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__Question__OjProblem.08e8...

1524 lines
1.8 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([[198,3,5,7,8,17,20],{"++UQ":
/*!***************************************************************!*\
!*** ./src/pages/Question/OjProblem/TestCasePanel/index.less ***!
\***************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},"+NIl":
/*!***************************************************!*\
!*** ./node_modules/codemirror/mode/stex/stex.js ***!
\***************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";e.defineMode("stex",(function(e,t){function n(e,t){e.cmdState.push(t)}function r(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function i(e,t,n){return function(){this.name=e,this.bracketNo=0,this.style=t,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 o={};function a(e,t){e.f=t}function s(e,t){var i;if(e.match(/^\\[a-zA-Z@]+/)){var s=e.current().slice(1);return n(t,i=new(i=o.hasOwnProperty(s)?o[s]:o.DEFAULT)),a(t,c),i.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return a(t,(function(e,t){return l(e,t,"\\]")})),"keyword";if(e.match("\\("))return a(t,(function(e,t){return l(e,t,"\\)")})),"keyword";if(e.match("$$"))return a(t,(function(e,t){return l(e,t,"$$")})),"keyword";if(e.match("$"))return a(t,(function(e,t){return l(e,t,"$")})),"keyword";var u=e.next();return"%"==u?(e.skipToEnd(),"comment"):"}"==u||"]"==u?(i=r(t))?(i.closeBracket(u),a(t,c),"bracket"):"error":"{"==u||"["==u?(n(t,i=new(i=o.DEFAULT)),"bracket"):/\d/.test(u)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(i=function(e){for(var t=e.cmdState,n=t.length-1;n>=0;n--){var r=t[n];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}(t)).name&&(i.argument=e.current()),i.styleIdentifier())}function l(e,t,n){if(e.eatSpace())return null;if(n&&e.match(n))return a(t,s),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=e.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(e.skipToEnd(),"comment"):"error"}function c(e,t){var n=e.peek();return"{"==n||"["==n?(r(t).openBracket(n),e.eat(n),a(t,s),"bracket"):/[ \t\r]/.test(n)?(e.eat(n),null):(a(t,s),function(e){var t=e.cmdState.pop();t&&t.closeBracket()}(t),s(e,t))}return o.importmodule=i("importmodule","tag",["string","builtin"]),o.documentclass=i("documentclass","tag",["","atom"]),o.usepackage=i("usepackage","tag",["atom"]),o.begin=i("begin","tag",["atom"]),o.end=i("end","tag",["atom"]),o.label=i("label","tag",["atom"]),o.ref=i("ref","tag",["atom"]),o.eqref=i("eqref","tag",["atom"]),o.cite=i("cite","tag",["atom"]),o.bibitem=i("bibitem","tag",["atom"]),o.Bibitem=i("Bibitem","tag",["atom"]),o.RBibitem=i("RBibitem","tag",["atom"]),o.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:t.inMathMode?function(e,t){return l(e,t)}:s}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)},blankLine:function(e){e.f=s,e.cmdState.length=0},lineComment:"%"}})),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}(n(/*! ../../lib/codemirror */"VrN/"))},"+QRC":
/*!*************************************************!*\
!*** ./node_modules/copy-to-clipboard/index.js ***!
\*************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";var r=n(/*! toggle-selection */"E9nw"),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,o,a,s,l,c,u=!1;t||(t={}),n=t.debug||!1;try{if(a=r(),s=document.createRange(),l=document.getSelection(),(c=document.createElement("span")).textContent=e,c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[t.format]||i.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(c),s.selectNodeContents(c),l.addRange(s),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(s):l.removeAllRanges()),c&&document.body.removeChild(c),a()}return u}},"07cG":
/*!***************************************************!*\
!*** ./src/components/Spinner/index.less?modules ***!
\***************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"0r65":
/*!******************************************!*\
!*** ./node_modules/webworkify/index.js ***!
\******************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){var n=arguments[3],r=arguments[4],i=arguments[5],o=JSON.stringify;e.exports=function(e,t){for(var a,s=Object.keys(i),l=0,c=s.length;l<c;l++){var u=s[l],h=i[u].exports;if(h===e||h&&h.default===e){a=u;break}}if(!a){a=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var d={};for(l=0,c=s.length;l<c;l++){d[u=s[l]]=u}r[a]=["function(require,module,exports){"+e+"(self); }",d]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[a]=a,r[f]=["function(require,module,exports){var f = require("+o(a)+");(f.default ? f.default : f)(self);}",p];var m={};!function e(t){for(var n in m[t]=!0,r[t][1]){var i=r[t][1][n];m[i]||e(i)}}(f);var g="("+n+")({"+Object.keys(m).map((function(e){return o(e)+":["+r[e][0]+","+o(r[e][1])+"]"})).join(",")+"},{},["+o(f)+"])",v=window.URL||window.webkitURL||window.mozURL||window.msURL,y=new Blob([g],{type:"text/javascript"});if(t&&t.bare)return y;var b=v.createObjectURL(y),_=new Worker(b);return _.objectURL=b,_}},"19Vz":
/*!**************************************************************!*\
!*** ./node_modules/codemirror/addon/display/placeholder.js ***!
\**************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=e.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(o,a,s){var l=s&&s!=e.Init;if(a&&!l)o.on("blur",r),o.on("change",i),o.on("swapDoc",i),e.on(o.getInputField(),"compositionupdate",o.state.placeholderCompose=function(){!function(e){setTimeout((function(){var r=!1,i=e.getInputField();"TEXTAREA"==i.nodeName?r=!i.value:1==e.lineCount()&&(r=!/[^\u200b]/.test(i.querySelector(".CodeMirror-line").textContent)),r?n(e):t(e)}),20)}(o)}),i(o);else if(!a&&l){o.off("blur",r),o.off("change",i),o.off("swapDoc",i),e.off(o.getInputField(),"compositionupdate",o.state.placeholderCompose),t(o);var c=o.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}a&&!o.hasFocus()&&r(o)}))}(n(/*! ../../lib/codemirror */"VrN/"))},"1FX+":
/*!******************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/index.less?modules ***!
\******************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___t3HuD",flex_space_between:"flex_space_between___3eY6W",flex_box_vertical_center:"flex_box_vertical_center___SMD2f",flex_box_center_end:"flex_box_center_end___1qy96",flex_box_column:"flex_box_column___1iEso",wrap:"wrap___3Vyua",head:"head___HUi2n",sort:"sort___1UPxB",btn:"btn___2b6SJ",listWarp:"listWarp___1pNnP",pagination:"pagination___3I0F3",fixedRight:"fixedRight___527Xj","oj-width-input":"oj-width-input___QQMFK"}},"1eCo":
/*!*************************************************!*\
!*** ./node_modules/codemirror/mode/xml/xml.js ***!
\*************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";var t={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};e.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function h(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(f("atom","]]>")):null:e.match("--")?n(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=e(t+1),r.tokenize(n,r);if(">"==i){if(1==t){r.tokenize=h;break}return r.tokenize=e(t-1),r.tokenize(n,r)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var n,r,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=h,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=h,t.state=v,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=d;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=h;break}n.next()}return e}}function p(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function g(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;m(e)}}function v(e,t,n){return"openTag"==e?(n.tagStart=t.column(),y):"closeTag"==e?b:v}function y(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",x):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",x(e,0,n)):(a="error",y)}function b(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",_):(a="tag error",E)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",_(e,0,n)):(a="error",E)}function _(e,t,n){return"endTag"!=e?(a="error",_):(m(n),v)}function E(e,t,n){return a="error",_(e,0,n)}function x(e,t,n){if("word"==e)return a="attribute",w;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?g(n,r):(g(n,r),n.context=new p(n,r,i==n.indented)),v}return a="error",x}function w(e,t,n){return"equals"==e?S:(l.allowMissing||(a="error"),x(e,0,n))}function S(e,t,n){return"string"==e?k:"word"==e&&l.allowUnquoted?(a="string",x):(a="error",x(e,0,n))}function k(e,t,n){return"string"==e?k:x(e,0,n)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:v,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=h)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;i;){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(o)for(;i;){var a=l.contextGrabbers[i.tagName];if(!a||!a.hasOwnProperty(o[2]))break;i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==S&&(e.state=x)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.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(e,t,n){"use strict";n.d(t,"d",(function(){return ae})),n.d(t,"b",(function(){return _e})),n.d(t,"c",(function(){return xe})),n.d(t,"a",(function(){return Se}));var r=n("VTBJ"),i=n("1OyB"),o=n("vuIU"),a=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"),m=n("2GS6"),g=n("Gytx"),v=n.n(g),y=n("TSYQ"),b=n.n(y),_=n("U8pU"),E=n("ODXe"),x=/iPhone/i,w=/iPod/i,S=/iPad/i,k=/\bAndroid(?:.+)Mobile\b/i,C=/Android/i,T=/\bAndroid(?:.+)SD4930UR\b/i,O=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,A=/Windows Phone/i,L=/\bWindows(?:.+)ARM\b/i,R=/BlackBerry/i,D=/BB10/i,I=/Opera Mini/i,M=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function P(e,t){return e.test(t)}function j(e){var t=e||("undefined"!=typeof navigator?navigator.userAgent:""),n=t.split("[FBAN");if(void 0!==n[1]){var r=n;t=Object(E.a)(r,1)[0]}if(void 0!==(n=t.split("Twitter"))[1]){var i=n;t=Object(E.a)(i,1)[0]}var o={apple:{phone:P(x,t)&&!P(A,t),ipod:P(w,t),tablet:!P(x,t)&&P(S,t)&&!P(A,t),device:(P(x,t)||P(w,t)||P(S,t))&&!P(A,t)},amazon:{phone:P(T,t),tablet:!P(T,t)&&P(O,t),device:P(T,t)||P(O,t)},android:{phone:!P(A,t)&&P(T,t)||!P(A,t)&&P(k,t),tablet:!P(A,t)&&!P(T,t)&&!P(k,t)&&(P(O,t)||P(C,t)),device:!P(A,t)&&(P(T,t)||P(O,t)||P(k,t)||P(C,t))||P(/\bokhttp\b/i,t)},windows:{phone:P(A,t),tablet:P(L,t),device:P(A,t)||P(L,t)},other:{blackberry:P(R,t),blackberry10:P(D,t),opera:P(I,t),firefox:P(N,t),chrome:P(M,t),device:P(R,t)||P(D,t)||P(I,t)||P(N,t)||P(M,t)},any:null,phone:null,tablet:null};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}var B=Object(r.a)(Object(r.a)({},j()),{},{isMobile:j});function F(){}function U(e,t,n){var r=t||"";return e.key||"".concat(r,"item_").concat(n)}function G(e){return"".concat(e,"-menu-")}function z(e,t){var n=-1;c.Children.forEach(e,(function(e){n+=1,e&&e.type&&e.type.isMenuItemGroup?c.Children.forEach(e.props.children,(function(e){t(e,n+=1)})):t(e,n)}))}var H=["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"],V=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e&&"function"==typeof e.getBoundingClientRect&&e.getBoundingClientRect().width;if(n){if(t){var r=getComputedStyle(e),i=r.marginLeft,o=r.marginRight;n+=+i.replace("px","")+ +o.replace("px","")}n=+n.toFixed(6)}return n||0},W=function(e,t,n){e&&"object"===Object(_.a)(e.style)&&(e.style[t]=n)},K=n("KQm4"),q=n("Ff2n"),X=n("i8i4"),Y=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]}},ee={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]}},te=0,ne={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},re=function(e,t,n){var i=G(t),o=e.getState();e.setState({defaultActiveFirst:Object(r.a)(Object(r.a)({},o.defaultActiveFirst),{},Object(f.a)({},i,n))})},ie=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var o;Object(i.a)(this,n),(o=t.call(this,e)).onDestroy=function(e){o.props.onDestroy(e)},o.onKeyDown=function(e){var t=e.keyCode,n=o.menuInstance,r=o.props,i=r.isOpen,a=r.store;if(t===p.a.ENTER)return o.onTitleClick(e),re(a,o.props.eventKey,!0),!0;if(t===p.a.RIGHT)return i?n.onKeyDown(e):(o.triggerOpenChange(!0),re(a,o.props.eventKey,!0)),!0;if(t===p.a.LEFT){var s;if(!i)return;return(s=n.onKeyDown(e))||(o.triggerOpenChange(!1),s=!0),s}return!i||t!==p.a.UP&&t!==p.a.DOWN?void 0:n.onKeyDown(e)},o.onOpenChange=function(e){o.props.onOpenChange(e)},o.onPopupVisibleChange=function(e){o.triggerOpenChange(e,e?"mouseenter":"mouseleave")},o.onMouseEnter=function(e){var t=o.props,n=t.eventKey,r=t.onMouseEnter,i=t.store;re(i,o.props.eventKey,!1),r({key:n,domEvent:e})},o.onMouseLeave=function(e){var t=o.props,n=t.parentMenu,r=t.eventKey,i=t.onMouseLeave;n.subMenuInstance=Object(a.a)(o),i({key:r,domEvent:e})},o.onTitleMouseEnter=function(e){var t=o.props,n=t.eventKey,r=t.onItemHover,i=t.onTitleMouseEnter;r({key:n,hover:!0}),i({key:n,domEvent:e})},o.onTitleMouseLeave=function(e){var t=o.props,n=t.parentMenu,r=t.eventKey,i=t.onItemHover,s=t.onTitleMouseLeave;n.subMenuInstance=Object(a.a)(o),i({key:r,hover:!1}),s({key:r,domEvent:e})},o.onTitleClick=function(e){var t=Object(a.a)(o).props;t.onTitleClick({key:t.eventKey,domEvent:e}),"hover"!==t.triggerSubMenuAction&&(o.triggerOpenChange(!t.isOpen,"click"),re(t.store,o.props.eventKey,!1))},o.onSubMenuClick=function(e){"function"==typeof o.props.onClick&&o.props.onClick(o.addKeyPath(e))},o.onSelect=function(e){o.props.onSelect(e)},o.onDeselect=function(e){o.props.onDeselect(e)},o.getPrefixCls=function(){return"".concat(o.props.rootPrefixCls,"-submenu")},o.getActiveClassName=function(){return"".concat(o.getPrefixCls(),"-active")},o.getDisabledClassName=function(){return"".concat(o.getPrefixCls(),"-disabled")},o.getSelectedClassName=function(){return"".concat(o.getPrefixCls(),"-selected")},o.getOpenClassName=function(){return"".concat(o.props.rootPrefixCls,"-submenu-open")},o.saveMenuInstance=function(e){o.menuInstance=e},o.addKeyPath=function(e){return Object(r.a)(Object(r.a)({},e),{},{keyPath:(e.keyPath||[]).concat(o.props.eventKey)})},o.triggerOpenChange=function(e,t){var n=o.props.eventKey,r=function(){o.onOpenChange({key:n,item:Object(a.a)(o),trigger:t,open:e})};"mouseenter"===t?o.mouseenterTimeout=setTimeout((function(){r()}),0):r()},o.isChildrenSelected=function(){var e={find:!1};return function e(t,n,r){t&&!r.find&&c.Children.forEach(t,(function(t){if(t){var i=t.type;if(!i||!(i.isSubMenu||i.isMenuItem||i.isMenuItemGroup))return;-1!==n.indexOf(t.key)?r.find=!0:t.props.children&&e(t.props.children,n,r)}}))}(o.props.children,o.props.selectedKeys,e),e.find},o.isOpen=function(){return-1!==o.props.openKeys.indexOf(o.props.eventKey)},o.adjustWidth=function(){if(o.subMenuTitle&&o.menuInstance){var e=X.findDOMNode(o.menuInstance);e.offsetWidth>=o.subMenuTitle.offsetWidth||(e.style.minWidth="".concat(o.subMenuTitle.offsetWidth,"px"))}},o.saveSubMenuTitle=function(e){o.subMenuTitle=e},o.getBaseProps=function(){var e=Object(a.a)(o).props;return{mode:"horizontal"===e.mode?"vertical":e.mode,visible:o.props.isOpen,level:e.level+1,inlineIndent:e.inlineIndent,focusable:!1,onClick:o.onSubMenuClick,onSelect:o.onSelect,onDeselect:o.onDeselect,onDestroy:o.onDestroy,selectedKeys:e.selectedKeys,eventKey:"".concat(e.eventKey,"-menu-"),openKeys:e.openKeys,motion:e.motion,onOpenChange:o.onOpenChange,subMenuOpenDelay:e.subMenuOpenDelay,parentMenu:Object(a.a)(o),subMenuCloseDelay:e.subMenuCloseDelay,forceSubMenuRender:e.forceSubMenuRender,triggerSubMenuAction:e.triggerSubMenuAction,builtinPlacements:e.builtinPlacements,defaultActiveFirst:e.store.getState().defaultActiveFirst[G(e.eventKey)],multiple:e.multiple,prefixCls:e.rootPrefixCls,id:o.internalMenuId,manualRef:o.saveMenuInstance,itemIcon:e.itemIcon,expandIcon:e.expandIcon,direction:e.direction}},o.getMotion=function(e,t){var n=Object(a.a)(o).haveRendered,i=o.props,s=i.motion,l=i.rootPrefixCls;return Object(r.a)(Object(r.a)({},s),{},{leavedClassName:"".concat(l,"-hidden"),removeOnLeave:!1,motionAppear:n||!t||"inline"!==e})};var s=e.store,l=e.eventKey,u=s.getState().defaultActiveFirst;o.isRootMenu=!1;var h=!1;return u&&(h=u[l]),re(s,l,h),o}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e=this,t=this.props,n=t.mode,r=t.parentMenu,i=t.manualRef;i&&i(this),"horizontal"===n&&r.isRootMenu&&this.props.isOpen&&(this.minWidthTimeout=setTimeout((function(){return e.adjustWidth()}),0))}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.onDestroy,n=e.eventKey;t&&t(n),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(e){var t=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 o=r.className,a=r.style,s=b()("".concat(n.prefixCls,"-sub"),o,Object(f.a)({},"".concat(n.prefixCls,"-rtl"),"rtl"===i));return c.createElement(pe,Object.assign({},n,{id:t.internalMenuId,className:s,style:a}),e)}))}},{key:"render",value:function(){var e,t=Object(r.a)({},this.props),n=t.isOpen,i=this.getPrefixCls(),o="inline"===t.mode,a=b()(i,"".concat(i,"-").concat(t.mode),(e={},Object(f.a)(e,t.className,!!t.className),Object(f.a)(e,this.getOpenClassName(),n),Object(f.a)(e,this.getActiveClassName(),t.active||n&&!o),Object(f.a)(e,this.getDisabledClassName(),t.disabled),Object(f.a)(e,this.getSelectedClassName(),this.isChildrenSelected()),e));this.internalMenuId||(t.eventKey?this.internalMenuId="".concat(t.eventKey,"$Menu"):(te+=1,this.internalMenuId="$__$".concat(te,"$Menu")));var s={},l={},u={};t.disabled||(s={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},l={onClick:this.onTitleClick},u={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var h={},d=t.direction;o&&("rtl"===d?h.paddingRight=t.inlineIndent*t.level:h.paddingLeft=t.inlineIndent*t.level);var p={};this.props.isOpen&&(p={"aria-owns":this.internalMenuId});var m=null;"horizontal"!==t.mode&&(m=this.props.expandIcon,"function"==typeof this.props.expandIcon&&(m=c.createElement(this.props.expandIcon,Object(r.a)({},this.props))));var g=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 t.title?t.title:void 0}),t.title,m||c.createElement("i",{className:"".concat(i,"-arrow")})),v=this.renderChildren(t.children),y=t.parentMenu.isRootMenu?t.parentMenu.props.getPopupContainer:function(e){return e.parentNode},_=ne[t.mode],E=t.popupOffset?{offset:t.popupOffset}:{},x="inline"===t.mode?"":t.popupClassName;x+="rtl"===d?" ".concat(i,"-rtl"):"";var w=t.disabled,S=t.triggerSubMenuAction,k=t.subMenuOpenDelay,C=t.forceSubMenuRender,T=t.subMenuCloseDelay,O=t.builtinPlacements;H.forEach((function(e){return delete t[e]})),delete t.onClick;var A="rtl"===d?Object.assign({},ee,O):Object.assign({},Q,O);return delete t.direction,c.createElement("li",Object.assign({},t,s,{className:a,role:"menuitem"}),o&&g,o&&v,!o&&c.createElement($.a,{prefixCls:i,popupClassName:b()("".concat(i,"-popup"),x),getPopupContainer:y,builtinPlacements:A,popupPlacement:_,popupVisible:n,popupAlign:E,popup:v,action:w?[]:[S],mouseEnterDelay:k,mouseLeaveDelay:T,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:C},g))}}]),n}(c.Component);ie.defaultProps={onMouseEnter:F,onMouseLeave:F,onTitleMouseEnter:F,onTitleMouseLeave:F,onTitleClick:F,manualRef:F,mode:"vertical",title:""};var oe=Object(u.b)((function(e,t){var n=e.openKeys,r=e.activeKey,i=e.selectedKeys,o=t.eventKey,a=t.subMenuKey;return{isOpen:n.indexOf(o)>-1,active:r[a]===o,selectedKeys:i}}))(ie);oe.isSubMenu=!0;var ae=oe,se=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments)).resizeObserver=null,e.mutationObserver=null,e.originalTotalWidth=0,e.overflowedItems=[],e.menuItemSizes=[],e.cancelFrameId=null,e.state={lastVisibleIndex:void 0},e.getMenuItemNodes=function(){var t=e.props.prefixCls,n=X.findDOMNode(Object(a.a)(e));return n?[].slice.call(n.children).filter((function(e){return e.className.split(" ").indexOf("".concat(t,"-overflowed-submenu"))<0})):[]},e.getOverflowedSubMenuItem=function(t,n,i){var o=e.props,a=o.overflowedIndicator,s=o.level,l=o.mode,u=o.prefixCls,h=o.theme;if(1!==s||"horizontal"!==l)return null;var d=e.props.children[0].props,f=(d.children,d.title,d.style),p=Object(q.a)(d,["children","title","style"]),m=Object(r.a)({},f),g="".concat(t,"-overflowed-indicator"),v="".concat(t,"-overflowed-indicator");0===n.length&&!0!==i?m=Object(r.a)(Object(r.a)({},m),{},{display:"none"}):i&&(m=Object(r.a)(Object(r.a)({},m),{},{visibility:"hidden",position:"absolute"}),g="".concat(g,"-placeholder"),v="".concat(v,"-placeholder"));var y=h?"".concat(u,"-").concat(h):"",b={};return H.forEach((function(e){void 0!==p[e]&&(b[e]=p[e])})),c.createElement(ae,Object.assign({title:a,className:"".concat(u,"-overflowed-submenu"),popupClassName:y},b,{key:g,eventKey:v,disabled:!1,style:m}),n)},e.setChildrenWidthAndResize=function(){if("horizontal"===e.props.mode){var t=X.findDOMNode(Object(a.a)(e));if(t){var n=t.children;if(n&&0!==n.length){var r=t.children[n.length-1];W(r,"display","inline-block");var i=e.getMenuItemNodes(),o=i.filter((function(e){return e.className.split(" ").indexOf("menuitem-overflowed")>=0}));o.forEach((function(e){W(e,"display","inline-block")})),e.menuItemSizes=i.map((function(e){return V(e,!0)})),o.forEach((function(e){W(e,"display","none")})),e.overflowedIndicatorWidth=V(t.children[t.children.length-1],!0),e.originalTotalWidth=e.menuItemSizes.reduce((function(e,t){return e+t}),0),e.handleResize(),W(r,"display","none")}}}},e.handleResize=function(){if("horizontal"===e.props.mode){var t=X.findDOMNode(Object(a.a)(e));if(t){var n=V(t);e.overflowedItems=[];var r,i=0;e.originalTotalWidth>n+.5&&(r=-1,e.menuItemSizes.forEach((function(t){(i+=t)+e.overflowedIndicatorWidth<=n&&(r+=1)}))),e.setState({lastVisibleIndex:r})}}},e}return Object(o.a)(n,[{key:"componentDidMount",value:function(){var e=this;if(this.setChildrenWidthAndResize(),1===this.props.level&&"horizontal"===this.props.mode){var t=X.findDOMNode(this);if(!t)return;this.resizeObserver=new Y.default((function(t){t.forEach((function(){var t=e.cancelFrameId;cancelAnimationFrame(t),e.cancelFrameId=requestAnimationFrame(e.setChildrenWidthAndResize)}))})),[].slice.call(t.children).concat(t).forEach((function(t){e.resizeObserver.observe(t)})),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((function(){e.resizeObserver.disconnect(),[].slice.call(t.children).concat(t).forEach((function(t){e.resizeObserver.observe(t)})),e.setChildrenWidthAndResize()})),this.mutationObserver.observe(t,{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(e){var t=this,n=this.state.lastVisibleIndex;return(e||[]).reduce((function(r,i,o){var a=i;if("horizontal"===t.props.mode){var s=t.getOverflowedSubMenuItem(i.props.eventKey,[]);void 0!==n&&-1!==t.props.className.indexOf("".concat(t.props.prefixCls,"-root"))&&(o>n&&(a=c.cloneElement(i,{style:{display:"none"},eventKey:"".concat(i.props.eventKey,"-hidden"),className:"".concat("menuitem-overflowed")})),o===n+1&&(t.overflowedItems=e.slice(n+1).map((function(e){return c.cloneElement(e,{key:e.props.eventKey,mode:"vertical-left"})})),s=t.getOverflowedSubMenuItem(i.props.eventKey,t.overflowedItems)));var l=[].concat(Object(K.a)(r),[s,a]);return o===e.length-1&&l.push(t.getOverflowedSubMenuItem(i.props.eventKey,[],!0)),l}return[].concat(Object(K.a)(r),[a])}),[])}},{key:"render",value:function(){var e=this.props,t=(e.visible,e.prefixCls,e.overflowedIndicator,e.mode,e.level,e.tag),n=e.children,r=(e.theme,Object(q.a)(e,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"])),i=t;return c.createElement(i,Object.assign({},r),this.renderChildren(n))}}]),n}(c.Component);se.defaultProps={tag:"div",className:""};var le=se;function ce(e,t,n){var i=e.getState();e.setState({activeKey:Object(r.a)(Object(r.a)({},i.activeKey),{},Object(f.a)({},t,n))})}function ue(e){return e.eventKey||"0-menu-"}function he(e,t){var n,r=t,i=e.children,o=e.eventKey;if(r&&(z(i,(function(e,t){e&&e.props&&!e.props.disabled&&r===U(e,o,t)&&(n=!0)})),n))return r;return r=null,e.defaultActiveFirst?(z(i,(function(e,t){r||!e||e.props.disabled||(r=U(e,o,t))})),r):r}function de(e){if(e){var t=this.instanceArray.indexOf(e);-1!==t?this.instanceArray[t]=e:this.instanceArray.push(e)}}var fe=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var o;return Object(i.a)(this,n),(o=t.call(this,e)).onKeyDown=function(e,t){var n,r=e.keyCode;if(o.getFlatInstanceArray().forEach((function(t){t&&t.props.active&&t.onKeyDown&&(n=t.onKeyDown(e))})),n)return 1;var i=null;return r!==p.a.UP&&r!==p.a.DOWN||(i=o.step(r===p.a.UP?-1:1)),i?(e.preventDefault(),ce(o.props.store,ue(o.props),i.props.eventKey),"function"==typeof t&&t(i),1):void 0},o.onItemHover=function(e){var t=e.key,n=e.hover;ce(o.props.store,ue(o.props),n?t:null)},o.onDeselect=function(e){o.props.onDeselect(e)},o.onSelect=function(e){o.props.onSelect(e)},o.onClick=function(e){o.props.onClick(e)},o.onOpenChange=function(e){o.props.onOpenChange(e)},o.onDestroy=function(e){o.props.onDestroy(e)},o.getFlatInstanceArray=function(){return o.instanceArray},o.step=function(e){var t=o.getFlatInstanceArray(),n=o.props.store.getState().activeKey[ue(o.props)],r=t.length;if(!r)return null;e<0&&(t=t.concat().reverse());var i=-1;if(t.every((function(e,t){return!e||e.props.eventKey!==n||(i=t,!1)})),o.props.defaultActiveFirst||-1===i||(a=t.slice(i,r-1)).length&&!a.every((function(e){return!!e.props.disabled}))){var a,s=(i+1)%r,l=s;do{var c=t[l];if(c&&!c.props.disabled)return c;l=(l+1)%r}while(l!==s);return null}},o.renderCommonMenuItem=function(e,t,n){var i=o.props.store.getState(),s=Object(a.a)(o).props,l=U(e,s.eventKey,t),u=e.props;if(!u||"string"==typeof e.type)return e;var h=l===i.activeKey,d=Object(r.a)(Object(r.a)({mode:u.mode||s.mode,level:s.level,inlineIndent:s.inlineIndent,renderMenuItem:o.renderMenuItem,rootPrefixCls:s.prefixCls,index:t,parentMenu:s.parentMenu,manualRef:u.disabled?void 0:Object(m.a)(e.ref,de.bind(Object(a.a)(o))),eventKey:l,active:!u.disabled&&h,multiple:s.multiple,onClick:function(e){(u.onClick||F)(e),o.onClick(e)},onItemHover:o.onItemHover,motion:s.motion,subMenuOpenDelay:s.subMenuOpenDelay,subMenuCloseDelay:s.subMenuCloseDelay,forceSubMenuRender:s.forceSubMenuRender,onOpenChange:o.onOpenChange,onDeselect:o.onDeselect,onSelect:o.onSelect,builtinPlacements:s.builtinPlacements,itemIcon:u.itemIcon||o.props.itemIcon,expandIcon:u.expandIcon||o.props.expandIcon},n),{},{direction:s.direction});return("inline"===s.mode||B.any)&&(d.triggerSubMenuAction="click"),c.cloneElement(e,d)},o.renderMenuItem=function(e,t,n){if(!e)return null;var r=o.props.store.getState(),i={openKeys:r.openKeys,selectedKeys:r.selectedKeys,triggerSubMenuAction:o.props.triggerSubMenuAction,subMenuKey:n};return o.renderCommonMenuItem(e,t,i)},e.store.setState({activeKey:Object(r.a)(Object(r.a)({},e.store.getState().activeKey),{},Object(f.a)({},e.eventKey,he(e,e.activeKey)))}),o.instanceArray=[],o}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(e){return this.props.visible||e.visible||this.props.className!==e.className||!v()(this.props.style,e.style)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n="activeKey"in t?t.activeKey:t.store.getState().activeKey[ue(t)],r=he(t,n);if(r!==n)ce(t.store,ue(t),r);else if("activeKey"in e){r!==he(e,e.activeKey)&&ce(t.store,ue(t),r)}}},{key:"render",value:function(){var e=this,t=Object(d.a)({},this.props);this.instanceArray=[];var n={className:b()(t.prefixCls,t.className,"".concat(t.prefixCls,"-").concat(t.mode)),role:t.role||"menu"};t.id&&(n.id=t.id),t.focusable&&(n.tabIndex=0,n.onKeyDown=this.onKeyDown);var r=t.prefixCls,i=t.eventKey,o=t.visible,a=t.level,s=t.mode,l=t.overflowedIndicator,u=t.theme;return H.forEach((function(e){return delete t[e]})),delete t.onClick,c.createElement(le,Object.assign({},t,{prefixCls:r,mode:s,tag:"ul",level:a,theme:u,visible:o,overflowedIndicator:l},n),c.Children.map(t.children,(function(t,n){return e.renderMenuItem(t,n,i||"0-menu-")})))}}]),n}(c.Component);fe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:F};var pe=Object(u.b)()(fe),me=n("Kwbf");function ge(e,t,n){var r=e.prefixCls,i=e.motion,o=e.defaultMotions,a=void 0===o?{}:o,s=e.openAnimation,l=e.openTransitionName,c=t.switchingModeFromInline;if(i)return i;if("object"===Object(_.a)(s)&&s)Object(me.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=a[n];return u||(c?null:a.other)}var ve=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(e){var o;Object(i.a)(this,n),(o=t.call(this,e)).inlineOpenKeys=[],o.onSelect=function(e){var t=Object(a.a)(o).props;if(t.selectable){var n=o.store.getState().selectedKeys,i=e.key;n=t.multiple?n.concat([i]):[i],"selectedKeys"in t||o.store.setState({selectedKeys:n}),t.onSelect(Object(r.a)(Object(r.a)({},e),{},{selectedKeys:n}))}},o.onClick=function(e){var t=o.getRealMenuMode(),n=Object(a.a)(o),r=n.store,i=n.props.onOpenChange;"inline"===t||"openKeys"in o.props||(r.setState({openKeys:[]}),i([])),o.props.onClick(e)},o.onKeyDown=function(e,t){o.innerMenu.getWrappedInstance().onKeyDown(e,t)},o.onOpenChange=function(e){var t=Object(a.a)(o).props,n=o.store.getState().openKeys.concat(),r=!1,i=function(e){var t=!1;if(e.open)(t=-1===n.indexOf(e.key))&&n.push(e.key);else{var i=n.indexOf(e.key);(t=-1!==i)&&n.splice(i,1)}r=r||t};Array.isArray(e)?e.forEach(i):i(e),r&&("openKeys"in o.props||o.store.setState({openKeys:n}),t.onOpenChange(n))},o.onDeselect=function(e){var t=Object(a.a)(o).props;if(t.selectable){var n=o.store.getState().selectedKeys.concat(),i=e.key,s=n.indexOf(i);-1!==s&&n.splice(s,1),"selectedKeys"in t||o.store.setState({selectedKeys:n}),t.onDeselect(Object(r.a)(Object(r.a)({},e),{},{selectedKeys:n}))}},o.onMouseEnter=function(e){o.restoreModeVerticalFromInline();var t=o.props.onMouseEnter;t&&t(e)},o.onTransitionEnd=function(e){var t="width"===e.propertyName&&e.target===e.currentTarget,n=e.target.className,r="[object SVGAnimatedString]"===Object.prototype.toString.call(n)?n.animVal:n,i="font-size"===e.propertyName&&r.indexOf("anticon")>=0;(t||i)&&o.restoreModeVerticalFromInline()},o.setInnerMenu=function(e){o.innerMenu=e},o.isRootMenu=!0;var s=e.defaultSelectedKeys,l=e.defaultOpenKeys;return"selectedKeys"in e&&(s=e.selectedKeys||[]),"openKeys"in e&&(l=e.openKeys||[]),o.store=Object(u.c)({selectedKeys:s,openKeys:l,activeKey:{"0-menu-":he(e,e.activeKey)}}),o.state={switchingModeFromInline:!1},o}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(e){this.updateOpentKeysWhenSwitchMode(e),this.updateMiniStore();var t=this.props,n=t.siderCollapsed,r=t.inlineCollapsed,i=t.onOpenChange;(!e.inlineCollapsed&&r||!e.siderCollapsed&&n)&&i([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(e){var t=this.props,n=this.store,r=this.inlineOpenKeys,i=n.getState(),o={};"inline"===e.mode&&"inline"!==t.mode&&this.setState({switchingModeFromInline:!0}),"openKeys"in t||((t.inlineCollapsed&&!e.inlineCollapsed||t.siderCollapsed&&!e.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=i.openKeys.concat(),o.openKeys=[]),(!t.inlineCollapsed&&e.inlineCollapsed||!t.siderCollapsed&&e.siderCollapsed)&&(o.openKeys=r,this.inlineOpenKeys=[])),Object.keys(o).length&&n.setState(o)}},{key:"updateMenuDisplay",value:function(){var e=this.props.collapsedWidth,t=this.store,n=this.prevOpenKeys;this.getInlineCollapsed()&&(0===e||"0"===e||"0px"===e)?(this.prevOpenKeys=t.getState().openKeys.concat(),this.store.setState({openKeys:[]})):n&&(this.store.setState({openKeys:n}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var e=this.props.mode,t=this.state.switchingModeFromInline,n=this.getInlineCollapsed();return t&&n?"inline":n?"vertical":e}},{key:"getInlineCollapsed",value:function(){var e=this.props,t=e.inlineCollapsed,n=e.siderCollapsed;return void 0!==n?n:t}},{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 e=Object(r.a)({},Object(h.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),t=this.getRealMenuMode();return e.className+=" ".concat(e.prefixCls,"-root"),"rtl"===e.direction&&(e.className+=" ".concat(e.prefixCls,"-rtl")),delete(e=Object(r.a)(Object(r.a)({},e),{},{mode:t,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ge(this.props,this.state,t)})).openAnimation,delete e.openTransitionName,c.createElement(u.a,{store:this.store},c.createElement(pe,Object.assign({},e,{ref:this.setInnerMenu}),this.props.children))}}]),n}(c.Component);ve.defaultProps={selectable:!0,onClick:F,onSelect:F,onOpenChange:F,onDeselect:F,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:c.createElement("span",null,"···")};var ye=ve,be=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments)).onKeyDown=function(t){if(t.keyCode===p.a.ENTER)return e.onClick(t),!0},e.onMouseLeave=function(t){var n=e.props,r=n.eventKey,i=n.onItemHover,o=n.onMouseLeave;i({key:r,hover:!1}),o({key:r,domEvent:t})},e.onMouseEnter=function(t){var n=e.props,r=n.eventKey,i=n.onItemHover,o=n.onMouseEnter;i({key:r,hover:!0}),o({key:r,domEvent:t})},e.onClick=function(t){var n=e.props,r=n.eventKey,i=n.multiple,o=n.onClick,s=n.onSelect,l=n.onDeselect,c=n.isSelected,u={key:r,keyPath:[r],item:Object(a.a)(e),domEvent:t};o(u),i?c?l(u):s(u):c||s(u)},e.saveNode=function(t){e.node=t},e}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var e=this.props;e.onDestroy&&e.onDestroy(e.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 e,t=Object(r.a)({},this.props),n=b()(this.getPrefixCls(),t.className,(e={},Object(f.a)(e,this.getActiveClassName(),!t.disabled&&t.active),Object(f.a)(e,this.getSelectedClassName(),t.isSelected),Object(f.a)(e,this.getDisabledClassName(),t.disabled),e)),i=Object(r.a)(Object(r.a)({},t.attribute),{},{title:"string"==typeof t.title?t.title:void 0,className:n,role:t.role||"menuitem","aria-disabled":t.disabled});"option"===t.role?i=Object(r.a)(Object(r.a)({},i),{},{role:"option","aria-selected":t.isSelected}):null!==t.role&&"none"!==t.role||(i.role="none");var o={onClick:t.disabled?null:this.onClick,onMouseLeave:t.disabled?null:this.onMouseLeave,onMouseEnter:t.disabled?null:this.onMouseEnter},a=Object(r.a)({},t.style);"inline"===t.mode&&("rtl"===t.direction?a.paddingRight=t.inlineIndent*t.level:a.paddingLeft=t.inlineIndent*t.level),H.forEach((function(e){return delete t[e]})),delete t.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)(t,["onClick","onMouseEnter","onMouseLeave","onSelect"]),i,o,{style:a,ref:this.saveNode}),t.children,s)}}]),n}(c.Component);be.isMenuItem=!0,be.defaultProps={onSelect:F,onMouseEnter:F,onMouseLeave:F,manualRef:F};var _e=Object(u.b)((function(e,t){var n=e.activeKey,r=e.selectedKeys,i=t.eventKey;return{active:n[t.subMenuKey]===i,isSelected:-1!==r.indexOf(i)}}))(be),Ee=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments)).renderInnerMenuItem=function(t){var n=e.props;return(0,n.renderMenuItem)(t,n.index,e.props.subMenuKey)},e}return Object(o.a)(n,[{key:"render",value:function(){var e=Object(d.a)({},this.props),t=e.className,n=void 0===t?"":t,r=e.rootPrefixCls,i="".concat(r,"-item-group-title"),o="".concat(r,"-item-group-list"),a=e.title,s=e.children;return H.forEach((function(t){return delete e[t]})),delete e.onClick,delete e.direction,c.createElement("li",Object.assign({},e,{className:"".concat(n," ").concat(r,"-item-group")}),c.createElement("div",{className:i,title:"string"==typeof a?a:void 0},a),c.createElement("ul",{className:o},c.Children.map(s,this.renderInnerMenuItem)))}}]),n}(c.Component);Ee.isMenuItemGroup=!0,Ee.defaultProps={disabled:!0};var xe=Ee,we=function(e){var t=e.className,n=e.rootPrefixCls,r=e.style;return c.createElement("li",{className:"".concat(t," ").concat(n,"-item-divider"),style:r})};we.defaultProps={disabled:!0,className:"",style:{}};var Se=we;t.e=ye},"3tLw":
/*!*********************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/img/a.svg ***!
\*********************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/a.39070d50.svg"},"4xil":
/*!******************************************************!*\
!*** ./src/components/Video/Play/index.less?modules ***!
\******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={watermark:"watermark___2DVjg",videovideo:"videovideo___3jScv",animate__loop:"animate__loop___36IZ1",upDown:"upDown___3FGkz",container:"container___GV_Ds","video-container":"video-container___35tqx","video-controls":"video-controls___u99fM",hide:"hide___2GDit","video-progress":"video-progress___2LKQJ",seek:"seek___3b-US","seek-tooltip":"seek-tooltip___bZ9sZ","bottom-controls":"bottom-controls___74sQw","left-controls":"left-controls___2kBb3","volume-controls":"volume-controls___QLaWH","fullscreen-button":"fullscreen-button___2nHzc","pip-button":"pip-button___18qQG","playback-animation":"playback-animation___gCL6X",volume:"volume___10eUe",hidden:"hidden___2JBJW"}},"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(e,t,n){"use strict";n.d(t,"a",(function(){return g})),n.d(t,"b",(function(){return b}));var r=n(/*! react-router */"Ty5D"),i=n(/*! @babel/runtime/helpers/esm/inheritsLoose */"dI71"),o=n(/*! react */"q1tI"),a=n.n(o),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");a.a.Component;a.a.Component;var h=function(e,t){return"function"==typeof e?e(t):e},d=function(e,t){return"string"==typeof e?Object(s.c)(e,null,null,t):e},f=function(e){return e},p=a.a.forwardRef;void 0===p&&(p=f);var m=p((function(e,t){var n=e.innerRef,r=e.navigate,i=e.onClick,o=Object(c.a)(e,["innerRef","navigate","onClick"]),s=o.target,u=Object(l.a)({},o,{onClick:function(e){try{i&&i(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return u.ref=f!==p&&t||n,a.a.createElement("a",u)}));var g=p((function(e,t){var n=e.component,i=void 0===n?m:n,o=e.replace,s=e.to,g=e.innerRef,v=Object(c.a)(e,["component","replace","to","innerRef"]);return a.a.createElement(r.e.Consumer,null,(function(e){e||Object(u.a)(!1);var n=e.history,r=d(h(s,e.location),e.location),c=r?n.createHref(r):"",m=Object(l.a)({},v,{href:c,navigate:function(){var t=h(s,e.location);(o?n.replace:n.push)(t)}});return f!==p?m.ref=t||g:m.innerRef=g,a.a.createElement(i,m)}))})),v=function(e){return e},y=a.a.forwardRef;void 0===y&&(y=v);var b=y((function(e,t){var n=e["aria-current"],i=void 0===n?"page":n,o=e.activeClassName,s=void 0===o?"active":o,f=e.activeStyle,p=e.className,m=e.exact,b=e.isActive,_=e.location,E=e.sensitive,x=e.strict,w=e.style,S=e.to,k=e.innerRef,C=Object(c.a)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return a.a.createElement(r.e.Consumer,null,(function(e){e||Object(u.a)(!1);var n=_||e.location,o=d(h(S,n),n),c=o.pathname,T=c&&c.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),O=T?Object(r.f)(n.pathname,{path:T,exact:m,sensitive:E,strict:x}):null,A=!!(b?b(O,n):O),L=A?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(p,s):p,R=A?Object(l.a)({},w,{},f):w,D=Object(l.a)({"aria-current":A&&i||null,className:L,style:R,to:o},C);return v!==y?D.ref=t||k:D.innerRef=k,a.a.createElement(g,D)}))}))},"5nXd":
/*!************************************************!*\
!*** ./node_modules/store/src/store-engine.js ***!
\************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r=n(/*! ./util */"MFOe"),i=r.slice,o=r.pluck,a=r.each,s=r.bind,l=r.create,c=r.isList,u=r.isFunction,h=r.isObject;e.exports={createStore:f};var d={version:"2.0.12",enabled:!1,get:function(e,t){var n=this.storage.read(this._namespacePrefix+e);return this._deserialize(n,t)},set:function(e,t){return void 0===t?this.remove(e):(this.storage.write(this._namespacePrefix+e,this._serialize(t)),t)},remove:function(e){this.storage.remove(this._namespacePrefix+e)},each:function(e){var t=this;this.storage.each((function(n,r){e.call(t,t._deserialize(n),(r||"").replace(t._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(e){return this._namespacePrefix=="__storejs_"+e+"_"},createStore:function(){return f.apply(this,arguments)},addPlugin:function(e){this._addPlugin(e)},namespace:function(e){return f(this.storage,this.plugins,e)}};function f(e,t,n){n||(n=""),e&&!c(e)&&(e=[e]),t&&!c(t)&&(t=[t]);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(e){try{var t="__storejs__test__";e.write(t,t);var n=e.read(t)===t;return e.remove(t),n}catch(e){return!1}},_assignPluginFnProp:function(e,t){var n=this[t];this[t]=function(){var t=i(arguments,0),r=this;function o(){if(n)return a(arguments,(function(e,n){t[n]=e})),n.apply(r,t)}var s=[o].concat(t);return e.apply(r,s)}},_serialize:function(e){return JSON.stringify(e)},_deserialize:function(e,t){if(!e)return t;var n="";try{n=JSON.parse(e)}catch(t){n=e}return void 0!==n?n:t},_addStorage:function(e){this.enabled||this._testStorage(e)&&(this.storage=e,this.enabled=!0)},_addPlugin:function(e){var t=this;if(c(e))a(e,(function(e){t._addPlugin(e)}));else if(!o(this.plugins,(function(t){return e===t}))){if(this.plugins.push(e),!u(e))throw new Error("Plugins must be function values that return objects");var n=e.call(this);if(!h(n))throw new Error("Plugins must return an object of function properties");a(n,(function(n,r){if(!u(n))throw new Error("Bad plugin property: "+r+" from plugin "+e.name+". Plugins should only return functions.");t._assignPluginFnProp(n,r)}))}},addStorage:function(e){!function(){var e="undefined"==typeof console?null:console;if(e){var t=e.warn?e.warn:e.log;t.apply(e,arguments)}}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(e)}},d,{plugins:[]});return p.raw={},a(p,(function(e,t){u(e)&&(p.raw[t]=s(p,e))})),a(e,(function(e){p._addStorage(e)})),a(t,(function(e){p._addPlugin(e)})),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(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var r=n("wx14"),i=n("rePB"),o=n("VTBJ"),a=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(e){var t,n="".concat(e.rootPrefixCls,"-item"),r=f()(n,"".concat(n,"-").concat(e.page),(t={},Object(i.a)(t,"".concat(n,"-active"),e.active),Object(i.a)(t,e.className,!!e.className),Object(i.a)(t,"".concat(n,"-disabled"),!e.page),t));return h.a.createElement("li",{title:e.showTitle?e.page:null,className:r,onClick:function(){e.onClick(e.page)},onKeyPress:function(t){e.onKeyPress(t,e.onClick,e.page)},tabIndex:"0"},e.itemRender(e.page,"page",h.a.createElement("a",{rel:"nofollow"},e.page)))},m=13,g=38,v=40,y=function(e){Object(l.a)(n,e);var t=Object(c.a)(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).state={goInputText:""},e.buildOptionText=function(t){return"".concat(t," ").concat(e.props.locale.items_per_page)},e.changeSize=function(t){e.props.changeSize(Number(t))},e.handleChange=function(t){e.setState({goInputText:t.target.value})},e.handleBlur=function(t){var n=e.props,r=n.goButton,i=n.quickGo,o=n.rootPrefixCls,a=e.state.goInputText;r||""===a||t.relatedTarget&&(t.relatedTarget.className.indexOf("".concat(o,"-prev"))>=0||t.relatedTarget.className.indexOf("".concat(o,"-next"))>=0)||(e.setState({goInputText:""}),i(e.getValidValue()))},e.go=function(t){""!==e.state.goInputText&&(t.keyCode!==m&&"click"!==t.type||(e.setState({goInputText:""}),e.props.quickGo(e.getValidValue())))},e}return Object(s.a)(n,[{key:"getValidValue",value:function(){var e=this.state,t=e.goInputText,n=e.current;return!t||isNaN(t)?n:Number(t)}},{key:"getPageSizeOptions",value:function(){var e=this.props,t=e.pageSize,n=e.pageSizeOptions;return n.some((function(e){return e.toString()===t.toString()}))?n:n.concat([t.toString()]).sort((function(e,t){return(isNaN(Number(e))?0:Number(e))-(isNaN(Number(t))?0:Number(t))}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.pageSize,r=t.locale,i=t.rootPrefixCls,o=t.changeSize,a=t.quickGo,s=t.goButton,l=t.selectComponentClass,c=t.buildOptionText,u=t.selectPrefixCls,d=t.disabled,f=this.state.goInputText,p="".concat(i,"-options"),m=l,g=null,v=null,y=null;if(!o&&!a)return null;var b=this.getPageSizeOptions();if(o&&m){var _=b.map((function(t,n){return h.a.createElement(m.Option,{key:n,value:t.toString()},(c||e.buildOptionText)(t))}));g=h.a.createElement(m,{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(e){return e.parentNode}},_)}return a&&(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)},g,v)}}]),n}(h.a.Component);y.defaultProps={pageSizeOptions:["10","20","50","100"]};var b=y,_=n("N2Kk");function E(){}function x(e,t,n){var r=void 0===e?t.pageSize:e;return Math.floor((n.total-1)/r)+1}var w=function(e){Object(l.a)(n,e);var t=Object(c.a)(n);function n(e){var r;Object(a.a)(this,n),(r=t.call(this,e)).getJumpPrevPage=function(){return Math.max(1,r.state.current-(r.props.showLessItems?3:5))},r.getJumpNextPage=function(){return Math.min(x(void 0,r.state,r.props),r.state.current+(r.props.showLessItems?3:5))},r.getItemIcon=function(e,t){var n=r.props.prefixCls,i=e||h.a.createElement("button",{type:"button","aria-label":t,className:"".concat(n,"-item-link")});return"function"==typeof e&&(i=h.a.createElement(e,Object(o.a)({},r.props))),i},r.savePaginationNode=function(e){r.paginationNode=e},r.isValid=function(e){return"number"==typeof(t=e)&&isFinite(t)&&Math.floor(t)===t&&e!==r.state.current;var t},r.shouldDisplayQuickJumper=function(){var e=r.props,t=e.showQuickJumper,n=e.pageSize;return!(e.total<=n)&&t},r.handleKeyDown=function(e){e.keyCode!==g&&e.keyCode!==v||e.preventDefault()},r.handleKeyUp=function(e){var t=r.getValidValue(e);t!==r.state.currentInputValue&&r.setState({currentInputValue:t}),e.keyCode===m?r.handleChange(t):e.keyCode===g?r.handleChange(t-1):e.keyCode===v&&r.handleChange(t+1)},r.changePageSize=function(e){var t=r.state.current,n=x(e,r.state,r.props);t=t>n?n:t,0===n&&(t=r.state.current),"number"==typeof e&&("pageSize"in r.props||r.setState({pageSize:e}),"current"in r.props||r.setState({current:t,currentInputValue:t})),r.props.onShowSizeChange(t,e),"onChange"in r.props&&r.props.onChange&&r.props.onChange(t,e)},r.handleChange=function(e){var t=r.props.disabled,n=e;if(r.isValid(n)&&!t){var i=x(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 o=r.state.pageSize;return r.props.onChange(n,o),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<x(void 0,r.state,r.props)},r.runIfEnter=function(e,t){if("Enter"===e.key||13===e.charCode){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];t.apply(void 0,r)}},r.runIfEnterPrev=function(e){r.runIfEnter(e,r.prev)},r.runIfEnterNext=function(e){r.runIfEnter(e,r.next)},r.runIfEnterJumpPrev=function(e){r.runIfEnter(e,r.jumpPrev)},r.runIfEnterJumpNext=function(e){r.runIfEnter(e,r.jumpNext)},r.handleGoTO=function(e){e.keyCode!==m&&"click"!==e.type||r.handleChange(r.state.currentInputValue)};var i=e.onChange!==E;"current"in e&&!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=e.defaultCurrent;"current"in e&&(s=e.current);var l=e.defaultPageSize;return"pageSize"in e&&(l=e.pageSize),s=Math.min(s,x(l,void 0,e)),r.state={current:s,currentInputValue:s,pageSize:l},r}return Object(s.a)(n,[{key:"componentDidUpdate",value:function(e,t){var n=this.props.prefixCls;if(t.current!==this.state.current&&this.paginationNode){var r=this.paginationNode.querySelector(".".concat(n,"-item-").concat(t.current));r&&document.activeElement===r&&r.blur()}}},{key:"getValidValue",value:function(e){var t=e.target.value,n=x(void 0,this.state,this.props),r=this.state.currentInputValue;return""===t?t:isNaN(Number(t))?r:t>=n?n:Number(t)}},{key:"getShowSizeChanger",value:function(){var e=this.props,t=e.showSizeChanger,n=e.total,r=e.totalBoundaryShowSizeChanger;return void 0!==t?t:n>r}},{key:"renderPrev",value:function(e){var t=this.props,n=t.prevIcon,r=(0,t.itemRender)(e,"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(e){var t=this.props,n=t.nextIcon,r=(0,t.itemRender)(e,"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 e=this,t=this.props,n=t.prefixCls,o=t.className,a=t.style,s=t.disabled,l=t.hideOnSinglePage,c=t.total,d=t.locale,m=t.showQuickJumper,g=t.showLessItems,v=t.showTitle,y=t.showTotal,_=t.simple,E=t.itemRender,w=t.showPrevNextJumpers,S=t.jumpPrevIcon,k=t.jumpNextIcon,C=t.selectComponentClass,T=t.selectPrefixCls,O=t.pageSizeOptions,A=this.state,L=A.current,R=A.pageSize,D=A.currentInputValue;if(!0===l&&c<=R)return null;var I=x(void 0,this.state,this.props),M=[],N=null,P=null,j=null,B=null,F=null,U=m&&m.goButton,G=g?1:2,z=L-1>0?L-1:0,H=L+1<I?L+1:I,V=Object.keys(this.props).reduce((function(t,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)&&"role"!==n||(t[n]=e.props[n]),t}),{});if(_)return U&&(F="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),F=h.a.createElement("li",{title:v?"".concat(d.jump_to).concat(L,"/").concat(I):null,className:"".concat(n,"-simple-pager")},F)),h.a.createElement("ul",Object(r.a)({className:f()(n,"".concat(n,"-simple"),Object(i.a)({},"".concat(n,"-disabled"),s),o),style:a,ref:this.savePaginationNode},V),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(z)),h.a.createElement("li",{title:v?"".concat(L,"/").concat(I):null,className:"".concat(n,"-simple-pager")},h.a.createElement("input",{type:"text",value:D,disabled:s,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),h.a.createElement("span",{className:"".concat(n,"-slash")},"/"),I),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(H)),F);if(I<=3+2*G){var W={locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:v,itemRender:E};I||M.push(h.a.createElement(p,Object(r.a)({},W,{key:"noPager",page:I,className:"".concat(n,"-disabled")})));for(var K=1;K<=I;K+=1){var q=L===K;M.push(h.a.createElement(p,Object(r.a)({},W,{key:K,page:K,active:q})))}}else{var X=g?d.prev_3:d.prev_5,Y=g?d.next_3:d.next_5;w&&(N=h.a.createElement("li",{title:v?X: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"),!!S))},E(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(S,"prev page"))),P=h.a.createElement("li",{title:v?Y: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))},E(this.getJumpNextPage(),"jump-next",this.getItemIcon(k,"next page")))),B=h.a.createElement(p,{locale:d,last:!0,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:I,page:I,active:!1,showTitle:v,itemRender:E}),j=h.a.createElement(p,{locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:v,itemRender:E});var $=Math.max(1,L-G),J=Math.min(L+G,I);L-1<=G&&(J=1+2*G),I-L<=G&&($=I-2*G);for(var Z=$;Z<=J;Z+=1){var Q=L===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:E}))}L-1>=2*G&&3!==L&&(M[0]=Object(u.cloneElement)(M[0],{className:"".concat(n,"-item-after-jump-prev")}),M.unshift(N)),I-L>=2*G&&L!==I-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(j),J!==I&&M.push(B)}var ee=null;y&&(ee=h.a.createElement("li",{className:"".concat(n,"-total-text")},y(c,[0===c?0:(L-1)*R+1,L*R>c?c:L*R])));var te=!this.hasPrev()||!I,ne=!this.hasNext()||!I;return h.a.createElement("ul",Object(r.a)({className:f()(n,o,Object(i.a)({},"".concat(n,"-disabled"),s)),style:a,unselectable:"unselectable",ref:this.savePaginationNode},V),ee,h.a.createElement("li",{title:v?d.prev_page:null,onClick:this.prev,tabIndex:te?null:0,onKeyPress:this.runIfEnterPrev,className:f()("".concat(n,"-prev"),Object(i.a)({},"".concat(n,"-disabled"),te)),"aria-disabled":te},this.renderPrev(z)),M,h.a.createElement("li",{title:v?d.next_page:null,onClick:this.next,tabIndex:ne?null:0,onKeyPress:this.runIfEnterNext,className:f()("".concat(n,"-next"),Object(i.a)({},"".concat(n,"-disabled"),ne)),"aria-disabled":ne},this.renderNext(H)),h.a.createElement(b,{disabled:s,locale:d,rootPrefixCls:n,selectComponentClass:C,selectPrefixCls:T,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:L,pageSize:R,pageSizeOptions:O,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:U}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n={};if("current"in e&&(n.current=e.current,e.current!==t.current&&(n.currentInputValue=n.current)),"pageSize"in e&&e.pageSize!==t.pageSize){var r=t.current,i=x(e.pageSize,t,e);r=r>i?i:r,"current"in e||(n.current=r,n.currentInputValue=r),n.pageSize=e.pageSize}return n}}]),n}(h.a.Component);w.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:E,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:E,locale:_.a,style:{},itemRender:function(e,t,n){return n},totalBoundaryShowSizeChanger:50};var S=w},"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(e,t,n){"use strict";var r=n(/*! ./Table */"wCXF"),i=n(/*! ./Footer */"n6Qo");n.d(t,"b",(function(){return i.a}));n(/*! ./sugar/Column */"IBYe"),n(/*! ./sugar/ColumnGroup */"6eGT");var o=n(/*! ./utils/legacyUtil */"hW8S");n.d(t,"a",(function(){return o.a})),t.c=r.b},"6eGT":
/*!*******************************************************!*\
!*** ./node_modules/rc-table/es/sugar/ColumnGroup.js ***!
\*******************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";t.a=function(e){return null}},"7+5b":
/*!******************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/v.svg ***!
\******************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/v.e7f297d6.svg"},"7Cbv":
/*!**************************************************************!*\
!*** ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,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 o(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}var a=/^(?:[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(e){return"string"==typeof e&&a.test(e)},l=[],c=0;c<256;++c)l.push((c+256).toString(16).substr(1));var u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};t.a=function(e,t,n){var r=(e=e||{}).random||(e.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return u(r)}},"7ahc":
/*!*************************************************************!*\
!*** ./src/components/markdown-editor/code-block/index.tsx ***!
\*************************************************************/
/*! exports provided: default, MyCodeMirror */
/*! exports used: MyCodeMirror, default */function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));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"),o=(n(/*! antd/es/button/style */"+L6B"),n(/*! antd/es/button */"2/Rp")),a=(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}},m={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 g(e){var t=e.value,n=e.onChange,i=e.mode,o=e.options,a=void 0===o?{}:o,l=Object(c.useRef)(),h=Object(c.useState)(),f=Object(s.a)(h,2),p=f[0],m=f[1];return Object(c.useEffect)((function(){if(p){function e(e){var t=e.getValue();n&&n(t)}return p.on("change",e),function(){p.off("change",e)}}}),[p,n]),Object(c.useEffect)((function(){p&&p.setOption("mode",i)}),[p,i]),Object(c.useEffect)((function(){p&&(t===p.getValue()&&""!==t||setTimeout((function(){p.setValue(t||" ")}),300))}),[p,t]),Object(c.useEffect)((function(){if(l.current&&!p){var e=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},a));m(e)}}),[l.current,p]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}t.b=function(e){var t=e.callback,n=e.onCancel,r=Object(c.useState)("python"),h=Object(s.a)(r,2),d=h[0],v=h[1];return u.a.createElement(a.a,Object(i.a)({},p,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)}}),u.a.createElement(a.a.Item,{label:"代码语言",name:"language"},u.a.createElement(l.a,{onChange:function(e){v(m[e][1])}},Object.keys(m).map((function(e){return u.a.createElement(f,{key:e,value:e},m[e][0])})))),u.a.createElement(a.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},u.a.createElement(g,{mode:d})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(o.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(o.a,{type:"ghost",onClick:n},"取消")))}},"7ixt":
/*!**************************************************!*\
!*** ./node_modules/rc-tooltip/es/placements.js ***!
\**************************************************/
/*! exports provided: placements, default */
/*! exports used: placements */function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r={adjustX:1,adjustY:1},i=[0,0],o={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}}},"7qur":
/*!*************************************************!*\
!*** ./src/pages/Question/OjProblem/service.ts ***!
\*************************************************/
/*! exports provided: getProgrammingTopic, sumbitCode, debugCode, getSubmitRecords, getRecordDetail, getOperationResult, addNotes, resetCode, syncCode, updateCode, updateLanguageCode, triggerPlus, practicesList, articlesList, addArticles, editArticles, editArticlesDetails, articlesDetails, articlesStatus, articlesAssist, articlesHide, deleteArticles, setLogTime */
/*! exports used: addArticles, addNotes, articlesAssist, articlesDetails, articlesHide, articlesList, articlesStatus, debugCode, deleteArticles, editArticles, editArticlesDetails, getOperationResult, getProgrammingTopic, getRecordDetail, getSubmitRecords, practicesList, resetCode, setLogTime, sumbitCode, syncCode, triggerPlus, updateCode, updateLanguageCode */function(e,t,n){"use strict";n.d(t,"m",(function(){return i})),n.d(t,"s",(function(){return o})),n.d(t,"h",(function(){return a})),n.d(t,"o",(function(){return s})),n.d(t,"n",(function(){return l})),n.d(t,"l",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"q",(function(){return h})),n.d(t,"t",(function(){return d})),n.d(t,"v",(function(){return f})),n.d(t,"w",(function(){return p})),n.d(t,"u",(function(){return m})),n.d(t,"p",(function(){return g})),n.d(t,"f",(function(){return v})),n.d(t,"a",(function(){return y})),n.d(t,"j",(function(){return b})),n.d(t,"k",(function(){return _})),n.d(t,"d",(function(){return E})),n.d(t,"g",(function(){return x})),n.d(t,"c",(function(){return w})),n.d(t,"e",(function(){return S})),n.d(t,"i",(function(){return k})),n.d(t,"r",(function(){return C}));var r=n(/*! @/utils/fetch */"ErOA");function i(e){return Object(r.c)("mypractices/".concat(e,".json"),{hidePopLogin:!0})}function o(e,t){return Object(r.f)("mypractices/".concat(e,"/code_submit.json"),t)}function a(e,t){return Object(r.c)("mypractices/".concat(e,"/code_debug.json"),t)}function s(e,t){return Object(r.c)("mypractices/".concat(e,"/submit_records.json"),t)}function l(e){return Object(r.c)("mypractices/record_detail.json",{id:e})}function c(e,t){return Object(r.c)("mypractices/".concat(e,"/result.json"),{mode:t})}function u(e,t){return Object(r.f)("mypractices/".concat(e,"/add_notes.json"),t)}function h(e,t){return Object(r.f)("mypractices/".concat(e,"/restore_initial_code.json"),t)}function d(e,t){return Object(r.f)("mypractices/".concat(e,"/sync_code.json"),t)}function f(e,t){return Object(r.f)("mypractices/".concat(e,"/update_code.json"),t)}function p(e){return Object(r.f)("mypractices/".concat(e,"/initial_codes.json"))}function m(e,t){return Object(r.f)("discusses/".concat(e,"/plus.json"),t)}function g(e){return Object(r.c)("practices/practices_list.json",e)}function v(e,t){return Object(r.c)("practices/".concat(e,"/question_solution_articles"),t)}function y(e,t){return Object(r.f)("practices/".concat(e,"/question_solution_articles"),t)}function b(e,t){return Object(r.g)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function _(e,t){return Object(r.c)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/edit"),t)}function E(e,t){return Object(r.c)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function x(e,t){return Object(r.f)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/set_authority_or_excellent"),t)}function w(e,t){return Object(r.f)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/praise_or_treads"),t)}function S(e,t){return Object(r.f)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/hide"))}function k(e,t){return Object(r.b)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function C(e,t){return Object(r.f)("mypractices/".concat(e,"/update_practice_time_sum"),t)}},"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(e,t,n){"use strict";n.d(t,"e",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return f})),n.d(t,"f",(function(){return p})),n.d(t,"b",(function(){return m}));var r=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),o=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),a=n(/*! rc-util/es/Children/toArray */"Zm9Q"),s=n(/*! rc-util/es/warning */"Kwbf"),l=n(/*! ../util */"OZM5");function c(e,t){return null!=e?e:t}function u(e){return function e(t){return Object(a.a)(t).map((function(t){if(!Object(l.i)(t))return Object(s.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,r=t.props,a=r.children,c=Object(o.a)(r,["children"]),u=Object(i.a)({key:n},c),h=e(a);return h.length&&(u.children=h),u})).filter((function(e){return e}))}(e)}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Set(!0===t?[]:t),o=[];function a(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.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===e.length-1])});return o.push(p),!0===t||n.has(f)?p.children=a(u.children||[],p):p.children=[],p}))}return a(e),o}function d(e,t,n){var r;n?"string"==typeof n?r=function(e){return e[n]}:"function"==typeof n&&(r=function(e){return n(e)}):r=function(e,t){return c(e.key,t)},function n(i,o,a){var s=i?i.children:e,c=i?Object(l.h)(a.pos,o):"0";if(i){var u=r(i,c),h={node:i,index:o,pos:c,key:u,parentPos:a.node?a.pos:null,level:a.level+1};t(h)}s&&s.forEach((function(e,t){n(e,t,{node:i,pos:c,level:a?a.level+1:-1})}))}(null)}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.initWrapper,r=t.processEntity,i=t.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,a={},s={},l={posEntities:a,keyEntities:s};return n&&(l=n(l)||l),d(e,(function(e){var t=e.node,n=e.index,i=e.pos,o=e.key,u=e.parentPos,h={node:t,index:n,key:o,pos:i,level:e.level},d=c(o,i);a[i]=h,s[d]=h,h.parent=a[u],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h)),r&&r(h,l)}),o),i&&i(l),l}function p(e,t){var n=t.expandedKeys,r=t.selectedKeys,i=t.loadedKeys,o=t.loadingKeys,a=t.checkedKeys,s=t.halfCheckedKeys,l=t.dragOverNodeKey,c=t.dropPosition,u=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==r.indexOf(e),loaded:-1!==i.indexOf(e),loading:-1!==o.indexOf(e),checked:-1!==a.indexOf(e),halfChecked:-1!==s.indexOf(e),pos:String(u?u.pos:""),dragOver:l===e&&0===c,dragOverGapTop:l===e&&-1===c,dragOverGapBottom:l===e&&1===c}}function m(e){var t=e.data,n=e.expanded,r=e.selected,o=e.checked,a=e.loaded,l=e.loading,c=e.halfChecked,u=e.dragOver,h=e.dragOverGapTop,d=e.dragOverGapBottom,f=e.pos,p=e.active,m=Object(i.a)(Object(i.a)({},t),{},{expanded:n,selected:r,checked:o,loaded:a,loading:l,halfChecked:c,dragOver:u,dragOverGapTop:h,dragOverGapBottom:d,pos:f,active:p});return"props"in m||Object.defineProperty(m,"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`."),e}}),m}},"8EBN":
/*!**********************************************!*\
!*** ./node_modules/codemirror/mode/meta.js ***!
\**********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";e.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 t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),o=i>-1&&t.substring(i+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)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(e,t,n){e.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(e,t,n){"use strict";n("DYRE");var r=n("zeV3"),i=(n("+L6B"),n("2/Rp")),o=n("k1fw"),a=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 m=[],g=["<ul>"],v=new f.a.Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){m.length=0,g=["<ul>"]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function E(){return function e(t,n,r,i){if(n>=t.length||t[n].level<=r)return n;var o=t[n];i.push("<li><a href='#"+o.anchor+"'>"+o.text+"</a>");var a=[];return n=e(t,++n,o.level,a),a.length>0&&(i.push("<ul>"),a.forEach((function(e){i.push(e)})),i.push("</ul>")),i.push("</li>"),n=e(t,n,r,i)}(m,0,0,g),g.push("</ul>"),g.join("")}var x={heading:function(e){var t=y.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:Object(s.a)(t,1)[0].length>=r.length?e.slice(r.length):e})).join("\n")}(n,t[3]||""),i=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(i)>=0){var o=k(),a=r;r=o,C[o]={type:"block",expression:a}}return{type:"code",raw:n,lang:i,text:r}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,k=function(){return"__special_katext_id_".concat(S++,"__")},C={};function T(){S=0,C={}}function O(e){return e=e.replace(w,(function(e,t){var n=k();return C[n]={type:"inline",expression:t},n}))}var A=v.listitem;v.listitem=function(e){return A(O(e))};var L=v.paragraph;v.paragraph=function(e){return L(O(e))};var R=v.tablecell;v.tablecell=function(e,t){return R(O(e),t)},v.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];return r?["latex","katex","math"].indexOf(r)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:Object(p.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:Object(p.escape)(e,!0))+"</code></pre>"},v.heading=function(e,t,n){var r=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return m.push({anchor:r,level:t,text:e}),"<h"+t+' id="'+r+'">'+e+"</h"+t+">"},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:x,renderer:v});var D=f.a,I=(n("SJMd"),n("ulZh")),M=n.n(I),N=n("m3rI"),P=n("Oy/b"),j=n("p5ED"),B=n("ErOA"),F=function(e,t){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function U(e,t){function n(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function G(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function z(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function H(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}var V=function(){function e(){}return e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},e.setAttributes=function(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n],o=i[0],a=i[1];e.setAttribute(o,a)}},e.createRect=function(t,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","rect");return i.setAttribute("width",t.toString()),i.setAttribute("height",n.toString()),r&&e.setAttributes(i,r),i},e.createLine=function(t,n,r,i,o){var a=document.createElementNS("http://www.w3.org/2000/svg","line");return a.setAttribute("x1",t.toString()),a.setAttribute("y1",n.toString()),a.setAttribute("x2",r.toString()),a.setAttribute("y2",i.toString()),o&&e.setAttributes(a,o),a},e.createPolygon=function(t,n){var r=document.createElementNS("http://www.w3.org/2000/svg","polygon");return r.setAttribute("points",t),n&&e.setAttributes(r,n),r},e.createCircle=function(t,n){var r=document.createElementNS("http://www.w3.org/2000/svg","circle");return r.setAttribute("cx",(t/2).toString()),r.setAttribute("cy",(t/2).toString()),r.setAttribute("r",t.toString()),n&&e.setAttributes(r,n),r},e.createEllipse=function(t,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return i.setAttribute("cx",(t/2).toString()),i.setAttribute("cy",(n/2).toString()),i.setAttribute("rx",(t/2).toString()),i.setAttribute("ry",(n/2).toString()),r&&e.setAttributes(i,r),i},e.createGroup=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttributes(n,t),n},e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},e.createMarker=function(t,n,r,i,o,a,s){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return e.setAttributes(l,[["id",t],["orient",n],["markerWidth",r.toString()],["markerHeight",i.toString()],["refX",o.toString()],["refY",a.toString()]]),l.appendChild(s),l},e.createText=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),t&&e.setAttributes(n,t),n},e.createTSpan=function(t,n){var r=document.createElementNS("http://www.w3.org/2000/svg","tspan");return r.textContent=t,n&&e.setAttributes(r,n),r},e.createImage=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return t&&e.setAttributes(n,t),n},e.createPoint=function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=e,n.y=t,n},e.createPath=function(t,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),n&&e.setAttributes(r,n),r},e}(),W=function(){function e(){}return e.addKey=function(t){e.key=t},Object.defineProperty(e,"isLicensed",{get:function(){return!!e.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(e.key)},enumerable:!1,configurable:!0}),e}(),K=function(){function e(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return e.prototype.rasterize=function(e,t,n){var r=this;return new Promise((function(i){var o=void 0!==n?n:document.createElement("canvas");null===e&&(r.markersOnly=!0,r.naturalSize=!1);var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("width",t.width.baseVal.valueAsString),a.setAttribute("height",t.height.baseVal.valueAsString),a.setAttribute("viewBox","0 0 "+t.viewBox.baseVal.width.toString()+" "+t.viewBox.baseVal.height.toString()),a.innerHTML=t.innerHTML,!0===r.naturalSize?(a.width.baseVal.value=e.naturalWidth,a.height.baseVal.value=e.naturalHeight):void 0!==r.width&&void 0!==r.height&&(a.width.baseVal.value=r.width,a.height.baseVal.value=r.height),o.width=a.width.baseVal.value,o.height=a.height.baseVal.value;var s=a.outerHTML,l=o.getContext("2d");!0!==r.markersOnly&&l.drawImage(e,0,0,o.width,o.height);var c=window.URL,u=new Image(o.width,o.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 e=o.toDataURL(r.imageType,r.imageQuality);i(e)},u.src=d}))},e}(),q=function(){},X=function(){function e(e){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+e+"_"}return Object.defineProperty(e.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),e.prototype.addClass=function(e){return void 0===this.styleSheet&&this.addStyleSheet(),e.name=""+this.classNamePrefix+e.localName,this.classes.push(e),this.styleSheet.sheet.insertRule("."+e.name+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length),e},e.prototype.addRule=function(e){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(e),this.styleSheet.sheet.insertRule(e.selector+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length)},e.prototype.addStyleSheet=function(){var e;this.styleSheet=document.createElement("style"),(null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).appendChild(this.styleSheet),this.addRule(new Y("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Y("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new Y("@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 "))},e.prototype.removeStyleSheet=function(){var e;this.styleSheet&&((null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},e}(),Y=function(e,t){this.selector=e,this.style=t},$=function(e,t){this.localName=e,this.style=t},J=function(){function e(e,t,n,r,i){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=e,this.displayMode=t,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 e.prototype.show=function(e){var t=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,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(e){var n=document.createElement("div");n.className=""+t.toolbarButtonStyleClass.name,n.setAttribute("data-type-name",e.typeName),n.innerHTML=e.icon,n.addEventListener("click",(function(){t.markerToolbarButtonClicked(n,e)})),t.buttons.push(n),t.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()},e.prototype.addButtonClickListener=function(e){this.buttonClickListeners.push(e)},e.prototype.removeButtonClickListener=function(e){this.buttonClickListeners.indexOf(e)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(e),1)},e.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},e.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var e=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var t=0;t<this.markerButtons.length;t++)t<e||t===e&&this.markerButtons.length-1===e?this.markerButtonBlock.appendChild(this.markerButtons[t]):(t===e&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[t]))}},e.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")},e.prototype.resetButtonStyles=function(){var e=this;this.buttons.forEach((function(t){t.className=t.className.replace(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name,"").trim(),t.className=t.className.replace(e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:e.toolbarActiveButtonStyleColorsClass.name,"").trim(),t.className+=" "+(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name)}))},e.prototype.addActionButton=function(e,t,n){var r=this,i=document.createElement("div");switch(i.className=""+this.toolbarButtonStyleClass.name,i.innerHTML=t,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}e.appendChild(i),this.buttons.push(i)},e.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 e=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new $("toolbar_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.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 Y("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Y("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n "))},e.prototype.markerToolbarButtonClicked=function(e,t){this.setActiveButton(e),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("marker",t)})),this.markerButtonOverflowBlock.style.display="none"},e.prototype.actionToolbarButtonClicked=function(e,t){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("action",t)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},e.prototype.setActiveButton=function(e){this.resetButtonStyles(),e.className=e.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),e.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},e.prototype.setActiveMarkerButton=function(e){var t=this.markerButtons.find((function(t){return t.getAttribute("data-type-name")===e}));t&&this.setActiveButton(t)},e.prototype.setCurrentMarker=function(e){var t=this;this.currentMarker=e,this.buttons.filter((function(e){return/delete|notes/.test(e.getAttribute("data-action"))})).forEach((function(e){void 0===t.currentMarker?(e.style.fillOpacity="0.4",e.style.pointerEvents="none"):(e.style.fillOpacity="1",e.style.pointerEvents="all")}))},e}(),Z=function(){function e(e,t,n,r){this.panels=[],this.panelButtons=[],this.markerjsContainer=e,this.displayMode=t,this.uiStyleSettings=n,this.styles=r,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return e.prototype.addStyles=function(){var e;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 t=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!==(e=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==e?e:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new $("toolbox_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.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 Y("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new Y("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},e.prototype.show=function(e){var t;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==t?t:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},e.prototype.setPanelButtons=function(e){var t,n,r=this;this.panels=e,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==t?t: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(e){var t;e.uiStyleSettings=r.uiStyleSettings;var n=document.createElement("div");n.className=r.toolboxButtonStyleClass.name+" "+(null!==(t=r.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==t?t:r.toolboxButtonStyleColorsClass.name),n.innerHTML=e.icon,n.title=e.title,n.addEventListener("click",(function(){r.panelButtonClick(e)})),r.panelButtons.push(n),r.buttonRow.appendChild(n)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},e.prototype.panelButtonClick=function(e){var t=this,n=-1;if(e!==this.activePanel){n=this.panels.indexOf(e),this.panelRow.innerHTML="";var r=e.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=e}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===t.displayMode?t.panelRow.style.display="none":t.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(e,r){var i,o;e.className=t.toolboxButtonStyleClass.name+" "+(r===n?""+(null!==(i=t.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==i?i:t.toolboxActiveButtonStyleColorsClass.name):""+(null!==(o=t.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==o?o:t.toolboxButtonStyleColorsClass.name))}))},e}(),Q=function(e,t){this.title=e,this.icon=t},ee=function(e){function t(t,n,r,i){var o=e.call(this,t,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 o.colors=[],o.addTransparent=!1,o.colorBoxes=[],o.colors=n,o.currentColor=r,o.setCurrentColor=o.setCurrentColor.bind(o),o.getColorBox=o.getColorBox.bind(o),o}return U(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.whiteSpace="nowrap",this.colors.forEach((function(n){var r=e.getColorBox(n);t.appendChild(r),e.colorBoxes.push(r)})),t},t.prototype.getColorBox=function(e){var t=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=e===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentColor(e,i)}));var o=document.createElement("div");return o.style.display="inline-block",o.style.width=r-2+"px",o.style.height=r-2+"px",o.style.backgroundColor=e,o.style.borderRadius=r/2+"px","transparent"===e&&(o.style.fill=this.uiStyleSettings.toolboxAccentColor,o.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(o),i},t.prototype.setCurrentColor=function(e,t){var n=this;this.currentColor=e,this.colorBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(e)},t}(Q),te=function(){function e(e,t,n){this._state="new",this._isSelected=!1,this._container=e,this._overlayContainer=t,this.globalSettings=n,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(e.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!1},Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},e.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},e.prototype.pointerDown=function(e,t){},e.prototype.dblClick=function(e,t){},e.prototype.manipulate=function(e){},e.prototype.pointerUp=function(e){this.stateChanged()},e.prototype.dispose=function(){},e.prototype.addMarkerVisualToContainer=function(e){this.container.childNodes.length>0?this.container.insertBefore(e,this.container.childNodes[0]):this.container.appendChild(e)},e.prototype.getState=function(){return{typeName:e.typeName,state:this.state,notes:this.notes}},e.prototype.restoreState=function(e){this._state=e.state,this.notes=e.notes},e.prototype.scale=function(e,t){},e.prototype.colorChanged=function(e){this.onColorChanged&&this.onColorChanged(e),this.stateChanged()},e.prototype.fillColorChanged=function(e){this.onFillColorChanged&&this.onFillColorChanged(e),this.stateChanged()},e.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var e=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),e.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(e)&&this.onStateChanged(this)}},e.typeName="MarkerBase",e}(),ne=function(){function e(){this.findGripByVisual=this.findGripByVisual.bind(this)}return e.prototype.findGripByVisual=function(e){return this.topLeft.ownsTarget(e)?this.topLeft:this.topCenter.ownsTarget(e)?this.topCenter:this.topRight.ownsTarget(e)?this.topRight:this.centerLeft.ownsTarget(e)?this.centerLeft:this.centerRight.ownsTarget(e)?this.centerRight:this.bottomLeft.ownsTarget(e)?this.bottomLeft:this.bottomCenter.ownsTarget(e)?this.bottomCenter:this.bottomRight.ownsTarget(e)?this.bottomRight:void 0},e}(),re=function(){function e(){this.GRIP_SIZE=10,this.visual=V.createGroup(),this.visual.appendChild(V.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(V.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e}(),ie=function(){function e(){}return e.toITransformMatrix=function(e){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}},e.toSVGMatrix=function(e,t){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e},e}(),oe=function(e){function t(t,n,r){var i=e.call(this,t,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(V.createTransform()),i.setupControlBox(),i}return U(t,e),Object.defineProperty(t.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visual",{get:function(){return this._visual},set:function(e){this._visual=e;var t=V.createTransform();this._visual.transform.baseVal.appendItem(t)},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!!(void 0!==this.controlGrips.findGripByVisual(t)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.left=t.x,this.top=t.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var r=this.unrotatePoint(t);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 o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(t),this._state="select","creating"===n&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},t.prototype.moveVisual=function(e){this.visual.style.transform="translate("+e.x+"px, "+e.y+"px)"},t.prototype.manipulate=function(e){var t=this.unrotatePoint(e);"creating"===this.state?this.resize(e):"move"===this.state?(this.left=this.manipulationStartLeft+(t.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(t.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(t):"rotate"===this.state&&this.rotate(e)},t.prototype.resize=function(e){var t=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:t=this.manipulationStartLeft+e.x-this.manipulationStartX,n=this.manipulationStartWidth+this.manipulationStartLeft-t;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:n=this.manipulationStartWidth+e.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:r=this.manipulationStartTop+e.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+e.y-this.manipulationStartY}n>=0?(this.left=t,this.width=n):(this.left=t+n,this.width=-n),i>=0?(this.top=r,this.height=i):(this.top=r+i,this.height=-i),this.setSize()},t.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},t.prototype.rotate=function(e){if(Math.abs(e.x-this.centerX)>.1){var t=Math.sign(e.x-this.centerX);this.rotationAngle=180*Math.atan((e.y-this.centerY)/(e.x-this.centerX))/Math.PI+90*t,this.applyRotation()}},t.prototype.applyRotation=function(){var e=this.container.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(e,0)},t.prototype.rotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM(),n=V.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.unrotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM();t=t.inverse();var n=V.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=V.createGroup();var e=V.createTransform();e.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(e),this.container.appendChild(this.controlBox),this.controlRect=V.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=V.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 ne,this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){var e=this.controlBox.transform.baseVal.getItem(0);e.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(e,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()},t.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()},t.prototype.createGrip=function(){var e=new re;return e.visual.transform.baseVal.appendItem(V.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.controlGrips.topLeft.GRIP_SIZE,t=-e/2,n=t,r=(this.width+this.CB_DISTANCE)/2-e/2,i=(this.height+this.CB_DISTANCE)/2-e/2,o=this.height+this.CB_DISTANCE-e/2,a=this.width+this.CB_DISTANCE-e/2;this.positionGrip(this.controlGrips.topLeft.visual,t,n),this.positionGrip(this.controlGrips.topCenter.visual,r,n),this.positionGrip(this.controlGrips.topRight.visual,a,n),this.positionGrip(this.controlGrips.centerLeft.visual,t,i),this.positionGrip(this.controlGrips.centerRight.visual,a,i),this.positionGrip(this.controlGrips.bottomLeft.visual,t,o),this.positionGrip(this.controlGrips.bottomCenter.visual,r,o),this.positionGrip(this.controlGrips.bottomRight.visual,a,o),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,r,n-3*this.CB_DISTANCE)},t.prototype.positionGrip=function(e,t,n){var r=e.transform.baseVal.getItem(0);r.setTranslate(t,n),e.transform.baseVal.replaceItem(r,0)},t.prototype.hideControlBox=function(){this.controlBox.style.display="none"},t.prototype.showControlBox=function(){this.controlBox.style.display=""},t.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ie.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ie.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;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(ie.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ie.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,n.containerTransformMatrix))},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n);var r=this.rotatePoint({x:this.left,y:this.top}),i=this.unrotatePoint({x:r.x*t,y:r.y*n});this.left=i.x,this.top=i.y,this.width=this.width*t,this.height=this.height*n,this.adjustControlBox()},t}(te),ae=function(e){function t(t,n,r){var i=e.call(this,t,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(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=V.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&V.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&V.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&V.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&V.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.title="Rectangle marker",t}(oe),se=function(e){function t(t,n,r,i){var o=e.call(this,t,i||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return o.widths=[],o.widthBoxes=[],o.widths=n,o.currentWidth=r,o.setCurrentWidth=o.setCurrentWidth.bind(o),o}return U(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.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===e.currentWidth?e.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentWidth(n,r)})),t.appendChild(r);var i=document.createElement("div");i.innerText=n.toString(),i.style.marginRight="5px",r.appendChild(i);var o=document.createElement("div");o.style.minHeight="20px",o.style.flexGrow="2",o.style.display="flex",o.style.alignItems="center";var a=document.createElement("hr");a.style.minWidth="20px",a.style.border="0px",a.style.borderTop=n+"px solid "+e.uiStyleSettings.toolboxColor,a.style.flexGrow="2",o.appendChild(a),r.appendChild(o),e.widthBoxes.push(r)})),t},t.prototype.setCurrentWidth=function(e,t){var n=this;this.currentWidth=e,this.widthBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},t}(Q),le=function(e){function t(t,n,r,i){var o=e.call(this,t,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 o.styles=[],o.styleBoxes=[],o.styles=n,o.currentStyle=r,o.setCurrentStyle=o.setCurrentStyle.bind(o),o}return U(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.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/e.styles.length-5+"%",r.style.borderColor=n===e.currentStyle?e.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentStyle(n,r)})),t.appendChild(r);var i=document.createElement("div");i.style.minHeight="20px",i.style.flexGrow="2",i.style.overflow="hidden";var o='<svg width="100" height="20">\n <line x1="0" y1="10" x2="100" y2="10" stroke="'+e.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(""!==n?'stroke-dasharray="'+n+'"':"")+" />\n </svg>";i.innerHTML=o,r.appendChild(i),e.styleBoxes.push(r)})),t},t.prototype.setCurrentStyle=function(e,t){var n=this;this.currentStyle=e,this.styleBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},t}(Q),ce=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.strokeColor=r.defaultColor,i.strokeWidth=r.defaultStrokeWidth,i.strokeDasharray=r.defaultStrokeDasharray,i.strokePanel=new ee("Line color",r.defaultColorSet,r.defaultColor),i.strokePanel.onColorChanged=i.setStrokeColor,i.strokeWidthPanel=new se("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.strokeWidthPanel.onWidthChanged=i.setStrokeWidth,i.strokeStylePanel=new le("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),i.strokeStylePanel.onStyleChanged=i.setStrokeDasharray,i}return U(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="FrameMarker",t.title="Frame marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',t}(ae),ue=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},he=function(e){function t(t,n,r){var i=e.call(this,t,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(t,e),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!(!this.grip1.ownsTarget(t)&&!this.grip2.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartX=t.x,this.manipulationStartY=t.y,"new"===this.state&&(this.x1=t.x,this.y1=t.y,this.x2=t.x,this.y2=t.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"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")},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"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(t),this._state="select","creating"===n&&this.onMarkerCreated&&this.onMarkerCreated(this)},t.prototype.adjustVisual=function(){},t.prototype.manipulate=function(e){"creating"===this.state?this.resize(e):"move"===this.state?(this.x1=this.manipulationStartX1+e.x-this.manipulationStartX,this.y1=this.manipulationStartY1+e.y-this.manipulationStartY,this.x2=this.manipulationStartX2+e.x-this.manipulationStartX,this.y2=this.manipulationStartY2+e.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(e)},t.prototype.resize=function(e){switch(this.activeGrip){case this.grip1:this.x1=e.x,this.y1=e.y;break;case this.grip2:case void 0:this.x2=e.x,this.y2=e.y}this.adjustVisual(),this.adjustControlBox()},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=V.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){this.positionGrips()},t.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},t.prototype.createGrip=function(){var e=new re;return e.visual.transform.baseVal.appendItem(V.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-e/2,this.y1-e/2),this.positionGrip(this.grip2.visual,this.x2-e/2,this.y2-e/2)},t.prototype.positionGrip=function(e,t,n){var r=e.transform.baseVal.getItem(0);r.setTranslate(t,n),e.transform.baseVal.replaceItem(r,0)},t.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.x1=n.x1,this.y1=n.y1,this.x2=n.x2,this.y2=n.y2},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.x1=this.x1*t,this.y1=this.y1*n,this.x2=this.x2*t,this.y2=this.y2*n,this.adjustVisual(),this.adjustControlBox()},t}(te),de=function(e){function t(t,n,r){var i=e.call(this,t,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 ee("Line color",r.defaultColorSet,r.defaultColor),i.strokePanel.onColorChanged=i.setStrokeColor,i.strokeWidthPanel=new se("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.strokeWidthPanel.onWidthChanged=i.setStrokeWidth,i.strokeStylePanel=new le("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),i.strokeStylePanel.onStyleChanged=i.setStrokeDasharray,i}return U(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorLine&&t!==this.visibleLine)},t.prototype.createVisual=function(){this.visual=V.createGroup(),this.selectorLine=V.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=V.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},t.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()),V.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),V.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),V.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.createVisual(),this.adjustVisual()},t.typeName="LineMarker",t.title="Line marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',t}(he),fe=function(e){function t(t,n,r,i){var o=e.call(this,t,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 o.fonts=[],o.fontBoxes=[],o.fonts=n,o.currentFont=r,o.setCurrentFont=o.setCurrentFont.bind(o),o}return U(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.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/e.fonts.length-5+"%",r.style.borderColor=n===e.currentFont?e.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentFont(n,r)})),t.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 o=document.createElement("div");o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.innerHTML="The quick brown fox jumps over the lazy dog",i.appendChild(o),r.appendChild(i),e.fontBoxes.push(r)})),t},t.prototype.setCurrentFont=function(e,t){var n=this;this.currentFont=e,this.fontBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},t}(Q),pe=function(e){function t(t,n,r){var i=e.call(this,t,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 ee("Color",r.defaultColorSet,r.defaultColor),i.colorPanel.onColorChanged=i.setColor,i.fontFamilyPanel=new fe("Font",r.defaultFontFamilies,r.defaultFontFamily),i.fontFamilyPanel.onFontChanged=i.setFont,i}return U(t,e),t.prototype.ownsTarget=function(t){if(e.prototype.ownsTarget.call(this,t)||t===this.visual||t===this.textElement||t===this.bgRectangle)return!0;var n=!1;return this.textElement.childNodes.forEach((function(e){e===t&&(n=!0)})),n},t.prototype.createVisual=function(){this.visual=V.createGroup(),this.bgRectangle=V.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=V.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(V.createTransform()),this.textElement.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.isMoved=!1,this.pointerDownPoint=t,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.renderText=function(){var e=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(t){e.textElement.appendChild(V.createTSpan(""===t.trim()?" ":t.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},t.prototype.getTextScale=function(){var e=this.textElement.getBBox(),t=1;if(e.width>0&&e.height>0){var n=(1*this.width-this.width*this.padding*2/100)/e.width,r=(1*this.height-this.height*this.padding*2/100)/e.height;t=Math.min(n,r)}return t},t.prototype.getTextPosition=function(e){var t=this.textElement.getBBox(),n=0,r=0;return t.width>0&&t.height>0&&(n=(this.width-t.width*e)/2,r=this.height/2-t.height*e/2),{x:n,y:r}},t.prototype.sizeText=function(){var e=this.textElement.getBBox(),t=this.getTextScale(),n=this.getTextPosition(t);n.y-=e.y*t,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+n.x+"px, "+n.y+"px) scale("+t+", "+t+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(n.x,n.y),this.textElement.transform.baseVal.getItem(1).setScale(t,t))},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(t.x-this.pointerDownPoint.x)>5||Math.abs(t.y-this.pointerDownPoint.y)>5)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.isMoved=!0,this.setSize(),this.sizeText()},t.prototype.setSize=function(){e.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},t.prototype.pointerUp=function(t){var n=this.state;"creating"===n&&(this._suppressMarkerCreateEvent=!0),e.prototype.pointerUp.call(this,t),this.setSize(),("creating"===n||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},t.prototype.showTextEditor=function(){var e=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(e){e.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var t=Number.parseFloat(e.textEditor.style.fontSize);e.textEditor.clientWidth>=Number.parseInt(e.textEditor.style.maxWidth)&&t>.9;)t-=.1,e.textEditor.style.fontSize=Math.max(t,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(e){e.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(e){if(e.clipboardData){var t=e.clipboardData.getData("text"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(t)),e.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){e.textEditDivClicked(e.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},t.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var e=this.getTextScale(),t=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),n=this.textElement.getBBox(),r={x:n.width*e,y:n.height*e};t.x-=r.x/2,t.y-=r.y/2,this.textEditor.style.top=t.y+"px",this.textEditor.style.left=t.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-t.x+"px",this.textEditor.style.fontSize=Math.max(16*e,12)+"px",this.textElement.style.display="none"}},t.prototype.textEditDivClicked=function(e){this.text=e.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},t.prototype.select=function(){e.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},t.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),e.prototype.deselect.call(this)},t.prototype.dblClick=function(t,n){e.prototype.dblClick.call(this,t,n),this.showTextEditor()},t.prototype.setColor=function(e){this.textElement&&V.setAttributes(this.textElement,[["fill",e]]),this.color=e,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(e)},t.prototype.setFont=function(e){this.textElement&&V.setAttributes(this.textElement,[["font-family",e]]),this.fontFamily=e,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},t.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},t.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.color=n.color,this.fontFamily=n.fontFamily,this.padding=n.padding,this.text=n.text,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize(),this.sizeText(),this.positionTextEditor()},t.typeName="TextMarker",t.title="Text marker",t.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>',t}(oe),me=function(e){function t(t,n,r){var i=e.call(this,t,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 ee("Color",r.defaultColorSet,r.defaultColor),i.colorPanel.onColorChanged=i.setColor,i.lineWidthPanel=new se("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.lineWidthPanel.onWidthChanged=i.setLineWidth,i}return U(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.drawingImage)},t.prototype.createVisual=function(){this.visual=V.createGroup(),this.drawingImage=V.createImage(),this.visual.appendChild(this.drawingImage);var e=V.createTransform();this.visual.transform.baseVal.appendItem(e),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,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(t.x,t.y),this.drawing=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.manipulate=function(t){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(t.x,t.y),this.canvasContext.stroke()):e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):e.prototype.pointerUp.call(this,t)},t.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)},t.prototype.select=function(){"creating"===this.state&&this.finishCreation(),e.prototype.select.call(this)},t.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),e.prototype.deselect.call(this)},t.prototype.finishCreation=function(){for(var e=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),t=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],n=t[0],r=t[1],i=t[2],o=t[3],a=!1,s=0;s<this.canvasElement.height;s++)for(var l=0;l<this.canvasElement.width;l++)e.data[s*this.canvasElement.width*4+4*l+3]>0&&(a=!0,s<r&&(r=s),l<n&&(n=l),s>o&&(o=s),l>i&&(i=l));if(a){this.left=n/this.pixelRatio,this.top=r/this.pixelRatio,this.width=(i-n)/this.pixelRatio,this.height=(o-r)/this.pixelRatio;var c=document.createElement("canvas");c.width=i-n,c.height=o-r,c.getContext("2d").putImageData(this.canvasContext.getImageData(n,r,i-n,o-r),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},t.prototype.setDrawingImage=function(){V.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},t.prototype.setColor=function(e){this.color=e,this.colorChanged(e)},t.prototype.setLineWidth=function(e){this.lineWidth=e},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({drawingImgUrl:this.drawingImgUrl},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){this.createVisual(),e.prototype.restoreState.call(this,t),this.drawingImgUrl=t.drawingImgUrl,this.setDrawingImage()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setDrawingImage()},t.typeName="FreehandMarker",t.title="Freehand marker",t.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>',t}(oe),ge=function(e){function t(t,n,r){var i=e.call(this,t,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(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");t.style.display="flex",t.style.overflow="hidden",t.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 o=document.createElement("div");if(o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=i===r.currentType?r.uiStyleSettings.toolboxAccentColor:"transparent",o.addEventListener("click",(function(){e.setCurrentType(i,o)})),t.appendChild(o),"both"===i||"start"===i){var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.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>',a.style.marginLeft="5px",o.appendChild(a)}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),o.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",o.appendChild(c)}r.typeBoxes.push(o)},r=this,i=0;i<4;i++)n(i);return t},t.prototype.setCurrentType=function(e,t){var n=this;this.currentType=e,this.typeBoxes.forEach((function(e){e.style.borderColor=e===t?void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},t}(Q),ve=function(e){function t(t,n,r){var i=e.call(this,t,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 ge("Arrow type","end"),i.arrowTypePanel.onArrowTypeChanged=i.setArrowType,i}return U(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.arrow1&&t!==this.arrow2)},t.prototype.getArrowPoints=function(e,t){var n=this.arrowBaseWidth+2*this.strokeWidth,r=this.arrowBaseHeight+2*this.strokeWidth;return e-n/2+","+(t+r/2)+" "+e+","+(t-r/2)+" "+(e+n/2)+","+(t+r/2)},t.prototype.createTips=function(){this.arrow1=V.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=V.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.arrow2)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.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",V.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),V.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.arrow1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(n,0);var r=this.arrow2.transform.baseVal.getItem(0);r.setRotate(t+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(r,0)}},t.prototype.setArrowType=function(e){this.arrowType=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({arrowType:this.arrowType},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.arrowType=n.arrowType,this.createTips(),this.adjustVisual()},t.typeName="ArrowMarker",t.title="Arrow marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',t}(de),ye=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.fillColor=r.defaultFillColor,i.strokeWidth=0,i.fillPanel=new ee("Color",r.defaultColorSet,r.defaultFillColor),i.fillPanel.onColorChanged=i.setFillColor,i}return U(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="CoverMarker",t.title="Cover marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',t}(ae),be=function(e){function t(t,n,r,i){var o=e.call(this,t,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 o.opacities=[],o.opacityBoxes=[],o.opacities=n,o.currentOpacity=r,o.setCurrentOpacity=o.setCurrentOpacity.bind(o),o}return U(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",t.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===e.currentOpacity?e.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentOpacity(n,r)})),t.appendChild(r);var i=document.createElement("div");i.innerText=100*n+"%",r.appendChild(i),e.opacityBoxes.push(r)})),t},t.prototype.setCurrentOpacity=function(e,t){var n=this;this.currentOpacity=e,this.opacityBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},t}(Q),_e=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.setOpacity=i.setOpacity.bind(i),i.fillColor=r.defaultHighlightColor,i.strokeWidth=0,i.opacity=r.defaultHighlightOpacity,i.fillPanel=new ee("Color",r.defaultColorSet,i.fillColor),i.fillPanel.onColorChanged=i.setFillColor,i.opacityPanel=new be("Opacity",r.defaultOpacitySteps,i.opacity),i.opacityPanel.onOpacityChanged=i.setOpacity,i}return U(t,e),t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&V.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="HighlightMarker",t.title="Highlight marker",t.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>',t}(ye),Ee='<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>',xe=function(e){function t(t,n,r){var i=e.call(this,t,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 ee("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 ee("Fill color",r.defaultColorSet,i.bgColor,Ee),i.bgColorPanel.onColorChanged=i.setBgColor,i.fontFamilyPanel=new fe("Font",r.defaultFontFamilies,r.defaultFontFamily),i.fontFamilyPanel.onFontChanged=i.setFont,i.tipGrip=new re,i.tipGrip.visual.transform.baseVal.appendItem(V.createTransform()),i.controlBox.appendChild(i.tipGrip.visual),i}return U(t,e),t.prototype.ownsTarget=function(t){return e.prototype.ownsTarget.call(this,t)||this.tipGrip.ownsTarget(t)||this.tip===t},t.prototype.createTip=function(){V.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=V.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},t.prototype.pointerDown=function(t,n){"new"===this.state&&e.prototype.pointerDown.call(this,t,n),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(n)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.pointerUp=function(t){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,e.prototype.pointerUp.call(this,t);else{var n="creating"===this.state;e.prototype.pointerUp.call(this,t),this.setTipPoints(n),this.positionTip()}},t.prototype.manipulate=function(t){if(this.tipMoving){var n=this.unrotatePoint(t);this.tipPosition={x:n.x-this.manipulationStartLeft,y:n.y-this.manipulationStartTop},this.positionTip()}else e.prototype.manipulate.call(this,t)},t.prototype.setBgColor=function(e){this.bgRectangle&&this.tip&&(V.setAttributes(this.bgRectangle,[["fill",e]]),V.setAttributes(this.tip,[["fill",e]])),this.bgColor=e,this.fillColorChanged(e)},t.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},t.prototype.setTipPoints=function(e){void 0===e&&(e=!1);var t=Math.min(this.height/2,15),n=this.height/5;e&&(this.tipPosition={x:t+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,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:0},this.tipBase2Position={x:t+n,y:0}):(this.tipBase1Position={x:0,y:t},this.tipBase2Position={x:0,y:t+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,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-n,y:0},this.tipBase2Position={x:this.width-t,y:0}):(this.tipBase1Position={x:this.width,y:t},this.tipBase2Position={x:this.width,y:t+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,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-n,y:this.height},this.tipBase2Position={x:this.width-t,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-t-n},this.tipBase2Position={x:this.width,y:this.height-t}):r<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:this.height},this.tipBase2Position={x:t+n,y:this.height}):(this.tipBase1Position={x:0,y:this.height-t},this.tipBase2Position={x:0,y:this.height-t-n})},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.positionTip()},t.prototype.positionTip=function(){V.setAttributes(this.tip,[["points",this.getTipPoints()]]);var e=this.tipGrip.visual.transform.baseVal.getItem(0);e.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(e,0)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.positionTip(),e.prototype.select.call(this)},t.prototype.getState=function(){var n=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.bgColor=n.bgColor,this.tipPosition=n.tipPosition,e.prototype.restoreState.call(this,t),this.createTip(),this.setTipPoints()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.tipPosition={x:this.tipPosition.x*t,y:this.tipPosition.y*n},this.positionTip()},t.typeName="CalloutMarker",t.title="Callout marker",t.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>',t}(pe),we=function(e){function t(t,n,r){var i=e.call(this,t,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 ee("Line color",H(r.defaultColorSet,["transparent"]),r.defaultColor),i.strokePanel.onColorChanged=i.setStrokeColor,i.fillPanel=new ee("Fill color",H(r.defaultColorSet,["transparent"]),i.fillColor,Ee),i.fillPanel.onColorChanged=i.setFillColor,i.strokeWidthPanel=new se("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.strokeWidthPanel.onWidthChanged=i.setStrokeWidth,i.strokeStylePanel=new le("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),i.strokeStylePanel.onStyleChanged=i.setStrokeDasharray,i.opacityPanel=new be("Opacity",r.defaultOpacitySteps,i.opacity),i.opacityPanel.onOpacityChanged=i.setOpacity,i}return U(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=V.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),V.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&V.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&V.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(e),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&V.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&V.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&V.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.typeName="EllipseMarker",t.title="Ellipse marker",t.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>',t}(oe),Se=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return U(t,e),Object.defineProperty(t.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.tip1&&t!==this.tip2)},t.prototype.createTips=function(){this.tip1=V.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(V.createTransform()),this.visual.appendChild(this.tip1),this.tip2=V.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(V.createTransform()),this.visual.appendChild(this.tip2)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(V.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()]]),V.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.tip1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(n,0);var r=this.tip2.transform.baseVal.getItem(0);r.setRotate(t+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(r,0)}},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t),this.createTips(),this.adjustVisual()},t.typeName="MeasurementMarker",t.title="Measurement marker",t.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>',t}(de),ke=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.strokePanel.colors=r.defaultColorSet,i.fillColor="transparent",i}return U(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="EllipseFrameMarker",t.title="Ellipse frame marker",t.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>',t}(we),Ce=function(){function e(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),e.prototype.addUndoStep=function(e){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(e)||(this.undoStack.push(e),JSON.stringify(this.lastRedoStep)!==JSON.stringify(e)&&this.redoStack.splice(0,this.redoStack.length))},e.prototype.replaceLastUndoStep=function(e){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=e)},e.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},e.prototype.undo=function(){if(this.undoStack.length>1){var e=this.undoStack.pop();return void 0!==e&&this.redoStack.push(e),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},e.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},e}(),Te=function(e){function t(t,n,r){var i=e.call(this,t,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 ee("Line color",r.defaultColorSet,r.defaultColor),i.strokePanel.onColorChanged=i.setStrokeColor,i.strokeWidthPanel=new se("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),i.strokeWidthPanel.onWidthChanged=i.setStrokeWidth,i.strokeStylePanel=new le("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),i.strokeStylePanel.onStyleChanged=i.setStrokeDasharray,i}return U(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorCurve&&t!==this.visibleCurve&&!this.curveGrip.ownsTarget(t))},t.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},t.prototype.createVisual=function(){this.visual=V.createGroup(),this.selectorCurve=V.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=V.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=t.x,this.curveY=t.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(n)&&(this.activeGrip=this.curveGrip,this._state="resize")},t.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),V.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),V.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),V.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setupControlBox=function(){e.prototype.setupControlBox.call(this),this.curveControlLine1=V.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=V.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)},t.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,e.prototype.addControlGrips.call(this)},t.prototype.positionGrips=function(){e.prototype.positionGrips.call(this);var t=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-t/2,this.curveY-t/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},t.prototype.manipulate=function(t){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+t.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+t.y-this.manipulationStartY),e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){this.activeGrip===this.curveGrip&&(this.curveX=t.x,this.curveY=t.y),e.prototype.resize.call(this,t),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual()},t.prototype.scale=function(t,n){this.curveX=this.curveX*t,this.curveY=this.curveY*n,e.prototype.scale.call(this,t,n)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.curveX=n.curveX,this.curveY=n.curveY,this.createVisual(),this.adjustVisual()},t.typeName="CurveMarker",t.title="Curve marker",t.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>',t}(he),Oe=function(){function e(e,t){void 0===t&&(t=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=e,this.cancelable=t}return Object.defineProperty(e.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this._defaultPrevented=!0},e}(),Ae=function(e){function t(t,n,r){var i=e.call(this,t,!1)||this;return i.dataUrl=n,i.state=r,i}return U(t,e),t}(Oe),Le=function(e){function t(t,n,r){void 0===r&&(r=!1);var i=e.call(this,t,r)||this;return i.marker=n,i}return U(t,e),t}(Oe),Re=function(){function e(){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 e.prototype.addEventListener=function(e,t){this[e].push(t)},e.prototype.removeEventListener=function(e,t){var n=this[e].indexOf(t);n>-1&&this[e].splice(n,1)},e}(),De=function(){function e(t){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ue,this._isOpen=!1,this.undoRedoManager=new Ce,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 Re,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=e.instanceCounter++,this.styles=new X(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=t,this.targetRoot=document.body,this.width=t.clientWidth,this.height=t.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(e.prototype,"ALL_MARKER_TYPES",{get:function(){return[ce,me,ve,pe,ke,we,_e,xe,Se,ye,de,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ce,me,ve,pe,we,_e,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ce,me,ve,pe,_e]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(e){var t=this;this._availableMarkerTypes.splice(0),e.forEach((function(e){if("string"==typeof e){var n=t.ALL_MARKER_TYPES.find((function(t){return t.typeName===e}));void 0!==n&&t._availableMarkerTypes.push(n)}else t._availableMarkerTypes.push(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(e){this._zoomLevel=e,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(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),W.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},e.prototype.show=function(){var e=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(t){return t(new Oe(e))}))},e.prototype.render=function(){return G(this,void 0,void 0,(function(){var e;return z(this,(function(t){switch(t.label){case 0:return this.setCurrentMarker(),(e=new K).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.markersOnly=this.renderMarkersOnly,e.width=this.renderWidth,e.height=this.renderHeight,[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return t.sent(),[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,t.sent()]}}))}))},e.prototype.close=function(e){var t=this;if(void 0===e&&(e=!1),this.isOpen){var n=!1;e||this.eventListeners.beforeclose.forEach((function(e){var r=new Oe(t,!0);e(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(e){return e(new Oe(t))})),this.detachEvents(),this._isOpen=!1)}},e.prototype.addMarkersToToolbar=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this._availableMarkerTypes).push.apply(e,t)},e.prototype.addRenderEventListener=function(e){this.addEventListener("render",(function(t){e(t.dataUrl,t.state)}))},e.prototype.removeRenderEventListener=function(e){},e.prototype.addCloseEventListener=function(e){this.addEventListener("close",(function(){e()}))},e.prototype.removeCloseEventListener=function(e){},e.prototype.setupResizeObserver=function(){var e=this;"inline"===this.settings.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){e.resize(e.target.clientWidth,e.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.settings.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){return e.onPopupTargetResize()})),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},e.prototype.onPopupTargetResize=function(){var e=1*this.target.clientWidth/this.target.clientHeight,t=this.editorCanvas.clientWidth/e>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*e:this.editorCanvas.clientWidth,n=t<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/e;this.resize(t,n)},e.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},e.prototype.resize=function(e,t){this._isResizing=!0;var n=e/this.imageWidth,r=t/this.imageHeight;this.imageWidth=Math.round(e),this.imageHeight=Math.round(t),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px","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},e.prototype.scaleMarkers=function(e,t){var n,r=this;this._currentMarker&&this._currentMarker instanceof pe?this._currentMarker.scale(e,t):(n=this._currentMarker,this.setCurrentMarker()),this.markers.forEach((function(n){n!==r._currentMarker&&n.scale(e,t)})),void 0!==n&&this.setCurrentMarker(n)},e.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"},e.prototype.setTopLeft=function(){var e=this.editingTarget.getBoundingClientRect(),t=this.editorCanvas.getBoundingClientRect();this.left=e.left-t.left,this.top=e.top-t.top},e.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)},e.prototype.addDefs=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.defs=V.createDefs(),this.addDefsToImage(),(e=this.defs).append.apply(e,t)},e.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},e.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)},e.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},e.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},e.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)},e.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},e.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)},e.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 e=document.createElement("a");e.href="https://markerjs.com/",e.target="_blank",e.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>',e.title="Powered by marker.js",e.style.display="grid",e.style.alignItems="center",e.style.justifyItems="center",e.style.padding="3px",e.style.width="20px",e.style.height="20px",this.logoUI.appendChild(e),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},e.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")},e.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"},e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},e.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 e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"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")},e.prototype.closeUI=function(){"popup"===this.settings.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},e.prototype.removeMarker=function(e){this.markerImage.removeChild(e.container),this.markers.indexOf(e)>-1&&this.markers.splice(this.markers.indexOf(e),1),e.dispose()},e.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())},e.prototype.toolbarButtonClicked=function(e,t){if("marker"===e&&void 0!==t)this.createNewMarker(t);else if("action"===e)switch(t){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":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()}},e.prototype.deleteSelectedMarker=function(){var e=this;if(void 0!==this._currentMarker){var t=!1;if(this.eventListeners.markerbeforedelete.forEach((function(n){var r=new Le(e,e._currentMarker,!0);n(r),r.defaultPrevented&&(t=!0)})),!t){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(t){return t(new Le(e,n))}))}}},e.prototype.clear=function(){var e=this,t=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(n){var r=new Le(e,void 0,!0);n(r),r.defaultPrevented&&(t=!0)})),!t)){this.setCurrentMarker();for(var n=function(t){var n=r.markers[t];r.setCurrentMarker(r.markers[t]),r._currentMarker.dispose(),r.markerImage.removeChild(r._currentMarker.container),r.markers.splice(r.markers.indexOf(r._currentMarker),1),r.eventListeners.markerdelete.forEach((function(t){return t(new Le(e,n))}))},r=this,i=this.markers.length-1;i>=0;i--)n(i);this.addUndoStep()}},Object.defineProperty(e.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),e.prototype.showNotesEditor=function(){var e;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!==(e=this._currentMarker.notes)&&void 0!==e?e:"",this.overlayContainer.appendChild(this.notesArea))},e.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)},e.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},e.prototype.addUndoStep=function(){var e=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var t=this.getState(),n=this.undoRedoManager.getLastUndoStep();if(!n||n.width===t.width&&n.height===t.height){var r=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(t),r<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach((function(t){return t(new Oe(e))}))}else this.undoRedoManager.replaceLastUndoStep(t),this.eventListeners.statechange.forEach((function(t){return t(new Oe(e))}))}},e.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},e.prototype.undoStep=function(){var e=this,t=this.undoRedoManager.undo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new Oe(e))})))},e.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},e.prototype.redoStep=function(){var e=this,t=this.undoRedoManager.redo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new Oe(e))})))},e.prototype.stepZoom=function(){var e=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=e<this.zoomSteps.length-1?this.zoomSteps[e+1]:this.zoomSteps[0]},e.prototype.panTo=function(e){this.contentDiv.scrollBy({left:this.prevPanPoint.x-e.x,top:this.prevPanPoint.y-e.y}),this.prevPanPoint=e},e.prototype.startRenderAndClose=function(){return G(this,void 0,void 0,(function(){var e,t,n=this;return z(this,(function(r){switch(r.label){case 0:return[4,this.render()];case 1:return e=r.sent(),t=this.getState(),this.eventListeners.render.forEach((function(r){return r(new Ae(n,e,t))})),this.close(!0),[2]}}))}))},e.prototype.getState=function(e){!0===e&&this.setCurrentMarker();var t={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach((function(e){return t.markers.push(e.getState())})),t},e.prototype.restoreState=function(e){var t=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);e.markers.forEach((function(e){var n=t._availableMarkerTypes.find((function(t){return t.typeName===e.typeName}));if(void 0!==n){var r=t.addNewMarker(n);r.restoreState(e),t.markers.push(r)}})),e.width&&e.height&&(e.width!==this.imageWidth||e.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/e.width,this.imageHeight/e.height),this.eventListeners.restorestate.forEach((function(e){return e(new Oe(t))}))},e.prototype.addNewMarker=function(e){var t=V.createGroup();return this.markerImage.appendChild(t),new e(t,this.overlayContainer,this.settings)},e.prototype.createNewMarker=function(e){var t,n=this;(t="string"==typeof e?this._availableMarkerTypes.find((function(t){return t.typeName===e})):e)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(t),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(t.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach((function(e){return e(new Le(n,n._currentMarker))})))},e.prototype.markerCreated=function(e){var t=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(e),this.setCurrentMarker(e),e instanceof me&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(me):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach((function(e){return e(new Le(t,t._currentMarker))}))},e.prototype.colorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=e,this.settings.defaultStrokeColor=e)},e.prototype.fillColorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=e)},e.prototype.markerStateChanged=function(e){var t=this;this.eventListeners.markerchange.forEach((function(n){return n(new Le(t,e))}))},e.prototype.setCurrentMarker=function(e){var t=this;this._currentMarker!==e&&void 0!==this._currentMarker&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach((function(e){return e(new Le(t,t._currentMarker))}))),this._currentMarker=e,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(e){return e(new Le(t,t._currentMarker))})))},e.prototype.onPointerDown=function(e){if(this._isFocused||this.focus(),this.touchPoints++,1===this.touchPoints||"touch"!==e.pointerType)if(void 0===this._currentMarker||"new"!==this._currentMarker.state&&"creating"!==this._currentMarker.state){if("select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t?(this.setCurrentMarker(t),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:e.clientX,y:e.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY))},e.prototype.onDblClick=function(e){if(this._isFocused||this.focus(),"select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t&&t!==this._currentMarker&&this.setCurrentMarker(t),void 0!==this._currentMarker?this._currentMarker.dblClick(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target):this.setCurrentMarker()}},e.prototype.onPointerMove=function(e){1!==this.touchPoints&&"touch"===e.pointerType||(void 0!==this._currentMarker||this.isDragging)&&(void 0!==this._currentMarker&&"edit"===this._currentMarker.state||e.preventDefault(),void 0!==this._currentMarker?this._currentMarker.manipulate(this.clientToLocalCoordinates(e.clientX,e.clientY)):this.zoomLevel>1&&this.panTo({x:e.clientX,y:e.clientY}))},e.prototype.onPointerUp=function(e){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(e.clientX,e.clientY)),this.isDragging=!1,this.addUndoStep()},e.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},e.prototype.onKeyUp=function(e){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==e.key&&"Backspace"!==e.key||this.deleteSelectedMarker()},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.markerImage.getBoundingClientRect();return{x:(e-n.left)/this.zoomLevel,y:(t-n.top)/this.zoomLevel}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"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()},e.prototype.addLicenseKey=function(e){W.addKey(e)},e.prototype.addEventListener=function(e,t){this.eventListeners.addEventListener(e,t)},e.prototype.removeEventListener=function(e,t){this.eventListeners.removeEventListener(e,t)},e.prototype.renderState=function(e){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(e),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),e.prototype.focus=function(){var e=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(t){return t(new Oe(e))})))},e.prototype.blur=function(){var e=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(t){return t(new Oe(e))})))},e.instanceCounter=0,e}(),Ie=function(e,t){return(Ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};
/* **********************************
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 Me(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ie(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Ne(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function Pe(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var je=function(){function e(){}return e.addKey=function(t){e.key=t},Object.defineProperty(e,"isLicensed",{get:function(){return!!e.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(e.key)},enumerable:!1,configurable:!0}),e}(),Be=function(){function e(){}return e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},e.setAttributes=function(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n],o=i[0],a=i[1];e.setAttribute(o,a)}},e.createRect=function(t,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","rect");return i.setAttribute("width",t.toString()),i.setAttribute("height",n.toString()),r&&e.setAttributes(i,r),i},e.createLine=function(t,n,r,i,o){var a=document.createElementNS("http://www.w3.org/2000/svg","line");return a.setAttribute("x1",t.toString()),a.setAttribute("y1",n.toString()),a.setAttribute("x2",r.toString()),a.setAttribute("y2",i.toString()),o&&e.setAttributes(a,o),a},e.createPolygon=function(t,n){var r=document.createElementNS("http://www.w3.org/2000/svg","polygon");return r.setAttribute("points",t),n&&e.setAttributes(r,n),r},e.createCircle=function(t,n){var r=document.createElementNS("http://www.w3.org/2000/svg","circle");return r.setAttribute("cx",(t/2).toString()),r.setAttribute("cy",(t/2).toString()),r.setAttribute("r",t.toString()),n&&e.setAttributes(r,n),r},e.createEllipse=function(t,n,r){var i=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return i.setAttribute("cx",(t/2).toString()),i.setAttribute("cy",(n/2).toString()),i.setAttribute("rx",(t/2).toString()),i.setAttribute("ry",(n/2).toString()),r&&e.setAttributes(i,r),i},e.createGroup=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttributes(n,t),n},e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},e.createMarker=function(t,n,r,i,o,a,s){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return e.setAttributes(l,[["id",t],["orient",n],["markerWidth",r.toString()],["markerHeight",i.toString()],["refX",o.toString()],["refY",a.toString()]]),l.appendChild(s),l},e.createText=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),t&&e.setAttributes(n,t),n},e.createTSpan=function(t,n){var r=document.createElementNS("http://www.w3.org/2000/svg","tspan");return r.textContent=t,n&&e.setAttributes(r,n),r},e.createImage=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return t&&e.setAttributes(n,t),n},e.createPoint=function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=e,n.y=t,n},e.createPath=function(t,n){var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),n&&e.setAttributes(r,n),r},e.createElement=function(t,n){var r=document.createElementNS("http://www.w3.org/2000/svg",t);return n&&e.setAttributes(r,n),r},e.getHollowRectanglePath=function(e,t,n,r,i,o,a,s){return"M"+e+","+t+"V"+(t+r)+"H"+(e+n)+"V"+t+"H"+i+"V"+o+"H"+(i+a)+"V"+(o+s)+"H"+i+"V"+t+"Z"},e}(),Fe=function(){function e(e){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+e+"_"}return Object.defineProperty(e.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),e.prototype.addClass=function(e){return void 0===this.styleSheet&&this.addStyleSheet(),e.name=""+this.classNamePrefix+e.localName,this.classes.push(e),this.styleSheet.sheet.insertRule("."+e.name+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length),e},e.prototype.addRule=function(e){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(e),this.styleSheet.sheet.insertRule(e.selector+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length)},e.prototype.addStyleSheet=function(){var e;this.styleSheet=document.createElement("style"),(null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).appendChild(this.styleSheet),this.addRule(new Ue("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ue("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new Ue("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new Ge("_fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new Ge("_fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},e.prototype.removeStyleSheet=function(){var e;this.styleSheet&&((null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},e}(),Ue=function(e,t){this.selector=e,this.style=t},Ge=function(e,t){this.localName=e,this.style=t},ze=function(){function e(){this.blocks=[],this.display=""}return e.prototype.addButtonBlock=function(e){e.className=this.blockClassName,e.buttonClassName=this.buttonClassName,e.buttonColorsClassName=this.buttonColorsClassName,e.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(e)},e.prototype.addElementBlock=function(e){void 0===e.className&&(e.className=this.blockClassName),this.blocks.push(e)},e.prototype.getUI=function(){var e=document.createElement("div");return e.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,e.style.display=this.display,this.blocks.forEach((function(t){return e.appendChild(t.getUI())})),e},e}(),He=function(){function e(){}return e.prototype.getUI=function(){var e=document.createElement("div");if(e.className=this.className,void 0!==this.minWidth&&(e.style.minWidth=this.minWidth),void 0!==this.contentAlign)switch(this.contentAlign){case"start":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"end":e.style.justifyContent="flex-end"}return e.style.whiteSpace="nowrap",e},e}(),Ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[],t}return Me(t,e),t.prototype.addButton=function(e){e.className=this.buttonClassName,e.colorsClassName=this.buttonColorsClassName,e.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(e)},t.prototype.getUI=function(){var t=e.prototype.getUI.call(this);return this.buttons.forEach((function(e){return t.appendChild(e.getUI())})),t},t}(He),We=function(){function e(e,t){this._isActive=!1,this._isHidden=!1,this._icon=e,this.title=t,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(e.prototype,"icon",{get:function(){return this._icon},set:function(e){this._icon=e,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(e){this._isActive=e,this.adjustClassName()},enumerable:!1,configurable:!0}),e.prototype.getUI=function(){var e=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 e.onClick()})),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},e.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,"")))},e.prototype.hide=function(){this._isHidden=!0},e}(),Ke=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.elements=[],t}return Me(t,e),t.prototype.addElement=function(e){this.elements.push(e)},t.prototype.getUI=function(){var t=e.prototype.getUI.call(this);return this.elements.forEach((function(e){return t.appendChild(e)})),t},t}(He),qe=function(){function e(e,t){this.horizontal=e,this.vertical=t}return Object.defineProperty(e.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),e.prototype.getVerticalLength=function(e){return e/this.ratio},e.prototype.getHorizontalLength=function(e){return e*this.ratio},e}(),Xe=function(){function e(){}return e.getIcon=function(e,t){if(e>0&&t>0){var n=new qe(e,t),r=n.ratio>=1?20:n.getHorizontalLength(20),i=n.ratio<1?20:n.getVerticalLength(20),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(o);var a=Be.createDefs();o.appendChild(a);var s=Be.createElement("clipPath",[["id","text-bg-clip"]]);a.appendChild(s);var l=Be.createPath(Be.getHollowRectanglePath((24-r)/2,(24-i)/2,r,i,(24-r)/2+2,(24-i)/2+2,r-4,i-4));o.appendChild(l);var c=Be.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);c.appendChild(Be.createTSpan(e+":"+t)),o.appendChild(c);var u=c.getBBox();Be.setAttributes(c,[["x",((24-u.width)/2).toString()],["y",((24-u.height)/2-u.y).toString()]]);var h=Be.createPath(Be.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),Be.setAttributes(l,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(o),o.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>'},e}(),Ye=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.isDropdownOpen=!1,i.onClick=i.dropdownButtonClicked,i.dropdownButtons=r,i}return Me(t,e),t.prototype.setupDropdown=function(){var e=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach((function(t){t.className=e.className,t.colorsClassName=e.colorsClassName,e.dropdownBlock.appendChild(t.getUI())})),this.uiContainer.appendChild(this.dropdownBlock)},t.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},t.prototype.dropdownButtonClicked=function(){void 0===this.dropdownBlock&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},t.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},t.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},t.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},t}(We),$e=function(){function e(e,t){this.GRIP_SIZE=10,this.color=e,this.fillColor=t,this.visual=Be.createGroup(),this.visual.appendChild(Be.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Be.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e.prototype.setCenter=function(e,t){this.visual.childNodes.forEach((function(n){return Be.setAttributes(n,[["cx",e.toString()],["cy",t.toString()]])}))},e}(),Je=function(){function e(e,t,n,r){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=e,this.canvasHeight=t,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(e.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(e){this._aspectRatio=e,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(e){this._isGridVisible=e,this.gridContainer&&Be.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(e){this._zoomFactor=e,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),e.prototype.open=function(){var e=this;this.cropShadeElement=Be.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Be.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var t=0;t<this.numberOfGridLines;t++)this.horizontalGridLines.push(Be.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Be.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach((function(t){return e.gridContainer.appendChild(t)})),this.verticalGridLines.forEach((function(t){return e.gridContainer.appendChild(t)})),this.cropRectElement=Be.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new $e(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new $e(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new $e(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new $e(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},e.prototype.setCropRectangle=function(e){this.cropRect=e;var t=Object.assign({},this.cropRect);1!==this.zoomFactor&&(t.width=this.cropRect.width*this.zoomFactor,t.height=this.cropRect.height*this.zoomFactor,t.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-t.width/2,t.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-t.height/2),Be.setAttributes(this.cropRectElement,[["x",t.x.toString()],["y",t.y.toString()],["width",t.width.toString()],["height",t.height.toString()]]);var n=t.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach((function(e,r){var i=t.y+n*(r+1);Be.setAttributes(e,[["x1",""+t.x],["y1",""+i],["x2",""+(t.x+t.width)],["y2",""+i]])}));var r=t.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach((function(e,n){var i=t.x+r*(n+1);Be.setAttributes(e,[["x1",""+i],["y1",""+t.y],["x2",""+i],["y2",""+(t.y+t.height)]])})),Be.setAttributes(this.cropShadeElement,[["d",Be.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,t.x,t.y,t.width,t.height)]]),this.topLeftGrip.setCenter(t.x,t.y),this.topRightGrip.setCenter(t.x+t.width,t.y),this.bottomLeftGrip.setCenter(t.x,t.y+t.height),this.bottomRightGrip.setCenter(t.x+t.width,t.y+t.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},e.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)},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.container.getBoundingClientRect();return{x:e-n.left+this.margin,y:t-n.top+this.margin}},e.prototype.onPointerDown=function(e){this.container.setPointerCapture(e.pointerId),this.previousPoint=this.clientToLocalCoordinates(e.clientX,e.clientY),this.cropRectElement===e.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(e.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(e.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(e.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(e.target)&&(this.activeGrip=this.bottomRightGrip)},e.prototype.onPointerMove=function(e){if(this.isMoving)this.move(this.clientToLocalCoordinates(e.clientX,e.clientY));else if(this.activeGrip){var t=this.clientToLocalCoordinates(e.clientX,e.clientY);this.resize(t)}e.preventDefault()},e.prototype.onPointerUp=function(e){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(e.pointerId)},e.prototype.move=function(e){var t=e.x-this.previousPoint.x,n=e.y-this.previousPoint.y;1!==this.zoomFactor&&(t=-t/this.zoomFactor,n=-n/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+t),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+n),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=e},e.prototype.resize=function(e){var t=Object.assign({},this.cropRect),n=e.x-this.previousPoint.x,r=e.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:t.x+n<this.margin&&(n=this.margin-t.x),t.x+=n,t.width=this.cropRect.x+this.cropRect.width-t.x;break;case this.bottomRightGrip:case this.topRightGrip:t.width+n>this.canvasWidth*this.zoomFactor&&(n=this.canvasWidth*this.zoomFactor-t.width),t.width+=n}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(t.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(n),t.height=this.aspectRatio.getVerticalLength(t.width)):(t.y+=r,t.height=this.cropRect.y+this.cropRect.height-t.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?t.height=this.aspectRatio.getVerticalLength(t.width):t.height+=r}t.width<10&&(t.x=this.cropRect.x,t.width=10),t.height<10&&(t.y=this.cropRect.y,t.height=10),this.previousPoint=e,t.x>=this.margin&&t.y>=this.margin&&t.x-this.margin+t.width<=this.canvasWidth&&t.y-this.margin+t.height<=this.canvasHeight&&(this.cropRect=t,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},e.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var e=this.cropRect.x+this.cropRect.width/2,t=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=e-this.cropRect.width/2,this.cropRect.y=t-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},e.prototype.getRescaledRect=function(e,t,n,r,i,o){var a=n/e,s=r/t;return{x:(i.x-o)*a+o,y:(i.y-o)*s+o,width:i.width*a,height:i.height*s}},e.prototype.scaleCanvas=function(e,t){var n=this.getRescaledRect(this.canvasWidth,this.canvasHeight,e,t,this.cropRect,this.margin);this.canvasWidth=e,this.canvasHeight=t,this.onCropChange&&this.onCropChange(n),this.setCropRectangle(n)},e}(),Ze=function(){function e(e){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=e,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(e.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),e.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},e.prototype.onPointerDown=function(e){this.controlContainer.setPointerCapture(e.pointerId),this.isDragging=!0,this.previousPoint={x:e.clientX,y:e.clientY}},e.prototype.onPointerMove=function(e){this.isDragging&&(this.onAngleChange&&this.onAngleChange((e.clientX-this.previousPoint.x)/5),this.previousPoint.x=e.clientX)},e.prototype.onPointerUp=function(e){this.isDragging&&this.onAngleChange&&this.onAngleChange((e.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(e.pointerId)},e.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var e=this.angleLabelText.getBBox();Be.setAttributes(this.angleLabelElement,[["x",((this.width-e.width)/2).toString()],["y",(this.height/2).toString()]])}},e.prototype.positionScaleShape=function(){if(this.scaleShape){var e=this.scaleShape.transform.baseVal.getItem(0);e.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(e,0)}},e.prototype.getVisual=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("width",this.width+"px"),e.setAttribute("height",this.height+"px"),e.setAttribute("viewBox","0 0 "+this.width+" "+this.height),e.style.flexShrink="0",document.body.appendChild(e);for(var t="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;t+="h4v"+-r+"h1v"+r}t+="v1H0Z",this.scaleShape=Be.createPath(t);var i=Be.createTransform();this.scaleShape.transform.baseVal.appendItem(i),e.appendChild(this.scaleShape),this.angleLabelElement=Be.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Be.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var o=Be.createTSpan("");return o.innerHTML="&deg;",this.angleLabelElement.appendChild(o),e.appendChild(this.angleLabelElement),document.body.removeChild(e),e},e}(),Qe=function(){function e(){this.naturalSize=!1,this.imageType="image/png"}return e.prototype.rasterize=function(e,t,n,r,i,o,a){var s=this;return new Promise((function(l){var c=document.createElement("canvas");c.width=e.width.baseVal.value-2*r,c.height=e.height.baseVal.value-2*r;var u=1,h=1;!0===s.naturalSize?(u=t.naturalWidth/(e.width.baseVal.value-2*r)/o,h=t.naturalHeight/(e.height.baseVal.value-2*r)/a,c.width=t.naturalWidth/o,c.height=t.naturalHeight/a):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(o,a),d.translate(-c.width/2,-c.height/2),d.drawImage(t,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))}))},e}(),et=function(){function e(t){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=e.instanceCounter++,this.styles=new Fe(this.instanceNo),this.target=t,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(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(e){this._zoomToCropEnabled=e,e?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(e){this._isGridVisible=e,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gridLines",{get:function(){return this._gridLines},set:function(e){this._gridLines=e,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(e){this._rotationAngle=e,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){var e;return null!==(e=this._aspectRatio)&&void 0!==e?e:this.aspectRatios[0]},set:function(e){this._aspectRatio=e},enumerable:!1,configurable:!0}),e.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},e.prototype.show=function(){this.showUI(),this.open()},e.prototype.close=function(e){void 0===e&&(e=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.displayMode&&window.removeEventListener("resize",this.setWindowHeight),e||this.closeEventListeners.forEach((function(e){return e()})),this._isOpen=!1)},e.prototype.addRenderEventListener=function(e){this.renderEventListeners.push(e)},e.prototype.removeRenderEventListener=function(e){this.renderEventListeners.indexOf(e)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(e),1)},e.prototype.addCloseEventListener=function(e){this.closeEventListeners.push(e)},e.prototype.removeCloseEventListener=function(e){this.closeEventListeners.indexOf(e)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(e),1)},e.prototype.setupResizeObserver=function(){var e=this;"inline"===this.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){e.resize(e.target.clientWidth,e.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))},e.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var e=1*this.target.clientWidth/this.target.clientHeight,t=this.contentDiv.clientWidth/e>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*e:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,n=t+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/e;this.resize(t,n)}},e.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},e.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",Be.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},e.prototype.resize=function(e,t){this.imageWidth=Math.round(e),this.imageHeight=Math.round(t),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px","popup"!==this.displayMode?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},e.prototype.setEditingTarget=function(){var e=document.createElement("canvas");e.width=this.target.naturalWidth,e.height=this.target.naturalHeight,e.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var t=e.toDataURL();Be.setAttributes(this.editingTarget,[["href",t]]),this.setEditingTargetSize()},e.prototype.setTopLeft=function(){var e=this.target.getBoundingClientRect(),t=this.editorCanvas.getBoundingClientRect();this.left=e.left-t.left-this.CANVAS_MARGIN,this.top=e.top-t.top-this.CANVAS_MARGIN},e.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=Be.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Be.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Be.createGroup(),this.editingTargetRotationScaleContainer=Be.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var e=Be.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(e);var t=Be.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(t),this.editingTargetContainer=Be.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)},e.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},e.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Be.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Je(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()},e.prototype.zoomToCrop=function(){if(this.cropRect){var e=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,t=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=e+"px "+t+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-e+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-t+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},e.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)},e.prototype.cropRectChanged=function(e){this.cropRect=e,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},e.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},e.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"},e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},e.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 e=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,t=this.target.offsetTop>e+this.CANVAS_MARGIN?this.target.offsetTop-(e+this.CANVAS_MARGIN):0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=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},e.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},e.prototype.addTopToolbar=function(){var e=this;this.topToolbar=new ze,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var t=new Ve;t.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(t);var n=[];this.aspectRatios.forEach((function(t){var r=new We(Xe.getIcon(t.horizontal,t.vertical),0===t.horizontal&&0===t.vertical?"FREE":t.horizontal+":"+t.vertical);r.onClick=function(){return e.ratioButtonClicked(t)},n.push(r)})),this.aspectRatioButton=new Ye(Xe.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,t.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var r=new We('<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(){e.isGridVisible=!e.isGridVisible,r.isActive=e.isGridVisible},t.addButton(r);var i=new We('<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(){e.zoomToCropEnabled=!e.zoomToCropEnabled,i.isActive=e.zoomToCropEnabled},t.addButton(i),!je.isLicensed){var o=new Ke;this.topToolbar.addElementBlock(o);var a=document.createElement("div");a.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>',a.appendChild(s),o.addElement(a)}var l=new Ve;l.minWidth=3*this.toolbarHeight+"px",l.contentAlign="end",this.topToolbar.addButtonBlock(l);var c=new We('<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 We('<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)},e.prototype.addBottomToolbar=function(){var e=this;this.bottomToolbar=new ze,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var t=new Ve;t.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(t);var n=new We('<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,t.addButton(n);var r=new We('<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,t.addButton(r);var i=new Ke;i.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(i),this.straightener=new Ze("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(t){e.rotateBy(t),e.straightener.angle=e.rotationAngle},i.addElement(this.straightener.getUI());var o=new Ve;o.minWidth=2*this.toolbarHeight+"px",o.contentAlign="end",this.bottomToolbar.addButtonBlock(o);var a=new We('<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");a.onClick=this.flipHorizontallyButtonClicked,o.addButton(a);var s=new We('<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,o.addButton(s)},e.prototype.ratioButtonClicked=function(e){this.aspectRatio=e,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},e.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Xe.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},e.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&0!==this.aspectRatio.horizontal&&0!==this.aspectRatio.vertical?this.cropLayer.aspectRatio=new qe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},e.prototype.closeUI=function(){"popup"===this.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},e.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},e.prototype.restoreState=function(e){if(e){var t=this.cropLayer.getRescaledRect(e.width,e.height,this.imageWidth,this.imageHeight,e.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(t),this.cropRectChanged(t),this.flippedHorizontally=e.flippedHorizontally,this.flippedVertically=e.flippedVertically,this.applyFlip(),this.rotationAngle=e.rotationAngle,this.applyRotation()}},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.cropImage.getBoundingClientRect();return{x:e-n.left,y:t-n.top}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var e=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=e+"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()},e.prototype.rotateLeftButtonClicked=function(){var e=this.rotationAngle-90;this.rotationAngle%90!=0&&(e+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(e)},e.prototype.rotateRightButtonClicked=function(){var e=this.rotationAngle+90;this.rotationAngle%90!=0&&(e-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(e)},e.prototype.rotateTo=function(e){e=(e=e>180?e-360:e)<=-180?e+360:e,this.rotationAngle=e,this.applyRotation()},e.prototype.rotateBy=function(e){this.rotateTo((this.rotationAngle+e)%360)},e.prototype.applyRotation=function(){var e=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var t=this.editingTargetRotationContainer.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(t,0);var 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=e},e.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},e.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},e.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},e.prototype.startRenderAndClose=function(){return Ne(this,void 0,void 0,(function(){var e,t;return Pe(this,(function(n){switch(n.label){case 0:return[4,this.render()];case 1:return e=n.sent(),t=this.getState(),this.renderEventListeners.forEach((function(n){return n(e,t)})),this.close(!0),[2]}}))}))},e.prototype.render=function(){return Ne(this,void 0,void 0,(function(){var e;return Pe(this,(function(t){switch(t.label){case 0:return(e=new Qe).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.width=this.renderWidth,e.height=this.renderHeight,this.unzoomFromCrop(),Be.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,e.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return t.sent(),[4,e.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,t.sent()]}}))}))},e.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ge("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 Ge("toolbar_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new Ge("toolbar-block","\n display: flex;\n align-items: center;\n box-sizing: content-box;\n "));var e=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ge("toolbar_button","\n display: inline-block;\n width: "+(this.toolbarHeight-2*e)+"px;\n height: "+(this.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ge("toolbar_button_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ge("toolbar_active_button","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n background-color: "+this.styles.settings.toolbarBackgroundActiveColor+"\n ")),this.styles.addRule(new Ue("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Ue("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.styles.settings.toolbarBackgroundHoverColor+"\n ")),this.toolbarDropdownStyleClass=this.styles.addClass(new Ge("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 Ge("toolbar_dropdown_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ge("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 Ge("toolbar_straightener","\n display: flex;\n overflow: hidden;\n justify-content: center;\n height: "+(this.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ge("toolbar_straightener_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n "))},e.instanceCounter=0,e}(),tt=n("8hTe"),nt=n.n(tt),rt=/<pre[^>]*>/g;t.a=function(e){var t=e.value,n=void 0===t?"":t,l=e.edit,d=void 0!==l&&l,f=e.className,p=e.showTextOnly,m=e.showLines,g=e.replaces,v=e.zoomImg,y=e.hasMask,x=e.style,w=void 0===x?{}:x,S=e.stylesPrev,k=void 0===S?{}:S,O=String(n),A=Object(u.useRef)(),L=Object(u.useRef)(),R=Object(u.useState)(""),I=Object(s.a)(R,2),F=I[0],U=I[1],G=Object(u.useState)("office"),z=Object(s.a)(G,2),H=z[0],V=z[1],W=Object(u.useMemo)((function(){try{O=(O=O.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(e){}var e=D(O),t=C;if(O.match(/\[TOC\]/)&&(e=e.replace("<p>[TOC]</p>",E()),b()),e=(e=e.replace(/(__special_katext_id_\d+__)/g,(function(e,n){var r=t[n],i=r.type,o=r.expression;return Object(P.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(o)||"",{displayMode:"block"===i,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),T(),p){var n=document.createElement("div");return n.innerHTML=e,n.innerText}return setTimeout((function(){return X()}),500),e}),[O]),K=Object(u.useRef)();function q(e){var t=e.target;if("IMG"===t.tagName.toUpperCase()){if(v){var n=t.getAttribute("src");U(n),V("image")}}else if("A"===t.tagName.toUpperCase()){var r=t.getAttribute("href");if(r.indexOf("office")>-1)e.preventDefault(),U(r),V("office");else if(r.indexOf("application/pdf")>-1)e.preventDefault(),U(r),V("pdf");else if(r.indexOf("type=text")>-1)e.preventDefault(),U(r),V("html");else if(r.startsWith("#")){e.preventDefault();var i=document.getElementById(r.replace("#",""));i&&i.scrollIntoView(!0)}}}_.WebkitLineClamp=m,m&&(w=Object(o.a)(Object(o.a)({},w),_));var X=function(){var e,t=null===(e=K.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(M.a.isSupported()){var t=new M.a;t.loadSource(e.src),t.attachMedia(e)}}))};Object(u.useEffect)((function(){if(K.current&&W&&W.match(rt)&&window.PR.prettyPrint(),K.current)return K.current.addEventListener("click",q),function(){K.current.removeEventListener("click",q),T(),b()}}),[W,K.current,q]);return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:K,style:Object(o.a)({},w),className:"".concat(f||""," markdown-body ").concat(nt.a.mdBody),onMouseOver:function(e){d&&("IMG"===e.target.nodeName?(A.current.style.display="flex",A.current.style.width=e.target.clientWidth+"px",A.current.style.height=e.target.clientHeight+"px",A.current.style.top=e.target.offsetTop+"px",A.current.style.left=e.target.offsetLeft+"px",L.current.src=e.target.getAttribute("src")):A.current.style.display="none")},dangerouslySetInnerHTML:{__html:W}}),h.a.createElement("div",{ref:A,className:nt.a.button},h.a.createElement(r.a,null,h.a.createElement(i.a,{onClick:function(){return(e=new et(L.current)).displayMode="popup",e.addRenderEventListener(function(){var e=Object(a.a)(c.a.mark((function e(t){var n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A.current.style.display="none",e.next=3,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:t}});case 3:null!=(n=e.sent)&&n.id&&g(L.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 e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),void e.show();var e}},"裁剪"),h.a.createElement(i.a,{onClick:function(){return(e=new De(L.current)).settings.displayMode="popup",e.addEventListener("render",function(){var e=Object(a.a)(c.a.mark((function e(t){var n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(A.current.style.display="none",!L.current){e.next=6;break}return e.next=4,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:t.dataUrl}});case 4:null!=(n=e.sent)&&n.id&&g(L.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 e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.show(),void(window.markerArea=e);var e}},"编辑"))),h.a.createElement("img",{ref:L,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(j.a,{close:!0,data:F,hasMask:y,type:null!=F&&F.length?H:"",style:Object(o.a)({},k),onClose:function(){return U("")}}))}},"9VGf":
/*!****************************************!*\
!*** ./src/components/useInterval.tsx ***!
\****************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(/*! react */"q1tI");function i(e,t){var n=Object(r.useRef)();Object(r.useEffect)((function(){n.current=e})),Object(r.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])}},AMnG:
/*!*********************************************************************!*\
!*** ./src/pages/tasks/left-panel/discuss/discuss-editor/index.tsx ***!
\*********************************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,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"),o=n(/*! react */"q1tI"),a=n.n(o),s=(n(/*! ./index.less */"nWbc"),n(/*! @/components/markdown-editor */"Ot1p"));t.a=function(e){var t=e.id,n=e.activeDiscussIndex,l=e.onReplyDiscuss,c=Object(o.useState)(""),u=Object(i.a)(c,2),h=u[0],d=u[1];return a.a.createElement("div",{key:t,className:"discuss-item-editor",style:{display:n===t?"block":"none",width:"100%"}},a.a.createElement(s.a,{miniToolbar:!0,startInit:n===t,defaultValue:h,id:t,noStorage:!0,watch:!1,height:155,placeholder:"我要回复",showResizeBar:!0,onChange:function(e){d(e)}}),a.a.createElement("a",{onClick:function(){h?(l(t,h),d("")):r.b.info("回复内容不能为空!")},className:"btn-send"},"发送"))}},Aky1:
/*!***********************************!*\
!*** ./src/utils/aliyunUpload.ts ***!
\***********************************/
/*! exports provided: getUploader */
/*! exports used: getUploader */function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r,i=n(/*! @/utils/fetch */"ErOA"),o=n(/*! aliyun-vod-upload-ll */"ppsT"),a=n.n(o),s="",l="";function c(e){!function(e){r=new a.a.Vod({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:0x6803cbd867207,enableUploadProgress:!1,addFileSuccess:function(t){console.log("addFileSuccess: "+t.file.name),e.addFileSuccess&&e.addFileSuccess(t),r.startUpload()},onUploadstarted:function(t){var n=t.file.name;if(t.videoId){var o="/api/users/".concat(s,"/video_auths.json");Object(i.a)(o,{method:"put",body:{video_id:t.videoId,title:n,file_name:n,virtual_classroom_id:l}}).then((function(n){if(-1!=n.status){var i=n.data,o=i.UploadAuth,a=i.UploadAddress;i.VideoId;r.setUploadAuthAndAddress(t,o,a)}else e.onUploadError&&e.onUploadError(t)})).catch((function(e){r.deleteFile(r._curIndex),r.nextUpload(),console.log(e)}))}else{var a="/api/users/".concat(s,"/video_auths.json");Object(i.a)(a,{method:"Post",body:{title:""+n,file_name:""+n,virtual_classroom_id:l}}).then((function(e){if(e){var n=e.data,i=n.UploadAuth,o=n.UploadAddress,a=n.VideoId;r.setUploadAuthAndAddress(t,i,o,a)}})).catch((function(e){r.deleteFile(r._curIndex),r.nextUpload(),console.log(e)})),console.log("文件开始上传...")}},onUploadSucceed:function(t){e.onUploadSucceed&&e.onUploadSucceed(t),console.log("文件上传成功!")},onUploadFailed:function(t,n,r){e.onUploadFailed&&e.onUploadFailed(t),console.log("文件上传失败!")},onUploadCanceled:function(e,t,n){console.log("文件上传已暂停!")},onUploadProgress:function(t,n,r){e.onUploadProgress&&e.onUploadProgress(t,n,r);Math.ceil(100*r);console.log("文件上传中...")},onUploadTokenExpired:function(e){console.log("文件上传超时!");var t="/api/users/".concat(s,"/video_auths.json");Object(i.a)(t,{method:"put",body:{video_id:e.videoId}}).then((function(e){var t=e.data.UploadAuth;r.resumeUploadWithAuth(t)})).catch((function(e){console.log(e)}))},onUploadEnd:function(t){e.onUploadEnd&&e.onUploadEnd(t),console.log("onUploadEnd: uploaded all the files")}}),e.gotUploader&&e.gotUploader(r)}(e)}function u(e,t,n){e&&(s=e),t&&(l=t),c(n)}},BU3w:
/*!***************************************************!*\
!*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***!
\***************************************************/
/*! exports provided: injectCSS, updateCSS */
/*! exports used: updateCSS */function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(/*! ./canUseDom */"MNnm");function i(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(r.a)())return null;var o,a=document.createElement("style");(null===(t=n.csp)||void 0===t?void 0:t.nonce)&&(a.nonce=null===(o=n.csp)||void 0===o?void 0:o.nonce);a.innerHTML=e;var s=i(n),l=s.firstChild;return n.prepend&&s.prepend?s.prepend(a):n.prepend&&l?s.insertBefore(a,l):s.appendChild(a),a}var a=new Map;function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i(n);if(!a.has(r)){var s=o("",n),l=s.parentNode;a.set(r,l),l.removeChild(s)}var c=Array.from(a.get(r).children).find((function(e){return"STYLE"===e.tagName&&e["rc-util-key"]===t}));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!==e&&(c.innerHTML=e),c}var f=o(e,n);return f["rc-util-key"]=t,f}},Bd2K:
/*!********************************************************!*\
!*** ./node_modules/codemirror/addon/edit/closetag.js ***!
\********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){e.defineOption("autoCloseTags",!1,(function(a,s,l){if(l!=e.Init&&l&&a.removeKeyMap("autoCloseTags"),s){var c={name:"autoCloseTags"};"object"==typeof s&&!1===s.whenClosing||(c["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}(t)}),"object"==typeof s&&!1===s.whenOpening||(c["'>'"]=function(r){return function(r){if(r.getOption("disableInput"))return e.Pass;for(var a=r.listSelections(),s=[],l=r.getOption("autoCloseTags"),c=0;c<a.length;c++){if(!a[c].empty())return e.Pass;var u=a[c].head,h=r.getTokenAt(u),d=e.innerMode(r.getMode(),h.state),f=d.state,p=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(f),m=p&&p.name;if(!m)return e.Pass;var g="html"==d.mode.configuration,v="object"==typeof l&&l.dontCloseTags||g&&t,y="object"==typeof l&&l.indentTags||g&&n;h.end>u.ch&&(m=m.slice(0,m.length-h.end+u.ch));var b=m.toLowerCase();if(!m||"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||o(r,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f)||[],m,u,!0))return e.Pass;var _="object"==typeof l&&l.emptyTags;if(_&&i(_,m)>-1)s[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)};else{var E=y&&i(y,b)>-1;s[c]={indent:E,text:">"+(E?"\n\n":"")+"</"+m+">",newPos:E?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)}}}var x="object"==typeof l&&l.dontIndentOnAutoClose;for(c=a.length-1;c>=0;c--){var w=s[c];r.replaceRange(w.text,a[c].head,a[c].anchor,"+insert");var S=r.listSelections().slice(0);S[c]={head:w.newPos,anchor:w.newPos},r.setSelections(S),!x&&w.indent&&(r.indentLine(w.newPos.line,null,!0),r.indentLine(w.newPos.line+1,null,!0))}}(r)}),a.addKeyMap(c)}}));var t=["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(t,n){for(var r=t.listSelections(),i=[],a=n?"/":"</",s=t.getOption("autoCloseTags"),l="object"==typeof s&&s.dontIndentOnSlash,c=0;c<r.length;c++){if(!r[c].empty())return e.Pass;var u=r[c].head,h=t.getTokenAt(u),d=e.innerMode(t.getMode(),h.state),f=d.state;if(n&&("string"==h.type||"<"!=h.string.charAt(0)||h.start!=u.ch-1))return e.Pass;var p,m="xml"!=d.mode.name&&"htmlmixed"==t.getMode().name;if(m&&"javascript"==d.mode.name)p=a+"script";else if(m&&"css"==d.mode.name)p=a+"style";else{var g=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f);if(!g||g.length&&o(t,g,g[g.length-1],u))return e.Pass;p=a+g[g.length-1]}">"!=t.getLine(u.line).charAt(h.end)&&(p+=">"),i[c]=p}if(t.replaceSelections(i),r=t.listSelections(),!l)for(c=0;c<r.length;c++)(c==r.length-1||r[c].head.line<r[c+1].head.line)&&t.indentLine(r[c].head.line)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;++n)if(e[n]==t)return n;return-1}function o(t,n,r,i,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,i.line+500),s=e.scanForClosingTag(t,i,null,a);if(!s||s.tag!=r)return!1;for(var l=o?1:0,c=n.length-1;c>=0&&n[c]==r;c--)++l;for(i=s.to,c=1;c<l;c++){var u=e.scanForClosingTag(t,i,null,a);if(!u||u.tag!=r)return!1;i=u.to}return!0}e.commands.closeTag=function(e){return r(e)}}(n(/*! ../../lib/codemirror */"VrN/"),n(/*! ../fold/xml-fold */"osHv"))},BdwD:
/*!*****************************************!*\
!*** ./src/components/NoData/index.tsx ***!
\*****************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,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"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),a=n(/*! react */"q1tI"),s=n.n(a),l=n(/*! @/assets/images/icons/nodata.png */"FOrL"),c=n.n(l);t.a=function(e){var t=e.buttonProps,n=void 0===t?{}:t,a=e.styles,l=void 0===a?{}:a,u=e.customText,h=e.ButtonText,d=e.ButtonClick,f=e.Buttonclass,p=e.ButtonTwo;return s.a.createElement("section",{className:"tc animated fadeIn",style:Object(o.a)(Object(o.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(e,t,n){"use strict";function r(e){var t=!0;if(e.length>0){for(var n=0;n<e.length;n++)if(0==e[n].compile_success||!e[n].compile_success){t=!1;break}}else t=!1;return t}function i(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],r=0;r<e.length;r++){var i=e[r],o=t?"".concat(t,"/").concat(i.name):"".concat(i.name);n.push({title:i.name,isLeaf:"tree"!==i.type,key:o})}return n}function o(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(i.key===t){i.children=n;break}i.children&&o(i.children,t,n)}return e}function a(e,t,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||e.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,t),s&&e.apply(i,o)}}n.d(t,"d",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"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(e,t,n){},CNDd:
/*!***************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/c1.svg ***!
\***************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/c1.7850f139.svg"},CaVn:
/*!******************************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/index.less?modules ***!
\******************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___2wZ0h",flex_space_between:"flex_space_between___3MVWH",flex_box_vertical_center:"flex_box_vertical_center___O0jNB",flex_box_center_end:"flex_box_center_end___2q4xj",flex_box_column:"flex_box_column___13R-8",listDetails:"listDetails___3lMam",head:"head___2jzWe",name:"name___3xIfG",title:"title___3-ce8",a:"a___1ZME1",b:"b___oiiqU",tag:"tag___32Ulf",btn:"btn___lJ5fA",scroll:"scroll___anvih",video:"video___1gujl",html:"html___z0BU7",g:"g___3sfQf",btns:"btns___OWbut"}},CrYA:
/*!*******************************************************!*\
!*** ./node_modules/store/storages/sessionStorage.js ***!
\*******************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r=n(/*! ../src/util */"MFOe").Global;function i(){return r.sessionStorage}function o(e){return i().getItem(e)}e.exports={name:"sessionStorage",read:o,write:function(e,t){return i().setItem(e,t)},each:function(e){for(var t=i().length-1;t>=0;t--){var n=i().key(t);e(o(n),n)}},remove:function(e){return i().removeItem(e)},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(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function h(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?f(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=n(/*! react */"q1tI"),y=(n(/*! prop-types */"17x9"),n(/*! qr.js/lib/QRCode */"H38U")),b=n(/*! qr.js/lib/ErrorCorrectLevel */"aRTE");function _(e){for(var t="",n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r<2048?(t+=String.fromCharCode(192|r>>6),t+=String.fromCharCode(128|63&r)):r<55296||r>=57344?(t+=String.fromCharCode(224|r>>12),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|63&r)):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t+=String.fromCharCode(240|r>>18),t+=String.fromCharCode(128|r>>12&63),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|63&r))}return t}var E={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1};function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return e.forEach((function(e,r){var i=null;e.forEach((function(o,a){if(!o&&null!==i)return n.push("M".concat(i+t," ").concat(r+t,"h").concat(a-i,"v1H").concat(i+t,"z")),void(i=null);if(a!==e.length-1)o&&null===i&&(i=a);else{if(!o)return;null===i?n.push("M".concat(a+t,",").concat(r+t," h1v1H").concat(a+t,"z")):n.push("M".concat(i+t,",").concat(r+t," h").concat(a+1-i,"v1H").concat(i+t,"z"))}}))})),n.join("")}function w(e,t){return e.slice().map((function(e,n){return n<t.y||n>=t.y+t.h?e:e.map((function(e,n){return(n<t.x||n>=t.x+t.w)&&e}))}))}function S(e,t){var n=e.imageSettings,r=e.size,i=e.includeMargin;if(null==n)return null;var o=i?4:0,a=t.length+2*o,s=Math.floor(.1*r),l=a/r,c=(n.width||s)*l,u=(n.height||s)*l,h=null==n.x?t.length/2-c/2:n.x*l,d=null==n.y?t.length/2-u/2:n.y*l,f=null;if(n.excavate){var p=Math.floor(h),m=Math.floor(d);f={x:p,y:m,w:Math.ceil(c+h-p),h:Math.ceil(u+d-m)}}return{x:h,y:d,h:u,w:c,excavation:f}}var k=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}(),C=function(e){function t(){var e,n;l(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return g(f(n=h(this,(e=d(t)).call.apply(e,[this].concat(i)))),"_canvas",void 0),g(f(n),"_image",void 0),g(f(n),"state",{imgLoaded:!1}),g(f(n),"handleImageLoad",(function(){n.setState({imgLoaded:!0})})),n}return p(t,e),u(t,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var e=this.props,t=e.value,n=e.size,r=e.level,i=e.bgColor,o=e.fgColor,a=e.includeMargin,s=e.imageSettings,l=new y(-1,b[r]);if(l.addData(_(t)),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=a?4:0,f=h.length+2*d,p=S(this.props,h);null!=s&&null!=p&&null!=p.excavation&&(h=w(h,p.excavation));var m=window.devicePixelRatio||1;c.height=c.width=n*m;var g=n/f*m;u.scale(g,g),u.fillStyle=i,u.fillRect(0,0,f,f),u.fillStyle=o,k?u.fill(new Path2D(x(h,d))):h.forEach((function(e,t){e.forEach((function(e,n){e&&u.fillRect(n+d,t+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 e=this,t=this.props,n=(t.value,t.size),r=(t.level,t.bgColor,t.fgColor,t.style),o=(t.includeMargin,t.imageSettings),l=s(t,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),c=a({height:n,width:n},r),u=null,h=o&&o.src;return null!=o&&null!=h&&(u=v.createElement("img",{src:h,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(t){return e._image=t}})),v.createElement(v.Fragment,null,v.createElement("canvas",i({style:c,height:n,width:n,ref:function(t){return e._canvas=t}},l)),u)}}]),t}(v.PureComponent);g(C,"defaultProps",E);var T=function(e){function t(){return l(this,t),h(this,d(t).apply(this,arguments))}return p(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.value,n=e.size,r=e.level,o=e.bgColor,a=e.fgColor,l=e.includeMargin,c=e.imageSettings,u=s(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),h=new y(-1,b[r]);h.addData(_(t)),h.make();var d=h.modules;if(null===d)return null;var f=l?4:0,p=d.length+2*f,m=S(this.props,d),g=null;null!=c&&null!=m&&(null!=m.excavation&&(d=w(d,m.excavation)),g=v.createElement("image",{xlinkHref:c.src,height:m.h,width:m.w,x:m.x+f,y:m.y+f,preserveAspectRatio:"none"}));var E=x(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:o,d:"M0,0 h".concat(p,"v").concat(p,"H0z")}),v.createElement("path",{fill:a,d:E}),g)}}]),t}(v.PureComponent);g(T,"defaultProps",E);var O=function(e){var t=e.renderAs,n=s(e,["renderAs"]),r="svg"===t?T:C;return v.createElement(r,n)};O.defaultProps=a({renderAs:"canvas"},E),e.exports=O},DlQD:
/*!*******************************************!*\
!*** ./node_modules/marked/lib/marked.js ***!
\*******************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[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=e[Symbol.iterator]()).next.bind(r)}var r=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){function t(){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}}e.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:t,changeDefaults:function(t){e.exports.defaults=t}}})),i=(r.defaults,r.getDefaults,r.changeDefaults,/[&<>"']/),o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},c=function(e){return l[e]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var d=/(^|[^\[])\^/g,f=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,m={},g=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(e,t){m[" "+e]||(g.test(e)?m[" "+e]=e+"/":m[" "+e]=_(e,"/",!0));var n=-1===(e=m[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(v,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(y,"$1")+t:e+t}function _(e,t,n){var r=e.length;if(0===r)return"";for(var i=0;i<r;){var o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.substr(0,r-i)}var E=function(e,t){if(t){if(i.test(e))return e.replace(o,c)}else if(a.test(e))return e.replace(s,c);return e},x=h,w=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,r){return r=(r=r.source||r).replace(d,"$1"),e=e.replace(t,r),n},getRegex:function(){return new RegExp(e,t)}};return n},S=function(e,t,n){if(e){var r;try{r=decodeURIComponent(h(n)).replace(f,"").toLowerCase()}catch(e){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!p.test(n)&&(n=b(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},k={exec:function(){}},C=function(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},T=function(e,t){var n=e.replace(/\|/g,(function(e,t,n){for(var r=!1,i=t;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},O=_,A=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,r=0,i=0;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&--r<0)return i;return-1},L=function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},R=r.defaults,D=O,I=T,M=E,N=A;function P(e,t,n){var r=t.href,i=t.title?M(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:i,text:o}:{type:"image",raw:n,href:r,title:i,text:M(o)}}var j=function(){function e(e){this.options=e||R}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e,t){var n=this.rules.block.code.exec(e);if(n){var r=t[t.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:D(i,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=r.length?e.slice(r.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:r}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:I(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[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]=I(n.cells[r],n.header.length);return n}}},t.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},t.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){for(var n,r,i,o,a,s,l,c=t[0],u=t[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=t[0].match(this.rules.block.item),m=!1,g=p.length,v=0;v<g;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!==g-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)&&(o=p.slice(v+1).join("\n"),f.raw=f.raw.substring(0,f.raw.length-o.length),v=g-1)),a=m||/\n\n(?!\s*$)/.test(n),v!==g-1&&(m="\n"===n.charAt(n.length-1),a||(a=m)),a&&(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:a,text:n});return f}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):M(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:I(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[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]=I(n.cells[r].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}},t.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}},t.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}},t.text=function(e,t){var n=this.rules.block.text.exec(e);if(n){var r=t[t.length-1];return r&&"text"===r.type?{raw:n[0],text:n[0]}:{type:"text",raw:n[0],text:n[0]}}},t.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:M(t[1])}},t.tag=function(e,t,n){var r=this.rules.inline.tag.exec(e);if(r)return!t&&/^<a /i.test(r[0])?t=!0:t&&/^<\/a>/i.test(r[0])&&(t=!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:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):M(r[0]):r[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=N(t[2],"()");if(n>-1){var r=(0===t[0].indexOf("!")?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,r).trim(),t[3]=""}var i=t[2],o="";if(this.options.pedantic){var a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a?(i=a[1],o=a[3]):o=""}else o=t[3]?t[3].slice(1,-1):"";return P(t,{href:(i=i.trim().replace(/^<([\s\S]*)>$/,"$1"))?i.replace(this.rules.inline._escapes,"$1"):i,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=t[r.toLowerCase()])||!r.href){var i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return P(n,r,n[0])}},t.strong=function(e,t,n){void 0===n&&(n="");var r=this.rules.inline.strong.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,o="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(r=o.exec(t));)if(i=this.rules.inline.strong.middle.exec(t.slice(0,r.index+3)))return{type:"strong",raw:e.slice(0,i[0].length),text:e.slice(2,i[0].length-2)}}},t.em=function(e,t,n){void 0===n&&(n="");var r=this.rules.inline.em.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,o="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(r=o.exec(t));)if(i=this.rules.inline.em.middle.exec(t.slice(0,r.index+2)))return{type:"em",raw:e.slice(0,i[0].length),text:e.slice(1,i[0].length-1)}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[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:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}},t.autolink=function(e,t){var n,r,i=this.rules.inline.autolink.exec(e);if(i)return r="@"===i[2]?"mailto:"+(n=M(this.options.mangle?t(i[1]):i[1])):n=M(i[1]),{type:"link",raw:i[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var r,i;if("@"===n[2])i="mailto:"+(r=M(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==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}]}}},t.inlineText=function(e,t,n){var r,i=this.rules.inline.text.exec(e);if(i)return r=t?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}},e}(),B=k,F=w,U=C,G={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:B,table:B,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?'|\([^()]*\))/};G.def=F(G.def).replace("label",G._label).replace("title",G._title).getRegex(),G.bullet=/(?:[*+-]|\d{1,9}[.)])/,G.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,G.item=F(G.item,"gm").replace(/bull/g,G.bullet).getRegex(),G.list=F(G.list).replace(/bull/g,G.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+G.def.source+")").getRegex(),G._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",G._comment=/<!--(?!-?>)[\s\S]*?-->/,G.html=F(G.html,"i").replace("comment",G._comment).replace("tag",G._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),G.paragraph=F(G._paragraph).replace("hr",G.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",G._tag).getRegex(),G.blockquote=F(G.blockquote).replace("paragraph",G.paragraph).getRegex(),G.normal=U({},G),G.gfm=U({},G.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*|$)"}),G.gfm.nptable=F(G.gfm.nptable).replace("hr",G.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",G._tag).getRegex(),G.gfm.table=F(G.gfm.table).replace("hr",G.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",G._tag).getRegex(),G.pedantic=U({},G.normal,{html:F("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",G._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:B,paragraph:F(G.normal._paragraph).replace("hr",G.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",G.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,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:B,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};z.punctuation=F(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",z.em.start=F(z.em.start).replace(/punctuation/g,z._punctuation).getRegex(),z.em.middle=F(z.em.middle).replace(/punctuation/g,z._punctuation).replace(/overlapSkip/g,z._overlapSkip).getRegex(),z.em.endAst=F(z.em.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.em.endUnd=F(z.em.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.start=F(z.strong.start).replace(/punctuation/g,z._punctuation).getRegex(),z.strong.middle=F(z.strong.middle).replace(/punctuation/g,z._punctuation).replace(/blockSkip/g,z._blockSkip).getRegex(),z.strong.endAst=F(z.strong.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.endUnd=F(z.strong.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=F(z._blockSkip,"g").getRegex(),z.overlapSkip=F(z._overlapSkip,"g").getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,z.autolink=F(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=F(z.tag).replace("comment",G._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=F(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=F(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=F(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=U({},z),z.pedantic=U({},z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:F(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=U({},z.normal,{escape:F(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),z.gfm.url=F(z.gfm.url,"i").replace("email",z.gfm._extended_email).getRegex(),z.breaks=U({},z.gfm,{br:F(z.br).replace("{2,}","*").getRegex(),text:F(z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var H={block:G,inline:z},V=r.defaults,W=H.block,K=H.inline;function q(e){return e.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function X(e){var t,n,r="",i=e.length;for(t=0;t<i;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var Y=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||V,this.options.tokenizer=this.options.tokenizer||new j,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:W.normal,inline:K.normal};this.options.pedantic?(t.block=W.pedantic,t.inline=K.pedantic):this.options.gfm&&(t.block=W.gfm,this.options.breaks?t.inline=K.breaks:t.inline=K.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)};var n,r,i,o=t.prototype;return o.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(e,t,n){var r,i,o,a;for(void 0===t&&(t=[]),void 0===n&&(n=!0),e=e.replace(/^ +$/gm,"");e;)if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e,t))e=e.substring(r.raw.length),r.type?t.push(r):((a=t[t.length-1]).raw+="\n"+r.raw,a.text+="\n"+r.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),o=r.items.length,i=0;i<o;i++)r.items[i].tokens=this.blockTokens(r.items[i].text,[],!1);t.push(r)}else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(n&&(r=this.tokenizer.def(e)))e=e.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(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else if(n&&(r=this.tokenizer.paragraph(e)))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.text(e,t))e=e.substring(r.raw.length),r.type?t.push(r):((a=t[t.length-1]).raw+="\n"+r.raw,a.text+="\n"+r.text);else if(e){var s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}throw new Error(s)}return t},o.inline=function(e){var t,n,r,i,o,a,s=e.length;for(t=0;t<s;t++)switch((a=e[t]).type){case"paragraph":case"text":case"heading":a.tokens=[],this.inlineTokens(a.text,a.tokens);break;case"table":for(a.tokens={header:[],cells:[]},i=a.header.length,n=0;n<i;n++)a.tokens.header[n]=[],this.inlineTokens(a.header[n],a.tokens.header[n]);for(i=a.cells.length,n=0;n<i;n++)for(o=a.cells[n],a.tokens.cells[n]=[],r=0;r<o.length;r++)a.tokens.cells[n][r]=[],this.inlineTokens(o[r],a.tokens.cells[n][r]);break;case"blockquote":this.inline(a.tokens);break;case"list":for(i=a.items.length,n=0;n<i;n++)this.inline(a.items[n].tokens)}return e},o.inlineTokens=function(e,t,n,r,i){var o;void 0===t&&(t=[]),void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===i&&(i="");var a,s=e;if(this.tokens.links){var l=Object.keys(this.tokens.links);if(l.length>0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(s));)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,r))e=e.substring(o.raw.length),n=o.inLink,r=o.inRawBlock,t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,r)),t.push(o);else if(o=this.tokenizer.strong(e,s,i))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.em(e,s,i))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,r),t.push(o);else if(o=this.tokenizer.autolink(e,X))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,X))){if(o=this.tokenizer.inlineText(e,r,q))e=e.substring(o.raw.length),i=o.raw.slice(-1),t.push(o);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(o.raw.length),t.push(o);return t},n=t,i=[{key:"rules",get:function(){return{block:W,inline:K}}}],(r=null)&&e(n.prototype,r),i&&e(n,i),t}(),$=r.defaults,J=S,Z=E,Q=function(){function e(e){this.options=e||$}var t=e.prototype;return t.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);null!=i&&i!==e&&(n=!0,e=i)}return r?'<pre><code class="'+this.options.langPrefix+Z(r,!0)+'">'+(n?e:Z(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Z(e,!0))+"</code></pre>\n"},t.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},t.html=function(e){return e},t.heading=function(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},t.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},t.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},t.listitem=function(e){return"<li>"+e+"</li>\n"},t.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},t.paragraph=function(e){return"<p>"+e+"</p>\n"},t.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},t.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},t.strong=function(e){return"<strong>"+e+"</strong>"},t.em=function(e){return"<em>"+e+"</em>"},t.codespan=function(e){return"<code>"+e+"</code>"},t.br=function(){return this.options.xhtml?"<br/>":"<br>"},t.del=function(e){return"<del>"+e+"</del>"},t.link=function(e,t,n){if(null===(e=J(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<a href="'+Z(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"},t.image=function(e,t,n){if(null===(e=J(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},t.text=function(e){return e},e}(),ee=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),te=function(){function e(){this.seen={}}return e.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),ne=r.defaults,re=x,ie=function(){function e(e){this.options=e||ne,this.options.renderer=this.options.renderer||new Q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ee,this.slugger=new te}e.parse=function(t,n){return new e(n).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,b,_="",E=e.length;for(n=0;n<E;n++)switch((h=e[n]).type){case"space":continue;case"hr":_+=this.renderer.hr();continue;case"heading":_+=this.renderer.heading(this.parseInline(h.tokens),h.depth,re(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue;case"code":_+=this.renderer.code(h.text,h.lang,h.escaped);continue;case"table":for(c="",l="",o=h.header.length,r=0;r<o;r++)l+=this.renderer.tablecell(this.parseInline(h.tokens.header[r]),{header:!0,align:h.align[r]});for(c+=this.renderer.tablerow(l),u="",o=h.cells.length,r=0;r<o;r++){for(l="",a=(s=h.tokens.cells[r]).length,i=0;i<a;i++)l+=this.renderer.tablecell(this.parseInline(s[i]),{header:!1,align:h.align[i]});u+=this.renderer.tablerow(l)}_+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(h.tokens),_+=this.renderer.blockquote(u);continue;case"list":for(d=h.ordered,f=h.start,p=h.loose,o=h.items.length,u="",r=0;r<o;r++)v=(g=h.items[r]).checked,y=g.task,m="",g.task&&(b=this.renderer.checkbox(v),p?g.tokens.length>0&&"text"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(g.tokens,p),u+=this.renderer.listitem(m,y,v);_+=this.renderer.list(u,d,f);continue;case"html":_+=this.renderer.html(h.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1<E&&"text"===e[n+1].type;)u+="\n"+((h=e[++n]).tokens?this.parseInline(h.tokens):h.text);_+=t?this.renderer.paragraph(u):u;continue;default:var x='Token with "'+h.type+'" type was not found.';if(this.options.silent)return void console.error(x);throw new Error(x)}return _},t.parseInline=function(e,t){t=t||this.renderer;var n,r,i="",o=e.length;for(n=0;n<o;n++)switch((r=e[n]).type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:var a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}return i},e}(),oe=C,ae=L,se=E,le=r.getDefaults,ce=r.changeDefaults,ue=r.defaults;function he(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),t=oe({},he.defaults,t||{}),ae(t),n){var r,i=t.highlight;try{r=Y.lex(e,t)}catch(e){return n(e)}var o=function(e){var o;if(!e)try{o=ie.parse(r,t)}catch(t){e=t}return t.highlight=i,e?n(e):n(null,o)};if(!i||i.length<3)return o();if(delete t.highlight,!r.length)return o();var a=0;return he.walkTokens(r,(function(e){"code"===e.type&&(a++,setTimeout((function(){i(e.text,e.lang,(function(t,n){if(t)return o(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),0==--a&&o()}))}),0))})),void(0===a&&o())}try{var s=Y.lex(e,t);return t.walkTokens&&he.walkTokens(s,t.walkTokens),ie.parse(s,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+se(e.message+"",!0)+"</pre>";throw e}}return he.options=he.setOptions=function(e){return oe(he.defaults,e),ce(he.defaults),he},he.getDefaults=le,he.defaults=ue,he.use=function(e){var t=oe({},e);if(e.renderer&&function(){var n=he.defaults.renderer||new Q,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=e.renderer[t].apply(n,o);return!1===s&&(s=r.apply(n,o)),s}};for(var i in e.renderer)r(i);t.renderer=n}(),e.tokenizer&&function(){var n=he.defaults.tokenizer||new j,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=e.tokenizer[t].apply(n,o);return!1===s&&(s=r.apply(n,o)),s}};for(var i in e.tokenizer)r(i);t.tokenizer=n}(),e.walkTokens){var n=he.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens(t),n&&n(t)}}he.setOptions(t)},he.walkTokens=function(e,t){for(var r,i=n(e);!(r=i()).done;){var o=r.value;switch(t(o),o.type){case"table":for(var a,s=n(o.tokens.header);!(a=s()).done;){var l=a.value;he.walkTokens(l,t)}for(var c,u=n(o.tokens.cells);!(c=u()).done;)for(var h,d=n(c.value);!(h=d()).done;){var f=h.value;he.walkTokens(f,t)}break;case"list":he.walkTokens(o.items,t);break;default:o.tokens&&he.walkTokens(o.tokens,t)}}},he.Parser=ie,he.parser=ie.parse,he.Renderer=Q,he.TextRenderer=ee,he.Lexer=Y,he.lexer=Y.lex,he.Tokenizer=j,he.Slugger=te,he.parse=he,he}()},"DlR+":
/*!******************************************************!*\
!*** ./node_modules/store/storages/cookieStorage.js ***!
\******************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r=n(/*! ../src/util */"MFOe"),i=r.Global,o=r.trim;e.exports={name:"cookieStorage",read:function(e){if(!e||!c(e))return null;var t="(?:^|.*;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(a.cookie.replace(new RegExp(t),"$1"))},write:function(e,t){if(!e)return;a.cookie=escape(e)+"="+escape(t)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"},each:s,remove:l,clearAll:function(){s((function(e,t){l(t)}))}};var a=i.document;function s(e){for(var t=a.cookie.split(/; ?/g),n=t.length-1;n>=0;n--)if(o(t[n])){var r=t[n].split("="),i=unescape(r[0]);e(unescape(r[1]),i)}}function l(e){e&&c(e)&&(a.cookie=escape(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function c(e){return new RegExp("(?:^|;\\s*)"+escape(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(a.cookie)}},E2g8:
/*!******************************************************!*\
!*** ./node_modules/es6-promise/dist/es6-promise.js ***!
\******************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){(function(t,n){
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.8+1e68dce6
*/var r;r=function(){"use strict";function e(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,o=void 0,a=void 0,s=function(e,t){p[i]=e,p[i+1]=t,2===(i+=2)&&(a?a(m):_())},l="undefined"!=typeof window?window:void 0,c=l||{},u=c.MutationObserver||c.WebKitMutationObserver,h="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function f(){var e=setTimeout;return function(){return e(m,1)}}var p=new Array(1e3);function m(){for(var e=0;e<i;e+=2)(0,p[e])(p[e+1]),p[e]=void 0,p[e+1]=void 0;i=0}var g,v,y,b,_=void 0;function E(e,t){var n=this,r=new this.constructor(S);void 0===r[w]&&M(r);var i=n._state;if(i){var o=arguments[i-1];s((function(){return D(i,r,o,n._result)}))}else L(n,r,e,t);return r}function x(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(S);return C(t,e),t}h?_=function(){return t.nextTick(m)}:u?(v=0,y=new u(m),b=document.createTextNode(""),y.observe(b,{characterData:!0}),_=function(){b.data=v=++v%2}):d?((g=new MessageChannel).port1.onmessage=m,_=function(){return g.port2.postMessage(0)}):_=void 0===l?function(){try{var e=Function("return this")().require("vertx");return void 0!==(o=e.runOnLoop||e.runOnContext)?function(){o(m)}:f()}catch(e){return f()}}():f();var w=Math.random().toString(36).substring(2);function S(){}function k(t,n,r){n.constructor===t.constructor&&r===E&&n.constructor.resolve===x?function(e,t){1===t._state?O(e,t._result):2===t._state?A(e,t._result):L(t,void 0,(function(t){return C(e,t)}),(function(t){return A(e,t)}))}(t,n):void 0===r?O(t,n):e(r)?function(e,t,n){s((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?C(e,n):O(e,n))}),(function(t){r||(r=!0,A(e,t))}),e._label);!r&&i&&(r=!0,A(e,i))}),e)}(t,n,r):O(t,n)}function C(e,t){if(e===t)A(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)O(e,t);else{var n=void 0;try{n=t.then}catch(t){return void A(e,t)}k(e,t,n)}var r,i}function T(e){e._onerror&&e._onerror(e._result),R(e)}function O(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(R,e))}function A(e,t){void 0===e._state&&(e._state=2,e._result=t,s(T,e))}function L(e,t,n,r){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+1]=n,i[o+2]=r,0===o&&e._state&&s(R,e)}function R(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,o=e._result,a=0;a<t.length;a+=3)r=t[a],i=t[a+n],r?D(n,r,i,o):i(o);e._subscribers.length=0}}function D(t,n,r,i){var o=e(r),a=void 0,s=void 0,l=!0;if(o){try{a=r(i)}catch(e){l=!1,s=e}if(n===a)return void A(n,new TypeError("A promises callback cannot return that same promise."))}else a=i;void 0!==n._state||(o&&l?C(n,a):!1===l?A(n,s):1===t?O(n,a):2===t&&A(n,a))}var I=0;function M(e){e[w]=I++,e._state=void 0,e._result=void 0,e._subscribers=[]}var N=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(S),this.promise[w]||M(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&O(this.promise,this._result))):A(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===x){var i=void 0,o=void 0,a=!1;try{i=e.then}catch(e){a=!0,o=e}if(i===E&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===P){var s=new n(S);a?A(s,o):k(s,e,i),this._willSettleAt(s,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===e?A(r,n):this._result[t]=n),0===this._remaining&&O(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;L(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),P=function(){function t(e){this[w]=I++,this._result=this._state=void 0,this._subscribers=[],S!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){C(e,t)}),(function(t){A(e,t)}))}catch(t){A(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this.constructor;return e(t)?this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return P.prototype.then=E,P.all=function(e){return new N(this,e).promise},P.race=function(e){var t=this;return r(e)?new t((function(n,r){for(var i=e.length,o=0;o<i;o++)t.resolve(e[o]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},P.resolve=x,P.reject=function(e){var t=new this(S);return A(t,e),t},P._setScheduler=function(e){a=e},P._setAsap=function(e){s=e},P._asap=s,P.polyfill=function(){var e=void 0;if(void 0!==n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=P},P.Promise=P,P},e.exports=r()}).call(this,n(/*! ./../../node-libs-browser/mock/process.js */"Q2Ig"),n(/*! ./../../@umijs/deps/compiled/webpack/4/global.js */"IyRk"))},E9nw:
/*!************************************************!*\
!*** ./node_modules/toggle-selection/index.js ***!
\************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},EHPI:
/*!*******************************************************!*\
!*** ./src/pages/Problems/OjForm/CodePanel/index.tsx ***!
\*******************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n(/*! antd/es/drawer/style */"bbsP");var r,i=n(/*! antd/es/drawer */"/wGt"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),a=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(e,t){switch(t.type){case r.set_show_editor_setting:return Object(a.a)(Object(a.a)({},e),{},{showEditorSetting:t.payload});case r.set_theme:return Object(a.a)(Object(a.a)({},e),{},{theme:t.payload});case r.set_font_size:return Object(a.a)(Object(a.a)({},e),{},{fontSize:t.payload});case r.on_tab_to_space:return Object(a.a)(Object(a.a)({},e),{},{tabToSpace:t.payload});default:throw new Error}}function m(e){var t=e.onShowCodeSetting;return l.a.createElement("div",{className:"action-bar"},l.a.createElement("span",null,"学员初始代码文件"),l.a.createElement("a",{onClick:t},l.a.createElement("i",{className:"iconfont icon-shezhi"})))}!function(e){e[e.set_font_size=0]="set_font_size",e[e.set_theme=1]="set_theme",e[e.on_tab_to_space=2]="on_tab_to_space",e[e.set_show_editor_setting=3]="set_show_editor_setting"}(r||(r={})),t.a=function(e){var t=e.value,n=e.onChange,a=e.language,g=e.ActionBarRender,v=void 0===g?function(e){return l.a.createElement(m,{onShowCodeSetting:e})}:g,y=Object(s.useReducer)(p,f),b=Object(o.a)(y,2),_=b[0],E=b[1],x=_.theme,w=_.fontSize,S=_.showEditorSetting,k=_.tabToSpace,C={onFontSizeChange:function(e){E({type:r.set_font_size,payload:e}),Object(d.b)("cmFontSize",e)},tabToSpace:k,cmFontSize:w,className:"oj",cmCodeMode:x,onTabToSpace:function(e){E({type:r.on_tab_to_space,payload:e}),Object(d.b)("cmTabToSpace",e)},onCodeModeChange:function(e){E({type:r.set_theme,payload:e}),Object(d.b)("cmCodeMode",e)}};var T={value:t,language:a,onChange:n,theme:x,height:"calc(100% - 56px)",options:{fontSize:w,insertSpaces:k}};return l.a.createElement(s.Fragment,null,l.a.createElement("div",{className:"code-panel-container"},v((function(){E({type:r.set_show_editor_setting,payload:!0})})),l.a.createElement(c.b,T)),l.a.createElement(h.a,null,l.a.createElement(i.a,{className:"oj",title:null,placement:"right",closable:!1,visible:S,onClose:function(){E({type:r.set_show_editor_setting,payload:!1})}},l.a.createElement(u.a,C))))}},ELLl:
/*!*************************************************************!*\
!*** ./node_modules/codemirror/addon/edit/closebrackets.js ***!
\*************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:function(t){var i=s(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),a=t.listSelections(),c=0;c<a.length;c++){if(!a[c].empty())return e.Pass;var u=l(t,a[c].head);if(!u||o.indexOf(u)%2!=0)return e.Pass}for(c=a.length-1;c>=0;c--){var h=a[c].head;t.replaceRange("",n(h.line,h.ch-1),n(h.line,h.ch+1),"+delete")}},Enter:function(t){var n=s(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a<o.length;a++){if(!o[a].empty())return e.Pass;var c=l(t,o[a].head);if(!c||i.indexOf(c)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),o=t.listSelections();for(var n=0;n<o.length;n++){var r=o[n].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}}))}};function o(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),r="'"+n+"'";i[r]||(i[r]=a(n))}}function a(t){return function(i){return function(t,i){var o=s(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=r(o,"pairs"),l=a.indexOf(i);if(-1==l)return e.Pass;for(var u,h=r(o,"closeBefore"),d=r(o,"triples"),f=a.charAt(l+1)==i,p=t.listSelections(),m=l%2==0,g=0;g<p.length;g++){var v,y=p[g],b=y.head,_=t.getRange(b,n(b.line,b.ch+1));if(m&&!y.empty())v="surround";else if(!f&&m||_!=i)if(f&&b.ch>1&&d.indexOf(i)>=0&&t.getRange(n(b.line,b.ch-2),b)==i+i){if(b.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(b.line,b.ch-2))))return e.Pass;v="addFour"}else if(f){var E=0==b.ch?" ":t.getRange(n(b.line,b.ch-1),b);if(e.isWordChar(_)||E==i||e.isWordChar(E))return e.Pass;v="both"}else{if(!m||!(0===_.length||/\s/.test(_)||h.indexOf(_)>-1))return e.Pass;v="both"}else v=f&&c(t,b)?"both":d.indexOf(i)>=0&&t.getRange(b,n(b.line,b.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=v)return e.Pass}else u=v}var x=l%2?a.charAt(l-1):i,w=l%2?i:a.charAt(l+1);t.operation((function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var r=0;r<3;r++)t.execCommand("goCharRight");else if("surround"==u){var i=t.getSelections();for(r=0;r<i.length;r++)i[r]=x+i[r]+w;for(t.replaceSelections(i,"around"),i=t.listSelections().slice(),r=0;r<i.length;r++)i[r]=(o=i[r],a=void 0,a=e.cmpPos(o.anchor,o.head)>0,{anchor:new n(o.anchor.line,o.anchor.ch+(a?-1:1)),head:new n(o.head.line,o.head.ch+(a?1:-1))});t.setSelections(i)}else"both"==u?(t.replaceSelection(x+w,null),t.triggerElectric(x+w),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(x+x+x+x,"before"),t.execCommand("goCharRight"));var o,a}))}(i,t)}}function s(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function c(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.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(e,t,n){e.exports=n.p+"static/nodata.a6b3f948.png"},GUcZ:
/*!*****************************************************!*\
!*** ./node_modules/flv.js/src/flv.js + 40 modules ***!
\*****************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/events/events.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";var r=n("fWQN"),i=n("mtLc"),o=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t},"function"!=typeof self.Promise&&n(/*! es6-promise */"E2g8").polyfill()}}]),e}();o.install();var a=o,s=n("+qE3"),l=n.n(s),c=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,null,[{key:"e",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","error",r),e.ENABLE_ERROR&&(console.error?console.error(r):console.warn?console.warn(r):console.log(r))}},{key:"i",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",r),e.ENABLE_INFO&&(console.info?console.info(r):console.log(r))}},{key:"w",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",r),e.ENABLE_WARN&&(console.warn?console.warn(r):console.log(r))}},{key:"d",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",r),e.ENABLE_DEBUG&&(console.debug?console.debug(r):console.log(r))}},{key:"v",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var r="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",r),e.ENABLE_VERBOSE&&console.log(r)}}]),e}();c.GLOBAL_TAG="flv.js",c.FORCE_GLOBAL_TAG=!1,c.ENABLE_ERROR=!0,c.ENABLE_INFO=!0,c.ENABLE_WARN=!0,c.ENABLE_DEBUG=!0,c.ENABLE_VERBOSE=!0,c.ENABLE_CALLBACK=!1,c.emitter=new l.a;var u=c,h=function(){function e(){Object(r.a)(this,e),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return Object(i.a)(e,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}}]),e}(),d=n("yKVA"),f=n("879j"),p=function(){function e(t){Object(r.a)(this,e),this._message=t}return Object(i.a)(e,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),e}(),m=function(e){Object(d.a)(n,e);var t=Object(f.a)(n);function n(e){return Object(r.a)(this,n),t.call(this,e)}return Object(i.a)(n,[{key:"name",get:function(){return"IllegalStateException"}}]),n}(p),g=function(e){Object(d.a)(n,e);var t=Object(f.a)(n);function n(e){return Object(r.a)(this,n),t.call(this,e)}return Object(i.a)(n,[{key:"name",get:function(){return"InvalidArgumentException"}}]),n}(p),v=function(e){Object(d.a)(n,e);var t=Object(f.a)(n);function n(e){return Object(r.a)(this,n),t.call(this,e)}return Object(i.a)(n,[{key:"name",get:function(){return"NotImplementedException"}}]),n}(p),y={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},b={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},_=function(){function e(t){Object(r.a)(this,e),this._type=t||"undefined",this._status=y.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return Object(i.a)(e,[{key:"destroy",value:function(){this._status=y.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===y.kConnecting||this._status===y.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onComplete",get:function(){return this._onComplete},set:function(e){this._onComplete=e}},{key:"open",value:function(e,t){throw new v("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new v("Unimplemented abstract function!")}}]),e}(),E=n("oZsa");function x(e,t,n){return(x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(E.a)(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}var w={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],n=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],r={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:n[0]||""},i={};if(r.browser){i[r.browser]=!0;var o=r.majorVersion.split(".");i.version={major:parseInt(r.majorVersion,10),string:r.version},o.length>1&&(i.version.minor=parseInt(o[1],10)),o.length>2&&(i.version.build=parseInt(o[2],10))}if(r.platform&&(i[r.platform]=!0),(i.chrome||i.opr||i.safari)&&(i.webkit=!0),i.rv||i.iemobile){i.rv&&delete i.rv;r.browser="msie",i.msie=!0}if(i.edge){delete i.edge;r.browser="msedge",i.msedge=!0}if(i.opr){r.browser="opera",i.opera=!0}if(i.safari&&i.android){r.browser="android",i.android=!0}for(var a in i.name=r.browser,i.platform=r.platform,w)w.hasOwnProperty(a)&&delete w[a];Object.assign(w,i)}();var S=w,k=function(e){Object(d.a)(n,e);var t=Object(f.a)(n);function n(e,i){var o;return Object(r.a)(this,n),(o=t.call(this,"fetch-stream-loader")).TAG="FetchStreamLoader",o._seekHandler=e,o._config=i,o._needStash=!0,o._requestAbort=!1,o._contentLength=null,o._receivedLength=0,o}return Object(i.a)(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),x(Object(E.a)(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){var n=this;this._dataSource=e,this._range=t;var r=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(r=e.redirectedURL);var i=this._seekHandler.getConfig(r,t),o=new self.Headers;if("object"==typeof i.headers){var a=i.headers;for(var s in a)a.hasOwnProperty(s)&&o.append(s,a[s])}var l={method:"GET",headers:o,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var c in this._config.headers)o.append(c,this._config.headers[c]);!1===e.cors&&(l.mode="same-origin"),e.withCredentials&&(l.credentials="include"),e.referrerPolicy&&(l.referrerPolicy=e.referrerPolicy),this._status=y.kConnecting,self.fetch(i.url,l).then((function(e){if(n._requestAbort)return n._requestAbort=!1,void(n._status=y.kIdle);if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==i.url&&n._onURLRedirect){var t=n._seekHandler.removeURLParameters(e.url);n._onURLRedirect(t)}var r=e.headers.get("Content-Length");return null!=r&&(n._contentLength=parseInt(r),0!==n._contentLength&&n._onContentLengthKnown&&n._onContentLengthKnown(n._contentLength)),n._pump.call(n,e.body.getReader())}if(n._status=y.kError,!n._onError)throw new p("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);n._onError(b.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(n._status=y.kError,!n._onError)throw e;n._onError(b.EXCEPTION,{code:-1,msg:e.message})}))}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(e){var t=this;return e.read().then((function(n){if(n.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=y.kError;var r=b.EARLY_EOF,i={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new p(i.msg);t._onError(r,i)}else t._status=y.kComplete,t._onComplete&&t._onComplete(t._range.from,t._range.from+t._receivedLength-1);else{if(!0===t._requestAbort)return t._requestAbort=!1,t._status=y.kComplete,e.cancel();t._status=y.kBuffering;var o=n.value.buffer,a=t._range.from+t._receivedLength;t._receivedLength+=o.byteLength,t._onDataArrival&&t._onDataArrival(o,a,t._receivedLength),t._pump(e)}})).catch((function(e){if(11!==e.code||!S.msedge){t._status=y.kError;var n=0,r=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(n=b.EXCEPTION,r={code:e.code,msg:e.message}):(n=b.EARLY_EOF,r={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new p(r.msg);t._onError(n,r)}}))}}],[{key:"isSupported",value:function(){try{var e=S.msedge&&S.version.minor>=15048,t=!S.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}}}]),n}(_),C=function(e){Object(d.a)(n,e);var t=Object(f.a)(n);function n(e,i){var o;return Object(r.a)(this,n),(o=t.call(this,"xhr-moz-chunked-loader")).TAG="MozChunkedLoader",o._seekHandler=e,o._config=i,o._needStash=!0,o._xhr=null,o._requestAbort=!1,o._contentLength=null,o._receivedLength=0,o}return Object(i.a)(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),x(Object(E.a)(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(n=e.redirectedURL);var r=this._seekHandler.getConfig(n,t);this._requestURL=r.url;var i=this._xhr=new XMLHttpRequest;if(i.open("GET",r.url,!0),i.responseType="moz-chunked-arraybuffer",i.onreadystatechange=this._onReadyStateChange.bind(this),i.onprogress=this._onProgress.bind(this),i.onloadend=this._onLoadEnd.bind(this),i.onerror=this._onXhrError.bind(this),e.withCredentials&&(i.withCredentials=!0),"object"==typeof r.headers){var o=r.headers;for(var a in o)o.hasOwnProperty(a)&&i.setRequestHeader(a,o[a])}if("object"==typeof this._config.headers){var s=this._config.headers;for(var l in s)s.hasOwnProperty(l)&&i.setRequestHeader(l,s[l])}this._status=y.kConnecting,i.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=y.kComplete}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var n=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(n)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=y.kError,!this._onError)throw new p("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(b.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=y.kBuffering}}},{key:"_onProgress",value:function(e){if(this._status!==y.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}}},{key:"_onLoadEnd",value:function(e){!0!==this._requestAbort?this._status!==y.kError&&(this._status=y.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1}},{key:"_onXhrError",value:function(e){this._status=y.kError;var t=0,n=null;if(this._contentLength&&e.loaded<this._contentLength?(t=b.EARLY_EOF,n={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=b.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new p(n.msg);this._onError(t,n)}}],[{key:"isSupported",value:function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return u.w("MozChunkedLoader",e.message),!1}}}]),n}(_),T=function(e){Object(d.a)(n,e);var t=Object(f.a)(n);function n(e,i){var o;return Object(r.a)(this,n),(o=t.call(this,"xhr-range-loader")).TAG="RangeLoader",o._seekHandler=e,o._config=i,o._needStash=!1,o._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],o._currentChunkSizeKB=384,o._currentSpeedNormalized=0,o._zeroSpeedChunkCount=0,o._xhr=null,o._speedSampler=new h,o._requestAbort=!1,o._waitForTotalLength=!1,o._totalLengthReceived=!1,o._currentRequestURL=null,o._currentRedirectedURL=null,o._currentRequestRange=null,o._totalLength=null,o._contentLength=null,o._receivedLength=0,o._lastTimeLoaded=0,o}return Object(i.a)(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),x(Object(E.a)(n.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(e,t){this._dataSource=e,this._range=t,this._status=y.kConnecting;var n=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(n=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||n?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))}},{key:"_openSubRange",value:function(){var e=1024*this._currentChunkSizeKB,t=this._range.from+this._receivedLength,n=t+e;null!=this._contentLength&&n-this._range.from>=this._contentLength&&(n=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(e,t){this._lastTimeLoaded=0;var n=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?n=this._currentRedirectedURL:null!=e.redirectedURL&&(n=e.redirectedURL));var r=this._seekHandler.getConfig(n,t);this._currentRequestURL=r.url;var i=this._xhr=new XMLHttpRequest;if(i.open("GET",r.url,!0),i.responseType="arraybuffer",i.onreadystatechange=this._onReadyStateChange.bind(this),i.onprogress=this._onProgress.bind(this),i.onload=this._onLoad.bind(this),i.onerror=this._onXhrError.bind(this),e.withCredentials&&(i.withCredentials=!0),"object"==typeof r.headers){var o=r.headers;for(var a in o)o.hasOwnProperty(a)&&i.setRequestHeader(a,o[a])}if("object"==typeof this._config.headers){var s=this._config.headers;for(var l in s)s.hasOwnProperty(l)&&i.setRequestHeader(l,s[l])}i.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=y.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var n=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&n!==this._currentRedirectedURL&&(this._currentRedirectedURL=n,this._onURLRedirect&&this._onURLRedirect(n))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=y.kBuffering}else{if(this._status=y.kError,!this._onError)throw new p("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(b.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}},{key:"_onProgress",value:function(e){if(this._status!==y.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var n=e.total;this._internalAbort(),null!=n&0!==n&&(this._totalLength=n)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var r=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(r)}}},{key:"_normalizeSpeed",value:function(e){var t=this._chunkSizeKBList,n=t.length-1,r=0,i=0,o=n;if(e<t[0])return t[0];for(;i<=o;){if((r=i+Math.floor((o-i)/2))===n||e>=t[r]&&e<t[r+1])return t[r];t[r]<e?i=r+1:o=r-1}}},{key:"_onLoad",value:function(e){if(this._status!==y.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){var n=this._normalizeSpeed(t);this._currentSpeedNormalized!==n&&(this._currentSpeedNormalized=n,this._currentChunkSizeKB=n)}var r=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=r.byteLength;var o=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():o=!0,this._onDataArrival&&this._onDataArrival(r,i,this._receivedLength),o&&(this._status=y.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}}},{key:"_onXhrError",value:function(e){this._status=y.kError;var t=0,n=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=b.EARLY_EOF,n={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=b.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new p(n.msg);this._onError(t,n)}}],[{key:"isSupported",value:function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return u.w("RangeLoader",e.message),!1}}}]),n}(_),O=function(e){Object(d.a)(n,e);var t=Object(f.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.call(this,"websocket-loader")).TAG="WebSocketLoader",e._needStash=!0,e._ws=null,e._requestAbort=!1,e._receivedLength=0,e}return Object(i.a)(n,[{key:"destroy",value:function(){this._ws&&this.abort(),x(Object(E.a)(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=y.kConnecting}catch(e){this._status=y.kError;var n={code:e.code,msg:e.message};if(!this._onError)throw new p(n.msg);this._onError(b.EXCEPTION,n)}}},{key:"abort",value:function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=y.kComplete}},{key:"_onWebSocketOpen",value:function(e){this._status=y.kBuffering}},{key:"_onWebSocketClose",value:function(e){!0!==this._requestAbort?(this._status=y.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1}},{key:"_onWebSocketMessage",value:function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var n=new FileReader;n.onload=function(){t._dispatchArrayBuffer(n.result)},n.readAsArrayBuffer(e.data)}else{this._status=y.kError;var r={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new p(r.msg);this._onError(b.EXCEPTION,r)}}},{key:"_dispatchArrayBuffer",value:function(e){var t=e,n=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}},{key:"_onWebSocketError",value:function(e){this._status=y.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new p(t.msg);this._onError(b.EXCEPTION,t)}}],[{key:"isSupported",value:function(){try{return void 0!==self.WebSocket}catch(e){return!1}}}]),n}(_),A=function(){function e(t){Object(r.a)(this,e),this._zeroStart=t||!1}return Object(i.a)(e,[{key:"getConfig",value:function(e,t){var n,r={};0!==t.from||-1!==t.to?(n=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(t.from.toString(),"-"),r.Range=n):this._zeroStart&&(r.Range="bytes=0-");return{url:e,headers:r}}},{key:"removeURLParameters",value:function(e){return e}}]),e}(),L=function(){function e(t,n){Object(r.a)(this,e),this._startName=t,this._endName=n}return Object(i.a)(e,[{key:"getConfig",value:function(e,t){var n=e;if(0!==t.from||-1!==t.to){var r=!0;-1===n.indexOf("?")&&(n+="?",r=!1),r&&(n+="&"),n+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(n+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:n,headers:{}}}},{key:"removeURLParameters",value:function(e){var t=e.split("?")[0],n=void 0,r=e.indexOf("?");-1!==r&&(n=e.substring(r+1));var i="";if(null!=n&&n.length>0)for(var o=n.split("&"),a=0;a<o.length;a++){var s=o[a].split("="),l=a>0;s[0]!==this._startName&&s[0]!==this._endName&&(l&&(i+="&"),i+=o[a])}return 0===i.length?t:t+"?"+i}}]),e}(),R=function(){function e(t,n,i){Object(r.a)(this,e),this.TAG="IOController",this._config=n,this._extraData=i,this._stashInitialSize=393216,null!=n.stashInitialSize&&n.stashInitialSize>0&&(this._stashInitialSize=n.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===n.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=t,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(t.url),this._refTotalLength=t.filesize?t.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new h,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return Object(i.a)(e,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(e){this._extraData=e}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(e){this._onSeeked=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onComplete",get:function(){return this._onComplete},set:function(e){this._onComplete=e}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(e){this._onRedirect=e}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===T?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new A(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",n=e.seekParamEnd||"bend";this._seekHandler=new L(t,n)}else{if("custom"!==e.seekType)throw new g("Invalid seekType in config: ".concat(e.seekType));if("function"!=typeof e.customSeekHandler)throw new g("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}},{key:"_selectLoader",value:function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=O;else if(k.isSupported())this._loaderClass=k;else if(C.isSupported())this._loaderClass=C;else{if(!T.isSupported())throw new p("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=T}}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}},{key:"seek",value:function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}},{key:"_internalSeek",value:function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var n={from:e,to:-1};this._currentRange={from:n.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,n),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(e){if(!e||"string"!=typeof e||0===e.length)throw new g("Url must be a non-empty string!");this._dataSource.url=e}},{key:"_expandBuffer",value:function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var n=new ArrayBuffer(t);if(this._stashUsed>0){var r=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(n,0,t).set(r,0)}this._stashBuffer=n,this._bufferSize=t}}},{key:"_normalizeSpeed",value:function(e){var t=this._speedNormalizeList,n=t.length-1,r=0,i=0,o=n;if(e<t[0])return t[0];for(;i<=o;){if((r=i+Math.floor((o-i)/2))===n||e>=t[r]&&e<t[r+1])return t[r];t[r]<e?i=r+1:o=r-1}}},{key:"_adjustStashSize",value:function(e){var t=0;(t=this._config.isLive||e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var n=1024*t+1048576;this._bufferSize<n&&this._expandBuffer(n),this._stashSize=1024*t}},{key:"_dispatchChunks",value:function(e,t){return this._currentRange.to=t+e.byteLength-1,this._onDataArrival(e,t)}},{key:"_onURLRedirect",value:function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)}},{key:"_onContentLengthKnown",value:function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(e,t,n){if(!this._onDataArrival)throw new m("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);var r=this._speedSampler.lastSecondKBps;if(0!==r){var i=this._normalizeSpeed(r);this._speedNormalized!==i&&(this._speedNormalized=i,this._adjustStashSize(i))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize){new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var o=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var a=this._stashBuffer.slice(0,this._stashUsed),s=this._dispatchChunks(a,this._stashByteStart);if(s<a.byteLength){if(s>0){var l=new Uint8Array(a,s);o.set(l,0),this._stashUsed=l.byteLength,this._stashByteStart+=s}}else this._stashUsed=0,this._stashByteStart+=s;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),o=new Uint8Array(this._stashBuffer,0,this._bufferSize)),o.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var c=this._dispatchChunks(e,t);if(c<e.byteLength){var u=e.byteLength-c;u>this._bufferSize&&(this._expandBuffer(u),o=new Uint8Array(this._stashBuffer,0,this._bufferSize)),o.set(new Uint8Array(e,c),0),this._stashUsed+=u,this._stashByteStart=t+c}}}else if(0===this._stashUsed){var h=this._dispatchChunks(e,t);if(h<e.byteLength){var d=e.byteLength-h;d>this._bufferSize&&this._expandBuffer(d),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(e,h),0),this._stashUsed+=d,this._stashByteStart=t+h}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var f=new Uint8Array(this._stashBuffer,0,this._bufferSize);f.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var p=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(p<this._stashUsed&&p>0){var g=new Uint8Array(this._stashBuffer,p);f.set(g,0)}this._stashUsed-=p,this._stashByteStart+=p}}}},{key:"_flushStashBuffer",value:function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart),r=t.byteLength-n;if(n<t.byteLength){if(!e){if(n>0){var i=new Uint8Array(this._stashBuffer,0,this._bufferSize),o=new Uint8Array(t,n);i.set(o,0),this._stashUsed=o.byteLength,this._stashByteStart+=n}return 0}u.w(this.TAG,"".concat(r," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,r}return 0}},{key:"_onLoaderComplete",value:function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(e,t){switch(u.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=b.UNRECOVERABLE_EARLY_EOF),e){case b.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=this._currentRange.to+1;return void(n<this._totalLength&&(u.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(n,!1)))}e=b.UNRECOVERABLE_EARLY_EOF}if(!this._onError)throw new p("IOException: "+t.msg);this._onError(e,t)}}]),e}(),D={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function I(){return Object.assign({},D)}var M=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var e=new R({},I()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t}},{key:"getNetworkLoaderTypeName",value:function(){var e=new R({},I()),t=e.loaderType;return e.destroy(),t}},{key:"supportNativeMediaPlayback",value:function(t){null==e.videoElement&&(e.videoElement=window.document.createElement("video"));var n=e.videoElement.canPlayType(t);return"probably"===n||"maybe"==n}},{key:"getFeatureList",value:function(){var t={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.mseFlvPlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName(),t.mseLiveFlvPlayback=t.mseFlvPlayback&&t.networkStreamIO,t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t}}]),e}(),N={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},P=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,null,[{key:"forceGlobalTag",get:function(){return u.FORCE_GLOBAL_TAG},set:function(t){u.FORCE_GLOBAL_TAG=t,e._notifyChange()}},{key:"globalTag",get:function(){return u.GLOBAL_TAG},set:function(t){u.GLOBAL_TAG=t,e._notifyChange()}},{key:"enableAll",get:function(){return u.ENABLE_VERBOSE&&u.ENABLE_DEBUG&&u.ENABLE_INFO&&u.ENABLE_WARN&&u.ENABLE_ERROR},set:function(t){u.ENABLE_VERBOSE=t,u.ENABLE_DEBUG=t,u.ENABLE_INFO=t,u.ENABLE_WARN=t,u.ENABLE_ERROR=t,e._notifyChange()}},{key:"enableDebug",get:function(){return u.ENABLE_DEBUG},set:function(t){u.ENABLE_DEBUG=t,e._notifyChange()}},{key:"enableVerbose",get:function(){return u.ENABLE_VERBOSE},set:function(t){u.ENABLE_VERBOSE=t,e._notifyChange()}},{key:"enableInfo",get:function(){return u.ENABLE_INFO},set:function(t){u.ENABLE_INFO=t,e._notifyChange()}},{key:"enableWarn",get:function(){return u.ENABLE_WARN},set:function(t){u.ENABLE_WARN=t,e._notifyChange()}},{key:"enableError",get:function(){return u.ENABLE_ERROR},set:function(t){u.ENABLE_ERROR=t,e._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:u.GLOBAL_TAG,forceGlobalTag:u.FORCE_GLOBAL_TAG,enableVerbose:u.ENABLE_VERBOSE,enableDebug:u.ENABLE_DEBUG,enableInfo:u.ENABLE_INFO,enableWarn:u.ENABLE_WARN,enableError:u.ENABLE_ERROR,enableCallback:u.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(e){u.GLOBAL_TAG=e.globalTag,u.FORCE_GLOBAL_TAG=e.forceGlobalTag,u.ENABLE_VERBOSE=e.enableVerbose,u.ENABLE_DEBUG=e.enableDebug,u.ENABLE_INFO=e.enableInfo,u.ENABLE_WARN=e.enableWarn,u.ENABLE_ERROR=e.enableError,u.ENABLE_CALLBACK=e.enableCallback}},{key:"_notifyChange",value:function(){var t=e.emitter;if(t.listenerCount("change")>0){var n=e.getConfig();t.emit("change",n)}}},{key:"registerListener",value:function(t){e.emitter.addListener("change",t)}},{key:"removeListener",value:function(t){e.emitter.removeListener("change",t)}},{key:"addLogListener",value:function(t){u.emitter.addListener("log",t),u.emitter.listenerCount("log")>0&&(u.ENABLE_CALLBACK=!0,e._notifyChange())}},{key:"removeLogListener",value:function(t){u.emitter.removeListener("log",t),0===u.emitter.listenerCount("log")&&(u.ENABLE_CALLBACK=!1,e._notifyChange())}}]),e}();P.emitter=new l.a;var j=P,B=function(){function e(){Object(r.a)(this,e),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return Object(i.a)(e,[{key:"isComplete",value:function(){var e=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&null!=this.duration&&null!=this.metadata&&null!=this.hasKeyframesIndex&&e&&t}},{key:"isSeekable",value:function(){return!0===this.hasKeyframesIndex}},{key:"getNearestKeyframe",value:function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,n=this._search(t.times,e);return{index:n,milliseconds:t.times[n],fileposition:t.filepositions[n]}}},{key:"_search",value:function(e,t){var n=0,r=e.length-1,i=0,o=0,a=r;for(t<e[0]&&(n=0,o=a+1);o<=a;){if((i=o+Math.floor((a-o)/2))===r||t>=e[i]&&t<e[i+1]){n=i;break}e[i]<t?o=i+1:a=i-1}return n}}]),e}();function F(e,t,n){var r=e;if(t+n<r.length){for(;n--;)if(128!=(192&r[++t]))return!1;return!0}return!1}var U,G=function(e){for(var t=[],n=e,r=0,i=e.length;r<i;)if(n[r]<128)t.push(String.fromCharCode(n[r])),++r;else{if(n[r]<192);else if(n[r]<224){if(F(n,r,1)){var o=(31&n[r])<<6|63&n[r+1];if(o>=128){t.push(String.fromCharCode(65535&o)),r+=2;continue}}}else if(n[r]<240){if(F(n,r,2)){var a=(15&n[r])<<12|(63&n[r+1])<<6|63&n[r+2];if(a>=2048&&55296!=(63488&a)){t.push(String.fromCharCode(65535&a)),r+=3;continue}}}else if(n[r]<248&&F(n,r,3)){var s=(7&n[r])<<18|(63&n[r+1])<<12|(63&n[r+2])<<6|63&n[r+3];if(s>65536&&s<1114112){s-=65536,t.push(String.fromCharCode(s>>>10|55296)),t.push(String.fromCharCode(1023&s|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")},z=(U=new ArrayBuffer(2),new DataView(U).setInt16(0,256,!0),256===new Int16Array(U)[0]),H=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,null,[{key:"parseScriptData",value:function(t,n,r){var i={};try{var o=e.parseValue(t,n,r),a=e.parseValue(t,n+o.size,r-o.size);i[o.data]=a.data}catch(e){u.e("AMF",e.toString())}return i}},{key:"parseObject",value:function(t,n,r){if(r<3)throw new m("Data not enough when parse ScriptDataObject");var i=e.parseString(t,n,r),o=e.parseValue(t,n+i.size,r-i.size),a=o.objectEnd;return{data:{name:i.data,value:o.data},size:i.size+o.size,objectEnd:a}}},{key:"parseVariable",value:function(t,n,r){return e.parseObject(t,n,r)}},{key:"parseString",value:function(e,t,n){if(n<2)throw new m("Data not enough when parse String");var r=new DataView(e,t,n).getUint16(0,!z);return{data:r>0?G(new Uint8Array(e,t+2,r)):"",size:2+r}}},{key:"parseLongString",value:function(e,t,n){if(n<4)throw new m("Data not enough when parse LongString");var r=new DataView(e,t,n).getUint32(0,!z);return{data:r>0?G(new Uint8Array(e,t+4,r)):"",size:4+r}}},{key:"parseDate",value:function(e,t,n){if(n<10)throw new m("Data size invalid when parse Date");var r=new DataView(e,t,n),i=r.getFloat64(0,!z),o=r.getInt16(8,!z);return{data:new Date(i+=60*o*1e3),size:10}}},{key:"parseValue",value:function(t,n,r){if(r<1)throw new m("Data not enough when parse Value");var i,o=new DataView(t,n,r),a=1,s=o.getUint8(0),l=!1;try{switch(s){case 0:i=o.getFloat64(1,!z),a+=8;break;case 1:i=!!o.getUint8(1),a+=1;break;case 2:var c=e.parseString(t,n+1,r-1);i=c.data,a+=c.size;break;case 3:i={};var h=0;for(9==(16777215&o.getUint32(r-4,!z))&&(h=3);a<r-4;){var d=e.parseObject(t,n+a,r-a-h);if(d.objectEnd)break;i[d.data.name]=d.data.value,a+=d.size}if(a<=r-3)9===(16777215&o.getUint32(a-1,!z))&&(a+=3);break;case 8:i={},a+=4;var f=0;for(9==(16777215&o.getUint32(r-4,!z))&&(f=3);a<r-8;){var p=e.parseVariable(t,n+a,r-a-f);if(p.objectEnd)break;i[p.data.name]=p.data.value,a+=p.size}if(a<=r-3)9===(16777215&o.getUint32(a-1,!z))&&(a+=3);break;case 9:i=void 0,a=1,l=!0;break;case 10:i=[];var g=o.getUint32(1,!z);a+=4;for(var v=0;v<g;v++){var y=e.parseValue(t,n+a,r-a);i.push(y.data),a+=y.size}break;case 11:var b=e.parseDate(t,n+1,r-1);i=b.data,a+=b.size;break;case 12:var _=e.parseString(t,n+1,r-1);i=_.data,a+=_.size;break;default:a=r,u.w("AMF","Unsupported AMF value type "+s)}}catch(e){u.e("AMF",e.toString())}return{data:i,size:a,objectEnd:l}}}]),e}(),V=function(){function e(t){Object(r.a)(this,e),this.TAG="ExpGolomb",this._buffer=t,this._buffer_index=0,this._total_bytes=t.byteLength,this._total_bits=8*t.byteLength,this._current_word=0,this._current_word_bits_left=0}return Object(i.a)(e,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var e=this._total_bytes-this._buffer_index;if(e<=0)throw new m("ExpGolomb: _fillCurrentWord() but no bytes available");var t=Math.min(4,e),n=new Uint8Array(4);n.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(n.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t}},{key:"readBits",value:function(e){if(e>32)throw new g("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var n=this._current_word_bits_left?this._current_word:0;n>>>=32-this._current_word_bits_left;var r=e-this._current_word_bits_left;this._fillCurrentWord();var i=Math.min(r,this._current_word_bits_left),o=this._current_word>>>32-i;return this._current_word<<=i,this._current_word_bits_left-=i,n=n<<i|o}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(0!=(this._current_word&2147483648>>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}},{key:"readUEG",value:function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1}},{key:"readSEG",value:function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}}]),e}(),W=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,null,[{key:"_ebsp2rbsp",value:function(e){for(var t=e,n=t.byteLength,r=new Uint8Array(n),i=0,o=0;o<n;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(r[i]=t[o],i++);return new Uint8Array(r.buffer,0,i)}},{key:"parseSPS",value:function(t){var n=e._ebsp2rbsp(t),r=new V(n);r.readByte();var i=r.readByte();r.readByte();var o=r.readByte();r.readUEG();var a=e.getProfileString(i),s=e.getLevelString(o),l=1,c=420,u=8;if((100===i||110===i||122===i||244===i||44===i||83===i||86===i||118===i||128===i||138===i||144===i)&&(3===(l=r.readUEG())&&r.readBits(1),l<=3&&(c=[0,420,422,444][l]),u=r.readUEG()+8,r.readUEG(),r.readBits(1),r.readBool()))for(var h=3!==l?8:12,d=0;d<h;d++)r.readBool()&&(d<6?e._skipScalingList(r,16):e._skipScalingList(r,64));r.readUEG();var f=r.readUEG();if(0===f)r.readUEG();else if(1===f){r.readBits(1),r.readSEG(),r.readSEG();for(var p=r.readUEG(),m=0;m<p;m++)r.readSEG()}var g=r.readUEG();r.readBits(1);var v=r.readUEG(),y=r.readUEG(),b=r.readBits(1);0===b&&r.readBits(1),r.readBits(1);var _=0,E=0,x=0,w=0;r.readBool()&&(_=r.readUEG(),E=r.readUEG(),x=r.readUEG(),w=r.readUEG());var S=1,k=1,C=0,T=!0,O=0,A=0;if(r.readBool()){if(r.readBool()){var L=r.readByte();L>0&&L<16?(S=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][L-1],k=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][L-1]):255===L&&(S=r.readByte()<<8|r.readByte(),k=r.readByte()<<8|r.readByte())}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(4),r.readBool()&&r.readBits(24)),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool()){var R=r.readBits(32),D=r.readBits(32);T=r.readBool(),C=(O=D)/(A=2*R)}}var I=1;1===S&&1===k||(I=S/k);var M=0,N=0;0===l?(M=1,N=2-b):(M=3===l?1:2,N=(1===l?2:1)*(2-b));var P=16*(v+1),j=16*(y+1)*(2-b);P-=(_+E)*M,j-=(x+w)*N;var B=Math.ceil(P*I);return r.destroy(),r=null,{profile_string:a,level_string:s,bit_depth:u,ref_frames:g,chroma_format:c,chroma_format_string:e.getChromaFormatString(c),frame_rate:{fixed:T,fps:C,fps_den:A,fps_num:O},sar_ratio:{width:S,height:k},codec_size:{width:P,height:j},present_size:{width:B,height:j}}}},{key:"_skipScalingList",value:function(e,t){for(var n=8,r=8,i=0;i<t;i++)0!==r&&(r=(n+e.readSEG()+256)%256),n=0===r?n:r}},{key:"getProfileString",value:function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(e){return(e/10).toFixed(1)}},{key:"getChromaFormatString",value:function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),e}(),K={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};var q=function(){function e(t,n){Object(r.a)(this,e),this.TAG="FLVDemuxer",this._config=n,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=t.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=t.hasAudioTrack,this._hasVideo=t.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new B,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return Object(i.a)(e,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(e){return e.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(e){this._timestampBase=e}},{key:"overridedDuration",get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}},{key:"overridedHasAudio",set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}},{key:"overridedHasVideo",set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new B}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched}},{key:"parseChunks",value:function(t,n){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new m("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var r=0,i=this._littleEndian;if(0===n){if(!(t.byteLength>13))return 0;r=e.probe(t).dataOffset}this._firstParse&&(this._firstParse=!1,n+r!==this._dataOffset&&u.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==new DataView(t,r).getUint32(0,!i)&&u.w(this.TAG,"PrevTagSize0 !== 0 !!!"),r+=4);for(;r<t.byteLength;){this._dispatch=!0;var o=new DataView(t,r);if(r+11+4>t.byteLength)break;var a=o.getUint8(0),s=16777215&o.getUint32(0,!i);if(r+11+s+4>t.byteLength)break;if(8===a||9===a||18===a){var l=o.getUint8(4),c=o.getUint8(5),h=o.getUint8(6)|c<<8|l<<16|o.getUint8(7)<<24;0!==(16777215&o.getUint32(7,!i))&&u.w(this.TAG,"Meet tag which has StreamID != 0!");var d=r+11;switch(a){case 8:this._parseAudioData(t,d,s,h);break;case 9:this._parseVideoData(t,d,s,h,n+r);break;case 18:this._parseScriptData(t,d,s)}var f=o.getUint32(11+s,!i);f!==11+s&&u.w(this.TAG,"Invalid PrevTagSize ".concat(f)),r+=11+s+4}else u.w(this.TAG,"Unsupported tag type ".concat(a,", skipped")),r+=11+s+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),r}},{key:"_parseScriptData",value:function(e,t,n){var r=H.parseScriptData(e,t,n);if(r.hasOwnProperty("onMetaData")){if(null==r.onMetaData||"object"!=typeof r.onMetaData)return void u.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&u.w(this.TAG,"Found another onMetaData tag!"),this._metadata=r;var i=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},i)),"boolean"==typeof i.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=i.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof i.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=i.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof i.audiodatarate&&(this._mediaInfo.audioDataRate=i.audiodatarate),"number"==typeof i.videodatarate&&(this._mediaInfo.videoDataRate=i.videodatarate),"number"==typeof i.width&&(this._mediaInfo.width=i.width),"number"==typeof i.height&&(this._mediaInfo.height=i.height),"number"==typeof i.duration){if(!this._durationOverrided){var o=Math.floor(i.duration*this._timescale);this._duration=o,this._mediaInfo.duration=o}}else this._mediaInfo.duration=0;if("number"==typeof i.framerate){var a=Math.floor(1e3*i.framerate);if(a>0){var s=a/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=s,this._referenceFrameRate.fps_num=a,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=s}}if("object"==typeof i.keyframes){this._mediaInfo.hasKeyframesIndex=!0;var l=i.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(l),i.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=i,u.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(r).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},r))}},{key:"_parseKeyframesIndex",value:function(e){for(var t=[],n=[],r=1;r<e.times.length;r++){var i=this._timestampBase+Math.floor(1e3*e.times[r]);t.push(i),n.push(e.filepositions[r])}return{times:t,filepositions:n}}},{key:"_parseAudioData",value:function(e,t,n,r){if(n<=1)u.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!0!==this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var i=new DataView(e,t,n).getUint8(0),o=i>>>4;if(2===o||10===o){var a=0,s=(12&i)>>>2;if(s>=0&&s<=4){a=this._flvSoundRateTable[s];var l=1&i,c=this._audioMetadata,h=this._audioTrack;if(c||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(c=this._audioMetadata={}).type="audio",c.id=h.id,c.timescale=this._timescale,c.duration=this._duration,c.audioSampleRate=a,c.channelCount=0===l?1:2),10===o){var d=this._parseAACAudioData(e,t+1,n-1);if(null==d)return;if(0===d.packetType){c.config&&u.w(this.TAG,"Found another AudioSpecificConfig!");var f=d.data;c.audioSampleRate=f.samplingRate,c.channelCount=f.channelCount,c.codec=f.codec,c.originalCodec=f.originalCodec,c.config=f.config,c.refSampleDuration=1024/c.audioSampleRate*c.timescale,u.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",c);var p=this._mediaInfo;p.audioCodec=c.originalCodec,p.audioSampleRate=c.audioSampleRate,p.audioChannelCount=c.channelCount,p.hasVideo?null!=p.videoCodec&&(p.mimeType='video/x-flv; codecs="'+p.videoCodec+","+p.audioCodec+'"'):p.mimeType='video/x-flv; codecs="'+p.audioCodec+'"',p.isComplete()&&this._onMediaInfo(p)}else if(1===d.packetType){var m=this._timestampBase+r,g={unit:d.data,length:d.data.byteLength,dts:m,pts:m};h.samples.push(g),h.length+=d.data.length}else u.e(this.TAG,"Flv: Unsupported AAC data type ".concat(d.packetType))}else if(2===o){if(!c.codec){var v=this._parseMP3AudioData(e,t+1,n-1,!0);if(null==v)return;c.audioSampleRate=v.samplingRate,c.channelCount=v.channelCount,c.codec=v.codec,c.originalCodec=v.originalCodec,c.refSampleDuration=1152/c.audioSampleRate*c.timescale,u.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",c);var y=this._mediaInfo;y.audioCodec=c.codec,y.audioSampleRate=c.audioSampleRate,y.audioChannelCount=c.channelCount,y.audioDataRate=v.bitRate,y.hasVideo?null!=y.videoCodec&&(y.mimeType='video/x-flv; codecs="'+y.videoCodec+","+y.audioCodec+'"'):y.mimeType='video/x-flv; codecs="'+y.audioCodec+'"',y.isComplete()&&this._onMediaInfo(y)}var b=this._parseMP3AudioData(e,t+1,n-1,!1);if(null==b)return;var _=this._timestampBase+r,E={unit:b,length:b.byteLength,dts:_,pts:_};h.samples.push(E),h.length+=b.length}}else this._onError(K.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+s)}else this._onError(K.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+o)}}},{key:"_parseAACAudioData",value:function(e,t,n){if(!(n<=1)){var r={},i=new Uint8Array(e,t,n);return r.packetType=i[0],0===i[0]?r.data=this._parseAACAudioSpecificConfig(e,t+1,n-1):r.data=i.subarray(1),r}u.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")}},{key:"_parseAACAudioSpecificConfig",value:function(e,t,n){var r,i,o=new Uint8Array(e,t,n),a=null,s=0,l=null;if(s=r=o[0]>>>3,(i=(7&o[0])<<1|o[1]>>>7)<0||i>=this._mpegSamplingRates.length)this._onError(K.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var c=this._mpegSamplingRates[i],u=(120&o[1])>>>3;if(!(u<0||u>=8)){5===s&&(l=(7&o[1])<<1|o[2]>>>7,(124&o[2])>>>2);var h=self.navigator.userAgent.toLowerCase();return-1!==h.indexOf("firefox")?i>=6?(s=5,a=new Array(4),l=i-3):(s=2,a=new Array(2),l=i):-1!==h.indexOf("android")?(s=2,a=new Array(2),l=i):(s=5,l=i,a=new Array(4),i>=6?l=i-3:1===u&&(s=2,a=new Array(2),l=i)),a[0]=s<<3,a[0]|=(15&i)>>>1,a[1]=(15&i)<<7,a[1]|=(15&u)<<3,5===s&&(a[1]|=(15&l)>>>1,a[2]=(1&l)<<7,a[2]|=8,a[3]=0),{config:a,samplingRate:c,channelCount:u,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+r}}this._onError(K.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}}},{key:"_parseMP3AudioData",value:function(e,t,n,r){if(!(n<4)){this._littleEndian;var i=new Uint8Array(e,t,n),o=null;if(r){if(255!==i[0])return;var a=i[1]>>>3&3,s=(6&i[1])>>1,l=(240&i[2])>>>4,c=(12&i[2])>>>2,h=3!==(i[3]>>>6&3)?2:1,d=0,f=0;switch(a){case 0:d=this._mpegAudioV25SampleRateTable[c];break;case 2:d=this._mpegAudioV20SampleRateTable[c];break;case 3:d=this._mpegAudioV10SampleRateTable[c]}switch(s){case 1:34,l<this._mpegAudioL3BitRateTable.length&&(f=this._mpegAudioL3BitRateTable[l]);break;case 2:33,l<this._mpegAudioL2BitRateTable.length&&(f=this._mpegAudioL2BitRateTable[l]);break;case 3:32,l<this._mpegAudioL1BitRateTable.length&&(f=this._mpegAudioL1BitRateTable[l])}o={bitRate:f,samplingRate:d,channelCount:h,codec:"mp3",originalCodec:"mp3"}}else o=i;return o}u.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")}},{key:"_parseVideoData",value:function(e,t,n,r,i){if(n<=1)u.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!0!==this._hasVideoFlagOverrided||!1!==this._hasVideo){var o=new Uint8Array(e,t,n)[0],a=(240&o)>>>4,s=15&o;7===s?this._parseAVCVideoPacket(e,t+1,n-1,r,i,a):this._onError(K.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(s))}}},{key:"_parseAVCVideoPacket",value:function(e,t,n,r,i,o){if(n<4)u.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var a=this._littleEndian,s=new DataView(e,t,n),l=s.getUint8(0),c=(16777215&s.getUint32(0,!a))<<8>>8;if(0===l)this._parseAVCDecoderConfigurationRecord(e,t+4,n-4);else if(1===l)this._parseAVCVideoData(e,t+4,n-4,r,i,o,c);else if(2!==l)return void this._onError(K.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(l))}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(e,t,n){if(n<7)u.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var r=this._videoMetadata,i=this._videoTrack,o=this._littleEndian,a=new DataView(e,t,n);r?void 0!==r.avcc&&u.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(r=this._videoMetadata={}).type="video",r.id=i.id,r.timescale=this._timescale,r.duration=this._duration);var s=a.getUint8(0),l=a.getUint8(1);a.getUint8(2),a.getUint8(3);if(1===s&&0!==l)if(this._naluLengthSize=1+(3&a.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var c=31&a.getUint8(5);if(0!==c){c>1&&u.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(c));for(var h=6,d=0;d<c;d++){var f=a.getUint16(h,!o);if(h+=2,0!==f){var p=new Uint8Array(e,t+h,f);h+=f;var m=W.parseSPS(p);if(0===d){r.codecWidth=m.codec_size.width,r.codecHeight=m.codec_size.height,r.presentWidth=m.present_size.width,r.presentHeight=m.present_size.height,r.profile=m.profile_string,r.level=m.level_string,r.bitDepth=m.bit_depth,r.chromaFormat=m.chroma_format,r.sarRatio=m.sar_ratio,r.frameRate=m.frame_rate,!1!==m.frame_rate.fixed&&0!==m.frame_rate.fps_num&&0!==m.frame_rate.fps_den||(r.frameRate=this._referenceFrameRate);var g=r.frameRate.fps_den,v=r.frameRate.fps_num;r.refSampleDuration=r.timescale*(g/v);for(var y=p.subarray(1,4),b="avc1.",_=0;_<3;_++){var E=y[_].toString(16);E.length<2&&(E="0"+E),b+=E}r.codec=b;var x=this._mediaInfo;x.width=r.codecWidth,x.height=r.codecHeight,x.fps=r.frameRate.fps,x.profile=r.profile,x.level=r.level,x.refFrames=m.ref_frames,x.chromaFormat=m.chroma_format_string,x.sarNum=r.sarRatio.width,x.sarDen=r.sarRatio.height,x.videoCodec=b,x.hasAudio?null!=x.audioCodec&&(x.mimeType='video/x-flv; codecs="'+x.videoCodec+","+x.audioCodec+'"'):x.mimeType='video/x-flv; codecs="'+x.videoCodec+'"',x.isComplete()&&this._onMediaInfo(x)}}}var w=a.getUint8(h);if(0!==w){w>1&&u.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(w)),h++;for(var S=0;S<w;S++){var k=a.getUint16(h,!o);h+=2,0!==k&&(h+=k)}r.avcc=new Uint8Array(n),r.avcc.set(new Uint8Array(e,t,n),0),u.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",r)}else this._onError(K.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else this._onError(K.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else this._onError(K.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else this._onError(K.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}}},{key:"_parseAVCVideoData",value:function(e,t,n,r,i,o,a){for(var s=this._littleEndian,l=new DataView(e,t,n),c=[],h=0,d=0,f=this._naluLengthSize,p=this._timestampBase+r,m=1===o;d<n;){if(d+4>=n){u.w(this.TAG,"Malformed Nalu near timestamp ".concat(p,", offset = ").concat(d,", dataSize = ").concat(n));break}var g=l.getUint32(d,!s);if(3===f&&(g>>>=8),g>n-f)return void u.w(this.TAG,"Malformed Nalus near timestamp ".concat(p,", NaluSize > DataSize!"));var v=31&l.getUint8(d+f);5===v&&(m=!0);var y=new Uint8Array(e,t+d,f+g),b={type:v,data:y};c.push(b),h+=y.byteLength,d+=f+g}if(c.length){var _=this._videoTrack,E={units:c,length:h,isKeyframe:m,dts:p,cts:a,pts:p+a};m&&(E.fileposition=i),_.samples.push(E),_.length+=h}}}],[{key:"probe",value:function(e){var t=new Uint8Array(e),n={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return n;var r,i,o=(4&t[4])>>>2!=0,a=0!=(1&t[4]),s=(r=t)[i=5]<<24|r[i+1]<<16|r[i+2]<<8|r[i+3];return s<9?n:{match:!0,consumed:s,dataOffset:s,hasAudioTrack:o,hasVideoTrack:a}}}]),e}(),X=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,null,[{key:"init",value:function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var n=e.constants={};n.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),n.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),n.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),n.STSC=n.STCO=n.STTS,n.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),n.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),n.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),n.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(e){for(var t=8,n=null,r=Array.prototype.slice.call(arguments,1),i=r.length,o=0;o<i;o++)t+=r[o].byteLength;(n=new Uint8Array(t))[0]=t>>>24&255,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n.set(e,4);for(var a=8,s=0;s<i;s++)n.set(r[s],a),a+=r[s].byteLength;return n}},{key:"generateInitSegment",value:function(t){var n=e.box(e.types.ftyp,e.constants.FTYP),r=e.moov(t),i=new Uint8Array(n.byteLength+r.byteLength);return i.set(n,0),i.set(r,n.byteLength),i}},{key:"moov",value:function(t){var n=e.mvhd(t.timescale,t.duration),r=e.trak(t),i=e.mvex(t);return e.box(e.types.moov,n,r,i)}},{key:"mvhd",value:function(t,n){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var n=t.id,r=t.duration,i=t.presentWidth,o=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,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,i>>>8&255,255&i,0,0,o>>>8&255,255&o,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var n=t.timescale,r=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,85,196,0,0]))}},{key:"hdlr",value:function(t){var n=null;return n="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,n)}},{key:"minf",value:function(t){var n=null;return n="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,n,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))}},{key:"mp3",value:function(t){var n=t.channelCount,r=t.audioSampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types[".mp3"],i)}},{key:"mp4a",value:function(t){var n=t.channelCount,r=t.audioSampleRate,i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.mp4a,i,e.esds(t))}},{key:"esds",value:function(t){var n=t.config||[],r=n.length,i=new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(n).concat([6,1,2]));return e.box(e.types.esds,i)}},{key:"avc1",value:function(t){var n=t.avcc,r=t.codecWidth,i=t.codecHeight,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r>>>8&255,255&r,i>>>8&255,255&i,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,o,e.box(e.types.avcC,n))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var n=t.id,r=new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,r)}},{key:"moof",value:function(t,n){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,n))}},{key:"mfhd",value:function(t){var n=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,n)}},{key:"traf",value:function(t,n){var r=t.id,i=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),o=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),a=e.sdtp(t),s=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,i,o,s,a)}},{key:"sdtp",value:function(t){for(var n=t.samples||[],r=n.length,i=new Uint8Array(4+r),o=0;o<r;o++){var a=n[o].flags;i[o+4]=a.isLeading<<6|a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy}return e.box(e.types.sdtp,i)}},{key:"trun",value:function(t,n){var r=t.samples||[],i=r.length,o=12+16*i,a=new Uint8Array(o);n+=8+o,a.set([0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0);for(var s=0;s<i;s++){var l=r[s].duration,c=r[s].size,u=r[s].flags,h=r[s].cts;a.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.isNonSync,0,0,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*s)}return e.box(e.types.trun,a)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();X.init();var Y=X,$=function(){function e(){Object(r.a)(this,e)}return Object(i.a)(e,null,[{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)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===t)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===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),e}(),J=function e(t,n,i,o,a){Object(r.a)(this,e),this.dts=t,this.pts=n,this.duration=i,this.originalDts=o,this.isSyncPoint=a,this.fileposition=null},Z=function(){function e(){Object(r.a)(this,e),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return Object(i.a)(e,[{key:"appendSyncPoint",value:function(e){e.isSyncPoint=!0,this.syncPoints.push(e)}}]),e}(),Q=function(){function e(){Object(r.a)(this,e),this._list=[]}return Object(i.a)(e,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))}},{key:"getLastSyncPointBeforeDts",value:function(e){if(0==this._list.length)return null;var t=this._list,n=0,r=t.length-1,i=0,o=0,a=r;for(e<t[0].dts&&(n=0,o=a+1);o<=a;){if((i=o+Math.floor((a-o)/2))===r||e>=t[i].dts&&e<t[i+1].dts){n=i;break}t[i].dts<e?o=i+1:a=i-1}return this._list[n]}}]),e}(),ee=function(){function e(t){Object(r.a)(this,e),this._type=t,this._list=[],this._lastAppendLocation=-1}return Object(i.a)(e,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return 0===this._list.length}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(e){var t=this._list;if(0===t.length)return-2;var n=t.length-1,r=0,i=0,o=n,a=0;if(e<t[0].originalBeginDts)return a=-1;for(;i<=o;){if((r=i+Math.floor((o-i)/2))===n||e>t[r].lastSample.originalDts&&e<t[r+1].originalBeginDts){a=r;break}t[r].originalBeginDts<e?i=r+1:o=r-1}return a}},{key:"_searchNearestSegmentAfter",value:function(e){return this._searchNearestSegmentBefore(e)+1}},{key:"append",value:function(e){var t=this._list,n=e,r=this._lastAppendLocation,i=0;-1!==r&&r<t.length&&n.originalBeginDts>=t[r].lastSample.originalDts&&(r===t.length-1||r<t.length-1&&n.originalBeginDts<t[r+1].originalBeginDts)?i=r+1:t.length>0&&(i=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=i,this._list.splice(i,0,n)}},{key:"getLastSegmentBefore",value:function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}},{key:"getLastSampleBefore",value:function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}},{key:"getLastSyncPointBefore",value:function(e){for(var t=this._searchNearestSegmentBefore(e),n=this._list[t].syncPoints;0===n.length&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null}}]),e}(),te=function(){function e(t){Object(r.a)(this,e),this.TAG="MP4Remuxer",this._config=t,this._isLive=!0===t.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new ee("audio"),this._videoSegmentInfoList=new ee("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!S.chrome||!(S.version.major<50||50===S.version.major&&S.version.build<2661)),this._fillSilentAfterSeek=S.msedge||S.msie,this._mp3UseMpegAudio=!S.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return Object(i.a)(e,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(e,t){if(!this._onMediaSegment)throw new m("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)}},{key:"_onTrackMetadataReceived",value:function(e,t){var n=null,r="mp4",i=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(r="mpeg",i="",n=new Uint8Array):n=Y.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,n=Y.generateInitSegment(t)}if(!this._onInitSegment)throw new m("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:n.buffer,codec:i,container:"".concat(e,"/").concat(r),mediaDuration:t.duration})}},{key:"_calculateDtsBase",value:function(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}},{key:"flushStashedSamples",value:function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,n={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(n.samples.push(e),n.length=e.length);var r={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(r.samples.push(t),r.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(n,!0),this._remuxAudio(r,!0)}},{key:"_remuxAudio",value:function(e,t){if(null!=this._audioMeta){var n,r=e,i=r.samples,o=void 0,a=-1,s=this._audioMeta.refSampleDuration,l="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,c=this._dtsBaseInited&&void 0===this._audioNextDts,h=!1;if(i&&0!==i.length&&(1!==i.length||t)){var d=0,f=null,p=0;l?(d=0,p=r.length):(d=8,p=8+r.length);var m=null;if(i.length>1&&(p-=(m=i.pop()).length),null!=this._audioStashedLastSample){var g=this._audioStashedLastSample;this._audioStashedLastSample=null,i.unshift(g),p+=g.length}null!=m&&(this._audioStashedLastSample=m);var v=i[0].dts-this._dtsBase;if(this._audioNextDts)o=v-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())o=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(h=!0);else{var y=this._audioSegmentInfoList.getLastSampleBefore(v);if(null!=y){var b=v-(y.originalDts+y.duration);b<=3&&(b=0),o=v-(y.dts+y.duration+b)}else o=0}if(h){var _=v-o,E=this._videoSegmentInfoList.getLastSegmentBefore(v);if(null!=E&&E.beginDts<_){var x=$.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(x){var w=E.beginDts,k=_-E.beginDts;u.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(w,", duration: ").concat(k)),i.unshift({unit:x,dts:w,pts:w}),p+=x.byteLength}}else h=!1}for(var C=[],T=0;T<i.length;T++){var O=i[T],A=O.unit,L=O.dts-this._dtsBase,R=L-o;-1===a&&(a=R);var D=0;if(T!==i.length-1)D=i[T+1].dts-this._dtsBase-o-R;else if(null!=m)D=m.dts-this._dtsBase-o-R;else D=C.length>=1?C[C.length-1].duration:Math.floor(s);var I=!1,M=null;if(D>1.5*s&&"mp3"!==this._audioMeta.codec&&this._fillAudioTimestampGap&&!S.safari){I=!0;var N=Math.abs(D-s),P=Math.ceil(N/s),j=R+s;u.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"dts: ".concat(R+D," ms, expected: ").concat(R+Math.round(s)," ms, ")+"delta: ".concat(Math.round(N)," ms, generate: ").concat(P," frames"));var B=$.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==B&&(u.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),B=A),M=[];for(var F=0;F<P;F++){var U=Math.round(j);if(M.length>0){var G=M[M.length-1];G.duration=U-G.dts}var z={dts:U,pts:U,cts:0,unit:B,size:B.byteLength,duration:0,originalDts:L,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};M.push(z),p+=z.size,j+=s}var H=M[M.length-1];H.duration=R+D-H.dts,D=Math.round(s)}C.push({dts:R,pts:R,cts:0,unit:O.unit,size:O.unit.byteLength,duration:D,originalDts:L,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),I&&C.push.apply(C,M)}l?f=new Uint8Array(p):((f=new Uint8Array(p))[0]=p>>>24&255,f[1]=p>>>16&255,f[2]=p>>>8&255,f[3]=255&p,f.set(Y.types.mdat,4));for(var V=0;V<C.length;V++){var W=C[V].unit;f.set(W,d),d+=W.byteLength}var K=C[C.length-1];n=K.dts+K.duration,this._audioNextDts=n;var q=new Z;q.beginDts=a,q.endDts=n,q.beginPts=a,q.endPts=n,q.originalBeginDts=C[0].originalDts,q.originalEndDts=K.originalDts+K.duration,q.firstSample=new J(C[0].dts,C[0].pts,C[0].duration,C[0].originalDts,!1),q.lastSample=new J(K.dts,K.pts,K.duration,K.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(q),r.samples=C,r.sequenceNumber++;var X=null;X=l?new Uint8Array:Y.moof(r,a),r.samples=[],r.length=0;var Q={type:"audio",data:this._mergeBoxes(X,f).buffer,sampleCount:C.length,info:q};l&&c&&(Q.timestampOffset=a),this._onMediaSegment("audio",Q)}}}},{key:"_remuxVideo",value:function(e,t){if(null!=this._videoMeta){var n,r,i=e,o=i.samples,a=void 0,s=-1,l=-1;if(o&&0!==o.length&&(1!==o.length||t)){var c=8,u=null,h=8+e.length,d=null;if(o.length>1&&(h-=(d=o.pop()).length),null!=this._videoStashedLastSample){var f=this._videoStashedLastSample;this._videoStashedLastSample=null,o.unshift(f),h+=f.length}null!=d&&(this._videoStashedLastSample=d);var p=o[0].dts-this._dtsBase;if(this._videoNextDts)a=p-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())a=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(p);if(null!=m){var g=p-(m.originalDts+m.duration);g<=3&&(g=0),a=p-(m.dts+m.duration+g)}else a=0}for(var v=new Z,y=[],b=0;b<o.length;b++){var _=o[b],E=_.dts-this._dtsBase,x=_.isKeyframe,w=E-a,S=_.cts,k=w+S;-1===s&&(s=w,l=k);var C=0;if(b!==o.length-1)C=o[b+1].dts-this._dtsBase-a-w;else if(null!=d)C=d.dts-this._dtsBase-a-w;else C=y.length>=1?y[y.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(x){var T=new J(w,k,C,_.dts,!0);T.fileposition=_.fileposition,v.appendSyncPoint(T)}y.push({dts:w,pts:k,cts:S,units:_.units,size:_.length,isKeyframe:x,duration:C,originalDts:E,flags:{isLeading:0,dependsOn:x?2:1,isDependedOn:x?1:0,hasRedundancy:0,isNonSync:x?0:1}})}(u=new Uint8Array(h))[0]=h>>>24&255,u[1]=h>>>16&255,u[2]=h>>>8&255,u[3]=255&h,u.set(Y.types.mdat,4);for(var O=0;O<y.length;O++)for(var A=y[O].units;A.length;){var L=A.shift().data;u.set(L,c),c+=L.byteLength}var R=y[y.length-1];if(n=R.dts+R.duration,r=R.pts+R.duration,this._videoNextDts=n,v.beginDts=s,v.endDts=n,v.beginPts=l,v.endPts=r,v.originalBeginDts=y[0].originalDts,v.originalEndDts=R.originalDts+R.duration,v.firstSample=new J(y[0].dts,y[0].pts,y[0].duration,y[0].originalDts,y[0].isKeyframe),v.lastSample=new J(R.dts,R.pts,R.duration,R.originalDts,R.isKeyframe),this._isLive||this._videoSegmentInfoList.append(v),i.samples=y,i.sequenceNumber++,this._forceFirstIDR){var D=y[0].flags;D.dependsOn=2,D.isNonSync=0}var I=Y.moof(i,s);i.samples=[],i.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(I,u).buffer,sampleCount:y.length,info:v})}}}},{key:"_mergeBoxes",value:function(e,t){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}}]),e}(),ne={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},re=function(){function e(t,n){Object(r.a)(this,e),this.TAG="TransmuxingController",this._emitter=new l.a,this._config=n,t.segments||(t.segments=[{duration:t.duration,filesize:t.filesize,url:t.url}]),"boolean"!=typeof t.cors&&(t.cors=!0),"boolean"!=typeof t.withCredentials&&(t.withCredentials=!1),this._mediaDataSource=t,this._currentSegmentIndex=0;var i=0;this._mediaDataSource.segments.forEach((function(e){e.timestampBase=i,i+=e.duration,e.cors=t.cors,e.withCredentials=t.withCredentials,n.referrerPolicy&&(e.referrerPolicy=n.referrerPolicy)})),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return Object(i.a)(e,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(e,t){this._currentSegmentIndex=e;var n=this._mediaDataSource.segments[e],r=this._ioctl=new R(n,this._config,e);r.onError=this._onIOException.bind(this),r.onSeeked=this._onIOSeeked.bind(this),r.onComplete=this._onIOComplete.bind(this),r.onRedirect=this._onIORedirect.bind(this),r.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):r.onDataArrival=this._onInitChunkArrival.bind(this),r.open(t)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(e){if(null!=this._mediaInfo&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){var n=this._mediaInfo.segments[t];if(null==n)this._pendingSeekTime=e;else{var r=n.getNearestKeyframe(e);this._remuxer.seek(r.milliseconds),this._ioctl.seek(r.fileposition),this._pendingResolveSeekPoint=r.milliseconds}}else{var i=this._mediaInfo.segments[t];if(null==i)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{var o=i.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,o.fileposition),this._pendingResolveSeekPoint=o.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}}},{key:"_searchSegmentIndexContains",value:function(e){for(var t=this._mediaDataSource.segments,n=t.length-1,r=0;r<t.length;r++)if(e<t[r].timestampBase){n=r-1;break}return n}},{key:"_onInitChunkArrival",value:function(e,t){var n=this,r=null,i=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,i=this._demuxer.parseChunks(e,t);else if((r=q.probe(e)).match){this._demuxer=new q(r,this._config),this._remuxer||(this._remuxer=new te(this._config));var o=this._mediaDataSource;null==o.duration||isNaN(o.duration)||(this._demuxer.overridedDuration=o.duration),"boolean"==typeof o.hasAudio&&(this._demuxer.overridedHasAudio=o.hasAudio),"boolean"==typeof o.hasVideo&&(this._demuxer.overridedHasVideo=o.hasVideo),this._demuxer.timestampBase=o.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),i=this._demuxer.parseChunks(e,t)}else r=null,u.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((function(){n._internalAbort()})),this._emitter.emit(ne.DEMUX_ERROR,K.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),i=0;return i}},{key:"_onMediaInfo",value:function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,B.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,B.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=n,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))}},{key:"_onMetaDataArrived",value:function(e){this._emitter.emit(ne.METADATA_ARRIVED,e)}},{key:"_onScriptDataArrived",value:function(e){this._emitter.emit(ne.SCRIPTDATA_ARRIVED,e)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(e){var t=e+1;t<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(t)):(this._remuxer.flushStashedSamples(),this._emitter.emit(ne.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(e){var t=this._ioctl.extraData;this._mediaDataSource.segments[t].redirectedURL=e}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(ne.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(e,t){u.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(ne.IO_ERROR,e,t),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(e,t){u.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(ne.DEMUX_ERROR,e,t)}},{key:"_onRemuxerInitSegmentArrival",value:function(e,t){this._emitter.emit(ne.INIT_SEGMENT,e,t)}},{key:"_onRemuxerMediaSegmentArrival",value:function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(ne.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var n=t.info.syncPoints,r=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,S.safari&&n.length>0&&n[0].originalDts===r&&(r=n[0].pts),this._emitter.emit(ne.RECOMMEND_SEEKPOINT,r)}}},{key:"_enableStatisticsReporter",value:function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(e){var t=this._mediaInfo.segments[e],n=Object.assign({},t);n.duration=this._mediaInfo.duration,n.segmentCount=this._mediaInfo.segmentCount,delete n.segments,delete n.keyframesIndex,this._emitter.emit(ne.MEDIA_INFO,n)}},{key:"_reportStatisticsInfo",value:function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(ne.STATISTICS_INFO,e)}}]),e}(),ie=function(e){var t=null,n=function(t,n){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:n}})}.bind(this);function r(t,n){var r={msg:ne.INIT_SEGMENT,data:{type:t,data:n}};e.postMessage(r,[n.data])}function i(t,n){var r={msg:ne.MEDIA_SEGMENT,data:{type:t,data:n}};e.postMessage(r,[n.data])}function o(){var t={msg:ne.LOADING_COMPLETE};e.postMessage(t)}function s(){var t={msg:ne.RECOVERED_EARLY_EOF};e.postMessage(t)}function l(t){var n={msg:ne.MEDIA_INFO,data:t};e.postMessage(n)}function c(t){var n={msg:ne.METADATA_ARRIVED,data:t};e.postMessage(n)}function u(t){var n={msg:ne.SCRIPTDATA_ARRIVED,data:t};e.postMessage(n)}function h(t){var n={msg:ne.STATISTICS_INFO,data:t};e.postMessage(n)}function d(t,n){e.postMessage({msg:ne.IO_ERROR,data:{type:t,info:n}})}function f(t,n){e.postMessage({msg:ne.DEMUX_ERROR,data:{type:t,info:n}})}function p(t){e.postMessage({msg:ne.RECOMMEND_SEEKPOINT,data:t})}a.install(),e.addEventListener("message",(function(a){switch(a.data.cmd){case"init":(t=new re(a.data.param[0],a.data.param[1])).on(ne.IO_ERROR,d.bind(this)),t.on(ne.DEMUX_ERROR,f.bind(this)),t.on(ne.INIT_SEGMENT,r.bind(this)),t.on(ne.MEDIA_SEGMENT,i.bind(this)),t.on(ne.LOADING_COMPLETE,o.bind(this)),t.on(ne.RECOVERED_EARLY_EOF,s.bind(this)),t.on(ne.MEDIA_INFO,l.bind(this)),t.on(ne.METADATA_ARRIVED,c.bind(this)),t.on(ne.SCRIPTDATA_ARRIVED,u.bind(this)),t.on(ne.STATISTICS_INFO,h.bind(this)),t.on(ne.RECOMMEND_SEEKPOINT,p.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(a.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":var m=a.data.param;j.applyConfig(m),!0===m.enableCallback?j.addLogListener(n):j.removeLogListener(n)}}))},oe=function(){function e(t,i){if(Object(r.a)(this,e),this.TAG="Transmuxer",this._emitter=new l.a,i.enableWorker&&"undefined"!=typeof Worker)try{var o=n(/*! webworkify */"0r65");this._worker=o(ie),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[t,i]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},j.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:j.getConfig()})}catch(e){u.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new re(t,i)}else this._controller=new re(t,i);if(this._controller){var a=this._controller;a.on(ne.IO_ERROR,this._onIOError.bind(this)),a.on(ne.DEMUX_ERROR,this._onDemuxError.bind(this)),a.on(ne.INIT_SEGMENT,this._onInitSegment.bind(this)),a.on(ne.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),a.on(ne.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),a.on(ne.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),a.on(ne.MEDIA_INFO,this._onMediaInfo.bind(this)),a.on(ne.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),a.on(ne.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),a.on(ne.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),a.on(ne.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return Object(i.a)(e,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),j.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"hasWorker",value:function(){return null!=this._worker}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(ne.INIT_SEGMENT,e,t)}))}},{key:"_onMediaSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(ne.MEDIA_SEGMENT,e,t)}))}},{key:"_onLoadingComplete",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(ne.LOADING_COMPLETE)}))}},{key:"_onRecoveredEarlyEof",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(ne.RECOVERED_EARLY_EOF)}))}},{key:"_onMediaInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(ne.MEDIA_INFO,e)}))}},{key:"_onMetaDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(ne.METADATA_ARRIVED,e)}))}},{key:"_onScriptDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(ne.SCRIPTDATA_ARRIVED,e)}))}},{key:"_onStatisticsInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(ne.STATISTICS_INFO,e)}))}},{key:"_onIOError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(ne.IO_ERROR,e,t)}))}},{key:"_onDemuxError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(ne.DEMUX_ERROR,e,t)}))}},{key:"_onRecommendSeekpoint",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(ne.RECOMMEND_SEEKPOINT,e)}))}},{key:"_onLoggingConfigChanged",value:function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})}},{key:"_onWorkerMessage",value:function(e){var t=e.data,n=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case ne.INIT_SEGMENT:case ne.MEDIA_SEGMENT:this._emitter.emit(t.msg,n.type,n.data);break;case ne.LOADING_COMPLETE:case ne.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case ne.MEDIA_INFO:Object.setPrototypeOf(n,B.prototype),this._emitter.emit(t.msg,n);break;case ne.METADATA_ARRIVED:case ne.SCRIPTDATA_ARRIVED:case ne.STATISTICS_INFO:this._emitter.emit(t.msg,n);break;case ne.IO_ERROR:case ne.DEMUX_ERROR:this._emitter.emit(t.msg,n.type,n.info);break;case ne.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,n);break;case"logcat_callback":u.emitter.emit("log",n.type,n.logcat)}}}]),e}(),ae={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},se=function(){function e(t){Object(r.a)(this,e),this.TAG="MSEController",this._config=t,this._emitter=new l.a,this._config.isLive&&null==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new Q}return Object(i.a)(e,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){if(this._mediaSource)throw new m("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var n=this._pendingSegments[t];n.splice(0,n.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var r=this._sourceBuffers[t];if(r){if("closed"!==e.readyState){try{e.removeSourceBuffer(r)}catch(e){u.e(this.TAG,e.message)}r.removeEventListener("error",this.e.onSourceBufferError),r.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){u.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var n=e,r="".concat(n.container);n.codec&&n.codec.length>0&&(r+=";codecs=".concat(n.codec));var i=!1;if(u.v(this.TAG,"Received Initialization Segment, mimeType: "+r),this._lastInitSegments[n.type]=n,r!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])u.v(this.TAG,"Notice: ".concat(n.type," mimeType changed, origin: ").concat(this._mimeTypes[n.type],", target: ").concat(r));else{i=!0;try{var o=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(r);o.addEventListener("error",this.e.onSourceBufferError),o.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return u.e(this.TAG,e.message),void this._emitter.emit(ae.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[n.type]=r}t||this._pendingSegments[n.type].push(n),i||this._sourceBuffers[n.type]&&!this._sourceBuffers[n.type].updating&&this._doAppendSegments(),S.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var n=this._sourceBuffers[t.type];!n||n.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}},{key:"seek",value:function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var n=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{n.abort()}catch(e){u.e(this.TAG,e.message)}this._idrList.clear();var r=this._pendingSegments[t];if(r.splice(0,r.length),"closed"!==this._mediaSource.readyState){for(var i=0;i<n.buffered.length;i++){var o=n.buffered.start(i),a=n.buffered.end(i);this._pendingRemoveRanges[t].push({start:o,end:a})}if(n.updating||this._doRemoveRanges(),S.safari){var s=this._lastInitSegments[t];s&&(this._pendingSegments[t].push(s),n.updating||this._doAppendSegments())}}}}},{key:"endOfStream",value:function(){var e=this._mediaSource,t=this._sourceBuffers;e&&"open"===e.readyState?t.video&&t.video.updating||t.audio&&t.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,e.endOfStream()):e&&"closed"===e.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)}},{key:"getNearestKeyframe",value:function(e){return this._idrList.getLastSyncPointBeforeDts(e)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){var r=n.buffered;if(r.length>=1&&e-r.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){for(var r=n.buffered,i=!1,o=0;o<r.length;o++){var a=r.start(o),s=r.end(o);if(a<=e&&e<s+3){if(e-a>=this._config.autoCleanupMaxBackwardDuration){i=!0;var l=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:a,end:l})}}else s<e&&(i=!0,this._pendingRemoveRanges[t].push({start:a,end:s}))}i&&!n.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var e=this._sourceBuffers;if(0!==this._mediaElement.readyState&&"open"===this._mediaSource.readyState&&!(e.video&&e.video.updating||e.audio&&e.audio.updating)){var t=this._mediaSource.duration,n=this._pendingMediaDuration;n>0&&(isNaN(t)||n>t)&&(u.v(this.TAG,"Update MediaSource duration from ".concat(t," to ").concat(n)),this._mediaSource.duration=n),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}}},{key:"_doRemoveRanges",value:function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],n=this._pendingRemoveRanges[e];n.length&&!t.updating;){var r=n.shift();t.remove(r.start,r.end)}}},{key:"_doAppendSegments",value:function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var n=e[t].shift();if(n.timestampOffset){var r=this._sourceBuffers[t].timestampOffset,i=n.timestampOffset/1e3;Math.abs(r-i)>.1&&(u.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(r," to ").concat(i)),this._sourceBuffers[t].timestampOffset=i),delete n.timestampOffset}if(!n.data||0===n.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(n.data),this._isBufferFull=!1,"video"===t&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(e){this._pendingSegments[t].unshift(n),22===e.code?(this._isBufferFull||this._emitter.emit(ae.BUFFER_FULL),this._isBufferFull=!0):(u.e(this.TAG,e.message),this._emitter.emit(ae.ERROR,{code:e.code,msg:e.message}))}}}},{key:"_onSourceOpen",value:function(){if(u.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(ae.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){u.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){u.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(ae.UPDATE_END)}},{key:"_onSourceBufferError",value:function(e){u.e(this.TAG,"SourceBuffer Error: ".concat(e))}}]),e}(),le={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},ce={NETWORK_EXCEPTION:b.EXCEPTION,NETWORK_STATUS_CODE_INVALID:b.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:b.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:b.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:K.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:K.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:K.CODEC_UNSUPPORTED},ue=function(){function e(t,n){if(Object(r.a)(this,e),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new l.a,this._config=I(),"object"==typeof n&&Object.assign(this._config,n),"flv"!==t.type.toLowerCase())throw new g("FlvPlayer requires an flv MediaDataSource input!");!0===t.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=t,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var i=S.chrome&&(S.version.major<50||50===S.version.major&&S.version.build<2661);this._alwaysSeekKeyframe=!!(i||S.msedge||S.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return Object(i.a)(e,[{key:"destroy",value:function(){null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){var n=this;e===N.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){n._emitter.emit(N.MEDIA_INFO,n.mediaInfo)})):e===N.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){n._emitter.emit(N.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){var t=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new se(this._config),this._msectl.on(ae.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(ae.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(ae.SOURCE_OPEN,(function(){t._mseSourceOpened=!0,t._hasPendingLoad&&(t._hasPendingLoad=!1,t.load())})),this._msectl.on(ae.ERROR,(function(e){t._emitter.emit(N.ERROR,le.MEDIA_ERROR,ce.MEDIA_MSE_ERROR,e)})),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var e=this;if(!this._mediaElement)throw new m("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new m("FlvPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new oe(this._mediaDataSource,this._config),this._transmuxer.on(ne.INIT_SEGMENT,(function(t,n){e._msectl.appendInitSegment(n)})),this._transmuxer.on(ne.MEDIA_SEGMENT,(function(t,n){if(e._msectl.appendMediaSegment(n),e._config.lazyLoad&&!e._config.isLive){var r=e._mediaElement.currentTime;n.info.endDts>=1e3*(r+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(u.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(ne.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(N.LOADING_COMPLETE)})),this._transmuxer.on(ne.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(N.RECOVERED_EARLY_EOF)})),this._transmuxer.on(ne.IO_ERROR,(function(t,n){e._emitter.emit(N.ERROR,le.NETWORK_ERROR,t,n)})),this._transmuxer.on(ne.DEMUX_ERROR,(function(t,n){e._emitter.emit(N.ERROR,le.MEDIA_ERROR,t,{code:-1,msg:n})})),this._transmuxer.on(ne.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(N.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(ne.METADATA_ARRIVED,(function(t){e._emitter.emit(N.METADATA_ARRIVED,t)})),this._transmuxer.on(ne.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(N.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(ne.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(N.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(ne.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()))}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,r=0;if(this._mediaElement.getVideoPlaybackQuality){var i=this._mediaElement.getVideoPlaybackQuality();n=i.totalVideoFrames,r=i.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,r=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=r),e}},{key:"_onmseUpdateEnd",value:function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,n=0,r=0;r<e.length;r++){var i=e.start(r),o=e.end(r);if(i<=t&&t<o){i,n=o;break}}n>=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(u.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}},{key:"_onmseBufferFull",value:function(){u.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,n=!1,r=0;r<t.length;r++){var i=t.start(r),o=t.end(r);if(e>=i&&e<o){e>=o-this._config.lazyLoadRecoverDuration&&(n=!0);break}}n&&(window.clearInterval(this._progressChecker),this._progressChecker=null,n&&(u.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(e){for(var t=this._mediaElement.buffered,n=0;n<t.length;n++){var r=t.start(n),i=t.end(n);if(e>=r&&e<i)return!0}return!1}},{key:"_internalSeek",value:function(e){var t=this._isTimepointBuffered(e),n=!1,r=0;if(e<1&&this._mediaElement.buffered.length>0){var i=this._mediaElement.buffered.start(0);(i<1&&e<i||S.safari)&&(n=!0,r=S.safari?.1:i)}if(n)this._requestSetTime=!0,this._mediaElement.currentTime=r;else if(t){if(this._alwaysSeekKeyframe){var o=this._msectl.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement.currentTime=null!=o?o.dts/1e3:e}else this._requestSetTime=!0,this._mediaElement.currentTime=e;null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var e=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(e)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(e){var t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){var n=t.buffered;n.length>0&&t.currentTime<n.start(0)&&(u.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(n.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=n.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(e){var t=this._mediaElement.currentTime,n=this._mediaElement.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(t<1&&n.length>0){var r=n.start(0);if(r<1&&t<r||S.safari)return this._requestSetTime=!0,void(this._mediaElement.currentTime=S.safari?.1:r)}if(this._isTimepointBuffered(t)){if(this._alwaysSeekKeyframe){var i=this._msectl.getNearestKeyframe(Math.floor(1e3*t));null!=i&&(this._requestSetTime=!0,this._mediaElement.currentTime=i.dts/1e3)}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:t,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}}},{key:"_onvCanPlay",value:function(e){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(e){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(e){this._checkAndResumeStuckPlayback()}}]),e}(),he=function(){function e(t,n){if(Object(r.a)(this,e),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new l.a,this._config=I(),"object"==typeof n&&Object.assign(this._config,n),"flv"===t.type.toLowerCase())throw new g("NativePlayer does't support flv MediaDataSource input!");if(t.hasOwnProperty("segments"))throw new g("NativePlayer(".concat(t.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=t,this._mediaElement=null}return Object(i.a)(e,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){var n=this;e===N.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(N.MEDIA_INFO,n.mediaInfo)})):e===N.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(N.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new m("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e}},{key:"statisticsInfo",get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,r=0;if(this._mediaElement.getVideoPlaybackQuality){var i=this._mediaElement.getVideoPlaybackQuality();n=i.totalVideoFrames,r=i.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,r=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=r),e}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(N.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(N.STATISTICS_INFO,this.statisticsInfo)}}]),e}();a.install();var de={createPlayer:function(e,t){var n=e;if(null==n||"object"!=typeof n)throw new g("MediaDataSource must be an javascript object!");if(!n.hasOwnProperty("type"))throw new g("MediaDataSource must has type field to indicate video file type!");switch(n.type){case"flv":return new ue(n,t);default:return new he(n,t)}},isSupported:function(){return M.supportMSEH264Playback()},getFeatureList:function(){return M.getFeatureList()}};de.BaseLoader=_,de.LoaderStatus=y,de.LoaderErrors=b,de.Events=N,de.ErrorTypes=le,de.ErrorDetails=ce,de.FlvPlayer=ue,de.NativePlayer=he,de.LoggingControl=j,Object.defineProperty(de,"version",{enumerable:!0,get:function(){return"__VERSION__"}});t.a=de},GgEA:
/*!********************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/Discuss/discuss-item/index.less ***!
\********************************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},Gytx:
/*!********************************************!*\
!*** ./node_modules/shallowequal/index.js ***!
\********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<o.length;l++){var c=o[l];if(!s(c))return!1;var u=e[c],h=t[c];if(!1===(i=n?n.call(r,u,h,c):void 0)||void 0===i&&u!==h)return!1}return!0}},H38U:
/*!******************************************!*\
!*** ./node_modules/qr.js/lib/QRCode.js ***!
\******************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r=n(/*! ./8BitByte */"f4xo"),i=n(/*! ./RSBlock */"rcnY"),o=n(/*! ./BitBuffer */"wU8J"),a=n(/*! ./util */"Iq15"),s=n(/*! ./Polynomial */"dWSS");function l(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var c=l.prototype;c.addData=function(e){var t=new r(e);this.dataList.push(t),this.dataCache=null},c.isDark=function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},c.getModuleCount=function(){return this.moduleCount},c.make=function(){if(this.typeNumber<1){var e=1;for(e=1;e<40;e++){for(var t=i.getRSBlocks(e,this.errorCorrectLevel),n=new o,r=0,s=0;s<t.length;s++)r+=t[s].dataCount;for(s=0;s<this.dataList.length;s++){var l=this.dataList[s];n.put(l.mode,4),n.put(l.getLength(),a.getLengthInBits(l.mode,e)),l.write(n)}if(n.getLengthInBits()<=8*r)break}this.typeNumber=e}this.makeImpl(!1,this.getBestMaskPattern())},c.makeImpl=function(e,t){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(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=l.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},c.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(this.modules[e+n][t+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 e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=a.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},c.createMovieClip=function(e,t,n){var r=e.createEmptyMovieClip(t,n);this.make();for(var i=0;i<this.modules.length;i++)for(var o=1*i,a=0;a<this.modules[i].length;a++){var s=1*a;this.modules[i][a]&&(r.beginFill(0,100),r.moveTo(s,o),r.lineTo(s+1,o),r.lineTo(s+1,o+1),r.lineTo(s,o+1),r.endFill())}return r},c.setupTimingPattern=function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},c.setupPositionAdjustPattern=function(){for(var e=a.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var n=0;n<e.length;n++){var r=e[t],i=e[n];if(null==this.modules[r][i])for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)this.modules[r+o][i+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},c.setupTypeNumber=function(e){for(var t=a.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},c.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=a.getBCHTypeInfo(n),i=0;i<15;i++){var o=!e&&1==(r>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++){o=!e&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e},c.mapData=function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,o=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;o<e.length&&(c=1==(e[o]>>>i&1)),a.getMask(t,r,s-l)&&(c=!c),this.modules[r][s-l]=c,-1==--i&&(o++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}},l.PAD0=236,l.PAD1=17,l.createData=function(e,t,n){for(var r=i.getRSBlocks(e,t),s=new o,c=0;c<n.length;c++){var u=n[c];s.put(u.mode,4),s.put(u.getLength(),a.getLengthInBits(u.mode,e)),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(e,t){for(var n=0,r=0,i=0,o=new Array(t.length),l=new Array(t.length),c=0;c<t.length;c++){var u=t[c].dataCount,h=t[c].totalCount-u;r=Math.max(r,u),i=Math.max(i,h),o[c]=new Array(u);for(var d=0;d<o[c].length;d++)o[c][d]=255&e.buffer[d+n];n+=u;var f=a.getErrorCorrectPolynomial(h),p=new s(o[c],f.getLength()-1).mod(f);l[c]=new Array(f.getLength()-1);for(d=0;d<l[c].length;d++){var m=d+p.getLength()-l[c].length;l[c][d]=m>=0?p.get(m):0}}var g=0;for(d=0;d<t.length;d++)g+=t[d].totalCount;var v=new Array(g),y=0;for(d=0;d<r;d++)for(c=0;c<t.length;c++)d<o[c].length&&(v[y++]=o[c][d]);for(d=0;d<i;d++)for(c=0;c<t.length;c++)d<l[c].length&&(v[y++]=l[c][d]);return v},e.exports=l},HmJG:
/*!****************************************************************!*\
!*** ./src/components/markdown-editor/upload-image/index.less ***!
\****************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},Hw79:
/*!******************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/SubmitList/index.less?modules ***!
\******************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={pagination:"pagination___2VQzP",info:"info___1saw2"}},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(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return v}));var r,i=n("q1tI"),o=(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=i.createContext(null),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.render=function(){return i.createElement(a.Provider,{value:this.props.store},this.props.children)},t}(i.Component),l=n("Gytx"),c=n.n(l),u=n("2mql"),h=n.n(u),d=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(){return(f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};var p=function(){return{}};function m(e,t){void 0===t&&(t={});var n=!!e,r=e||p;return function(o){var s=function(t){function s(e,n){var i=t.call(this,e,n)||this;return i.unsubscribe=null,i.handleChange=function(){if(i.unsubscribe){var e=r(i.store.getState(),i.props);i.setState({subscribed:e})}},i.store=i.context,i.state={subscribed:r(i.store.getState(),e),store:i.store,props:e},i}return d(s,t),s.getDerivedStateFromProps=function(t,n){return e&&2===e.length&&t!==n.props?{subscribed:r(n.store.getState(),t),props:t}:{props:t}},s.prototype.componentDidMount=function(){this.trySubscribe()},s.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},s.prototype.shouldComponentUpdate=function(e,t){return!c()(this.props,e)||!c()(this.state.subscribed,t.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 e=f(f(f({},this.props),this.state.subscribed),{store:this.store});return i.createElement(o,f({},e,{ref:this.props.miniStoreForwardedRef}))},s.displayName="Connect("+function(e){return e.displayName||e.name||"Component"}(o)+")",s.contextType=a,s}(i.Component);if(t.forwardRef){var l=i.forwardRef((function(e,t){return i.createElement(s,f({},e,{miniStoreForwardedRef:t}))}));return h()(l,o)}return h()(s,o)}}var g=function(){return(g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function v(e){var t=e,n=[];return{setState:function(e){t=g(g({},t),e);for(var r=0;r<n.length;r++)n[r]()},getState:function(){return t},subscribe:function(e){return n.push(e),function(){var t=n.indexOf(e);n.splice(t,1)}}}}},IBYe:
/*!**************************************************!*\
!*** ./node_modules/rc-table/es/sugar/Column.js ***!
\**************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";t.a=function(e){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(e,t,n){var r=n(/*! ./mode */"nVVt"),i=n(/*! ./Polynomial */"dWSS"),o=n(/*! ./math */"dQei"),a=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(e){for(var t=e<<10;p.getBCHDigit(t)-p.getBCHDigit(p.G15)>=0;)t^=p.G15<<p.getBCHDigit(t)-p.getBCHDigit(p.G15);return(e<<10|t)^p.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;p.getBCHDigit(t)-p.getBCHDigit(p.G18)>=0;)t^=p.G18<<p.getBCHDigit(t)-p.getBCHDigit(p.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return p.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case a:return(t+n)%2==0;case s:return t%2==0;case l:return n%3==0;case c:return(t+n)%3==0;case u:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case h:return t*n%2+t*n%3==0;case d:return(t*n%2+t*n%3)%2==0;case f:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new i([1],0),n=0;n<e;n++)t=t.multiply(new i([1,o.gexp(n)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){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:"+e)}else if(t<27)switch(e){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:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){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:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r++)for(var i=0;i<t;i++){for(var o=0,a=e.isDark(r,i),s=-1;s<=1;s++)if(!(r+s<0||t<=r+s))for(var l=-1;l<=1;l++)i+l<0||t<=i+l||0==s&&0==l||a==e.isDark(r+s,i+l)&&o++;o>5&&(n+=3+o-5)}for(r=0;r<t-1;r++)for(i=0;i<t-1;i++){var c=0;e.isDark(r,i)&&c++,e.isDark(r+1,i)&&c++,e.isDark(r,i+1)&&c++,e.isDark(r+1,i+1)&&c++,0!=c&&4!=c||(n+=3)}for(r=0;r<t;r++)for(i=0;i<t-6;i++)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(i=0;i<t;i++)for(r=0;r<t-6;r++)e.isDark(r,i)&&!e.isDark(r+1,i)&&e.isDark(r+2,i)&&e.isDark(r+3,i)&&e.isDark(r+4,i)&&!e.isDark(r+5,i)&&e.isDark(r+6,i)&&(n+=40);var u=0;for(i=0;i<t;i++)for(r=0;r<t;r++)e.isDark(r,i)&&u++;return n+=10*(Math.abs(100*u/t/t-50)/5)}};e.exports=p},IxHN:
/*!******************************************!*\
!*** ./src/components/Spinner/index.tsx ***!
\******************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";var r=n(/*! react */"q1tI"),i=n.n(r),o=n(/*! ./index.less?modules */"07cG"),a=n.n(o);t.a=function(e){var t=e.message,n=e.className,r=e.children,o=e.style,s=void 0===o?{}:o;return i.a.createElement("div",{className:"".concat(a.a.idsRingWrapper," ").concat(n)},i.a.createElement("div",{className:a.a.ldsRing},i.a.createElement("div",null),i.a.createElement("div",null),i.a.createElement("div",null),i.a.createElement("div",null)),t?i.a.createElement("p",{style:s},t):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(e,t,n){(function(n){var r;!function(n,i){e.exports=function(n){"use strict";var i,o=(n=n||{}).Base64,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=function(e){for(var t={},n=0,r=e.length;n<r;n++)t[e.charAt(n)]=n;return t}(a),l=String.fromCharCode,c=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?l(192|t>>>6)+l(128|63&t):l(224|t>>>12&15)+l(128|t>>>6&63)+l(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return l(240|t>>>18&7)+l(128|t>>>12&63)+l(128|t>>>6&63)+l(128|63&t)},u=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(e){return e.replace(u,c)},d=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[a.charAt(n>>>18),a.charAt(n>>>12&63),t>=2?"=":a.charAt(n>>>6&63),t>=1?"=":a.charAt(63&n)].join("")},f=n.btoa&&"function"==typeof n.btoa?function(e){return n.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,d)},p=function(e){return f(h(String(e)))},m=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},g=function(e,t){return t?m(p(e)):p(e)};n.Uint8Array&&(i=function(e,t){for(var n="",r=0,i=e.length;r<i;r+=3){var o=e[r],s=e[r+1],l=e[r+2],c=o<<16|s<<8|l;n+=a.charAt(c>>>18)+a.charAt(c>>>12&63)+(void 0!==s?a.charAt(c>>>6&63):"=")+(void 0!==l?a.charAt(63&c):"=")}return t?m(n):n});var v,y=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,b=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return l(55296+(t>>>10))+l(56320+(1023&t));case 3:return l((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return l((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},_=function(e){return e.replace(y,b)},E=function(e){var t=e.length,n=t%4,r=(t>0?s[e.charAt(0)]<<18:0)|(t>1?s[e.charAt(1)]<<12:0)|(t>2?s[e.charAt(2)]<<6:0)|(t>3?s[e.charAt(3)]:0),i=[l(r>>>16),l(r>>>8&255),l(255&r)];return i.length-=[0,0,2,1][n],i.join("")},x=n.atob&&"function"==typeof n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/\S{1,4}/g,E)},w=function(e){return x(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},S=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},k=function(e){return function(e){return _(x(e))}(S(e))};n.Uint8Array&&(v=function(e){return Uint8Array.from(w(S(e)),(function(e){return e.charCodeAt(0)}))});var C=function(){var e=n.Base64;return n.Base64=o,e};if(n.Base64={VERSION:"2.6.4",atob:w,btoa:f,fromBase64:k,toBase64:g,utob:h,encode:g,encodeURI:function(e){return g(e,!0)},btou:_,decode:k,noConflict:C,fromUint8Array:i,toUint8Array:v},"function"==typeof Object.defineProperty){var T=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};n.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",T((function(){return k(this)}))),Object.defineProperty(String.prototype,"toBase64",T((function(e){return g(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",T((function(){return g(this,!0)})))}}n.Meteor&&(Base64=n.Base64);e.exports?e.exports.Base64=n.Base64:void 0===(r=function(){return n.Base64}.apply(t,[]))||(e.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"))},JOrW:
/*!**********************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/gf.svg ***!
\**********************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/gf.09d89ab3.svg"},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(e,t,n){"use strict";n.d(t,"b",(function(){return E})),n.d(t,"a",(function(){return w}));var r=n("1OyB"),i=n("vuIU"),o=n("Ji7U"),a=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"),m=n.n(p),g=n("+nKL"),v=n("8OUc"),y=s.forwardRef((function(e,t){var n=e.prefixCls,r=e.id,i=e.flattenOptions,o=e.childrenAsData,a=e.values,p=e.searchValue,y=e.multiple,b=e.defaultActiveFirstOption,_=e.height,E=e.itemHeight,x=e.notFoundContent,w=e.open,S=e.menuItemSelectedIcon,k=e.virtual,C=e.onSelect,T=e.onToggleOpen,O=e.onActiveValue,A=e.onScroll,L=e.onMouseEnter,R="".concat(n,"-item"),D=Object(f.a)((function(){return i}),[w,i],(function(e,t){return t[0]&&e[1]!==t[1]})),I=s.useRef(null),M=function(e){e.preventDefault()},N=function(e){I.current&&I.current.scrollTo({index:e})},P=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=D.length,r=0;r<n;r+=1){var i=(e+r*t+n)%n,o=D[i],a=o.group,s=o.data;if(!a&&!s.disabled)return i}return-1},j=s.useState((function(){return P(0)})),B=Object(u.a)(j,2),F=B[0],U=B[1],G=function(e){U(e);var t=D[e];t?O(t.data.value,e):O(null,-1)};s.useEffect((function(){G(!1!==b?P(0):-1)}),[D.length,p]),s.useEffect((function(){var e=setTimeout((function(){if(!y&&w&&1===a.size){var e=Array.from(a)[0],t=D.findIndex((function(t){return t.data.value===e}));G(t),N(t)}}));return function(){return clearTimeout(e)}}),[w]);var z=function(e){void 0!==e&&C(e,{selected:!a.has(e)}),y||T(!1)};if(s.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which;switch(t){case h.a.UP:case h.a.DOWN:var n=0;if(t===h.a.UP?n=-1:t===h.a.DOWN&&(n=1),0!==n){var r=P(F+n,n);N(r),G(r)}break;case h.a.ENTER:var i=D[F];i&&!i.data.disabled?z(i.data.value):z(void 0),w&&e.preventDefault();break;case h.a.ESC:T(!1)}},onKeyUp:function(){},scrollTo:function(e){N(e)}}})),0===D.length)return s.createElement("div",{role:"listbox",id:"".concat(r,"_list"),className:"".concat(R,"-empty"),onMouseDown:M},x);function H(e){var t=D[e];if(!t)return null;var n=t.data||{},i=n.value,l=n.label,c=n.children,u=Object(d.a)(n,!0),h=o?c:l;return t?s.createElement("div",Object.assign({"aria-label":"string"==typeof h?h:null},u,{key:e,role:"option",id:"".concat(r,"_list_").concat(e),"aria-selected":a.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"}},H(F-1),H(F),H(F+1)),s.createElement(g.a,{itemKey:"key",ref:I,data:D,height:_,itemHeight:E,fullHeight:!1,onMouseDown:M,onScroll:A,virtual:k,onMouseEnter:L},(function(e,t){var n,r=e.group,i=e.groupOption,u=e.data,h=u.label,d=u.key;if(r)return s.createElement("div",{className:m()(R,"".concat(R,"-group"))},void 0!==h?h:d);var f=u.disabled,p=u.value,g=u.title,y=u.children,b=u.style,_=u.className,E=Object(c.a)(u,["disabled","value","title","children","style","className"]),x=a.has(p),w="".concat(R,"-option"),k=m()(R,w,_,(n={},Object(l.a)(n,"".concat(w,"-grouped"),i),Object(l.a)(n,"".concat(w,"-active"),F===t&&!f),Object(l.a)(n,"".concat(w,"-disabled"),f),Object(l.a)(n,"".concat(w,"-selected"),x),n)),C=o?y:h,T=!S||"function"==typeof S||x;return s.createElement("div",Object.assign({},E,{"aria-selected":x,className:k,title:g,onMouseMove:function(){F===t||f||G(t)},onClick:function(){f||z(p)},style:b}),s.createElement("div",{className:"".concat(w,"-content")},C||p),s.isValidElement(S)||x,T&&s.createElement(v.a,{className:"".concat(R,"-option-state"),customizeIcon:S,customizeIconProps:{isSelected:x}},x?"✓":null))})))}));y.displayName="OptionList";var b=y,_=function(){return null};_.isSelectOption=!0;var E=_,x=function(){return null};x.isSelectOptGroup=!0;var w=x,S=n("VTBJ"),k=n("Zm9Q");function C(e){var t=e.key,n=e.props,r=n.children,i=n.value,o=Object(c.a)(n,["children","value"]);return Object(S.a)({key:t,value:void 0!==i?i:t,children:r},o)}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(k.a)(e).map((function(e,n){if(!s.isValidElement(e)||!e.type)return null;var r=e.type.isSelectOptGroup,i=e.key,o=e.props,a=o.children,l=Object(c.a)(o,["children"]);return t||!r?C(e):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(null===i?n:i,"__"),label:i},l),{},{options:T(a)})})).filter((function(e){return e}))}var O=n("2Qr1"),A=n("qNPg"),L=n("U8pU"),R=n("Kwbf"),D=n("WKfj");var I=function(e){var t=e.mode,n=e.options,r=e.children,i=e.backfill,o=e.allowClear,a=e.placeholder,l=e.getInputElement,c=e.showSearch,u=e.onSearch,h=e.defaultOpen,d=e.autoFocus,f=e.labelInValue,p=e.value,m=e.inputValue,g=e.optionLabelProp,v="multiple"===t||"tags"===t,y=void 0!==c?c:v||"combobox"===t,b=n||T(r);if(Object(R.a)("tags"!==t||b.every((function(e){return!e.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===t||"combobox"===t){var _=b.some((function(e){return e.options?e.options.some((function(e){return"number"==typeof("value"in e?e.value:e.key)})):"number"==typeof("value"in e?e.value:e.key)}));Object(R.a)(!_,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(R.a)("combobox"!==t||!g,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(R.a)("combobox"===t||!i,"`backfill` only works with `combobox` mode."),Object(R.a)("combobox"===t||!l,"`getInputElement` only work with `combobox` mode."),Object(R.b)("combobox"!==t||!l||!o||!a,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),u&&!y&&"combobox"!==t&&"tags"!==t&&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 E=Object(D.d)(p);Object(R.a)(!f||E.every((function(e){return"object"===Object(L.a)(e)&&("key"in e||"value"in e)})),"`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 x=null;Object(k.a)(r).some((function(e){if(!s.isValidElement(e)||!e.type)return!1;var t=e.type;return!t.isSelectOption&&(t.isSelectOptGroup?!Object(k.a)(e.props.children).every((function(t){return!(s.isValidElement(t)&&e.type&&!t.type.isSelectOption)||(x=t.type,!1)})):(x=t,!0))})),x&&Object(R.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(x.displayName||x.name||x,"`.")),Object(R.a)(void 0===m,"`inputValue` is deprecated, please use `searchValue` instead.")}},M=Object(A.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:T,flattenOptions:O.d,getLabeledValue:O.e,filterOptions:O.b,isValueDisabled:O.g,findValueOption:O.c,warningProps:I,fillOptionsWithMissingValue:O.a}),N=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments)).selectRef=s.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}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=E,N.OptGroup=w;var P=N;t.c=P},M8RZ:
/*!**********************************!*\
!*** ./src/components/modal.tsx ***!
\**********************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"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"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),a=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(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e){var i;Object(r.a)(this,n),i=t.call(this,e);var o=window.document;return i.node=o.createElement("div"),o.body.appendChild(i.node),i}return Object(i.a)(n,[{key:"render",value:function(){var e=this.props.children;return Object(c.createPortal)(e,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(e,t,n){(function(t){var n=Object.assign?Object.assign:function(e,t,n,r){for(var i=1;i<arguments.length;i++)s(Object(arguments[i]),(function(t,n){e[n]=t}));return e},r=function(){if(Object.create)return function(e,t,r,i){var o=a(arguments,1);return n.apply(this,[Object.create(e)].concat(o))};{function e(){}return function(t,r,i,o){var s=a(arguments,1);return e.prototype=t,n.apply(this,[new e].concat(s))}}}(),i=String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},o="undefined"!=typeof window?window:t;function a(e,t){return Array.prototype.slice.call(e,t||0)}function s(e,t){l(e,(function(e,n){return t(e,n),!1}))}function l(e,t){if(c(e)){for(var n=0;n<e.length;n++)if(t(e[n],n))return e[n]}else for(var r in e)if(e.hasOwnProperty(r)&&t(e[r],r))return e[r]}function c(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}e.exports={assign:n,create:r,trim:i,bind:function(e,t){return function(){return t.apply(e,Array.prototype.slice.call(arguments,0))}},slice:a,each:s,map:function(e,t){var n=c(e)?[]:{};return l(e,(function(e,r){return n[r]=t(e,r),!1})),n},pluck:l,isList:c,isFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)},isObject:function(e){return e&&"[object Object]"==={}.toString.call(e)},Global:o}}).call(this,n(/*! ./../../@umijs/deps/compiled/webpack/4/global.js */"IyRk"))},MVJL:
/*!********************************************************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/CustomDiscuss/DiscussItem/index.less?modules ***!
\********************************************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___2gBaY",flex_space_between:"flex_space_between___2uD--",flex_box_vertical_center:"flex_box_vertical_center___3Bq-4",flex_box_center_end:"flex_box_center_end___2MOXm",flex_box_column:"flex_box_column___1Sq4x",discussItem:"discussItem___Mk503",wrap:"wrap___VPGVq",list:"list___2zNHf",btns:"btns___1hoB3",secondLevelDiscuss:"secondLevelDiscuss___9Ixoa",line:"line___20Ukm",thirdlyLevelDiscuss:"thirdlyLevelDiscuss___3ZS-s"}},NvD2:
/*!******************************************************!*\
!*** ./node_modules/rc-tree/es/utils/conductUtil.js ***!
\******************************************************/
/*! exports provided: isCheckDisabled, conductCheck */
/*! exports used: conductCheck */function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(/*! rc-util/es/warning */"Kwbf");function i(e,t){var n=new Set;return e.forEach((function(e){t.has(e)||n.add(e)})),n}function o(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,i=t.checkable;return!(!n&&!r)||!1===i}function a(e,t,n,a){var s,l=[];s=a||o;var c=new Set(e.filter((function(e){var t=!!n[e];return t||l.push(e),t}))),u=new Map,h=0;return Object.keys(n).forEach((function(e){var t=n[e],r=t.level,i=u.get(r);i||(i=new Set,u.set(r,i)),i.add(t),h=Math.max(h,r)})),Object(r.a)(!l.length,"Tree missing follow keys: ".concat(l.slice(0,100).map((function(e){return"'".concat(e,"'")})).join(", "))),!0===t?function(e,t,n,r){for(var o=new Set(e),a=new Set,s=0;s<=n;s+=1){(t.get(s)||new Set).forEach((function(e){var t=e.key,n=e.node,i=e.children,a=void 0===i?[]:i;o.has(t)&&!r(n)&&a.filter((function(e){return!r(e.node)})).forEach((function(e){o.add(e.key)}))}))}for(var l=new Set,c=n;c>=0;c-=1){(t.get(c)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!r(n)&&e.parent&&!l.has(e.parent.key))if(r(e.parent.node))l.add(t.key);else{var i=!0,s=!1;(t.children||[]).filter((function(e){return!r(e.node)})).forEach((function(e){var t=e.key,n=o.has(t);i&&!n&&(i=!1),s||!n&&!a.has(t)||(s=!0)})),i&&o.add(t.key),s&&a.add(t.key),l.add(t.key)}}))}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(i(a,o))}}(c,u,h,s):function(e,t,n,r,o){for(var a=new Set(e),s=new Set(t),l=0;l<=r;l+=1){(n.get(l)||new Set).forEach((function(e){var t=e.key,n=e.node,r=e.children,i=void 0===r?[]:r;a.has(t)||s.has(t)||o(n)||i.filter((function(e){return!o(e.node)})).forEach((function(e){a.delete(e.key)}))}))}s=new Set;for(var c=new Set,u=r;u>=0;u-=1){(n.get(u)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!o(n)&&e.parent&&!c.has(e.parent.key))if(o(e.parent.node))c.add(t.key);else{var r=!0,i=!1;(t.children||[]).filter((function(e){return!o(e.node)})).forEach((function(e){var t=e.key,n=a.has(t);r&&!n&&(r=!1),i||!n&&!s.has(t)||(i=!0)})),r||a.delete(t.key),i&&s.add(t.key),c.add(t.key)}}))}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(i(s,a))}}(c,t.halfCheckedKeys,u,h,s)}},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(e,t,n){"use strict";var r=n("U8pU"),i=n("VTBJ"),o=n("Ff2n"),a=n("q1tI"),s=n("uciX"),l=n("7ixt"),c=function(e){var t=e.overlay,n=e.prefixCls,r=e.id,i=e.overlayInnerStyle;return a.createElement("div",{className:"".concat(n,"-inner"),id:r,role:"tooltip",style:i},"function"==typeof t?t():t)},u=Object(a.forwardRef)((function(e,t){var n=e.overlayClassName,u=e.trigger,h=void 0===u?["hover"]:u,d=e.mouseEnterDelay,f=void 0===d?0:d,p=e.mouseLeaveDelay,m=void 0===p?.1:p,g=e.overlayStyle,v=e.prefixCls,y=void 0===v?"rc-tooltip":v,b=e.children,_=e.onVisibleChange,E=e.afterVisibleChange,x=e.transitionName,w=e.animation,S=e.placement,k=void 0===S?"right":S,C=e.align,T=void 0===C?{}:C,O=e.destroyTooltipOnHide,A=void 0!==O&&O,L=e.defaultVisible,R=e.getTooltipContainer,D=e.overlayInnerStyle,I=Object(o.a)(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),M=Object(a.useRef)(null);Object(a.useImperativeHandle)(t,(function(){return M.current}));var N=Object(i.a)({},I);"visible"in e&&(N.popupVisible=e.visible);var P=!1,j=!1;if("boolean"==typeof A)P=A;else if(A&&"object"===Object(r.a)(A)){var B=A.keepParent;P=!0===B,j=!1===B}return a.createElement(s.a,Object.assign({popupClassName:n,prefixCls:y,popup:function(){var t=e.arrowContent,n=void 0===t?null:t,r=e.overlay,i=e.id;return[a.createElement("div",{className:"".concat(y,"-arrow"),key:"arrow"},n),a.createElement(c,{key:"content",prefixCls:y,id:i,overlay:r,overlayInnerStyle:D})]},action:h,builtinPlacements:l.a,popupPlacement:k,ref:M,popupAlign:T,getPopupContainer:R,onPopupVisibleChange:_,afterPopupVisibleChange:E,popupTransitionName:x,popupAnimation:w,defaultPopupVisible:L,destroyPopupOnHide:P,autoDestroy:j,mouseLeaveDelay:m,popupStyle:g,mouseEnterDelay:f},N),b)}));t.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(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"k",(function(){return l})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return u})),n.d(t,"g",(function(){return h})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return f})),n.d(t,"j",(function(){return p})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return g}));var r=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),i=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU"),o=(n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),n(/*! react */"q1tI"),n(/*! rc-util/es/warning */"Kwbf"));n(/*! ./TreeNode */"WaYH");function a(e,t){var n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function s(e,t){var n=e.slice();return-1===n.indexOf(t)&&n.push(t),n}function l(e){return e.split("-")}function c(e,t){return"".concat(e,"-").concat(t)}function u(e){return e&&e.type&&e.type.isTreeNode}function h(e,t){var n=[e];return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){var r=t.key,i=t.children;n.push(r),e(i)}))}(t[e].children),n}function d(e,t){var n=e.clientY,r=t.selectHandle.getBoundingClientRect(),i=r.top,o=r.bottom,a=r.height,s=Math.max(.25*a,2);return n<=i+s?-1:n>=o-s?1:0}function f(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function p(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==Object(i.a)(e))return Object(o.a)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function m(e,t){var n=new Set;return(e||[]).forEach((function(e){!function e(r){if(!n.has(r)){var i=t[r];if(i){n.add(r);var o=i.parent;i.node.disabled||o&&e(o.key)}}}(e)})),Object(r.a)(n)}function g(e){var t={};return Object.keys(e).forEach((function(n){(n.startsWith("data-")||n.startsWith("aria-"))&&(t[n]=e[n])})),t}},"OkW/":
/*!*******************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/Discuss/index.less ***!
\*******************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},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(e,t,n){"use strict";n("2qtc");var r=n("kLXV"),i=n("rAM+"),o=(n("miYZ"),n("tsqr")),a=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),m=n("bdgK"),g=(n("p77/"),n("Bd2K"),n("ELLl"),n("19Vz"),n("lZu9"),n("+NIl"),n("kSUc"),n("9Bee")),v=function(e){var t=e.value,n=void 0===t?"":t,r=(e.className,e.showTextOnly,e.showLines,e.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"),_=(n("dejd"),n("C+DQ"),n("D1Df")),E=n.n(_),x=n("1vsH"),w=n("m3rI"),S=[{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(e){var t=e.onActionCallback,n=e.title,r=e.icon,i=e.actionName,o=e.className,a=void 0===o?"":o,s=e.children;return d.a.createElement("a",{title:n,className:a,onClick:function(){t(i)}},d.a.createElement("i",{className:"md-iconfont ".concat(r)}),s)}var C=function(e){var t=e.watch,n=e.showNullButton,r=e.onActionCallback,i=e.fullScreen,o=e.insertTemp,a=e.hidetoolBar,s=e.uuid,l=e.setOpenPhones,c=Object(x.E)("_educoder_session_login"),u=Object(x.E)("_educoder_session"),h=[].concat(S,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},!a&&h.map((function(e,t){return d.a.createElement("li",{key:t},e.actionName?d.a.createElement(k,Object(b.a)({},e,{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,o&&d.a.createElement("li",null,d.a.createElement(k,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(o),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(w.a.API_SERVER)),d.a.createElement(E.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+u+"&key="+s+"&api="+encodeURIComponent(w.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})))},T=n("M8RZ"),O=(n("+L6B"),n("2/Rp")),A=(n("y8nQ"),n("Vl3Y")),L=(n("5NDa"),n("5rEg")),R={labelCol:{span:4},wrapperCol:{span:20}},D=function(e){var t=e.callback,n=e.onCancel;return d.a.createElement(A.a,Object(b.a)({},R,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)}}),d.a.createElement(A.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},d.a.createElement(L.a,null)),d.a.createElement(A.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},d.a.createElement(L.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(O.a,{type:"ghost",onClick:n},"取消")))},I=n("7ahc"),M=n("k1fw"),N=(n("HmJG"),n("BjJ7")),P=A.a.useForm,j={width:280,marginRight:10},B={labelCol:{span:5},wrapperCol:{span:19}},F=function(e){var t=e.callback,n=e.onCancel,r=P(),i=Object(s.a)(r,1)[0],o=Object(h.useRef)();function a(e,t){i.setFieldsValue({src:"/api/attachments/".concat(e.id,"?type=").concat(e.content_type),type:t.type})}return d.a.createElement(A.a,Object(b.a)({form:i},B,{className:"upload-image-panel",onFinish:function(e){t(Object(M.a)(Object(M.a)({},e),{},{name:o.current}))}}),d.a.createElement(A.a.Item,{label:"文件地址",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(A.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入文件地址"}]},d.a.createElement(L.a,{style:j})),d.a.createElement(U,{onFileChange:function(e){var t=e.target.files[0];o.current=t.name,G(t,a)}}))),d.a.createElement(A.a.Item,{label:"文件描述",name:"alt"},d.a.createElement(L.a,{style:{width:264}})),d.a.createElement(A.a.Item,{style:{textAlign:"right"}},d.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(O.a,{type:"ghost",onClick:n},"取消")))};function U(e){var t=e.onFileChange;return d.a.createElement("a",{className:"upload-button"},"本地上传",d.a.createElement("input",{type:"file",onChange:t}))}function G(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),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){t(JSON.parse(n.target.responseText),e)}),!1),r.addEventListener("error",(function(e){console.error(e)}),!1),r.open("POST","".concat(N.a,"/api/attachments.json")),r.send(n)}n("giR+");var z,H,V=n("fyUT"),W=(n("7Kak"),n("9yH6")),K=W.a.Group,q={margin:"0 8px"},X=function(e){var t=e.callback,n=e.onCancel;return d.a.createElement(A.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)}},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:q},"单元格数:"),d.a.createElement("span",{style:q},"行数"),d.a.createElement(A.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},d.a.createElement(V.a,null)),d.a.createElement("span",{style:q},"列数"),d.a.createElement(A.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},d.a.createElement(V.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:q},"对齐方式:"),d.a.createElement(A.a.Item,{name:"align"},d.a.createElement(K,null,d.a.createElement(W.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(W.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(W.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(W.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(O.a,{type:"ghost",onClick:n},"取消")))},Y=n("ErOA"),$=n("7Cbv"),J="------------",Z={default:J,left:":".concat(J),center:":".concat(J,":"),right:"".concat(J,":")},Q=n("9VGf");function ee(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var te=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ne=["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"],re=(z={},Object(l.a)(z,te+"-B","bold"),Object(l.a)(z,te+"-I","italic"),z),ie=(H={},Object(l.a)(H,"link","添加链接"),Object(l.a)(H,"code-block","添加代码块"),Object(l.a)(H,"upload-image","添加文件"),Object(l.a)(H,"add-table","添加表格"),H);t.a=function(e){var t=e.defaultValue,n=void 0===t?"":t,c=e.onChange,f=e.width,y=void 0===f?"100%":f,b=e.height,_=void 0===b?400:b,E=e.miniToolbar,x=void 0!==E&&E,S=e.isFocus,k=void 0!==S&&S,O=e.watch,A=e.insertTemp,L=e.mode,R=void 0===L?"markdown":L,M=e.id,N=void 0===M?"markdown-editor-id":M,P=e.showResizeBar,j=void 0!==P&&P,B=e.noStorage,U=void 0!==B&&B,z=e.showNullButton,H=void 0!==z&&z,V=e.hidetoolBar,W=void 0!==V&&V,K=e.fullScreen,q=void 0!==K&&K,J=e.onBlur,te=e.onCMBeforeChange,oe=e.onFullScreen,ae=e.className,se=void 0===ae?"":ae,le=e.disablePaste,ce=void 0!==le&&le,ue=e.placeholder,he=void 0===ue?"":ue,de=e.values,fe=void 0===de?"":de,pe=Object(h.useState)(null),me=Object(s.a)(pe,2),ge=me[0],ve=me[1],ye=Object(h.useState)(n),be=Object(s.a)(ye,2),_e=be[0],Ee=be[1],xe=Object(h.useState)(O),we=Object(s.a)(xe,2),Se=we[0],ke=we[1],Ce=Object(h.useState)(q),Te=Object(s.a)(Ce,2),Oe=Te[0],Ae=Te[1],Le=Object(h.useState)(""),Re=Object(s.a)(Le,2),De=Re[0],Ie=Re[1],Me=Object(h.useState)(0),Ne=Object(s.a)(Me,2),Pe=Ne[0],je=Ne[1],Be=Object(h.useState)(_),Fe=Object(s.a)(Be,2),Ue=Fe[0],Ge=Fe[1],ze=Object(h.useState)(!1),He=Object(s.a)(ze,2),Ve=(He[0],He[1]),We=Object(h.useRef)(Object($.a)()),Ke=Object(h.useRef)(!1),qe=Object(h.useRef)(),Xe=Object(h.useRef)(),Ye=Object(h.useRef)(),$e=Object(h.useRef)(),Je=Object(h.useRef)(),Ze=function(){var e=Object(a.a)(u.a.mark((function e(){var t,n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Y.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:We.current}});case 2:null!=(n=e.sent)&&null!==(t=n.attachments)&&void 0!==t&&t.length&&(console.log("cm:",ge,Xe),n.attachments.map((function(e){e.content_type.indexOf("image")>-1?ge.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):e.content_type.indexOf("video")>-1?ge.replaceSelection('<video width="100%" controls src="'.concat(w.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):e.content_type.indexOf("pdf")>-1?ge.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,'&disposition=inline" target="_blank">').concat(e.name,"</a>")):ge.replaceSelection("[".concat(e.name,"](").concat(w.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")"))})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(h.useEffect)((function(){Ee(fe),null==ge||ge.setValue(fe)}),[fe]),Object(h.useEffect)((function(){null==oe||oe(Oe)}),[Oe]),Object(h.useEffect)((function(){if(Xe.current){var e=p.a.fromTextArea(Xe.current,{mode:R,lineNumbers:!x,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});function t(t,n){if(!ce){var r=n.clipboardData;if(r){var i=r.types.toString(),a=r.items;if("Files"===i||r.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==R)return;try{var s,l=a[1];"file"===(null===(s=a[0])||void 0===s?void 0:s.kind)&&(l=a[0]);var c=l.getAsFile(),u=c.name.split(".").pop();G(c,(function(t){var n,r,i;t.id?(null==c||null===(n=c.type)||void 0===n?void 0:n.indexOf("image"))>-1?e.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):(null==c||null===(r=c.type)||void 0===r?void 0:r.indexOf("video"))>-1?e.replaceSelection('<video width="100%" controls src="'.concat(w.a.API_SERVER,"/api/attachments/").concat(t.id,'"></video>')):(null==c||null===(i=c.type)||void 0===i?void 0:i.indexOf("pdf"))>-1?e.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(c.type,'&disposition=inline" target="_blank">').concat(c.name,"</a>")):ne.includes(u)?e.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(t.id,'?type=office&disposition=inline" target="_blank">').concat(c.name,"</a>")):e.replaceSelection("[".concat(c.name,"](").concat(w.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))}catch(n){o.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()}return k&&e.focus(),e.on("paste",t),e.on("dragleave",(function(e,t){Ye.current.classList.remove("mouse-hover-md")})),e.on("dragover",(function(e,t){Ye.current.classList.add("mouse-hover-md")})),e.on("drop",(function(t,n){var r;if(Ye.current.classList.add("mouse-hover-md"),(r=n.dataTransfer.files).length>0){n.preventDefault(),n.stopPropagation();for(var i=function(t){var n=r[t],i=n.name.split(".").pop();G(n,(function(t){var r,o,a;t.id?(null==n||null===(r=n.type)||void 0===r?void 0:r.indexOf("image"))>-1?e.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):(null==n||null===(o=n.type)||void 0===o?void 0:o.indexOf("video"))>-1?e.replaceSelection('<video width="100%" controls src="'.concat(w.a.API_SERVER,"/api/attachments/").concat(t.id,'"></video>')):(null==n||null===(a=n.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?e.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(n.type,'&disposition=inline" target="_blank">').concat(n.name,"</a>")):ne.includes(i)?e.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(t.id,'?type=office&disposition=inline" target="_blank">').concat(n.name,"</a>")):e.replaceSelection("[".concat(n.name,"](").concat(w.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))},o=0;o<r.length;o++)i(o)}})),ve(e),function(){e.off("paste",t)}}}),[]);var Qe=Object(h.useCallback)((function(){Ye.current}),[Ue,Ye,Oe]);Object(h.useEffect)((function(){if(ge){var e=function(){var e=new m.default((function(e){var t,n=Object(i.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&(Qe(),ge.setSize("100%","100%"),ge.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(Xe.current.parentElement),e}();return function(){e.unobserve(Xe.current.parentElement)}}}),[ge,Qe]),Object(h.useEffect)((function(){if(ge){for(var e=[],t=function(){var t=r[n],i=(o=Object(s.a)(t,2))[0],a=o[1],c=Object(l.a)({},i,(function(){et(a)}));e.push(c),ge.addKeyMap(c)},n=0,r=Object.entries(re);n<r.length;n++){var o;t()}return qe.current=setInterval((function(){Ke.current&&Ze()}),4e3),function(){clearInterval(qe.current);var t,n=Object(i.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;ge.removeKeyMap(r)}}catch(e){n.e(e)}finally{n.f()}}}}),[ge]),Object(h.useEffect)((function(){q!==Oe&&Ae(q)}),[q]),Object(Q.a)((function(){if(!U&&Pe>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(N);e>=Pe+1e4&&(!t||t!==_e)&&(window.sessionStorage.setItem(N,_e),Ve(!0))}}),1e4),Object(h.useEffect)((function(){ke(O)}),[ge,O]),Object(h.useEffect)((function(){ge&&k&&ge.focus()}),[ge,k]),Object(h.useEffect)((function(){if(Se&&ge){var e=ge.getScrollerElement();function t(e){var t=e.target;if(Je.current){var n=t.scrollTop/t.scrollHeight;Je.current.scrollTop=Je.current.scrollHeight*n}}return e.addEventListener("scroll",t),function(){e.removeEventListener("scroll",t)}}}),[ge,Se]),Object(h.useEffect)((function(){if(ge&&te){function e(e,t){te(e,t)}return ge.on("beforeChange",e),function(){ge.off("beforeChange",e)}}}),[ge,te]),Object(h.useEffect)((function(){if(ge&&J){function e(){J(ge.getValue())}return ge.on("blur",e),function(){ge.off("blur",e)}}}),[ge,J]),Object(h.useEffect)((function(){if(ge){function e(e){var t=e.getValue();Ee(t),je((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),c&&c(t)}return ge.on("change",e),function(){ge.off("change",e)}}}),[ge,c]),Object(h.useEffect)((function(){ge&&(null==n?(ge.setValue(""),Ee("")):n!==ge.getValue()&&(ge.setValue(n),Ee(n),ge.setCursor(ge.lineCount(),0)))}),[ge,n]);var et=Object(h.useCallback)((function(e){var t=ge.getCursor(),n=ge.getSelection(),r=n.split("\n");switch(e){case"bold":return ge.replaceSelection("**"+n+"**"),""===n&&ge.setCursor(t.line,t.ch+2),ge.focus();case"italic":return ge.replaceSelection("*"+n+"*"),""===n&&ge.setCursor(t.line,t.ch+1),ge.focus();case"code":return ge.replaceSelection("`"+n+"`"),""===n&&ge.setCursor(t.line,t.ch+1),ge.focus();case"inline-latex":return ge.replaceSelection("`$$"+n+"$$`"),""===n&&ge.setCursor(t.line,t.ch+3),ge.focus();case"latex":return ge.replaceSelection("```latex\n"+n+"\n```"),ge.setCursor(t.line+1,n.length+1),ge.focus();case"line-break":return ge.replaceSelection("<br/>\n"),ge.focus();case"list-ul":return""===n?ge.replaceSelection("- "+n):ge.replaceSelection(r.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),ge.focus();case"list-ol":return""===n?ge.replaceSelection("1. "+n):ge.replaceSelection(r.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),ge.focus();case"add-null-ch":return""===n&&ge.setCursor(t.line,t.ch+1),ge.replaceSelection("▁"),ge.focus();case"inster-template-1":return""===n&&ge.setCursor(t.line,t.ch),ge.replaceSelection("\n**模板标题**\n模板正文内容可输入文本内容和粘贴图片等操作"),ge.focus();case"eraser":return ge.setValue(""),ge.focus();case"trigger-watch":return ke(!Se),ge.focus();case"trigger-full-screen":return Ae(!Oe),ge.focus();case"link":return void Ie("link");case"code-block":return void Ie("code-block");case"upload-image":return void Ie("upload-image");case"add-table":return void Ie("add-table");default:throw new Error}}),[ge,Se,Oe]),tt=Object(h.useCallback)((function(e){switch(Ie(""),De){case"link":var t=e.title,n=e.link;return ge.replaceSelection("[".concat(t,"](").concat(n,")")),ge.focus();case"code-block":var r=e.language,i=e.content;return ge.replaceSelection(["```"+r,i,"```"].join("\n")),ge.focus();case"upload-image":var o=e.src,a=e.alt,s=e.name;return o.indexOf("type=image")>-1?ge.replaceSelection("![ ".concat(a||""," ]( ").concat(o,' "').concat(a||"",'" )')):o.indexOf("type=application/pdf")>-1?ge.replaceSelection('<a href="'.concat(o,'&disposition=inline" target="_blank">').concat(s,"</a>")):ge.replaceSelection('<a href="'.concat(o,'" target="_blank">').concat(s,"</a>")),ge.focus();case"add-table":for(var l=e.row,c=e.col,u=e.align,h="\n",d=0;d<l;d++){for(var f=[],p=[],m=0;m<c;m++)1===d&&p.push(Z[u]),f.push(" ");1===d&&(h+="| ".concat(p.join(" | ")," |\n")),h+="| ".concat(f.join(1===c?"":" | ")," |\n")}return ge.replaceSelection(h+"\n"),ge.focus();default:throw new Error}}),[ge,De]),nt=Object(h.useMemo)((function(){switch(De){case"link":return d.a.createElement(D,{callback:tt,onCancel:rt});case"code-block":return d.a.createElement(I.b,{callback:tt,onCancel:rt});case"upload-image":return d.a.createElement(F,{callback:tt,onCancel:rt});case"add-table":return d.a.createElement(X,{callback:tt,onCancel:rt});default:return null}}),[De]);function rt(){Ie("")}Object(h.useEffect)((function(){if($e.current){var e=$e.current,t=!1,n=0;function r(e){t=!0,n=e.pageY}function i(){t=!1}function o(e){if(t){var r=e.pageY-n;r<0&&(r=0),r>300&&(r=300),Ge(_+r+"px")}}return e.addEventListener("mousedown",r),document.addEventListener("mousemove",o),document.addEventListener("mouseup",i),function(){e.removeEventListener("mousedown",r),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i)}}}),[ge,$e]),Object(h.useEffect)((function(){Ge(_)}),[_]);var it={width:ee(y),height:ee(Ue)};Object(h.useMemo)((function(){if(Pe){var e=new Date(Pe),t=e.getHours(),n=e.getMinutes(),r=e.getSeconds();return n=n<10?"0"+n:n,r=r<10?"0"+r:r,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(r)}return 0}),[Pe]);return d.a.createElement(h.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ye},d.a.createElement("div",{className:"markdown-editor-container ".concat(se," ").concat(Se?"on-preview":""," ").concat(x?"mini":""," ").concat(Oe?"full-screen":""),style:it},d.a.createElement(C,{insertTemp:A,watch:Se,fullScreen:Oe,showNullButton:H,onActionCallback:et,hidetoolBar:W,uuid:We.current,setOpenPhones:function(){Ke.current=!0}}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:Xe,placeholder:he})),Se?d.a.createElement("div",{ref:Je,className:"preview-container"},"stex"===R&&d.a.createElement(v,{value:_e}),"stex"!==R&&d.a.createElement(g.a,{edit:!0,value:_e,replaces:function(e,t){var n=ge.getValue();n=n.replace(e,t),Ee(n),null==ge||ge.setValue(n)}})):null))),j?d.a.createElement("a",{ref:$e,className:"editor-resize"}):null,d.a.createElement(T.a,null,ie[De]?d.a.createElement(r.a,{centered:!0,title:ie[De],visible:!0,onCancel:rt,footer:null},nt):null))}},P5Jw:
/*!***********************************************************!*\
!*** ./node_modules/react-copy-to-clipboard/lib/index.js ***!
\***********************************************************/
/*! no static exports found */
/*! exports used: CopyToClipboard */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";var r=n(/*! ./Component */"rHrb").CopyToClipboard;r.CopyToClipboard=r,e.exports=r},PD8m:
/*!******************************************************!*\
!*** ./node_modules/store/storages/memoryStorage.js ***!
\******************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports={name:"memoryStorage",read:function(e){return n[e]},write:function(e,t){n[e]=t},each:function(e){for(var t in n)n.hasOwnProperty(t)&&e(n[t],t)},remove:function(e){delete n[e]},clearAll:function(e){n={}}};var n={}},RELg:
/*!**************************************************************!*\
!*** ./node_modules/store/storages/oldIE-userDataStorage.js ***!
\**************************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r=n(/*! ../src/util */"MFOe").Global;e.exports={name:"oldIE-userDataStorage",write:function(e,t){if(a)return;var n=l(e);o((function(e){e.setAttribute(n,t),e.save("storejs")}))},read:function(e){if(a)return;var t=l(e),n=null;return o((function(e){n=e.getAttribute(t)})),n},each:function(e){o((function(t){for(var n=t.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var i=n[r];e(t.getAttribute(i.name),i.name)}}))},remove:function(e){var t=l(e);o((function(e){e.removeAttribute(t),e.save("storejs")}))},clearAll:function(){o((function(e){var t=e.XMLDocument.documentElement.attributes;e.load("storejs");for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save("storejs")}))}};var i=r.document,o=function(){if(!i||!i.documentElement||!i.documentElement.addBehavior)return null;var e,t,n;try{(t=new ActiveXObject("htmlfile")).open(),t.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></iframe>'),t.close(),e=t.w.frames[0].document,n=e.createElement("div")}catch(t){n=i.createElement("div"),e=i.body}return function(t){var r=[].slice.call(arguments,0);r.unshift(n),e.appendChild(n),n.addBehavior("#default#userData"),n.load("storejs"),t.apply(this,r),e.removeChild(n)}}(),a=(r.navigator?r.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);var s=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function l(e){return e.replace(/^\d/,"___$&").replace(s,"___")}},RpDr:
/*!**************************************************************!*\
!*** ./src/pages/Question/OjProblem/TestCasePanel/index.tsx ***!
\**************************************************************/
/*! exports provided: ExecuteDict, getDetailCommitOut, getCommitOut, default */
/*! exports used: ExecuteDict, default, getDetailCommitOut */function(e,t,n){"use strict";n.d(t,"a",(function(){return E})),n.d(t,"c",(function(){return w}));n(/*! antd/es/button/style */"+L6B");var r,i,o=n(/*! antd/es/button */"2/Rp"),a=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 */"bdLU"),m=n(/*! js-base64 */"J66h"),g=(n(/*! ./index.less */"++UQ"),n(/*! @/components/Spinner */"IxHN")),v=n(/*! @/components/RenderHtml */"9Bee"),y=n(/*! @/utils/util */"1vsH"),b=c.a.TextArea,_={visible:!1,tabIndex:"0"},E=(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 x(e,t){switch(t.type){case i.SET_VISIBLE:return Object(s.a)(Object(s.a)({},e),{},{visible:t.payload});case i.SET_TABINDEX:return Object(s.a)(Object(s.a)({},e),{},{tabIndex:t.payload});default:throw new Error}}function w(e){var t=e.status,n=e.error_msg,r=e.output,i=e.input,o=e.expected_output,a=e.is_file,s=e.input_file_url,l=e.output_file_url,c=e.expected_output_file_url,u=null,d={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(t){case p.a.NOMATCH:u=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",{className:"c-red"},"实际输入:"),!a&&h.a.createElement(v.a,{value:i,style:d}),a&&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"},"实际输出:"),!a&&h.a.createElement(v.a,{value:r&&m.Base64.decode(r)||"",style:d}),a&&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"},"预期输出:"),!a&&h.a.createElement(v.a,{value:o&&m.Base64.decode(o)||"",style:d}),a&&h.a.createElement("div",{style:d},h.a.createElement("a",{onClick:function(){return Object(y.w)(c,o)}},o)));break;case p.a.EXECUTEFAILURE:case p.a.COMPILEFAILURE:u=h.a.createElement(h.a.Fragment,null,h.a.createElement("p",null,"最后执行的输入:"),!a&&h.a.createElement(v.a,{value:i,style:d}),a&&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"},m.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(e){e[e.SET_VISIBLE=0]="SET_VISIBLE",e[e.SET_TABINDEX=1]="SET_TABINDEX"}(i||(i={})),t.b=function(e){var t=e.id,n=e.input,r=e.debuging,s=e.submitting,l=e.executingMessage,c=e.debugResult,v=e.onChangeInput,y=e.onDebugCode,E=e.onSubmitCode,w=Object(u.useReducer)(x,_),S=Object(a.a)(w,2),k=S[0],C=S[1],T=k.visible,O=k.tabIndex;function A(e){var t=e.target.id;C({type:i.SET_TABINDEX,payload:t})}Object(u.useEffect)((function(){C({type:i.SET_VISIBLE,payload:!1})}),[t]);var L=Object(u.useMemo)((function(){if(c){c.status;return h.a.createElement(h.a.Fragment,null,function(e){var t=e.status,n=e.error_msg,r=e.execute_time,i=e.output,o=e.input,a=e.expected_output,s=(e.is_file,e.input_file_url,e.output_file_url,e.expected_output_file_url,null);switch(t){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,m.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,o)),h.a.createElement("p",null,"输出:",i&&m.Base64.decode(i)),h.a.createElement("p",null,"预期输出:",a&&m.Base64.decode(a)));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,o)),h.a.createElement("p",null,"执行出错信息:"),h.a.createElement("pre",{className:"error"},m.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," ")}(c))}return null}),[c]);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:n,onChange:v})),h.a.createElement("div",{className:"tab-panel-body ".concat("1"===O?"":"hide")},r?h.a.createElement(g.a,{message:l}):c?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(){C({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",{style:{visibility:"hidden"}},"控制台"),h.a.createElement("div",{className:"flex-container"},h.a.createElement(o.a,{id:"oj-prev",className:"btn-blue",type:"ghost"},"上一题"),h.a.createElement(o.a,{id:"oj-next",className:"btn-blue",type:"ghost"},"下一题"),h.a.createElement(o.a,{className:"btn-green",type:"ghost",loading:r,onClick:function(){C({type:i.SET_VISIBLE,payload:!0}),C({type:i.SET_TABINDEX,payload:"1"}),y()}},"调试代码"),h.a.createElement(o.a,{type:"primary",loading:s,disabled:s,onClick:function(){C({type:i.SET_VISIBLE,payload:!1}),E()}},"评测并提交"))))}},"S/kP":
/*!*********************************************!*\
!*** ./src/assets/images/question/time.svg ***!
\*********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/time.a3dc82f3.svg"},"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(e,t,n){var r=n(/*! ./arrayWithHoles.js */"wTVA"),i=n(/*! ./iterableToArray.js */"EbDI"),o=n(/*! ./unsupportedIterableToArray.js */"ZhPi"),a=n(/*! ./nonIterableRest.js */"wkBT");e.exports=function(e){return r(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},SJMd:
/*!****************************************************!*\
!*** ./node_modules/code-prettify/src/prettify.js ***!
\****************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var e=window,t=["break,continue,do,else,for,if,return,while"],n=[[t,"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"],o=[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"],a=[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=[t,"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=[t,"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=[t,"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(e,t,n,r,i){if(n){var o={sourceNode:e,pre:1,langExtension:null,numberLines:null,sourceCode:n,spans:null,basePos:t,decorations:null};r(o),i.push.apply(i,o.decorations)}}var f=/\S/;function p(e){for(var t=void 0,n=e.firstChild;n;n=n.nextSibling){var r=n.nodeType;t=1===r?t?e:n:3===r&&f.test(n.nodeValue)?e:t}return t===e?void 0:t}function m(e,t){var n,r={};!function(){for(var i=e.concat(t),o=[],a={},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;a.hasOwnProperty(f)||(o.push(d),a[f]=null)}o.push(/[\0-\uffff]/),n=function(e){for(var t=0,n=!1,r=!1,i=0,o=e.length;i<o;++i){if((d=e[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 a={b:8,t:9,n:10,v:11,f:12,r:13};function s(e){var t=e.charCodeAt(0);if(92!==t)return t;var n=e.charAt(1);return(t=a[n])||("0"<=n&&n<="7"?parseInt(e.substring(1),8):"u"===n||"x"===n?parseInt(e.substring(2),16):e.charCodeAt(1))}function l(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);var t=String.fromCharCode(e);return"\\"===t||"-"===t||"]"===t||"^"===t?"\\"+t:t}function c(e){var t=e.substring(1,e.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="^"===t[0],i=["["];r&&i.push("^");for(var o=r?1:0,a=t.length;o<a;++o){var c=t[o];if(/\\[bdsw]/i.test(c))i.push(c);else{var u,h=s(c);o+2<a&&"-"===t[o+1]?(u=s(t[o+2]),o+=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(e,t){return e[0]-t[0]||t[1]-e[1]}));var d=[],f=[];for(o=0;o<n.length;++o){(p=n[o])[0]<=f[1]+1?f[1]=Math.max(f[1],p[1]):d.push(f=p)}for(o=0;o<d.length;++o){var p=d[o];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(e){for(var r=e.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,o=[],a=0,s=0;a<i;++a){if("("===(h=r[a]))++s;else if("\\"===h.charAt(0)){(u=+h.substring(1))&&(u<=s?o[u]=-1:r[a]=l(u))}}for(a=1;a<o.length;++a)-1===o[a]&&(o[a]=++t);for(a=0,s=0;a<i;++a){if("("===(h=r[a]))o[++s]||(r[a]="(?:");else if("\\"===h.charAt(0)){var u;(u=+h.substring(1))&&u<=s&&(r[a]="\\"+o[u])}}for(a=0;a<i;++a)"^"===r[a]&&"^"!==r[a+1]&&(r[a]="");if(e.ignoreCase&&n)for(a=0;a<i;++a){var h,d=(h=r[a]).charAt(0);h.length>=2&&"["===d?r[a]=c(h):"\\"!==d&&(r[a]=h.replace(/[a-zA-Z]/g,(function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(-33&t,32|t)+"]"})))}return r.join("")}var h=[];for(i=0,o=e.length;i<o;++i){var d;if((d=e[i]).global||d.multiline)throw new Error(""+d);h.push("(?:"+u(d)+")")}return new RegExp(h.join("|"),r?"gi":"g")}(o)}();var i=t.length,o=function(e){for(var a=e.sourceCode,s=e.basePos,l=e.sourceNode,c=[s,"pln"],u=0,h=a.match(n)||[],f={},p=0,m=h.length;p<m;++p){var g,v=h[p],y=f[v],b=void 0;if("string"==typeof y)g=!1;else{var _=r[v.charAt(0)];if(_)b=v.match(_[1]),y=_[0];else{for(var x=0;x<i;++x)if(_=t[x],b=v.match(_[1])){y=_[0];break}b||(y="pln")}!(g=y.length>=5&&"lang-"===y.substring(0,5))||b&&"string"==typeof b[1]||(g=!1,y="src"),g||(f[v]=y)}var w=u;if(u+=v.length,g){var S=b[1],k=v.indexOf(S),C=k+S.length;b[2]&&(k=(C=v.length-b[2].length)-S.length);var T=y.substring(5);d(l,s+w,v.substring(0,k),o,c),d(l,s+w+k,S,E(T,S),c),d(l,s+w+C,v.substring(C),o,c)}else c.push(s+w,y)}e.decorations=c};return o}function g(e){var t=[],n=[];e.tripleQuotedStrings?t.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):e.multiLineStrings?t.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):t.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&n.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var r=e.hashComments;r&&(e.cStyleComments?(r>1?t.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):t.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])):t.push(["com",/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(n.push(["com",/^\/\/[^\r\n]*/,null]),n.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var i=e.regexLiterals;if(i){var o=i>1?"":"\n\r",a=o?".":"[\\S\\s]",s="/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+a+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+a+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+s+")")])}var l=e.types;l&&n.push(["typ",l]);var c=(""+e.keywords).replace(/^ | $/g,"");c.length&&n.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push(["pln",/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return e.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]),m(t,n)}var v=g({keywords:[r,o,i,a,s,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(e,t,n){for(var r=/(?:^|\s)nocode(?:\s|$)/,i=/\r\n?|\n/,o=e.ownerDocument,a=o.createElement("li");e.firstChild;)a.appendChild(e.firstChild);var s=[a];function l(e){var t=e.nodeType;if(1!=t||r.test(e.className)){if((3==t||4==t)&&n){var a=e.nodeValue,s=a.match(i);if(s){var u=a.substring(0,s.index);e.nodeValue=u;var h=a.substring(s.index+s[0].length);if(h)e.parentNode.insertBefore(o.createTextNode(h),e.nextSibling);c(e),u||e.parentNode.removeChild(e)}}}else if("br"===e.nodeName)c(e),e.parentNode&&e.parentNode.removeChild(e);else for(var d=e.firstChild;d;d=d.nextSibling)l(d)}function c(e){for(;!e.nextSibling;)if(!(e=e.parentNode))return;for(var t,n=function e(t,n){var r=n?t.cloneNode(!1):t,i=t.parentNode;if(i){var o=e(i,1),a=t.nextSibling;o.appendChild(r);for(var s=a;s;s=a)a=s.nextSibling,o.appendChild(s)}return r}(e.nextSibling,0);(t=n.parentNode)&&1===t.nodeType;)n=t;s.push(n)}for(var u=0;u<s.length;++u)l(s[u]);t===(0|t)&&s[0].setAttribute("value",t);var h=o.createElement("ol");h.className="linenums";for(var d=Math.max(0,t-1|0)||0,f=(u=0,s.length);u<f;++u)(a=s[u]).className="L"+(u+d)%10,a.firstChild||a.appendChild(o.createTextNode(" ")),h.appendChild(a);e.appendChild(h)}var b={};function _(t,n){for(var r=n.length;--r>=0;){var i=n[r];b.hasOwnProperty(i)?e.console&&console.warn("cannot override language handler %s",i):b[i]=t}}function E(e,t){return e&&b.hasOwnProperty(e)||(e=/^\s*</.test(t)?"default-markup":"default-code"),b[e]}function x(t){var n,r,i,o,a,s,l,c=t.langExtension;try{var u=(n=t.sourceNode,r=t.pre,i=/(?:^|\s)nocode(?:\s|$)/,o=[],a=0,s=[],l=0,function e(t){var n=t.nodeType;if(1==n){if(i.test(t.className))return;for(var c=t.firstChild;c;c=c.nextSibling)e(c);var u=t.nodeName.toLowerCase();"br"!==u&&"li"!==u||(o[l]="\n",s[l<<1]=a++,s[l++<<1|1]=t)}else if(3==n||4==n){var h=t.nodeValue;h.length&&(h=r?h.replace(/\r\n?/g,"\n"):h.replace(/[ \t\r\n]+/g," "),o[l]=h,s[l<<1]=a,a+=h.length,s[l++<<1|1]=t)}}(n),{sourceCode:o.join("").replace(/\n$/,""),spans:s}),h=u.sourceCode;t.sourceCode=h,t.spans=u.spans,t.basePos=0,E(c,h)(t),function(e){var t=/\bMSIE\s(\d+)/.exec(navigator.userAgent);t=t&&+t[1]<=8;var n,r,i=/\n/g,o=e.sourceCode,a=o.length,s=0,l=e.spans,c=l.length,u=0,h=e.decorations,d=h.length,f=0;for(h[d]=a,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],m=h[r+1],g=r+2;g+2<=d&&h[g+1]===m;)g+=2;h[n++]=p,h[n++]=m,r=g}d=h.length=n;var v=e.sourceNode,y="";v&&(y=v.style.display,v.style.display="none");try{for(;u<c;){l[u];var b,_=l[u+2]||a,E=h[f+2]||a,x=(g=Math.min(_,E),l[u+1]);if(1!==x.nodeType&&(b=o.substring(s,g))){t&&(b=b.replace(i,"\r")),x.nodeValue=b;var w=x.ownerDocument,S=w.createElement("span");S.className=h[f+1];var k=x.parentNode;k.replaceChild(S,x),S.appendChild(x),s<_&&(l[u+1]=x=w.createTextNode(o.substring(g,_)),k.insertBefore(x,S.nextSibling))}(s=g)>=_&&(u+=2),s>=E&&(f+=2)}}finally{v&&(v.style.display=y)}}(t)}catch(t){e.console&&console.log(t&&t.stack||t)}}function w(e,t,n){var r=n||!1,i=t||null,o=document.createElement("div");return o.innerHTML="<pre>"+e+"</pre>",o=o.firstChild,r&&y(o,r,!0),x({langExtension:i,numberLines:r,sourceNode:o,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),o.innerHTML}function S(t,n){var r=n||document.body,i=r.ownerDocument||document;function o(e){return r.getElementsByTagName(e)}for(var a=[o("pre"),o("code"),o("xmp")],s=[],l=0;l<a.length;++l)for(var c=0,u=a[l].length;c<u;++c)s.push(a[l][c]);a=null;var h=Date;h.now||(h={now:function(){return+new Date}});var d=0,f=/\blang(?:uage)?-([\w.]+)(?!\S)/,m=/\bprettyprint\b/,g=/\bprettyprinted\b/,v=/pre|xmp/i,b=/^code$/i,_=/^(?:pre|code|xmp)$/i,E={};!function n(){for(var r=e.PR_SHOULD_USE_CONTINUATION?h.now()+250:1/0;d<s.length&&h.now()<r;d++){for(var o=s[d],a=E,l=o;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){a={},u.replace(/\b(\w+)=([\w:.%+-]+)/g,(function(e,t,n){a[t]=n}));break}}var w=o.className;if((a!==E||m.test(w))&&!g.test(w)){for(var S=!1,k=o.parentNode;k;k=k.parentNode){var C=k.tagName;if(_.test(C)&&k.className&&m.test(k.className)){S=!0;break}}if(!S){o.className+=" prettyprinted";var T,O,A=a.lang;if(!A)!(A=w.match(f))&&(T=p(o))&&b.test(T.tagName)&&(A=T.className.match(f)),A&&(A=A[1]);if(v.test(o.tagName))O=1;else{var L=o.currentStyle,R=i.defaultView,D=L?L.whiteSpace:R&&R.getComputedStyle?R.getComputedStyle(o,null).getPropertyValue("white-space"):0;O=D&&"pre"===D.substring(0,3)}var I=a.linenums;(I="true"===I||+I)||(I=!!(I=w.match(/\blinenums\b(?::(\d+))?/))&&(!I[1]||!I[1].length||+I[1])),I&&y(o,I,O),x({langExtension:A,sourceNode:o,numberLines:I,pre:O,sourceCode:null,basePos:null,spans:null,decorations:null})}}}d<s.length?e.setTimeout(n,250):"function"==typeof t&&t()}()}_(v,["default-code"]),_(m([],[["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"]),_(m([["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"]),_(m([],[["atv",/^[\s\S]+/]]),["uq.val"]),_(g({keywords:r,hashComments:!0,cStyleComments:!0,types:h}),["c","cc","cpp","cxx","cyc","m"]),_(g({keywords:"null,true,false"}),["json"]),_(g({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:h}),["cs"]),_(g({keywords:i,cStyleComments:!0}),["java"]),_(g({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),_(g({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),_(g({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),_(g({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),_(g({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),_(g({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"]),_(m([],[["str",/^[\s\S]+/]]),["regex"]);var k=e.PR={createSimpleLexer:m,registerLangHandler:_,sourceDecorator:g,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:w,prettyPrint:S},C=e.define;"function"==typeof C&&C.amd&&C("google-code-prettify",[],(function(){return k}))}()},TcMa:
/*!*******************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/Description/index.less?modules ***!
\*******************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={desc:"desc___qlRMF",info:"info___JEaKq","commit-info":"commit-info___3-4e0"}},UZu5:
/*!*************************************************!*\
!*** ./src/components/image-preview/index.less ***!
\*************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},VEzc:
/*!**************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/Drawer/index.less?modules ***!
\**************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___z2AYj",flex_space_between:"flex_space_between___2PZH7",flex_box_vertical_center:"flex_box_vertical_center___3Vw8I",flex_box_center_end:"flex_box_center_end___1dJQf",flex_box_column:"flex_box_column___kstqC",wrap:"wrap___wWYG3",head:"head___1xABk",title:"title___yYb50",content:"content___fzoVv",list:"list___2q90P",footer:"footer___3zT-e"}},"VrN/":
/*!***************************************************!*\
!*** ./node_modules/codemirror/lib/codemirror.js ***!
\***************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),_=/win/i.test(t),E=h&&e.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(h=!1,l=!0);var x=y&&(c||h&&(null==E||E<12.11)),w=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var k,C=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return T(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function L(e,t,n,r){var i=A(e,t,n,r);return i.setAttribute("role","presentation"),i}function R(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function D(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function I(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function M(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!S(n[r]).test(t)&&(t+=" "+n[r]);return t}k=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var N=function(e){e.select()};function P(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function j(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function B(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?N=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(N=function(e){try{e.select()}catch(e){}});var F=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};function U(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}F.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},F.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var G={toString:function(){return"CodeMirror.Pass"}},z={scroll:!1},H={origin:"*mouse"},V={origin:"+move"};function W(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var K=[""];function q(e){for(;K.length<=e;)K.push(X(K)+" ");return K[e]}function X(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function $(){}function J(e,t){var n;return Object.create?n=Object.create(e):($.prototype=e,n=new $),t&&j(t,n),n}var Z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Q(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Q(e))||t.test(e):Q(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 re(e){return e.charCodeAt(0)>=768&&ne.test(e)}function ie(e,t,n){for(;(n<0?t>0:t<e.length)&&re(e.charAt(t));)t+=n;return t}function oe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var ae=null;function se(e,t,n){var r;ae=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ae=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ae=i)}return null!=r?r:ae}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,h=[],d=0;d<u;++d)h.push((c=a.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 m=h[f];"m"==m?h[f]=p:p=m}for(var g=0,v=l;g<u;++g){var y=h[g];"1"==y&&"r"==v?h[g]="n":n.test(y)&&(v=y,"r"==y&&(h[g]="R"))}for(var b=1,_=h[0];b<u-1;++b){var E=h[b];"+"==E&&"1"==_&&"1"==h[b+1]?h[b]="1":","!=E||_!=h[b+1]||"1"!=_&&"n"!=_||(h[b]=_),_=E}for(var x=0;x<u;++x){var w=h[x];if(","==w)h[x]="N";else if("%"==w){var S=void 0;for(S=x+1;S<u&&"%"==h[S];++S);for(var k=x&&"!"==h[x-1]||S<u&&"1"==h[S]?"1":"N",C=x;C<S;++C)h[C]=k;x=S-1}}for(var T=0,O=l;T<u;++T){var A=h[T];"L"==O&&"1"==A?h[T]="L":n.test(A)&&(O=A)}for(var L=0;L<u;++L)if(t.test(h[L])){var R=void 0;for(R=L+1;R<u&&t.test(h[R]);++R);for(var D="L"==(L?h[L-1]:l),I=D==("L"==(R<u?h[R]:l))?D?"L":"R":l,M=L;M<R;++M)h[M]=I;L=R-1}for(var N,P=[],j=0;j<u;)if(r.test(h[j])){var B=j;for(++j;j<u&&r.test(h[j]);++j);P.push(new o(0,B,j))}else{var F=j,U=P.length,G="rtl"==s?1:0;for(++j;j<u&&"L"!=h[j];++j);for(var z=F;z<j;)if(i.test(h[z])){F<z&&(P.splice(U,0,new o(1,F,z)),U+=G);var H=z;for(++z;z<j&&i.test(h[z]);++z);P.splice(U,0,new o(2,H,z)),U+=G,F=z}else++z;F<j&&P.splice(U,0,new o(1,F,j))}return"ltr"==s&&(1==P[0].level&&(N=a.match(/^\s+/))&&(P[0].from=N[0].length,P.unshift(new o(0,0,N[0].length))),1==X(P).level&&(N=a.match(/\s+$/))&&(X(P).to-=N[0].length,P.push(new o(0,u-N[0].length,u)))),"rtl"==s?P.reverse():P}}();function ce(e,t){var n=e.order;return null==n&&(n=e.order=le(e.text,t)),n}var ue=[],he=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ue).concat(n)}};function de(e,t){return e._handlers&&e._handlers[t]||ue}function fe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=U(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function pe(e,t){var n=de(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function me(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),pe(e,n||t.type,e,t),Ee(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==U(n,t[r])&&n.push(t[r])}function ve(e,t){return de(e,t).length>0}function ye(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){fe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function _e(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ee(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function xe(e){be(e),_e(e)}function we(e){return e.target||e.srcElement}function Se(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var ke,Ce,Te=function(){if(a&&s<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Oe(e){if(null==ke){var t=A("span","");O(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ke=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=ke?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ae(e){if(null!=Ce)return Ce;var t=O(e,document.createTextNode("AخA")),n=k(t,0,1).getBoundingClientRect(),r=k(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(Ce=r.right-n.right<3)}var Le,Re=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},De=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(Le=A("div"))||(Le.setAttribute("oncopy","return;"),"function"==typeof Le.oncopy),Me=null,Ne={},Pe={};function je(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ne[e]=t}function Be(e){if("string"==typeof e&&Pe.hasOwnProperty(e))e=Pe[e];else if(e&&"string"==typeof e.name&&Pe.hasOwnProperty(e.name)){var t=Pe[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Fe(e,t){t=Be(t);var n=Ne[t.name];if(!n)return Fe(e,"text/plain");var r=n(e,t);if(Ue.hasOwnProperty(t.name)){var i=Ue[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Ue={};function Ge(e,t){j(t,Ue.hasOwnProperty(e)?Ue[e]:Ue[e]={})}function ze(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function He(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ve(e,t,n){return!e.startState||e.startState(t,n)}var We=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ke(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function qe(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function Xe(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ye(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function $e(e){if(null==e.parent)return null;for(var t=e.parent,n=U(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Je(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function Ze(e,t){return t>=e.first&&t<e.first+e.size}function Qe(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,n){if(void 0===n&&(n=null),!(this instanceof et))return new et(e,t,n);this.line=e,this.ch=t,this.sticky=n}function tt(e,t){return e.line-t.line||e.ch-t.ch}function nt(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function rt(e){return et(e.line,e.ch)}function it(e,t){return tt(e,t)<0?t:e}function ot(e,t){return tt(e,t)<0?e:t}function at(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function st(e,t){if(t.line<e.first)return et(e.first,0);var n=e.first+e.size-1;return t.line>n?et(n,Ke(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ke(e,t.line).text.length)}function lt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=st(e,t[r]);return n}We.prototype.eol=function(){return this.pos>=this.string.length},We.prototype.sol=function(){return this.pos==this.lineStart},We.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},We.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},We.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},We.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},We.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},We.prototype.skipToEnd=function(){this.pos=this.string.length},We.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},We.prototype.backUp=function(e){this.pos-=e},We.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=B(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},We.prototype.indentation=function(){return B(this.string,null,this.tabSize)-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},We.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},We.prototype.current=function(){return this.string.slice(this.start,this.pos)},We.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},We.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},We.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,n,r){var i=[e.state.modeGen],o={};_t(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,_t(e,t.text,s.mode,n,(function(e,t){for(var n=l;c<e;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function dt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ft(e,$e(t)),i=t.text.length>e.options.maxHighlightLength&&ze(e.doc.mode,r.state),o=ht(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ft(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ut(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Ke(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ct?c.lookAhead:0)<=o.modeFrontier))return s;var u=B(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),a=o>r.first&&Ke(r,o-1).stateAfter,s=a?ut.fromSaved(r,a,o):new ut(r,Ve(r.mode),o);return r.iter(o,t,(function(n){pt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function pt(e,t,n,r){var i=e.doc.mode,o=new We(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&mt(i,n.state);!o.eol();)gt(i,o,n.state),o.start=o.pos}function mt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=He(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function gt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=He(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,n){return t instanceof ct?new ut(e,ze(e.mode,t.state),n,t.lookAhead):new ut(e,ze(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?ze(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Ke(a,(t=st(a,t)).line),c=ft(e,t.line,n),u=new We(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=gt(s,u,c.state),r&&o.push(new vt(u,i,ze(a.mode,c.state)));return r?o:new vt(u,i,c.state)}function bt(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function _t(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,h=new We(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&bt(mt(n,r.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,a&&pt(e,t,r,h.pos),h.pos=t.length,l=null):l=bt(gt(n,h,r.state,d),o),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 Et=!1,xt=!1;function wt(e,t,n){this.marker=e,this.from=t,this.to=n}function St(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function kt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ct(e,t){if(t.full)return null;var n=Ze(e,t.from.line)&&Ke(e,t.from.line).markedSpans,r=Ze(e,t.to.line)&&Ke(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==tt(t.from,t.to),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new wt(a,o.from,s?null:o.to))}}return r}(n,i,a),l=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new wt(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,a),c=1==t.text.length,u=X(t.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=St(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 m=l[p];null!=m.to&&(m.to+=u),null==m.from?St(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m)):(m.from+=u,c&&(s||(s=[])).push(m))}s&&(s=Tt(s)),l&&l!=s&&(l=Tt(l));var g=[s];if(!c){var v,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new wt(s[b].marker,null,null));for(var _=0;_<y;++_)g.push(v);g.push(l)}return g}function Tt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ot(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function At(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Lt(e){return e.inclusiveLeft?-1:0}function Rt(e){return e.inclusiveRight?1:0}function Dt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=tt(r.from,i.from)||Lt(e)-Lt(t);if(o)return-o;var a=tt(r.to,i.to)||Rt(e)-Rt(t);return a||t.id-e.id}function It(e,t){var n,r=xt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Dt(n,i.marker)<0)&&(n=i.marker);return n}function Mt(e){return It(e,!0)}function Nt(e){return It(e,!1)}function Pt(e,t){var n,r=xt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Dt(n,o.marker)<0)&&(n=o.marker)}return n}function jt(e,t,n,r,i){var o=Ke(e,t),a=xt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=tt(c.from,n)||Lt(l.marker)-Lt(i),h=tt(c.to,r)||Rt(l.marker)-Rt(i);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?tt(c.from,r)<=0:tt(c.from,r)<0)))return!0}}}function Bt(e){for(var t;t=Mt(e);)e=t.find(-1,!0).line;return e}function Ft(e,t){var n=Ke(e,t),r=Bt(n);return n==r?t:$e(r)}function Ut(e,t){if(t>e.lastLine())return t;var n,r=Ke(e,t);if(!Gt(e,r))return t;for(;n=Nt(r);)r=n.find(1,!0).line;return $e(r)+1}function Gt(e,t){var n=xt&&t.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&&zt(e,t,r))return!0}}function zt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return zt(e,r.line,St(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&zt(e,t,i))return!0}function Ht(e){for(var t=0,n=(e=Bt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function Vt(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Mt(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=Nt(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function Wt(e){var t=e.display,n=e.doc;t.maxLine=Ke(n,n.first),t.maxLineLength=Vt(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=Vt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Kt=function(e,t,n){this.text=e,At(this,t),this.height=n?n(this):1};function qt(e){e.parent=null,Ot(e)}Kt.prototype.lineNo=function(){return $e(this)},ye(Kt);var Xt={},Yt={};function $t(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:Xt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Jt(e,t){var n=L("span",null,null,l?"padding-right: .1px":null),r={pre:L("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Qt,Ae(e.display.measure)&&(a=ce(o,e.doc.direction))&&(r.addToken=en(r.addToken,a)),r.map=[],nn(o,r,dt(e,o,t!=e.display.externalMeasured&&$e(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=M(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=M(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Oe(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.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 pe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=M(r.pre.className,r.textClass||"")),r}function Zt(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,r,i,o,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){c=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var p=h.exec(t),m=p?p.index-f:t.length-f;if(m){var g=document.createTextNode(u.slice(f,f+m));a&&s<9?c.appendChild(A("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;f+=m+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(A("span",q(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=c.appendChild(A("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?c.appendChild(A("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||d||o||l){var _=n||"";r&&(_+=r),i&&(_+=i);var E=A("span",[c],_,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&E.setAttribute(x,l[x]);return e.content.appendChild(E)}e.content.appendChild(c)}}function en(e,t){return function(n,r,i,o,a,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<t.length&&!((h=t[d]).to>c&&h.from<=c);d++);if(h.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,h.to-c),i,o,null,s,l),o=null,r=r.slice(h.to-c),c=h.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,h,d,f=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=s="",d=null,h=null,v=1/0;for(var y=[],b=void 0,_=0;_<r.length;++_){var E=r[_],x=E.marker;if("bookmark"==x.type&&E.from==p&&x.widgetNode)y.push(x);else if(E.from<=p&&(null==E.to||E.to>p||x.collapsed&&E.to==p&&E.from==p)){if(null!=E.to&&E.to!=p&&v>E.to&&(v=E.to,c=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&E.from==p&&(u+=" "+x.startStyle),x.endStyle&&E.to==v&&(b||(b=[])).push(x.endStyle,E.to),x.title&&((d||(d={})).title=x.title),x.attributes)for(var w in x.attributes)(d||(d={}))[w]=x.attributes[w];x.collapsed&&(!h||Dt(h.marker,x)<0)&&(h=E)}else E.from>p&&v>E.from&&(v=E.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==v&&(c+=" "+b[S]);if(!h||h.from==p)for(var k=0;k<y.length;++k)tn(t,0,y[k]);if(h&&(h.from||0)==p){if(tn(t,(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 C=Math.min(f,v);;){if(g){var T=p+g.length;if(!h){var O=T>C?g.slice(0,C-p):g;t.addToken(t,O,a?a+l:l,u,p+O.length==v?c:"",s,d)}if(T>=C){g=g.slice(C-p),p=C;break}p=T,u=""}g=i.slice(o,o=n[m++]),a=$t(n[m++],t.cm.options)}}else for(var A=1;A<n.length;A+=2)t.addToken(t,i.slice(o,o=n[A]),$t(n[A+1],t.cm.options))}function rn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Nt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?$e(X(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Gt(e,t)}function on(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new rn(e.doc,Ke(e.doc,o),o);r=o+a.size,i.push(a)}return i}var an=null,sn=null;function ln(e,t){var n=de(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);an?r=an.delayedCallbacks:sn?r=sn:(r=sn=[],setTimeout(cn,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function cn(){var e=sn;sn=null;for(var t=0;t<e.length;++t)e[t]()}function un(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?fn(e,t):"gutter"==o?mn(e,t,n,r):"class"==o?pn(e,t):"widget"==o&&gn(e,t,r)}t.changes=null}function hn(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function dn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Jt(e,t)}function fn(e,t){var n=t.text.className,r=dn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,pn(e,t)):n&&(t.text.className=n)}function pn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=hn(t);t.background=r.insertBefore(A("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?hn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function mn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=hn(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=hn(t),s=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(A("div",Qe(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function gn(e,t,n){t.alignable&&(t.alignable=null);for(var r=S("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);yn(e,t,n)}function vn(e,t,n,r){var i=dn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),pn(e,t),mn(e,t,n,r),yn(e,t,r),t.node}function yn(e,t,n){if(bn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)bn(e,t.rest[r],t,n,!1)}function bn(e,t,n,r,i){if(t.widgets)for(var o=hn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=A("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),_n(l,c,n,r),e.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),ln(l,"redraw")}}function _n(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function En(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!R(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),O(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function xn(e,t){for(var n=we(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function wn(e){return e.lineSpace.offsetTop}function Sn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function kn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Cn(e){return 50-e.display.nativeBarWidth}function Tn(e){return e.display.scroller.clientWidth-Cn(e)-e.display.barWidth}function On(e){return e.display.scroller.clientHeight-Cn(e)-e.display.barHeight}function An(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if($e(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ln(e,t,n,r){return In(e,Dn(e,t),n,r)}function Rn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Dn(e,t){var n=$e(t),r=Rn(e,n);r&&!r.text?r=null:r&&r.changes&&(un(e,r,n,or(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=$e(t=Bt(t)),r=e.display.externalMeasured=new rn(e.doc,t,n);r.lineN=n;var i=r.built=Jt(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}(e,t));var i=An(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function In(e,t,n,r,i){t.before&&(n=-1);var o,l=n+(r||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&Tn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Pn(t.map,n,r),l=o.node,c=o.start,u=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&re(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&re(t.line.text.charAt(o.coverStart+u));)++u;if((i=a&&s<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():jn(k(l,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,h="right"}a&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Me)return Me;var t=O(e,A("span","x")),n=t.getBoundingClientRect(),r=k(t,0,1).getBoundingClientRect();return Me=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var f;c>0&&(h=r="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+ir(e.display),top:p.top,bottom:p.bottom}:Nn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var _=b?y[b-1]:0,E=y[b],x={left:("right"==h?i.right:i.left)-t.rect.left,right:("left"==h?i.left:i.right)-t.rect.left,top:_,bottom:E};return i.left||i.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=m,x.rbottom=g),x}(e,t,n,r)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Mn,Nn={left:0,right:0,top:0,bottom:0};function Pn(e,t,n){for(var r,i,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,o=1,a="left"):t<l?o=1+(i=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function jn(e,t){var n=Nn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Bn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Fn(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Bn(e.display.view[t])}function Un(e){Fn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Gn(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function zn(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Hn(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=En(e.widgets[n]));return t}function Vn(e,t,n,r,i){if(!i){var o=Hn(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=Ht(t);if("local"==r?a+=wn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:zn());var l=s.left+("window"==r?0:Gn());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function Wn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Gn(),i-=zn();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Kn(e,t,n,r,i){return r||(r=Ke(e.doc,t.line)),Vn(e,r,Ln(e,r,t.ch,i),n)}function qn(e,t,n,r,i,o){function a(t,a){var s=In(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,Vn(e,r,s,n)}r=r||Ke(e.doc,t.line),i||(i=Dn(e,r));var s=ce(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var h=se(s,l,c),d=ae,f=u(l,h,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function Xn(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=ir(e.display)*t.ch);var r=Ke(e.doc,t.line),i=Ht(r)+wn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Yn(e,t,n,r,i){var o=et(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function $n(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Yn(r.first,0,null,-1,-1);var i=Je(r,n),o=r.first+r.size-1;if(i>o)return Yn(r.first+r.size-1,Ke(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ke(r,i);;){var s=er(e,a,i,t,n),l=Pt(a,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;a=Ke(r,i=c.line)}}function Jn(e,t,n,r){r-=Hn(t);var i=t.text.length,o=oe((function(t){return In(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=oe((function(t){return In(e,n,t).top>r}),o,i)}}function Zn(e,t,n,r){return n||(n=Dn(e,t)),Jn(e,t,n,Vn(e,t,In(e,n,r),"line").top)}function Qn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=Ht(t);var o=Dn(e,t),a=Hn(t),s=0,l=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var h=(e.options.lineWrapping?nr:tr)(e,t,n,o,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,m=null,g=oe((function(t){var n=In(e,o,t);return n.top+=a,n.bottom+=a,!!Qn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)}),s,l),v=!1;if(m){var y=r-m.left<m.right-r,b=y==c;g=p+(b?0:1),f=b?"after":"before",d=y?m.left:m.right}else{c||g!=l&&g!=s||g++,f=0==g?"after":g==t.text.length?"before":In(e,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var _=qn(e,et(n,g,f),"line",t,o);d=_.left,v=i<_.top?-1:i>=_.bottom?1:0}return Yn(n,g=ie(t.text,g,1),f,v,r-d)}function tr(e,t,n,r,i,o,a){var s=oe((function(s){var l=i[s],c=1!=l.level;return Qn(qn(e,et(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=qn(e,et(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Qn(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function nr(e,t,n,r,i,o,a){var s=Jn(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.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=In(e,r,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,m=p<o?o-p+1e9:p-o;(!u||h>m)&&(u=f,h=m)}}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(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Mn){Mn=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Mn.appendChild(document.createTextNode("x")),Mn.appendChild(A("br"));Mn.appendChild(document.createTextNode("x"))}O(e.measure,Mn);var n=Mn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function ir(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function or(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:ar(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ar(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function sr(e){var t=rr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ir(e.display)-3);return function(i){if(Gt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function lr(e){var t=e.doc,n=sr(e);t.iter((function(e){var t=n(e);t!=e.height&&Ye(e,t)}))}function cr(e,t,n,r){var i=e.display;if(!n&&"true"==we(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,c=$n(e,o,a);if(r&&c.xRel>0&&(l=Ke(e.doc,c.line).text).length==c.ch){var u=B(l,l.length,e.options.tabSize)-l.length;c=et(c.line,Math.max(0,Math.round((o-kn(e.display).left)/ir(e.display))-u))}return c}function ur(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function hr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)xt&&Ft(e.doc,t)<i.viewTo&&fr(e);else if(n<=i.viewFrom)xt&&Ut(e.doc,n+r)>i.viewFrom?fr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)fr(e);else if(t<=i.viewFrom){var o=pr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):fr(e)}else if(n>=i.viewTo){var a=pr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):fr(e)}else{var s=pr(e,t,t,-1),l=pr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):fr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function dr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[ur(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==U(a,n)&&a.push(n)}}}function fr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pr(e,t,n,r){var i,o=ur(e,t),a=e.display.view;if(!xt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;Ft(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function mr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function gr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vr(e,t){void 0===t&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&yr(e,s.head,i),l||_r(e,s,o)}}return r}function yr(e,t,n){var r=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(A("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)*e.options.cursorHeight+"px",r.other){var o=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function br(e,t){return e.top-t.top||e.left-t.left}function _r(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=kn(e.display),s=a.left,l=Math.max(r.sizerWidth,Tn(e)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(r-t)+"px"))}function h(t,n,r){var o,a,h=Ke(i,t),d=h.text.length;function f(n,r){return Kn(e,et(t,n),"div",h,r)}function p(t,n,r){var i=Zn(e,h,null,t),o="ltr"==n==("after"==r)?"left":"right";return f("after"==r?i.begin:i.end-(/\s/.test(h.text.charAt(i.end-1))?2:1),o)[o]}var m=ce(h,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?d:r,(function(e,t,i,h){var g="ltr"==i,v=f(e,g?"left":"right"),y=f(t-1,g?"right":"left"),b=null==n&&0==e,_=null==r&&t==d,E=0==h,x=!m||h==m.length-1;if(y.top-v.top<=3){var w=(c?_:b)&&x,S=(c?b:_)&&E?s:(g?v:y).left,k=w?l:(g?y:v).right;u(S,v.top,k-S,v.bottom)}else{var C,T,O,A;g?(C=c&&b&&E?s:v.left,T=c?l:p(e,i,"before"),O=c?s:p(t,i,"after"),A=c&&_&&x?l:y.right):(C=c?p(e,i,"before"):s,T=!c&&b&&E?l:v.right,O=!c&&_&&x?s:y.left,A=c?p(t,i,"after"):l),u(C,v.top,T-C,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(O,y.top,A-O,y.bottom)}(!o||br(v,o)<0)&&(o=v),br(y,o)<0&&(o=y),(!a||br(v,a)<0)&&(a=v),br(y,a)<0&&(a=y)})),{start:o,end:a}}var d=t.from(),f=t.to();if(d.line==f.line)h(d.line,d.ch,f.ch);else{var p=Ke(i,d.line),m=Ke(i,f.line),g=Bt(p)==Bt(m),v=h(d.line,d.ch,g?p.text.length+1:null).end,y=h(f.line,g?0:null,f.ch).start;g&&(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(o)}function Er(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||kr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function xr(e){e.state.focused||(e.display.input.focus(),Sr(e))}function wr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,kr(e))}),100)}function Sr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Er(e))}function kr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,C(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Cr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],o=e.options.lineWrapping,l=void 0,c=0;if(!i.hidden){if(a&&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,!o&&i.text.firstChild&&(c=i.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=i.line.height-l;if((d>.005||d<-.005)&&(Ye(i.line,l),Tr(i.line),i.rest))for(var f=0;f<i.rest.length;f++)Tr(i.rest[f]);if(c>e.display.sizerWidth){var p=Math.ceil(c/ir(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Tr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Or(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-wn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Je(t,r),a=Je(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=Je(t,Ht(Ke(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=Je(t,Ht(Ke(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Ar(e,t){var n=e.display,r=rr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=On(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Sn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-h,f=Tn(e)-n.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(p?0:10)-f),a}function Lr(e,t){null!=t&&(Ir(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Rr(e){Ir(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Dr(e,t,n){null==t&&null==n||Ir(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Ir(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mr(e,Xn(e,t.from),Xn(e,t.to),t.margin))}function Mr(e,t,n,r){var i=Ar(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Dr(e,i.scrollLeft,i.scrollTop)}function Nr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||li(e,{top:t}),Pr(e,t,!0),n&&li(e),ri(e,100))}function Pr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function jr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,hi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Sn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Cn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Fr=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),he(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),he(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Fr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fr.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new F,this.disableVert=new F},Fr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Fr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ur=function(){};function Gr(e,t){t||(t=Br(e));var n=e.display.barWidth,r=e.display.barHeight;zr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Cr(e),zr(e,Br(e)),n=e.display.barWidth,r=e.display.barHeight}function zr(e,t){var n=e.display,r=n.scrollbars.update(t);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&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.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 Hr={native:Fr,null:Ur};function Vr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Hr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?jr(e,t):Nr(e,t)}),e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Wr=0;function Kr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Wr},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function qr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{an=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Xr(t[n]);for(var r=0;r<t.length;r++)Yr(t[r]);for(var i=0;i<t.length;i++)$r(t[i]);for(var o=0;o<t.length;o++)Jr(t[o]);for(var a=0;a<t.length;a++)Zr(t[a])}(e)}))}function Xr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Cn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Cn(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Wt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yr(e){e.updatedDisplay=e.mustUpdate&&ai(e.cm,e.update)}function $r(e){var t=e.cm,n=t.display;e.updatedDisplay&&Cr(t),e.barMeasure=Br(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ln(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Cn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Jr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&jr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Gr(t,e.barMeasure),e.updatedDisplay&&ui(t,e.barMeasure),e.selectionChanged&&Er(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&xr(e.cm)}function Zr(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&si(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Pr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&jr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!me(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=A("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-wn(e.display))+"px;\n height: "+(t.bottom-t.top+Cn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=qn(e,t),l=n&&n!=t?qn(e,n):s,c=Ar(e,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=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=c.scrollTop&&(Nr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(jr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return i}(t,st(r,e.scrollToPos.from),st(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a<i.length;++a)i[a].lines.length||pe(i[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&pe(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Qr(e,t){if(e.curOp)return t();Kr(e);try{return t()}finally{qr(e)}}function ei(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Kr(e);try{return t.apply(e,arguments)}finally{qr(e)}}}function ti(e){return function(){if(this.curOp)return e.apply(this,arguments);Kr(this);try{return e.apply(this,arguments)}finally{qr(this)}}}function ni(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Kr(t);try{return e.apply(this,arguments)}finally{qr(t)}}}function ri(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,P(ii,e))}function ii(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ft(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?ze(t.mode,r.state):null,l=ht(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&d<a.length;++d)h=a[d]!=o.styles[d];h&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&pt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return ri(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Qr(e,(function(){for(var t=0;t<i.length;t++)dr(e,i[t],"text")}))}}var oi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Or(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Tn(e),this.force=n,this.dims=or(e),this.events=[]};function ai(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return fr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mr(e))return!1;di(e)&&(fr(e),t.dims=or(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),xt&&(o=Ft(e.doc,o),a=Ut(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ur(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(on(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,ur(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Ht(Ke(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=mr(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=D();if(!t||!R(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&R(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),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==o){for(;a!=d.node;)a=s(a);var f=i&&null!=t&&t<=u&&d.lineNumber;d.changes&&(U(d.changes,"gutter")>-1&&(f=!1),un(e,d,u,n)),f&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Qe(e.options,u)))),a=d.node.nextSibling}else{var p=vn(e,d,u,n);o.insertBefore(p,a)}u+=d.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=D()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&R(document.body,e.anchorNode)&&R(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ri(e,400)),n.updateLineNumbers=null,!0}function si(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Tn(e))r&&(t.visible=Or(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-On(e),n.top)}),t.visible=Or(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ai(e,t))break;Cr(e);var i=Br(e);gr(e),Gr(e,i),ui(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function li(e,t){var n=new oi(e,t);if(ai(e,n)){Cr(e),si(e,n);var r=Br(e);gr(e),Gr(e,r),ui(e,r),n.finish()}}function ci(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ui(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Cn(e)+"px"}function hi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=ar(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function di(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=Qe(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ci(e.display),!0}return!1}function fi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function pi(e){var t=e.gutters,n=e.gutterSpecs;T(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=t.appendChild(A("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ci(e)}function mi(e){pi(e.display),hr(e),hi(e)}function gi(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=L("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=L("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=L("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[c],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: 50px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=fi(i.gutters,i.lineNumbers),pi(o),r.init(o)}oi.prototype.signal=function(e,t){ve(e,t)&&this.events.push(arguments)},oi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)pe.apply(null,this.events[e])};var vi=0,yi=null;function bi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function _i(e){var t=bi(e);return t.x*=yi,t.y*=yi,t}function Ei(e,t){var r=bi(t),i=r.x,o=r.y,a=e.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||o&&u){if(o&&y&&l)e:for(var d=t.target,f=a.view;d!=s;d=d.parentNode)for(var p=0;p<f.length;p++)if(f[p].node==d){e.display.currentWheelTarget=d;break e}if(i&&!n&&!h&&null!=yi)return o&&u&&Nr(e,Math.max(0,s.scrollTop+o*yi)),jr(e,Math.max(0,s.scrollLeft+i*yi)),(!o||o&&u)&&be(t),void(a.wheelStartX=null);if(o&&null!=yi){var m=o*yi,g=e.doc.scrollTop,v=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),li(e,{top:g,bottom:v})}vi<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=i,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(yi=(yi*vi+n)/(vi+1),++vi)}}),200)):(a.wheelDX+=i,a.wheelDY+=o))}}a?yi=-.53:n?yi=15:u?yi=-.7:d&&(yi=-1/3);var xi=function(e,t){this.ranges=e,this.primIndex=t};xi.prototype.primary=function(){return this.ranges[this.primIndex]},xi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!nt(n.anchor,r.anchor)||!nt(n.head,r.head))return!1}return!0},xi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new wi(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new xi(e,this.primIndex)},xi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},xi.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return n}return-1};var wi=function(e,t){this.anchor=e,this.head=t};function Si(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=U(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=tt(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=ot(s.from(),a.from()),u=it(s.to(),a.to()),h=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new wi(h?u:c,h?c:u))}}return new xi(t,n)}function ki(e,t){return new xi([new wi(e,t||e)],0)}function Ci(e){return e.text?et(e.from.line+e.text.length-1,X(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ti(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Ci(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ci(t).ch-t.to.ch),et(n,r)}function Oi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new wi(Ti(i.anchor,t),Ti(i.head,t)))}return Si(e.cm,n,e.sel.primIndex)}function Ai(e,t,n){return e.line==t.line?et(n.line,e.ch-t.ch+n.ch):et(n.line+(e.line-t.line),e.ch)}function Li(e){e.doc.mode=Fe(e.options,e.doc.modeOption),Ri(e)}function Ri(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ri(e,100),e.state.modeGen++,e.curOp&&hr(e)}function Di(e,t){return 0==t.from.ch&&0==t.to.ch&&""==X(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ii(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ot(e),At(e,n);var i=r?r(e):1;i!=e.height&&Ye(e,i)}(e,n,i,r),ln(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new Kt(c[o],i(o),r));return n}var s=t.from,l=t.to,c=t.text,u=Ke(e,s.line),h=Ke(e,l.line),d=X(c),f=i(c.length-1),p=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Di(e,t)){var m=a(0,c.length-1);o(h,h.text,f),p&&e.remove(s.line,p),m.length&&e.insert(s.line,m)}else if(u==h)if(1==c.length)o(u,u.text.slice(0,s.ch)+d+u.text.slice(l.ch),f);else{var g=a(1,c.length-1);g.push(new Kt(d+u.text.slice(l.ch),f,r)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+h.text.slice(l.ch),i(0)),e.remove(s.line+1,p);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(h,d+h.text.slice(l.ch),f);var v=a(1,c.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}ln(e,"change",e,t)}function Mi(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;a<r.linked.length;++a){var s=r.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;n&&!l||(t(s.doc,l),e(s.doc,r,l))}}}(e,null,!0)}function Ni(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,lr(e),Li(e),Pi(e),e.options.lineWrapping||Wt(e),e.options.mode=t.modeOption,hr(e)}function Pi(e){("rtl"==e.doc.direction?I:C)(e.display.lineDiv,"CodeMirror-rtl")}function ji(e){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=e||1}function Bi(e,t){var n={from:rt(t.from),to:Ci(t),text:qe(e,t.from,t.to)};return Hi(e,n,t.from.line,t.to.line+1),Mi(e,(function(e){return Hi(e,n,t.from.line,t.to.line+1)}),!0),n}function Fi(e){for(;e.length&&X(e).ranges;)e.pop()}function Ui(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Fi(e.done),X(e.done)):e.done.length&&!X(e.done).ranges?X(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),X(e.done)):void 0}(i,i.lastOp==r)))a=X(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=Ci(t):o.changes.push(Bi(e,t));else{var l=X(i.done);for(l&&l.ranges||zi(e.sel,i.done),o={changes:[Bi(e,t)],generation:i.generation},i.done.push(o);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=t.origin,a||pe(e,"historyAdded")}function Gi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,X(i.done),t))?i.done[i.done.length-1]=t:zi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Fi(i.undone)}function zi(e,t){var n=X(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Hi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Vi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Wi(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Vi(n[i]));return r}(e,t),r=Ct(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function Ki(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?xi.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&U(t,Number(u[1]))>-1&&(X(s)[h]=c[h],delete c[h])}}}return r}function qi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=tt(t,i)<0;o!=tt(n,i)<0?(i=t,t=n):o!=tt(t,n)<0&&(t=n)}return new wi(i,t)}return new wi(n||t,t)}function Xi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qi(e,new xi([qi(e.sel.primary(),t,n,i)],0),r)}function Yi(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=qi(e.sel.ranges[o],t[o],null,i);Qi(e,Si(e.cm,r,e.sel.primIndex),n)}function $i(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Qi(e,Si(e.cm,i,e.sel.primIndex),r)}function Ji(e,t,n,r){Qi(e,ki(t,n),r)}function Zi(e,t,n){var r=e.history.done,i=X(r);i&&i.ranges?(r[r.length-1]=t,eo(e,t,n)):Qi(e,t,n)}function Qi(e,t,n){eo(e,t,n),Gi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function eo(e,t,n){(ve(e,"beforeSelectionChange")||e.cm&&ve(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new wi(st(e,t[n].anchor),st(e,t[n].head))},origin:n&&n.origin};return pe(e,"beforeSelectionChange",e,r),e.cm&&pe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Si(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);to(e,ro(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Rr(e.cm)}function to(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ge(e.cm)),ln(e,"cursorActivity",e))}function no(e){to(e,ro(e,e.sel,null,!1))}function ro(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=oo(e,a.anchor,s&&s.anchor,n,r),c=oo(e,a.head,s&&s.head,n,r);(i||l!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new wi(l,c))}return i?Si(e.cm,i,t.primIndex):t}function io(e,t,n,r,i){var o=Ke(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],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<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(pe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;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=ao(e,h,-r,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=tt(h,n))&&(r<0?d<0:d>0))return io(e,h,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=ao(e,f,r,f.line==t.line?o:null)),f?io(e,f,t,r,i):null}}return t}function oo(e,t,n,r,i){var o=r||1,a=io(e,t,n,o,i)||!i&&io(e,t,n,o,!0)||io(e,t,n,-o,i)||!i&&io(e,t,n,-o,!0);return a||(e.cantEdit=!0,et(e.first,0))}function ao(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:n>0&&t.ch==(r||Ke(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+n)}function so(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),z)}function lo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=st(e,t)),n&&(r.to=st(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),pe(e,"beforeChange",e,r),e.cm&&pe(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function co(e,t,n){if(e.cm){if(!e.cm.curOp)return ei(e.cm,co)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"))||(t=lo(e,t,!0))){var r=Et&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=U(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(tt(c.to,s.from)<0||tt(c.from,s.to)>0)){var u=[l,1],h=tt(c.from,s.from),d=tt(c.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)uo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else uo(e,t)}}function uo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Oi(e,t);Ui(e,t,n,e.cm?e.cm.curOp.id:NaN),po(e,t,n,Ct(e,t));var r=[];Mi(e,(function(e,n){n||-1!=U(r,e.history)||(yo(e.history,t),r.push(e.history)),po(e,t,null,Ct(e,t))}))}}function ho(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(zi(i,l),n&&!i.equals(e.sel))return void Qi(e,i,{clearRedo:!1});a=i}var u=[];zi(a,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var h=ve(e,"beforeChange")||e.cm&&ve(e.cm,"beforeChange"),d=function(n){var r=i.changes[n];if(r.origin=t,h&&!lo(e,r,!1))return s.length=0,{};u.push(Bi(e,r));var o=n?Oi(e,r):X(s);po(e,r,o,Wi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Ci(r)});var a=[];Mi(e,(function(e,t){t||-1!=U(a,e.history)||(yo(e.history,r),a.push(e.history)),po(e,r,null,Wi(e,r))}))},f=i.changes.length-1;f>=0;--f){var p=d(f);if(p)return p.v}}}}function fo(e,t){if(0!=t&&(e.first+=t,e.sel=new xi(Y(e.sel.ranges,(function(e){return new wi(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){hr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)dr(e.cm,r,"gutter")}}function po(e,t,n,r){if(e.cm&&!e.cm.curOp)return ei(e.cm,po)(e,t,n,r);if(t.to.line<e.first)fo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);fo(e,i),t={from:et(e.first,0),to:et(t.to.line+i,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:et(o,Ke(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n||(n=Oi(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=$e(Bt(Ke(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ge(e),Ii(r,t,n,sr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=Vt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Ke(e,r).stateAfter;if(i&&(!(i instanceof ct)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,o.line),ri(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?hr(e):o.line!=a.line||1!=t.text.length||Di(e.doc,t)?hr(e,o.line,a.line+1,c):dr(e,o.line,"text");var u=ve(e,"changes"),h=ve(e,"change");if(h||u){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};h&&ln(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,r):Ii(e,t,r),eo(e,n,z),e.cantEdit&&oo(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function mo(e,t,n,r,i){var o;r||(r=n),tt(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),co(e,{from:n,to:r,text:t,origin:i})}function go(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function vo(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)go(o.ranges[s].anchor,t,n,r),go(o.ranges[s].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=et(c.from.line+r,c.from.ch),c.to=et(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function yo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;vo(e.done,n,r,i),vo(e.undone,n,r,i)}function bo(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Ke(e,at(e,t)):i=$e(t),null==i?null:(r(o,i)&&e.cm&&dr(e.cm,i,n),o)}function _o(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function Eo(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}wi.prototype.from=function(){return ot(this.anchor,this.head)},wi.prototype.to=function(){return it(this.anchor,this.head)},wi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},_o.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,qt(i),ln(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},Eo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof _o))){var s=[];this.collapse(s),this.children=[new _o(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new _o(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,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new Eo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=U(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new Eo(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var xo=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function wo(e,t,n){Ht(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Lr(e,n)}xo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=$e(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=En(this);Ye(n,Math.max(0,n.height-o)),e&&(Qr(e,(function(){wo(e,n,-o),dr(e,r,"widget")})),ln(e,"lineWidgetCleared",e,this,r))}},xo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=En(this)-t;i&&(Gt(this.doc,r)||Ye(r,r.height+i),n&&Qr(n,(function(){n.curOp.forceUpdate=!0,wo(n,r,i),ln(n,"lineWidgetChanged",n,e,$e(r))})))},ye(xo);var So=0,ko=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++So};function Co(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=j(r)).shared=!1;var o=[Co(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Mi(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Co(e,st(e,t),st(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=X(o)})),new To(o,a)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ei(e.cm,Co)(e,t,n,r,i);var o=new ko(e,i),a=tt(t,n);if(r&&j(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=L("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(jt(e,t.line,t,n,o)||t.line!=n.line&&jt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");xt=!0}o.addToHistory&&Ui(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Bt(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&Ye(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new wt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Gt(e,t)&&Ye(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Et=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)hr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)dr(c,u,"text");o.atomic&&no(c.doc),ln(c,"markerAdded",c,o)}return o}ko.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Kr(e),ve(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=St(a.markedSpans,this);e&&!this.collapsed?dr(e,$e(a),"text"):e&&(null!=s.to&&(i=$e(a)),null!=s.from&&(r=$e(a))),a.markedSpans=kt(a.markedSpans,s),null==s.from&&this.collapsed&&!Gt(this.doc,a)&&e&&Ye(a,rr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Bt(this.lines[l]),u=Vt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&hr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&ln(e,"markerCleared",e,this,r,i),t&&qr(e),this.parent&&this.parent.clear()}},ko.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=St(o.markedSpans,this);if(null!=a.from&&(n=et(t?o:$e(o),a.from),-1==e))return n;if(null!=a.to&&(r=et(t?o:$e(o),a.to),1==e))return r}return n&&{from:n,to:r}},ko.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Qr(r,(function(){var i=t.line,o=$e(t.line),a=Rn(r,o);if(a&&(Bn(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Gt(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=En(n)-s;l&&Ye(i,i.height+l)}ln(r,"markerChanged",r,e)}))},ko.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=U(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ko.prototype.detachLine=function(e){if(this.lines.splice(U(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(ko);var To=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Oo(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ao(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Mi(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==U(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}To.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ln(this,"clear")}},To.prototype.find=function(e,t){return this.primary.find(e,t)},ye(To);var Lo=0,Ro=function(e,t,n,r,i){if(!(this instanceof Ro))return new Ro(e,t,n,r,i);null==n&&(n=0),Eo.call(this,[new _o([new Kt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=et(n,0);this.sel=ki(o),this.history=new ji(null),this.id=++Lo,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Ii(this,{from:o,to:o,text:e}),Qi(this,ki(o),z)};Ro.prototype=J(Eo.prototype,{constructor:Ro,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Xe(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ni((function(e){var t=et(this.first,0),n=this.first+this.size-1;co(this,{from:t,to:et(n,Ke(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Dr(this.cm,0,0),Qi(this,ki(t),z)})),replaceRange:function(e,t,n,r){mo(this,e,t=st(this,t),n=n?st(this,n):t,r)},getRange:function(e,t,n){var r=qe(this,st(this,e),st(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ze(this,e))return Ke(this,e)},getLineNumber:function(e){return $e(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ke(this,e)),Bt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return st(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ni((function(e,t,n){Ji(this,st(this,"number"==typeof e?et(e,t||0):e),null,n)})),setSelection:ni((function(e,t,n){Ji(this,st(this,e),st(this,t||e),n)})),extendSelection:ni((function(e,t,n){Xi(this,st(this,e),t&&st(this,t),n)})),extendSelections:ni((function(e,t){Yi(this,lt(this,e),t)})),extendSelectionsBy:ni((function(e,t){Yi(this,lt(this,Y(this.sel.ranges,e)),t)})),setSelections:ni((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new wi(st(this,e[i].anchor),st(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Qi(this,Si(this.cm,r,t),n)}})),addSelection:ni((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new wi(st(this,e),st(this,t||e))),Qi(this,Si(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=qe(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=qe(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ni((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],i=et(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=Ai(s.from,i,o),c=Ai(Ci(s),i,o);if(i=s.to,o=c,"around"==n){var u=e.sel.ranges[a],h=tt(u.head,u.anchor)<0;r[a]=new wi(h?c:l,h?l:c)}else r[a]=new wi(l,l)}return new xi(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)co(this,r[l]);s?Zi(this,s):this.cm&&Rr(this.cm)})),undo:ni((function(){ho(this,"undo")})),redo:ni((function(){ho(this,"redo")})),undoSelection:ni((function(){ho(this,"undo",!0)})),redoSelection:ni((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ji(this.history.maxGeneration),Mi(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Ki(this.history.done),undone:Ki(this.history.undone)}},setHistory:function(e){var t=this.history=new ji(this.history.maxGeneration);t.done=Ki(e.done.slice(0),null,!0),t.undone=Ki(e.undone.slice(0),null,!0)},setGutterMarker:ni((function(e,t,n){return bo(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&te(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:ni((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&bo(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,te(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!Ze(this,e))return null;if(t=e,!(e=Ke(this,e)))return null}else if(null==(t=$e(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ni((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(S(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:ni((function(e,t,n){return bo(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(S(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:ni((function(e,t,n){return function(e,t,n,r){var i=new xo(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),bo(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Gt(e,t)){var r=Ht(t)<e.scrollTop;Ye(t,t.height+En(i)),r&&Lr(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&ln(o,"lineWidgetAdded",o,i,"number"==typeof t?t:$e(t)),i}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Co(this,st(this,e),st(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Co(this,e=st(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ke(this,(e=st(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),st(this,et(n,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Ro(Xe(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ro(Xe(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(tt(o,a)){var s=Co(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Oo(this)),r},unlinkDoc:function(e){if(e instanceof Ta&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ao(Oo(this));break}if(e.history==this.history){var n=[e.id];Mi(e,(function(e){return n.push(e.id)}),!0),e.history=new ji(null),e.history.done=Ki(this.history.done,n),e.history.undone=Ki(this.history.undone,n)}},iterLinkedDocs:function(e){Mi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Re(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ni((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Qr(t=this.cm,(function(){Pi(t),hr(t)})))}))}),Ro.prototype.eachLine=Ro.prototype.iter;var Do=0;function Io(e){var t=this;if(Mo(t),!me(t,e)&&!xn(t.display,e)){be(e),a&&(Do=+new Date);var n=cr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,l=function(){++s==i&&ei(t,(function(){var e={from:n=st(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};co(t.doc,e),Zi(t.doc,ki(st(t.doc,n),st(t.doc,Ci(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==U(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),l()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,ki(n,n)),d)for(var f=0;f<d.length;++f)mo(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Mo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function No(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Po=!1;function jo(){var e;Po||(he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,No(Bo)}),100))})),he(window,"blur",(function(){return No(kr)})),Po=!0)}function Bo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Fo={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"},Uo=0;Uo<10;Uo++)Fo[Uo+48]=Fo[Uo+96]=String(Uo);for(var Go=65;Go<=90;Go++)Fo[Go]=String.fromCharCode(Go);for(var zo=1;zo<=12;zo++)Fo[zo+111]=Fo[zo+63235]="F"+zo;var Ho={};function Vo(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!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 t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Wo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Y(n.split(" "),Vo),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function Ko(e,t,n,r){var i=(t=$o(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ko(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Ko(e,t.fallthrough[o],n,r);if(a)return a}}}function qo(e){var t="string"==typeof e?e:Fo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Xo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Yo(e,t){if(h&&34==e.keyCode&&e.char)return!1;var n=Fo[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Xo(n,e,t))}function $o(e){return"string"==typeof e?Ho[e]:e}function Jo(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&tt(o.from,X(r).to)<=0;){var a=r.pop();if(tt(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Qr(e,(function(){for(var t=r.length-1;t>=0;t--)mo(e.doc,"",r[t].from,r[t].to,"+delete");Rr(e)}))}function Zo(e,t,n){var r=ie(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Qo(e,t,n){var r=Zo(e,t.ch,n);return null==r?null:new et(t.line,r,n<0?"after":"before")}function ea(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ce(n,t.doc.direction);if(o){var a,s=i<0?X(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Dn(t,n);a=i<0?n.text.length-1:0;var u=In(t,c,a).top;a=oe((function(e){return In(t,c,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Zo(n,a,1))}else a=i<0?s.to:s.from;return new et(r,a,l)}}return new et(r,i<0?n.text.length:0,i<0?"before":"after")}Ho.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"},Ho.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"},Ho.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"},Ho.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"]},Ho.default=y?Ho.macDefault:Ho.pcDefault;var ta={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),z)},killLine:function(e){return Jo(e,(function(t){if(t.empty()){var n=Ke(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Jo(e,(function(t){return{from:et(t.from().line,0),to:st(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Jo(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Jo(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Jo(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return na(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return ra(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ke(e.doc,t),r=function(e){for(var t;t=Nt(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=$e(r)),ea(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),V)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),V)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?ra(e,t.head):r}),V)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=B(e.getLine(o.line),o.ch,r);t.push(q(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=Ke(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new et(i.line,i.ch-1)),i.ch>0)i=new et(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Ke(e.doc,i.line-1).text;a&&(i=new et(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(i.line-1,a.length-1),i,"+transpose"))}n.push(new wi(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Rr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function na(e,t){var n=Ke(e.doc,t),r=Bt(n);return r!=n&&(t=$e(r)),ea(!0,e,r,t,1)}function ra(e,t){var n=na(e,t.line),r=Ke(e.doc,n.line),i=ce(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return et(n.line,a?0:o,n.sticky)}return n}function ia(e,t,n){if("string"==typeof t&&!(t=ta[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=G}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var oa=new F;function aa(e,t,n,r){var i=e.state.keySeq;if(i){if(qo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:oa.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),sa(e,i+" "+t,n,r))return!0}return sa(e,t,n,r)}function sa(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Ko(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Ko(t,e.options.extraKeys,n,e)||Ko(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&ln(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(be(n),Er(e)),!!i}function la(e,t){var n=Yo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?aa(e,"Shift-"+n,t,(function(t){return ia(e,t,!0)}))||aa(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ia(e,t)})):aa(e,n,t,(function(t){return ia(e,t)})))}var ca=null;function ua(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=D(),me(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=la(t,e);h&&(ca=i?r:null,i||88!=r||Ie||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(C(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n))}I(t,"CodeMirror-crosshair"),he(document,"keyup",n),he(document,"mouseover",n)}(t)}}function ha(e){16==e.keyCode&&(this.doc.sel.shift=!1),me(this,e)}function da(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||xn(t.display,e)||me(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(h&&n==ca)return ca=null,void be(e);if(!h||e.which&&!(e.which<10)||!la(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return aa(e,"'"+n+"'",t,(function(t){return ia(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var fa,pa,ma=function(e,t,n){this.time=e,this.pos=t,this.button=n};function ga(e){var t=this,n=t.display;if(!(me(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,xn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!ba(t,e)){var r=cr(t,e),i=Se(e),o=r?function(e,t){var n=+new Date;return pa&&pa.compare(n,e,t)?(fa=pa=null,"triple"):fa&&fa.compare(n,e,t)?(pa=new ma(n,e,t),fa=null,"double"):(fa=new ma(n,e,t),pa=null,"single")}(r,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),aa(e,Xo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=ta[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=G}finally{e.state.suppressEdits=!1}return r}))}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){a?setTimeout(P(xr,e),0):e.curOp.focus=D();var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.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}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Te&&!e.isReadOnly()&&"single"==n&&(i=c.contains(t))>-1&&(tt((i=c.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,c=ei(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,fe(i.wrapper.ownerDocument,"mouseup",c),fe(i.wrapper.ownerDocument,"mousemove",u),fe(i.scroller,"dragstart",h),fe(i.scroller,"drop",c),o||(be(t),r.addNew||Xi(e.doc,n,null,null,r.extend),l&&!d||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),he(i.wrapper.ownerDocument,"mouseup",c),he(i.wrapper.ownerDocument,"mousemove",u),he(i.scroller,"dragstart",h),he(i.scroller,"drop",c),wr(e),setTimeout((function(){return i.input.focus()}),20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;be(t);var a,s,l=o.sel,c=l.ranges;if(r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new wi(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new wi(n,n)),n=cr(e,t,!0,!0),s=-1;else{var u=va(e,n,r.unit);a=r.extend?qi(a,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,Qi(o,Si(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(Qi(o,Si(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):$i(o,s,a,H):(s=0,Qi(o,new xi([a],0),H),l=o.sel);var h=n;function d(t){if(0!=tt(h,t))if(h=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=B(Ke(o,n.line).text,n.ch,c),d=B(Ke(o,t.line).text,t.ch,c),f=Math.min(u,d),p=Math.max(u,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Ke(o,m).text,y=W(v,f,c);f==p?i.push(new wi(et(m,y),et(m,y))):v.length>y&&i.push(new wi(et(m,y),et(m,W(v,p,c))))}i.length||i.push(new wi(n,n)),Qi(o,Si(e,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,_=a,E=va(e,t,r.unit),x=_.anchor;tt(E.anchor,x)>0?(b=E.head,x=ot(_.from(),E.anchor)):(b=E.anchor,x=it(_.to(),E.head));var w=l.ranges.slice(0);w[s]=function(e,t){var n=t.anchor,r=t.head,i=Ke(e.doc,n.line);if(0==tt(n,r)&&n.sticky==r.sticky)return t;var o=ce(i);if(!o)return t;var a=se(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=se(o,r.ch,r.sticky),h=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=o[c+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,m=f?"after":"before";return n.ch==p&&n.sticky==m?t:new wi(new et(n.line,p,m),r)}(e,new wi(st(o,x),b)),Qi(o,Si(e,w,s),H)}}var f=i.wrapper.getBoundingClientRect(),p=0;function m(t){e.state.selectingText=!1,p=1/0,t&&(be(t),i.input.focus()),fe(i.wrapper.ownerDocument,"mousemove",g),fe(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=ei(e,(function(t){0!==t.buttons&&Se(t)?function t(n){var a=++p,s=cr(e,n,!0,"rectangle"==r.unit);if(s)if(0!=tt(s,h)){e.curOp.focus=D(),d(s);var l=Or(i,o);(s.line>=l.to||s.line<l.from)&&setTimeout(ei(e,(function(){p==a&&t(n)})),150)}else{var c=n.clientY<f.top?-20:n.clientY>f.bottom?20:0;c&&setTimeout(ei(e,(function(){p==a&&(i.scroller.scrollTop+=c,t(n))})),50)}}(t):m(t)})),v=ei(e,m);e.state.selectingText=v,he(i.wrapper.ownerDocument,"mousemove",g),he(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,o)}(t,r,o,e):we(e)==n.scroller&&be(e):2==i?(r&&Xi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(w?t.display.input.onContextMenu(e):wr(t)))}}function va(e,t,n){if("char"==n)return new wi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new wi(et(t.line,0),st(e.doc,et(t.line+1,0)));var r=n(e,t);return new wi(r.from,r.to)}function ya(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ve(e,n))return Ee(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i)return pe(e,n,e,Je(e.doc,o),e.display.gutterSpecs[l].className,t),Ee(t)}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function _a(e,t){xn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||w||e.display.input.onContextMenu(t)}function Ea(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Un(e)}ma.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var xa={toString:function(){return"CodeMirror.Init"}},wa={},Sa={};function ka(e,t,n){if(!t!=!(n&&n!=xa)){var r=e.display.dragFunctions,i=t?he:fe;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ca(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(C(e.display.wrapper,"CodeMirror-wrap"),Wt(e)),lr(e),hr(e),Un(e),setTimeout((function(){return Gr(e)}),100)}function Ta(e,t){var n=this;if(!(this instanceof Ta))return new Ta(e,t);this.options=t=t?j(t):{},j(wa,t,!1);var r=t.value;"string"==typeof r?r=new Ro(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ta.inputStyles[t.inputStyle](this),o=this.display=new gi(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,Ea(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vr(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 F,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",ei(e,ga)),he(t.scroller,"dblclick",a&&s<11?ei(e,(function(t){if(!me(e,t)){var n=cr(e,t);if(n&&!ba(e,t)&&!xn(e.display,t)){be(t);var r=e.findWordAt(n);Xi(e.doc,r.anchor,r.head)}}})):function(t){return me(e,t)||be(t)}),he(t.scroller,"contextmenu",(function(t){return _a(e,t)})),he(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||_a(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}he(t.scroller,"touchstart",(function(i){if(!me(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ba(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!xn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new wi(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new wi(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}i()})),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Nr(e,t.scroller.scrollTop),jr(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return Ei(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return Ei(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||xe(t)},over:function(t){me(e,t)||(function(e,t){var n=cr(e,t);if(n){var r=document.createDocumentFragment();yr(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}(e,t),xe(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Do<100))xe(t);else if(!me(e,t)&&!xn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(e,t)},drop:ei(e,Io),leave:function(t){me(e,t)||Mo(e)}};var l=t.input.getField();he(l,"keyup",(function(t){return ha.call(e,t)})),he(l,"keydown",ei(e,ua)),he(l,"keypress",ei(e,da)),he(l,"focus",(function(t){return Sr(e,t)})),he(l,"blur",(function(t){return kr(e,t)}))}(this),jo(),Kr(this),this.curOp.forceUpdate=!0,Ni(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Sr(n)}),20):kr(this),Sa)Sa.hasOwnProperty(c)&&Sa[c](this,t[c],xa);di(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Oa.length;++u)Oa[u](this);qr(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Ta.defaults=wa,Ta.optionHandlers=Sa;var Oa=[];function Aa(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=ft(e,t).state:n="prev");var a=e.options.tabSize,s=Ke(o,t),l=B(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==G||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?B(Ke(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)d+=a,h+="\t";if(d<c&&(h+=q(c-d)),h!=u)return mo(o,h,et(t,0),et(t,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<u.length){var g=et(t,u.length);$i(o,p,new wi(g,g));break}}}Ta.defineInitHook=function(e){return Oa.push(e)};var La=null;function Ra(e){La=e}function Da(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,l=Re(t),c=null;if(s&&r.ranges.length>1)if(La&&La.text.join("\n")==t){if(r.ranges.length%La.text.length==0){c=[];for(var u=0;u<La.text.length;u++)c.push(o.splitLines(La.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=Y(l,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var f=r.ranges[d],p=f.from(),m=f.to();f.empty()&&(n&&n>0?p=et(p.line,p.ch-n):e.state.overwrite&&!s?m=et(m.line,Math.min(Ke(o,m.line).text.length,m.ch+X(l).length)):s&&La&&La.lineWise&&La.text.join("\n")==l.join("\n")&&(p=m=et(p.line,0)));var g={from:p,to:m,text:c?c[d%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};co(e.doc,g),ln(e,"inputRead",e,g)}t&&!s&&Ma(e,t),Rr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ia(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qr(t,(function(){return Da(t,n,0,null,"paste")})),!0}function Ma(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.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 o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=Aa(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ke(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Aa(e,i.head.line,"smart"));a&&ln(e,"electricInput",e,i.head.line)}}}function Na(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:et(i,0),head:et(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Pa(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function ja(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Pa(e),t}function Ba(e,t,n,r,i){var o=t,a=n,s=Ke(e,t.line),l=i&&"rtl"==e.direction?-n:n;function c(o){var a,c;if("codepoint"==r){var u=s.text.charCodeAt(t.ch+(r>0?0:-1));a=isNaN(u)?null:new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=i?function(e,t,n,r){var i=ce(t,e.doc.direction);if(!i)return Qo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=se(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Qo(t,n,r);var s,l=function(e,n){return Zo(t,e instanceof et?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||Dn(e,t),Zn(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var h=1==a.level==r<0,d=l(n,h?1:-1);if(null!=d&&(h?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var f=h?"before":"after";return new et(n.line,d,f)}}var p=function(e,t,r){for(var o=function(e,t){return t?new et(n.line,l(e,1),"before"):new et(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return o(c,s)}},m=p(o+r,r,u);if(m)return m;var g=r>0?u.end:l(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,c(g)))?null:m}(e.cm,s,t,n):Qo(s,t,n);if(null==a){if(o||(c=t.line+l)<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(s=Ke(e,c))))return!1;t=ea(i,e.cm,s,t.line,l)}else t=a;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=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||c(!f);f=!1){var p=s.text.charAt(t.ch)||"\n",m=ee(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||m||(m="s"),u&&u!=m){n<0&&(n=1,c(),t.sticky="after");break}if(m&&(u=m),n>0&&!c(!f))break}var g=oo(e,t,o,a,!0);return nt(o,g)&&(g.hitSide=!0),g}function Fa(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*rr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=$n(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ua=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new F,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ga(e,t){var n=Rn(e,t.line);if(!n||n.hidden)return null;var r=Ke(e.doc,t.line),i=An(n,r,t.line),o=ce(r,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var s=Pn(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function za(e,t){return t&&(e.bad=!0),e}function Ha(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return za(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Va(o,t,n)}}function Va(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!R(r,t))return za(et($e(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?X(e.rest):e.line;return za(et($e(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?l.map:c[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var u=$e(i<0?e.line:e.rest[i]),h=o[a]+r;return(r<0||s!=t)&&(h=o[a+(r?1:0)]),et(u,h)}}}var h=u(a,s,n);if(h)return za(h,i);for(var d=s.nextSibling,f=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(h=u(d,d.firstChild,0))return za(et(h.line,h.ch-f),i);f+=d.textContent.length}for(var p=s.previousSibling,m=n;p;p=p.previousSibling){if(h=u(p,p.firstChild,-1))return za(et(h.line,h.ch+m),i);m+=p.textContent.length}}Ua.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!me(r,e)){if(r.somethingSelected())Ra({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Na(r);Ra({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,z),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=La.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=ja(),l=s.firstChild;r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=La.text.join("\n");var c=document.activeElement;N(l),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==i&&n.showPrimarySelection()}),50)}}Pa(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),he(i,"paste",(function(e){!o(e)||me(r,e)||Ia(e,r)||s<=11&&setTimeout(ei(r,(function(){return t.updateFromDOM()})),20)})),he(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(i,"touchstart",(function(){return n.forceCompositionEnd()})),he(i,"input",(function(){t.composing||t.readFromDOMSoon()})),he(i,"copy",a),he(i,"cut",a)},Ua.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ua.prototype.prepareSelection=function(){var e=vr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ua.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ua.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ua.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=Ha(t,e.anchorNode,e.anchorOffset),s=Ha(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=tt(ot(a,s),i)||0!=tt(it(a,s),o)){var l=t.display.view,c=i.line>=t.display.viewFrom&&Ga(t,i)||{node:l[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Ga(t,o);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=e.rangeCount&&e.getRangeAt(0);try{f=k(c.node,c.offset,u.offset,u.node)}catch(e){}f&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ua.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Ua.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Ua.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ua.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return R(this.div,t)},Ua.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ua.prototype.blur=function(){this.div.blur()},Ua.prototype.getField=function(){return this.div},Ua.prototype.supportsTouch=function(){return!0},Ua.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Qr(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Ua.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ua.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=Ha(t,e.anchorNode,e.anchorOffset),r=Ha(t,e.focusNode,e.focusOffset);n&&r&&Qr(t,(function(){Qi(t.doc,ki(n,r),z),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ua.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=et(a.line-1,Ke(r.doc,a.line-1).length)),s.ch==Ke(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=et(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=ur(r,a.line))?(t=$e(i.view[0].line),n=i.view[0].node):(t=$e(i.view[e].line),n=i.view[e-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=$e(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var h=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(e){e&&(c(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(et(r,0),et(i+1,0),(g=+d,function(e){return e.id==g}));return void(f.length&&(o=f[0].find(0))&&u(qe(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&c();for(var m=0;m<t.childNodes.length;m++)h(t.childNodes[m]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),p&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var g}for(;h(t),t!=n;)t=t.nextSibling,l=!1;return o}(r,n,c,t,l)),d=qe(r.doc,et(t,0),et(l,Ke(r.doc,l).text.length));h.length>1&&d.length>1;)if(X(h)==X(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var f=0,p=0,m=h[0],g=d[0],v=Math.min(m.length,g.length);f<v&&m.charCodeAt(f)==g.charCodeAt(f);)++f;for(var y=X(h),b=X(d),_=Math.min(y.length-(1==h.length?f:0),b.length-(1==d.length?f:0));p<_&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==d.length&&t==a.line)for(;f&&f>a.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 E=et(t,f),x=et(l,d.length?X(d).length-p:0);return h.length>1||h[0]||tt(E,x)?(mo(r.doc,h,E,x,"+input"),!0):void 0},Ua.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ua.prototype.reset=function(){this.forceCompositionEnd()},Ua.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ua.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ua.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qr(this.cm,(function(){return hr(e.cm)}))},Ua.prototype.setUneditable=function(e){e.contentEditable="false"},Ua.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,Da)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ua.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ua.prototype.onContextMenu=function(){},Ua.prototype.resetPosition=function(){},Ua.prototype.needsContentAttribute=!0;var Wa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new F,this.hasSelection=!1,this.composing=null};Wa.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!me(r,e)){if(r.somethingSelected())Ra({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Na(r);Ra({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,z):(n.prevInput="",i.value=t.text.join("\n"),N(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),he(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(i,"paste",(function(e){me(r,e)||Ia(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),he(i,"cut",o),he(i,"copy",o),he(e.scroller,"paste",(function(t){if(!xn(e,t)&&!me(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){xn(e,t)||be(t)})),he(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),he(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Wa.prototype.createField=function(e){this.wrapper=ja(),this.textarea=this.wrapper.firstChild},Wa.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Wa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var i=qn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},Wa.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Wa.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&N(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Wa.prototype.getField=function(){return this.textarea},Wa.prototype.supportsTouch=function(){return!1},Wa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},Wa.prototype.blur=function(){this.textarea.blur()},Wa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Wa.prototype.receivedFocus=function(){this.slowPoll()},Wa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Wa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Wa.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||De(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r=""),8666==o)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(t,(function(){Da(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Wa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Wa.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Wa.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=cr(n,e),c=r.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ei(n,Qi)(n.doc,ki(o),z);var u,d=i.style.cssText,f=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"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=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&g(),w){xe(e);var m=function(){fe(window,"mouseup",m),setTimeout(v,20)};he(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=d,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?ei(n,so)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Wa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Wa.prototype.setUneditable=function(){},Wa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=xa&&i(e,t,n)}:i)}e.defineOption=n,e.Init=xa,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Li(e)}),!0),n("indentUnit",2,Li,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ri(e),Un(e),hr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(et(r,o))}r++}));for(var i=n.length-1;i>=0;i--)mo(e.doc,t,n[i],et(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=xa&&e.refresh()})),n("specialCharPlaceholder",Zt,(function(e){return e.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(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ea(e),mi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=$o(t),i=n!=xa&&$o(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ca,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=fi(t,e.options.lineNumbers),mi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ar(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Gr(e)}),!0),n("scrollbarStyle","native",(function(e){Vr(e),Gr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fi(e.options.gutters,t),mi(e)}),!0),n("firstLineNumber",1,mi,!0),n("lineNumberFormatter",(function(e){return e}),mi,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(kr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,ka),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ri,!0),n("addModeClass",!1,Ri,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ri,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Ta),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ei(this,t[e])(this,n,i),pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"]($o(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ti((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,hr(this)})),removeOverlay:ti((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void hr(this)}})),indentLine:ti((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Ze(this.doc,e)&&Aa(this,e,t,n)})),indentSelection:ti((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Aa(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Rr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Aa(this,l,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&$i(this.doc,r,new wi(o,c[r].to()),z)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=dt(this,Ke(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(o,this)&&-1==U(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return ft(this,(e=at(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return qn(this,null==e?n.head:"object"==typeof e?st(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Kn(this,st(this.doc,e),t||"page")},coordsChar:function(e,t){return $n(this,(e=Wn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Wn(this,{top:e,left:0},t||"page").top,Je(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=Ke(this.doc,e)}else r=e;return Vn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ht(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(e,t,n,r,i){var o,a,s,l=this.display,c=(e=qn(this,st(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)c=e.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||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Ar(o,a)).scrollTop&&Nr(o,s.scrollTop),null!=s.scrollLeft&&jr(o,s.scrollLeft))},triggerOnKeyDown:ti(ua),triggerOnKeyPress:ti(da),triggerOnKeyUp:ha,triggerOnMouseDown:ti(ga),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:ti((function(e){Ma(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=st(this.doc,e),a=0;a<t&&!(o=Ba(this.doc,o,i,n,r)).hitSide;++a);return o},moveH:ti((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Ba(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),V)})),deleteH:ti((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Jo(this,(function(n){var i=Ba(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=st(this.doc,e),s=0;s<t;++s){var l=qn(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Fa(this,l,i,n)).hitSide)break}return a},moveV:ti((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var s=qn(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=Fa(n,s,e,t);return"page"==t&&a==r.sel.primary()&&Lr(n,Kn(n,l,"div").top-s.top),l}),V),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=Ke(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),a=ee(o,i)?function(e){return ee(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};n>0&&a(t.charAt(n-1));)--n;for(;r<t.length&&a(t.charAt(r));)++r}return new wi(et(e.line,n),et(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?I(this.display.cursorDiv,"CodeMirror-overwrite"):C(this.display.cursorDiv,"CodeMirror-overwrite"),pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ti((function(e,t){Dr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Cn(this)-this.display.barHeight,width:e.scrollWidth-Cn(this)-this.display.barWidth,clientHeight:On(this),clientWidth:Tn(this)}},scrollIntoView:ti((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Ir(e),e.curOp.scrollToPos=t}(this,e):Mr(this,e.from,e.to,e.margin)})),setSize:ti((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Fn(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){dr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,pe(this,"refresh",this)})),operation:function(e){return Qr(this,e)},startOperation:function(){return Kr(this)},endOperation:function(){return qr(this)},refresh:ti((function(){var e=this.display.cachedTextHeight;hr(this),this.curOp.forceUpdate=!0,Un(this),Dr(this,this.doc.scrollLeft,this.doc.scrollTop),ci(this.display),(null==e||Math.abs(e-rr(this.display))>.5||this.options.lineWrapping)&&lr(this),pe(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ni(this,e),Un(this),this.display.input.reset(),Dr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},ye(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Ta);var Ka="iter insert remove copy getEditor constructor".split(" ");for(var qa in Ro.prototype)Ro.prototype.hasOwnProperty(qa)&&U(Ka,qa)<0&&(Ta.prototype[qa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ro.prototype[qa]));return ye(Ro),Ta.inputStyles={textarea:Wa,contenteditable:Ua},Ta.defineMode=function(e){Ta.defaults.mode||"null"==e||(Ta.defaults.mode=e),je.apply(this,arguments)},Ta.defineMIME=function(e,t){Pe[e]=t},Ta.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ta.defineMIME("text/plain","null"),Ta.defineExtension=function(e,t){Ta.prototype[e]=t},Ta.defineDocExtension=function(e,t){Ro.prototype[e]=t},Ta.fromTextArea=function(e,t){if((t=t?j(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=D();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(he(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Ta((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=fe,e.on=he,e.wheelEventPixels=_i,e.Doc=Ro,e.splitLines=Re,e.countColumn=B,e.findColumn=W,e.isWordChar=Q,e.Pass=G,e.signal=pe,e.Line=Kt,e.changeEnd=Ci,e.scrollbarModel=Hr,e.Pos=et,e.cmpPos=tt,e.modes=Ne,e.mimeModes=Pe,e.resolveMode=Be,e.getMode=Fe,e.modeExtensions=Ue,e.extendMode=Ge,e.copyState=ze,e.startState=Ve,e.innerMode=He,e.commands=ta,e.keyMap=Ho,e.keyName=Yo,e.isModifierKey=qo,e.lookupKey=Ko,e.normalizeKeyMap=Wo,e.StringStream=We,e.SharedTextMarker=To,e.TextMarker=ko,e.LineWidget=xo,e.e_preventDefault=be,e.e_stopPropagation=_e,e.e_stop=xe,e.addClass=I,e.contains=R,e.rmClass=C,e.keyNames=Fo}(Ta),Ta.version="5.58.2",Ta}()},W7jJ:
/*!*************************************************************!*\
!*** ./src/pages/Question/OjProblem/index.tsx + 16 modules ***!
\*************************************************************/
/*! exports provided: default */
/*! all exports used */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@ant-design/icons/es/icons/CaretDownOutlined.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@ant-design/icons/es/icons/CaretUpOutlined.js */
/*! 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/Problems/OjForm/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/Description/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/Drawer/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/CustomDiscuss/DiscussItem/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/CustomDiscuss/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/SubmitList/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/index.less?modules (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/.umi-production/core/umiExports.ts */
/*! 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/Video/Play/index.jsx */
/*! 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/Problems/OjForm/CodePanel/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/TestCasePanel/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/interface.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/service.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/left-panel/discuss/discuss-editor/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/aliyunUpload.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/authority.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/util.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/question/show.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/question/time.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/question/title.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/b.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/c.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/c1.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/d.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/e.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/g.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/gf.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/jx.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/s.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/t.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/v.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Question/OjProblem/LeftPanel/FilterList/img/a.svg (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/assets/images/question/internal.png (<- 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/col/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/col/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/row/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/row/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/select/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/select/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/skeleton/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/skeleton/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/antd/es/tooltip/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/tooltip/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/lodash/lodash.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-copy-to-clipboard/lib/index.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(e,t,n){"use strict";n.r(t);var r=n("0Owb"),i=n("PpiC"),o=(n("OaEy"),n("2fM7")),a=(n("T2oS"),n("W9HT")),s=(n("miYZ"),n("tsqr")),l=(n("2qtc"),n("kLXV")),c=n("9og8"),u=n("tJVT"),h=n("k1fw"),d=(n("aHsQ"),n("sGsY")),f=n("WmNS"),p=n.n(f),m=n("q1tI"),g=n.n(m),v=n("Fvcw"),y=n("GIiI"),b=n("Ty5D"),_=n("9kvl"),E=n("55Ip"),x=n("7qur"),w=n("cDPC"),S=n("m3rI"),k=n("RCxd"),C=n("EHPI"),T=n("J66h"),O=n("uMZB"),A=n.n(O),L=(n("sNtx"),n("RpDr")),R=(n("+L6B"),n("2/Rp")),D=(n("y8nQ"),n("Vl3Y")),I=(n("5NDa"),n("5rEg")),M=I.a.TextArea,N=function(e){var t=e.callback,n=e.onCancel,r=e.notes;return g.a.createElement(D.a,{className:"note-form-panel",onFinish:function(e){t(e)},initialValues:{notes:r}},g.a.createElement(D.a.Item,{name:"notes",rules:[{required:!0,message:"请输入笔记内容"},{max:5e3,message:"笔记最大字数为".concat(5e3)}]},g.a.createElement(M,{placeholder:"请输入笔记内容",rows:5})),g.a.createElement(D.a.Item,{style:{textAlign:"right"}},g.a.createElement(R.a,{type:"ghost",onClick:n,style:{marginRight:10}}," 取消 "),g.a.createElement(R.a,{type:"primary",htmlType:"submit"}," 提交 ")))},P=n("ZsLC"),j=n.n(P),B=(n("DjyN"),n("NUBc")),F=(n("g9YV"),n("wCAj")),U=n("Hw79"),G=n.n(U),z=n("ye1Q"),H=n("lfch"),V=n("bdLU"),W=n("1vsH"),K=n("wd/R"),q=n.n(K),X=F.a.Column,Y=function(e){var t=e.submitResult,n=e.submitting,r=e.submitRecords,i=e.page,o=e.onPageChange,l=e.topicId,c=t||{},u=c.status,h=c.id,d=c.input,f=c.output,p=c.expected_output,m=c.is_file,v=c.input_file_url,y=c.output_file_url,_=c.expected_output_file_url,x=c.error_msg,w=r||{},S=w.records,k=w.records_count,C=Object(b.i)();return g.a.createElement(a.a,{spinning:n,tip:"评测中...",indicator:g.a.createElement(z.a,{style:{fontSize:24},spin:!0})},h?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:u===V.a.OK?"c-green":"c-red"},L.a[u])),g.a.createElement("li",{className:G.a.error},g.a.createElement("a",{onClick:function(){m?navigator.clipboard.writeText(T.Base64.decode(x)).then((function(){s.b.success("复制错误信息成功")})):navigator.clipboard.writeText(T.Base64.decode(f)).then((function(){s.b.success("复制错误信息成功")}))}},"复制错误信息 ",g.a.createElement(H.a,null)," ")),g.a.createElement("li",null,g.a.createElement(E.a,{to:"/problems/".concat(l,"/record-detail/").concat(h,"?backId=").concat(null==C?void 0:C.save_identifier)},"显示详情 > "))),u!==V.a.OK?g.a.createElement(g.a.Fragment,null,g.a.createElement("p",{className:"c-red"},"实际输入:"),g.a.createElement("pre",null,!m&&d,m&&g.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(W.w)(v,d)}},d)),g.a.createElement("p",{className:"c-red"},"实际输出:"),g.a.createElement("pre",null,(4===u||5===u)&&T.Base64.decode(x),4!=u&&5!=u&&(m?g.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(W.w)(y,f)}},f):T.Base64.decode(f))),g.a.createElement("p",{className:"c-red"},"预期输出:"),g.a.createElement("pre",null,!m&&T.Base64.decode(p),m&&g.a.createElement("a",{style:{fontSize:"16px"},onClick:function(){return Object(W.w)(_,p)}},p))):null):null,(null==S?void 0:S.length)>0?g.a.createElement(F.a,{dataSource:S,rowKey:"id",pagination:!1},g.a.createElement(X,{title:"提交时间",dataIndex:"created_at",key:"created_at",render:function(e,t){return g.a.createElement("span",null," ",q()(e).format("YYYY-MM-DD HH:mm:ss"))}}),g.a.createElement(X,{title:"提交结果",dataIndex:"status",key:"status",render:function(e,t){var n;return g.a.createElement(E.a,{className:0===e?"c-green":"c-red",to:"/problems/".concat(l,"/record-detail/").concat(t.id,"?backId=").concat(null==C?void 0:C.save_identifier)},null===(n=L.a[e])||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"})):null,k>15?g.a.createElement(B.a,{className:G.a.pagination,current:i,pageSize:15,total:k,onChange:o}):null)},$=n("BdwD"),J=(n("DYRE"),n("zeV3")),Z=(n("+BJd"),n("mr32")),Q=n("TcMa"),ee=n.n(Q),te=n("9Bee"),ne={1:{name:"简单",color:"#52c41a"},2:{name:"适中",color:"#faad14"},3:{name:"困难",color:"#f5222d"}},re=function(e){var t=e.hack,n=(e.onTriggerPraise,e.toDiscuss),r=(t.language,t.difficulty),i=t.time_limit,o=(t.username,t.user_path,t.user_praise,t.comments_count),a=(t.praises_count,t.description),s=t.pass_count,l=t.submit_count;Object(b.h)();console.log(t.language,"language");var c=ne[r];return g.a.createElement(g.a.Fragment,null,g.a.createElement("ul",{className:ee.a.info},g.a.createElement("li",null,"难度:",g.a.createElement(Z.a,{color:c.color},c.name)),g.a.createElement("li",null,"评测时长限制:",g.a.createElement("b",null,i,"秒"))),g.a.createElement(te.a,{value:a,className:ee.a.desc}),g.a.createElement("ul",{className:ee.a["commit-info"]},g.a.createElement("li",null,g.a.createElement(J.a,{size:4},g.a.createElement("span",null,"通过次数")," ",g.a.createElement("b",null,s))),g.a.createElement("li",null,g.a.createElement(J.a,{size:4},g.a.createElement("span",null,"提交次数")," ",g.a.createElement("b",null,l))," "),g.a.createElement("li",{style:{flex:"1 0 0"}}),g.a.createElement("li",null,g.a.createElement(J.a,{size:4},g.a.createElement("i",{className:"iconfont icon-huifu1",onClick:n})," ",g.a.createElement("b",null,o))," ")))},ie=n("dhSg"),oe=n("ps8w"),ae=n.n(oe),se=n("oBTY"),le=n("M8RZ"),ce=(n("OkW/"),n("ErOA"));function ue(e){return Object(ce.c)("comments.json",e)}function he(e){return Object(ce.f)("/discusses/".concat(e,"/plus.json"),{container_type:"Discuss",type:1})}function de(e){return Object(ce.f)("comments/reply.json",e)}function fe(e){return Object(ce.f)("comments.json",e)}function pe(e){return Object(ce.f)("comments/".concat(null==e?void 0:e.id,"/hidden.json"),e)}function me(e){return Object(ce.b)("comments/".concat(null==e?void 0:e.id,".json"))}n("GgEA");var ge=n("AMnG"),ve=n("xKgJ");function ye(e){var t=e.author;return g.a.createElement("a",{href:"/users/".concat(t.login),target:"_blank"},g.a.createElement("img",{alt:"用户头像",height:"50",style:{borderRadius:"50%"},src:"".concat(S.a.IMG_SERVER,"/images/").concat(t.image_url),width:"50"}))}function be(e){var t=e.data,n=e.index,r=e.parentDiscussIndex,i=e.user,o=e.onSetActionType,a=t.author,s=t.can_delete,l=t.content,c=t.id,u=t.time;var h=i.admin||s||a.user_id===i.user_id;return g.a.createElement("div",{className:"discuss-item-container second-discuss "},g.a.createElement(ye,{author:a}),g.a.createElement("section",null,g.a.createElement("div",{className:"discuss-info"},g.a.createElement("a",{href:"/users/".concat(a.login),target:"_blank"},a.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(){o({id:c,index:n,type:"delete-discuss",parentDiscussIndex:r,message:"确定要删除该条回复吗"})},title:"删除"},g.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),g.a.createElement(te.a,{className:"discuss-content",value:l})))}var _e,Ee=function(e){var t=e.user,n=e.data,r=e.index,i=e.onPlusDiscuss,o=e.onSetActionType,a=e.activeDiscussIndex,s=e.onReplyDiscuss,l=e.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;console.log(v&&(!u||0==u.length),"children22");t.admin||(t.user_id,y.user_id);return g.a.createElement("div",{className:"discuss-item-container",key:d},g.a.createElement(ye,{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(te.a,{className:"discuss-content",value:c}),u&&u.length>0?g.a.createElement("div",{className:"reply-discuss-container"},u.map((function(e,n){return g.a.createElement(be,{key:e.id,data:e,index:n,user:t,onSetActionType:o,parentDiscussIndex:r})}))):null,g.a.createElement("div",{className:"btn-group"},Object(ve.v)()?g.a.createElement("a",{onClick:function(){o({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(){o({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(ge.a,{id:d,activeDiscussIndex:a,onReplyDiscuss:s})))},xe=n("kaH+"),we=(n("Wx9E"),n("Ot1p")),Se=function(e){var t=e.user_praise,n=e.praise_count,r=e.praisePlus,i=e.onCreateDiscuss,o=e.discuss_count,a=Object(m.useState)(!1),s=Object(u.a)(a,2),l=s[0],h=s[1],d=Object(m.useState)(""),f=Object(u.a)(d,2),v=f[0],y=f[1];function b(){h(!1)}function _(){return(_=Object(c.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i(v),y(""),h(!1);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return g.a.createElement("div",{className:"dis-input-editor-container ".concat(l?"active":""," ")},g.a.createElement("div",{className:l?"text-area hide":"text-area"},g.a.createElement("input",{placeholder:"说点什么",onClick:function(){h(!0)}}),g.a.createElement("a",{style:{alignItems:"center"}}," ",g.a.createElement("i",{className:"iconfont icon-huifu1"}),"    ",o," "),g.a.createElement("a",{className:"c-light-black",onClick:r,style:{alignItems:"center"},title:t?"取消点赞":"点赞"},g.a.createElement("i",{className:"mr3 ".concat(t?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),n?g.a.createElement("span",null,n):"")),l?g.a.createElement("div",{className:"input-mask",onClick:b}):null,g.a.createElement("div",{className:l?"md-container":"md-container hide"},g.a.createElement(we.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:v,height:240,onChange:function(e){y(e)}}),g.a.createElement("div",{className:"tip-container",onClick:b},g.a.createElement("a",{className:"btn-send",onClick:function(){return _.apply(this,arguments)}}," 发送 "))))},ke={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null};function Ce(e,t){switch(t.type){case _e.SHOW_DISCUSSES_LOADING:return Object(h.a)(Object(h.a)({},e),{},{loading:!0});case _e.GET_DISCUSSES:case _e.TOP_OR_DOWN_DISCUSS:case _e.SET_ACTION_TYPE:case _e.PLUS_DISCUSS:return Object(h.a)(Object(h.a)({},e),t.payload);case _e.SET_PAGE:return Object(h.a)(Object(h.a)({},e),{},{page:t.payload});case _e.ACTIVE_DISCUSS_INDEX:return Object(h.a)(Object(h.a)({},e),t.payload);default:throw new Error}}!function(e){e[e.GET_DISCUSSES=0]="GET_DISCUSSES",e[e.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",e[e.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",e[e.PLUS_DISCUSS=3]="PLUS_DISCUSS",e[e.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",e[e.SET_PAGE=5]="SET_PAGE",e[e.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"}(_e||(_e={}));var Te,Oe=function(e){var t=e.user,n=e.identifier,r=e.hack,i=e.onTriggerPraise,o=e.setDiscussTotal,a=Object(m.useReducer)(Ce,ke),s=Object(u.a)(a,2),d=s[0],f=s[1],v=(d.loading,d.page),y=d.data,b=d.count,_=d.actionType,E=d.activeDiscussIndex,x=Object(m.useCallback)(Object(c.a)(p.a.mark((function e(){var t,r,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f({type:_e.SHOW_DISCUSSES_LOADING}),e.next=3,ue({container_type:"Practice",container_identifier:n,limit:10,page:v});case 3:t=e.sent,r=t.comments,i=t.disscuss_count,f({type:_e.GET_DISCUSSES,payload:{data:r,count:i,loading:!1}}),o(i);case 7:case"end":return e.stop()}}),e)}))),[v,n]);function w(e){f({type:_e.SET_ACTION_TYPE,payload:{actionType:e}})}function S(e){f(E===e?{type:_e.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}:{type:_e.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:e}})}function k(e,t,n){return C.apply(this,arguments)}function C(){return(C=Object(c.a)(p.a.mark((function e(t,n,r){var i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,he(t);case 3:i=e.sent,y[r].user_praise=n,y[r].praise_count=i.praise_count,f({type:_e.PLUS_DISCUSS,payload:{data:Object(se.a)(y)}}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.log(e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function T(){return(T=Object(c.a)(p.a.mark((function e(){var t,r,i,o,a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_.id,r=_.params,i=_.type,o=_.index,a=_.parentDiscussIndex,"hidden-discuss"!==i){e.next=7;break}return console.log(r,"params"),e.next=5,pe(Object(h.a)({id:t,container_type:"Practice",container_identifier:n},r));case 5:a?y[a].children[o].hidden=1==r.hidden:y[o].hidden=1==r.hidden,f({type:_e.SET_ACTION_TYPE,payload:{actionType:null,data:Object(se.a)(y)}});case 7:if("delete-discuss"!==i){e.next=13;break}return e.next=10,me({id:t,container_type:"Practice",container_identifier:n});case 10:return f({type:_e.SET_ACTION_TYPE,payload:{actionType:null}}),e.next=13,x();case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e,t){return A.apply(this,arguments)}function A(){return(A=Object(c.a)(p.a.mark((function e(t,r){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,de({container_type:"Practice",container_identifier:n,comments:{content:r,parent_id:t}});case 3:x(),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.log(e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function L(){return(L=Object(c.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f({type:_e.SHOW_DISCUSSES_LOADING}),e.next=3,fe({comments:{content:t},container_type:"Practice",container_identifier:n});case 3:x();case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return Object(m.useEffect)((function(){x()}),[n,v]),g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{className:"discuss-panel"},0===y.length?g.a.createElement($.a,null):y.map((function(e,n){return g.a.createElement(Ee,{onReplyDiscuss:O,onPlusDiscuss:k,onSetActiveDiscussIndex:S,onSetActionType:w,data:e,index:n,user:t,activeDiscussIndex:E})})),b>10?g.a.createElement("div",{className:"pagination-container"},g.a.createElement(B.a,{showQuickJumper:!0,onChange:function(e){f({type:_e.SET_PAGE,page:e})},current:v,total:b})):null),g.a.createElement(Se,{user_praise:r.user_praise,praise_count:r.praises_count,praisePlus:i,discuss_count:r.comments_count,onCreateDiscuss:function(e){return L.apply(this,arguments)}}),g.a.createElement(le.a,null,g.a.createElement(l.a,{centered:!0,title:"提示",visible:!!_,onOk:function(){return T.apply(this,arguments)},onCancel:function(){f({type:_e.SET_ACTION_TYPE,payload:{actionType:null}})}},g.a.createElement("p",null,_?_.message:"")),g.a.createElement(xe.a,null)))},Ae=n("1FX+"),Le=n.n(Ae),Re=n("pYxM"),De=n.n(Re),Ie=n("sB/4"),Me=n.n(Ie),Ne=n("Wtmd"),Pe=n.n(Ne),je=n("CNDd"),Be=n.n(je),Fe=n("nCk5"),Ue=n.n(Fe),Ge=n("kovY"),ze=n.n(Ge),He=function(e){var t=e.style,n=void 0===t?{}:t,r=e.onClick,i=e.onAssist,o=e.onHide,a=e.data,s=e.active,l=e.showLine;return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{className:s===(null==a?void 0:a.id)?"".concat(De.a.list," ").concat(De.a.active):De.a.list,style:n,onClick:function(){return r(a)}},(null==a?void 0:a.video)&&g.a.createElement("div",{className:De.a.left},g.a.createElement("img",{src:null==a?void 0:a.video_cover}),g.a.createElement("div",null,g.a.createElement("img",{src:Me.a}),g.a.createElement("span",null,null==a?void 0:a.video_duration)),g.a.createElement("div",{className:De.a.mask})),g.a.createElement("div",{className:De.a.right},g.a.createElement("div",{className:De.a.name},g.a.createElement("img",{src:S.a.IMG_SERVER+"/images/"+(null==a?void 0:a.image_url),width:30,height:30}),g.a.createElement("div",{title:null==a?void 0:a.name,className:De.a.title},null==a?void 0:a.name),(null==a?void 0:a.is_authority)&&g.a.createElement("div",{className:De.a.b},"官方"),(null==a?void 0:a.is_excellent)&&g.a.createElement("div",{className:De.a.a},"精选")),g.a.createElement("div",{className:De.a.des},g.a.createElement(te.a,{showLines:2,showTextOnly:!0,value:(null==a?void 0:a.content)||"暂无内容"})),g.a.createElement("div",{className:De.a.tag},g.a.createElement("span",{className:"current",onClick:function(e){e.stopPropagation(),i(a)}},g.a.createElement("img",{src:null!=a&&a.user_liker?Be.a:Pe.a}),g.a.createElement("span",{style:{color:null!=a&&a.user_liker?"#0152d9":"#656f87"}},null==a?void 0:a.praises_count)),g.a.createElement("span",null,g.a.createElement("img",{src:Ue.a}),g.a.createElement("span",null,null==a?void 0:a.discusses_count)),g.a.createElement("span",null,g.a.createElement("img",{src:ze.a}),g.a.createElement("span",null,null==a?void 0:a.viewed_count)),Object(ve.v)()&&g.a.createElement("span",{className:"current",style:{color:"#0152d9",marginRight:0,userSelect:"none"},onClick:function(e){e.stopPropagation(),o(a)}},null!=a&&a.is_hidden?"取消隐藏":"隐藏")))),l&&g.a.createElement("div",{className:De.a.line}))},Ve=(n("5Dmo"),n("3S7+")),We=n("Z8dc"),Ke=n.n(We),qe=n("Aky1"),Xe=n("7+5b"),Ye=n.n(Xe),$e=n("twBr"),Je=n.n($e),Ze=n("oE5q"),Qe=n.n(Ze),et=function(e,t){var n,r,i,o=t.payload.uploadInfo,a=void 0===o?{}:o;switch(t.type){case"addVideo":return{videoList:[].concat(Object(se.a)(e.videoList),[{name:a.file.name,size:a.file.size,type:a.file.type,fileHash:a.fileHash,state:a.state,video_id:a.videoId,attachment_id:"",article_id:-1,loaded:0,title:""}])};case"removeVideo":return{videoList:e.videoList.filter((function(e){return e.name!==t.payload.name}))};case"replaceVideo":return{videoList:t.payload};case"removeAll":return[];case"updateProgress":return{videoList:e.videoList.map((function(e){return e.name===t.payload.uploadInfo.file.name?Object(h.a)(Object(h.a)({},e),{loaded:t.payload.progressPercent,video_id:a.videoId,fileHash:a.fileHash}):e}))};case"updateTitle":return{videoList:null===(n=e.videoList)||void 0===n?void 0:n.map((function(e){return e.name===t.payload.item.name?Object(h.a)(Object(h.a)({},e),{title:t.payload.title}):e}))};case"updateImg":return{videoList:null===(r=e.videoList)||void 0===r?void 0:r.map((function(e){return e.name===t.payload.item.name?Object(h.a)(Object(h.a)({},e),{attachment_id:t.payload.attachment_id}):e}))};case"updateImg":return{videoList:null===(i=e.videoList)||void 0===i?void 0:i.map((function(e){return e.name===t.payload.item.name?Object(h.a)(Object(h.a)({},e),{attachment_id:t.payload.attachment_id}):e}))};default:return[]}},tt=function(e){var t,n,r=e.onClose,i=e.onOk,o=e.identifier,a=e.active,d=D.a.useForm(),f=Object(u.a)(d,1)[0],v=Object(m.useState)({}),y=Object(u.a)(v,2),_=y[0],E=y[1],w=Object(m.useState)(!1),S=Object(u.a)(w,2),k=S[0],C=S[1],T=Object(m.useState)(!1),O=Object(u.a)(T,2),A=O[0],L=O[1],M=Object(m.useReducer)(et,{videoList:[]}),N=Object(u.a)(M,2),P=N[0],j=N[1],B=Object(ve.x)(),F=(Object(b.i)(),Object(m.useRef)());Object(m.useEffect)((function(){a&&G()}),[a]);var U,G=function(){var e=Object(c.a)(p.a.mark((function e(){var t,n,r,i,s,l,c,u,h,d,m,g;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.k)(o,{active:a});case 2:0===(null==(t=e.sent)?void 0:t.status)&&(l={name:null==t||null===(n=t.data)||void 0===n?void 0:n.name,content:null==t||null===(r=t.data)||void 0===r?void 0:r.content},f.setFieldsValue(l),E(l),null!=t&&null!==(i=t.data)&&void 0!==i&&null!==(s=i.videos)&&void 0!==s&&s[0]&&j({type:"replaceVideo",payload:[{video_id:null==t||null===(c=t.data)||void 0===c||null===(u=c.videos)||void 0===u||null===(h=u[0])||void 0===h?void 0:h.video_id,name:null==t||null===(d=t.data)||void 0===d||null===(m=d.videos)||void 0===m||null===(g=m[0])||void 0===g?void 0:g.title,loaded:100}]}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),z=function(){var e=Object(c.a)(p.a.mark((function e(t){var n,r,s,l,c;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r={videos:P.videoList,articles:t},L(!0),!a){e.next=9;break}return r.active=a,e.next=6,Object(x.j)(o,r);case 6:s=e.sent,e.next=12;break;case 9:return e.next=11,Object(x.a)(o,r);case 11:s=e.sent;case 12:0===(null===(n=s)||void 0===n?void 0:n.status)&&(console.log(a||(null===(l=s)||void 0===l?void 0:l.id),44),i(a||(null===(c=s)||void 0===c?void 0:c.id))),L(!1);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),H=function(){document.getElementById("fileUpload").value=""},V=function(e){return g.a.createElement("div",{className:Ke.a.mainSucceed},g.a.createElement("img",{src:Je.a,alt:""}),g.a.createElement("span",null,"上传成功"),g.a.createElement("div",{className:Ke.a.tip},g.a.createElement(Ve.a,{getPopupContainer:function(e){return e.parentNode},title:g.a.createElement("div",null,g.a.createElement("div",null,"1、上传视频即表示您已同意",g.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"上传内容协议"),",不得上传未经他人授权的作品;"),g.a.createElement("div",null,"2、不支持断点续传文件大小请勿超过1G"),g.a.createElement("div",null,"3、支持文件格式avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm、wmv"))},g.a.createElement("img",{src:Qe.a,alt:""}))),g.a.createElement("div",{className:Ke.a.del,onClick:function(){return t=e.name,n=100==e.loaded,void l.a.confirm({title:"提示",centered:!0,okText:"确定",cancelText:"取消",content:g.a.createElement("div",{className:"tc"},"您确认要",n?"删除":"取消上传","该视频吗?"),onOk:function(){H(),j({type:"removeVideo",payload:{name:t}})}});var t,n}},g.a.createElement("i",{className:"iconfont icon-shanchu7 mr5"}),"删除视频"))},W=null===(t=P.videoList)||void 0===t?void 0:t.length;return g.a.createElement("div",{className:Ke.a.listForm},g.a.createElement("header",null,a?"编辑":"发布","题解"),g.a.createElement("section",{className:Ke.a.scroll,id:"sss"},g.a.createElement("div",{className:Ke.a.formWrap}," ",g.a.createElement(D.a,{form:f,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(e,t){E(Object(h.a)({},t))},onFinish:z},g.a.createElement(D.a.Item,{name:"name",label:"标题:",rules:[{required:!0,message:"请输入名称"},{max:60,message:"请输入名称最大限制60个字符"},{whitespace:!0,message:"请勿输入空格"}]},g.a.createElement(I.a,{bordered:!1,placeholder:"请输入名称最大限制60个字符",suffix:"".concat((null===(n=_.name)||void 0===n?void 0:n.length)||0,"/60")})),g.a.createElement(D.a.Item,{name:"content",label:"内容:"},g.a.createElement(we.a,{defaultValue:_.content||"",watch:!0})))),g.a.createElement("div",{className:Ke.a.upload},W?g.a.createElement(g.a.Fragment,null,null===(U=P.videoList)||void 0===U?void 0:U.map((function(e,t){return g.a.createElement(g.a.Fragment,{key:t},100==e.loaded?V(e):(n=e.loaded,g.a.createElement("div",{className:Ke.a.mainLoading},g.a.createElement("div",{className:Ke.a.proWarp},g.a.createElement("div",{className:Ke.a.pro},g.a.createElement("div",{style:{width:n}})),g.a.createElement("span",null,n||0,"%")),g.a.createElement("aside",null,"上传中"),g.a.createElement("div",{className:Ke.a.tip},g.a.createElement(Ve.a,{getPopupContainer:function(e){return e.parentNode},title:g.a.createElement("div",null,g.a.createElement("div",null,"1、上传视频即表示您已同意",g.a.createElement("a",{className:"current c-light-primary",target:"_blank",href:"/users/innov/videos/protocol"},"上传内容协议"),",不得上传未经他人授权的作品;"),g.a.createElement("div",null,"2、不支持断点续传文件大小请勿超过1G"),g.a.createElement("div",null,"3、支持文件格式avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm、wmv"))},g.a.createElement("img",{src:Qe.a,alt:""}))))));var n}))):g.a.createElement("label",{htmlFor:"fileUpload",className:Ke.a.main},g.a.createElement("img",{src:Ye.a,alt:""}),g.a.createElement("span",null,"上传视频")),g.a.createElement("input",{type:"file",id:"fileUpload",style:{display:"none"},onChange:function(e){var t,n=e.target.files[0];if(n){var r=n.name.toLowerCase();return r&&-1==r.indexOf(".avi")&&-1==r.indexOf(".flv")&&-1==r.indexOf(".f4v")&&-1==r.indexOf(".m4v")&&-1==r.indexOf(".mov")&&-1==r.indexOf(".mp4")&&-1==r.indexOf(".rmvb")&&-1==r.indexOf(".swf")&&-1==r.indexOf(".webm")&&-1==r.indexOf(".wmv")?(s.b.info("不支持的视频格式"),void H()):n.size>1073741824?(s.b.info("视频大小超过".concat(1024,"M")),void H()):null!==(t=P.videoList)&&void 0!==t&&t.find((function(e){return e.name===n.name}))?(s.b.info("你不能上传同一个视频文件名称,请重新选择。"),void H()):void function(e){C(!0),F.current?F.current.addFile(e,null,null,null,'{"Vod":{}}'):Object(qe.a)(null==B?void 0:B.login,"",{create:!F,addFileSuccess:function(e){j({type:"addVideo",payload:{uploadInfo:e}})},onUploadProgress:function(e,t,n){var r=Math.ceil(100*n);j({type:"updateProgress",payload:{uploadInfo:e,progressPercent:r}}),H()},onUploadFailed:function(e){s.b.info("视频云服务出现异常,请重新上传。")},onUploadEnd:function(e){C(!1)},onUploadSucceed:function(e){C(!1)},onUploadError:function(e){C(!1)},gotUploader:function(t){t.addFile(e,null,null,null,'{"Vod":{}}'),F.current=t}})}(n)}H()},accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"}))),g.a.createElement("div",{className:Ke.a.btns},g.a.createElement(R.a,{onClick:function(){l.a.confirm({centered:!0,width:500,okText:"确定",cancelText:"取消",title:"注意",icon:null,className:"custom-modal-divider",content:"您正在编写题解,点击关闭后,您的题解内容将不会进行保存。",onOk:r})},type:"primary",ghost:!0},"关闭"),g.a.createElement(R.a,{loading:A,disabled:k,onClick:function(){return f.submit()},type:"primary"},"发布题解")))},nt=(n("cWXX"),n("/ezw")),rt=n("CaVn"),it=n.n(rt),ot=n("s8/Y"),at=n.n(ot),st=n("JOrW"),lt=n.n(st),ct=n("gqXR"),ut=n.n(ct),ht=(n("14J3"),n("BMrR")),dt=(n("jCWc"),n("kPKH")),ft=n("wW8i"),pt=n.n(ft),mt=n("MVJL"),gt=n.n(mt),vt=function(e){var t=e.id,n=e.cb,r=Object(m.useState)(""),i=Object(u.a)(r,2),o=i[0],a=i[1];return g.a.createElement("aside",{className:"mt10"},g.a.createElement(we.a,{defaultValue:o,id:"writeForumsReviewId",onChange:function(e){a(e)},placeholder:"我要回复...",height:240}),g.a.createElement(ht.a,null,g.a.createElement(dt.a,{flex:"1"}),g.a.createElement(dt.a,null,g.a.createElement(R.a,{type:"primary",size:"large",onClick:Object(c.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:""===o?s.b.error("请输入内容"):n(t,o);case 1:case"end":return e.stop()}}),e)})))},"发送"))))},yt=function(e){var t,n=e.data;return g.a.createElement("div",{className:gt.a.thirdlyLevelDiscuss},g.a.createElement("span",{className:"c-grey-333"},g.a.createElement("span",{className:"font 14 c-light-primary"},null==n||null===(t=n.author)||void 0===t?void 0:t.name),"@",g.a.createElement("span",{className:"font 14 c-light-primary"},null==n?void 0:n.parent_name),":"),g.a.createElement(te.a,{value:null==n?void 0:n.content}))},bt=function(e){var t,n,r,i,o=e.data,a=e.onReplyDiscuss,s=e.thirdlyReply,l=e.setThirdlyReply,c=Object(ve.x)();return console.log(c,"user"),g.a.createElement("div",{className:gt.a.list},g.a.createElement("img",{src:S.a.IMG_SERVER+"/images/"+(null==o||null===(t=o.author)||void 0===t?void 0:t.image_url)}),g.a.createElement("div",{className:gt.a.wrap},g.a.createElement("div",{className:"font14",style:{marginBottom:6}},g.a.createElement("span",{className:"c-grey-333"},null==o||null===(n=o.author)||void 0===n?void 0:n.name),(null==c?void 0:c.login)!==(null==o||null===(r=o.author)||void 0===r?void 0:r.login)&&g.a.createElement("span",{onClick:function(){return l(null==o?void 0:o.id)},className:"c-grey-999 current",style:{float:"right"}},g.a.createElement("i",{className:"iconfont icon-huifu3 mr3 font12"}),g.a.createElement("span",null,"回复"))),g.a.createElement(te.a,{value:null==o?void 0:o.content}),null==o||null===(i=o.children)||void 0===i?void 0:i.map((function(e){return g.a.createElement(yt,{key:e.id,data:e})})),s===(null==o?void 0:o.id)&&g.a.createElement("div",null,g.a.createElement(vt,{id:null==o?void 0:o.id,cb:a}),g.a.createElement("div",{style:{textAlign:"end",paddingTop:20},onClick:function(){return l(null)},className:"c-light-primary current"},g.a.createElement("i",{style:{transform:"scale(0.7)",display:"inline-block"},className:"iconfont icon-shouqi font12"}),"收起回复")),g.a.createElement("div",{className:gt.a.line})))},_t=function(e){var t,n,r,i,o=e.data,a=e.onReplyDiscuss,s=e.secondReply,l=e.setSecondReply,c=e.thirdlyReply,h=e.setThirdlyReply,d=e.onPlusDiscuss,f=Object(m.useState)(!1),p=Object(u.a)(f,2),v=p[0],y=p[1];return console.log(o,"data"),g.a.createElement("div",{className:gt.a.discussItem},g.a.createElement("div",{className:gt.a.list},g.a.createElement("img",{src:S.a.IMG_SERVER+"/images/"+(null==o||null===(t=o.author)||void 0===t?void 0:t.image_url)}),g.a.createElement("div",{className:gt.a.wrap},g.a.createElement("div",{className:"font14",style:{marginBottom:6}},g.a.createElement("span",{className:"c-grey-333 mr30"},null==o||null===(n=o.author)||void 0===n?void 0:n.name),g.a.createElement("span",{className:"c-grey-999"},null==o?void 0:o.time)),g.a.createElement(te.a,{value:null==o?void 0:o.content}),g.a.createElement("div",{className:gt.a.btns},g.a.createElement("div",{onClick:function(){return d(null==o?void 0:o.id)},className:null!=o&&o.user_praise?"c-light-primary":"c-grey-999"},g.a.createElement("i",{className:"iconfont icon-xiaodianzan2 mr3"}),g.a.createElement("span",null,null==o?void 0:o.praise_count)),g.a.createElement("div",{onClick:function(){var e;0!==(null==o||null===(e=o.children)||void 0===e?void 0:e.length)&&(l(null),y(!v))},style:{color:v?"#0152d9":"#999999"}},g.a.createElement("i",{className:"iconfont icon-xiaopinglun2 mr3"}),g.a.createElement("span",null,v?"收起评论":null==o||null===(r=o.children)||void 0===r?void 0:r.length)),g.a.createElement("div",{onClick:function(){y(!1),l(s===(null==o?void 0:o.id)?null:null==o?void 0:o.id)},style:{color:s===(null==o?void 0:o.id)?"#0152d9":"#999999"}},g.a.createElement("i",{className:"iconfont icon-huifu3 mr3"}),g.a.createElement("span",null,s===(null==o?void 0:o.id)?"收起回复":"回复"))),s===(null==o?void 0:o.id)&&g.a.createElement(vt,{id:null==o?void 0:o.id,cb:function(e,t){a(e,t),y(!0)}}),v&&g.a.createElement("div",{className:gt.a.secondLevelDiscuss},null==o||null===(i=o.children)||void 0===i?void 0:i.map((function(e){return g.a.createElement(bt,{thirdlyReply:c,setThirdlyReply:h,key:e.id,data:e,onReplyDiscuss:a})}))))))},Et=function(e){e.identifier;var t=e.active,n=e.onOk,r=Object(m.useState)(""),i=Object(u.a)(r,2),o=i[0],a=i[1],l=Object(m.useState)(1),h=Object(u.a)(l,2),d=h[0],f=h[1],v=Object(m.useState)([]),y=Object(u.a)(v,2),b=y[0],_=y[1],E=Object(m.useState)(0),x=Object(u.a)(E,2),w=x[0],S=x[1],k=Object(m.useState)(null),C=Object(u.a)(k,2),T=C[0],O=C[1],A=Object(m.useState)(null),L=Object(u.a)(A,2),D=L[0],I=L[1];Object(m.useEffect)((function(){M(1),f(1)}),[t]);var M=function(){var e=Object(c.a)(p.a.mark((function e(n){var r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ue({container_type:"QuestionSolutionArticle",container_identifier:t,limit:5,page:n});case 2:null!=(r=e.sent)&&r.comments&&(_((null==r?void 0:r.comments)||[]),f(n),S(null==r?void 0:r.disscuss_count));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),N=function(){var e=Object(c.a)(p.a.mark((function e(){var r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==o){e.next=3;break}return s.b.error("请输入内容"),e.abrupt("return");case 3:return e.next=5,fe({comments:{content:o},container_type:"QuestionSolutionArticle",container_identifier:t});case 5:null!=(r=e.sent)&&r.discuss&&(a(""),M(d),n());case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=Object(c.a)(p.a.mark((function e(n,r,i){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,de({container_type:"QuestionSolutionArticle",container_identifier:t,comments:{content:r,parent_id:n}});case 2:e.sent,O(null),I(null),M(d);case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),j=function(){var e=Object(c.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,he(t);case 2:e.sent,M(d);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return g.a.createElement("div",{className:pt.a.discuss},g.a.createElement("aside",{className:pt.a.reply,style:{borderWidth:w?1:0}},g.a.createElement(we.a,{defaultValue:o,id:"writeForumsReviewId",onChange:function(e){a(e)},placeholder:"我要回复...",height:240}),g.a.createElement(ht.a,null,g.a.createElement(dt.a,{flex:"1"}),g.a.createElement(dt.a,null,g.a.createElement(R.a,{type:"primary",size:"large",onClick:function(){return N()}},"发送")))),null==b?void 0:b.map((function(e){return g.a.createElement(_t,{secondReply:T,setSecondReply:O,thirdlyReply:D,setThirdlyReply:I,key:e.id,data:e,onReplyDiscuss:P,onPlusDiscuss:j})})),g.a.createElement(B.a,{className:pt.a.pagination,showTotal:function(e){return g.a.createElement("span",{style:{color:"#656F87"}},"共",g.a.createElement("span",{className:"c-light-primary"},e),"条数据")},current:d,onChange:function(e){f(e),M(e)},total:w,showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,pageSize:5}))},xt=n("hgre"),wt=function(e){var t,n,r,i,o,s,d,f,v,y,b=e.active,_=e.identifier,E=(e.onAssist,e.onEdit),w=e.onArticlesSkip,k=e.onClose,C=e.onOk,T=e.onDelete,O=e.detailsIndex,A=e.btnShowStatus,L=Object(m.useState)(!0),D=Object(u.a)(L,2),I=D[0],M=D[1],N=Object(m.useState)({}),P=Object(u.a)(N,2),j=P[0],B=P[1];Object(m.useEffect)((function(){b&&F()}),[b,O]);var F=function(){var e=Object(c.a)(p.a.mark((function e(){var t,n=arguments;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(!(n.length>0&&void 0!==n[0])||n[0])&&M(!0),e.next=4,Object(x.d)(_,{active:b});case 4:0===(null==(t=e.sent)?void 0:t.status)&&B((null==t?void 0:t.data)||{}),M(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),U=function(){var e=Object(c.a)(p.a.mark((function e(t){var n;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.g)(_,Object(h.a)({active:b},t));case 2:0===(null==(n=e.sent)?void 0:n.status)&&(F(!1),C());case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),G=function(){var e=Object(c.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.c)(_,{active:null==t?void 0:t.id});case 2:0===e.sent.status&&(F(!1),C());case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return g.a.createElement("div",{className:it.a.listDetails},g.a.createElement(nt.a,{className:"pt20 pl20 pr20",loading:I,active:!0,paragraph:{rows:5}},g.a.createElement("div",{className:it.a.head},g.a.createElement("div",{className:it.a.name},g.a.createElement("div",{title:null==j?void 0:j.name,className:it.a.title},null==j?void 0:j.name),(null==j?void 0:j.is_authority)&&g.a.createElement("div",{className:it.a.b},"官方"),(null==j?void 0:j.is_excellent)&&g.a.createElement("div",{className:it.a.a},"精选")),g.a.createElement("div",{className:it.a.tag},g.a.createElement("img",{src:S.a.IMG_SERVER+"/images/"+(null==j?void 0:j.image_url)}),g.a.createElement("div",{className:"c-grey-333 ml5 mr20 font14"},null==j?void 0:j.username),g.a.createElement("div",{style:{display:"inline-block",marginBottom:-2},className:"c-grey-999 mr20 font12"},"发布于",q()(null==j?void 0:j.created_at).format("YYYY-MM-DD")),g.a.createElement("span",null,g.a.createElement("img",{src:Pe.a}),g.a.createElement("span",null,null==j?void 0:j.praises_count)),g.a.createElement("span",null,g.a.createElement("img",{src:Ue.a}),g.a.createElement("span",null,null==j?void 0:j.discusses_count)),g.a.createElement("span",null,g.a.createElement("img",{src:ze.a}),g.a.createElement("span",null,null==j?void 0:j.viewed_count)),g.a.createElement("div",{className:it.a.btn},(Object(ve.v)()||(null==j?void 0:j.is_self))&&g.a.createElement(g.a.Fragment,null,g.a.createElement(R.a,{onClick:function(){return e=j,void l.a.confirm({centered:!0,width:500,okText:"确定",cancelText:"取消",title:"提示",icon:null,className:"custom-modal-divider",content:"确认要删除该题解吗?",onOk:function(){return T(e)}});var e},type:"primary",ghost:!0},"删除"),g.a.createElement(R.a,{onClick:function(){return E(j)},type:"primary",ghost:!0},"编辑")),Object(ve.v)()&&g.a.createElement(R.a,{onClick:function(){return U({is_authority:!(null!=j&&j.is_authority)})},type:"primary"},g.a.createElement("img",{src:lt.a}),null!=j&&j.is_authority?"取消":"设为","官方"),Object(ve.v)()&&g.a.createElement(R.a,{onClick:function(){return U({is_excellent:!(null!=j&&j.is_excellent)})},type:"primary"},g.a.createElement("img",{src:at.a}),null!=j&&j.is_excellent?"取消":"设为","精选")))),g.a.createElement("div",{className:it.a.scroll},(null==j||null===(t=j.videos)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.id)&&g.a.createElement("div",{className:it.a.video},g.a.createElement(a.a,{tip:"正在转码,请稍等...",spinning:!(null!=j&&null!==(r=j.videos)&&void 0!==r&&null!==(i=r[0])&&void 0!==i&&i.transcoded)},g.a.createElement(xt.a,{poster:null==j||null===(o=j.videos)||void 0===o||null===(s=o[0])||void 0===s?void 0:s.cover_url,src:(null==j||null===(d=j.videos)||void 0===d||null===(f=d[0])||void 0===f?void 0:f.play_url)||"",videoId:null==j||null===(v=j.videos)||void 0===v||null===(y=v[0])||void 0===y?void 0:y.id,logWatchHistory:function(){}}))),g.a.createElement(te.a,{className:it.a.html,value:(null==j?void 0:j.content)||""}),g.a.createElement("div",{onClick:function(){return G(j)},className:it.a.g},g.a.createElement("img",{className:"mr10",src:(null!=j&&j.user_liker,ut.a)}),g.a.createElement("span",null,null==j?void 0:j.praises_count)),g.a.createElement(Et,{onOk:function(){F(!1),C()},active:b,identifier:_})),g.a.createElement("div",{className:it.a.btns},g.a.createElement(R.a,{onClick:function(){return k()},type:"primary",ghost:!0},"关闭"),A[0]&&g.a.createElement(R.a,{onClick:function(e){return w(e,"prev")},style:{marginLeft:20},type:"primary"},"上一题解"),A[1]&&g.a.createElement(R.a,{onClick:function(e){return w(e,"next")},style:{marginLeft:20},type:"primary"},"下一题解"))))},St=n("3tLw"),kt=n.n(St),Ct=n("ek7X"),Tt=n("0NbB"),Ot=function(e){var t=e.identifier,n=e.tabStatus,r=e.setFilterListTotal,i=e.setListStatus,o={page:1,limit:10,total:0,search:"",save_search:"",sort_by:"updated_at",sort_direction:null},l=Object(m.useState)(Object(h.a)({},o)),d=Object(u.a)(l,2),f=d[0],v=d[1],y=Object(m.useState)(!1),b=Object(u.a)(y,2),_=b[0],E=b[1],w=Object(m.useState)(0),S=Object(u.a)(w,2),k=S[0],C=S[1],T=Object(m.useState)(1),O=Object(u.a)(T,2),A=O[0],L=O[1],R=Object(m.useState)(null),D=Object(u.a)(R,2),M=D[0],N=D[1],P=Object(m.useState)([]),j=Object(u.a)(P,2),F=j[0],U=j[1],G=Object(m.useState)([!0,!0]),z=Object(u.a)(G,2),H=z[0],V=z[1],W=Object(m.useState)(0),K=Object(u.a)(W,2),q=K[0],X=K[1],Y=Object(m.useRef)(null);Object(m.useEffect)((function(){ne()}),[n]),Object(m.useEffect)((function(){J()}),[M]),Object(m.useEffect)((function(){Q(Object(h.a)({},o)),ne()}),[t]),Object(m.useEffect)((function(){return window.addEventListener("resize",Z),i(q),function(){window.removeEventListener("resize",Z)}}),[q]);var J=function(){var e=Object(c.a)(p.a.mark((function e(){var t,n;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(M){e.next=3;break}return V([!0,!0]),e.abrupt("return");case 3:t=[!0,!0],0===(n=null==F?void 0:F.findIndex((function(e){return e.id===M})))&&1===f.page&&(t[0]=!1),(f.page-1)*f.limit+(n+1)===f.total&&(t[1]=!1),V(t);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Z=function(){if(q){var e,t=window.innerWidth-(null===(e=Y.current)||void 0===e?void 0:e.clientWidth);C(t)}},Q=function(){var e=Object(c.a)(p.a.mark((function e(n){var i,o,a,s;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return E(!0),e.next=3,Object(x.f)(t,n);case 3:return 0===(null==(i=e.sent)?void 0:i.status)&&(U((null==i||null===(o=i.data)||void 0===o?void 0:o.articles)||[]),v(Object(h.a)(Object(h.a)({},n),{},{total:null==i||null===(a=i.data)||void 0===a?void 0:a.articles_count})),r(null==i||null===(s=i.data)||void 0===s?void 0:s.articles_count)),E(!1),e.abrupt("return",i);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ee=function(){var e;document.getElementsByClassName("btn-resize")[0].style.visibility="hidden";var t=window.innerWidth-(null===(e=Y.current)||void 0===e?void 0:e.clientWidth);C(t)},te=function(e){ee(),N(null==e?void 0:e.id),X(3)},ne=function(){document.getElementsByClassName("btn-resize")[0].style.visibility="visible",C(0),X(0),N(null)},re=function(){var e=Object(c.a)(p.a.mark((function e(n){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.c)(t,{active:null==n?void 0:n.id});case 2:0===e.sent.status&&(Q(f),L(A+1));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ie=function(){var e=Object(c.a)(p.a.mark((function e(n){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.e)(t,{active:null==n?void 0:n.id});case 2:0===e.sent.status&&(Q(f),L(A+1));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),oe=function(){var e=Object(c.a)(p.a.mark((function e(n){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.i)(t,{active:null==n?void 0:n.id});case 2:0===e.sent.status&&(ne(),Q(f));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ae=function(){var e=Object(c.a)(p.a.mark((function e(t,n){var r,i,o,a,l,c,u,d,m,g,y;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null==F?void 0:F.findIndex((function(e){return e.id===M})),console.log(r,n,22),"prev"!==n){e.next=21;break}if(void 0!==r){e.next=6;break}return s.b.warn("上一题解不存在"),e.abrupt("return");case 6:if(0!==r){e.next=19;break}if(1!==f.page){e.next=10;break}return s.b.warn("上一题解不存在"),e.abrupt("return");case 10:if(1===f.page){e.next=17;break}return f.page=f.page-1,v(Object(h.a)({},f)),e.next=15,Q(f);case 15:0===(null==(i=e.sent)?void 0:i.status)&&(c=null==i||null===(o=i.data)||void 0===o?void 0:o.articles[(null==i||null===(a=i.data)||void 0===a||null===(l=a.articles)||void 0===l?void 0:l.length)-1],N(null==c?void 0:c.id),console.log(t.target,555));case 17:e.next=21;break;case 19:u=F[r-1],N(null==u?void 0:u.id);case 21:if("next"!==n){e.next=39;break}if(void 0!==r){e.next=25;break}return s.b.warn("下一题解不存在"),e.abrupt("return");case 25:if((f.page-1)*f.limit+(r+1)!==f.total){e.next=28;break}return s.b.warn("下一题解不存在"),e.abrupt("return");case 28:if(r+1!==f.limit){e.next=37;break}return f.page=f.page+1,v(Object(h.a)({},f)),e.next=33,Q(f);case 33:0===(null==(d=e.sent)?void 0:d.status)&&(g=null==d||null===(m=d.data)||void 0===m?void 0:m.articles[0],N(null==g?void 0:g.id)),e.next=39;break;case 37:y=F[r+1],N(null==y?void 0:y.id);case 39:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return g.a.createElement("div",{className:Le.a.wrap,ref:Y},g.a.createElement("div",{className:Le.a.head},g.a.createElement("div",{className:Le.a.sort,onClick:function(){null===(null==f?void 0:f.sort_direction)?f.sort_direction="asc":"asc"===(null==f?void 0:f.sort_direction)?f.sort_direction="desc":"desc"===(null==f?void 0:f.sort_direction)&&(f.sort_direction=null),f.page=1,ne(),v(Object(h.a)({},f)),Q(f)}},g.a.createElement("span",null,"最新"),g.a.createElement("aside",null,g.a.createElement(Ct.a,{style:{color:"asc"===(null==f?void 0:f.sort_direction)?"#0152d9":"#bfbfbf"}}),g.a.createElement(Tt.a,{style:{color:"desc"===(null==f?void 0:f.sort_direction)?"#0152d9":"#bfbfbf"}}))),g.a.createElement(I.a.Search,{value:f.save_search,className:Le.a["oj-width-input"],placeholder:"搜索题解",onChange:function(e){f.save_search=e.target.value,v(Object(h.a)({},f))},onSearch:function(){f.page=1,f.search=null==f?void 0:f.save_search,ne(),v(Object(h.a)({},f)),Q(f)}}),g.a.createElement("div",{onClick:function(){ee(),X(1)},className:Le.a.btn},g.a.createElement("img",{src:kt.a}),"写题解")),g.a.createElement("div",{className:Le.a.listWarp},g.a.createElement(a.a,{spinning:_,className:"mt20"},null==F?void 0:F.map((function(e,t){var n=!0;return t+1===F.length&&0!==t&&(n=!1),g.a.createElement(He,{active:M,key:e.id,data:e,showLine:n,onClick:te,onAssist:re,onHide:ie})})),0===(null==F?void 0:F.length)&&g.a.createElement($.a,{customText:"暂时还没有相关数据哦!"}))),g.a.createElement(B.a,{className:Le.a.pagination,showTotal:function(e){return g.a.createElement("span",{style:{color:"#656F87"}},"共",g.a.createElement("span",{className:"c-light-primary"},e),"条数据")},total:f.total,showSizeChanger:!1,current:null==f?void 0:f.page,onChange:function(e){f.page=e,v(Object(h.a)({},f)),Q(f)},hideOnSinglePage:!0,showQuickJumper:!0}),q>0&&g.a.createElement("div",{className:Le.a.fixedRight,style:{width:k}},1===q&&g.a.createElement(tt,{identifier:t,onClose:ne,onOk:function(e){X(3),N(e),f.page=1,v(Object(h.a)({},f)),Q(f)}}),2===q&&g.a.createElement(tt,{active:M,identifier:t,onClose:ne,onOk:function(e){X(3),N(e),v(Object(h.a)({},f)),Q(f)}}),3===q&&g.a.createElement(wt,{btnShowStatus:H,onArticlesSkip:ae,detailsIndex:A,active:M,identifier:t,onClose:ne,onOk:function(e){v(Object(h.a)({},f)),Q(f)},onEdit:function(e){ee(),N(null==e?void 0:e.id),X(2)},onAssist:re,onDelete:oe})))},At=n("VEzc"),Lt=n.n(At),Rt=function(e){var t,n=e.visible,r=e.onVisible,i=e.value,l=e.onChange,d=e.setIndex,f=Object(m.useState)({page:1,per_page:30,total:0,tag_discipline_id:[],search:"",save_search:"",difficulty:null}),v=Object(u.a)(f,2),y=v[0],E=v[1],w=Object(m.useState)([]),S=Object(u.a)(w,2),k=S[0],C=S[1],T=Object(m.useState)([]),O=Object(u.a)(T,2),A=O[0],L=O[1],R=Object(m.useState)(!1),D=Object(u.a)(R,2),M=D[0],N=D[1],P=Object(m.useRef)([]),j=Object(m.useRef)(null),F=Object(b.i)();Object(m.useEffect)((function(){return null!=F&&F.id&&(j.current=setInterval((function(){U(30)}),3e4)),function(){clearInterval(j.current)}}),[]);var U=function(){var e=Object(c.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.r)(null==F?void 0:F.id,{practice_time:t});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();Object(m.useEffect)((function(){V(y),H()}),[]),Object(m.useEffect)((function(){return window.addEventListener("click",z),function(){window.removeEventListener("click",z)}}),[null==F?void 0:F.save_identifier,n]),Object(m.useEffect)((function(){var e=P.current.findIndex((function(e){return e.identifier===(null==F?void 0:F.save_identifier)})),t=P.current[e-1],n=P.current[e+1],r=document.getElementById("oj-prev"),i=document.getElementById("oj-next");r.style.display=t?"block":"none",i.style.display=n?"block":"none"}),[null==F?void 0:F.save_identifier,P.current]);var G=function(e,t){if(e.id===t)return e;for(var n=0,r=e;r=r.parentNode;n++){if(r.id===t)return r;if(r==document.documentElement)return!1}},z=function(){var e=Object(c.a)(p.a.mark((function e(t){var i,o,a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!G(t.target,"oj-drawer")&&n&&r(!1),i=P.current.findIndex((function(e){return e.identifier===(null==F?void 0:F.save_identifier)})),o=P.current[i-1],a=P.current[i+1],"oj-prev"!==t.target.id){e.next=14;break}if(o&&-1!==i){e.next=8;break}return s.b.warn("上一题不存在"),e.abrupt("return");case 8:return t.target.style.pointerEvents="none",t.target.style.cursor="not-allowed",e.next=12,W(null==o?void 0:o.identifier);case 12:d("0"),setTimeout((function(){t.target.style.pointerEvents="auto",t.target.style.cursor="pointer"}),400);case 14:if("oj-next"!==t.target.id&&"oj-modal-next"!==t.target.id){e.next=24;break}if(a&&-1!==i){e.next=18;break}return s.b.warn("下一题不存在"),e.abrupt("return");case 18:return t.target.style.pointerEvents="none",t.target.style.cursor="not-allowed",e.next=22,W(null==a?void 0:a.identifier);case 22:d("0"),setTimeout((function(){t.target.style.pointerEvents="auto",t.target.style.cursor="pointer"}),400);case 24:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();Object(m.useEffect)((function(){l(null==F?void 0:F.save_identifier);var e=A.findIndex((function(e){return e.some((function(e){return e.identifier===(null==F?void 0:F.save_identifier)}))}));E(-1===e?Object(h.a)(Object(h.a)({},y),{},{page:1}):Object(h.a)(Object(h.a)({},y),{},{page:e+1}))}),[null==F?void 0:F.save_identifier,A]);var H=function(){var e=Object(c.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(ce.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:t=e.sent,C(t.tag_disciplines||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=Object(c.a)(p.a.mark((function e(t){var n,r,i,o,a,s;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),e.next=3,Object(x.p)(t);case 3:if(null!=(n=e.sent)&&n.practices_list){for(i=null==n||null===(r=n.practices_list)||void 0===r?void 0:r.length,o=[],a=0;a<i;a+=null==y?void 0:y.per_page)o.push(null==n||null===(s=n.practices_list)||void 0===s?void 0:s.slice(a,a+(null==y?void 0:y.per_page)));E(Object(h.a)(Object(h.a)({},y),{},{total:null==n?void 0:n.practices_count})),P.current=(null==n?void 0:n.practices_list)||[],L(o)}N(!1);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),W=function(){var e=Object(c.a)(p.a.mark((function e(t,n){var r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(ce.a)("/api/practices/".concat(t,"/start"),{method:"get"});case 2:0===(null==(r=e.sent)?void 0:r.status)&&_.d.push("/problems/".concat(null==r?void 0:r.identifier,"/oj/").concat(t));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return g.a.createElement("div",{className:Lt.a.wrap,id:"oj-drawer",style:{left:n?0:-700}},g.a.createElement("div",{className:Lt.a.head},g.a.createElement("div",{className:Lt.a.title},"题目列表"),g.a.createElement(I.a.Search,{value:null==y?void 0:y.save_search,placeholder:"请输入题目名称搜索",style:{width:178,marginLeft:"auto",marginRight:10},onChange:function(e){y.save_search=e.target.value,E(Object(h.a)({},y))},onSearch:function(){y.page=1,y.search=y.save_search,E(Object(h.a)({},y)),V(y)}}),g.a.createElement(o.a,{value:null==y?void 0:y.tag_discipline_id,style:{width:210},mode:"multiple",placeholder:"选择知识点",showSearch:!1,showArrow:!0,getPopupContainer:function(e){return e.parentNode},maxTagTextLength:2,maxTagCount:2,onChange:function(e){y.page=1,y.tag_discipline_id=e,E(Object(h.a)({},y)),V(y)}},k.map((function(e){return g.a.createElement(o.a.Option,{key:e.id,value:e.id},e.name)}))),g.a.createElement(o.a,{style:{width:70,marginLeft:10},allowClear:!0,placeholder:"难度",getPopupContainer:function(e){return e.parentNode},value:null==y?void 0:y.difficulty,onChange:function(e){y.page=1,y.difficulty="number"==typeof e?e:null,E(Object(h.a)({},y)),V(y)}},g.a.createElement(o.a.Option,{value:1},"简单"),g.a.createElement(o.a.Option,{value:2},"适中"),g.a.createElement(o.a.Option,{value:3},"困难"))),g.a.createElement("div",{className:Lt.a.content},g.a.createElement(a.a,{spinning:M},null==A||null===(t=A[y.page-1])||void 0===t?void 0:t.map((function(e){return g.a.createElement("div",{key:e.identifier,className:Lt.a.list,onClick:function(t){return W(e.identifier,t)}},g.a.createElement("i",{style:{visibility:i===e.identifier?"visible":"hidden"},className:"iconfont icon-wancheng1 c-green-29b"}),g.a.createElement("span",{style:{fontWeight:i===e.identifier?"bold":400,color:i===e.identifier?"#ffffff":"#bac4cd"},title:null==e?void 0:e.name},e.name),1===(null==e?void 0:e.difficulty)&&g.a.createElement("b",{style:{color:"#2FA34F"}},"简单"),2===(null==e?void 0:e.difficulty)&&g.a.createElement("b",{style:{color:"#0152d9"}},"适中"),3===(null==e?void 0:e.difficulty)&&g.a.createElement("b",{style:{color:"#FA6400"}},"困难"))})))),g.a.createElement("div",{className:Lt.a.footer},g.a.createElement(B.a,{showTotal:function(e){return g.a.createElement("span",{style:{color:"#656F87"}},"共",g.a.createElement("span",{className:"c-light-primary"},e),"条数据")},total:y.total,pageSize:null==y?void 0:y.per_page,current:null==y?void 0:y.page,showSizeChanger:!1,onChange:function(e){y.page=e,E(Object(h.a)({},y))},showQuickJumper:!0,hideOnSinglePage:!0})))},Dt=function(e){var t,n=e.hack,r=e.onTriggerPraise,i=e.topicId,o=e.page,a=e.onPageChange,s=e.user,c=e.submitRecords,h=e.submitting,d=e.submitResult,f=Object(b.h)(),p=Object(m.useState)((null==f||null===(t=f.query)||void 0===t?void 0:t.tab)||"0"),v=Object(u.a)(p,2),y=v[0],_=v[1],E=Object(m.useState)(0),x=Object(u.a)(E,2),w=x[0],S=x[1],k=Object(m.useState)(0),C=Object(u.a)(k,2),T=C[0],O=C[1],A=Object(m.useState)(0),L=Object(u.a)(A,2),R=L[0],D=L[1],I=Object(m.useState)(),M=Object(u.a)(I,2),N=M[0],P=M[1],B=Object(m.useState)(!1),F=Object(u.a)(B,2),U=F[0],G=F[1];function z(e){var t=e.target.id;"3"!==y||t===y||1!==T&&2!==T?_(t):l.a.confirm({centered:!0,width:500,okText:"确定",cancelText:"取消",title:"注意",icon:null,className:"custom-modal-divider",content:"您正在编写题解,点击关闭后,您的题解内容将不会进行保存。",onOk:function(){_(t)}})}return Object(m.useEffect)((function(){return ie.a.subscribe("to-commit-info",(function(){_("1")}))}),[]),g.a.createElement("div",{className:j.a["left-panel"]},g.a.createElement("ul",{className:"".concat(j.a["s-navs"]," ").concat(j.a["bg-white"]," ").concat(j.a.b1)},g.a.createElement("li",{className:"mr40 current"},g.a.createElement("img",{onClick:function(){return G(!0)},src:ae.a})),g.a.createElement("li",{className:j.a["oj-mr"]},g.a.createElement("a",{className:"0"===y?j.a.active:"",id:"0",onClick:z},"任务描述")),g.a.createElement("li",{className:j.a["oj-mr"]},g.a.createElement("a",{className:"3"===y?j.a.active:"",id:"3",onClick:z},"题解",R?"(".concat(R,")"):"")),g.a.createElement("li",{className:j.a["oj-mr"]},g.a.createElement("a",{className:"2"===y?j.a.active:"",id:"2",onClick:z},"评论",w?"(".concat(w,")"):"")),g.a.createElement("li",null,g.a.createElement("a",{className:"1"===y?j.a.active:"",id:"1",onClick:z},"提交记录"))),g.a.createElement("div",{className:"".concat(j.a["tab-panel-body"]," ").concat("0"===y?"":"hide"),style:{padding:"0 0 0 16px"}},g.a.createElement(re,{hack:n,onTriggerPraise:r,toDiscuss:function(){_("2")}})),g.a.createElement("div",{className:"".concat(j.a["tab-panel-body"]," ").concat("1"===y?"":"hide")},null!=c&&c.records_count?g.a.createElement(Y,{page:o,onPageChange:a,topicId:i,submitting:h,submitRecords:c,submitResult:d}):g.a.createElement($.a,null)),g.a.createElement("div",{className:"".concat(j.a["tab-panel-body"]," ").concat("2"===y?"":"hide"),style:{padding:0}},g.a.createElement(Oe,{setDiscussTotal:S,user:s,identifier:n.identifier,hack:n,onTriggerPraise:r})),g.a.createElement("div",{className:"".concat(j.a["tab-panel-body"]," ").concat("3"===y?"":"hide"),style:{padding:0}},g.a.createElement(Ot,{setListStatus:O,setFilterListTotal:D,tabStatus:y,identifier:n.identifier})),g.a.createElement(Rt,{visible:U,setIndex:_,onVisible:function(e){return G(e)},value:N,onChange:function(e){return P(e)}}))},It=function(e){return 1===String(e).length?"0".concat(e):e},Mt=function(e){var t=e.className,n=void 0===t?"":t,r=e.onChange,i=Object(m.useState)(0),o=Object(u.a)(i,2),a=o[0],s=o[1];Object(m.useEffect)((function(){var e=setTimeout((function(){s(a+1e3)}),1e3);return r(a+1e3),function(){clearInterval(e)}}),[a]);var l=parseInt(a/36e5)||"00",c=parseInt(a%36e5/6e4)||"00",h=parseInt(a%6e4/1e3)||"00";return g.a.createElement("div",{className:n},It(l),":",It(c),":",It(h))},Nt=n("oFv4"),Pt=n.n(Nt),jt=n("S/kP"),Bt=n.n(jt),Ft=n("t/PP"),Ut=n.n(Ft),Gt=n("LvDl"),zt=n.n(Gt),Ht=n("P5Jw"),Vt=(d.a.Countdown,{Java:"java",C:"c",Python:"py","C++":"c"});function Wt(){return(new Date).getTime()}!function(e){e[e.SET_LOADING=0]="SET_LOADING",e[e.GET_DATA=1]="GET_DATA",e[e.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",e[e.SET_DATA=3]="SET_DATA",e[e.SET_DEBUGING=4]="SET_DEBUGING",e[e.SET_SUBMITING=5]="SET_SUBMITING",e[e.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",e[e.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",e[e.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",e[e.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",e[e.SET_PAGE=10]="SET_PAGE",e[e.GET_LANGUAGE=11]="GET_LANGUAGE",e[e.GET_DRAWER=12]="GET_DRAWER"}(Te||(Te={}));var Kt={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:"",languageValue:"",languageList:[],drawerData:[]};function qt(e,t){switch(t.type){case Te.GET_DATA:return Object(h.a)(Object(h.a)({},e),t.payload);case Te.SET_DATA:return Object(h.a)(Object(h.a)({},e),{},{data:t.payload});case Te.SET_LOADING:return Object(h.a)(Object(h.a)({},e),{},{loading:t.payload});case Te.GET_LANGUAGE:return Object(h.a)(Object(h.a)({},e),{},{languageList:t.payload});case Te.GET_DRAWER:return Object(h.a)(Object(h.a)({},e),{},{drawerData:t.payload});case Te.SET_SHOW_NOTE:return Object(h.a)(Object(h.a)({},e),{},{showNote:t.payload});case Te.SET_DEBUGING:return Object(h.a)(Object(h.a)({},e),{},{debuging:t.payload});case Te.SET_SUBMITING:return Object(h.a)(Object(h.a)({},e),{},{submitting:t.payload});case Te.GET_SUBMIT_RECORDS:return Object(h.a)(Object(h.a)({},e),{},{submitRecords:t.payload});case Te.SET_PAGE:return Object(h.a)(Object(h.a)({},e),{},{submitRecordPage:t.payload});case Te.SET_EXECUTE_MESSAGE:return Object(h.a)(Object(h.a)({},e),{},{executingMessage:t.payload});case Te.SET_EXECUTE_RESULT:case Te.SET_SUBMIT_RESULT:return Object(h.a)(Object(h.a)({},e),t.payload);default:throw new Error}}t.default=function(e){e.children;var t,n,r=Object(m.useReducer)(qt,Kt),i=Object(u.a)(r,2),o=i[0],d=i[1],f=Object(b.i)().id,k=Object(b.g)(),C=Object(b.h)(),O=o.languageValue,L=o.languageList,R=o.loading,D=o.data,I=o.debugResult,M=o.submitResult,N=o.submitRecords,P=o.submitRecordPage,j=o.showNote,B=o.debuging,F=o.submitting,U=o.executingMessage,G=Object(m.useState)("#FFF"),z=Object(u.a)(G,2),H=(z[0],z[1],Object(m.useState)(null)),V=Object(u.a)(H,2),W=(V[0],V[1],Object(m.useState)({})),K=Object(u.a)(W,2),q=(K[0],K[1],Object(m.useState)(!1)),X=Object(u.a)(q,2),Y=X[0],$=X[1],J=Object(m.useRef)(null),Z=Object(m.useRef)(null),Q=null==D?void 0:D.user,ee=null==D?void 0:D.hack;Object(m.useEffect)((function(){return Object(_.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),Object(_.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){Object(_.c)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),Object(_.c)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}}),[]),Object(m.useEffect)((function(){setTimeout((function(){document.title="在线刷题"}),400)})),Object(m.useEffect)((function(){if(Y){var e,t=document.getElementById("oj-next"),n=document.getElementById("oj-modal-next");"none"===(null==t||null===(e=t.style)||void 0===e?void 0:e.display)?n.style.display="none":n.style.display="block"}}),[Y]),Object(m.useEffect)((function(){function e(){return(e=Object(c.a)(p.a.mark((function e(){var t,n,r,i,o;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.m)(f);case 2:401===(t=e.sent).status?document.location.href="/user/login":(t.hack=t.practice,t.hack.code=T.Base64.decode(null==t||null===(n=t.hack)||void 0===n?void 0:n.code),o="".concat(null==Q?void 0:Q.login,"-language"),localStorage.getItem(o)&&(t.hack.language=localStorage.getItem(o)),Z.current=zt.a.cloneDeep(t),Z.current.language=null==t||null===(r=t.hack)||void 0===r?void 0:r.language,d({type:Te.GET_DATA,payload:{loading:!1,data:t}}),d({type:Te.SET_SUBMIT_RESULT,payload:{languageValue:null==t||null===(i=t.hack)||void 0===i?void 0:i.language}}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}f&&function(){e.apply(this,arguments)}()}),[f]),Object(m.useEffect)((function(){d({type:Te.SET_SUBMIT_RESULT,payload:{debugResult:void 0}}),ne(),$(!1)}),[f]),Object(m.useEffect)((function(){clearTimeout(J.current)}),[f]),Object(m.useEffect)((function(){!function(){te.apply(this,arguments)}()}),[f,P]);function te(){return(te=Object(c.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(x.o)(f,{limit:15,page:P});case 3:t=e.sent,d({type:Te.GET_SUBMIT_RECORDS,payload:t}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function ne(){return re.apply(this,arguments)}function re(){return(re=Object(c.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(x.w)(f);case 3:t=e.sent,d({type:Te.GET_LANGUAGE,payload:null==t?void 0:t.data}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function oe(e){return ae.apply(this,arguments)}function ae(){return(ae=Object(c.a)(p.a.mark((function e(t){var n,r,i,o,a,s;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null===(n=window)||void 0===n||null===(r=n.location)||void 0===r||null===(i=r.pathname)||void 0===i||null===(o=i.split("/"))||void 0===o?void 0:o[2])||f,e.next=3,Object(x.v)(a,t||{code:T.Base64.encode(ee.code),language:O});case 3:return s=e.sent,e.abrupt("return",s);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function se(){return(se=Object(c.a)(p.a.mark((function e(){var t,n,r,i,a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!F){e.next=2;break}return e.abrupt("return");case 2:return d({type:Te.SET_SUBMITING,payload:!0}),e.prev=3,ie.a.publish("to-commit-info"),e.next=7,oe();case 7:if(0!==e.sent.status){e.next=21;break}return a=function(){return(a=Object(c.a)(p.a.mark((function e(){var t,a,s,c,u,m;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.l)(f,"submit");case 2:if(t=e.sent,a=t.status,s=t.data,c=Wt(),u=c-r>1e3*(n+3),0===a||u||setTimeout(i,1e3),!u){e.next=12;break}return l.a.error({centered:!0,okText:"知道啦",content:"评测代码超时"}),d({type:Te.SET_SUBMITING,payload:!1}),e.abrupt("return");case 12:if(0!==a){e.next=19;break}return 2===s.status&&l.a.error({centered:!0,okText:"知道啦",content:"评测代码超时"}),e.next=16,Object(x.o)(f,{limit:15,page:P});case 16:m=e.sent,d({type:Te.SET_SUBMIT_RESULT,payload:Object(h.a)(Object(h.a)({},o),{},{submitResult:s,submitting:!1,submitRecords:m})}),0===(null==s?void 0:s.status)&&$(!0);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return a.apply(this,arguments)},t={},e.next=14,Object(x.s)(f,t);case 14:if(-1!==e.sent.status){e.next=18;break}return window.parent.location.href="/classrooms/".concat(C.query.coursesId,"/exercise/").concat(C.query.exercisesId,"/detail"),e.abrupt("return");case 18:n=ee.time_limit,r=Wt(),i();case 21:e.next=26;break;case 23:e.prev=23,e.t0=e.catch(3),d({type:Te.SET_SUBMITING,payload:!1});case 26:case"end":return e.stop()}}),e,null,[[3,23]])})))).apply(this,arguments)}function le(){return(le=Object(c.a)(p.a.mark((function e(){var t,n,r,i,a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o.debuging=!0,d({type:Te.SET_DEBUGING,payload:!0}),e.prev=2,e.next=5,oe();case 5:if(0!==e.sent.status){e.next=21;break}return a=function(){return(a=Object(c.a)(p.a.mark((function e(){var n,a,s,c,u,m;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.l)(f,"debug");case 2:if(n=e.sent,a=n.status,s=n.message,c=n.data,u=Wt(),m=u-r>1e3*(t+3),0===a||m||(d({type:Te.SET_EXECUTE_MESSAGE,payload:s}),setTimeout(i,1e3)),!m){e.next=13;break}return l.a.error({centered:!0,okText:"知道啦",content:"调试代码超时"}),d({type:Te.SET_DEBUGING,payload:!1}),e.abrupt("return");case 13:0===a&&(d({type:Te.SET_DEBUGING,payload:!1}),2===c.status&&l.a.error({centered:!0,okText:"知道啦",content:"调试代码超时"}),d({type:Te.SET_EXECUTE_RESULT,payload:Object(h.a)(Object(h.a)({},o),{},{debugResult:c,debuging:!1})}));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return a.apply(this,arguments)},t=ee.time_limit,n={input:encodeURIComponent(D.test_case.input)},e.next=13,Object(x.h)(f,n);case 13:if(-1!==e.sent.status){e.next=17;break}return window.parent.location.href="/classrooms/".concat(C.query.coursesId,"/exercise/").concat(C.query.exercisesId,"/detail"),e.abrupt("return");case 17:r=Wt(),i(),e.next=22;break;case 21:d({type:Te.SET_DEBUGING,payload:!1});case 22:e.next=27;break;case 24:e.prev=24,e.t0=e.catch(2),console.log(e.t0);case 27:return e.prev=27,e.finish(27);case 29:case"end":return e.stop()}}),e,null,[[2,24,27,29]])})))).apply(this,arguments)}function ce(e){var t;clearTimeout(J.current),J.current=setTimeout((function(){var t;oe({code:T.Base64.encode(e),language:null==Z||null===(t=Z.current)||void 0===t?void 0:t.language})}),2e3),d({type:Te.SET_DATA,payload:Object(h.a)(Object(h.a)({},null==Z?void 0:Z.current),{},{hack:Object(h.a)(Object(h.a)({},null==Z||null===(t=Z.current)||void 0===t?void 0:t.hack),{},{code:e})})})}var ue=function(){var e=Object(c.a)(p.a.mark((function e(t){var n,r,i,o;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d({type:Te.SET_LOADING,payload:!0}),e.next=3,oe();case 3:if(0!==e.sent.status){e.next=14;break}return d({type:Te.SET_SUBMIT_RESULT,payload:{languageValue:t}}),Z.current.language=t,n="".concat(null==Q?void 0:Q.login,"-language"),localStorage.setItem(n,t),e.next=11,Object(x.w)(f);case 11:0===(r=e.sent).status&&(o=null==r||null===(i=r.data)||void 0===i?void 0:i.find((function(e){return e.language===t})),ce(T.Base64.decode(o.code))),setTimeout((function(){d({type:Te.SET_LOADING,payload:!1})}),300);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function he(){return(he=Object(c.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(x.q)(f,{language:O});case 3:401===(t=e.sent).status?k.replace("/login",{from:C.pathname}):(ce(T.Base64.decode(t.code)),ne()),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function de(){return(de=Object(c.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.b)(f,t);case 2:d({type:Te.GET_DATA,payload:{showNote:!1,data:Object(h.a)(Object(h.a)({},D),{},{hack:Object(h.a)(Object(h.a)({},ee),{},{notes:t.notes})})}});case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var fe={input:null==D||null===(t=D.test_case)||void 0===t?void 0:t.input,language:null==ee?void 0:ee.language,code:null==ee?void 0:ee.code,title:"main."+Vt[null==ee?void 0:ee.language],modify_code:null==ee?void 0:ee.modify_code,notes:null==ee?void 0:ee.notes,debugResult:I,debuging:B,submitting:F,executingMessage:U,id:f,languageValue:O,languageList:L,onChangeLanguage:ue,onCancelNote:function(){d({type:Te.SET_SHOW_NOTE,payload:!1})},onAddNote:function(e){return de.apply(this,arguments)},showNote:j,onShowNote:function(){d({type:Te.SET_SHOW_NOTE,payload:!0})},onSubmitCode:function(){return se.apply(this,arguments)},onChangeCode:ce,onChangeInput:function(e){var t=e.target.value;d({type:Te.SET_DATA,payload:Object(h.a)(Object(h.a)({},D),{},{test_case:{input:t}})})},onDebugCode:function(){return le.apply(this,arguments)},onResetCode:function(){return he.apply(this,arguments)},onSyncCode:function(){l.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:g.a.createElement("p",null,"初始代码有修改,更新后将覆盖现有代码哦~ ",g.a.createElement("br",null),"请将您编辑的代码保存至本地,以防丢失"),onOk:function(){return Object(c.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.t)(f,{language:O});case 2:401===(t=e.sent).status?k.replace("/login",{from:C.pathname}):ce(T.Base64.decode(t.code));case 4:case"end":return e.stop()}}),e)})))()}})},onUpdateCode:oe};function pe(){return(pe=Object(c.a)(p.a.mark((function e(){var t,n,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(x.u)(ee.id,{container_type:"Hack",type:1});case 2:t=e.sent,n=t.praise_count,r=Object(h.a)(Object(h.a)({},D),{},{hack:Object(h.a)(Object(h.a)({},ee),{},{praises_count:n,user_praise:!ee.user_praise})}),d({type:Te.SET_DATA,payload:r});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var me={topicId:f,submitResult:M,submitRecords:N,submitting:F,page:P,onPageChange:function(e){d({type:Te.SET_PAGE,payload:e})},hack:ee,user:null==D?void 0:D.user,onTriggerPraise:function(){return pe.apply(this,arguments)}};return console.log(D,null==Z?void 0:Z.current,"data--------"),g.a.createElement(g.a.Fragment,null,g.a.createElement(a.a,{className:"oj-custom-large-spin",size:"large",spinning:R},D?g.a.createElement("div",{className:"oj-custom-warp"},g.a.createElement("header",{className:A.a.header,style:{minWidth:1200}},g.a.createElement("div",null,g.a.createElement("img",{src:"".concat(S.a.IMG_SERVER,"/images/").concat(Q.image_url),alt:"user",width:30}),g.a.createElement("span",null,Q.name)),g.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},g.a.createElement("div",null,ee.name),g.a.createElement(Mt,{onChange:function(e){},className:"font12 c-grey-999"})),g.a.createElement(Ht.CopyToClipboard,{text:"".concat(null===(n=window.location)||void 0===n?void 0:n.origin,"/problems/").concat(ee.identifier,"/share"),onCopy:function(){return s.b.success("复制题目链接成功")}},g.a.createElement("span",{className:A.a.btn_back,style:{marginRight:10,cursor:"pointer"}}," ",g.a.createElement("i",{className:"iconfont icon-fenxiang1 font14 mr5"}),"分享题目")),ee.edit_privilege?g.a.createElement(E.a,{className:A.a.btn_back,to:"/problems/".concat(ee.identifier,"/ojedit"),style:{marginRight:10}}," ",g.a.createElement(v.a,null)," 编辑"):null,g.a.createElement(E.a,{className:A.a.btn_back,to:"/problems"}," ",g.a.createElement(y.a,null),"退出")),g.a.createElement(w.a,{hideResize:!0,className:"my-problems oj-problems",leftChild:g.a.createElement(Dt,me),rightChild:g.a.createElement(Yt,fe)})):null),g.a.createElement(l.a,{centered:!0,closable:!1,width:680,footer:null,visible:Y,className:"oj-modal"},g.a.createElement("section",{className:"oj-modal-content"},g.a.createElement("div",{className:"oj-modal-head"},g.a.createElement("img",{src:Pt.a,alt:""}),g.a.createElement("i",{onClick:function(){return $(!1)},className:"iconfont icon-guanbi1"})),g.a.createElement("aside",null,g.a.createElement("img",{className:"mr30",src:Ut.a}),"运行时间: ",g.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},null==M?void 0:M.execute_time,"s"),"优于",g.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(null==M?void 0:M.time_better_than)||100,"%"),"的用户"),g.a.createElement("aside",{className:"mb50"},g.a.createElement("img",{src:Bt.a,className:"mr30"}),g.a.createElement("span",{className:"oj-modal-tt"},g.a.createElement("span",null,g.a.createElement("span",null,"占用内存: "),g.a.createElement("span",{className:"c-light-primary"},null==M?void 0:M.execute_memory,"kb")),g.a.createElement("span",null,g.a.createElement("span",null))),"优于",g.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(null==M?void 0:M.memory_better_than)||100,"%"),"的用户"),g.a.createElement("div",{id:"oj-modal-next",className:"oj-modal-btn"},"进入下一题"))))};function Xt(e){var t=e.languageValue,n=e.languageList,r=e.onChangeLanguage,i=(e.title,e.modify_code,e.onSyncCode,e.onShowCodeSetting),a=e.onResetCode;Object(b.h)();return g.a.createElement("div",{className:"action-bar"},g.a.createElement(o.a,{className:"oj-select",value:t,style:{width:100},placeholder:"选择语言",onChange:r},null==n?void 0:n.map((function(e){return g.a.createElement(o.a.Option,{key:e.language,value:e.language},e.language)}))),g.a.createElement("span",null),g.a.createElement("a",{title:"恢复初始代码",onClick:function(){l.a.confirm({title:"恢复初始代码",icon:g.a.createElement(k.a,null),content:"你在本文件中修改的内容将丢失,是否确定重新加载初始代码?",centered:!0,okText:"确定",cancelText:"取消",onOk:a})}},g.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),g.a.createElement("a",{onClick:i},g.a.createElement("i",{className:"iconfont icon-shezhi"})))}function Yt(e){var t=e.id,n=e.input,o=e.showNote,a=(e.onShowNote,e.notes),s=e.onCancelNote,l=e.onAddNote,c=e.debugResult,u=e.language,h=e.debuging,d=e.submitting,f=e.executingMessage,p=e.code,m=e.onSubmitCode,v=e.onDebugCode,y=e.onChangeCode,b=e.onChangeInput,_=(e.onUpdateCode,Object(i.a)(e,["id","input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode"]));var E={id:t,input:n,debugResult:c,debuging:h,submitting:d,executingMessage:f,onDebugCode:v,onChangeCode:y,onSubmitCode:m,onChangeInput:b};return g.a.createElement("div",{className:"right-panel"},g.a.createElement(C.a,{language:u,value:p,onChange:y,ActionBarRender:function(e){return g.a.createElement(Xt,Object(r.a)({},_,{onShowCodeSetting:e}))}}),g.a.createElement("div",{className:"note-form-area ".concat(o?"active":"")},g.a.createElement(N,{onCancel:s,notes:a,callback:l})),g.a.createElement(L.b,E))}},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/tree/DirectoryTree.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/utils/treeUtil.js because of ./node_modules/antd/es/tree/DirectoryTree.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";var r=n("rePB"),i=n("Ff2n"),o=n("VTBJ"),a=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"),m=n("OZM5"),g=function(e){var t=e.prefixCls,n=e.level,i=e.isStart,o=e.isEnd;if(!n)return null;for(var a="".concat(t,"-indent-unit"),s=[],l=0;l<n;l+=1){var c;s.push(h.createElement("span",{key:l,className:f()(a,(c={},Object(r.a)(c,"".concat(a,"-start"),i[l+1]),Object(r.a)(c,"".concat(a,"-end"),o[l+1]),Object(r.a)(c,"".concat(a,"-end-first-level"),!l&&o[0]),c))}))}return h.createElement("span",{"aria-hidden":"true",className:"".concat(t,"-indent")},s)},v=n("815F"),y=function(e){Object(c.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).state={dragNodeHighlight:!1},e.onSelectorClick=function(t){(0,e.props.context.onNodeClick)(t,Object(v.b)(e.props)),e.isSelectable()?e.onSelect(t):e.onCheck(t)},e.onSelectorDoubleClick=function(t){(0,e.props.context.onNodeDoubleClick)(t,Object(v.b)(e.props))},e.onSelect=function(t){if(!e.isDisabled()){var n=e.props.context.onNodeSelect;t.preventDefault(),n(t,Object(v.b)(e.props))}},e.onCheck=function(t){if(!e.isDisabled()){var n=e.props,r=n.disableCheckbox,i=n.checked,o=e.props.context.onNodeCheck;if(e.isCheckable()&&!r){t.preventDefault();var a=!i;o(t,Object(v.b)(e.props),a)}}},e.onMouseEnter=function(t){(0,e.props.context.onNodeMouseEnter)(t,Object(v.b)(e.props))},e.onMouseLeave=function(t){(0,e.props.context.onNodeMouseLeave)(t,Object(v.b)(e.props))},e.onContextMenu=function(t){(0,e.props.context.onNodeContextMenu)(t,Object(v.b)(e.props))},e.onDragStart=function(t){var n=e.props.context.onNodeDragStart;t.stopPropagation(),e.setState({dragNodeHighlight:!0}),n(t,Object(l.a)(e));try{t.dataTransfer.setData("text/plain","")}catch(e){}},e.onDragEnter=function(t){var n=e.props.context.onNodeDragEnter;t.preventDefault(),t.stopPropagation(),n(t,Object(l.a)(e))},e.onDragOver=function(t){var n=e.props.context.onNodeDragOver;t.preventDefault(),t.stopPropagation(),n(t,Object(l.a)(e))},e.onDragLeave=function(t){var n=e.props.context.onNodeDragLeave;t.stopPropagation(),n(t,Object(l.a)(e))},e.onDragEnd=function(t){var n=e.props.context.onNodeDragEnd;t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,Object(l.a)(e))},e.onDrop=function(t){var n=e.props.context.onNodeDrop;t.preventDefault(),t.stopPropagation(),e.setState({dragNodeHighlight:!1}),n(t,Object(l.a)(e))},e.onExpand=function(t){(0,e.props.context.onNodeExpand)(t,Object(v.b)(e.props))},e.setSelectHandle=function(t){e.selectHandle=t},e.getNodeState=function(){var t=e.props.expanded;return e.isLeaf()?null:t?"open":"close"},e.hasChildren=function(){var t=e.props.eventKey;return!!((e.props.context.keyEntities[t]||{}).children||[]).length},e.isLeaf=function(){var t=e.props,n=t.isLeaf,r=t.loaded,i=e.props.context.loadData,o=e.hasChildren();return!1!==n&&(n||!i&&!o||i&&r&&!o)},e.isDisabled=function(){var t=e.props.disabled;return!(!e.props.context.disabled&&!t)},e.isCheckable=function(){var t=e.props.checkable,n=e.props.context.checkable;return!(!n||!1===t)&&n},e.syncLoadData=function(t){var n=t.expanded,r=t.loading,i=t.loaded,o=e.props.context,a=o.loadData,s=o.onNodeLoad;r||a&&n&&!e.isLeaf()&&(e.hasChildren()||i||s(Object(v.b)(e.props)))},e.renderSwitcher=function(){var t=e.props,n=t.expanded,r=t.switcherIcon,i=e.props.context,a=i.prefixCls,s=i.switcherIcon,l=r||s;if(e.isLeaf())return h.createElement("span",{className:f()("".concat(a,"-switcher"),"".concat(a,"-switcher-noop"))},"function"==typeof l?l(Object(o.a)(Object(o.a)({},e.props),{},{isLeaf:!0})):l);var c=f()("".concat(a,"-switcher"),"".concat(a,"-switcher_").concat(n?"open":"close"));return h.createElement("span",{onClick:e.onExpand,className:c},"function"==typeof l?l(Object(o.a)(Object(o.a)({},e.props),{},{isLeaf:!1})):l)},e.renderCheckbox=function(){var t=e.props,n=t.checked,r=t.halfChecked,i=t.disableCheckbox,o=e.props.context.prefixCls,a=e.isDisabled(),s=e.isCheckable();if(!s)return null;var l="boolean"!=typeof s?s:null;return h.createElement("span",{className:f()("".concat(o,"-checkbox"),n&&"".concat(o,"-checkbox-checked"),!n&&r&&"".concat(o,"-checkbox-indeterminate"),(a||i)&&"".concat(o,"-checkbox-disabled")),onClick:e.onCheck},l)},e.renderIcon=function(){var t=e.props.loading,n=e.props.context.prefixCls;return h.createElement("span",{className:f()("".concat(n,"-iconEle"),"".concat(n,"-icon__").concat(e.getNodeState()||"docu"),t&&"".concat(n,"-icon_loading"))})},e.renderSelector=function(){var t,n,r=e.state.dragNodeHighlight,i=e.props,o=i.title,a=i.selected,s=i.icon,l=i.loading,c=i.data,u=e.props.context,d=u.prefixCls,p=u.showIcon,m=u.icon,g=u.draggable,v=u.loadData,y=u.titleRender,b=e.isDisabled(),_="".concat(d,"-node-content-wrapper");if(p){var E=s||m;t=E?h.createElement("span",{className:f()("".concat(d,"-iconEle"),"".concat(d,"-icon__customize"))},"function"==typeof E?E(e.props):E):e.renderIcon()}else v&&l&&(t=e.renderIcon());n="function"==typeof o?o(c):y?y(c):o;var x=h.createElement("span",{className:"".concat(d,"-title")},n);return h.createElement("span",{ref:e.setSelectHandle,title:"string"==typeof o?o:"",className:f()("".concat(_),"".concat(_,"-").concat(e.getNodeState()||"normal"),!b&&(a||r)&&"".concat(d,"-node-selected"),!b&&g&&"draggable"),draggable:!b&&g||void 0,"aria-grabbed":!b&&g||void 0,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onContextMenu:e.onContextMenu,onClick:e.onSelectorClick,onDoubleClick:e.onSelectorDoubleClick,onDragStart:g?e.onDragStart:void 0},t,x)},e}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 e=this.props.selectable,t=this.props.context.selectable;return"boolean"==typeof e?e:t}},{key:"render",value:function(){var e,t=this.props,n=t.eventKey,o=t.className,a=t.style,s=t.dragOver,l=t.dragOverGapTop,c=t.dragOverGapBottom,u=t.isLeaf,d=t.isStart,p=t.isEnd,y=t.expanded,b=t.selected,_=t.checked,E=t.halfChecked,x=t.loading,w=t.domRef,S=t.active,k=t.onMouseMove,C=Object(i.a)(t,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),T=this.props.context,O=T.prefixCls,A=T.filterTreeNode,L=T.draggable,R=T.keyEntities,D=this.isDisabled(),I=Object(m.f)(C),M=(R[n]||{}).level,N=p[p.length-1];return h.createElement("div",Object.assign({ref:w,className:f()(o,"".concat(O,"-treenode"),(e={},Object(r.a)(e,"".concat(O,"-treenode-disabled"),D),Object(r.a)(e,"".concat(O,"-treenode-switcher-").concat(y?"open":"close"),!u),Object(r.a)(e,"".concat(O,"-treenode-checkbox-checked"),_),Object(r.a)(e,"".concat(O,"-treenode-checkbox-indeterminate"),E),Object(r.a)(e,"".concat(O,"-treenode-selected"),b),Object(r.a)(e,"".concat(O,"-treenode-loading"),x),Object(r.a)(e,"".concat(O,"-treenode-active"),S),Object(r.a)(e,"".concat(O,"-treenode-leaf-last"),N),Object(r.a)(e,"drag-over",!D&&s),Object(r.a)(e,"drag-over-gap-top",!D&&l),Object(r.a)(e,"drag-over-gap-bottom",!D&&c),Object(r.a)(e,"filter-node",A&&A(Object(v.b)(this.props))),e)),style:a,onDragEnter:L?this.onDragEnter:void 0,onDragOver:L?this.onDragOver:void 0,onDragLeave:L?this.onDragLeave:void 0,onDrop:L?this.onDrop:void 0,onDragEnd:L?this.onDragEnd:void 0,onMouseMove:k},I),h.createElement(g,{prefixCls:O,level:M,isStart:d,isEnd:p}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(h.Component),b=function(e){return h.createElement(p.a.Consumer,null,(function(t){return h.createElement(y,Object.assign({},e,{context:t}))}))};b.displayName="TreeNode",b.defaultProps={title:"---"},b.isTreeNode=1;t.a=b},Wtmd:
/*!**************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/c.svg ***!
\**************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/c.03ba6fd6.svg"},Wx9E:
/*!****************************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/Discuss/discuss-input-editor/index.less ***!
\****************************************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},XIdC:
/*!********************************************!*\
!*** ./node_modules/rc-switch/es/index.js ***!
\********************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";var r=n(/*! @babel/runtime/helpers/esm/defineProperty */"rePB"),i=n(/*! @babel/runtime/helpers/esm/slicedToArray */"ODXe"),o=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),a=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=a.forwardRef((function(e,t){var n,s=e.prefixCls,h=void 0===s?"rc-switch":s,d=e.className,f=e.checked,p=e.defaultChecked,m=e.disabled,g=e.loadingIcon,v=e.checkedChildren,y=e.unCheckedChildren,b=e.onClick,_=e.onChange,E=e.onKeyDown,x=Object(o.a)(e,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),w=Object(c.a)(!1,{value:f,defaultValue:p}),S=Object(i.a)(w,2),k=S[0],C=S[1];function T(e,t){var n=k;return m||(C(n=e),null==_||_(n,t)),n}var O=l()(h,d,(n={},Object(r.a)(n,"".concat(h,"-checked"),k),Object(r.a)(n,"".concat(h,"-disabled"),m),n));return a.createElement("button",Object.assign({},x,{type:"button",role:"switch","aria-checked":k,disabled:m,className:O,ref:t,onKeyDown:function(e){e.which===u.a.LEFT?T(!1,e):e.which===u.a.RIGHT&&T(!0,e),null==E||E(e)},onClick:function(e){var t=T(!k,e);null==b||b(t,e)}}),g,a.createElement("span",{className:"".concat(h,"-inner")},k?v:y))}));h.displayName="Switch",t.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(e,t,n){"use strict";n.r(t),n.d(t,"ResizableTextArea",(function(){return I}));var r=n("wx14"),i=n("1OyB"),o=n("vuIU"),a=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"),m=new Map;var g=new p.default((function(e){e.forEach((function(e){var t,n=e.target;null===(t=m.get(n))||void 0===t||t.forEach((function(e){return e(n)}))}))}));var v=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(l.Component),y=l.createContext(null);function b(e){var t=e.children,n=e.disabled,r=l.useRef(null),i=l.useRef(null),o=l.useContext(y),a=l.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),s=l.isValidElement(t)&&Object(d.c)(t),u=s?t.ref:null,h=l.useMemo((function(){return Object(d.a)(u,r)}),[u,r]),p=l.useRef(e);p.current=e;var b=l.useCallback((function(e){var t=p.current,n=t.onResize,r=t.data,i=e.getBoundingClientRect(),s=i.width,l=i.height,u=e.offsetWidth,h=e.offsetHeight,d=Math.floor(s),f=Math.floor(l);if(a.current.width!==d||a.current.height!==f||a.current.offsetWidth!==u||a.current.offsetHeight!==h){var m={width:d,height:f,offsetWidth:u,offsetHeight:h};a.current=m;var g=u===Math.round(s)?s:u,v=h===Math.round(l)?l:h,y=Object(c.a)(Object(c.a)({},m),{},{offsetWidth:g,offsetHeight:v});null==o||o(y,e,r),n&&Promise.resolve().then((function(){n(y,e)}))}}),[]);return l.useEffect((function(){var e,t,o=Object(f.a)(r.current)||Object(f.a)(i.current);return o&&!n&&(e=o,t=b,m.has(e)||(m.set(e,new Set),g.observe(e)),m.get(e).add(t)),function(){return function(e,t){m.has(e)&&(m.get(e).delete(t),m.get(e).size||(g.unobserve(e),m.delete(e)))}(o,b)}}),[r.current,n]),l.createElement(v,{ref:i},s?l.cloneElement(t,{ref:h}):t)}function _(e){var t=e.children;return Object(h.a)(t).map((function(t,n){var i=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(n);return l.createElement(b,Object(r.a)({},e,{key:i}),t)}))}_.Collection=function(e){var t=e.children,n=e.onBatchResize,r=l.useRef(0),i=l.useRef([]),o=l.useContext(y),a=l.useCallback((function(e,t,a){r.current+=1;var s=r.current;i.current.push({size:e,element:t,data:a}),Promise.resolve().then((function(){s===r.current&&(null==n||n(i.current),i.current=[])})),null==o||o(e,t,a)}),[n,o]);return l.createElement(y.Provider,{value:a},t)};var E,x=_,w=n("bT9E"),S=n("TSYQ"),k=n.n(S),C="\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",T=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],O={};function A(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&O[n])return O[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),a=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),s=T.map((function(e){return"".concat(e,":").concat(r.getPropertyValue(e))})).join(";"),l={sizingStyle:s,paddingSize:o,borderSize:a,boxSizing:i};return t&&n&&(O[n]=l),l}var L,R=n("Gytx"),D=n.n(R);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}(L||(L={}));var I=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var o;return Object(i.a)(this,n),(o=t.call(this,e)).nextFrameActionId=void 0,o.resizeFrameId=void 0,o.textArea=void 0,o.saveTextArea=function(e){o.textArea=e},o.handleResize=function(e){var t=o.state.resizeStatus,n=o.props,r=n.autoSize,i=n.onResize;t===L.NONE&&("function"==typeof i&&i(e),r&&o.resizeOnNextFrame())},o.resizeOnNextFrame=function(){cancelAnimationFrame(o.nextFrameActionId),o.nextFrameActionId=requestAnimationFrame(o.resizeTextarea)},o.resizeTextarea=function(){var e=o.props.autoSize;if(e&&o.textArea){var t=e.minRows,n=e.maxRows,r=function(e){var t=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;E||((E=document.createElement("textarea")).setAttribute("tab-index","-1"),E.setAttribute("aria-hidden","true"),document.body.appendChild(E)),e.getAttribute("wrap")?E.setAttribute("wrap",e.getAttribute("wrap")):E.removeAttribute("wrap");var i=A(e,t),o=i.paddingSize,a=i.borderSize,s=i.boxSizing,l=i.sizingStyle;E.setAttribute("style","".concat(l,";").concat(C)),E.value=e.value||e.placeholder||"";var c,u=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,d=E.scrollHeight;if("border-box"===s?d+=a:"content-box"===s&&(d-=o),null!==n||null!==r){E.value=" ";var f=E.scrollHeight-o;null!==n&&(u=f*n,"border-box"===s&&(u=u+o+a),d=Math.max(u,d)),null!==r&&(h=f*r,"border-box"===s&&(h=h+o+a),c=d>h?"":"hidden",d=Math.min(h,d))}return{height:d,minHeight:u,maxHeight:h,overflowY:c,resize:"none"}}(o.textArea,!1,t,n);o.setState({textareaStyles:r,resizeStatus:L.RESIZING},(function(){cancelAnimationFrame(o.resizeFrameId),o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:L.RESIZED},(function(){o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:L.NONE}),o.fixFirefoxAutoScroll()}))}))}))}))}},o.renderTextArea=function(){var e=o.props,t=e.prefixCls,n=void 0===t?"rc-textarea":t,i=e.autoSize,a=e.onResize,s=e.className,h=e.disabled,d=o.state,f=d.textareaStyles,p=d.resizeStatus,m=Object(w.a)(o.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),g=k()(n,s,Object(u.a)({},"".concat(n,"-disabled"),h));"value"in m&&(m.value=m.value||"");var v=Object(c.a)(Object(c.a)(Object(c.a)({},o.props.style),f),p===L.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(x,{onResize:o.handleResize,disabled:!(i||a)},l.createElement("textarea",Object(r.a)({},m,{className:g,style:v,ref:o.saveTextArea})))},o.state={textareaStyles:{},resizeStatus:L.NONE},o}return Object(o.a)(n,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&D()(e.autoSize,this.props.autoSize)||this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var e=this.textArea.selectionStart,t=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,t)}}catch(e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),n}(l.Component),M=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var r;Object(i.a)(this,n),(r=t.call(this,e)).resizableTextArea=void 0,r.focus=function(){r.resizableTextArea.textArea.focus()},r.saveTextArea=function(e){r.resizableTextArea=e},r.handleChange=function(e){var t=r.props.onChange;r.setValue(e.target.value,(function(){r.resizableTextArea.resizeTextarea()})),t&&t(e)},r.handleKeyDown=function(e){var t=r.props,n=t.onPressEnter,i=t.onKeyDown;13===e.keyCode&&n&&n(e),i&&i(e)};var o=void 0===e.value||null===e.value?e.defaultValue:e.value;return r.state={value:o},r}return Object(o.a)(n,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(I,Object(r.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),n}(l.Component);t.default=M},Z8dc:
/*!***************************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/index.less?modules ***!
\***************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___3U5jH",flex_space_between:"flex_space_between___10tgP",flex_box_vertical_center:"flex_box_vertical_center___1e5pu",flex_box_center_end:"flex_box_center_end___WDBuM",flex_box_column:"flex_box_column___3TSEG",listForm:"listForm___264Pu",scroll:"scroll___CK9uS",formWrap:"formWrap___2n6e2",btns:"btns___2wuct",main:"main___1WFqr",mainLoading:"mainLoading___1kJWi",tip:"tip___10JaH",proWarp:"proWarp___TMP84",pro:"pro___1CLLm",mainSucceed:"mainSucceed___3NYgf",del:"del___34rdE"}},ZD9Y:
/*!*********************************************************!*\
!*** ./src/components/tpi-code-setting/CodeSetting.tsx ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,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")),o=n(/*! react */"q1tI"),a=n.n(o),s=(n(/*! ./index.less */"lOMy"),i.a.Option);t.a=function(e){var t=e.onFontSizeChange,n=e.cmFontSize,o=e.cmCodeMode,l=e.onCodeModeChange,c=e.onTabToSpace,u=e.className,h=void 0===u?"":u,d=e.tabToSpace,f=e.children;return a.a.createElement("div",{className:"tpi-code-setting ".concat(h)},a.a.createElement("h3",null,"代码编辑器"),a.a.createElement("section",null,a.a.createElement("div",{className:"file-item"},a.a.createElement("b",null,"风格切换"),a.a.createElement(i.a,{bordered:!1,size:"small",value:o,onChange:l},a.a.createElement(s,{value:"vs"},"浅色风格"),a.a.createElement(s,{value:"vs-dark"},"深色风格"))),a.a.createElement("div",{className:"file-item"},a.a.createElement("b",null,"字体大小"),a.a.createElement(i.a,{bordered:!1,size:"small",value:n,onChange:t},a.a.createElement(s,{value:12},"12px"),a.a.createElement(s,{value:14},"14px"),a.a.createElement(s,{value:16},"16px"),a.a.createElement(s,{value:18},"18px"),a.a.createElement(s,{value:20},"20px"),a.a.createElement(s,{value:22},"22px"))),a.a.createElement("div",{className:"file-item"},a.a.createElement("b",null,"Tab转换"),a.a.createElement(r.a,{checked:d,onChange:c}))),a.a.createElement("h3",null,"快捷键"),a.a.createElement("section",null,a.a.createElement("div",{className:"file-item"},a.a.createElement("b",null,"保存代码"),a.a.createElement("span",null,"Ctrl + S")),a.a.createElement("div",{className:"file-item"},a.a.createElement("b",null,"唤出快捷键列表"),a.a.createElement("span",null,"F1 / Alt + F1")),a.a.createElement("div",{className:"file-item"},a.a.createElement("b",null,"左右缩进"),a.a.createElement("span",null,"Ctrl + ]/[")),a.a.createElement("div",{className:"file-item"},a.a.createElement("b",null,"跳到匹配的括号"),a.a.createElement("span",null,"Ctrl + Shift + \\")),a.a.createElement("div",{className:"file-item"},a.a.createElement("b",null,"转到行首"),a.a.createElement("span",null,"Home")),a.a.createElement("div",{className:"file-item"},a.a.createElement("b",null,"转到行尾"),a.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(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var r=n("k1fw"),i=(n("miYZ"),n("tsqr")),o=n("rAM+"),a=n("tJVT"),s=n("PpiC"),l=n("q1tI"),c=n.n(l),u=n("bdgK");function h(e,t,n,i,o){var a=t.getWordUntilPosition(n),s={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:a.startColumn,endColumn:a.endColumn},l=i.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}}));return o.map((function(e){l.push(Object(r.a)(Object(r.a)({},e),{},{range:s}))})),l}n("LvDl");function d(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}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 m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var r=p[e[n]];if(r)return r}return t[0]}return p[t]||t}var g=null;t.b=function(e){var t=e.width,p=void 0===t?"100%":t,v=e.height,y=void 0===v?"100%":v,b=e.value,_=e.language,E=void 0===_?"javascript":_,x=e.style,w=void 0===x?{}:x,S=e.options,k=void 0===S?{}:S,C=e.overrideServices,T=void 0===C?{}:C,O=e.theme,A=void 0===O?"vs-dark":O,L=e.onEditBlur,R=e.onSave,D=e.autoHeight,I=void 0!==D&&D,M=e.forbidCopy,N=void 0!==M&&M,P=e.onChange,j=void 0===P?f:P,B=e.editorDidMount,F=void 0===B?f:B,U=e.onFocus,G=void 0===U?f:U,z=e.filename,H=void 0===z?"educoder.txt":z,V=(Object(s.a)(e,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Object(l.useRef)()),W=Object(l.useRef)({}),K=Object(l.useRef)(),q=Object(l.useRef)(!1),X=Object(l.useRef)(),Y=Object(l.useState)(!1),$=Object(a.a)(Y,2),J=$[0],Z=$[1];function Q(){i.b.warn(decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"))}function ee(){var e=W.current.instance;if(e){var t=e.getSelection(),n=W.current.pastePos||{},r=new g.Range(n.startLineNumber||t.endLineNumber,n.startColumn||t.endColumn,n.endLineNumber||t.endLineNumber,n.endColumn||t.endColumn);setTimeout((function(){e.executeEdits("",[{range:r,text:""}])}),300)}}function te(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),R())}Object(l.useEffect)((function(){K.current&&clearTimeout(K.current),K.current=setTimeout((function(){!function(){var e=W.current.instance;if(null!=b&&e&&J){var t=e.getModel();t&&b!==t.getValue()&&(!0,t.setValue(b),e.layout(),!1)}}()}),500)}),[b,J,W.current]);var ne=function(){if(I&&W.current.instance){var e=W.current.instance.getContentHeight();ue(e<y?y:e)}else ue(y)};function re(e,t){var n,r,i=window.URL||window.webkitURL||window,o=new Blob([t]),a=document.createElementNS("http://www.w3.org/1999/xhtml","a");a.href=i.createObjectURL(o),a.download=e,n=a,(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(){ne()}),[ne]),Object(l.useEffect)((function(){V.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(e){try{g=e,W.current.instance=g.editor.create(V.current,{value:b,language:m(E),theme:A,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},T);var t=W.current.instance;if(F(t,g),setTimeout((function(){ne(),W.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){re(H||"educoder.txt",t.getValue())}})}),500),W.current.subscription=t.onDidChangeModelContent((function(e){q.current?clearTimeout(X.current):(ne(),j(t.getValue(),e)),X.current=setTimeout((function(){q.current=!1}),500)})),window.Monaco||function(e){var t={label:"ifelse",kind:e.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.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"];e.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(r,i){return{suggestions:h(e,r,i,n,[t])}}});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"];e.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(t,n){var i=[{label:"print",kind:e.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(e,t,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"];e.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(n,r){var o=[t,{label:"main",kind:e.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {","\t$0","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:e.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(e,n,r,i,o)}}})}(g),N&&(t.addCommand(g.KeyMod.CtrlCmd|g.KeyMod.Shift|g.KeyCode.KEY_V,(function(){return Q(),null})),t.addCommand(g.KeyMod.CtrlCmd|g.KeyCode.KEY_C,(function(){return Q(),null}))),window.Monaco=g,L&&t.onDidBlurEditorWidget((function(){L(t.getValue())})),G&&t.onDidFocusEditorText((function(){G(t.getValue())})),N){t.addCommand(g.KeyMod.CtrlCmd|g.KeyCode.KEY_V,(function(){return Q(),null})),t.onDidPaste((function(e){W.current.pastePos=e}));try{window.addEventListener("paste",ee)}catch(e){}}var n=function(){var e;return V.current&&(e=new u.default((function(e){var t,n=Object(o.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&W.current.instance.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(V.current),e}();return Z(!0),function(){var e=W.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),W.current.subscription&&W.current.subscription.dispose(),N&&window.removeEventListener("paste",ee),n.unobserve(V.current)}}catch(e){}}))}),[]),Object(l.useEffect)((function(){if(W.current.instance&&J)return document.addEventListener("keydown",te,!1),function(){document.removeEventListener("keydown",te)}}),[R,J]),Object(l.useEffect)((function(){var e=W.current.instance;if(e&&J){var t=m(E);g.editor.setModelLanguage(e.getModel(),t),console.log("language:",E,e.getModel(),t)}}),[E,J]),Object(l.useEffect)((function(){W.current.instance&&J&&g.editor.setTheme(A)}),[A,J]),Object(l.useEffect)((function(){var e=W.current.instance;e&&J&&(e.updateOptions(Object(r.a)({},k)),setTimeout((function(){e.getModel().updateOptions(Object(r.a)({},k))}),200))}),[JSON.stringify(k),J]),Object(l.useEffect)((function(){var e=W.current.instance;e&&J&&e.layout()}),[p,y,J]);var ie=Object(l.useState)(d(p)),oe=Object(a.a)(ie,2),ae=oe[0],se=(oe[1],Object(l.useState)(d(y))),le=Object(a.a)(se,2),ce=le[0],ue=le[1],he=Object(r.a)(Object(r.a)({},w),{},{width:ae,height:ce});return c.a.createElement("div",{className:"my-monaco-editor",ref:V,style:he})};function v(e){var t=e.width,i=void 0===t?"100%":t,s=e.height,h=void 0===s?"100%":s,f=e.original,p=e.modified,m=e.language,v=e.options,y=void 0===v?{}:v,b=Object(l.useRef)(),_=Object(l.useState)(null),E=Object(a.a)(_,2),x=E[0],w=E[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(e){var t=(g=e).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}));w(t);var n=function(e){var t;return b.current&&(t=new u.default((function(t){var n,r=Object(o.a)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&e.layout()}}catch(e){r.e(e)}finally{r.f()}}))).observe(b.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),n.unobserve(b.current)}}))}),[]),Object(l.useEffect)((function(){x&&x.setModel({original:g.editor.createModel(f,m),modified:g.editor.createModel(p,m)})}),[f,p,m,x]);var S={width:d(i),height:d(h)};return c.a.createElement("div",{className:"my-diff-editor",ref:b,style:S})}},ZpRC:
/*!*************************************************************************!*\
!*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***!
\*************************************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";function r(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function i(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function o(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return i(n.overflowY,t)||i(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function a(e,t,n,r,i,o,a,s){return o<e&&a>t||o>e&&a<t?0:o<=e&&s<=n||a>=t&&s>=n?o-e-r:a>t&&s<n||o<e&&s>n?a-t+i:0}var s=function(e,t){var n=window,i=t.scrollMode,s=t.block,l=t.inline,c=t.boundary,u=t.skipOverflowHiddenElements,h="function"==typeof c?c:function(e){return e!==c};if(!r(e))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,f=[],p=e;r(p)&&h(p);){if((p=p.parentElement)===d){f.push(p);break}null!=p&&p===document.body&&o(p)&&!o(document.documentElement)||null!=p&&o(p,u)&&f.push(p)}for(var m=n.visualViewport?n.visualViewport.width:innerWidth,g=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),_=b.height,E=b.width,x=b.top,w=b.right,S=b.bottom,k=b.left,C="start"===s||"nearest"===s?x:"end"===s?S:x+_/2,T="center"===l?k+E/2:"end"===l?w:k,O=[],A=0;A<f.length;A++){var L=f[A],R=L.getBoundingClientRect(),D=R.height,I=R.width,M=R.top,N=R.right,P=R.bottom,j=R.left;if("if-needed"===i&&x>=0&&k>=0&&S<=g&&w<=m&&x>=M&&S<=P&&k>=j&&w<=N)return O;var B=getComputedStyle(L),F=parseInt(B.borderLeftWidth,10),U=parseInt(B.borderTopWidth,10),G=parseInt(B.borderRightWidth,10),z=parseInt(B.borderBottomWidth,10),H=0,V=0,W="offsetWidth"in L?L.offsetWidth-L.clientWidth-F-G:0,K="offsetHeight"in L?L.offsetHeight-L.clientHeight-U-z:0;if(d===L)H="start"===s?C:"end"===s?C-g:"nearest"===s?a(y,y+g,g,U,z,y+C,y+C+_,_):C-g/2,V="start"===l?T:"center"===l?T-m/2:"end"===l?T-m:a(v,v+m,m,F,G,v+T,v+T+E,E),H=Math.max(0,H+y),V=Math.max(0,V+v);else{H="start"===s?C-M-U:"end"===s?C-P+z+K:"nearest"===s?a(M,P,D,U,z+K,C,C+_,_):C-(M+D/2)+K/2,V="start"===l?T-j-F:"center"===l?T-(j+I/2)+W/2:"end"===l?T-N+G+W:a(j,N,I,F,G+W,T,T+E,E);var q=L.scrollLeft,X=L.scrollTop;C+=X-(H=Math.max(0,Math.min(X+H,L.scrollHeight-D+K))),T+=q-(V=Math.max(0,Math.min(q+V,L.scrollWidth-I+W)))}O.push({el:L,top:H,left:V})}return O};function l(e){return e===Object(e)&&0!==Object.keys(e).length}t.a=function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(n?[]:s(e,t));if(!n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:l(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,i=e.top,o=e.left;r.scroll&&n?r.scroll({top:i,left:o,behavior:t}):(r.scrollTop=i,r.scrollLeft=o)}))}(s(e,r),r.behavior)}}},ZsLC:
/*!*******************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/index.less?modules ***!
\*******************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={"left-panel":"left-panel___FTwwW","tab-panel-body":"tab-panel-body___2YSOx",b1:"b1___3qx3o","oj-mr":"oj-mr___1GA9N","oj-width-input":"oj-width-input___3GkyP","s-navs":"s-navs___1fGGf","bg-white":"bg-white___1ZAy0",active:"active___39N6D"}},aRTE:
/*!*****************************************************!*\
!*** ./node_modules/qr.js/lib/ErrorCorrectLevel.js ***!
\*****************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports={L:1,M:0,Q:3,H:2}},bCnd:
/*!******************************!*\
!*** ./src/utils/urlTool.ts ***!
\******************************/
/*! exports provided: toStore, fromStore */
/*! exports used: fromStore, toStore */function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(/*! store */"je13"),i=n.n(r);function o(e,t){var n=i.a.get("__ec");n||(n={}),n[e]=t,i.a.set("__ec",n)}function a(e,t){var n=i.a.get("__ec");return n?void 0===n[e]?t:n[e]:t}},bT9E:
/*!*****************************************!*\
!*** ./node_modules/rc-util/es/omit.js ***!
\*****************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function i(e,t){var n=Object(r.a)({},e);return Array.isArray(t)&&t.forEach((function(e){delete n[e]})),n}},bdLU:
/*!***************************************************!*\
!*** ./src/pages/Question/OjProblem/interface.ts ***!
\***************************************************/
/*! exports provided: ExecuteStatus */
/*! exports used: ExecuteStatus */function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),function(e){e[e.NOMATCH=-1]="NOMATCH",e[e.OK=0]="OK",e[e.TIMEOUT=2]="TIMEOUT",e[e.PODFAILURE=3]="PODFAILURE",e[e.COMPILEFAILURE=4]="COMPILEFAILURE",e[e.EXECUTEFAILURE=5]="EXECUTEFAILURE"}(r||(r={}))},biw7:
/*!**********************************************************!*\
!*** ./node_modules/rc-table/es/context/TableContext.js ***!
\**********************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";var r=n(/*! react */"q1tI"),i=r.createContext(null);t.a=i},c5Ni:
/*!******************************************************!*\
!*** ./node_modules/codemirror/theme/blackboard.css ***!
\******************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},cDPC:
/*!*************************************************!*\
!*** ./src/components/SplitContainer/index.tsx ***!
\*************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";var r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),i=n(/*! react */"q1tI"),o=n.n(i);n(/*! ./index.less */"i3hx");t.a=function(e){var t=e.defaultX,n=void 0===t?"40%":t,a=e.leftChild,s=e.rightChild,l=e.className,c=e.hideResize,u=void 0!==c&&c,h=Object(i.useState)(n),d=Object(r.a)(h,2),f=d[0],p=d[1],m=Object(i.useRef)();Object(i.useEffect)((function(){function e(e){m.current&&p(e.pageX)}function t(){m.current=!1}return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),function(){window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}}),[]);var g="number"==typeof f&&.01!==f?"".concat(f,"px"):n,v="calc(100% - ".concat(u?"0px":"4px"," - ").concat(g,")");return o.a.createElement("div",{className:"split-panel-container ".concat(l)},o.a.createElement("section",{style:{width:g,display:.01===f?"none":""}},a),o.a.createElement("section",{className:"resize-x-bar",onMouseDown:function(){m.current=!0}},o.a.createElement("a",{className:"btn-resize"},o.a.createElement("svg",{width:"16",height:"13",viewBox:"0 0 16 13"},o.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"})))),o.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(e,t){for(var n={glog:function(e){if(e<1)throw new Error("glog("+e+")");return n.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return n.EXP_TABLE[e]},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;e.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(e,t,n){var r=n(/*! ./math */"dQei");function i(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var n=0;n<e.length&&0==e[n];)n++;this.num=new Array(e.length-n+t);for(var r=0;r<e.length-n;r++)this.num[r]=e[r+n]}i.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),n=0;n<this.getLength();n++)for(var o=0;o<e.getLength();o++)t[n+o]^=r.gexp(r.glog(this.get(n))+r.glog(e.get(o)));return new i(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=r.glog(this.get(0))-r.glog(e.get(0)),n=new Array(this.getLength()),o=0;o<this.getLength();o++)n[o]=this.get(o);for(o=0;o<e.getLength();o++)n[o]^=r.gexp(r.glog(e.get(o))+t);return new i(n,0).mod(e)}},e.exports=i},dejd:
/*!***********************************************************!*\
!*** ./src/components/markdown-editor/toolbar/index.less ***!
\***********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,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(e,t,n){"use strict";var r=n("Ff2n"),i=n("rePB"),o=n("1OyB"),a=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 m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){Object(i.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e){var t=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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){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(e){e.preventDefault()}var _=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,E=function(e){return null!=e},x=function(e,t){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},w=function(e){Object(s.a)(n,e);var t=v(n);function n(e){var r;Object(o.a)(this,n),(r=t.call(this,e)).onKeyDown=function(e){var t=r.props,n=t.onKeyDown,i=t.onPressEnter;if(e.keyCode===p.a.UP){var o=r.getRatio(e);r.up(e,o,null),r.stop()}else if(e.keyCode===p.a.DOWN){var a=r.getRatio(e);r.down(e,a,null),r.stop()}else e.keyCode===p.a.ENTER&&i&&i(e);if(r.recordCursorPosition(),r.lastKeyCode=e.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,[e].concat(l))}},r.onKeyUp=function(e){var t=r.props.onKeyUp;if(r.stop(),r.recordCursorPosition(),t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];t.apply(void 0,[e].concat(i))}},r.onChange=function(e){var t=r.props.onChange;r.state.focused&&(r.inputting=!0),r.rawInput=r.props.parser(r.getValueFromEvent(e)),r.setState({inputValue:r.rawInput}),t(r.toNumber(r.rawInput))},r.onMouseUp=function(){var e=r.props.onMouseUp;r.recordCursorPosition(),e&&e.apply(void 0,arguments)},r.onFocus=function(){var e;r.setState({focused:!0}),(e=r.props).onFocus.apply(e,arguments)},r.onBlur=function(){var e=r.props.onBlur;r.inputting=!1,r.setState({focused:!1});var t=r.getCurrentValidValue(r.state.inputValue),n=r.setValue(t,y);if(e){var i=r.input.value,o=r.getInputDisplayValue({focus:!1,value:n});r.input.value=o?Number(o):o,e.apply(void 0,arguments),r.input.value=i}},r.getRatio=function(e){var t=1;return e.metaKey||e.ctrlKey?t=.1:e.shiftKey&&(t=10),t},r.getFullNum=function(e){return isNaN(e)?e:/e/i.test(String(e))?Number(e).toFixed(18).replace(/\.?0+$/,""):e},r.getPrecision=function(e){if(E(r.props.precision))return r.props.precision;var t=String(e);if(t.indexOf("e-")>=0)return parseInt(t.slice(t.indexOf("e-")+2),10);var n=0;return t.indexOf(".")>=0&&(n=t.length-t.indexOf(".")-1),n},r.getInputDisplayValue=function(e){var t,n=e||r.state,i=n.focused,o=n.inputValue,a=n.value;null==(t=i?o:r.toPrecisionAsStep(a))&&(t="");var s=r.formatWrapper(t);return E(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(e){}},r.restoreByAfter=function(e){if(void 0===e)return!1;var t=r.input.value,n=t.lastIndexOf(e);if(-1===n)return!1;var i=r.cursorBefore.length;return r.lastKeyCode===p.a.DELETE&&r.cursorBefore.charAt(i-1)===e[0]?(r.fixCaret(i,i),!0):n+e.length===t.length&&(r.fixCaret(n,n),!0)},r.partRestoreByAfter=function(e){return void 0!==e&&Array.prototype.some.call(e,(function(t,n){var i=e.substring(n);return r.restoreByAfter(i)}))},r.isNotCompleteNumber=function(e){return isNaN(e)||""===e||null===e||e&&e.toString().indexOf(".")===e.toString().length-1},r.stop=function(){r.autoStepTimer&&clearTimeout(r.autoStepTimer)},r.down=function(e,t,n){r.pressingUpOrDown=!0,r.step("down",e,t,n)},r.up=function(e,t,n){r.pressingUpOrDown=!0,r.step("up",e,t,n)},r.saveInput=function(e){r.input=e};var i=e.value;void 0===i&&(i=e.defaultValue),r.state={focused:e.autoFocus};var a=r.getValidValue(r.toNumber(i));return r.state=g(g({},r.state),{},{inputValue:r.toPrecisionAsStep(a),value:a}),r}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.value,r=t.onChange,i=t.max,o=t.min,a=this.state.focused;if(e){if(!x(e.value,n)||!x(e.max,i)||!x(e.min,o)){var s,l=a?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&&e.max!==i&&"number"==typeof c&&c>i&&r&&r(i),"min"in this.props&&e.min!==o&&"number"==typeof c&&c<o&&r&&r(o)}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(e){}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(e){var t=e;return t=""===t?"":this.isNotCompleteNumber(parseFloat(t))?this.state.value:this.getValidValue(t),this.toNumber(t)}},{key:"getValueFromEvent",value:function(e){var t=e.target.value.trim().replace(/。/g,".");return E(this.props.decimalSeparator)&&(t=t.replace(this.props.decimalSeparator,".")),t}},{key:"getValidValue",value:function(e){var t=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(e);return isNaN(r)?e:(r<t&&(r=t),r>n&&(r=n),r)}},{key:"setValue",value:function(e,t){var n=this.props.precision,r=this.isNotCompleteNumber(parseFloat(e))?null:parseFloat(e),i=this.state.value,o=void 0===i?null:i,a=this.state.inputValue,s=void 0===a?null:a,l="number"==typeof r?r.toFixed(n):"".concat(r),c=r!==o||l!=="".concat(s);return"value"in this.props?(s=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:s},t)):this.setState({value:r,inputValue:this.toPrecisionAsStep(e)},t),c&&this.props.onChange(r),r}},{key:"getMaxPrecision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.props,r=n.precision,i=n.step;if(E(r))return r;var o=this.getPrecision(t),a=this.getPrecision(i),s=this.getPrecision(e);return e?Math.max(s,o+a):o+a}},{key:"getPrecisionFactor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.getMaxPrecision(e,t);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(e){return this.props.formatter?this.props.formatter(e):e}},{key:"toPrecisionAsStep",value:function(e){if(this.isNotCompleteNumber(e)||""===e)return e;var t=Math.abs(this.getMaxPrecision(e));return isNaN(t)?e.toString():Number(e).toFixed(t)}},{key:"toNumber",value:function(e){var t=this.props.precision,n=this.state.focused,r=e&&e.length>16&&n;return this.isNotCompleteNumber(e)||r?e:E(t)?Math.round(e*Math.pow(10,t))/Math.pow(10,t):Number(e)}},{key:"upStep",value:function(e,t){var n=this.props.step,r=this.getPrecisionFactor(e,t),i=Math.abs(this.getMaxPrecision(e,t)),o=((r*e+r*n*t)/r).toFixed(i);return this.toNumber(o)}},{key:"downStep",value:function(e,t){var n=this.props.step,r=this.getPrecisionFactor(e,t),i=Math.abs(this.getMaxPrecision(e,t)),o=((r*e-r*n*t)/r).toFixed(i);return this.toNumber(o)}},{key:"step",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0;this.stop(),t&&(t.persist(),t.preventDefault());var o=this.props;if(!o.disabled){var a=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(a)){var s=this["".concat(e,"Step")](a,r),l=s>o.max||s<o.min;s>o.max?s=o.max:s<o.min&&(s=o.min),this.setValue(s,null),this.setState({focused:!0},(function(){n.pressingUpOrDown=!1})),l||(this.autoStepTimer=setTimeout((function(){n[e](t,r,!0)}),i?200:600))}}}},{key:"fixCaret",value:function(e,t){if(void 0!==e&&void 0!==t&&this.input&&this.input.value)try{var n=this.input.selectionStart,r=this.input.selectionEnd;e===n&&t===r||this.input.setSelectionRange(e,t)}catch(e){}}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,o=t.disabled,a=t.readOnly,s=t.useTouch,l=t.autoComplete,c=t.upHandler,u=t.downHandler,d=t.className,p=t.max,m=t.min,g=t.style,v=t.title,_=t.onMouseEnter,E=t.onMouseLeave,x=t.onMouseOver,w=t.onMouseOut,S=t.required,k=t.onClick,C=t.tabIndex,T=t.type,O=t.placeholder,A=t.id,L=t.inputMode,R=t.pattern,D=t.step,I=t.maxLength,M=t.autoFocus,N=t.name,P=t.onPaste,j=t.onInput,B=Object(r.a)(t,["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"]),F=this.state,U=F.value,G=F.focused,z=f()(n,(e={},Object(i.a)(e,d,!!d),Object(i.a)(e,"".concat(n,"-disabled"),o),Object(i.a)(e,"".concat(n,"-focused"),G),e)),H={};Object.keys(B).forEach((function(e){"data-"!==e.substr(0,5)&&"aria-"!==e.substr(0,5)&&"role"!==e||(H[e]=B[e])}));var V=!a&&!o,W=this.getInputDisplayValue(null),K=(U||0===U)&&(isNaN(U)||Number(U)>=p)||o||a,q=(U||0===U)&&(isNaN(U)||Number(U)<=m)||o||a,X=f()("".concat(n,"-handler"),"".concat(n,"-handler-up"),Object(i.a)({},"".concat(n,"-handler-up-disabled"),K)),Y=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:z,style:g,title:v,onMouseEnter:_,onMouseLeave:E,onMouseOver:x,onMouseOut:w,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:X}),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:Y}),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":m,"aria-valuemax":p,"aria-valuenow":U,required:S,type:T,placeholder:O,onPaste:P,onClick:k,onMouseUp:this.onMouseUp,className:"".concat(n,"-input"),tabIndex:C,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:V?this.onKeyDown:y,onKeyUp:V?this.onKeyUp:y,autoFocus:M,maxLength:I,readOnly:a,disabled:o,max:p,min:m,step:D,name:N,title:v,id:A,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(W),pattern:R,inputMode:L,onInput:j},H))))}}]),n}(h.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_,min:-_,step:1,style:{},onChange:y,onKeyDown:y,onPressEnter:y,onFocus:y,onBlur:y,parser:function(e){return e.replace(/[^\w.-]+/g,"")},required:!1,autoComplete:"off"};var S=w;t.a=S},f4xo:
/*!********************************************!*\
!*** ./node_modules/qr.js/lib/8BitByte.js ***!
\********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r=n(/*! ./mode */"nVVt");function i(e){this.mode=r.MODE_8BIT_BYTE,this.data=e}i.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t<this.data.length;t++)e.put(this.data.charCodeAt(t),8)}},e.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(e,t,n){"use strict";var r=n("Ff2n"),i=n("1OyB"),o=n("vuIU"),a=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),m=n("qx4F"),g=n("4IlW");var v={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},y=Object.keys(v).filter((function(e){if("undefined"==typeof document)return!1;var t=document.getElementsByTagName("html")[0];return e in(t?t.style:{})}))[0],b=v[y];function _(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),n)}function E(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r):e.attachEvent&&e.detachEvent("on".concat(t),n)}var x=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},w=!("undefined"!=typeof window&&window.document&&window.document.createElement);function S(e){var t=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(e){return!1}}();return function(){var n,r=Object(l.a)(e);if(t){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={},C=function(e){Object(a.a)(n,e);var t=S(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).domFocus=function(){r.dom&&r.dom.focus()},r.removeStartHandler=function(e){e.touches.length>1||(r.startPos={x:e.touches[0].clientX,y:e.touches[0].clientY})},r.removeMoveHandler=function(e){if(!(e.changedTouches.length>1)){var t=e.currentTarget,n=e.changedTouches[0].clientX-r.startPos.x,i=e.changedTouches[0].clientY-r.startPos.y;(t===r.maskDom||t===r.handlerDom||t===r.contentDom&&function e(t,n,r,i){if(!n||n===document||n instanceof Document)return!1;if(n===t.parentNode)return!0;var o=Math.max(Math.abs(r),Math.abs(i))===Math.abs(i),a=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!!(o&&(!d||d&&(n.scrollTop>=s&&i<0||n.scrollTop<=0&&i>0))||a&&(!f||f&&(n.scrollLeft>=l&&r<0||n.scrollLeft<=0&&r>0)))&&e(t,n.parentNode,r,i)}(t,e.target,n,i))&&e.cancelable&&e.preventDefault()}},r.transitionEnd=function(e){var t=e.target;E(t,b,r.transitionEnd),t.style.transition=""},r.onKeyDown=function(e){if(e.keyCode===g.a.ESC){var t=r.props.onClose;e.stopPropagation(),t&&t(e)}},r.onWrapperTransitionEnd=function(e){var t=r.props,n=t.open,i=t.afterVisibleChange;e.target===r.contentWrapper&&e.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 e=r.props,t=e.open,n=e.width,i=e.height,o=r.getHorizontalBoolAndPlacementName(),a=o.isHorizontal,s=o.placementName,l=r.contentDom?r.contentDom.getBoundingClientRect()[a?"width":"height"]:0,c=(a?n:i)||l;r.setLevelAndScrolling(t,s,c)},r.setLevelTransform=function(e,t,n,i){var o=r.props,a=o.placement,s=o.levelMove,l=o.duration,c=o.ease,u=o.showMask;r.levelDom.forEach((function(o){o.style.transition="transform ".concat(l," ").concat(c),_(o,b,r.transitionEnd);var h=e?n:0;if(s){var d=function(e,t){var n="function"==typeof e?e(t):e;return Array.isArray(n)?2===n.length?n:[n[0],n[1]]:[n]}(s,{target:o,open:e});h=e?d[0]:d[1]||0}var f="number"==typeof h?"".concat(h,"px"):h,p="left"===a||"top"===a?f:"-".concat(f);p=u&&"right"===a&&i?"calc(".concat(p," + ").concat(i,"px)"):p,o.style.transform=h?"".concat(t,"(").concat(p,")"):""}))},r.setLevelAndScrolling=function(e,t,n){var i=r.props.onChange;if(!w){var o=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(m.a)(!0):0;r.setLevelTransform(e,t,n,o),r.toggleScrollingToDrawerAndBody(o)}i&&i(e)},r.toggleScrollingToDrawerAndBody=function(e){var t=r.props,n=t.getOpenCount,i=t.getContainer,o=t.showMask,a=t.open,s=i&&i(),l=n&&n();if(s&&s.parentNode===document.body&&o){var c=["touchstart"],u=[document.body,r.maskDom,r.handlerDom,r.contentDom];a&&"hidden"!==document.body.style.overflow?(e&&r.addScrollingEffect(e),1===l&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",u.forEach((function(e,t){e&&_(e,c[t]||"touchmove",t?r.removeMoveHandler:r.removeStartHandler,r.passive)}))):r.getCurrentDrawerSome()&&(l||(document.body.style.overflow=""),document.body.style.touchAction="",e&&r.remScrollingEffect(e),u.forEach((function(e,t){e&&E(e,c[t]||"touchmove",t?r.removeMoveHandler:r.removeStartHandler,r.passive)})))}},r.addScrollingEffect=function(e){var t=r.props,n=t.placement,i=t.duration,o=t.ease,a=t.getOpenCount,s=t.switchScrollingEffect;1===(a&&a())&&s();var l="width ".concat(i," ").concat(o),c="transform ".concat(i," ").concat(o);switch(r.dom.style.transition="none",n){case"right":r.dom.style.transform="translateX(-".concat(e,"px)");break;case"top":case"bottom":r.dom.style.width="calc(100% - ".concat(e,"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(e){var t,n=r.props,i=n.placement,o=n.duration,a=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(o," ").concat(a),u="transform ".concat(o," ").concat(a);switch(i){case"left":r.dom.style.width="100%",c="width 0s ".concat(a," ").concat(o);break;case"right":r.dom.style.transform="translateX(".concat(e,"px)"),r.dom.style.width="100%",c="width 0s ".concat(a," ").concat(o),r.maskDom&&(r.maskDom.style.left="-".concat(e,"px"),r.maskDom.style.width="calc(100% + ".concat(e,"px)"));break;case"top":case"bottom":r.dom.style.width="calc(100% + ".concat(e,"px)"),r.dom.style.height="100%",r.dom.style.transform="translateZ(0)",t="height 0s ".concat(a," ").concat(o)}clearTimeout(r.timeout),r.timeout=setTimeout((function(){r.dom&&(r.dom.style.transition="".concat(u,",").concat(t?"".concat(t,","):"").concat(c),r.dom.style.transform="",r.dom.style.width="",r.dom.style.height="")}))},r.getCurrentDrawerSome=function(){return!Object.keys(k).some((function(e){return k[e]}))},r.getLevelDom=function(e){var t=e.level,n=e.getContainer;if(!w){var i,o=n&&n(),a=o?o.parentNode:null;if(r.levelDom=[],"all"===t)(a?Array.prototype.slice.call(a.children):[]).forEach((function(e){"SCRIPT"!==e.nodeName&&"STYLE"!==e.nodeName&&"LINK"!==e.nodeName&&e!==o&&r.levelDom.push(e)}));else t&&(i=t,Array.isArray(i)?i:[i]).forEach((function(e){document.querySelectorAll(e).forEach((function(e){r.levelDom.push(e)}))}))}},r.getHorizontalBoolAndPlacementName=function(){var e=r.props.placement,t="left"===e||"right"===e;return{isHorizontal:t,placementName:"translate".concat(t?"X":"Y")}},r.state={_self:Object(d.a)(r)},r}return Object(o.a)(n,[{key:"componentDidMount",value:function(){var e=this;if(!w){var t=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return t=!0,null}}))}catch(e){}this.passive=!!t&&{passive:!1}}var n=this.props,r=n.open,i=n.getContainer,o=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&&(o&&o.parentNode===document.body&&(k[this.drawerId]=r),this.openLevelTransition(),this.forceUpdate((function(){e.domFocus()})))}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.open,r=t.getContainer,i=r&&r();n!==e.open&&(n&&this.domFocus(),i&&i.parentNode===document.body&&(k[this.drawerId]=!!n),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.getOpenCount,n=e.open,r=e.switchScrollingEffect,i="function"==typeof t&&t();delete k[this.drawerId],n&&(this.setLevelTransform(!1),document.body.style.touchAction=""),i||(document.body.style.overflow="",r(!0))}},{key:"render",value:function(){var e,t=this,n=this.props,i=n.className,o=n.children,a=n.style,s=n.width,l=n.height,c=(n.defaultOpen,n.open),d=n.prefixCls,f=n.placement,m=(n.level,n.levelMove,n.ease,n.duration,n.getContainer,n.handler),g=(n.onChange,n.afterVisibleChange,n.showMask),v=n.maskClosable,y=n.maskStyle,b=n.onClose,_=n.onHandleClick,E=n.keyboard,w=(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"])),S=!!this.dom&&c,k=p()(d,(e={},Object(h.a)(e,"".concat(d,"-").concat(f),!0),Object(h.a)(e,"".concat(d,"-open"),S),Object(h.a)(e,i||"",!!i),Object(h.a)(e,"no-mask",!g),e)),C=this.getHorizontalBoolAndPlacementName().placementName,T="left"===f||"top"===f?"-100%":"100%",O=S?"":"".concat(C,"(").concat(T,")"),A=m&&u.cloneElement(m,{onClick:function(e){m.props.onClick&&m.props.onClick(),_&&_(e)},ref:function(e){t.handlerDom=e}});return u.createElement("div",Object.assign({},w,{tabIndex:-1,className:k,style:a,ref:function(e){t.dom=e},onKeyDown:S&&E?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),g&&u.createElement("div",{className:"".concat(d,"-mask"),onClick:v?b:void 0,style:y,ref:function(e){t.maskDom=e}}),u.createElement("div",{className:"".concat(d,"-content-wrapper"),style:{transform:O,msTransform:O,width:x(s)?"".concat(s,"px"):s,height:x(l)?"".concat(l,"px"):l},ref:function(e){t.contentWrapper=e}},u.createElement("div",{className:"".concat(d,"-content"),ref:function(e){t.contentDom=e},onTouchStart:S&&g?this.removeStartHandler:void 0,onTouchMove:S&&g?this.removeMoveHandler:void 0},o),A))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t._self,i={prevProps:e};if(void 0!==n){var o=e.placement,a=e.level;o!==n.placement&&(r.contentDom=null),a!==n.level&&r.getLevelDom(e)}return i}}]),n}(u.Component);C.defaultProps={switchScrollingEffect:function(){}};var T=C;function O(e){var t=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(e){return!1}}();return function(){var n,r=Object(l.a)(e);if(t){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 A=function(e){Object(a.a)(n,e);var t=O(n);function n(e){var r;Object(i.a)(this,n),(r=t.call(this,e)).onHandleClick=function(e){var t=r.props,n=t.onHandleClick,i=t.open;if(n&&n(e),void 0===i){var o=r.state.open;r.setState({open:!o})}},r.onClose=function(e){var t=r.props,n=t.onClose,i=t.open;n&&n(e),void 0===i&&r.setState({open:!1})};var o=void 0!==e.open?e.open:!!e.defaultOpen;return r.state={open:o},"onMaskClick"in e&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),r}return Object(o.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=(t.defaultOpen,t.getContainer),i=t.wrapperClassName,o=t.forceRender,a=t.handler,s=Object(r.a)(t,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),l=this.state.open;if(!n)return u.createElement("div",{className:i,ref:function(t){e.dom=t}},u.createElement(T,Object.assign({},s,{open:l,handler:a,getContainer:function(){return e.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var h=!!a||o;return u.createElement(c.a,{visible:l,forceRender:h,getContainer:n,wrapperClassName:i},(function(t){var n=t.visible,i=t.afterClose,o=Object(r.a)(t,["visible","afterClose"]);return u.createElement(T,Object.assign({},s,o,{open:void 0!==n?n:l,afterVisibleChange:void 0!==i?i:s.afterVisibleChange,handler:a,onClose:e.onClose,onHandleClick:e.onHandleClick}))}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r={prevProps:e};return void 0!==n&&e.open!==n.open&&(r.open=e.open),r}}]),n}(u.Component);A.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 L=A;t.a=L},fcyK:
/*!********************************************************!*\
!*** ./src/pages/Problems/OjForm/CodePanel/index.less ***!
\********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},fyJ8:
/*!************************************************!*\
!*** ./node_modules/rc-table/es/Cell/index.js ***!
\************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";var r=n(/*! @babel/runtime/helpers/esm/defineProperty */"rePB"),i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),o=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),a=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(e,t){var n,l,d,f=e.prefixCls,p=e.className,m=e.record,g=e.index,v=e.dataIndex,y=e.render,b=e.children,_=e.component,E=void 0===_?"td":_,x=e.colSpan,w=e.rowSpan,S=e.fixLeft,k=e.fixRight,C=e.firstFixLeft,T=e.lastFixLeft,O=e.firstFixRight,A=e.lastFixRight,L=e.appendNode,R=e.additionalProps,D=void 0===R?{}:R,I=e.ellipsis,M=e.align,N=e.rowType,P=e.isSticky,j="".concat(f,"-cell");if(b)d=b;else{var B=Object(h.b)(m,v);if(d=B,y){var F=y(B,m,g);!function(e){return e&&"object"===Object(a.a)(e)&&!Array.isArray(e)&&!s.isValidElement(e)}(F)?d=F:(d=F.children,l=F.props)}}"object"!==Object(a.a)(d)||Array.isArray(d)||s.isValidElement(d)||(d=null),I&&(T||O)&&(d=s.createElement("span",{className:"".concat(j,"-content")},d));var U=l||{},G=U.colSpan,z=U.rowSpan,H=U.style,V=U.className,W=Object(o.a)(U,["colSpan","rowSpan","style","className"]),K=void 0!==G?G:x,q=void 0!==z?z:w;if(0===K||0===q)return null;var X={},Y="number"==typeof S,$="number"==typeof k;Y&&(X.position="sticky",X.left=S),$&&(X.position="sticky",X.right=k);var J,Z={};M&&(Z.textAlign=M);var Q=!0===I?{showTitle:!0}:I;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 ee,te=Object(i.a)(Object(i.a)(Object(i.a)({title:J},W),D),{},{colSpan:K&&1!==K?K:null,rowSpan:q&&1!==q?q:null,className:c()(j,p,(n={},Object(r.a)(n,"".concat(j,"-fix-left"),Y),Object(r.a)(n,"".concat(j,"-fix-left-first"),C),Object(r.a)(n,"".concat(j,"-fix-left-last"),T),Object(r.a)(n,"".concat(j,"-fix-right"),$),Object(r.a)(n,"".concat(j,"-fix-right-first"),O),Object(r.a)(n,"".concat(j,"-fix-right-last"),A),Object(r.a)(n,"".concat(j,"-ellipsis"),I),Object(r.a)(n,"".concat(j,"-with-append"),L),Object(r.a)(n,"".concat(j,"-fix-sticky"),(Y||$)&&P),n),D.className,V),style:Object(i.a)(Object(i.a)(Object(i.a)(Object(i.a)({},D.style),Z),X),H),ref:(ee=E,"string"==typeof ee||Object(u.c)(ee)?t:null)});return s.createElement(E,Object.assign({},te),L,d)}));d.displayName="Cell";var f=s.memo(d,(function(e,t){return!!t.shouldCellUpdate&&!t.shouldCellUpdate(t.record,e.record)}));t.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(e,t,n){e.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(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,(function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function str(e,t){var n,r,i,o,a,s=gap,l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),"function"==typeof rep&&(l=rep.call(t,e,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,a=[],"[object Array]"===Object.prototype.toString.apply(l)){for(o=l.length,n=0;n<o;n+=1)a[n]=str(n,l)||"null";return i=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,i}if(rep&&"object"==typeof rep)for(o=rep.length,n=0;n<o;n+=1)"string"==typeof rep[n]&&(i=str(r=rep[n],l))&&a.push(quote(r)+(gap?": ":":")+i);else for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(i=str(r,l))&&a.push(quote(r)+(gap?": ":":")+i);return i=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.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(e,t,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=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){var j;function walk(e,t){var n,r,i=e[t];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(e,t,i)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,(function(e){return"\\u"+("0000"+e.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")})}()},gqXR:
/*!*********************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/g.svg ***!
\*********************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/g.a5bcde87.svg"},hW8S:
/*!******************************************************!*\
!*** ./node_modules/rc-table/es/utils/legacyUtil.js ***!
\******************************************************/
/*! exports provided: INTERNAL_COL_DEFINE, getExpandableProps, getDataAndAriaProps */
/*! exports used: INTERNAL_COL_DEFINE, getDataAndAriaProps, getExpandableProps */function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s}));var r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),i=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),o=(n(/*! rc-util/es/warning */"Kwbf"),"RC_TABLE_INTERNAL_COL_DEFINE");function a(e){var t=e.expandable,n=Object(i.a)(e,["expandable"]);return"expandable"in e?Object(r.a)(Object(r.a)({},n),t):n}function s(e){return Object.keys(e).reduce((function(t,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)||(t[n]=e[n]),t}),{})}},hgre:
/*!*********************************************!*\
!*** ./src/components/Video/Play/index.jsx ***!
\*********************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,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/asyncToGenerator */"9og8"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */"WmNS"),a=n.n(o),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! flv.js */"GUcZ"),u=n(/*! hls.js */"ulZh"),h=n.n(u),d=n(/*! @/utils/authority */"xKgJ"),f=n(/*! @/utils/fullscreen.ts */"bntm"),p=n(/*! ./index.less?modules */"4xil"),m=n.n(p);function g(e){if(isNaN(e))return{minutes:"00",seconds:"00"};var t=new Date(1e3*e).toISOString().substr(11,8);return{minutes:t.substr(3,2),seconds:t.substr(6,2)}}function v(e,t){return e-t}function y(e){e.sort(v);for(var t=0,n=0;n<e.length-1;n++){var r=Math.abs(e[n+1]-e[n]);r<21&&(t+=r)}return t}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return!!(this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2)}});var b=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i;t.a=Object(s.forwardRef)((function(e,t){var n,o=e.src,u=e.toLog,p=e.videoId,v=e.logWatchHistory,_=e.courseId,E=void 0===_?null:_,x=e.startTime,w=e.handlePause,S=void 0===w?function(){}:w,k=e.handlePlay,C=void 0===k?function(){}:k,T=e.handlePlayEnded,O=void 0===T?function(){}:T,A=e.videoSpeed,L=void 0===A?1:A,R="flv"===(null==o||null===(n=o.split("."))||void 0===n?void 0:n.pop()),D=Object(s.useRef)(),I=Object(s.useRef)(),M=Object(s.useRef)(),N=Object(s.useRef)(),P=Object(s.useRef)(),j=Object(s.useRef)(),B=Object(s.useRef)(),F=Object(s.useRef)(),U=Object(s.useRef)(),G=Object(s.useRef)(),z=Object(s.useRef)(),H=Object(s.useRef)(),V=Object(s.useRef)(),W=Object(s.useRef)(),K=navigator.userAgent.toLowerCase().match(b),q=K?K[0]:"pc",X=Object(s.useRef)(!1),Y=Object(d.x)(),$=0,J=0,Z=0,Q=null,ee=!1,te=20,ne=1,re=!1,ie=!1,oe=[];Object(s.useImperativeHandle)(t,(function(){return{getLastUpdatedTime:function(){return D.current.currentTime},getDuration:function(){return D.current.duration}}}));var ae=Object(s.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={point:D.current.currentTime};function r(){return o.apply(this,arguments)}function o(){return(o=Object(i.a)(a.a.mark((function t(){var r;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return re=!0,t.next=3,v(n);case 3:r=t.sent,Q=r,re=!1,e&&e();case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}Q?(n.log_id=Q,n.watch_duration=y(oe),n.total_duration=J):(E?(n.video_id=parseInt(p,10),n.course_id=E):n.video_id=p,n.duration=$,n.device=q),t&&(n.ed="1"),r()}),[p,E]);function se(){D.current.paused?(N.current.style.display="none",P.current.style.display="block"):(N.current.style.display="block",P.current.style.display="none")}function le(){z.current.style.display="none",V.current.style.display="none",H.current.style.display="none",D.current.muted||0===D.current.volume?z.current.style.display="block":D.current.volume>0&&D.current.volume<=.5?V.current.style.display="block":H.current.style.display="block"}Object(s.useEffect)((function(){r.b.destroy();var e=null;return c.a.isSupported&&R&&o&&(null==o?void 0:o.indexOf(".m3u8"))<0?(e=c.a.createPlayer({type:"flv",volume:.8,cors:!0,url:o,muted:!1}),D.current&&(e.attachMediaElement(D.current),e.load())):D.current.setAttribute("src",o),le(),function(){e&&(e.unload(),e.pause(),e.destroy(),e=null)}}),[D,R,o]),Object(s.useEffect)((function(){document.getElementById("play"),document.querySelectorAll(".playback-icons use");function e(){C(),x&&!X.current&&(D.current.currentTime=x),X.current=!0,oe.push(D.current.currentTime),ee||(ee=!0,u&&ae())}function t(){return n.apply(this,arguments)}function n(){return(n=Object(i.a)(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:se(),oe.push(D.current.currentTime),u&&ae((function(){Q=null,Z=0,ee=!1,re=!1,ie=!1,oe=[],J=0,ne=1}),!0);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function r(){var e=Math.round(D.current.duration);j.current.setAttribute("max",e),B.current.setAttribute("max",e);var t=g(e);F.current.innerText="".concat(t.minutes,":").concat(t.seconds),F.current.setAttribute("datetime","".concat(t.minutes,"m ").concat(t.seconds,"s"))}function o(){var e=Math.round(D.current.duration);j.current.setAttribute("max",e),B.current.setAttribute("max",e);var t=g(e);F.current.innerText="".concat(t.minutes,":").concat(t.seconds),F.current.setAttribute("datetime","".concat(t.minutes,"m ").concat(t.seconds,"s")),j.current.value=Math.floor(D.current.currentTime),B.current.value=Math.floor(D.current.currentTime),function(){var e=g(Math.round(D.current.currentTime));U.current.innerText="".concat(e.minutes,":").concat(e.seconds),U.current.setAttribute("datetime","".concat(e.minutes,"m ").concat(e.seconds,"s"))}();var n=I.current.getBoundingClientRect(),r=n.width,i=(n.height,n.x),o=n.y;if(!(i<0||o<0)&&r&&!ie){var a=D.current.currentTime,s=a-Z;Math.abs(s)<10?(J+=Math.abs(s),Z=a,re||J-ne*te>=0&&(ne++,oe.push(Z),u&&ae())):(Z=a,u&&ae())}}function s(){ie=!0}function l(){D.current.playing&&oe.push(D.current.currentTime,Z),Z=D.current.currentTime,ie=!1}function c(){($=D.current.duration)<=20&&(te=$/3),D.current.addEventListener("play",e)}function h(){S()}function d(e){var t=e.target.dataset.seek?e.target.dataset.seek:e.target.value;D.current.currentTime=t,B.current.value=t,j.current.value=t}function p(e){var t=Math.round(e.offsetX/e.target.clientWidth*parseInt(e.target.getAttribute("max"),10));j.current.setAttribute("data-seek",t);var n=g(t);G.current.textContent="".concat(n.minutes,":").concat(n.seconds);var r=D.current.getBoundingClientRect();G.current.style.left="".concat(e.pageX-r.left,"px")}return M.current.addEventListener(Object(f.c)(),(function(e){e.preventDefault(),Object(f.a)()?(D.current.style.width="100%",D.current.style.height="100%"):D.current.style.cssText=""})),D.current.addEventListener("canplay",c),D.current.addEventListener("ended",t),D.current.addEventListener("seeking",s),D.current.addEventListener("seeked",l),D.current.addEventListener("loadedmetadata",r),j.current.addEventListener("mousemove",p),j.current.addEventListener("input",d),D.current.addEventListener("timeupdate",o),D.current.addEventListener("pause",h),D.current.addEventListener("volumechange",le),function(){D.current.removeEventListener("canplay",c),D.current.removeEventListener("play",e),D.current.removeEventListener("ended",t),D.current.removeEventListener("seeking",s),D.current.removeEventListener("seeked",l),j.current.removeEventListener("mousemove",p),j.current.removeEventListener("input",d),D.current.removeEventListener("timeupdate",o),D.current.removeEventListener("pause",h),D.current.removeEventListener("loadedmetadata",r),D.current.removeEventListener("volumechange",le),D.current.playing&&(oe.push(Z,D.current.currentTime),u&&ae())}}),[D,o]),Object(s.useEffect)((function(){if(D.current.onended=function(){O(D)},D.current.oncontextmenu=function(){return!1},(null==o?void 0:o.indexOf(".m3u8"))>-1)if(D.current.canPlayType("application/vnd.apple.mpegurl"))D.current.src=o;else if(h.a.isSupported()){var e=new h.a;e.loadSource(o),e.attachMedia(D.current)}}),[o]),Object(s.useEffect)((function(){D.current.playbackRate=L}),[L]);return l.a.createElement("div",{style:{position:"relative"},ref:M},l.a.createElement("div",{ref:I,className:"".concat(m.a.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(m.a.animate__loop)},Y?Y.login:" "),l.a.createElement("div",{className:m.a.container},l.a.createElement("div",{className:m.a["video-container"],id:"video-container"},l.a.createElement("div",{className:m.a["playback-animation"],id:"playback-animation"},l.a.createElement("svg",{className:m.a["playback-icons"]},l.a.createElement("use",{className:"hidden",href:"#play-icon"}),l.a.createElement("use",{href:"#pause"}))),l.a.createElement("video",{className:m.a.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:D,autoPlay:!1}),l.a.createElement("div",{className:"".concat(m.a["video-controls"]," "),id:"video-controls"},l.a.createElement("div",{className:m.a["bottom-controls"]},l.a.createElement("div",{className:m.a["left-controls"]},l.a.createElement("button",{"data-title":"播放/暂停",id:"play",onClick:function(){D.current.paused||D.current.ended?D.current.play():D.current.pause(),se()}},l.a.createElement("svg",{className:m.a["playback-icons"]},l.a.createElement("use",{ref:P,href:"#play-icon"}),l.a.createElement("use",{ref:N,style:{display:"none"},href:"#pause"}))),l.a.createElement("div",{className:m.a.time},l.a.createElement("time",{id:"time-elapsed",ref:U},"00:00"),l.a.createElement("span",null," / "),l.a.createElement("time",{id:"duration",ref:F},"00:00"))),l.a.createElement("div",{className:m.a["right-controls"]},l.a.createElement("div",{className:m.a["volume-controls"]},l.a.createElement("button",{"data-title":"开启/关闭声音",className:m.a["volume-button"],id:"volume-button",onClick:function(){D.current.muted=!D.current.muted,D.current.muted?(W.current.setAttribute("data-volume",volume.value),W.current.value=0):W.current.value=W.current.dataset.volume}},l.a.createElement("svg",null,l.a.createElement("use",{ref:z,href:"#volume-mute"}),l.a.createElement("use",{ref:V,href:"#volume-low"}),l.a.createElement("use",{ref:H,href:"#volume-high"}))),l.a.createElement("input",{className:m.a.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:W,style:{display:"none"},onClick:le})),l.a.createElement("button",{"data-title":"全屏/退出全屏",className:m.a["fullscreen-button"],onClick:function(){Object(f.a)()?Object(f.b)():Object(f.d)(M.current)}},l.a.createElement("svg",null,l.a.createElement("use",{href:"#fullscreen"}),l.a.createElement("use",{href:"#fullscreen-exit",className:"hidden"}))))),l.a.createElement("div",{className:m.a["video-progress"]},l.a.createElement("progress",{ref:B,value:"0",min:"0"}),l.a.createElement("input",{className:m.a.seek,ref:j,value:"0",min:"0",type:"range",step:"1"}),l.a.createElement("div",{className:m.a["seek-tooltip"],ref:G,id:"seek-tooltip"},"00:00"))))),l.a.createElement("svg",{style:{display:"none"}},l.a.createElement("defs",null,l.a.createElement("symbol",{id:"pause",viewBox:"0 0 24 24"},l.a.createElement("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})),l.a.createElement("symbol",{id:"play-icon",viewBox:"0 0 24 24"},l.a.createElement("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})),l.a.createElement("symbol",{id:"volume-high",viewBox:"0 0 24 24"},l.a.createElement("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})),l.a.createElement("symbol",{id:"volume-low",viewBox:"0 0 24 24"},l.a.createElement("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})),l.a.createElement("symbol",{id:"volume-mute",viewBox:"0 0 24 24"},l.a.createElement("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})),l.a.createElement("symbol",{id:"fullscreen",viewBox:"0 0 24 24"},l.a.createElement("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})),l.a.createElement("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24"},l.a.createElement("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})),l.a.createElement("symbol",{id:"pip",viewBox:"0 0 24 24"},l.a.createElement("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})))))}))},i3hx:
/*!**************************************************!*\
!*** ./src/components/SplitContainer/index.less ***!
\**************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,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(e,t,n){var r=n(/*! ../src/store-engine */"5nXd"),i=n(/*! ../storages/all */"gRFJ"),o=[n(/*! ../plugins/json2 */"uQRt")];e.exports=r.createStore(i,o)},kSUc:
/*!***************************************************!*\
!*** ./src/components/markdown-editor/index.less ***!
\***************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},"kaH+":
/*!************************************************!*\
!*** ./src/components/image-preview/index.tsx ***!
\************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,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"),o=n(/*! react */"q1tI"),a=n.n(o),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");t.a=function(){var e=Object(o.useState)(""),t=Object(i.a)(e,2),n=t[0],h=t[1],d=Object(o.useState)(0),f=Object(i.a)(d,2),p=f[0],m=f[1],g=Object(o.useRef)("");function v(e){27==e.keyCode&&g.current&&y()}function y(){document.body.style.overflow="auto",h("")}return Object(o.useEffect)((function(){return s.a.subscribe("preview-image",(function(e){h(e),document.body.style.overflow="hidden"}))}),[]),Object(o.useEffect)((function(){return document.addEventListener("keydown",v),function(){document.removeEventListener("keydown",v)}}),[]),Object(o.useEffect)((function(){g.current=n}),[n]),a.a.createElement(o.Fragment,null,n?a.a.createElement("div",{className:"image-preview-container"},a.a.createElement("div",{className:"button-group"},a.a.createElement(r.a,{onClick:function(){m(p+90)}},"旋转",a.a.createElement(l.a,null)),a.a.createElement(r.a,{href:n},"下载",a.a.createElement(c.a,null)),a.a.createElement(r.a,{onClick:y},"关闭",a.a.createElement(u.a,null))),a.a.createElement("div",{className:"preview-wrp-group"},a.a.createElement("img",{className:"image-preview",src:n,alt:"预览大图",style:{transform:"rotate(".concat(p,"deg)")}}))):null)}},kovY:
/*!**************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/e.svg ***!
\**************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/e.eabfa286.svg"},lOMy:
/*!****************************************************!*\
!*** ./src/components/tpi-code-setting/index.less ***!
\****************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},lZu9:
/*!***********************************************************!*\
!*** ./node_modules/codemirror/mode/markdown/markdown.js ***!
\***********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";e.defineMode("markdown",(function(t,n){var r=e.getMode(t,"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 o={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 a in o)o.hasOwnProperty(a)&&n.tokenTypeOverrides[a]&&(o[a]=n.tokenTypeOverrides[a]);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*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 g(e,t,n){return t.f=t.inline=n,n(e,t)}function v(e,t,n){return t.f=t.block=n,n(e,t)}function y(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==_){var n=i;if(!n){var o=e.innerMode(r,t.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(t.f=S,t.block=b,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function b(r,i){var a,d=r.column()===i.indentation,m=!(a=i.prevLine.stream)||!/\S/.test(a.string),v=i.indentedCode,y=i.prevLine.hr,b=!1!==i.list,_=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var w=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,b)){for(i.list=null;w<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=w-i.listStack[i.listStack.length-1])}var S=!(m||y||i.prevLine.header||b&&v||i.prevLine.fencedCodeEnd),k=(!1===i.list||y||m)&&i.indentation<=_&&r.match(s),C=null;if(i.indentationDiff>=4&&(v||i.prevLine.fencedCodeEnd||i.prevLine.header||m))return r.skipToEnd(),i.indentedCode=!0,o.code;if(r.eatSpace())return null;if(d&&i.indentation<=_&&(C=r.match(u))&&C[1].length<=6)return i.quote=0,i.header=C[1].length,i.thisLine.header=!0,n.highlightFormatting&&(i.formatting="header"),i.f=i.inline,x(i);if(i.indentation<=_&&r.eat(">"))return i.quote=d?1:i.quote+1,n.highlightFormatting&&(i.formatting="quote"),r.eatSpace(),x(i);if(!k&&!i.setext&&d&&i.indentation<=_&&(C=r.match(l))){var T=C[1]?"ol":"ul";return i.indentation=w+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-"+T]),x(i)}return d&&i.indentation<=_&&(C=r.match(f,!0))?(i.quote=0,i.fencedEndRE=new RegExp(C[1]+"+ *$"),i.localMode=n.fencedCodeBlockHighlighting&&function(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}(C[2]||n.fencedCodeBlockDefaultMode),i.localMode&&(i.localState=e.startState(i.localMode)),i.f=i.block=E,n.highlightFormatting&&(i.formatting="code-block"),i.code=-1,x(i)):i.setext||!(S&&b||i.quote||!1!==i.list||i.code||k||p.test(r.string))&&(C=r.lookAhead(1))&&(C=C.match(h))?(i.setext?(i.header=i.setext,i.setext=0,r.skipToEnd(),n.highlightFormatting&&(i.formatting="header")):(i.header="="==C[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,x(i)):k?(r.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,o.hr):"["===r.peek()?g(r,i,O):g(r,i,i.inline)}function _(t,n){var o=r.token(t,n.htmlState);if(!i){var a=e.innerMode(r,n.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=S,n.block=b,n.htmlState=null)}return o}function E(e,t){var r,i=t.listStack[t.listStack.length-1]||0,a=t.indentation<i,s=i+3;return t.fencedEndRE&&t.indentation<=s&&(a||e.match(t.fencedEndRE))?(n.highlightFormatting&&(t.formatting="code-block"),a||(r=x(t)),t.localMode=t.localState=null,t.block=b,t.f=S,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,a?v(e,t,t.block):r):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),o.code)}function x(e){var t=[];if(e.formatting){t.push(o.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(o.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(o.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(o.linkHref,"url"):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.emoji&&t.push(o.emoji),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,"link"),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+"-"+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+"-"+e.quote):t.push(o.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function w(e,t){if(e.match(d,!0))return x(t)}function S(t,i){var a=i.text(t,i);if(void 0!==a)return a;if(i.list)return i.list=null,x(i);if(i.taskList)return" "===t.match(c,!0)[1]?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting="task"),i.taskList=!1,x(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting="header"),x(i);var s=t.next();if(i.linkTitle){i.linkTitle=!1;var l=s;"("===s&&(l=")");var u="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(u),!0))return o.linkHref}if("`"===s){var h=i.formatting;n.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var d=t.current().length;if(0!=i.code||i.quote&&1!=d){if(d==i.code){var f=x(i);return i.code=0,f}return i.formatting=h,x(i)}return i.code=d,x(i)}if(i.code)return x(i);if("\\"===s&&(t.next(),n.highlightFormatting)){var p=x(i),g=o.formatting+"-escape";return p?p+" "+g:g}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,n.highlightFormatting&&(i.formatting="image"),x(i);if("["===s&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,n.highlightFormatting&&(i.formatting="image"),x(i);if("]"===s&&i.imageAltText){n.highlightFormatting&&(i.formatting="image");var p=x(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=C,p}if("["===s&&!i.image)return i.linkText&&t.match(/^.*?\]/)||(i.linkText=!0,n.highlightFormatting&&(i.formatting="link")),x(i);if("]"===s&&i.linkText){n.highlightFormatting&&(i.formatting="link");var p=x(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?C:S,p}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=k,n.highlightFormatting&&(i.formatting="link"),(p=x(i))?p+=" ":p="",p+o.linkInline;if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=k,n.highlightFormatting&&(i.formatting="link"),(p=x(i))?p+=" ":p="",p+o.linkEmail;if(n.xml&&"<"===s&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=t.string.indexOf(">",t.pos);if(-1!=y){var b=t.string.substring(t.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(r),v(t,i,_)}if(n.xml&&"<"===s&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===s||"_"===s){for(var E=1,w=1==t.pos?" ":t.string.charAt(t.pos-2);E<3&&t.eat(s);)E++;var T=t.peek()||" ",O=!/\s/.test(T)&&(!m.test(T)||/\s/.test(w)||m.test(w)),A=!/\s/.test(w)&&(!m.test(w)||/\s/.test(T)||m.test(T)),L=null,R=null;if(E%2&&(i.em||!O||"*"!==s&&A&&!m.test(w)?i.em!=s||!A||"*"!==s&&O&&!m.test(T)||(L=!1):L=!0),E>1&&(i.strong||!O||"*"!==s&&A&&!m.test(w)?i.strong!=s||!A||"*"!==s&&O&&!m.test(T)||(R=!1):R=!0),null!=R||null!=L)return n.highlightFormatting&&(i.formatting=null==L?"strong":null==R?"em":"strong em"),!0===L&&(i.em=s),!0===R&&(i.strong=s),f=x(i),!1===L&&(i.em=!1),!1===R&&(i.strong=!1),f}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return x(i);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(i.strikethrough)return n.highlightFormatting&&(i.formatting="strikethrough"),f=x(i),i.strikethrough=!1,f;if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting="strikethrough"),x(i)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return x(i);t.backUp(2)}if(n.emoji&&":"===s&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,n.highlightFormatting&&(i.formatting="emoji");var D=x(i);return i.emoji=!1,D}return" "===s&&(t.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),x(i)}function k(e,t){if(">"===e.next()){t.f=t.inline=S,n.highlightFormatting&&(t.formatting="link");var r=x(t);return r?r+=" ":r="",r+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function C(e,t){if(e.eatSpace())return null;var r,i=e.next();return"("===i||"["===i?(t.f=t.inline=(r="("===i?")":"]",function(e,t){if(e.next()===r){t.f=t.inline=S,n.highlightFormatting&&(t.formatting="link-string");var i=x(t);return t.linkHref=!1,i}return e.match(T[r]),t.linkHref=!0,x(t)}),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,x(t)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function O(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=A,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,x(t)):g(e,t,S)}function A(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=L,n.highlightFormatting&&(t.formatting="link");var r=x(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function L(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=S,o.linkHref+" url")}var R={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:S,text:w,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(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(r,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=_)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==_?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:R}},indent:function(t,n,i){return t.block==_&&r.indent?r.indent(t.htmlState,n,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,i):e.Pass},blankLine:y,getType:x,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return R}),"xml"),e.defineMIME("text/markdown","markdown"),e.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(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("q1tI"),i=n("biw7"),o=n("fyJ8");t.b=function(e){var t=e.children,n=r.useContext(i.a).prefixCls;return r.createElement("tfoot",{className:"".concat(n,"-summary")},t)};var a={Cell:function(e){var t=e.className,n=e.index,a=e.children,s=e.colSpan,l=e.rowSpan,c=r.useContext(i.a),u=c.prefixCls,h=c.fixedInfoList[n];return r.createElement(o.a,Object.assign({className:t,index:n,component:"td",prefixCls:u,record:null,dataIndex:null,render:function(){return{children:a,props:{colSpan:s,rowSpan:l}}}},h))},Row:function(e){return r.createElement("tr",Object.assign({},e))}}},nCk5:
/*!**************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/d.svg ***!
\**************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/d.53bf6ae3.svg"},nVVt:
/*!****************************************!*\
!*** ./node_modules/qr.js/lib/mode.js ***!
\****************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.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(e,t,n){},oE5q:
/*!******************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/t.svg ***!
\******************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/t.0b94c5c3.svg"},oFv4:
/*!*************************************************!*\
!*** ./src/assets/images/question/internal.png ***!
\*************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/internal.da228387.png"},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(e,t,n){!function(e){"use strict";var t=e.Pos;function n(e,t){return e.line-t.line||e.ch-t.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 o(e,t,n,r){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=r?Math.max(r.from,e.firstLine()):e.firstLine(),this.max=r?Math.min(r.to-1,e.lastLine()):e.lastLine()}function a(e,n){var r=e.cm.getTokenTypeAt(t(e.line,n));return r&&/\btag\b/.test(r)}function s(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(s(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){i.lastIndex=t,e.ch=t;var n=i.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function h(e){for(;;){i.lastIndex=e.ch;var t=i.exec(e.text);if(!t){if(s(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function f(e,n){for(var r=[];;){var i,o=h(e),a=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(i=c(e)))return;if("selfClose"!=i)if(o[1]){for(var l=r.length-1;l>=0;--l)if(r[l]==o[2]){r.length=l;break}if(l<0&&(!n||n==o[2]))return{tag:o[2],from:t(a,s),to:t(e.line,e.ch)}}else r.push(o[2])}}function p(e,n){for(var r=[];;){var i=d(e);if(!i)return;if("selfClose"!=i){var o=e.line,a=e.ch,s=u(e);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:t(e.line,e.ch),to:t(o,a)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,r){for(var i=new o(e,r.line,0);;){var a=h(i);if(!a||i.line!=r.line)return;var s=c(i);if(!s)return;if(!a[1]&&"selfClose"!=s){var l=t(i.line,i.ch),u=f(i,a[2]);return u&&n(u.from,l)>0?{from:l,to:u.from}:null}}})),e.findMatchingTag=function(e,r,i){var a=new o(e,r.line,r.ch,i);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var s=c(a),l=s&&t(a.line,a.ch),h=s&&u(a);if(s&&h&&!(n(a,r)>0)){var d={from:t(a.line,a.ch),to:l,tag:h[2]};return"selfClose"==s?{open:d,close:null,at:"open"}:h[1]?{open:p(a,h[2]),close:d,at:"close"}:{open:d,close:f(a=new o(e,l.line,l.ch,i),h[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,r){for(var i=new o(e,t.line,t.ch,n);;){var a=p(i,r);if(!a)break;var s=f(new o(e,t.line,t.ch,n),a.tag);if(s)return{open:a,close:s}}},e.scanForClosingTag=function(e,t,n,r){return f(new o(e,t.line,t.ch,r?{from:0,to:r}:null),n)}}(n(/*! ../../lib/codemirror */"VrN/"))},p5ED:
/*!*********************************************!*\
!*** ./src/components/PreviewAll/index.tsx ***!
\*********************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,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+")),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),a=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");t.a=function(e){var t=e.name,n=e.data,c=(e.theme,e.type),p=e.filename,m=e.monacoEditor,g=e.className,v=e.style,y=e.close,b=e.onClose,_=e.hasMask,E=Object(s.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),x=Object(a.a)(E,2),w=(x[0],x[1],Object(s.useState)("")),S=Object(a.a)(w,2),k=(S[0],S[1]),C=Object(s.useRef)();p&&(m.filename=p),Object(s.useEffect)((function(){var e,t,n=null===(e=document.cookie)||void 0===e||null===(t=e.replace(/\s/g,""))||void 0===t?void 0:t.split(";");null==n||n.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&k(t[1])}))}),[]);var T=function(){n.startsWith("http")||n.startsWith("/")?O():Object(f.x)(p||"educoder",n,p)},O=function(){Object(f.v)(p||t,n)};return console.log("data:",n,"fileanme:",p," name:",t),l.a.createElement("div",{style:Object(o.a)({},v||{}),className:"".concat(_&&u.a.bgBlack," ").concat(c?u.a.wrp:"hide")},y&&l.a.createElement("div",{className:u.a.close,ref:C},l.a.createElement(i.a,{title:"点击下载此文件",getPopupContainer:function(){return C.current}},l.a.createElement("span",{onClick:O},l.a.createElement("i",{className:"icon-quxiaozhiding"}))),l.a.createElement(i.a,{title:"关闭",getPopupContainer:function(){return C.current}},l.a.createElement("span",{className:"",onClick:b},l.a.createElement("i",{className:"icon-guanbi1"})))),l.a.createElement("div",{className:"".concat(u.a[g]," ").concat(g," ").concat(u.a.monaco," ").concat("txt"===c?"show":"hide")},"txt"===c&&l.a.createElement(d.b,m)),"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}),"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:T},l.a.createElement(h.a,null),"点击下载")),("download"===c||"office"===c)&&l.a.createElement(r.a,{type:"primary",size:"large",onClick:T},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(e,t,n){},pYxM:
/*!***********************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/index.less?modules ***!
\***********************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___v-DUT",flex_space_between:"flex_space_between___1bRJc",flex_box_vertical_center:"flex_box_vertical_center___k_OZG",flex_box_center_end:"flex_box_center_end___2lt4j",flex_box_column:"flex_box_column___3fVE5",active:"active___-vjVj",line:"line___3pg8N",list:"list___3yqVJ",left:"left___2dr70",mask:"mask___186YH",right:"right___17A6Y",name:"name___v6M7T",title:"title___1BhMz",a:"a___3T4cN",b:"b___1z1Bk",des:"des___29QAn",tag:"tag___FfUI2"}},ppsT:
/*!****************************************************!*\
!*** ./node_modules/aliyun-vod-upload-ll/index.js ***!
\****************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){(function(t){!function(t){window.OSS=t(),e.exports=t()}((function(){return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,(function(e){return i(t[a][1][e]||e)}),c,c.exports,e,t,n,r)}return n[a].exports}for(var o=!1,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){"use strict";var r=e("./browser/client");r.Buffer=e("buffer").Buffer,r.co=e("co"),r.urllib=e("../shims/xhr"),r.version=e("./browser/version").version,t.exports=r},{"../shims/xhr":244,"./browser/client":2,"./browser/version":5,buffer:38,co:41}],2:[function(e,t,n){(function(n,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(this instanceof o))return new o(e,t);e&&e.inited?this.options=e:this.options=o.initOptions(e),this.options.cancelFlag=!1,this.options.urllib?this.urllib=this.options.urllib:(this.urllib=E,this.agent=this.options.agent||T),this.ctx=t,this.userAgent=this._getUserAgent(),this.options.amendTimeSkewed=0}var a=i(e("babel-runtime/regenerator")),s=i(e("babel-runtime/core-js/object/keys")),l=e("debug")("ali-oss"),c=e("./../../shims/crypto/crypto.js"),u=e("path"),h=e("copy-to"),d=e("mime"),f=e("xml2js"),p=e("humanize-ms"),m=e("agentkeepalive"),g=e("merge-descriptors"),v=e("url"),y=e("is-type-of"),b=e("platform"),_=e("utility"),E=e("urllib"),x=e("./version"),w=e("dateformat"),S=e("bowser"),k=e("../common/signUtils"),C=e("../common/utils"),T=new m;t.exports=o,o.initOptions=function(e){if(!e||!e.accessKeyId||!e.accessKeySecret)throw new Error("require accessKeyId, accessKeySecret");var t={region:"oss-cn-hangzhou",internal:!1,secure:document&&document.location&&"https:"===document.location.protocol,bucket:null,endpoint:null,cname:!1};if((0,s.default)(e).forEach((function(n){void 0!==e[n]&&(t[n]=e[n])})),t.accessKeyId=t.accessKeyId.trim(),t.accessKeySecret=t.accessKeySecret.trim(),t.timeout&&(t.timeout=p(t.timeout)),t.endpoint)t.endpoint=function(e,t){var n=v.parse(e);if(!n.protocol){var r=t?"https://":"http://";n=v.parse(r+e)}if("http:"!==n.protocol&&"https:"!==n.protocol)throw new Error("Endpoint protocol must be http or https.");return n}(t.endpoint,t.secure);else{if(!t.region)throw new Error("require options.endpoint or options.region");t.endpoint=function(e,t,n){var r=n?"https://":"http://",i=t?"-internal.aliyuncs.com":".aliyuncs.com";return"vpc100-oss-cn-"===e.substr(0,"vpc100-oss-cn-".length)&&(i=".aliyuncs.com"),v.parse(r+e+i)}(t.region,t.internal,t.secure)}return t.inited=!0,t};var O=o.prototype;g(O,e("./object")),g(O,e("./managed_upload")),g(O,e("../common/multipart")),g(O,e("../common/thunkpool.js")),o.Wrapper=e("./wrapper"),O.signature=function(e){return l("authorization stringToSign: %s",e),k.computeSignature(this.options.accessKeySecret,e)},O.authorization=function(e,t,n,r){var i=k.buildCanonicalString(e.toUpperCase(),t,{headers:r,parameters:n});return k.authorization(this.options.accessKeyId,this.options.accessKeySecret,i)},O.createRequest=function(e){var t={"x-oss-date":w(+new Date+this.options.amendTimeSkewed,"UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'"),"x-oss-user-agent":this.userAgent};this.options.stsToken&&(t["x-oss-security-token"]=this.options.stsToken),h(e.headers).to(t),function(e,t){return e[t]||e[t.toLowerCase()]}(t,"Content-Type")||(e.mime===d.default_type&&(e.mime=""),e.mime&&e.mime.indexOf("/")>0?t["Content-Type"]=e.mime:t["Content-Type"]=d.getType(e.mime||u.extname(e.object||""))||"application/octet-stream"),e.content&&(t["Content-Md5"]=c.createHash("md5").update(new r(e.content,"utf8")).digest("base64"),t["Content-Length"]||(t["Content-Length"]=e.content.length));var n=this._getResource(e);t.authorization=this.authorization(e.method,n,e.subres,t);var i=this._getReqUrl(e);l("request %s %s, with headers %j, !!stream: %s",e.method,i,t,!!e.stream);var o=e.timeout||this.options.timeout;return{url:i,params:{agent:this.agent,method:e.method,content:e.content,stream:e.stream,headers:t,timeout:o,writeStream:e.writeStream,customResponse:e.customResponse,ctx:e.ctx||this.ctx}}},O.request=a.default.mark((function e(t){var n,r,i,o;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.createRequest(t),r=void 0,i=void 0,e.prev=3,e.next=6,this.urllib.request(n.url,n.params);case 6:r=e.sent,l("response %s %s, got %s, headers: %j",t.method,n.url,r.status,r.headers),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),i=e.t0;case 13:if(o=void 0,!r||!t.successStatuses||-1!==t.successStatuses.indexOf(r.status)){e.next=26;break}return e.next=17,this.requestError(r);case 17:if("RequestTimeTooSkewed"!==(o=e.sent).code){e.next=23;break}return this.options.amendTimeSkewed=+new Date(o.serverTime)-new Date,e.next=22,this.request(t);case 22:return e.abrupt("return",e.sent);case 23:o.params=t,e.next=30;break;case 26:if(!i){e.next=30;break}return e.next=29,this.requestError(i);case 29:o=e.sent;case 30:if(!o){e.next=32;break}throw o;case 32:if(!t.xmlResponse){e.next=36;break}return e.next=35,this.parseXML(r.data);case 35:r.data=e.sent;case 36:return e.abrupt("return",r);case 37:case"end":return e.stop()}}),e,this,[[3,10]])})),O._getResource=function(e){var t="/";return e.bucket&&(t+=e.bucket+"/"),e.object&&(t+=e.object),t},O._isIP=function(e){return C._isIP(e)},O._escape=function(e){return _.encodeURIComponent(e).replace(/%2F/g,"/")},O._getReqUrl=function(e){var t={};h(this.options.endpoint).to(t);var n=this._isIP(t.hostname),r=this.options.cname;!e.bucket||r||n||(t.host=e.bucket+"."+t.host);var i="/";e.bucket&&n&&(i+=e.bucket+"/"),e.object&&(i+=this._escape(e.object).replace(/\+/g,"%2B")),t.pathname=i;var o={};if(e.query&&g(o,e.query),e.subres){var a={};y.string(e.subres)?a[e.subres]="":y.array(e.subres)?e.subres.forEach((function(e){a[e]=""})):a=e.subres,g(o,a)}return t.query=o,v.format(t)},O._getUserAgent=function(){var e="aliyun-sdk-"+(n&&n.browser?"js":"nodejs")+"/"+x.version,t=b.description;return!t&&n&&(t="Node.js "+n.version.slice(1)+" on "+n.platform+" "+n.arch),this._checkUserAgent(e+" "+t)},O._checkUserAgent=function(e){return e.replace(/\u03b1/,"alpha").replace(/\u03b2/,"beta")},O.checkBrowserAndVersion=function(e,t){return S.name===e&&S.version.split(".")[0]===t},O.parseXML=function(e){return function(t){r.isBuffer(e)&&(e=e.toString()),f.parseString(e,{explicitRoot:!1,explicitArray:!1},t)}},O.requestError=a.default.mark((function e(t){var n,r,i,o;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null,t.data&&t.data.length){e.next=5;break}-1===t.status||-2===t.status?((n=new Error(t.message)).name=t.name,n.status=t.status,n.code=t.name):(404===t.status?((n=new Error("Object not exists")).name="NoSuchKeyError",n.status=404,n.code="NoSuchKey"):412===t.status?((n=new Error("Pre condition failed")).name="PreconditionFailedError",n.status=412,n.code="PreconditionFailed"):((n=new Error("Unknow error, status: "+t.status)).name="UnknowError",n.status=t.status),n.requestId=t.headers["x-oss-request-id"],n.host=""),e.next=30;break;case 5:return r=String(t.data),l("request response error data: %s",r),i=void 0,e.prev=8,e.next=11,this.parseXML(r)||{};case 11:i=e.sent,e.next=21;break;case 14:return e.prev=14,e.t0=e.catch(8),l(r),e.t0.message+="\nraw xml: "+r,e.t0.status=t.status,e.t0.requestId=t.headers["x-oss-request-id"],e.abrupt("return",e.t0);case 21:o=i.Message||"unknow request error, status: "+t.status,i.Condition&&(o+=" (condition: "+i.Condition+")"),(n=new Error(o)).name=i.Code?i.Code+"Error":"UnknowError",n.status=t.status,n.code=i.Code,n.requestId=i.RequestId,n.hostId=i.HostId,n.serverTime=i.ServerTime;case 30:return l("generate error %j",n),e.abrupt("return",n);case 32:case"end":return e.stop()}}),e,this,[[8,14]])}))}).call(this,e("_process"),e("buffer").Buffer)},{"../common/multipart":8,"../common/signUtils":9,"../common/thunkpool.js":10,"../common/utils":11,"./../../shims/crypto/crypto.js":237,"./managed_upload":3,"./object":4,"./version":5,"./wrapper":6,_process:173,agentkeepalive:12,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,bowser:35,buffer:38,"copy-to":43,dateformat:154,debug:155,"humanize-ms":160,"is-type-of":165,"merge-descriptors":168,mime:242,path:170,platform:171,url:203,urllib:244,utility:243,xml2js:213}],3:[function(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(this instanceof i))return new i(e,t);f.call(this,t),this.file=e,this.reader=new FileReader,this.start=0,this.finish=!1,this.fileBuffer=null}var o=r(e("babel-runtime/core-js/array/from")),a=r(e("babel-runtime/regenerator")),s=e("is-type-of"),l=e("util"),c=e("path"),u=e("mime"),h=e("copy-to"),d=n;d.multipartUpload=a.default.mark((function e(t,n,r){var i,o,l,h,d,f,p,m,g;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.resetCancelFlag(),!(r=r||{}).checkpoint||!r.checkpoint.uploadId){e.next=6;break}return e.next=5,this._resumeMultipart(r.checkpoint,r);case 5:return e.abrupt("return",e.sent);case 6:return i=102400,r.mime||(s.file(n)?r.mime=u.getType(c.extname(n.name)):s.blob(n)?r.mime=n.type:r.mime=u.getType(c.extname(n))),r.headers=r.headers||{},this._convertMetaToHeaders(r.meta,r.headers),e.next=12,this._getFileSize(n);case 12:if(!((o=e.sent)<i)){e.next=25;break}return l=this._createStream(n,0,o),r.contentLength=o,e.next=18,this.putStream(t,l,r);case 18:if(h=e.sent,!r||!r.progress){e.next=22;break}return e.next=22,r.progress(1);case 22:return d={res:h.res,bucket:this.options.bucket,name:t,etag:h.res.headers.etag},(r.headers&&r.headers["x-oss-callback"]||r.callback)&&(d.data=h.data),e.abrupt("return",d);case 25:if(!(r.partSize&&r.partSize<i)){e.next=27;break}throw new Error("partSize must not be smaller than "+i);case 27:return e.next=29,this.initMultipartUpload(t,r);case 29:if(f=e.sent,p=f.uploadId,m=this._getPartSize(o,r.partSize),g={file:n,name:t,fileSize:o,partSize:m,uploadId:p,doneParts:[]},!r||!r.progress){e.next=36;break}return e.next=36,r.progress(0,g,f.res);case 36:return e.next=38,this._resumeMultipart(g,r);case 38:return e.abrupt("return",e.sent);case 39:case"end":return e.stop()}}),e,this)})),d._resumeMultipart=a.default.mark((function e(t,n){var r,i,s,l,c,u,d,f,p,m,g,v,y,b,_,E,x,w,S,k;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isCancel()){e.next=2;break}throw this._makeCancelEvent();case 2:if(r=t.file,i=t.fileSize,s=t.partSize,l=t.uploadId,c=t.doneParts,u=t.name,d=[],c.length>0&&h(c).to(d),f=this._divideParts(i,s),p=f.length,m=!1,g=a.default.mark((function e(i,o){var s,h,g;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.isCancel()){e.next=21;break}return e.prev=1,s=f[o-1],h={stream:i._createStream(r,s.start,s.end),size:s.end-s.start},e.next=6,i._uploadPart(u,l,o,h);case 6:if(g=e.sent,i.isCancel()||m){e.next=13;break}if(t.doneParts.push({number:o,etag:g.res.headers.etag}),d.push({number:o,etag:g.res.headers.etag}),!n||!n.progress){e.next=13;break}return e.next=13,n.progress(c.length/p,t,g.res);case 13:e.next=21;break;case 15:if(e.prev=15,e.t0=e.catch(1),i.isCancel()){e.next=21;break}throw i.cancel(),e.t0.partNum=o,e.t0;case 21:case"end":return e.stop()}}),e,this,[[1,15]])})),v=(0,o.default)(new Array(p),(function(e,t){return t+1})),y=d.map((function(e){return e.number})),b=v.filter((function(e){return y.indexOf(e)<0})),5,_=n.parallel||5,!this.checkBrowserAndVersion("Internet Explorer","10")&&1!==_){e.next=26;break}E=0;case 16:if(!(E<b.length)){e.next=24;break}if(!this.isCancel()){e.next=19;break}throw this._makeCancelEvent();case 19:return e.next=21,g(this,b[E]);case 21:E++,e.next=16;break;case 24:e.next=40;break;case 26:for(x=[],w=0;w<b.length;w++)x.push(g(this,b[w]));return e.next=30,this._thunkPool(x,_);case 30:if(S=e.sent,m=!0,!(S&&S.length>0)){e.next=37;break}throw this.resetCancelFlag(),(k=S[0]).message="Failed to upload some parts with error: "+k.toString()+" part_num: "+k.partNum,k;case 37:if(!this.isCancel()){e.next=40;break}throw x=null,this._makeCancelEvent();case 40:return e.next=42,this.completeMultipartUpload(u,l,d,n);case 42:return e.abrupt("return",e.sent);case 43:case"end":return e.stop()}}),e,this)})),s.file=function(e){return"undefined"!=typeof File&&e instanceof File},s.blob=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},d._getFileSize=a.default.mark((function e(t){var n;return a.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s.buffer(t)){e.next=4;break}return e.abrupt("return",t.length);case 4:if(!s.blob(t)&&!s.file(t)){e.next=6;break}return e.abrupt("return",t.size);case 6:if(!s.string(t)){e.next=11;break}return e.next=9,this._statFile(t);case 9:return n=e.sent,e.abrupt("return",n.size);case 11:throw new Error("_getFileSize requires Buffer/File/String.");case 12:case"end":return e.stop()}}),e,this)}));var f=e("stream").Readable;l.inherits(i,f),i.prototype.readFileAndPush=function(e){if(this.fileBuffer)for(var t=!0;t&&this.fileBuffer&&this.start<this.fileBuffer.length;){var n=this.start,r=n+e;r=r>this.fileBuffer.length?this.fileBuffer.length:r,this.start=r,t=this.push(this.fileBuffer.slice(n,r))}},i.prototype._read=function(e){if(this.file&&this.start>=this.file.size||this.fileBuffer&&this.start>=this.fileBuffer.length||this.finish||0===this.start&&!this.file)return this.finish||(this.fileBuffer=null,this.finish=!0),void this.push(null);e=e||16384;var n=this;this.reader.onload=function(r){n.fileBuffer=new t(new Uint8Array(r.target.result)),n.file=null,n.readFileAndPush(e)},0===this.start?this.reader.readAsArrayBuffer(this.file):this.readFileAndPush(e)},d._createStream=function(e,t,n){if(s.blob(e)||s.file(e))return new i(e.slice(t,n));throw new Error("_createStream requires File/String.")},d._getPartSize=function(e,t){return t?Math.max(Math.ceil(e/1e4),t):1048576},d._divideParts=function(e,t){for(var n=Math.ceil(e/t),r=[],i=0;i<n;i++){var o=t*i,a=Math.min(o+t,e);r.push({start:o,end:a})}return r},d._makeCancelEvent=function(){return{status:0,name:"cancel"}}}).call(this,e("buffer").Buffer)},{"babel-runtime/core-js/array/from":16,"babel-runtime/regenerator":33,buffer:38,"copy-to":43,"is-type-of":165,mime:242,path:170,stream:195,util:207}],4:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=r(e("babel-runtime/core-js/object/keys")),o=r(e("babel-runtime/regenerator")),a=e("debug")("ali-oss:object"),s=e("utility"),l=e("fs"),c=e("is-type-of"),u=e("url"),h=e("copy-to"),d=e("path"),f=e("mime"),p=e("../common/callback"),m=e("../common/signUtils"),g=n;g.append=o.default.mark((function e(t,n,r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===(r=r||{}).position&&(r.position="0"),r.subres={append:"",position:r.position},r.method="POST",e.next=6,this.put(t,n,r);case 6:return(i=e.sent).nextAppendPosition=i.res.headers["x-oss-next-append-position"],e.abrupt("return",i);case 9:case"end":return e.stop()}}),e,this)})),g.put=o.default.mark((function e(t,n,r){var i,a,s,l,u,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=void 0,r=r||{},!c.buffer(n)){e.next=6;break}i=n,e.next=18;break;case 6:if(!c.blob(n)&&!c.file(n)){e.next=17;break}return r.mime||(c.file(n)?r.mime=f.getType(d.extname(n.name)):r.mime=n.type),a=this._createStream(n,0,n.size),e.next=11,this._getFileSize(n);case 11:return r.contentLength=e.sent,e.next=14,this.putStream(t,a,r);case 14:return e.abrupt("return",e.sent);case 17:throw new TypeError("Must provide Buffer/Blob for put.");case 18:return r.headers=r.headers||{},this._convertMetaToHeaders(r.meta,r.headers),s=r.method||"PUT",l=this._objectRequestParams(s,t,r),p.encodeCallback(l,r),l.mime=r.mime,l.content=i,l.successStatuses=[200],e.next=28,this.request(l);case 28:return u=e.sent,h={name:t,url:this._objectUrl(t),res:u.res},l.headers&&l.headers["x-oss-callback"]&&(h.data=JSON.parse(u.data.toString())),e.abrupt("return",h);case 32:case"end":return e.stop()}}),e,this)})),g.putStream=o.default.mark((function e(t,n,r){var i,a,s,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=r||{}).headers=r.headers||{},r.contentLength?r.headers["Content-Length"]=r.contentLength:r.headers["Transfer-Encoding"]="chunked",this._convertMetaToHeaders(r.meta,r.headers),i=r.method||"PUT",a=this._objectRequestParams(i,t,r),p.encodeCallback(a,r),a.mime=r.mime,a.stream=n,a.successStatuses=[200],e.next=12,this.request(a);case 12:return s=e.sent,l={name:t,url:this._objectUrl(t),res:s.res},a.headers&&a.headers["x-oss-callback"]&&(l.data=JSON.parse(s.data.toString())),e.abrupt("return",l);case 16:case"end":return e.stop()}}),e,this)})),g.head=o.default.mark((function e(t,n){var r,a,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=this._objectRequestParams("HEAD",t,n)).successStatuses=[200,304],e.next=4,this.request(r);case 4:return a=e.sent,s={meta:null,res:a.res,status:a.status},200===a.status&&(0,i.default)(a.headers).forEach((function(e){0===e.indexOf("x-oss-meta-")&&(s.meta||(s.meta={}),s.meta[e.substring(11)]=a.headers[e])})),e.abrupt("return",s);case 8:case"end":return e.stop()}}),e,this)})),g.get=o.default.mark((function e(t,n,r){var i,s,u,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null,s=!1,c.writableStream(n)?i=n:c.string(n)?(i=l.createWriteStream(n),s=!0):r=n,(r=r||{}).process&&(r.subres=r.subres||{},r.subres["x-oss-process"]=r.process),u=void 0,e.prev=6,(h=this._objectRequestParams("GET",t,r)).writeStream=i,h.successStatuses=[200,206,304],e.next=12,this.request(h);case 12:u=e.sent,s&&i.destroy(),e.next=24;break;case 16:if(e.prev=16,e.t0=e.catch(6),!s){e.next=23;break}return i.destroy(),a("get error: %s, delete the exists file %s",e.t0,n),e.next=23,this._deleteFileSafe(n);case 23:throw e.t0;case 24:return e.abrupt("return",{res:u.res,content:u.data});case 25:case"end":return e.stop()}}),e,this,[[6,16]])})),g.getStream=o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=n||{},(r=this._objectRequestParams("GET",t,n)).customResponse=!0,r.successStatuses=[200,206,304],e.next=6,this.request(r);case 6:return i=e.sent,e.abrupt("return",{stream:i.res,res:{status:i.status,headers:i.headers}});case 8:case"end":return e.stop()}}),e,this)})),g.delete=o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=this._objectRequestParams("DELETE",t,n)).successStatuses=[204],e.next=4,this.request(r);case 4:return i=e.sent,e.abrupt("return",{res:i.res});case 6:case"end":return e.stop()}}),e,this)})),g.deleteMulti=o.default.mark((function e(t,n){var r,i,l,c,u,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r='<?xml version="1.0" encoding="UTF-8"?>\n<Delete>\n',(n=n||{}).quiet?r+=" <Quiet>true</Quiet>\n":r+=" <Quiet>false</Quiet>\n",i=0;i<t.length;i++)r+=" <Object><Key>"+s.escape(this._objectName(t[i]))+"</Key></Object>\n";return a("delete multi objects: %s",r+="</Delete>"),n.subres="delete",(l=this._objectRequestParams("POST","",n)).mime="xml",l.content=r,l.xmlResponse=!0,l.successStatuses=[200],e.next=14,this.request(l);case 14:return c=e.sent,u=c.data,(h=u&&u.Deleted||null)&&(Array.isArray(h)||(h=[h]),h=h.map((function(e){return e.Key}))),e.abrupt("return",{res:c.res,deleted:h});case 19:case"end":return e.stop()}}),e,this)})),g.copy=o.default.mark((function e(t,n,r){var a,s,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=r||{}).headers=r.headers||{},(0,i.default)(r.headers).forEach((function(e){r.headers["x-oss-copy-source-"+e.toLowerCase()]=r.headers[e]})),r.meta&&(r.headers["x-oss-metadata-directive"]="REPLACE"),this._convertMetaToHeaders(r.meta,r.headers),n="/"!==n[0]?"/"+this.options.bucket+"/"+encodeURIComponent(n):"/"+encodeURIComponent(n.slice(1)),r.headers["x-oss-copy-source"]=n,(a=this._objectRequestParams("PUT",t,r)).xmlResponse=!0,a.successStatuses=[200,304],e.next=12,this.request(a);case 12:return s=e.sent,(l=s.data)&&(l={etag:l.ETag,lastModified:l.LastModified}),e.abrupt("return",{data:l,res:s.res});case 16:case"end":return e.stop()}}),e,this)})),g.putMeta=o.default.mark((function e(t,n,r){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.copy(t,t,{meta:n||{},timeout:r&&r.timeout,ctx:r&&r.ctx});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})),g.list=o.default.mark((function e(t,n){var r,i,a,s,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=this._objectRequestParams("GET","",n)).query=t,r.xmlResponse=!0,r.successStatuses=[200],e.next=6,this.request(r);case 6:return i=e.sent,a=i.data.Contents,s=this,a&&(Array.isArray(a)||(a=[a]),a=a.map((function(e){return{name:e.Key,url:s._objectUrl(e.Key),lastModified:e.LastModified,etag:e.ETag,type:e.Type,size:Number(e.Size),storageClass:e.StorageClass,owner:{id:e.Owner.ID,displayName:e.Owner.DisplayName}}}))),(l=i.data.CommonPrefixes||null)&&(Array.isArray(l)||(l=[l]),l=l.map((function(e){return e.Prefix}))),e.abrupt("return",{res:i.res,objects:a,prefixes:l,nextMarker:i.data.NextMarker||null,isTruncated:"true"===i.data.IsTruncated});case 13:case"end":return e.stop()}}),e,this)})),g.putACL=o.default.mark((function e(t,n,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=r||{}).subres="acl",r.headers=r.headers||{},r.headers["x-oss-object-acl"]=n,t=this._objectName(t),(i=this._objectRequestParams("PUT",t,r)).successStatuses=[200],e.next=9,this.request(i);case 9:return a=e.sent,e.abrupt("return",{res:a.res});case 11:case"end":return e.stop()}}),e,this)})),g.getACL=o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=n||{}).subres="acl",t=this._objectName(t),(r=this._objectRequestParams("GET",t,n)).successStatuses=[200],r.xmlResponse=!0,e.next=8,this.request(r);case 8:return i=e.sent,e.abrupt("return",{acl:i.data.AccessControlList.Grant,owner:{id:i.data.Owner.ID,displayName:i.data.Owner.DisplayName},res:i.res});case 10:case"end":return e.stop()}}),e,this)})),g.restore=o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=n||{}).subres="restore",(r=this._objectRequestParams("POST",t,n)).successStatuses=[202],e.next=6,this.request(r);case 6:return i=e.sent,e.abrupt("return",{res:i.res});case 8:case"end":return e.stop()}}),e,this)})),g.signatureUrl=function(e,t){t=t||{},e=this._objectName(e),t.method=t.method||"GET";var n=s.timestamp()+(t.expires||1800),r={bucket:this.options.bucket,object:e},i=this._getResource(r);this.options.stsToken&&(t["security-token"]=this.options.stsToken);var o=m._signatureForURL(this.options.accessKeySecret,t,i,n),a=u.parse(this._getReqUrl(r));return a.query={OSSAccessKeyId:this.options.accessKeyId,Expires:n,Signature:o.Signature},h(o.subResource).to(a.query),a.format()},g.getObjectUrl=function(e,t){return t?"/"!==t[t.length-1]&&(t+="/"):t=this.options.endpoint.format(),t+this._escape(this._objectName(e))},g._objectUrl=function(e){return this._getReqUrl({bucket:this.options.bucket,object:e})},g.generateObjectUrl=function(e,t){if(t)"/"!==t[t.length-1]&&(t+="/");else{t=this.options.endpoint.format();var n=u.parse(t),r=this.options.bucket;n.hostname=r+"."+n.hostname,n.host=r+"."+n.host,t=n.format()}return t+this._escape(this._objectName(e))},g._objectRequestParams=function(e,t,n){if(!this.options.bucket)throw new Error("Please create a bucket first");n=n||{};var r={object:t=this._objectName(t),bucket:this.options.bucket,method:e,subres:n&&n.subres,timeout:n&&n.timeout,ctx:n&&n.ctx};return n.headers&&(r.headers={},h(n.headers).to(r.headers)),r},g._objectName=function(e){return e.replace(/^\/+/,"")},g._statFile=function(e){return function(t){l.stat(e,t)}},g._convertMetaToHeaders=function(e,t){e&&(0,i.default)(e).forEach((function(n){t["x-oss-meta-"+n]=e[n]}))},g._deleteFileSafe=function(e){return function(t){l.exists(e,(function(n){n?l.unlink(e,(function(n){n&&a("unlink %j error: %s",e,n),t()})):t()}))}}},{"../common/callback":7,"../common/signUtils":9,"babel-runtime/core-js/object/keys":23,"babel-runtime/regenerator":33,"copy-to":43,debug:155,fs:36,"is-type-of":165,mime:242,path:170,url:203,utility:243}],5:[function(e,t,n){"use strict";n.version="5.3.1"},{}],6:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return e&&"function"==typeof e.next&&"function"==typeof e.throw}function o(e){if(!e)return!1;var t=e.constructor;return!!t&&("GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName||i(t.prototype)||i(e.prototype))}function a(e,t){var n=new e(t),r=(0,c.default)(n),i=(0,c.default)((0,l.default)(n));r.concat(i).forEach((function(e){o(n[e])?this[e]=u.wrap(n[e]).bind(n):this[e]=n[e]}),this)}function s(e){if(!(this instanceof s))return new s(e);a.call(this,h,e)}var l=r(e("babel-runtime/core-js/object/get-prototype-of")),c=r(e("babel-runtime/core-js/object/keys")),u=e("co"),h=e("./client");t.exports=s,s.STS=function e(t){if(!(this instanceof e))return new e(t);a.call(this,h.STS,t)}},{"./client":2,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/core-js/object/keys":23,co:41}],7:[function(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=r(e("babel-runtime/core-js/object/keys")),o=r(e("babel-runtime/core-js/json/stringify"));n.encodeCallback=function(e,n){if(e.headers=e.headers||{},!Object.prototype.hasOwnProperty.call(e.headers,"x-oss-callback")&&n.callback){var r={callbackUrl:encodeURI(n.callback.url),callbackBody:n.callback.body};n.callback.host&&(r.callbackHost=n.callback.host),n.callback.contentType&&(r.callbackBodyType=n.callback.contentType);var a=new t((0,o.default)(r)).toString("base64");if(e.headers["x-oss-callback"]=a,n.callback.customValue){var s={};(0,i.default)(n.callback.customValue).forEach((function(e){s["x:"+e]=n.callback.customValue[e]})),e.headers["x-oss-callback-var"]=new t((0,o.default)(s)).toString("base64")}}}}).call(this,e("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38}],8:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/regenerator")),i=e("copy-to"),o=e("./callback"),a=n;a.listUploads=r.default.mark((function e(t,n){var o,a,s,l;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={},i(n=n||{}).to(o),o.subres="uploads",(a=this._objectRequestParams("GET","",o)).query=t,a.xmlResponse=!0,a.successStatuses=[200],e.next=10,this.request(a);case 10:return s=e.sent,l=s.data.Upload||[],Array.isArray(l)||(l=[l]),l=l.map((function(e){return{name:e.Key,uploadId:e.UploadId,initiated:e.Initiated}})),e.abrupt("return",{res:s.res,uploads:l,bucket:s.data.Bucket,nextKeyMarker:s.data.NextKeyMarker,nextUploadIdMarker:s.data.NextUploadIdMarker,isTruncated:"true"===s.data.IsTruncated});case 15:case"end":return e.stop()}}),e,this)})),a.listParts=r.default.mark((function e(t,n,o,a){var s,l,c;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s={},i(a=a||{}).to(s),s.subres={uploadId:n},(l=this._objectRequestParams("GET",t,s)).query=o,l.xmlResponse=!0,l.successStatuses=[200],e.next=10,this.request(l);case 10:return c=e.sent,e.abrupt("return",{res:c.res,uploadId:c.data.UploadId,bucket:c.data.Bucket,name:c.data.Key,partNumberMarker:c.data.PartNumberMarker,nextPartNumberMarker:c.data.NextPartNumberMarker,maxParts:c.data.MaxParts,isTruncated:c.data.IsTruncated,parts:c.data.Part||[]});case 12:case"end":return e.stop()}}),e,this)})),a.abortMultipartUpload=r.default.mark((function e(t,n,o){var a,s,l;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.cancel(),a={},i(o=o||{}).to(a),a.subres={uploadId:n},(s=this._objectRequestParams("DELETE",t,a)).successStatuses=[204],e.next=9,this.request(s);case 9:return l=e.sent,e.abrupt("return",{res:l.res});case 11:case"end":return e.stop()}}),e,this)})),a.initMultipartUpload=r.default.mark((function e(t,n){var o,a,s;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={},i(n=n||{}).to(o),o.headers=o.headers||{},this._convertMetaToHeaders(n.meta,o.headers),o.subres="uploads",(a=this._objectRequestParams("POST",t,o)).mime=n.mime,a.xmlResponse=!0,a.successStatuses=[200],e.next=12,this.request(a);case 12:return s=e.sent,e.abrupt("return",{res:s.res,bucket:s.data.Bucket,name:s.data.Key,uploadId:s.data.UploadId});case 14:case"end":return e.stop()}}),e,this)})),a.uploadPart=r.default.mark((function e(t,n,i,o,a,s,l){var c;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c={stream:this._createStream(o,a,s),size:s-a},e.next=3,this._uploadPart(t,n,i,c,l);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})),a.completeMultipartUpload=r.default.mark((function e(t,n,a,s){var l,c,u,h,d,f,p,m;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(l=a.concat().sort((function(e,t){return e.number-t.number})).filter((function(e,t,n){return!t||e.number!==n[t-1].number})),c='<?xml version="1.0" encoding="UTF-8"?>\n<CompleteMultipartUpload>\n',u=0;u<l.length;u++)h=l[u],c+="<Part>\n",c+="<PartNumber>"+h.number+"</PartNumber>\n",c+="<ETag>"+h.etag+"</ETag>\n",c+="</Part>\n";return c+="</CompleteMultipartUpload>",d={},i(s=s||{}).to(d),d.subres={uploadId:n},f=this._objectRequestParams("POST",t,d),o.encodeCallback(f,d),f.mime="xml",f.content=c,f.headers&&f.headers["x-oss-callback"]||(f.xmlResponse=!0),f.successStatuses=[200],e.next=16,this.request(f);case 16:return p=e.sent,m={res:p.res,bucket:f.bucket,name:t,etag:p.res.headers.etag},f.headers&&f.headers["x-oss-callback"]&&(m.data=JSON.parse(p.data.toString())),e.abrupt("return",m);case 20:case"end":return e.stop()}}),e,this)})),a._uploadPart=r.default.mark((function e(t,n,o,a,s){var l,c,u;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l={},i(s=s||{}).to(l),l.headers={"Content-Length":a.size},l.subres={partNumber:o,uploadId:n},(c=this._objectRequestParams("PUT",t,l)).mime=l.mime,c.stream=a.stream,c.successStatuses=[200],e.next=11,this.request(c);case 11:return u=e.sent,a.stream=null,c.stream=null,e.abrupt("return",{name:t,etag:u.res.headers.etag,res:u.res});case 15:case"end":return e.stop()}}),e,this)}))},{"./callback":7,"babel-runtime/regenerator":33,"copy-to":43}],9:[function(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=r(e("babel-runtime/core-js/json/stringify")),o=r(e("babel-runtime/core-js/object/keys")),a=e("./../../shims/crypto/crypto.js"),s=e("is-type-of");n.buildCanonicalizedResource=function(e,t){var n=""+e,r="?";if(s.string(t)&&""!==t.trim())n+=r+t;else if(s.array(t))t.sort(),n+=r+t.join("&");else if(t){(0,o.default)(t).sort((function(e,t){return e[0]>t[0]?1:e[0]<t[0]?-1:0})).forEach((function(e){n+=r+e,t[e]&&(n+="="+t[e]),r="&"}))}return n},n.buildCanonicalString=function(e,t,n,r){var i=(n=n||{}).headers||{},a=[],s={},l=[e.toUpperCase(),i["Content-Md5"]||"",i["Content-Type"]||i["Content-Type".toLowerCase()],r||i["x-oss-date"]];return(0,o.default)(i).forEach((function(e){var t=e.toLowerCase();0===t.indexOf("x-oss-")&&(s[t]=String(i[e]).trim())})),(0,o.default)(s).sort().forEach((function(e){a.push(e+":"+s[e])})),(l=l.concat(a)).push(this.buildCanonicalizedResource(t,n.parameters)),l.join("\n")},n.computeSignature=function(e,n){return a.createHmac("sha1",e).update(new t(n,"utf8")).digest("base64")},n.authorization=function(e,t,n){return"OSS "+e+":"+this.computeSignature(t,n)},n._signatureForURL=function(e,n,r,a){var s={},l={};if(n.process&&(l["x-oss-process"]=n.process),n.response&&(0,o.default)(n.response).forEach((function(e){var t="response-"+e.toLowerCase();l[t]=n.response[e]})),(0,o.default)(n).forEach((function(e){var t=e.toLowerCase(),r=n[e];0===t.indexOf("x-oss-")?s[t]=r:0===t.indexOf("content-md5")||0===t.indexOf("content-type")?s[e]=r:"expires"!==t&&"response"!==t&&"process"!==t&&"method"!==t&&(l[t]=r)})),Object.prototype.hasOwnProperty.call(n,"security-token")&&(l["security-token"]=n["security-token"]),Object.prototype.hasOwnProperty.call(n,"callback")){var c={callbackUrl:encodeURI(n.callback.url),callbackBody:n.callback.body};if(n.callback.host&&(c.callbackHost=n.callback.host),n.callback.contentType&&(c.callbackBodyType=n.callback.contentType),l.callback=new t((0,i.default)(c)).toString("base64"),n.callback.customValue){var u={};(0,o.default)(n.callback.customValue).forEach((function(e){u["x:"+e]=n.callback.customValue[e]})),l["callback-var"]=new t((0,i.default)(u)).toString("base64")}}var h=this.buildCanonicalString(n.method,r,{headers:s,parameters:l},a.toString());return{Signature:this.computeSignature(e,h),subResource:l}}}).call(this,e("buffer").Buffer)},{"./../../shims/crypto/crypto.js":237,"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/keys":23,buffer:38,"is-type-of":165}],10:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/regenerator")),i=e("co"),o=e("co-priority-queue"),a=e("any-promise"),s=n;s._thunkPool=function(e,t){function n(e,t){++c===e.length&&t(u)}function s(e,t){function n(){var n;return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=void 0;case 1:if(l.isCancel()){r.next=9;break}return r.next=4,c.next();case 4:return n=r.sent,r.next=7,n();case 7:r.next=1;break;case 9:(h+=1)===e&&(c.fns=[],c.buffer=[],t(u));case 11:case"end":return r.stop()}}),s,this)}function a(e){console.error(e.stack)}for(var s=r.default.mark(n),c=new o,h=0,d=0;d<e;d++)i(n).catch(a);return function(e,t){return function(n){c.push(r.default.mark((function t(){return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=n,t.next=4,e;case 4:t.t1=t.sent,(0,t.t0)(null,t.t1),t.next=11;break;case 8:t.prev=8,t.t2=t.catch(0),n(t.t2);case 11:case"end":return t.stop()}}),t,this,[[0,8]])})),t)}}}var l=this,c=0,u=[];return new a((function(o){function a(t){return r.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,h(e[t]);case 2:n(e,o);case 3:case"end":return r.stop()}}),c,this)}function l(t){u.push(t),n(e,o)}for(var c=r.default.mark(a),h=new s(t,o),d=0;d<e.length;d++)i(a(d)).catch(l)}))},s.cancel=function(){this.options.cancelFlag=!0},s.isCancel=function(){return this.options.cancelFlag},s.resetCancelFlag=function(){this.options.cancelFlag=!1}},{"any-promise":13,"babel-runtime/regenerator":33,co:41,"co-priority-queue":40}],11:[function(e,t,n){"use strict";n._isIP=function(e){return/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/.test(e)||/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/.test(e)}},{}],12:[function(e,t,n){function r(){}t.exports=r,t.exports.HttpsAgent=r},{}],13:[function(e,t,n){t.exports=e("./register")().Promise},{"./register":15}],14:[function(e,t,n){"use strict";var r=null;t.exports=function(e,t){return function(n,i){n=n||null;var o=!1!==(i=i||{}).global;if(null===r&&o&&(r=e["@@any-promise/REGISTRATION"]||null),null!==r&&null!==n&&r.implementation!==n)throw new Error('any-promise already defined as "'+r.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return null===r&&(r=null!==n&&void 0!==i.Promise?{Promise:i.Promise,implementation:n}:t(n),o&&(e["@@any-promise/REGISTRATION"]=r)),r}}},{}],15:[function(e,t,n){"use strict";t.exports=e("./loader")(window,(function(){if(void 0===window.Promise)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}}))},{"./loader":14}],16:[function(e,t,n){t.exports={default:e("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":44}],17:[function(e,t,n){t.exports={default:e("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":45}],18:[function(e,t,n){t.exports={default:e("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":46}],19:[function(e,t,n){t.exports={default:e("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":47}],20:[function(e,t,n){t.exports={default:e("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":48}],21:[function(e,t,n){t.exports={default:e("core-js/library/fn/object/get-own-property-names"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-names":49}],22:[function(e,t,n){t.exports={default:e("core-js/library/fn/object/get-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/get-prototype-of":50}],23:[function(e,t,n){t.exports={default:e("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":51}],24:[function(e,t,n){t.exports={default:e("core-js/library/fn/promise"),__esModule:!0}},{"core-js/library/fn/promise":52}],25:[function(e,t,n){t.exports={default:e("core-js/library/fn/set-immediate"),__esModule:!0}},{"core-js/library/fn/set-immediate":53}],26:[function(e,t,n){t.exports={default:e("core-js/library/fn/string/from-code-point"),__esModule:!0}},{"core-js/library/fn/string/from-code-point":54}],27:[function(e,t,n){t.exports={default:e("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":56}],28:[function(e,t,n){t.exports={default:e("core-js/library/fn/symbol/has-instance"),__esModule:!0}},{"core-js/library/fn/symbol/has-instance":55}],29:[function(e,t,n){t.exports={default:e("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":57}],30:[function(e,t,n){"use strict";n.__esModule=!0,n.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},{}],31:[function(e,t,n){"use strict";n.__esModule=!0;var r=function(e){return e&&e.__esModule?e:{default:e}}(e("../core-js/object/define-property"));n.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),(0,r.default)(e,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},{"../core-js/object/define-property":20}],32:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=r(e("../core-js/symbol/iterator")),o=r(e("../core-js/symbol")),a="function"==typeof o.default&&"symbol"==typeof i.default?function(e){return typeof e}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};n.default="function"==typeof o.default&&"symbol"===a(i.default)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":void 0===e?"undefined":a(e)}},{"../core-js/symbol":27,"../core-js/symbol/iterator":29}],33:[function(e,t,n){t.exports=e("regenerator-runtime")},{"regenerator-runtime":191}],34:[function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function i(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}function o(e,t,n){for(var r,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i(r));return o.join("")}n.byteLength=function(e){var t=r(e),n=t[0],i=t[1];return 3*(n+i)/4-i},n.toByteArray=function(e){for(var t,n=r(e),i=n[0],o=n[1],a=new l(function(e,t,n){return 3*(t+n)/4-n}(0,i,o)),c=0,u=o>0?i-4:i,h=0;h<u;h+=4)t=s[e.charCodeAt(h)]<<18|s[e.charCodeAt(h+1)]<<12|s[e.charCodeAt(h+2)]<<6|s[e.charCodeAt(h+3)],a[c++]=t>>16&255,a[c++]=t>>8&255,a[c++]=255&t;return 2===o&&(t=s[e.charCodeAt(h)]<<2|s[e.charCodeAt(h+1)]>>4,a[c++]=255&t),1===o&&(t=s[e.charCodeAt(h)]<<10|s[e.charCodeAt(h+1)]<<4|s[e.charCodeAt(h+2)]>>2,a[c++]=t>>8&255,a[c++]=255&t),a},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i=[],s=0,l=n-r;s<l;s+=16383)i.push(o(e,s,s+16383>l?l:s+16383));return 1===r?(t=e[n-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"=")),i.join("")};for(var a=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,h=c.length;u<h;++u)a[u]=c[u],s[c.charCodeAt(u)]=u;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],35:[function(e,t,n){!function(e,n,r){void 0!==t&&t.exports?t.exports=r():e.bowser=r()}(this,0,(function(){function e(e){function t(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var r,i=t(/(ipod|iphone|ipad)/i).toLowerCase(),a=!/like android/i.test(e)&&/android/i.test(e),s=/nexus\s*[0-6]\s*/i.test(e),l=!s&&/nexus\s*[0-9]+/i.test(e),c=/CrOS/.test(e),u=/silk/i.test(e),h=/sailfish/i.test(e),d=/tizen/i.test(e),f=/(web|hpw)os/i.test(e),p=/windows phone/i.test(e),m=(/SamsungBrowser/i.test(e),!p&&/windows/i.test(e)),g=!i&&!u&&/macintosh/i.test(e),v=!a&&!h&&!d&&!f&&/linux/i.test(e),y=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),b=t(/version\/(\d+(\.\d+)?)/i),_=/tablet/i.test(e)&&!/tablet pc/i.test(e),E=!_&&/[^-]mobi/i.test(e),x=/xbox/i.test(e);/opera/i.test(e)?r={name:"Opera",opera:o,version:b||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?r={name:"Opera",opera:o,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||b}:/SamsungBrowser/i.test(e)?r={name:"Samsung Internet for Android",samsungBrowser:o,version:b||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?r={name:"Opera Coast",coast:o,version:b||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?r={name:"Yandex Browser",yandexbrowser:o,version:b||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?r={name:"UC Browser",ucbrowser:o,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?r={name:"Maxthon",maxthon:o,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?r={name:"Epiphany",epiphany:o,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?r={name:"Puffin",puffin:o,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?r={name:"Sleipnir",sleipnir:o,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?r={name:"K-Meleon",kMeleon:o,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:p?(r={name:"Windows Phone",osname:"Windows Phone",windowsphone:o},y?(r.msedge=o,r.version=y):(r.msie=o,r.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?r={name:"Internet Explorer",msie:o,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:c?r={name:"Chrome",osname:"Chrome OS",chromeos:o,chromeBook:o,chrome:o,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?r={name:"Microsoft Edge",msedge:o,version:y}:/vivaldi/i.test(e)?r={name:"Vivaldi",vivaldi:o,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||b}:h?r={name:"Sailfish",osname:"Sailfish OS",sailfish:o,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?r={name:"SeaMonkey",seamonkey:o,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(r={name:"Firefox",firefox:o,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(r.firefoxos=o,r.osname="Firefox OS")):u?r={name:"Amazon Silk",silk:o,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?r={name:"PhantomJS",phantom:o,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?r={name:"SlimerJS",slimer:o,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?r={name:"BlackBerry",osname:"BlackBerry OS",blackberry:o,version:b||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:f?(r={name:"WebOS",osname:"WebOS",webos:o,version:b||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(r.touchpad=o)):/bada/i.test(e)?r={name:"Bada",osname:"Bada",bada:o,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:d?r={name:"Tizen",osname:"Tizen",tizen:o,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||b}:/qupzilla/i.test(e)?r={name:"QupZilla",qupzilla:o,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||b}:/chromium/i.test(e)?r={name:"Chromium",chromium:o,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||b}:/chrome|crios|crmo/i.test(e)?r={name:"Chrome",chrome:o,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?r={name:"Android",version:b}:/safari|applewebkit/i.test(e)?(r={name:"Safari",safari:o},b&&(r.version=b)):i?(r={name:"iphone"==i?"iPhone":"ipad"==i?"iPad":"iPod"},b&&(r.version=b)):r=/googlebot/i.test(e)?{name:"Googlebot",googlebot:o,version:t(/googlebot\/(\d+(\.\d+))/i)||b}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!r.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(r.name=r.name||"Blink",r.blink=o):(r.name=r.name||"Webkit",r.webkit=o),!r.version&&b&&(r.version=b)):!r.opera&&/gecko\//i.test(e)&&(r.name=r.name||"Gecko",r.gecko=o,r.version=r.version||t(/gecko\/(\d+(\.\d+)?)/i)),r.windowsphone||!a&&!r.silk?!r.windowsphone&&i?(r[i]=o,r.ios=o,r.osname="iOS"):g?(r.mac=o,r.osname="macOS"):x?(r.xbox=o,r.osname="Xbox"):m?(r.windows=o,r.osname="Windows"):v&&(r.linux=o,r.osname="Linux"):(r.android=o,r.osname="Android");var w="";r.windows?w=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)):r.windowsphone?w=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):r.mac?w=(w=t(/Mac OS X (\d+([_\.\s]\d+)*)/i)).replace(/[_\s]/g,"."):i?w=(w=t(/os (\d+([_\s]\d+)*) like mac os x/i)).replace(/[_\s]/g,"."):a?w=t(/android[ \/-](\d+(\.\d+)*)/i):r.webos?w=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):r.blackberry?w=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):r.bada?w=t(/bada\/(\d+(\.\d+)*)/i):r.tizen&&(w=t(/tizen[\/\s](\d+(\.\d+)*)/i)),w&&(r.osversion=w);var S=!r.windows&&w.split(".")[0];return _||l||"ipad"==i||a&&(3==S||S>=4&&!E)||r.silk?r.tablet=o:(E||"iphone"==i||"ipod"==i||a||s||r.blackberry||r.webos||r.bada)&&(r.mobile=o),r.msedge||r.msie&&r.version>=10||r.yandexbrowser&&r.version>=15||r.vivaldi&&r.version>=1||r.chrome&&r.version>=20||r.samsungBrowser&&r.version>=4||r.firefox&&r.version>=20||r.safari&&r.version>=6||r.opera&&r.version>=10||r.ios&&r.osversion&&r.osversion.split(".")[0]>=6||r.blackberry&&r.version>=10.1||r.chromium&&r.version>=20?r.a=o:r.msie&&r.version<10||r.chrome&&r.version<20||r.firefox&&r.version<20||r.safari&&r.version<6||r.opera&&r.version<10||r.ios&&r.osversion&&r.osversion.split(".")[0]<6||r.chromium&&r.version<20?r.c=o:r.x=o,r}function t(e){return e.split(".").length}function n(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n++)r.push(t(e[n]));return r}function r(e){for(var r=Math.max(t(e[0]),t(e[1])),i=n(e,(function(e){var i=r-t(e);return n((e+=new Array(i+1).join(".0")).split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));--r>=0;){if(i[0][r]>i[1][r])return 1;if(i[0][r]!==i[1][r])return-1;if(0===r)return 0}}function i(t,n,i){var o=a;"string"==typeof n&&(i=n,n=void 0),void 0===n&&(n=!1),i&&(o=e(i));var s=""+o.version;for(var l in t)if(t.hasOwnProperty(l)&&o[l]){if("string"!=typeof t[l])throw new Error("Browser version in the minVersion map should be a string: "+l+": "+String(t));return r([s,t[l]])<0}return n}var o=!0,a=e("undefined"!=typeof navigator&&navigator.userAgent||"");return a.test=function(e){for(var t=0;t<e.length;++t){var n=e[t];if("string"==typeof n&&n in a)return!0}return!1},a.isUnsupportedBrowser=i,a.compareVersions=r,a.check=function(e,t,n){return!i(e,t,n)},a._detect=e,a.detect=e,a}))},{}],36:[function(e,t,n){},{}],37:[function(e,t,n){function r(e){return e.toString(this.encoding)}function i(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function o(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=e("buffer").Buffer,s=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},l=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!s(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=i;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=o;break;default:return void(this.write=r)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};l.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";if(e=e.slice(n,e.length),!((i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived);var i;r=(t+=e.toString(this.encoding,0,r)).length-1;if((i=t.charCodeAt(r))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,r)}return t},l.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},l.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{buffer:38}],38:[function(e,n,r){(function(t){"use strict";function n(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=o.prototype:(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,n){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return a(this,e,t,n)}function a(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),o.TYPED_ARRAY_SUPPORT?(e=t).__proto__=o.prototype:e=c(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),a=(e=i(e,r)).write(t,n);return a!==r&&(e=e.slice(0,a)),e}(e,t,n):function(e,t){if(o.isBuffer(t)){var n=0|u(t.length);return 0===(e=i(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?i(e,0):c(e,t);if("Buffer"===t.type&&G(t.data))return c(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(s(t),e=i(e,t<0?0:0|u(t)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t){var n=t.length<0?0:0|u(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function u(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return P(e).length;t=(""+t).toLowerCase(),r=!0}}function d(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return w(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function p(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var a,s=1,l=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,l/=2,c/=2,n/=2}if(i){var u=-1;for(a=n;a<l;a++)if(o(e,a)===o(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===c)return u*s}else-1!==u&&(a-=a-u),u=-1}else for(n+c>l&&(n=l-c),a=n;a>=0;a--){for(var h=!0,d=0;d<c;d++)if(o(e,a+d)!==o(t,d)){h=!1;break}if(h)return a}return-1}function g(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function v(e,t,n,r){return B(P(t,e.length-n),e,n,r)}function y(e,t,n,r){return B(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function b(e,t,n,r){return y(e,t,n,r)}function _(e,t,n,r){return B(j(t),e,n,r)}function E(e,t,n,r){return B(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function x(e,t,n){return 0===t&&n===e.length?F.fromByteArray(e):F.fromByteArray(e.slice(t,n))}function w(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,l,c=e[i],u=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(u=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=h}return function(e){var t=e.length;if(t<=z)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=z));return n}(r)}function S(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function k(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function C(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=N(e[o]);return i}function T(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function O(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,i){return i||D(e,0,n,4),U.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,i){return i||D(e,0,n,8),U.write(e,t,n,r,52,8),n+8}function N(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return F.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}var F=e("base64-js"),U=e("ieee754"),G=e("isarray");r.Buffer=o,r.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},r.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),r.kMaxLength=n(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return function(e,t,n,r){return s(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}(null,e,t,n)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!G(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=o.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):d.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),l=Math.min(a,s),c=this.slice(r,i),u=e.slice(t,n),h=0;h<l;++h)if(c[h]!==u[h]){a=c[h],s=u[h];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},o.prototype.indexOf=function(e,t,n){return p(this,e,t,n,!0)},o.prototype.lastIndexOf=function(e,t,n){return p(this,e,t,n,!1)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return b(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var z=4096;o.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),o.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=o.prototype;else{var i=t-e;n=new o(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},o.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},o.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),U.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),U.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),U.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),U.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var s=o.isBuffer(e)?e:P(new o(e,r).toString()),l=s.length;for(a=0;a<n-t;++a)this[a+t]=s[a%l]}return this};var H=/[^+\/0-9A-Za-z-_]/g}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":34,ieee754:161,isarray:166}],39:[function(e,t,n){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],40:[function(e,t,n){"use strict";var r=function(){this.buffer=[],this.fns=[]};r.prototype.push=function(e,t){if(this.fns.length)return this.fns.shift()(null,e);var n={data:e,priority:t},r=i(this.buffer,n,(function(e){return e.priority}));this.buffer.splice(r,0,n)},r.prototype.next=function(){var e=this;return function(t){if(e.buffer.length)return t(null,e.buffer.pop().data);e.fns.push(t)}};var i=function(e,t,n){t=n(t);for(var r=0,i=e?e.length:r;r<i;){var o=r+i>>>1;n(e[o])<t?r=o+1:i=o}return r};t.exports=r},{}],41:[function(e,t,n){function r(e){var t=this,n=u.call(arguments,1);return new Promise((function(r,o){function a(t){var n;try{n=e.next(t)}catch(e){return o(e)}c(n)}function s(t){var n;try{n=e.throw(t)}catch(e){return o(e)}c(n)}function c(e){if(e.done)return r(e.value);var n=i.call(t,e.value);return n&&l(n)?n.then(a,s):s(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(e.value)+'"'))}if("function"==typeof e&&(e=e.apply(t,n)),!e||"function"!=typeof e.next)return r(e);a()}))}function i(e){return e?l(e)?e:function(e){var t=e.constructor;return!!t&&("GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName||c(t.prototype))}(e)||c(e)?r.call(this,e):"function"==typeof e?o.call(this,e):Array.isArray(e)?a.call(this,e):function(e){return Object==e.constructor}(e)?s.call(this,e):e:e}function o(e){var t=this;return new Promise((function(n,r){e.call(t,(function(e,t){if(e)return r(e);arguments.length>2&&(t=u.call(arguments,1)),n(t)}))}))}function a(e){return Promise.all(e.map(i,this))}function s(e){for(var t=new e.constructor,n=Object.keys(e),r=[],o=0;o<n.length;o++){var a=n[o],s=i.call(this,e[a]);s&&l(s)?function(e,n){t[n]=void 0,r.push(e.then((function(e){t[n]=e})))}(s,a):t[a]=e[a]}return Promise.all(r).then((function(){return t}))}function l(e){return"function"==typeof e.then}function c(e){return"function"==typeof e.next&&"function"==typeof e.throw}var u=Array.prototype.slice;t.exports=r.default=r.co=r,r.wrap=function(e){function t(){return r.call(this,e.apply(this,arguments))}return t.__generatorFunction__=e,t}},{}],42:[function(e,t,n){t.exports={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,E2BIG:7,EACCES:13,EADDRINUSE:48,EADDRNOTAVAIL:49,EAFNOSUPPORT:47,EAGAIN:35,EALREADY:37,EBADF:9,EBADMSG:94,EBUSY:16,ECANCELED:89,ECHILD:10,ECONNABORTED:53,ECONNREFUSED:61,ECONNRESET:54,EDEADLK:11,EDESTADDRREQ:39,EDOM:33,EDQUOT:69,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:65,EIDRM:90,EILSEQ:92,EINPROGRESS:36,EINTR:4,EINVAL:22,EIO:5,EISCONN:56,EISDIR:21,ELOOP:62,EMFILE:24,EMLINK:31,EMSGSIZE:40,EMULTIHOP:95,ENAMETOOLONG:63,ENETDOWN:50,ENETRESET:52,ENETUNREACH:51,ENFILE:23,ENOBUFS:55,ENODATA:96,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:77,ENOLINK:97,ENOMEM:12,ENOMSG:91,ENOPROTOOPT:42,ENOSPC:28,ENOSR:98,ENOSTR:99,ENOSYS:78,ENOTCONN:57,ENOTDIR:20,ENOTEMPTY:66,ENOTSOCK:38,ENOTSUP:45,ENOTTY:25,ENXIO:6,EOPNOTSUPP:102,EOVERFLOW:84,EPERM:1,EPIPE:32,EPROTO:100,EPROTONOSUPPORT:43,EPROTOTYPE:41,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:70,ETIME:101,ETIMEDOUT:60,ETXTBSY:26,EWOULDBLOCK:35,EXDEV:18,SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGBUS:10,SIGFPE:8,SIGKILL:9,SIGUSR1:30,SIGSEGV:11,SIGUSR2:31,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:20,SIGCONT:19,SIGSTOP:17,SIGTSTP:18,SIGTTIN:21,SIGTTOU:22,SIGURG:16,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:23,SIGSYS:12,SSL_OP_ALL:2147486719,SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION:262144,SSL_OP_CIPHER_SERVER_PREFERENCE:4194304,SSL_OP_CISCO_ANYCONNECT:32768,SSL_OP_COOKIE_EXCHANGE:8192,SSL_OP_CRYPTOPRO_TLSEXT_BUG:2147483648,SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS:2048,SSL_OP_EPHEMERAL_RSA:0,SSL_OP_LEGACY_SERVER_CONNECT:4,SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER:32,SSL_OP_MICROSOFT_SESS_ID_BUG:1,SSL_OP_MSIE_SSLV2_RSA_PADDING:0,SSL_OP_NETSCAPE_CA_DN_BUG:536870912,SSL_OP_NETSCAPE_CHALLENGE_BUG:2,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG:1073741824,SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG:8,SSL_OP_NO_COMPRESSION:131072,SSL_OP_NO_QUERY_MTU:4096,SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION:65536,SSL_OP_NO_SSLv2:16777216,SSL_OP_NO_SSLv3:33554432,SSL_OP_NO_TICKET:16384,SSL_OP_NO_TLSv1:67108864,SSL_OP_NO_TLSv1_1:268435456,SSL_OP_NO_TLSv1_2:134217728,SSL_OP_PKCS1_CHECK_1:0,SSL_OP_PKCS1_CHECK_2:0,SSL_OP_SINGLE_DH_USE:1048576,SSL_OP_SINGLE_ECDH_USE:524288,SSL_OP_SSLEAY_080_CLIENT_DH_BUG:128,SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG:0,SSL_OP_TLS_BLOCK_PADDING_BUG:512,SSL_OP_TLS_D5_BUG:256,SSL_OP_TLS_ROLLBACK_BUG:8388608,ENGINE_METHOD_DSA:2,ENGINE_METHOD_DH:4,ENGINE_METHOD_RAND:8,ENGINE_METHOD_ECDH:16,ENGINE_METHOD_ECDSA:32,ENGINE_METHOD_CIPHERS:64,ENGINE_METHOD_DIGESTS:128,ENGINE_METHOD_STORE:256,ENGINE_METHOD_PKEY_METHS:512,ENGINE_METHOD_PKEY_ASN1_METHS:1024,ENGINE_METHOD_ALL:65535,ENGINE_METHOD_NONE:0,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_UDP_REUSEADDR:4}},{}],43:[function(e,t,n){"use strict";function r(e,t){if(!(this instanceof r))return new r(e,t);this.src=e,this._withAccess=t}function i(e,t){return void 0===e[t]&&void 0===e.__lookupGetter__(t)&&void 0===e.__lookupSetter__(t)}var o=Array.prototype.slice;t.exports=r,r.prototype.withAccess=function(e){return this._withAccess=!1!==e,this},r.prototype.pick=function(e){return Array.isArray(e)||(e=o.call(arguments)),e.length&&(this.keys=e),this},r.prototype.to=function(e){if(e=e||{},!this.src)return e;var t=this.keys||Object.keys(this.src);if(!this._withAccess){for(var n=0;n<t.length;n++)void 0===e[r=t[n]]&&(e[r]=this.src[r]);return e}for(n=0;n<t.length;n++){var r=t[n];if(i(e,r)){var o=this.src.__lookupGetter__(r),a=this.src.__lookupSetter__(r);o&&e.__defineGetter__(r,o),a&&e.__defineSetter__(r,a),o||a||(e[r]=this.src[r])}}return e},r.prototype.toCover=function(e){for(var t=this.keys||Object.keys(this.src),n=0;n<t.length;n++){var r=t[n];delete e[r];var i=this.src.__lookupGetter__(r),o=this.src.__lookupSetter__(r);i&&e.__defineGetter__(r,i),o&&e.__defineSetter__(r,o),i||o||(e[r]=this.src[r])}},r.prototype.override=r.prototype.toCover,r.prototype.and=function(e){var t={};return this.to(t),this.src=e,this.to(t),this.src=t,this}},{}],44:[function(e,t,n){e("../../modules/es6.string.iterator"),e("../../modules/es6.array.from"),t.exports=e("../../modules/_core").Array.from},{"../../modules/_core":65,"../../modules/es6.array.from":133,"../../modules/es6.string.iterator":145}],45:[function(e,t,n){var r=e("../../modules/_core"),i=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(e){return i.stringify.apply(i,arguments)}},{"../../modules/_core":65}],46:[function(e,t,n){e("../../modules/es6.object.assign"),t.exports=e("../../modules/_core").Object.assign},{"../../modules/_core":65,"../../modules/es6.object.assign":136}],47:[function(e,t,n){e("../../modules/es6.object.create");var r=e("../../modules/_core").Object;t.exports=function(e,t){return r.create(e,t)}},{"../../modules/_core":65,"../../modules/es6.object.create":137}],48:[function(e,t,n){e("../../modules/es6.object.define-property");var r=e("../../modules/_core").Object;t.exports=function(e,t,n){return r.defineProperty(e,t,n)}},{"../../modules/_core":65,"../../modules/es6.object.define-property":138}],49:[function(e,t,n){e("../../modules/es6.object.get-own-property-names");var r=e("../../modules/_core").Object;t.exports=function(e){return r.getOwnPropertyNames(e)}},{"../../modules/_core":65,"../../modules/es6.object.get-own-property-names":139}],50:[function(e,t,n){e("../../modules/es6.object.get-prototype-of"),t.exports=e("../../modules/_core").Object.getPrototypeOf},{"../../modules/_core":65,"../../modules/es6.object.get-prototype-of":140}],51:[function(e,t,n){e("../../modules/es6.object.keys"),t.exports=e("../../modules/_core").Object.keys},{"../../modules/_core":65,"../../modules/es6.object.keys":141}],52:[function(e,t,n){e("../modules/es6.object.to-string"),e("../modules/es6.string.iterator"),e("../modules/web.dom.iterable"),e("../modules/es6.promise"),e("../modules/es7.promise.finally"),e("../modules/es7.promise.try"),t.exports=e("../modules/_core").Promise},{"../modules/_core":65,"../modules/es6.object.to-string":142,"../modules/es6.promise":143,"../modules/es6.string.iterator":145,"../modules/es7.promise.finally":147,"../modules/es7.promise.try":148,"../modules/web.dom.iterable":151}],53:[function(e,t,n){e("../modules/web.immediate"),t.exports=e("../modules/_core").setImmediate},{"../modules/_core":65,"../modules/web.immediate":152}],54:[function(e,t,n){e("../../modules/es6.string.from-code-point"),t.exports=e("../../modules/_core").String.fromCodePoint},{"../../modules/_core":65,"../../modules/es6.string.from-code-point":144}],55:[function(e,t,n){e("../../modules/es6.function.has-instance"),t.exports=e("../../modules/_wks-ext").f("hasInstance")},{"../../modules/_wks-ext":130,"../../modules/es6.function.has-instance":135}],56:[function(e,t,n){e("../../modules/es6.symbol"),e("../../modules/es6.object.to-string"),e("../../modules/es7.symbol.async-iterator"),e("../../modules/es7.symbol.observable"),t.exports=e("../../modules/_core").Symbol},{"../../modules/_core":65,"../../modules/es6.object.to-string":142,"../../modules/es6.symbol":146,"../../modules/es7.symbol.async-iterator":149,"../../modules/es7.symbol.observable":150}],57:[function(e,t,n){e("../../modules/es6.string.iterator"),e("../../modules/web.dom.iterable"),t.exports=e("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":130,"../../modules/es6.string.iterator":145,"../../modules/web.dom.iterable":151}],58:[function(e,t,n){t.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},{}],59:[function(e,t,n){t.exports=function(){}},{}],60:[function(e,t,n){t.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},{}],61:[function(e,t,n){var r=e("./_is-object");t.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},{"./_is-object":85}],62:[function(e,t,n){var r=e("./_to-iobject"),i=e("./_to-length"),o=e("./_to-absolute-index");t.exports=function(e){return function(t,n,a){var s,l=r(t),c=i(l.length),u=o(a,c);if(e&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}}},{"./_to-absolute-index":121,"./_to-iobject":123,"./_to-length":124}],63:[function(e,t,n){var r=e("./_cof"),i=e("./_wks")("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},{"./_cof":64,"./_wks":131}],64:[function(e,t,n){var r={}.toString;t.exports=function(e){return r.call(e).slice(8,-1)}},{}],65:[function(e,t,n){var r=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=r)},{}],66:[function(e,t,n){"use strict";var r=e("./_object-dp"),i=e("./_property-desc");t.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},{"./_object-dp":98,"./_property-desc":111}],67:[function(e,t,n){var r=e("./_a-function");t.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":58}],68:[function(e,t,n){t.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},{}],69:[function(e,t,n){t.exports=!e("./_fails")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},{"./_fails":74}],70:[function(e,t,n){var r=e("./_is-object"),i=e("./_global").document,o=r(i)&&r(i.createElement);t.exports=function(e){return o?i.createElement(e):{}}},{"./_global":76,"./_is-object":85}],71:[function(e,t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],72:[function(e,t,n){var r=e("./_object-keys"),i=e("./_object-gops"),o=e("./_object-pie");t.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),l=o.f,c=0;s.length>c;)l.call(e,a=s[c++])&&t.push(a);return t}},{"./_object-gops":103,"./_object-keys":106,"./_object-pie":107}],73:[function(e,t,n){var r=e("./_global"),i=e("./_core"),o=e("./_ctx"),a=e("./_hide"),s=e("./_has"),l=function(e,t,n){var c,u,h,d=e&l.F,f=e&l.G,p=e&l.S,m=e&l.P,g=e&l.B,v=e&l.W,y=f?i:i[t]||(i[t]={}),b=y.prototype,_=f?r:p?r[t]:(r[t]||{}).prototype;for(c in f&&(n=t),n)(u=!d&&_&&void 0!==_[c])&&s(y,c)||(h=u?_[c]:n[c],y[c]=f&&"function"!=typeof _[c]?n[c]:g&&u?o(h,r):v&&_[c]==h?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(h):m&&"function"==typeof h?o(Function.call,h):h,m&&((y.virtual||(y.virtual={}))[c]=h,e&l.R&&b&&!b[c]&&a(b,c,h)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},{"./_core":65,"./_ctx":67,"./_global":76,"./_has":77,"./_hide":78}],74:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],75:[function(e,t,n){var r=e("./_ctx"),i=e("./_iter-call"),o=e("./_is-array-iter"),a=e("./_an-object"),s=e("./_to-length"),l=e("./core.get-iterator-method"),c={},u={};(n=t.exports=function(e,t,n,h,d){var f,p,m,g,v=d?function(){return e}:l(e),y=r(n,h,t?2:1),b=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(o(v)){for(f=s(e.length);f>b;b++)if((g=t?y(a(p=e[b])[0],p[1]):y(e[b]))===c||g===u)return g}else for(m=v.call(e);!(p=m.next()).done;)if((g=i(m,y,p.value,t))===c||g===u)return g}).BREAK=c,n.RETURN=u},{"./_an-object":61,"./_ctx":67,"./_is-array-iter":83,"./_iter-call":86,"./_to-length":124,"./core.get-iterator-method":132}],76:[function(e,t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},{}],77:[function(e,t,n){var r={}.hasOwnProperty;t.exports=function(e,t){return r.call(e,t)}},{}],78:[function(e,t,n){var r=e("./_object-dp"),i=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},{"./_descriptors":69,"./_object-dp":98,"./_property-desc":111}],79:[function(e,t,n){var r=e("./_global").document;t.exports=r&&r.documentElement},{"./_global":76}],80:[function(e,t,n){t.exports=!e("./_descriptors")&&!e("./_fails")((function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a}))},{"./_descriptors":69,"./_dom-create":70,"./_fails":74}],81:[function(e,t,n){t.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},{}],82:[function(e,t,n){var r=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},{"./_cof":64}],83:[function(e,t,n){var r=e("./_iterators"),i=e("./_wks")("iterator"),o=Array.prototype;t.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},{"./_iterators":91,"./_wks":131}],84:[function(e,t,n){var r=e("./_cof");t.exports=Array.isArray||function(e){return"Array"==r(e)}},{"./_cof":64}],85:[function(e,t,n){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],86:[function(e,t,n){var r=e("./_an-object");t.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},{"./_an-object":61}],87:[function(e,t,n){"use strict";var r=e("./_object-create"),i=e("./_property-desc"),o=e("./_set-to-string-tag"),a={};e("./_hide")(a,e("./_wks")("iterator"),(function(){return this})),t.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},{"./_hide":78,"./_object-create":97,"./_property-desc":111,"./_set-to-string-tag":115,"./_wks":131}],88:[function(e,t,n){"use strict";var r=e("./_library"),i=e("./_export"),o=e("./_redefine"),a=e("./_hide"),s=e("./_iterators"),l=e("./_iter-create"),c=e("./_set-to-string-tag"),u=e("./_object-gpo"),h=e("./_wks")("iterator"),d=!([].keys&&"next"in[].keys()),f=function(){return this};t.exports=function(e,t,n,p,m,g,v){l(n,t,p);var y,b,_,E=function(e){if(!d&&e in k)return k[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",w="values"==m,S=!1,k=e.prototype,C=k[h]||k["@@iterator"]||m&&k[m],T=C||E(m),O=m?w?E("entries"):T:void 0,A="Array"==t&&k.entries||C;if(A&&(_=u(A.call(new e)))!==Object.prototype&&_.next&&(c(_,x,!0),r||"function"==typeof _[h]||a(_,h,f)),w&&C&&"values"!==C.name&&(S=!0,T=function(){return C.call(this)}),r&&!v||!d&&!S&&k[h]||a(k,h,T),s[t]=T,s[x]=f,m)if(y={values:w?T:E("values"),keys:g?T:E("keys"),entries:O},v)for(b in y)b in k||o(k,b,y[b]);else i(i.P+i.F*(d||S),t,y);return y}},{"./_export":73,"./_hide":78,"./_iter-create":87,"./_iterators":91,"./_library":92,"./_object-gpo":104,"./_redefine":113,"./_set-to-string-tag":115,"./_wks":131}],89:[function(e,t,n){var r=e("./_wks")("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(e){}t.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},{"./_wks":131}],90:[function(e,t,n){t.exports=function(e,t){return{value:t,done:!!e}}},{}],91:[function(e,t,n){t.exports={}},{}],92:[function(e,t,n){t.exports=!0},{}],93:[function(e,t,n){var r=e("./_uid")("meta"),i=e("./_is-object"),o=e("./_has"),a=e("./_object-dp").f,s=0,l=Object.isExtensible||function(){return!0},c=!e("./_fails")((function(){return l(Object.preventExtensions({}))})),u=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},h=t.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!l(e))return"F";if(!t)return"E";u(e)}return e[r].i},getWeak:function(e,t){if(!o(e,r)){if(!l(e))return!0;if(!t)return!1;u(e)}return e[r].w},onFreeze:function(e){return c&&h.NEED&&l(e)&&!o(e,r)&&u(e),e}}},{"./_fails":74,"./_has":77,"./_is-object":85,"./_object-dp":98,"./_uid":127}],94:[function(e,t,n){var r=e("./_global"),i=e("./_task").set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,l="process"==e("./_cof")(a);t.exports=function(){var e,t,n,c=function(){var r,i;for(l&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(l)n=function(){a.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var u=s.resolve(void 0);n=function(){u.then(c)}}else n=function(){i.call(r,c)};else{var h=!0,d=document.createTextNode("");new o(c).observe(d,{characterData:!0}),n=function(){d.data=h=!h}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},{"./_cof":64,"./_global":76,"./_task":120}],95:[function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=i(t),this.reject=i(n)}var i=e("./_a-function");t.exports.f=function(e){return new r(e)}},{"./_a-function":58}],96:[function(e,t,n){"use strict";var r=e("./_object-keys"),i=e("./_object-gops"),o=e("./_object-pie"),a=e("./_to-object"),s=e("./_iobject"),l=Object.assign;t.exports=!l||e("./_fails")((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=l({},e)[n]||Object.keys(l({},t)).join("")!=r}))?function(e,t){for(var n=a(e),l=arguments.length,c=1,u=i.f,h=o.f;l>c;)for(var d,f=s(arguments[c++]),p=u?r(f).concat(u(f)):r(f),m=p.length,g=0;m>g;)h.call(f,d=p[g++])&&(n[d]=f[d]);return n}:l},{"./_fails":74,"./_iobject":82,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_to-object":125}],97:[function(e,t,n){var r=e("./_an-object"),i=e("./_object-dps"),o=e("./_enum-bug-keys"),a=e("./_shared-key")("IE_PROTO"),s=function(){},l=function(){var t,n=e("./_dom-create")("iframe"),r=o.length;for(n.style.display="none",e("./_html").appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;r--;)delete l.prototype[o[r]];return l()};t.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=l(),void 0===t?n:i(n,t)}},{"./_an-object":61,"./_dom-create":70,"./_enum-bug-keys":71,"./_html":79,"./_object-dps":99,"./_shared-key":116}],98:[function(e,t,n){var r=e("./_an-object"),i=e("./_ie8-dom-define"),o=e("./_to-primitive"),a=Object.defineProperty;n.f=e("./_descriptors")?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},{"./_an-object":61,"./_descriptors":69,"./_ie8-dom-define":80,"./_to-primitive":126}],99:[function(e,t,n){var r=e("./_object-dp"),i=e("./_an-object"),o=e("./_object-keys");t.exports=e("./_descriptors")?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,l=0;s>l;)r.f(e,n=a[l++],t[n]);return e}},{"./_an-object":61,"./_descriptors":69,"./_object-dp":98,"./_object-keys":106}],100:[function(e,t,n){var r=e("./_object-pie"),i=e("./_property-desc"),o=e("./_to-iobject"),a=e("./_to-primitive"),s=e("./_has"),l=e("./_ie8-dom-define"),c=Object.getOwnPropertyDescriptor;n.f=e("./_descriptors")?c:function(e,t){if(e=o(e),t=a(t,!0),l)try{return c(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},{"./_descriptors":69,"./_has":77,"./_ie8-dom-define":80,"./_object-pie":107,"./_property-desc":111,"./_to-iobject":123,"./_to-primitive":126}],101:[function(e,t,n){var r=e("./_to-iobject"),i=e("./_object-gopn").f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},{"./_object-gopn":102,"./_to-iobject":123}],102:[function(e,t,n){var r=e("./_object-keys-internal"),i=e("./_enum-bug-keys").concat("length","prototype");n.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],103:[function(e,t,n){n.f=Object.getOwnPropertySymbols},{}],104:[function(e,t,n){var r=e("./_has"),i=e("./_to-object"),o=e("./_shared-key")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},{"./_has":77,"./_shared-key":116,"./_to-object":125}],105:[function(e,t,n){var r=e("./_has"),i=e("./_to-iobject"),o=e("./_array-includes")(!1),a=e("./_shared-key")("IE_PROTO");t.exports=function(e,t){var n,s=i(e),l=0,c=[];for(n in s)n!=a&&r(s,n)&&c.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~o(c,n)||c.push(n));return c}},{"./_array-includes":62,"./_has":77,"./_shared-key":116,"./_to-iobject":123}],106:[function(e,t,n){var r=e("./_object-keys-internal"),i=e("./_enum-bug-keys");t.exports=Object.keys||function(e){return r(e,i)}},{"./_enum-bug-keys":71,"./_object-keys-internal":105}],107:[function(e,t,n){n.f={}.propertyIsEnumerable},{}],108:[function(e,t,n){var r=e("./_export"),i=e("./_core"),o=e("./_fails");t.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},{"./_core":65,"./_export":73,"./_fails":74}],109:[function(e,t,n){t.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},{}],110:[function(e,t,n){var r=e("./_an-object"),i=e("./_is-object"),o=e("./_new-promise-capability");t.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},{"./_an-object":61,"./_is-object":85,"./_new-promise-capability":95}],111:[function(e,t,n){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],112:[function(e,t,n){var r=e("./_hide");t.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},{"./_hide":78}],113:[function(e,t,n){t.exports=e("./_hide")},{"./_hide":78}],114:[function(e,t,n){"use strict";var r=e("./_global"),i=e("./_core"),o=e("./_object-dp"),a=e("./_descriptors"),s=e("./_wks")("species");t.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},{"./_core":65,"./_descriptors":69,"./_global":76,"./_object-dp":98,"./_wks":131}],115:[function(e,t,n){var r=e("./_object-dp").f,i=e("./_has"),o=e("./_wks")("toStringTag");t.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},{"./_has":77,"./_object-dp":98,"./_wks":131}],116:[function(e,t,n){var r=e("./_shared")("keys"),i=e("./_uid");t.exports=function(e){return r[e]||(r[e]=i(e))}},{"./_shared":117,"./_uid":127}],117:[function(e,t,n){var r=e("./_core"),i=e("./_global"),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:e("./_library")?"pure":"global",copyright:"漏 2018 Denis Pushkarev (zloirock.ru)"})},{"./_core":65,"./_global":76,"./_library":92}],118:[function(e,t,n){var r=e("./_an-object"),i=e("./_a-function"),o=e("./_wks")("species");t.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[o])?t:i(n)}},{"./_a-function":58,"./_an-object":61,"./_wks":131}],119:[function(e,t,n){var r=e("./_to-integer"),i=e("./_defined");t.exports=function(e){return function(t,n){var o,a,s=String(i(t)),l=r(n),c=s.length;return l<0||l>=c?e?"":void 0:(o=s.charCodeAt(l))<55296||o>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):o:e?s.slice(l,l+2):a-56320+(o-55296<<10)+65536}}},{"./_defined":68,"./_to-integer":122}],120:[function(e,t,n){var r,i,o,a=e("./_ctx"),s=e("./_invoke"),l=e("./_html"),c=e("./_dom-create"),u=e("./_global"),h=u.process,d=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,m=u.Dispatch,g=0,v={},y=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},b=function(e){y.call(e.data)};d&&f||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return v[++g]=function(){s("function"==typeof e?e:Function(e),t)},r(g),g},f=function(e){delete v[e]},"process"==e("./_cof")(h)?r=function(e){h.nextTick(a(y,e,1))}:m&&m.now?r=function(e){m.now(a(y,e,1))}:p?(o=(i=new p).port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(r=function(e){u.postMessage(e+"","*")},u.addEventListener("message",b,!1)):r="onreadystatechange"in c("script")?function(e){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),t.exports={set:d,clear:f}},{"./_cof":64,"./_ctx":67,"./_dom-create":70,"./_global":76,"./_html":79,"./_invoke":81}],121:[function(e,t,n){var r=e("./_to-integer"),i=Math.max,o=Math.min;t.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(e,t)}},{"./_to-integer":122}],122:[function(e,t,n){var r=Math.ceil,i=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(e>0?i:r)(e)}},{}],123:[function(e,t,n){var r=e("./_iobject"),i=e("./_defined");t.exports=function(e){return r(i(e))}},{"./_defined":68,"./_iobject":82}],124:[function(e,t,n){var r=e("./_to-integer"),i=Math.min;t.exports=function(e){return e>0?i(r(e),9007199254740991):0}},{"./_to-integer":122}],125:[function(e,t,n){var r=e("./_defined");t.exports=function(e){return Object(r(e))}},{"./_defined":68}],126:[function(e,t,n){var r=e("./_is-object");t.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":85}],127:[function(e,t,n){var r=0,i=Math.random();t.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+i).toString(36))}},{}],128:[function(e,t,n){var r=e("./_global").navigator;t.exports=r&&r.userAgent||""},{"./_global":76}],129:[function(e,t,n){var r=e("./_global"),i=e("./_core"),o=e("./_library"),a=e("./_wks-ext"),s=e("./_object-dp").f;t.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},{"./_core":65,"./_global":76,"./_library":92,"./_object-dp":98,"./_wks-ext":130}],130:[function(e,t,n){n.f=e("./_wks")},{"./_wks":131}],131:[function(e,t,n){var r=e("./_shared")("wks"),i=e("./_uid"),o=e("./_global").Symbol,a="function"==typeof o;(t.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},{"./_global":76,"./_shared":117,"./_uid":127}],132:[function(e,t,n){var r=e("./_classof"),i=e("./_wks")("iterator"),o=e("./_iterators");t.exports=e("./_core").getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},{"./_classof":63,"./_core":65,"./_iterators":91,"./_wks":131}],133:[function(e,t,n){"use strict";var r=e("./_ctx"),i=e("./_export"),o=e("./_to-object"),a=e("./_iter-call"),s=e("./_is-array-iter"),l=e("./_to-length"),c=e("./_create-property"),u=e("./core.get-iterator-method");i(i.S+i.F*!e("./_iter-detect")((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,i,h,d=o(e),f="function"==typeof this?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,g=void 0!==m,v=0,y=u(d);if(g&&(m=r(m,p>2?arguments[2]:void 0,2)),null==y||f==Array&&s(y))for(n=new f(t=l(d.length));t>v;v++)c(n,v,g?m(d[v],v):d[v]);else for(h=y.call(d),n=new f;!(i=h.next()).done;v++)c(n,v,g?a(h,m,[i.value,v],!0):i.value);return n.length=v,n}})},{"./_create-property":66,"./_ctx":67,"./_export":73,"./_is-array-iter":83,"./_iter-call":86,"./_iter-detect":89,"./_to-length":124,"./_to-object":125,"./core.get-iterator-method":132}],134:[function(e,t,n){"use strict";var r=e("./_add-to-unscopables"),i=e("./_iter-step"),o=e("./_iterators"),a=e("./_to-iobject");t.exports=e("./_iter-define")(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},{"./_add-to-unscopables":59,"./_iter-define":88,"./_iter-step":90,"./_iterators":91,"./_to-iobject":123}],135:[function(e,t,n){"use strict";var r=e("./_is-object"),i=e("./_object-gpo"),o=e("./_wks")("hasInstance"),a=Function.prototype;o in a||e("./_object-dp").f(a,o,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},{"./_is-object":85,"./_object-dp":98,"./_object-gpo":104,"./_wks":131}],136:[function(e,t,n){var r=e("./_export");r(r.S+r.F,"Object",{assign:e("./_object-assign")})},{"./_export":73,"./_object-assign":96}],137:[function(e,t,n){var r=e("./_export");r(r.S,"Object",{create:e("./_object-create")})},{"./_export":73,"./_object-create":97}],138:[function(e,t,n){var r=e("./_export");r(r.S+r.F*!e("./_descriptors"),"Object",{defineProperty:e("./_object-dp").f})},{"./_descriptors":69,"./_export":73,"./_object-dp":98}],139:[function(e,t,n){e("./_object-sap")("getOwnPropertyNames",(function(){return e("./_object-gopn-ext").f}))},{"./_object-gopn-ext":101,"./_object-sap":108}],140:[function(e,t,n){var r=e("./_to-object"),i=e("./_object-gpo");e("./_object-sap")("getPrototypeOf",(function(){return function(e){return i(r(e))}}))},{"./_object-gpo":104,"./_object-sap":108,"./_to-object":125}],141:[function(e,t,n){var r=e("./_to-object"),i=e("./_object-keys");e("./_object-sap")("keys",(function(){return function(e){return i(r(e))}}))},{"./_object-keys":106,"./_object-sap":108,"./_to-object":125}],142:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{dup:36}],143:[function(e,t,n){"use strict";var r,i,o,a,s=e("./_library"),l=e("./_global"),c=e("./_ctx"),u=e("./_classof"),h=e("./_export"),d=e("./_is-object"),f=e("./_a-function"),p=e("./_an-instance"),m=e("./_for-of"),g=e("./_species-constructor"),v=e("./_task").set,y=e("./_microtask")(),b=e("./_new-promise-capability"),_=e("./_perform"),E=e("./_user-agent"),x=e("./_promise-resolve"),w=l.TypeError,S=l.process,k=S&&S.versions,C=k&&k.v8||"",T=l.Promise,O="process"==u(S),A=function(){},L=i=b.f,R=!!function(){try{var t=T.resolve(1),n=(t.constructor={})[e("./_wks")("species")]=function(e){e(A,A)};return(O||"function"==typeof PromiseRejectionEvent)&&t.then(A)instanceof n&&0!==C.indexOf("6.6")&&-1===E.indexOf("Chrome/66")}catch(e){}}(),D=function(e){var t;return!(!d(e)||"function"!=typeof(t=e.then))&&t},I=function(e,t){if(!e._n){e._n=!0;var n=e._c;y((function(){for(var r=e._v,i=1==e._s,o=0;n.length>o;)!function(t){var n,o,a,s=i?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{s?(i||(2==e._h&&P(e),e._h=1),!0===s?n=r:(u&&u.enter(),n=s(r),u&&(u.exit(),a=!0)),n===t.promise?c(w("Promise-chain cycle")):(o=D(n))?o.call(n,l,c):l(n)):c(r)}catch(e){u&&!a&&u.exit(),c(e)}}(n[o++]);e._c=[],e._n=!1,t&&!e._h&&M(e)}))}},M=function(e){v.call(l,(function(){var t,n,r,i=e._v,o=N(e);if(o&&(t=_((function(){O?S.emit("unhandledRejection",i,e):(n=l.onunhandledrejection)?n({promise:e,reason:i}):(r=l.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=O||N(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},N=function(e){return 1!==e._h&&0===(e._a||e._c).length},P=function(e){v.call(l,(function(){var t;O?S.emit("rejectionHandled",e):(t=l.onrejectionhandled)&&t({promise:e,reason:e._v})}))},j=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),I(t,!0))},B=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw w("Promise can't be resolved itself");(t=D(e))?y((function(){var r={_w:n,_d:!1};try{t.call(e,c(B,r,1),c(j,r,1))}catch(e){j.call(r,e)}})):(n._v=e,n._s=1,I(n,!1))}catch(e){j.call({_w:n,_d:!1},e)}}};R||(T=function(e){p(this,T,"Promise","_h"),f(e),r.call(this);try{e(c(B,this,1),c(j,this,1))}catch(e){j.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=e("./_redefine-all")(T.prototype,{then:function(e,t){var n=L(g(this,T));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&I(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=c(B,e,1),this.reject=c(j,e,1)},b.f=L=function(e){return e===T||e===a?new o(e):i(e)}),h(h.G+h.W+h.F*!R,{Promise:T}),e("./_set-to-string-tag")(T,"Promise"),e("./_set-species")("Promise"),a=e("./_core").Promise,h(h.S+h.F*!R,"Promise",{reject:function(e){var t=L(this);return(0,t.reject)(e),t.promise}}),h(h.S+h.F*(s||!R),"Promise",{resolve:function(e){return x(s&&this===a?T:this,e)}}),h(h.S+h.F*!(R&&e("./_iter-detect")((function(e){T.all(e).catch(A)}))),"Promise",{all:function(e){var t=this,n=L(t),r=n.resolve,i=n.reject,o=_((function(){var n=[],o=0,a=1;m(e,!1,(function(e){var s=o++,l=!1;n.push(void 0),a++,t.resolve(e).then((function(e){l||(l=!0,n[s]=e,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=L(t),r=n.reject,i=_((function(){m(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},{"./_a-function":58,"./_an-instance":60,"./_classof":63,"./_core":65,"./_ctx":67,"./_export":73,"./_for-of":75,"./_global":76,"./_is-object":85,"./_iter-detect":89,"./_library":92,"./_microtask":94,"./_new-promise-capability":95,"./_perform":109,"./_promise-resolve":110,"./_redefine-all":112,"./_set-species":114,"./_set-to-string-tag":115,"./_species-constructor":118,"./_task":120,"./_user-agent":128,"./_wks":131}],144:[function(e,t,n){var r=e("./_export"),i=e("./_to-absolute-index"),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},{"./_export":73,"./_to-absolute-index":121}],145:[function(e,t,n){"use strict";var r=e("./_string-at")(!0);e("./_iter-define")(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},{"./_iter-define":88,"./_string-at":119}],146:[function(e,t,n){"use strict";var r=e("./_global"),i=e("./_has"),o=e("./_descriptors"),a=e("./_export"),s=e("./_redefine"),l=e("./_meta").KEY,c=e("./_fails"),u=e("./_shared"),h=e("./_set-to-string-tag"),d=e("./_uid"),f=e("./_wks"),p=e("./_wks-ext"),m=e("./_wks-define"),g=e("./_enum-keys"),v=e("./_is-array"),y=e("./_an-object"),b=e("./_is-object"),_=e("./_to-iobject"),E=e("./_to-primitive"),x=e("./_property-desc"),w=e("./_object-create"),S=e("./_object-gopn-ext"),k=e("./_object-gopd"),C=e("./_object-dp"),T=e("./_object-keys"),O=k.f,A=C.f,L=S.f,R=r.Symbol,D=r.JSON,I=D&&D.stringify,M=f("_hidden"),N=f("toPrimitive"),P={}.propertyIsEnumerable,j=u("symbol-registry"),B=u("symbols"),F=u("op-symbols"),U=Object.prototype,G="function"==typeof R,z=r.QObject,H=!z||!z.prototype||!z.prototype.findChild,V=o&&c((function(){return 7!=w(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=O(U,t);r&&delete U[t],A(e,t,n),r&&e!==U&&A(U,t,r)}:A,W=function(e){var t=B[e]=w(R.prototype);return t._k=e,t},K=G&&"symbol"==typeof R.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof R},q=function(e,t,n){return e===U&&q(F,t,n),y(e),t=E(t,!0),y(n),i(B,t)?(n.enumerable?(i(e,M)&&e[M][t]&&(e[M][t]=!1),n=w(n,{enumerable:x(0,!1)})):(i(e,M)||A(e,M,x(1,{})),e[M][t]=!0),V(e,t,n)):A(e,t,n)},X=function(e,t){y(e);for(var n,r=g(t=_(t)),i=0,o=r.length;o>i;)q(e,n=r[i++],t[n]);return e},Y=function(e){var t=P.call(this,e=E(e,!0));return!(this===U&&i(B,e)&&!i(F,e))&&(!(t||!i(this,e)||!i(B,e)||i(this,M)&&this[M][e])||t)},$=function(e,t){if(e=_(e),t=E(t,!0),e!==U||!i(B,t)||i(F,t)){var n=O(e,t);return!n||!i(B,t)||i(e,M)&&e[M][t]||(n.enumerable=!0),n}},J=function(e){for(var t,n=L(_(e)),r=[],o=0;n.length>o;)i(B,t=n[o++])||t==M||t==l||r.push(t);return r},Z=function(e){for(var t,n=e===U,r=L(n?F:_(e)),o=[],a=0;r.length>a;)!i(B,t=r[a++])||n&&!i(U,t)||o.push(B[t]);return o};G||(s((R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var e=d(arguments.length>0?arguments[0]:void 0),t=function(n){this===U&&t.call(F,n),i(this,M)&&i(this[M],e)&&(this[M][e]=!1),V(this,e,x(1,n))};return o&&H&&V(U,e,{configurable:!0,set:t}),W(e)}).prototype,"toString",(function(){return this._k})),k.f=$,C.f=q,e("./_object-gopn").f=S.f=J,e("./_object-pie").f=Y,e("./_object-gops").f=Z,o&&!e("./_library")&&s(U,"propertyIsEnumerable",Y,!0),p.f=function(e){return W(f(e))}),a(a.G+a.W+a.F*!G,{Symbol:R});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)f(Q[ee++]);for(var te=T(f.store),ne=0;te.length>ne;)m(te[ne++]);a(a.S+a.F*!G,"Symbol",{for:function(e){return i(j,e+="")?j[e]:j[e]=R(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var t in j)if(j[t]===e)return t},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!G,"Object",{create:function(e,t){return void 0===t?w(e):X(w(e),t)},defineProperty:q,defineProperties:X,getOwnPropertyDescriptor:$,getOwnPropertyNames:J,getOwnPropertySymbols:Z}),D&&a(a.S+a.F*(!G||c((function(){var e=R();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(b(t)||void 0!==e)&&!K(e))return v(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!K(t))return t}),r[1]=t,I.apply(D,r)}}),R.prototype[N]||e("./_hide")(R.prototype,N,R.prototype.valueOf),h(R,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},{"./_an-object":61,"./_descriptors":69,"./_enum-keys":72,"./_export":73,"./_fails":74,"./_global":76,"./_has":77,"./_hide":78,"./_is-array":84,"./_is-object":85,"./_library":92,"./_meta":93,"./_object-create":97,"./_object-dp":98,"./_object-gopd":100,"./_object-gopn":102,"./_object-gopn-ext":101,"./_object-gops":103,"./_object-keys":106,"./_object-pie":107,"./_property-desc":111,"./_redefine":113,"./_set-to-string-tag":115,"./_shared":117,"./_to-iobject":123,"./_to-primitive":126,"./_uid":127,"./_wks":131,"./_wks-define":129,"./_wks-ext":130}],147:[function(e,t,n){"use strict";var r=e("./_export"),i=e("./_core"),o=e("./_global"),a=e("./_species-constructor"),s=e("./_promise-resolve");r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then((function(){return n}))}:e,n?function(n){return s(t,e()).then((function(){throw n}))}:e)}})},{"./_core":65,"./_export":73,"./_global":76,"./_promise-resolve":110,"./_species-constructor":118}],148:[function(e,t,n){"use strict";var r=e("./_export"),i=e("./_new-promise-capability"),o=e("./_perform");r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},{"./_export":73,"./_new-promise-capability":95,"./_perform":109}],149:[function(e,t,n){e("./_wks-define")("asyncIterator")},{"./_wks-define":129}],150:[function(e,t,n){e("./_wks-define")("observable")},{"./_wks-define":129}],151:[function(e,t,n){e("./es6.array.iterator");for(var r=e("./_global"),i=e("./_hide"),o=e("./_iterators"),a=e("./_wks")("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<s.length;l++){var c=s[l],u=r[c],h=u&&u.prototype;h&&!h[a]&&i(h,a,c),o[c]=o.Array}},{"./_global":76,"./_hide":78,"./_iterators":91,"./_wks":131,"./es6.array.iterator":134}],152:[function(e,t,n){var r=e("./_export"),i=e("./_task");r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},{"./_export":73,"./_task":120}],153:[function(e,t,n){(function(t){"use strict";function r(e){return Object.prototype.toString.call(e)}var i=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/helpers/typeof"));n.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},n.isBoolean=function(e){return"boolean"==typeof e},n.isNull=function(e){return null===e},n.isNullOrUndefined=function(e){return null==e},n.isNumber=function(e){return"number"==typeof e},n.isString=function(e){return"string"==typeof e},n.isSymbol=function(e){return"symbol"===(void 0===e?"undefined":(0,i.default)(e))},n.isUndefined=function(e){return void 0===e},n.isRegExp=function(e){return"[object RegExp]"===r(e)},n.isObject=function(e){return"object"===(void 0===e?"undefined":(0,i.default)(e))&&null!==e},n.isDate=function(e){return"[object Date]"===r(e)},n.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},n.isFunction=function(e){return"function"==typeof e},n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===(void 0===e?"undefined":(0,i.default)(e))||void 0===e},n.isBuffer=t.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":163,"babel-runtime/helpers/typeof":32}],154:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/helpers/typeof"));!function(e){function i(e,t){for(e=String(e),t=t||2;e.length<t;)e="0"+e;return e}function o(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var i=(t-n)/6048e5;return 1+Math.floor(i)}function a(e){var t=e.getDay();return 0===t&&(t=7),t}function s(e){return null===e?"null":void 0===e?"undefined":"object"!==(void 0===e?"undefined":(0,r.default)(e))?void 0===e?"undefined":(0,r.default)(e):Array.isArray(e)?"array":{}.toString.call(e).slice(8,-1).toLowerCase()}var l=function(){var e=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g;return function(r,c,u,h){if(1!==arguments.length||"string"!==s(r)||/\d/.test(r)||(c=r,r=void 0),(r=r||new Date)instanceof Date||(r=new Date(r)),isNaN(r))throw TypeError("Invalid date");var d=(c=String(l.masks[c]||c||l.masks.default)).slice(0,4);"UTC:"!==d&&"GMT:"!==d||(c=c.slice(4),u=!0,"GMT:"===d&&(h=!0));var f=u?"getUTC":"get",p=r[f+"Date"](),m=r[f+"Day"](),g=r[f+"Month"](),v=r[f+"FullYear"](),y=r[f+"Hours"](),b=r[f+"Minutes"](),_=r[f+"Seconds"](),E=r[f+"Milliseconds"](),x=u?0:r.getTimezoneOffset(),w=o(r),S=a(r),k={d:p,dd:i(p),ddd:l.i18n.dayNames[m],dddd:l.i18n.dayNames[m+7],m:g+1,mm:i(g+1),mmm:l.i18n.monthNames[g],mmmm:l.i18n.monthNames[g+12],yy:String(v).slice(2),yyyy:v,h:y%12||12,hh:i(y%12||12),H:y,HH:i(y),M:b,MM:i(b),s:_,ss:i(_),l:i(E,3),L:i(Math.round(E/10)),t:y<12?"a":"p",tt:y<12?"am":"pm",T:y<12?"A":"P",TT:y<12?"AM":"PM",Z:h?"GMT":u?"UTC":(String(r).match(t)||[""]).pop().replace(n,""),o:(x>0?"-":"+")+i(100*Math.floor(Math.abs(x)/60)+Math.abs(x)%60,4),S:["th","st","nd","rd"][p%10>3?0:(p%100-p%10!=10)*p%10],W:w,N:S};return c.replace(e,(function(e){return e in k?k[e]:e.slice(1,e.length-1)}))}}();l.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},l.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},"object"===(void 0===n?"undefined":(0,r.default)(n))?t.exports=l:(void 0).dateFormat=l}()},{"babel-runtime/helpers/typeof":32}],155:[function(e,t,n){(function(r){function i(){var e;try{e=n.storage.debug}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e}(n=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},n.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),t){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var i=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))})),e.splice(o,0,r)}},n.save=function(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(e){}},n.load=i,n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},n.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},n.enable(i())}).call(this,e("_process"))},{"./debug":156,_process:173}],156:[function(e,t,n){function r(e){function t(){if(t.enabled){var e=t,r=+new Date,o=r-(i||r);e.diff=o,e.prev=i,e.curr=r,i=r;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=n.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var l=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(t,r){if("%%"===t)return t;l++;var i=n.formatters[r];if("function"==typeof i){var o=a[l];t=i.call(e,o),a.splice(l,1),l--}return t})),n.formatArgs.call(e,a),(t.log||n.log||console.log.bind(console)).apply(e,a)}}return t.namespace=e,t.enabled=n.enabled(e),t.useColors=n.useColors(),t.color=function(e){var t,r=0;for(t in e)r=(r<<5)-r+e.charCodeAt(t),r|=0;return n.colors[Math.abs(r)%n.colors.length]}(e),"function"==typeof n.init&&n.init(t),t}var i;(n=t.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){n.enable("")},n.enable=function(e){n.save(e),n.names=[],n.skips=[];for(var t=("string"==typeof e?e:"").split(/[\s,]+/),r=t.length,i=0;i<r;i++)t[i]&&("-"===(e=t[i].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){var t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=e("ms"),n.names=[],n.skips=[],n.formatters={}},{ms:169}],157:[function(e,t,n){"use strict";var r=/["'&<>]/;t.exports=function(e){var t=""+e,n=r.exec(t);if(!n)return t;var i,o="",a=0,s=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 39:i="&#39;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}s!==a&&(o+=t.substring(s,a)),s=a+1,o+=i}return s!==a?o+t.substring(s,a):o}},{}],158:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,s,l,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}if(a(n=this._events[e]))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),r=(c=n.slice()).length,l=0;l<r;l++)c[l].apply(this,s);return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(n=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,a,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],159:[function(e,t,n){var r=e("http"),i=t.exports;for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o]);i.request=function(e,t){return e||(e={}),e.scheme="https",e.protocol="https:",r.request.call(this,e,t)}},{http:196}],160:[function(e,t,n){"use strict";var r=e("util"),i=e("ms");t.exports=function(e){if("number"==typeof e)return e;var t=i(e);if(void 0===t){var n=new Error(r.format("humanize-ms(%j) result undefined",e));console.warn(n.stack)}return t}},{ms:169,util:207}],161:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,c=l>>1,u=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*m}},{}],162:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],163:[function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],164:[function(e,t,n){!function(e){function r(e){return"function"==typeof e&&(/^class(\s|\{\}$)/.test(i.call(e))||/^.*classCallCheck\(/.test(function(e){return i.call(e).replace(/^[^{]*{\s*/,"").replace(/\s*}[^}]*$/,"")}(e)))}var i=Function.prototype.toString;void 0!==n?(void 0!==t&&t.exports&&(n=t.exports=r),n.isClass=r):e.isClass=r}(this)},{}],165:[function(e,t,n){"use strict";var r=e("core-util-is"),i=e("isstream"),o=e("is-class");Object.keys(r).map((function(e){n[function(e){var t=e.slice(2);return t[0].toLowerCase()+t.slice(1)}(e)]=r[e]})),n.stream=i,n.readableStream=i.isReadable,n.writableStream=i.isWritable,n.duplexStream=i.isDuplex,n.class=o,n.finite=function(e){return Number.isFinite(e)},n.NaN=function(e){return Number.isNaN(e)},n.generator=function(e){return e&&"function"==typeof e.next&&"function"==typeof e.throw},n.generatorFunction=function(e){return e&&e.constructor&&"GeneratorFunction"===e.constructor.name},n.asyncFunction=function(e){return e&&e.constructor&&"AsyncFunction"===e.constructor.name},n.promise=function(e){return e&&"function"==typeof e.then};var a=Math.pow(2,31);n.int=function(e){return r.isNumber(e)&&e%1==0},n.int32=function(e){return n.int(e)&&e<a&&e>=-a},n.long=function(e){return n.int(e)&&(e>=a||e<-a)},n.Long=function(e){return n.object(e)&&n.number(e.high)&&n.number(e.low)},n.double=function(e){return r.isNumber(e)&&!isNaN(e)&&e%1!=0},n.date=function(e){return e instanceof Date},n.regExp=function(e){return e instanceof RegExp},n.regexp=n.regExp,n.error=function(e){return e instanceof Error},n.array=function(e){return Array.isArray(e)}},{"core-util-is":153,"is-class":164,isstream:167}],166:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],167:[function(e,t,n){function r(e){return e instanceof a.Stream}function i(e){return r(e)&&"function"==typeof e._read&&"object"==typeof e._readableState}function o(e){return r(e)&&"function"==typeof e._write&&"object"==typeof e._writableState}var a=e("stream");t.exports=r,t.exports.isReadable=i,t.exports.isWritable=o,t.exports.isDuplex=function(e){return i(e)&&o(e)}},{stream:195}],168:[function(e,t,n){"use strict";t.exports=function(e,t,n){if(!e)throw new TypeError("argument dest is required");if(!t)throw new TypeError("argument src is required");return void 0===n&&(n=!0),Object.getOwnPropertyNames(t).forEach((function(i){if(n||!r.call(e,i)){var o=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,o)}})),e};var r=Object.prototype.hasOwnProperty},{}],169:[function(e,t,n){function r(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var i=1e3,o=60*i,a=60*o,s=24*a,l=365.25*s;t.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*l;case"days":case"day":case"d":return n*s;case"hours":case"hour":case"hrs":case"hr":case"h":return n*a;case"minutes":case"minute":case"mins":case"min":case"m":return n*o;case"seconds":case"second":case"secs":case"sec":case"s":return n*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===n&&!1===isNaN(e))return t.long?function(e){return r(e,s,"day")||r(e,a,"hour")||r(e,o,"minute")||r(e,i,"second")||e+" ms"}(e):function(e){return e>=s?Math.round(e/s)+"d":e>=a?Math.round(e/a)+"h":e>=o?Math.round(e/o)+"m":e>=i?Math.round(e/i)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],170:[function(e,t,n){(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}n.resolve=function(){for(var n="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,i="/"===a.charAt(0))}return(i?"/":"")+(n=t(r(n.split("/"),(function(e){return!!e})),!i).join("/"))||"."},n.normalize=function(e){var o=n.isAbsolute(e),a="/"===i(e,-1);return(e=t(r(e.split("/"),(function(e){return!!e})),!o).join("/"))||o||(e="."),e&&a&&(e+="/"),(o?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var i=r(e.split("/")),o=r(t.split("/")),a=Math.min(i.length,o.length),s=a,l=0;l<a;l++)if(i[l]!==o[l]){s=l;break}var c=[];for(l=s;l<i.length;l++)c.push("..");return(c=c.concat(o.slice(s))).join("/")},n.sep="/",n.delimiter=":",n.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,i=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},n.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,o=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===r&&(i=!1,r=a+1),46===s?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=a+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)};var i="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,e("_process"))},{_process:173}],171:[function(e,n,r){(function(e){(function(){"use strict";function t(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function i(e){return e=c(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:t(e)}function o(e,t){for(var n in e)y.call(e,n)&&t(e[n],n,e)}function a(e){return null==e?t(e):b.call(e).slice(8,-1)}function s(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function l(e,t){var n=null;return function(e,t){var n=-1,r=e?e.length:0;if("number"==typeof r&&r>-1&&r<=m)for(;++n<r;)t(e[n],n,e);else o(e,t)}(e,(function(r,i){n=t(n,r,i,e)})),n}function c(e){return String(e).replace(/^ +| +$/g,"")}var u={function:!0,object:!0},h=u[typeof window]&&window||this,d=u[typeof r]&&r,f=u[typeof n]&&n&&!n.nodeType&&n,p=d&&f&&"object"==typeof e&&e;!p||p.global!==p&&p.window!==p&&p.self!==p||(h=p);var m=Math.pow(2,53)-1,g=/\bOpera/,v=Object.prototype,y=v.hasOwnProperty,b=v.toString,_=function e(t){function n(e){return l(e,(function(e,n){var r=n.pattern||s(n);return!e&&(e=RegExp("\\b"+r+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+r+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+r+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((e=String(n.label&&!RegExp(r,"i").test(n.label)?n.label:e).split("/"))[1]&&!/[\d.]+/.test(e[0])&&(e[0]+=" "+e[1]),n=n.label||n,e=i(e[0].replace(RegExp(r,"i"),n).replace(RegExp("; *(?:"+n+"[_-])?","i")," ").replace(RegExp("("+n+")[-_.]?(\\w)","i"),"$1 $2"))),e}))}var r=h,u=t&&"object"==typeof t&&"String"!=a(t);u&&(r=t,t=null);var d=r.navigator||{},f=d.userAgent||"";t||(t=f);var p,m,v=u?!!d.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(b.toString()),y=u?"Object":"ScriptBridgingProxyObject",_=u?"Object":"Environment",E=u&&r.java?"JavaPackage":a(r.java),x=u?"Object":"RuntimeObject",w=/\bJava/.test(E)&&r.java,S=w&&a(r.environment)==_,k=w?"a":"伪",C=w?"b":"尾",T=r.document||{},O=r.operamini||r.opera,A=g.test(A=u&&O?O["[[Class]]"]:a(O))?A:O=null,L=t,R=[],D=null,I=t==f,M=I&&O&&"function"==typeof O.version&&O.version(),N=l([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],(function(e,n){return e||RegExp("\\b"+(n.pattern||s(n))+"\\b","i").exec(t)&&(n.label||n)})),P=l(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Waterfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"],(function(e,n){return e||RegExp("\\b"+(n.pattern||s(n))+"\\b","i").exec(t)&&(n.label||n)})),j=n([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),B=l({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1}},(function(e,n,r){return e||(n[j]||n[/^[a-z]+(?: +[a-z]+\b)*/i.exec(j)]||RegExp("\\b"+s(r)+"(?:\\b|\\w*\\d)","i").exec(t))&&r})),F=l(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "],(function(e,n){var r=n.pattern||s(n);return!e&&(e=RegExp("\\b"+r+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(e=function(e,t,n){var r={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return t&&n&&/^Win/i.test(e)&&!/^Windows Phone /i.test(e)&&(r=r[/[\d.]+$/.exec(e)])&&(e="Windows "+r),e=String(e),t&&n&&(e=e.replace(RegExp(t,"i"),n)),i(e.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(e,r,n.label||n)),e}));if(N&&(N=[N]),B&&!j&&(j=n([B])),(p=/\bGoogle TV\b/.exec(j))&&(j=p[0]),/\bSimulator\b/i.test(t)&&(j=(j?j+" ":"")+"Simulator"),"Opera Mini"==P&&/\bOPiOS\b/.test(t)&&R.push("running in Turbo/Uncompressed mode"),"IE"==P&&/\blike iPhone OS\b/.test(t)?(B=(p=e(t.replace(/like iPhone OS/,""))).manufacturer,j=p.product):/^iP/.test(j)?(P||(P="Safari"),F="iOS"+((p=/ OS ([\d_]+)/i.exec(t))?" "+p[1].replace(/_/g,"."):"")):"Konqueror"!=P||/buntu/i.test(F)?B&&"Google"!=B&&(/Chrome/.test(P)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(j))||/\bAndroid\b/.test(F)&&/^Chrome/.test(P)&&/\bVersion\//i.test(t)?(P="Android Browser",F=/\bAndroid\b/.test(F)?F:"Android"):"Silk"==P?(/\bMobi/i.test(t)||(F="Android",R.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&R.unshift("accelerated")):"PaleMoon"==P&&(p=/\bFirefox\/([\d.]+)\b/.exec(t))?R.push("identifying as Firefox "+p[1]):"Firefox"==P&&(p=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(F||(F="Firefox OS"),j||(j=p[1])):!P||(p=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(P))?(P&&!j&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(p+"/")+8))&&(P=null),(p=j||B||F)&&(j||B||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(F))&&(P=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(F)?F:p)+" Browser")):"Electron"==P&&(p=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&R.push("Chromium "+p):F="Kubuntu",M||(M=function(e){return l(e,(function(e,n){return e||(RegExp(n+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))","Version",s(P),"(?:Firefox|Minefield|NetFront)"])),(p=("iCab"==N&&parseFloat(M)>3?"WebKit":/\bOpera\b/.test(P)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(N)&&"WebKit"||!N&&/\bMSIE\b/i.test(t)&&("Mac OS"==F?"Tasman":"Trident")||"WebKit"==N&&/\bPlayStation\b(?! Vita\b)/i.test(P)&&"NetFront")&&(N=[p]),"IE"==P&&(p=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(P+=" Mobile",F="Windows Phone "+(/\+$/.test(p)?p:p+".x"),R.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(P="IE Mobile",F="Windows Phone 8.x",R.unshift("desktop mode"),M||(M=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=P&&"Trident"==N&&(p=/\brv:([\d.]+)/.exec(t))&&(P&&R.push("identifying as "+P+(M?" "+M:"")),P="IE",M=p[1]),I){if(function(e,t){var n=null!=e?typeof e[t]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(n)||"object"==n&&!e[t])}(r,"global"))if(w&&(L=(p=w.lang.System).getProperty("os.arch"),F=F||p.getProperty("os.name")+" "+p.getProperty("os.version")),S){try{M=r.require("ringo/engine").version.join("."),P="RingoJS"}catch(t){(p=r.system)&&p.global.system==r.system&&(P="Narwhal",F||(F=p[0].os||null))}P||(P="Rhino")}else"object"==typeof r.process&&!r.process.browser&&(p=r.process)&&("object"==typeof p.versions&&("string"==typeof p.versions.electron?(R.push("Node "+p.versions.node),P="Electron",M=p.versions.electron):"string"==typeof p.versions.nw&&(R.push("Chromium "+M,"Node "+p.versions.node),P="NW.js",M=p.versions.nw)),P||(P="Node.js",L=p.arch,F=p.platform,M=(M=/[\d.]+/.exec(p.version))?M[0]:null));else a(p=r.runtime)==y?(P="Adobe AIR",F=p.flash.system.Capabilities.os):a(p=r.phantom)==x?(P="PhantomJS",M=(p=p.version||null)&&p.major+"."+p.minor+"."+p.patch):"number"==typeof T.documentMode&&(p=/\bTrident\/(\d+)/i.exec(t))?(M=[M,T.documentMode],(p=+p[1]+4)!=M[1]&&(R.push("IE "+M[1]+" mode"),N&&(N[1]=""),M[1]=p),M="IE"==P?String(M[1].toFixed(1)):M[0]):"number"==typeof T.documentMode&&/^(?:Chrome|Firefox)\b/.test(P)&&(R.push("masking as "+P+" "+M),P="IE",M="11.0",N=["Trident"],F="Windows");F=F&&i(F)}if(M&&(p=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(M)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(I&&d.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(D=/b/i.test(p)?"beta":"alpha",M=M.replace(RegExp(p+"\\+?$"),"")+("beta"==D?C:k)+(/\d+\+?/.exec(p)||"")),"Fennec"==P||"Firefox"==P&&/\b(?:Android|Firefox OS)\b/.test(F))P="Firefox Mobile";else if("Maxthon"==P&&M)M=M.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(j))"Xbox 360"==j&&(F=null),"Xbox 360"==j&&/\bIEMobile\b/.test(t)&&R.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(P)&&(!P||j||/Browser|Mobi/.test(P))||"Windows CE"!=F&&!/Mobi/i.test(t))if("IE"==P&&I)try{null===r.external&&R.unshift("platform preview")}catch(t){R.unshift("embedded")}else(/\bBlackBerry\b/.test(j)||/\bBB10\b/.test(t))&&(p=(RegExp(j.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||M)?(F=((p=[p,/BB10/.test(t)])[1]?(j=null,B="BlackBerry"):"Device Software")+" "+p[0],M=null):this!=o&&"Wii"!=j&&(I&&O||/Opera/.test(P)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==P&&/\bOS X (?:\d+\.){2,}/.test(F)||"IE"==P&&(F&&!/^Win/.test(F)&&M>5.5||/\bWindows XP\b/.test(F)&&M>8||8==M&&!/\bTrident\b/.test(t)))&&!g.test(p=e.call(o,t.replace(g,"")+";"))&&p.name&&(p="ing as "+p.name+((p=p.version)?" "+p:""),g.test(P)?(/\bIE\b/.test(p)&&"Mac OS"==F&&(F=null),p="identify"+p):(p="mask"+p,P=A?i(A.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(p)&&(F=null),I||(M=null)),N=["Presto"],R.push(p));else P+=" Mobile";(p=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(p=[parseFloat(p.replace(/\.(\d)$/,".0$1")),p],"Safari"==P&&"+"==p[1].slice(-1)?(P="WebKit Nightly",D="alpha",M=p[1].slice(0,-1)):M!=p[1]&&M!=(p[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(M=null),p[1]=(/\bChrome\/([\d.]+)/i.exec(t)||0)[1],537.36==p[0]&&537.36==p[2]&&parseFloat(p[1])>=28&&"WebKit"==N&&(N=["Blink"]),I&&(v||p[1])?(N&&(N[1]="like Chrome"),p=p[1]||((p=p[0])<530?1:p<532?2:p<532.05?3:p<533?4:p<534.03?5:p<534.07?6:p<534.1?7:p<534.13?8:p<534.16?9:p<534.24?10:p<534.3?11:p<535.01?12:p<535.02?"13+":p<535.07?15:p<535.11?16:p<535.19?17:p<536.05?18:p<536.1?19:p<537.01?20:p<537.11?"21+":p<537.13?23:p<537.18?24:p<537.24?25:p<537.36?26:"Blink"!=N?"27":"28")):(N&&(N[1]="like Safari"),p=(p=p[0])<400?1:p<500?2:p<526?3:p<533?4:p<534?"4+":p<535?5:p<537?6:p<538?7:p<601?8:"8"),N&&(N[1]+=" "+(p+="number"==typeof p?".x":/[.+]/.test(p)?"":"+")),"Safari"==P&&(!M||parseInt(M)>45)&&(M=p)),"Opera"==P&&(p=/\bzbov|zvav$/.exec(F))?(P+=" ",R.unshift("desktop mode"),"zvav"==p?(P+="Mini",M=null):P+="Mobile",F=F.replace(RegExp(" *"+p+"$"),"")):"Safari"==P&&/\bChrome\b/.exec(N&&N[1])&&(R.unshift("desktop mode"),P="Chrome Mobile",M=null,/\bOS X\b/.test(F)?(B="Apple",F="iOS 4.3+"):F=null),M&&0==M.indexOf(p=/[\d.]+$/.exec(F))&&t.indexOf("/"+p+"-")>-1&&(F=c(F.replace(p,""))),N&&!/\b(?:Avant|Nook)\b/.test(P)&&(/Browser|Lunascape|Maxthon/.test(P)||"Safari"!=P&&/^iOS/.test(F)&&/\bSafari\b/.test(N[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(P)&&N[1])&&(p=N[N.length-1])&&R.push(p),R.length&&(R=["("+R.join("; ")+")"]),B&&j&&j.indexOf(B)<0&&R.push("on "+B),j&&R.push((/^on /.test(R[R.length-1])?"":"on ")+j),F&&(p=/ ([\d.+]+)$/.exec(F),m=p&&"/"==F.charAt(F.length-p[0].length-1),F={architecture:32,family:p&&!m?F.replace(p[0],""):F,version:p?p[1]:null,toString:function(){var e=this.version;return this.family+(e&&!m?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(p=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(L))&&!/\bi686\b/i.test(L)?(F&&(F.architecture=64,F.family=F.family.replace(RegExp(" *"+p),"")),P&&(/\bWOW64\b/i.test(t)||I&&/\w(?:86|32)$/.test(d.cpuClass||d.platform)&&!/\bWin64; x64\b/i.test(t))&&R.unshift("32-bit")):F&&/^OS X/.test(F.family)&&"Chrome"==P&&parseFloat(M)>=39&&(F.architecture=64),t||(t=null);var U={};return U.description=t,U.layout=N&&N[0],U.manufacturer=B,U.name=P,U.prerelease=D,U.product=j,U.ua=t,U.version=P&&M,U.os=F||{architecture:null,family:null,version:null,toString:function(){return"null"}},U.parse=e,U.toString=function(){return this.description||""},U.version&&R.unshift(M),U.name&&R.unshift(P),F&&P&&(F!=String(F).split(" ")[0]||F!=P.split(" ")[0]&&!j)&&R.push(j?"("+F+")":"on "+F),R.length&&(U.description=R.join(" ")),U}();d&&f?o(_,(function(e,t){d[t]=e})):h.platform=_}).call(this)}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],172:[function(e,t,n){(function(e){"use strict";!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,n)}));case 3:return e.nextTick((function(){t.call(null,n,r)}));case 4:return e.nextTick((function(){t.call(null,n,r,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return e.nextTick((function(){t.apply(null,o)}))}}}:t.exports=e}).call(this,e("_process"))},{_process:173}],173:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(u===setTimeout)return setTimeout(e,0);if((u===r||!u)&&setTimeout)return u=setTimeout,setTimeout(e,0);try{return u(e,0)}catch(t){try{return u.call(null,e,0)}catch(t){return u.call(this,e,0)}}}function a(){m&&f&&(m=!1,f.length?p=f.concat(p):g=-1,p.length&&s())}function s(){if(!m){var e=o(a);m=!0;for(var t=p.length;t;){for(f=p,p=[];++g<t;)f&&f[g].run();g=-1,t=p.length}f=null,m=!1,function(e){if(h===clearTimeout)return clearTimeout(e);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}(e)}}function l(e,t){this.fun=e,this.array=t}function c(){}var u,h,d=t.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:r}catch(e){u=r}try{h="function"==typeof clearTimeout?clearTimeout:i}catch(e){h=i}}();var f,p=[],m=!1,g=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new l(e,t)),1!==p.length||m||o(s)},l.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.prependListener=c,d.prependOnceListener=c,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],174:[function(e,n,r){(function(e){!function(t){function i(e){throw new RangeError(R[e])}function o(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function a(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+o((e=e.replace(L,".")).split("."),t).join(".")}function s(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function l(e){return o(e,(function(e){var t="";return e>65535&&(t+=M((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+M(e)})).join("")}function c(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:_}function u(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function h(e,t,n){var r=0;for(e=n?I(e/S):e>>1,e+=I(e/t);e>D*x>>1;r+=_)e=I(e/D);return I(r+(D+1)*e/(e+w))}function d(e){var t,n,r,o,a,s,u,d,f,p,m=[],g=e.length,v=0,y=C,w=k;for((n=e.lastIndexOf(T))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&i("not-basic"),m.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(a=v,s=1,u=_;o>=g&&i("invalid-input"),((d=c(e.charCodeAt(o++)))>=_||d>I((b-v)/s))&&i("overflow"),v+=d*s,!(d<(f=u<=w?E:u>=w+x?x:u-w));u+=_)s>I(b/(p=_-f))&&i("overflow"),s*=p;w=h(v-a,t=m.length+1,0==a),I(v/t)>b-y&&i("overflow"),y+=I(v/t),v%=t,m.splice(v++,0,y)}return l(m)}function f(e){var t,n,r,o,a,l,c,d,f,p,m,g,v,y,w,S=[];for(g=(e=s(e)).length,t=C,n=0,a=k,l=0;l<g;++l)(m=e[l])<128&&S.push(M(m));for(r=o=S.length,o&&S.push(T);r<g;){for(c=b,l=0;l<g;++l)(m=e[l])>=t&&m<c&&(c=m);for(c-t>I((b-n)/(v=r+1))&&i("overflow"),n+=(c-t)*v,t=c,l=0;l<g;++l)if((m=e[l])<t&&++n>b&&i("overflow"),m==t){for(d=n,f=_;!(d<(p=f<=a?E:f>=a+x?x:f-a));f+=_)w=d-p,y=_-p,S.push(M(u(p+w%y,0))),d=I(w/y);S.push(M(u(d,0))),a=h(n,v,r==o),n=0,++r}++n,++t}return S.join("")}var p="object"==typeof r&&r&&!r.nodeType&&r,m="object"==typeof n&&n&&!n.nodeType&&n,g="object"==typeof e&&e;g.global!==g&&g.window!==g&&g.self!==g||(t=g);var v,y,b=2147483647,_=36,E=1,x=26,w=38,S=700,k=72,C=128,T="-",O=/^xn--/,A=/[^\x20-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,R={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},D=_-E,I=Math.floor,M=String.fromCharCode;if(v={version:"1.4.1",ucs2:{decode:s,encode:l},decode:d,encode:f,toASCII:function(e){return a(e,(function(e){return A.test(e)?"xn--"+f(e):e}))},toUnicode:function(e){return a(e,(function(e){return O.test(e)?d(e.slice(4).toLowerCase()):e}))}},p&&m)if(n.exports==p)m.exports=v;else for(y in v)v.hasOwnProperty(y)&&(p[y]=v[y]);else t.punycode=v}(this)}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],175:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var c=e.length;l>0&&c>l&&(c=l);for(var u=0;u<c;++u){var h,d,f,p,m=e[u].replace(s,"%20"),g=m.indexOf(n);g>=0?(h=m.substr(0,g),d=m.substr(g+1)):(h=m,d=""),f=decodeURIComponent(h),p=decodeURIComponent(d),r(a,f)?i(a[f])?a[f].push(p):a[f]=[a[f],p]:a[f]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],176:[function(e,t,n){"use strict";function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?r(a(e),(function(a){var s=encodeURIComponent(i(a))+n;return o(e[a])?r(e[a],(function(e){return s+encodeURIComponent(i(e))})).join(t):s+encodeURIComponent(i(e[a]))})).join(t):s?encodeURIComponent(i(s))+n+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},{}],177:[function(e,t,n){"use strict";n.decode=n.parse=e("./decode"),n.encode=n.stringify=e("./encode")},{"./decode":175,"./encode":176}],178:[function(e,t,n){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":179}],179:[function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);u.call(this,e),h.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||s.nextTick(o,this)}function o(e){e.end()}var a=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/keys")),s=e("process-nextick-args"),l=a.default||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var c=e("core-util-is");c.inherits=e("inherits");var u=e("./_stream_readable"),h=e("./_stream_writable");c.inherits(r,u);for(var d=l(h.prototype),f=0;f<d.length;f++){var p=d[f];r.prototype[p]||(r.prototype[p]=h.prototype[p])}Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),r.prototype._destroy=function(e,t){this.push(null),this.end(),s.nextTick(t,e)}},{"./_stream_readable":181,"./_stream_writable":183,"babel-runtime/core-js/object/keys":23,"core-util-is":153,inherits:162,"process-nextick-args":172}],180:[function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);i.call(this,e)}t.exports=r;var i=e("./_stream_transform"),o=e("core-util-is");o.inherits=e("inherits"),o.inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":182,"core-util-is":153,inherits:162}],181:[function(e,n,r){(function(t,r){"use strict";function i(t,n){t=t||{};var r=n instanceof(w=w||e("./_stream_duplex"));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new I,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(D||(D=e("string_decoder/").StringDecoder),this.decoder=new D(t.encoding),this.encoding=t.encoding)}function o(t){if(w=w||e("./_stream_duplex"),!(this instanceof o))return new o(t);this._readableState=new i(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),C.call(this)}function a(e,t,n,r,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,u(e)}}(e,a)):(i||(o=l(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||(0,E.default)(t)===T.prototype||(t=function(e){return T.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):s(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?s(e,a,t,!1):d(e,a)):s(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function s(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&u(e)),d(e,t)}function l(e,t){var n;return function(e){return T.isBuffer(e)||e instanceof O}(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function c(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function u(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(R("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?x.nextTick(h,e):h(e))}function h(e){R("emit readable"),e.emit("readable"),g(e)}function d(e,t){t.readingMore||(t.readingMore=!0,x.nextTick(f,e,t))}function f(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(R("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function p(e){R("readable nexttick read 0"),e.read(0)}function m(e,t){t.reading||(R("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),g(e),t.flowing&&!t.reading&&e.read(0)}function g(e){var t=e._readableState;for(R("flow",t.flowing);t.flowing&&null!==e.read(););}function v(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0==(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=T.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0==(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function y(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,x.nextTick(b,t,e))}function b(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function _(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}var E=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/get-prototype-of")),x=e("process-nextick-args");n.exports=o;var w,S=e("isarray");o.ReadableState=i;var k=(e("events").EventEmitter,function(e,t){return e.listeners(t).length}),C=e("./internal/streams/stream"),T=e("safe-buffer").Buffer,O=r.Uint8Array||function(){},A=e("core-util-is");A.inherits=e("inherits");var L=e("util"),R=void 0;R=L&&L.debuglog?L.debuglog("stream"):function(){};var D,I=e("./internal/streams/BufferList"),M=e("./internal/streams/destroy");A.inherits(o,C);var N=["error","close","destroy","pause","resume"];Object.defineProperty(o.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),o.prototype.destroy=M.destroy,o.prototype._undestroy=M.undestroy,o.prototype._destroy=function(e,t){this.push(null),t(e)},o.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=T.from(e,t),t=""),n=!0),a(this,e,t,!1,n)},o.prototype.unshift=function(e){return a(this,e,null,!0,!1)},o.prototype.isPaused=function(){return!1===this._readableState.flowing},o.prototype.setEncoding=function(t){return D||(D=e("string_decoder/").StringDecoder),this._readableState.decoder=new D(t),this._readableState.encoding=t,this};var P=8388608;o.prototype.read=function(e){R("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return R("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?y(this):u(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&y(this),null;var r,i=t.needReadable;return R("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&R("length less than watermark",i=!0),t.ended||t.reading?R("reading or ended",i=!1):i&&(R("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=c(n,t))),null===(r=e>0?v(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&y(this)),null!==r&&this.emit("data",r),r},o.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},o.prototype.pipe=function(e,n){function r(e,t){R("onunpipe"),e===h&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,o())}function i(){R("onend"),e.end()}function o(){R("cleanup"),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("drain",p),e.removeListener("error",s),e.removeListener("unpipe",r),h.removeListener("end",i),h.removeListener("end",u),h.removeListener("data",a),m=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||p()}function a(t){R("ondata"),v=!1,!1!==e.write(t)||v||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&-1!==_(d.pipes,e))&&!m&&(R("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,v=!0),h.pause())}function s(t){R("onerror",t),u(),e.removeListener("error",s),0===k(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",c),u()}function c(){R("onfinish"),e.removeListener("close",l),u()}function u(){R("unpipe"),h.unpipe(e)}var h=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,R("pipe count=%d opts=%j",d.pipesCount,n);var f=(!n||!1!==n.end)&&e!==t.stdout&&e!==t.stderr?i:u;d.endEmitted?x.nextTick(f):h.once("end",f),e.on("unpipe",r);var p=function(e){return function(){var t=e._readableState;R("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&k(e,"data")&&(t.flowing=!0,g(e))}}(h);e.on("drain",p);var m=!1,v=!1;return h.on("data",a),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?S(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",s),e.once("close",l),e.once("finish",c),e.emit("pipe",h),d.flowing||(R("pipe resume"),h.resume()),e},o.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var a=_(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},o.prototype.on=function(e,t){var n=C.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&u(this):x.nextTick(p,this))}return n},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){var e=this._readableState;return e.flowing||(R("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,x.nextTick(m,e,t))}(this,e)),this},o.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this},o.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(R("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){R("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||!(n.objectMode||i&&i.length)||t.push(i)||(r=!0,e.pause())})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<N.length;o++)e.on(N[o],this.emit.bind(this,N[o]));return this._read=function(t){R("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(o.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),o._fromList=v}).call(this,e("_process"),void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":179,"./internal/streams/BufferList":184,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/get-prototype-of":22,"core-util-is":153,events:158,inherits:162,isarray:166,"process-nextick-args":172,"safe-buffer":193,"string_decoder/":200,util:36}],182:[function(e,t,n){"use strict";function r(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function i(e){if(!(this instanceof i))return new i(e);s.call(this,e),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){a(e,t,n)})):a(this,null,null)}function a(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}t.exports=i;var s=e("./_stream_duplex"),l=e("core-util-is");l.inherits=e("inherits"),l.inherits(i,s),i.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},i.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},i.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},i.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},i.prototype._destroy=function(e,t){var n=this;s.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},{"./_stream_duplex":179,"core-util-is":153,inherits:162}],183:[function(e,n,r){(function(t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}function a(){}function s(t,n){E=E||e("./_stream_duplex"),t=t||{};var r=n instanceof E;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,a=t.writableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(_.nextTick(i,r),_.nextTick(m,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),m(e,t))}(e,n,r,t,i);else{var o=f(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||d(e,n),r?x(h,e,n,o,i):h(e,n,o,i)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function l(t){if(E=E||e("./_stream_duplex"),!(S.call(l,this)||this instanceof E))return new l(t);this._writableState=new s(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),C.call(this)}function c(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=T.from(t,n)),t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else u(e,t,!1,s,r,i,o);return l}function u(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function h(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),m(e,t)}function d(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,l=!0;n;)i[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;i.allBuffers=l,u(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,h=n.encoding,d=n.callback;if(u(e,t,!1,t.objectMode?1:c.length,c,h,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function f(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function p(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),m(e,t)}))}function m(e,t){var n=f(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,_.nextTick(p,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}var g=i(e("babel-runtime/core-js/object/define-property")),v=i(e("babel-runtime/core-js/symbol/has-instance")),y=i(e("babel-runtime/core-js/symbol")),b=i(e("babel-runtime/core-js/set-immediate")),_=e("process-nextick-args");n.exports=l;var E,x=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?b.default:_.nextTick;l.WritableState=s;var w=e("core-util-is");w.inherits=e("inherits");var S,k={deprecate:e("util-deprecate")},C=e("./internal/streams/stream"),T=e("safe-buffer").Buffer,O=r.Uint8Array||function(){},A=e("./internal/streams/destroy");w.inherits(l,C),s.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(s.prototype,"buffer",{get:k.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof y.default&&v.default&&"function"==typeof Function.prototype[v.default]?(S=Function.prototype[v.default],(0,g.default)(l,v.default,{value:function(e){return!!S.call(this,e)||this===l&&e&&e._writableState instanceof s}})):S=function(e){return e instanceof this},l.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},l.prototype.write=function(e,t,n){var r=this._writableState,i=!1,o=!r.objectMode&&function(e){return T.isBuffer(e)||e instanceof O}(e);return o&&!T.isBuffer(e)&&(e=function(e){return T.from(e)}(e)),"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=a),r.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),_.nextTick(t,n)}(this,n):(o||function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),_.nextTick(r,o),i=!1),i}(this,r,e,n))&&(r.pendingcb++,i=c(this,r,o,e,t,n)),i},l.prototype.cork=function(){this._writableState.corked++},l.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||d(this,e))},l.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),l.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},l.prototype._writev=null,l.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,m(e,t),n&&(t.finished?_.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),l.prototype.destroy=A.destroy,l.prototype._undestroy=A.undestroy,l.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":179,"./internal/streams/destroy":185,"./internal/streams/stream":186,_process:173,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/set-immediate":25,"babel-runtime/core-js/symbol":27,"babel-runtime/core-js/symbol/has-instance":28,"core-util-is":153,inherits:162,"process-nextick-args":172,"safe-buffer":193,"util-deprecate":205}],184:[function(e,t,n){"use strict";function r(e,t,n){e.copy(t,n)}var i=e("safe-buffer").Buffer,o=e("util");t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t=i.allocUnsafe(e>>>0),n=this.head,o=0;n;)r(n.data,t,o),o+=n.data.length,n=n.next;return t},e}(),o&&o.inspect&&o.inspect.custom&&(t.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":193,util:36}],185:[function(e,t,n){"use strict";function r(e,t){e.emit("error",t)}var i=e("process-nextick-args");t.exports={destroy:function(e,t){var n=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||i.nextTick(r,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(i.nextTick(r,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":172}],186:[function(e,t,n){"use strict";t.exports=e("events").EventEmitter},{events:158}],187:[function(e,t,n){t.exports=e("./readable").PassThrough},{"./readable":188}],188:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":179,"./lib/_stream_passthrough.js":180,"./lib/_stream_readable.js":181,"./lib/_stream_transform.js":182,"./lib/_stream_writable.js":183}],189:[function(e,t,n){t.exports=e("./readable").Transform},{"./readable":188}],190:[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":183}],191:[function(e,t,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=e("./runtime"),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},{"./runtime":192}],192:[function(e,t,n){!function(e){"use strict";function n(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,a=Object.create(o.prototype),s=new f(r||[]);return a._invoke=c(e,n,s),a}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function a(){}function s(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function l(e){function t(n,i,o,a){var s=r(e[n],e,i);if("throw"!==s.type){var l=s.arg,c=l.value;return c&&"object"==typeof c&&y.call(c,"__await")?Promise.resolve(c.__await).then((function(e){t("next",e,o,a)}),(function(e){t("throw",e,o,a)})):Promise.resolve(c).then((function(e){l.value=e,o(l)}),a)}a(s.arg)}var n;this._invoke=function(e,r){function i(){return new Promise((function(n,i){t(e,r,n,i)}))}return n=n?n.then(i,i):i()}}function c(e,t,n){var i=k;return function(o,a){if(i===T)throw new Error("Generator is already running");if(i===O){if("throw"===o)throw a;return m()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var l=u(s,n);if(l){if(l===A)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===k)throw i=O,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=T;var c=r(e,t,n);if("normal"===c.type){if(i=n.done?O:C,c.arg===A)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=O,n.method="throw",n.arg=c.arg)}}}function u(e,t){var n=e.iterator[t.method];if(n===g){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=g,u(e,t),"throw"===t.method))return A;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return A}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,A;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=g),t.delegate=null,A):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,A)}function h(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function d(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function f(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(h,this),this.reset(!0)}function p(e){if(e){var t=e[_];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(y.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=g,t.done=!0,t};return r.next=r}}return{next:m}}function m(){return{value:g,done:!0}}var g,v=Object.prototype,y=v.hasOwnProperty,b="function"==typeof Symbol?Symbol:{},_=b.iterator||"@@iterator",E=b.asyncIterator||"@@asyncIterator",x=b.toStringTag||"@@toStringTag",w="object"==typeof t,S=e.regeneratorRuntime;if(S)w&&(t.exports=S);else{(S=e.regeneratorRuntime=w?t.exports:{}).wrap=n;var k="suspendedStart",C="suspendedYield",T="executing",O="completed",A={},L={};L[_]=function(){return this};var R=Object.getPrototypeOf,D=R&&R(R(p([])));D&&D!==v&&y.call(D,_)&&(L=D);var I=a.prototype=i.prototype=Object.create(L);o.prototype=I.constructor=a,a.constructor=o,a[x]=o.displayName="GeneratorFunction",S.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===o||"GeneratorFunction"===(t.displayName||t.name))},S.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,x in e||(e[x]="GeneratorFunction")),e.prototype=Object.create(I),e},S.awrap=function(e){return{__await:e}},s(l.prototype),l.prototype[E]=function(){return this},S.AsyncIterator=l,S.async=function(e,t,r,i){var o=new l(n(e,t,r,i));return S.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},s(I),I[x]="Generator",I[_]=function(){return this},I.toString=function(){return"[object Generator]"},S.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},S.values=p,f.prototype={constructor:f,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(d),!e)for(var t in this)"t"===t.charAt(0)&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=g)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){function t(t,r){return o.type="throw",o.arg=e,n.next=t,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,A):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),A},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),d(n),A}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;d(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:p(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=g),A}}}}(function(){return this}()||Function("return this")())},{}],193:[function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return a(e,t,n)}var o=e("buffer"),a=o.Buffer;a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=o:(r(o,n),n.Buffer=i),r(a,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o.SlowBuffer(e)}},{buffer:38}],194:[function(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=r(e("babel-runtime/core-js/string/from-code-point")),o=r(e("babel-runtime/core-js/json/stringify")),a=r(e("babel-runtime/helpers/typeof")),s=r(e("babel-runtime/core-js/object/define-property")),l=r(e("babel-runtime/core-js/object/keys")),c=r(e("babel-runtime/core-js/object/create"));!function(n){function r(e,t){if(!(this instanceof r))return new r(e,t);var i=this;(function(e){for(var t=0,n=I.length;t<n;t++)e[I[t]]=""})(i),i.q=i.c="",i.bufferCheckPosition=n.MAX_BUFFER_LENGTH,i.opt=t||{},i.opt.lowercase=i.opt.lowercase||i.opt.lowercasetags,i.looseCase=i.opt.lowercase?"toLowerCase":"toUpperCase",i.tags=[],i.closed=i.closedRoot=i.sawRoot=!1,i.tag=i.error=null,i.strict=!!e,i.noscript=!(!e&&!i.opt.noscript),i.state=V.BEGIN,i.strictEntities=i.opt.strictEntities,i.ENTITIES=i.strictEntities?(0,c.default)(n.XML_ENTITIES):(0,c.default)(n.ENTITIES),i.attribList=[],i.opt.xmlns&&(i.ns=(0,c.default)(F)),i.trackPosition=!1!==i.opt.position,i.trackPosition&&(i.position=i.line=i.column=0),v(i,"onready")}function u(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),r=0,i=0,o=I.length;i<o;i++){var a=e[I[i]].length;if(a>t)switch(I[i]){case"textNode":b(e);break;case"cdata":y(e,"oncdata",e.cdata),e.cdata="";break;case"script":y(e,"onscript",e.script),e.script="";break;default:E(e,"Max buffer length exceeded: "+I[i])}r=Math.max(r,a)}var s=n.MAX_BUFFER_LENGTH-r;e.bufferCheckPosition=s+e.position}function h(e,t){if(!(this instanceof h))return new h(e,t);D.apply(this),this._parser=new r(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,M.forEach((function(e){(0,s.default)(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})}))}function d(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function f(e){return'"'===e||"'"===e}function p(e){return">"===e||d(e)}function m(e,t){return e.test(t)}function g(e,t){return!m(e,t)}function v(e,t,n){e[t]&&e[t](n)}function y(e,t,n){e.textNode&&b(e),v(e,t,n)}function b(e){e.textNode=_(e.opt,e.textNode),e.textNode&&v(e,"ontext",e.textNode),e.textNode=""}function _(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function E(e,t){return b(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,v(e,"onerror",t),e}function x(e){return e.sawRoot&&!e.closedRoot&&w(e,"Unclosed root tag"),e.state!==V.BEGIN&&e.state!==V.BEGIN_WHITESPACE&&e.state!==V.TEXT&&E(e,"Unexpected end"),b(e),e.c="",e.closed=!0,v(e,"onend"),r.call(e,e.strict,e.opt),e}function w(e,t){if("object"!==(void 0===e?"undefined":(0,a.default)(e))||!(e instanceof r))throw new Error("bad call to strictFail");e.strict&&E(e,t)}function S(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,y(e,"onopentagstart",n)}function k(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function C(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=k(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==j)w(e,"xml: prefix must be bound to "+j+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==B)w(e,"xmlns: prefix must be bound to "+B+"\nActual: "+e.attribValue);else{var i=e.tag,o=e.tags[e.tags.length-1]||e;i.ns===o.ns&&(i.ns=(0,c.default)(o.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,y(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function T(e,t){if(e.opt.xmlns){var n=e.tag,r=k(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(w(e,"Unbound namespace prefix: "+(0,o.default)(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&(0,l.default)(n.ns).forEach((function(t){y(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,s=e.attribList.length;a<s;a++){var c=e.attribList[a],u=c[0],h=c[1],d=k(u,!0),f=d.prefix,p=d.local,m=""===f?"":n.ns[f]||"",g={name:u,value:h,prefix:f,local:p,uri:m};f&&"xmlns"!==f&&!m&&(w(e,"Unbound namespace prefix: "+(0,o.default)(f)),g.uri=f),e.tag.attributes[u]=g,y(e,"onattribute",g)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),y(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=V.TEXT:e.state=V.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function O(e){if(!e.tagName)return w(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=V.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=V.SCRIPT);y(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)w(e,"Unexpected close tag");if(t<0)return w(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=V.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var o=e.tag=e.tags.pop();e.tagName=e.tag.name,y(e,"onclosetag",e.tagName);var a={};for(var s in o.ns)a[s]=o.ns[s];var c=e.tags[e.tags.length-1]||e;e.opt.xmlns&&o.ns!==c.ns&&(0,l.default)(o.ns).forEach((function(t){var n=o.ns[t];y(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=V.TEXT}function A(e){var t,n=e.entity,r=n.toLowerCase(),o="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),o=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),o=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(t)||o.toLowerCase()!==n?(w(e,"Invalid character entity"),"&"+e.entity+";"):(0,i.default)(t))}function L(e,t){"<"===t?(e.state=V.OPEN_WAKA,e.startTagPosition=e.position):d(t)||(w(e,"Non-whitespace before first tag."),e.textNode=t,e.state=V.TEXT)}function R(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}n.parser=function(e,t){return new r(e,t)},n.SAXParser=r,n.SAXStream=h,n.createStream=function(e,t){return new h(e,t)},n.MAX_BUFFER_LENGTH=65536;var D,I=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];n.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],c.default||(Object.create=function(e){function t(){}return t.prototype=e,new t}),l.default||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),r.prototype={end:function(){x(this)},write:function(e){var t=this;if(this.error)throw this.error;if(t.closed)return E(t,"Cannot write after close. Assign an onready handler.");if(null===e)return x(t);"object"===(void 0===e?"undefined":(0,a.default)(e))&&(e=e.toString());for(var n=0,r="";r=R(e,n++),t.c=r,r;)switch(t.trackPosition&&(t.position++,"\n"===r?(t.line++,t.column=0):t.column++),t.state){case V.BEGIN:if(t.state=V.BEGIN_WHITESPACE,"\ufeff"===r)continue;L(t,r);continue;case V.BEGIN_WHITESPACE:L(t,r);continue;case V.TEXT:if(t.sawRoot&&!t.closedRoot){for(var i=n-1;r&&"<"!==r&&"&"!==r;)(r=R(e,n++))&&t.trackPosition&&(t.position++,"\n"===r?(t.line++,t.column=0):t.column++);t.textNode+=e.substring(i,n-1)}"<"!==r||t.sawRoot&&t.closedRoot&&!t.strict?(d(r)||t.sawRoot&&!t.closedRoot||w(t,"Text data outside of root node."),"&"===r?t.state=V.TEXT_ENTITY:t.textNode+=r):(t.state=V.OPEN_WAKA,t.startTagPosition=t.position);continue;case V.SCRIPT:"<"===r?t.state=V.SCRIPT_ENDING:t.script+=r;continue;case V.SCRIPT_ENDING:"/"===r?t.state=V.CLOSE_TAG:(t.script+="<"+r,t.state=V.SCRIPT);continue;case V.OPEN_WAKA:if("!"===r)t.state=V.SGML_DECL,t.sgmlDecl="";else if(d(r));else if(m(U,r))t.state=V.OPEN_TAG,t.tagName=r;else if("/"===r)t.state=V.CLOSE_TAG,t.tagName="";else if("?"===r)t.state=V.PROC_INST,t.procInstName=t.procInstBody="";else{if(w(t,"Unencoded <"),t.startTagPosition+1<t.position){var o=t.position-t.startTagPosition;r=new Array(o).join(" ")+r}t.textNode+="<"+r,t.state=V.TEXT}continue;case V.SGML_DECL:(t.sgmlDecl+r).toUpperCase()===N?(y(t,"onopencdata"),t.state=V.CDATA,t.sgmlDecl="",t.cdata=""):t.sgmlDecl+r==="--"?(t.state=V.COMMENT,t.comment="",t.sgmlDecl=""):(t.sgmlDecl+r).toUpperCase()===P?(t.state=V.DOCTYPE,(t.doctype||t.sawRoot)&&w(t,"Inappropriately located doctype declaration"),t.doctype="",t.sgmlDecl=""):">"===r?(y(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=V.TEXT):f(r)?(t.state=V.SGML_DECL_QUOTED,t.sgmlDecl+=r):t.sgmlDecl+=r;continue;case V.SGML_DECL_QUOTED:r===t.q&&(t.state=V.SGML_DECL,t.q=""),t.sgmlDecl+=r;continue;case V.DOCTYPE:">"===r?(t.state=V.TEXT,y(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=r,"["===r?t.state=V.DOCTYPE_DTD:f(r)&&(t.state=V.DOCTYPE_QUOTED,t.q=r));continue;case V.DOCTYPE_QUOTED:t.doctype+=r,r===t.q&&(t.q="",t.state=V.DOCTYPE);continue;case V.DOCTYPE_DTD:t.doctype+=r,"]"===r?t.state=V.DOCTYPE:f(r)&&(t.state=V.DOCTYPE_DTD_QUOTED,t.q=r);continue;case V.DOCTYPE_DTD_QUOTED:t.doctype+=r,r===t.q&&(t.state=V.DOCTYPE_DTD,t.q="");continue;case V.COMMENT:"-"===r?t.state=V.COMMENT_ENDING:t.comment+=r;continue;case V.COMMENT_ENDING:"-"===r?(t.state=V.COMMENT_ENDED,t.comment=_(t.opt,t.comment),t.comment&&y(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+r,t.state=V.COMMENT);continue;case V.COMMENT_ENDED:">"!==r?(w(t,"Malformed comment"),t.comment+="--"+r,t.state=V.COMMENT):t.state=V.TEXT;continue;case V.CDATA:"]"===r?t.state=V.CDATA_ENDING:t.cdata+=r;continue;case V.CDATA_ENDING:"]"===r?t.state=V.CDATA_ENDING_2:(t.cdata+="]"+r,t.state=V.CDATA);continue;case V.CDATA_ENDING_2:">"===r?(t.cdata&&y(t,"oncdata",t.cdata),y(t,"onclosecdata"),t.cdata="",t.state=V.TEXT):"]"===r?t.cdata+="]":(t.cdata+="]]"+r,t.state=V.CDATA);continue;case V.PROC_INST:"?"===r?t.state=V.PROC_INST_ENDING:d(r)?t.state=V.PROC_INST_BODY:t.procInstName+=r;continue;case V.PROC_INST_BODY:if(!t.procInstBody&&d(r))continue;"?"===r?t.state=V.PROC_INST_ENDING:t.procInstBody+=r;continue;case V.PROC_INST_ENDING:">"===r?(y(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=V.TEXT):(t.procInstBody+="?"+r,t.state=V.PROC_INST_BODY);continue;case V.OPEN_TAG:m(G,r)?t.tagName+=r:(S(t),">"===r?T(t):"/"===r?t.state=V.OPEN_TAG_SLASH:(d(r)||w(t,"Invalid character in tag name"),t.state=V.ATTRIB));continue;case V.OPEN_TAG_SLASH:">"===r?(T(t,!0),O(t)):(w(t,"Forward-slash in opening tag not followed by >"),t.state=V.ATTRIB);continue;case V.ATTRIB:if(d(r))continue;">"===r?T(t):"/"===r?t.state=V.OPEN_TAG_SLASH:m(U,r)?(t.attribName=r,t.attribValue="",t.state=V.ATTRIB_NAME):w(t,"Invalid attribute name");continue;case V.ATTRIB_NAME:"="===r?t.state=V.ATTRIB_VALUE:">"===r?(w(t,"Attribute without value"),t.attribValue=t.attribName,C(t),T(t)):d(r)?t.state=V.ATTRIB_NAME_SAW_WHITE:m(G,r)?t.attribName+=r:w(t,"Invalid attribute name");continue;case V.ATTRIB_NAME_SAW_WHITE:if("="===r)t.state=V.ATTRIB_VALUE;else{if(d(r))continue;w(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",y(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===r?T(t):m(U,r)?(t.attribName=r,t.state=V.ATTRIB_NAME):(w(t,"Invalid attribute name"),t.state=V.ATTRIB)}continue;case V.ATTRIB_VALUE:if(d(r))continue;f(r)?(t.q=r,t.state=V.ATTRIB_VALUE_QUOTED):(w(t,"Unquoted attribute value"),t.state=V.ATTRIB_VALUE_UNQUOTED,t.attribValue=r);continue;case V.ATTRIB_VALUE_QUOTED:if(r!==t.q){"&"===r?t.state=V.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=r;continue}C(t),t.q="",t.state=V.ATTRIB_VALUE_CLOSED;continue;case V.ATTRIB_VALUE_CLOSED:d(r)?t.state=V.ATTRIB:">"===r?T(t):"/"===r?t.state=V.OPEN_TAG_SLASH:m(U,r)?(w(t,"No whitespace between attributes"),t.attribName=r,t.attribValue="",t.state=V.ATTRIB_NAME):w(t,"Invalid attribute name");continue;case V.ATTRIB_VALUE_UNQUOTED:if(!p(r)){"&"===r?t.state=V.ATTRIB_VALUE_ENTITY_U:t.attribValue+=r;continue}C(t),">"===r?T(t):t.state=V.ATTRIB;continue;case V.CLOSE_TAG:if(t.tagName)">"===r?O(t):m(G,r)?t.tagName+=r:t.script?(t.script+="</"+t.tagName,t.tagName="",t.state=V.SCRIPT):(d(r)||w(t,"Invalid tagname in closing tag"),t.state=V.CLOSE_TAG_SAW_WHITE);else{if(d(r))continue;g(U,r)?t.script?(t.script+="</"+r,t.state=V.SCRIPT):w(t,"Invalid tagname in closing tag."):t.tagName=r}continue;case V.CLOSE_TAG_SAW_WHITE:if(d(r))continue;">"===r?O(t):w(t,"Invalid characters in closing tag");continue;case V.TEXT_ENTITY:case V.ATTRIB_VALUE_ENTITY_Q:case V.ATTRIB_VALUE_ENTITY_U:var s,l;switch(t.state){case V.TEXT_ENTITY:s=V.TEXT,l="textNode";break;case V.ATTRIB_VALUE_ENTITY_Q:s=V.ATTRIB_VALUE_QUOTED,l="attribValue";break;case V.ATTRIB_VALUE_ENTITY_U:s=V.ATTRIB_VALUE_UNQUOTED,l="attribValue"}";"===r?(t[l]+=A(t),t.entity="",t.state=s):m(t.entity.length?H:z,r)?t.entity+=r:(w(t,"Invalid character in entity name"),t[l]+="&"+t.entity+r,t.entity="",t.state=s);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&u(t),t},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){!function(e){b(e),""!==e.cdata&&(y(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(y(e,"onscript",e.script),e.script="")}(this)}};try{D=e("stream").Stream}catch(e){D=function(){}}var M=n.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));h.prototype=(0,c.default)(D.prototype,{constructor:{value:h}}),h.prototype.write=function(n){if("function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)){if(!this._decoder){var r=e("string_decoder").StringDecoder;this._decoder=new r("utf8")}n=this._decoder.write(n)}return this._parser.write(n.toString()),this.emit("data",n),!0},h.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},h.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===M.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),D.prototype.on.call(n,e,t)};var N="[CDATA[",P="DOCTYPE",j="http://www.w3.org/XML/1998/namespace",B="http://www.w3.org/2000/xmlns/",F={xml:j,xmlns:B},U=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,G=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,z=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,H=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,V=0;for(var W in n.STATE={BEGIN:V++,BEGIN_WHITESPACE:V++,TEXT:V++,TEXT_ENTITY:V++,OPEN_WAKA:V++,SGML_DECL:V++,SGML_DECL_QUOTED:V++,DOCTYPE:V++,DOCTYPE_QUOTED:V++,DOCTYPE_DTD:V++,DOCTYPE_DTD_QUOTED:V++,COMMENT_STARTING:V++,COMMENT:V++,COMMENT_ENDING:V++,COMMENT_ENDED:V++,CDATA:V++,CDATA_ENDING:V++,CDATA_ENDING_2:V++,PROC_INST:V++,PROC_INST_BODY:V++,PROC_INST_ENDING:V++,OPEN_TAG:V++,OPEN_TAG_SLASH:V++,ATTRIB:V++,ATTRIB_NAME:V++,ATTRIB_NAME_SAW_WHITE:V++,ATTRIB_VALUE:V++,ATTRIB_VALUE_QUOTED:V++,ATTRIB_VALUE_CLOSED:V++,ATTRIB_VALUE_UNQUOTED:V++,ATTRIB_VALUE_ENTITY_Q:V++,ATTRIB_VALUE_ENTITY_U:V++,CLOSE_TAG:V++,CLOSE_TAG_SAW_WHITE:V++,SCRIPT:V++,SCRIPT_ENDING:V++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},(0,l.default)(n.ENTITIES).forEach((function(e){var t=n.ENTITIES[e],r="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=r})),n.STATE)n.STATE[n.STATE[W]]=W;V=n.STATE,i.default||function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n,r,i=[],o=-1,a=arguments.length;if(!a)return"";for(var s="";++o<a;){var l=Number(arguments[o]);if(!isFinite(l)||l<0||l>1114111||t(l)!==l)throw RangeError("Invalid code point: "+l);l<=65535?i.push(l):(n=55296+((l-=65536)>>10),r=l%1024+56320,i.push(n,r)),(o+1===a||i.length>16384)&&(s+=e.apply(null,i),i.length=0)}return s};s.default?Object.defineProperty(String,"fromCodePoint",{value:n,configurable:!0,writable:!0}):String.fromCodePoint=n}()}(void 0===n?(void 0).sax={}:n)}).call(this,e("buffer").Buffer)},{"babel-runtime/core-js/json/stringify":17,"babel-runtime/core-js/object/create":19,"babel-runtime/core-js/object/define-property":20,"babel-runtime/core-js/object/keys":23,"babel-runtime/core-js/string/from-code-point":26,"babel-runtime/helpers/typeof":32,buffer:38,stream:195,string_decoder:37}],195:[function(e,t,n){function r(){i.call(this)}t.exports=r;var i=e("events").EventEmitter;e("inherits")(r,i),r.Readable=e("readable-stream/readable.js"),r.Writable=e("readable-stream/writable.js"),r.Duplex=e("readable-stream/duplex.js"),r.Transform=e("readable-stream/transform.js"),r.PassThrough=e("readable-stream/passthrough.js"),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&c.pause&&c.pause()}function r(){c.readable&&c.resume&&c.resume()}function o(){u||(u=!0,e.end())}function a(){u||(u=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(l(),0===i.listenerCount(this,"error"))throw e}function l(){c.removeListener("data",n),e.removeListener("drain",r),c.removeListener("end",o),c.removeListener("close",a),c.removeListener("error",s),e.removeListener("error",s),c.removeListener("end",l),c.removeListener("close",l),e.removeListener("close",l)}var c=this;c.on("data",n),e.on("drain",r),e._isStdio||t&&!1===t.end||(c.on("end",o),c.on("close",a));var u=!1;return c.on("error",s),e.on("error",s),c.on("end",l),c.on("close",l),e.on("close",l),e.emit("pipe",c),e}},{events:158,inherits:162,"readable-stream/duplex.js":178,"readable-stream/passthrough.js":187,"readable-stream/readable.js":188,"readable-stream/transform.js":189,"readable-stream/writable.js":190}],196:[function(e,n,r){(function(t){var n=e("./lib/request"),i=e("./lib/response"),o=e("xtend"),a=e("builtin-status-codes"),s=e("url"),l=r;l.request=function(e,r){e="string"==typeof e?s.parse(e):o(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||i,l=e.hostname||e.host,c=e.port,u=e.path||"/";l&&-1!==l.indexOf(":")&&(l="["+l+"]"),e.url=(l?a+"//"+l:"")+(c?":"+c:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var h=new n(e);return r&&h.on("response",r),h},l.get=function(e,t){var n=l.request(e,t);return n.end(),n},l.ClientRequest=n,l.IncomingMessage=i.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=a,l.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":198,"./lib/response":199,"builtin-status-codes":39,url:203,xtend:236}],197:[function(e,n,r){(function(e){"use strict";function t(){if(void 0!==o)return o;if(e.XMLHttpRequest){o=new e.XMLHttpRequest;try{o.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){o=null}}else o=null;return o}function n(e){var n=t();if(!n)return!1;try{return n.responseType=e,n.responseType===e}catch(e){}return!1}function i(e){return"function"==typeof e}r.fetch=i(e.fetch)&&i(e.ReadableStream),r.writableStream=i(e.WritableStream),r.abortController=i(e.AbortController),r.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),r.blobConstructor=!0}catch(e){}var o,a=void 0!==e.ArrayBuffer,s=a&&i(e.ArrayBuffer.prototype.slice);r.arraybuffer=r.fetch||a&&n("arraybuffer"),r.msstream=!r.fetch&&s&&n("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&a&&n("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!t()&&i(t().overrideMimeType),r.vbArray=i(e.VBArray),o=null}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],198:[function(e,n,r){(function(t,r,i){"use strict";var o=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/keys")),a=e("./capability"),s=e("inherits"),l=e("./response"),c=e("readable-stream"),u=e("to-arraybuffer"),h=l.IncomingMessage,d=l.readyStates,f=n.exports=function(e){var t=this;c.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+new i(e.auth).toString("base64")),(0,o.default)(e.headers).forEach((function(n){t.setHeader(n,e.headers[n])}));var n,r=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!a.abortController)r=!1,n=!0;else if("prefer-streaming"===e.mode)n=!1;else if("allow-wrong-content-type"===e.mode)n=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");n=!0}t._mode=function(e,t){return a.fetch&&t?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":a.vbArray&&e?"text:vbarray":"text"}(n,r),t._fetchTimer=null,t.on("finish",(function(){t._onFinish()}))};s(f,c.Writable),f.prototype.setHeader=function(e,t){var n=e.toLowerCase();-1===p.indexOf(n)&&(this._headers[n]={name:e,value:t})},f.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},f.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},f.prototype._onFinish=function(){var e=this;if(!e._destroyed){var n=e._opts,s=e._headers,l=null;"GET"!==n.method&&"HEAD"!==n.method&&(l=a.arraybuffer?u(i.concat(e._body)):a.blobConstructor?new r.Blob(e._body.map((function(e){return u(e)})),{type:(s["content-type"]||{}).value||""}):i.concat(e._body).toString());var c=[];if((0,o.default)(s).forEach((function(e){var t=s[e].name,n=s[e].value;Array.isArray(n)?n.forEach((function(e){c.push([t,e])})):c.push([t,n])})),"fetch"===e._mode){var h=null;if(a.abortController){var f=new AbortController;h=f.signal,e._fetchAbortController=f,"requestTimeout"in n&&0!==n.requestTimeout&&(e._fetchTimer=r.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),n.requestTimeout))}r.fetch(e._opts.url,{method:e._opts.method,headers:c,body:l||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin",signal:h}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){r.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)}))}else{var p=e._xhr=new r.XMLHttpRequest;try{p.open(e._opts.method,e._opts.url,!0)}catch(n){return void t.nextTick((function(){e.emit("error",n)}))}"responseType"in p&&(p.responseType=e._mode.split(":")[0]),"withCredentials"in p&&(p.withCredentials=!!n.withCredentials),"text"===e._mode&&"overrideMimeType"in p&&p.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in n&&(p.timeout=n.requestTimeout,p.ontimeout=function(){e.emit("requestTimeout")}),c.forEach((function(e){p.setRequestHeader(e[0],e[1])})),e._response=null,p.onreadystatechange=function(){switch(p.readyState){case d.LOADING:case d.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(p.onprogress=function(){e._onXHRProgress()}),p.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{p.send(l)}catch(n){return void t.nextTick((function(){e.emit("error",n)}))}}}},f.prototype._onXHRProgress=function(){var e=this;(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},f.prototype._connect=function(){var e=this;e._destroyed||(e._response=new h(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},f.prototype._write=function(e,t,n){this._body.push(e),n()},f.prototype.abort=f.prototype.destroy=function(){var e=this;e._destroyed=!0,r.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},f.prototype.end=function(e,t,n){"function"==typeof e&&(n=e,e=void 0),c.Writable.prototype.end.call(this,e,t,n)},f.prototype.flushHeaders=function(){},f.prototype.setTimeout=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var p=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,e("_process"),void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":197,"./response":199,_process:173,"babel-runtime/core-js/object/keys":23,buffer:38,inherits:162,"readable-stream":188,"to-arraybuffer":202}],199:[function(e,n,r){(function(t,n,i){"use strict";var o=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/promise")),a=e("./capability"),s=e("inherits"),l=e("readable-stream"),c=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=r.IncomingMessage=function(e,r,s,c){var u=this;if(l.Readable.call(u),u._mode=s,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){t.nextTick((function(){u.emit("close")}))})),"fetch"===s){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach((function(e,t){u.headers[t.toLowerCase()]=e,u.rawHeaders.push(t,e)})),a.writableStream){var h=new WritableStream({write:function(e){return new o.default((function(t,n){u._destroyed?n():u.push(new i(e))?t():u._resumeFetch=t}))},close:function(){n.clearTimeout(c),u._destroyed||u.push(null)},abort:function(e){u._destroyed||u.emit("error",e)}});try{return void r.body.pipeTo(h).catch((function(e){n.clearTimeout(c),u._destroyed||u.emit("error",e)}))}catch(e){}}var d=r.body.getReader();!function e(){d.read().then((function(t){if(!u._destroyed){if(t.done)return n.clearTimeout(c),void u.push(null);u.push(new i(t.value)),e()}})).catch((function(e){n.clearTimeout(c),u._destroyed||u.emit("error",e)}))}()}else if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===u.headers[n]&&(u.headers[n]=[]),u.headers[n].push(t[2])):void 0!==u.headers[n]?u.headers[n]+=", "+t[2]:u.headers[n]=t[2],u.rawHeaders.push(t[1],t[2])}})),u._charset="x-user-defined",!a.overrideMimeType){var f=u.rawHeaders["mime-type"];if(f){var p=f.match(/;\s*charset=([^;])(;|$)/);p&&(u._charset=p[1].toLowerCase())}u._charset||(u._charset="utf-8")}};s(u,l.Readable),u.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},u.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==c.DONE)break;try{r=new n.VBArray(t.responseBody).toArray()}catch(e){}if(null!==r){e.push(new i(r));break}case"text":try{r=t.responseText}catch(t){e._mode="text:vbarray";break}if(r.length>e._pos){var o=r.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new i(o.length),s=0;s<o.length;s++)a[s]=255&o.charCodeAt(s);e.push(a)}else e.push(o,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==c.DONE||!t.response)break;r=t.response,e.push(new i(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==c.LOADING||!r)break;e.push(new i(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==c.LOADING)break;var l=new n.MSStreamReader;l.onprogress=function(){l.result.byteLength>e._pos&&(e.push(new i(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){e.push(null)},l.readAsArrayBuffer(r)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,e("_process"),void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":197,_process:173,"babel-runtime/core-js/promise":24,buffer:38,inherits:162,"readable-stream":188}],200:[function(e,t,n){"use strict";function r(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(d.isEncoding===f||!f(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=a,this.end=s,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=l,this.end=c,t=3;break;default:return this.write=u,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=d.allocUnsafe(t)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"锟<>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"锟<>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"锟<>"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function a(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}var d=e("safe-buffer").Buffer,f=d.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};n.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"锟<>":t},r.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=i(t[r]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--r<n||-2===o?0:(o=i(t[r]))>=0?(o>0&&(e.lastNeed=o-2),o):--r<n||-2===o?0:(o=i(t[r]))>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":193}],201:[function(e,t,n){(function(t,r){function i(e,t){this._id=e,this._clearFn=t}var o=e("process/browser.js").nextTick,a=Function.prototype.apply,s=Array.prototype.slice,l={},c=0;n.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n.setImmediate="function"==typeof t?t:function(e){var t=c++,r=!(arguments.length<2)&&s.call(arguments,1);return l[t]=!0,o((function(){l[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))})),t},n.clearImmediate="function"==typeof r?r:function(e){delete l[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":173,timers:201}],202:[function(e,t,n){var r=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(r.isBuffer(e)){for(var t=new Uint8Array(e.length),n=e.length,i=0;i<n;i++)t[i]=e[i];return t.buffer}throw new Error("Argument must be a Buffer")}},{buffer:38}],203:[function(e,t,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,n){if(e&&a.isObject(e)&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}var o=e("punycode"),a=e("./util");n.parse=i,n.resolve=function(e,t){return i(e,!1,!0).resolve(t)},n.resolveObject=function(e,t){return e?i(e,!1,!0).resolveObject(t):t},n.format=function(e){return a.isString(e)&&(e=i(e)),e instanceof r?e.format():r.prototype.format.call(e)},n.Url=r;var s=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(u),d=["%","/","?",";","#"].concat(h),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=e("querystring");r.prototype.parse=function(e,t,n){if(!a.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),i=-1!==r&&r<e.indexOf("#")?"?":"#",l=e.split(i);l[0]=l[0].replace(/\\/g,"/");var u=e=l.join(i);if(u=u.trim(),!n&&1===e.split("#").length){var _=c.exec(u);if(_)return this.path=u,this.href=u,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var E=s.exec(u);if(E){var x=(E=E[0]).toLowerCase();this.protocol=x,u=u.substr(E.length)}if(n||E||u.match(/^\/\/[^@\/]+@[^@\/]+/)){var w="//"===u.substr(0,2);!w||E&&v[E]||(u=u.substr(2),this.slashes=!0)}if(!v[E]&&(w||E&&!y[E])){for(var S=-1,k=0;k<f.length;k++){-1!==(O=u.indexOf(f[k]))&&(-1===S||O<S)&&(S=O)}var C,T;-1!==(T=-1===S?u.lastIndexOf("@"):u.lastIndexOf("@",S))&&(C=u.slice(0,T),u=u.slice(T+1),this.auth=decodeURIComponent(C)),S=-1;for(k=0;k<d.length;k++){var O;-1!==(O=u.indexOf(d[k]))&&(-1===S||O<S)&&(S=O)}-1===S&&(S=u.length),this.host=u.slice(0,S),u=u.slice(S),this.parseHost(),this.hostname=this.hostname||"";var A="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!A)for(var L=this.hostname.split(/\./),R=(k=0,L.length);k<R;k++){var D=L[k];if(D&&!D.match(p)){for(var I="",M=0,N=D.length;M<N;M++)D.charCodeAt(M)>127?I+="x":I+=D[M];if(!I.match(p)){var P=L.slice(0,k),j=L.slice(k+1),B=D.match(m);B&&(P.push(B[1]),j.unshift(B[2])),j.length&&(u="/"+j.join(".")+u),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=o.toASCII(this.hostname));var F=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+F,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!g[x])for(k=0,R=h.length;k<R;k++){var G=h[k];if(-1!==u.indexOf(G)){var z=encodeURIComponent(G);z===G&&(z=escape(G)),u=u.split(G).join(z)}}var H=u.indexOf("#");-1!==H&&(this.hash=u.substr(H),u=u.slice(0,H));var V=u.indexOf("?");if(-1!==V?(this.search=u.substr(V),this.query=u.substr(V+1),t&&(this.query=b.parse(this.query)),u=u.slice(0,V)):t&&(this.search="",this.query={}),u&&(this.pathname=u),y[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"";var W=this.search||"";this.path=F+W}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&a.isObject(this.query)&&Object.keys(this.query).length&&(o=b.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+r},r.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(a.isString(e)){var t=new r;t.parse(e,!1,!0),e=t}for(var n=new r,i=Object.keys(this),o=0;o<i.length;o++){var s=i[o];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var l=Object.keys(e),c=0;c<l.length;c++){var u=l[c];"protocol"!==u&&(n[u]=e[u])}return y[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!y[e.protocol]){for(var h=Object.keys(e),d=0;d<h.length;d++){var f=h[d];n[f]=e[f]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||v[e.protocol])n.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",g=n.search||"";n.path=m+g}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),E=_||b||n.host&&e.pathname,x=E,w=n.pathname&&n.pathname.split("/")||[],S=(p=e.pathname&&e.pathname.split("/")||[],n.protocol&&!y[n.protocol]);if(S&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),E=E&&(""===p[0]||""===w[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,w=p;else if(p.length)w||(w=[]),w.pop(),w=w.concat(p),n.search=e.search,n.query=e.query;else if(!a.isNullOrUndefined(e.search)){if(S)n.hostname=n.host=w.shift(),(A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=A.shift(),n.host=n.hostname=A.shift());return n.search=e.search,n.query=e.query,a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var k=w.slice(-1)[0],C=(n.host||e.host||w.length>1)&&("."===k||".."===k)||""===k,T=0,O=w.length;O>=0;O--)"."===(k=w[O])?w.splice(O,1):".."===k?(w.splice(O,1),T++):T&&(w.splice(O,1),T--);if(!E&&!x)for(;T--;T)w.unshift("..");!E||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),C&&"/"!==w.join("/").substr(-1)&&w.push("");var A,L=""===w[0]||w[0]&&"/"===w[0].charAt(0);S&&(n.hostname=n.host=L?"":w.length?w.shift():"",(A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=A.shift(),n.host=n.hostname=A.shift()));return(E=E||n.host&&w.length)&&!L&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":204,punycode:174,querystring:177}],204:[function(e,t,n){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],205:[function(e,n,r){(function(e){function t(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}n.exports=function(e,n){if(t("noDeprecation"))return e;var r=!1;return function(){if(!r){if(t("throwDeprecation"))throw new Error(n);t("traceDeprecation")?console.trace(n):console.warn(n),r=!0}return e.apply(this,arguments)}}}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],206:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],207:[function(e,n,r){(function(t,n){function i(e,t){var n={seen:[],stylize:a};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(t)?n.showHidden=t:t&&r._extend(n,t),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),s(n,e,n.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function a(e,t){return e}function s(e,t,n){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return m(i)||(i=s(e,i,n)),i}var o=l(e,t);if(o)return o;var a=Object.keys(t),d=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),_(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(t);if(0===a.length){if(E(t)){var f=t.name?": "+t.name:"";return e.stylize("[Function"+f+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(b(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return c(t)}var p,g="",y=!1,x=["{","}"];return h(t)&&(y=!0,x=["[","]"]),E(t)&&(g=" [Function"+(t.name?": "+t.name:"")+"]"),v(t)&&(g=" "+RegExp.prototype.toString.call(t)),b(t)&&(g=" "+Date.prototype.toUTCString.call(t)),_(t)&&(g=" "+c(t)),0!==a.length||y&&0!=t.length?n<0?v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),p=y?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a<s;++a)k(t,String(a))?o.push(u(e,t,n,r,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(u(e,t,n,r,i,!0))})),o}(e,t,n,d,a):a.map((function(r){return u(e,t,n,d,r,y)})),e.seen.pop(),function(e,t,n){return e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(p,g,x)):x[0]+g+x[1]}function l(e,t){if(g(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return p(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function u(e,t,n,r,i,o){var a,l,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?l=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(l=e.stylize("[Setter]","special")),k(r,i)||(a="["+i+"]"),l||(e.seen.indexOf(c.value)<0?(l=f(n)?s(e,c.value,null):s(e,c.value,n-1)).indexOf("\n")>-1&&(l=o?l.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+l.split("\n").map((function(e){return" "+e})).join("\n")):l=e.stylize("[Circular]","special")),g(a)){if(o&&i.match(/^\d+$/))return l;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+l}function h(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function f(e){return null===e}function p(e){return"number"==typeof e}function m(e){return"string"==typeof e}function g(e){return void 0===e}function v(e){return y(e)&&"[object RegExp]"===x(e)}function y(e){return"object"==typeof e&&null!==e}function b(e){return y(e)&&"[object Date]"===x(e)}function _(e){return y(e)&&("[object Error]"===x(e)||e instanceof Error)}function E(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function w(e){return e<10?"0"+e.toString(10):e.toString(10)}function S(){var e=new Date,t=[w(e.getHours()),w(e.getMinutes()),w(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var C=/%[sdj%]/g;r.format=function(e){if(!m(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,a=String(e).replace(C,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),s=r[n];n<o;s=r[++n])f(s)||!y(s)?a+=" "+s:a+=" "+i(s);return a},r.deprecate=function(e,i){if(g(n.process))return function(){return r.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),o=!0}return e.apply(this,arguments)}};var T,O={};r.debuglog=function(e){if(g(T)&&(T=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!O[e])if(new RegExp("\\b"+e+"\\b","i").test(T)){var n=t.pid;O[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else O[e]=function(){};return O[e]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=h,r.isBoolean=d,r.isNull=f,r.isNullOrUndefined=function(e){return null==e},r.isNumber=p,r.isString=m,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=g,r.isRegExp=v,r.isObject=y,r.isDate=b,r.isError=_,r.isFunction=E,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",S(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!y(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":206,_process:173,inherits:162}],208:[function(e,t,n){"use strict";(function(){n.stripBOM=function(e){return"\ufeff"===e[0]?e.substring(1):e}}).call(void 0)},{}],209:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=r(e("babel-runtime/helpers/typeof")),o=r(e("babel-runtime/core-js/object/keys"));(function(){var t,r,a,s,l,c={}.hasOwnProperty;t=e("xmlbuilder"),r=e("./defaults").defaults,s=function(e){return"string"==typeof e&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)},l=function(e){return"<![CDATA["+a(e)+"]]>"},a=function(e){return e.replace("]]>","]]]]><![CDATA[>")},n.Builder=function(){function e(e){var t,n,i;for(t in this.options={},n=r[.2])c.call(n,t)&&(i=n[t],this.options[t]=i);for(t in e)c.call(e,t)&&(i=e[t],this.options[t]=i)}return e.prototype.buildObject=function(e){var n,a,u,h,d;return n=this.options.attrkey,a=this.options.charkey,1===(0,o.default)(e).length&&this.options.rootName===r[.2].rootName?e=e[d=(0,o.default)(e)[0]]:d=this.options.rootName,u=function(e){return function(t,r){var o,h,d,f,p,m;if("object"!==(void 0===r?"undefined":(0,i.default)(r)))e.options.cdata&&s(r)?t.raw(l(r)):t.txt(r);else if(Array.isArray(r)){for(f in r)if(c.call(r,f))for(p in h=r[f])d=h[p],t=u(t.ele(p),d).up()}else for(p in r)if(c.call(r,p))if(h=r[p],p===n){if("object"===(void 0===h?"undefined":(0,i.default)(h)))for(o in h)m=h[o],t=t.att(o,m)}else if(p===a)t=e.options.cdata&&s(h)?t.raw(l(h)):t.txt(h);else if(Array.isArray(h))for(f in h)c.call(h,f)&&(t="string"==typeof(d=h[f])?e.options.cdata&&s(d)?t.ele(p).raw(l(d)).up():t.ele(p,d).up():u(t.ele(p),d).up());else"object"===(void 0===h?"undefined":(0,i.default)(h))?t=u(t.ele(p),h).up():"string"==typeof h&&e.options.cdata&&s(h)?t=t.ele(p).raw(l(h)).up():(null==h&&(h=""),t=t.ele(p,h.toString()).up());return t}}(this),h=t.create(d,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),u(h,e).end(this.options.renderOpts)},e}()}).call(void 0)},{"./defaults":210,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,xmlbuilder:235}],210:[function(e,t,n){"use strict";(function(){n.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(void 0)},{}],211:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=r(e("babel-runtime/core-js/object/get-own-property-names")),o=r(e("babel-runtime/core-js/object/keys")),a=r(e("babel-runtime/helpers/typeof"));(function(){var t,r,s,l,c,u,h,d,f=function(e,t){return function(){return e.apply(t,arguments)}},p={}.hasOwnProperty;h=e("sax"),s=e("events"),t=e("./bom"),u=e("./processors"),d=e("timers").setImmediate,r=e("./defaults").defaults,l=function(e){return"object"===(void 0===e?"undefined":(0,a.default)(e))&&null!=e&&0===(0,o.default)(e).length},c=function(e,t,n){var r,i;for(r=0,i=e.length;r<i;r++)t=(0,e[r])(t,n);return t},n.Parser=function(e){function s(e){var t,i,o;if(this.parseString=f(this.parseString,this),this.reset=f(this.reset,this),this.assignOrPush=f(this.assignOrPush,this),this.processAsync=f(this.processAsync,this),!(this instanceof n.Parser))return new n.Parser(e);for(t in this.options={},i=r[.2])p.call(i,t)&&(o=i[t],this.options[t]=o);for(t in e)p.call(e,t)&&(o=e[t],this.options[t]=o);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(u.normalize)),this.reset()}return function(e,t){function n(){this.constructor=e}for(var r in t)p.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(s,e),s.prototype.processAsync=function(){var e,t;try{return this.remaining.length<=this.options.chunkSize?(e=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(e),this.saxParser.close()):(e=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(e),d(this.processAsync))}catch(e){if(t=e,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(t)}},s.prototype.assignOrPush=function(e,t,n){return t in e?(e[t]instanceof Array||(e[t]=[e[t]]),e[t].push(n)):this.options.explicitArray?e[t]=[n]:e[t]=n},s.prototype.reset=function(){var e,t,n,r;return this.removeAllListeners(),this.saxParser=h.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=function(e){return function(t){if(e.saxParser.resume(),!e.saxParser.errThrown)return e.saxParser.errThrown=!0,e.emit("error",t)}}(this),this.saxParser.onend=function(e){return function(){if(!e.saxParser.ended)return e.saxParser.ended=!0,e.emit("end",e.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,r=[],e=this.options.attrkey,t=this.options.charkey,this.saxParser.onopentag=function(n){return function(i){var o,a,s,l,u;if((s={})[t]="",!n.options.ignoreAttrs)for(o in u=i.attributes)p.call(u,o)&&(e in s||n.options.mergeAttrs||(s[e]={}),a=n.options.attrValueProcessors?c(n.options.attrValueProcessors,i.attributes[o],o):i.attributes[o],l=n.options.attrNameProcessors?c(n.options.attrNameProcessors,o):o,n.options.mergeAttrs?n.assignOrPush(s,l,a):s[e][l]=a);return s["#name"]=n.options.tagNameProcessors?c(n.options.tagNameProcessors,i.name):i.name,n.options.xmlns&&(s[n.options.xmlnskey]={uri:i.uri,local:i.local}),r.push(s)}}(this),this.saxParser.onclosetag=function(e){return function(){var n,s,u,h,d,f,m,g,v,y;if(f=r.pop(),d=f["#name"],e.options.explicitChildren&&e.options.preserveChildrenOrder||delete f["#name"],!0===f.cdata&&(n=f.cdata,delete f.cdata),v=r[r.length-1],f[t].match(/^\s*$/)&&!n?(s=f[t],delete f[t]):(e.options.trim&&(f[t]=f[t].trim()),e.options.normalize&&(f[t]=f[t].replace(/\s{2,}/g," ").trim()),f[t]=e.options.valueProcessors?c(e.options.valueProcessors,f[t],d):f[t],1===(0,o.default)(f).length&&t in f&&!e.EXPLICIT_CHARKEY&&(f=f[t])),l(f)&&(f=""!==e.options.emptyTag?e.options.emptyTag:s),null!=e.options.validator&&(y="/"+function(){var e,t,n;for(n=[],e=0,t=r.length;e<t;e++)h=r[e],n.push(h["#name"]);return n}().concat(d).join("/"),function(){var t;try{f=e.options.validator(y,v&&v[d],f)}catch(n){return t=n,e.emit("error",t)}}()),e.options.explicitChildren&&!e.options.mergeAttrs&&"object"===(void 0===f?"undefined":(0,a.default)(f)))if(e.options.preserveChildrenOrder){if(v){for(u in v[e.options.childkey]=v[e.options.childkey]||[],m={},f)p.call(f,u)&&(m[u]=f[u]);v[e.options.childkey].push(m),delete f["#name"],1===(0,o.default)(f).length&&t in f&&!e.EXPLICIT_CHARKEY&&(f=f[t])}}else h={},e.options.attrkey in f&&(h[e.options.attrkey]=f[e.options.attrkey],delete f[e.options.attrkey]),!e.options.charsAsChildren&&e.options.charkey in f&&(h[e.options.charkey]=f[e.options.charkey],delete f[e.options.charkey]),(0,i.default)(f).length>0&&(h[e.options.childkey]=f),f=h;return r.length>0?e.assignOrPush(v,d,f):(e.options.explicitRoot&&(g=f,(f={})[d]=g),e.resultObject=f,e.saxParser.ended=!0,e.emit("end",e.resultObject))}}(this),n=function(e){return function(n){var i,o;if(o=r[r.length-1])return o[t]+=n,e.options.explicitChildren&&e.options.preserveChildrenOrder&&e.options.charsAsChildren&&(e.options.includeWhiteChars||""!==n.replace(/\\n/g,"").trim())&&(o[e.options.childkey]=o[e.options.childkey]||[],(i={"#name":"__text__"})[t]=n,e.options.normalize&&(i[t]=i[t].replace(/\s{2,}/g," ").trim()),o[e.options.childkey].push(i)),o}}(this),this.saxParser.ontext=n,this.saxParser.oncdata=function(e){var t;if(t=n(e))return t.cdata=!0}},s.prototype.parseString=function(e,n){var r;null!=n&&"function"==typeof n&&(this.on("end",(function(e){return this.reset(),n(null,e)})),this.on("error",(function(e){return this.reset(),n(e)})));try{return""===(e=e.toString()).trim()?(this.emit("end",null),!0):(e=t.stripBOM(e),this.options.async?(this.remaining=e,d(this.processAsync),this.saxParser):this.saxParser.write(e).close())}catch(e){if(r=e,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",r),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw r}},s}(s.EventEmitter),n.parseString=function(e,t,r){var i,o;return null!=r?("function"==typeof r&&(i=r),"object"===(void 0===t?"undefined":(0,a.default)(t))&&(o=t)):("function"==typeof t&&(i=t),o={}),new n.Parser(o).parseString(e,i)}}).call(void 0)},{"./bom":208,"./defaults":210,"./processors":212,"babel-runtime/core-js/object/get-own-property-names":21,"babel-runtime/core-js/object/keys":23,"babel-runtime/helpers/typeof":32,events:158,sax:194,timers:201}],212:[function(e,t,n){"use strict";(function(){var e;e=new RegExp(/(?!xmlns)^.*:/),n.normalize=function(e){return e.toLowerCase()},n.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},n.stripPrefix=function(t){return t.replace(e,"")},n.parseNumbers=function(e){return isNaN(e)||(e=e%1==0?parseInt(e,10):parseFloat(e)),e},n.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e="true"===e.toLowerCase()),e}}).call(void 0)},{}],213:[function(e,t,n){"use strict";(function(){var t,r,i,o,a={}.hasOwnProperty;r=e("./defaults"),t=e("./builder"),i=e("./parser"),o=e("./processors"),n.defaults=r.defaults,n.processors=o,n.ValidationError=function(e){function t(e){this.message=e}return function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,Error),t}(),n.Builder=t.Builder,n.Parser=i.Parser,n.parseString=i.parseString}).call(void 0)},{"./builder":209,"./defaults":210,"./parser":211,"./processors":212}],214:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=r(e("babel-runtime/core-js/object/get-prototype-of")),o=r(e("babel-runtime/helpers/typeof")),a=r(e("babel-runtime/core-js/object/assign"));(function(){var e,n,r,s,l,c,u=[].slice,h={}.hasOwnProperty;e=function(){var e,t,n,r,i,o;if(o=arguments[0],i=2<=arguments.length?u.call(arguments,1):[],s(a.default))a.default.apply(null,arguments);else for(e=0,n=i.length;e<n;e++)if(null!=(r=i[e]))for(t in r)h.call(r,t)&&(o[t]=r[t]);return o},s=function(e){return!!e&&"[object Function]"===Object.prototype.toString.call(e)},l=function(e){var t;return!!e&&("function"===(t=void 0===e?"undefined":(0,o.default)(e))||"object"===t)},n=function(e){return s(Array.isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},r=function(e){var t;if(n(e))return!e.length;for(t in e)if(h.call(e,t))return!1;return!0},c=function(e){var t,n;return l(e)&&(n=(0,i.default)(e))&&(t=n.constructor)&&"function"==typeof t&&t instanceof t&&Function.prototype.toString.call(t)===Function.prototype.toString.call(Object)},t.exports.assign=e,t.exports.isFunction=s,t.exports.isObject=l,t.exports.isArray=n,t.exports.isEmpty=r,t.exports.isPlainObject=c}).call(void 0)},{"babel-runtime/core-js/object/assign":18,"babel-runtime/core-js/object/get-prototype-of":22,"babel-runtime/helpers/typeof":32}],215:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/create"));(function(){t.exports=function(){function e(e,t,n){if(this.options=e.options,this.stringify=e.stringify,null==t)throw new Error("Missing attribute name of element "+e.name);if(null==n)throw new Error("Missing attribute value for attribute "+t+" of element "+e.name);this.name=this.stringify.attName(t),this.value=this.stringify.attValue(n)}return e.prototype.clone=function(){return(0,r.default)(this)},e.prototype.toString=function(e){return this.options.writer.set(e).attribute(this)},e}()}).call(void 0)},{"babel-runtime/core-js/object/create":19}],216:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/create"));(function(){var n,i={}.hasOwnProperty;n=e("./XMLNode"),t.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing CDATA text");this.text=this.stringify.cdata(n)}return function(e,t){function n(){this.constructor=e}for(var r in t)i.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return(0,r.default)(this)},t.prototype.toString=function(e){return this.options.writer.set(e).cdata(this)},t}(n)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],217:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/create"));(function(){var n,i={}.hasOwnProperty;n=e("./XMLNode"),t.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing comment text");this.text=this.stringify.comment(n)}return function(e,t){function n(){this.constructor=e}for(var r in t)i.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return(0,r.default)(this)},t.prototype.toString=function(e){return this.options.writer.set(e).comment(this)},t}(n)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],218:[function(e,t,n){"use strict";(function(){var n,r={}.hasOwnProperty;n=e("./XMLNode"),t.exports=function(e){function t(e,n,r,i,o,a){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing DTD element name");if(null==r)throw new Error("Missing DTD attribute name");if(!i)throw new Error("Missing DTD attribute type");if(!o)throw new Error("Missing DTD attribute default");if(0!==o.indexOf("#")&&(o="#"+o),!o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");if(a&&!o.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT");this.elementName=this.stringify.eleName(n),this.attributeName=this.stringify.attName(r),this.attributeType=this.stringify.dtdAttType(i),this.defaultValue=this.stringify.dtdAttDefault(a),this.defaultValueType=o}return function(e,t){function n(){this.constructor=e}for(var i in t)r.call(t,i)&&(e[i]=t[i]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).dtdAttList(this)},t}(n)}).call(void 0)},{"./XMLNode":227}],219:[function(e,t,n){"use strict";(function(){var n,r={}.hasOwnProperty;n=e("./XMLNode"),t.exports=function(e){function t(e,n,r){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing DTD element name");r||(r="(#PCDATA)"),Array.isArray(r)&&(r="("+r.join(",")+")"),this.name=this.stringify.eleName(n),this.value=this.stringify.dtdElementValue(r)}return function(e,t){function n(){this.constructor=e}for(var i in t)r.call(t,i)&&(e[i]=t[i]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).dtdElement(this)},t}(n)}).call(void 0)},{"./XMLNode":227}],220:[function(e,t,n){"use strict";(function(){var n,r,i={}.hasOwnProperty;r=e("./Utility").isObject,n=e("./XMLNode"),t.exports=function(e){function t(e,n,i,o){if(t.__super__.constructor.call(this,e),null==i)throw new Error("Missing entity name");if(null==o)throw new Error("Missing entity value");if(this.pe=!!n,this.name=this.stringify.eleName(i),r(o)){if(!o.pubID&&!o.sysID)throw new Error("Public and/or system identifiers are required for an external entity");if(o.pubID&&!o.sysID)throw new Error("System identifier is required for a public external entity");if(null!=o.pubID&&(this.pubID=this.stringify.dtdPubID(o.pubID)),null!=o.sysID&&(this.sysID=this.stringify.dtdSysID(o.sysID)),null!=o.nData&&(this.nData=this.stringify.dtdNData(o.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity")}else this.value=this.stringify.dtdEntityValue(o)}return function(e,t){function n(){this.constructor=e}for(var r in t)i.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).dtdEntity(this)},t}(n)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],221:[function(e,t,n){"use strict";(function(){var n,r={}.hasOwnProperty;n=e("./XMLNode"),t.exports=function(e){function t(e,n,r){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing notation name");if(!r.pubID&&!r.sysID)throw new Error("Public or system identifiers are required for an external entity");this.name=this.stringify.eleName(n),null!=r.pubID&&(this.pubID=this.stringify.dtdPubID(r.pubID)),null!=r.sysID&&(this.sysID=this.stringify.dtdSysID(r.sysID))}return function(e,t){function n(){this.constructor=e}for(var i in t)r.call(t,i)&&(e[i]=t[i]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).dtdNotation(this)},t}(n)}).call(void 0)},{"./XMLNode":227}],222:[function(e,t,n){"use strict";(function(){var n,r,i={}.hasOwnProperty;r=e("./Utility").isObject,n=e("./XMLNode"),t.exports=function(e){function t(e,n,i,o){var a;t.__super__.constructor.call(this,e),r(n)&&(n=(a=n).version,i=a.encoding,o=a.standalone),n||(n="1.0"),this.version=this.stringify.xmlVersion(n),null!=i&&(this.encoding=this.stringify.xmlEncoding(i)),null!=o&&(this.standalone=this.stringify.xmlStandalone(o))}return function(e,t){function n(){this.constructor=e}for(var r in t)i.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).declaration(this)},t}(n)}).call(void 0)},{"./Utility":214,"./XMLNode":227}],223:[function(e,t,n){"use strict";(function(){var n,r,i,o,a,s,l={}.hasOwnProperty;s=e("./Utility").isObject,a=e("./XMLNode"),n=e("./XMLDTDAttList"),i=e("./XMLDTDEntity"),r=e("./XMLDTDElement"),o=e("./XMLDTDNotation"),t.exports=function(e){function t(e,n,r){var i,o;t.__super__.constructor.call(this,e),this.documentObject=e,s(n)&&(n=(i=n).pubID,r=i.sysID),null==r&&(r=(o=[n,r])[0],n=o[1]),null!=n&&(this.pubID=this.stringify.dtdPubID(n)),null!=r&&(this.sysID=this.stringify.dtdSysID(r))}return function(e,t){function n(){this.constructor=e}for(var r in t)l.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.element=function(e,t){var n;return n=new r(this,e,t),this.children.push(n),this},t.prototype.attList=function(e,t,r,i,o){var a;return a=new n(this,e,t,r,i,o),this.children.push(a),this},t.prototype.entity=function(e,t){var n;return n=new i(this,!1,e,t),this.children.push(n),this},t.prototype.pEntity=function(e,t){var n;return n=new i(this,!0,e,t),this.children.push(n),this},t.prototype.notation=function(e,t){var n;return n=new o(this,e,t),this.children.push(n),this},t.prototype.toString=function(e){return this.options.writer.set(e).docType(this)},t.prototype.ele=function(e,t){return this.element(e,t)},t.prototype.att=function(e,t,n,r,i){return this.attList(e,t,n,r,i)},t.prototype.ent=function(e,t){return this.entity(e,t)},t.prototype.pent=function(e,t){return this.pEntity(e,t)},t.prototype.not=function(e,t){return this.notation(e,t)},t.prototype.up=function(){return this.root()||this.documentObject},t}(a)}).call(void 0)},{"./Utility":214,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLNode":227}],224:[function(e,t,n){"use strict";(function(){var n,r,i,o,a={}.hasOwnProperty;o=e("./Utility").isPlainObject,n=e("./XMLNode"),i=e("./XMLStringifier"),r=e("./XMLStringWriter"),t.exports=function(e){function t(e){t.__super__.constructor.call(this,null),e||(e={}),e.writer||(e.writer=new r),this.options=e,this.stringify=new i(e),this.isDocument=!0}return function(e,t){function n(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.end=function(e){var t;return e?o(e)&&(t=e,e=this.options.writer.set(t)):e=this.options.writer,e.document(this)},t.prototype.toString=function(e){return this.options.writer.set(e).document(this)},t}(n)}).call(void 0)},{"./Utility":214,"./XMLNode":227,"./XMLStringWriter":231,"./XMLStringifier":232}],225:[function(e,t,n){"use strict";(function(){var n,r,i,o,a,s,l,c,u,h,d,f,p,m,g,v,y,b,_,E={}.hasOwnProperty;_=e("./Utility"),y=_.isObject,v=_.isFunction,b=_.isPlainObject,h=e("./XMLElement"),r=e("./XMLCData"),i=e("./XMLComment"),f=e("./XMLRaw"),g=e("./XMLText"),d=e("./XMLProcessingInstruction"),c=e("./XMLDeclaration"),u=e("./XMLDocType"),o=e("./XMLDTDAttList"),s=e("./XMLDTDEntity"),a=e("./XMLDTDElement"),l=e("./XMLDTDNotation"),n=e("./XMLAttribute"),m=e("./XMLStringifier"),p=e("./XMLStringWriter"),t.exports=function(){function e(e,t,n){var r;e||(e={}),e.writer?b(e.writer)&&(r=e.writer,e.writer=new p(r)):e.writer=new p(e),this.options=e,this.writer=e.writer,this.stringify=new m(e),this.onDataCallback=t||function(){},this.onEndCallback=n||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return e.prototype.node=function(e,t,n){var r;if(null==e)throw new Error("Missing node name");if(this.root&&-1===this.currentLevel)throw new Error("Document can only have one root node");return this.openCurrent(),e=e.valueOf(),null==t&&(t={}),t=t.valueOf(),y(t)||(n=(r=[t,n])[0],t=r[1]),this.currentNode=new h(this,e,t),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,null!=n&&this.text(n),this},e.prototype.element=function(e,t,n){return this.currentNode&&this.currentNode instanceof u?this.dtdElement.apply(this,arguments):this.node(e,t,n)},e.prototype.attribute=function(e,t){var r,i;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode");if(null!=e&&(e=e.valueOf()),y(e))for(r in e)E.call(e,r)&&(i=e[r],this.attribute(r,i));else v(t)&&(t=t.apply()),this.options.skipNullAttributes&&null==t||(this.currentNode.attributes[e]=new n(this,e,t));return this},e.prototype.text=function(e){var t;return this.openCurrent(),t=new g(this,e),this.onData(this.writer.text(t,this.currentLevel+1)),this},e.prototype.cdata=function(e){var t;return this.openCurrent(),t=new r(this,e),this.onData(this.writer.cdata(t,this.currentLevel+1)),this},e.prototype.comment=function(e){var t;return this.openCurrent(),t=new i(this,e),this.onData(this.writer.comment(t,this.currentLevel+1)),this},e.prototype.raw=function(e){var t;return this.openCurrent(),t=new f(this,e),this.onData(this.writer.raw(t,this.currentLevel+1)),this},e.prototype.instruction=function(e,t){var n,r,i,o,a;if(this.openCurrent(),null!=e&&(e=e.valueOf()),null!=t&&(t=t.valueOf()),Array.isArray(e))for(n=0,o=e.length;n<o;n++)r=e[n],this.instruction(r);else if(y(e))for(r in e)E.call(e,r)&&(i=e[r],this.instruction(r,i));else v(t)&&(t=t.apply()),a=new d(this,e,t),this.onData(this.writer.processingInstruction(a,this.currentLevel+1));return this},e.prototype.declaration=function(e,t,n){var r;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node");return r=new c(this,e,t,n),this.onData(this.writer.declaration(r,this.currentLevel+1)),this},e.prototype.doctype=function(e,t,n){if(this.openCurrent(),null==e)throw new Error("Missing root node name");if(this.root)throw new Error("dtd() must come before the root node");return this.currentNode=new u(this,t,n),this.currentNode.rootNodeName=e,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},e.prototype.dtdElement=function(e,t){var n;return this.openCurrent(),n=new a(this,e,t),this.onData(this.writer.dtdElement(n,this.currentLevel+1)),this},e.prototype.attList=function(e,t,n,r,i){var a;return this.openCurrent(),a=new o(this,e,t,n,r,i),this.onData(this.writer.dtdAttList(a,this.currentLevel+1)),this},e.prototype.entity=function(e,t){var n;return this.openCurrent(),n=new s(this,!1,e,t),this.onData(this.writer.dtdEntity(n,this.currentLevel+1)),this},e.prototype.pEntity=function(e,t){var n;return this.openCurrent(),n=new s(this,!0,e,t),this.onData(this.writer.dtdEntity(n,this.currentLevel+1)),this},e.prototype.notation=function(e,t){var n;return this.openCurrent(),n=new l(this,e,t),this.onData(this.writer.dtdNotation(n,this.currentLevel+1)),this},e.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},e.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},e.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},e.prototype.openNode=function(e){if(!e.isOpen)return!this.root&&0===this.currentLevel&&e instanceof h&&(this.root=e),this.onData(this.writer.openNode(e,this.currentLevel)),e.isOpen=!0},e.prototype.closeNode=function(e){if(!e.isClosed)return this.onData(this.writer.closeNode(e,this.currentLevel)),e.isClosed=!0},e.prototype.onData=function(e){return this.documentStarted=!0,this.onDataCallback(e)},e.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},e.prototype.ele=function(){return this.element.apply(this,arguments)},e.prototype.nod=function(e,t,n){return this.node(e,t,n)},e.prototype.txt=function(e){return this.text(e)},e.prototype.dat=function(e){return this.cdata(e)},e.prototype.com=function(e){return this.comment(e)},e.prototype.ins=function(e,t){return this.instruction(e,t)},e.prototype.dec=function(e,t,n){return this.declaration(e,t,n)},e.prototype.dtd=function(e,t,n){return this.doctype(e,t,n)},e.prototype.e=function(e,t,n){return this.element(e,t,n)},e.prototype.n=function(e,t,n){return this.node(e,t,n)},e.prototype.t=function(e){return this.text(e)},e.prototype.d=function(e){return this.cdata(e)},e.prototype.c=function(e){return this.comment(e)},e.prototype.r=function(e){return this.raw(e)},e.prototype.i=function(e,t){return this.instruction(e,t)},e.prototype.att=function(){return this.currentNode&&this.currentNode instanceof u?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},e.prototype.a=function(){return this.currentNode&&this.currentNode instanceof u?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},e.prototype.ent=function(e,t){return this.entity(e,t)},e.prototype.pent=function(e,t){return this.pEntity(e,t)},e.prototype.not=function(e,t){return this.notation(e,t)},e}()}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLStringWriter":231,"./XMLStringifier":232,"./XMLText":233}],226:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/create"));(function(){var n,i,o,a,s,l={}.hasOwnProperty;s=e("./Utility"),a=s.isObject,o=s.isFunction,i=e("./XMLNode"),n=e("./XMLAttribute"),t.exports=function(e){function t(e,n,r){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing element name");this.name=this.stringify.eleName(n),this.attributes={},null!=r&&this.attribute(r),e.isDocument&&(this.isRoot=!0,this.documentObject=e,e.rootObject=this)}return function(e,t){function n(){this.constructor=e}for(var r in t)l.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){var e,t,n,i;for(t in(n=(0,r.default)(this)).isRoot&&(n.documentObject=null),n.attributes={},i=this.attributes)l.call(i,t)&&(e=i[t],n.attributes[t]=e.clone());return n.children=[],this.children.forEach((function(e){var t;return(t=e.clone()).parent=n,n.children.push(t)})),n},t.prototype.attribute=function(e,t){var r,i;if(null!=e&&(e=e.valueOf()),a(e))for(r in e)l.call(e,r)&&(i=e[r],this.attribute(r,i));else o(t)&&(t=t.apply()),this.options.skipNullAttributes&&null==t||(this.attributes[e]=new n(this,e,t));return this},t.prototype.removeAttribute=function(e){var t,n,r;if(null==e)throw new Error("Missing attribute name");if(e=e.valueOf(),Array.isArray(e))for(n=0,r=e.length;n<r;n++)t=e[n],delete this.attributes[t];else delete this.attributes[e];return this},t.prototype.toString=function(e){return this.options.writer.set(e).element(this)},t.prototype.att=function(e,t){return this.attribute(e,t)},t.prototype.a=function(e,t){return this.attribute(e,t)},t}(i)}).call(void 0)},{"./Utility":214,"./XMLAttribute":215,"./XMLNode":227,"babel-runtime/core-js/object/create":19}],227:[function(e,t,n){"use strict";(function(){var n,r,i,o,a,s,l,c,u,h,d,f,p={}.hasOwnProperty;f=e("./Utility"),d=f.isObject,h=f.isFunction,u=f.isEmpty,a=null,n=null,r=null,i=null,o=null,l=null,c=null,s=null,t.exports=function(){function t(t){this.parent=t,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],a||(a=e("./XMLElement"),n=e("./XMLCData"),r=e("./XMLComment"),i=e("./XMLDeclaration"),o=e("./XMLDocType"),l=e("./XMLRaw"),c=e("./XMLText"),s=e("./XMLProcessingInstruction"))}return t.prototype.element=function(e,t,n){var r,i,o,a,s,l,c,f,m,g;if(l=null,null==t&&(t={}),t=t.valueOf(),d(t)||(n=(m=[t,n])[0],t=m[1]),null!=e&&(e=e.valueOf()),Array.isArray(e))for(o=0,c=e.length;o<c;o++)i=e[o],l=this.element(i);else if(h(e))l=this.element(e.apply());else if(d(e)){for(s in e)if(p.call(e,s))if(g=e[s],h(g)&&(g=g.apply()),d(g)&&u(g)&&(g=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&0===s.indexOf(this.stringify.convertAttKey))l=this.attribute(s.substr(this.stringify.convertAttKey.length),g);else if(!this.options.separateArrayItems&&Array.isArray(g))for(a=0,f=g.length;a<f;a++)i=g[a],(r={})[s]=i,l=this.element(r);else d(g)?(l=this.element(s)).element(g):l=this.element(s,g)}else l=!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===e.indexOf(this.stringify.convertTextKey)?this.text(n):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&0===e.indexOf(this.stringify.convertCDataKey)?this.cdata(n):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&0===e.indexOf(this.stringify.convertCommentKey)?this.comment(n):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&0===e.indexOf(this.stringify.convertRawKey)?this.raw(n):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&0===e.indexOf(this.stringify.convertPIKey)?this.instruction(e.substr(this.stringify.convertPIKey.length),n):this.node(e,t,n);if(null==l)throw new Error("Could not create any elements with: "+e);return l},t.prototype.insertBefore=function(e,t,n){var r,i,o;if(this.isRoot)throw new Error("Cannot insert elements at root level");return i=this.parent.children.indexOf(this),o=this.parent.children.splice(i),r=this.parent.element(e,t,n),Array.prototype.push.apply(this.parent.children,o),r},t.prototype.insertAfter=function(e,t,n){var r,i,o;if(this.isRoot)throw new Error("Cannot insert elements at root level");return i=this.parent.children.indexOf(this),o=this.parent.children.splice(i+1),r=this.parent.element(e,t,n),Array.prototype.push.apply(this.parent.children,o),r},t.prototype.remove=function(){var e;if(this.isRoot)throw new Error("Cannot remove the root element");return e=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[e,e-e+1].concat([])),this.parent},t.prototype.node=function(e,t,n){var r,i;return null!=e&&(e=e.valueOf()),t||(t={}),t=t.valueOf(),d(t)||(n=(i=[t,n])[0],t=i[1]),r=new a(this,e,t),null!=n&&r.text(n),this.children.push(r),r},t.prototype.text=function(e){var t;return t=new c(this,e),this.children.push(t),this},t.prototype.cdata=function(e){var t;return t=new n(this,e),this.children.push(t),this},t.prototype.comment=function(e){var t;return t=new r(this,e),this.children.push(t),this},t.prototype.commentBefore=function(e){var t,n;return t=this.parent.children.indexOf(this),n=this.parent.children.splice(t),this.parent.comment(e),Array.prototype.push.apply(this.parent.children,n),this},t.prototype.commentAfter=function(e){var t,n;return t=this.parent.children.indexOf(this),n=this.parent.children.splice(t+1),this.parent.comment(e),Array.prototype.push.apply(this.parent.children,n),this},t.prototype.raw=function(e){var t;return t=new l(this,e),this.children.push(t),this},t.prototype.instruction=function(e,t){var n,r,i,o,a;if(null!=e&&(e=e.valueOf()),null!=t&&(t=t.valueOf()),Array.isArray(e))for(o=0,a=e.length;o<a;o++)n=e[o],this.instruction(n);else if(d(e))for(n in e)p.call(e,n)&&(r=e[n],this.instruction(n,r));else h(t)&&(t=t.apply()),i=new s(this,e,t),this.children.push(i);return this},t.prototype.instructionBefore=function(e,t){var n,r;return n=this.parent.children.indexOf(this),r=this.parent.children.splice(n),this.parent.instruction(e,t),Array.prototype.push.apply(this.parent.children,r),this},t.prototype.instructionAfter=function(e,t){var n,r;return n=this.parent.children.indexOf(this),r=this.parent.children.splice(n+1),this.parent.instruction(e,t),Array.prototype.push.apply(this.parent.children,r),this},t.prototype.declaration=function(e,t,n){var r,o;return r=this.document(),o=new i(r,e,t,n),r.children[0]instanceof i?r.children[0]=o:r.children.unshift(o),r.root()||r},t.prototype.doctype=function(e,t){var n,r,i,a,s,l,c,u,h;for(n=this.document(),r=new o(n,e,t),i=a=0,l=(u=n.children).length;a<l;i=++a)if(u[i]instanceof o)return n.children[i]=r,r;for(i=s=0,c=(h=n.children).length;s<c;i=++s)if(h[i].isRoot)return n.children.splice(i,0,r),r;return n.children.push(r),r},t.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},t.prototype.root=function(){var e;for(e=this;e;){if(e.isDocument)return e.rootObject;if(e.isRoot)return e;e=e.parent}},t.prototype.document=function(){var e;for(e=this;e;){if(e.isDocument)return e;e=e.parent}},t.prototype.end=function(e){return this.document().end(e)},t.prototype.prev=function(){var e;if((e=this.parent.children.indexOf(this))<1)throw new Error("Already at the first node");return this.parent.children[e-1]},t.prototype.next=function(){var e;if(-1===(e=this.parent.children.indexOf(this))||e===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[e+1]},t.prototype.importDocument=function(e){var t;return(t=e.root().clone()).parent=this,t.isRoot=!1,this.children.push(t),this},t.prototype.ele=function(e,t,n){return this.element(e,t,n)},t.prototype.nod=function(e,t,n){return this.node(e,t,n)},t.prototype.txt=function(e){return this.text(e)},t.prototype.dat=function(e){return this.cdata(e)},t.prototype.com=function(e){return this.comment(e)},t.prototype.ins=function(e,t){return this.instruction(e,t)},t.prototype.doc=function(){return this.document()},t.prototype.dec=function(e,t,n){return this.declaration(e,t,n)},t.prototype.dtd=function(e,t){return this.doctype(e,t)},t.prototype.e=function(e,t,n){return this.element(e,t,n)},t.prototype.n=function(e,t,n){return this.node(e,t,n)},t.prototype.t=function(e){return this.text(e)},t.prototype.d=function(e){return this.cdata(e)},t.prototype.c=function(e){return this.comment(e)},t.prototype.r=function(e){return this.raw(e)},t.prototype.i=function(e,t){return this.instruction(e,t)},t.prototype.u=function(){return this.up()},t.prototype.importXMLBuilder=function(e){return this.importDocument(e)},t}()}).call(void 0)},{"./Utility":214,"./XMLCData":216,"./XMLComment":217,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233}],228:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/create"));(function(){var n,i={}.hasOwnProperty;n=e("./XMLNode"),t.exports=function(e){function t(e,n,r){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing instruction target");this.target=this.stringify.insTarget(n),r&&(this.value=this.stringify.insValue(r))}return function(e,t){function n(){this.constructor=e}for(var r in t)i.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return(0,r.default)(this)},t.prototype.toString=function(e){return this.options.writer.set(e).processingInstruction(this)},t}(n)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],229:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/create"));(function(){var n,i={}.hasOwnProperty;n=e("./XMLNode"),t.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing raw text");this.value=this.stringify.raw(n)}return function(e,t){function n(){this.constructor=e}for(var r in t)i.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return(0,r.default)(this)},t.prototype.toString=function(e){return this.options.writer.set(e).raw(this)},t}(n)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],230:[function(e,t,n){"use strict";(function(){var n,r,i,o,a,s,l,c,u,h,d,f,p,m={}.hasOwnProperty;l=e("./XMLDeclaration"),c=e("./XMLDocType"),n=e("./XMLCData"),r=e("./XMLComment"),u=e("./XMLElement"),d=e("./XMLRaw"),f=e("./XMLText"),h=e("./XMLProcessingInstruction"),i=e("./XMLDTDAttList"),o=e("./XMLDTDElement"),a=e("./XMLDTDEntity"),s=e("./XMLDTDNotation"),p=e("./XMLWriterBase"),t.exports=function(e){function t(e,n){t.__super__.constructor.call(this,n),this.stream=e}return function(e,t){function n(){this.constructor=e}for(var r in t)m.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.document=function(e){var t,n,i,o,a,s,u,d;for(n=0,o=(s=e.children).length;n<o;n++)(t=s[n]).isLastRootNode=!1;for(e.children[e.children.length-1].isLastRootNode=!0,d=[],i=0,a=(u=e.children).length;i<a;i++)switch(t=u[i],!1){case!(t instanceof l):d.push(this.declaration(t));break;case!(t instanceof c):d.push(this.docType(t));break;case!(t instanceof r):d.push(this.comment(t));break;case!(t instanceof h):d.push(this.processingInstruction(t));break;default:d.push(this.element(t))}return d},t.prototype.attribute=function(e){return this.stream.write(" "+e.name+'="'+e.value+'"')},t.prototype.cdata=function(e,t){return this.stream.write(this.space(t)+"<![CDATA["+e.text+"]]>"+this.endline(e))},t.prototype.comment=function(e,t){return this.stream.write(this.space(t)+"\x3c!-- "+e.text+" --\x3e"+this.endline(e))},t.prototype.declaration=function(e,t){return this.stream.write(this.space(t)),this.stream.write('<?xml version="'+e.version+'"'),null!=e.encoding&&this.stream.write(' encoding="'+e.encoding+'"'),null!=e.standalone&&this.stream.write(' standalone="'+e.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(e))},t.prototype.docType=function(e,t){var l,c,u,d;if(t||(t=0),this.stream.write(this.space(t)),this.stream.write("<!DOCTYPE "+e.root().name),e.pubID&&e.sysID?this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'):e.sysID&&this.stream.write(' SYSTEM "'+e.sysID+'"'),e.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(e)),c=0,u=(d=e.children).length;c<u;c++)switch(l=d[c],!1){case!(l instanceof i):this.dtdAttList(l,t+1);break;case!(l instanceof o):this.dtdElement(l,t+1);break;case!(l instanceof a):this.dtdEntity(l,t+1);break;case!(l instanceof s):this.dtdNotation(l,t+1);break;case!(l instanceof n):this.cdata(l,t+1);break;case!(l instanceof r):this.comment(l,t+1);break;case!(l instanceof h):this.processingInstruction(l,t+1);break;default:throw new Error("Unknown DTD node type: "+l.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(e))},t.prototype.element=function(e,t){var i,o,a,s,l,c,p,g;for(l in t||(t=0),g=this.space(t),this.stream.write(g+"<"+e.name),c=e.attributes)m.call(c,l)&&(i=c[l],this.attribute(i));if(0===e.children.length||e.children.every((function(e){return""===e.value})))this.allowEmpty?this.stream.write("></"+e.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&1===e.children.length&&null!=e.children[0].value)this.stream.write(">"),this.stream.write(e.children[0].value),this.stream.write("</"+e.name+">");else{for(this.stream.write(">"+this.newline),a=0,s=(p=e.children).length;a<s;a++)switch(o=p[a],!1){case!(o instanceof n):this.cdata(o,t+1);break;case!(o instanceof r):this.comment(o,t+1);break;case!(o instanceof u):this.element(o,t+1);break;case!(o instanceof d):this.raw(o,t+1);break;case!(o instanceof f):this.text(o,t+1);break;case!(o instanceof h):this.processingInstruction(o,t+1);break;default:throw new Error("Unknown XML node type: "+o.constructor.name)}this.stream.write(g+"</"+e.name+">")}return this.stream.write(this.endline(e))},t.prototype.processingInstruction=function(e,t){return this.stream.write(this.space(t)+"<?"+e.target),e.value&&this.stream.write(" "+e.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(e))},t.prototype.raw=function(e,t){return this.stream.write(this.space(t)+e.value+this.endline(e))},t.prototype.text=function(e,t){return this.stream.write(this.space(t)+e.value+this.endline(e))},t.prototype.dtdAttList=function(e,t){return this.stream.write(this.space(t)+"<!ATTLIST "+e.elementName+" "+e.attributeName+" "+e.attributeType),"#DEFAULT"!==e.defaultValueType&&this.stream.write(" "+e.defaultValueType),e.defaultValue&&this.stream.write(' "'+e.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(e))},t.prototype.dtdElement=function(e,t){return this.stream.write(this.space(t)+"<!ELEMENT "+e.name+" "+e.value),this.stream.write(this.spacebeforeslash+">"+this.endline(e))},t.prototype.dtdEntity=function(e,t){return this.stream.write(this.space(t)+"<!ENTITY"),e.pe&&this.stream.write(" %"),this.stream.write(" "+e.name),e.value?this.stream.write(' "'+e.value+'"'):(e.pubID&&e.sysID?this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'):e.sysID&&this.stream.write(' SYSTEM "'+e.sysID+'"'),e.nData&&this.stream.write(" NDATA "+e.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(e))},t.prototype.dtdNotation=function(e,t){return this.stream.write(this.space(t)+"<!NOTATION "+e.name),e.pubID&&e.sysID?this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'):e.pubID?this.stream.write(' PUBLIC "'+e.pubID+'"'):e.sysID&&this.stream.write(' SYSTEM "'+e.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(e))},t.prototype.endline=function(e){return e.isLastRootNode?"":this.newline},t}(p)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],231:[function(e,t,n){"use strict";(function(){var n,r,i,o,a,s,l,c,u,h,d,f,p,m={}.hasOwnProperty;l=e("./XMLDeclaration"),c=e("./XMLDocType"),n=e("./XMLCData"),r=e("./XMLComment"),u=e("./XMLElement"),d=e("./XMLRaw"),f=e("./XMLText"),h=e("./XMLProcessingInstruction"),i=e("./XMLDTDAttList"),o=e("./XMLDTDElement"),a=e("./XMLDTDEntity"),s=e("./XMLDTDNotation"),p=e("./XMLWriterBase"),t.exports=function(e){function t(e){t.__super__.constructor.call(this,e)}return function(e,t){function n(){this.constructor=e}for(var r in t)m.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.document=function(e){var t,n,i,o,a;for(this.textispresent=!1,o="",n=0,i=(a=e.children).length;n<i;n++)t=a[n],o+=function(){switch(!1){case!(t instanceof l):return this.declaration(t);case!(t instanceof c):return this.docType(t);case!(t instanceof r):return this.comment(t);case!(t instanceof h):return this.processingInstruction(t);default:return this.element(t,0)}}.call(this);return this.pretty&&o.slice(-this.newline.length)===this.newline&&(o=o.slice(0,-this.newline.length)),o},t.prototype.attribute=function(e){return" "+e.name+'="'+e.value+'"'},t.prototype.cdata=function(e,t){return this.space(t)+"<![CDATA["+e.text+"]]>"+this.newline},t.prototype.comment=function(e,t){return this.space(t)+"\x3c!-- "+e.text+" --\x3e"+this.newline},t.prototype.declaration=function(e,t){var n;return n=this.space(t),n+='<?xml version="'+e.version+'"',null!=e.encoding&&(n+=' encoding="'+e.encoding+'"'),null!=e.standalone&&(n+=' standalone="'+e.standalone+'"'),(n+=this.spacebeforeslash+"?>")+this.newline},t.prototype.docType=function(e,t){var l,c,u,d,f;if(t||(t=0),d=this.space(t),d+="<!DOCTYPE "+e.root().name,e.pubID&&e.sysID?d+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(d+=' SYSTEM "'+e.sysID+'"'),e.children.length>0){for(d+=" [",d+=this.newline,c=0,u=(f=e.children).length;c<u;c++)l=f[c],d+=function(){switch(!1){case!(l instanceof i):return this.dtdAttList(l,t+1);case!(l instanceof o):return this.dtdElement(l,t+1);case!(l instanceof a):return this.dtdEntity(l,t+1);case!(l instanceof s):return this.dtdNotation(l,t+1);case!(l instanceof n):return this.cdata(l,t+1);case!(l instanceof r):return this.comment(l,t+1);case!(l instanceof h):return this.processingInstruction(l,t+1);default:throw new Error("Unknown DTD node type: "+l.constructor.name)}}.call(this);d+="]"}return(d+=this.spacebeforeslash+">")+this.newline},t.prototype.element=function(e,t){var i,o,a,s,l,c,p,g,v,y,b,_,E;for(p in t||(t=0),E=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),g="",g+=(_=this.space(t))+"<"+e.name,v=e.attributes)m.call(v,p)&&(i=v[p],g+=this.attribute(i));if(0===e.children.length||e.children.every((function(e){return""===e.value})))this.allowEmpty?g+="></"+e.name+">"+this.newline:g+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&1===e.children.length&&null!=e.children[0].value)g+=">",g+=e.children[0].value,g+="</"+e.name+">"+this.newline;else{if(this.dontprettytextnodes)for(a=0,l=(y=e.children).length;a<l;a++)if(null!=(o=y[a]).value){this.textispresent++,E=!0;break}for(this.textispresent&&(this.newline="",this.pretty=!1,_=this.space(t)),g+=">"+this.newline,s=0,c=(b=e.children).length;s<c;s++)o=b[s],g+=function(){switch(!1){case!(o instanceof n):return this.cdata(o,t+1);case!(o instanceof r):return this.comment(o,t+1);case!(o instanceof u):return this.element(o,t+1);case!(o instanceof d):return this.raw(o,t+1);case!(o instanceof f):return this.text(o,t+1);case!(o instanceof h):return this.processingInstruction(o,t+1);default:throw new Error("Unknown XML node type: "+o.constructor.name)}}.call(this);E&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),g+=_+"</"+e.name+">"+this.newline}return g},t.prototype.processingInstruction=function(e,t){var n;return n=this.space(t)+"<?"+e.target,e.value&&(n+=" "+e.value),n+(this.spacebeforeslash+"?>")+this.newline},t.prototype.raw=function(e,t){return this.space(t)+e.value+this.newline},t.prototype.text=function(e,t){return this.space(t)+e.value+this.newline},t.prototype.dtdAttList=function(e,t){var n;return n=this.space(t)+"<!ATTLIST "+e.elementName+" "+e.attributeName+" "+e.attributeType,"#DEFAULT"!==e.defaultValueType&&(n+=" "+e.defaultValueType),e.defaultValue&&(n+=' "'+e.defaultValue+'"'),n+(this.spacebeforeslash+">")+this.newline},t.prototype.dtdElement=function(e,t){return this.space(t)+"<!ELEMENT "+e.name+" "+e.value+this.spacebeforeslash+">"+this.newline},t.prototype.dtdEntity=function(e,t){var n;return n=this.space(t)+"<!ENTITY",e.pe&&(n+=" %"),n+=" "+e.name,e.value?n+=' "'+e.value+'"':(e.pubID&&e.sysID?n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(n+=' SYSTEM "'+e.sysID+'"'),e.nData&&(n+=" NDATA "+e.nData)),n+(this.spacebeforeslash+">")+this.newline},t.prototype.dtdNotation=function(e,t){var n;return n=this.space(t)+"<!NOTATION "+e.name,e.pubID&&e.sysID?n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.pubID?n+=' PUBLIC "'+e.pubID+'"':e.sysID&&(n+=' SYSTEM "'+e.sysID+'"'),n+(this.spacebeforeslash+">")+this.newline},t.prototype.openNode=function(e,t){var n,r,i,o;if(t||(t=0),e instanceof u){for(r in i=this.space(t)+"<"+e.name,o=e.attributes)m.call(o,r)&&(n=o[r],i+=this.attribute(n));return i+(e.children?">":"/>")+this.newline}return i=this.space(t)+"<!DOCTYPE "+e.rootNodeName,e.pubID&&e.sysID?i+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(i+=' SYSTEM "'+e.sysID+'"'),i+(e.children?" [":">")+this.newline},t.prototype.closeNode=function(e,t){switch(t||(t=0),!1){case!(e instanceof u):return this.space(t)+"</"+e.name+">"+this.newline;case!(e instanceof c):return this.space(t)+"]>"+this.newline}},t}(p)}).call(void 0)},{"./XMLCData":216,"./XMLComment":217,"./XMLDTDAttList":218,"./XMLDTDElement":219,"./XMLDTDEntity":220,"./XMLDTDNotation":221,"./XMLDeclaration":222,"./XMLDocType":223,"./XMLElement":226,"./XMLProcessingInstruction":228,"./XMLRaw":229,"./XMLText":233,"./XMLWriterBase":234}],232:[function(e,t,n){"use strict";(function(){var e={}.hasOwnProperty;t.exports=function(){function t(t){var n,r,i;for(n in this.assertLegalChar=function(e,t){return function(){return e.apply(t,arguments)}}(this.assertLegalChar,this),t||(t={}),this.noDoubleEncoding=t.noDoubleEncoding,r=t.stringify||{})e.call(r,n)&&(i=r[n],this[n]=i)}return t.prototype.eleName=function(e){return e=""+e||"",this.assertLegalChar(e)},t.prototype.eleText=function(e){return e=""+e||"",this.assertLegalChar(this.elEscape(e))},t.prototype.cdata=function(e){return e=(e=""+e||"").replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(e)},t.prototype.comment=function(e){if((e=""+e||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+e);return this.assertLegalChar(e)},t.prototype.raw=function(e){return""+e||""},t.prototype.attName=function(e){return""+e||""},t.prototype.attValue=function(e){return e=""+e||"",this.attEscape(e)},t.prototype.insTarget=function(e){return""+e||""},t.prototype.insValue=function(e){if((e=""+e||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+e);return e},t.prototype.xmlVersion=function(e){if(!(e=""+e||"").match(/1\.[0-9]+/))throw new Error("Invalid version number: "+e);return e},t.prototype.xmlEncoding=function(e){if(!(e=""+e||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+e);return e},t.prototype.xmlStandalone=function(e){return e?"yes":"no"},t.prototype.dtdPubID=function(e){return""+e||""},t.prototype.dtdSysID=function(e){return""+e||""},t.prototype.dtdElementValue=function(e){return""+e||""},t.prototype.dtdAttType=function(e){return""+e||""},t.prototype.dtdAttDefault=function(e){return null!=e?""+e||"":e},t.prototype.dtdEntityValue=function(e){return""+e||""},t.prototype.dtdNData=function(e){return""+e||""},t.prototype.convertAttKey="@",t.prototype.convertPIKey="?",t.prototype.convertTextKey="#text",t.prototype.convertCDataKey="#cdata",t.prototype.convertCommentKey="#comment",t.prototype.convertRawKey="#raw",t.prototype.assertLegalChar=function(e){var t;if(t=e.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+e+" at index "+t.index);return e},t.prototype.elEscape=function(e){var t;return t=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")},t.prototype.attEscape=function(e){var t;return t=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")},t}()}).call(void 0)},{}],233:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/object/create"));(function(){var n,i={}.hasOwnProperty;n=e("./XMLNode"),t.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing element text");this.value=this.stringify.eleText(n)}return function(e,t){function n(){this.constructor=e}for(var r in t)i.call(t,r)&&(e[r]=t[r]);n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return(0,r.default)(this)},t.prototype.toString=function(e){return this.options.writer.set(e).text(this)},t}(n)}).call(void 0)},{"./XMLNode":227,"babel-runtime/core-js/object/create":19}],234:[function(e,t,n){"use strict";(function(){var e={}.hasOwnProperty;t.exports=function(){function t(t){var n,r,i,o,a,s,l,c,u;for(n in t||(t={}),this.pretty=t.pretty||!1,this.allowEmpty=null!=(r=t.allowEmpty)&&r,this.pretty?(this.indent=null!=(i=t.indent)?i:" ",this.newline=null!=(o=t.newline)?o:"\n",this.offset=null!=(a=t.offset)?a:0,this.dontprettytextnodes=null!=(s=t.dontprettytextnodes)?s:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=null!=(l=t.spacebeforeslash)?l:"",!0===this.spacebeforeslash&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,c=t.writer||{})e.call(c,n)&&(u=c[n],this[n]=u)}return t.prototype.set=function(t){var n,r,i;for(n in t||(t={}),"pretty"in t&&(this.pretty=t.pretty),"allowEmpty"in t&&(this.allowEmpty=t.allowEmpty),this.pretty?(this.indent="indent"in t?t.indent:" ",this.newline="newline"in t?t.newline:"\n",this.offset="offset"in t?t.offset:0,this.dontprettytextnodes="dontprettytextnodes"in t?t.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in t?t.spacebeforeslash:"",!0===this.spacebeforeslash&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,r=t.writer||{})e.call(r,n)&&(i=r[n],this[n]=i);return this},t.prototype.space=function(e){var t;return this.pretty?(t=(e||0)+this.offset+1)>0?new Array(t).join(this.indent):"":""},t}()}).call(void 0)},{}],235:[function(e,t,n){"use strict";(function(){var n,r,i,o,a,s,l;l=e("./Utility"),a=l.assign,s=l.isFunction,n=e("./XMLDocument"),r=e("./XMLDocumentCB"),o=e("./XMLStringWriter"),i=e("./XMLStreamWriter"),t.exports.create=function(e,t,r,i){var o,s;if(null==e)throw new Error("Root element needs a name");return i=a({},t,r,i),s=(o=new n(i)).element(e),i.headless||(o.declaration(i),null==i.pubID&&null==i.sysID||o.doctype(i)),s},t.exports.begin=function(e,t,i){var o;return s(e)&&(t=(o=[e,t])[0],i=o[1],e={}),t?new r(e,t,i):new n(e)},t.exports.stringWriter=function(e){return new o(e)},t.exports.streamWriter=function(e,t){return new i(e,t)}}).call(void 0)},{"./Utility":214,"./XMLDocument":224,"./XMLDocumentCB":225,"./XMLStreamWriter":230,"./XMLStringWriter":231}],236:[function(e,t,n){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e};var r=Object.prototype.hasOwnProperty},{}],237:[function(e,t,n){"use strict";function r(e,t){var n=a[e=e||"sha1"],r=[];return n||i("algorithm:",e,"is not yet supported"),{update:function(e){return o.isBuffer(e)||(e=new o(e)),r.push(e),e.length,this},digest:function(e){var i=o.concat(r),a=t?function(e,t,n){o.isBuffer(t)||(t=new o(t)),o.isBuffer(n)||(n=new o(n)),t.length>s?t=e(t):t.length<s&&(t=o.concat([t,l],s));for(var r=new o(s),i=new o(s),a=0;a<s;a++)r[a]=54^t[a],i[a]=92^t[a];var c=e(o.concat([r,n]));return e(o.concat([i,c]))}(n,t,i):n(i);return r=null,e?a.toString(e):a}}}function i(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}var o=e("buffer").Buffer,a={sha1:e("./sha"),sha256:e("./sha256"),md5:e("./md5")},s=64,l=new o(s);l.fill(0),n.createHash=function(e){return r(e)},n.createHmac=function(e,t){return r(e,t)},function(e,t){for(var n in e)t(e[n])}(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],(function(e){n[e]=function(){i("sorry,",e,"is not implemented yet")}}))},{"./md5":239,"./sha":240,"./sha256":241,buffer:38}],238:[function(e,t,n){"use strict";var r=e("buffer").Buffer,i=4,o=new r(i);o.fill(0);var a=8;t.exports={hash:function(e,t,n,s){return r.isBuffer(e)||(e=new r(e)),function(e,t,n){for(var i=new r(t),o=n?i.writeInt32BE:i.writeInt32LE,a=0;a<e.length;a++)o.call(i,e[a],4*a,!0);return i}(t(function(e,t){if(e.length%i!=0){var n=e.length+(i-e.length%i);e=r.concat([e,o],n)}for(var a=[],s=t?e.readInt32BE:e.readInt32LE,l=0;l<e.length;l+=i)a.push(s.call(e,l));return a}(e,s),e.length*a),n,s)}}},{buffer:38}],239:[function(e,t,n){"use strict";function r(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,r=-271733879,i=-1732584194,u=271733878,h=0;h<e.length;h+=16){var d=n,f=r,p=i,m=u;n=o(n,r,i,u,e[h+0],7,-680876936),u=o(u,n,r,i,e[h+1],12,-389564586),i=o(i,u,n,r,e[h+2],17,606105819),r=o(r,i,u,n,e[h+3],22,-1044525330),n=o(n,r,i,u,e[h+4],7,-176418897),u=o(u,n,r,i,e[h+5],12,1200080426),i=o(i,u,n,r,e[h+6],17,-1473231341),r=o(r,i,u,n,e[h+7],22,-45705983),n=o(n,r,i,u,e[h+8],7,1770035416),u=o(u,n,r,i,e[h+9],12,-1958414417),i=o(i,u,n,r,e[h+10],17,-42063),r=o(r,i,u,n,e[h+11],22,-1990404162),n=o(n,r,i,u,e[h+12],7,1804603682),u=o(u,n,r,i,e[h+13],12,-40341101),i=o(i,u,n,r,e[h+14],17,-1502002290),n=a(n,r=o(r,i,u,n,e[h+15],22,1236535329),i,u,e[h+1],5,-165796510),u=a(u,n,r,i,e[h+6],9,-1069501632),i=a(i,u,n,r,e[h+11],14,643717713),r=a(r,i,u,n,e[h+0],20,-373897302),n=a(n,r,i,u,e[h+5],5,-701558691),u=a(u,n,r,i,e[h+10],9,38016083),i=a(i,u,n,r,e[h+15],14,-660478335),r=a(r,i,u,n,e[h+4],20,-405537848),n=a(n,r,i,u,e[h+9],5,568446438),u=a(u,n,r,i,e[h+14],9,-1019803690),i=a(i,u,n,r,e[h+3],14,-187363961),r=a(r,i,u,n,e[h+8],20,1163531501),n=a(n,r,i,u,e[h+13],5,-1444681467),u=a(u,n,r,i,e[h+2],9,-51403784),i=a(i,u,n,r,e[h+7],14,1735328473),n=s(n,r=a(r,i,u,n,e[h+12],20,-1926607734),i,u,e[h+5],4,-378558),u=s(u,n,r,i,e[h+8],11,-2022574463),i=s(i,u,n,r,e[h+11],16,1839030562),r=s(r,i,u,n,e[h+14],23,-35309556),n=s(n,r,i,u,e[h+1],4,-1530992060),u=s(u,n,r,i,e[h+4],11,1272893353),i=s(i,u,n,r,e[h+7],16,-155497632),r=s(r,i,u,n,e[h+10],23,-1094730640),n=s(n,r,i,u,e[h+13],4,681279174),u=s(u,n,r,i,e[h+0],11,-358537222),i=s(i,u,n,r,e[h+3],16,-722521979),r=s(r,i,u,n,e[h+6],23,76029189),n=s(n,r,i,u,e[h+9],4,-640364487),u=s(u,n,r,i,e[h+12],11,-421815835),i=s(i,u,n,r,e[h+15],16,530742520),n=l(n,r=s(r,i,u,n,e[h+2],23,-995338651),i,u,e[h+0],6,-198630844),u=l(u,n,r,i,e[h+7],10,1126891415),i=l(i,u,n,r,e[h+14],15,-1416354905),r=l(r,i,u,n,e[h+5],21,-57434055),n=l(n,r,i,u,e[h+12],6,1700485571),u=l(u,n,r,i,e[h+3],10,-1894986606),i=l(i,u,n,r,e[h+10],15,-1051523),r=l(r,i,u,n,e[h+1],21,-2054922799),n=l(n,r,i,u,e[h+8],6,1873313359),u=l(u,n,r,i,e[h+15],10,-30611744),i=l(i,u,n,r,e[h+6],15,-1560198380),r=l(r,i,u,n,e[h+13],21,1309151649),n=l(n,r,i,u,e[h+4],6,-145523070),u=l(u,n,r,i,e[h+11],10,-1120210379),i=l(i,u,n,r,e[h+2],15,718787259),r=l(r,i,u,n,e[h+9],21,-343485551),n=c(n,d),r=c(r,f),i=c(i,p),u=c(u,m)}return Array(n,r,i,u)}function i(e,t,n,r,i,o){return c(function(e,t){return e<<t|e>>>32-t}(c(c(t,e),c(r,o)),i),n)}function o(e,t,n,r,o,a,s){return i(t&n|~t&r,e,t,o,a,s)}function a(e,t,n,r,o,a,s){return i(t&r|n&~r,e,t,o,a,s)}function s(e,t,n,r,o,a,s){return i(t^n^r,e,t,o,a,s)}function l(e,t,n,r,o,a,s){return i(n^(t|~r),e,t,o,a,s)}function c(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}var u=e("./helpers");t.exports=function(e){return u.hash(e,r,16)}},{"./helpers":238}],240:[function(e,t,n){"use strict";function r(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n=Array(80),r=1732584193,l=-271733879,c=-1732584194,u=271733878,h=-1009589776,d=0;d<e.length;d+=16){for(var f=r,p=l,m=c,g=u,v=h,y=0;y<80;y++){n[y]=y<16?e[d+y]:s(n[y-3]^n[y-8]^n[y-14]^n[y-16],1);var b=a(a(s(r,5),i(y,l,c,u)),a(a(h,n[y]),o(y)));h=u,u=c,c=s(l,30),l=r,r=b}r=a(r,f),l=a(l,p),c=a(c,m),u=a(u,g),h=a(h,v)}return Array(r,l,c,u,h)}function i(e,t,n,r){return e<20?t&n|~t&r:e<40?t^n^r:e<60?t&n|t&r|n&r:t^n^r}function o(e){return e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514}function a(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function s(e,t){return e<<t|e>>>32-t}var l=e("./helpers");t.exports=function(e){return l.hash(e,r,20,!0)}},{"./helpers":238}],241:[function(e,t,n){"use strict";var r=e("./helpers"),i=function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},o=function(e,t){return e>>>t|e<<32-t},a=function(e,t){return e>>>t},s=function(e,t,n){return e&t^~e&n},l=function(e,t,n){return e&t^e&n^t&n},c=function(e){return o(e,2)^o(e,13)^o(e,22)},u=function(e){return o(e,6)^o(e,11)^o(e,25)},h=function(e){return o(e,7)^o(e,18)^a(e,3)},d=function(e){return o(e,17)^o(e,19)^a(e,10)},f=function(e,t){var n,r,o,a,f,p,m,g,v,y,b=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),_=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),E=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var x=0;x<e.length;x+=16){n=_[0],r=_[1],o=_[2],a=_[3],f=_[4],p=_[5],m=_[6],g=_[7];for(var w=0;w<64;w++)E[w]=w<16?e[w+x]:i(i(i(d(E[w-2]),E[w-7]),h(E[w-15])),E[w-16]),v=i(i(i(i(g,u(f)),s(f,p,m)),b[w]),E[w]),y=i(c(n),l(n,r,o)),g=m,m=p,p=f,f=i(a,v),a=o,o=r,r=n,n=i(v,y);_[0]=i(n,_[0]),_[1]=i(r,_[1]),_[2]=i(o,_[2]),_[3]=i(a,_[3]),_[4]=i(f,_[4]),_[5]=i(p,_[5]),_[6]=i(m,_[6]),_[7]=i(g,_[7])}return _};t.exports=function(e){return r.hash(e,f,32,!0)}},{"./helpers":238}],242:[function(e,n,r){(function(t){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var o=i(e("babel-runtime/core-js/object/create")),a=i(e("babel-runtime/helpers/classCallCheck")),s=i(e("babel-runtime/helpers/createClass")),l=i(e("babel-runtime/helpers/typeof"));!function(e){"object"===(void 0===r?"undefined":(0,l.default)(r))&&void 0!==n?n.exports=e():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).mime=e()}((function(){return function t(n,r,i){function o(s,l){if(!r[s]){if(!n[s]){var c="function"==typeof e&&e;if(!l&&c)return c(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};n[s][0].call(h.exports,(function(e){return o(n[s][1][e]||e)}),h,h.exports,t,n,r,i)}return r[s].exports}for(var a="function"==typeof e&&e,s=0;s<i.length;s++)o(i[s]);return o}({1:[function(e,t,n){var r=function(){function e(){(0,a.default)(this,e),this._types=(0,o.default)(null),this._extensions=(0,o.default)(null);for(var t=0;t<arguments.length;t++)this.define(arguments[t])}return(0,s.default)(e,[{key:"define",value:function(e,t){for(var n in e){for(var r=e[n],i=0;i<r.length;i++){var o=r[i];if(!t&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+n+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+n+'".');this._types[o]=n}!t&&this._extensions[n]||(this._extensions[n]=r[0])}}},{key:"getType",value:function(e){var t=(e=String(e)).replace(/^.*[\/\\]/,"").toLowerCase(),n=t.replace(/^.*\./,"").toLowerCase(),r=t.length<e.length;return(n.length<t.length-1||!r)&&this._types[n]||null}},{key:"getExtension",value:function(e){return(e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1)&&this._extensions[e.toLowerCase()]||null}}]),e}();t.exports=r},{}],2:[function(e,t,n){var r=e("./Mime");t.exports=new r(e("./types/standard"),e("./types/other"))},{"./Mime":1,"./types/other":3,"./types/standard":4}],3:[function(e,t,n){t.exports={"application/prs.cww":["cww"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":[],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],4:[function(e,t,n){t.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/xm":["xm"],"font/otf":["otf"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/webp":["webp"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},{}]},{},[2])(2)}))}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"babel-runtime/core-js/object/create":19,"babel-runtime/helpers/classCallCheck":30,"babel-runtime/helpers/createClass":31,"babel-runtime/helpers/typeof":32}],243:[function(e,t,n){"use strict";n.encodeURIComponent=function(e){try{return encodeURIComponent(e)}catch(t){return e}},n.escape=e("escape-html"),n.timestamp=function(e){if(e){var t=e;return"string"==typeof t&&(t=Number(t)),10===String(e).length&&(t*=1e3),new Date(t)}return Math.round(Date.now()/1e3)}},{"escape-html":157}],244:[function(e,t,n){(function(t,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return void 0===e?t:e}function a(e,t){return function(n,r,i){if(n)return t(n);e({data:r,status:i.statusCode,headers:i.headers,res:i})}}var s,l=i(e("babel-runtime/core-js/json/stringify")),c=i(e("babel-runtime/helpers/typeof")),u=e("util"),h=e("url"),d=e("http"),f=e("https"),p=e("debug")("urllib"),m=e("humanize-ms"),g=0,v=Math.pow(2,31)-10,y=/^https?:\/\//i;n.TIMEOUTS=[m("300s"),m("300s")];var b=["json","text"];n.request=function(t,r,i){return 2===arguments.length&&"function"==typeof r&&(i=r,r=null),"function"==typeof i?n.requestWithCallback(t,r,i):(s||(s=e("any-promise")),new s((function(e,i){n.requestWithCallback(t,r,a(e,i))})))},n.requestWithCallback=function(i,a,s){function _(){X&&(clearTimeout(X),X=null)}function E(){Y&&(clearTimeout(Y),Y=null)}function x(e,r,o){if(E(),!s)return console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!",Date(),A,t.pid,B.method,i),void(e&&console.warn("[urllib:warn] [%s] [%s] [worker:%s] %s: %s\nstack: %s",Date(),A,t.pid,e.name,e.message,e.stack));var c=s;s=null;var u={};if(o&&(ee=o.statusCode,u=o.headers),401===ee&&u["www-authenticate"]&&(!a.headers||!a.headers.Authorization)&&a.digestAuth){var h=u["www-authenticate"];if(h.indexOf("Digest ")>=0)return p("Request#%d %s: got digest auth header WWW-Authenticate: %s",A,i,h),a.headers=a.headers||{},a.headers.Authorization=digestAuthHeader(B.method,B.path,h,a.digestAuth),p("Request#%d %s: auth with digest header: %s",A,i,a.headers.Authorization),o.headers["set-cookie"]&&(a.headers.Cookie=o.headers["set-cookie"].join(";")),n.requestWithCallback(i,a,c)}var d=Date.now()-D;ie&&(ie.contentDownload=d),p("[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j",d,Q,ee,B.method,B.host,B.path,Z,ie);var f={status:ee,statusCode:ee,headers:u,size:Q,aborted:te,rt:d,keepAliveSocket:Z,data:r,requestUrls:a.requestUrls,timing:ie,remoteAddress:ne,remotePort:re};if(e){var m="";P&&"function"==typeof P.getCurrentStatus&&(m=", agent status: "+(0,l.default)(P.getCurrentStatus())),e.message+=", "+B.method+" "+i+" "+ee+" (connected: "+J+", keepalive socket: "+Z+m+")\nheaders: "+(0,l.default)(u),e.data=r,e.path=B.path,e.status=ee,e.headers=u,e.res=f}c(e,r,a.streaming?o:f),a.emitter&&(L.url=i,L.socket=se&&se.connection,L.options=B,L.size=K,a.emitter.emit("response",{requestId:A,error:e,ctx:a.ctx,req:L,res:f}))}function w(e){var t=null;if(a.followRedirect&&statuses.redirect[e.statusCode]){a._followRedirectCount=(a._followRedirectCount||0)+1;var r=e.headers.location;if(r){if(!(a._followRedirectCount>a.maxRedirects)){var o=a.formatRedirectUrl?a.formatRedirectUrl(i,r):h.resolve(i,r);p("Request#%d %s: `redirected` from %s to %s",A,B.path,i,o),E(),a.headers&&a.headers.Host&&y.test(r)&&(a.headers.Host=null);var l=s;return s=null,n.requestWithCallback(o,a,l),{redirect:!0,error:null}}(t=new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+i)).name="MaxRedirectError"}else(t=new Error("Got statusCode "+e.statusCode+" but cannot resolve next location from headers")).name="FollowRedirectError"}return{redirect:!1,error:t}}function S(e,t,n){return n(null,t,e.headers["content-encoding"])}function k(e){var t;if(ie&&(ie.waiting=Date.now()-D),p("Request#%d %s `req response` event emit: status %d, headers: %j",A,i,e.statusCode,e.headers),a.streaming)return(t=w(e)).redirect?void e.resume():t.error?(e.resume(),x(t.error,null,e)):x(null,null,e);if(e.on("close",(function(){p("Request#%d %s: `res close` event emit, total size %d",A,i,Q)})),e.on("error",(function(){p("Request#%d %s: `res error` event emit, total size %d",A,i,Q)})),e.on("aborted",(function(){te=!0,p("Request#%d %s: `res aborted` event emit, total size %d",A,i,Q)})),le)return(t=w(e)).redirect?void e.resume():t.error?(e.resume(),le.end(),x(t.error,null,e)):(!1===a.consumeWriteStream?e.on("end",x.bind(null,null,null,e)):isNode010||isNode012?first([[le,"close"],[e,"aborted"]],(function(t,n,r){p("Request#%d %s: writeStream or res %s event emitted",A,i,r),x($||null,null,e)})):le.on("close",(function(){p("Request#%d %s: writeStream close event emitted",A,i),x($||null,null,e)})),e.pipe(le));var n=[];e.on("data",(function(e){p("Request#%d %s: `res data` event emit, size %d",A,i,e.length),Q+=e.length,n.push(e)})),e.on("end",(function(){var t=r.concat(n,Q);if(p("Request#%d %s: `res end` event emit, total size %d, _dumped: %s",A,i,Q,e._dumped),$)return x($,t,e);var o=w(e);if(o.error)return x(o.error,t,e);o.redirect||S(e,t,(function(n,r,o){if(n)return x(n,t,e);if(!o&&b.indexOf(a.dataType)>=0){try{r=decodeBodyByCharset(r,e)}catch(t){return p("decodeBodyByCharset error: %s",t),x(null,r,e)}if("json"===a.dataType)if(0===Q)r=null;else{var s=parseJSON(r,j);s.error?n=s.error:r=s.data}}te&&p("Request#%d %s: Remote socket was terminated before `response.end()` was called",A,i),x(n,r,e)}))}))}function C(){p("Response timer ticking, timeout: %d",ae),Y=setTimeout((function(){Y=null;var e="Response timeout for "+ae+"ms";($=new Error(e)).name="ResponseTimeoutError",$.requestId=A,p("ResponseTimeout: Request#%d %s %s: %s, connected: %s",A,i,$.name,e,J),T()}),ae)}function T(){p("Request#%d %s abort, connected: %s",A,i,J),se.socket||($.noSocket=!0,x($)),se.abort()}if(!i||"string"!=typeof i&&"object"!==(void 0===i?"undefined":(0,c.default)(i))){var O=u.format("expect request url to be a string or a http request options, but got %j",i);throw new Error(O)}2===arguments.length&&"function"==typeof a&&(s=a,a=null),g>=v&&(g=0);var A=++g;(a=a||{}).requestUrls=a.requestUrls||[];var L={requestId:A,url:i,args:a,ctx:a.ctx};a.emitter&&a.emitter.emit("request",L),a.timeout=a.timeout||n.TIMEOUTS,a.maxRedirects=a.maxRedirects||10,a.streaming=a.streaming||a.customResponse;var R,D=Date.now();"string"==typeof i?(y.test(i)||(i="http://"+i),R=h.parse(i)):R=i;var I=(a.type||a.method||R.method||"GET").toUpperCase(),M=R.port||80,N=d,P=o(a.agent,n.agent),j=a.fixJSONCtlChars;"https:"===R.protocol&&(N=f,P=o(a.httpsAgent,n.httpsAgent),R.port||(M=443));var B={host:R.hostname||R.host||"localhost",path:R.path||"/",method:I,port:M,agent:P,headers:a.headers||{},lookup:a.lookup};Array.isArray(a.timeout)?B.requestTimeout=a.timeout[a.timeout.length-1]:void 0!==a.timeout&&(B.requestTimeout=a.timeout);for(var F=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","secureOptions"],U=0;U<F.length;U++){var G=F[U];a.hasOwnProperty(G)&&(B[G]=a[G])}!1!==B.rejectUnauthorized||B.hasOwnProperty("secureOptions")||(B.secureOptions=e("constants").SSL_OP_NO_TLSv1_2);var z=a.auth||R.auth;z&&(B.auth=z);var H=a.content||a.data,V="GET"===I||"HEAD"===I||a.dataAsQueryString;if(!a.content&&H&&"string"!=typeof H&&!r.isBuffer(H))if(V)H=a.nestedQuerystring?qs.stringify(H):querystring.stringify(H);else{var W=B.headers["Content-Type"]||B.headers["content-type"];W||(W="json"===a.contentType?"application/json":"application/x-www-form-urlencoded",B.headers["Content-Type"]=W),H="application/json"===parseContentType(W).type?(0,l.default)(H):a.nestedQuerystring?qs.stringify(H):querystring.stringify(H)}V&&H&&(B.path+=(R.query?"&":"?")+H,H=null);var K=0;if(H){var q=H.length;r.isBuffer(H)||(q=r.byteLength(H)),K=B.headers["Content-Length"]=q}"json"===a.dataType&&(B.headers.Accept="application/json"),"function"==typeof a.beforeRequest&&a.beforeRequest(B);var X=null,Y=null,$=null,J=!1,Z=!1,Q=0,ee=-1,te=!1,ne="",re="",ie=null;a.timing&&(ie={queuing:0,dnslookup:0,connected:0,requestSent:0,waiting:0,contentDownload:0}),B.headers["User-Agent"]||B.headers["user-agent"]||(B.headers["User-Agent"]=navigator.userAgent),a.gzip&&(B.headers["Accept-Encoding"]||B.headers["accept-encoding"]||(B.headers["Accept-Encoding"]="gzip"));var oe,ae,se,le=a.writeStream;p("Request#%d %s %s with headers %j, options.path: %s",A,I,i,B.headers,B.path),a.requestUrls.push(i),Array.isArray(a.timeout)?(oe=m(a.timeout[0]),ae=m(a.timeout[1])):oe=ae=m(a.timeout),p("ConnectTimeout: %d, ResponseTimeout: %d",oe,ae);try{se=N.request(B,k)}catch(e){return x(e)}return"undefined"==typeof window?(p("Connect timer ticking, timeout: %d",oe),X=setTimeout((function(){X=null,-1===ee&&(ee=-2);var e="Connect timeout for "+oe+"ms",t="ConnectionTimeoutError";se.socket||(t="SocketAssignTimeoutError",e+=", working sockets is full"),($=new Error(e)).name=t,$.requestId=A,p("ConnectTimeout: Request#%d %s %s: %s, connected: %s",A,i,$.name,e,J),T()}),oe)):se.on("requestTimeout",(function(){-1===ee&&(ee=-2),($=new Error("Connect timeout for "+oe+"ms")).name="ConnectionTimeoutError",$.requestId=A,T()})),ie&&se.on("finish",(function(){ie.requestSent=Date.now()-D})),se.once("socket",(function(e){ie&&(ie.queuing=Date.now()-D),isNode010&&e.socket&&(e=e.socket);var t=e.readyState;if("opening"===t)return e.once("lookup",(function(e,t,n){p("Request#%d %s lookup: %s, %s, %s",A,i,e,t,n),ie&&(ie.dnslookup=Date.now()-D),t&&(ne=t)})),void e.once("connect",(function(){ie&&(ie.connected=Date.now()-D),_(),C(),p("Request#%d %s new socket connected",A,i),J=!0,ne||(ne=e.remoteAddress),re=e.remotePort}));p("Request#%d %s reuse socket connected, readyState: %s",A,i,t),J=!0,Z=!0,ne||(ne=e.remoteAddress),re=e.remotePort,_(),C()})),se.on("error",(function(e){"Error"!==e.name&&"TypeError"!==e.name||(e.name=J?"ResponseError":"RequestError"),e.message+=' (req "error")',p("Request#%d %s `req error` event emit, %s: %s",A,i,e.name,e.message),x($||e)})),le&&le.once("error",(function(e){e.message+=' (writeStream "error")',$=e,p("Request#%d %s `writeStream error` event emit, %s: %s",A,i,e.name,e.message),T()})),a.stream?(a.stream.pipe(se),a.stream.once("error",(function(e){e.message+=' (stream "error")',$=e,p("Request#%d %s `readStream error` event emit, %s: %s",A,i,e.name,e.message),T()}))):se.end(H),se.requestId=A,se}}).call(this,e("_process"),e("buffer").Buffer)},{_process:173,"any-promise":13,"babel-runtime/core-js/json/stringify":17,"babel-runtime/helpers/typeof":32,buffer:38,constants:42,debug:155,http:196,https:159,"humanize-ms":160,url:203,util:207}]},{},[1])(1)})),function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=12)}([function(e,t,n){e.exports=function(){var e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},i=r.lib={},o=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o<i;o+=4)t[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=0;i<t;i+=4){var o=function(t){t=t;var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}}(4294967296*(n||e.random()));n=987654071*o(),r.push(4294967296*o()|0)}return new a.init(r,t)}}),s=r.enc={},l=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},u=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},h=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,s=i/(4*o),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,c=e.min(4*l,i);if(l){for(var u=0;u<l;u+=o)this._doProcessBlock(r,u);var h=r.splice(0,l);n.sigBytes-=c}return new a.init(h,c)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),d=(i.Hasher=h.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new d.HMAC.init(e,n).finalize(t)}}}),r.algo={});return r}(Math);return e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"detectIEVersion",value:function(){for(var e=4,t=document.createElement("div"),n=t.getElementsByTagName("i");t.innerHTML="\x3c!--[if gt IE "+e+"]><i></i><![endif]--\x3e",n[0];)e++;return e>4&&e}},{key:"extend",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&t[n]&&(e[n]=t[n])}},{key:"isArray",value:function(e){return"[object Array]"===Object.prototype.toString.call(arg)}},{key:"getFileType",value:function(e){return e=e.toLowerCase(),/.mp4|.flv|.m3u8|.avi|.rm|.rmvb|.mpeg|.mpg|.mov|.wmv|.3gp|.asf|.dat|.dv|.f4v|.gif|.m2t|.m4v|.mj2|.mjpeg|.mpe|.mts|.ogg|.qt|.swf|.ts|.vob|.wmv|.webm/.test(e)?"video":/.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(e)?"audio":/.bmp|.jpg|.jpeg|.png/.test(e)?"img":"other"}},{key:"isImage",value:function(e){return e=e.toLowerCase(),!!/.jpg|.jpeg|.png/.test(e)}},{key:"ISODateString",value:function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z"}},{key:"isIntNum",value:function(e){return!!/^\d+$/.test(e)}}]),e}();t.default=i},function(e,t,n){e.exports=function(e){return function(t){function n(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+i+a;return(s<<o|s>>>32-o)+t}function r(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+i+a;return(s<<o|s>>>32-o)+t}function i(e,t,n,r,i,o,a){var s=e+(t^n^r)+i+a;return(s<<o|s>>>32-o)+t}function o(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+i+a;return(s<<o|s>>>32-o)+t}var a=e,s=a.lib,l=s.WordArray,c=s.Hasher,u=a.algo,h=[];!function(){for(var e=0;e<64;e++)h[e]=4294967296*t.abs(t.sin(e+1))|0}();var d=u.MD5=c.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var a=0;a<16;a++){var s=t+a,l=e[s];e[s]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}var c=this._hash.words,u=e[t+0],d=e[t+1],f=e[t+2],p=e[t+3],m=e[t+4],g=e[t+5],v=e[t+6],y=e[t+7],b=e[t+8],_=e[t+9],E=e[t+10],x=e[t+11],w=e[t+12],S=e[t+13],k=e[t+14],C=e[t+15],T=c[0],O=c[1],A=c[2],L=c[3];T=n(T,O,A,L,u,7,h[0]),L=n(L,T,O,A,d,12,h[1]),A=n(A,L,T,O,f,17,h[2]),O=n(O,A,L,T,p,22,h[3]),T=n(T,O,A,L,m,7,h[4]),L=n(L,T,O,A,g,12,h[5]),A=n(A,L,T,O,v,17,h[6]),O=n(O,A,L,T,y,22,h[7]),T=n(T,O,A,L,b,7,h[8]),L=n(L,T,O,A,_,12,h[9]),A=n(A,L,T,O,E,17,h[10]),O=n(O,A,L,T,x,22,h[11]),T=n(T,O,A,L,w,7,h[12]),L=n(L,T,O,A,S,12,h[13]),A=n(A,L,T,O,k,17,h[14]),T=r(T,O=n(O,A,L,T,C,22,h[15]),A,L,d,5,h[16]),L=r(L,T,O,A,v,9,h[17]),A=r(A,L,T,O,x,14,h[18]),O=r(O,A,L,T,u,20,h[19]),T=r(T,O,A,L,g,5,h[20]),L=r(L,T,O,A,E,9,h[21]),A=r(A,L,T,O,C,14,h[22]),O=r(O,A,L,T,m,20,h[23]),T=r(T,O,A,L,_,5,h[24]),L=r(L,T,O,A,k,9,h[25]),A=r(A,L,T,O,p,14,h[26]),O=r(O,A,L,T,b,20,h[27]),T=r(T,O,A,L,S,5,h[28]),L=r(L,T,O,A,f,9,h[29]),A=r(A,L,T,O,y,14,h[30]),T=i(T,O=r(O,A,L,T,w,20,h[31]),A,L,g,4,h[32]),L=i(L,T,O,A,b,11,h[33]),A=i(A,L,T,O,x,16,h[34]),O=i(O,A,L,T,k,23,h[35]),T=i(T,O,A,L,d,4,h[36]),L=i(L,T,O,A,m,11,h[37]),A=i(A,L,T,O,y,16,h[38]),O=i(O,A,L,T,E,23,h[39]),T=i(T,O,A,L,S,4,h[40]),L=i(L,T,O,A,u,11,h[41]),A=i(A,L,T,O,p,16,h[42]),O=i(O,A,L,T,v,23,h[43]),T=i(T,O,A,L,_,4,h[44]),L=i(L,T,O,A,w,11,h[45]),A=i(A,L,T,O,C,16,h[46]),T=o(T,O=i(O,A,L,T,f,23,h[47]),A,L,u,6,h[48]),L=o(L,T,O,A,y,10,h[49]),A=o(A,L,T,O,k,15,h[50]),O=o(O,A,L,T,g,21,h[51]),T=o(T,O,A,L,w,6,h[52]),L=o(L,T,O,A,p,10,h[53]),A=o(A,L,T,O,E,15,h[54]),O=o(O,A,L,T,d,21,h[55]),T=o(T,O,A,L,b,6,h[56]),L=o(L,T,O,A,C,10,h[57]),A=o(A,L,T,O,v,15,h[58]),O=o(O,A,L,T,S,21,h[59]),T=o(T,O,A,L,m,6,h[60]),L=o(L,T,O,A,x,10,h[61]),A=o(A,L,T,O,f,15,h[62]),O=o(O,A,L,T,_,21,h[63]),c[0]=c[0]+T|0,c[1]=c[1]+O|0,c[2]=c[2]+A|0,c[3]=c[3]+L|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}});a.MD5=c._createHelper(d),a.HmacMD5=c._createHmacHelper(d)}(Math),e.MD5}(n(0))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPLOADSTATE={INIT:"init",UPLOADING:"uploading",COMPLETE:"complete",INTERRUPT:"interrupt"},t.UPLOADSTEP={INIT:"init",PART:"part",COMPLETE:"complete"},t.UPLOADDEFAULT={PARALLEL:5,PARTSIZE:1048576}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=r(n(5)),a=r(n(25)),s=r(n(6)),l=r(n(7)),c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=l.default.os.name,r=l.default.os.version||"",i=l.default.browser.name,a=l.default.browser.version||"",c=window.location.href,u="";c&&(u=l.default.getHost(c));var h="pc";l.default.os.ipad?h="pad":(l.default.os.iphone||l.default.os.android)&&(h="phone"),this._ri=o.default.create(),this.initParam={APIVersion:"0.6.0",lv:"1",av:s.default.version,pd:"upload",sm:"upload",md:"uploader",uuid:e.getUuid(),os:n,ov:r,et:i,ev:a,uat:navigator.userAgent,app_n:u,tt:h,dm:"h5",ut:""}}return i(e,[{key:"log",value:function(e,t){t&&t.ri?(this._ri=t.ri,delete t.ri):this._ri=o.default.create(),t&&t.ut&&(this.initParam.ut=t.ut,delete t.ut),this.initParam.t=(new Date).getTime(),this.initParam.ll="20006"==e?"error":"info",this.initParam.ri=this._ri,this.initParam.e=e;var n=[];if(t)for(var r in t)n.push(r+"="+t[r]);var i=n.join("&");this.initParam.args=encodeURIComponent(""==i?"0":i);var a=[];for(var r in this.initParam)a.push(r+"="+this.initParam[r]);var s=a.join("&");AliyunUpload&&AliyunUpload.__logTestCallback__?AliyunUpload.__logTestCallback__(s):new Image(0,0).src="https://videocloud.cn-hangzhou.log.aliyuncs.com/logstores/upload/track?"+s}}],[{key:"getUuid",value:function(){var e=a.default.get("p_h5_upload_u");return e||(e=o.default.create(),a.default.set("p_h5_upload_u",e,730)),e}},{key:"getClientId",value:function(){return a.default.get("p_h5_upload_clientId")}},{key:"setClientId",value:function(e){return e||(e=o.default.create()),a.default.set("p_h5_upload_clientId",e,730),e}}]),e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"create",value:function(e,t){var n,r,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),o=[];if(t=t||i.length,e)for(n=0;n<e;n++)o[n]=i[0|Math.random()*t];else for(o[8]=o[13]=o[18]=o[23]="-",o[14]="4",n=0;n<36;n++)o[n]||(r=0|16*Math.random(),o[n]=i[19==n?3&r|8:r]);return o.join("")}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={version:"1.5.0"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(e){var t=navigator.userAgent.toLowerCase();return e.chrome?"Chrome":e.firefox?"Firefox":e.safari?"Safari":e.webview?"webview":e.ie?/edge/.test(t)?"Edge":"IE":/baiduspider/.test(t)?"Baiduspider":/ucweb/.test(t)||/UCBrowser/.test(t)?"UC":/opera/.test(t)?"Opera":/ucweb/.test(t)?"UC":/360se/.test(t)?"360浏览器":/bidubrowser/.test(t)?"百度浏览器":/metasr/.test(t)?"搜狗浏览器":/lbbrowser/.test(t)?"猎豹浏览器":/micromessenger/.test(t)?"微信内置浏览器":/qqbrowser/.test(t)?"QQ浏览器":/playstation/.test(t)?"PS4浏览器":void 0},o=function(){var e={},t={},n=navigator.userAgent,r=navigator.platform,o=n.match(/Web[kK]it[\/]{0,1}([\d.]+)/),a=n.match(/(Android);?[\s\/]+([\d.]+)?/),s=!!n.match(/\(Macintosh\; Intel /),l=n.match(/(iPad).*OS\s([\d_]+)/),c=n.match(/(iPod)(.*OS\s([\d_]+))?/),u=!l&&n.match(/(iPhone\sOS)\s([\d_]+)/),h=n.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),d=/Win\d{2}|Windows/.test(r),f=n.match(/Windows Phone ([\d.]+)/),p=h&&n.match(/TouchPad/),m=n.match(/Kindle\/([\d.]+)/),g=n.match(/Silk\/([\d._]+)/),v=n.match(/(BlackBerry).*Version\/([\d.]+)/),y=n.match(/(BB10).*Version\/([\d.]+)/),b=n.match(/(RIM\sTablet\sOS)\s([\d.]+)/),_=n.match(/PlayBook/),E=n.match(/Chrome\/([\d.]+)/)||n.match(/CriOS\/([\d.]+)/),x=n.match(/Firefox\/([\d.]+)/),w=n.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/),S=n.match(/MSIE\s([\d.]+)/)||n.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/),k=!E&&n.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/),C=k||n.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);if((t.webkit=!!o)&&(t.version=o[1]),a&&(e.android=!0,e.version=a[2]),u&&!c&&(e.ios=e.iphone=!0,e.version=u[2].replace(/_/g,".")),l&&(e.ios=e.ipad=!0,e.version=l[2].replace(/_/g,".")),c&&(e.ios=e.ipod=!0,e.version=c[3]?c[3].replace(/_/g,"."):null),f&&(e.wp=!0,e.version=f[1]),h&&(e.webos=!0,e.version=h[2]),p&&(e.touchpad=!0),v&&(e.blackberry=!0,e.version=v[2]),y&&(e.bb10=!0,e.version=y[2]),b&&(e.rimtabletos=!0,e.version=b[2]),_&&(t.playbook=!0),m&&(e.kindle=!0,e.version=m[1]),g&&(t.silk=!0,t.version=g[1]),!g&&e.android&&n.match(/Kindle Fire/)&&(t.silk=!0),E&&(t.chrome=!0,t.version=E[1]),x&&(t.firefox=!0,t.version=x[1]),w&&(e.firefoxos=!0,e.version=w[1]),S&&(t.ie=!0,t.version=S[1]),C&&(s||e.ios||d||a)&&(t.safari=!0,e.ios||(t.version=C[1])),k&&(t.webview=!0),s){var T=n.match(/[\d]*_[\d]*_[\d]*/);T&&T.length>0&&T[0]&&(e.version=T[0].replace(/_/g,"."))}return e.tablet=!!(l||_||a&&!n.match(/Mobile/)||x&&n.match(/Tablet/)||S&&!n.match(/Phone/)&&n.match(/Touch/)),e.phone=!(e.tablet||e.ipod||!(a||u||h||v||y||E&&n.match(/Android/)||E&&n.match(/CriOS\/([\d.]+)/)||x&&n.match(/Mobile/)||S&&n.match(/Touch/))),e.pc=!e.tablet&&!e.phone,s?e.name="macOS":d?(e.name="windows",e.version=function(){var e=navigator.userAgent,t="";return(e.indexOf("Windows NT 5.0")>-1||e.indexOf("Windows 2000")>-1)&&(t="2000"),(e.indexOf("Windows NT 5.1")>-1||e.indexOf("Windows XP")>-1)&&(t="XP"),(e.indexOf("Windows NT 5.2")>-1||e.indexOf("Windows 2003")>-1)&&(t="2003"),(e.indexOf("Windows NT 6.0")>-1||e.indexOf("Windows Vista")>-1)&&(t="Vista"),(e.indexOf("Windows NT 6.1")>-1||e.indexOf("Windows 7")>-1)&&(t="7"),(e.indexOf("Windows NT 6.2")>-1||e.indexOf("Windows 8")>-1)&&(t="8"),(e.indexOf("Windows NT 6.3")>-1||e.indexOf("Windows 8.1")>-1)&&(t="8.1"),(e.indexOf("Windows NT 10")>-1||e.indexOf("Windows 10")>-1)&&(t="10"),t}()):e.name=function(e){var t=navigator.userAgent,n="other";if(e.ios)return"iOS";if(e.android)return"android";if(t.indexOf("Baiduspider")>-1)return"Baiduspider";if(t.indexOf("PlayStation")>-1)return"PS4";var r="Win32"==navigator.platform||"Windows"==navigator.platform||t.indexOf("Windows")>-1,i="Mac68K"==navigator.platform||"MacPPC"==navigator.platform||"Macintosh"==navigator.platform||"MacIntel"==navigator.platform;return i&&(n="macOS"),"X11"==navigator.platform&&!r&&!i&&(n="Unix"),String(navigator.platform).indexOf("Linux")>-1&&(n="Linux"),r?"windows":n}(e),t.name=i(t),{os:e,browser:t}}(),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"getHost",value:function(e){var t="";if(void 0===e||null==e||""==e)return"";var n=e.indexOf("//"),r=e;n>-1&&(r=e.substring(n+2));t=r;var i=r.split("/");return i&&i.length>0&&(t=i[0]),(i=t.split(":"))&&i.length>0&&(t=i[0]),t}},{key:"os",get:function(){return o.os}},{key:"browser",get:function(){var e=o.browser;return e.name||(e.name=i()),e}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"get",value:function(e,t,n,r,i){var o;n=n||function(){},"undefined"==typeof XMLHttpRequest&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw new Error("This browser does not support XMLHttpRequest.")}),(o=new XMLHttpRequest).onreadystatechange=function(){4===o.readyState&&(200===o.status?t(o.responseText):n(o.responseText))};try{void 0===r&&(r=!0),o.open("GET",e,r),i&&(o.withCredentials=!0)}catch(e){return void n(e)}try{o.send()}catch(e){n(e)}}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(27),o=n(30),a=(n(10),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"randomUUID",value:function(){for(var e=[],t="0123456789abcdef",n=0;n<36;n++)e[n]=t.substr(Math.floor(16*Math.random()),1);return e[14]="4",e[19]=t.substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}},{key:"aliyunEncodeURI",value:function(e){var t=encodeURIComponent(e);return t.replace(/\+/g,"%20").replace(/\*/g,"%2A").replace(/%7E/g,"~").replace(/!/g,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")}},{key:"makeUTF8sort",value:function(t,n,r){if(!t)throw new Error("PrismPlayer Error: vid should not be null!");var i=[];for(var o in t)i.push(o);var a=i.sort(),s="",l=a.length;for(o=0;o<l;o++){var c=e.aliyunEncodeURI(a[o]),u=e.aliyunEncodeURI(t[a[o]]);""==s?s=c+n+u:s+=r+c+n+u}return s}},{key:"makeChangeSiga",value:function(t,n){if(!t)throw new Error("PrismPlayer Error: vid should not be null!");return o.stringify(i("GET&"+e.aliyunEncodeURI("/")+"&"+e.aliyunEncodeURI(e.makeUTF8sort(t,"=","&")),n+"&"))}}]),e}());t.default=a},function(e,t,n){e.exports=function(e){return e.enc.Utf8}(n(0))},function(e,t,n){e.exports=function(e){return e.enc.Hex}(n(0))},function(e,t,n){e.exports=n(13)},function(t,n,r){"use strict";var i,o={Vod:function(e){return e&&e.__esModule?e:{default:e}}(("function"==typeof Symbol&&Symbol.iterator,r(14))).default};void 0!==(i=function(){return o}.apply(n,[]))&&(t.exports=i),window.AliyunUpload=o,e.exports=AliyunUpload},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(15),a=n(3),s=r(n(16)),l=r(n(18)),c=r(n(24)),u=r(n(4)),h=r(n(1)),d=r(n(5)),f=r(n(26)),p=r(n(31)),m=r(n(32)),g=(n(2),function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.options=t,this.options.partSize=this.options.partSize||a.UPLOADDEFAULT.PARTSIZE,this.options.parallel=this.options.parallel||a.UPLOADDEFAULT.PARALLEL,this.options.region=this.options.region||"cn-shanghai",this.options.cname=this.options.cname||!1,this.options.localCheckpoint=this.options.localCheckpoint||!1,void 0===this.options.enableUploadProgress&&(this.options.enableUploadProgress=!0),this._ossCreditor=new Object,this._state=o.VODSTATE.INIT,this._uploadList=[],this._curIndex=-1,this._ossUpload=null,this._log=new u.default,this._retryCount=0,this._retryTotal=this.options.retryCount||3,this._retryDuration=this.options.retryDuration||2,this._state=o.VODSTATE.INIT,this._uploadWay="vod",this._onbeforeunload=!1,this._invalidUserId=!1,this._initEvent()}return i(e,[{key:"init",value:function(e,t,n,r){return this._retryCount=0,!(n&&!r||!n&&r||e&&!t||!e&&t||(this._ossCreditor.accessKeyId=e,this._ossCreditor.accessKeySecret=t,this._ossCreditor.securityToken=n,this._ossCreditor.expireTime=r,0))}},{key:"addFile",value:function(e,t,n,r,i,a){if(!e)return!1;if(0==e.size)try{this.options.onUploadFailed({file:e},"EmptyFile","文件大小为0不能上传")}catch(e){console.log(e)}for(var s=(this.options,0);s<this._uploadList.length;s++)if(this._uploadList[s].file==e)return!1;var c=new Object;if(c.file=e,c._endpoint=t,c._bucket=n,c._object=r,c.state=o.UPLOADSTATE.INIT,c.isImage=h.default.isImage(e.name),!c.isImage&&this.options.enableUploadProgress){var u=this;m.default.getMd5(e,(function(e){c.fileHash=e;var t=u._getCheckoutpoint(c);u.options.localCheckpoint||t||u._getCheckoutpointFromCloud(c,(function(e){if(e.UploadPoint){var t=JSON.parse(e.UploadPoint);1!=t.loaded&&(c.checkpoint=t.checkpoint,c.loaded=t.loaded,c.videoId=e.VideoId,u._saveCheckoutpoint(c,t.checkpoint))}}),(function(e){try{if((e=JSON.parse(e))&&"InvalidParameter"==e.Code&&e.Message.indexOf("UserId")>0){u._invalidUserId=!0;var t=e.Message+"正确账号ID(userId)请参考https://help.aliyun.com/knowledge_detail/37196.html";console.log(t)}}catch(e){console.log(e)}}))}))}i&&(c.videoInfo=i?JSON.parse(i).Vod:{},c.userData=l.default.encode(i)),c.ri=d.default.create(),this._uploadList.push(c),this._reportLog("20001",c,{ql:this._uploadList.length});try{this.options.addFileSuccess&&this.options.addFileSuccess(c)}catch(e){console.log(e)}return!0}},{key:"deleteFile",value:function(e){return!!this.cancelFile(e)&&(this._uploadList.splice(e,1),!0)}},{key:"cleanList",value:function(){this.stopUpload(),this._uploadList.length=0,this._curIndex=-1}},{key:"cancelFile",value:function(e){if(this.options,e<0||e>=this._uploadList.length)return!1;var t=this._uploadList[e];if(e==this._curIndex&&t.state==o.UPLOADSTATE.UPLOADING){t.state=o.UPLOADSTATE.CANCELED;var n=this._getCheckoutpoint(t);n&&n.checkpoint&&(n=n.checkpoint),n&&this._ossUpload.abort(t),this._removeCheckoutpoint(t),this.nextUpload()}else t.state!=o.UPLOADSTATE.SUCCESS&&(t.state=o.UPLOADSTATE.CANCELED);return this._reportLog("20008",t),!0}},{key:"resumeFile",value:function(e){if(this.options,e<0||e>=this._uploadList.length)return!1;var t=this._uploadList[e];return t.state==o.UPLOADSTATE.CANCELED&&(t.state=o.UPLOADSTATE.INIT,!0)}},{key:"listFiles",value:function(){return this._uploadList}},{key:"getCheckpoint",value:function(e){return this._getCheckoutpoint({file:e})}},{key:"startUpload",value:function(e){if(this._retryCount=0,this.options,this._state!=o.VODSTATE.START&&this._state!=o.VODSTATE.EXPIRE)if(this._initState(),this._curIndex=this._findUploadIndex(),-1!=this._curIndex){var t=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(t),this._state=o.VODSTATE.START}else this._state=o.VODSTATE.END;else console.log("already started or expired")}},{key:"nextUpload",value:function(){var e=this.options;if(this._state==o.VODSTATE.START)if(this._curIndex=this._findUploadIndex(),-1!=this._curIndex){var t=this._uploadList[this._curIndex];this._ossUpload=null,this._upload(t)}else{this._state=o.VODSTATE.END;try{e.onUploadEnd&&e.onUploadEnd(t)}catch(e){console.log(e)}}}},{key:"clear",value:function(e){for(var t=this.options,n=0,r=0;r<this._uploadList.length;r++)t.uploadList[r].state==o.UPLOADSTATE.SUCCESS&&n++,this._uploadList[r].state==e&&(t.uploadList.splice(r,1),r--);t.onClear&&t.onClear(t.uploadList.length,n)}},{key:"stopUpload",value:function(){if((this._state==o.VODSTATE.START||this._state==o.VODSTATE.FAILURE||-1==this._curIndex)&&-1!=this._curIndex){var e=this._uploadList[this._curIndex];this._state=o.VODSTATE.STOP,e.state=o.UPLOADSTATE.STOPED,this._changeState(e,o.UPLOADSTATE.STOPED),this._ossUpload.cancel()}}},{key:"resumeUploadWithAuth",value:function(e){if(!e)return!1;var t=JSON.parse(l.default.decode(e));return!!(t.AccessKeyId&&t.AccessKeySecret&&t.SecurityToken&&t.Expiration)&&this.resumeUploadWithToken(t.AccessKeyId,t.AccessKeySecret,t.SecurityToken,t.Expiration)}},{key:"resumeUploadWithToken",value:function(e,t,n,r){if(this.options,!(e&&t&&n&&r))return!1;if(this._state!=o.VODSTATE.EXPIRE)return!1;if(-1==this._curIndex)return!1;var i="";return this._uploadList.length>this._curIndex&&(i=this._uploadList[this._curIndex]),i&&(this.init(e,t,n,r),this._state=o.VODSTATE.START,this._ossUpload=null,this._uploadCore(i,i.retry),i.retry=!1),!0}},{key:"resumeUploadWithSTSToken",value:function(e,t,n){if(-1==this._curIndex)return!1;if(this._state!=o.VODSTATE.EXPIRE)return!1;if(this._uploadList.length>this._curIndex){var r=this._uploadList[this._curIndex];r.object?this._refreshSTSTokenUpload(r,e,t,n):this.setSTSToken(r,e,t,n)}}},{key:"setSTSTokenDirectlyUpload",value:function(e,t,n,r,i){if(!(t&&n&&r&&i))return console.log("accessKeyId、ccessKeySecret、securityToken and expiration should not be empty."),!1;this._ut="oss";var o=e;this.init(t,n,r,i),o.endpoint=o._endpoint,o.bucket=o._bucket,o.object=o._object,this._ossUpload=null,this._uploadCore(o,e.retry),e.retry=!1}},{key:"setSTSToken",value:function(e,t,n,r){if(!t||!n||!r)return console.log("accessKeyId、ccessKeySecret、securityToken should not be empty."),!1;this._ut="vod",this._uploadWay="sts";var i=e.videoInfo,a={accessKeyId:t,securityToken:r,accessKeySecret:n,fileName:e.file.name,title:i.Title,requestId:e.ri,region:this.options.region};i.ImageType&&(a.imageType=i.ImageType),i.ImageExt&&(a.imageExt=i.ImageExt),i.FileSize&&(a.fileSize=i.FileSize),i.Description&&(a.description=i.Description),i.CateId&&(a.cateId=i.CateId),i.Tags&&(a.tags=i.Tags),i.TemplateGroupId&&(a.templateGroupId=i.TemplateGroupId),i.StorageLocation&&(a.storageLocation=i.StorageLocation),i.CoverURL&&(a.coverUrl=i.CoverURL),i.TransCodeMode&&(a.transCodeMode=i.TransCodeMode),i.UserData&&(a.userData=i.UserData);var s=this,l="getUploadAuth";e.videoId?(a.videoId=e.videoId,l="refreshUploadAuth"):e.isImage&&(l="getImageUploadAuth"),f.default[l](a,(function(t){e.videoId=t.VideoId?t.VideoId:e.videoId,s.setUploadAuthAndAddress(e,t.UploadAuth,t.UploadAddress),s._state=o.VODSTATE.START}),(function(t){s._error(e,{name:t.Code,code:t.Code,message:t.Message,requestId:t.RequestId})}))}},{key:"setUploadAuthAndAddress",value:function(e,t,n,r){if(!e||!t||!n)return!1;var i=JSON.parse(l.default.decode(t));if(!(i.AccessKeyId&&i.AccessKeySecret&&i.SecurityToken&&i.Expiration))return console.error("uploadauth is invalid"),!1;var o={},a=e;if(n){if(!(o=JSON.parse(l.default.decode(n))).Endpoint||!o.Bucket||!o.FileName)return console.error("uploadAddress is invalid"),!1}else o.Endpoint=a.endpoint,o.Bucket=a.bucket,o.FileName=a.object;this._ut="vod",this._uploadWay="vod",this.options.region=i.Region||this.options.region,this.init(i.AccessKeyId,i.AccessKeySecret,i.SecurityToken,i.Expiration),a.endpoint=a._endpoint?a._endpoint:o.Endpoint,a.bucket=a._bucket?a._bucket:o.Bucket,a.object=a._object?a._object:o.FileName,a.region=this.options.region,r&&(a.videoId=r),this._ossUpload=null,this._uploadCore(a,e.retry),e.retry=!1}},{key:"_refreshSTSTokenUpload",value:function(e,t,n,r){if(!t||!n||!r)return console.log("accessKeyId、ccessKeySecret、securityToken should not be empty."),!1;var i={accessKeyId:t,securityToken:r,accessKeySecret:n,videoId:e.object,requestId:e.ri,region:this.options.region},a=this,s="refreshUploadAuth";e.isImage&&(s="getImageUploadAuth"),f.default[s](i,(function(t){a.setUploadAuthAndAddress(e,t.UploadAuth,UploadAddress),a._state=o.VODSTATE.START}),(function(t){a._error(e,{name:t.Code,code:t.Code,message:t.Message,requestId:t.RequestId})}))}},{key:"_upload",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.options;if(e.retry=t,n.onUploadstarted&&!t)try{var r=this._getCheckoutpoint(e);r&&r.state!=o.UPLOADSTATE.UPLOADING&&(e.checkpoint=r,e.videoId=r.videoId),n.onUploadstarted(e)}catch(e){console.log(e)}}},{key:"_uploadCore",value:function(e){if(!this._ossCreditor.accessKeyId||!this._ossCreditor.accessKeySecret||!this._ossCreditor.securityToken)throw new Error("AccessKeyId、AccessKeySecret、securityToken should not be null");if(e.state=o.UPLOADSTATE.UPLOADING,!this._ossUpload){e.endpoint=e.endpoint||"http://oss-cn-hangzhou.aliyuncs.com";var t=this;this._ossUpload=new s.default({bucket:e.bucket,endpoint:e.endpoint,AccessKeyId:this._ossCreditor.accessKeyId,AccessKeySecret:this._ossCreditor.accessKeySecret,SecurityToken:this._ossCreditor.securityToken,timeout:this.options.timeout,cname:this.options.cname},{onerror:function(e,n){t._error.call(t,e,n)},oncomplete:function(e,n){t._complete.call(t,e,n)},onprogress:function(e,n,r){t._progress.call(t,e,n,r)}})}var n=h.default.getFileType(e.file.name),r=this._getCheckoutpoint(e),i="",a="";r&&r.checkpoint&&(a=r.state,i=r.videoId,r=r.checkpoint),r&&i==e.videoId&&a!=o.UPLOADSTATE.UPLOADING&&(r.file=e.file,e.checkpoint=r,r.uploadId);var l=this._adjustPartSize(e);this._reportLog("20002",e,{ft:n,fs:e.file.size,bu:e.bucket,ok:e.object,vid:e.videoId||"",fn:e.file.name,fw:null,fh:null,ps:l});var c={headers:{"x-oss-notification":e.userData?e.userData:""},partSize:l,parallel:this.options.parallel};this._ossUpload.upload(e,c)}},{key:"_findUploadIndex",value:function(){for(var e=-1,t=0;t<this._uploadList.length;t++)if(this._uploadList[t].state==o.UPLOADSTATE.INIT){e=t;break}return e}},{key:"_error",value:function(e,t){if("cancel"==t.name)try{this.options.onUploadCanceled(e,t)}catch(e){console.log(e)}else{if(t.message.indexOf("InvalidAccessKeyIdError")>0||"SignatureDoesNotMatchError"==t.name||"SecurityTokenExpired"==t.code||"InvalidSecurityToken.Expired"==t.code||"InvalidAccessKeyId"==t.code&&this._ossCreditor.securityToken){if(this.options.onUploadTokenExpired){this._state=o.VODSTATE.EXPIRE,e.state=o.UPLOADSTATE.FAIlURE;try{this.options.onUploadTokenExpired(e,t)}catch(e){console.log(e)}}return}if(("RequestTimeoutError"==t.name||"ConnectionTimeout"==t.name||"ConnectionTimeoutError"==t.name)&&this._retryTotal>this._retryCount){var n=this;return setTimeout((function(){n._uploadCore(e,!0)}),1e3*n._retryDuration),void this._retryCount++}"NoSuchUploadError"==t.name&&this._removeCheckoutpoint(e),this._handleError(e,t)}}},{key:"_handleError",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=o.UPLOADSTATE.FAIlURE;if(e.state!=o.UPLOADSTATE.CANCELED&&(e.state=o.UPLOADSTATE.FAIlURE,this._state=o.VODSTATE.FAILURE,this.options.onUploadFailed&&t&&t.code&&t.message))try{this.options.onUploadFailed(e,t.code,t.message)}catch(e){console.log(e)}if(n&&this._changeState(e,r),this._reportLog("20006",e,{code:t.name,message:t.message,requestId:t.requestId,fs:e.file.size,bu:e.bucket,ok:e.object,fn:e.file.name}),this._reportLog("20004",e,{requestId:t.requestId,fs:e.file.size,bu:e.bucket,ok:e.object,fn:e.file.name}),e.ri=d.default.create(),-1!=this._findUploadIndex()){var i=this;this._state=o.VODSTATE.START,setTimeout((function(){i.nextUpload()}),100)}}},{key:"_complete",value:function(e,t){if(e.state=o.UPLOADSTATE.SUCCESS,this.options.onUploadSucceed)try{this.options.onUploadSucceed(e)}catch(e){console.log(e)}var n=0;t&&t.res&&t.res.headers&&(n=t.res.headers["x-oss-request-id"]),this._removeCheckoutpoint(e);var r=this;setTimeout((function(){r.nextUpload()}),100),this._retryCount=0,this._reportLog("20003",e,{requestId:n})}},{key:"_progress",value:function(e,t,n){if(this.options.onUploadProgress)try{e.loaded=t.loaded,this.options.onUploadProgress(e,t.total,t.loaded)}catch(e){console.log(e)}var r=t.checkpoint,i=0;r&&(e.checkpoint=r,this._saveCheckoutpoint(e,r,o.UPLOADSTATE.UPLOADING),i=r.uploadId),this._retryCount=0;var a=this._getPortNumber(r),s=0;if(n&&n.headers&&(s=n.headers["x-oss-request-id"]),0!=t.loaded&&this._reportLog("20007",e,{pn:a,requestId:s}),1!=t.loaded&&this._reportLog("20005",e,{UploadId:i,pn:a+1,pr:e.retry?1:0,fs:e.file.size,bu:e.bucket,ok:e.object,fn:e.file.name}),!this._invalidUserId&&!e.isImage&&"vod"==this._ut&&this.options.enableUploadProgress){var l={file:e.file,checkpoint:t,userId:this.options.userId,videoId:e.videoId,region:this.options.region,fileHash:e.fileHash};try{var c=this;p.default.upload(l,(function(){}),(function(e){if((e=JSON.parse(e))&&"InvalidParameter"==e.Code&&e.Message.indexOf("UserId")>0){c._invalidUserId=!0;var t=e.Message+"正确账号ID(userId)请参考https://help.aliyun.com/knowledge_detail/37196.html";console.log(t)}}))}catch(e){console.log(e)}}}},{key:"_getPortNumber",value:function(e){if(e){var t=e.doneParts;if(t&&t.length>0)return t[t.length-1].number}return 0}},{key:"_removeCheckoutpoint",value:function(e){var t=this._getCheckoutpointKey(e);c.default.remove(t)}},{key:"_getCheckoutpoint",value:function(e){var t=this._getCheckoutpointKey(e),n=c.default.get(t);if(n)try{return JSON.parse(n)}catch(e){}return""}},{key:"_saveCheckoutpoint",value:function(e,t,n){if(t){var r=this._getCheckoutpointKey(e),i=e.file,o={fileName:i.name,lastModified:i.lastModified,size:i.size,object:e.object,videoId:e.videoId,bucket:e.bucket,endpoint:e.endpoint,checkpoint:t,loaded:e.loaded,state:n};c.default.set(r,JSON.stringify(o))}}},{key:"_changeState",value:function(e,t){var n=this._getCheckoutpoint(e);n&&((this._onbeforeunload=!0)&&(t=o.UPLOADSTATE.STOPED),this._saveCheckoutpoint(e,n.checkpoint,t))}},{key:"_getCheckoutpointKey",value:function(e){return"upload_"+e.file.lastModified+"_"+e.file.name+"_"+e.file.size}},{key:"_getCheckoutpointFromCloud",value:function(e,t,n){var r={userId:this.options.userId,uploadInfoList:[{FileName:e.file.name,FileSize:e.file.size,FileCreateTime:e.file.lastModified,FileHash:e.fileHash}],region:this.options.region};p.default.get(r,(function(e){t(e)}),n)}},{key:"_reportLog",value:function(e,t,n){n||(n={}),n.ri=t.ri,this._ut&&(n.ut=this._ut),this._log.log(e,n)}},{key:"_initEvent",value:function(){var e=this;window&&(window.onbeforeunload=function(t){if(e._onbeforeunload=!0,-1!=e._curIndex&&e._uploadList.length>e._curIndex){var n=e._uploadList[e._curIndex];e._changeState(n,o.UPLOADSTATE.STOPED)}})}},{key:"_initState",value:function(){for(var e=0;e<this._uploadList.length;e++){var t=this._uploadList[e];t.state!=o.UPLOADSTATE.FAIlURE&&t.state!=o.UPLOADSTATE.STOPED||(t.state=o.UPLOADSTATE.INIT)}this._state=o.VODSTATE.INIT}},{key:"_adjustPartSize",value:function(e){return e.file.size/this.options.partSize>1e4?e.file.size/9999:this.options.partSize}}]),e}());t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPLOADSTATE={INIT:"Ready",UPLOADING:"Uploading",SUCCESS:"Success",FAIlURE:"Failure",CANCELED:"Canceled",STOPED:"Stoped"},t.VODSTATE={INIT:"Init",START:"Start",STOP:"Stop",FAILURE:"Failure",EXPIRE:"Expire",END:"End"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(3),a=(r(n(17)),n(1)),s=(r(a),function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t){this._config=t,this.create(this._config),this._uploadInfo=null,this._callback={};var r=function(){};this._callback.onerror=n.onerror||r,this._callback.oncomplete=n.oncomplete||r,this._callback.onprogress=n.onprogress||r}}return i(e,[{key:"create",value:function(e){if(e.endpoint=e.endpoint||this._config.endpoint,e.bucket=e.bucket||this._config.bucket,!(e.AccessKeyId&&e.AccessKeySecret&&e.endpoint&&e.SecurityToken))throw new Error("AccessKeyId、AccessKeySecret、endpoint should not be null");var t={accessKeyId:e.AccessKeyId,accessKeySecret:e.AccessKeySecret,stsToken:e.SecurityToken,endpoint:e.endpoint||this._config.endpoint,bucket:e.bucket||this._config.bucket,secure:!0,cname:e.cname};e.timeout&&(t.timeout=e.timeout),this.oss=new OSS.Wrapper(t)}},{key:"abort",value:function(e){if(e.checkpoint){var t=e.checkpoint.uploadId;this.oss.abortMultipartUpload(e.object,t)}}},{key:"getVersion",value:function(){}},{key:"cancel",value:function(){this.oss.cancel&&this.oss.cancel()}},{key:"upload",value:function(e,t){this._uploadInfo=e;var n=this,r={parallel:t.parallel||this._config.parallel||o.UPLOADDEFAULT.PARALLEL,partSize:t.partSize||this._config.partSize||o.UPLOADDEFAULT.PARTSIZE,progress:function(e,t,r){return function(i){n._progress(e,t,r),i()}}};t.headers&&(r.headers=t.headers),e.checkpoint&&(r.checkpoint=e.checkpoint),e.bucket||(this.oss.options.bucket=e.bucket),e.endpoint||(this.oss.options.endpoint=e.endpoint),this.oss.multipartUpload(e.object,e.file,r).then((function(e,t){n._complete(e)})).catch((function(e){n.oss.cancel&&(n.oss&&n.oss.isCancel()?console.log("oss is cancel as error"):n.oss.cancel()),n._error(e)}))}},{key:"header",value:function(e,t,n){this.oss.get(e.object).then((function(e){t(e)})).catch((function(e){n(e)}))}},{key:"_progress",value:function(e,t,n){this._callback.onprogress(this._uploadInfo,{loaded:e,total:this._uploadInfo.file.size,checkpoint:t},n)}},{key:"_error",value:function(e){this._callback.onerror(this._uploadInfo,e)}},{key:"_complete",value:function(e){this._callback.oncomplete(this._uploadInfo,e)}}]),e}());t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"format",value:function(e){if(arguments.length<2)return null;for(var t=arguments[1],n=1;n<arguments.length;n++){var r=new RegExp("\\{"+(n-1)+"\\}","gm");t=t.replace(r,arguments[n+1])}return{code:e,message:t}}},{key:"CODE",get:function(){return{SUCCESS:"Successful",EmptyValue:"InvalidParameter.EmptyValue",STSInvalid:"InvalidParameter.TokenInvalid",ReadFileError:"ReadFileError",FILEDUPLICATION:"FileDuplication",UploadALEADRYSTARTED:"UploadAlearyStarted"}}},{key:"MESSAGE",get:function(){return{SUCCESS:"Successful",EmptyValue:"参数 {0} 不能为空。",STSInvalid:"STS参数非法 accessKeyId、accessKeySecret、secretToken、expireTime都不能为空。",ReadFileError:"读取文件{0}{1}失败.",FILEDUPLICATION:"文件重复添加 {0}",UploadALEADRYSTARTED:"重复开始."}}}]),e}();t.default=i},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),r=function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t)}return n(t,null,[{key:"encode",value:function(t){return new e(t).toString("base64")}},{key:"decode",value:function(t){return new e(t,"base64").toString()}}]),t}();t.default=r}).call(t,n(19).Buffer)},function(e,t,n){"use strict";(function(e){function r(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(r()<t)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=o.prototype:(null===e&&(e=new o(t)),e.length=t),e}function o(e,t,n){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return a(this,e,t,n)}function a(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),o.TYPED_ARRAY_SUPPORT?(e=t).__proto__=o.prototype:e=c(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),a=(e=i(e,r)).write(t,n);return a!==r&&(e=e.slice(0,a)),e}(e,t,n):function(e,t){if(o.isBuffer(t)){var n=0|u(t.length);return 0===(e=i(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/(t.length)?i(e,0):c(e,t);if("Buffer"===t.type&&G(t.data))return c(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(s(t),e=i(e,t<0?0:0|u(t)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function c(e,t){var n=t.length<0?0:0|u(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function u(e){if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return P(e).length;t=(""+t).toLowerCase(),r=!0}}function d(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return w(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function p(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var a,s=1,l=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,l/=2,c/=2,n/=2}if(i){var u=-1;for(a=n;a<l;a++)if(o(e,a)===o(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===c)return u*s}else-1!==u&&(a-=a-u),u=-1}else for(n+c>l&&(n=l-c),a=n;a>=0;a--){for(var h=!0,d=0;d<c;d++)if(o(e,a+d)!==o(t,d)){h=!1;break}if(h)return a}return-1}function g(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function v(e,t,n,r){return B(P(t,e.length-n),e,n,r)}function y(e,t,n,r){return B(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function b(e,t,n,r){return y(e,t,n,r)}function _(e,t,n,r){return B(j(t),e,n,r)}function E(e,t,n,r){return B(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function x(e,t,n){return 0===t&&n===e.length?F.fromByteArray(e):F.fromByteArray(e.slice(t,n))}function w(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,l,c=e[i],u=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(u=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=h}return function(e){var t=e.length;if(t<=z)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=z));return n}(r)}function S(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function k(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function C(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=N(e[o]);return i}function T(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function O(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,i){return i||D(e,0,n,4),U.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,i){return i||D(e,0,n,8),U.write(e,t,n,r,52,8),n+8}function N(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function j(e){return F.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}var F=n(21),U=n(22),G=n(23);t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return function(e,t,n,r){return s(t),t<=0?i(e,t):void 0!==n?"string"==typeof r?i(e,t).fill(n,r):i(e,t).fill(n):i(e,t)}(null,e,t,n)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!G(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=o.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?w(this,0,e):d.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),l=Math.min(a,s),c=this.slice(r,i),u=e.slice(t,n),h=0;h<l;++h)if(c[h]!==u[h]){a=c[h],s=u[h];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},o.prototype.indexOf=function(e,t,n){return p(this,e,t,n,!0)},o.prototype.lastIndexOf=function(e,t,n){return p(this,e,t,n,!1)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return b(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var z=4096;o.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),o.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=o.prototype;else{var i=t-e;n=new o(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},o.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},o.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),U.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),U.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),U.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),U.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var s=o.isBuffer(e)?e:P(new o(e,r).toString()),l=s.length;for(a=0;a<n-t;++a)this[a+t]=s[a%l]}return this};var H=/[^+\/0-9A-Za-z-_]/g}).call(t,n(20))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}function o(e,t,n){for(var r,o=[],a=t;a<n;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(i(r));return o.join("")}t.byteLength=function(e){return 3*e.length/4-r(e)},t.toByteArray=function(e){var t,n,i,o,a,c=e.length;o=r(e),a=new l(3*c/4-o),n=o>0?c-4:c;var u=0;for(t=0;t<n;t+=4)i=s[e.charCodeAt(t)]<<18|s[e.charCodeAt(t+1)]<<12|s[e.charCodeAt(t+2)]<<6|s[e.charCodeAt(t+3)],a[u++]=i>>16&255,a[u++]=i>>8&255,a[u++]=255&i;return 2===o?(i=s[e.charCodeAt(t)]<<2|s[e.charCodeAt(t+1)]>>4,a[u++]=255&i):1===o&&(i=s[e.charCodeAt(t)]<<10|s[e.charCodeAt(t+1)]<<4|s[e.charCodeAt(t+2)]>>2,a[u++]=i>>8&255,a[u++]=255&i),a},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i="",s=[],l=0,c=n-r;l<c;l+=16383)s.push(o(e,l,l+16383>c?c:l+16383));return 1===r?(t=e[n-1],i+=a[t>>2],i+=a[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=a[t>>10],i+=a[t>>4&63],i+=a[t<<2&63],i+="="),s.push(i),s.join("")};for(var a=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,h=c.length;u<h;++u)a[u]=c[u],s[c.charCodeAt(u)]=u;s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,c=l>>1,u=-7,h=n?i-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=c}return(f?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"set",value:function(e,t){try{window.localStorage&&localStorage.setItem(e,t)}catch(n){window[e+"_localStorage"]=t}}},{key:"get",value:function(e){try{if(window.localStorage)return localStorage.getItem(e)}catch(t){return window[e+"_localStorage"]}return""}},{key:"remove",value:function(e){try{window.localStorage&&localStorage.removeItem(e)}catch(t){delete window[e+"_localStorage"]}}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"get",value:function(e){for(var t=e+"",n=document.cookie.split(";"),r=0;r<n.length;r++){var i=n[r].trim();if(0==i.indexOf(t))return unescape(i.substring(t.length+1,i.length))}return""}},{key:"set",value:function(e,t,n){var r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3);var i="expires="+r.toGMTString();document.cookie=e+"="+escape(t)+"; "+i}}]),e}();t.default=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=r(n(8)),a=r(n(9)),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"refreshUploadAuth",value:function(e,t,n){var r=(a.default.randomUUID(),a.default.randomUUID()),i={AccessKeyId:e.accessKeyId,SecurityToken:e.securityToken,Action:"RefreshUploadVideo",VideoId:e.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:r,RequestId:e.requestId},s=a.default.makeUTF8sort(i,"=","&")+"&Signature="+a.default.aliyunEncodeURI(a.default.makeChangeSiga(i,e.accessKeySecret)),l="https://vod."+e.region+".aliyuncs.com/?"+s;o.default.get(l,(function(e){e=JSON.parse(e);t&&t(e)}),(function(e){if(n){var t=JSON.parse(e);n(t)}}))}},{key:"getUploadAuth",value:function(e,t,n){var r=(a.default.randomUUID(),a.default.randomUUID()),i={AccessKeyId:e.accessKeyId,SecurityToken:e.securityToken,Action:"CreateUploadVideo",Title:e.title,FileName:e.fileName,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:r,RequestId:e.requestId};e.fileSize&&(i.FileSize=e.fileSize),e.description&&(i.Description=e.description),e.cateId&&(i.CateId=e.cateId),e.tags&&(i.Tags=e.tags),e.templateGroupId&&(i.TemplateGroupId=e.templateGroupId),e.storageLocation&&(i.StorageLocation=e.storageLocation),e.coverUrl&&(i.CoverURL=e.coverUrl),e.transCodeMode&&(i.TransCodeMode=e.transCodeMode),e.userData&&(i.UserData=JSON.stringify(e.userData));var s=a.default.makeUTF8sort(i,"=","&")+"&Signature="+a.default.aliyunEncodeURI(a.default.makeChangeSiga(i,e.accessKeySecret)),l="https://vod."+e.region+".aliyuncs.com/?"+s;o.default.get(l,(function(e){try{e=JSON.parse(e)}catch(e){if(n)return void n({Code:"GetUploadAuthFailed",Message:"获取uploadauth失败"})}t&&t(e)}),(function(e){if(n){var t={Code:"GetUploadAuthFailed",Message:"获取uploadauth失败"};try{t=JSON.parse(e)}catch(e){}n(t)}}))}},{key:"getImageUploadAuth",value:function(e,t,n){var r=(a.default.randomUUID(),a.default.randomUUID()),i={AccessKeyId:e.accessKeyId,SecurityToken:e.securityToken,Action:"CreateUploadImage",ImageType:e.imageType?e.imageType:"default",Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:r,RequestId:e.requestId};e.title&&(i.Title=e.title),e.imageExt&&(i.ImageExt=e.imageExt),e.tags&&(i.Tags=e.tags),e.storageLocation&&(i.StorageLocation=e.storageLocation);var s=a.default.makeUTF8sort(i,"=","&")+"&Signature="+a.default.aliyunEncodeURI(a.default.makeChangeSiga(i,e.accessKeySecret)),l="https://vod."+e.region+".aliyuncs.com/?"+s;o.default.get(l,(function(e){e=JSON.parse(e),t&&t(e)}),(function(e){if(n){var t=JSON.parse(e);n(t)}}))}}]),e}();t.default=s},function(e,t,n){e.exports=function(e){return e.HmacSHA1}(n(0),n(28),n(29))},function(e,t,n){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,o=t.algo,a=[],s=o.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],l=n[4],c=0;c<80;c++){if(c<16)a[c]=0|e[t+c];else{var u=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=u<<1|u>>>31}var h=(r<<5|r>>>27)+l+a[c];h+=c<20?1518500249+(i&o|~i&s):c<40?1859775393+(i^o^s):c<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,l=s,s=o,o=i<<30|i>>>2,i=r,r=h}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+l|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1}(n(0))},function(e,t,n){e.exports=function(e){!function(){var t=e,n=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),s=o.words,l=a.words,c=0;c<n;c++)s[c]^=1549556828,l[c]^=909522486;o.sigBytes=a.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}()}(n(0))},function(e,t,n){e.exports=function(e){return function(){function t(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2,l=n[e.charCodeAt(a)]>>>6-a%4*2;i[o>>>2]|=(s|l)<<24-o%4*8,o++}return r.create(i,o)}var n=e,r=n.lib.WordArray;n.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)i.push(r.charAt(a>>>6*(3-s)&63));var l=r.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var n=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<r.length;o++)i[r.charCodeAt(o)]=o}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(n=s)}return t(e,n,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(n(0))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=r(n(8)),a=r(n(7)),s=r(n(4)),l=r(n(6)),c=r(n(1)),u=r(n(9)),h=n(2),d=n(11),f=n(10),p=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return i(e,null,[{key:"getAuthInfo",value:function(e,t,n){var r=e+"|f#Ylm&^1TppeRhLg|"+n;return t&&(r=e+"|"+t+"|f#Ylm&^1TppeRhLg|"+n),h(f.parse(r)).toString(d)}},{key:"upload",value:function(t,n,r){var i=c.default.ISODateString(new Date),h=Math.floor((new Date).valueOf()/1e3),d=s.default.getClientId();d=s.default.setClientId(d);var f=e.getAuthInfo(t.userId,d,h),p=u.default.randomUUID(),m={Source:"WebSDK",BusinessType:"UploadVideo",Action:"ReportUploadProgress",TerminalType:"H5",DeviceModel:a.default.browser.name+(a.default.browser.version||""),AppVersion:l.default.version,AuthTimestamp:h,Timestamp:i,AuthInfo:f,FileName:t.file.name,FileSize:t.file.size,FileCreateTime:t.file.lastModified,FileHash:t.fileHash,UploadId:t.checkpoint.checkpoint.uploadId,PartSize:t.checkpoint.checkpoint.partSize,DonePartsCount:t.checkpoint.checkpoint.doneParts.length,UploadPoint:JSON.stringify(t.checkpoint),UploadRatio:t.checkpoint.loaded,UserId:t.userId,VideoId:t.videoId,Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:p};d&&(m.ClientId=d);var g=u.default.makeUTF8sort(m,"=","&")+"&Signature="+u.default.aliyunEncodeURI(u.default.makeChangeSiga(m,t.accessKeySecret)),v="https://vod."+t.region+".aliyuncs.com/?"+g;o.default.get(v,(function(e){n&&n()}),(function(e){e&&(r(e),console.log(e))}))}},{key:"get",value:function(t,n,r){var i=c.default.ISODateString(new Date),h=Math.floor((new Date).valueOf()/1e3),d=s.default.getClientId(),f=e.getAuthInfo(t.userId,d,h),p=u.default.randomUUID(),m={Source:"WebSDK",BusinessType:"UploadVideo",Action:"GetUploadProgress",TerminalType:"H5",DeviceModel:a.default.browser.name+(a.default.browser.version||""),AppVersion:l.default.version,AuthTimestamp:h,Timestamp:i,AuthInfo:f,UserId:t.userId,UploadInfoList:JSON.stringify(t.uploadInfoList),Version:"2017-03-21",Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureVersion:"1.0",SignatureNonce:p};d&&(m.ClientId=d);var g=u.default.makeUTF8sort(m,"=","&")+"&Signature="+u.default.aliyunEncodeURI(u.default.makeChangeSiga(m,t.accessKeySecret)),v="https://vod."+t.region+".aliyuncs.com/?"+g;o.default.get(v,(function(e){var t={},r=d;(e=e?JSON.parse(e):{}).UploadProgress&&e.UploadProgress.UploadProgressList&&e.UploadProgress.UploadProgressList.length>0&&(r=(t=e.UploadProgress.UploadProgressList[0]).ClientId),s.default.setClientId(r),n&&n(t)}),(function(e){e&&(r(e),console.log(e))}))}}]),e}();t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(2),o=n(33),a=(n(11),function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"getMd5",value:function(e,t,n){var r=new FileReader;r.onload=function(e){try{if(e&&e.target){var n=i(o.parse(e.target.result)).toString();t(n)}}catch(e){console.log(e)}},r.onerror=function(e){console.log(e),errorCallback(e)};var a=(File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice).call(e,0,1024);r.readAsBinaryString(a)}}]),e}());t.default=a},function(e,t,n){e.exports=function(e){return e.enc.Latin1}(n(0))}])}).call(this,n(/*! ./../@umijs/deps/compiled/webpack/4/global.js */"IyRk"))},ps8w:
/*!*********************************************!*\
!*** ./src/assets/images/question/show.svg ***!
\*********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/show.6268a056.svg"},"rAM+":
/*!*******************************************************************************************************************!*\
!*** ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js ***!
\*******************************************************************************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function i(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Object(r.a)(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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 a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},rHrb:
/*!***************************************************************!*\
!*** ./node_modules/react-copy-to-clipboard/lib/Component.js ***!
\***************************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=o(n(/*! react */"q1tI")),i=o(n(/*! copy-to-clipboard */"+QRC"));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?f(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=function(e){function t(){var e,n;c(this,t);for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return m(f(n=h(this,(e=d(t)).call.apply(e,[this].concat(a)))),"onClick",(function(e){var t=n.props,o=t.text,a=t.onCopy,s=t.children,l=t.options,c=r.default.Children.only(s),u=(0,i.default)(o,l);a&&a(o,u),c&&c.props&&"function"==typeof c.props.onClick&&c.props.onClick(e)})),n}var n,o,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),n=t,(o=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=l(e,["text","onCopy","options","children"]),i=r.default.Children.only(t);return r.default.cloneElement(i,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(n,!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{onClick:this.onClick}))}}])&&u(n.prototype,o),a&&u(n,a),t}(r.default.PureComponent);t.CopyToClipboard=g,m(g,"defaultProps",{onCopy:void 0,options:void 0})},rUJ1:
/*!********************************************!*\
!*** ./node_modules/marked/src/helpers.js ***!
\********************************************/
/*! no static exports found */
/*! exports used: escape */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){const n=/[&<>"']/,r=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s=e=>a[e];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(l,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const u=/(^|[^\[])\^/g;const h=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const f={},p=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(e,t){f[" "+e]||(p.test(e)?f[" "+e]=e+"/":f[" "+e]=y(e,"/",!0));const n=-1===(e=f[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(g,"$1")+t:e+t}function y(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.substr(0,r-i)}e.exports={escape:function(e,t){if(t){if(n.test(e))return e.replace(r,s)}else if(i.test(e))return e.replace(o,s);return e},unescape:c,edit:function(e,t){e=e.source||e,t=t||"";const n={replace:(t,r)=>(r=(r=r.source||r).replace(u,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(c(n)).replace(h,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!d.test(n)&&(n=v(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:v,noopTest:{exec:function(){}},merge:function(e){let t,n,r=1;for(;r<arguments.length;r++)for(n in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},splitCells:function(e,t){const n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},rtrim:y,findClosingBracket:function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1},checkSanitizeDeprecation:function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}}},rcnY:
/*!*******************************************!*\
!*** ./node_modules/qr.js/lib/RSBlock.js ***!
\*******************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r=n(/*! ./ErrorCorrectLevel */"aRTE");function i(e,t){this.totalCount=e,this.dataCount=t}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(e,t){var n=i.getRsBlockTable(e,t);if(null==n)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var r=n.length/3,o=new Array,a=0;a<r;a++)for(var s=n[3*a+0],l=n[3*a+1],c=n[3*a+2],u=0;u<s;u++)o.push(new i(l,c));return o},i.getRsBlockTable=function(e,t){switch(t){case r.L:return i.RS_BLOCK_TABLE[4*(e-1)+0];case r.M:return i.RS_BLOCK_TABLE[4*(e-1)+1];case r.Q:return i.RS_BLOCK_TABLE[4*(e-1)+2];case r.H:return i.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},e.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(e,t,n){var r=n(/*! ../src/util */"MFOe").Global;function i(){return r.localStorage}function o(e){return i().getItem(e)}e.exports={name:"localStorage",read:o,write:function(e,t){return i().setItem(e,t)},each:function(e){for(var t=i().length-1;t>=0;t--){var n=i().key(t);e(o(n),n)}},remove:function(e){return i().removeItem(e)},clearAll:function(){return i().clear()}}},"s8/Y":
/*!**********************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/img/jx.svg ***!
\**********************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/jx.6713fc81.svg"},"sB/4":
/*!**************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/List/img/b.svg ***!
\**************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/b.7405990c.svg"},sNtx:
/*!*************************************************!*\
!*** ./src/pages/Question/OjProblem/index.less ***!
\*************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},sR1s:
/*!*****************************************************!*\
!*** ./node_modules/rc-table/es/utils/valueUtil.js ***!
\*****************************************************/
/*! exports provided: getPathValue, getColumnsKey, mergeObject, validateValue */
/*! exports used: getColumnsKey, getPathValue, mergeObject, validateValue */function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return l}));var r=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU");function i(e){return null==e?[]:Array.isArray(e)?e:[e]}function o(e,t){if(!t&&"number"!=typeof t)return e;for(var n=i(t),r=e,o=0;o<n.length;o+=1){if(!r)return null;r=r[n[o]]}return r}function a(e){var t=[],n={};return e.forEach((function(e){for(var r=e||{},o=r.key,a=r.dataIndex,s=o||i(a).join("-")||"RC_TABLE_KEY";n[s];)s="".concat(s,"_next");n[s]=!0,t.push(s)})),t}function s(){var e={};function t(e,n){n&&Object.keys(n).forEach((function(i){var o=n[i];o&&"object"===Object(r.a)(o)?(e[i]=e[i]||{},t(e[i],o)):e[i]=o}))}for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return i.forEach((function(n){t(e,n)})),e}function l(e){return null!=e}},sboe:
/*!*************************************************!*\
!*** ./node_modules/rc-tree/es/contextTypes.js ***!
\*************************************************/
/*! exports provided: TreeContext */
/*! exports used: TreeContext */function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(/*! react */"q1tI"),i=r.createContext(null)},"t/PP":
/*!**********************************************!*\
!*** ./src/assets/images/question/title.svg ***!
\**********************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/title.dd3b799f.svg"},t23M:
/*!*****************************************************!*\
!*** ./node_modules/rc-resize-observer/es/index.js ***!
\*****************************************************/
/*! exports provided: default */
/*! exports used: default */function(e,t,n){"use strict";var r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),i=n(/*! @babel/runtime/helpers/esm/classCallCheck */"1OyB"),o=n(/*! @babel/runtime/helpers/esm/createClass */"vuIU"),a=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(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments)).resizeObserver=null,e.childNode=null,e.currentElement=null,e.state={width:0,height:0,offsetHeight:0,offsetWidth:0},e.onResize=function(t){var n=e.props.onResize,i=t[0].target,o=i.getBoundingClientRect(),a=o.width,s=o.height,l=i.offsetWidth,c=i.offsetHeight,u=Math.floor(a),h=Math.floor(s);if(e.state.width!==u||e.state.height!==h||e.state.offsetWidth!==l||e.state.offsetHeight!==c){var d={width:u,height:h,offsetWidth:l,offsetHeight:c};e.setState(d),n&&Promise.resolve().then((function(){n(Object(r.a)(Object(r.a)({},d),{},{offsetWidth:l,offsetHeight:c}))}))}},e.setChildNode=function(t){e.childNode=t},e}return Object(o.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 e=Object(c.a)(this.childNode||this);e!==this.currentElement&&(this.destroyObserver(),this.currentElement=e),!this.resizeObserver&&e&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(e))}}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var e=this.props.children,t=Object(u.a)(e);if(t.length>1)Object(h.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(0===t.length)return Object(h.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var n=t[0];if(l.isValidElement(n)&&Object(d.c)(n)){var r=n.ref;t[0]=l.cloneElement(n,{ref:Object(d.a)(r,this.setChildNode)})}return 1===t.length?t[0]:t.map((function(e,t){return!l.isValidElement(e)||"key"in e&&null!==e.key?e:l.cloneElement(e,{key:"".concat("rc-observer-key","-").concat(t)})}))}}]),n}(l.Component);p.displayName="ResizeObserver",t.a=p},twBr:
/*!******************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListForm/img/s.svg ***!
\******************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/s.1f286590.svg"},uMZB:
/*!******************************************************!*\
!*** ./src/pages/Problems/OjForm/index.less?modules ***!
\******************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.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(e,t,n){e.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(e,t,n){var r;"undefined"!=typeof window&&(r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
/*!*********************************************!*\
!*** ./node_modules/eventemitter3/index.js ***!
\*********************************************/
/*! no static exports found */function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||e,o),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},c.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},c.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,r,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,o),!0;case 6:return u.fn.call(u.context,t,n,r,o,a),!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(e,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,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,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(e,t,n){return s(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,r){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return l(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||l(this,o);else{for(var s=0,c=[],u=a.length;s<u;s++)(a[s].fn!==t||r&&!a[s].once||n&&a[s].context!==n)&&c.push(a[s]);c.length?this._events[o]=1===c.length?c[0]:c:l(this,o)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&l(this,t)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,e.exports=c},"./node_modules/url-toolkit/src/url-toolkit.js":
/*!*****************************************************!*\
!*** ./node_modules/url-toolkit/src/url-toolkit.js ***!
\*****************************************************/
/*! no static exports found */function(e,t,n){var r,i,o,a,s;r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,i=/^([^\/?#]*)([^]*)$/,o=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=s.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=s.normalizePath(r.path),s.buildURLFromParts(r)}var o=s.parseURL(t);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return n.alwaysNormalize?(o.path=s.normalizePath(o.path),s.buildURLFromParts(o)):t;var a=s.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var l=i.exec(a.path);a.netLoc=l[1],a.path=l[2]}a.netLoc&&!a.path&&(a.path="/");var c={scheme:a.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(c.netLoc=a.netLoc,"/"!==o.path[0]))if(o.path){var u=a.path,h=u.substring(0,u.lastIndexOf("/")+1)+o.path;c.path=s.normalizePath(h)}else c.path=a.path,o.params||(c.params=a.params,o.query||(c.query=a.query));return null===c.path&&(c.path=n.alwaysNormalize?s.normalizePath(o.path):o.path),s.buildURLFromParts(c)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(o,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=s},"./node_modules/webworkify-webpack/index.js":
/*!**************************************************!*\
!*** ./node_modules/webworkify-webpack/index.js ***!
\**************************************************/
/*! no static exports found */function(e,t,n){function r(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n.oe=function(e){throw console.error(e),e};var r=n(n.s=ENTRY_MODULE);return r.default||r}function i(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function o(e,t,r){var o={};o[r]=[];var a=t.toString(),s=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return o;for(var l,c=s[1],u=new RegExp("(\\\\n|\\W)"+i(c)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");l=u.exec(a);)"dll-reference"!==l[3]&&o[r].push(l[3]);for(u=new RegExp("\\("+i(c)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");l=u.exec(a);)e[l[2]]||(o[r].push(l[1]),e[l[2]]=n(l[1]).m),o[l[2]]=o[l[2]]||[],o[l[2]].push(l[4]);for(var h,d=Object.keys(o),f=0;f<d.length;f++)for(var p=0;p<o[d[f]].length;p++)h=o[d[f]][p],isNaN(1*h)||(o[d[f]][p]=1*o[d[f]][p]);return o}function a(e){return Object.keys(e).reduce((function(t,n){return t||e[n].length>0}),!1)}e.exports=function(e,t){t=t||{};var i={main:n.m},s=t.all?{main:Object.keys(i.main)}:function(e,t){for(var n={main:[t]},r={main:[]},i={main:{}};a(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]&&e[c][u]){i[c][u]=!0,r[c]=r[c]||[],r[c].push(u);for(var h=o(e,e[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,e),l="";Object.keys(s).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;s[e][t];)t++;s[e].push(t),i[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+e+" = ("+r.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+s[e].map((function(t){return JSON.stringify(t)+": "+i[e][t].toString()})).join(",")+"});\n"})),l=l+"new (("+r.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+s.main.map((function(e){return JSON.stringify(e)+": "+i.main[e].toString()})).join(",")+"}))(self);";var c=new window.Blob([l],{type:"text/javascript"});if(t.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(e,t,n){"use strict";n.r(t),n.d(t,"hlsDefaultConfig",(function(){return w})),n.d(t,"mergeConfig",(function(){return S})),n.d(t,"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"),o=n(/*! ./controller/audio-track-controller */"./src/controller/audio-track-controller.ts"),a=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"),m=n(/*! ./utils/fetch-loader */"./src/utils/fetch-loader.ts"),g=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(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=E(E({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:g.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:a.SubtitleStreamController,subtitleTrackController:s.default,timelineController:c.TimelineController,audioStreamController:i.default,audioTrackController:o.default,emeController:d.default,cmcdController:f.default});function S(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return b({},e,t)}function k(e){var t=e.loader;t!==m.default&&t!==p.default?(y.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):Object(m.fetchSupported)()&&(e.loader=m.default,e.progressive=!0,e.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(e,t,n){"use strict";n.r(t);var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../utils/ewma-bandwidth-estimator */"./src/utils/ewma-bandwidth-estimator.ts"),o=n(/*! ../events */"./src/events.ts"),a=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(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var h=function(){function e(e){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=e;var t=e.config;this.bwEstimator=new i.default(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}var t,n,h,d=e.prototype;return d.registerListeners=function(){var e=this.hls;e.on(o.Events.FRAG_LOADING,this.onFragLoading,this),e.on(o.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(o.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var e=this.hls;e.off(o.Events.FRAG_LOADING,this.onFragLoading,this),e.off(o.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(o.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(e,t){var n,r=t.frag;r.type===l.PlaylistLevelType.MAIN&&(this.timer||(this.fragCurrent=r,this.partCurrent=null!=(n=t.part)?n:null,this.timer=self.setInterval(this.onCheck,100)))},d.onLevelLoaded=function(e,t){var n=this.hls.config;t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},d._abandonRulesCheck=function(){var e=this.fragCurrent,t=this.partCurrent,n=this.hls,i=n.autoLevelEnabled,s=n.config,l=n.media;if(e&&l){var u=t?t.stats:e.stats,h=t?t.duration:e.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,m=n.minAutoLevel,g=p[e.level],v=u.total||Math.max(u.loaded,Math.round(h*g.maxBitrate/8)),y=Math.max(1,u.bwEstimate?u.bwEstimate/8:1e3*u.loaded/d),b=(v-u.loaded)/y,_=l.currentTime,E=(a.BufferHelper.bufferInfo(l,_,s.maxBufferHole).end-_)/f;if(!(E>=2*h/f||b<=E)){var x,w=Number.POSITIVE_INFINITY;for(x=e.level-1;x>m&&!((w=h*p[x].maxBitrate/(6.4*y))<E);x--);if(!(w>=b)){var S=this.bwEstimator.getEstimate();c.logger.warn("Fragment "+e.sn+(t?" part "+t.index:"")+" of level "+e.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+x+"\n Current BW estimate: "+(Object(r.isFiniteNumber)(S)?(S/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: "+w.toFixed(3)+" s\n Time to underbuffer: "+E.toFixed(3)+" s"),n.nextLoadLevel=x,this.bwEstimator.sample(d,u.loaded),this.clearTimer(),e.loader&&(this.fragCurrent=this.partCurrent=null,e.loader.abort()),n.trigger(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:u})}}}}}},d.onFragLoaded=function(e,t){var n=t.frag,i=t.part;if(n.type===l.PlaylistLevelType.MAIN&&Object(r.isFiniteNumber)(n.sn)){var a=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)+a.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:a,frag:n,part:i,id:n.type};this.onFragBuffered(o.Events.FRAG_BUFFERED,d),n.bitrateTest=!1}}},d.onFragBuffered=function(e,t){var n=t.frag,r=t.part,i=r?r.stats:n.stats;if(!i.aborted&&n.type===l.PlaylistLevelType.MAIN&&"initSegment"!==n.sn){var o=i.parsing.end-i.loading.start;this.bwEstimator.sample(o,i.loaded),i.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}},d.onError=function(e,t){switch(t.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 e=this.fragCurrent,t=this.partCurrent,n=this.hls,r=n.maxAutoLevel,i=n.config,o=n.minAutoLevel,s=n.media,l=t?t.duration:e?e.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=(a.BufferHelper.bufferInfo(s,u,i.maxBufferHole).end-u)/h,p=this.findBestLevel(d,o,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 m=l?Math.min(l,i.maxStarvationDelay):i.maxStarvationDelay,g=i.abrBandWidthFactor,v=i.abrBandWidthUpFactor;if(!f){var y=this.bitrateTestDelay;y&&(m=(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*m)+" ms"),g=v=1)}return p=this.findBestLevel(d,o,r,f+m,g,v),Math.max(p,0)},d.findBestLevel=function(e,t,n,r,i,o){for(var a,s=this.fragCurrent,l=this.partCurrent,u=this.lastLoadedFragLevel,h=this.hls.levels,d=h[u],f=!(null==d||null===(a=d.details)||void 0===a||!a.live),p=null==d?void 0:d.codecSet,m=l?l.duration:s?s.duration:0,g=n;g>=t;g--){var v=h[g];if(v&&(!p||v.codecSet===p)){var y=v.details,b=(l?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||m,_=void 0;_=g<=u?i*e:o*e;var E=h[g].maxBitrate,x=E*b/_;if(c.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+g+"/"+Math.round(_)+"/"+E+"/"+b+"/"+r+"/"+x),_>E&&(!x||f&&!this.bitrateTestDelay||x<r))return g}}return-1},t=e,(n=[{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,t=this.bwEstimator;if(!(-1===e||t&&t.canEstimate()))return e;var n=this.getNextABRAutoLevel();return-1!==e&&(n=Math.min(e,n)),n},set:function(e){this._nextAutoLevel=e}}])&&u(t.prototype,n),h&&u(t,h),e}();t.default=h},"./src/controller/audio-stream-controller.ts":
/*!***************************************************!*\
!*** ./src/controller/audio-stream-controller.ts ***!
\***************************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),o=n(/*! ../events */"./src/events.ts"),a=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"),m=n(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),g=n(/*! ../errors */"./src/errors.ts"),v=n(/*! ../utils/logger */"./src/utils/logger.ts");function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var _=function(e){var t,n;function _(t,n){var r;return(r=e.call(this,t,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=e,(t=_).prototype=Object.create(n.prototype),t.prototype.constructor=t,b(t,n);var E=_.prototype;return E.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},E._registerListeners=function(){var e=this.hls;e.on(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(o.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(o.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(o.Events.ERROR,this.onError,this),e.on(o.Events.BUFFER_RESET,this.onBufferReset,this),e.on(o.Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(o.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var e=this.hls;e.off(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(o.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(o.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(o.Events.ERROR,this.onError,this),e.off(o.Events.BUFFER_RESET,this.onBufferReset,this),e.off(o.Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(o.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onInitPtsFound=function(e,t){var n=t.frag,r=t.id,o=t.initPTS;if("main"===r){var a=n.cc;this.initPTS[n.cc]=o,this.log("InitPTS for cc: "+a+" found from main: "+o),this.videoTrackCC=a,this.state===i.State.WAITING_INIT_PTS&&this.tick()}},E.startLoad=function(e){if(!this.levels)return this.startPosition=e,void(this.state=i.State.STOPPED);var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,t>0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=i.State.IDLE):(this.loadedmetadata=!1,this.state=i.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()},E.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_TRACK:var t,n=this.levels,r=this.trackId,o=null==n||null===(t=n[r])||void 0===t?void 0:t.details;if(o){if(this.waitForCdnTuneIn(o))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,m=u.complete;if(void 0!==this.initPTS[h.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.FRAG_LOADING;var g={frag:h,part:d,payload:f.flush(),networkDetails:null};this._handleFragmentLoadProgress(g),m&&e.prototype._handleFragmentLoadComplete.call(this,g)}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=a.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()},E.clearWaitingFragment=function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.IDLE)},E.onTickEnd=function(){var e=this.media;if(e&&e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length&&(this.loadedmetadata=!0),this.lastCurrentTime=e.currentTime}},E.doTickIdle=function(){var e,t,n=this.hls,r=this.levels,a=this.media,s=this.trackId,l=n.config;if(r&&r[s]&&(a||!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(),m=this.audioSwitch;if(!(f>=p)||m){if(!m&&this._streamEnded(d,h))return n.trigger(o.Events.BUFFER_EOS,{type:"audio"}),void(this.state=i.State.ENDED);var g=h.fragments[0].start,v=d.end;if(m){var y=this.getLoadPosition();v=y,h.PTSKnown&&y<g&&(d.end>g||d.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),a.currentTime=g+.05)}var b=this.getNextFragment(v,h);b?"identity"!==(null===(e=b.decryptdata)||void 0===e?void 0:e.keyFormat)||null!==(t=b.decryptdata)&&void 0!==t&&t.key?this.loadFragment(b,h,v):this.loadKey(b,h):this.bufferFlushed=!0}}}}},E.getMaxBufferLength=function(){var t=e.prototype.getMaxBufferLength.call(this),n=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,c.PlaylistLevelType.MAIN);return null===n?t:Math.max(t,n.len)},E.onMediaDetaching=function(){this.videoBuffer=null,e.prototype.onMediaDetaching.call(this)},E.onAudioTracksUpdated=function(e,t){var n=t.audioTracks;this.resetTransmuxer(),this.levels=n.map((function(e){return new l.Level(e)}))},E.onAudioTrackSwitching=function(e,t){var n=!!t.url;this.trackId=t.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()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},E.onLevelLoaded=function(e,t){this.mainDetails=t.details},E.onAudioTrackLoaded=function(e,t){var n,r=this.levels,o=t.details,a=t.id;if(r){this.log("Track "+a+" loaded ["+o.startSN+","+o.endSN+"],duration:"+o.totalduration);var s=r[a],l=0;if(o.live||null!==(n=s.details)&&void 0!==n&&n.live){var c=this.mainDetails;if(o.fragments[0]||(o.deltaUpdateFailed=!0),o.deltaUpdateFailed||!c)return;!s.details&&o.hasProgramDateTime&&c.hasProgramDateTime?(Object(m.alignMediaPlaylistByPDT)(o,c),l=o.fragments[0].start):l=this.alignPlaylists(o,s.details)}s.details=o,this.levelLastLoaded=a,this.startFragRequested||!this.mainDetails&&o.live||this.setStartPosition(s.details,l),this.state!==i.State.WAITING_TRACK||this.waitForCdnTuneIn(o)||(this.state=i.State.IDLE),this.tick()}else this.warn("Audio tracks were reset while loading level "+a)},E._handleFragmentLoadProgress=function(e){var t,n=e.frag,r=e.part,o=e.payload,a=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 m=a.defaultAudioCodec||u.audioCodec||"mp4a.40.2",g=this.transmuxer;g||(g=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===(t=n.initSegment)||void 0===t?void 0:t.data;if(void 0!==y){var _=r?r.index:-1,E=-1!==_,x=new f.ChunkMetadata(n.level,n.sn,n.stats.chunkCount,o.byteLength,_,E);g.push(o,b,m,"",n,r,p.totalduration,!1,x,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(o)),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")},E._handleFragmentLoadComplete=function(t){this.waitingData?this.waitingData.complete=!0:e.prototype._handleFragmentLoadComplete.call(this,t)},E.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},E.onBufferCreated=function(e,t){var n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},E.onFragBuffered=function(e,t){var n=t.frag,r=t.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(o.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(n,r)))},E.onError=function(t,n){switch(n.details){case g.ErrorDetails.FRAG_LOAD_ERROR:case g.ErrorDetails.FRAG_LOAD_TIMEOUT:case g.ErrorDetails.KEY_LOAD_ERROR:case g.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.AUDIO,n);break;case g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case g.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 g.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===n.parent&&(this.state===i.State.PARSING||this.state===i.State.PARSED)){var r=!0,o=this.getFwdBufferInfo(this.mediaBuffer,c.PlaylistLevelType.AUDIO);o&&o.len>.5&&(r=!this.reduceMaxBufferLength(o.len)),r&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},E.onBufferFlushed=function(e,t){t.type===u.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},E._handleTransmuxComplete=function(e){var t,n="audio",r=this.hls,a=e.remuxResult,s=e.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=a.audio,f=a.text,p=a.id3,m=a.initSegment;if(!this.fragContextChanged(c)){if(this.state=i.State.PARSING,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=m&&m.tracks&&(this._bufferInitSegment(m.tracks,c,s),r.trigger(o.Events.FRAG_PARSING_INIT_SEGMENT,{frag:c,id:n,tracks:m.tracks})),d){var g=d.startPTS,v=d.endPTS,b=d.startDTS,_=d.endDTS;h&&(h.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:g,endPTS:v,startDTS:b,endDTS:_}),c.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,g,v,b,_),this.bufferFragmentData(d,c,h,s)}if(null!=p&&null!==(t=p.samples)&&void 0!==t&&t.length){var E=y({frag:c,id:n},p);r.trigger(o.Events.FRAG_PARSING_METADATA,E)}if(f){var x=y({frag:c,id:n},f);r.trigger(o.Events.FRAG_PARSING_USERDATA,x)}}},E._bufferInitSegment=function(e,t,n){if(this.state===i.State.PARSING){e.video&&delete e.video;var r=e.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(o.Events.BUFFER_CODECS,e);var a=r.initSegment;if(null!=a&&a.byteLength){var s={type:"audio",frag:t,part:null,chunkMeta:n,parent:t.type,data:a};this.hls.trigger(o.Events.BUFFER_APPENDING,s)}this.tick()}}},E.loadFragment=function(t,n,o){var a=this.fragmentTracker.getState(t);this.fragCurrent=t,(this.audioSwitch||a===s.FragmentState.NOT_LOADED||a===s.FragmentState.PARTIAL)&&("initSegment"===t.sn?this._loadInitSegment(t):n.live&&!Object(r.isFiniteNumber)(this.initPTS[t.cc])?(this.log("Waiting for video PTS in continuity counter "+t.cc+" of live stream before loading audio fragment "+t.sn+" of level "+this.trackId),this.state=i.State.WAITING_INIT_PTS):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,n,o)))},E.completeAudioSwitch=function(){var t=this.hls,n=this.media,r=this.trackId;n&&(this.log("Switching audio track : flushing all audio"),e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,t.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:r})},_}(i.default);t.default=_},"./src/controller/audio-track-controller.ts":
/*!**************************************************!*\
!*** ./src/controller/audio-track-controller.ts ***!
\**************************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),a=n(/*! ../types/loader */"./src/types/loader.ts");function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t,"[audio-track-controller]")||this).tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.trackName="",n.selectDefaultTrack=!0,n.registerListeners(),n}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,l(t,n);var c,u,h,d=o.prototype;return d.registerListeners=function(){var e=this.hls;e.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(r.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(r.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(r.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var e=this.hls;e.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(r.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(r.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(r.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,e.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(e,t){this.tracks=t.audioTracks||[]},d.onAudioTrackLoaded=function(e,t){var n=t.id,r=t.details,i=this.tracksInGroup[n];if(i){var o=i.details;i.details=t.details,this.log("audioTrack "+n+" loaded ["+r.startSN+"-"+r.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,t,o))}else this.warn("Invalid audio track id "+n)},d.onLevelLoading=function(e,t){this.switchLevel(t.level)},d.onLevelSwitching=function(e,t){this.switchLevel(t.level)},d.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.audioGroupIds){var n=t.audioGroupIds[t.urlId];if(this.groupId!==n){this.groupId=n;var i=this.tracks.filter((function(e){return!n||e.groupId===n}));this.selectDefaultTrack&&!i.some((function(e){return e.default}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var o={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(r.Events.AUDIO_TRACKS_UPDATED,o),this.selectInitialTrack()}}},d.onError=function(t,n){e.prototype.onError.call(this,t,n),!n.fatal&&n.context&&n.context.type===a.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},d.setAudioTrack=function(e){var t=this.tracksInGroup;if(e<0||e>=t.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var n=t[this.trackId];this.log("Now switching to audio-track index "+e);var i=t[e],o=i.id,a=i.groupId,s=void 0===a?"":a,l=i.name,c=i.type,u=i.url;if(this.trackId=e,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(r.Events.AUDIO_TRACK_SWITCHING,{id:o,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 e=this.tracksInGroup;console.assert(e.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,n=this.findTrackId(t)||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(e){for(var t=this.tracksInGroup,n=0;n<t.length;n++){var r=t[n];if((!this.selectDefaultTrack||r.default)&&(!e||e===r.name))return r.id}return-1},d.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var n=t.id,i=t.groupId,o=t.url;if(e)try{o=e.addDirectives(o)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(r.Events.AUDIO_TRACK_LOADING,{url:o,id:n,groupId:i,deliveryDirectives:e||null})}},c=o,(u=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}}])&&s(c.prototype,u),h&&s(c,h),o}(o.default);t.default=c},"./src/controller/base-playlist-controller.ts":
/*!****************************************************!*\
!*** ./src/controller/base-playlist-controller.ts ***!
\****************************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return l}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../types/level */"./src/types/level.ts"),o=n(/*! ./level-helper */"./src/controller/level-helper.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ../errors */"./src/errors.ts"),l=function(){function e(e,t){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=a.logger.log.bind(a.logger,t+":"),this.warn=a.logger.warn.bind(a.logger,t+":"),this.hls=e}var t=e.prototype;return t.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},t.onError=function(e,t){t.fatal&&t.type===s.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},t.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},t.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},t.stopLoad=function(){this.canLoad=!1,this.clearTimer()},t.switchParams=function(e,t){var n=null==t?void 0:t.renditionReports;if(n)for(var o=0;o<n.length;o++){var a=n[o],s=""+a.URI;if(s===e.substr(-s.length)){var l=parseInt(a["LAST-MSN"]),c=parseInt(a["LAST-PART"]);if(t&&this.hls.config.lowLatencyMode){var u=Math.min(t.age-t.partTarget,t.targetduration);void 0!==c&&u>t.partTarget&&(c+=1)}if(Object(r.isFiniteNumber)(l))return new i.HlsUrlParameters(l,Object(r.isFiniteNumber)(c)?c:void 0,i.HlsSkip.No)}}},t.loadPlaylist=function(e){},t.shouldLoadTrack=function(e){return this.canLoad&&e&&!!e.url&&(!e.details||e.details.live)},t.playlistLoaded=function(e,t,n){var r=this,i=t.details,a=t.stats,s=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(i.advancedDateTime=Date.now()-s,i.live||null!=n&&n.live){if(i.reloaded(n),n&&this.log("live playlist "+e+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),n&&i.fragments.length>0&&Object(o.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,m=d===f;-1!==p?(c=m?f+1:d,u=m?h?0:p:p+1):c=f+1;var g=i.age,v=g+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 "+g.toFixed(2)+"s goal: "+y+" skip sn "+b+" to part "+u)}i.tuneInGoal=y}if(l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,u),h||!m)return void this.loadPlaylist(l)}else l=this.getDeliveryDirectives(i,t.deliveryDirectives,c,u);var _=Object(o.computeReloadInterval)(i,a);void 0!==c&&i.canBlockReload&&(_-=i.partTarget||1),this.log("reload live playlist "+e+" in "+Math.round(_)+" ms"),this.timer=self.setTimeout((function(){return r.loadPlaylist(l)}),_)}else this.clearTimer()},t.getDeliveryDirectives=function(e,t,n,r){var o=Object(i.getSkipValue)(e,n);return null!=t&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,r=t.part,o=i.HlsSkip.No),new i.HlsUrlParameters(n,r,o)},t.retryLoadingOrFail=function(e){var t,n=this,r=this.hls.config,i=this.retryCount<r.levelLoadingMaxRetry;if(i)if(this.retryCount++,e.details.indexOf("LoadTimeOut")>-1&&null!==(t=e.context)&&void 0!==t&&t.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+e.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return n.loadPlaylist()}),o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+e.details+'"')}else this.warn('cannot recover from error "'+e.details+'"'),this.clearTimer(),e.fatal=!0;return i},e}()},"./src/controller/base-stream-controller.ts":
/*!**************************************************!*\
!*** ./src/controller/base-stream-controller.ts ***!
\**************************************************/
/*! exports provided: State, default */function(e,t,n){"use strict";n.r(t),n.d(t,"State",(function(){return E})),n.d(t,"default",(function(){return x}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../task-loop */"./src/task-loop.ts"),o=n(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),a=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"),m=n(/*! ../loader/fragment-loader */"./src/loader/fragment-loader.ts"),g=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(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var E={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},x=function(e){var t,n;function i(t,n,r){var i;return(i=e.call(this)||this).hls=void 0,i.fragPrevious=null,i.fragCurrent=null,i.fragmentTracker=void 0,i.transmuxer=null,i._state=E.STOPPED,i.media=void 0,i.mediaBuffer=void 0,i.config=void 0,i.bitrateTest=!1,i.lastCurrentTime=0,i.nextLoadPosition=0,i.startPosition=0,i.loadedmetadata=!1,i.fragLoadError=0,i.retryDate=0,i.levels=null,i.fragmentLoader=void 0,i.levelLastLoaded=null,i.startFragRequested=!1,i.decrypter=void 0,i.initPTS=[],i.onvseeking=null,i.onvended=null,i.logPrefix="",i.log=void 0,i.warn=void 0,i.logPrefix=r,i.log=s.logger.log.bind(s.logger,r+":"),i.warn=s.logger.warn.bind(s.logger,r+":"),i.hls=t,i.fragmentLoader=new m.default(t.config),i.fragmentTracker=n,i.config=t.config,i.decrypter=new g.default(t,t.config),t.on(l.Events.KEY_LOADED,i.onKeyLoaded,function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i)),i}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,_(t,n);var x,w,S,k=i.prototype;return k.doTick=function(){this.onTickEnd()},k.onTickEnd=function(){},k.startLoad=function(e){},k.stopLoad=function(){this.fragmentLoader.abort();var e=this.fragCurrent;e&&this.fragmentTracker.removeFragment(e),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=E.STOPPED},k._streamEnded=function(e,t){var n=this.fragCurrent,r=this.fragmentTracker;if(!t.live&&n&&n.sn===t.endSN&&!e.nextStart){var i=r.getState(n);return i===o.FragmentState.PARTIAL||i===o.FragmentState.OK}return!1},k.onMediaAttached=function(e,t){var n=this.media=this.mediaBuffer=t.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===E.STOPPED&&this.startLoad(r.startPosition)},k.onMediaDetaching=function(){var e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.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 e=this.config,t=this.fragCurrent,n=this.media,i=this.mediaBuffer,o=this.state,s=n?n.currentTime:0,l=a.BufferHelper.bufferInfo(i||n,s,e.maxBufferHole);if(this.log("media seeking to "+(Object(r.isFiniteNumber)(s)?s.toFixed(3):s)+", state: "+o),o===E.ENDED)this.resetLoadingState();else if(t&&!l.len){var c=e.maxFragLookUpTolerance,u=t.start-c,h=s>t.start+t.duration+c;(s<u||h)&&(h&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.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(e,t){if(this.state===E.KEY_LOADING&&t.frag===this.fragCurrent&&this.levels){this.state=E.IDLE;var n=this.levels[t.frag.level].details;n&&this.loadFragment(t.frag,n,t.frag.start)}},k.onHandlerDestroying=function(){this.stopLoad(),e.prototype.onHandlerDestroying.call(this)},k.onHandlerDestroyed=function(){this.state=E.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,e.prototype.onHandlerDestroyed.call(this)},k.loadKey=function(e,t){this.log("Loading key for "+e.sn+" of ["+t.startSN+"-"+t.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level),this.state=E.KEY_LOADING,this.fragCurrent=e,this.hls.trigger(l.Events.KEY_LOADING,{frag:e})},k.loadFragment=function(e,t,n){this._loadFragForPlayback(e,t,n)},k._loadFragForPlayback=function(e,t,n){var r=this;this._doFragLoad(e,t,n,(function(t){if(r.fragContextChanged(e))return r.warn("Fragment "+e.sn+(t.part?" p: "+t.part.index:"")+" of level "+e.level+" was dropped during download."),void r.fragmentTracker.removeFragment(e);e.stats.chunkCount++,r._handleFragmentLoadProgress(t)})).then((function(t){if(t){r.fragLoadError=0;var n=r.state;if(!r.fragContextChanged(e))return"payload"in t&&(r.log("Loaded fragment "+e.sn+" of level "+e.level),r.hls.trigger(l.Events.FRAG_LOADED,t),r.state===E.BACKTRACKING)?(r.fragmentTracker.backtrack(e,t),void r.resetFragmentLoading(e)):void r._handleFragmentLoadComplete(t);(n===E.FRAG_LOADING||n===E.BACKTRACKING||!r.fragCurrent&&n===E.PARSING)&&(r.fragmentTracker.removeFragment(e),r.state=E.IDLE)}})).catch((function(t){r.warn(t),r.resetFragmentLoading(e)}))},k.flushMainBuffer=function(e,t,n){if(void 0===n&&(n=null),e-t){var r={startOffset:e,endOffset:t,type:n};this.fragLoadError=0,this.hls.trigger(l.Events.BUFFER_FLUSHING,r)}},k._loadInitSegment=function(e){var t=this;this._doFragLoad(e).then((function(n){if(!n||t.fragContextChanged(e)||!t.levels)throw new Error("init load aborted");return n})).then((function(n){var r=t.hls,i=n.payload,o=e.decryptdata;if(i&&i.byteLength>0&&o&&o.key&&o.iv&&"AES-128"===o.method){var a=self.performance.now();return t.decrypter.webCryptoDecrypt(new Uint8Array(i),o.key.buffer,o.iv.buffer).then((function(t){var i=self.performance.now();return r.trigger(l.Events.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:a,tdecrypt:i}}),n.payload=t,n}))}return n})).then((function(n){var r=t.fragCurrent,i=t.hls,o=t.levels;if(!o)throw new Error("init load aborted, missing levels");var a=o[e.level].details;console.assert(a,"Level details are defined when init segment is loaded");var s=e.stats;t.state=E.IDLE,t.fragLoadError=0,e.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:e.type}),t.tick()})).catch((function(n){t.warn(n),t.resetFragmentLoading(e)}))},k.fragContextChanged=function(e){var t=this.fragCurrent;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId},k.fragBufferedComplete=function(e,t){var n=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+e.type+" sn: "+e.sn+(t?" part: "+t.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level+" "+v.default.toString(a.BufferHelper.getBuffered(n))),this.state=E.IDLE,this.tick()},k._handleFragmentLoadComplete=function(e){var t=this.transmuxer;if(t){var n=e.frag,r=e.part,i=e.partsLoaded,o=!i||0===i.length||i.some((function(e){return!e})),a=new u.ChunkMetadata(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!o);t.flush(a)}},k._handleFragmentLoadProgress=function(e){},k._doFragLoad=function(e,t,n,i){var o=this;if(void 0===n&&(n=null),!this.levels)throw new Error("frag load aborted, missing levels");if(n=Math.max(e.start,n||0),this.config.lowLatencyMode&&t){var a=t.partList;if(a&&i){n>e.end&&t.fragmentHint&&(e=t.fragmentHint);var s=this.getNextPart(a,e,n);if(s>-1){var c=a[s];return this.log("Loading part sn: "+e.sn+" p: "+c.index+" cc: "+e.cc+" of playlist ["+t.startSN+"-"+t.endSN+"] parts [0-"+s+"-"+(a.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(n.toFixed(3))),this.nextLoadPosition=c.start+c.duration,this.state=E.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:e,part:a[s],targetBufferTime:n}),this.doFragPartsLoad(e,a,s,i).catch((function(e){return o.handleFragLoadError(e)}))}if(!e.url||this.loadedEndOfParts(a,n))return Promise.resolve(null)}}return this.log("Loading fragment "+e.sn+" cc: "+e.cc+" "+(t?"of ["+t.startSN+"-"+t.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(n.toFixed(3))),Object(r.isFiniteNumber)(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=E.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragmentLoader.load(e,i).catch((function(e){return o.handleFragLoadError(e)}))},k.doFragPartsLoad=function(e,t,n,r){var i=this;return new Promise((function(o,a){var s=[];!function n(c){var u=t[c];i.fragmentLoader.loadPart(e,u,r).then((function(r){s[u.index]=r;var a=r.part;i.hls.trigger(l.Events.FRAG_LOADED,r);var h=t[c+1];if(!h||h.fragment!==e)return o({frag:e,part:a,partsLoaded:s});n(c+1)})).catch(a)}(n)}))},k.handleFragLoadError=function(e){var t=e.data;return t&&t.details===c.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(l.Events.ERROR,t),null},k._handleTransmuxerFlush=function(e){var t=this.getCurrentContext(e);if(t&&this.state===E.PARSING){var n=t.frag,r=t.part,i=t.level,o=self.performance.now();n.stats.parsing.end=o,r&&(r.stats.parsing.end=o),this.updateLevelTiming(n,r,i,e.partial)}else this.fragCurrent||(this.state=E.IDLE)},k.getCurrentContext=function(e){var t=this.levels,n=e.level,r=e.sn,i=e.part;if(!t||!t[n])return this.warn("Levels object was unset while buffering fragment "+r+" of level "+n+". The current chunk will not be buffered."),null;var o=t[n],a=i>-1?Object(p.getPartWith)(o,r,i):null,s=a?a.fragment:Object(p.getFragmentWithSN)(o,r,this.fragCurrent);return s?{frag:s,part:a,level:o}:null},k.bufferFragmentData=function(e,t,n,r){if(e&&this.state===E.PARSING){var i=e.data1,o=e.data2,a=i;if(i&&o&&(a=Object(h.appendUint8Array)(i,o)),a&&a.length){var s={type:e.type,frag:t,part:n,chunkMeta:r,parent:t.type,data:a};this.hls.trigger(l.Events.BUFFER_APPENDING,s),e.dropped&&e.independent&&!n&&this.flushBufferGap(t)}}},k.flushBufferGap=function(e){var t=this.media;if(t)if(a.BufferHelper.isBuffered(t,t.currentTime)){var n=t.currentTime,r=a.BufferHelper.bufferInfo(t,n,0),i=e.duration,o=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),s=Math.max(Math.min(e.start-o,r.end-o),n+o);e.start-s>o&&this.flushMainBuffer(s,e.start)}else this.flushMainBuffer(0,e.start)},k.getFwdBufferInfo=function(e,t){var n=this.config,i=this.getLoadPosition();if(!Object(r.isFiniteNumber)(i))return null;var o=a.BufferHelper.bufferInfo(e,i,n.maxBufferHole);if(0===o.len&&void 0!==o.nextStart){var s=this.fragmentTracker.getBufferedFrag(i,t);if(s&&o.nextStart<s.end)return a.BufferHelper.bufferInfo(e,i,Math.max(o.nextStart,n.maxBufferHole))}return o},k.getMaxBufferLength=function(e){var t,n=this.config;return t=e?Math.max(8*n.maxBufferSize/e,n.maxBufferLength):n.maxBufferLength,Math.min(t,n.maxMaxBufferLength)},k.reduceMaxBufferLength=function(e){var t=this.config,n=e||t.maxBufferLength;return t.maxMaxBufferLength>=n&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},k.getNextFragment=function(e,t){var n,r,i=t.fragments,o=i.length;if(!o)return null;var a,s=this.config,l=i[0].start;if(t.live){var c=s.initialLiveManifestSize;if(o<c)return this.warn("Not enough fragments to start playback (have: "+o+", need: "+c+")"),null;t.PTSKnown||this.startFragRequested||-1!==this.startPosition||(a=this.getInitialLiveFragment(t,i),this.startPosition=a?this.hls.liveSyncPosition||a.start:e)}else e<=l&&(a=i[0]);if(!a){var u=s.lowLatencyMode?t.partEnd:t.fragmentEnd;a=this.getFragmentAtPosition(e,u,t)}return null===(n=a)||void 0===n||!n.initSegment||null!==(r=a)&&void 0!==r&&r.initSegment.data||this.bitrateTest||(a=a.initSegment),a},k.getNextPart=function(e,t,n){for(var r=-1,i=!1,o=!0,a=0,s=e.length;a<s;a++){var l=e[a];if(o=o&&!l.independent,r>-1&&n<l.start)break;var c=l.loaded;!c&&(i||l.independent||o)&&l.fragment===t&&(r=a),i=c}return r},k.loadedEndOfParts=function(e,t){var n=e[e.length-1];return n&&t>n.start&&n.loaded},k.getInitialLiveFragment=function(e,t){var n=this.fragPrevious,r=null;if(n){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+n.programDateTime),r=Object(f.findFragmentByPDT)(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){var i=n.sn+1;if(i>=e.startSN&&i<=e.endSN){var o=t[i-e.startSN];n.cc===o.cc&&(r=o,this.log("Live playlist, switching playlist, load frag with next SN: "+r.sn))}r||(r=Object(f.findFragWithCC)(t,n.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+r.sn)}}else{var a=this.hls.liveSyncPosition;null!==a&&(r=this.getFragmentAtPosition(a,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r},k.getFragmentAtPosition=function(e,t,n){var r,i=this.config,a=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),e<t){var d=e>t-u?0:u;r=Object(f.findFragmentByPTS)(a,s,e,d)}else r=s[s.length-1];if(r){var p=r.sn-n.startSN,m=a&&r.level===a.level,g=s[p+1];if(this.fragmentTracker.getState(r)===o.FragmentState.BACKTRACKED){r=null;for(var v=p;s[v]&&this.fragmentTracker.getState(s[v])===o.FragmentState.BACKTRACKED;)r=a?s[v--]:s[--v];r||(r=g)}else a&&r.sn===a.sn&&!h&&m&&(r.sn<l&&this.fragmentTracker.getState(g)!==o.FragmentState.OK?(this.log("SN "+r.sn+" just loaded, load next one: "+g.sn),r=g):r=null)}return r},k.synchronizeToLiveEdge=function(e){var t=this.config,n=this.media;if(n){var r=this.hls.liveSyncPosition,i=n.currentTime,o=e.fragments[0].start,a=e.edge,s=i>=o-t.maxFragLookUpTolerance&&i<=a;if(null!==r&&n.duration>r&&(i<r||!s)){var l=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!s&&n.readyState<4||i<a-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: "+a+", reset currentTime to : "+r.toFixed(3)),n.currentTime=r))}}},k.alignPlaylists=function(e,t){var n=this.levels,i=this.levelLastLoaded,o=this.fragPrevious,a=null!==i?n[i]:null,s=e.fragments.length;if(!s)return this.warn("No fragments in live playlist"),0;var l=e.fragments[0].start,c=!t,u=e.alignedSliding&&Object(r.isFiniteNumber)(l);if(c||!u&&!l){Object(d.alignStream)(o,a,e);var h=e.fragments[0].start;return this.log("Live playlist sliding: "+h.toFixed(2)+" start-sn: "+(t?t.startSN:"na")+"->"+e.startSN+" prev-sn: "+(o?o.sn:"na")+" fragments: "+s),h}return l},k.waitForCdnTuneIn=function(e){return e.live&&e.canBlockReload&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)},k.setStartPosition=function(e,t){var n=this.startPosition;if(n<t&&(n=-1),-1===n||-1===this.lastCurrentTime){var i=e.startTimeOffset;Object(r.isFiniteNumber)(i)?(n=t+i,i<0&&(n+=e.totalduration),n=Math.min(Math.max(t,n),t+e.totalduration),this.log("Start time offset "+i+" found in playlist, adjust startPosition to "+n),this.startPosition=n):e.live?n=this.hls.liveSyncPosition||t:this.startPosition=n=0,this.lastCurrentTime=n}this.nextLoadPosition=n},k.getLoadPosition=function(){var e=this.media,t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t},k.handleFragLoadAborted=function(e,t){this.transmuxer&&"initSegment"!==e.sn&&e.stats.aborted&&(this.warn("Fragment "+e.sn+(t?" part"+t.index:"")+" of level "+e.level+" was aborted"),this.resetFragmentLoading(e))},k.resetFragmentLoading=function(e){this.fragCurrent&&this.fragContextChanged(e)||(this.state=E.IDLE)},k.onFragmentOrKeyLoadError=function(e,t){if(!t.fatal){var n=t.frag;if(n&&n.type===e){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 o=Math.min(Math.pow(2,this.fragLoadError)*i.fragLoadingRetryDelay,i.fragLoadingMaxRetryTimeout);this.warn("Fragment "+n.sn+" of "+e+" "+n.level+" failed to load, retrying in "+o+"ms"),this.retryDate=self.performance.now()+o,this.fragLoadError++,this.state=E.FRAG_LOADING_WAITING_RETRY}else t.levelRetry?(e===y.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=E.IDLE):(s.logger.error(t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.hls.stopLoad(),this.state=E.ERROR)}}},k.afterBufferFlushed=function(e,t,n){if(e){var r=a.BufferHelper.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,n),this.state===E.ENDED&&this.resetLoadingState()}},k.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=E.IDLE},k.resetLiveStartWhenNotLoaded=function(e){if(!this.loadedmetadata){this.startFragRequested=!1;var t=this.levels?this.levels[e].details:null;if(null!=t&&t.live)return this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},k.updateLevelTiming=function(e,t,n,r){var i=this,o=n.details;console.assert(!!o,"level.details must be defined"),Object.keys(e.elementaryStreams).reduce((function(t,a){var s=e.elementaryStreams[a];if(s){var c=s.endPTS-s.startPTS;if(c<=0)return i.warn("Could not parse fragment "+e.sn+" "+a+" duration reliably ("+c+") resetting transmuxer to fallback to playlist timing"),i.resetTransmuxer(),t||!1;var u=r?0:Object(p.updateFragPTSDTS)(o,e,s.startPTS,s.endPTS,s.startDTS,s.endDTS);return i.hls.trigger(l.Events.LEVEL_PTS_UPDATED,{details:o,level:n,drift:u,type:a,frag:e,start:s.startPTS,end:s.endPTS}),!0}return t}),!1)?(this.state=E.PARSED,this.hls.trigger(l.Events.FRAG_PARSED,{frag:e,part:t})):this.resetLoadingState()},k.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},x=i,(w=[{key:"state",get:function(){return this._state},set:function(e){var t=this._state;t!==e&&(this._state=e,this.log(t+"->"+e))}}])&&b(x.prototype,w),S&&b(x,S),i}(i.default)},"./src/controller/buffer-controller.ts":
/*!*********************************************!*\
!*** ./src/controller/buffer-controller.ts ***!
\*********************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return f}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=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 e(e){var t=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 e=t.hls,n=t.media,r=t.mediaSource;o.logger.log("[buffer-controller]: Media source opened"),n&&(t.updateMediaElementDuration(),e.trigger(i.Events.MEDIA_ATTACHED,{media:n})),r&&r.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){o.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){o.logger.log("[buffer-controller]: Media source ended")},this.hls=e,this._initSourceBuffer(),this.registerListeners()}var t=e.prototype;return t.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},t.destroy=function(){this.unregisterListeners(),this.details=null},t.registerListeners=function(){var e=this.hls;e.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(i.Events.BUFFER_RESET,this.onBufferReset,this),e.on(i.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(i.Events.BUFFER_EOS,this.onBufferEos,this),e.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(i.Events.FRAG_PARSED,this.onFragParsed,this),e.on(i.Events.FRAG_CHANGED,this.onFragChanged,this)},t.unregisterListeners=function(){var e=this.hls;e.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(i.Events.BUFFER_RESET,this.onBufferReset,this),e.off(i.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(i.Events.BUFFER_EOS,this.onBufferEos,this),e.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(i.Events.FRAG_PARSED,this.onFragParsed,this),e.off(i.Events.FRAG_CHANGED,this.onFragChanged,this)},t._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new u.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},t.onManifestParsed=function(e,t){var n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,o.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},t.onMediaAttaching=function(e,t){var n=this.media=t.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}},t.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,n=this._objectUrl;if(t){if(o.logger.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){o.logger.warn("[buffer-controller]: onMediaDetaching: "+e.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(n&&self.URL.revokeObjectURL(n),e.src===n?(e.removeAttribute("src"),e.load()):o.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(i.Events.MEDIA_DETACHED,void 0)},t.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach((function(t){var n=e.sourceBuffer[t];try{n&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(n),e.sourceBuffer[t]=void 0)}catch(e){o.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",e)}})),this._initSourceBuffer()},t.onBufferCodecs=function(e,t){var n=this,r=this.getSourceBufferTypes().length;Object.keys(t).forEach((function(e){if(r){var i=n.tracks[e];if(i&&"function"==typeof i.buffer.changeType){var o=t[e],a=o.codec,s=o.levelCodec,l=o.container;if((i.levelCodec||i.codec).replace(d,"$1")!==(s||a).replace(d,"$1")){var c=l+";codecs="+(s||a);n.appendChangeType(e,c)}}}else n.pendingTracks[e]=t[e]})),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},t.appendChangeType=function(e,t){var n=this,r=this.operationQueue,i={execute:function(){var i=n.sourceBuffer[e];i&&(o.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),i.changeType(t)),r.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){o.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",t)}};r.append(i,e)},t.onBufferAppending=function(e,t){var n=this,r=this.hls,l=this.operationQueue,c=this.tracks,u=t.data,h=t.type,d=t.frag,f=t.part,p=t.chunkMeta,m=p.buffering[h],g=self.performance.now();m.start=g;var v=d.stats.buffering,y=f?f.stats.buffering:null;0===v.start&&(v.start=g),y&&0===y.start&&(y.start=g);var b=c.audio,_="audio"===h&&1===p.id&&"audio/mpeg"===(null==b?void 0:b.container),E={execute:function(){if(m.executeStart=self.performance.now(),_){var e=n.sourceBuffer[h];if(e){var t=d.start-e.timestampOffset;Math.abs(t)>=.1&&(o.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+t+") sn: "+d.sn+")"),e.timestampOffset=d.start)}}n.appendExecutor(u,h)},onStart:function(){},onComplete:function(){var e=self.performance.now();m.executeEnd=m.end=e,0===v.first&&(v.first=e),y&&0===y.first&&(y.first=e);var t=n.sourceBuffer,r={};for(var o in t)r[o]=s.BufferHelper.getBuffered(t[o]);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(e){o.logger.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",e);var t={type:a.ErrorTypes.MEDIA_ERROR,parent:d.type,details:a.ErrorDetails.BUFFER_APPEND_ERROR,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=a.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,t.details=a.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>r.config.appendErrorMaxRetry&&(o.logger.error("[buffer-controller]: Failed "+r.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),t.fatal=!0)),r.trigger(i.Events.ERROR,t)}};l.append(E,h)},t.onBufferFlushing=function(e,t){var n=this,r=this.operationQueue,a=function(e){return{execute:n.removeExecutor.bind(n,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(i.Events.BUFFER_FLUSHED,{type:e})},onError:function(t){o.logger.warn("[buffer-controller]: Failed to remove from "+e+" SourceBuffer",t)}}};t.type?r.append(a(t.type),t.type):this.getSourceBufferTypes().forEach((function(e){r.append(a(e),e)}))},t.onFragParsed=function(e,t){var n=this,r=t.frag,a=t.part,s=[],l=a?a.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&&o.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+r.type+" level: "+r.level+" sn: "+r.sn),this.blockBuffers((function(){var e=self.performance.now();r.stats.buffering.end=e,a&&(a.stats.buffering.end=e);var t=a?a.stats:r.stats;n.hls.trigger(i.Events.FRAG_BUFFERED,{frag:r,part:a,stats:t,id:r.type})}),s)},t.onFragChanged=function(e,t){this.flushBackBuffer()},t.onBufferEos=function(e,t){var n=this;this.getSourceBufferTypes().reduce((function(e,r){var i=n.sourceBuffer[r];return t.type&&t.type!==r||i&&!i.ended&&(i.ended=!0,o.logger.log("[buffer-controller]: "+r+" sourceBuffer now EOS")),e&&!(i&&!i.ended)}),!0)&&this.blockBuffers((function(){var e=n.mediaSource;e&&"open"===e.readyState&&e.endOfStream()}))},t.onLevelUpdated=function(e,t){var n=t.details;n.fragments.length&&(this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},t.flushBackBuffer=function(){var e=this.hls,t=this.details,n=this.media,o=this.sourceBuffer;if(n&&null!==t){var a=this.getSourceBufferTypes();if(a.length){var l=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(Object(r.isFiniteNumber)(l)&&!(l<0)){var c=n.currentTime,u=t.levelTargetDuration,h=Math.max(l,u),d=Math.floor(c/u)*u-h;a.forEach((function(n){var r=o[n];if(r){var a=s.BufferHelper.getBuffered(r);a.length>0&&d>a.start(0)&&(e.trigger(i.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),t.live&&e.trigger(i.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),e.trigger(i.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:n}))}}))}}}},t.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,n=this.media,i=this.mediaSource,a=e.fragments[0].start+e.totalduration,s=n.duration,l=Object(r.isFiniteNumber)(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(o.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(e)):(a>l&&a>s||!Object(r.isFiniteNumber)(s))&&(o.logger.log("[buffer-controller]: Updating Media Source duration to "+a.toFixed(3)),i.duration=a)}},t.updateSeekableRange=function(e){var t=this.mediaSource,n=e.fragments;if(n.length&&e.live&&null!=t&&t.setLiveSeekableRange){var r=Math.max(0,n[0].start),i=Math.max(r,r+e.totalduration);t.setLiveSeekableRange(r,i)}},t.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,n=this.pendingTracks,r=Object.keys(n).length;if(r&&!e||2===r){this.createSourceBuffers(n),this.pendingTracks={};var o=this.getSourceBufferTypes();if(0===o.length)return void this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});o.forEach((function(e){t.executeNext(e)}))}},t.createSourceBuffers=function(e){var t=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var r=0;for(var s in e)if(!t[s]){var l=e[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;o.logger.log("[buffer-controller]: creating sourceBuffer("+u+")");try{var h=t[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(e){o.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+e.message),this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,mimeType:u})}}r&&this.hls.trigger(i.Events.BUFFER_CREATED,{tracks:this.tracks})},t._onSBUpdateStart=function(e){this.operationQueue.current(e).onStart()},t._onSBUpdateEnd=function(e){var t=this.operationQueue;t.current(e).onComplete(),t.shiftAndExecuteNext(e)},t._onSBUpdateError=function(e,t){o.logger.error("[buffer-controller]: "+e+" SourceBuffer error",t),this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(e);n&&n.onError(t)},t.removeExecutor=function(e,t,n){var i=this.media,a=this.mediaSource,s=this.operationQueue,l=this.sourceBuffer[e];if(!i||!a||!l)return o.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),void s.shiftAndExecuteNext(e);var c=Object(r.isFiniteNumber)(i.duration)?i.duration:1/0,u=Object(r.isFiniteNumber)(a.duration)?a.duration:1/0,h=Math.max(0,t),d=Math.min(n,c,u);d>h?(o.logger.log("[buffer-controller]: Removing ["+h+","+d+"] from the "+e+" SourceBuffer"),console.assert(!l.updating,e+" sourceBuffer must not be updating"),l.remove(h,d)):s.shiftAndExecuteNext(e)},t.appendExecutor=function(e,t){var n=this.operationQueue,r=this.sourceBuffer[t];if(!r)return o.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),void n.shiftAndExecuteNext(t);r.ended=!1,console.assert(!r.updating,t+" sourceBuffer must not be updating"),r.appendBuffer(e)},t.blockBuffers=function(e,t){var n=this;if(void 0===t&&(t=this.getSourceBufferTypes()),!t.length)return o.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(e);var r=this.operationQueue,i=t.map((function(e){return r.appendBlocker(e)}));Promise.all(i).then((function(){e(),t.forEach((function(e){var t=n.sourceBuffer[e];t&&t.updating||r.shiftAndExecuteNext(e)}))}))},t.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},t.addBufferListener=function(e,t,n){var r=this.sourceBuffer[e];if(r){var i=n.bind(this,e);this.listeners[e].push({event:t,listener:i}),r.addEventListener(t,i)}},t.removeBufferListeners=function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach((function(e){t.removeEventListener(e.event,e.listener)}))},e}()},"./src/controller/buffer-operation-queue.ts":
/*!**************************************************!*\
!*** ./src/controller/buffer-operation-queue.ts ***!
\**************************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return i}));var r=n(/*! ../utils/logger */"./src/utils/logger.ts"),i=function(){function e(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}var t=e.prototype;return t.append=function(e,t){var n=this.queues[t];n.push(e),1===n.length&&this.buffers[t]&&this.executeNext(t)},t.insertAbort=function(e,t){this.queues[t].unshift(e),this.executeNext(t)},t.appendBlocker=function(e){var t,n=new Promise((function(e){t=e})),r={execute:t,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(r,e),n},t.executeNext=function(e){var t=this.buffers,n=this.queues,i=t[e],o=n[e];if(o.length){var a=o[0];try{a.execute()}catch(t){r.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(t),i&&i.updating||(o.shift(),this.executeNext(e))}}},t.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},t.current=function(e){return this.queues[e][0]},e}()},"./src/controller/cap-level-controller.ts":
/*!************************************************!*\
!*** ./src/controller/cap-level-controller.ts ***!
\************************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../events */"./src/events.ts");function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=function(){function e(e){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=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var t,n,o,a=e.prototype;return a.setStreamController=function(e){this.streamController=e},a.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},a.registerListeners=function(){var e=this.hls;e.on(r.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(r.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},a.unregisterListener=function(){var e=this.hls;e.off(r.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(r.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},a.onFpsDropLevelCapping=function(t,n){e.isLevelAllowed(n.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(n.droppedLevel)},a.onMediaAttaching=function(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null},a.onManifestParsed=function(e,t){var n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()},a.onBufferCodecs=function(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()},a.onMediaDetaching=function(){this.stopCapping()},a.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var e=this.hls.levels;if(e.length){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},a.getMaxLevel=function(t){var n=this,r=this.hls.levels;if(!r.length)return-1;var i=r.filter((function(r,i){return e.isLevelAllowed(i,n.restrictedLevels)&&i<=t}));return this.clientRect=null,e.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},a.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())},a.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},a.getDimensions=function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,t.width||t.height||(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t},e.isLevelAllowed=function(e,t){return void 0===t&&(t=[]),-1===t.indexOf(e)},e.getMaxLevelByMediaSize=function(e,t,n){if(!e||!e.length)return-1;for(var r,i,o=e.length-1,a=0;a<e.length;a+=1){var s=e[a];if((s.width>=t||s.height>=n)&&(r=s,!(i=e[a+1])||r.width!==i.width||r.height!==i.height)){o=a;break}}return o},t=e,o=[{key:"contentScaleFactor",get:function(){var e=1;try{e=self.devicePixelRatio}catch(e){}return e}}],(n=[{key:"mediaWidth",get:function(){return this.getDimensions().width*e.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*e.contentScaleFactor}}])&&i(t.prototype,n),o&&i(t,o),e}();t.default=o},"./src/controller/cmcd-controller.ts":
/*!*******************************************!*\
!*** ./src/controller/cmcd-controller.ts ***!
\*******************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return d}));var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../types/cmcd */"./src/types/cmcd.ts"),o=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts");function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var d=function(){function e(t){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(e){try{n.apply(e,{ot:i.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(e){a.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=function(e){try{var t=e.frag,r=n.hls.levels[t.level],o=n.getObjectType(t),s={d:1e3*t.duration,ot:o};o!==i.CMCDObjectType.VIDEO&&o!==i.CMCDObjectType.AUDIO&&o!=i.CMCDObjectType.MUXED||(s.br=r.bitrate/1e3,s.tb=n.getTopBandwidth(o),s.bl=n.getBufferLength(o)),n.apply(e,s)}catch(e){a.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=t;var r=this.config=t.config,o=r.cmcd;null!=o&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=o.sessionId||e.uuid(),this.cid=o.contentId,this.useHeaders=!0===o.useHeaders,this.registerListeners())}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(r.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(r.Events.BUFFER_CREATED,this.onBufferCreated,this)},t.unregisterListeners=function(){var e=this.hls;e.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(r.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(r.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},t.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},t.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},t.onBufferCreated=function(e,t){var n,r;this.audioBuffer=null===(n=t.tracks.audio)||void 0===n?void 0:n.buffer,this.videoBuffer=null===(r=t.tracks.video)||void 0===r?void 0:r.buffer},t.createData=function(){var e;return{v:i.CMCDVersion,sf:i.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:null===(e=this.media)||void 0===e?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},t.apply=function(t,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 o=e.toHeaders(n);if(!Object.keys(o).length)return;t.headers||(t.headers={}),h(t.headers,o)}else{var a=e.toQuery(n);if(!a)return;t.url=e.appendQueryToUri(t.url,a)}},t.getObjectType=function(e){var t=e.type;return"subtitle"===t?i.CMCDObjectType.TIMED_TEXT:"initSegment"===e.sn?i.CMCDObjectType.INIT:"audio"===t?i.CMCDObjectType.AUDIO:"main"===t?this.hls.audioTracks.length?i.CMCDObjectType.VIDEO:i.CMCDObjectType.MUXED:void 0},t.getTopBandwidth=function(e){for(var t,n=0,r=c(e===i.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels);!(t=r()).done;){var o=t.value;o.bitrate>n&&(n=o.bitrate)}return n>0?n:NaN},t.getBufferLength=function(e){var t=this.hls.media,n=e===i.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return n&&t?1e3*o.BufferHelper.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,n=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new n(e)}var r=e.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(e,n,r){t(e),this.loader.load(e,n,r)},l(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()},t.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,n=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new n(e)}var r=e.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(e,n,r){t(e),this.loader.load(e,n,r)},l(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()},e.uuid=function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)},e.serialize=function(e){for(var t,n=[],r=function(e){return!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e},i=function(e){return Math.round(e)},o=function(e){return 100*i(e/100)},a={br:i,d:i,bl:o,dl:o,mtp:o,nor:function(e){return encodeURIComponent(e)},rtp:o,tb:i},s=c(Object.keys(e||{}).sort());!(t=s()).done;){var l=t.value,u=e[l];if(r(u)&&!("v"===l&&1===u||"pr"==l&&1===u)){var h=a[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(",")},e.toHeaders=function(t){for(var n={},r=["Object","Request","Session","Status"],i=[{},{},{},{}],o={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},a=0,s=Object.keys(t);a<s.length;a++){var l=s[a];i[null!=o[l]?o[l]:1][l]=t[l]}for(var c=0;c<i.length;c++){var u=e.serialize(i[c]);u&&(n["CMCD-"+r[c]]=u)}return n},e.toQuery=function(t){return"CMCD="+encodeURIComponent(e.serialize(t))},e.appendQueryToUri=function(e,t){if(!t)return e;var n=e.includes("?")?"&":"?";return""+e+n+t},e}()},"./src/controller/eme-controller.ts":
/*!******************************************!*\
!*** ./src/controller/eme-controller.ts ***!
\******************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! ../utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts");function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var l=function(){function e(e){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=e,this._config=e.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var t,n,l,c=e.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(e){switch(e){case a.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+e+'"')},c._attemptKeySystemAccess=function(e,t,n){var r=this,i=function(e,t,n,r){switch(e){case a.KeySystems.WIDEVINE:return function(e,t,n){var r={audioCapabilities:[],videoCapabilities:[]};return e.forEach((function(e){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+e+'"',robustness:n.audioRobustness||""})})),t.forEach((function(e){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+e+'"',robustness:n.videoRobustness||""})})),[r]}(t,n,r);default:throw new Error("Unknown key-system: "+e)}}(e,t,n,this._drmSystemOptions);o.logger.log("Requesting encrypted media key-system access");var s=this.requestMediaKeySystemAccess(e,i);this.mediaKeysPromise=s.then((function(t){return r._onMediaKeySystemAccessObtained(e,t)})),s.catch((function(t){o.logger.error('Failed to obtain key-system "'+e+'" access:',t)}))},c._onMediaKeySystemAccessObtained=function(e,t){var n=this;o.logger.log('Access for key-system "'+e+'" obtained');var r={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:e};this._mediaKeysList.push(r);var i=Promise.resolve().then((function(){return t.createMediaKeys()})).then((function(t){return r.mediaKeys=t,o.logger.log('Media-keys created for key-system "'+e+'"'),n._onMediaKeysCreated(),t}));return i.catch((function(e){o.logger.error("Failed to create media-keys:",e)})),i},c._onMediaKeysCreated=function(){var e=this;this._mediaKeysList.forEach((function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),e._onNewMediaKeySession(t.mediaKeysSession))}))},c._onNewMediaKeySession=function(e){var t=this;o.logger.log("New key-system session "+e.sessionId),e.addEventListener("message",(function(n){t._onKeySessionMessage(e,n.message)}),!1)},c._onKeySessionMessage=function(e,t){o.logger.log("Got EME message event, creating license request"),this._requestLicense(t,(function(t){o.logger.log("Received license data (length: "+(t?t.byteLength:t)+"), updating key-session"),e.update(t)}))},c.onMediaEncrypted=function(e){var t=this;if(o.logger.log('Media is encrypted using "'+e.initDataType+'" init data type'),!this.mediaKeysPromise)return o.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){t._media&&(t._attemptSetMediaKeys(n),t._generateRequestWithPreferredKeySession(e.initDataType,e.initData))};this.mediaKeysPromise.then(n).catch(n)},c._attemptSetMediaKeys=function(e){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys)return o.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});o.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},c._generateRequestWithPreferredKeySession=function(e,t){var n=this,a=this._mediaKeysList[0];if(!a)return o.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(a.mediaKeysSessionInitialized)o.logger.warn("Key-Session already initialized but requested again");else{var s=a.mediaKeysSession;if(!s)return o.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(!t)return o.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});o.logger.log('Generating key-session request for "'+e+'" init data type'),a.mediaKeysSessionInitialized=!0,s.generateRequest(e,t).then((function(){o.logger.debug("Key-session generation succeeded")})).catch((function(e){o.logger.error("Error generating key-session request:",e),n.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})}))}},c._createLicenseXhr=function(e,t,n){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,r,e,t,n);var i=this._licenseXhrSetup;if(i)try{i.call(this.hls,r,e),i=void 0}catch(e){o.logger.error(e)}try{r.readyState||r.open("POST",e,!0),i&&i.call(this.hls,r,e)}catch(e){throw new Error("issue setting up KeySystem license XHR "+e)}return r},c._onLicenseRequestReadyStageChange=function(e,t,n,a){switch(e.readyState){case 4:if(200===e.status){this._requestLicenseFailureCount=0,o.logger.log("License request succeeded");var s=e.response,l=this._licenseResponseCallback;if(l)try{s=l.call(this.hls,e,t)}catch(e){o.logger.error(e)}a(s)}else{if(o.logger.error("License Request XHR failed ("+t+"). Status: "+e.status+" ("+e.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;o.logger.warn("Retrying license request, "+c+" attempts left"),this._requestLicense(n,a)}}},c._generateLicenseRequestChallenge=function(e,t){switch(e.mediaKeySystemDomain){case a.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+e.mediaKeySystemDomain)},c._requestLicense=function(e,t){o.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n)return o.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 a=this.getLicenseServerUrl(n.mediaKeySystemDomain),s=this._createLicenseXhr(a,e,t);o.logger.log("Sending license request to URL: "+a);var l=this._generateLicenseRequestChallenge(n,e);s.send(l)}catch(e){o.logger.error("Failure requesting DRM license: "+e),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(e,t){if(this._emeEnabled){var n=t.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)}},c.onMediaDetached=function(){var e=this._media,t=this._mediaKeysList;e&&(e.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map((function(e){if(e.mediaKeysSession)return e.mediaKeysSession.close().catch((function(){}))}))).then((function(){return e.setMediaKeys(null)})).catch((function(){})))},c.onManifestParsed=function(e,t){if(this._emeEnabled){var n=t.levels.map((function(e){return e.audioCodec})).filter((function(e){return!!e})),r=t.levels.map((function(e){return e.videoCodec})).filter((function(e){return!!e}));this._attemptKeySystemAccess(a.KeySystems.WIDEVINE,n,r)}},t=e,(n=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&s(t.prototype,n),l&&s(t,l),e}();t.default=l},"./src/controller/fps-controller.ts":
/*!******************************************!*\
!*** ./src/controller/fps-controller.ts ***!
\******************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=function(){function e(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.registerListeners=function(){this.hls.on(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.unregisterListeners=function(){this.hls.off(r.Events.MEDIA_ATTACHING,this.onMediaAttaching)},t.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},t.onMediaAttaching=function(e,t){var n=this.hls.config;if(n.capLevelOnFPSDrop){var r=t.media instanceof self.HTMLVideoElement?t.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)}},t.checkFPS=function(e,t,n){var o=performance.now();if(t){if(this.lastTime){var a=o-this.lastTime,s=n-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*s/a,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=o,this.lastDroppedFrames=n,this.lastDecodedFrames=t}},t.checkFPSInterval=function(){var e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},e}();t.default=o},"./src/controller/fragment-finders.ts":
/*!********************************************!*\
!*** ./src/controller/fragment-finders.ts ***!
\********************************************/
/*! exports provided: findFragmentByPDT, findFragmentByPTS, fragmentWithinToleranceTest, pdtWithinToleranceTest, findFragWithCC */function(e,t,n){"use strict";n.r(t),n.d(t,"findFragmentByPDT",(function(){return o})),n.d(t,"findFragmentByPTS",(function(){return a})),n.d(t,"fragmentWithinToleranceTest",(function(){return s})),n.d(t,"pdtWithinToleranceTest",(function(){return l})),n.d(t,"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 o(e,t,n){if(null===t||!Array.isArray(e)||!e.length||!Object(r.isFiniteNumber)(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;n=n||0;for(var i=0;i<e.length;++i){var o=e[i];if(l(t,n,o))return o}return null}function a(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var o=null;if(e?o=t[e.sn-t[0].sn+1]||null:0===n&&0===t[0].start&&(o=t[0]),o&&0===s(n,r,o))return o;var a=i.default.search(t,s.bind(null,n,r));return a||o}function s(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0);var r=Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-r<=e?1:n.start-r>e&&n.start?-1:0}function l(e,t,n){var r=1e3*Math.min(t,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>e}function c(e,t){return i.default.search(e,(function(e){return e.cc<t?1:e.cc>t?-1:0}))}},"./src/controller/fragment-tracker.ts":
/*!********************************************!*\
!*** ./src/controller/fragment-tracker.ts ***!
\********************************************/
/*! exports provided: FragmentState, FragmentTracker */function(e,t,n){"use strict";n.r(t),n.d(t,"FragmentState",(function(){return r})),n.d(t,"FragmentTracker",(function(){return a}));var r,i=n(/*! ../events */"./src/events.ts"),o=n(/*! ../types/loader */"./src/types/loader.ts");!function(e){e.NOT_LOADED="NOT_LOADED",e.BACKTRACKED="BACKTRACKED",e.APPENDING="APPENDING",e.PARTIAL="PARTIAL",e.OK="OK"}(r||(r={}));var a=function(){function e(e){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=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){var e=this.hls;e.on(i.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.on(i.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(i.Events.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var e=this.hls;e.off(i.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.off(i.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(i.Events.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},t.getAppendedFrag=function(e,t){if(t===o.PlaylistLevelType.MAIN){var n=this.activeFragment,r=this.activeParts;if(!n)return null;if(r)for(var i=r.length;i--;){var a=r[i],s=a?a.end:n.appendedPTS;if(a.start<=e&&void 0!==s&&e<=s)return i>9&&(this.activeParts=r.slice(i-9)),a}else if(n.start<=e&&void 0!==n.appendedPTS&&e<=n.appendedPTS)return n}return this.getBufferedFrag(e,t)},t.getBufferedFrag=function(e,t){for(var n=this.fragments,r=Object.keys(n),i=r.length;i--;){var o=n[r[i]];if((null==o?void 0:o.body.type)===t&&o.buffered){var a=o.body;if(a.start<=e&&e<=a.end)return a}}return null},t.detectEvictedFragments=function(e,t,n){var r=this;Object.keys(this.fragments).forEach((function(i){var o=r.fragments[i];if(o)if(o.buffered){var a=o.range[e];a&&a.time.some((function(e){var n=!r.isTimeBuffered(e.startPTS,e.endPTS,t);return n&&r.removeFragment(o.body),n}))}else o.body.type===n&&r.removeFragment(o.body)}))},t.detectPartialFragments=function(e){var t=this,n=this.timeRanges,r=e.frag,i=e.part;if(n&&"initSegment"!==r.sn){var o=l(r),a=this.fragments[o];a&&(Object.keys(n).forEach((function(e){var o=r.elementaryStreams[e];if(o){var s=n[e],l=null!==i||!0===o.partial;a.range[e]=t.getBufferedTimes(r,i,l,s)}})),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body))}},t.fragBuffered=function(e){var t=l(e),n=this.fragments[t];n&&(n.backtrack=n.loaded=null,n.buffered=!0)},t.getBufferedTimes=function(e,t,n,r){for(var i={time:[],partial:n},o=t?t.start:e.start,a=t?t.end:e.end,s=e.minEndPTS||a,l=e.maxStartPTS||o,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(o,r.start(c)),endPTS:Math.min(a,r.end(c))});break}if(o<h&&a>u)i.partial=!0,i.time.push({startPTS:Math.max(o,r.start(c)),endPTS:Math.min(a,r.end(c))});else if(a<=u)break}return i},t.getPartialFragment=function(e){var t,n,r,i=null,o=0,a=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach((function(c){var u=l[c];u&&s(u)&&(n=u.body.start-a,r=u.body.end+a,e>=n&&e<=r&&(t=Math.min(e-n,r-e),o<=t&&(i=u.body,o=t)))})),i},t.getState=function(e){var t=l(e),n=this.fragments[t];return n?n.buffered?s(n)?r.PARTIAL:r.OK:n.backtrack?r.BACKTRACKED:r.APPENDING:r.NOT_LOADED},t.backtrack=function(e,t){var n=l(e),r=this.fragments[n];if(!r||r.backtrack)return null;var i=r.backtrack=t||r.loaded;return r.loaded=null,i},t.getBacktrackData=function(e){var t=l(e),n=this.fragments[t];if(n){var r,i=n.backtrack;if(null!=i&&null!==(r=i.payload)&&void 0!==r&&r.byteLength)return i;this.removeFragment(e)}return null},t.isTimeBuffered=function(e,t,n){for(var r,i,o=0;o<n.length;o++){if(r=n.start(o)-this.bufferPadding,i=n.end(o)+this.bufferPadding,e>=r&&t<=i)return!0;if(t<=r)return!1}return!1},t.onFragLoaded=function(e,t){var n=t.frag,r=t.part;if("initSegment"!==n.sn&&!n.bitrateTest&&!r){var i=l(n);this.fragments[i]={body:n,loaded:t,backtrack:null,buffered:!1,range:Object.create(null)}}},t.onBufferAppended=function(e,t){var n=this,r=t.frag,i=t.part,a=t.timeRanges;if(r.type===o.PlaylistLevelType.MAIN)if(this.activeFragment=r,i){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(i)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach((function(e){var t=a[e];if(n.detectEvictedFragments(e,t),!i)for(var o=0;o<t.length;o++)r.appendedPTS=Math.max(t.end(o),r.appendedPTS||0)}))},t.onFragBuffered=function(e,t){this.detectPartialFragments(t)},t.hasFragment=function(e){var t=l(e);return!!this.fragments[t]},t.removeFragmentsInRange=function(e,t,n){var r=this;Object.keys(this.fragments).forEach((function(i){var o=r.fragments[i];if(o&&o.buffered){var a=o.body;a.type===n&&a.start<t&&a.end>e&&r.removeFragment(a)}}))},t.removeFragment=function(e){var t=l(e);e.stats.loaded=0,e.clearElementaryStreamInfo(),delete this.fragments[t]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},e}();function s(e){var t,n;return e.buffered&&((null===(t=e.range.video)||void 0===t?void 0:t.partial)||(null===(n=e.range.audio)||void 0===n?void 0:n.partial))}function l(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.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(e,t,n){"use strict";n.r(t),n.d(t,"STALL_MINIMUM_DURATION_MS",(function(){return s})),n.d(t,"MAX_START_GAP_JUMP",(function(){return l})),n.d(t,"SKIP_BUFFER_HOLE_STEP_SECONDS",(function(){return c})),n.d(t,"SKIP_BUFFER_RANGE_START",(function(){return u})),n.d(t,"default",(function(){return h}));var r=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),i=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../events */"./src/events.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=250,l=2,c=.1,u=.05,h=function(){function e(e,t,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=e,this.media=t,this.fragmentTracker=n,this.hls=r}var t=e.prototype;return t.destroy=function(){this.hls=this.fragmentTracker=this.media=null},t.poll=function(e){var t=this.config,n=this.media,i=this.stalled,o=n.currentTime,c=n.seeking,u=this.seeking&&!c,h=!this.seeking&&c;if(this.seeking=c,o===e){if((h||u)&&(this.stalled=null),!n.paused&&!n.ended&&0!==n.playbackRate&&r.BufferHelper.getBuffered(n).length){var d=r.BufferHelper.bufferInfo(n,o,0),f=d.len>0,p=d.nextStart||0;if(f||p){if(c){var m=d.len>l,g=!p||p-o>l&&!this.fragmentTracker.getPartialFragment(o);if(m||g)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var v,y=Math.max(p,d.start||0)-o,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,_=(null==b||null===(v=b.details)||void 0===v?void 0:v.live)?2*b.details.targetduration:l;if(y>0&&y<=_)return void this._trySkipBufferHole(null)}var E=self.performance.now();if(null!==i){var x=E-i;!c&&x>=s&&this._reportStall(d.len);var w=r.BufferHelper.bufferInfo(n,o,t.maxBufferHole);this._tryFixBufferStall(w,x)}else this.stalled=E}}}else if(this.moved=!0,null!==i){if(this.stallReported){var S=self.performance.now()-i;a.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(S)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},t._tryFixBufferStall=function(e,t){var n=this.config,r=this.fragmentTracker,i=this.media.currentTime,o=r.getPartialFragment(i);o&&this._trySkipBufferHole(o)||e.len>n.maxBufferHole&&t>1e3*n.highBufferWatchdogPeriod&&(a.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},t._reportStall=function(e){var t=this.hls,n=this.media;this.stallReported||(this.stallReported=!0,a.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+e+")"),t.trigger(o.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e}))},t._trySkipBufferHole=function(e){for(var t=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+t.maxBufferHole>=h&&l<p){var m=Math.max(p+u,s.currentTime+c);return a.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+m),this.moved=!0,this.stalled=null,s.currentTime=m,e&&n.trigger(o.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 "+m,frag:e}),m}h=d.end(f)}return 0},t._tryNudgeBuffer=function(){var e=this.config,t=this.hls,n=this.media,r=n.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<e.nudgeMaxRetry){var l=r+s*e.nudgeOffset;a.logger.warn("Nudging 'currentTime' from "+r+" to "+l),n.currentTime=l,t.trigger(o.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else a.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+e.nudgeMaxRetry+" nudges"),t.trigger(o.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},e}()},"./src/controller/id3-track-controller.ts":
/*!************************************************!*\
!*** ./src/controller/id3-track-controller.ts ***!
\************************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),o=n(/*! ../demux/id3 */"./src/demux/id3.ts"),a=function(){function e(e){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=e,this._registerListeners()}var t=e.prototype;return t.destroy=function(){this._unregisterListeners()},t._registerListeners=function(){var e=this.hls;e.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(r.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},t._unregisterListeners=function(){var e=this.hls;e.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(r.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},t.onMediaAttached=function(e,t){this.media=t.media},t.onMediaDetaching=function(){this.id3Track&&(Object(i.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null)},t.getID3Track=function(e){if(this.media){for(var t=0;t<e.length;t++){var n=e[t];if("metadata"===n.kind&&"id3"===n.label)return Object(i.sendAddTrackEvent)(n,this.media),n}return this.media.addTextTrack("metadata","id3")}},t.onFragParsingMetadata=function(e,t){if(this.media){var n=t.frag,r=t.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var i=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<r.length;a++){var s=o.getID3Frames(r[a].data);if(s){var l=r[a].pts,c=a<r.length-1?r[a+1].pts:n.end;c-l<=0&&(c=l+.25);for(var u=0;u<s.length;u++){var h=s[u];if(!o.isTimeStampFrame(h)){var d=new i(l,c,"");d.value=h,this.id3Track.addCue(d)}}}}}},t.onBufferFlushing=function(e,t){var n=t.startOffset,r=t.endOffset,o=t.type;if(!o||"audio"===o){var a=this.id3Track;a&&Object(i.removeCuesInRange)(a,n,r)}},e}();t.default=a},"./src/controller/latency-controller.ts":
/*!**********************************************!*\
!*** ./src/controller/latency-controller.ts ***!
\**********************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return s}));var r=n(/*! ../errors */"./src/errors.ts"),i=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts");function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(e){var t=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 t.timeupdate()},this.hls=e,this.config=e.config,this.registerListeners()}var t,n,s,l=e.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(e,t){this.media=t.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(e,t){var n=t.details;this.levelDetails=n,n.advanced&&this.timeupdate(),!n.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},l.onError=function(e,t){t.details===r.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,o.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},l.timeupdate=function(){var e=this.media,t=this.levelDetails;if(e&&t){this.currentTime=e.currentTime;var n=this.computeLatency();if(null!==n){this._latency=n;var r=this.config,i=r.lowLatencyMode,o=r.maxLiveSyncPlaybackRate;if(i&&1!==o){var a=this.targetLatency;if(null!==a){var s=n-a,l=s<Math.min(this.maxLatency,a+t.targetduration);if(t.live&&l&&s>.05&&this.forwardBufferLength>1){var c=Math.min(2,Math.max(1,o)),u=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;e.playbackRate=Math.min(c,Math.max(1,u))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}}}}},l.estimateLiveEdge=function(){var e=this.levelDetails;return null===e?null:e.edge+e.age},l.computeLatency=function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime},t=e,(n=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var e=this.config,t=this.levelDetails;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}},{key:"targetLatency",get:function(){var e=this.levelDetails;if(null===e)return null;var t=e.holdBack,n=e.partHoldBack,r=e.targetduration,i=this.config,o=i.liveSyncDuration,a=i.liveSyncDurationCount,s=i.lowLatencyMode,l=this.hls.userConfig,c=s&&n||t;(l.liveSyncDuration||l.liveSyncDurationCount||0===c)&&(c=void 0!==o?o:a*r);var u=r;return c+Math.min(1*this.stallCount,u)}},{key:"liveSyncPosition",get:function(){var e=this.estimateLiveEdge(),t=this.targetLatency,n=this.levelDetails;if(null===e||null===t||null===n)return null;var r=n.edge,i=e-t-this.edgeStalled,o=r-n.totalduration,a=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(o,i),a)}},{key:"drift",get:function(){var e=this.levelDetails;return null===e?1:e.drift}},{key:"edgeStalled",get:function(){var e=this.levelDetails;if(null===e)return 0;var t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}},{key:"forwardBufferLength",get:function(){var e=this.media,t=this.levelDetails;if(!e||!t)return 0;var n=e.buffered.length;return n?e.buffered.end(n-1):t.edge-this.currentTime}}])&&a(t.prototype,n),s&&a(t,s),e}()},"./src/controller/level-controller.ts":
/*!********************************************!*\
!*** ./src/controller/level-controller.ts ***!
\********************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return p}));var r=n(/*! ../types/level */"./src/types/level.ts"),i=n(/*! ../events */"./src/events.ts"),o=n(/*! ../errors */"./src/errors.ts"),a=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(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),p=function(e){var t,n;function l(t){var n;return(n=e.call(this,t,"[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=e,(t=l).prototype=Object.create(n.prototype),t.prototype.constructor=t,d(t,n);var p,m,g,v=l.prototype;return v._registerListeners=function(){var e=this.hls;e.on(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(i.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(i.Events.ERROR,this.onError,this)},v._unregisterListeners=function(){var e=this.hls;e.off(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(i.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(i.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(i.Events.ERROR,this.onError,this)},v.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},v.startLoad=function(){this._levels.forEach((function(e){e.loadError=0})),e.prototype.startLoad.call(this)},v.onManifestLoaded=function(e,t){var n,l,c=[],u=[],h=[],d={},p=!1,m=!1,g=!1;if(t.levels.forEach((function(e){var t=e.attrs;p=p||!(!e.width||!e.height),m=m||!!e.videoCodec,g=g||!!e.audioCodec,f&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0);var n=e.bitrate+"-"+e.attrs.RESOLUTION+"-"+e.attrs.CODECS;(l=d[n])?l.url.push(e.url):(l=new r.Level(e),d[n]=l,c.push(l)),t&&(t.AUDIO&&Object(s.addGroupId)(l,"audio",t.AUDIO),t.SUBTITLES&&Object(s.addGroupId)(l,"text",t.SUBTITLES))})),(p||m)&&g&&(c=c.filter((function(e){var t=e.videoCodec,n=e.width,r=e.height;return!!t||!(!n||!r)}))),c=c.filter((function(e){var t=e.audioCodec,n=e.videoCodec;return(!t||Object(a.isCodecSupportedInMp4)(t,"audio"))&&(!n||Object(a.isCodecSupportedInMp4)(n,"video"))})),t.audioTracks&&(u=t.audioTracks.filter((function(e){return!e.audioCodec||Object(a.isCodecSupportedInMp4)(e.audioCodec,"audio")})),Object(s.assignTrackIdsByGroup)(u)),t.subtitles&&(h=t.subtitles,Object(s.assignTrackIdsByGroup)(h)),c.length>0){n=c[0].bitrate,c.sort((function(e,t){return e.bitrate-t.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=g&&!m,b={levels:c,audioTracks:u,subtitleTracks:h,firstLevel:this._firstLevel,stats:t.stats,audio:g,video:m,altAudio:!y&&u.some((function(e){return!!e.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:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,reason:"no level with compatible codecs found in manifest"})},v.onError=function(t,n){if(e.prototype.onError.call(this,t,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 a,s=!1,l=!0;switch(n.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:if(n.frag){var u=this._levels[n.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(a=n.frag.level)):a=n.frag.level}break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:r&&(r.deliveryDirectives&&(l=!1),a=r.level),s=!0;break;case o.ErrorDetails.REMUX_ALLOC_ERROR:a=n.level,s=!0}void 0!==a&&this.recoverLevel(n,a,s,l)}}},v.recoverLevel=function(e,t,n,r){var i=e.details,o=this._levels[t];if(o.loadError++,n){if(!this.retryLoadingOrFail(e))return void(this.currentLevelIndex=-1);e.levelRetry=!0}if(r){var a=o.url.length;if(a>1&&o.loadError<a)e.levelRetry=!0,this.redundantFailover(t);else if(-1===this.manualLevelIndex){var s=0===t?this._levels.length-1:t-1;this.currentLevelIndex!==s&&0===this._levels[s].loadError&&(this.warn(i+": switch to "+s),e.levelRetry=!0,this.hls.nextAutoLevel=s)}}},v.redundantFailover=function(e){var t=this._levels[e],n=t.url.length;if(n>1){var r=(t.urlId+1)%n;this.warn("Switching to redundant URL-id "+r),this._levels.forEach((function(e){e.urlId=r})),this.level=e}},v.onFragLoaded=function(e,t){var n=t.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(e,t){var n,r,i=t.level,o=t.details,a=this._levels[i];if(!a)return this.warn("Invalid level index "+i),void(null!==(r=t.deliveryDirectives)&&void 0!==r&&r.skip&&(o.deltaUpdateFailed=!0));i===this.currentLevelIndex?(0===a.fragmentError&&(a.loadError=0,this.retryCount=0),this.playlistLoaded(i,t,a.details)):null!==(n=t.deliveryDirectives)&&void 0!==n&&n.skip&&(o.deltaUpdateFailed=!0)},v.onAudioTrackSwitched=function(e,t){var n=this.hls.levels[this.currentLevelIndex];if(n&&n.audioGroupIds){for(var r=-1,i=this.hls.audioTracks[t.id].groupId,o=0;o<n.audioGroupIds.length;o++)if(n.audioGroupIds[o]===i){r=o;break}r!==n.urlId&&(n.urlId=r,this.startLoad())}},v.loadPlaylist=function(e){var t=this.currentLevelIndex,n=this._levels[t];if(this.canLoad&&n&&n.url.length>0){var r=n.urlId,o=n.url[r];if(e)try{o=e.addDirectives(o)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("Attempt loading level index "+t+(e?" at sn "+e.msn+" part "+e.part:"")+" with URL-id "+r+" "+o),this.clearTimer(),this.hls.trigger(i.Events.LEVEL_LOADING,{url:o,level:t,id:r,deliveryDirectives:e||null})}},v.removeLevel=function(e,t){var n=function(e,n){return n!==t},r=this._levels.filter((function(r,i){return i!==e||r.url.length>1&&void 0!==t&&(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(e,t){var n=e.details;return null!=n&&n.fragments&&n.fragments.forEach((function(e){e.level=t})),e}));this._levels=r,this.hls.trigger(i.Events.LEVELS_UPDATED,{levels:r})},p=l,(m=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t,n=this._levels;if(0!==n.length&&(this.currentLevelIndex!==e||null===(t=n[e])||void 0===t||!t.details)){if(e<0||e>=n.length){var r=e<0;if(this.hls.trigger(i.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:r,reason:"invalid level idx"}),r)return;e=Math.min(e,n.length-1)}this.clearTimer();var a=this.currentLevelIndex,s=n[a],l=n[e];this.log("switching to level "+e+" from "+a),this.currentLevelIndex=e;var c=u({},l,{level:e,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(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}])&&h(p.prototype,m),g&&h(p,g),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(e,t,n){"use strict";n.r(t),n.d(t,"addGroupId",(function(){return o})),n.d(t,"assignTrackIdsByGroup",(function(){return a})),n.d(t,"updatePTS",(function(){return s})),n.d(t,"updateFragPTSDTS",(function(){return c})),n.d(t,"mergeDetails",(function(){return u})),n.d(t,"mapPartIntersection",(function(){return h})),n.d(t,"mapFragmentIntersection",(function(){return d})),n.d(t,"adjustSliding",(function(){return f})),n.d(t,"addSliding",(function(){return p})),n.d(t,"computeReloadInterval",(function(){return m})),n.d(t,"getFragmentWithSN",(function(){return g})),n.d(t,"getPartWith",(function(){return v}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../utils/logger */"./src/utils/logger.ts");function o(e,t,n){switch(t){case"audio":e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds.push(n);break;case"text":e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds.push(n)}}function a(e){var t={};e.forEach((function(e){var n=e.groupId||"";e.id=t[n]=t[n]||0,t[n]++}))}function s(e,t,n){l(e[t],e[n])}function l(e,t){var n=t.startPTS;if(Object(r.isFiniteNumber)(n)){var i,o=0;t.sn>e.sn?(o=n-e.start,i=e):(o=e.start-n,i=t),i.duration!==o&&(i.duration=o)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function c(e,t,n,o,a,s){o-n<=0&&(i.logger.warn("Fragment should have a positive duration",t),o=n+t.duration,s=a+t.duration);var c=n,u=o,h=t.startPTS,d=t.endPTS;if(Object(r.isFiniteNumber)(h)){var f=Math.abs(h-n);Object(r.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(f,t.deltaPTS):t.deltaPTS=f,c=Math.max(n,h),n=Math.min(n,h),a=Math.min(a,t.startDTS),u=Math.min(o,d),o=Math.max(o,d),s=Math.max(s,t.endDTS)}t.duration=o-n;var p=n-t.start;t.appendedPTS=o,t.start=t.startPTS=n,t.maxStartPTS=c,t.startDTS=a,t.endPTS=o,t.minEndPTS=u,t.endDTS=s;var m,g=t.sn;if(!e||g<e.startSN||g>e.endSN)return 0;var v=g-e.startSN,y=e.fragments;for(y[v]=t,m=v;m>0;m--)l(y[m],y[m-1]);for(m=v;m<y.length-1;m++)l(y[m],y[m+1]);return e.fragmentHint&&l(y[y.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,p}function u(e,t){for(var n=null,o=e.fragments,a=o.length-1;a>=0;a--){var s=o[a].initSegment;if(s){n=s;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var l,u=0;if(d(e,t,(function(e,i){e.relurl&&(u=e.cc-i.cc),Object(r.isFiniteNumber)(e.startPTS)&&Object(r.isFiniteNumber)(e.endPTS)&&(i.start=i.startPTS=e.startPTS,i.startDTS=e.startDTS,i.appendedPTS=e.appendedPTS,i.maxStartPTS=e.maxStartPTS,i.endPTS=e.endPTS,i.endDTS=e.endDTS,i.minEndPTS=e.minEndPTS,i.duration=e.endPTS-e.startPTS,i.duration&&(l=i),t.PTSKnown=t.alignedSliding=!0),i.elementaryStreams=e.elementaryStreams,i.loader=e.loader,i.stats=e.stats,i.urlId=e.urlId,e.initSegment&&(i.initSegment=e.initSegment,n=e.initSegment)})),n&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((function(e){var t;e.initSegment&&e.initSegment.relurl!==(null===(t=n)||void 0===t?void 0:t.relurl)||(e.initSegment=n)})),t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some((function(e){return!e})),t.deltaUpdateFailed)){i.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=t.skippedSegments;p--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var m=t.fragments;if(u){i.logger.warn("discontinuity sliding from playlist, take drift into account");for(var g=0;g<m.length;g++)m[g].cc+=u}t.skippedSegments&&(t.startCC=t.fragments[0].cc),h(e.partList,t.partList,(function(e,t){t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),l?c(t,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):f(e,t),m.length&&(t.totalduration=t.edge-m[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;var v=t.advancedDateTime;if(t.advanced&&v){var y=t.edge;t.driftStart||(t.driftStartTime=v,t.driftStart=y),t.driftEndTime=v,t.driftEnd=y}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function h(e,t,n){if(e&&t)for(var r=0,i=0,o=e.length;i<=o;i++){var a=e[i],s=t[i+r];a&&s&&a.index===s.index&&a.fragment.sn===s.fragment.sn?n(a,s):r--}}function d(e,t,n){for(var r=t.skippedSegments,i=Math.max(e.startSN,t.startSN)-t.startSN,o=(e.fragmentHint?1:0)+(r?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,s=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=i;c<=o;c++){var u=l[a+c],h=s[c];r&&!h&&c<r&&(h=t.fragments[c]=u),u&&h&&n(u,h)}}function f(e,t){var n=t.startSN+t.skippedSegments-e.startSN,r=e.fragments;n<0||n>=r.length||p(t,r[n].start)}function p(e,t){if(t){for(var n=e.fragments,r=e.skippedSegments;r<n.length;r++)n[r].start+=t;e.fragmentHint&&(e.fragmentHint.start+=t)}}function m(e,t){var n,r=1e3*e.levelTargetDuration,i=r/2,o=e.age,a=o>0&&o<3*r,s=t.loading.end-t.loading.start,l=e.availabilityDelay;if(!1===e.updated)if(a){var c=333*e.misses;n=Math.max(Math.min(i,2*s),c),e.availabilityDelay=(e.availabilityDelay||0)+n}else n=i;else a?(l=Math.min(l||r/2,o),e.availabilityDelay=l,n=l+r-o):n=r-s;return Math.round(n)}function g(e,t,n){if(!e||!e.details)return null;var r=e.details,i=r.fragments[t-r.startSN];return i||((i=r.fragmentHint)&&i.sn===t?i:t<r.startSN&&n&&n.sn===t?n:null)}function v(e,t,n){if(!e||!e.details)return null;var r=e.details.partList;if(r)for(var i=r.length;i--;){var o=r[i];if(o.index===n&&o.fragment.sn===t)return o}return null}},"./src/controller/stream-controller.ts":
/*!*********************************************!*\
!*** ./src/controller/stream-controller.ts ***!
\*********************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"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"),o=n(/*! ../is-supported */"./src/is-supported.ts"),a=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"),m=n(/*! ../utils/logger */"./src/utils/logger.ts");function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=function(e){var t,n;function y(t,n){var r;return(r=e.call(this,t,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=e,(t=y).prototype=Object.create(n.prototype),t.prototype.constructor=t,v(t,n);var b,_,E,x=y.prototype;return x._registerListeners=function(){var e=this.hls;e.on(a.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(a.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(a.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(a.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(a.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(a.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(a.Events.ERROR,this.onError,this),e.on(a.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(a.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(a.Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(a.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(a.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(a.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x._unregisterListeners=function(){var e=this.hls;e.off(a.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(a.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(a.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(a.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(a.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(a.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(a.Events.ERROR,this.onError,this),e.off(a.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(a.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(a.Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(a.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(a.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(a.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},x.startLoad=function(e){if(this.levels){var t=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}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=i.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=i.State.STOPPED},x.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},x.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_LEVEL:var e,t=this.levels,n=this.level,r=null==t||null===(e=t[n])||void 0===e?void 0:e.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 o,a=self.performance.now(),s=this.retryDate;(!s||a>=s||null!==(o=this.media)&&void 0!==o&&o.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=i.State.IDLE)}this.onTickEnd()},x.onTickEnd=function(){e.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},x.doTickIdle=function(){var e,t,n=this.hls,r=this.levelLastLoaded,o=this.levels,s=this.media,h=n.config,d=n.nextLoadLevel;if(null!==r&&(s||!this.startFragRequested&&h.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&o&&o[d]){var f=o[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 m=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:s,c.PlaylistLevelType.MAIN);if(null!==m&&!(m.len>=this.getMaxBufferLength(f.maxBitrate))){if(this._streamEnded(m,p)){var g={};return this.altAudio&&(g.type="video"),this.hls.trigger(a.Events.BUFFER_EOS,g),void(this.state=i.State.ENDED)}var v=m.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 _=this.audioOnly&&!this.altAudio?u.ElementaryStreamTypes.AUDIO:u.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(s,_,c.PlaylistLevelType.MAIN),y=this.getNextFragment(this.nextLoadPosition,p)}y&&(!y.initSegment||y.initSegment.data||this.bitrateTest||(y=y.initSegment),"identity"!==(null===(e=y.decryptdata)||void 0===e?void 0:e.keyFormat)||null!==(t=y.decryptdata)&&void 0!==t&&t.key?this.loadFragment(y,p,v):this.loadKey(y,p))}}}},x.loadFragment=function(t,n,r){var i,o=this.fragmentTracker.getState(t);if(this.fragCurrent=t,o===l.FragmentState.BACKTRACKED){var a=this.fragmentTracker.getBacktrackData(t);if(a)return this._handleFragmentLoadProgress(a),void this._handleFragmentLoadComplete(a);o=l.FragmentState.NOT_LOADED}o===l.FragmentState.NOT_LOADED||o===l.FragmentState.PARTIAL?"initSegment"===t.sn?this._loadInitSegment(t):this.bitrateTest?(t.bitrateTest=!0,this.log("Fragment "+t.sn+" of level "+t.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(t)):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,n,r)):o===l.FragmentState.APPENDING?this.reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t):0===(null===(i=this.media)||void 0===i?void 0:i.buffered.length)&&this.fragmentTracker.removeAllFragments()},x.getAppendedFrag=function(e){var t=this.fragmentTracker.getAppendedFrag(e,c.PlaylistLevelType.MAIN);return t&&"fragment"in t?t.fragment:t},x.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,c.PlaylistLevelType.MAIN)},x.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+.5):null},x.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},x.nextLevelSwitch=function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var n,r=this.getAppendedFrag(t.currentTime);if(r&&r.start>1&&this.flushMainBuffer(0,r.start-1),!t.paused&&e){var i=e[this.hls.nextLoadLevel],o=this.fragLastKbps;n=o&&this.fragCurrent?this.fragCurrent.duration*i.maxBitrate/(1e3*o)+1:0}else n=0;var a=this.getBufferedFrag(t.currentTime+n);if(a){var s=this.followingBufferedFrag(a);if(s){this.abortCurrentFrag();var l=s.maxStartPTS?s.maxStartPTS:s.start,c=s.duration,u=Math.max(a.end,l+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,.5*c),.75*c));this.flushMainBuffer(u,Number.POSITIVE_INFINITY)}}}},x.abortCurrentFrag=function(){var e=this.fragCurrent;this.fragCurrent=null,null!=e&&e.loader&&e.loader.abort(),this.state===i.State.KEY_LOADING&&(this.state=i.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},x.flushMainBuffer=function(t,n){e.prototype.flushMainBuffer.call(this,t,n,this.altAudio?"video":null)},x.onMediaAttached=function(t,n){e.prototype.onMediaAttached.call(this,t,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)},x.onMediaDetaching=function(){var t=this.media;t&&(t.removeEventListener("playing",this.onvplaying),t.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),e.prototype.onMediaDetaching.call(this)},x.onMediaPlaying=function(){this.tick()},x.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:null;Object(r.isFiniteNumber)(t)&&this.log("Media seeked to "+t.toFixed(3)),this.tick()},x.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(a.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},x.onManifestParsed=function(e,t){var n,r=!1,i=!1;t.levels.forEach((function(e){(n=e.audioCodec)&&(-1!==n.indexOf("mp4a.40.2")&&(r=!0),-1!==n.indexOf("mp4a.40.5")&&(i=!0))})),this.audioCodecSwitch=r&&i&&!Object(o.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1},x.onLevelLoading=function(e,t){var n=this.levels;if(n&&this.state===i.State.IDLE){var r=n[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(r.details))&&(this.state=i.State.WAITING_LEVEL)}},x.onLevelLoaded=function(e,t){var n,r=this.levels,o=t.level,s=t.details,l=s.totalduration;if(r){this.log("Level "+o+" 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!==t.level&&c.loader&&(this.state=i.State.IDLE,c.loader.abort());var u=r[o],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=o,this.hls.trigger(a.Events.LEVEL_UPDATED,{details:s,level:o}),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 "+o)},x._handleFragmentLoadProgress=function(e){var t,n=e.frag,r=e.part,i=e.payload,o=this.levels;if(o){var a=o[n.level],s=a.details;if(s){var l=a.videoCodec,u=s.PTSKnown||!s.live,f=null===(t=n.initSegment)||void 0===t?void 0:t.data,p=this._getAudioCodec(a),m=this.transmuxer=this.transmuxer||new h.default(this.hls,c.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),g=r?r.index:-1,v=-1!==g,y=new d.ChunkMetadata(n.level,n.sn,n.stats.chunkCount,i.byteLength,g,v),b=this.initPTS[n.cc];m.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")},x.onAudioTrackSwitching=function(e,t){var n=this.altAudio,r=!!t.url,i=t.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 o=this.fragCurrent;null!=o&&o.loader&&(this.log("Switching to main audio track, cancel main fragment load"),o.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var s=this.hls;n&&s.trigger(a.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),s.trigger(a.Events.AUDIO_TRACK_SWITCHED,{id:i})}},x.onAudioTrackSwitched=function(e,t){var n=t.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()},x.onBufferCreated=function(e,t){var n,r,i=t.tracks,o=!1;for(var a in i){var s=i[a];if("main"===s.id){if(r=a,n=s,"video"===a){var l=i[a];l&&(this.videoBuffer=l.buffer)}}else o=!0}o&&n?(this.log("Alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media},x.onFragBuffered=function(e,t){var n=t.frag,r=t.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 o=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),"initSegment"!==n.sn&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}},x.onError=function(e,t){switch(t.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,t);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==i.State.ERROR&&(t.fatal?(this.warn(""+t.details),this.state=i.State.ERROR):t.levelRetry||this.state!==i.State.WAITING_LEVEL||(this.state=i.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if("main"===t.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()}}},x.checkBuffer=function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){var n=s.BufferHelper.getBuffered(e);!this.loadedmetadata&&n.length?(this.loadedmetadata=!0,this.seekToStartPos()):t.poll(this.lastCurrentTime),this.lastCurrentTime=e.currentTime}},x.onFragLoadEmergencyAborted=function(){this.state=i.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},x.onBufferFlushed=function(e,t){var n=t.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)}},x.onLevelsUpdated=function(e,t){this.levels=t.levels},x.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},x.seekToStartPos=function(){var e=this.media,t=e.currentTime,n=this.startPosition;if(n>=0&&t<n){if(e.seeking)return void m.logger.log("could not seek to "+n+", already seeking at "+t);var r=s.BufferHelper.getBuffered(e),i=(r.length?r.start(0):0)-n;i>0&&(i<this.config.maxBufferHole||i<this.config.maxFragLookUpTolerance)&&(m.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 "+t),e.currentTime=n}},x._getAudioCodec=function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t},x._loadBitrateTestFrag=function(e){var t=this;this._doFragLoad(e).then((function(n){var r=t.hls;if(n&&!r.nextLoadLevel&&!t.fragContextChanged(e)){t.fragLoadError=0,t.state=i.State.IDLE,t.startFragRequested=!1,t.bitrateTest=!1;var o=e.stats;o.parsing.start=o.parsing.end=o.buffering.start=o.buffering.end=self.performance.now(),r.trigger(a.Events.FRAG_LOADED,n)}}))},x._handleTransmuxComplete=function(e){var t,n="main",o=this.hls,s=e.remuxResult,l=e.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,m=s.text,g=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),o.trigger(a.Events.FRAG_PARSING_INIT_SEGMENT,{frag:h,id:n,tracks:v.tracks}));var b=v.initPTS,_=v.timescale;Object(r.isFiniteNumber)(b)&&(this.initPTS[h.cc]=b,o.trigger(a.Events.INIT_PTS_FOUND,{frag:h,id:n,initPTS:b,timescale:_}))}if(p&&!1!==s.independent){if(f.details){var E=p.startPTS,x=p.endPTS,w=p.startDTS,S=p.endDTS;if(d)d.elementaryStreams[p.type]={startPTS:E,endPTS:x,startDTS:w,endDTS:S};else if(p.firstKeyFrame&&p.independent&&(this.couldBacktrack=!0),p.dropped&&p.independent){if(this.getLoadPosition()+this.config.maxBufferHole<E)return void this.backtrack(h);h.setElementaryStreamInfo(p.type,h.start,x,h.start,S,!0)}h.setElementaryStreamInfo(p.type,E,x,w,S),this.bufferFragmentData(p,h,d,l)}}else if(!1===s.independent)return void this.backtrack(h);if(y){var k=y.startPTS,C=y.endPTS,T=y.startDTS,O=y.endDTS;d&&(d.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:k,endPTS:C,startDTS:T,endDTS:O}),h.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,k,C,T,O),this.bufferFragmentData(y,h,d,l)}if(null!=g&&null!==(t=g.samples)&&void 0!==t&&t.length){var A={frag:h,id:n,samples:g.samples};o.trigger(a.Events.FRAG_PARSING_METADATA,A)}if(m){var L={frag:h,id:n,samples:m.samples};o.trigger(a.Events.FRAG_PARSING_USERDATA,L)}}},x._bufferInitSegment=function(e,t,n,r){var o=this;if(this.state===i.State.PARSING){this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;var s=t.audio,l=t.video,c=t.audiovideo;if(s){var u=e.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)),e.audioCodec&&e.audioCodec!==u&&this.log('Swapping manifest audio codec "'+e.audioCodec+'" for "'+u+'"'),s.levelCodec=u,s.id="main",this.log("Init audio buffer, container:"+s.container+", codecs[selected/level/parsed]=["+(u||"")+"/"+(e.audioCodec||"")+"/"+s.codec+"]")}l&&(l.levelCodec=e.videoCodec,l.id="main",this.log("Init video buffer, container:"+l.container+", codecs[level/parsed]=["+(e.videoCodec||"")+"/"+l.codec+"]")),c&&this.log("Init audiovideo buffer, container:"+c.container+", codecs[level/parsed]=["+(e.attrs.CODECS||"")+"/"+c.codec+"]"),this.hls.trigger(a.Events.BUFFER_CODECS,t),Object.keys(t).forEach((function(e){var i=t[e].initSegment;null!=i&&i.byteLength&&o.hls.trigger(a.Events.BUFFER_APPENDING,{type:e,data:i,frag:n,part:null,chunkMeta:r,parent:n.type})})),this.tick()}},x.backtrack=function(e){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(e);var t=this.fragmentTracker.backtrack(e);this.fragPrevious=null,this.nextLoadPosition=e.start,t?this.resetFragmentLoading(e):this.state=i.State.BACKTRACKING},x.checkFragmentChanged=function(){var e=this.media,t=null;if(e&&e.readyState>1&&!1===e.seeking){var n=e.currentTime;if(s.BufferHelper.isBuffered(e,n)?t=this.getAppendedFrag(n):s.BufferHelper.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){var r=this.fragPlaying,i=t.level;r&&t.sn===r.sn&&r.level===i&&t.urlId===r.urlId||(this.hls.trigger(a.Events.FRAG_CHANGED,{frag:t}),r&&r.level===i||this.hls.trigger(a.Events.LEVEL_SWITCHED,{level:i}),this.fragPlaying=t)}}},b=y,(_=[{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getAppendedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;if(e){var t=this.getAppendedFrag(e.currentTime);return this.followingBufferedFrag(t)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&g(b.prototype,_),E&&g(b,E),y}(i.default)},"./src/controller/subtitle-stream-controller.ts":
/*!******************************************************!*\
!*** ./src/controller/subtitle-stream-controller.ts ***!
\******************************************************/
/*! exports provided: SubtitleStreamController */function(e,t,n){"use strict";n.r(t),n.d(t,"SubtitleStreamController",(function(){return m}));var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=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(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var m=function(e){var t,n;function m(t,n){var r;return(r=e.call(this,t,n,"[subtitle-stream-controller]")||this).levels=[],r.currentTrackId=-1,r.tracksBuffered=[],r.mainDetails=null,r._registerListeners(),r}n=e,(t=m).prototype=Object.create(n.prototype),t.prototype.constructor=t,p(t,n);var g,v,y,b=m.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var e=this.hls;e.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(r.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(r.Events.ERROR,this.onError,this),e.on(r.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(r.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(r.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b._unregisterListeners=function(){var e=this.hls;e.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(r.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(r.Events.ERROR,this.onError,this),e.off(r.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(r.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(r.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.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(e,t){this.mainDetails=t.details},b.onSubtitleFragProcessed=function(e,t){var n=t.frag,r=t.success;if(this.fragPrevious=n,this.state=u.State.IDLE,r){var i=this.tracksBuffered[this.currentTrackId];if(i){for(var o,a=n.start,s=0;s<i.length;s++)if(a>=i[s].start&&a<=i[s].end){o=i[s];break}var l=n.start+n.duration;o?o.end=l:(o={start:a,end:l},i.push(o)),this.fragmentTracker.fragBuffered(n)}}},b.onBufferFlushing=function(e,t){var n=t.startOffset,r=t.endOffset;if(0===n&&r!==Number.POSITIVE_INFINITY){var i=this.currentTrackId,o=this.levels;if(!o.length||!o[i]||!o[i].details)return;var a=r-o[i].details.targetduration;if(a<=0)return;t.endOffsetSubtitles=Math.max(0,a),this.tracksBuffered.forEach((function(e){for(var t=0;t<e.length;)if(e[t].end<=a)e.shift();else{if(!(e[t].start<a))break;e[t].start=a,t++}})),this.fragmentTracker.removeFragmentsInRange(n,a,h.PlaylistLevelType.SUBTITLE)}},b.onError=function(e,t){var n,r=t.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(e,t){var n=this,r=t.subtitleTracks;this.tracksBuffered=[],this.levels=r.map((function(e){return new d.Level(e)})),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach((function(e){n.tracksBuffered[e.id]=[]})),this.mediaBuffer=null},b.onSubtitleTrackSwitch=function(e,t){if(this.currentTrackId=t.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(e,t){var n,r=t.details,i=t.id,o=this.currentTrackId,c=this.levels;if(c.length){var h=c[o];if(!(i>=c.length||i!==o)&&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(a.findFragmentByPTS)(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0))}}},b._handleFragmentLoadComplete=function(e){var t=e.frag,n=e.payload,i=t.decryptdata,o=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){var a=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).then((function(e){var n=performance.now();o.trigger(r.Events.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:a,tdecrypt:n}})}))}},b.doTick=function(){if(this.media){if(this.state===u.State.IDLE){var e,t=this.currentTrackId,n=this.levels;if(!n.length||!n[t]||!n[t].details)return;var s=n[t].details,l=s.targetduration,h=this.config,d=this.media,f=o.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 m,g=s.fragments,v=g.length,y=s.edge,b=this.fragPrevious;if(p<y){var _=h.maxFragLookUpTolerance;b&&s.hasProgramDateTime&&(m=Object(a.findFragmentByPDT)(g,b.endProgramDateTime,_)),m||!(m=Object(a.findFragmentByPTS)(b,g,p,_))&&b&&b.start<g[0].start&&(m=g[0])}else m=g[v-1];null!==(e=m)&&void 0!==e&&e.encrypted?(i.logger.log("Loading key for "+m.sn),this.state=u.State.KEY_LOADING,this.hls.trigger(r.Events.KEY_LOADING,{frag:m})):m&&this.fragmentTracker.getState(m)===c.FragmentState.NOT_LOADED&&this.loadFragment(m,s,p)}}else this.state=u.State.IDLE},b.loadFragment=function(t,n,r){this.fragCurrent=t,e.prototype.loadFragment.call(this,t,n,r)},g=m,(v=[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}])&&f(g.prototype,v),y&&f(g,y),m}(u.default)},"./src/controller/subtitle-track-controller.ts":
/*!*****************************************************!*\
!*** ./src/controller/subtitle-track-controller.ts ***!
\*****************************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),o=n(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),a=n(/*! ../types/loader */"./src/types/loader.ts");function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){var t,n;function o(t){var n;return(n=e.call(this,t,"[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=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,l(t,n);var c,h,d,f=o.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,e.prototype.destroy.call(this)},f.registerListeners=function(){var e=this.hls;e.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(r.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(r.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var e=this.hls;e.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(r.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(r.Events.ERROR,this.onError,this)},f.onMediaAttached=function(e,t){this.media=t.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(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},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(e){Object(i.clearCurrentCues)(e)})),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(e,t){this.tracks=t.subtitleTracks},f.onSubtitleTrackLoaded=function(e,t){var n=t.id,r=t.details,i=this.trackId,o=this.tracksInGroup[i];if(o){var a=o.details;o.details=t.details,this.log("subtitle track "+n+" loaded ["+r.startSN+"-"+r.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,t,a))}else this.warn("Invalid subtitle track id "+n)},f.onLevelLoading=function(e,t){this.switchLevel(t.level)},f.onLevelSwitching=function(e,t){this.switchLevel(t.level)},f.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.textGroupIds){var n=t.textGroupIds[t.urlId];if(this.groupId!==n){var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,o=this.tracks.filter((function(e){return!n||e.groupId===n}));this.tracksInGroup=o;var a=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=n;var s={subtitleTracks:o};this.log("Updating subtitle tracks, "+o.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(r.Events.SUBTITLE_TRACKS_UPDATED,s),-1!==a&&this.setSubtitleTrack(a,i)}}},f.findTrackId=function(e){for(var t=this.tracksInGroup,n=0;n<t.length;n++){var r=t[n];if((!this.selectDefaultTrack||r.default)&&(!e||e===r.name))return r.id}return-1},f.onError=function(t,n){e.prototype.onError.call(this,t,n),!n.fatal&&n.context&&n.context.type===a.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},f.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var n=t.id,i=t.groupId,o=t.url;if(e)try{o=e.addDirectives(o)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(r.Events.SUBTITLE_TRACK_LOADING,{url:o,id:n,groupId:i,deliveryDirectives:e||null})}},f.toggleTrackModes=function(e){var t=this,n=this.media,r=this.subtitleDisplay,i=this.trackId;if(n){var o=u(n.textTracks),a=o.filter((function(e){return e.groupId===t.groupId}));if(-1===e)[].slice.call(o).forEach((function(e){e.mode="disabled"}));else{var s=a[i];s&&(s.mode="disabled")}var l=a[e];l&&(l.mode=r?"showing":"hidden")}},f.setSubtitleTrack=function(e,t){var n,i=this.tracksInGroup;if(this.media){if(this.trackId!==e&&this.toggleTrackModes(e),!(this.trackId===e&&(-1===e||null!==(n=i[e])&&void 0!==n&&n.details)||e<-1||e>=i.length)){this.clearTimer();var o=i[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,o){var a=o.id,s=o.groupId,l=void 0===s?"":s,c=o.name,u=o.type,h=o.url;this.hls.trigger(r.Events.SUBTITLE_TRACK_SWITCH,{id:a,groupId:l,name:c,type:u,url:h});var d=this.switchParams(o.url,null==t?void 0:t.details);this.loadPlaylist(d)}else this.hls.trigger(r.Events.SUBTITLE_TRACK_SWITCH,{id:e})}}else this.queuedDefaultTrack=e},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var e=-1,t=u(this.media.textTracks),n=0;n<t.length;n++)if("hidden"===t[n].mode)e=n;else if("showing"===t[n].mode){e=n;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}},c=o,(h=[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}}])&&s(c.prototype,h),d&&s(c,d),o}(o.default);function u(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];"subtitles"===r.kind&&r.label&&t.push(e[n])}return t}t.default=c},"./src/controller/timeline-controller.ts":
/*!***********************************************!*\
!*** ./src/controller/timeline-controller.ts ***!
\***********************************************/
/*! exports provided: TimelineController */function(e,t,n){"use strict";n.r(t),n.d(t,"TimelineController",(function(){return d}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/cea-608-parser */"./src/utils/cea-608-parser.ts"),a=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 e(e){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=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new a.default(this,"textTrack1"),n=new a.default(this,"textTrack2"),r=new a.default(this,"textTrack3"),s=new a.default(this,"textTrack4");this.cea608Parser1=new o.default(1,t,n),this.cea608Parser2=new o.default(3,r,s)}e.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(i.Events.FRAG_LOADING,this.onFragLoading,this),e.on(i.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(i.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(i.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(i.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(i.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=e.prototype;return t.destroy=function(){var e=this.hls;e.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(i.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(i.Events.FRAG_LOADING,this.onFragLoading,this),e.off(i.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(i.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(i.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(i.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(i.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(e,t,n,r,o){for(var a,s,l,c,u=!1,h=o.length;h--;){var d=o[h],f=(a=d[0],s=d[1],l=t,c=n,Math.min(s,c)-Math.max(a,l));if(f>=0&&(d[0]=Math.min(d[0],t),d[1]=Math.max(d[1],n),u=!0,f/(n-t)>.5))return}if(u||o.push([t,n]),this.config.renderTextTracksNatively){var p=this.captionsTracks[e];this.Cues.newCue(p,t,n,r)}else{var m=this.Cues.newCue(null,t,n,r);this.hls.trigger(i.Events.CUES_PARSED,{type:"captions",cues:m,track:e})}},t.onInitPtsFound=function(e,t){var n=this,r=t.frag,o=t.id,a=t.initPTS,s=t.timescale,l=this.unparsedVttFrags;"main"===o&&(this.initPTS[r.cc]=a,this.timescale[r.cc]=s),l.length&&(this.unparsedVttFrags=[],l.forEach((function(e){n.onFragLoaded(i.Events.FRAG_LOADED,e)})))},t.getExistingTrack=function(e){var t=this.media;if(t)for(var n=0;n<t.textTracks.length;n++){var r=t.textTracks[n];if(r[e])return r}return null},t.createCaptionsTrack=function(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)},t.createNativeTrack=function(e){if(!this.captionsTracks[e]){var t=this.captionsProperties,n=this.captionsTracks,r=this.media,i=t[e],o=i.label,a=i.languageCode,s=this.getExistingTrack(e);if(s)n[e]=s,Object(l.clearCurrentCues)(n[e]),Object(l.sendAddTrackEvent)(n[e],r);else{var c=this.createTextTrack("captions",o,a);c&&(c[e]=!0,n[e]=c)}}},t.createNonNativeTrack=function(e){if(!this.nonNativeCaptionsTracks[e]){var t=this.captionsProperties[e];if(t){var n={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=n,this.hls.trigger(i.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}}},t.createTextTrack=function(e,t,n){var r=this.media;if(r)return r.addTextTrack(e,t,n)},t.onMediaAttaching=function(e,t){this.media=t.media,this._cleanTracks()},t.onMediaDetaching=function(){var e=this.captionsTracks;Object.keys(e).forEach((function(t){Object(l.clearCurrentCues)(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={}},t.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())},t._cleanTracks=function(){var e=this.media;if(e){var t=e.textTracks;if(t)for(var n=0;n<t.length;n++)Object(l.clearCurrentCues)(t[n])}},t.onSubtitleTracksUpdated=function(e,t){var n=this;this.textTracks=[];var r=t.subtitleTracks||[],o=r.some((function(e){return e.textCodec===c.IMSC1_CODEC}));if(this.config.enableWebVTT||o&&this.config.enableIMSC1){var a=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(e,t){var r;if(t<s.length){for(var i=null,o=0;o<s.length;o++)if(f(s[o],e)){i=s[o];break}i&&(r=i)}r?Object(l.clearCurrentCues)(r):(r=n.createTextTrack("subtitles",e.name,e.lang))&&(r.mode="disabled"),r&&(r.groupId=e.groupId,n.textTracks.push(r))}))}else if(!a&&this.tracks&&this.tracks.length){var u=this.tracks.map((function(e){return{label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}}));this.hls.trigger(i.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:u})}}},t.onManifestLoaded=function(e,t){var n=this;this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((function(e){var t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(t){var r="textTrack"+t[1],i=n.captionsProperties[r];i&&(i.label=e.name,e.lang&&(i.languageCode=e.lang),i.media=e)}}))},t.onFragLoading=function(e,t){var n=this.cea608Parser1,r=this.cea608Parser2,i=this.lastSn,o=this.lastPartIndex;if(this.enabled&&n&&r&&t.frag.type===u.PlaylistLevelType.MAIN){var a,s,l=t.frag.sn,c=null!=(a=null==t||null===(s=t.part)||void 0===s?void 0:s.index)?a:-1;l===i+1||l===i&&c===o+1||(n.reset(),r.reset()),this.lastSn=l,this.lastPartIndex=c}},t.onFragLoaded=function(e,t){var n=t.frag,o=t.payload,a=this.initPTS,s=this.unparsedVttFrags;if(n.type===u.PlaylistLevelType.SUBTITLE)if(o.byteLength){if(!Object(r.isFiniteNumber)(a[n.cc]))return s.push(t),void(a.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,o):this._parseVTTs(n,o,d)}}else this.hls.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(e,t){var n=this,r=this.hls;Object(c.parseIMSC1)(t,this.initPTS[e.cc],this.timescale[e.cc],(function(t){n._appendCues(t,e.level),r.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(function(t){h.logger.log("Failed to parse IMSC1: "+t),r.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))},t._parseVTTs=function(e,t,n){var r=this,o=this.hls;Object(s.parseWebVTT)(t,this.initPTS[e.cc],this.timescale[e.cc],n,e.cc,e.start,(function(t){r._appendCues(t,e.level),o.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(function(n){r._fallbackToIMSC1(e,t),h.logger.log("Failed to parse VTT cue: "+n),o.trigger(i.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:n})}))},t._fallbackToIMSC1=function(e,t){var n=this,r=this.tracks[e.level];r.textCodec||Object(c.parseIMSC1)(t,this.initPTS[e.cc],this.timescale[e.cc],(function(){r.textCodec=c.IMSC1_CODEC,n._parseIMSC1(e,t)}),(function(){r.textCodec="wvtt"}))},t._appendCues=function(e,t){var n=this.hls;if(this.config.renderTextTracksNatively){var r=this.textTracks[t];if("disabled"===r.mode)return;e.forEach((function(e){return Object(l.addCueToTrack)(r,e)}))}else{var o=this.tracks[t].default?"default":"subtitles"+t;n.trigger(i.Events.CUES_PARSED,{type:"subtitles",cues:e,track:o})}},t.onFragDecrypted=function(e,t){var n=t.frag;if(n.type===u.PlaylistLevelType.SUBTITLE){if(!Object(r.isFiniteNumber)(this.initPTS[n.cc]))return void this.unparsedVttFrags.push(t);this.onFragLoaded(i.Events.FRAG_LOADED,t)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(e,t){var n=this.cea608Parser1,r=this.cea608Parser2;if(this.enabled&&n&&r)for(var i=0;i<t.samples.length;i++){var o=t.samples[i].bytes;if(o){var a=this.extractCea608Data(o);n.addData(t.samples[i].pts,a[0]),r.addData(t.samples[i].pts,a[1])}}},t.onBufferFlushing=function(e,t){var n=t.startOffset,r=t.endOffset,i=t.endOffsetSubtitles,o=t.type,a=this.media;if(a&&!(a.currentTime<r)){if(!o||"video"===o){var s=this.captionsTracks;Object.keys(s).forEach((function(e){return Object(l.removeCuesInRange)(s[e],n,r)}))}if(this.config.renderTextTracksNatively&&0===n&&void 0!==i){var c=this.textTracks;Object.keys(c).forEach((function(e){return Object(l.removeCuesInRange)(c[e],n,i)}))}}},t.extractCea608Data=function(e){for(var t=31&e[0],n=2,r=[[],[]],i=0;i<t;i++){var o=e[n++],a=127&e[n++],s=127&e[n++],l=3&o;0===a&&0===s||0!=(4&o)&&(0!==l&&1!==l||(r[l].push(a),r[l].push(s)))}return r},e}();function f(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}},"./src/crypt/aes-crypto.ts":
/*!*********************************!*\
!*** ./src/crypt/aes-crypto.ts ***!
\*********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return r}));var r=function(){function e(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}return e.prototype.decrypt=function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)},e}()},"./src/crypt/aes-decryptor.ts":
/*!************************************!*\
!*** ./src/crypt/aes-decryptor.ts ***!
\************************************/
/*! exports provided: removePadding, default */function(e,t,n){"use strict";n.r(t),n.d(t,"removePadding",(function(){return i})),n.d(t,"default",(function(){return o}));var r=n(/*! ../utils/typed-array */"./src/utils/typed-array.ts");function i(e){var t=e.byteLength,n=t&&new DataView(e.buffer).getUint8(t-1);return n?Object(r.sliceUint8)(e,0,t-n):e}var o=function(){function e(){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 t=e.prototype;return t.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),n=new Uint32Array(4),r=0;r<4;r++)n[r]=t.getUint32(4*r);return n},t.initTable=function(){var e=this.sBox,t=this.invSBox,n=this.subMix,r=n[0],i=n[1],o=n[2],a=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,m=0;for(m=0;m<256;m++)d[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,e[f]=g,t[g]=f;var v=d[f],y=d[v],b=d[y],_=257*d[g]^16843008*g;r[f]=_<<24|_>>>8,i[f]=_<<16|_>>>16,o[f]=_<<8|_>>>24,a[f]=_,_=16843009*b^65537*y^257*v^16843008*f,l[g]=_<<24|_>>>8,c[g]=_<<16|_>>>16,u[g]=_<<8|_>>>24,h[g]=_,f?(f=v^d[d[d[b^v]]],p^=d[d[p]]):f=p=1}},t.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),n=!0,r=0;r<t.length&&n;)n=t[r]===this.key[r],r++;if(!n){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var o,a,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,m=p[0],g=p[1],v=p[2],y=p[3];for(o=0;o<c;o++)o<i?s=u[o]=t[o]:(l=s,o%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[o/i|0]<<24):i>6&&o%i==4&&(l=d[l>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[255&l]),u[o]=s=(u[o-i]^l)>>>0);for(a=0;a<c;a++)o=c-a,l=3&a?u[o]:u[o-4],h[a]=a<4||o<=4?l:m[d[l>>>24]]^g[d[l>>>16&255]]^v[d[l>>>8&255]]^y[d[255&l]],h[a]=h[a]>>>0}},t.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},t.decrypt=function(e,t,n){for(var r,i,o,a,s,l,c,u,h,d,f,p,m,g,v=this.keySize+6,y=this.invKeySchedule,b=this.invSBox,_=this.invSubMix,E=_[0],x=_[1],w=_[2],S=_[3],k=this.uint8ArrayToUint32Array_(n),C=k[0],T=k[1],O=k[2],A=k[3],L=new Int32Array(e),R=new Int32Array(L.length),D=this.networkToHostOrderSwap;t<L.length;){for(h=D(L[t]),d=D(L[t+1]),f=D(L[t+2]),p=D(L[t+3]),s=h^y[0],l=p^y[1],c=f^y[2],u=d^y[3],m=4,g=1;g<v;g++)r=E[s>>>24]^x[l>>16&255]^w[c>>8&255]^S[255&u]^y[m],i=E[l>>>24]^x[c>>16&255]^w[u>>8&255]^S[255&s]^y[m+1],o=E[c>>>24]^x[u>>16&255]^w[s>>8&255]^S[255&l]^y[m+2],a=E[u>>>24]^x[s>>16&255]^w[l>>8&255]^S[255&c]^y[m+3],s=r,l=i,c=o,u=a,m+=4;r=b[s>>>24]<<24^b[l>>16&255]<<16^b[c>>8&255]<<8^b[255&u]^y[m],i=b[l>>>24]<<24^b[c>>16&255]<<16^b[u>>8&255]<<8^b[255&s]^y[m+1],o=b[c>>>24]<<24^b[u>>16&255]<<16^b[s>>8&255]<<8^b[255&l]^y[m+2],a=b[u>>>24]<<24^b[s>>16&255]<<16^b[l>>8&255]<<8^b[255&c]^y[m+3],R[t]=D(r^C),R[t+1]=D(a^T),R[t+2]=D(o^O),R[t+3]=D(i^A),C=h,T=d,O=f,A=p,t+=4}return R.buffer},e}()},"./src/crypt/decrypter.ts":
/*!********************************!*\
!*** ./src/crypt/decrypter.ts ***!
\********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"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"),o=n(/*! ./aes-decryptor */"./src/crypt/aes-decryptor.ts"),a=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 e(e,t,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=e,this.config=t,this.removePKCS7Padding=i,i)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(e){}null===this.subtle&&(this.config.enableSoftwareAES=!0)}var t=e.prototype;return t.destroy=function(){this.observer=null},t.isSync=function(){return this.config.enableSoftwareAES},t.flush=function(){var e=this.currentResult;if(e){var t=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Object(o.removePadding)(t):t}this.reset()},t.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},t.decrypt=function(e,t,n,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(e),t,n);var i=this.flush();i&&r(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(e),t,n).then(r)},t.softwareDecrypt=function(e,t,n){var r=this.currentIV,i=this.currentResult,a=this.remainderData;this.logOnce("JS AES decrypt"),a&&(e=Object(s.appendUint8Array)(a,e),this.remainderData=null);var c=this.getValidChunk(e);if(!c.length)return null;r&&(n=r);var u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new o.default),u.expandKey(t);var h=i;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=Object(l.sliceUint8)(c,-16).buffer,h||null},t.webCryptoDecrypt=function(e,t,n){var o=this,a=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new i.default(a,t)),this.fastAesKey.expandKey().then((function(t){return a?new r.default(a,n).decrypt(e.buffer,t):Promise.reject(new Error("web crypto not initialized"))})).catch((function(r){return o.onWebCryptoError(r,e,t,n)}))},t.onWebCryptoError=function(e,t,n,r){return a.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",e),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(t,n,r)},t.getValidChunk=function(e){var t=e,n=e.length-e.length%16;return n!==e.length&&(t=Object(l.sliceUint8)(e,0,n),this.remainderData=Object(l.sliceUint8)(e,n)),t},t.logOnce=function(e){this.logEnabled&&(a.logger.log("[decrypter.ts]: "+e),this.logEnabled=!1)},e}()},"./src/crypt/fast-aes-key.ts":
/*!***********************************!*\
!*** ./src/crypt/fast-aes-key.ts ***!
\***********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return r}));var r=function(){function e(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}return e.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},e}()},"./src/demux/aacdemuxer.ts":
/*!*********************************!*\
!*** ./src/demux/aacdemuxer.ts ***!
\*********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),i=n(/*! ./adts */"./src/demux/adts.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! ../demux/id3 */"./src/demux/id3.ts");function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=function(e){var t,n;function r(t,n){var r;return(r=e.call(this)||this).observer=void 0,r.config=void 0,r.observer=t,r.config=n,r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n);var l=r.prototype;return l.resetInitSegment=function(t,n,r){e.prototype.resetInitSegment.call(this,t,n,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}},r.probe=function(e){if(!e)return!1;for(var t=(a.getID3Data(e,0)||[]).length,n=e.length;t<n;t++)if(i.probe(e,t))return o.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(e,t){return i.canParse(e,t)},l.appendFrame=function(e,t,n){i.initTrackConfig(e,this.observer,t,n,e.manifestCodec);var r=i.appendFrame(e,t,n,this.initPTS,this.frameIndex);if(r&&0===r.missing)return r},r}(r.default);l.minProbeByteLength=9,t.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(e,t,n){"use strict";n.r(t),n.d(t,"getAudioConfig",(function(){return a})),n.d(t,"isHeaderPattern",(function(){return s})),n.d(t,"getHeaderLength",(function(){return l})),n.d(t,"getFullFrameLength",(function(){return c})),n.d(t,"canGetFrameLength",(function(){return u})),n.d(t,"isHeader",(function(){return h})),n.d(t,"canParse",(function(){return d})),n.d(t,"probe",(function(){return f})),n.d(t,"initTrackConfig",(function(){return p})),n.d(t,"getFrameDuration",(function(){return m})),n.d(t,"parseFrameHeader",(function(){return g})),n.d(t,"appendFrame",(function(){return v}));var r=n(/*! ../utils/logger */"./src/utils/logger.ts"),i=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../events */"./src/events.ts");function a(e,t,n,a){var s,l,c,u,h=navigator.userAgent.toLowerCase(),d=a,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&t[n+2])>>>6);var p=(60&t[n+2])>>>2;if(!(p>f.length-1))return c=(1&t[n+2])<<2,c|=(192&t[n+3])>>>6,r.logger.log("manifest codec:"+a+", 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),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&p>=6?l=p-3:((a&&-1!==a.indexOf("mp4a.40.2")&&(p>=6&&1===c||/vivaldi/i.test(h))||!a&&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};e.trigger(o.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+p})}function s(e,t){return 255===e[t]&&240==(246&e[t+1])}function l(e,t){return 1&e[t+1]?7:9}function c(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function u(e,t){return t+5<e.length}function h(e,t){return t+1<e.length&&s(e,t)}function d(e,t){return u(e,t)&&s(e,t)&&c(e,t)<=e.length-t}function f(e,t){if(h(e,t)){var n=l(e,t);if(t+n>=e.length)return!1;var r=c(e,t);if(r<=n)return!1;var i=t+r;return i===e.length||h(e,i)}return!1}function p(e,t,n,i,o){if(!e.samplerate){var s=a(t,n,i,o);if(!s)return;e.config=s.config,e.samplerate=s.samplerate,e.channelCount=s.channelCount,e.codec=s.codec,e.manifestCodec=s.manifestCodec,r.logger.log("parsed codec:"+e.codec+", rate:"+s.samplerate+", channels:"+s.channelCount)}}function m(e){return 9216e4/e}function g(e,t,n,r,i){var o=l(e,t),a=c(e,t);if((a-=o)>0)return{headerLength:o,frameLength:a,stamp:n+r*i}}function v(e,t,n,r,i){var o=g(t,n,r,i,m(e.samplerate));if(o){var a,s=o.frameLength,l=o.headerLength,c=o.stamp,u=l+s,h=Math.max(0,n+u-t.length);h?(a=new Uint8Array(u-l)).set(t.subarray(n+l,t.length),0):a=t.subarray(n+l,n+u);var d={unit:a,pts:c};return h||e.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(e,t,n){"use strict";n.r(t),n.d(t,"initPTSFn",(function(){return c}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../demux/id3 */"./src/demux/id3.ts"),o=n(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),a=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),s=n(/*! ../utils/typed-array */"./src/utils/typed-array.ts"),l=function(){function e(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var t=e.prototype;return t.resetInitSegment=function(e,t,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},t.resetTimeStamp=function(){},t.resetContiguity=function(){},t.canParse=function(e,t){return!1},t.appendFrame=function(e,t,n){},t.demux=function(e,t){this.cachedData&&(e=Object(a.appendUint8Array)(this.cachedData,e),this.cachedData=null);var n,r,l=i.getID3Data(e,0),u=l?l.length:0,h=this._audioTrack,d=this._id3Track,f=l?i.getTimeStamp(l):void 0,p=e.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=c(f,t)),l&&l.length>0&&d.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),r=this.initPTS;u<p;){if(this.canParse(e,u)){var m=this.appendFrame(h,e,u);m?(this.frameIndex++,r=m.sample.pts,n=u+=m.length):u=p}else i.canParse(e,u)?(l=i.getID3Data(e,u),d.samples.push({pts:r,dts:r,data:l}),n=u+=l.length):u++;if(u===p&&n!==p){var g=Object(s.sliceUint8)(e,n);this.cachedData?this.cachedData=Object(a.appendUint8Array)(this.cachedData,g):this.cachedData=g}}return{audioTrack:h,avcTrack:Object(o.dummyTrack)(),id3Track:d,textTrack:Object(o.dummyTrack)()}},t.demuxSampleAes=function(e,t,n){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},t.flush=function(e){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(o.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(o.dummyTrack)()}},t.destroy=function(){},e}(),c=function(e,t){return Object(r.isFiniteNumber)(e)?90*e:9e4*t};t.default=l},"./src/demux/chunk-cache.ts":
/*!**********************************!*\
!*** ./src/demux/chunk-cache.ts ***!
\**********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return r}));var r=function(){function e(){this.chunks=[],this.dataLength=0}var t=e.prototype;return t.push=function(e){this.chunks.push(e),this.dataLength+=e.length},t.flush=function(){var e,t=this.chunks,n=this.dataLength;return t.length?(e=1===t.length?t[0]:function(e,t){for(var n=new Uint8Array(t),r=0,i=0;i<e.length;i++){var o=e[i];n.set(o,r),r+=o.length}return n}(t,n),this.reset(),e):new Uint8Array(0)},t.reset=function(){this.chunks.length=0,this.dataLength=0},e}()},"./src/demux/dummy-demuxed-track.ts":
/*!******************************************!*\
!*** ./src/demux/dummy-demuxed-track.ts ***!
\******************************************/
/*! exports provided: dummyTrack */function(e,t,n){"use strict";function r(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}n.r(t),n.d(t,"dummyTrack",(function(){return r}))},"./src/demux/exp-golomb.ts":
/*!*********************************!*\
!*** ./src/demux/exp-golomb.ts ***!
\*********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../utils/logger */"./src/utils/logger.ts"),i=function(){function e(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}var t=e.prototype;return t.loadWord=function(){var e=this.data,t=this.bytesAvailable,n=e.byteLength-t,r=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");r.set(e.subarray(n,n+i)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i},t.skipBits=function(e){var t;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},t.readBits=function(e){var t=Math.min(this.bitsAvailable,e),n=this.word>>>32-t;return e>32&&r.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?n<<t|this.readBits(t):n},t.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},t.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.skipEG=function(){this.skipBits(1+this.skipLZ())},t.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},t.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},t.readBoolean=function(){return 1===this.readBits(1)},t.readUByte=function(){return this.readBits(8)},t.readUShort=function(){return this.readBits(16)},t.readUInt=function(){return this.readBits(32)},t.skipScalingList=function(e){for(var t=8,n=8,r=0;r<e;r++)0!==n&&(n=(t+this.readEG()+256)%256),t=0===n?t:n},t.readSPS=function(){var e,t,n,r=0,i=0,o=0,a=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 m=s();if(l(5),h(3),s(),f(),100===m||110===m||122===m||244===m||44===m||83===m||86===m||118===m||128===m){var g=c();if(3===g&&h(1),f(),f(),h(1),u())for(t=3!==g?8:12,n=0;n<t;n++)u()&&p(n<6?16:64)}f();var v=c();if(0===v)c();else if(1===v)for(h(1),d(),d(),e=c(),n=0;n<e;n++)d();f(),h(1);var y=c(),b=c(),_=l(1);0===_&&h(1),h(1),u()&&(r=c(),i=c(),o=c(),a=c());var E=[1,1];if(u()&&u())switch(s()){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:E=[s()<<8|s(),s()<<8|s()]}return{width:Math.ceil(16*(y+1)-2*r-2*i),height:(2-_)*(b+1)*16-(_?2:4)*(o+a),pixelRatio:E}},t.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},e}();t.default=i},"./src/demux/id3.ts":
/*!**************************!*\
!*** ./src/demux/id3.ts ***!
\**************************/
/*! exports provided: isHeader, isFooter, getID3Data, canParse, getTimeStamp, isTimeStampFrame, getID3Frames, decodeFrame, utf8ArrayToStr, testables */function(e,t,n){"use strict";n.r(t),n.d(t,"isHeader",(function(){return i})),n.d(t,"isFooter",(function(){return o})),n.d(t,"getID3Data",(function(){return a})),n.d(t,"canParse",(function(){return l})),n.d(t,"getTimeStamp",(function(){return c})),n.d(t,"isTimeStampFrame",(function(){return u})),n.d(t,"getID3Frames",(function(){return d})),n.d(t,"decodeFrame",(function(){return f})),n.d(t,"utf8ArrayToStr",(function(){return y})),n.d(t,"testables",(function(){return b}));var r,i=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},o=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},a=function(e,t){for(var n=t,r=0;i(e,t);)r+=10,r+=s(e,t+6),o(e,t+10)&&(r+=10),t+=r;if(r>0)return e.subarray(n,n+r)},s=function(e,t){var n=0;return n=(127&e[t])<<21,n|=(127&e[t+1])<<14,n|=(127&e[t+2])<<7,n|=127&e[t+3]},l=function(e,t){return i(e,t)&&s(e,t+6)+10<=e.length-t},c=function(e){for(var t=d(e),n=0;n<t.length;n++){var r=t[n];if(u(r))return v(r)}},u=function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info},h=function(e){var t=String.fromCharCode(e[0],e[1],e[2],e[3]),n=s(e,4);return{type:t,size:n,data:e.subarray(10,10+n)}},d=function(e){for(var t=0,n=[];i(e,t);){for(var r=s(e,t+6),a=(t+=10)+r;t+8<a;){var l=h(e.subarray(t)),c=f(l);c&&n.push(c),t+=l.size+10}o(e,t)&&(t+=10)}return n},f=function(e){return"PRIV"===e.type?p(e):"W"===e.type[0]?g(e):m(e)},p=function(e){if(!(e.size<2)){var t=y(e.data,!0),n=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:n.buffer}}},m=function(e){if(!(e.size<2)){if("TXXX"===e.type){var t=1,n=y(e.data.subarray(t),!0);t+=n.length+1;var r=y(e.data.subarray(t));return{key:e.type,info:n,data:r}}var i=y(e.data.subarray(1));return{key:e.type,data:i}}},g=function(e){if("WXXX"===e.type){if(e.size<2)return;var t=1,n=y(e.data.subarray(t),!0);t+=n.length+1;var r=y(e.data.subarray(t));return{key:e.type,info:n,data:r}}var i=y(e.data);return{key:e.type,data:i}},v=function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),n=1&t[3],r=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return r/=45,n&&(r+=47721858.84),Math.round(r)}},y=function(e,t){void 0===t&&(t=!1);var n=_();if(n){var r=n.decode(e);if(t){var i=r.indexOf("\0");return-1!==i?r.substring(0,i):r}return r.replace(/\0/g,"")}for(var o,a,s,l=e.length,c="",u=0;u<l;){if(0===(o=e[u++])&&t)return c;if(0!==o&&3!==o)switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(o);break;case 12:case 13:a=e[u++],c+=String.fromCharCode((31&o)<<6|63&a);break;case 14:a=e[u++],s=e[u++],c+=String.fromCharCode((15&o)<<12|(63&a)<<6|(63&s)<<0)}}return c},b={decodeTextFrame:m};function _(){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(e,t,n){"use strict";n.r(t);var r=n(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),i=n(/*! ../demux/id3 */"./src/demux/id3.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! ./mpegaudio */"./src/demux/mpegaudio.ts");function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,s(t,n);var l=r.prototype;return l.resetInitSegment=function(t,n,r){e.prototype.resetInitSegment.call(this,t,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}},r.probe=function(e){if(!e)return!1;for(var t=(i.getID3Data(e,0)||[]).length,n=e.length;t<n;t++)if(a.probe(e,t))return o.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(e,t){return a.canParse(e,t)},l.appendFrame=function(e,t,n){if(null!==this.initPTS)return a.appendFrame(e,t,n,this.initPTS,this.frameIndex)},r}(r.default);l.minProbeByteLength=4,t.default=l},"./src/demux/mp4demuxer.ts":
/*!*********************************!*\
!*** ./src/demux/mp4demuxer.ts ***!
\*********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),i=n(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),o=function(){function e(e,t){this.remainderData=null,this.config=void 0,this.config=t}var t=e.prototype;return t.resetTimeStamp=function(){},t.resetInitSegment=function(){},t.resetContiguity=function(){},e.probe=function(e){return Object(r.findBox)({data:e,start:0,end:Math.min(e.length,16384)},["moof"]).length>0},t.demux=function(e){var t=e,n=Object(i.dummyTrack)();if(this.config.progressive){this.remainderData&&(t=Object(r.appendUint8Array)(this.remainderData,e));var o=Object(r.segmentValidRange)(t);this.remainderData=o.remainder,n.samples=o.valid||new Uint8Array}else n.samples=t;return{audioTrack:Object(i.dummyTrack)(),avcTrack:n,id3Track:Object(i.dummyTrack)(),textTrack:Object(i.dummyTrack)()}},t.flush=function(){var e=Object(i.dummyTrack)();return e.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(i.dummyTrack)(),avcTrack:e,id3Track:Object(i.dummyTrack)(),textTrack:Object(i.dummyTrack)()}},t.demuxSampleAes=function(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy=function(){},e}();o.minProbeByteLength=1024,t.default=o},"./src/demux/mpegaudio.ts":
/*!********************************!*\
!*** ./src/demux/mpegaudio.ts ***!
\********************************/
/*! exports provided: appendFrame, parseHeader, isHeaderPattern, isHeader, canParse, probe */function(e,t,n){"use strict";n.r(t),n.d(t,"appendFrame",(function(){return l})),n.d(t,"parseHeader",(function(){return c})),n.d(t,"isHeaderPattern",(function(){return u})),n.d(t,"isHeader",(function(){return h})),n.d(t,"canParse",(function(){return d})),n.d(t,"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],o=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],a=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],s=[0,1,1,4];function l(e,t,n,r,i){if(!(n+24>t.length)){var o=c(t,n);if(o&&n+o.frameLength<=t.length){var a=r+i*(9e4*o.samplesPerFrame/o.sampleRate),s={unit:t.subarray(n,n+o.frameLength),pts:a,dts:a};return e.config=[],e.channelCount=o.channelCount,e.samplerate=o.sampleRate,e.samples.push(s),{sample:s,length:o.frameLength,missing:0}}}}function c(e,t){var n=e[t+1]>>3&3,l=e[t+1]>>1&3,c=e[t+2]>>4&15,u=e[t+2]>>2&3;if(1!==n&&0!==c&&15!==c&&3!==u){var h=e[t+2]>>1&1,d=e[t+3]>>6,f=1e3*i[14*(3===n?3-l:3===l?3:4)+c-1],p=o[3*(3===n?0:2===n?1:2)+u],m=3===d?1:2,g=a[n][l],v=s[l],y=8*g*v,b=Math.floor(g*f/p+h)*v;if(null===r){var _=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);r=_?parseInt(_[1]):0}return!!r&&r<=87&&2===l&&f>=224e3&&0===d&&(e[t+3]=128|e[t+3]),{sampleRate:p,channelCount:m,frameLength:b,samplesPerFrame:y}}}function u(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function h(e,t){return t+1<e.length&&u(e,t)}function d(e,t){return u(e,t)&&4<=e.length-t}function f(e,t){if(t+1<e.length&&u(e,t)){var n=c(e,t),r=4;null!=n&&n.frameLength&&(r=n.frameLength);var i=t+r;return i===e.length||h(e,i)}return!1}},"./src/demux/sample-aes.ts":
/*!*********************************!*\
!*** ./src/demux/sample-aes.ts ***!
\*********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),i=n(/*! ./tsdemuxer */"./src/demux/tsdemuxer.ts"),o=function(){function e(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new r.default(e,t,{removePKCS7Padding:!1})}var t=e.prototype;return t.decryptBuffer=function(e,t){this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,t)},t.decryptAacSample=function(e,t,n,r){var i=e[t].unit,o=i.subarray(16,i.length-i.length%16),a=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),s=this;this.decryptBuffer(a,(function(o){var a=new Uint8Array(o);i.set(a,16),r||s.decryptAacSamples(e,t+1,n)}))},t.decryptAacSamples=function(e,t,n){for(;;t++){if(t>=e.length)return void n();if(!(e[t].unit.length<32)){var r=this.decrypter.isSync();if(this.decryptAacSample(e,t,n,r),!r)return}}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,n=new Int8Array(t),r=0,i=32;i<=e.length-16;i+=160,r+=16)n.set(e.subarray(i,i+16),r);return n},t.getAvcDecryptedUnit=function(e,t){for(var n=new Uint8Array(t),r=0,i=32;i<=e.length-16;i+=160,r+=16)e.set(n.subarray(r,r+16),i);return e},t.decryptAvcSample=function(e,t,n,r,o,a){var s=Object(i.discardEPB)(o.data),l=this.getAvcEncryptedData(s),c=this;this.decryptBuffer(l.buffer,(function(i){o.data=c.getAvcDecryptedUnit(s,i),a||c.decryptAvcSamples(e,t,n+1,r)}))},t.decryptAvcSamples=function(e,t,n,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length)return void r();for(var i=e[t].units;!(n>=i.length);n++){var o=i[n];if(!(o.data.length<=48||1!==o.type&&5!==o.type)){var a=this.decrypter.isSync();if(this.decryptAvcSample(e,t,n,r,o,a),!a)return}}}},e}();t.default=o},"./src/demux/transmuxer-interface.ts":
/*!*******************************************!*\
!*** ./src/demux/transmuxer-interface.ts ***!
\*******************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return h}));var r=n(/*! webworkify-webpack */"./node_modules/webworkify-webpack/index.js"),i=n(/*! ../events */"./src/events.ts"),o=n(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),a=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 e(e,t,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=e,this.id=t,this.onTransmuxComplete=n,this.onFlush=l;var d=e.config,f=function(t,n){(n=n||{}).frag=h.frag,n.id=h.id,e.trigger(t,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"')},m=navigator.vendor;if(d.enableWorker&&"undefined"!=typeof Worker){var g;a.logger.log("demuxing in webworker");try{g=this.worker=r(/*! ../demux/transmuxer-worker.ts */"./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(t){e.trigger(i.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(t.message+" ("+t.filename+":"+t.lineno+")")})},g.postMessage({cmd:"init",typeSupported:p,vendor:m,id:t,config:JSON.stringify(d)})}catch(e){a.logger.warn("Error in worker:",e),a.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new o.default(this.observer,p,d,m,t),this.worker=null}}else this.transmuxer=new o.default(this.observer,p,d,m,t)}var t=e.prototype;return t.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},t.push=function(e,t,n,r,i,s,l,c,u,h){var d=this;u.transmuxing.start=self.performance.now();var f=this.transmuxer,p=this.worker,m=s?s.start:i.start,g=i.decryptdata,v=this.frag,y=!(v&&i.cc===v.cc),b=!(v&&u.level===v.level),_=v?u.sn-v.sn:-1,E=this.part?u.part-this.part.index:1,x=!b&&(1===_||0===_&&1===E),w=self.performance.now();(b||_||0===i.stats.parsing.start)&&(i.stats.parsing.start=w),!s||!E&&x||(s.stats.parsing.start=w);var S=new o.TransmuxState(y,x,c,b,m);if(!x||y){a.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: "+x+"\n accurateTimeOffset: "+c+"\n timeOffset: "+m);var k=new o.TransmuxConfig(n,r,t,l,h);this.configureTransmuxer(k)}if(this.frag=i,this.part=s,p)p.postMessage({cmd:"demux",data:e,decryptdata:g,chunkMeta:u,state:S},e instanceof ArrayBuffer?[e]:[]);else if(f){var C=f.push(e,g,u,S);Object(o.isPromise)(C)?C.then((function(e){d.handleTransmuxComplete(e)})):this.handleTransmuxComplete(C)}},t.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var n=this.transmuxer,r=this.worker;if(r)r.postMessage({cmd:"flush",chunkMeta:e});else if(n){var i=n.flush(e);Object(o.isPromise)(i)?i.then((function(n){t.handleFlushResult(n,e)})):this.handleFlushResult(i,e)}},t.handleFlushResult=function(e,t){var n=this;e.forEach((function(e){n.handleTransmuxComplete(e)})),this.onFlush(t)},t.onWorkerMessage=function(e){var t=e.data,n=this.hls;switch(t.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,n.trigger(t.event,t.data)}},t.configureTransmuxer=function(e){var t=this.worker,n=this.transmuxer;t?t.postMessage({cmd:"configure",config:e}):n&&n.configure(e)},t.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},e}()},"./src/demux/transmuxer-worker.ts":
/*!****************************************!*\
!*** ./src/demux/transmuxer-worker.ts ***!
\****************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return s}));var r=n(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),i=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! eventemitter3 */"./node_modules/eventemitter3/index.js");function s(e){var t=new a.EventEmitter,n=function(t,n){e.postMessage({event:t,data:n})};t.on(i.Events.FRAG_DECRYPTED,n),t.on(i.Events.ERROR,n),e.addEventListener("message",(function(i){var a=i.data;switch(a.cmd){case"init":var s=JSON.parse(a.config);e.transmuxer=new r.default(t,a.typeSupported,s,a.vendor,a.id),Object(o.enableLogs)(s.debug),n("init",null);break;case"configure":e.transmuxer.configure(a.config);break;case"demux":var c=e.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(r.isPromise)(c)?c.then((function(t){l(e,t)})):l(e,c);break;case"flush":var h=a.chunkMeta,d=e.transmuxer.flush(h);Object(r.isPromise)(d)?d.then((function(t){u(e,t,h)})):u(e,d,h)}}))}function l(e,t){if((n=t.remuxResult).audio||n.video||n.text||n.id3||n.initSegment){var n,r=[],i=t.remuxResult,o=i.audio,a=i.video;o&&c(r,o),a&&c(r,a),e.postMessage({event:"transmuxComplete",data:t},r)}}function c(e,t){t.data1&&e.push(t.data1.buffer),t.data2&&e.push(t.data2.buffer)}function u(e,t,n){t.forEach((function(t){l(e,t)})),e.postMessage({event:"flush",data:n})}},"./src/demux/transmuxer.ts":
/*!*********************************!*\
!*** ./src/demux/transmuxer.ts ***!
\*********************************/
/*! exports provided: default, isPromise, TransmuxConfig, TransmuxState */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return y})),n.d(t,"isPromise",(function(){return _})),n.d(t,"TransmuxConfig",(function(){return E})),n.d(t,"TransmuxState",(function(){return x}));var r,i=n(/*! ../events */"./src/events.ts"),o=n(/*! ../errors */"./src/errors.ts"),a=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"),m=n(/*! ../utils/logger */"./src/utils/logger.ts");try{r=self.performance.now.bind(self.performance)}catch(e){m.logger.debug("Unable to use Performance API on this environment"),r=self.Date.now}var g=[{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;g.forEach((function(e){var t=e.demux;v=Math.max(v,t.minProbeByteLength)}));var y=function(){function e(e,t,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=e,this.typeSupported=t,this.config=n,this.vendor=r,this.id=i}var t=e.prototype;return t.configure=function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()},t.push=function(e,t,n,i){var o=this,a=n.transmuxing;a.executeStart=r();var s=new Uint8Array(e),l=this.cache,c=this.config,u=this.currentTransmuxState,h=this.transmuxConfig;i&&(this.currentTransmuxState=i);var d=function(e,t){var n=null;return e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(n=t),n}(s,t);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(e){var t=o.push(e,null,n);return o.decryptionPromise=null,t})),this.decryptionPromise;var m=f.softwareDecrypt(s,d.key.buffer,d.iv.buffer);if(!m)return a.executeEnd=r(),b(n);s=new Uint8Array(m)}var g=i||u,v=g.contiguous,y=g.discontinuity,_=g.trackSwitch,E=g.accurateTimeOffset,x=g.timeOffset,w=h.audioCodec,S=h.videoCodec,k=h.defaultInitPts,C=h.duration,T=h.initSegmentData;if((y||_)&&this.resetInitSegment(T,w,S,C),y&&this.resetInitialTimestamp(k),v||this.resetContiguity(),this.needsProbing(s,y,_)){if(l.dataLength){var O=l.flush();s=Object(p.appendUint8Array)(O,s)}this.configureTransmuxer(s,h)}var A=this.transmux(s,d,x,E,n),L=this.currentTransmuxState;return L.contiguous=!0,L.discontinuity=!1,L.trackSwitch=!1,a.executeEnd=r(),A},t.flush=function(e){var t=this,n=e.transmuxing;n.executeStart=r();var a=this.decrypter,s=this.cache,l=this.currentTransmuxState,c=this.decryptionPromise;if(c)return c.then((function(){return t.flush(e)}));var u=[],h=l.timeOffset;if(a){var d=a.flush();d&&u.push(this.push(d,null,e))}var f=s.dataLength;s.reset();var p=this.demuxer,m=this.remuxer;if(!p||!m)return f>=v&&this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),n.executeEnd=r(),[b(e)];var g=p.flush(h);return _(g)?g.then((function(n){return t.flushRemux(u,n,e),u})):(this.flushRemux(u,g,e),u)},t.flushRemux=function(e,t,n){var i=t.audioTrack,o=t.avcTrack,a=t.id3Track,s=t.textTrack,l=this.currentTransmuxState,c=l.accurateTimeOffset,u=l.timeOffset;m.logger.log("[transmuxer.ts]: Flushed fragment "+n.sn+(n.part>-1?" p: "+n.part:"")+" of level "+n.level);var h=this.remuxer.remux(i,o,a,s,u,c,!0,this.id);e.push({remuxResult:h,chunkMeta:n}),n.transmuxing.executeEnd=r()},t.resetInitialTimestamp=function(e){var t=this.demuxer,n=this.remuxer;t&&n&&(t.resetTimeStamp(e),n.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,n,r){var i=this.demuxer,o=this.remuxer;i&&o&&(i.resetInitSegment(t,n,r),o.resetInitSegment(e,t,n))},t.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},t.transmux=function(e,t,n,r,i){return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,n,r,i):this.transmuxUnencrypted(e,n,r,i)},t.transmuxUnencrypted=function(e,t,n,r){var i=this.demuxer.demux(e,t,!1,!this.config.progressive),o=i.audioTrack,a=i.avcTrack,s=i.id3Track,l=i.textTrack;return{remuxResult:this.remuxer.remux(o,a,s,l,t,n,!1,this.id),chunkMeta:r}},t.transmuxSampleAes=function(e,t,n,r,i){var o=this;return this.demuxer.demuxSampleAes(e,t,n).then((function(e){return{remuxResult:o.remuxer.remux(e.audioTrack,e.avcTrack,e.id3Track,e.textTrack,n,r,!1,o.id),chunkMeta:i}}))},t.configureTransmuxer=function(e,t){for(var n,r=this.config,i=this.observer,o=this.typeSupported,a=this.vendor,s=t.audioCodec,c=t.defaultInitPts,u=t.duration,h=t.initSegmentData,f=t.videoCodec,p=0,v=g.length;p<v;p++)if(g[p].demux.probe(e)){n=g[p];break}n||(m.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,_=n.remux,E=n.demux;b&&b instanceof _||(this.remuxer=new _(i,r,o,a)),y&&y instanceof E||(this.demuxer=new E(i,r,o),this.probe=E.probe),this.resetInitSegment(h,s,f,u),this.resetInitialTimestamp(c)},t.needsProbing=function(e,t,n){return!this.demuxer||!this.remuxer||t||n},t.getDecrypter=function(){var e=this.decrypter;return e||(e=this.decrypter=new a.default(this.observer,this.config)),e},e}(),b=function(e){return{remuxResult:{},chunkMeta:e}};function _(e){return"then"in e&&e.then instanceof Function}var E=function(e,t,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=e,this.videoCodec=t,this.initSegmentData=n,this.duration=r,this.defaultInitPts=i},x=function(e,t,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=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=r,this.timeOffset=i}},"./src/demux/tsdemuxer.ts":
/*!********************************!*\
!*** ./src/demux/tsdemuxer.ts ***!
\********************************/
/*! exports provided: discardEPB, default */function(e,t,n){"use strict";n.r(t),n.d(t,"discardEPB",(function(){return _}));var r=n(/*! ./adts */"./src/demux/adts.ts"),i=n(/*! ./mpegaudio */"./src/demux/mpegaudio.ts"),o=n(/*! ./exp-golomb */"./src/demux/exp-golomb.ts"),a=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 e(e,t,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=e,this.config=t,this.typeSupported=n}e.probe=function(t){var n=e.syncOffset(t);return!(n<0||(n&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+n+", junk ahead ?"),0))},e.syncOffset=function(e){for(var t=Math.min(1e3,e.length-564),n=0;n<t;){if(71===e[n]&&71===e[n+188]&&71===e[n+376])return n;n++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:d[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}};var t=e.prototype;return t.resetInitSegment=function(t,n,r){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video",r),this._audioTrack=e.createTrack("audio",r),this._id3Track=e.createTrack("id3",r),this._txtTrack=e.createTrack("text",r),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=t,this.videoCodec=n,this._duration=r},t.resetTimeStamp=function(){},t.resetContiguity=function(){var e=this._audioTrack,t=this._avcTrack,n=this._id3Track;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},t.demux=function(t,n,r,i){var o;void 0===r&&(r=!1),void 0===i&&(i=!1),r||(this.sampleAes=null);var a=this._avcTrack,s=this._audioTrack,d=this._id3Track,f=a.pid,p=a.pesData,y=s.pid,b=d.pid,_=s.pesData,E=d.pesData,x=!1,w=this.pmtParsed,S=this._pmtId,k=t.length;if(this.remainderData&&(k=(t=Object(c.appendUint8Array)(this.remainderData,t)).length,this.remainderData=null),k<188&&!i)return this.remainderData=t,{audioTrack:s,avcTrack:a,id3Track:d,textTrack:this._txtTrack};var C=Math.max(0,e.syncOffset(t));(k-=(k+C)%188)<t.byteLength&&!i&&(this.remainderData=new Uint8Array(t.buffer,k,t.buffer.byteLength-k));for(var T=C;T<k;T+=188)if(71===t[T]){var O=!!(64&t[T+1]),A=((31&t[T+1])<<8)+t[T+2],L=void 0;if((48&t[T+3])>>4>1){if((L=T+5+t[T+4])===T+188)continue}else L=T+4;switch(A){case f:O&&(p&&(o=v(p))&&this.parseAVCPES(o,!1),p={data:[],size:0}),p&&(p.data.push(t.subarray(L,T+188)),p.size+=T+188-L);break;case y:O&&(_&&(o=v(_))&&(s.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),_={data:[],size:0}),_&&(_.data.push(t.subarray(L,T+188)),_.size+=T+188-L);break;case b:O&&(E&&(o=v(E))&&this.parseID3PES(o),E={data:[],size:0}),E&&(E.data.push(t.subarray(L,T+188)),E.size+=T+188-L);break;case 0:O&&(L+=t[L]+1),S=this._pmtId=m(t,L);break;case S:O&&(L+=t[L]+1);var R=g(t,L,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,r);(f=R.avc)>0&&(a.pid=f),(y=R.audio)>0&&(s.pid=y,s.isAAC=R.isAAC),(b=R.id3)>0&&(d.pid=b),x&&!w&&(u.logger.log("reparse from beginning"),x=!1,T=C-188),w=this.pmtParsed=!0;break;case 17:case 8191:break;default:x=!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"});a.pesData=p,s.pesData=_,d.pesData=E;var D={audioTrack:s,avcTrack:a,id3Track:d,textTrack:this._txtTrack};return i&&this.extractRemainingSamples(D),D},t.flush=function(){var e,t=this.remainderData;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e},t.extractRemainingSamples=function(e){var t,n=e.audioTrack,r=e.avcTrack,i=e.id3Track,o=r.pesData,a=n.pesData,s=i.pesData;o&&(t=v(o))?(this.parseAVCPES(t,!0),r.pesData=null):r.pesData=o,a&&(t=v(a))?(n.isAAC?this.parseAACPES(t):this.parseMPEGPES(t),n.pesData=null):(null!=a&&a.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),n.pesData=a),s&&(t=v(s))?(this.parseID3PES(t),i.pesData=null):i.pesData=s},t.demuxSampleAes=function(e,t,n){var r=this.demux(e,n,!0,!this.config.progressive),i=this.sampleAes=new s.default(this.observer,this.config,t);return this.decrypt(r,i)},t.decrypt=function(e,t){return new Promise((function(n){var r=e.audioTrack,i=e.avcTrack;r.samples&&r.isAAC?t.decryptAacSamples(r.samples,0,(function(){i.samples?t.decryptAvcSamples(i.samples,0,0,(function(){n(e)})):n(e)})):i.samples&&t.decryptAvcSamples(i.samples,0,0,(function(){n(e)}))}))},t.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},t.parseAVCPES=function(e,t){var n,r=this,i=this._avcTrack,s=this.parseAVCNALu(e.data),l=this.avcSample,c=!1;e.data=null,l&&s.length&&!i.audFound&&(y(l,i),l=this.avcSample=p(!1,e.pts,e.dts,"")),s.forEach((function(t){switch(t.type){case 1:n=!0,l||(l=r.avcSample=p(!0,e.pts,e.dts,"")),l.frame=!0;var s=t.data;if(c&&s.length>4){var u=new o.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,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:n=!0;var h=new o.default(_(t.data));h.readUByte();for(var d=0,f=0,m=!1,g=0;!m&&h.bytesAvailable>1;){d=0;do{d+=g=h.readUByte()}while(255===g);f=0;do{f+=g=h.readUByte()}while(255===g);if(4===d&&0!==h.bytesAvailable){if(m=!0,181===h.readUByte()&&49===h.readUShort()&&1195456820===h.readUInt()&&3===h.readUByte()){for(var v=h.readUByte(),E=31&v,x=[v,h.readUByte()],w=0;w<E;w++)x.push(h.readUByte()),x.push(h.readUByte()),x.push(h.readUByte());b(r._txtTrack.samples,{type:3,pts:e.pts,bytes:x})}}else if(5===d&&0!==h.bytesAvailable){if(m=!0,f>16){for(var S=[],k=0;k<16;k++)S.push(h.readUByte().toString(16)),3!==k&&5!==k&&7!==k&&9!==k||S.push("-");for(var C=f-16,T=new Uint8Array(C),O=0;O<C;O++)T[O]=h.readUByte();b(r._txtTrack.samples,{pts:e.pts,payloadType:d,uuid:S.join(""),userData:Object(a.utf8ArrayToStr)(T),userDataBytes:T})}}else if(f<h.bytesAvailable)for(var A=0;A<f;A++)h.readUByte()}break;case 7:if(n=!0,c=!0,!i.sps){var L=new o.default(t.data).readSPS();i.width=L.width,i.height=L.height,i.pixelRatio=L.pixelRatio,i.sps=[t.data],i.duration=r._duration;for(var R=t.data.subarray(1,4),D="avc1.",I=0;I<3;I++){var M=R[I].toString(16);M.length<2&&(M="0"+M),D+=M}i.codec=D}break;case 8:n=!0,i.pps||(i.pps=[t.data]);break;case 9:n=!1,i.audFound=!0,l&&y(l,i),l=r.avcSample=p(!1,e.pts,e.dts,"");break;case 12:n=!1;break;default:n=!1,l&&(l.debug+="unknown NAL "+t.type+" ")}l&&n&&l.units.push(t)})),t&&l&&(y(l,i),this.avcSample=null)},t.getLastNalUnit=function(){var e,t,n=this.avcSample;if(!n||0===n.units.length){var r=this._avcTrack.samples;n=r[r.length-1]}if(null!==(e=n)&&void 0!==e&&e.units){var i=n.units;t=i[i.length-1]}return t},t.parseAVCNALu=function(e){var t,n,r=e.byteLength,i=this._avcTrack,o=i.naluState||0,a=o,s=[],l=0,c=-1,u=0;for(-1===o&&(c=0,u=31&e[0],o=0,l=1);l<r;)if(t=e[l++],o)if(1!==o)if(t)if(1===t){if(c>=0){var h={data:e.subarray(c,l-o-1),type:u};s.push(h)}else{var d=this.getLastNalUnit();if(d&&(a&&l<=4-a&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-a)),(n=l-o-1)>0)){var f=new Uint8Array(d.data.byteLength+n);f.set(d.data,0),f.set(e.subarray(0,n),d.data.byteLength),d.data=f,d.state=0}}l<r?(c=l,u=31&e[l],o=0):o=-1}else o=0;else o=3;else o=t?0:2;else o=t?0:1;if(c>=0&&o>=0){var p={data:e.subarray(c,r),type:u,state:o};s.push(p)}if(0===s.length){var m=this.getLastNalUnit();if(m){var g=new Uint8Array(m.data.byteLength+e.byteLength);g.set(m.data,0),g.set(e,m.data.byteLength),m.data=g}}return i.naluState=o,s},t.parseAACPES=function(e){var t,n,i,o,a,s=0,c=this._audioTrack,d=this.aacOverFlow,f=e.data;if(d){this.aacOverFlow=null;var p=d.sample.unit.byteLength,m=Math.min(d.missing,p),g=p-m;d.sample.unit.set(f.subarray(0,m),g),c.samples.push(d.sample),s=d.missing}for(t=s,n=f.length;t<n-1&&!r.isHeader(f,t);t++);if(t===s||(t<n-1?(i="AAC PES did not start with ADTS header,offset:"+t,o=!1):(i="no ADTS header found in AAC PES",o=!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:o,reason:i}),!o)){if(r.initTrackConfig(c,this.observer,f,t,this.audioCodec),void 0!==e.pts)a=e.pts;else{if(!d)return void u.logger.warn("[tsdemuxer]: AAC PES unknown PTS");var v=r.getFrameDuration(c.samplerate);a=d.sample.pts+v}for(var y=0;t<n;){if(r.isHeader(f,t)){if(t+5<n){var b=r.appendFrame(c,f,t,a,y);if(b){if(!b.missing){t+=b.length,y++;continue}this.aacOverFlow=b}}break}t++}}},t.parseMPEGPES=function(e){var t=e.data,n=t.length,r=0,o=0,a=e.pts;if(void 0!==a)for(;o<n;)if(i.isHeader(t,o)){var s=i.appendFrame(this._audioTrack,t,o,a,r);if(!s)break;o+=s.length,r++}else o++;else u.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")},t.parseID3PES=function(e){void 0!==e.pts?this._id3Track.samples.push(e):u.logger.warn("[tsdemuxer]: ID3 PES unknown PTS")},e}();function p(e,t,n,r){return{key:e,frame:!1,pts:t,dts:n,units:[],debug:r,length:0}}function m(e,t){return(31&e[t+10])<<8|e[t+11]}function g(e,t,n,r){var i={audio:-1,avc:-1,id3:-1,isAAC:!0},o=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<o;){var a=(31&e[t+1])<<8|e[t+2];switch(e[t]){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=a);break;case 21:-1===i.id3&&(i.id3=a);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=a);break;case 3:case 4:n?-1===i.audio&&(i.audio=a,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")}t+=5+((15&e[t+3])<<8|e[t+4])}return i}function v(e){var t,n,r,i,o,a=0,s=e.data;if(!e||0===e.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===((t=s[0])[0]<<16)+(t[1]<<8)+t[2]){if((n=(t[4]<<8)+t[5])&&n>e.size-6)return null;var c=t[7];192&c&&(i=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&c?i-(o=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>54e5&&(u.logger.warn(Math.round((i-o)/9e4)+"s delta between PTS and DTS, align them"),i=o):o=i);var h=(r=t[8])+9;if(e.size<=h)return null;e.size-=h;for(var d=new Uint8Array(e.size),f=0,p=s.length;f<p;f++){var m=(t=s[f]).byteLength;if(h){if(h>m){h-=m;continue}t=t.subarray(h),m-=h,h=0}d.set(t,a),a+=m}return n&&(n-=r+3),{data:d,pts:i,dts:o,len:n}}return null}function y(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var n=t.samples,r=n.length;if(!r)return void t.dropped++;var i=n[r-1];e.pts=i.pts,e.dts=i.dts}t.samples.push(e)}e.debug.length&&u.logger.log(e.pts+"/"+e.dts+":"+e.debug)}function b(e,t){var n=e.length;if(n>0){if(t.pts>=e[n-1].pts)e.push(t);else for(var r=n-1;r>=0;r--)if(t.pts<e[r].pts){e.splice(r,0,t);break}}else e.push(t)}function _(e){for(var t=e.byteLength,n=[],r=1;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return e;var i=t-n.length,o=new Uint8Array(i),a=0;for(r=0;r<i;a++,r++)a===n[0]&&(a++,n.shift()),o[r]=e[a];return o}f.minProbeByteLength=188,t.default=f},"./src/errors.ts":
/*!***********************!*\
!*** ./src/errors.ts ***!
\***********************/
/*! exports provided: ErrorTypes, ErrorDetails */function(e,t,n){"use strict";var r,i;n.r(t),n.d(t,"ErrorTypes",(function(){return r})),n.d(t,"ErrorDetails",(function(){return i})),function(e){e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError"}(r||(r={})),function(e){e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown"}(i||(i={}))},"./src/events.ts":
/*!***********************!*\
!*** ./src/events.ts ***!
\***********************/
/*! exports provided: Events */function(e,t,n){"use strict";var r;n.r(t),n.d(t,"Events",(function(){return r})),function(e){e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached"}(r||(r={}))},"./src/hls.ts":
/*!********************!*\
!*** ./src/hls.ts ***!
\********************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"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"),o=n(/*! ./loader/key-loader */"./src/loader/key-loader.ts"),a=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"),m=n(/*! ./events */"./src/events.ts"),g=n(/*! ./errors */"./src/errors.ts");function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var y=function(){function e(t){void 0===t&&(t={}),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)(e.DefaultConfig,t);this.userConfig=t,Object(d.enableLogs)(n.debug),this._autoLevelCapping=-1,n.progressive&&Object(f.enableStreamingMode)(n);var r=n.abrController,h=n.bufferController,m=n.capLevelController,g=n.fpsController,v=this.abrController=new r(this),y=this.bufferController=new h(this),b=this.capLevelController=new m(this),_=new g(this),E=new i.default(this),x=new o.default(this),w=new a.default(this),S=this.levelController=new l.default(this),k=new c.FragmentTracker(this),C=this.streamController=new u.default(this,k);b.setStreamController(C),_.setStreamController(C);var T=[S,C];this.networkControllers=T;var O=[E,x,v,y,b,_,w,k];this.audioTrackController=this.createController(n.audioTrackController,null,T),this.createController(n.audioStreamController,k,T),this.subtitleTrackController=this.createController(n.subtitleTrackController,null,T),this.createController(n.subtitleStreamController,k,T),this.createController(n.timelineController,null,O),this.emeController=this.createController(n.emeController,null,O),this.cmcdController=this.createController(n.cmcdController,null,O),this.latencyController=this.createController(s.default,null,O),this.coreComponents=O}e.isSupported=function(){return Object(h.isSupported)()};var t,n,y,b=e.prototype;return b.createController=function(e,t,n){if(e){var r=t?new e(this,t):new e(this);return n&&n.push(r),r}return null},b.on=function(e,t,n){void 0===n&&(n=this),this._emitter.on(e,t,n)},b.once=function(e,t,n){void 0===n&&(n=this),this._emitter.once(e,t,n)},b.removeAllListeners=function(e){this._emitter.removeAllListeners(e)},b.off=function(e,t,n,r){void 0===n&&(n=this),this._emitter.off(e,t,n,r)},b.listeners=function(e){return this._emitter.listeners(e)},b.emit=function(e,t,n){return this._emitter.emit(e,t,n)},b.trigger=function(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){d.logger.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.trigger(m.Events.ERROR,{type:g.ErrorTypes.OTHER_ERROR,details:g.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,error:t})}return!1},b.listenerCount=function(e){return this._emitter.listenerCount(e)},b.destroy=function(){d.logger.log("destroy"),this.trigger(m.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(e){return e.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(e){return e.destroy()})),this.coreComponents.length=0},b.attachMedia=function(e){d.logger.log("attachMedia"),this._media=e,this.trigger(m.Events.MEDIA_ATTACHING,{media:e})},b.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(m.Events.MEDIA_DETACHING,void 0),this._media=null},b.loadSource=function(e){this.stopLoad();var t=this.media,n=this.url,i=this.url=r.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});d.logger.log("loadSource:"+i),t&&n&&n!==i&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(t)),this.trigger(m.Events.MANIFEST_LOADING,{url:e})},b.startLoad=function(e){void 0===e&&(e=-1),d.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))},b.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))},b.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},b.recoverMediaError=function(){d.logger.log("recoverMediaError");var e=this._media;this.detachMedia(),e&&this.attachMedia(e)},b.removeLevel=function(e,t){void 0===t&&(t=0),this.levelController.removeLevel(e,t)},t=e,y=[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return m.Events}},{key:"ErrorTypes",get:function(){return g.ErrorTypes}},{key:"ErrorDetails",get:function(){return g.ErrorDetails}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:f.hlsDefaultConfig},set:function(t){e.defaultConfig=t}}],(n=[{key:"levels",get:function(){var e=this.levelController.levels;return e||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){d.logger.log("set currentLevel:"+e),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){d.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){d.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){d.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){d.logger.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(e){var t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){this._autoLevelCapping!==e&&(d.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e)}},{key:"bandwidthEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var e=this.levels,t=this.config.minAutoBitrate;if(!e)return 0;for(var n=e.length,r=0;r<n;r++)if(e[r].maxBitrate>t)return r;return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{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(t.prototype,n),y&&v(t,y),e}();y.defaultConfig=void 0},"./src/is-supported.ts":
/*!*****************************!*\
!*** ./src/is-supported.ts ***!
\*****************************/
/*! exports provided: isSupported, changeTypeSupported */function(e,t,n){"use strict";n.r(t),n.d(t,"isSupported",(function(){return o})),n.d(t,"changeTypeSupported",(function(){return a}));var r=n(/*! ./utils/mediasource-helper */"./src/utils/mediasource-helper.ts");function i(){return self.SourceBuffer||self.WebKitSourceBuffer}function o(){var e=Object(r.getMediaSource)();if(!e)return!1;var t=i(),n=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),o=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!n&&!!o}function a(){var e,t=i();return"function"==typeof(null==t||null===(e=t.prototype)||void 0===e?void 0:e.changeType)}},"./src/loader/fragment-loader.ts":
/*!***************************************!*\
!*** ./src/loader/fragment-loader.ts ***!
\***************************************/
/*! exports provided: default, LoadError */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return h})),n.d(t,"LoadError",(function(){return f}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../errors */"./src/errors.ts");function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return a(e,arguments,c(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,e)})(e)}function a(e,t,n){return(a=s()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,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(e){return!1}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=Math.pow(2,17),h=function(){function e(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}var t=e.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(e,t){var n=this,r=e.url;if(!r)return Promise.reject(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,networkDetails:null},"Fragment does not have a "+(r?"part list":"url")));this.abort();var o=this.config,a=o.fLoader,s=o.loader;return new Promise((function(r,l){n.loader&&n.loader.destroy();var c=n.loader=e.loader=a?new a(o):new s(o),h=d(e),p={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:u};e.stats=c.stats,c.load(h,p,{onSuccess:function(t,i,o,a){n.resetLoader(e,c),r({frag:e,part:null,payload:t.data,networkDetails:a})},onError:function(t,r,o){n.resetLoader(e,c),l(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:t,networkDetails:o}))},onAbort:function(t,r,o){n.resetLoader(e,c),l(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,networkDetails:o}))},onTimeout:function(t,r,o){n.resetLoader(e,c),l(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,networkDetails:o}))},onProgress:function(n,r,i,o){t&&t({frag:e,part:null,payload:i,networkDetails:o})}})}))},t.loadPart=function(e,t,n){var r=this;this.abort();var o=this.config,a=o.fLoader,s=o.loader;return new Promise((function(l,c){r.loader&&r.loader.destroy();var h=r.loader=e.loader=a?new a(o):new s(o),p=d(e,t),m={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:u};t.stats=h.stats,h.load(p,m,{onSuccess:function(i,o,a,s){r.resetLoader(e,h),r.updateStatsFromPart(e,t);var c={frag:e,part:t,payload:i.data,networkDetails:s};n(c),l(c)},onError:function(n,o,a){r.resetLoader(e,h),c(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:n,networkDetails:a}))},onAbort:function(n,o,a){e.stats.aborted=t.stats.aborted,r.resetLoader(e,h),c(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,networkDetails:a}))},onTimeout:function(n,o,a){r.resetLoader(e,h),c(new f({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,networkDetails:a}))}})}))},t.updateStatsFromPart=function(e,t){var n=e.stats,r=t.stats,i=r.total;if(n.loaded+=r.loaded,i){var o=Math.round(e.duration/t.duration),a=Math.min(Math.round(n.loaded/i),o),s=(o-a)*Math.round(n.loaded/a);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},t.resetLoader=function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()},e}();function d(e,t){void 0===t&&(t=null);var n=t||e,i={frag:e,part:t,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},o=n.byteRangeStartOffset,a=n.byteRangeEndOffset;return Object(r.isFiniteNumber)(o)&&Object(r.isFiniteNumber)(a)&&(i.rangeStart=o,i.rangeEnd=a),i}var f=function(e){var t,n;function r(t){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return(n=e.call.apply(e,[this].concat(i))||this).data=void 0,n.data=t,n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,l(t,n),r}(o(Error))},"./src/loader/fragment.ts":
/*!********************************!*\
!*** ./src/loader/fragment.ts ***!
\********************************/
/*! exports provided: ElementaryStreamTypes, BaseSegment, Fragment, Part */function(e,t,n){"use strict";n.r(t),n.d(t,"ElementaryStreamTypes",(function(){return r})),n.d(t,"BaseSegment",(function(){return f})),n.d(t,"Fragment",(function(){return p})),n.d(t,"Part",(function(){return m}));var r,i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),o=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),a=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(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,u(e,t)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}!function(e){e.AUDIO="audio",e.VIDEO="video",e.AUDIOVIDEO="audiovideo"}(r||(r={}));var f=function(){function e(e){var t;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((t={})[r.AUDIO]=null,t[r.VIDEO]=null,t[r.AUDIOVIDEO]=null,t),this.baseurl=e}return e.prototype.setByteRange=function(e,t){var n=e.split("@",2),r=[];1===n.length?r[0]=t?t.byteRangeEndOffset:0:r[0]=parseInt(n[1]),r[1]=parseInt(n[0])+r[0],this._byteRange=r},d(e,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(o.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(e){this._url=e}}]),e}(),p=function(e){function t(t,n){var r;return(r=e.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=t,r}c(t,e);var n=t.prototype;return n.createInitializationVector=function(e){for(var t=new Uint8Array(16),n=12;n<16;n++)t[n]=e>>8*(15-n)&255;return t},n.setDecryptDataFromLevelKey=function(e,t){var n=e;return"AES-128"===(null==e?void 0:e.method)&&e.uri&&!e.iv&&((n=s.LevelKey.fromURI(e.uri)).method=e.method,n.iv=this.createInitializationVector(t),n.keyFormat="identity"),n},n.setElementaryStreamInfo=function(e,t,n,r,i,o){void 0===o&&(o=!1);var a=this.elementaryStreams,s=a[e];s?(s.startPTS=Math.min(s.startPTS,t),s.endPTS=Math.max(s.endPTS,n),s.startDTS=Math.min(s.startDTS,r),s.endDTS=Math.max(s.endDTS,i)):a[e]={startPTS:t,endPTS:n,startDTS:r,endDTS:i,partial:o}},n.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[r.AUDIO]=null,e[r.VIDEO]=null,e[r.AUDIOVIDEO]=null},d(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var e=this.sn;"number"!=typeof e&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&a.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),e=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,e)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(i.isFiniteNumber)(this.programDateTime))return null;var e=Object(i.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;return!(null===(e=this.decryptdata)||void 0===e||!e.keyFormat||!this.decryptdata.uri)}}]),t}(f),m=function(e){function t(t,n,r,i,o){var a;(a=e.call(this,r)||this).fragOffset=0,a.duration=0,a.gap=!1,a.independent=!1,a.relurl=void 0,a.fragment=void 0,a.index=void 0,a.stats=new l.LoadStats,a.duration=t.decimalFloatingPoint("DURATION"),a.gap=t.bool("GAP"),a.independent=t.bool("INDEPENDENT"),a.relurl=t.enumeratedString("URI"),a.fragment=n,a.index=i;var s=t.enumeratedString("BYTERANGE");return s&&a.setByteRange(s,o),o&&(a.fragOffset=o.fragOffset+o.duration),a}return c(t,e),d(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}]),t}(f)},"./src/loader/key-loader.ts":
/*!**********************************!*\
!*** ./src/loader/key-loader.ts ***!
\**********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return a}));var r=n(/*! ../events */"./src/events.ts"),i=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=function(){function e(e){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){this.hls.on(r.Events.KEY_LOADING,this.onKeyLoading,this)},t._unregisterListeners=function(){this.hls.off(r.Events.KEY_LOADING,this.onKeyLoading)},t.destroy=function(){for(var e in this._unregisterListeners(),this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={}},t.onKeyLoading=function(e,t){var n=t.frag,i=n.type,a=this.loaders[i];if(n.decryptdata){var s=n.decryptdata.uri;if(s!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(a&&(o.logger.warn("abort previous key loader for type:"+i),a.abort()),!s)return void o.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 o.logger.warn("Missing decryption data on fragment in onKeyLoading")},t.loadsuccess=function(e,t,n){var i=n.frag;i.decryptdata?(this.decryptkey=i.decryptdata.key=new Uint8Array(e.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(r.Events.KEY_LOADED,{frag:i})):o.logger.error("after key load, decryptdata unset")},t.loaderror=function(e,t){var n=t.frag,o=n.loader;o&&o.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:e})},t.loadtimeout=function(e,t){var n=t.frag,o=n.loader;o&&o.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})},e}()},"./src/loader/level-details.ts":
/*!*************************************!*\
!*** ./src/loader/level-details.ts ***!
\*************************************/
/*! exports provided: LevelDetails */function(e,t,n){"use strict";n.r(t),n.d(t,"LevelDetails",(function(){return o}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts");function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=function(){function e(e){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=e}var t,n,o;return e.prototype.reloaded=function(e){if(!e)return this.advanced=!0,void(this.updated=!0);var t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t,this.advanced=this.endSN>e.endSN||t>0||0===t&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay},t=e,(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 e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!==(e=this.fragments)&&void 0!==e&&e.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 e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&i(t.prototype,n),o&&i(t,o),e}()},"./src/loader/level-key.ts":
/*!*********************************!*\
!*** ./src/loader/level-key.ts ***!
\*********************************/
/*! exports provided: LevelKey */function(e,t,n){"use strict";n.r(t),n.d(t,"LevelKey",(function(){return o}));var r=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js");function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=function(){function e(e,t){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,this._uri=t?Object(r.buildAbsoluteURL)(e,t,{alwaysNormalize:!0}):e}var t,n,o;return e.fromURL=function(t,n){return new e(t,n)},e.fromURI=function(t){return new e(t)},t=e,(n=[{key:"uri",get:function(){return this._uri}}])&&i(t.prototype,n),o&&i(t,o),e}()},"./src/loader/load-stats.ts":
/*!**********************************!*\
!*** ./src/loader/load-stats.ts ***!
\**********************************/
/*! exports provided: LoadStats */function(e,t,n){"use strict";n.r(t),n.d(t,"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(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return g}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),o=n(/*! ./fragment */"./src/loader/fragment.ts"),a=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("|")),m=/\.(mp4|m4s|m4v|m4a)$/i,g=function(){function e(){}return e.findGroup=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.id===t)return r}},e.convertAVC1ToAVCOTI=function(e){var t=e.split(".");if(t.length>2){var n=t.shift()+".";return n+=parseInt(t.shift()).toString(16),n+=("000"+parseInt(t.shift()).toString(16)).substr(-4)}return e},e.resolve=function(e,t){return i.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.parseMasterPlaylist=function(t,n){var r,i=[],o={},a=!1;for(h.lastIndex=0;null!=(r=h.exec(t));)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:e.resolve(r[2],n)},u=s.decimalResolution("RESOLUTION");u&&(c.width=u.width,c.height=u.height),v((s.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),c),c.videoCodec&&-1!==c.videoCodec.indexOf("avc1")&&(c.videoCodec=e.convertAVC1ToAVCOTI(c.videoCodec)),i.push(c)}else if(r[3]){var d=new l.AttrList(r[3]);d["DATA-ID"]&&(a=!0,o[d["DATA-ID"]]=d)}return{levels:i,sessionData:a?o:null}},e.parseMasterPlaylistMedia=function(t,n,r,i){var o;void 0===i&&(i=[]);var a=[],s=0;for(d.lastIndex=0;null!==(o=d.exec(t));){var c=new l.AttrList(o[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?e.resolve(c.URI,n):""};if(i.length){var h=e.findGroup(i,u.groupId)||i[0];y(u,h,"audioCodec"),y(u,h,"textCodec")}a.push(u)}}return a},e.parseLevelPlaylist=function(e,t,n,u,h){var d,g,v,y=new a.LevelDetails(t),_=y.fragments,E=null,x=0,w=0,S=0,k=0,C=null,T=new o.Fragment(u,t),O=-1,A=!1;for(f.lastIndex=0,y.m3u8=e;null!==(d=f.exec(e));){A&&(A=!1,(T=new o.Fragment(u,t)).start=S,T.sn=x,T.cc=k,T.level=n,E&&(T.initSegment=E,T.rawProgramDateTime=E.rawProgramDateTime));var L=d[1];if(L){T.duration=parseFloat(L);var R=(" "+d[2]).slice(1);T.title=R||null,T.tagList.push(R?["INF",L,R]:["INF",L])}else if(d[3])Object(r.isFiniteNumber)(T.duration)&&(T.start=S,v&&(T.levelkey=v),T.sn=x,T.level=n,T.cc=k,T.urlId=h,_.push(T),T.relurl=(" "+d[3]).slice(1),b(T,C),C=T,S+=T.duration,x++,w=0,A=!0);else if(d[4]){var D=(" "+d[4]).slice(1);C?T.setByteRange(D,C):T.setByteRange(D)}else if(d[5])T.rawProgramDateTime=(" "+d[5]).slice(1),T.tagList.push(["PROGRAM-DATE-TIME",T.rawProgramDateTime]),-1===O&&(O=_.length);else{if(!(d=d[0].match(p))){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(g=1;g<d.length&&void 0===d[g];g++);var I=(" "+d[g]).slice(1),M=(" "+d[g+1]).slice(1),N=d[g+2]?(" "+d[g+2]).slice(1):"";switch(I){case"PLAYLIST-TYPE":y.type=M.toUpperCase();break;case"MEDIA-SEQUENCE":x=y.startSN=parseInt(M);break;case"SKIP":var P=new l.AttrList(M),j=P.decimalInteger("SKIPPED-SEGMENTS");if(Object(r.isFiniteNumber)(j)){y.skippedSegments=j;for(var B=j;B--;)_.unshift(null);x+=j}var F=P.enumeratedString("RECENTLY-REMOVED-DATERANGES");F&&(y.recentlyRemovedDateranges=F.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)&&T.tagList.push(N?[M,N]:[M]);break;case"DIS":k++;case"GAP":T.tagList.push([I]);break;case"BITRATE":T.tagList.push([I,M]);break;case"DISCONTINUITY-SEQ":k=parseInt(M);break;case"KEY":var U,G=new l.AttrList(M),z=G.enumeratedString("METHOD"),H=G.URI,V=G.hexadecimalInteger("IV"),W=G.enumeratedString("KEYFORMATVERSIONS"),K=G.enumeratedString("KEYID"),q=null!=(U=G.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;z&&(v=s.LevelKey.fromURL(t,H),H&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(z)>=0&&(v.method=z,v.keyFormat=q,K&&(v.keyID=K),W&&(v.keyFormatVersions=W),v.iv=V));break;case"START":var X=new l.AttrList(M).decimalFloatingPoint("TIME-OFFSET");Object(r.isFiniteNumber)(X)&&(y.startTimeOffset=X);break;case"MAP":var Y=new l.AttrList(M);T.relurl=Y.URI,Y.BYTERANGE&&T.setByteRange(Y.BYTERANGE),T.level=n,T.sn="initSegment",v&&(T.levelkey=v),T.initSegment=null,E=T,A=!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=w>0?Z[Z.length-1]:void 0,ee=w++,te=new o.Part(new l.AttrList(M),T,t,ee,Q);Z.push(te),T.duration+=te.duration;break;case"PRELOAD-HINT":var ne=new l.AttrList(M);y.preloadHint=ne;break;case"RENDITION-REPORT":var re=new l.AttrList(M);y.renditionReports=y.renditionReports||[],y.renditionReports.push(re);break;default:c.logger.warn("line parsed but not handled: "+d)}}}C&&!C.relurl?(_.pop(),S-=C.duration,y.partList&&(y.fragmentHint=C)):y.partList&&(b(T,C),T.cc=k,y.fragmentHint=T);var ie=_.length,oe=_[0],ae=_[ie-1];if((S+=y.skippedSegments*y.targetduration)>0&&ie&&ae){y.averagetargetduration=S/ie;var se=ae.sn;y.endSN="initSegment"!==se?se:0,oe&&(y.startCC=oe.cc,oe.initSegment||y.fragments.every((function(e){return e.relurl&&(t=e.relurl,m.test(null!=(n=null===(r=i.parseURL(t))||void 0===r?void 0:r.path)?n:""));var t,n,r}))&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(T=new o.Fragment(u,t)).relurl=ae.relurl,T.level=n,T.sn="initSegment",oe.initSegment=T,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(S+=y.fragmentHint.duration),y.totalduration=S,y.endCC=k,O>0&&function(e,t){for(var n=e[t],r=t;r--;){var i=e[r];if(!i)return;i.programDateTime=n.programDateTime-1e3*i.duration,n=i}}(_,O),y},e}();function v(e,t){["video","audio","text"].forEach((function(n){var r=e.filter((function(e){return Object(u.isCodecType)(e,n)}));if(r.length){var i=r.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[n+"Codec"]=i.length>0?i[0]:r[0],e=e.filter((function(e){return-1===r.indexOf(e)}))}})),t.unknownCodecs=e}function y(e,t,n){var r=t[n];r&&(e[n]=r)}function b(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Object(r.isFiniteNumber)(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":
/*!***************************************!*\
!*** ./src/loader/playlist-loader.ts ***!
\***************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../events */"./src/events.ts"),o=n(/*! ../errors */"./src/errors.ts"),a=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(e,t){var n=e.url;return void 0!==n&&0!==n.indexOf("data:")||(n=t.url),n}var d=function(){function e(e){this.hls=void 0,this.loaders=Object.create(null),this.hls=e,this.registerListeners()}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.unregisterListeners=function(){var e=this.hls;e.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(i.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.createInternalLoader=function(e){var t=this.hls.config,n=t.pLoader,r=t.loader,i=new(n||r)(t);return e.loader=i,this.loaders[e.type]=i,i},t.getInternalLoader=function(e){return this.loaders[e.type]},t.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},t.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},t.onManifestLoading=function(e,t){var n=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:c.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},t.onLevelLoading=function(e,t){var n=t.id,r=t.level,i=t.url,o=t.deliveryDirectives;this.load({id:n,groupId:null,level:r,responseType:"text",type:c.PlaylistContextType.LEVEL,url:i,deliveryDirectives:o})},t.onAudioTrackLoading=function(e,t){var n=t.id,r=t.groupId,i=t.url,o=t.deliveryDirectives;this.load({id:n,groupId:r,level:null,responseType:"text",type:c.PlaylistContextType.AUDIO_TRACK,url:i,deliveryDirectives:o})},t.onSubtitleTrackLoading=function(e,t){var n=t.id,r=t.groupId,i=t.url,o=t.deliveryDirectives;this.load({id:n,groupId:r,level:null,responseType:"text",type:c.PlaylistContextType.SUBTITLE_TRACK,url:i,deliveryDirectives:o})},t.load=function(e){var t,n,r,i,o,s,l=this.hls.config,u=this.getInternalLoader(e);if(u){var h=u.context;if(h&&h.url===e.url)return void a.logger.trace("[playlist-loader]: playlist request ongoing");a.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),u.abort()}switch(e.type){case c.PlaylistContextType.MANIFEST:n=l.manifestLoadingMaxRetry,r=l.manifestLoadingTimeOut,i=l.manifestLoadingRetryDelay,o=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,o=l.levelLoadingMaxRetryTimeout}if(u=this.createInternalLoader(e),null!==(t=e.deliveryDirectives)&&void 0!==t&&t.part&&(e.type===c.PlaylistContextType.LEVEL&&null!==e.level?s=this.hls.levels[e.level].details:e.type===c.PlaylistContextType.AUDIO_TRACK&&null!==e.id?s=this.hls.audioTracks[e.id].details:e.type===c.PlaylistContextType.SUBTITLE_TRACK&&null!==e.id&&(s=this.hls.subtitleTracks[e.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:o,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(e,p,m)},t.loadsuccess=function(e,t,n,r){if(void 0===r&&(r=null),n.isSidxRequest)return this.handleSidxRequest(e,n),void this.handlePlaylistLoaded(e,t,n,r);this.resetInternalLoader(n.type);var i=e.data;0===i.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),i.indexOf("#EXTINF:")>0||i.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,t,n,r):this.handleMasterPlaylist(e,t,n,r)):this.handleManifestParsingError(e,n,"no EXTM3U delimiter",r)},t.loaderror=function(e,t,n){void 0===n&&(n=null),this.handleNetworkError(t,n,!1,e)},t.loadtimeout=function(e,t,n){void 0===n&&(n=null),this.handleNetworkError(t,n,!0)},t.handleMasterPlaylist=function(e,t,n,r){var o=this.hls,s=e.data,c=h(e,n),d=l.default.parseMasterPlaylist(s,c),f=d.levels,p=d.sessionData;if(f.length){var m=f.map((function(e){return{id:e.attrs.AUDIO,audioCodec:e.audioCodec}})),g=f.map((function(e){return{id:e.attrs.SUBTITLES,textCodec:e.textCodec}})),v=l.default.parseMasterPlaylistMedia(s,c,"AUDIO",m),y=l.default.parseMasterPlaylistMedia(s,c,"SUBTITLES",g),b=l.default.parseMasterPlaylistMedia(s,c,"CLOSED-CAPTIONS");v.length&&(v.some((function(e){return!e.url}))||!f[0].audioCodec||f[0].attrs.AUDIO||(a.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:""}))),o.trigger(i.Events.MANIFEST_LOADED,{levels:f,audioTracks:v,subtitles:y,captions:b,url:c,stats:t,networkDetails:r,sessionData:p})}else this.handleManifestParsingError(e,n,"no level found in manifest",r)},t.handleTrackOrLevelPlaylist=function(e,t,n,a){var s=this.hls,d=n.id,f=n.level,p=n.type,m=h(e,n),g=Object(r.isFiniteNumber)(d)?d:0,v=Object(r.isFiniteNumber)(f)?f:g,y=function(e){switch(e.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(e.data,m,v,y,g);if(b.fragments.length){if(p===c.PlaylistContextType.MANIFEST){var _={attrs:new u.AttrList({}),bitrate:0,details:b,name:"",url:m};s.trigger(i.Events.MANIFEST_LOADED,{levels:[_],audioTracks:[],url:m,stats:t,networkDetails:a,sessionData:null})}if(t.parsing.end=performance.now(),b.needSidxRanges){var E,x=null===(E=b.fragments[0].initSegment)||void 0===E?void 0:E.url;this.load({url:x,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(e,t,n,a)}else s.trigger(i.Events.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,reason:"no fragments found in level",level:"number"==typeof n.level?n.level:void 0})},t.handleSidxRequest=function(e,t){var n=Object(s.parseSegmentIndex)(new Uint8Array(e.data));if(n){var r=n.references,i=t.levelDetails;r.forEach((function(e,t){var r=e.info,o=i.fragments[t];0===o.byteRange.length&&o.setByteRange(String(1+r.end-r.start)+"@"+String(r.start)),o.initSegment&&o.initSegment.setByteRange(String(n.moovEndOffset)+"@0")}))}},t.handleManifestParsingError=function(e,t,n,r){this.hls.trigger(i.Events.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===c.PlaylistContextType.MANIFEST,url:e.url,reason:n,response:e,context:t,networkDetails:r})},t.handleNetworkError=function(e,t,n,r){void 0===n&&(n=!1),a.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var s=o.ErrorDetails.UNKNOWN,l=!1,u=this.getInternalLoader(e);switch(e.type){case c.PlaylistContextType.MANIFEST:s=n?o.ErrorDetails.MANIFEST_LOAD_TIMEOUT:o.ErrorDetails.MANIFEST_LOAD_ERROR,l=!0;break;case c.PlaylistContextType.LEVEL:s=n?o.ErrorDetails.LEVEL_LOAD_TIMEOUT:o.ErrorDetails.LEVEL_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.AUDIO_TRACK:s=n?o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.SUBTITLE_TRACK:s=n?o.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:o.ErrorDetails.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(e.type);var h={type:o.ErrorTypes.NETWORK_ERROR,details:s,fatal:l,url:e.url,loader:u,context:e,networkDetails:t};r&&(h.response=r),this.hls.trigger(i.Events.ERROR,h)},t.handlePlaylistLoaded=function(e,t,n,r){var o=n.type,a=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)),o){case c.PlaylistContextType.MANIFEST:case c.PlaylistContextType.LEVEL:this.hls.trigger(i.Events.LEVEL_LOADED,{details:h,level:a||0,id:s||0,stats:t,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:t,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:t,networkDetails:r,deliveryDirectives:d})}}else this.handleManifestParsingError(e,n,"invalid target duration",r)},e}();t.default=d},"./src/polyfills/number.ts":
/*!*********************************!*\
!*** ./src/polyfills/number.ts ***!
\*********************************/
/*! exports provided: isFiniteNumber, MAX_SAFE_INTEGER */function(e,t,n){"use strict";n.r(t),n.d(t,"isFiniteNumber",(function(){return r})),n.d(t,"MAX_SAFE_INTEGER",(function(){return i}));var r=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},i=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":
/*!*********************************!*\
!*** ./src/remux/aac-helper.ts ***!
\*********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=function(){function e(){}return e.getSilentFrame=function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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===t)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===t)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===t)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===t)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])}},e}();t.default=r},"./src/remux/mp4-generator.ts":
/*!************************************!*\
!*** ./src/remux/mp4-generator.ts ***!
\************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=Math.pow(2,32)-1,i=function(){function e(){}return e.init=function(){var t;for(t in e.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:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.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]);e.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]),o=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=o,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,a,l,a,s),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,i))},e.box=function(e){for(var t=8,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=r.length,a=o;o--;)t+=r[o].byteLength;var s=new Uint8Array(t);for(s[0]=t>>24&255,s[1]=t>>16&255,s[2]=t>>8&255,s[3]=255&t,s.set(e,4),o=0,t=8;o<a;o++)s.set(r[o],t),t+=r[o].byteLength;return s},e.hdlr=function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])},e.mdat=function(t){return e.box(e.types.mdat,t)},e.mdhd=function(t,n){n*=t;var i=Math.floor(n/(r+1)),o=Math.floor(n%(r+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,o>>24,o>>16&255,o>>8&255,255&o,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,n,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,n))},e.moov=function(t){for(var n=t.length,r=[];n--;)r[n]=e.trak(t[n]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(r).concat(e.mvex(t)))},e.mvex=function(t){for(var n=t.length,r=[];n--;)r[n]=e.trex(t[n]);return e.box.apply(null,[e.types.mvex].concat(r))},e.mvhd=function(t,n){n*=t;var i=Math.floor(n/(r+1)),o=Math.floor(n%(r+1)),a=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,o>>24,o>>16&255,o>>8&255,255&o,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 e.box(e.types.mvhd,a)},e.sdtp=function(t){var n,r,i=t.samples||[],o=new Uint8Array(4+i.length);for(n=0;n<i.length;n++)r=i[n].flags,o[n+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return e.box(e.types.sdtp,o)},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))},e.avc1=function(t){var n,r,i,o=[],a=[];for(n=0;n<t.sps.length;n++)i=(r=t.sps[n]).byteLength,o.push(i>>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(r));for(n=0;n<t.pps.length;n++)i=(r=t.pps[n]).byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(r));var s=e.box(e.types.avcC,new Uint8Array([1,o[3],o[4],o[5],255,224|t.sps.length].concat(o).concat([t.pps.length]).concat(a))),l=t.width,c=t.height,u=t.pixelRatio[0],h=t.pixelRatio[1];return e.box(e.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,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,h>>24,h>>16&255,h>>8&255,255&h])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.mp4a=function(t){var n=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var n=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]))},e.stsd=function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))},e.tkhd=function(t){var n=t.id,i=t.duration*t.timescale,o=t.width,a=t.height,s=Math.floor(i/(r+1)),l=Math.floor(i%(r+1));return e.box(e.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,o>>8&255,255&o,0,0,a>>8&255,255&a,0,0]))},e.traf=function(t,n){var i=e.sdtp(t),o=t.id,a=Math.floor(n/(r+1)),s=Math.floor(n%(r+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,s>>24,s>>16&255,s>>8&255,255&s])),e.trun(t,i.length+16+20+8+16+8+8),i)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var n=t.id;return e.box(e.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]))},e.trun=function(t,n){var r,i,o,a,s,l,c=t.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++)o=(i=c[r]).duration,a=i.size,s=i.flags,l=i.cts,d.set([o>>>24&255,o>>>16&255,o>>>8&255,255&o,a>>>24&255,a>>>16&255,a>>>8&255,255&a,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 e.box(e.types.trun,d)},e.initSegment=function(t){e.types||e.init();var n=e.moov(t),r=new Uint8Array(e.FTYP.byteLength+n.byteLength);return r.set(e.FTYP),r.set(n,e.FTYP.byteLength),r},e}();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,t.default=i},"./src/remux/mp4-remuxer.ts":
/*!**********************************!*\
!*** ./src/remux/mp4-remuxer.ts ***!
\**********************************/
/*! exports provided: default, normalizePts */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return m})),n.d(t,"normalizePts",(function(){return g}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ./aac-helper */"./src/remux/aac-helper.ts"),o=n(/*! ./mp4-generator */"./src/remux/mp4-generator.ts"),a=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(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var d=null,f=null,p=!1,m=function(){function e(e,t,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=e,this.config=t,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 o=navigator.userAgent.match(/Safari\/(\d+)/i);f=o?parseInt(o[1]):0}p=!!d&&d<75||!!f&&f<600}var t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){l.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e},t.resetNextTimestamp=function(){l.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},t.resetInitSegment=function(){l.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},t.getVideoStartPts=function(e){var t=!1,n=e.reduce((function(e,n){var r=n.pts-e;return r<-4294967296?(t=!0,g(e,n.pts)):r>0?e:n.pts}),e[0].pts);return t&&l.logger.debug("PTS rollover detected"),n},t.remux=function(e,t,n,r,i,o,a,s){var u,h,d,f,p,m,v=i,y=i,b=e.pid>-1,_=t.pid>-1,E=t.samples.length,x=e.samples.length>0,w=E>1;if((!b||x)&&(!_||w)||this.ISGenerated||a){this.ISGenerated||(d=this.generateIS(e,t,i));var S=this.isVideoContiguous,k=-1;if(w&&(k=function(e){for(var t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!S&&this.config.forceKeyFrameOnDiscontinuity))if(m=!0,k>0){l.logger.warn("[mp4-remuxer]: Dropped "+k+" out of "+E+" video samples due to a missing keyframe");var C=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(k),t.dropped+=k,y+=(t.samples[0].pts-C)/(t.timescale||9e4)}else-1===k&&(l.logger.warn("[mp4-remuxer]: No keyframe found out of "+E+" video samples"),m=!1);if(this.ISGenerated){if(x&&w){var T=this.getVideoStartPts(t.samples),O=(g(e.samples[0].pts,T)-T)/t.inputTimeScale;v+=Math.max(0,O),y+=Math.max(0,-O)}if(x){if(e.samplerate||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(e,t,i)),h=this.remuxAudio(e,v,this.isAudioContiguous,o,_||w||s===c.PlaylistLevelType.AUDIO?y:void 0),w){var A=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(e,t,i)),u=this.remuxVideo(t,y,S,A)}}else w&&(u=this.remuxVideo(t,y,S,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:m,text:f,id3:p}},t.generateIS=function(e,t,n){var i,a,s,l=e.samples,c=t.samples,u=this.typeSupported,h={},d=!Object(r.isFiniteNumber)(this._initPTS),f="audio/mp4";if(d&&(i=a=1/0),e.config&&l.length&&(e.timescale=e.samplerate,e.isAAC||(u.mpeg?(f="audio/mpeg",e.codec=""):u.mp3&&(e.codec="mp3")),h.audio={id:"audio",container:f,codec:e.codec,initSegment:!e.isAAC&&u.mpeg?new Uint8Array(0):o.default.initSegment([e]),metadata:{channelCount:e.channelCount}},d&&(s=e.inputTimeScale,i=a=l[0].pts-Math.round(s*n))),t.sps&&t.pps&&c.length&&(t.timescale=t.inputTimeScale,h.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:o.default.initSegment([t]),metadata:{width:t.width,height:t.height}},d)){s=t.inputTimeScale;var p=this.getVideoStartPts(c),m=Math.round(s*n);a=Math.min(a,g(c[0].dts,p)-m),i=Math.min(i,p-m)}if(Object.keys(h).length)return this.ISGenerated=!0,d&&(this._initPTS=i,this._initDTS=a),{tracks:h,initPTS:i,timescale:s}},t.remuxVideo=function(e,t,n,r){var i,c,f,m=e.inputTimeScale,y=e.samples,b=[],_=y.length,E=this._initPTS,x=this.nextAvcDts,w=8,S=Number.POSITIVE_INFINITY,k=Number.NEGATIVE_INFINITY,C=0,T=!1;n&&null!==x||(x=t*m-(y[0].pts-g(y[0].dts,y[0].pts)));for(var O=0;O<_;O++){var A=y[O];A.pts=g(A.pts-E,x),A.dts=g(A.dts-E,x),A.dts>A.pts&&(C=Math.max(Math.min(C,A.pts-A.dts),-18e3)),A.dts<y[O>0?O-1:O].dts&&(T=!0)}T&&y.sort((function(e,t){var n=e.dts-t.dts,r=e.pts-t.pts;return n||r})),c=y[0].dts,f=y[y.length-1].dts;var L=Math.round((f-c)/(_-1));if(C<0){if(C<-2*L){l.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(u.toMsFromMpegTsClock)(-L,!0)+" ms");for(var R=C,D=0;D<_;D++)y[D].dts=R=Math.max(R,y[D].pts-L),y[D].pts=Math.max(R,y[D].pts)}else{l.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(u.toMsFromMpegTsClock)(C,!0)+" ms to overcome this issue");for(var I=0;I<_;I++)y[I].dts=y[I].dts+C}c=y[0].dts}if(n){var M=c-x,N=M>L;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=x;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 j=0,B=0,F=0;F<_;F++){for(var U=y[F],G=U.units,z=G.length,H=0,V=0;V<z;V++)H+=G[V].data.length;B+=H,j+=z,U.length=H,U.dts=Math.max(U.dts,c),U.pts=Math.max(U.pts,U.dts,0),S=Math.min(U.pts,S),k=Math.max(U.pts,k)}f=y[_-1].dts;var W,K=B+4*j+8;try{W=new Uint8Array(K)}catch(e){return void this.observer.emit(a.Events.ERROR,a.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(W.buffer);q.setUint32(0,K),W.set(o.default.types.mdat,4);for(var X=0;X<_;X++){for(var Y=y[X],$=Y.units,J=0,Z=0,Q=$.length;Z<Q;Z++){var ee=$[Z],te=ee.data,ne=ee.data.byteLength;q.setUint32(w,ne),w+=4,W.set(te,w),w+=ne,J+=4+ne}if(X<_-1)i=y[X+1].dts-Y.dts;else{var re=this.config,ie=Y.dts-y[X>0?X-1:X].dts;if(re.stretchShortVideoTrack&&null!==this.nextAudioPts){var oe=Math.floor(re.maxBufferHole*m),ae=(r?S+r*m:this.nextAudioPts)-Y.pts;ae>oe?((i=ae-ie)<0&&(i=ie),l.logger.log("[mp4-remuxer]: It is approximately "+ae/90+" ms to the next segment; using duration "+i/90+" ms for the last video frame.")):i=ie}else i=ie}var se=Math.round(Y.pts-Y.dts);b.push(new v(Y.key,i,J,se))}if(b.length&&d&&d<70){var le=b[0].flags;le.dependsOn=2,le.isNonSync=0}console.assert(void 0!==i,"mp4SampleDuration must be computed"),this.nextAvcDts=x=f+i,this.isVideoContiguous=!0;var ce={data1:o.default.moof(e.sequenceNumber++,c,h({},e,{samples:b})),data2:W,startPTS:S/m,endPTS:(k+i)/m,startDTS:c/m,endDTS:x/m,type:"video",hasAudio:!1,hasVideo:!0,nb:b.length,dropped:e.dropped};return e.samples=[],e.dropped=0,console.assert(W.length,"MDAT length must not be zero"),ce},t.remuxAudio=function(e,t,n,r,c){var u=e.inputTimeScale,d=u/(e.samplerate?e.samplerate:u),f=e.isAAC?1024:1152,p=f*d,m=this._initPTS,y=!e.isAAC&&this.typeSupported.mpeg,b=[],_=e.samples,E=y?0:8,x=this.nextAudioPts||-1,w=t*u;if(this.isAudioContiguous=n=n||_.length&&x>0&&(r&&Math.abs(w-x)<9e3||Math.abs(g(_[0].pts-m,w)-x)<20*p),_.forEach((function(e){e.pts=g(e.pts-m,w)})),!n||x<0){if(!(_=_.filter((function(e){return e.pts>=0}))).length)return;x=0===c?0:r?Math.max(0,w):_[0].pts}if(e.isAAC)for(var S=void 0!==c,k=this.config.maxAudioFramesDrift,C=0,T=x;C<_.length;C++){var O=_[C],A=O.pts,L=A-T,R=Math.abs(1e3*L/u);if(L<=-k*p&&S)0===C&&(l.logger.warn("Audio frame @ "+(A/u).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*L/u)+" ms."),this.nextAudioPts=x=T=A);else if(L>=k*p&&R<1e4&&S){var D=Math.round(L/p);(T=A-D*p)<0&&(D--,T+=p),0===C&&(this.nextAudioPts=x=T),l.logger.warn("[mp4-remuxer]: Injecting "+D+" audio frame @ "+(T/u).toFixed(3)+"s due to "+Math.round(1e3*L/u)+" ms gap.");for(var I=0;I<D;I++){var M=Math.max(T,0),N=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);N||(l.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),N=O.unit.subarray()),_.splice(C,0,{unit:N,pts:M}),T+=p,C++}}O.pts=T,T+=p}for(var P,j=null,B=null,F=0,U=_.length;U--;)F+=_[U].unit.byteLength;for(var G=0,z=_.length;G<z;G++){var H=_[G],V=H.unit,W=H.pts;if(null!==B)b[G-1].duration=Math.round((W-B)/d);else{if(n&&e.isAAC&&(W=x),j=W,!(F>0))return;F+=E;try{P=new Uint8Array(F)}catch(e){return void this.observer.emit(a.Events.ERROR,a.Events.ERROR,{type:s.ErrorTypes.MUX_ERROR,details:s.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:F,reason:"fail allocating audio mdat "+F})}y||(new DataView(P.buffer).setUint32(0,F),P.set(o.default.types.mdat,4))}P.set(V,E);var K=V.byteLength;E+=K,b.push(new v(!0,f,K,0)),B=W}var q=b.length;if(q){var X=b[b.length-1];this.nextAudioPts=x=B+d*X.duration;var Y=y?new Uint8Array(0):o.default.moof(e.sequenceNumber++,j/d,h({},e,{samples:b}));e.samples=[];var $=j/u,J=x/u,Z={data1:Y,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}},t.remuxEmptyAudio=function(e,t,n,r){var o=e.inputTimeScale,a=o/(e.samplerate?e.samplerate:o),s=this.nextAudioPts,c=(null!==s?s:r.startDTS*o)+this._initDTS,u=r.endDTS*o+this._initDTS,h=1024*a,d=Math.ceil((u-c)/h),f=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(l.logger.warn("[mp4-remuxer]: remux empty Audio"),f){for(var p=[],m=0;m<d;m++){var g=c+m*h;p.push({unit:f,pts:g,dts:g})}return e.samples=p,this.remuxAudio(e,t,n,!1)}l.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},t.remuxID3=function(e,t){var n=e.samples.length;if(n){for(var r=e.inputTimeScale,i=this._initPTS,o=this._initDTS,a=0;a<n;a++){var s=e.samples[a];s.pts=g(s.pts-i,t*r)/r,s.dts=g(s.dts-o,t*r)/r}var l=e.samples;return e.samples=[],{samples:l}}},t.remuxText=function(e,t){var n=e.samples.length;if(n){for(var r=e.inputTimeScale,i=this._initPTS,o=0;o<n;o++){var a=e.samples[o];a.pts=g(a.pts-i,t*r)/r}e.samples.sort((function(e,t){return e.pts-t.pts}));var s=e.samples;return e.samples=[],{samples:s}}},e}();function g(e,t){var n;if(null===t)return e;for(n=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=n;return e}var v=function(e,t,n,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=n,this.cts=r,this.flags=new y(e)},y=function(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}},"./src/remux/passthrough-remuxer.ts":
/*!******************************************!*\
!*** ./src/remux/passthrough-remuxer.ts ***!
\******************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),o=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=function(){function e(){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 t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){this.initPTS=e,this.lastEndDTS=null},t.resetNextTimestamp=function(){this.lastEndDTS=null},t.resetInitSegment=function(e,t,n){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(e),this.emitInitSegment=!0},t.generateInitSegment=function(e){var t=this.audioCodec,n=this.videoCodec;if(!e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var r=this.initData=Object(i.parseInitSegment)(e);t||(t=c(r.audio,o.ElementaryStreamTypes.AUDIO)),n||(n=c(r.video,o.ElementaryStreamTypes.VIDEO));var s={};r.audio&&r.video?s.audiovideo={container:"video/mp4",codec:t+","+n,initSegment:e,id:"main"}:r.audio?s.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?s.video={container:"video/mp4",codec:n,initSegment:e,id:"main"}:a.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},t.remux=function(e,t,n,o,s){var c=this.initPTS,u=this.lastEndDTS,h={audio:void 0,video:void 0,text:o,id3:n,initSegment:void 0};Object(r.isFiniteNumber)(u)||(u=this.lastEndDTS=s||0);var d=t.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 a.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 m=Object(i.getDuration)(d,p),g=u,v=m+g;Object(i.offsetStartDTS)(p,d,c),m>0?this.lastEndDTS=v:(a.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var y=!!p.audio,b=!!p.video,_="";y&&(_+="audio"),b&&(_+="video");var E={data1:d,startPTS:g,startDTS:g,endPTS:v,endDTS:v,type:_,hasAudio:y,hasVideo:b,nb:1,dropped:0};return h.audio="audio"===E.type?E:void 0,h.video="audio"!==E.type?E:void 0,h.text=o,h.id3=n,h.initSegment=f,h},e}(),l=function(e,t,n){return Object(i.getStartDTS)(e,t)-n};function c(e,t){var n=null==e?void 0:e.codec;return n&&n.length>4?n:"hvc1"===n?"hvc1.1.c.L120.90":"av01"===n?"av01.0.04M.08":"avc1"===n||t===o.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}t.default=s},"./src/task-loop.ts":
/*!**************************!*\
!*** ./src/task-loop.ts ***!
\**************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return r}));var r=function(){function e(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var t=e.prototype;return t.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},t.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},t.onHandlerDestroyed=function(){},t.hasInterval=function(){return!!this._tickInterval},t.hasNextTick=function(){return!!this._tickTimer},t.setInterval=function(e){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,e),!0)},t.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},t.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},t.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},t.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},t.doTick=function(){},e}()},"./src/types/cmcd.ts":
/*!***************************!*\
!*** ./src/types/cmcd.ts ***!
\***************************/
/*! exports provided: CMCDVersion, CMCDObjectType, CMCDStreamingFormat, CMCDStreamType */function(e,t,n){"use strict";n.r(t),n.d(t,"CMCDVersion",(function(){return a})),n.d(t,"CMCDObjectType",(function(){return r})),n.d(t,"CMCDStreamingFormat",(function(){return i})),n.d(t,"CMCDStreamType",(function(){return o}));var r,i,o,a=1;!function(e){e.MANIFEST="m",e.AUDIO="a",e.VIDEO="v",e.MUXED="av",e.INIT="i",e.CAPTION="c",e.TIMED_TEXT="tt",e.KEY="k",e.OTHER="o"}(r||(r={})),function(e){e.DASH="d",e.HLS="h",e.SMOOTH="s",e.OTHER="o"}(i||(i={})),function(e){e.VOD="v",e.LIVE="l"}(o||(o={}))},"./src/types/level.ts":
/*!****************************!*\
!*** ./src/types/level.ts ***!
\****************************/
/*! exports provided: HlsSkip, getSkipValue, HlsUrlParameters, Level */function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i;function o(e,t){var n=e.canSkipUntil,r=e.canSkipDateRanges,o=e.endSN;return n&&(void 0!==t?t-o:0)<n?r?i.v2:i.Yes:i.No}n.r(t),n.d(t,"HlsSkip",(function(){return i})),n.d(t,"getSkipValue",(function(){return o})),n.d(t,"HlsUrlParameters",(function(){return a})),n.d(t,"Level",(function(){return s})),function(e){e.No="",e.Yes="YES",e.v2="v2"}(i||(i={}));var a=function(){function e(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}return e.prototype.addDirectives=function(e){var t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.toString()},e}(),s=function(){function e(e){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=[e.url],this.attrs=e.attrs,this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter((function(e){return e})).join(",").replace(/\.[^.,]+/g,"")}var t,n,i;return t=e,(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(e){var t=e%this.url.length;this._urlId!==t&&(this.details=void 0,this._urlId=t)}}])&&r(t.prototype,n),i&&r(t,i),e}()},"./src/types/loader.ts":
/*!*****************************!*\
!*** ./src/types/loader.ts ***!
\*****************************/
/*! exports provided: PlaylistContextType, PlaylistLevelType */function(e,t,n){"use strict";var r,i;n.r(t),n.d(t,"PlaylistContextType",(function(){return r})),n.d(t,"PlaylistLevelType",(function(){return i})),function(e){e.MANIFEST="manifest",e.LEVEL="level",e.AUDIO_TRACK="audioTrack",e.SUBTITLE_TRACK="subtitleTrack"}(r||(r={})),function(e){e.MAIN="main",e.AUDIO="audio",e.SUBTITLE="subtitle"}(i||(i={}))},"./src/types/transmuxer.ts":
/*!*********************************!*\
!*** ./src/types/transmuxer.ts ***!
\*********************************/
/*! exports provided: ChunkMetadata */function(e,t,n){"use strict";n.r(t),n.d(t,"ChunkMetadata",(function(){return r}));var r=function(e,t,n,r,i,o){void 0===r&&(r=0),void 0===i&&(i=-1),void 0===o&&(o=!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=e,this.sn=t,this.id=n,this.size=r,this.part=i,this.partial=o}},"./src/utils/attr-list.ts":
/*!********************************!*\
!*** ./src/utils/attr-list.ts ***!
\********************************/
/*! exports provided: AttrList */function(e,t,n){"use strict";n.r(t),n.d(t,"AttrList",(function(){return o}));var r=/^(\d+)x(\d+)$/,i=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,o=function(){function e(t){for(var n in"string"==typeof t&&(t=e.parseAttrList(t)),t)t.hasOwnProperty(n)&&(this[n]=t[n])}var t=e.prototype;return t.decimalInteger=function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t},t.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var n=new Uint8Array(t.length/2),r=0;r<t.length/2;r++)n[r]=parseInt(t.slice(2*r,2*r+2),16);return n}return null},t.hexadecimalIntegerAsNumber=function(e){var t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t},t.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.optionalFloat=function(e,t){var n=this[e];return n?parseFloat(n):t},t.enumeratedString=function(e){return this[e]},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){var t=r.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(e){var t,n={};for(i.lastIndex=0;null!==(t=i.exec(e));){var r=t[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),n[t[1]]=r}return n},e}()},"./src/utils/binary-search.ts":
/*!************************************!*\
!*** ./src/utils/binary-search.ts ***!
\************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),t.default={search:function(e,t){for(var n=0,r=e.length-1,i=null,o=null;n<=r;){var a=t(o=e[i=(n+r)/2|0]);if(a>0)n=i+1;else{if(!(a<0))return o;r=i-1}}return null}}},"./src/utils/buffer-helper.ts":
/*!************************************!*\
!*** ./src/utils/buffer-helper.ts ***!
\************************************/
/*! exports provided: BufferHelper */function(e,t,n){"use strict";n.r(t),n.d(t,"BufferHelper",(function(){return o}));var r=n(/*! ./logger */"./src/utils/logger.ts"),i={length:0,start:function(){return 0},end:function(){return 0}},o=function(){function e(){}return e.isBuffered=function(t,n){try{if(t)for(var r=e.getBuffered(t),i=0;i<r.length;i++)if(n>=r.start(i)&&n<=r.end(i))return!0}catch(e){}return!1},e.bufferInfo=function(t,n,r){try{if(t){var i,o=e.getBuffered(t),a=[];for(i=0;i<o.length;i++)a.push({start:o.start(i),end:o.end(i)});return this.bufferedInfo(a,n,r)}}catch(e){}return{len:0,start:n,end:n,nextStart:void 0}},e.bufferedInfo=function(e,t,n){t=Math.max(0,t),e.sort((function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var r=[];if(n)for(var i=0;i<e.length;i++){var o=r.length;if(o){var a=r[o-1].end;e[i].start-a<n?e[i].end>a&&(r[o-1].end=e[i].end):r.push(e[i])}else r.push(e[i])}else r=e;for(var s,l=0,c=t,u=t,h=0;h<r.length;h++){var d=r[h].start,f=r[h].end;if(t+n>=d&&t<f)c=d,l=(u=f)-t;else if(t+n<d){s=d;break}}return{len:l,start:c||0,end:u||0,nextStart:s}},e.getBuffered=function(e){try{return e.buffered}catch(e){return r.logger.log("failed to get media.buffered",e),i}},e}()},"./src/utils/cea-608-parser.ts":
/*!*************************************!*\
!*** ./src/utils/cea-608-parser.ts ***!
\*************************************/
/*! exports provided: Row, CaptionScreen, default */function(e,t,n){"use strict";n.r(t),n.d(t,"Row",(function(){return g})),n.d(t,"CaptionScreen",(function(){return v}));var r,i=n(/*! ../utils/logger */"./src/utils/logger.ts"),o={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},a=function(e){var t=e;return o.hasOwnProperty(e)&&(t=o[e]),String.fromCharCode(t)},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(e){e[e.ERROR=0]="ERROR",e[e.TEXT=1]="TEXT",e[e.WARNING=2]="WARNING",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG",e[e.DATA=3]="DATA"}(r||(r={}));var d=function(){function e(){this.time=null,this.verboseLevel=r.ERROR}return e.prototype.log=function(e,t){this.verboseLevel>=e&&i.logger.log(this.time+" ["+e+"] "+t)},e}(),f=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},p=function(){function e(e,t,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=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1}var t=e.prototype;return t.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},t.setStyles=function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},t.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},t.equals=function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},t.copy=function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},t.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},e}(),m=function(){function e(e,t,n,r,i,o){this.uchar=void 0,this.penState=void 0,this.uchar=e||" ",this.penState=new p(t,n,r,i,o)}var t=e.prototype;return t.reset=function(){this.uchar=" ",this.penState.reset()},t.setChar=function(e,t){this.uchar=e,this.penState.copy(t)},t.setPenState=function(e){this.penState.copy(e)},t.equals=function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},t.copy=function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},t.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},e}(),g=function(){function e(e){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var t=0;t<100;t++)this.chars.push(new m);this.logger=e,this.pos=0,this.currPenState=new p}var t=e.prototype;return t.equals=function(e){for(var t=!0,n=0;n<100;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},t.copy=function(e){for(var t=0;t<100;t++)this.chars[t].copy(e.chars[t])},t.isEmpty=function(){for(var e=!0,t=0;t<100;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},t.setCursor=function(e){this.pos!==e&&(this.pos=e),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)},t.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},t.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},t.insertChar=function(e){e>=144&&this.backSpace();var t=a(e);this.pos>=100?this.logger.log(r.ERROR,"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},t.clearFromPos=function(e){var t;for(t=e;t<100;t++)this.chars[t].reset()},t.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},t.clearToEndOfRow=function(){this.clearFromPos(this.pos)},t.getTextString=function(){for(var e=[],t=!0,n=0;n<100;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},t.setPenStyles=function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)},e}(),v=function(){function e(e){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var t=0;t<15;t++)this.rows.push(new g(e));this.logger=e,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var t=e.prototype;return t.reset=function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},t.equals=function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},t.copy=function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},t.isEmpty=function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},t.backSpace=function(){this.rows[this.currRow].backSpace()},t.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},t.insertChar=function(e){this.rows[this.currRow].insertChar(e)},t.setPen=function(e){this.rows[this.currRow].setPenStyles(e)},t.moveCursor=function(e){this.rows[this.currRow].moveCursor(e)},t.setCursor=function(e){this.logger.log(r.INFO,"setCursor: "+e),this.rows[this.currRow].setCursor(e)},t.setPAC=function(e){this.logger.log(r.INFO,"pacData = "+JSON.stringify(e));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var n=0;n<15;n++)this.rows[n].clear();var i=this.currRow+1-this.nrRollUpRows,o=this.lastOutputScreen;if(o){var a=o.rows[i].cueStartTime,s=this.logger.time;if(a&&null!==s&&a<s)for(var l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(o.rows[i+l])}}this.currRow=t;var c=this.rows[this.currRow];if(null!==e.indent){var u=e.indent,h=Math.max(u-1,0);c.setCursor(e.indent),e.color=c.chars[h].penState.foreground}var d={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(d)},t.setBkgData=function(e){this.logger.log(r.INFO,"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},t.setRollUpRows=function(e){this.nrRollUpRows=e},t.rollUp=function(){if(null!==this.nrRollUpRows){this.logger.log(r.TEXT,this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(r.INFO,"Rolling up")}else this.logger.log(r.DEBUG,"roll_up but nrRollUpRows not set yet")},t.getDisplayText=function(e){e=e||!1;for(var t=[],n="",r=-1,i=0;i<15;i++){var o=this.rows[i].getTextString();o&&(r=i+1,e?t.push("Row "+r+": '"+o+"'"):t.push(o.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},t.getTextAndFormat=function(){return this.rows},e}(),y=function(){function e(e,t,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=e,this.outputFilter=t,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 t=e.prototype;return t.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},t.getHandler=function(){return this.outputFilter},t.setHandler=function(e){this.outputFilter=e},t.setPAC=function(e){this.writeScreen.setPAC(e)},t.setBkgData=function(e){this.writeScreen.setBkgData(e)},t.setMode=function(e){e!==this.mode&&(this.mode=e,this.logger.log(r.INFO,"MODE="+e),"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=e)},t.insertChars=function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);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())},t.ccRCL=function(){this.logger.log(r.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},t.ccBS=function(){this.logger.log(r.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},t.ccAOF=function(){},t.ccAON=function(){},t.ccDER=function(){this.logger.log(r.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},t.ccRU=function(e){this.logger.log(r.INFO,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},t.ccFON=function(){this.logger.log(r.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},t.ccRDC=function(){this.logger.log(r.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},t.ccTR=function(){this.logger.log(r.INFO,"TR"),this.setMode("MODE_TEXT")},t.ccRTD=function(){this.logger.log(r.INFO,"RTD"),this.setMode("MODE_TEXT")},t.ccEDM=function(){this.logger.log(r.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},t.ccCR=function(){this.logger.log(r.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},t.ccENM=function(){this.logger.log(r.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},t.ccEOC=function(){if(this.logger.log(r.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(r.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},t.ccTO=function(e){this.logger.log(r.INFO,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},t.ccMIDROW=function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}this.logger.log(r.INFO,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},t.outputDataUpdate=function(e){void 0===e&&(e=!1);var t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},t.cueSplitAtTime=function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))},e}(),b=function(){function e(e,t,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(e,t,r),new y(e+1,n,r)],this.cmdHistory={a:null,b:null},this.logger=r}var t=e.prototype;return t.getHandler=function(e){return this.channels[e].getHandler()},t.setHandler=function(e,t){this.channels[e].setHandler(t)},t.addData=function(e,t){var n,i,o,a=!1;this.logger.time=e;for(var s=0;s<t.length;s+=2)if(i=127&t[s],o=127&t[s+1],0!==i||0!==o){if(this.logger.log(r.DATA,"["+f([t[s],t[s+1]])+"] -> ("+f([i,o])+")"),(n=this.parseCmd(i,o))||(n=this.parseMidrow(i,o)),n||(n=this.parsePAC(i,o)),n||(n=this.parseBackgroundAttributes(i,o)),!n&&(a=this.parseChars(i,o))){var l=this.currentChannel;l&&l>0?this.channels[l].insertChars(a):this.logger.log(r.WARNING,"No channel found yet. TEXT-MODE?")}n||a||this.logger.log(r.WARNING,"Couldn't parse cleaned data "+f([i,o])+" orig: "+f([t[s],t[s+1]]))}},t.parseCmd=function(e,t){var n=this.cmdHistory;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;if(E(e,t,n))return _(null,null,n),this.logger.log(r.DEBUG,"Repeated command ("+f([e,t])+") is dropped"),!0;var i=20===e||21===e||23===e?1:2,o=this.channels[i];return 20===e||21===e||28===e||29===e?32===t?o.ccRCL():33===t?o.ccBS():34===t?o.ccAOF():35===t?o.ccAON():36===t?o.ccDER():37===t?o.ccRU(2):38===t?o.ccRU(3):39===t?o.ccRU(4):40===t?o.ccFON():41===t?o.ccRDC():42===t?o.ccTR():43===t?o.ccRTD():44===t?o.ccEDM():45===t?o.ccCR():46===t?o.ccENM():47===t&&o.ccEOC():o.ccTO(t-32),_(e,t,n),this.currentChannel=i,!0},t.parseMidrow=function(e,t){var n=0;if((17===e||25===e)&&t>=32&&t<=47){if((n=17===e?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(t),this.logger.log(r.DEBUG,"MIDROW ("+f([e,t])+")"),!0)}return!1},t.parsePAC=function(e,t){var n,r=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;if(E(e,t,r))return _(null,null,r),!0;var i=e<=23?1:2;n=t>=64&&t<=95?1===i?s[e]:c[e]:1===i?l[e]:u[e];var o=this.channels[i];return!!o&&(o.setPAC(this.interpretPAC(n,t)),_(e,t,r),this.currentChannel=i,!0)},t.interpretPAC=function(e,t){var n,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-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},t.parseChars=function(e,t){var n,i,o=null,s=null;if(e>=25?(n=2,s=e-8):(n=1,s=e),s>=17&&s<=19?(i=17===s?t+80:18===s?t+112:t+144,this.logger.log(r.INFO,"Special char '"+a(i)+"' in channel "+n),o=[i]):e>=32&&e<=127&&(o=0===t?[e]:[e,t]),o){var l=f(o);this.logger.log(r.DEBUG,"Char codes = "+l.join(",")),_(e,t,this.cmdHistory)}return o},t.parseBackgroundAttributes=function(e,t){var n;if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;var r={};16===e||24===e?(n=Math.floor((t-32)/2),r.background=h[n],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0));var i=e<=23?1:2;return this.channels[i].setBkgData(r),_(e,t,this.cmdHistory),!0},t.reset=function(){for(var e=0;e<Object.keys(this.channels).length;e++){var t=this.channels[e];t&&t.reset()}this.cmdHistory={a:null,b:null}},t.cueSplitAtTime=function(e){for(var t=0;t<this.channels.length;t++){var n=this.channels[t];n&&n.cueSplitAtTime(e)}},e}();function _(e,t,n){n.a=e,n.b=t}function E(e,t,n){return n.a===e&&n.b===t}t.default=b},"./src/utils/codecs.ts":
/*!*****************************!*\
!*** ./src/utils/codecs.ts ***!
\*****************************/
/*! exports provided: isCodecType, isCodecSupportedInMp4 */function(e,t,n){"use strict";n.r(t),n.d(t,"isCodecType",(function(){return i})),n.d(t,"isCodecSupportedInMp4",(function(){return o}));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(e,t){var n=r[t];return!!n&&!0===n[e.slice(0,4)]}function o(e,t){return MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}},"./src/utils/cues.ts":
/*!***************************!*\
!*** ./src/utils/cues.ts ***!
\***************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ./vttparser */"./src/utils/vttparser.ts"),i=n(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts"),o=n(/*! ./texttrack-utils */"./src/utils/texttrack-utils.ts"),a=/\s/,s={newCue:function(e,t,n,s){for(var l,c,u,h,d,f=[],p=self.VTTCue||self.TextTrackCue,m=0;m<s.rows.length;m++)if(u=!0,h=0,d="",!(l=s.rows[m]).isEmpty()){for(var g=0;g<l.chars.length;g++)a.test(l.chars[g].uchar)&&u?h++:(d+=l.chars[g].uchar,u=!1);l.cueStartTime=t,t===n&&(n+=1e-4),h>=16?h--:h++;var v=Object(r.fixLineBreaks)(d.trim()),y=Object(i.generateCueId)(t,n,v);e&&e.cues&&e.cues.getCueById(y)||((c=new p(t,n,v)).id=y,c.line=m+1,c.align="left",c.position=10+Math.min(80,10*Math.floor(8*h/32)),f.push(c))}return e&&f.length&&(f.sort((function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line})),f.forEach((function(t){return Object(o.addCueToTrack)(e,t)}))),f}};t.default=s},"./src/utils/discontinuities.ts":
/*!**************************************!*\
!*** ./src/utils/discontinuities.ts ***!
\**************************************/
/*! exports provided: findFirstFragWithCC, shouldAlignOnDiscontinuities, findDiscontinuousReferenceFrag, adjustSlidingStart, alignStream, alignPDT, alignFragmentByPDTDelta, alignMediaPlaylistByPDT */function(e,t,n){"use strict";n.r(t),n.d(t,"findFirstFragWithCC",(function(){return a})),n.d(t,"shouldAlignOnDiscontinuities",(function(){return s})),n.d(t,"findDiscontinuousReferenceFrag",(function(){return l})),n.d(t,"adjustSlidingStart",(function(){return u})),n.d(t,"alignStream",(function(){return h})),n.d(t,"alignPDT",(function(){return d})),n.d(t,"alignFragmentByPDTDelta",(function(){return f})),n.d(t,"alignMediaPlaylistByPDT",(function(){return p}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ./logger */"./src/utils/logger.ts"),o=n(/*! ../controller/level-helper */"./src/controller/level-helper.ts");function a(e,t){for(var n=null,r=0,i=e.length;r<i;r++){var o=e[r];if(o&&o.cc===t){n=o;break}}return n}function s(e,t,n){return!(!t.details||!(n.endCC>n.startCC||e&&e.cc<n.startCC))}function l(e,t){var n=e.fragments,r=t.fragments;if(r.length&&n.length){var o=a(n,r[0].cc);if(o&&(!o||o.startPTS))return o;i.logger.log("No frag in previous level to align on")}else i.logger.log("No fragments to align")}function c(e,t){if(e){var n=e.start+t;e.start=e.startPTS=n,e.endPTS=n+e.duration}}function u(e,t){for(var n=t.fragments,r=0,i=n.length;r<i;r++)c(n[r],e);t.fragmentHint&&c(t.fragmentHint,e),t.alignedSliding=!0}function h(e,t,n){t&&(function(e,t,n){if(s(e,n,t)){var o=l(n.details,t);o&&Object(r.isFiniteNumber)(o.start)&&(i.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),u(o.start,t))}}(e,n,t),!n.alignedSliding&&t.details&&d(n,t.details),n.alignedSliding||!t.details||n.skippedSegments||Object(o.adjustSliding)(t.details,n))}function d(e,t){if(t.fragments.length&&e.hasProgramDateTime&&t.hasProgramDateTime){var n=t.fragments[0].programDateTime,o=e.fragments[0].programDateTime,a=(o-n)/1e3+t.fragments[0].start;a&&Object(r.isFiniteNumber)(a)&&(i.logger.log("Adjusting PTS using programDateTime delta "+(o-n)+"ms, sliding:"+a.toFixed(3)+" "+e.url+" "),u(a,e))}}function f(e,t){var n=e.programDateTime;if(n){var r=(n-t)/1e3;e.start=e.startPTS=r,e.endPTS=r+e.duration}}function p(e,t){if(t.fragments.length&&e.hasProgramDateTime&&t.hasProgramDateTime){var n=t.fragments[0].programDateTime-1e3*t.fragments[0].start;e.fragments.forEach((function(e){f(e,n)})),e.fragmentHint&&f(e.fragmentHint,n),e.alignedSliding=!0}}},"./src/utils/ewma-bandwidth-estimator.ts":
/*!***********************************************!*\
!*** ./src/utils/ewma-bandwidth-estimator.ts ***!
\***********************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../utils/ewma */"./src/utils/ewma.ts"),i=function(){function e(e,t,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(e),this.fast_=new r.default(t)}var t=e.prototype;return t.update=function(e,t){var n=this.slow_,i=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new r.default(e,n.getEstimate(),n.getTotalWeight())),this.fast_.halfLife!==t&&(this.fast_=new r.default(t,i.getEstimate(),i.getTotalWeight()))},t.sample=function(e,t){var n=(e=Math.max(e,this.minDelayMs_))/1e3,r=8*t/n;this.fast_.sample(n,r),this.slow_.sample(n,r)},t.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},t.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.destroy=function(){},e}();t.default=i},"./src/utils/ewma.ts":
/*!***************************!*\
!*** ./src/utils/ewma.ts ***!
\***************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=function(){function e(e,t,n){void 0===t&&(t=0),void 0===n&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}var t=e.prototype;return t.sample=function(e,t){var n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e},t.getTotalWeight=function(){return this.totalWeight_},t.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_},e}();t.default=r},"./src/utils/fetch-loader.ts":
/*!***********************************!*\
!*** ./src/utils/fetch-loader.ts ***!
\***********************************/
/*! exports provided: fetchSupported, default */function(e,t,n){"use strict";n.r(t),n.d(t,"fetchSupported",(function(){return d}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),o=n(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts");function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return s(e,arguments,u(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)})(e)}function s(e,t,n){return(s=l()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,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(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function d(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}var f=function(){function e(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||p,this.controller=new self.AbortController,this.stats=new i.LoadStats}var t=e.prototype;return t.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},t.abortInternal=function(){var e=this.response;e&&e.ok||(this.stats.aborted=!0,this.controller.abort())},t.abort=function(){var e;this.abortInternal(),null!==(e=this.callbacks)&&void 0!==e&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},t.load=function(e,t,n){var i=this,o=this.stats;if(o.loading.start)throw new Error("Loader can only be used once.");o.loading.start=self.performance.now();var a=function(e,t){var n={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(h({},e.headers))};return e.rangeEnd&&n.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),n}(e,this.controller.signal),s=n.onProgress,l="arraybuffer"===e.responseType,c=l?"byteLength":"length";this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,a),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout((function(){i.abortInternal(),n.onTimeout(o,e,i.response)}),t.timeout),self.fetch(this.request).then((function(n){if(i.response=i.loader=n,!n.ok){var a=n.status,c=n.statusText;throw new m(c||"fetch, bad network response",a,n)}return o.loading.first=Math.max(self.performance.now(),o.loading.start),o.total=parseInt(n.headers.get("Content-Length")||"0"),s&&Object(r.isFiniteNumber)(t.highWaterMark)?i.loadProgressively(n,o,e,t.highWaterMark,s):l?n.arrayBuffer():n.text()})).then((function(a){var l=i.response;self.clearTimeout(i.requestTimeout),o.loading.end=Math.max(self.performance.now(),o.loading.first),o.loaded=o.total=a[c];var u={url:l.url,data:a};s&&!Object(r.isFiniteNumber)(t.highWaterMark)&&s(o,e,a,l),n.onSuccess(u,o,e,l)})).catch((function(t){if(self.clearTimeout(i.requestTimeout),!o.aborted){var r=t.code||0;n.onError({code:r,text:t.message},e,t.details)}}))},t.getCacheAge=function(){var e=null;if(this.response){var t=this.response.headers.get("age");e=t?parseFloat(t):null}return e},t.loadProgressively=function(e,t,n,r,i){void 0===r&&(r=0);var a=new o.default,s=e.body.getReader();return function o(){return s.read().then((function(s){if(s.done)return a.dataLength&&i(t,n,a.flush(),e),Promise.resolve(new ArrayBuffer(0));var l=s.value,c=l.length;return t.loaded+=c,c<r||a.dataLength?(a.push(l),a.dataLength>=r&&i(t,n,a.flush(),e)):i(t,n,l,e),o()})).catch((function(){return Promise.reject()}))}()},e}();function p(e,t){return new self.Request(e.url,t)}var m=function(e){var t,n;function r(t,n,r){var i;return(i=e.call(this,t)||this).code=void 0,i.details=void 0,i.code=n,i.details=r,i}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,c(t,n),r}(a(Error));t.default=f},"./src/utils/imsc1-ttml-parser.ts":
/*!****************************************!*\
!*** ./src/utils/imsc1-ttml-parser.ts ***!
\****************************************/
/*! exports provided: IMSC1_CODEC, parseIMSC1 */function(e,t,n){"use strict";n.r(t),n.d(t,"IMSC1_CODEC",(function(){return u})),n.d(t,"parseIMSC1",(function(){return p}));var r=n(/*! ./mp4-tools */"./src/utils/mp4-tools.ts"),i=n(/*! ./vttparser */"./src/utils/vttparser.ts"),o=n(/*! ./vttcue */"./src/utils/vttcue.ts"),a=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(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).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(e,t,n,i,u){var h=Object(r.findBox)(new Uint8Array(e),["mdat"]);if(0!==h.length){var d=h[0],p=Object(a.utf8ArrayToStr)(new Uint8Array(e,d.start,d.end-d.start)),_=Object(s.toTimescaleFromScale)(t,1,n);try{i(function(e,t){var n=(new DOMParser).parseFromString(e,"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(e,t){return e[t]=n.getAttribute("ttp:"+t)||r[t],e}),{}),a="preserve"!==n.getAttribute("xml:space"),s=g(m(n,"styling","style")),u=g(m(n,"layout","region")),h=m(n,"body","[begin]");return[].map.call(h,(function(e){var n=function e(t,n){return[].slice.call(t.childNodes).reduce((function(t,r,i){var o;return"br"===r.nodeName&&i?t+"\n":null!==(o=r.childNodes)&&void 0!==o&&o.length?e(r,n):n?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent}),"")}(e,a);if(!n||!e.hasAttribute("begin"))return null;var r=b(e.getAttribute("begin"),i),h=b(e.getAttribute("dur"),i),d=b(e.getAttribute("end"),i);if(null===r)throw y(e);if(null===d){if(null===h)throw y(e);d=r+h}var p=new o.default(r-t,d-t,n);p.id=Object(l.generateCueId)(p.startTime,p.endTime,p.text);var m=u[e.getAttribute("region")],g=s[e.getAttribute("style")];p.position=10,p.size=80;var _=function(e,t){var n="http://www.w3.org/ns/ttml#styling";return["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce((function(r,i){var o=v(t,n,i)||v(e,n,i);return o&&(r[i]=o),r}),{})}(m,g),E=_.textAlign;if(E){var x=f[E];x&&(p.lineAlign=x),p.align=E}return c(p,_),p})).filter((function(e){return null!==e}))}(p,_))}catch(e){u(e)}}else u(new Error("Could not parse IMSC1 mdat"))}function m(e,t,n){var r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(n)):[]}function g(e){return e.reduce((function(e,t){var n=t.getAttribute("xml:id");return n&&(e[n]=t),e}),{})}function v(e,t,n){return e.hasAttributeNS(t,n)?e.getAttributeNS(t,n):null}function y(e){return new Error("Could not parse ttml timestamp "+e)}function b(e,t){if(!e)return null;var n=Object(i.parseTimeStamp)(e);return null===n&&(h.test(e)?n=function(e,t){var n=h.exec(e),r=(0|n[4])+(0|n[5])/t.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+r/t.frameRate}(e,t):d.test(e)&&(n=function(e,t){var n=d.exec(e),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/t.frameRate;case"t":return r/t.tickRate}return r}(e,t))),n}},"./src/utils/logger.ts":
/*!*****************************!*\
!*** ./src/utils/logger.ts ***!
\*****************************/
/*! exports provided: enableLogs, logger */function(e,t,n){"use strict";n.r(t),n.d(t,"enableLogs",(function(){return s})),n.d(t,"logger",(function(){return l}));var r=function(){},i={trace:r,debug:r,log:r,warn:r,info:r,error:r},o=i;function a(e){var t=self.console[e];return t?t.bind(self.console,"["+e+"] >"):r}function s(e){if(self.console&&!0===e||"object"==typeof e){!function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];n.forEach((function(t){o[t]=e[t]?e[t].bind(e):a(t)}))}(e,"debug","log","info","warn","error");try{o.log()}catch(e){o=i}}else o=i}var l=i},"./src/utils/mediakeys-helper.ts":
/*!***************************************!*\
!*** ./src/utils/mediakeys-helper.ts ***!
\***************************************/
/*! exports provided: KeySystems, requestMediaKeySystemAccess */function(e,t,n){"use strict";var r;n.r(t),n.d(t,"KeySystems",(function(){return r})),n.d(t,"requestMediaKeySystemAccess",(function(){return i})),function(e){e.WIDEVINE="com.widevine.alpha",e.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(e,t,n){"use strict";function r(){return self.MediaSource||self.WebKitMediaSource}n.r(t),n.d(t,"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(e,t,n){"use strict";n.r(t),n.d(t,"bin2str",(function(){return s})),n.d(t,"readUint16",(function(){return l})),n.d(t,"readUint32",(function(){return c})),n.d(t,"writeUint32",(function(){return u})),n.d(t,"findBox",(function(){return h})),n.d(t,"parseSegmentIndex",(function(){return d})),n.d(t,"parseInitSegment",(function(){return f})),n.d(t,"getStartDTS",(function(){return p})),n.d(t,"getDuration",(function(){return m})),n.d(t,"computeRawDurationFromSamples",(function(){return g})),n.d(t,"offsetStartDTS",(function(){return v})),n.d(t,"segmentValidRange",(function(){return y})),n.d(t,"appendUint8Array",(function(){return b}));var r=n(/*! ./typed-array */"./src/utils/typed-array.ts"),i=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),o=Math.pow(2,32)-1,a=[].push;function s(e){return String.fromCharCode.apply(null,e)}function l(e,t){"data"in e&&(t+=e.start,e=e.data);var n=e[t]<<8|e[t+1];return n<0?65536+n:n}function c(e,t){"data"in e&&(t+=e.start,e=e.data);var n=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return n<0?4294967296+n:n}function u(e,t,n){"data"in e&&(t+=e.start,e=e.data),e[t]=n>>24,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n}function h(e,t){var n,r,i,o=[];if(!t.length)return o;"data"in e?(n=e.data,r=e.start,i=e.end):(r=0,i=(n=e).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))===t[0])if(1===t.length)o.push({data:n,start:l+8,end:d});else{var f=h({data:n,start:l+8,end:d},t.slice(1));f.length&&a.apply(o,f)}l=d}return o}function d(e){var t=h(e,["moov"])[0],n=t?t.end:null,r=h(e,["sidx"]);if(!r||!r[0])return null;var i=[],o=r[0],a=o.data[0],s=0===a?8:16,u=c(o,s);s+=4,s+=0===a?8:16,s+=2;var d=o.end+0,f=l(o,s);s+=2;for(var p=0;p<f;p++){var m=s,g=c(o,m);m+=4;var v=2147483647&g;if(1==(2147483648&g)>>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var y=c(o,m);m+=4,i.push({referenceSize:v,subsegmentDuration:y,info:{duration:y/u,start:d,end:d+v-1}}),d+=v,s=m+=4}return{earliestPresentationTime:0,timescale:u,version:a,referencesCount:f,references:i,moovEndOffset:n}}function f(e){for(var t=[],n=h(e,["moov","trak"]),r=0;r<n.length;r++){var o=n[r],a=h(o,["tkhd"])[0];if(a){var l=a.data[a.start],u=0===l?12:20,d=c(a,u),f=h(o,["mdia","mdhd"])[0];if(f){var p=c(f,u=0===(l=f.data[f.start])?12:20),m=h(o,["mdia","hdlr"])[0];if(m){var g=s(m.data.subarray(m.start+8,m.start+12)),v={soun:i.ElementaryStreamTypes.AUDIO,vide:i.ElementaryStreamTypes.VIDEO}[g];if(v){var y=h(o,["mdia","minf","stbl","stsd"])[0],b=void 0;y&&(b=s(y.data.subarray(y.start+12,y.start+16))),t[d]={timescale:p,type:v},t[v]={timescale:p,id:d,codec:b}}}}}}return h(e,["moov","mvex","trex"]).forEach((function(e){var n=c(e,4),r=t[n];r&&(r.default={duration:c(e,12),flags:c(e,20)})})),t}function p(e,t){return h(t,["moof","traf"]).reduce((function(t,n){var r=h(n,["tfdt"])[0],i=r.data[r.start],o=h(n,["tfhd"]).reduce((function(t,n){var o=c(n,4),a=e[o];if(a){var s=c(r,4);1===i&&(s*=Math.pow(2,32),s+=c(r,8));var l=s/(a.timescale||9e4);if(isFinite(l)&&(null===t||l<t))return l}return t}),null);return null!==o&&isFinite(o)&&(null===t||o<t)?o:t}),null)||0}function m(e,t){for(var n=0,r=0,o=0,a=h(e,["moof","traf"]),s=0;s<a.length;s++){var l=a[s],u=h(l,["tfhd"])[0],f=t[c(u,4)];if(f){var p=f.default,m=c(u,0)|(null==p?void 0:p.flags),v=null==p?void 0:p.duration;8&m&&(v=c(u,2&m?12:8));for(var y=f.timescale||9e4,b=h(l,["trun"]),_=0;_<b.length;_++)n=v?v*c(b[_],4):g(b[_]),f.type===i.ElementaryStreamTypes.VIDEO?r+=n/y:f.type===i.ElementaryStreamTypes.AUDIO&&(o+=n/y)}}if(0===r&&0===o){var E=d(e);if(null!=E&&E.references)return E.references.reduce((function(e,t){return e+t.info.duration||0}),0)}return r||o}function g(e){var t=c(e,0),n=8;1&t&&(n+=4),4&t&&(n+=4);for(var r=0,i=c(e,4),o=0;o<i;o++)256&t&&(r+=c(e,n),n+=4),512&t&&(n+=4),1024&t&&(n+=4),2048&t&&(n+=4);return r}function v(e,t,n){h(t,["moof","traf"]).forEach((function(t){h(t,["tfhd"]).forEach((function(r){var i=c(r,4),a=e[i];if(a){var s=a.timescale||9e4;h(t,["tfdt"]).forEach((function(e){var t=e.data[e.start],r=c(e,4);if(0===t)u(e,4,r-n*s);else{r*=Math.pow(2,32),r+=c(e,8),r-=n*s,r=Math.max(r,0);var i=Math.floor(r/(o+1)),a=Math.floor(r%(o+1));u(e,4,i),u(e,8,a)}}))}}))}))}function y(e){var t={valid:null,remainder:null},n=h(e,["moof"]);if(!n)return t;if(n.length<2)return t.remainder=e,t;var i=n[n.length-1];return t.valid=Object(r.sliceUint8)(e,0,i.start-8),t.remainder=Object(r.sliceUint8)(e,i.start-8),t}function b(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}},"./src/utils/output-filter.ts":
/*!************************************!*\
!*** ./src/utils/output-filter.ts ***!
\************************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return r}));var r=function(){function e(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}var t=e.prototype;return t.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},t.newCue=function(e,t,n){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)},t.reset=function(){this.cueRanges=[]},e}()},"./src/utils/texttrack-utils.ts":
/*!**************************************!*\
!*** ./src/utils/texttrack-utils.ts ***!
\**************************************/
/*! exports provided: sendAddTrackEvent, addCueToTrack, clearCurrentCues, removeCuesInRange, getCuesInRange */function(e,t,n){"use strict";n.r(t),n.d(t,"sendAddTrackEvent",(function(){return i})),n.d(t,"addCueToTrack",(function(){return o})),n.d(t,"clearCurrentCues",(function(){return a})),n.d(t,"removeCuesInRange",(function(){return s})),n.d(t,"getCuesInRange",(function(){return l}));var r=n(/*! ./logger */"./src/utils/logger.ts");function i(e,t){var n;try{n=new Event("addtrack")}catch(e){(n=document.createEvent("Event")).initEvent("addtrack",!1,!1)}n.track=e,t.dispatchEvent(n)}function o(e,t){var n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t)}catch(n){r.logger.debug("[texttrack-utils]: "+n);var i=new self.TextTrackCue(t.startTime,t.endTime,t.text);i.id=t.id,e.addCue(i)}"disabled"===n&&(e.mode=n)}function a(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var n=e.cues.length;n--;)e.removeCue(e.cues[n]);"disabled"===t&&(e.mode=t)}function s(e,t,n){var r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var i=l(e.cues,t,n),o=0;o<i.length;o++)e.removeCue(i[o]);"disabled"===r&&(e.mode=r)}function l(e,t,n){var r=[],i=function(e,t){if(t<e[0].startTime)return 0;var n=e.length-1;if(t>e[n].endTime)return-1;for(var r=0,i=n;r<=i;){var o=Math.floor((i+r)/2);if(t<e[o].startTime)i=o-1;else{if(!(t>e[o].startTime&&r<n))return o;r=o+1}}return e[r].startTime-t<t-e[i].startTime?r:i}(e,t);if(i>-1)for(var o=i,a=e.length;o<a;o++){var s=e[o];if(s.startTime>=t&&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(e,t,n){"use strict";n.r(t),t.default={toString:function(e){for(var t="",n=e.length,r=0;r<n;r++)t+="["+e.start(r).toFixed(3)+","+e.end(r).toFixed(3)+"]";return t}}},"./src/utils/timescale-conversion.ts":
/*!*******************************************!*\
!*** ./src/utils/timescale-conversion.ts ***!
\*******************************************/
/*! exports provided: toTimescaleFromBase, toTimescaleFromScale, toMsFromMpegTsClock, toMpegTsClockFromTimescale */function(e,t,n){"use strict";function r(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=!1);var i=e*t*n;return r?Math.round(i):i}function i(e,t,n,i){return void 0===n&&(n=1),void 0===i&&(i=!1),r(e,t,1/n,i)}function o(e,t){return void 0===t&&(t=!1),r(e,1e3,1/9e4,t)}function a(e,t){return void 0===t&&(t=1),r(e,9e4,1/t)}n.r(t),n.d(t,"toTimescaleFromBase",(function(){return r})),n.d(t,"toTimescaleFromScale",(function(){return i})),n.d(t,"toMsFromMpegTsClock",(function(){return o})),n.d(t,"toMpegTsClockFromTimescale",(function(){return a}))},"./src/utils/typed-array.ts":
/*!**********************************!*\
!*** ./src/utils/typed-array.ts ***!
\**********************************/
/*! exports provided: sliceUint8 */function(e,t,n){"use strict";function r(e,t,n){return Uint8Array.prototype.slice?e.slice(t,n):new Uint8Array(Array.prototype.slice.call(e,t,n))}n.r(t),n.d(t,"sliceUint8",(function(){return r}))},"./src/utils/vttcue.ts":
/*!*****************************!*\
!*** ./src/utils/vttcue.ts ***!
\*****************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),t.default=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var e=["","lr","rl"],t=["start","middle","end","left","right"];function n(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;var n=t.toLowerCase();return!!~e.indexOf(n)&&n}function r(e){return n(t,e)}function i(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var a in o)e[a]=o[a]}return e}function o(t,o,a){var s=this,l={enumerable:!0};s.hasBeenReset=!1;var c="",u=!1,h=t,d=o,f=a,p=null,m="",g=!0,v="auto",y="start",b=50,_="middle",E=50,x="middle";Object.defineProperty(s,"id",i({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(s,"pauseOnExit",i({},l,{get:function(){return u},set:function(e){u=!!e}})),Object.defineProperty(s,"startTime",i({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"endTime",i({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"text",i({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(s,"region",i({},l,{get:function(){return p},set:function(e){p=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"vertical",i({},l,{get:function(){return m},set:function(t){var r=function(t){return n(e,t)}(t);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");m=r,this.hasBeenReset=!0}})),Object.defineProperty(s,"snapToLines",i({},l,{get:function(){return g},set:function(e){g=!!e,this.hasBeenReset=!0}})),Object.defineProperty(s,"line",i({},l,{get:function(){return v},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"lineAlign",i({},l,{get:function(){return y},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"position",i({},l,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"positionAlign",i({},l,{get:function(){return _},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(s,"size",i({},l,{get:function(){return E},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");E=e,this.hasBeenReset=!0}})),Object.defineProperty(s,"align",i({},l,{get:function(){return x},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");x=t,this.hasBeenReset=!0}})),s.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}()},"./src/utils/vttparser.ts":
/*!********************************!*\
!*** ./src/utils/vttparser.ts ***!
\********************************/
/*! exports provided: parseTimeStamp, fixLineBreaks, VTTParser */function(e,t,n){"use strict";n.r(t),n.d(t,"parseTimeStamp",(function(){return o})),n.d(t,"fixLineBreaks",(function(){return h})),n.d(t,"VTTParser",(function(){return d}));var r=n(/*! ./vttcue */"./src/utils/vttcue.ts"),i=function(){function e(){}return e.prototype.decode=function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))},e}();function o(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+parseFloat(r||0)}var n=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?t(n[2],n[3],0,n[4]):t(n[1],n[2],n[3],n[4]):null}var a=function(){function e(){this.values=Object.create(null)}var t=e.prototype;return t.set=function(e,t){this.get(e)||""===t||(this.values[e]=t)},t.get=function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},t.has=function(e){return e in this.values},t.alt=function(e,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}},t.integer=function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},t.percent=function(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1},e}();function s(e,t,n,r){var i=r?e.split(r):[e];for(var o in i)if("string"==typeof i[o]){var a=i[o].split(n);2===a.length&&t(a[0],a[1])}}var l=new r.default(0,0,""),c="middle"===l.align?"middle":"center";function u(e,t,n){var r=e;function i(){var t=o(e);if(null===t)throw new Error("Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(){e=e.replace(/^\s+/,"")}if(u(),t.startTime=i(),u(),"--\x3e"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.substr(3),u(),t.endTime=i(),u(),function(e,t){var r=new a;s(e,(function(e,t){var i;switch(e){case"region":for(var o=n.length-1;o>=0;o--)if(n[o].id===t){r.set(e,n[o].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":i=t.split(","),r.integer(e,i[0]),r.percent(e,i[0])&&r.set("snapToLines",!1),r.alt(e,i[0],["auto"]),2===i.length&&r.alt("lineAlign",i[1],["start",c,"end"]);break;case"position":i=t.split(","),r.percent(e,i[0]),2===i.length&&r.alt("positionAlign",i[1],["start",c,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",c,"end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");var i=r.get("line","auto");"auto"===i&&-1===l.line&&(i=-1),t.line=i,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",c);var o=r.get("position","auto");"auto"===o&&50===l.position&&(o="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=o}(e,t)}function h(e){return e.replace(/<br(?: \/)?>/gi,"\n")}var d=function(){function e(){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 t=e.prototype;return t.parse=function(e){var t=this;function n(){var e=t.buffer,n=0;for(e=h(e);n<e.length&&"\r"!==e[n]&&"\n"!==e[n];)++n;var r=e.substr(0,n);return"\r"===e[n]&&++n,"\n"===e[n]&&++n,t.buffer=e.substr(n),r}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var i="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var o=(i=n()).match(/^()?WEBVTT([ \t].*)?$/);if(!o||!o[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var a=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(a?a=!1:i=n(),t.state){case"HEADER":/:/.test(i)?s(i,(function(e,t){}),/:/):i||(t.state="ID");continue;case"NOTE":i||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){t.state="NOTE";break}if(!i)continue;if(t.cue=new r.default(0,0,""),t.state="CUE",-1===i.indexOf("--\x3e")){t.cue.id=i;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{u(i,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var l=-1!==i.indexOf("--\x3e");if(!i||l&&(a=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=i;continue;case"BADCUE":i||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},t.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(e){this.onparsingerror&&this.onparsingerror(e)}return this.onflush&&this.onflush(),this},e}()},"./src/utils/webvtt-parser.ts":
/*!************************************!*\
!*** ./src/utils/webvtt-parser.ts ***!
\************************************/
/*! exports provided: generateCueId, parseWebVTT */function(e,t,n){"use strict";n.r(t),n.d(t,"generateCueId",(function(){return h})),n.d(t,"parseWebVTT",(function(){return d}));var r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=n(/*! ./vttparser */"./src/utils/vttparser.ts"),o=n(/*! ../demux/id3 */"./src/demux/id3.ts"),a=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(e,t,n){return void 0===n&&(n=0),e.substr(n,t.length)===t},u=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return(t>>>0).toString()};function h(e,t,n){return u(e.toString())+u(t.toString())+u(n)}function d(e,t,n,u,d,f,p,m){var g,v=new i.VTTParser,y=Object(o.utf8ArrayToStr)(new Uint8Array(e)).trim().replace(l,"\n").split("\n"),b=[],_=Object(a.toMpegTsClockFromTimescale)(t,n),E="00:00.000",x=0,w=0,S=!0,k=!1;v.oncue=function(e){var t=u[d],n=u.ccOffset,r=(x-_)/9e4;if(null!=t&&t.new&&(void 0!==w?n=u.ccOffset=t.start:function(e,t,n){var r=e[t],i=e[r.prevCC];if(!i||!i.new&&r.new)return e.ccOffset=e.presentationOffset=r.start,void(r.new=!1);for(;null!==(o=i)&&void 0!==o&&o.new;){var o;e.ccOffset+=r.start-i.start,r.new=!1,i=e[(r=i).prevCC]}e.presentationOffset=n}(u,d,r)),r&&(n=r-u.presentationOffset),k){var i=e.endTime-e.startTime,o=Object(s.normalizePts)(9e4*(e.startTime+n-w),9e4*f)/9e4;e.startTime=o,e.endTime=o+i}var a=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(a)),e.id||(e.id=h(e.startTime,e.endTime,a)),e.endTime>0&&b.push(e)},v.onparsingerror=function(e){g=e},v.onflush=function(){g?m(g):p(b)},y.forEach((function(e){if(S){if(c(e,"X-TIMESTAMP-MAP=")){S=!1,k=!0,e.substr(16).split(",").forEach((function(e){c(e,"LOCAL:")?E=e.substr(6):c(e,"MPEGTS:")&&(x=parseInt(e.substr(7)))}));try{w=function(e){var t=parseInt(e.substr(-3)),n=parseInt(e.substr(-6,2)),i=parseInt(e.substr(-9,2)),o=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;if(!(Object(r.isFiniteNumber)(t)&&Object(r.isFiniteNumber)(n)&&Object(r.isFiniteNumber)(i)&&Object(r.isFiniteNumber)(o)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*n,t+=6e4*i,t+=36e5*o}(E)/1e3}catch(e){k=!1,g=e}return}""===e&&(S=!1)}v.parse(e+"\n")})),v.flush()}},"./src/utils/xhr-loader.ts":
/*!*********************************!*\
!*** ./src/utils/xhr-loader.ts ***!
\*********************************/
/*! exports provided: default */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../utils/logger */"./src/utils/logger.ts"),i=n(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),o=/^age:\s*[\d.]+\s*$/m,a=function(){function e(e){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=e?e.xhrSetup:null,this.stats=new i.LoadStats,this.retryDelay=0}var t=e.prototype;return t.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},t.abortInternal=function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))},t.abort=function(){var e;this.abortInternal(),null!==(e=this.callbacks)&&void 0!==e&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},t.load=function(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.retryDelay=t.retryDelay,this.loadInternal()},t.loadInternal=function(){var e=this.config,t=this.context;if(e){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,t.url)}catch(e){n.open("GET",t.url,!0),i(n,t.url)}n.readyState||n.open("GET",t.url,!0);var o=this.context.headers;if(o)for(var a in o)n.setRequestHeader(a,o[a])}catch(e){return void this.callbacks.onError({code:n.status,text:e.message},t,n)}t.rangeEnd&&n.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),n.onreadystatechange=this.readystatechange.bind(this),n.onprogress=this.loadprogress.bind(this),n.responseType=t.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),e.timeout),n.send()}},t.readystatechange=function(){var e=this.context,t=this.loader,n=this.stats;if(e&&t){var i=t.readyState,o=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){t.onreadystatechange=null,t.onprogress=null;var a=t.status;if(a>=200&&a<300){var s,l;if(n.loading.end=Math.max(self.performance.now(),n.loading.first),l="arraybuffer"===e.responseType?(s=t.response).byteLength:(s=t.responseText).length,n.loaded=n.total=l,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(n,e,s,t),!this.callbacks)return;var u={url:t.responseURL,data:s};this.callbacks.onSuccess(u,n,e,t)}else n.retry>=o.maxRetry||a>=400&&a<499?(r.logger.error(a+" while loading "+e.url),this.callbacks.onError({code:a,text:t.statusText},e,t)):(r.logger.warn(a+" while loading "+e.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),n.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)}},t.loadtimeout=function(){r.logger.warn("timeout while loading "+this.context.url);var e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))},t.loadprogress=function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)},t.getCacheAge=function(){var e=null;if(this.loader&&o.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e},e}();t.default=a}}).default},e.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(e,t,n){e.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(e,t,n){"use strict";n.d(t,"a",(function(){return Z}));var r=n("rePB"),i=n("VTBJ"),o=n("KQm4"),a=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"),m=n("qx4F"),g=n("6eGT"),v=n("IBYe"),y=n("Ff2n"),b=n("c+Xe"),_=n("fyJ8"),E=n("biw7");function x(e,t,n,r,i){var o,a,s=n[e]||{},l=n[t]||{};"left"===s.fixed?o=r.left[e]:"right"===l.fixed&&(a=r.right[t]);var c=!1,u=!1,h=!1,d=!1,f=n[t+1],p=n[e-1];if("rtl"===i){if(void 0!==o)d=!(p&&"left"===p.fixed);else if(void 0!==a){h=!(f&&"right"===f.fixed)}}else if(void 0!==o){c=!(f&&"left"===f.fixed)}else if(void 0!==a){u=!(p&&"right"===p.fixed)}return{fixLeft:o,fixRight:a,lastFixLeft:c,firstFixRight:u,lastFixRight:h,firstFixLeft:d,isSticky:r.isSticky}}var w=n("sR1s");function S(e){var t,n=e.cells,r=e.stickyOffsets,i=e.flattenColumns,o=e.rowComponent,a=e.cellComponent,s=e.onHeaderRow,c=e.index,u=l.useContext(E.a),h=u.prefixCls,d=u.direction;s&&(t=s(n.map((function(e){return e.column})),c));var f=Object(w.a)(n.map((function(e){return e.column})));return l.createElement(o,Object.assign({},t),n.map((function(e,t){var n,o=e.column,s=x(e.colStart,e.colEnd,i,r,d);return o&&o.onHeaderCell&&(n=e.column.onHeaderCell(o)),l.createElement(_.a,Object.assign({},e,{ellipsis:o.ellipsis,align:o.align,component:a,prefixCls:h,key:f[t]},s,{additionalProps:n,rowType:"header"}))})))}S.displayName="HeaderRow";var k=S;var C=function(e){var t=e.stickyOffsets,n=e.columns,r=e.flattenColumns,i=e.onHeaderRow,o=l.useContext(E.a),a=o.prefixCls,s=o.getComponent,c=l.useMemo((function(){return function(e){var t=[];!function e(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[i]=t[i]||[];var o=r,a=n.filter(Boolean).map((function(n){var r={key:n.key,className:n.className||"",children:n.title,column:n,colStart:o},a=1,s=n.children;return s&&s.length>0&&(a=e(s,o,i+1).reduce((function(e,t){return e+t}),0),r.hasSubColumns=!0),"colSpan"in n&&(a=n.colSpan),"rowSpan"in n&&(r.rowSpan=n.rowSpan),r.colSpan=a,r.colEnd=r.colStart+a-1,t[i].push(r),o+=a,a}));return a}(e,0);for(var n=t.length,r=function(e){t[e].forEach((function(t){"rowSpan"in t||t.hasSubColumns||(t.rowSpan=n-e)}))},i=0;i<n;i+=1)r(i);return t}(n)}),[n]),u=s(["header","wrapper"],"thead"),h=s(["header","row"],"tr"),d=s(["header","cell"],"th");return l.createElement(u,{className:"".concat(a,"-thead")},c.map((function(e,n){return l.createElement(k,{key:n,flattenColumns:r,cells:e,stickyOffsets:t,rowComponent:h,cellComponent:d,onHeaderRow:i,index:n})})))},T=n("hW8S");var O=function(e){for(var t=e.colWidths,n=e.columns,r=[],i=!1,o=(e.columCount||n.length)-1;o>=0;o-=1){var a=t[o],s=n&&n[o],c=s&&s[T.a];(a||c||i)&&(r.unshift(l.createElement("col",Object.assign({key:o,style:{width:a,minWidth:a}},c))),i=!0)}return l.createElement("colgroup",null,r)};var A=l.forwardRef((function(e,t){var n=e.noData,a=e.columns,s=e.flattenColumns,c=e.colWidths,h=e.columCount,d=e.stickyOffsets,f=e.direction,p=e.fixHeader,m=e.offsetHeader,g=e.stickyClassName,v=e.onScroll,_=Object(y.a)(e,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),x=l.useContext(E.a),w=x.prefixCls,S=x.scrollbarSize,k=x.isSticky,T=k&&!p?0:S,A=l.useRef(null),L=l.useCallback((function(e){Object(b.b)(t,e),Object(b.b)(A,e)}),[]);l.useEffect((function(){var e;function t(e){var t=e.currentTarget,n=e.deltaX;n&&(v({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}return null===(e=A.current)||void 0===e||e.addEventListener("wheel",t),function(){var e;null===(e=A.current)||void 0===e||e.removeEventListener("wheel",t)}}),[]);var R=s[s.length-1],D={fixed:R?R.fixed:null,onHeaderCell:function(){return{className:"".concat(w,"-cell-scrollbar")}}},I=Object(l.useMemo)((function(){return T?[].concat(Object(o.a)(a),[D]):a}),[T,a]),M=Object(l.useMemo)((function(){return T?[].concat(Object(o.a)(s),[D]):s}),[T,s]),N=Object(l.useMemo)((function(){var e=d.right,t=d.left;return Object(i.a)(Object(i.a)({},d),{},{left:"rtl"===f?[].concat(Object(o.a)(t.map((function(e){return e+T}))),[0]):t,right:"rtl"===f?e:[].concat(Object(o.a)(e.map((function(e){return e+T}))),[0]),isSticky:k})}),[T,d,k]),P=function(e,t){return Object(l.useMemo)((function(){for(var n=[],r=0;r<t;r+=1){var i=e[r];if(void 0===i)return null;n[r]=i}return n}),[e.join("_"),t])}(c,h);return l.createElement("div",{style:Object(i.a)({overflow:"hidden"},k?{top:m}:{}),ref:L,className:u()("".concat(w,"-header"),Object(r.a)({},g,!!g))},l.createElement("table",{style:{tableLayout:"fixed",visibility:n||P?null:"hidden"}},l.createElement(O,{colWidths:P?[].concat(Object(o.a)(P),[T]):[],columCount:h+1,columns:M}),l.createElement(C,Object.assign({},_,{stickyOffsets:N,columns:I,flattenColumns:M}))))}));A.displayName="FixedHeader";var L=A,R=l.createContext(null);var D=function(e){var t=e.prefixCls,n=e.children,r=e.component,i=e.cellComponent,o=e.fixHeader,a=e.fixColumn,s=e.horizonScroll,c=e.className,u=e.expanded,h=e.componentWidth,d=e.colSpan,f=l.useContext(E.a).scrollbarSize;return l.useMemo((function(){var e=n;return a&&(e=l.createElement("div",{style:{width:h-(o?f:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(t,"-expanded-row-fixed")},e)),l.createElement(r,{className:c,style:{display:u?null:"none"}},l.createElement(_.a,{component:i,prefixCls:t,colSpan:d},e))}),[n,r,o,s,c,u,h,d,f])};function I(e){var t=e.className,n=e.style,r=e.record,o=e.index,a=e.rowKey,c=e.getRowKey,h=e.rowExpandable,d=e.expandedKeys,f=e.onRow,p=e.indent,m=void 0===p?0:p,g=e.rowComponent,v=e.cellComponent,y=e.childrenColumnName,b=l.useContext(E.a),x=b.prefixCls,S=b.fixedInfoList,k=l.useContext(R),C=k.fixHeader,T=k.fixColumn,O=k.horizonScroll,A=k.componentWidth,L=k.flattenColumns,M=k.expandableType,N=k.expandRowByClick,P=k.onTriggerExpand,j=k.rowClassName,B=k.expandedRowClassName,F=k.indentSize,U=k.expandIcon,G=k.expandedRowRender,z=k.expandIconColumnIndex,H=l.useState(!1),V=Object(s.a)(H,2),W=V[0],K=V[1],q=d&&d.has(e.recordKey);l.useEffect((function(){q&&K(!0)}),[q]);var X,Y="row"===M&&(!h||h(r)),$="nest"===M,J=y&&r&&r[y],Z=Y||$;f&&(X=f(r,o));var Q;"string"==typeof j?Q=j:"function"==typeof j&&(Q=j(r,o,m));var ee,te,ne=Object(w.a)(L),re=l.createElement(g,Object.assign({},X,{"data-row-key":a,className:u()(t,"".concat(x,"-row"),"".concat(x,"-row-level-").concat(m),Q,X&&X.className),style:Object(i.a)(Object(i.a)({},n),X?X.style:null),onClick:function(e){if(N&&Z&&P(r,e),X&&X.onClick){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];(t=X).onClick.apply(t,[e].concat(i))}}}),L.map((function(e,t){var n,i,a=e.render,s=e.dataIndex,c=e.className,u=ne[t],h=S[t];return t===(z||0)&&$&&(n=l.createElement(l.Fragment,null,l.createElement("span",{style:{paddingLeft:"".concat(F*m,"px")},className:"".concat(x,"-row-indent indent-level-").concat(m)}),U({prefixCls:x,expanded:q,expandable:J,record:r,onExpand:P}))),e.onCell&&(i=e.onCell(r,o)),l.createElement(_.a,Object.assign({className:c,ellipsis:e.ellipsis,align:e.align,component:v,prefixCls:x,key:u,record:r,index:o,dataIndex:s,render:a,shouldCellUpdate:e.shouldCellUpdate},h,{appendNode:n,additionalProps:i}))})));if(Y&&(W||q)){var ie=G(r,o,m+1,q),oe=B&&B(r,o,m);ee=l.createElement(D,{expanded:q,className:u()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(m+1),oe),prefixCls:x,fixHeader:C,fixColumn:T,horizonScroll:O,component:g,componentWidth:A,cellComponent:v,colSpan:L.length},ie)}return J&&q&&(te=(r[y]||[]).map((function(t,n){var r=c(t,n);return l.createElement(I,Object.assign({},e,{key:r,rowKey:r,record:t,recordKey:r,index:n,indent:m+1}))}))),l.createElement(l.Fragment,null,re,ee,te)}I.displayName="BodyRow";var M=I,N=l.createContext(null);function P(e){var t=e.columnKey,n=e.onColumnResize,r=l.useRef();return l.useEffect((function(){r.current&&n(t,r.current.offsetWidth)}),[]),l.createElement(p.a,{onResize:function(e){var r=e.offsetWidth;n(t,r)}},l.createElement("td",{ref:r,style:{padding:0,border:0,height:0}},l.createElement("div",{style:{height:0,overflow:"hidden"}}," ")))}var j=l.memo((function(e){var t=e.data,n=e.getRowKey,r=e.measureColumnWidth,i=e.expandedKeys,o=e.onRow,a=e.rowExpandable,s=e.emptyNode,c=e.childrenColumnName,u=l.useContext(N).onColumnResize,h=l.useContext(E.a),d=h.prefixCls,f=h.getComponent,p=l.useContext(R),m=p.fixHeader,g=p.horizonScroll,v=p.flattenColumns,y=p.componentWidth;return l.useMemo((function(){var e,h=f(["body","wrapper"],"tbody"),p=f(["body","row"],"tr"),b=f(["body","cell"],"td");e=t.length?t.map((function(e,t){var r=n(e,t);return l.createElement(M,{key:r,rowKey:r,record:e,recordKey:r,index:t,rowComponent:p,cellComponent:b,expandedKeys:i,onRow:o,getRowKey:n,rowExpandable:a,childrenColumnName:c})})):l.createElement(D,{expanded:!0,className:"".concat(d,"-placeholder"),prefixCls:d,fixHeader:m,fixColumn:g,horizonScroll:g,component:p,componentWidth:y,cellComponent:b,colSpan:v.length},s);var _=Object(w.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}},_.map((function(e){return l.createElement(P,{key:e,columnKey:e,onColumnResize:u})}))),e)}),[t,d,o,r,i,n,f,y,s,v])}));j.displayName="Body";var B=j,F=n("wRmb"),U=n("xEkU"),G=n.n(U);function z(e){var t=Object(l.useRef)(e),n=Object(l.useState)({}),r=Object(s.a)(n,2)[1],i=Object(l.useRef)(null),o=Object(l.useRef)([]);return Object(l.useEffect)((function(){return function(){G.a.cancel(i.current)}}),[]),[t.current,function(e){null===i.current&&(o.current=[],i.current=G()((function(){o.current.forEach((function(e){t.current=e(t.current)})),i.current=null,r({})}))),o.current.push(e)}]}var H=function(e,t,n){return Object(l.useMemo)((function(){for(var r=[],i=[],o=0,a=0,s=0;s<t;s+=1)if("rtl"===n){i[s]=a,a+=e[s]||0;var l=t-s-1;r[l]=o,o+=e[l]||0}else{r[s]=o,o+=e[s]||0;var c=t-s-1;i[c]=a,a+=e[c]||0}return{left:r,right:i}}),[e,t,n])};var V=function(e){var t=e.className,n=e.children;return l.createElement("div",{className:t},n)},W=n("n6Qo");function K(e){var t,n=e.prefixCls,i=e.record,o=e.onExpand,a=e.expanded,s=e.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,(t={},Object(r.a)(t,"".concat(n,"-row-expanded"),a),Object(r.a)(t,"".concat(n,"-row-collapsed"),!a),t)),onClick:function(e){o(i,e),e.stopPropagation()}})}var q=n("zT1h"),X=n("y0+3"),Y=l.forwardRef((function(e,t){var n,o,a=e.scrollBodyRef,c=e.onScroll,h=e.offsetScroll,d=l.useContext(E.a).prefixCls,f=(null===(n=a.current)||void 0===n?void 0:n.scrollWidth)||0,p=(null===(o=a.current)||void 0===o?void 0:o.clientWidth)||0,g=f&&p*(p/f),v=l.useRef(),y=z({scrollLeft:0,isHiddenScrollBar:!1}),b=Object(s.a)(y,2),_=b[0],x=b[1],w=l.useRef({delta:0,x:0}),S=l.useState(!1),k=Object(s.a)(S,2),C=k[0],T=k[1],O=function(){T(!1)},A=function(e){var t,n=(e||(null===(t=window)||void 0===t?void 0:t.event)).buttons;if(C&&0!==n){var r=w.current.x+e.pageX-w.current.x-w.current.delta;r<=0&&(r=0),r+g>=p&&(r=p-g),c({scrollLeft:r/p*(f+2)}),w.current.x=e.pageX}else C&&T(!1)},L=function(){var e=Object(X.b)(a.current).top,t=e+a.current.offsetHeight,n=document.documentElement.scrollTop+window.innerHeight;t-Object(m.a)()<=n||e>=n-h?x((function(e){return Object(i.a)(Object(i.a)({},e),{},{isHiddenScrollBar:!0})})):x((function(e){return Object(i.a)(Object(i.a)({},e),{},{isHiddenScrollBar:!1})}))},R=function(e){x((function(t){return Object(i.a)(Object(i.a)({},t),{},{scrollLeft:e/f*p||0})}))};return l.useImperativeHandle(t,(function(){return{setScrollLeft:R}})),l.useEffect((function(){var e=Object(q.a)(document.body,"mouseup",O,!1),t=Object(q.a)(document.body,"mousemove",A,!1);return L(),function(){e.remove(),t.remove()}}),[g,C]),l.useEffect((function(){var e=Object(q.a)(window,"scroll",L,!1),t=Object(q.a)(window,"resize",L,!1);return function(){e.remove(),t.remove()}}),[]),l.useEffect((function(){_.isHiddenScrollBar||x((function(e){var t,n;return Object(i.a)(Object(i.a)({},e),{},{scrollLeft:a.current.scrollLeft/(null===(t=a.current)||void 0===t?void 0:t.scrollWidth)*(null===(n=a.current)||void 0===n?void 0:n.clientWidth)})}))}),[_.isHiddenScrollBar]),f<=p||!g||_.isHiddenScrollBar?null:l.createElement("div",{style:{height:Object(m.a)(),width:p,bottom:h},className:"".concat(d,"-sticky-scroll")},l.createElement("div",{onMouseDown:function(e){e.persist(),w.current.delta=e.pageX-_.scrollLeft,w.current.x=0,T(!0),e.preventDefault()},ref:v,className:u()("".concat(d,"-sticky-scroll-bar"),Object(r.a)({},"".concat(d,"-sticky-scroll-bar-active"),C)),style:{width:"".concat(g,"px"),transform:"translate3d(".concat(_.scrollLeft,"px, 0, 0)")}}))}));var $=[],J={},Z="rc-table-internal-hook",Q=l.memo((function(e){return e.children}),(function(e,t){return!!d()(e.props,t.props)&&(e.pingLeft!==t.pingLeft||e.pingRight!==t.pingRight)}));function ee(e){var t,n=e.prefixCls,c=e.className,h=e.rowClassName,d=e.style,g=e.data,v=e.rowKey,y=e.scroll,b=e.tableLayout,_=e.direction,S=e.title,k=e.footer,A=e.summary,D=e.id,I=e.showHeader,M=e.components,P=e.emptyText,j=e.onRow,U=e.onHeaderRow,G=e.internalHooks,q=e.transformColumns,X=e.internalRefs,ee=e.sticky,te=g||$,ne=!!te.length,re=l.useState(0),ie=Object(s.a)(re,2),oe=ie[0],ae=ie[1];l.useEffect((function(){ae(Object(m.a)())}));var se,le,ce,ue=l.useMemo((function(){return Object(w.c)(M,{})}),[M]),he=l.useCallback((function(e,t){return Object(w.b)(ue,e)||t}),[ue]),de=l.useMemo((function(){return"function"==typeof v?v:function(e){return e&&e[v]}}),[v]),fe=Object(T.c)(e),pe=fe.expandIcon,me=fe.expandedRowKeys,ge=fe.defaultExpandedRowKeys,ve=fe.defaultExpandAllRows,ye=fe.expandedRowRender,be=fe.onExpand,_e=fe.onExpandedRowsChange,Ee=fe.expandRowByClick,xe=fe.rowExpandable,we=fe.expandIconColumnIndex,Se=fe.expandedRowClassName,ke=fe.childrenColumnName,Ce=fe.indentSize,Te=pe||K,Oe=ke||"children",Ae=l.useMemo((function(){return ye?"row":!!(e.expandable&&G===Z&&e.expandable.__PARENT_RENDER_ICON__||te.some((function(e){return e&&"object"===Object(a.a)(e)&&e[Oe]})))&&"nest"}),[!!ye,te]),Le=l.useState((function(){return ge||(ve?function(e,t,n){var r=[];return function e(i){(i||[]).forEach((function(i,o){r.push(t(i,o)),e(i[n])}))}(e),r}(te,de,Oe):[])})),Re=Object(s.a)(Le,2),De=Re[0],Ie=Re[1],Me=l.useMemo((function(){return new Set(me||De||[])}),[me,De]),Ne=l.useCallback((function(e){var t,n=de(e,te.indexOf(e)),r=Me.has(n);r?(Me.delete(n),t=Object(o.a)(Me)):t=[].concat(Object(o.a)(Me),[n]),Ie(t),be&&be(!r,e),_e&&_e(t)}),[de,Me,te,be,_e]),Pe=l.useState(0),je=Object(s.a)(Pe,2),Be=je[0],Fe=je[1],Ue=Object(F.b)(Object(i.a)(Object(i.a)(Object(i.a)({},e),fe),{},{expandable:!!ye,expandedKeys:Me,getRowKey:de,onTriggerExpand:Ne,expandIcon:Te,expandIconColumnIndex:we,direction:_}),G===Z?q:null),Ge=Object(s.a)(Ue,2),ze=Ge[0],He=Ge[1],Ve=l.useMemo((function(){return{columns:ze,flattenColumns:He}}),[ze,He]),We=l.useRef(),Ke=l.useRef(),qe=l.useRef(),Xe=l.useState(!1),Ye=Object(s.a)(Xe,2),$e=Ye[0],Je=Ye[1],Ze=l.useState(!1),Qe=Object(s.a)(Ze,2),et=Qe[0],tt=Qe[1],nt=z(new Map),rt=Object(s.a)(nt,2),it=rt[0],ot=rt[1],at=Object(w.a)(He).map((function(e){return it.get(e)})),st=l.useMemo((function(){return at}),[at.join("_")]),lt=H(st,He.length,_),ct=y&&Object(w.d)(y.y),ut=y&&Object(w.d)(y.x),ht=ut&&He.some((function(e){return e.fixed})),dt=l.useRef(),ft=function(e,t){return l.useMemo((function(){var n=!!e;return{isSticky:n,stickyClassName:n?"".concat(t,"-sticky-header"):"",offsetHeader:"object"===Object(a.a)(e)&&e.offsetHeader||0,offsetScroll:"object"===Object(a.a)(e)&&e.offsetScroll||0}}),[e,t])}(ee,n),pt=ft.isSticky,mt=ft.offsetHeader,gt=ft.offsetScroll,vt=ft.stickyClassName;ct&&(le={overflowY:"scroll",maxHeight:y.y}),ut&&(se={overflowX:"auto"},ct||(le={overflowY:"hidden"}),ce={width:!0===y.x?"auto":y.x,minWidth:"100%"});var yt=l.useCallback((function(e,t){ot((function(n){var r=new Map(n);return r.set(e,t),r}))}),[]),bt=function(e){var t=Object(l.useRef)(e),n=Object(l.useRef)(null);function r(){window.clearTimeout(n.current)}return Object(l.useEffect)((function(){return r}),[]),[function(e){t.current=e,r(),n.current=window.setTimeout((function(){t.current=null,n.current=null}),100)},function(){return t.current}]}(null),_t=Object(s.a)(bt,2),Et=_t[0],xt=_t[1];function wt(e,t){t&&("function"==typeof t?t(e):t.scrollLeft!==e&&(t.scrollLeft=e))}var St=function(e){var t,n=e.currentTarget,r=e.scrollLeft,i="number"==typeof r?r:n.scrollLeft,o=n||J;xt()&&xt()!==o||(Et(o),wt(i,Ke.current),wt(i,qe.current),wt(i,null===(t=dt.current)||void 0===t?void 0:t.setScrollLeft));if(n){var a=n.scrollWidth,s=n.clientWidth;Je(i>0),tt(i<a-s)}},kt=function(){qe.current&&St({currentTarget:qe.current})};l.useEffect((function(){return kt}),[]),l.useEffect((function(){ut&&kt()}),[ut]),l.useEffect((function(){G===Z&&X&&(X.body.current=qe.current)}));var Ct,Tt,Ot=he(["table"],"table"),At=l.useMemo((function(){return b||(ht?"max-content"===y.x?"auto":"fixed":ct||He.some((function(e){return e.ellipsis}))?"fixed":"auto")}),[ct,ht,He,b]),Lt={colWidths:st,columCount:He.length,stickyOffsets:lt,onHeaderRow:U,fixHeader:ct},Rt=l.useMemo((function(){return ne?null:"function"==typeof P?P():P}),[ne,P]),Dt=l.createElement(B,{data:te,measureColumnWidth:ct||ut||pt,expandedKeys:Me,rowExpandable:xe,getRowKey:de,onRow:j,emptyNode:Rt,childrenColumnName:Oe}),It=l.createElement(O,{colWidths:He.map((function(e){return e.width})),columns:He}),Mt=A&&l.createElement(W.b,null,A(te)),Nt=he(["body"]);ct||pt?("function"==typeof Nt?(Tt=Nt(te,{scrollbarSize:oe,ref:qe,onScroll:St}),Lt.colWidths=He.map((function(e,t){var n=e.width,r=t===ze.length-1?n-oe: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}))):Tt=l.createElement("div",{style:Object(i.a)(Object(i.a)({},se),le),onScroll:St,ref:qe,className:u()("".concat(n,"-body"))},l.createElement(Ot,{style:Object(i.a)(Object(i.a)({},ce),{},{tableLayout:At})},It,Dt,Mt),pt&&l.createElement(Y,{ref:dt,offsetScroll:gt,scrollBodyRef:qe,onScroll:St})),Ct=l.createElement(l.Fragment,null,!1!==I&&l.createElement(L,Object.assign({noData:!te.length},Lt,Ve,{direction:_,offsetHeader:mt,stickyClassName:vt,ref:Ke,onScroll:St})),Tt)):Ct=l.createElement("div",{style:Object(i.a)(Object(i.a)({},se),le),className:u()("".concat(n,"-content")),onScroll:St,ref:qe},l.createElement(Ot,{style:Object(i.a)(Object(i.a)({},ce),{},{tableLayout:At})},It,!1!==I&&l.createElement(C,Object.assign({},Lt,Ve)),Dt,Mt));var Pt=Object(T.b)(e),jt=l.createElement("div",Object.assign({className:u()(n,c,(t={},Object(r.a)(t,"".concat(n,"-rtl"),"rtl"===_),Object(r.a)(t,"".concat(n,"-ping-left"),$e),Object(r.a)(t,"".concat(n,"-ping-right"),et),Object(r.a)(t,"".concat(n,"-layout-fixed"),"fixed"===b),Object(r.a)(t,"".concat(n,"-fixed-header"),ct),Object(r.a)(t,"".concat(n,"-fixed-column"),ht),Object(r.a)(t,"".concat(n,"-scroll-horizontal"),ut),Object(r.a)(t,"".concat(n,"-has-fix-left"),He[0]&&He[0].fixed),Object(r.a)(t,"".concat(n,"-has-fix-right"),He[He.length-1]&&"right"===He[He.length-1].fixed),t)),style:d,id:D,ref:We},Pt),l.createElement(Q,{pingLeft:$e,pingRight:et,props:Object(i.a)(Object(i.a)({},e),{},{stickyOffsets:lt,mergedExpandedKeys:Me})},S&&l.createElement(V,{className:"".concat(n,"-title")},S(te)),l.createElement("div",{className:"".concat(n,"-container")},Ct),k&&l.createElement(V,{className:"".concat(n,"-footer")},k(te))));ut&&(jt=l.createElement(p.a,{onResize:function(e){var t=e.width;kt(),Fe(We.current?We.current.offsetWidth:t)}},jt));var Bt=l.useMemo((function(){return{prefixCls:n,getComponent:he,scrollbarSize:oe,direction:_,fixedInfoList:He.map((function(e,t){return x(t,t,He,lt,_)})),isSticky:pt}}),[n,he,oe,_,He,lt,_,pt]),Ft=l.useMemo((function(){return Object(i.a)(Object(i.a)({},Ve),{},{tableLayout:At,rowClassName:h,expandedRowClassName:Se,componentWidth:Be,fixHeader:ct,fixColumn:ht,horizonScroll:ut,expandIcon:Te,expandableType:Ae,expandRowByClick:Ee,expandedRowRender:ye,onTriggerExpand:Ne,expandIconColumnIndex:we,indentSize:Ce})}),[Ve,At,h,Se,Be,ct,ht,ut,Te,Ae,Ee,ye,Ne,we,Ce]),Ut=l.useMemo((function(){return{onColumnResize:yt}}),[yt]);return l.createElement(E.a.Provider,{value:Bt},l.createElement(R.Provider,{value:Ft},l.createElement(N.Provider,{value:Ut},jt)))}ee.Column=v.a,ee.ColumnGroup=g.a,ee.Summary=W.a,ee.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};t.b=ee},wRmb:
/*!******************************************************!*\
!*** ./node_modules/rc-table/es/hooks/useColumns.js ***!
\******************************************************/
/*! exports provided: convertChildrenToColumns, default */
/*! exports used: convertChildrenToColumns, default */function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(/*! @babel/runtime/helpers/esm/defineProperty */"rePB"),i=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),o=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),a=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(e){return Object(l.a)(e).filter((function(e){return s.isValidElement(e)})).map((function(e){var t=e.key,n=e.props,r=n.children,i=Object(a.a)(n,["children"]),s=Object(o.a)({key:t},i);return r&&(s.children=u(r)),s}))}function h(e){return e.reduce((function(e,t){var n=t.fixed,r=!0===n?"left":n,a=t.children;return a&&a.length>0?[].concat(Object(i.a)(e),Object(i.a)(h(a).map((function(e){return Object(o.a)({fixed:r},e)})))):[].concat(Object(i.a)(e),[Object(o.a)(Object(o.a)({},t),{},{fixed:r})])}),[])}t.b=function(e,t){var n=e.prefixCls,i=e.columns,l=e.children,d=e.expandable,f=e.expandedKeys,p=e.getRowKey,m=e.onTriggerExpand,g=e.expandIcon,v=e.rowExpandable,y=e.expandIconColumnIndex,b=e.direction,_=e.expandRowByClick,E=s.useMemo((function(){return i||u(l)}),[i,l]),x=s.useMemo((function(){if(d){var e,t=y||0,i=E[t],o=(e={},Object(r.a)(e,c.a,{className:"".concat(n,"-expand-icon-col")}),Object(r.a)(e,"title",""),Object(r.a)(e,"fixed",i?i.fixed:null),Object(r.a)(e,"className","".concat(n,"-row-expand-icon-cell")),Object(r.a)(e,"render",(function(e,t,r){var i=p(t,r),o=f.has(i),a=!v||v(t),l=g({prefixCls:n,expanded:o,expandable:a,record:t,onExpand:m});return _?s.createElement("span",{onClick:function(e){return e.stopPropagation()}},l):l})),e),a=E.slice();return t>=0&&a.splice(t,0,o),a}return E}),[d,E,p,f,g,b]),w=s.useMemo((function(){var e=x;return t&&(e=t(e)),e.length||(e=[{render:function(){return null}}]),e}),[t,x,b]),S=s.useMemo((function(){return"rtl"===b?function(e){return e.map((function(e){var t=e.fixed,n=Object(a.a)(e,["fixed"]),r=t;return"left"===t?r="right":"right"===t&&(r="left"),Object(o.a)({fixed:r},n)}))}(h(w)):h(w)}),[w,b]);return[w,S]}},wU8J:
/*!*********************************************!*\
!*** ./node_modules/qr.js/lib/BitBuffer.js ***!
\*********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){function n(){this.buffer=new Array,this.length=0}n.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=n},wW8i:
/*!********************************************************************************************************!*\
!*** ./src/pages/Question/OjProblem/LeftPanel/FilterList/ListDetails/CustomDiscuss/index.less?modules ***!
\********************************************************************************************************/
/*! no static exports found */
/*! exports used: default */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___3xqQI",flex_space_between:"flex_space_between___1fvHN",flex_box_vertical_center:"flex_box_vertical_center___1Gb4J",flex_box_center_end:"flex_box_center_end___8RbQi",flex_box_column:"flex_box_column___3xL78",discuss:"discuss___ybobd",reply:"reply___3EgHc",pagination:"pagination___2EiMG"}},"y0+3":
/*!********************************************!*\
!*** ./node_modules/rc-util/es/Dom/css.js ***!
\********************************************/
/*! exports provided: get, set, getOuterWidth, getOuterHeight, getDocSize, getClientSize, getScroll, getOffset */
/*! exports used: getClientSize, getOffset */function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}));function r(){return{width:document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}}function i(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}},ynwM:
/*!************************************************************!*\
!*** ./node_modules/store/storages/oldFF-globalStorage.js ***!
\************************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var r=n(/*! ../src/util */"MFOe").Global;e.exports={name:"oldFF-globalStorage",read:function(e){return i[e]},write:function(e,t){i[e]=t},each:o,remove:function(e){return i.removeItem(e)},clearAll:function(){o((function(e,t){delete i[e]}))}};var i=r.globalStorage;function o(e){for(var t=i.length-1;t>=0;t--){var n=i.key(t);e(i[n],n)}}}}]);