(window.webpackJsonp=window.webpackJsonp||[]).push([[232,5,6,7],{"+NIl": /*!***************************************************!*\ !*** ./node_modules/codemirror/mode/stex/stex.js ***! \***************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){"use strict";e.defineMode("stex",(function(e,t){function r(e,t){e.cmdState.push(t)}function n(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function i(e,t,r){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=r,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var a={};function s(e,t){e.f=t}function o(e,t){var i;if(e.match(/^\\[a-zA-Z@]+/)){var o=e.current().slice(1);return r(t,i=new(i=a.hasOwnProperty(o)?a[o]:a.DEFAULT)),s(t,u),i.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return s(t,(function(e,t){return l(e,t,"\\]")})),"keyword";if(e.match("\\("))return s(t,(function(e,t){return l(e,t,"\\)")})),"keyword";if(e.match("$$"))return s(t,(function(e,t){return l(e,t,"$$")})),"keyword";if(e.match("$"))return s(t,(function(e,t){return l(e,t,"$")})),"keyword";var c=e.next();return"%"==c?(e.skipToEnd(),"comment"):"}"==c||"]"==c?(i=n(t))?(i.closeBracket(c),s(t,u),"bracket"):"error":"{"==c||"["==c?(r(t,i=new(i=a.DEFAULT)),"bracket"):/\d/.test(c)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(i=function(e){for(var t=e.cmdState,r=t.length-1;r>=0;r--){var n=t[r];if("DEFAULT"!=n.name)return n}return{styleIdentifier:function(){return null}}}(t)).name&&(i.argument=e.current()),i.styleIdentifier())}function l(e,t,r){if(e.eatSpace())return null;if(r&&e.match(r))return s(t,o),"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 n=e.next();return"{"==n||"}"==n||"["==n||"]"==n||"("==n||")"==n?"bracket":"%"==n?(e.skipToEnd(),"comment"):"error"}function u(e,t){var r=e.peek();return"{"==r||"["==r?(n(t).openBracket(r),e.eat(r),s(t,o),"bracket"):/[ \t\r]/.test(r)?(e.eat(r),null):(s(t,o),function(e){var t=e.cmdState.pop();t&&t.closeBracket()}(t),o(e,t))}return a.importmodule=i("importmodule","tag",["string","builtin"]),a.documentclass=i("documentclass","tag",["","atom"]),a.usepackage=i("usepackage","tag",["atom"]),a.begin=i("begin","tag",["atom"]),a.end=i("end","tag",["atom"]),a.label=i("label","tag",["atom"]),a.ref=i("ref","tag",["atom"]),a.eqref=i("eqref","tag",["atom"]),a.cite=i("cite","tag",["atom"]),a.bibitem=i("bibitem","tag",["atom"]),a.Bibitem=i("Bibitem","tag",["atom"]),a.RBibitem=i("RBibitem","tag",["atom"]),a.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:t.inMathMode?function(e,t){return l(e,t)}:o}},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=o,e.cmdState.length=0},lineComment:"%"}})),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}(r(/*! ../../lib/codemirror */"VrN/"))},"19Vz": /*!**************************************************************!*\ !*** ./node_modules/codemirror/addon/display/placeholder.js ***! \**************************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function r(e){t(e);var r=e.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=e.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var n=e.getOption("placeholder");"string"==typeof n&&(n=document.createTextNode(n)),r.appendChild(n),e.display.lineSpace.insertBefore(r,e.display.lineSpace.firstChild)}function n(e){a(e)&&r(e)}function i(e){var n=e.getWrapperElement(),i=a(e);n.className=n.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?r(e):t(e)}function a(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(a,s,o){var l=o&&o!=e.Init;if(s&&!l)a.on("blur",n),a.on("change",i),a.on("swapDoc",i),e.on(a.getInputField(),"compositionupdate",a.state.placeholderCompose=function(){!function(e){setTimeout((function(){var n=!1,i=e.getInputField();"TEXTAREA"==i.nodeName?n=!i.value:1==e.lineCount()&&(n=!/[^\u200b]/.test(i.querySelector(".CodeMirror-line").textContent)),n?r(e):t(e)}),20)}(a)}),i(a);else if(!s&&l){a.off("blur",n),a.off("change",i),a.off("swapDoc",i),e.off(a.getInputField(),"compositionupdate",a.state.placeholderCompose),t(a);var u=a.getWrapperElement();u.className=u.className.replace(" CodeMirror-empty","")}s&&!a.hasFocus()&&n(a)}))}(r(/*! ../../lib/codemirror */"VrN/"))},"1eCo": /*!*************************************************!*\ !*** ./node_modules/codemirror/mode/xml/xml.js ***! \*************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!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},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(n,i){var a,s,o=n.indentUnit,l={},u=i.htmlMode?t:r;for(var c in u)l[c]=u[c];for(var c in i)l[c]=i[c];function d(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();return"<"==n?e.eat("!")?e.eat("[")?e.match("CDATA[")?r(h("atom","]]>")):null:e.match("--")?r(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(function e(t){return function(r,n){for(var i;null!=(i=r.next());){if("<"==i)return n.tokenize=e(t+1),n.tokenize(r,n);if(">"==i){if(1==t){n.tokenize=d;break}return n.tokenize=e(t-1),n.tokenize(r,n)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(a=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"tag bracket"):"&"==n?(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 f(e,t){var r,n,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,a=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return a="equals",null;if("<"==i){t.tokenize=d,t.state=v,t.tagName=t.tagStart=null;var s=t.tokenize(e,t);return s?s+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(r=i,(n=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=f;break}return"string"}).isInAttribute=!0,n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=d;break}r.next()}return e}}function p(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function m(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!l.contextGrabbers.hasOwnProperty(r)||!l.contextGrabbers[r].hasOwnProperty(t))return;g(e)}}function v(e,t,r){return"openTag"==e?(r.tagStart=t.column(),y):"closeTag"==e?b:v}function y(e,t,r){return"word"==e?(r.tagName=t.current(),s="tag",S):l.allowMissingTagName&&"endTag"==e?(s="tag bracket",S(e,0,r)):(s="error",y)}function b(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&l.implicitlyClosed.hasOwnProperty(r.context.tagName)&&g(r),r.context&&r.context.tagName==n||!1===l.matchClosing?(s="tag",E):(s="tag error",x)}return l.allowMissingTagName&&"endTag"==e?(s="tag bracket",E(e,0,r)):(s="error",x)}function E(e,t,r){return"endTag"!=e?(s="error",E):(g(r),v)}function x(e,t,r){return s="error",E(e,0,r)}function S(e,t,r){if("word"==e)return s="attribute",T;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(n)?m(r,n):(m(r,n),r.context=new p(r,n,i==r.indented)),v}return s="error",S}function T(e,t,r){return"equals"==e?k:(l.allowMissing||(s="error"),S(e,0,r))}function k(e,t,r){return"string"==e?w:"word"==e&&l.allowUnquoted?(s="string",S):(s="error",S(e,0,r))}function w(e,t,r){return"string"==e?w:S(e,0,r)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,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;a=null;var r=t.tokenize(e,t);return(r||a)&&"comment"!=r&&(s=null,t.state=t.state(a||r,e,t),s&&(r="error"==s?r+" error":s)),r},indent:function(t,r,n){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+o;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+o*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],r=e.context;r;r=r.prev)r.tagName&&t.push(r.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})}(r(/*! ../../lib/codemirror */"VrN/"))},"7ahc": /*!*************************************************************!*\ !*** ./src/components/markdown-editor/code-block/index.tsx ***! \*************************************************************/ /*! exports provided: default, MyCodeMirror */ /*! exports used: MyCodeMirror, default */function(e,t,r){"use strict";r.d(t,"a",(function(){return m}));var n=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),i=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),a=(r(/*! antd/es/button/style */"+L6B"),r(/*! antd/es/button */"2/Rp")),s=(r(/*! antd/es/form/style */"y8nQ"),r(/*! antd/es/form */"Vl3Y")),o=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=(r(/*! antd/es/select/style */"OaEy"),r(/*! antd/es/select */"2fM7")),u=r(/*! react */"q1tI"),c=r.n(u),d=r(/*! codemirror */"VrN/"),f=r.n(d),h=(r(/*! codemirror/lib/codemirror.css */"p77/"),r(/*! codemirror/theme/blackboard.css */"c5Ni"),l.a.Option),p={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function m(e){var t=e.value,r=e.onChange,i=e.mode,a=e.options,s=void 0===a?{}:a,l=Object(u.useRef)(),d=Object(u.useState)(),h=Object(o.a)(d,2),p=h[0],g=h[1];return Object(u.useEffect)((function(){if(p){function e(e){var t=e.getValue();r&&r(t)}return p.on("change",e),function(){p.off("change",e)}}}),[p,r]),Object(u.useEffect)((function(){p&&p.setOption("mode",i)}),[p,i]),Object(u.useEffect)((function(){p&&(t===p.getValue()&&""!==t||setTimeout((function(){p.setValue(t||" ")}),300))}),[p,t]),Object(u.useEffect)((function(){if(l.current&&!p){var e=f.a.fromTextArea(l.current,Object(n.a)({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));g(e)}}),[l.current,p]),c.a.createElement("div",{className:"my-codemirror-container"},c.a.createElement("textarea",{ref:l}))}t.b=function(e){var t=e.callback,r=e.onCancel,n=Object(u.useState)("python"),d=Object(o.a)(n,2),f=d[0],v=d[1];return c.a.createElement(s.a,Object(i.a)({},p,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)}}),c.a.createElement(s.a.Item,{label:"代码语言",name:"language"},c.a.createElement(l.a,{onChange:function(e){v(g[e][1])}},Object.keys(g).map((function(e){return c.a.createElement(h,{key:e,value:e},g[e][0])})))),c.a.createElement(s.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},c.a.createElement(m,{mode:f})),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(a.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),c.a.createElement(a.a,{type:"ghost",onClick:r},"取消")))}},"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,r){!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-1&&t.substring(i+1,t.length);if(a)return e.findModeByExtension(a)},e.findModeByName=function(t){t=t.toLowerCase();for(var r=0;r"],f=new l.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){c.length=0,d=[""),d.join("")}var v={heading:function(e){var t=h.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 r=t[0],n=function(e,t){var r=e.match(/^(\s+)(?:```)/);if(null===r)return t;var n=r[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:Object(i.a)(t,1)[0].length>=n.length?e.slice(n.length):e})).join("\n")}(r,t[3]||""),a=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(a)>=0){var s=E(),o=n;n=s,x[s]={type:"block",expression:o}}return{type:"code",raw:r,lang:a,text:n}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,E=function(){return"__special_katext_id_".concat(b++,"__")},x={};function S(){b=0,x={}}function T(e){return e=e.replace(y,(function(e,t){var r=E();return x[r]={type:"inline",expression:t},r}))}var k=f.listitem;f.listitem=function(e){return k(T(e))};var w=f.paragraph;f.paragraph=function(e){return w(T(e))};var C=f.tablecell;f.tablecell=function(e,t){return C(T(e),t)},f.code=function(e,t,r){var n=(t||"").match(/\S*/)[0];return n?["latex","katex","math"].indexOf(n)>=0?"

".concat(e,"

"):'
').concat(r?e:Object(u.escape)(e,!0),"
\n"):'
'+(r?e:Object(u.escape)(e,!0))+"
"},f.heading=function(e,t,r){var n=this.options.headerPrefix+r.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:n,level:t,text:e}),"'+e+""},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:v,renderer:f});var L=l.a,A=(r("SJMd"),r("ulZh")),D=r.n(A),O=r("m3rI"),_=r("Oy/b"),R=r("p5ED"),I=/]*>/g;t.a=function(e){var t=e.value,r=void 0===t?"":t,o=e.className,l=e.showTextOnly,u=e.showLines,c=e.style,d=void 0===c?{}:c,f=e.stylesPrev,h=void 0===f?{}:f,v=String(r),y=Object(a.useState)(""),b=Object(i.a)(y,2),E=b[0],T=b[1],k=Object(a.useMemo)((function(){try{v=(v=v.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+O.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+O.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+O.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("(?[TOC]

",m()),p()),e=(e=e.replace(/(__special_katext_id_\d+__)/g,(function(e,r){var n=t[r],i=n.type,a=n.expression;return Object(_.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(a)||"",{displayMode:"block"===i,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),S(),l){var r=document.createElement("div");return r.innerHTML=e,r.innerText}return setTimeout((function(){return A()}),500),e}),[v]),w=Object(a.useRef)();function C(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var r=t.getAttribute("href");if(r.indexOf("office")>-1)e.preventDefault(),T(r);else if(r.startsWith("#")){e.preventDefault();var n=document.getElementById(r.replace("#",""));n&&n.scrollIntoView(!0)}}}g.WebkitLineClamp=u,u&&(d=Object(n.a)(Object(n.a)({},d),g));var A=function(){var e,t=null===(e=w.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(D.a.isSupported()){var t=new D.a;t.loadSource(e.src),t.attachMedia(e)}}))};return Object(a.useEffect)((function(){if(w.current&&k&&k.match(I)&&window.PR.prettyPrint(),w.current)return w.current.addEventListener("click",C),function(){w.current.removeEventListener("click",C),S(),p()}}),[k,w.current,C]),s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{ref:w,style:Object(n.a)({},d),className:"".concat(o||""," markdown-body "),dangerouslySetInnerHTML:{__html:k}}),s.a.createElement(R.a,{close:!0,data:E,type:null!=E&&E.length?"office":"",style:Object(n.a)({},h),onClose:function(){return T("")}}))}},"9VGf": /*!****************************************!*\ !*** ./src/components/useInterval.tsx ***! \****************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(/*! react */"q1tI");function i(e,t){var r=Object(n.useRef)();Object(n.useEffect)((function(){r.current=e})),Object(n.useEffect)((function(){if(null!==t){var e=setInterval((function(){r.current()}),t);return function(){return clearInterval(e)}}}),[t])}},BU3w: /*!***************************************************!*\ !*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***! \***************************************************/ /*! exports provided: injectCSS, updateCSS */ /*! exports used: updateCSS */function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(/*! ./canUseDom */"MNnm");function i(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function a(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(n.a)())return null;var a,s=document.createElement("style");(null===(t=r.csp)||void 0===t?void 0:t.nonce)&&(s.nonce=null===(a=r.csp)||void 0===a?void 0:a.nonce);s.innerHTML=e;var o=i(r),l=o.firstChild;return r.prepend&&o.prepend?o.prepend(s):r.prepend&&l?o.insertBefore(s,l):o.appendChild(s),s}var s=new Map;function o(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i(r);if(!s.has(n)){var o=a("",r),l=o.parentNode;s.set(n,l),l.removeChild(o)}var u=Array.from(s.get(n).children).find((function(e){return"STYLE"===e.tagName&&e["rc-util-key"]===t}));if(u){var c,d,f;if((null===(c=r.csp)||void 0===c?void 0:c.nonce)&&u.nonce!==(null===(d=r.csp)||void 0===d?void 0:d.nonce))u.nonce=null===(f=r.csp)||void 0===f?void 0:f.nonce;return u.innerHTML!==e&&(u.innerHTML=e),u}var h=a(e,r);return h["rc-util-key"]=t,h}},Bd2K: /*!********************************************************!*\ !*** ./node_modules/codemirror/addon/edit/closetag.js ***! \********************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){e.defineOption("autoCloseTags",!1,(function(s,o,l){if(l!=e.Init&&l&&s.removeKeyMap("autoCloseTags"),o){var u={name:"autoCloseTags"};"object"==typeof o&&!1===o.whenClosing||(u["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:n(t,!0)}(t)}),"object"==typeof o&&!1===o.whenOpening||(u["'>'"]=function(n){return function(n){if(n.getOption("disableInput"))return e.Pass;for(var s=n.listSelections(),o=[],l=n.getOption("autoCloseTags"),u=0;uc.ch&&(g=g.slice(0,g.length-d.end+c.ch));var b=g.toLowerCase();if(!g||"string"==d.type&&(d.end!=c.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&p.close||d.string.indexOf("/")==c.ch-d.start-1||v&&i(v,b)>-1||a(n,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(h)||[],g,c,!0))return e.Pass;var E="object"==typeof l&&l.emptyTags;if(E&&i(E,g)>-1)o[u]={text:"/>",newPos:e.Pos(c.line,c.ch+2)};else{var x=y&&i(y,b)>-1;o[u]={indent:x,text:">"+(x?"\n\n":"")+"",newPos:x?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}}var S="object"==typeof l&&l.dontIndentOnAutoClose;for(u=s.length-1;u>=0;u--){var T=o[u];n.replaceRange(T.text,s[u].head,s[u].anchor,"+insert");var k=n.listSelections().slice(0);k[u]={head:T.newPos,anchor:T.newPos},n.setSelections(k),!S&&T.indent&&(n.indentLine(T.newPos.line,null,!0),n.indentLine(T.newPos.line+1,null,!0))}}(n)}),s.addKeyMap(u)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],r=["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 n(t,r){for(var n=t.listSelections(),i=[],s=r?"/":""!=t.getLine(c.line).charAt(d.end)&&(p+=">"),i[u]=p}if(t.replaceSelections(i),n=t.listSelections(),!l)for(u=0;u=0&&r[u]==n;u--)++l;for(i=o.to,u=1;u0){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"",r=[],n=0;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r=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(n=e[Symbol.iterator]()).next.bind(n)}var n=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=(n.defaults,n.getDefaults,n.changeDefaults,/[&<>"']/),a=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},u=function(e){return l[e]},c=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(c,(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 f=/(^|[^\[])\^/g,h=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,g={},m=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(e,t){g[" "+e]||(m.test(e)?g[" "+e]=e+"/":g[" "+e]=E(e,"/",!0));var r=-1===(e=g[" "+e]).indexOf(":");return"//"===t.substring(0,2)?r?t:e.replace(v,"$1")+t:"/"===t.charAt(0)?r?t:e.replace(y,"$1")+t:e+t}function E(e,t,r){var n=e.length;if(0===n)return"";for(var i=0;i=0&&"\\"===r[i];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(r.length>t)r.splice(t);else for(;r.length1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e,t){var r=this.rules.block.code.exec(e);if(r){var n=t[t.length-1];if(n&&"paragraph"===n.type)return{raw:r[0],text:r[0].trimRight()};var i=r[0].replace(/^ {4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:R(i,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var r=t[0],n=function(e,t){var r=e.match(/^(\s+)(?:```)/);if(null===r)return t;var n=r[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e})).join("\n")}(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim():t[2],text:n}}},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 r={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(r.header.length===r.align.length){var n,i=r.align.length;for(n=0;n ?/gm,"");return{type:"blockquote",raw:t[0],text:r}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){for(var r,n,i,a,s,o,l,u=t[0],c=t[2],d=c.length>1,f=")"===c[c.length-1],h={type:"list",raw:u,ordered:d,start:d?+c.slice(0,-1):"",loose:!1,items:[]},p=t[0].match(this.rules.block.item),g=!1,m=p.length,v=0;v1||this.options.smartLists&&i!==c)&&(a=p.slice(v+1).join("\n"),h.raw=h.raw.substring(0,h.raw.length-a.length),v=m-1)),s=g||/\n\n(?!\s*$)/.test(r),v!==m-1&&(g="\n"===r.charAt(r.length-1),s||(s=g)),s&&(h.loose=!0),l=void 0,(o=/^\[[ xX]\] /.test(r))&&(l=" "!==r[1],r=r.replace(/^\[[ xX]\] +/,"")),h.items.push({type:"list_item",raw:u,task:o,checked:l,loose:s,text:r});return h}},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 r={type:"table",header:I(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(r.header.length===r.align.length){r.raw=t[0];var n,i=r.align.length;for(n=0;n/i.test(n[0])&&(t=!1),!r&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?r=!0:r&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(r=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:t,inRawBlock:r,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):M(n[0]):n[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var r=F(t[2],"()");if(r>-1){var n=(0===t[0].indexOf("!")?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,n).trim(),t[3]=""}var i=t[2],a="";if(this.options.pedantic){var s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);s?(i=s[1],a=s[3]):a=""}else a=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:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0])}},t.reflink=function(e,t){var r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){var n=(r[2]||r[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return P(r,n,r[0])}},t.strong=function(e,t,r){void 0===r&&(r="");var n=this.rules.inline.strong.start.exec(e);if(n&&(!n[1]||n[1]&&(""===r||this.rules.inline.punctuation.exec(r)))){t=t.slice(-1*e.length);var i,a="**"===n[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(a.lastIndex=0;null!=(n=a.exec(t));)if(i=this.rules.inline.strong.middle.exec(t.slice(0,n.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,r){void 0===r&&(r="");var n=this.rules.inline.em.start.exec(e);if(n&&(!n[1]||n[1]&&(""===r||this.rules.inline.punctuation.exec(r)))){t=t.slice(-1*e.length);var i,a="*"===n[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(a.lastIndex=0;null!=(n=a.exec(t));)if(i=this.rules.inline.em.middle.exec(t.slice(0,n.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 r=t[2].replace(/\n/g," "),n=/[^ ]/.test(r),i=r.startsWith(" ")&&r.endsWith(" ");return n&&i&&(r=r.substring(1,r.length-1)),r=M(r,!0),{type:"codespan",raw:t[0],text:r}}},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 r,n,i=this.rules.inline.autolink.exec(e);if(i)return n="@"===i[2]?"mailto:"+(r=M(this.options.mangle?t(i[1]):i[1])):r=M(i[1]),{type:"link",raw:i[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}},t.url=function(e,t){var r;if(r=this.rules.inline.url.exec(e)){var n,i;if("@"===r[2])i="mailto:"+(n=M(this.options.mangle?t(r[0]):r[0]));else{var a;do{a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0]}while(a!==r[0]);n=M(r[0]),i="www."===r[1]?"http://"+n:n}return{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}},t.inlineText=function(e,t,r){var n,i=this.rules.inline.text.exec(e);if(i)return n=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):M(i[0]):i[0]:M(this.options.smartypants?r(i[0]):i[0]),{type:"text",raw:i[0],text:n}},e}(),B=w,j=T,U=C,H={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable: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?'|\([^()]*\))/};H.def=j(H.def).replace("label",H._label).replace("title",H._title).getRegex(),H.bullet=/(?:[*+-]|\d{1,9}[.)])/,H.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,H.item=j(H.item,"gm").replace(/bull/g,H.bullet).getRegex(),H.list=j(H.list).replace(/bull/g,H.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+H.def.source+")").getRegex(),H._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",H._comment=//,H.html=j(H.html,"i").replace("comment",H._comment).replace("tag",H._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H.paragraph=j(H._paragraph).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.blockquote=j(H.blockquote).replace("paragraph",H.paragraph).getRegex(),H.normal=U({},H),H.gfm=U({},H.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),H.gfm.nptable=j(H.gfm.nptable).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.gfm.table=j(H.gfm.table).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.pedantic=U({},H.normal,{html:j("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",H._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:B,paragraph:j(H.normal._paragraph).replace("hr",H.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",H.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var G={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:B,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};G.punctuation=j(G.punctuation).replace(/punctuation/g,G._punctuation).getRegex(),G._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",G._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",G.em.start=j(G.em.start).replace(/punctuation/g,G._punctuation).getRegex(),G.em.middle=j(G.em.middle).replace(/punctuation/g,G._punctuation).replace(/overlapSkip/g,G._overlapSkip).getRegex(),G.em.endAst=j(G.em.endAst,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.em.endUnd=j(G.em.endUnd,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.strong.start=j(G.strong.start).replace(/punctuation/g,G._punctuation).getRegex(),G.strong.middle=j(G.strong.middle).replace(/punctuation/g,G._punctuation).replace(/blockSkip/g,G._blockSkip).getRegex(),G.strong.endAst=j(G.strong.endAst,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.strong.endUnd=j(G.strong.endUnd,"g").replace(/punctuation/g,G._punctuation).getRegex(),G.blockSkip=j(G._blockSkip,"g").getRegex(),G.overlapSkip=j(G._overlapSkip,"g").getRegex(),G._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,G._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,G._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,G.autolink=j(G.autolink).replace("scheme",G._scheme).replace("email",G._email).getRegex(),G._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,G.tag=j(G.tag).replace("comment",H._comment).replace("attribute",G._attribute).getRegex(),G._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,G._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,G._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,G.link=j(G.link).replace("label",G._label).replace("href",G._href).replace("title",G._title).getRegex(),G.reflink=j(G.reflink).replace("label",G._label).getRegex(),G.reflinkSearch=j(G.reflinkSearch,"g").replace("reflink",G.reflink).replace("nolink",G.nolink).getRegex(),G.normal=U({},G),G.pedantic=U({},G.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:j(/^!?\[(label)\]\((.*?)\)/).replace("label",G._label).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",G._label).getRegex()}),G.gfm=U({},G.normal,{escape:j(G.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(r="x"+r.toString(16)),n+="&#"+r+";";return n}var Y=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||z,this.options.tokenizer=this.options.tokenizer||new N,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:K.normal,inline:V.normal};this.options.pedantic?(t.block=K.pedantic,t.inline=V.pedantic):this.options.gfm&&(t.block=K.gfm,this.options.breaks?t.inline=V.breaks:t.inline=V.gfm),this.tokenizer.rules=t}t.lex=function(e,r){return new t(r).lex(e)};var r,n,i,a=t.prototype;return a.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},a.blockTokens=function(e,t,r){var n,i,a,s;for(void 0===t&&(t=[]),void 0===r&&(r=!0),e=e.replace(/^ +$/gm,"");e;)if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),n.type&&t.push(n);else if(n=this.tokenizer.code(e,t))e=e.substring(n.raw.length),n.type?t.push(n):((s=t[t.length-1]).raw+="\n"+n.raw,s.text+="\n"+n.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.nptable(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),n.tokens=this.blockTokens(n.text,[],r),t.push(n);else if(n=this.tokenizer.list(e)){for(e=e.substring(n.raw.length),a=n.items.length,i=0;i0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(o));)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(o));)o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(a=this.tokenizer.escape(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.tag(e,r,n))e=e.substring(a.raw.length),r=a.inLink,n=a.inRawBlock,t.push(a);else if(a=this.tokenizer.link(e))e=e.substring(a.raw.length),"link"===a.type&&(a.tokens=this.inlineTokens(a.text,[],!0,n)),t.push(a);else if(a=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(a.raw.length),"link"===a.type&&(a.tokens=this.inlineTokens(a.text,[],!0,n)),t.push(a);else if(a=this.tokenizer.strong(e,o,i))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],r,n),t.push(a);else if(a=this.tokenizer.em(e,o,i))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],r,n),t.push(a);else if(a=this.tokenizer.codespan(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.br(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.del(e))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],r,n),t.push(a);else if(a=this.tokenizer.autolink(e,$))e=e.substring(a.raw.length),t.push(a);else if(r||!(a=this.tokenizer.url(e,$))){if(a=this.tokenizer.inlineText(e,n,q))e=e.substring(a.raw.length),i=a.raw.slice(-1),t.push(a);else if(e){var u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}throw new Error(u)}}else e=e.substring(a.raw.length),t.push(a);return t},r=t,i=[{key:"rules",get:function(){return{block:K,inline:V}}}],(n=null)&&e(r.prototype,n),i&&e(r,i),t}(),X=n.defaults,Z=k,Q=x,J=function(){function e(e){this.options=e||X}var t=e.prototype;return t.code=function(e,t,r){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,n);null!=i&&i!==e&&(r=!0,e=i)}return n?'
'+(r?e:Q(e,!0))+"
\n":"
"+(r?e:Q(e,!0))+"
\n"},t.blockquote=function(e){return"
\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,r,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
\n":"
\n"},t.list=function(e,t,r){var n=t?"ol":"ul";return"<"+n+(t&&1!==r?' start="'+r+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var r=t.header?"th":"td";return(t.align?"<"+r+' align="'+t.align+'">':"<"+r+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,r){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return r;var n='"},t.image=function(e,t,r){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return r;var n=''+r+'":">"},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,r){return""+r},t.image=function(e,t,r){return""+r},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 r=t;do{this.seen[r]++,t=r+"-"+this.seen[r]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),re=n.defaults,ne=S,ie=function(){function e(e){this.options=e||re,this.options.renderer=this.options.renderer||new J,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ee,this.slugger=new te}e.parse=function(t,r){return new e(r).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var r,n,i,a,s,o,l,u,c,d,f,h,p,g,m,v,y,b,E="",x=e.length;for(r=0;r0&&"text"===m.tokens[0].type?(m.tokens[0].text=b+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=b+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:b}):g+=b),g+=this.parse(m.tokens,p),c+=this.renderer.listitem(g,y,v);E+=this.renderer.list(c,f,h);continue;case"html":E+=this.renderer.html(d.text);continue;case"paragraph":E+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(c=d.tokens?this.parseInline(d.tokens):d.text;r+1An error occurred:

    "+oe(e.message+"",!0)+"
    ";throw e}}return de.options=de.setOptions=function(e){return ae(de.defaults,e),ue(de.defaults),de},de.getDefaults=le,de.defaults=ce,de.use=function(e){var t=ae({},e);if(e.renderer&&function(){var r=de.defaults.renderer||new J,n=function(t){var n=r[t];r[t]=function(){for(var i=arguments.length,a=new Array(i),s=0;s",triples:"",explode:"[]{}"},r=e.Pos;function n(e,r){return"pairs"==r&&"string"==typeof e?e:"object"==typeof e&&null!=e[r]?e[r]:t[r]}e.defineOption("autoCloseBrackets",!1,(function(t,r,s){s&&s!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),r&&(a(n(r,"pairs")),t.state.closeBrackets=r,t.addKeyMap(i))}));var i={Backspace:function(t){var i=o(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var a=n(i,"pairs"),s=t.listSelections(),u=0;u=0;u--){var d=s[u].head;t.replaceRange("",r(d.line,d.ch-1),r(d.line,d.ch+1),"+delete")}},Enter:function(t){var r=o(t),i=r&&n(r,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var a=t.listSelections(),s=0;s1&&f.indexOf(i)>=0&&t.getRange(r(b.line,b.ch-2),b)==i+i){if(b.ch>2&&/\bstring/.test(t.getTokenTypeAt(r(b.line,b.ch-2))))return e.Pass;v="addFour"}else if(h){var x=0==b.ch?" ":t.getRange(r(b.line,b.ch-1),b);if(e.isWordChar(E)||x==i||e.isWordChar(x))return e.Pass;v="both"}else{if(!g||!(0===E.length||/\s/.test(E)||d.indexOf(E)>-1))return e.Pass;v="both"}else v=h&&u(t,b)?"both":f.indexOf(i)>=0&&t.getRange(b,r(b.line,b.ch+3))==i+i+i?"skipThree":"skip";if(c){if(c!=v)return e.Pass}else c=v}var S=l%2?s.charAt(l-1):i,T=l%2?i:s.charAt(l+1);t.operation((function(){if("skip"==c)t.execCommand("goCharRight");else if("skipThree"==c)for(var n=0;n<3;n++)t.execCommand("goCharRight");else if("surround"==c){var i=t.getSelections();for(n=0;n0,{anchor:new r(a.anchor.line,a.anchor.ch+(s?-1:1)),head:new r(a.head.line,a.head.ch+(s?1:-1))});t.setSelections(i)}else"both"==c?(t.replaceSelection(S+T,null),t.triggerElectric(S+T),t.execCommand("goCharLeft")):"addFour"==c&&(t.replaceSelection(S+S+S+S,"before"),t.execCommand("goCharRight"));var a,s}))}(i,t)}}function o(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){var n=e.getRange(r(t.line,t.ch-1),r(t.line,t.ch+1));return 2==n.length?n:null}function u(e,t){var n=e.getTokenAt(r(t.line,t.ch+1));return/\bstring/.test(n.type)&&n.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}a(t.pairs+"`")}(r(/*! ../../lib/codemirror */"VrN/"))},GfqC: /*!********************************************************!*\ !*** ./node_modules/rc-upload/es/index.js + 6 modules ***! \********************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.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,r){"use strict";var n=r("q1tI"),i=r.n(n),a=r("TSYQ"),s=r.n(a);function o(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function l(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var r=new FormData;e.data&&Object.keys(e.data).forEach((function(t){var n=e.data[t];Array.isArray(n)?n.forEach((function(e){r.append(t+"[]",e)})):r.append(t,e.data[t])})),e.file instanceof Blob?r.append(e.filename,e.file,e.file.name):r.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){return t.status<200||t.status>=300?e.onError(function(e,t){var r="cannot "+e.method+" "+e.action+" "+t.status+"'",n=new Error(r);return n.status=t.status,n.method=e.method,n.url=e.action,n}(e,t),o(t)):e.onSuccess(o(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var n=e.headers||{};return null!==n["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach((function(e){null!==n[e]&&t.setRequestHeader(e,n[e])})),t.send(r),{abort:function(){t.abort()}}}var u=+new Date,c=0;function d(){return"rc-upload-"+u+"-"+ ++c}var f=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",i=e.type||"",a=i.replace(/\/.*$/,"");return r.some((function(e){var t,r,s=e.trim();return"."===s.charAt(0)?(t=n.toLowerCase(),r=s.toLowerCase(),-1!==t.indexOf(r,t.length-r.length)):/\/\*$/.test(s)?a===s.replace(/\/.*$/,""):i===s}))}return!0};var h=function(e,t,r){var n=function e(n,i){i=i||"",n.isFile?n.file((function(e){r(e)&&(n.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=n.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))})):n.isDirectory&&function(e,t){var r=e.createReader(),n=[];!function e(){r.readEntries((function(r){var i=Array.prototype.slice.apply(r);n=n.concat(i),!i.length?t(n):e()}))}()}(n,(function(t){t.forEach((function(t){e(t,""+i+n.name+"/")}))}))};e.forEach((function(e){n(e.webkitGetAsEntry())}))},p=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(r,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),x=s()((v(e={},a,!0),v(e,a+"-disabled",l),v(e,o,o),e)),S=l?{}:{onClick:m?this.onClick:function(){},onKeyDown:m?this.onKeyDown:function(){},onMouseEnter:y,onMouseLeave:b,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return i.a.createElement(n,p({},S,{className:x,role:"button",style:c}),i.a.createElement("input",p({},(t=E,Object.keys(t).reduce((function(e,r){return"data-"!==r.substr(0,5)&&"aria-"!==r.substr(0,5)&&"role"!==r||(e[r]=t[r]),e}),{})),{id:u,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:f,directory:g?"directory":null,webkitdirectory:g?"webkitdirectory":null,multiple:d,onChange:this.onChange})),h)}}]),t}(n.Component),x=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:1,r=R.length,n=0;n1&&void 0!==arguments[1]&&arguments[1];return Object(w.a)(e).map((function(e,r){if(!o.isValidElement(e)||!e.type)return null;var n=e.type.isSelectOptGroup,i=e.key,a=e.props,s=a.children,l=Object(u.a)(a,["children"]);return t||!n?C(e):Object(k.a)(Object(k.a)({key:"__RC_SELECT_GRP__".concat(null===i?r:i,"__"),label:i},l),{},{options:L(s)})})).filter((function(e){return e}))}var A=r("2Qr1"),D=r("qNPg"),O=r("U8pU"),_=r("Kwbf"),R=r("WKfj");var I=function(e){var t=e.mode,r=e.options,n=e.children,i=e.backfill,a=e.allowClear,s=e.placeholder,l=e.getInputElement,u=e.showSearch,c=e.onSearch,d=e.defaultOpen,f=e.autoFocus,h=e.labelInValue,p=e.value,g=e.inputValue,m=e.optionLabelProp,v="multiple"===t||"tags"===t,y=void 0!==u?u:v||"combobox"===t,b=r||L(n);if(Object(_.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 E=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(_.a)(!E,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)("combobox"!==t||!m,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)("combobox"===t||!i,"`backfill` only works with `combobox` mode."),Object(_.a)("combobox"===t||!l,"`getInputElement` only work with `combobox` mode."),Object(_.b)("combobox"!==t||!l||!a||!s,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),c&&!y&&"combobox"!==t&&"tags"!==t&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!d||f,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=p){var x=Object(R.d)(p);Object(_.a)(!h||x.every((function(e){return"object"===Object(O.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(_.a)(!v||Array.isArray(p),"`value` should be array when `mode` is `multiple` or `tags`")}if(n){var S=null;Object(w.a)(n).some((function(e){if(!o.isValidElement(e)||!e.type)return!1;var t=e.type;return!t.isSelectOption&&(t.isSelectOptGroup?!Object(w.a)(e.props.children).every((function(t){return!(o.isValidElement(t)&&e.type&&!t.type.isSelectOption)||(S=t.type,!1)})):(S=t,!0))})),S&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(S.displayName||S.name||S,"`.")),Object(_.a)(void 0===g,"`inputValue` is deprecated, please use `searchValue` instead.")}},M=Object(D.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:L,flattenOptions:A.d,getLabeledValue:A.e,filterOptions:A.b,isValueDisabled:A.g,findValueOption:A.c,warningProps:I,fillOptionsWithMissingValue:A.a}),F=function(e){Object(a.a)(r,e);var t=Object(s.a)(r);function r(){var e;return Object(n.a)(this,r),(e=t.apply(this,arguments)).selectRef=o.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}return Object(i.a)(r,[{key:"render",value:function(){return o.createElement(M,Object.assign({ref:this.selectRef},this.props))}}]),r}(o.Component);F.Option=x,F.OptGroup=T;var P=F;t.c=P},M8RZ: /*!**********************************!*\ !*** ./src/components/modal.tsx ***! \**********************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),i=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),a=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),s=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),o=r(/*! react */"q1tI"),l=r.n(o),u=r(/*! react-dom */"i8i4"),c=function(e){Object(a.a)(r,e);var t=Object(s.a)(r);function r(e){var i;Object(n.a)(this,r),i=t.call(this,e);var a=window.document;return i.node=a.createElement("div"),a.body.appendChild(i.node),i}return Object(i.a)(r,[{key:"render",value:function(){var e=this.props.children;return Object(u.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),r}(l.a.Component)},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/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/slicedToArray.js */ /*! 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 ./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/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/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,r){"use strict";r("2qtc");var n=r("kLXV"),i=r("rAM+"),a=(r("miYZ"),r("tsqr")),s=r("tJVT"),o=r("jrin"),l=r("q1tI"),u=r.n(l),c=r("VrN/"),d=r.n(c),f=r("bdgK"),h=(r("p77/"),r("Bd2K"),r("ELLl"),r("19Vz"),r("lZu9"),r("+NIl"),r("kSUc"),r("9Bee")),p=function(e){var t=e.value,r=void 0===t?"":t,n=(e.className,e.showTextOnly,e.showLines,e.style,Object(l.useMemo)((function(){return""}),[r]));return u.a.createElement(u.a.Fragment,null,u.a.createElement("div",{dangerouslySetInnerHTML:{__html:n}}))},g=r("0Owb"),m=(r("dejd"),r("C+DQ"),[{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 v(e){var t=e.onActionCallback,r=e.title,n=e.icon,i=e.actionName,a=e.className,s=void 0===a?"":a,o=e.children;return u.a.createElement("a",{title:r,className:s,onClick:function(){t(i)}},u.a.createElement("i",{className:"md-iconfont ".concat(n)}),o)}var y=function(e){var t=e.watch,r=e.showNullButton,n=e.onActionCallback,i=e.fullScreen,a=e.insertTemp,s=e.hidetoolBar,o=[].concat(m,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return u.a.createElement("ul",{className:"markdown-toolbar-container"},!s&&o.map((function(e,t){return u.a.createElement("li",{key:t},e.actionName?u.a.createElement(v,Object(g.a)({},e,{onActionCallback:n})):u.a.createElement("span",{className:"v-line"}))})),r?u.a.createElement("li",null,u.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:n},u.a.createElement("span",{className:"fill-tip"},"点击插入\b填空项"))):null,a&&u.a.createElement("li",null,u.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:n},u.a.createElement("span",{className:"fill-tip"},"插入模板"))),u.a.createElement("li",{className:"btn-full-screen"},u.a.createElement(v,{icon:"".concat(i?"icon-shrink":"icon-enlarge"),title:i?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:n})))},b=r("M8RZ"),E=(r("+L6B"),r("2/Rp")),x=(r("y8nQ"),r("Vl3Y")),S=(r("5NDa"),r("5rEg")),T={labelCol:{span:4},wrapperCol:{span:20}},k=function(e){var t=e.callback,r=e.onCancel;return u.a.createElement(x.a,Object(g.a)({},T,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)}}),u.a.createElement(x.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},u.a.createElement(S.a,null)),u.a.createElement(x.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},u.a.createElement(S.a,null)),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(E.a,{type:"ghost",onClick:r},"取消")))},w=r("7ahc"),C=(r("HmJG"),r("BjJ7")),L=x.a.useForm,A={width:280,marginRight:10},D={labelCol:{span:5},wrapperCol:{span:19}},O=function(e){var t=e.callback,r=e.onCancel,n=L(),i=Object(s.a)(n,1)[0];function a(e,t){i.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type})}return u.a.createElement(x.a,Object(g.a)({form:i},D,{className:"upload-image-panel",onFinish:function(e){t(e)}}),u.a.createElement(x.a.Item,{label:"图片地址",required:!0},u.a.createElement("div",{className:"flex-container"},u.a.createElement(x.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}]},u.a.createElement(S.a,{style:A})),u.a.createElement(_,{onFileChange:function(e){R(e.target.files[0],a)}}))),u.a.createElement(x.a.Item,{label:"图片描述",name:"alt",rules:[{required:!0,message:"请输入图片描述"}]},u.a.createElement(S.a,{style:{width:264}})),u.a.createElement(x.a.Item,{style:{textAlign:"right"}},u.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(E.a,{type:"ghost",onClick:r},"取消")))};function _(e){var t=e.onFileChange;return u.a.createElement("a",{className:"upload-button"},"本地上传",u.a.createElement("input",{type:"file",onChange:t}))}function R(e,t){if(!e)throw new String("没有文件");var r=new FormData;r.append("editormd-image-file",e),r.append("file_param_name","editormd-image-file"),r.append("byxhr","true");var n=new window.XMLHttpRequest;n.withCredentials=!0,n.addEventListener("load",(function(r){t(JSON.parse(r.target.responseText),e)}),!1),n.addEventListener("error",(function(e){console.error(e)}),!1),n.open("POST","".concat(C.a,"/api/attachments.json")),n.send(r)}r("giR+");var I,M,F=r("fyUT"),P=(r("7Kak"),r("9yH6")),N=P.a.Group,B={margin:"0 8px"},j=function(e){var t=e.callback,r=e.onCancel;return u.a.createElement(x.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)}},u.a.createElement("div",{className:"flex-container"},u.a.createElement("span",{style:B},"单元格数:"),u.a.createElement("span",{style:B},"行数"),u.a.createElement(x.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},u.a.createElement(F.a,null)),u.a.createElement("span",{style:B},"列数"),u.a.createElement(x.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},u.a.createElement(F.a,null))),u.a.createElement("div",{className:"flex-container",style:{marginTop:12}},u.a.createElement("span",{style:B},"对齐方式:"),u.a.createElement(x.a.Item,{name:"align"},u.a.createElement(N,null,u.a.createElement(P.a,{value:"default"},u.a.createElement("i",{className:"fa fa-align-justify"})),u.a.createElement(P.a,{value:"left"},u.a.createElement("i",{className:"fa fa-align-left"})),u.a.createElement(P.a,{value:"center"},u.a.createElement("i",{className:"fa fa-align-center"})),u.a.createElement(P.a,{value:"right"},u.a.createElement("i",{className:"fa fa-align-right"}))))),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(E.a,{type:"ghost",onClick:r},"取消")))},U=r("m3rI"),H="------------",G={default:H,left:":".concat(H),center:":".concat(H,":"),right:"".concat(H,":")},W=r("9VGf");function z(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var K=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",V=(I={},Object(o.a)(I,K+"-B","bold"),Object(o.a)(I,K+"-I","italic"),I),q=(M={},Object(o.a)(M,"link","添加链接"),Object(o.a)(M,"code-block","添加代码块"),Object(o.a)(M,"upload-image","添加图片"),Object(o.a)(M,"add-table","添加表格"),M);t.a=function(e){var t=e.defaultValue,r=void 0===t?"":t,c=e.onChange,g=e.width,m=void 0===g?"100%":g,v=e.height,E=void 0===v?400:v,x=e.miniToolbar,S=void 0!==x&&x,T=e.isFocus,C=void 0!==T&&T,L=e.watch,A=e.insertTemp,D=e.mode,_=void 0===D?"markdown":D,I=e.id,M=void 0===I?"markdown-editor-id":I,F=e.showResizeBar,P=void 0!==F&&F,N=e.noStorage,B=void 0!==N&&N,H=e.showNullButton,K=void 0!==H&&H,$=e.hidetoolBar,Y=void 0!==$&&$,X=e.fullScreen,Z=void 0!==X&&X,Q=e.onBlur,J=e.onCMBeforeChange,ee=e.onFullScreen,te=e.className,re=void 0===te?"":te,ne=e.disablePaste,ie=void 0!==ne&&ne,ae=e.placeholder,se=void 0===ae?"":ae,oe=e.values,le=void 0===oe?"":oe,ue=Object(l.useState)(null),ce=Object(s.a)(ue,2),de=ce[0],fe=ce[1],he=Object(l.useState)(r),pe=Object(s.a)(he,2),ge=pe[0],me=pe[1],ve=Object(l.useState)(L),ye=Object(s.a)(ve,2),be=ye[0],Ee=ye[1],xe=Object(l.useState)(Z),Se=Object(s.a)(xe,2),Te=Se[0],ke=Se[1],we=Object(l.useState)(""),Ce=Object(s.a)(we,2),Le=Ce[0],Ae=Ce[1],De=Object(l.useState)(0),Oe=Object(s.a)(De,2),_e=Oe[0],Re=Oe[1],Ie=Object(l.useState)(E),Me=Object(s.a)(Ie,2),Fe=Me[0],Pe=Me[1],Ne=Object(l.useState)(!1),Be=Object(s.a)(Ne,2),je=(Be[0],Be[1]),Ue=Object(l.useRef)(),He=Object(l.useRef)(),Ge=Object(l.useRef)(),We=Object(l.useRef)();Object(l.useEffect)((function(){me(le),null==de||de.setValue(le)}),[le]),Object(l.useEffect)((function(){null==ee||ee(Te)}),[Te]),Object(l.useEffect)((function(){if(Ue.current){var e=d.a.fromTextArea(Ue.current,{mode:_,lineNumbers:!S,lineWrapping:!0,value:r,autoCloseTags:!0,autoCloseBrackets:!0});function t(t,r){if(!ie){var n=r.clipboardData;if(n){var i=n.types.toString(),s=n.items,o=["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"];if("Files"===i||n.types.indexOf("Files")>-1){if(r.preventDefault(),"stex"==_)return;try{var l,u=s[1];"file"===(null===(l=s[0])||void 0===l?void 0:l.kind)&&(u=s[0]);var c=u.getAsFile(),d=c.name.split(".").pop();R(c,(function(t){var r,n,i;t.id?(null==c||null===(r=c.type)||void 0===r?void 0:r.indexOf("image"))>-1?e.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):(null==c||null===(n=c.type)||void 0===n?void 0:n.indexOf("video"))>-1?e.replaceSelection('')):(null==c||null===(i=c.type)||void 0===i?void 0:i.indexOf("pdf"))>-1?e.replaceSelection('
    ').concat(c.name,"")):o.includes(d)?e.replaceSelection('').concat(c.name,"")):e.replaceSelection("[".concat(c.name,"](").concat(U.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(r){a.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}r.preventDefault()}return C&&e.focus(),e.on("paste",t),fe(e),function(){e.off("paste",t)}}}),[]);var ze=Object(l.useCallback)((function(){He.current}),[Fe,He,Te]);Object(l.useEffect)((function(){if(de){var e=function(){var e=new f.default((function(e){var t,r=Object(i.a)(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;(n.target.offsetHeight>0||n.target.offsetWidth>0)&&(ze(),de.setSize("100%","100%"),de.refresh())}}catch(e){r.e(e)}finally{r.f()}}));return e.observe(Ue.current.parentElement),e}();return function(){e.unobserve(Ue.current.parentElement)}}}),[de,ze]),Object(l.useEffect)((function(){if(de){for(var e=[],t=function(){var t=n[r],i=(a=Object(s.a)(t,2))[0],l=a[1],u=Object(o.a)({},i,(function(){Ke(l)}));e.push(u),de.addKeyMap(u)},r=0,n=Object.entries(V);r0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(M);e>=_e+1e4&&(!t||t!==ge)&&(window.sessionStorage.setItem(M,ge),je(!0))}}),1e4),Object(l.useEffect)((function(){Ee(L)}),[de,L]),Object(l.useEffect)((function(){de&&C&&de.focus()}),[de,C]),Object(l.useEffect)((function(){if(be&&de){var e=de.getScrollerElement();function t(e){var t=e.target;if(We.current){var r=t.scrollTop/t.scrollHeight;We.current.scrollTop=We.current.scrollHeight*r}}return e.addEventListener("scroll",t),function(){e.removeEventListener("scroll",t)}}}),[de,be]),Object(l.useEffect)((function(){if(de&&J){function e(e,t){J(e,t)}return de.on("beforeChange",e),function(){de.off("beforeChange",e)}}}),[de,J]),Object(l.useEffect)((function(){if(de&&Q){function e(){Q(de.getValue())}return de.on("blur",e),function(){de.off("blur",e)}}}),[de,Q]),Object(l.useEffect)((function(){if(de){function e(e){var t=e.getValue();me(t),Re((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),c&&c(t)}return de.on("change",e),function(){de.off("change",e)}}}),[de,c]),Object(l.useEffect)((function(){de&&(null==r?(de.setValue(""),me("")):r!==de.getValue()&&(de.setValue(r),me(r),de.setCursor(de.lineCount(),0)))}),[de,r]);var Ke=Object(l.useCallback)((function(e){var t=de.getCursor(),r=de.getSelection(),n=r.split("\n");switch(e){case"bold":return de.replaceSelection("**"+r+"**"),""===r&&de.setCursor(t.line,t.ch+2),de.focus();case"italic":return de.replaceSelection("*"+r+"*"),""===r&&de.setCursor(t.line,t.ch+1),de.focus();case"code":return de.replaceSelection("`"+r+"`"),""===r&&de.setCursor(t.line,t.ch+1),de.focus();case"inline-latex":return de.replaceSelection("`$$"+r+"$$`"),""===r&&de.setCursor(t.line,t.ch+3),de.focus();case"latex":return de.replaceSelection("```latex\n"+r+"\n```"),de.setCursor(t.line+1,r.length+1),de.focus();case"line-break":return de.replaceSelection("
    \n"),de.focus();case"list-ul":return""===r?de.replaceSelection("- "+r):de.replaceSelection(n.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),de.focus();case"list-ol":return""===r?de.replaceSelection("1. "+r):de.replaceSelection(n.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),de.focus();case"add-null-ch":return""===r&&de.setCursor(t.line,t.ch+1),de.replaceSelection("▁"),de.focus();case"inster-template-1":return""===r&&de.setCursor(t.line,t.ch),de.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),de.focus();case"eraser":return de.setValue(""),de.focus();case"trigger-watch":return Ee(!be),de.focus();case"trigger-full-screen":return ke(!Te),de.focus();case"link":return void Ae("link");case"code-block":return void Ae("code-block");case"upload-image":return void Ae("upload-image");case"add-table":return void Ae("add-table");default:throw new Error}}),[de,be,Te]),Ve=Object(l.useCallback)((function(e){switch(Ae(""),Le){case"link":var t=e.title,r=e.link;return de.replaceSelection("[".concat(t,"](").concat(r,")")),de.focus();case"code-block":var n=e.language,i=e.content;return de.replaceSelection(["```"+n,i,"```"].join("\n")),de.focus();case"upload-image":var a=e.src,s=e.alt;return de.replaceSelection("![ ".concat(s," ]( ").concat(a,' "').concat(s,'" )')),de.focus();case"add-table":for(var o=e.row,l=e.col,u=e.align,c="\n",d=0;d300&&(n=300),Pe(E+n+"px")}}return e.addEventListener("mousedown",n),document.addEventListener("mousemove",a),document.addEventListener("mouseup",i),function(){e.removeEventListener("mousedown",n),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)}}}),[de,Ge]),Object(l.useEffect)((function(){Pe(E)}),[E]);var Ye={width:z(m),height:z(Fe)};Object(l.useMemo)((function(){if(_e){var e=new Date(_e),t=e.getHours(),r=e.getMinutes(),n=e.getSeconds();return r=r<10?"0"+r:r,n=n<10?"0"+n:n,"".concat(t=t<10?"0"+t:t,":").concat(r,":").concat(n)}return 0}),[_e]);return u.a.createElement(l.Fragment,null,u.a.createElement("div",{className:"markdown-editor-wrapper",ref:He},u.a.createElement("div",{className:"markdown-editor-container ".concat(re," ").concat(be?"on-preview":""," ").concat(S?"mini":""," ").concat(Te?"full-screen":""),style:Ye},u.a.createElement(y,{insertTemp:A,watch:be,fullScreen:Te,showNullButton:K,onActionCallback:Ke,hidetoolBar:Y}),u.a.createElement("div",{className:"markdown-editor-body"},u.a.createElement("div",{className:"codemirror-container"},u.a.createElement("textarea",{ref:Ue,placeholder:se})),be?u.a.createElement("div",{ref:We,className:"preview-container"},"stex"===_&&u.a.createElement(p,{value:ge}),"stex"!==_&&u.a.createElement(h.a,{value:ge})):null))),P?u.a.createElement("a",{ref:Ge,className:"editor-resize"}):null,u.a.createElement(b.a,null,q[Le]?u.a.createElement(n.a,{centered:!0,title:q[Le],visible:!0,onCancel:$e,footer:null},qe):null))}},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"],r=[[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"],n=[r,"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=[r,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[r,"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"],s=[r,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="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"],u=[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"],c=[t,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],d=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function f(e,t,r,n,i){if(r){var a={sourceNode:e,pre:1,langExtension:null,numberLines:null,sourceCode:r,spans:null,basePos:t,decorations:null};n(a),i.push.apply(i,a.decorations)}}var h=/\S/;function p(e){for(var t=void 0,r=e.firstChild;r;r=r.nextSibling){var n=r.nodeType;t=1===n?t?e:r:3===n&&h.test(r.nodeValue)?e:t}return t===e?void 0:t}function g(e,t){var r,n={};!function(){for(var i=e.concat(t),a=[],s={},o=0,l=i.length;o=0;)n[c.charAt(d)]=u;var f=u[1],h=""+f;s.hasOwnProperty(h)||(a.push(f),s[h]=null)}a.push(/[\0-\uffff]/),r=function(e){for(var t=0,r=!1,n=!1,i=0,a=e.length;i122||(c<65||d>90||r.push([32|Math.max(65,d),32|Math.min(c,90)]),c<97||d>122||r.push([-33&Math.max(97,d),-33&Math.min(c,122)]))}}r.sort((function(e,t){return e[0]-t[0]||t[1]-e[1]}));var f=[],h=[];for(a=0;ap[0]&&(p[1]+1>p[0]&&i.push("-"),i.push(l(p[1])))}return i.push("]"),i.join("")}function c(e){for(var n=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=n.length,a=[],s=0,o=0;s=2&&"["===f?n[s]=u(d):"\\"!==f&&(n[s]=d.replace(/[a-zA-Z]/g,(function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(-33&t,32|t)+"]"})))}return n.join("")}var d=[];for(i=0,a=e.length;i=5&&"lang-"===y.substring(0,5))||b&&"string"==typeof b[1]||(m=!1,y="src"),m||(h[v]=y)}var T=c;if(c+=v.length,m){var k=b[1],w=v.indexOf(k),C=w+k.length;b[2]&&(w=(C=v.length-b[2].length)-k.length);var L=y.substring(5);f(l,o+T,v.substring(0,w),a,u),f(l,o+T+w,k,x(L,k),u),f(l,o+T+C,v.substring(C),a,u)}else u.push(o+T,y)}e.decorations=u};return a}function m(e){var t=[],r=[];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&&r.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var n=e.hashComments;n&&(e.cStyleComments?(n>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,"#"]),r.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):t.push(["com",/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(r.push(["com",/^\/\/[^\r\n]*/,null]),r.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var i=e.regexLiterals;if(i){var a=i>1?"":"\n\r",s=a?".":"[\\S\\s]",o="/(?=[^/*"+a+"])(?:[^/\\x5B\\x5C"+a+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+a+"]|\\x5C"+s+")*(?:\\x5D|$))+/";r.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+o+")")])}var l=e.types;l&&r.push(["typ",l]);var u=(""+e.keywords).replace(/^ | $/g,"");u.length&&r.push(["kwd",new RegExp("^(?:"+u.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push(["pln",/^\s+/,null," \r\n\t "]);var c="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(c+="(?!s*/)"),r.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(c),null]),g(t,r)}var v=m({keywords:[n,a,i,s,o,l,u,c],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(e,t,r){for(var n=/(?:^|\s)nocode(?:\s|$)/,i=/\r\n?|\n/,a=e.ownerDocument,s=a.createElement("li");e.firstChild;)s.appendChild(e.firstChild);var o=[s];function l(e){var t=e.nodeType;if(1!=t||n.test(e.className)){if((3==t||4==t)&&r){var s=e.nodeValue,o=s.match(i);if(o){var c=s.substring(0,o.index);e.nodeValue=c;var d=s.substring(o.index+o[0].length);if(d)e.parentNode.insertBefore(a.createTextNode(d),e.nextSibling);u(e),c||e.parentNode.removeChild(e)}}}else if("br"===e.nodeName)u(e),e.parentNode&&e.parentNode.removeChild(e);else for(var f=e.firstChild;f;f=f.nextSibling)l(f)}function u(e){for(;!e.nextSibling;)if(!(e=e.parentNode))return;for(var t,r=function e(t,r){var n=r?t.cloneNode(!1):t,i=t.parentNode;if(i){var a=e(i,1),s=t.nextSibling;a.appendChild(n);for(var o=s;o;o=s)s=o.nextSibling,a.appendChild(o)}return n}(e.nextSibling,0);(t=r.parentNode)&&1===t.nodeType;)r=t;o.push(r)}for(var c=0;c=0;){var i=r[n];b.hasOwnProperty(i)?e.console&&console.warn("cannot override language handler %s",i):b[i]=t}}function x(e,t){return e&&b.hasOwnProperty(e)||(e=/^\s*=E&&(c+=2),o>=x&&(h+=2)}}finally{v&&(v.style.display=y)}}(t)}catch(t){e.console&&console.log(t&&t.stack||t)}}function T(e,t,r){var n=r||!1,i=t||null,a=document.createElement("div");return a.innerHTML="
    "+e+"
    ",a=a.firstChild,n&&y(a,n,!0),S({langExtension:i,numberLines:n,sourceNode:a,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),a.innerHTML}function k(t,r){var n=r||document.body,i=n.ownerDocument||document;function a(e){return n.getElementsByTagName(e)}for(var s=[a("pre"),a("code"),a("xmp")],o=[],l=0;l]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),E(g([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),E(g([],[["atv",/^[\s\S]+/]]),["uq.val"]),E(m({keywords:n,hashComments:!0,cStyleComments:!0,types:d}),["c","cc","cpp","cxx","cyc","m"]),E(m({keywords:"null,true,false"}),["json"]),E(m({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:d}),["cs"]),E(m({keywords:i,cStyleComments:!0}),["java"]),E(m({keywords:c,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),E(m({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),E(m({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),E(m({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),E(m({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),E(m({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),E(g([],[["str",/^[\s\S]+/]]),["regex"]);var w=e.PR={createSimpleLexer:g,registerLangHandler:E,sourceDecorator:m,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:T,prettyPrint:k},C=e.define;"function"==typeof C&&C.amd&&C("google-code-prettify",[],(function(){return w}))}()},"T+//": /*!***********************************************!*\ !*** ./src/pages/Three/index.tsx + 4 modules ***! \***********************************************/ /*! exports provided: default */ /*! all exports used */ /*! 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/PlusSquareOutlined.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/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/pages/Three/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/RenderHtml/index.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/index.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/service/competitions.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 ./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/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/layout/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/layout/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/menu/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/menu/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/upload/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/upload/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,r){"use strict";r.r(t);r("Q9mQ");var n=r("diRs"),i=(r("2qtc"),r("kLXV")),a=(r("miYZ"),r("tsqr")),s=r("9og8"),o=r("tJVT"),l=(r("B9cy"),r("Ol7k")),u=(r("lUTK"),r("BvKs")),c=r("WmNS"),d=r.n(c),f=r("q1tI"),h=r.n(f),p=r("m3rI"),g=r("p0QG"),m=r.n(g),v=r("ErOA"),y=r("9kvl"),b=r("RCxd"),E=r("xGfz"),x=r("xKgJ"),S=(r("5NDa"),r("5rEg"));var T=Object(y.a)((function(e){return{user:e.user}}))((function(e){e.user;var t=e.CategoryId,r=e.IsShow,n=e.setIsShow,l=(e.dispatch,e.init),u=Object(f.useState)(),c=Object(o.a)(u,2),p=c[0],g=c[1];return h.a.createElement(i.a,{title:t?"新建三级类目":"新建二级类目",width:424,onCancel:function(){n(!1)},onOk:Object(s.a)(d.a.mark((function e(){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p){e.next=3;break}return a.b.error("栏目名不能为空"),e.abrupt("return");case 3:return e.next=5,Object(v.a)("/api/programas.json",{method:"post",body:{name:p,parent_id:t}});case 5:0===e.sent.status&&(a.b.info("创建成功"),n(!1),g(""),l());case 7:case"end":return e.stop()}}),e)}))),visible:r},h.a.createElement(S.a,{value:p,onChange:function(e){return g(e.target.value)},placeholder:"请输入不超过10个汉字的名称",maxLength:10}))}));var k=Object(y.a)((function(e){return{user:e.user}}))((function(e){e.user;var t=e.CategoryId,r=e.name,n=e.IsShow,l=e.setIsShow,u=(e.dispatch,e.init),c=Object(f.useState)(),p=Object(o.a)(c,2),g=p[0],m=p[1];return Object(f.useEffect)((function(){m(r)}),[r]),h.a.createElement(i.a,{title:"目录重命名",width:424,onCancel:function(){l(!1)},onOk:Object(s.a)(d.a.mark((function e(){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g){e.next=3;break}return a.b.error("栏目名不能为空"),e.abrupt("return");case 3:return e.next=5,Object(v.a)("/api/programas/".concat(t,"/rename.json"),{method:"put",body:{name:g,id:t}});case 5:0===e.sent.status&&(a.b.info("修改成功"),l(!1),m(""),u());case 7:case"end":return e.stop()}}),e)}))),visible:n},h.a.createElement(S.a,{value:g,onChange:function(e){return m(e.target.value)},placeholder:"请输入不超过10个汉字的名称",maxLength:10}))})),w=(r("+L6B"),r("2/Rp")),C=r("9Bee");var L=Object(y.a)((function(e){return{user:e.user}}))((function(e){e.user;var t,r,n,i,a=e.ItemData,s=e.setIssee;return e.dispatch,e.init,h.a.createElement("div",null,h.a.createElement("div",{style:{textAlign:"right"}},Object(x.v)()&&h.a.createElement(w.a,{onClick:function(){return s(!1)}},"编辑")),h.a.createElement(C.a,{value:a.content}),(null==a||null===(t=a.attachment)||void 0===t?void 0:t.id)&&h.a.createElement("div",null,h.a.createElement("a",{href:null==a||null===(r=a.attachment)||void 0===r?void 0:r.url,target:"_self",download:null==a||null===(n=a.attachment)||void 0===n?void 0:n.title},h.a.createElement("i",{style:{color:"#29BD8B"},className:"font-14 color-green iconfont icon-fujian mr8"}),h.a.createElement("span",{style:{color:"#000000"}},null==a||null===(i=a.attachment)||void 0===i?void 0:i.title))))})),A=(r("DZo9"),r("8z0m")),D=r("Ot1p"),O=r("hJwl");var _=Object(y.a)((function(e){return{user:e.user}}))((function(e){e.user;var t,r,n=e.ItemData,i=e.setIssee,l=e.CategoryId,u=(e.dispatch,e.init,Object(f.useState)([])),c=Object(o.a)(u,2),g=c[0],m=c[1],y=Object(f.useState)(n.content),b=Object(o.a)(y,2),E=b[0],x=b[1],S={name:"file",multiple:!0,action:p.a.API_SERVER+"/api/attachments.json",defaultFileList:(r=[],null==n||null===(t=n.attachments)||void 0===t||t.map((function(e){var t={uid:null==e?void 0:e.id,name:e.title,response:{id:e.id}};r.push(t)})),r),onRemove:function(e){Object(O.t)({id:e.uid})},onChange:function(e){console.log("info",e);var t=e.file.status;"removed"===t&&m(e.fileList),"done"===t?(m(e.fileList),a.b.success("".concat(e.file.name," 文件上传成功"))):"error"===t&&a.b.error("".concat(e.file.name," 文件上传失败"))},beforeUpload:function(e){var t=e.size/1024/1024<150;return t||a.b.info("文件大小必须小于150MB"),t}};function T(){return(T=Object(s.a)(d.a.mark((function e(){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(v.a)("/api/programas/".concat(l,"/update_content.json"),{method:"put",body:{id:l,content:E,attachment_id:k(g)}});case 2:e.sent&&(a.b.info("提交成功"),i(!0));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){var t;return e&&e.map((function(e){t=e.response.id})),t}return h.a.createElement("div",null,h.a.createElement(D.a,{defaultValue:E,onChange:function(e){return x(e)}}),h.a.createElement(A.a,S,h.a.createElement(w.a,{className:"uploadBtn"},"上传附件"),"(单个文件150M以内)"),h.a.createElement("p",{style:{marginTop:"10px"}},h.a.createElement(w.a,{style:{width:"90px"},onClick:function(){return function(){return T.apply(this,arguments)}()}},"提交"),h.a.createElement(w.a,{style:{marginLeft:"30px",width:"90px"},type:"primary",onClick:function(){return i(!0)}},"取消")))})),R=u.a.SubMenu,I=(l.a.Content,l.a.Sider);t.default=Object(y.a)((function(e){return{user:e.user,globalSetting:e.globalSetting}}))((function(e){e.user,e.dispatch;var t,r=e.globalSetting,l=Object(f.useState)(),c=Object(o.a)(l,2),g=(c[0],c[1],Object(f.useState)(!1)),y=Object(o.a)(g,2),S=y[0],w=y[1],C=Object(f.useState)(),A=Object(o.a)(C,2),D=A[0],O=A[1],M=Object(f.useState)(),F=Object(o.a)(M,2),P=F[0],N=F[1],B=Object(f.useState)(!1),j=Object(o.a)(B,2),U=j[0],H=j[1],G=Object(f.useState)(""),W=Object(o.a)(G,2),z=W[0],K=W[1],V=Object(f.useState)(""),q=Object(o.a)(V,2),$=q[0],Y=q[1],X=Object(f.useState)(!0),Z=Object(o.a)(X,2),Q=Z[0],J=Z[1];function ee(){return te.apply(this,arguments)}function te(){return(te=Object(s.a)(d.a.mark((function e(){var t;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(v.a)("/api/programas.json",{method:"get"});case 2:(t=e.sent)&&O(null==t?void 0:t.programas);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Object(f.useEffect)((function(){ee()}),[]),console.log("globalSetting",r);var re=function(){var e=Object(s.a)(d.a.mark((function e(t,r,n){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next=1===e.t0?3:2===e.t0?6:3===e.t0?10:4===e.t0?15:17;break;case 3:return N(null==r?void 0:r.id),w(!0),e.abrupt("break",17);case 6:return N(null==r?void 0:r.id),H(!0),K(null==r?void 0:r.name),e.abrupt("break",17);case 10:return e.next=12,Object(v.a)("/api/programas/".concat(null==r?void 0:r.id,"/top.json"),{method:"post",body:{id:null==r?void 0:r.id}});case 12:return 0===e.sent.status&&ee(),e.abrupt("break",17);case 15:return ne(h.a.createElement("p",null,"删除之后不能恢复,",h.a.createElement("br",null),"是否确认删除?"),Object(s.a)(d.a.mark((function e(){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(v.a)("/api/programas/".concat(null==r?void 0:r.id,".json"),{method:"delete",body:{id:null==r?void 0:r.id}});case 2:0===e.sent.status&&(a.b.info("删除成功"),ee());case 4:case"end":return e.stop()}}),e)})))),e.abrupt("break",17);case 17:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}(),ne=function(e,t){i.a.confirm({centered:!0,title:"提示",icon:h.a.createElement(b.a,null),content:e,okText:"确认",onOk:function(){return t()},cancelText:"取消"})},ie=function(e,t){return h.a.createElement("div",{className:m.a.leftMenuActions},1===t&&h.a.createElement("p",{className:"current",onClick:function(){return re(1,e,t)}},"新建"),h.a.createElement("p",{className:"current",onClick:function(){return re(2,e,t)}},"重命名"),h.a.createElement("p",{className:"current",onClick:function(){return re(3,e,t)}},"置顶"),h.a.createElement("p",{className:"current",onClick:function(){return re(4,e,t)}},"删除"))};function ae(){return se.apply(this,arguments)}function se(){return(se=Object(s.a)(d.a.mark((function e(){var t;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(v.a)("/api/programas/".concat(P,"/content.json"),{method:"get",params:{id:P}});case 2:(t=e.sent)&&Y(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return h.a.createElement("div",{style:{marginBottom:"40px"}},h.a.createElement("img",{style:{width:"100%"},src:p.a.IMG_SERVER+"/".concat(null==r||null===(t=r.setting)||void 0===t?void 0:t.shixun_banner_url)}),h.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},h.a.createElement(I,{width:244,className:m.a.leftMenus,style:{background:"none",marginTop:"20px",height:"auto"}},h.a.createElement(u.a,{mode:"inline"},null==D?void 0:D.map((function(e,t){var r;return(null==e?void 0:e.children.length)>0?h.a.createElement(R,{title:h.a.createElement("span",{className:"font16"},h.a.createElement("span",null,e.name),!Object(x.v)()&&h.a.createElement("span",null),Object(x.v)()&&h.a.createElement(n.a,{placement:"right",content:function(){return ie(e,1)},trigger:"hover"},h.a.createElement("span",{className:["iconfont icon-sandian",m.a.actions].join(" ")})))},null==e||null===(r=e.children)||void 0===r?void 0:r.map((function(e,t){return h.a.createElement(u.a.Item,{className:null===m.a||void 0===m.a?void 0:m.a.SubMentItem,onClick:function(){N(null==e?void 0:e.id),P=null==e?void 0:e.id,ae()}},h.a.createElement("span",{style:{flex:"1"}},null==e?void 0:e.name),Object(x.v)()&&h.a.createElement(n.a,{placement:"right",content:function(){return ie(e,2)},trigger:"hover"},h.a.createElement("span",{className:["iconfont icon-sandian",m.a.actions].join(" ")})))}))):h.a.createElement(u.a.Item,{className:null===m.a||void 0===m.a?void 0:m.a.SubMentItem,onClick:function(){N(null==e?void 0:e.id),P=null==e?void 0:e.id,ae()}},h.a.createElement("span",{style:{flex:"1"}},null==e?void 0:e.name),Object(x.v)()&&h.a.createElement(n.a,{placement:"right",content:function(){return ie(e,1)},trigger:"hover"},h.a.createElement("span",{className:["iconfont icon-sandian",m.a.actions].join(" ")})))})),h.a.createElement(u.a.Item,{onClick:function(){N(""),P="",w(!0)},style:{color:"#0152d9",fontSize:"16px",height:"40px",display:"flex",alignItems:"center"},icon:h.a.createElement(E.a,{style:{color:"#0152d9",fontSize:"16px"}})},"新增二级类目"))),h.a.createElement("div",{style:{width:"937px",marginLeft:"17px",background:"#fff",padding:"20px"}},Q&&h.a.createElement(L,{ItemData:$,setIssee:J}),!1===Q&&h.a.createElement(_,{ItemData:$,setIssee:J,CategoryId:P}))),h.a.createElement(T,{CategoryId:P,IsShow:S,setIsShow:w,init:ee}),h.a.createElement(k,{CategoryId:P,name:z,IsShow:U,setIsShow:H,init:ee}))}))},"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,r){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),s=n||i||a,o=s&&(n?document.documentMode||6:+(a||i)[1]),l=!a&&/WebKit\//.test(e),u=l&&/Qt\/\d+\.\d+/.test(e),c=!a&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!a&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),E=/win/i.test(t),x=d&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var S=y&&(u||d&&(null==x||x<12.11)),T=r||s&&o>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var w,C=function(e,t){var r=e.className,n=k(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function L(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return L(e).appendChild(t)}function D(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a=t)return s+(t-a);s+=o-a,s+=r-s%r,a=o+1}}g?F=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(F=function(e){try{e.select()}catch(e){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};function U(e,t){for(var r=0;r=t)return n+Math.min(s,t-i);if(i+=a-n,n=a+1,(i+=r-i%r)>=t)return n}}var V=[""];function q(e){for(;V.length<=e;)V.push($(V)+" ");return V[e]}function $(e){return e[e.length-1]}function Y(e,t){for(var r=[],n=0;n"€"&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ne(e){return e.charCodeAt(0)>=768&&re.test(e)}function ie(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var i=(t+r)/2,a=n<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:r;e(a)?r=a:t=a+n}}var se=null;function oe(e,t,r){var n;se=null;for(var i=0;it)return i;a.to==t&&(a.from!=a.to&&"before"==r?n=i:se=i),a.from==t&&(a.from!=a.to&&"before"!=r?n=i:se=i)}return null!=n?n:se}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function a(e,t,r){this.level=e,this.from=t,this.to=r}return function(s,o){var l="ltr"==o?"L":"R";if(0==s.length||"ltr"==o&&!e.test(s))return!1;for(var u,c=s.length,d=[],f=0;f-1&&(n[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function pe(e,t){var r=fe(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function ye(e){e.prototype.on=function(e,t){de(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ee(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xe(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Se(e){be(e),Ee(e)}function Te(e){return e.target||e.srcElement}function ke(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 we,Ce,Le=function(){if(s&&o<9)return!1;var e=D("div");return"draggable"in e||"dragDrop"in e}();function Ae(e){if(null==we){var t=D("span","​");A(e,D("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(we=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&o<8))}var r=we?D("span","​"):D("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function De(e){if(null!=Ce)return Ce;var t=A(e,document.createTextNode("AخA")),r=w(t,0,1).getBoundingClientRect(),n=w(t,1,2).getBoundingClientRect();return L(e),!(!r||r.left==r.right)&&(Ce=n.right-r.right<3)}var Oe,_e=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var a=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),s=a.indexOf("\r");-1!=s?(r.push(a.slice(0,s)),t+=s+1):(r.push(a),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Re=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(Oe=D("div"))||(Oe.setAttribute("oncopy","return;"),"function"==typeof Oe.oncopy),Me=null,Fe={},Pe={};function Ne(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fe[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=Z(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 je(e,t){t=Be(t);var r=Fe[t.name];if(!r)return je(e,"text/plain");var n=r(e,t);if(Ue.hasOwnProperty(t.name)){var i=Ue[t.name];for(var a in i)i.hasOwnProperty(a)&&(n.hasOwnProperty(a)&&(n["_"+a]=n[a]),n[a]=i[a])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)n[s]=t.modeProps[s];return n}var Ue={};function He(e,t){N(t,Ue.hasOwnProperty(e)?Ue[e]:Ue[e]={})}function Ge(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function We(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function ze(e,t,r){return!e.startState||e.startState(t,r)}var Ke=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Ve(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 r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],a=i.chunkSize();if(t=e.first&&tr?et(r,Ve(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?et(e.line,t):r<0?et(e.line,0):e}(t,Ve(e,t.line).text.length)}function lt(e,t){for(var r=[],n=0;n=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.post},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},ct=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function dt(e,t,r,n){var i=[e.state.modeGen],a={};Et(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),a,n);for(var s=r.state,o=function(n){r.baseTokens=i;var o=e.state.overlays[n],l=1,u=0;r.state=!0,Et(e,t.text,o.mode,r,(function(e,t){for(var r=l;ue&&i.splice(l,1,e,i[l+1],n),l+=2,u=Math.min(e,n)}if(t)if(o.opaque)i.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;re.options.maxHighlightLength&&Ge(e.doc.mode,n.state),a=dt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ht(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new ct(n,!0,t);var a=function(e,t,r){for(var n,i,a=e.doc,s=r?-1:t-(e.doc.mode.innerMode?1e3:100),o=t;o>s;--o){if(o<=a.first)return a.first;var l=Ve(a,o-1),u=l.stateAfter;if(u&&(!r||o+(u instanceof ut?u.lookAhead:0)<=a.modeFrontier))return o;var c=B(l.text,null,e.options.tabSize);(null==i||n>c)&&(i=o-1,n=c)}return i}(e,t,r),s=a>n.first&&Ve(n,a-1).stateAfter,o=s?ct.fromSaved(n,s,a):new ct(n,ze(n.mode),a);return n.iter(a,t,(function(r){pt(e,r.text,o);var n=o.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&nt.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}ct.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ct.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}},ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ct.fromSaved=function(e,t,r){return t instanceof ut?new ct(e,Ge(e.mode,t.state),r,t.lookAhead):new ct(e,Ge(e.mode,t),r)},ct.prototype.save=function(e){var t=!1!==e?Ge(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var vt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function yt(e,t,r,n){var i,a,s=e.doc,o=s.mode,l=Ve(s,(t=ot(s,t)).line),u=ht(e,t.line,r),c=new Ke(l.text,e.options.tabSize,u);for(n&&(a=[]);(n||c.pose.options.maxHighlightLength?(o=!1,s&&pt(e,t,n,d.pos),d.pos=t.length,l=null):l=bt(mt(r,d,n.state,f),a),f){var h=f[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!o||c!=l){for(;u=t:a.to>t);(n||(n=[])).push(new Tt(s,a.from,o?null:a.to))}}return n}(r,i,s),l=function(e,t,r){var n;if(e)for(var i=0;i=t:a.to>t)||a.from==t&&"bookmark"==s.type&&(!r||a.marker.insertLeft)){var o=null==a.from||(s.inclusiveLeft?a.from<=t:a.from0&&o)for(var b=0;bt)&&(!r||Rt(r,a.marker)<0)&&(r=a.marker)}return r}function Nt(e,t,r,n,i){var a=Ve(e,t),s=St&&a.markedSpans;if(s)for(var o=0;o=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?tt(u.to,r)>=0:tt(u.to,r)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?tt(u.from,n)<=0:tt(u.from,n)<0)))return!0}}}function Bt(e){for(var t;t=Mt(e);)e=t.find(-1,!0).line;return e}function jt(e,t){var r=Ve(e,t),n=Bt(r);return r==n?t:Xe(n)}function Ut(e,t){if(t>e.lastLine())return t;var r,n=Ve(e,t);if(!Ht(e,n))return t;for(;r=Ft(n);)n=r.find(1,!0).line;return Xe(n)+1}function Ht(e,t){var r=St&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Vt=function(e,t,r){this.text=e,Dt(this,t),this.height=r?r(this):1};function qt(e){e.parent=null,At(e)}Vt.prototype.lineNo=function(){return Xe(this)},ye(Vt);var $t={},Yt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Yt:$t;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var r=O("span",null,null,l?"padding-right: .1px":null),n={pre:O("pre",[r],"CodeMirror-line"),content:r,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 a=i?t.rest[i-1]:t.line,s=void 0;n.pos=0,n.addToken=Jt,De(e.display.measure)&&(s=ue(a,e.doc.direction))&&(n.addToken=er(n.addToken,s)),n.map=[],rr(a,n,ft(e,a,t!=e.display.externalMeasured&&Xe(a))),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=M(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=M(a.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Ae(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var o=n.content.lastChild;(/\bcm-tab\b/.test(o.className)||o.querySelector&&o.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=M(n.pre.className,n.textClass||"")),n}function Qt(e){var t=D("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,r,n,i,a,l){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;iu&&d.from<=u);f++);if(d.to>=c)return e(r,n,i,a,s,o,l);e(r,n.slice(0,d.to-u),i,a,null,o,l),a=null,n=n.slice(d.to-u),u=d.to}}}function tr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rr(e,t,r){var n=e.markedSpans,i=e.text,a=0;if(n)for(var s,o,l,u,c,d,f,h=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=o="",f=null,d=null,v=1/0;for(var y=[],b=void 0,E=0;Ep||S.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,u=""),S.className&&(l+=" "+S.className),S.css&&(o=(o?o+";":"")+S.css),S.startStyle&&x.from==p&&(c+=" "+S.startStyle),S.endStyle&&x.to==v&&(b||(b=[])).push(S.endStyle,x.to),S.title&&((f||(f={})).title=S.title),S.attributes)for(var T in S.attributes)(f||(f={}))[T]=S.attributes[T];S.collapsed&&(!d||Rt(d.marker,S)<0)&&(d=x)}else x.from>p&&v>x.from&&(v=x.from)}if(b)for(var k=0;k=h)break;for(var C=Math.min(h,v);;){if(m){var L=p+m.length;if(!d){var A=L>C?m.slice(0,C-p):m;t.addToken(t,A,s?s+l:l,c,p+A.length==v?u:"",o,f)}if(L>=C){m=m.slice(C-p),p=C;break}p=L,c=""}m=i.slice(a,a=r[g++]),s=Xt(r[g++],t.cm.options)}}else for(var D=1;Dr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Dr(e,t,r,n){return Rr(e,_r(e,t),r,n)}function Or(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&t2&&a.push((l.bottom+u.top)/2-r.top)}}a.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(a=function(e,t,r,n){var i,a=Fr(t.map,r,n),l=a.node,u=a.start,c=a.end,d=a.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;u&&ne(t.line.text.charAt(a.coverStart+u));)--u;for(;a.coverStart+c1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var h;u>0&&(d=n="right"),i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==n?h.length-1:0]:l.getBoundingClientRect()}if(s&&o<9&&!u&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+nn(e.display),top:p.top,bottom:p.bottom}:Mr}for(var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,b=0;bt)&&(i=(a=l-o)-1,t>=l&&(s="right")),null!=i){if(n=e[u+2],o==l&&r==(n.insertLeft?"left":"right")&&(s=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],s="left";if("right"==r&&i==l-o)for(;u=0&&(r=e[i]).left==r.right;i--);return r}function Nr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=n.text.length?(l=n.text.length,u="before"):l<=0&&(l=0,u="after"),!o)return s("before"==u?l-1:l,"before"==u);function c(e,t,r){return s(r?e-1:e,1==o[t].level!=r)}var d=oe(o,l,u),f=se,h=c(l,d,"before"==u);return null!=f&&(h.other=c(l,f,"before"!=u)),h}function qr(e,t){var r=0;t=ot(e.doc,t),e.options.lineWrapping||(r=nn(e.display)*t.ch);var n=Ve(e.doc,t.line),i=Wt(n)+Sr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function $r(e,t,r,n,i){var a=et(e,t,r);return a.xRel=i,n&&(a.outside=n),a}function Yr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return $r(n.first,0,null,-1,-1);var i=Ze(n,r),a=n.first+n.size-1;if(i>a)return $r(n.first+n.size-1,Ve(n,a).text.length,null,1,1);t<0&&(t=0);for(var s=Ve(n,i);;){var o=Jr(e,s,i,t,r),l=Pt(s,o.ch+(o.xRel>0||o.outside>0?1:0));if(!l)return o;var u=l.find(1);if(u.line==i)return u;s=Ve(n,i=u.line)}}function Xr(e,t,r,n){n-=Gr(t);var i=t.text.length,a=ae((function(t){return Rr(e,r,t-1).bottom<=n}),i,0);return{begin:a,end:i=ae((function(t){return Rr(e,r,t).top>n}),a,i)}}function Zr(e,t,r,n){return r||(r=_r(e,t)),Xr(e,t,r,Wr(e,t,Rr(e,r,n),"line").top)}function Qr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function Jr(e,t,r,n,i){i-=Wt(t);var a=_r(e,t),s=Gr(t),o=0,l=t.text.length,u=!0,c=ue(t,e.doc.direction);if(c){var d=(e.options.lineWrapping?tn:en)(e,t,r,a,c,n,i);o=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var f,h,p=null,g=null,m=ae((function(t){var r=Rr(e,a,t);return r.top+=s,r.bottom+=s,!!Qr(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)}),o,l),v=!1;if(g){var y=n-g.left=E.bottom?1:0}return $r(r,m=ie(t.text,m,1),h,v,n-f)}function en(e,t,r,n,i,a,s){var o=ae((function(o){var l=i[o],u=1!=l.level;return Qr(Vr(e,et(r,u?l.to:l.from,u?"before":"after"),"line",t,n),a,s,!0)}),0,i.length-1),l=i[o];if(o>0){var u=1!=l.level,c=Vr(e,et(r,u?l.from:l.to,u?"after":"before"),"line",t,n);Qr(c,a,s,!0)&&c.top>s&&(l=i[o-1])}return l}function tn(e,t,r,n,i,a,s){var o=Xr(e,t,n,s),l=o.begin,u=o.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,d=null,f=0;f=u||h.to<=l)){var p=Rr(e,n,1!=h.level?Math.min(u,h.to)-1:Math.max(l,h.from)).right,g=pg)&&(c=h,d=g)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function rn(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ir){Ir=D("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(D("br"));Ir.appendChild(document.createTextNode("x"))}A(e.measure,Ir);var r=Ir.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),L(e.measure),r||1}function nn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=D("span","xxxxxxxxxx"),r=D("pre",[t],"CodeMirror-line-like");A(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function an(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,a=t.gutters.firstChild,s=0;a;a=a.nextSibling,++s){var o=e.display.gutterSpecs[s].className;r[o]=a.offsetLeft+a.clientLeft+i,n[o]=a.clientWidth}return{fixedPos:sn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function sn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function on(e){var t=rn(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/nn(e.display)-3);return function(i){if(Ht(e.doc,i))return 0;var a=0;if(i.widgets)for(var s=0;s0&&(l=Ve(e.doc,u.line).text).length==u.ch){var c=B(l,l.length,e.options.tabSize)-l.length;u=et(u.line,Math.max(0,Math.round((a-kr(e.display).left)/nn(e.display))-c))}return u}function cn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)St&&jt(e.doc,t)i.viewFrom?hn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)hn(e);else if(t<=i.viewFrom){var a=pn(e,r,r+n,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=n):hn(e)}else if(r>=i.viewTo){var s=pn(e,t,t,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):hn(e)}else{var o=pn(e,t,t,-1),l=pn(e,r,r+n,1);o&&l?(i.view=i.view.slice(0,o.index).concat(ir(e,o.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):hn(e)}var u=i.externalMeasured;u&&(r=i.lineN&&t=n.viewTo)){var a=n.view[cn(e,t)];if(null!=a.node){var s=a.changes||(a.changes=[]);-1==U(s,r)&&s.push(r)}}}function hn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pn(e,t,r,n){var i,a=cn(e,t),s=e.display.view;if(!St||r==e.doc.first+e.doc.size)return{index:a,lineN:r};for(var o=e.display.viewFrom,l=0;l0){if(a==s.length-1)return null;i=o+s[a].size-t,a++}else i=o-t;t+=i,r+=i}for(;jt(e.doc,r)!=r;){if(a==(n<0?0:s.length-1))return null;r+=n*s[a-(n<0?1:0)].size,a+=n}return{index:a,lineN:r}}function gn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||o.to().linet||t==r&&s.to==t)&&(n(Math.max(s.from,t),Math.min(s.to,r),1==s.level?"rtl":"ltr",a),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?f:n,(function(e,t,i,d){var m="ltr"==i,v=h(e,m?"left":"right"),y=h(t-1,m?"right":"left"),b=null==r&&0==e,E=null==n&&t==f,x=0==d,S=!g||d==g.length-1;if(y.top-v.top<=3){var T=(u?E:b)&&S,k=(u?b:E)&&x?o:(m?v:y).left,w=T?l:(m?y:v).right;c(k,v.top,w-k,v.bottom)}else{var C,L,A,D;m?(C=u&&b&&x?o:v.left,L=u?l:p(e,i,"before"),A=u?o:p(t,i,"after"),D=u&&E&&S?l:y.right):(C=u?p(e,i,"before"):o,L=!u&&b&&x?l:v.right,A=!u&&E&&S?o:y.left,D=u?p(t,i,"after"):l),c(C,v.top,L-C,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||wn(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Sn(e){e.state.focused||(e.display.input.focus(),kn(e))}function Tn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,wn(e))}),100)}function kn(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()),xn(e))}function wn(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 Cn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||f<-.005)&&(Ye(i.line,l),Ln(i.line),i.rest))for(var h=0;he.display.sizerWidth){var p=Math.ceil(u/nn(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Ln(e){if(e.widgets)for(var t=0;t=s&&(a=Ze(t,Wt(Ve(t,l))-e.wrapper.clientHeight),s=l)}return{from:a,to:Math.max(s,a+1)}}function Dn(e,t){var r=e.display,n=rn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,a=Lr(e),s={};t.bottom-t.top>a&&(t.bottom=t.top+a);var o=e.doc.height+Tr(r),l=t.topo-n;if(t.topi+a){var c=Math.min(t.top,(u?o:t.bottom)-a);c!=i&&(s.scrollTop=c)}var d=e.options.fixedGutter?0:r.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft-d,h=Cr(e)-r.gutters.offsetWidth,p=t.right-t.left>h;return p&&(t.right=t.left+h),t.left<10?s.scrollLeft=0:t.lefth+f-3&&(s.scrollLeft=t.right+(p?0:10)-h),s}function On(e,t){null!=t&&(In(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function _n(e){In(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Rn(e,t,r){null==t&&null==r||In(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function In(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mn(e,qr(e,t.from),qr(e,t.to),t.margin))}function Mn(e,t,r,n){var i=Dn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Rn(e,i.scrollLeft,i.scrollTop)}function Fn(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||li(e,{top:t}),Pn(e,t,!0),r&&li(e),ni(e,100))}function Pn(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Nn(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,di(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Bn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Tr(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?r:0,docHeight:n,scrollHeight:n+wr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var jn=function(e,t,r){this.cm=r;var n=this.vert=D("div",[D("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=D("div",[D("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),de(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),de(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,s&&o<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n: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=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=y&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},jn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var i=e.getBoundingClientRect();("vert"==r?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,n)}))},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Un=function(){};function Hn(e,t){t||(t=Bn(e));var r=e.display.barWidth,n=e.display.barHeight;Gn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Cn(e),Gn(e,Bn(e)),r=e.display.barWidth,n=e.display.barHeight}function Gn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Un.prototype.update=function(){return{bottom:0,right:0}},Un.prototype.setScrollLeft=function(){},Un.prototype.setScrollTop=function(){},Un.prototype.clear=function(){};var Wn={native:jn,null:Un};function zn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Wn[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),de(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?Nn(e,t):Fn(e,t)}),e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Kn=0;function Vn(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:++Kn},t=e.curOp,ar?ar.ops.push(t):t.ownsGroup=ar={ops:[t],delayedCallbacks:[]}}function qn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ai(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yn(e){e.updatedDisplay=e.mustUpdate&&si(e.cm,e.update)}function Xn(e){var t=e.cm,r=t.display;e.updatedDisplay&&Cn(t),e.barMeasure=Bn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Dr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+wr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Cr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Zn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var a=D("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Sr(e.display))+"px;\n height: "+(t.bottom-t.top+wr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="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 a=0;a<5;a++){var s=!1,o=Vr(e,t),l=r&&r!=t?Vr(e,r):o,u=Dn(e,i={left:Math.min(o.left,l.left),top:Math.min(o.top,l.top)-n,right:Math.max(o.left,l.left),bottom:Math.max(o.bottom,l.bottom)+n}),c=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=u.scrollTop&&(Fn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(s=!0)),null!=u.scrollLeft&&(Nn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(s=!0)),!s)break}return i}(t,ot(n,e.scrollToPos.from),ot(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var s=0;s=e.display.viewTo)){var r=+new Date+e.options.workTime,n=ht(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(a){if(n.line>=e.display.viewFrom){var s=a.styles,o=a.text.length>e.options.maxHighlightLength?Ge(t.mode,n.state):null,l=dt(e,a,n,!0);o&&(n.state=o),a.styles=l.styles;var u=a.styleClasses,c=l.classes;c?a.styleClasses=c:u&&(a.styleClasses=null);for(var d=!s||s.length!=a.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),f=0;!d&&fr)return ni(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Jn(e,(function(){for(var t=0;t=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==gn(e))return!1;fi(e)&&(hn(e),t.dims=an(e));var i=n.first+n.size,a=Math.max(t.visible.from-e.options.viewportMargin,n.first),s=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFroms&&r.viewTo-s<20&&(s=Math.min(i,r.viewTo)),St&&(a=jt(e.doc,a),s=Ut(e.doc,s));var o=a!=r.viewFrom||s!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=ir(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=ir(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,cn(e,r)))),n.viewTo=r}(e,a,s),r.viewOffset=Wt(Ve(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=gn(e);if(!o&&0==u&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=R();if(!t||!_(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&_(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return u>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,a=n.lineDiv,s=a.firstChild;function o(t){var r=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,d=0;d-1&&(h=!1),ur(e,f,c,r)),h&&(L(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(Je(e.options,c)))),s=f.node.nextSibling}else{var p=mr(e,f,c,r);a.insertBefore(p,s)}c+=f.size}for(;s;)s=o(s)}(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=R()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),L(r.cursorDiv),L(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,o&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ni(e,400)),r.updateLineNumbers=null,!0}function oi(e,t){for(var r=t.viewport,n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Cr(e))n&&(t.visible=An(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Tr(e.display)-Lr(e),r.top)}),t.visible=An(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!si(e,t))break;Cn(e);var i=Bn(e);mn(e),Hn(e,i),ci(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 r=new ai(e,t);if(si(e,r)){Cn(e),oi(e,r);var n=Bn(e);mn(e),Hn(e,n),ci(e,n),r.finish()}}function ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ci(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+wr(e)+"px"}function di(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=sn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=n+"px",s=0;so.clientWidth,c=o.scrollHeight>o.clientHeight;if(i&&u||a&&c){if(a&&y&&l)e:for(var f=t.target,h=s.view;f!=o;f=f.parentNode)for(var p=0;p=0&&tt(e,n.to())<=0)return r}return-1};var Ti=function(e,t){this.anchor=e,this.head=t};function ki(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort((function(e,t){return tt(e.from(),t.from())})),r=U(t,i);for(var a=1;a0:l>=0){var u=at(o.from(),s.from()),c=it(o.to(),s.to()),d=o.empty()?s.from()==s.head:o.from()==o.head;a<=r&&--r,t.splice(--a,2,new Ti(d?c:u,d?u:c))}}return new Si(t,r)}function wi(e,t){return new Si([new Ti(e,t||e)],0)}function Ci(e){return e.text?et(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Li(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return Ci(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Ci(t).ch-t.to.ch),et(r,n)}function Ai(e,t){for(var r=[],n=0;n1&&e.remove(o.line+1,p-1),e.insert(o.line+1,v)}or(e,"change",e,t)}function Mi(e,t,r){!function e(n,i,a){if(n.linked)for(var s=0;so-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=function(e,t){return t?(ji(e.done),$(e.done)):e.done.length&&!$(e.done).ranges?$(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$(e.done)):void 0}(i,i.lastOp==n)))s=$(a.changes),0==tt(t.from,t.to)&&0==tt(t.from,s.to)?s.to=Ci(t):a.changes.push(Bi(e,t));else{var l=$(i.done);for(l&&l.ranges||Gi(e.sel,i.done),a={changes:[Bi(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||pe(e,"historyAdded")}function Hi(e,t,r,n){var i=e.history,a=n&&n.origin;r==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,a,$(i.done),t))?i.done[i.done.length-1]=t:Gi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=r,n&&!1!==n.clearRedo&&ji(i.undone)}function Gi(e,t){var r=$(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Wi(e,t,r,n){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=r.markedSpans),++a}))}function zi(e){if(!e)return null;for(var t,r=0;r-1&&($(o)[d]=u[d],delete u[d])}}}return n}function qi(e,t,r,n){if(n){var i=e.anchor;if(r){var a=tt(t,i)<0;a!=tt(r,i)<0?(i=t,t=r):a!=tt(t,r)<0&&(t=r)}return new Ti(i,t)}return new Ti(r||t,t)}function $i(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ji(e,new Si([qi(e.sel.primary(),t,r,i)],0),n)}function Yi(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a=t.ch:o.to>t.ch))){if(i&&(pe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(a.markedSpans){--s;continue}break}if(!l.atomic)continue;if(r){var d=l.find(n<0?1:-1),f=void 0;if((n<0?c:u)&&(d=sa(e,d,-n,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=tt(d,r))&&(n<0?f<0:f>0))return ia(e,d,t,n,i)}var h=l.find(n<0?-1:1);return(n<0?u:c)&&(h=sa(e,h,n,h.line==t.line?a:null)),h?ia(e,h,t,n,i):null}}return t}function aa(e,t,r,n,i){var a=n||1,s=ia(e,t,r,a,i)||!i&&ia(e,t,r,a,!0)||ia(e,t,r,-a,i)||!i&&ia(e,t,r,-a,!0);return s||(e.cantEdit=!0,et(e.first,0))}function sa(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?ot(e,et(t.line-1)):null:r>0&&t.ch==(n||Ve(e,t.line)).text.length?t.line0)){var c=[l,1],d=tt(u.from,o.from),f=tt(u.to,o.to);(d<0||!s.inclusiveLeft&&!d)&&c.push({from:u.from,to:o.from}),(f>0||!s.inclusiveRight&&!f)&&c.push({from:o.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)ca(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else ca(e,t)}}function ca(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var r=Ai(e,t);Ui(e,t,r,e.cm?e.cm.curOp.id:NaN),ha(e,t,r,Ct(e,t));var n=[];Mi(e,(function(e,r){r||-1!=U(n,e.history)||(va(e.history,t),n.push(e.history)),ha(e,t,null,Ct(e,t))}))}}function da(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,a=e.history,s=e.sel,o="undo"==t?a.done:a.undone,l="undo"==t?a.undone:a.done,u=0;u=0;--h){var p=f(h);if(p)return p.v}}}}function fa(e,t){if(0!=t&&(e.first+=t,e.sel=new Si(Y(e.sel.ranges,(function(e){return new Ti(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){dn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.linea&&(t={from:t.from,to:et(a,Ve(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),r||(r=Ai(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,a=t.from,s=t.to,o=!1,l=a.line;e.options.lineWrapping||(l=Xe(Bt(Ve(n,a.line))),n.iter(l,s.line+1,(function(e){if(e==i.maxLine)return o=!0,!0}))),n.sel.contains(t.from,t.to)>-1&&me(e),Ii(n,t,r,on(e)),e.options.lineWrapping||(n.iter(l,a.line+t.text.length,(function(e){var t=zt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,o=!1)})),o&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var i=Ve(e,n).stateAfter;if(i&&(!(i instanceof ut)||n+i.lookAhead1||!(this.children[0]instanceof ba))){var o=[];this.collapse(o),this.children=[new ba(o)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var s=i.lines.length%25+25,o=s;o10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n0||0==s&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=O("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Nt(e,t.line,t,r,a)||t.line!=r.line&&Nt(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");St=!0}a.addToHistory&&Ui(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var o,l=t.line,u=e.cm;if(e.iter(l,r.line+1,(function(e){u&&a.collapsed&&!u.options.lineWrapping&&Bt(e)==u.display.maxLine&&(o=!0),a.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 Tt(a,l==t.line?t.ch:null,l==r.line?r.ch:null)),++l})),a.collapsed&&e.iter(t.line,r.line+1,(function(t){Ht(e,t)&&Ye(t,0)})),a.clearOnEnter&&de(a,"beforeCursorEnter",(function(){return a.clear()})),a.readOnly&&(xt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Ta,a.atomic=!0),u){if(o&&(u.curOp.updateMaxLine=!0),a.collapsed)dn(u,t.line,r.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var c=t.line;c<=r.line;c++)fn(u,c,"text");a.atomic&&ra(u.doc),or(u,"markerAdded",u,a)}return a}ka.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vn(e),ve(this,"clear")){var r=this.find();r&&or(this,"clear",r.from,r.to)}for(var n=null,i=null,a=0;ae.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&dn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ra(e.doc)),e&&or(e,"markerCleared",e,this,n,i),t&&qn(e),this.parent&&this.parent.clear()}},ka.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)ua(this,n[l]);o?Qi(this,o):this.cm&&_n(this.cm)})),undo:ri((function(){da(this,"undo")})),redo:ri((function(){da(this,"redo")})),undoSelection:ri((function(){da(this,"undo",!0)})),redoSelection:ri((function(){da(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ot(this,e),t=ot(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(a){var s=a.markedSpans;if(s)for(var o=0;o=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||r&&!r(l.marker)||n.push(l.marker.parent||l.marker)}++i})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=a,++r})),ot(this,et(r,t))},indexFromPos:function(e){var t=(e=ot(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),ea(t.doc,wi(r,r)),f)for(var h=0;h=0;t--)pa(e.doc,"",n[t].from,n[t].to,"+delete");_n(e)}))}function Za(e,t,r){var n=ie(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Qa(e,t,r){var n=Za(e,t.ch,r);return null==n?null:new et(t.line,n,r<0?"after":"before")}function Ja(e,t,r,n,i){if(e){"rtl"==t.doc.direction&&(i=-i);var a=ue(r,t.doc.direction);if(a){var s,o=i<0?$(a):a[0],l=i<0==(1==o.level)?"after":"before";if(o.level>0||"rtl"==t.doc.direction){var u=_r(t,r);s=i<0?r.text.length-1:0;var c=Rr(t,u,s).top;s=ae((function(e){return Rr(t,u,e).top==c}),i<0==(1==o.level)?o.from:o.to-1,s),"before"==l&&(s=Za(r,s,1))}else s=i<0?o.to:o.from;return new et(n,s,l)}}return new et(n,i<0?r.text.length:0,i<0?"before":"after")}Ga.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ga.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ga.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ga.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ga.default=y?Ga.macDefault:Ga.pcDefault;var es={selectAll:oa,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),G)},killLine:function(e){return Xa(e,(function(t){if(t.empty()){var r=Ve(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new et(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),et(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var s=Ve(e.doc,i.line-1).text;s&&(i=new et(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),et(i.line-1,s.length-1),i,"+transpose"))}r.push(new Ti(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return Jn(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n-1&&(tt((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(tt(i.to(),t)>0||t.xRel<0)?function(e,t,r,n){var i=e.display,a=!1,u=ei(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,he(i.wrapper.ownerDocument,"mouseup",u),he(i.wrapper.ownerDocument,"mousemove",c),he(i.scroller,"dragstart",d),he(i.scroller,"drop",u),a||(be(t),n.addNew||$i(e.doc,r,null,null,n.extend),l&&!f||s&&9==o?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(e){a=a||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),de(i.wrapper.ownerDocument,"mouseup",u),de(i.wrapper.ownerDocument,"mousemove",c),de(i.scroller,"dragstart",d),de(i.scroller,"drop",u),Tn(e),setTimeout((function(){return i.input.focus()}),20)}(e,n,t,a):function(e,t,r,n){var i=e.display,a=e.doc;be(t);var s,o,l=a.sel,u=l.ranges;if(n.addNew&&!n.extend?(o=a.sel.contains(r),s=o>-1?u[o]:new Ti(r,r)):(s=a.sel.primary(),o=a.sel.primIndex),"rectangle"==n.unit)n.addNew||(s=new Ti(r,r)),r=un(e,t,!0,!0),o=-1;else{var c=ms(e,r,n.unit);s=n.extend?qi(s,c.anchor,c.head,n.extend):c}n.addNew?-1==o?(o=u.length,Ji(a,ki(e,u.concat([s]),o),{scroll:!1,origin:"*mouse"})):u.length>1&&u[o].empty()&&"char"==n.unit&&!n.extend?(Ji(a,ki(e,u.slice(0,o).concat(u.slice(o+1)),0),{scroll:!1,origin:"*mouse"}),l=a.sel):Xi(a,o,s,W):(o=0,Ji(a,new Si([s],0),W),l=a.sel);var d=r;function f(t){if(0!=tt(d,t))if(d=t,"rectangle"==n.unit){for(var i=[],u=e.options.tabSize,c=B(Ve(a,r.line).text,r.ch,u),f=B(Ve(a,t.line).text,t.ch,u),h=Math.min(c,f),p=Math.max(c,f),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=Ve(a,g).text,y=K(v,h,u);h==p?i.push(new Ti(et(g,y),et(g,y))):v.length>y&&i.push(new Ti(et(g,y),et(g,K(v,p,u))))}i.length||i.push(new Ti(r,r)),Ji(a,ki(e,l.ranges.slice(0,o).concat(i),o),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,E=s,x=ms(e,t,n.unit),S=E.anchor;tt(x.anchor,S)>0?(b=x.head,S=at(E.from(),x.anchor)):(b=x.anchor,S=it(E.to(),x.head));var T=l.ranges.slice(0);T[o]=function(e,t){var r=t.anchor,n=t.head,i=Ve(e.doc,r.line);if(0==tt(r,n)&&r.sticky==n.sticky)return t;var a=ue(i);if(!a)return t;var s=oe(a,r.ch,r.sticky),o=a[s];if(o.from!=r.ch&&o.to!=r.ch)return t;var l,u=s+(o.from==r.ch==(1!=o.level)?0:1);if(0==u||u==a.length)return t;if(n.line!=r.line)l=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=oe(a,n.ch,n.sticky),d=c-s||(n.ch-r.ch)*(1==o.level?-1:1);l=c==u-1||c==u?d<0:d>0}var f=a[u+(l?-1:0)],h=l==(1==f.level),p=h?f.from:f.to,g=h?"after":"before";return r.ch==p&&r.sticky==g?t:new Ti(new et(r.line,p,g),n)}(e,new Ti(ot(a,S),b)),Ji(a,ki(e,T,o),W)}}var h=i.wrapper.getBoundingClientRect(),p=0;function g(t){e.state.selectingText=!1,p=1/0,t&&(be(t),i.input.focus()),he(i.wrapper.ownerDocument,"mousemove",m),he(i.wrapper.ownerDocument,"mouseup",v),a.history.lastSelOrigin=null}var m=ei(e,(function(t){0!==t.buttons&&ke(t)?function t(r){var s=++p,o=un(e,r,!0,"rectangle"==n.unit);if(o)if(0!=tt(o,d)){e.curOp.focus=R(),f(o);var l=An(i,a);(o.line>=l.to||o.lineh.bottom?20:0;u&&setTimeout(ei(e,(function(){p==s&&(i.scroller.scrollTop+=u,t(r))})),50)}}(t):g(t)})),v=ei(e,g);e.state.selectingText=v,de(i.wrapper.ownerDocument,"mousemove",m),de(i.wrapper.ownerDocument,"mouseup",v)}(e,n,t,a)}(t,n,a,e):Te(e)==r.scroller&&be(e):2==i?(n&&$i(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(T?t.display.input.onContextMenu(e):Tn(t)))}}function ms(e,t,r){if("char"==r)return new Ti(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Ti(et(t.line,0),ot(e.doc,et(t.line+1,0)));var n=r(e,t);return new Ti(n.from,n.to)}function vs(e,t,r,n){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&be(t);var s=e.display,o=s.lineDiv.getBoundingClientRect();if(a>o.bottom||!ve(e,r))return xe(t);a-=o.top-s.viewOffset;for(var l=0;l=i)return pe(e,r,e,Ze(e.doc,a),e.display.gutterSpecs[l].className,t),xe(t)}}function ys(e,t){return vs(e,t,"gutterClick",!0)}function bs(e,t){xr(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&vs(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||T||e.display.input.onContextMenu(t)}function Es(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),jr(e)}ps.prototype.compare=function(e,t,r){return this.time+400>e&&0==tt(t,this.pos)&&r==this.button};var xs={toString:function(){return"CodeMirror.Init"}},Ss={},Ts={};function ks(e,t,r){if(!t!=!(r&&r!=xs)){var n=e.display.dragFunctions,i=t?de:he;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function ws(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"),Kt(e)),ln(e),dn(e),jr(e),setTimeout((function(){return Hn(e)}),100)}function Cs(e,t){var r=this;if(!(this instanceof Cs))return new Cs(e,t);this.options=t=t?N(t):{},N(Ss,t,!1);var n=t.value;"string"==typeof n?n=new Oa(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Cs.inputStyles[t.inputStyle](this),a=this.display=new mi(e,n,i,t);for(var u in a.wrapper.CodeMirror=this,Es(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},t.autofocus&&!v&&a.input.focus(),s&&o<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;de(t.scroller,"mousedown",ei(e,gs)),de(t.scroller,"dblclick",s&&o<11?ei(e,(function(t){if(!ge(e,t)){var r=un(e,t);if(r&&!ys(e,t)&&!xr(e.display,t)){be(t);var n=e.findWordAt(r);$i(e.doc,n.anchor,n.head)}}})):function(t){return ge(e,t)||be(t)}),de(t.scroller,"contextmenu",(function(t){return bs(e,t)})),de(t.input.getField(),"contextmenu",(function(r){t.scroller.contains(r.target)||bs(e,r)}));var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function a(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}de(t.scroller,"touchstart",(function(i){if(!ge(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!ys(e,i)){t.input.ensurePolled(),clearTimeout(r);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),de(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),de(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!xr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var s,o=e.coordsChar(t.activeTouch,"page");s=!n.prev||a(n,n.prev)?new Ti(o,o):!n.prev.prev||a(n,n.prev.prev)?e.findWordAt(o):new Ti(et(o.line,0),ot(e.doc,et(o.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),be(r)}i()})),de(t.scroller,"touchcancel",i),de(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Fn(e,t.scroller.scrollTop),Nn(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),de(t.scroller,"mousewheel",(function(t){return xi(e,t)})),de(t.scroller,"DOMMouseScroll",(function(t){return xi(e,t)})),de(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||Se(t)},over:function(t){ge(e,t)||(function(e,t){var r=un(e,t);if(r){var n=document.createDocumentFragment();yn(e,r,n),e.display.dragCursor||(e.display.dragCursor=D("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,n)}}(e,t),Se(t))},start:function(t){return function(e,t){if(s&&(!e.state.draggingText||+new Date-_a<100))Se(t);else if(!ge(e,t)&&!xr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var r=D("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),d&&r.parentNode.removeChild(r)}}(e,t)},drop:ei(e,Ra),leave:function(t){ge(e,t)||Ia(e)}};var l=t.input.getField();de(l,"keyup",(function(t){return cs.call(e,t)})),de(l,"keydown",ei(e,us)),de(l,"keypress",ei(e,ds)),de(l,"focus",(function(t){return kn(e,t)})),de(l,"blur",(function(t){return wn(e,t)}))}(this),Pa(),Vn(this),this.curOp.forceUpdate=!0,Fi(this,n),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){r.hasFocus()&&!r.state.focused&&kn(r)}),20):wn(this),Ts)Ts.hasOwnProperty(u)&&Ts[u](this,t[u],xs);fi(this),t.finishInit&&t.finishInit(this);for(var c=0;c150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>a.first?B(Ve(a,t-1).text,null,s):0:"add"==r?u=l+e.options.indentUnit:"subtract"==r?u=l-e.options.indentUnit:"number"==typeof r&&(u=l+r),u=Math.max(0,u);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/s);h;--h)f+=s,d+="\t";if(fs,l=_e(t),u=null;if(o&&n.ranges.length>1)if(Ds&&Ds.text.join("\n")==t){if(n.ranges.length%Ds.text.length==0){u=[];for(var c=0;c=0;f--){var h=n.ranges[f],p=h.from(),g=h.to();h.empty()&&(r&&r>0?p=et(p.line,p.ch-r):e.state.overwrite&&!o?g=et(g.line,Math.min(Ve(a,g.line).text.length,g.ch+$(l).length)):o&&Ds&&Ds.lineWise&&Ds.text.join("\n")==l.join("\n")&&(p=g=et(p.line,0)));var m={from:p,to:g,text:u?u[f%u.length]:l,origin:i||(o?"paste":e.state.cutIncoming>s?"cut":"+input")};ua(e.doc,m),or(e,"inputRead",e,m)}t&&!o&&Is(e,t),_n(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Rs(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Jn(t,(function(){return _s(t,r,0,null,"paste")})),!0}function Is(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var a=e.getModeAt(i.head),s=!1;if(a.electricChars){for(var o=0;o-1){s=As(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ve(e.doc,i.head.line).text.slice(0,i.head.ch))&&(s=As(e,i.head.line,"smart"));s&&or(e,"electricInput",e,i.head.line)}}}function Ms(e){for(var t=[],r=[],n=0;n0?0:-1));s=isNaN(c)?null:new et(t.line,Math.max(0,Math.min(o.text.length,t.ch+r*(c>=55296&&c<56320?2:1))),-r)}else s=i?function(e,t,r,n){var i=ue(t,e.doc.direction);if(!i)return Qa(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var a=oe(i,r.ch,r.sticky),s=i[a];if("ltr"==e.doc.direction&&s.level%2==0&&(n>0?s.to>r.ch:s.from=s.from&&f>=c.begin)){var h=d?"before":"after";return new et(r.line,f,h)}}var p=function(e,t,n){for(var a=function(e,t){return t?new et(r.line,l(e,1),"before"):new et(r.line,e,"after")};e>=0&&e0==(1!=s.level),u=o?n.begin:l(n.end,-1);if(s.from<=u&&u0?c.end:l(c.begin,-1);return null==m||n>0&&m==t.text.length||!(g=p(n>0?0:i.length-1,n,u(m)))?null:g}(e.cm,o,t,r):Qa(o,t,r);if(null==s){if(a||(u=t.line+l)=e.first+e.size||(t=new et(u,t.ch,t.sticky),!(o=Ve(e,u))))return!1;t=Ja(i,e.cm,o,t.line,l)}else t=s;return!0}if("char"==n||"codepoint"==n)u();else if("column"==n)u(!0);else if("word"==n||"group"==n)for(var c=null,d="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(r<0)||u(!h);h=!1){var p=o.text.charAt(t.ch)||"\n",g=ee(p,f)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||h||g||(g="s"),c&&c!=g){r<0&&(r=1,u(),t.sticky="after");break}if(g&&(c=g),r>0&&!u(!h))break}var m=aa(e,t,a,s,!0);return rt(a,m)&&(m.hitSide=!0),m}function Bs(e,t,r,n){var i,a,s=e.doc,o=t.left;if("page"==n){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*rn(e.display),3);i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(a=Yr(e,o,i)).outside;){if(r<0?i<=0:i>=s.height){a.hitSide=!0;break}i+=5*r}return a}var js=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Us(e,t){var r=Or(e,t.line);if(!r||r.hidden)return null;var n=Ve(e.doc,t.line),i=Ar(r,n,t.line),a=ue(n,e.doc.direction),s="left";a&&(s=oe(a,t.ch)%2?"right":"left");var o=Fr(i.map,t.ch,s);return o.offset="right"==o.collapse?o.end:o.start,o}function Hs(e,t){return t&&(e.bad=!0),e}function Gs(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Hs(e.clipPos(et(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||a.line=t.display.viewFrom&&Us(t,i)||{node:l[0].measure.map[2],offset:0},c=a.linen.firstLine()&&(s=et(s.line-1,Ve(n.doc,s.line-1).length)),o.ch==Ve(n.doc,o.line).text.length&&o.linei.viewTo-1)return!1;s.line==i.viewFrom||0==(e=cn(n,s.line))?(t=Xe(i.view[0].line),r=i.view[0].node):(t=Xe(i.view[e].line),r=i.view[e-1].node.nextSibling);var l,u,c=cn(n,o.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=Xe(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var d=n.doc.splitLines(function(e,t,r,n,i){var a="",s=!1,o=e.doc.lineSeparator(),l=!1;function u(){s&&(a+=o,l&&(a+=o),s=l=!1)}function c(e){e&&(u(),a+=e)}function d(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void c(r);var a,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(et(n,0),et(i+1,0),(m=+f,function(e){return e.id==m}));return void(h.length&&(a=h[0].find(0))&&c(qe(e.doc,a.from,a.to).join(o)))}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&&u();for(var g=0;g1&&f.length>1;)if($(d)==$(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,g=d[0],m=f[0],v=Math.min(g.length,m.length);hs.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var x=et(t,h),S=et(l,f.length?$(f).length-p:0);return d.length>1||d[0]||tt(x,S)?(pa(n.doc,d,x,S,"+input"),!0):void 0},js.prototype.ensurePolled=function(){this.forceCompositionEnd()},js.prototype.reset=function(){this.forceCompositionEnd()},js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},js.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))},js.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Jn(this.cm,(function(){return dn(e.cm)}))},js.prototype.setUneditable=function(e){e.contentEditable="false"},js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ei(this.cm,_s)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},js.prototype.onContextMenu=function(){},js.prototype.resetPosition=function(){},js.prototype.needsContentAttribute=!0;var zs=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null};zs.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function a(e){if(!ge(n,e)){if(n.somethingSelected())Os({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=Ms(n);Os({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,G):(r.prevInput="",i.value=t.text.join("\n"),F(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),de(i,"input",(function(){s&&o>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),de(i,"paste",(function(e){ge(n,e)||Rs(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),de(i,"cut",a),de(i,"copy",a),de(e.scroller,"paste",(function(t){if(!xr(e,t)&&!ge(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var a=new Event("paste");a.clipboardData=t.clipboardData,i.dispatchEvent(a)}})),de(e.lineSpace,"selectstart",(function(t){xr(e,t)||be(t)})),de(i,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),de(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},zs.prototype.createField=function(e){this.wrapper=Ps(),this.textarea=this.wrapper.firstChild},zs.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},zs.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=vn(e);if(e.options.moveInputWithCursor){var i=Vr(e,r.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+s.top-a.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+s.left-a.left))}return n},zs.prototype.showSelection=function(e){var t=this.cm.display;A(t.cursorDiv,e.cursors),A(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},zs.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&F(this.textarea),s&&o>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",s&&o>=9&&(this.hasSelection=null))}},zs.prototype.getField=function(){return this.textarea},zs.prototype.supportsTouch=function(){return!1},zs.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||R()!=this.textarea))try{this.textarea.focus()}catch(e){}},zs.prototype.blur=function(){this.textarea.blur()},zs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},zs.prototype.receivedFocus=function(){this.slowPoll()},zs.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},zs.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},zs.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Re(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(s&&o>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(8203!=a||n||(n="​"),8666==a)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(n.length,i.length);l1e3||i.indexOf("\n")>-1?r.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},zs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},zs.prototype.onKeyPress=function(){s&&o>=9&&(this.hasSelection=null),this.fastPoll()},zs.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=un(r,e),u=n.scroller.scrollTop;if(a&&!d){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(a)&&ei(r,Ji)(r.doc,wi(a),G);var c,f=i.style.cssText,h=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: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),n.input.focus(),l&&window.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),s&&o>=9&&m(),T){Se(e);var g=function(){he(window,"mouseup",g),setTimeout(v,20)};de(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=r.somethingSelected(),a="​"+(e?i.value:"");i.value="⇚",i.value=a,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=a.length,n.selForContextMenu=r.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=f,s&&o<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!s||s&&o<9)&&m();var e=0,a=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ei(r,oa)(r):e++<10?n.detectingSelectAll=setTimeout(a,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(a,200)}}},zs.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},zs.prototype.setUneditable=function(){},zs.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,i,a){e.defaults[r]=n,i&&(t[r]=a?function(e,t,r){r!=xs&&i(e,t,r)}:i)}e.defineOption=r,e.Init=xs,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Oi(e)}),!0),r("indentUnit",2,Oi,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){_i(e),jr(e),dn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var a=e.text.indexOf(t,i);if(-1==a)break;i=a+t.length,r.push(et(n,a))}n++}));for(var i=r.length-1;i>=0;i--)pa(e.doc,t,r[i],et(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=xs&&e.refresh()})),r("specialCharPlaceholder",Qt,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!E),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){Es(e),gi(e)}),!0),r("keyMap","default",(function(e,t,r){var n=Ya(t),i=r!=xs&&Ya(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,ws,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=hi(t,e.options.lineNumbers),gi(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?sn(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Hn(e)}),!0),r("scrollbarStyle","native",(function(e){zn(e),Hn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=hi(e.options.gutters,t),gi(e)}),!0),r("firstLineNumber",1,gi,!0),r("lineNumberFormatter",(function(e){return e}),gi,!0),r("showCursorWhenSelecting",!1,mn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(wn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,ks),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,mn,!0),r("singleCursorHeightPerLine",!0,mn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,_i,!0),r("addModeClass",!1,_i,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,_i,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(Cs),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&ei(this,t[e])(this,r,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"](Ya(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;rr&&(As(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&_n(this));else{var a=i.from(),s=i.to(),o=Math.max(r,a.line);r=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=o;l0&&Xi(this.doc,n,new Ti(a,u[n].to()),G)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=ot(this.doc,e);var t,r=ft(this,Ve(this.doc,e.line)),n=0,i=(r.length-1)/2,a=e.ch;if(0==a)t=r[2];else for(;;){var s=n+i>>1;if((s?r[2*s-1]:0)>=a)i=s;else{if(!(r[2*s+1]a&&(e=a,i=!0),n=Ve(this.doc,e)}else n=e;return Wr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Wt(n):0)},defaultTextHeight:function(){return rn(this.display)},defaultCharWidth:function(){return nn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var a,s,o,l=this.display,u=(e=Vr(this,ot(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var d=Math.max(l.wrapper.clientHeight,this.doc.height),f=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(u=e.bottom),c+t.offsetWidth>f&&(c=f-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(a=this,s={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(o=Dn(a,s)).scrollTop&&Fn(a,o.scrollTop),null!=o.scrollLeft&&Nn(a,o.scrollLeft))},triggerOnKeyDown:ti(us),triggerOnKeyPress:ti(ds),triggerOnKeyUp:cs,triggerOnMouseDown:ti(gs),execCommand:function(e){if(es.hasOwnProperty(e))return es[e].call(null,this)},triggerElectric:ti((function(e){Is(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var a=ot(this.doc,e),s=0;s0&&s(t.charAt(r-1));)--r;for(;n.5||this.options.lineWrapping)&&ln(this),pe(this,"refresh",this)})),swapDoc:ti((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Fi(this,e),jr(this),this.display.input.reset(),Rn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,or(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,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,a){e.registerHelper(t,n,a),r[t]._global.push({pred:i,val:a})}}(Cs);var Ks="iter insert remove copy getEditor constructor".split(" ");for(var Vs in Oa.prototype)Oa.prototype.hasOwnProperty(Vs)&&U(Ks,Vs)<0&&(Cs.prototype[Vs]=function(e){return function(){return e.apply(this.doc,arguments)}}(Oa.prototype[Vs]));return ye(Oa),Cs.inputStyles={textarea:zs,contenteditable:js},Cs.defineMode=function(e){Cs.defaults.mode||"null"==e||(Cs.defaults.mode=e),Ne.apply(this,arguments)},Cs.defineMIME=function(e,t){Pe[e]=t},Cs.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Cs.defineMIME("text/plain","null"),Cs.defineExtension=function(e,t){Cs.prototype[e]=t},Cs.defineDocExtension=function(e,t){Oa.prototype[e]=t},Cs.fromTextArea=function(e,t){if((t=t?N(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=R();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=o.getValue()}var i;if(e.form&&(de(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var s=a.submit=function(){n(),a.submit=i,a.submit(),a.submit=s}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var o=Cs((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return o},function(e){e.off=he,e.on=de,e.wheelEventPixels=Ei,e.Doc=Oa,e.splitLines=_e,e.countColumn=B,e.findColumn=K,e.isWordChar=J,e.Pass=H,e.signal=pe,e.Line=Vt,e.changeEnd=Ci,e.scrollbarModel=Wn,e.Pos=et,e.cmpPos=tt,e.modes=Fe,e.mimeModes=Pe,e.resolveMode=Be,e.getMode=je,e.modeExtensions=Ue,e.extendMode=He,e.copyState=Ge,e.startState=ze,e.innerMode=We,e.commands=es,e.keyMap=Ga,e.keyName=$a,e.isModifierKey=Va,e.lookupKey=Ka,e.normalizeKeyMap=za,e.StringStream=Ke,e.SharedTextMarker=Ca,e.TextMarker=ka,e.LineWidget=xa,e.e_preventDefault=be,e.e_stopPropagation=Ee,e.e_stop=Se,e.addClass=I,e.contains=_,e.rmClass=C,e.keyNames=Ba}(Cs),Cs.version="5.58.2",Cs}()},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,r){"use strict";r.r(t),r.d(t,"ResizableTextArea",(function(){return I}));var n=r("wx14"),i=r("1OyB"),a=r("vuIU"),s=r("Ji7U"),o=r("LK+K"),l=r("q1tI"),u=r("VTBJ"),c=r("rePB"),d=r("Zm9Q"),f=(r("Kwbf"),r("c+Xe")),h=r("m+aA"),p=r("bdgK"),g=new Map;var m=new p.default((function(e){e.forEach((function(e){var t,r=e.target;null===(t=g.get(r))||void 0===t||t.forEach((function(e){return e(r)}))}))}));var v=function(e){Object(s.a)(r,e);var t=Object(o.a)(r);function r(){return Object(i.a)(this,r),t.apply(this,arguments)}return Object(a.a)(r,[{key:"render",value:function(){return this.props.children}}]),r}(l.Component),y=l.createContext(null);function b(e){var t=e.children,r=e.disabled,n=l.useRef(null),i=l.useRef(null),a=l.useContext(y),s=l.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),o=l.isValidElement(t)&&Object(f.c)(t),c=o?t.ref:null,d=l.useMemo((function(){return Object(f.a)(c,n)}),[c,n]),p=l.useRef(e);p.current=e;var b=l.useCallback((function(e){var t=p.current,r=t.onResize,n=t.data,i=e.getBoundingClientRect(),o=i.width,l=i.height,c=e.offsetWidth,d=e.offsetHeight,f=Math.floor(o),h=Math.floor(l);if(s.current.width!==f||s.current.height!==h||s.current.offsetWidth!==c||s.current.offsetHeight!==d){var g={width:f,height:h,offsetWidth:c,offsetHeight:d};s.current=g;var m=c===Math.round(o)?o:c,v=d===Math.round(l)?l:d,y=Object(u.a)(Object(u.a)({},g),{},{offsetWidth:m,offsetHeight:v});null==a||a(y,e,n),r&&Promise.resolve().then((function(){r(y,e)}))}}),[]);return l.useEffect((function(){var e,t,a=Object(h.a)(n.current)||Object(h.a)(i.current);return a&&!r&&(e=a,t=b,g.has(e)||(g.set(e,new Set),m.observe(e)),g.get(e).add(t)),function(){return function(e,t){g.has(e)&&(g.get(e).delete(t),g.get(e).size||(m.unobserve(e),g.delete(e)))}(a,b)}}),[n.current,r]),l.createElement(v,{ref:i},o?l.cloneElement(t,{ref:d}):t)}function E(e){var t=e.children;return Object(d.a)(t).map((function(t,r){var i=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(r);return l.createElement(b,Object(n.a)({},e,{key:i}),t)}))}E.Collection=function(e){var t=e.children,r=e.onBatchResize,n=l.useRef(0),i=l.useRef([]),a=l.useContext(y),s=l.useCallback((function(e,t,s){n.current+=1;var o=n.current;i.current.push({size:e,element:t,data:s}),Promise.resolve().then((function(){o===n.current&&(null==r||r(i.current),i.current=[])})),null==a||a(e,t,s)}),[r,a]);return l.createElement(y.Provider,{value:s},t)};var x,S=E,T=r("bT9E"),k=r("TSYQ"),w=r.n(k),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",L=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],A={};function D(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&A[r])return A[r];var n=window.getComputedStyle(e),i=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),a=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),o=L.map((function(e){return"".concat(e,":").concat(n.getPropertyValue(e))})).join(";"),l={sizingStyle:o,paddingSize:a,borderSize:s,boxSizing:i};return t&&r&&(A[r]=l),l}var O,_=r("Gytx"),R=r.n(_);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}(O||(O={}));var I=function(e){Object(s.a)(r,e);var t=Object(o.a)(r);function r(e){var a;return Object(i.a)(this,r),(a=t.call(this,e)).nextFrameActionId=void 0,a.resizeFrameId=void 0,a.textArea=void 0,a.saveTextArea=function(e){a.textArea=e},a.handleResize=function(e){var t=a.state.resizeStatus,r=a.props,n=r.autoSize,i=r.onResize;t===O.NONE&&("function"==typeof i&&i(e),n&&a.resizeOnNextFrame())},a.resizeOnNextFrame=function(){cancelAnimationFrame(a.nextFrameActionId),a.nextFrameActionId=requestAnimationFrame(a.resizeTextarea)},a.resizeTextarea=function(){var e=a.props.autoSize;if(e&&a.textArea){var t=e.minRows,r=e.maxRows,n=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;x||((x=document.createElement("textarea")).setAttribute("tab-index","-1"),x.setAttribute("aria-hidden","true"),document.body.appendChild(x)),e.getAttribute("wrap")?x.setAttribute("wrap",e.getAttribute("wrap")):x.removeAttribute("wrap");var i=D(e,t),a=i.paddingSize,s=i.borderSize,o=i.boxSizing,l=i.sizingStyle;x.setAttribute("style","".concat(l,";").concat(C)),x.value=e.value||e.placeholder||"";var u,c=Number.MIN_SAFE_INTEGER,d=Number.MAX_SAFE_INTEGER,f=x.scrollHeight;if("border-box"===o?f+=s:"content-box"===o&&(f-=a),null!==r||null!==n){x.value=" ";var h=x.scrollHeight-a;null!==r&&(c=h*r,"border-box"===o&&(c=c+a+s),f=Math.max(c,f)),null!==n&&(d=h*n,"border-box"===o&&(d=d+a+s),u=f>d?"":"hidden",f=Math.min(d,f))}return{height:f,minHeight:c,maxHeight:d,overflowY:u,resize:"none"}}(a.textArea,!1,t,r);a.setState({textareaStyles:n,resizeStatus:O.RESIZING},(function(){cancelAnimationFrame(a.resizeFrameId),a.resizeFrameId=requestAnimationFrame((function(){a.setState({resizeStatus:O.RESIZED},(function(){a.resizeFrameId=requestAnimationFrame((function(){a.setState({resizeStatus:O.NONE}),a.fixFirefoxAutoScroll()}))}))}))}))}},a.renderTextArea=function(){var e=a.props,t=e.prefixCls,r=void 0===t?"rc-textarea":t,i=e.autoSize,s=e.onResize,o=e.className,d=e.disabled,f=a.state,h=f.textareaStyles,p=f.resizeStatus,g=Object(T.a)(a.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),m=w()(r,o,Object(c.a)({},"".concat(r,"-disabled"),d));"value"in g&&(g.value=g.value||"");var v=Object(u.a)(Object(u.a)(Object(u.a)({},a.props.style),h),p===O.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(S,{onResize:a.handleResize,disabled:!(i||s)},l.createElement("textarea",Object(n.a)({},g,{className:m,style:v,ref:a.saveTextArea})))},a.state={textareaStyles:{},resizeStatus:O.NONE},a}return Object(a.a)(r,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&R()(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()}}]),r}(l.Component),M=function(e){Object(s.a)(r,e);var t=Object(o.a)(r);function r(e){var n;Object(i.a)(this,r),(n=t.call(this,e)).resizableTextArea=void 0,n.focus=function(){n.resizableTextArea.textArea.focus()},n.saveTextArea=function(e){n.resizableTextArea=e},n.handleChange=function(e){var t=n.props.onChange;n.setValue(e.target.value,(function(){n.resizableTextArea.resizeTextarea()})),t&&t(e)},n.handleKeyDown=function(e){var t=n.props,r=t.onPressEnter,i=t.onKeyDown;13===e.keyCode&&r&&r(e),i&&i(e)};var a=void 0===e.value||null===e.value?e.defaultValue:e.value;return n.state={value:a},n}return Object(a.a)(r,[{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(n.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}}]),r}(l.Component);t.default=M},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,r){"use strict";r.d(t,"a",(function(){return v}));var n=r("k1fw"),i=(r("miYZ"),r("tsqr")),a=r("rAM+"),s=r("tJVT"),o=r("PpiC"),l=r("q1tI"),u=r.n(l),c=r("bdgK");function d(e,t,r,i,a){var s=t.getWordUntilPosition(r),o={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:s.startColumn,endColumn:s.endColumn},l=i.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:o}}));return a.map((function(e){l.push(Object(n.a)(Object(n.a)({},e),{},{range:o}))})),l}r("LvDl");function f(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function h(){}var p={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var r=0;r0||n.target.offsetWidth>0)&&K.current.instance.layout()}}catch(e){r.e(e)}finally{r.f()}}))).observe(z.current),e}();return Q(!0),function(){var e=K.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),K.current.subscription&&K.current.subscription.dispose(),F&&window.removeEventListener("paste",ee),r.unobserve(z.current)}}catch(e){}}))}),[]),Object(l.useEffect)((function(){if(K.current.instance&&Z)return document.addEventListener("keydown",te,!1),function(){document.removeEventListener("keydown",te)}}),[_,Z]),Object(l.useEffect)((function(){var e=K.current.instance;if(e&&Z){var t=g(x);m.editor.setModelLanguage(e.getModel(),t),console.log("language:",x,e.getModel(),t)}}),[x,Z]),Object(l.useEffect)((function(){K.current.instance&&Z&&m.editor.setTheme(D)}),[D,Z]),Object(l.useEffect)((function(){var e=K.current.instance;e&&Z&&(e.updateOptions(Object(n.a)({},w)),setTimeout((function(){e.getModel().updateOptions(Object(n.a)({},w))}),200))}),[JSON.stringify(w),Z]),Object(l.useEffect)((function(){var e=K.current.instance;e&&Z&&e.layout()}),[p,y,Z]);var ie=Object(l.useState)(f(p)),ae=Object(s.a)(ie,2),se=ae[0],oe=(ae[1],Object(l.useState)(f(y))),le=Object(s.a)(oe,2),ue=le[0],ce=le[1],de=Object(n.a)(Object(n.a)({},T),{},{width:se,height:ue});return u.a.createElement("div",{className:"my-monaco-editor",ref:z,style:de})};function v(e){var t=e.width,i=void 0===t?"100%":t,o=e.height,d=void 0===o?"100%":o,h=e.original,p=e.modified,g=e.language,v=e.options,y=void 0===v?{}:v,b=Object(l.useRef)(),E=Object(l.useState)(null),x=Object(s.a)(E,2),S=x[0],T=x[1];Object(l.useEffect)((function(){b.current&&r.e(/*! import() | monaco-editor */26).then(r.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(e){var t=(m=e).editor.createDiffEditor(b.current,Object(n.a)(Object(n.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}));T(t);var r=function(e){var t;return b.current&&(t=new c.default((function(t){var r,n=Object(a.a)(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&e.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(b.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),r.unobserve(b.current)}}))}),[]),Object(l.useEffect)((function(){S&&S.setModel({original:m.editor.createModel(h,g),modified:m.editor.createModel(p,g)})}),[h,p,g,S]);var k={width:f(i),height:f(d)};return u.a.createElement("div",{className:"my-diff-editor",ref:b,style:k})}},ZpRC: /*!*************************************************************************!*\ !*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***! \*************************************************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,r){"use strict";function n(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function i(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function a(e,t){if(e.clientHeightt||a>e&&s=t&&o>=r?a-e-n:s>t&&or?s-t+i:0}var o=function(e,t){var r=window,i=t.scrollMode,o=t.block,l=t.inline,u=t.boundary,c=t.skipOverflowHiddenElements,d="function"==typeof u?u:function(e){return e!==u};if(!n(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,h=[],p=e;n(p)&&d(p);){if((p=p.parentElement)===f){h.push(p);break}null!=p&&p===document.body&&a(p)&&!a(document.documentElement)||null!=p&&a(p,c)&&h.push(p)}for(var g=r.visualViewport?r.visualViewport.width:innerWidth,m=r.visualViewport?r.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),E=b.height,x=b.width,S=b.top,T=b.right,k=b.bottom,w=b.left,C="start"===o||"nearest"===o?S:"end"===o?k:S+E/2,L="center"===l?w+x/2:"end"===l?T:w,A=[],D=0;D=0&&w>=0&&k<=m&&T<=g&&S>=M&&k<=P&&w>=N&&T<=F)return A;var B=getComputedStyle(O),j=parseInt(B.borderLeftWidth,10),U=parseInt(B.borderTopWidth,10),H=parseInt(B.borderRightWidth,10),G=parseInt(B.borderBottomWidth,10),W=0,z=0,K="offsetWidth"in O?O.offsetWidth-O.clientWidth-j-H:0,V="offsetHeight"in O?O.offsetHeight-O.clientHeight-U-G:0;if(f===O)W="start"===o?C:"end"===o?C-m:"nearest"===o?s(y,y+m,m,U,G,y+C,y+C+E,E):C-m/2,z="start"===l?L:"center"===l?L-g/2:"end"===l?L-g:s(v,v+g,g,j,H,v+L,v+L+x,x),W=Math.max(0,W+y),z=Math.max(0,z+v);else{W="start"===o?C-M-U:"end"===o?C-P+G+V:"nearest"===o?s(M,P,R,U,G+V,C,C+E,E):C-(M+R/2)+V/2,z="start"===l?L-N-j:"center"===l?L-(N+I/2)+K/2:"end"===l?L-F+H+K:s(N,F,I,j,H+K,L,L+x,x);var q=O.scrollLeft,$=O.scrollTop;C+=$-(W=Math.max(0,Math.min($+W,O.scrollHeight-R+V))),L+=q-(z=Math.max(0,Math.min(q+z,O.scrollWidth-I+K)))}A.push({el:O,top:W,left:z})}return A};function l(e){return e===Object(e)&&0!==Object.keys(e).length}t.a=function(e,t){var r=!e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(r?[]:o(e,t));if(!r){var n=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 r="scrollBehavior"in document.body.style;e.forEach((function(e){var n=e.el,i=e.top,a=e.left;n.scroll&&r?n.scroll({top:i,left:a,behavior:t}):(n.scrollTop=i,n.scrollLeft=a)}))}(o(e,n),n.behavior)}}},Zss7: /*!**********************************************!*\ !*** ./node_modules/tinycolor2/tinycolor.js ***! \**********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){var n;!function(i){var a=/^\s+/,s=/\s+$/,o=0,l=i.round,u=i.min,c=i.max,d=i.random;function f(e,t){if(t=t||{},(e=e||"")instanceof f)return e;if(!(this instanceof f))return new f(e,t);var r=function(e){var t={r:0,g:0,b:0},r=1,n=null,o=null,l=null,d=!1,f=!1;"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(s,"").toLowerCase();var t,r=!1;if(O[e])e=O[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=W.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=W.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=W.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=W.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=W.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=W.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=W.hex8.exec(e))return{r:F(t[1]),g:F(t[2]),b:F(t[3]),a:j(t[4]),format:r?"name":"hex8"};if(t=W.hex6.exec(e))return{r:F(t[1]),g:F(t[2]),b:F(t[3]),format:r?"name":"hex"};if(t=W.hex4.exec(e))return{r:F(t[1]+""+t[1]),g:F(t[2]+""+t[2]),b:F(t[3]+""+t[3]),a:j(t[4]+""+t[4]),format:r?"name":"hex8"};if(t=W.hex3.exec(e))return{r:F(t[1]+""+t[1]),g:F(t[2]+""+t[2]),b:F(t[3]+""+t[3]),format:r?"name":"hex"};return!1}(e));"object"==typeof e&&(z(e.r)&&z(e.g)&&z(e.b)?(h=e.r,p=e.g,g=e.b,t={r:255*I(h,255),g:255*I(p,255),b:255*I(g,255)},d=!0,f="%"===String(e.r).substr(-1)?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(n=N(e.s),o=N(e.v),t=function(e,t,r){e=6*I(e,360),t=I(t,100),r=I(r,100);var n=i.floor(e),a=e-n,s=r*(1-t),o=r*(1-a*t),l=r*(1-(1-a)*t),u=n%6;return{r:255*[r,o,s,s,l,r][u],g:255*[l,r,r,o,s,s][u],b:255*[s,s,l,r,r,o][u]}}(e.h,n,o),d=!0,f="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(n=N(e.s),l=N(e.l),t=function(e,t,r){var n,i,a;function s(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=I(e,360),t=I(t,100),r=I(r,100),0===t)n=i=a=r;else{var o=r<.5?r*(1+t):r+t-r*t,l=2*r-o;n=s(l,o,e+1/3),i=s(l,o,e),a=s(l,o,e-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,n,l),d=!0,f="hsl"),e.hasOwnProperty("a")&&(r=e.a));var h,p,g;return r=R(r),{ok:d,format:e.format||f,r:u(255,c(t.r,0)),g:u(255,c(t.g,0)),b:u(255,c(t.b,0)),a:r}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=l(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=r.ok,this._tc_id=o++}function h(e,t,r){e=I(e,255),t=I(t,255),r=I(r,255);var n,i,a=c(e,t,r),s=u(e,t,r),o=(a+s)/2;if(a==s)n=i=0;else{var l=a-s;switch(i=o>.5?l/(2-a-s):l/(a+s),a){case e:n=(t-r)/l+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(f(n));return a}function D(e,t){t=t||6;for(var r=f(e).toHsv(),n=r.h,i=r.s,a=r.v,s=[],o=1/t;t--;)s.push(f({h:n,s:i,v:a})),a=(a+o)%1;return s}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:i.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=R(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=p(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),r=l(100*e.s),n=l(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return g(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,i){var a=[P(l(e).toString(16)),P(l(t).toString(16)),P(l(r).toString(16)),P(B(n))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*I(this._r,255))+"%",g:l(100*I(this._g,255))+"%",b:l(100*I(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*I(this._r,255))+"%, "+l(100*I(this._g,255))+"%, "+l(100*I(this._b,255))+"%)":"rgba("+l(100*I(this._r,255))+"%, "+l(100*I(this._g,255))+"%, "+l(100*I(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(_[g(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+m(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=f(e);r="#"+m(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(E,arguments)},brighten:function(){return this._applyModification(x,arguments)},darken:function(){return this._applyModification(S,arguments)},desaturate:function(){return this._applyModification(v,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(T,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(k,arguments)},monochromatic:function(){return this._applyCombination(D,arguments)},splitcomplement:function(){return this._applyCombination(L,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(C,arguments)}},f.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:N(e[n]));e=r}return f(e,t)},f.equals=function(e,t){return!(!e||!t)&&f(e).toRgbString()==f(t).toRgbString()},f.random=function(){return f.fromRatio({r:d(),g:d(),b:d()})},f.mix=function(e,t,r){r=0===r?0:r||50;var n=f(e).toRgb(),i=f(t).toRgb(),a=r/100;return f({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},f.readability=function(e,t){var r=f(e),n=f(t);return(i.max(r.getLuminance(),n.getLuminance())+.05)/(i.min(r.getLuminance(),n.getLuminance())+.05)},f.isReadable=function(e,t,r){var n,i,a=f.readability(e,t);switch(i=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},f.mostReadable=function(e,t,r){var n,i,a,s,o=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,s=r.size;for(var u=0;ul&&(l=n,o=f(t[u]));return f.isReadable(e,o,{level:a,size:s})||!i?o:(r.includeFallbackColors=!1,f.mostReadable(e,["#fff","#000"],r))};var O=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},_=f.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(O);function R(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function I(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=u(t,c(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),i.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function M(e){return u(1,c(0,e))}function F(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function N(e){return e<=1&&(e=100*e+"%"),e}function B(e){return i.round(255*parseFloat(e)).toString(16)}function j(e){return F(e)/255}var U,H,G,W=(H="[\\s|\\(]+("+(U="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",G="[\\s|\\(]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")[,|\\s]+("+U+")\\s*\\)?",{CSS_UNIT:new RegExp(U),rgb:new RegExp("rgb"+H),rgba:new RegExp("rgba"+G),hsl:new RegExp("hsl"+H),hsla:new RegExp("hsla"+G),hsv:new RegExp("hsv"+H),hsva:new RegExp("hsva"+G),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function z(e){return!!W.CSS_UNIT.exec(e)}e.exports?e.exports=f:void 0===(n=function(){return f}.call(t,r,t,e))||(e.exports=n)}(Math)},bT9E: /*!*****************************************!*\ !*** ./node_modules/rc-util/es/omit.js ***! \*****************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function i(e,t){var r=Object(n.a)({},e);return Array.isArray(t)&&t.forEach((function(e){delete r[e]})),r}},c5Ni: /*!******************************************************!*\ !*** ./node_modules/codemirror/theme/blackboard.css ***! \******************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},dejd: /*!***********************************************************!*\ !*** ./src/components/markdown-editor/toolbar/index.less ***! \***********************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},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,r){"use strict";var n=r("Ff2n"),i=r("rePB"),a=r("1OyB"),s=r("vuIU"),o=r("Ji7U"),l=r("md7G"),u=r("foSv"),c=r("q1tI"),d=r.n(c),f=r("TSYQ"),h=r.n(f),p=r("4IlW");function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t1?o-1:0),u=1;u1?r-1:0),a=1;a=0)return parseInt(t.slice(t.indexOf("e-")+2),10);var r=0;return t.indexOf(".")>=0&&(r=t.length-t.indexOf(".")-1),r},n.getInputDisplayValue=function(e){var t,r=e||n.state,i=r.focused,a=r.inputValue,s=r.value;null==(t=i?a:n.toPrecisionAsStep(s))&&(t="");var o=n.formatWrapper(t);return x(n.props.decimalSeparator)&&(o=o.toString().replace(".",n.props.decimalSeparator)),o},n.recordCursorPosition=function(){try{n.cursorStart=n.input.selectionStart,n.cursorEnd=n.input.selectionEnd,n.currentValue=n.input.value,n.cursorBefore=n.input.value.substring(0,n.cursorStart),n.cursorAfter=n.input.value.substring(n.cursorEnd)}catch(e){}},n.restoreByAfter=function(e){if(void 0===e)return!1;var t=n.input.value,r=t.lastIndexOf(e);if(-1===r)return!1;var i=n.cursorBefore.length;return n.lastKeyCode===p.a.DELETE&&n.cursorBefore.charAt(i-1)===e[0]?(n.fixCaret(i,i),!0):r+e.length===t.length&&(n.fixCaret(r,r),!0)},n.partRestoreByAfter=function(e){return void 0!==e&&Array.prototype.some.call(e,(function(t,r){var i=e.substring(r);return n.restoreByAfter(i)}))},n.isNotCompleteNumber=function(e){return isNaN(e)||""===e||null===e||e&&e.toString().indexOf(".")===e.toString().length-1},n.stop=function(){n.autoStepTimer&&clearTimeout(n.autoStepTimer)},n.down=function(e,t,r){n.pressingUpOrDown=!0,n.step("down",e,t,r)},n.up=function(e,t,r){n.pressingUpOrDown=!0,n.step("up",e,t,r)},n.saveInput=function(e){n.input=e};var i=e.value;void 0===i&&(i=e.defaultValue),n.state={focused:e.autoFocus};var s=n.getValidValue(n.toNumber(i));return n.state=m(m({},n.state),{},{inputValue:n.toPrecisionAsStep(s),value:s}),n}return Object(s.a)(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.value,n=t.onChange,i=t.max,a=t.min,s=this.state.focused;if(e){if(!S(e.value,r)||!S(e.max,i)||!S(e.min,a)){var o,l=s?r:this.getValidValue(r);o=this.pressingUpOrDown?l:this.inputting?this.rawInput:this.toPrecisionAsStep(l),this.setState({value:l,inputValue:o})}var u="value"in this.props?r:this.state.value;"max"in this.props&&e.max!==i&&"number"==typeof u&&u>i&&n&&n(i),"min"in this.props&&e.min!==a&&"number"==typeof u&&u1&&void 0!==arguments[1]?arguments[1]:this.props.min,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props.max,n=parseFloat(e);return isNaN(n)?e:(nr&&(n=r),n)}},{key:"setValue",value:function(e,t){var r=this.props.precision,n=this.isNotCompleteNumber(parseFloat(e))?null:parseFloat(e),i=this.state.value,a=void 0===i?null:i,s=this.state.inputValue,o=void 0===s?null:s,l="number"==typeof n?n.toFixed(r):"".concat(n),u=n!==a||l!=="".concat(o);return"value"in this.props?(o=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:o},t)):this.setState({value:n,inputValue:this.toPrecisionAsStep(e)},t),u&&this.props.onChange(n),n}},{key:"getMaxPrecision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.props,n=r.precision,i=r.step;if(x(n))return n;var a=this.getPrecision(t),s=this.getPrecision(i),o=this.getPrecision(e);return e?Math.max(o,a+s):a+s}},{key:"getPrecisionFactor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.getMaxPrecision(e,t);return Math.pow(10,r)}},{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,r=this.state.focused,n=e&&e.length>16&&r;return this.isNotCompleteNumber(e)||n?e:x(t)?Math.round(e*Math.pow(10,t))/Math.pow(10,t):Number(e)}},{key:"upStep",value:function(e,t){var r=this.props.step,n=this.getPrecisionFactor(e,t),i=Math.abs(this.getMaxPrecision(e,t)),a=((n*e+n*r*t)/n).toFixed(i);return this.toNumber(a)}},{key:"downStep",value:function(e,t){var r=this.props.step,n=this.getPrecisionFactor(e,t),i=Math.abs(this.getMaxPrecision(e,t)),a=((n*e-n*r*t)/n).toFixed(i);return this.toNumber(a)}},{key:"step",value:function(e,t){var r=this,n=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 a=this.props;if(!a.disabled){var s=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(s)){var o=this["".concat(e,"Step")](s,n),l=o>a.max||oa.max?o=a.max:o=p)||a||s,q=(U||0===U)&&(isNaN(U)||Number(U)<=g)||a||s,$=h()("".concat(r,"-handler"),"".concat(r,"-handler-up"),Object(i.a)({},"".concat(r,"-handler-up-disabled"),V)),Y=h()("".concat(r,"-handler"),"".concat(r,"-handler-down"),Object(i.a)({},"".concat(r,"-handler-down-disabled"),q)),X=o?{onTouchStart:V?y:this.up,onTouchEnd:this.stop}:{onMouseDown:V?y:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Z=o?{onTouchStart:q?y:this.down,onTouchEnd:this.stop}:{onMouseDown:q?y:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return d.a.createElement("div",{className:G,style:m,title:v,onMouseEnter:E,onMouseLeave:x,onMouseOver:S,onMouseOut:T,onFocus:function(){return null},onBlur:function(){return null}},d.a.createElement("div",{className:"".concat(r,"-handler-wrap")},d.a.createElement("span",Object.assign({unselectable:"on"},X,{role:"button","aria-label":"Increase Value","aria-disabled":V,className:$}),u||d.a.createElement("span",{unselectable:"on",className:"".concat(r,"-handler-up-inner"),onClick:b})),d.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Decrease Value","aria-disabled":q,className:Y}),c||d.a.createElement("span",{unselectable:"on",className:"".concat(r,"-handler-down-inner"),onClick:b}))),d.a.createElement("div",{className:"".concat(r,"-input-wrap")},d.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":g,"aria-valuemax":p,"aria-valuenow":U,required:k,type:L,placeholder:A,onPaste:P,onClick:w,onMouseUp:this.onMouseUp,className:"".concat(r,"-input"),tabIndex:C,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:z?this.onKeyDown:y,onKeyUp:z?this.onKeyUp:y,autoFocus:M,maxLength:I,readOnly:s,disabled:a,max:p,min:g,step:R,name:F,title:v,id:D,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(K),pattern:_,inputMode:O,onInput:N},W))))}}]),r}(d.a.Component);T.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,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 k=T;t.a=k},h78n: /*!**********************************************************!*\ !*** ./node_modules/rc-progress/es/index.js + 3 modules ***! \**********************************************************/ /*! exports provided: Line, Circle, default */ /*! exports used: Circle */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.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,r){"use strict";r.d(t,"a",(function(){return T}));var n=r("q1tI"),i=r.n(n),a=r("TSYQ"),s=r.n(a),o={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},l=function(e){var t=e.map((function(){return Object(n.useRef)()})),r=Object(n.useRef)();return Object(n.useEffect)((function(){var e=Date.now(),n=!1;Object.keys(t).forEach((function(i){var a=t[i].current;if(a){n=!0;var s=a.style;s.transitionDuration=".3s, .3s, .3s, .06s",r.current&&e-r.current<100&&(s.transitionDuration="0s, 0s")}})),n&&(r.current=Date.now())})),[t]};function u(){return(u=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var h=function(e){var t=e.className,r=e.percent,n=e.prefixCls,a=e.strokeColor,o=e.strokeLinecap,d=e.strokeWidth,h=e.style,p=e.trailColor,g=e.trailWidth,m=e.transition,v=f(e,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete v.gapPosition;var y=Array.isArray(r)?r:[r],b=Array.isArray(a)?a:[a],E=c(l(y),1)[0],x=d/2,S=100-d/2,T="M ".concat("round"===o?x:0,",").concat(x,"\n L ").concat("round"===o?S:100,",").concat(x),k="0 0 100 ".concat(d),w=0;return i.a.createElement("svg",u({className:s()("".concat(n,"-line"),t),viewBox:k,preserveAspectRatio:"none",style:h},v),i.a.createElement("path",{className:"".concat(n,"-line-trail"),d:T,strokeLinecap:o,stroke:p,strokeWidth:g||d,fillOpacity:"0"}),y.map((function(e,t){var r={strokeDasharray:"".concat(e,"px, 100px"),strokeDashoffset:"-".concat(w,"px"),transition:m||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},a=b[t]||b[b.length-1];return w+=e,i.a.createElement("path",{key:t,className:"".concat(n,"-line-path"),d:T,strokeLinecap:o,stroke:a,strokeWidth:d,fillOpacity:"0",ref:E[t],style:r})})))};h.defaultProps=o;function p(){return(p=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var y=0;function b(e){return+e.replace("%","")}function E(e){return Array.isArray(e)?e:[e]}function x(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,s=50-n/2,o=0,l=-s,u=0,c=-2*s;switch(a){case"left":o=-s,l=0,u=2*s,c=0;break;case"right":o=s,l=0,u=-2*s,c=0;break;case"bottom":l=s,c=2*s}var d="M 50,50 m ".concat(o,",").concat(l,"\n a ").concat(s,",").concat(s," 0 1 1 ").concat(u,",").concat(-c,"\n a ").concat(s,",").concat(s," 0 1 1 ").concat(-u,",").concat(c),f=2*Math.PI*s,h={stroke:r,strokeDasharray:"".concat(t/100*(f-i),"px ").concat(f,"px"),strokeDashoffset:"-".concat(i/2+e/100*(f-i),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:d,pathStyle:h}}var S=function(e){var t,r=e.prefixCls,a=e.strokeWidth,o=e.trailWidth,u=e.gapDegree,c=e.gapPosition,d=e.trailColor,f=e.strokeLinecap,h=e.style,m=e.className,S=e.strokeColor,T=e.percent,k=v(e,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),w=Object(n.useMemo)((function(){return y+=1}),[]),C=x(0,100,d,a,u,c),L=C.pathString,A=C.pathStyle,D=E(T),O=E(S),_=O.find((function(e){return"[object Object]"===Object.prototype.toString.call(e)})),R=g(l(D),1)[0];return i.a.createElement("svg",p({className:s()("".concat(r,"-circle"),m),viewBox:"0 0 100 100",style:h},k),_&&i.a.createElement("defs",null,i.a.createElement("linearGradient",{id:"".concat(r,"-gradient-").concat(w),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(_).sort((function(e,t){return b(e)-b(t)})).map((function(e,t){return i.a.createElement("stop",{key:t,offset:e,stopColor:_[e]})})))),i.a.createElement("path",{className:"".concat(r,"-circle-trail"),d:L,stroke:d,strokeLinecap:f,strokeWidth:o||a,fillOpacity:"0",style:A}),(t=0,D.map((function(e,n){var s=O[n]||O[O.length-1],o="[object Object]"===Object.prototype.toString.call(s)?"url(#".concat(r,"-gradient-").concat(w,")"):"",l=x(t,e,s,a,u,c);return t+=e,i.a.createElement("path",{key:n,className:"".concat(r,"-circle-path"),d:l.pathString,stroke:o,strokeLinecap:f,strokeWidth:a,opacity:0===e?0:1,fillOpacity:"0",style:l.pathStyle,ref:R[n]})}))).reverse())};S.defaultProps=o;var T=S},kSUc: /*!***************************************************!*\ !*** ./src/components/markdown-editor/index.less ***! \***************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},lZu9: /*!***********************************************************!*\ !*** ./node_modules/codemirror/mode/markdown/markdown.js ***! \***********************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){!function(e){"use strict";e.defineMode("markdown",(function(t,r){var n=e.getMode(t,"text/html"),i="null"==n.name;void 0===r.highlightFormatting&&(r.highlightFormatting=!1),void 0===r.maxBlockquoteDepth&&(r.maxBlockquoteDepth=0),void 0===r.taskLists&&(r.taskLists=!1),void 0===r.strikethrough&&(r.strikethrough=!1),void 0===r.emoji&&(r.emoji=!1),void 0===r.fencedCodeBlockHighlighting&&(r.fencedCodeBlockHighlighting=!0),void 0===r.fencedCodeBlockDefaultMode&&(r.fencedCodeBlockDefaultMode="text/plain"),void 0===r.xml&&(r.xml=!0),void 0===r.tokenTypeOverrides&&(r.tokenTypeOverrides={});var a={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var s in a)a.hasOwnProperty(s)&&r.tokenTypeOverrides[s]&&(a[s]=r.tokenTypeOverrides[s]);var o=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,c=r.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function m(e,t,r){return t.f=t.inline=r,r(e,t)}function v(e,t,r){return t.f=t.block=r,r(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==E){var r=i;if(!r){var a=e.innerMode(n,t.htmlState);r="xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText}r&&(t.f=k,t.block=b,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function b(n,i){var s,f=n.column()===i.indentation,g=!(s=i.prevLine.stream)||!/\S/.test(s.string),v=i.indentedCode,y=i.prevLine.hr,b=!1!==i.list,E=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var T=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,b)){for(i.list=null;T=4&&(v||i.prevLine.fencedCodeEnd||i.prevLine.header||g))return n.skipToEnd(),i.indentedCode=!0,a.code;if(n.eatSpace())return null;if(f&&i.indentation<=E&&(C=n.match(c))&&C[1].length<=6)return i.quote=0,i.header=C[1].length,i.thisLine.header=!0,r.highlightFormatting&&(i.formatting="header"),i.f=i.inline,S(i);if(i.indentation<=E&&n.eat(">"))return i.quote=f?1:i.quote+1,r.highlightFormatting&&(i.formatting="quote"),n.eatSpace(),S(i);if(!w&&!i.setext&&f&&i.indentation<=E&&(C=n.match(l))){var L=C[1]?"ol":"ul";return i.indentation=T+n.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,r.taskLists&&n.match(u,!1)&&(i.taskList=!0),i.f=i.inline,r.highlightFormatting&&(i.formatting=["list","list-"+L]),S(i)}return f&&i.indentation<=E&&(C=n.match(h,!0))?(i.quote=0,i.fencedEndRE=new RegExp(C[1]+"+ *$"),i.localMode=r.fencedCodeBlockHighlighting&&function(r){if(e.findModeByName){var n=e.findModeByName(r);n&&(r=n.mime||n.mimes[0])}var i=e.getMode(t,r);return"null"==i.name?null:i}(C[2]||r.fencedCodeBlockDefaultMode),i.localMode&&(i.localState=e.startState(i.localMode)),i.f=i.block=x,r.highlightFormatting&&(i.formatting="code-block"),i.code=-1,S(i)):i.setext||!(k&&b||i.quote||!1!==i.list||i.code||w||p.test(n.string))&&(C=n.lookAhead(1))&&(C=C.match(d))?(i.setext?(i.header=i.setext,i.setext=0,n.skipToEnd(),r.highlightFormatting&&(i.formatting="header")):(i.header="="==C[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,S(i)):w?(n.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,a.hr):"["===n.peek()?m(n,i,A):m(n,i,i.inline)}function E(t,r){var a=n.token(t,r.htmlState);if(!i){var s=e.innerMode(n,r.htmlState);("xml"==s.mode.name&&null===s.state.tagStart&&!s.state.context&&s.state.tokenize.isInText||r.md_inside&&t.current().indexOf(">")>-1)&&(r.f=k,r.block=b,r.htmlState=null)}return a}function x(e,t){var n,i=t.listStack[t.listStack.length-1]||0,s=t.indentation=e.quote?t.push(a.formatting+"-"+e.formatting[n]+"-"+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(a.linkHref,"url"):(e.strong&&t.push(a.strong),e.em&&t.push(a.em),e.strikethrough&&t.push(a.strikethrough),e.emoji&&t.push(a.emoji),e.linkText&&t.push(a.linkText),e.code&&t.push(a.code),e.image&&t.push(a.image),e.imageAltText&&t.push(a.imageAltText,"link"),e.imageMarker&&t.push(a.imageMarker)),e.header&&t.push(a.header,a.header+"-"+e.header),e.quote&&(t.push(a.quote),!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=e.quote?t.push(a.quote+"-"+e.quote):t.push(a.quote+"-"+r.maxBlockquoteDepth)),!1!==e.list){var i=(e.listStack.length-1)%3;i?1===i?t.push(a.list2):t.push(a.list3):t.push(a.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 T(e,t){if(e.match(f,!0))return S(t)}function k(t,i){var s=i.text(t,i);if(void 0!==s)return s;if(i.list)return i.list=null,S(i);if(i.taskList)return" "===t.match(u,!0)[1]?i.taskOpen=!0:i.taskClosed=!0,r.highlightFormatting&&(i.formatting="task"),i.taskList=!1,S(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return r.highlightFormatting&&(i.formatting="header"),S(i);var o=t.next();if(i.linkTitle){i.linkTitle=!1;var l=o;"("===o&&(l=")");var c="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(c),!0))return a.linkHref}if("`"===o){var d=i.formatting;r.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var f=t.current().length;if(0!=i.code||i.quote&&1!=f){if(f==i.code){var h=S(i);return i.code=0,h}return i.formatting=d,S(i)}return i.code=f,S(i)}if(i.code)return S(i);if("\\"===o&&(t.next(),r.highlightFormatting)){var p=S(i),m=a.formatting+"-escape";return p?p+" "+m:m}if("!"===o&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,r.highlightFormatting&&(i.formatting="image"),S(i);if("["===o&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,r.highlightFormatting&&(i.formatting="image"),S(i);if("]"===o&&i.imageAltText){r.highlightFormatting&&(i.formatting="image");var p=S(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=C,p}if("["===o&&!i.image)return i.linkText&&t.match(/^.*?\]/)||(i.linkText=!0,r.highlightFormatting&&(i.formatting="link")),S(i);if("]"===o&&i.linkText){r.highlightFormatting&&(i.formatting="link");var p=S(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?C:k,p}if("<"===o&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=w,r.highlightFormatting&&(i.formatting="link"),(p=S(i))?p+=" ":p="",p+a.linkInline;if("<"===o&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return i.f=i.inline=w,r.highlightFormatting&&(i.formatting="link"),(p=S(i))?p+=" ":p="",p+a.linkEmail;if(r.xml&&"<"===o&&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(n),v(t,i,E)}if(r.xml&&"<"===o&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if("*"===o||"_"===o){for(var x=1,T=1==t.pos?" ":t.string.charAt(t.pos-2);x<3&&t.eat(o);)x++;var L=t.peek()||" ",A=!/\s/.test(L)&&(!g.test(L)||/\s/.test(T)||g.test(T)),D=!/\s/.test(T)&&(!g.test(T)||/\s/.test(L)||g.test(L)),O=null,_=null;if(x%2&&(i.em||!A||"*"!==o&&D&&!g.test(T)?i.em!=o||!D||"*"!==o&&A&&!g.test(L)||(O=!1):O=!0),x>1&&(i.strong||!A||"*"!==o&&D&&!g.test(T)?i.strong!=o||!D||"*"!==o&&A&&!g.test(L)||(_=!1):_=!0),null!=_||null!=O)return r.highlightFormatting&&(i.formatting=null==O?"strong":null==_?"em":"strong em"),!0===O&&(i.em=o),!0===_&&(i.strong=o),h=S(i),!1===O&&(i.em=!1),!1===_&&(i.strong=!1),h}else if(" "===o&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return S(i);t.backUp(1)}if(r.strikethrough)if("~"===o&&t.eatWhile(o)){if(i.strikethrough)return r.highlightFormatting&&(i.formatting="strikethrough"),h=S(i),i.strikethrough=!1,h;if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,r.highlightFormatting&&(i.formatting="strikethrough"),S(i)}else if(" "===o&&t.match(/^~~/,!0)){if(" "===t.peek())return S(i);t.backUp(2)}if(r.emoji&&":"===o&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,r.highlightFormatting&&(i.formatting="emoji");var R=S(i);return i.emoji=!1,R}return" "===o&&(t.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),S(i)}function w(e,t){if(">"===e.next()){t.f=t.inline=k,r.highlightFormatting&&(t.formatting="link");var n=S(t);return n?n+=" ":n="",n+a.linkInline}return e.match(/^[^>]+/,!0),a.linkInline}function C(e,t){if(e.eatSpace())return null;var n,i=e.next();return"("===i||"["===i?(t.f=t.inline=(n="("===i?")":"]",function(e,t){if(e.next()===n){t.f=t.inline=k,r.highlightFormatting&&(t.formatting="link-string");var i=S(t);return t.linkHref=!1,i}return e.match(L[n]),t.linkHref=!0,S(t)}),r.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,S(t)):"error"}var L={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=D,e.next(),r.highlightFormatting&&(t.formatting="link"),t.linkText=!0,S(t)):m(e,t,k)}function D(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=O,r.highlightFormatting&&(t.formatting="link");var n=S(t);return t.linkText=!1,n}return e.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function O(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=k,a.linkHref+" url")}var _={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:k,text:T,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(n,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!=E)){var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=r,t.indentationDiff=null,r>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==E?{state:e.htmlState,mode:n}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:_}},indent:function(t,r,i){return t.block==E&&n.indent?n.indent(t.htmlState,r,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,r,i):e.Pass},blankLine:y,getType:S,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return _}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(r(/*! ../../lib/codemirror */"VrN/"),r(/*! ../xml/xml */"1eCo"),r(/*! ../meta */"8EBN"))},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,r){!function(e){"use strict";var t=e.Pos;function r(e,t){return e.line-t.line||e.ch-t.ch}var n="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("<(/?)(["+n+"]["+n+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function a(e,t,r,n){this.line=t,this.ch=r,this.cm=e,this.text=e.getLine(t),this.min=n?Math.max(n.from,e.firstLine()):e.firstLine(),this.max=n?Math.min(n.to-1,e.lastLine()):e.lastLine()}function s(e,r){var n=e.cm.getTokenTypeAt(t(e.line,r));return n&&/\btag\b/.test(n)}function o(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 u(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}if(s(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t+1}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(s(e,t+1)){i.lastIndex=t,e.ch=t;var r=i.exec(e.text);if(r&&r.index==t)return r}else e.ch=t}}function d(e){for(;;){i.lastIndex=e.ch;var t=i.exec(e.text);if(!t){if(o(e))continue;return}if(s(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function f(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(s(e,t+1)){var r=e.text.lastIndexOf("/",t),n=r>-1&&!/\S/.test(e.text.slice(r+1,t));return e.ch=t+1,n?"selfClose":"regular"}e.ch=t}}function h(e,r){for(var n=[];;){var i,a=d(e),s=e.line,o=e.ch-(a?a[0].length:0);if(!a||!(i=u(e)))return;if("selfClose"!=i)if(a[1]){for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(l<0&&(!r||r==a[2]))return{tag:a[2],from:t(s,o),to:t(e.line,e.ch)}}else n.push(a[2])}}function p(e,r){for(var n=[];;){var i=f(e);if(!i)return;if("selfClose"!=i){var a=e.line,s=e.ch,o=c(e);if(!o)return;if(o[1])n.push(o[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==o[2]){n.length=l;break}if(l<0&&(!r||r==o[2]))return{tag:o[2],from:t(e.line,e.ch),to:t(a,s)}}}else c(e)}}e.registerHelper("fold","xml",(function(e,n){for(var i=new a(e,n.line,0);;){var s=d(i);if(!s||i.line!=n.line)return;var o=u(i);if(!o)return;if(!s[1]&&"selfClose"!=o){var l=t(i.line,i.ch),c=h(i,s[2]);return c&&r(c.from,l)>0?{from:l,to:c.from}:null}}})),e.findMatchingTag=function(e,n,i){var s=new a(e,n.line,n.ch,i);if(-1!=s.text.indexOf(">")||-1!=s.text.indexOf("<")){var o=u(s),l=o&&t(s.line,s.ch),d=o&&c(s);if(o&&d&&!(r(s,n)>0)){var f={from:t(s.line,s.ch),to:l,tag:d[2]};return"selfClose"==o?{open:f,close:null,at:"open"}:d[1]?{open:p(s,d[2]),close:f,at:"close"}:{open:f,close:h(s=new a(e,l.line,l.ch,i),d[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,r,n){for(var i=new a(e,t.line,t.ch,r);;){var s=p(i,n);if(!s)break;var o=h(new a(e,t.line,t.ch,r),s.tag);if(o)return{open:s,close:o}}},e.scanForClosingTag=function(e,t,r,n){return h(new a(e,t.line,t.ch,n?{from:0,to:n}:null),r)}}(r(/*! ../../lib/codemirror */"VrN/"))},p0QG: /*!********************************************!*\ !*** ./src/pages/Three/index.less?modules ***! \********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){e.exports={flex_box_center:"flex_box_center___2axlI",flex_space_between:"flex_space_between___F6m1U",flex_box_vertical_center:"flex_box_vertical_center___2GovZ",flex_box_center_end:"flex_box_center_end___2h9j0",flex_box_column:"flex_box_column___1kuIs",SubMentItem:"SubMentItem___34z-Y",MenuItem:"MenuItem___1bbPM",wrp:"wrp___3LRhb",classroomInfo:"classroomInfo___Ohxoq",title:"title___22ZLP",titleLeft:"titleLeft___1MP-h",titleRight:"titleRight___3zsz9",classroomUser:"classroomUser___1ePAN",headPic:"headPic___2lEg_",teacherInfo:"teacherInfo___3C0Dn",classroomDesc:"classroomDesc____QVZX",classroomDescBg:"classroomDescBg___1e7L7",joinCouses:"joinCouses___2G4vP",bg:"bg___2QojS",leftMenus:"leftMenus___34tjX",titleSelected:"titleSelected___K6QwW",menuText:"menuText___3qMqH",totalCount:"totalCount___R2q38",actions:"actions___26Ww0",task_count:"task_count___3UQ1V",container:"container___2EGM4",leftMenuActions:"leftMenuActions___3_J-1"}},p5ED: /*!*********************************************!*\ !*** ./src/components/PreviewAll/index.tsx ***! \*********************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,r){"use strict";r(/*! antd/es/button/style */"+L6B");var n=r(/*! antd/es/button */"2/Rp"),i=(r(/*! antd/es/tooltip/style */"5Dmo"),r(/*! antd/es/tooltip */"3S7+")),a=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),s=r(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),o=r(/*! react */"q1tI"),l=r.n(o),u=r(/*! ./index.less?modules */"vHTk"),c=r.n(u),d=r(/*! @ant-design/icons */"yEEn"),f=r(/*! @/components/monaco-editor */"ZW9T"),h=r(/*! @/utils/util */"1vsH");t.a=function(e){var t=e.name,r=e.data,u=(e.theme,e.type),p=e.filename,g=e.monacoEditor,m=e.className,v=e.style,y=e.close,b=e.onClose,E=e.hasMask,x=Object(o.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),S=Object(s.a)(x,2),T=(S[0],S[1],Object(o.useState)("")),k=Object(s.a)(T,2),w=(k[0],k[1]),C=Object(o.useRef)();p&&(g.filename=p),Object(o.useEffect)((function(){var e,t,r=null===(e=document.cookie)||void 0===e||null===(t=e.replace(/\s/g,""))||void 0===t?void 0:t.split(";");null==r||r.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&w(t[1])}))}),[]);var L=function(){r.startsWith("http")||r.startsWith("/")?A():Object(h.x)(p||"educoder",r,p)},A=function(){Object(h.v)(p||t,r)};return console.log("data:",r,"fileanme:",p," name:",t),l.a.createElement("div",{style:Object(a.a)({},v||{}),className:"".concat(E&&c.a.bgBlack," ").concat(u?c.a.wrp:"hide")},y&&l.a.createElement("div",{className:c.a.close,ref:C},l.a.createElement(i.a,{title:"点击下载此文件",getPopupContainer:function(){return C.current}},l.a.createElement("span",{onClick:A},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(c.a[m]," ").concat(m," ").concat(c.a.monaco," ").concat("txt"===u?"show":"hide")},"txt"===u&&l.a.createElement(f.b,g)),"audio"===u&&l.a.createElement("audio",{src:"".concat(null!=r&&r.startsWith("/")||(null==r?void 0:r.indexOf("https://"))>-1?r:"data:audio/mp3;base64,").concat(r),autoPlay:!0}),"video"===u&&l.a.createElement(l.a.Fragment,null,null!=r&&r.startsWith("/")?l.a.createElement("video",{controls:!0,src:"".concat(r),autoPlay:!0}):l.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(r),autoPlay:!0})),"pdf"===u&&l.a.createElement("embed",{className:c.a.embed,src:r}),"image"===u&&l.a.createElement(l.a.Fragment,null,l.a.createElement("img",{src:"".concat(null!=r&&r.startsWith("/")||(null==r?void 0:r.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(r)})),"other"===u&&l.a.createElement("div",null,l.a.createElement(n.a,{type:"primary",size:"large",onClick:L},l.a.createElement(d.a,null),"点击下载")),("download"===u||"office"===u)&&l.a.createElement(n.a,{type:"primary",size:"large",onClick:L},l.a.createElement(d.a,null),"点击下载"))}},"p77/": /*!****************************************************!*\ !*** ./node_modules/codemirror/lib/codemirror.css ***! \****************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,r){},"rAM+": /*!*******************************************************************************************************************!*\ !*** ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js ***! \*******************************************************************************************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function i(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=Object(n.a)(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,l=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){l=!0,s=e},f:function(){try{o||null==r.return||r.return()}finally{if(l)throw s}}}}},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 r=/[&<>"']/,n=/[&<>"']/g,i=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},o=e=>s[e];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function u(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 c=/(^|[^\[])\^/g;const d=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const h={},p=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(e,t){h[" "+e]||(p.test(e)?h[" "+e]=e+"/":h[" "+e]=y(e,"/",!0));const r=-1===(e=h[" "+e]).indexOf(":");return"//"===t.substring(0,2)?r?t:e.replace(g,"$1")+t:"/"===t.charAt(0)?r?t:e.replace(m,"$1")+t:e+t}function y(e,t,r){const n=e.length;if(0===n)return"";let i=0;for(;i(n=(n=n.source||n).replace(c,"$1"),e=e.replace(t,n),r),getRegex:()=>new RegExp(e,t)};return r},cleanUrl:function(e,t,r){if(e){let e;try{e=decodeURIComponent(u(r)).replace(d,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!f.test(r)&&(r=v(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch(e){return null}return r},resolveUrl:v,noopTest:{exec:function(){}},merge:function(e){let t,r,n=1;for(;n{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"}).split(/ \|/);let n=0;if(r.length>t)r.splice(t);else for(;r.length0}),!1)}e.exports=function(e,t){t=t||{};var i={main:r.m},o=t.all?{main:Object.keys(i.main)}:function(e,t){for(var r={main:[t]},n={main:[]},i={main:{}};s(r);)for(var o=Object.keys(r),l=0;l=2*d/h||b<=x)){var S,T=Number.POSITIVE_INFINITY;for(S=e.level-1;S>g&&!((T=d*p[S].maxBitrate/(6.4*y))=b)){var k=this.bwEstimator.getEstimate();u.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 "+S+"\n Current BW estimate: "+(Object(n.isFiniteNumber)(k)?(k/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: "+T.toFixed(3)+" s\n Time to underbuffer: "+x.toFixed(3)+" s"),r.nextLoadLevel=S,this.bwEstimator.sample(f,c.loaded),this.clearTimer(),e.loader&&(this.fragCurrent=this.partCurrent=null,e.loader.abort()),r.trigger(a.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:c})}}}}}},f.onFragLoaded=function(e,t){var r=t.frag,i=t.part;if(r.type===l.PlaylistLevelType.MAIN&&Object(n.isFiniteNumber)(r.sn)){var s=i?i.stats:r.stats,o=i?i.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var u=this.hls.levels[r.level],c=(u.loaded?u.loaded.bytes:0)+s.loaded,d=(u.loaded?u.loaded.duration:0)+o;u.loaded={bytes:c,duration:d},u.realBitrate=Math.round(8*c/d)}if(r.bitrateTest){var f={stats:s,frag:r,part:i,id:r.type};this.onFragBuffered(a.Events.FRAG_BUFFERED,f),r.bitrateTest=!1}}},f.onFragBuffered=function(e,t){var r=t.frag,n=t.part,i=n?n.stats:r.stats;if(!i.aborted&&r.type===l.PlaylistLevelType.MAIN&&"initSegment"!==r.sn){var a=i.parsing.end-i.loading.start;this.bwEstimator.sample(a,i.loaded),i.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}},f.onError=function(e,t){switch(t.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},f.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},f.getNextABRAutoLevel=function(){var e=this.fragCurrent,t=this.partCurrent,r=this.hls,n=r.maxAutoLevel,i=r.config,a=r.minAutoLevel,o=r.media,l=t?t.duration:e?e.duration:0,c=o?o.currentTime:0,d=o&&0!==o.playbackRate?Math.abs(o.playbackRate):1,f=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,h=(s.BufferHelper.bufferInfo(o,c,i.maxBufferHole).end-c)/d,p=this.findBestLevel(f,a,n,h,i.abrBandWidthFactor,i.abrBandWidthUpFactor);if(p>=0)return p;u.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=l?Math.min(l,i.maxStarvationDelay):i.maxStarvationDelay,m=i.abrBandWidthFactor,v=i.abrBandWidthUpFactor;if(!h){var y=this.bitrateTestDelay;y&&(g=(l?Math.min(l,i.maxLoadingDelay):i.maxLoadingDelay)-y,u.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),m=v=1)}return p=this.findBestLevel(f,a,n,h+g,m,v),Math.max(p,0)},f.findBestLevel=function(e,t,r,n,i,a){for(var s,o=this.fragCurrent,l=this.partCurrent,c=this.lastLoadedFragLevel,d=this.hls.levels,f=d[c],h=!(null==f||null===(s=f.details)||void 0===s||!s.live),p=null==f?void 0:f.codecSet,g=l?l.duration:o?o.duration:0,m=r;m>=t;m--){var v=d[m];if(v&&(!p||v.codecSet===p)){var y=v.details,b=(l?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||g,E=void 0;E=m<=c?i*e:a*e;var x=d[m].maxBitrate,S=x*b/E;if(u.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+m+"/"+Math.round(E)+"/"+x+"/"+b+"/"+n+"/"+S),E>x&&(!S||h&&!this.bitrateTestDelay||S0&&-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()},x.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_TRACK:var t,r=this.levels,n=this.trackId,a=null==r||null===(t=r[n])||void 0===t?void 0:t.details;if(a){if(this.waitForCdnTuneIn(a))break;this.state=i.State.WAITING_INIT_PTS}break;case i.State.FRAG_LOADING_WAITING_RETRY:var o,l=performance.now(),u=this.retryDate;(!u||l>=u||null!==(o=this.media)&&void 0!==o&&o.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=i.State.IDLE);break;case i.State.WAITING_INIT_PTS:var c=this.waitingData;if(c){var d=c.frag,f=c.part,h=c.cache,g=c.complete;if(void 0!==this.initPTS[d.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.FRAG_LOADING;var m={frag:d,part:f,payload:h.flush(),networkDetails:null};this._handleFragmentLoadProgress(m),g&&e.prototype._handleFragmentLoadComplete.call(this,m)}else if(this.videoTrackCC!==this.waitingVideoCC)v.logger.log("Waiting fragment cc ("+d.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var y=this.getLoadPosition(),b=s.BufferHelper.bufferInfo(this.mediaBuffer,y,this.config.maxBufferHole);Object(p.fragmentWithinToleranceTest)(b.end,this.config.maxFragLookUpTolerance,d)<0&&(v.logger.log("Waiting fragment cc ("+d.cc+") @ "+d.start+" cancelled because another fragment at "+b.end+" is needed"),this.clearWaitingFragment())}}else this.state=i.State.IDLE}this.onTickEnd()},x.clearWaitingFragment=function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.IDLE)},x.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}},x.doTickIdle=function(){var e,t,r=this.hls,n=this.levels,s=this.media,o=this.trackId,l=r.config;if(n&&n[o]&&(s||!this.startFragRequested&&l.startFragPrefetch)){var d=n[o].details;if(!d||d.live&&this.levelLastLoaded!==o||this.waitForCdnTuneIn(d))this.state=i.State.WAITING_TRACK;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,c.ElementaryStreamTypes.AUDIO,u.PlaylistLevelType.AUDIO));var f=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,u.PlaylistLevelType.AUDIO);if(null!==f){var h=f.len,p=this.getMaxBufferLength(),g=this.audioSwitch;if(!(h>=p)||g){if(!g&&this._streamEnded(f,d))return r.trigger(a.Events.BUFFER_EOS,{type:"audio"}),void(this.state=i.State.ENDED);var m=d.fragments[0].start,v=f.end;if(g){var y=this.getLoadPosition();v=y,d.PTSKnown&&ym||f.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=m+.05)}var b=this.getNextFragment(v,d);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,d,v):this.loadKey(b,d):this.bufferFlushed=!0}}}}},x.getMaxBufferLength=function(){var t=e.prototype.getMaxBufferLength.call(this),r=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,u.PlaylistLevelType.MAIN);return null===r?t:Math.max(t,r.len)},x.onMediaDetaching=function(){this.videoBuffer=null,e.prototype.onMediaDetaching.call(this)},x.onAudioTracksUpdated=function(e,t){var r=t.audioTracks;this.resetTransmuxer(),this.levels=r.map((function(e){return new l.Level(e)}))},x.onAudioTrackSwitching=function(e,t){var r=!!t.url;this.trackId=t.id;var n=this.fragCurrent;null!=n&&n.loader&&n.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.audioSwitch=!0,this.state=i.State.IDLE):this.state=i.State.STOPPED,this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},x.onLevelLoaded=function(e,t){this.mainDetails=t.details},x.onAudioTrackLoaded=function(e,t){var r,n=this.levels,a=t.details,s=t.id;if(n){this.log("Track "+s+" loaded ["+a.startSN+","+a.endSN+"],duration:"+a.totalduration);var o=n[s],l=0;if(a.live||null!==(r=o.details)&&void 0!==r&&r.live){var u=this.mainDetails;if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed||!u)return;!o.details&&a.hasProgramDateTime&&u.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(a,u),l=a.fragments[0].start):l=this.alignPlaylists(a,o.details)}o.details=a,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&a.live||this.setStartPosition(o.details,l),this.state!==i.State.WAITING_TRACK||this.waitForCdnTuneIn(a)||(this.state=i.State.IDLE),this.tick()}else this.warn("Audio tracks were reset while loading level "+s)},x._handleFragmentLoadProgress=function(e){var t,r=e.frag,n=e.part,a=e.payload,s=this.config,o=this.trackId,l=this.levels;if(l){var c=l[o];console.assert(c,"Audio track is defined on fragment load progress");var p=c.details;console.assert(p,"Audio track details are defined on fragment load progress");var g=s.defaultAudioCodec||c.audioCodec||"mp4a.40.2",m=this.transmuxer;m||(m=this.transmuxer=new f.default(this.hls,u.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var y=this.initPTS[r.cc],b=null===(t=r.initSegment)||void 0===t?void 0:t.data;if(void 0!==y){var E=n?n.index:-1,x=-1!==E,S=new h.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,a.byteLength,E,x);m.push(a,b,g,"",r,n,p.totalduration,!1,S,y)}else v.logger.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+p.startSN+" ,"+p.endSN+"],track "+o),(this.waitingData=this.waitingData||{frag:r,part:n,cache:new d.default,complete:!1}).cache.push(new Uint8Array(a)),this.waitingVideoCC=this.videoTrackCC,this.state=i.State.WAITING_INIT_PTS}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},x._handleFragmentLoadComplete=function(t){this.waitingData?this.waitingData.complete=!0:e.prototype._handleFragmentLoadComplete.call(this,t)},x.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},x.onBufferCreated=function(e,t){var r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},x.onFragBuffered=function(e,t){var r=t.frag,n=t.part;r.type===u.PlaylistLevelType.AUDIO&&(this.fragContextChanged(r)?this.warn("Fragment "+r.sn+(n?" p: "+n.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==r.sn&&(this.fragPrevious=r,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(a.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(r,n)))},x.onError=function(t,r){switch(r.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.AUDIO,r);break;case m.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case m.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==i.State.ERROR&&this.state!==i.State.STOPPED&&(this.state=r.fatal?i.State.ERROR:i.State.IDLE,this.warn(r.details+" while loading frag, switching to "+this.state+" state"));break;case m.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===r.parent&&(this.state===i.State.PARSING||this.state===i.State.PARSED)){var n=!0,a=this.getFwdBufferInfo(this.mediaBuffer,u.PlaylistLevelType.AUDIO);a&&a.len>.5&&(n=!this.reduceMaxBufferLength(a.len)),n&&(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()}}},x.onBufferFlushed=function(e,t){t.type===c.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},x._handleTransmuxComplete=function(e){var t,r="audio",n=this.hls,s=e.remuxResult,o=e.chunkMeta,l=this.getCurrentContext(o);if(!l)return this.warn("The loading context changed while buffering fragment "+o.sn+" of level "+o.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(o.level);var u=l.frag,d=l.part,f=s.audio,h=s.text,p=s.id3,g=s.initSegment;if(!this.fragContextChanged(u)){if(this.state=i.State.PARSING,this.audioSwitch&&f&&this.completeAudioSwitch(),null!=g&&g.tracks&&(this._bufferInitSegment(g.tracks,u,o),n.trigger(a.Events.FRAG_PARSING_INIT_SEGMENT,{frag:u,id:r,tracks:g.tracks})),f){var m=f.startPTS,v=f.endPTS,b=f.startDTS,E=f.endDTS;d&&(d.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:m,endPTS:v,startDTS:b,endDTS:E}),u.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,m,v,b,E),this.bufferFragmentData(f,u,d,o)}if(null!=p&&null!==(t=p.samples)&&void 0!==t&&t.length){var x=y({frag:u,id:r},p);n.trigger(a.Events.FRAG_PARSING_METADATA,x)}if(h){var S=y({frag:u,id:r},h);n.trigger(a.Events.FRAG_PARSING_USERDATA,S)}}},x._bufferInitSegment=function(e,t,r){if(this.state===i.State.PARSING){e.video&&delete e.video;var n=e.audio;if(n){n.levelCodec=n.codec,n.id="audio",this.log("Init audio buffer, container:"+n.container+", codecs[parsed]=["+n.codec+"]"),this.hls.trigger(a.Events.BUFFER_CODECS,e);var s=n.initSegment;if(null!=s&&s.byteLength){var o={type:"audio",frag:t,part:null,chunkMeta:r,parent:t.type,data:s};this.hls.trigger(a.Events.BUFFER_APPENDING,o)}this.tick()}}},x.loadFragment=function(t,r,a){var s=this.fragmentTracker.getState(t);this.fragCurrent=t,(this.audioSwitch||s===o.FragmentState.NOT_LOADED||s===o.FragmentState.PARTIAL)&&("initSegment"===t.sn?this._loadInitSegment(t):r.live&&!Object(n.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,r,a)))},x.completeAudioSwitch=function(){var t=this.hls,r=this.media,n=this.trackId;r&&(this.log("Switching audio track : flushing all audio"),e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,t.trigger(a.Events.AUDIO_TRACK_SWITCHED,{id:n})},E}(i.default);t.default=E},"./src/controller/audio-track-controller.ts": /*!**************************************************!*\ !*** ./src/controller/audio-track-controller.ts ***! \**************************************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../events */"./src/events.ts"),i=r(/*! ../errors */"./src/errors.ts"),a=r(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),s=r(/*! ../types/loader */"./src/types/loader.ts");function o(e,t){for(var r=0;r=t.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var r=t[this.trackId];this.log("Now switching to audio-track index "+e);var i=t[e],a=i.id,s=i.groupId,o=void 0===s?"":s,l=i.name,u=i.type,c=i.url;if(this.trackId=e,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(n.Events.AUDIO_TRACK_SWITCHING,{id:a,groupId:o,name:l,type:u,url:c}),!i.details||i.details.live){var d=this.switchParams(i.url,null==r?void 0:r.details);this.loadPlaylist(d)}}},f.selectInitialTrack=function(){var e=this.tracksInGroup;console.assert(e.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,r=this.findTrackId(t)||this.findTrackId();-1!==r?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},f.findTrackId=function(e){for(var t=this.tracksInGroup,r=0;rt.partTarget&&(u+=1)}if(Object(n.isFiniteNumber)(l))return new i.HlsUrlParameters(l,Object(n.isFiniteNumber)(u)?u: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,r){var n=this,i=t.details,s=t.stats,o=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(i.advancedDateTime=Date.now()-o,i.live||null!=r&&r.live){if(i.reloaded(r),r&&this.log("live playlist "+e+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),r&&i.fragments.length>0&&Object(a.mergeDetails)(r,i),!this.canLoad||!i.live)return;var l,u=void 0,c=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var d=this.hls.config.lowLatencyMode,f=i.lastPartSn,h=i.endSN,p=i.lastPartIndex,g=f===h;-1!==p?(u=g?h+1:f,c=g?d?0:p:p+1):u=h+1;var m=i.age,v=m+i.ageHeader,y=Math.min(v-i.partTarget,1.5*i.targetduration);if(y>0){if(r&&y>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+y+" with playlist age: "+i.age),y=0;else{var b=Math.floor(y/i.targetduration);u+=b,void 0!==c&&(c+=Math.round(y%i.targetduration/i.partTarget)),this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+m.toFixed(2)+"s goal: "+y+" skip sn "+b+" to part "+c)}i.tuneInGoal=y}if(l=this.getDeliveryDirectives(i,t.deliveryDirectives,u,c),d||!g)return void this.loadPlaylist(l)}else l=this.getDeliveryDirectives(i,t.deliveryDirectives,u,c);var E=Object(a.computeReloadInterval)(i,s);void 0!==u&&i.canBlockReload&&(E-=i.partTarget||1),this.log("reload live playlist "+e+" in "+Math.round(E)+" ms"),this.timer=self.setTimeout((function(){return n.loadPlaylist(l)}),E)}else this.clearTimer()},t.getDeliveryDirectives=function(e,t,r,n){var a=Object(i.getSkipValue)(e,r);return null!=t&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,n=t.part,a=i.HlsSkip.No),new i.HlsUrlParameters(r,n,a)},t.retryLoadingOrFail=function(e){var t,r=this,n=this.hls.config,i=this.retryCount-1&&null!==(t=e.context)&&void 0!==t&&t.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+e.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*n.levelLoadingRetryDelay,n.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return r.loadPlaylist()}),a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' 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,r){"use strict";r.r(t),r.d(t,"State",(function(){return x})),r.d(t,"default",(function(){return S}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ../task-loop */"./src/task-loop.ts"),a=r(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),s=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),o=r(/*! ../utils/logger */"./src/utils/logger.ts"),l=r(/*! ../events */"./src/events.ts"),u=r(/*! ../errors */"./src/errors.ts"),c=r(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),d=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),f=r(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),h=r(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),p=r(/*! ./level-helper */"./src/controller/level-helper.ts"),g=r(/*! ../loader/fragment-loader */"./src/loader/fragment-loader.ts"),m=r(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),v=r(/*! ../utils/time-ranges */"./src/utils/time-ranges.ts"),y=r(/*! ../types/loader */"./src/types/loader.ts");function b(e,t){for(var r=0;rt.start+t.duration+u;(o0&&a&&a.key&&a.iv&&"AES-128"===a.method){var s=self.performance.now();return t.decrypter.webCryptoDecrypt(new Uint8Array(i),a.key.buffer,a.iv.buffer).then((function(t){var i=self.performance.now();return n.trigger(l.Events.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:s,tdecrypt:i}}),r.payload=t,r}))}return r})).then((function(r){var n=t.fragCurrent,i=t.hls,a=t.levels;if(!a)throw new Error("init load aborted, missing levels");var s=a[e.level].details;console.assert(s,"Level details are defined when init segment is loaded");var o=e.stats;t.state=x.IDLE,t.fragLoadError=0,e.data=new Uint8Array(r.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),r.frag===n&&i.trigger(l.Events.FRAG_BUFFERED,{stats:o,frag:n,part:null,id:e.type}),t.tick()})).catch((function(r){t.warn(r),t.resetFragmentLoading(e)}))},w.fragContextChanged=function(e){var t=this.fragCurrent;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId},w.fragBufferedComplete=function(e,t){var r=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(s.BufferHelper.getBuffered(r))),this.state=x.IDLE,this.tick()},w._handleFragmentLoadComplete=function(e){var t=this.transmuxer;if(t){var r=e.frag,n=e.part,i=e.partsLoaded,a=!i||0===i.length||i.some((function(e){return!e})),s=new c.ChunkMetadata(r.level,r.sn,r.stats.chunkCount+1,0,n?n.index:-1,!a);t.flush(s)}},w._handleFragmentLoadProgress=function(e){},w._doFragLoad=function(e,t,r,i){var a=this;if(void 0===r&&(r=null),!this.levels)throw new Error("frag load aborted, missing levels");if(r=Math.max(e.start,r||0),this.config.lowLatencyMode&&t){var s=t.partList;if(s&&i){r>e.end&&t.fragmentHint&&(e=t.fragmentHint);var o=this.getNextPart(s,e,r);if(o>-1){var u=s[o];return this.log("Loading part sn: "+e.sn+" p: "+u.index+" cc: "+e.cc+" of playlist ["+t.startSN+"-"+t.endSN+"] parts [0-"+o+"-"+(s.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(r.toFixed(3))),this.nextLoadPosition=u.start+u.duration,this.state=x.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:e,part:s[o],targetBufferTime:r}),this.doFragPartsLoad(e,s,o,i).catch((function(e){return a.handleFragLoadError(e)}))}if(!e.url||this.loadedEndOfParts(s,r))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(r.toFixed(3))),Object(n.isFiniteNumber)(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=x.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:e,targetBufferTime:r}),this.fragmentLoader.load(e,i).catch((function(e){return a.handleFragLoadError(e)}))},w.doFragPartsLoad=function(e,t,r,n){var i=this;return new Promise((function(a,s){var o=[];!function r(u){var c=t[u];i.fragmentLoader.loadPart(e,c,n).then((function(n){o[c.index]=n;var s=n.part;i.hls.trigger(l.Events.FRAG_LOADED,n);var d=t[u+1];if(!d||d.fragment!==e)return a({frag:e,part:s,partsLoaded:o});r(u+1)})).catch(s)}(r)}))},w.handleFragLoadError=function(e){var t=e.data;return t&&t.details===u.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(l.Events.ERROR,t),null},w._handleTransmuxerFlush=function(e){var t=this.getCurrentContext(e);if(t&&this.state===x.PARSING){var r=t.frag,n=t.part,i=t.level,a=self.performance.now();r.stats.parsing.end=a,n&&(n.stats.parsing.end=a),this.updateLevelTiming(r,n,i,e.partial)}else this.fragCurrent||(this.state=x.IDLE)},w.getCurrentContext=function(e){var t=this.levels,r=e.level,n=e.sn,i=e.part;if(!t||!t[r])return this.warn("Levels object was unset while buffering fragment "+n+" of level "+r+". The current chunk will not be buffered."),null;var a=t[r],s=i>-1?Object(p.getPartWith)(a,n,i):null,o=s?s.fragment:Object(p.getFragmentWithSN)(a,n,this.fragCurrent);return o?{frag:o,part:s,level:a}:null},w.bufferFragmentData=function(e,t,r,n){if(e&&this.state===x.PARSING){var i=e.data1,a=e.data2,s=i;if(i&&a&&(s=Object(d.appendUint8Array)(i,a)),s&&s.length){var o={type:e.type,frag:t,part:r,chunkMeta:n,parent:t.type,data:s};this.hls.trigger(l.Events.BUFFER_APPENDING,o),e.dropped&&e.independent&&!r&&this.flushBufferGap(t)}}},w.flushBufferGap=function(e){var t=this.media;if(t)if(s.BufferHelper.isBuffered(t,t.currentTime)){var r=t.currentTime,n=s.BufferHelper.bufferInfo(t,r,0),i=e.duration,a=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),o=Math.max(Math.min(e.start-a,n.end-a),r+a);e.start-o>a&&this.flushMainBuffer(o,e.start)}else this.flushMainBuffer(0,e.start)},w.getFwdBufferInfo=function(e,t){var r=this.config,i=this.getLoadPosition();if(!Object(n.isFiniteNumber)(i))return null;var a=s.BufferHelper.bufferInfo(e,i,r.maxBufferHole);if(0===a.len&&void 0!==a.nextStart){var o=this.fragmentTracker.getBufferedFrag(i,t);if(o&&a.nextStart=r&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},w.getNextFragment=function(e,t){var r,n,i=t.fragments,a=i.length;if(!a)return null;var s,o=this.config,l=i[0].start;if(t.live){var u=o.initialLiveManifestSize;if(a-1&&rr.start&&r.loaded},w.getInitialLiveFragment=function(e,t){var r=this.fragPrevious,n=null;if(r){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),n=Object(h.findFragmentByPDT)(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!n){var i=r.sn+1;if(i>=e.startSN&&i<=e.endSN){var a=t[i-e.startSN];r.cc===a.cc&&(n=a,this.log("Live playlist, switching playlist, load frag with next SN: "+n.sn))}n||(n=Object(h.findFragWithCC)(t,r.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+n.sn)}}else{var s=this.hls.liveSyncPosition;null!==s&&(n=this.getFragmentAtPosition(s,this.bitrateTest?e.fragmentEnd:e.edge,e))}return n},w.getFragmentAtPosition=function(e,t,r){var n,i=this.config,s=this.fragPrevious,o=r.fragments,l=r.endSN,u=r.fragmentHint,c=i.maxFragLookUpTolerance,d=!!(i.lowLatencyMode&&r.partList&&u);if(d&&u&&!this.bitrateTest&&(o=o.concat(u),l=u.sn),et-c?0:c;n=Object(h.findFragmentByPTS)(s,o,e,f)}else n=o[o.length-1];if(n){var p=n.sn-r.startSN,g=s&&n.level===s.level,m=o[p+1];if(this.fragmentTracker.getState(n)===a.FragmentState.BACKTRACKED){n=null;for(var v=p;o[v]&&this.fragmentTracker.getState(o[v])===a.FragmentState.BACKTRACKED;)n=s?o[v--]:o[--v];n||(n=m)}else s&&n.sn===s.sn&&!d&&g&&(n.sn=a-t.maxFragLookUpTolerance&&i<=s;if(null!==n&&r.duration>n&&(i"+e.startSN+" prev-sn: "+(a?a.sn:"na")+" fragments: "+o),d}return l},w.waitForCdnTuneIn=function(e){return e.live&&e.canBlockReload&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)},w.setStartPosition=function(e,t){var r=this.startPosition;if(r"+e))}}])&&b(S.prototype,T),k&&b(S,k),i}(i.default)},"./src/controller/buffer-controller.ts": /*!*********************************************!*\ !*** ./src/controller/buffer-controller.ts ***! \*********************************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return h}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ../events */"./src/events.ts"),a=r(/*! ../utils/logger */"./src/utils/logger.ts"),s=r(/*! ../errors */"./src/errors.ts"),o=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),l=r(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),u=r(/*! ../loader/fragment */"./src/loader/fragment.ts"),c=r(/*! ./buffer-operation-queue */"./src/controller/buffer-operation-queue.ts"),d=Object(l.getMediaSource)(),f=/([ha]vc.)(?:\.[^.,]+)+/,h=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,r=t.media,n=t.mediaSource;a.logger.log("[buffer-controller]: Media source opened"),r&&(t.updateMediaElementDuration(),e.trigger(i.Events.MEDIA_ATTACHED,{media:r})),n&&n.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){a.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){a.logger.log("[buffer-controller]: Media source ended")},this.hls=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 c.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},t.onManifestParsed=function(e,t){var r=2;(t.audio&&!t.video||!t.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,a.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},t.onMediaAttaching=function(e,t){var r=this.media=t.media;if(r&&d){var n=this.mediaSource=new d;n.addEventListener("sourceopen",this._onMediaSourceOpen),n.addEventListener("sourceended",this._onMediaSourceEnded),n.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(n),this._objectUrl=r.src}},t.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,r=this._objectUrl;if(t){if(a.logger.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){a.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&&(r&&self.URL.revokeObjectURL(r),e.src===r?(e.removeAttribute("src"),e.load()):a.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(i.Events.MEDIA_DETACHED,void 0)},t.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach((function(t){var r=e.sourceBuffer[t];try{r&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(r),e.sourceBuffer[t]=void 0)}catch(e){a.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",e)}})),this._initSourceBuffer()},t.onBufferCodecs=function(e,t){var r=this,n=this.getSourceBufferTypes().length;Object.keys(t).forEach((function(e){if(n){var i=r.tracks[e];if(i&&"function"==typeof i.buffer.changeType){var a=t[e],s=a.codec,o=a.levelCodec,l=a.container;if((i.levelCodec||i.codec).replace(f,"$1")!==(o||s).replace(f,"$1")){var u=l+";codecs="+(o||s);r.appendChangeType(e,u)}}}else r.pendingTracks[e]=t[e]})),n||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},t.appendChangeType=function(e,t){var r=this,n=this.operationQueue,i={execute:function(){var i=r.sourceBuffer[e];i&&(a.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),i.changeType(t)),n.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){a.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",t)}};n.append(i,e)},t.onBufferAppending=function(e,t){var r=this,n=this.hls,l=this.operationQueue,u=this.tracks,c=t.data,d=t.type,f=t.frag,h=t.part,p=t.chunkMeta,g=p.buffering[d],m=self.performance.now();g.start=m;var v=f.stats.buffering,y=h?h.stats.buffering:null;0===v.start&&(v.start=m),y&&0===y.start&&(y.start=m);var b=u.audio,E="audio"===d&&1===p.id&&"audio/mpeg"===(null==b?void 0:b.container),x={execute:function(){if(g.executeStart=self.performance.now(),E){var e=r.sourceBuffer[d];if(e){var t=f.start-e.timestampOffset;Math.abs(t)>=.1&&(a.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+t+") sn: "+f.sn+")"),e.timestampOffset=f.start)}}r.appendExecutor(c,d)},onStart:function(){},onComplete:function(){var e=self.performance.now();g.executeEnd=g.end=e,0===v.first&&(v.first=e),y&&0===y.first&&(y.first=e);var t=r.sourceBuffer,n={};for(var a in t)n[a]=o.BufferHelper.getBuffered(t[a]);r.appendError=0,r.hls.trigger(i.Events.BUFFER_APPENDED,{type:d,frag:f,part:h,chunkMeta:p,parent:f.type,timeRanges:n})},onError:function(e){a.logger.error("[buffer-controller]: Error encountered while trying to append to the "+d+" SourceBuffer",e);var t={type:s.ErrorTypes.MEDIA_ERROR,parent:f.type,details:s.ErrorDetails.BUFFER_APPEND_ERROR,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=s.ErrorDetails.BUFFER_FULL_ERROR:(r.appendError++,t.details=s.ErrorDetails.BUFFER_APPEND_ERROR,r.appendError>n.config.appendErrorMaxRetry&&(a.logger.error("[buffer-controller]: Failed "+n.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),t.fatal=!0)),n.trigger(i.Events.ERROR,t)}};l.append(x,d)},t.onBufferFlushing=function(e,t){var r=this,n=this.operationQueue,s=function(e){return{execute:r.removeExecutor.bind(r,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(i.Events.BUFFER_FLUSHED,{type:e})},onError:function(t){a.logger.warn("[buffer-controller]: Failed to remove from "+e+" SourceBuffer",t)}}};t.type?n.append(s(t.type),t.type):this.getSourceBufferTypes().forEach((function(e){n.append(s(e),e)}))},t.onFragParsed=function(e,t){var r=this,n=t.frag,s=t.part,o=[],l=s?s.elementaryStreams:n.elementaryStreams;l[u.ElementaryStreamTypes.AUDIOVIDEO]?o.push("audiovideo"):(l[u.ElementaryStreamTypes.AUDIO]&&o.push("audio"),l[u.ElementaryStreamTypes.VIDEO]&&o.push("video")),0===o.length&&a.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+n.type+" level: "+n.level+" sn: "+n.sn),this.blockBuffers((function(){var e=self.performance.now();n.stats.buffering.end=e,s&&(s.stats.buffering.end=e);var t=s?s.stats:n.stats;r.hls.trigger(i.Events.FRAG_BUFFERED,{frag:n,part:s,stats:t,id:n.type})}),o)},t.onFragChanged=function(e,t){this.flushBackBuffer()},t.onBufferEos=function(e,t){var r=this;this.getSourceBufferTypes().reduce((function(e,n){var i=r.sourceBuffer[n];return t.type&&t.type!==n||i&&!i.ended&&(i.ended=!0,a.logger.log("[buffer-controller]: "+n+" sourceBuffer now EOS")),e&&!(i&&!i.ended)}),!0)&&this.blockBuffers((function(){var e=r.mediaSource;e&&"open"===e.readyState&&e.endOfStream()}))},t.onLevelUpdated=function(e,t){var r=t.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},t.flushBackBuffer=function(){var e=this.hls,t=this.details,r=this.media,a=this.sourceBuffer;if(r&&null!==t){var s=this.getSourceBufferTypes();if(s.length){var l=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(Object(n.isFiniteNumber)(l)&&!(l<0)){var u=r.currentTime,c=t.levelTargetDuration,d=Math.max(l,c),f=Math.floor(u/c)*c-d;s.forEach((function(r){var n=a[r];if(n){var s=o.BufferHelper.getBuffered(n);s.length>0&&f>s.start(0)&&(e.trigger(i.Events.BACK_BUFFER_REACHED,{bufferEnd:f}),t.live&&e.trigger(i.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:f}),e.trigger(i.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:f,type:r}))}}))}}}},t.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,r=this.media,i=this.mediaSource,s=e.fragments[0].start+e.totalduration,o=r.duration,l=Object(n.isFiniteNumber)(i.duration)?i.duration:0;e.live&&t.config.liveDurationInfinity?(a.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(e)):(s>l&&s>o||!Object(n.isFiniteNumber)(o))&&(a.logger.log("[buffer-controller]: Updating Media Source duration to "+s.toFixed(3)),i.duration=s)}},t.updateSeekableRange=function(e){var t=this.mediaSource,r=e.fragments;if(r.length&&e.live&&null!=t&&t.setLiveSeekableRange){var n=Math.max(0,r[0].start),i=Math.max(n,n+e.totalduration);t.setLiveSeekableRange(n,i)}},t.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,r=this.pendingTracks,n=Object.keys(r).length;if(n&&!e||2===n){this.createSourceBuffers(r),this.pendingTracks={};var a=this.getSourceBufferTypes();if(0===a.length)return void this.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});a.forEach((function(e){t.executeNext(e)}))}},t.createSourceBuffers=function(e){var t=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var n=0;for(var o in e)if(!t[o]){var l=e[o];if(!l)throw Error("source buffer exists for track "+o+", however track does not");var u=l.levelCodec||l.codec,c=l.container+";codecs="+u;a.logger.log("[buffer-controller]: creating sourceBuffer("+c+")");try{var d=t[o]=r.addSourceBuffer(c),f=o;this.addBufferListener(f,"updatestart",this._onSBUpdateStart),this.addBufferListener(f,"updateend",this._onSBUpdateEnd),this.addBufferListener(f,"error",this._onSBUpdateError),this.tracks[o]={buffer:d,codec:u,container:l.container,levelCodec:l.levelCodec,id:l.id},n++}catch(e){a.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+e.message),this.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,mimeType:c})}}n&&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){a.logger.error("[buffer-controller]: "+e+" SourceBuffer error",t),this.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(e);r&&r.onError(t)},t.removeExecutor=function(e,t,r){var i=this.media,s=this.mediaSource,o=this.operationQueue,l=this.sourceBuffer[e];if(!i||!s||!l)return a.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),void o.shiftAndExecuteNext(e);var u=Object(n.isFiniteNumber)(i.duration)?i.duration:1/0,c=Object(n.isFiniteNumber)(s.duration)?s.duration:1/0,d=Math.max(0,t),f=Math.min(r,u,c);f>d?(a.logger.log("[buffer-controller]: Removing ["+d+","+f+"] from the "+e+" SourceBuffer"),console.assert(!l.updating,e+" sourceBuffer must not be updating"),l.remove(d,f)):o.shiftAndExecuteNext(e)},t.appendExecutor=function(e,t){var r=this.operationQueue,n=this.sourceBuffer[t];if(!n)return a.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),void r.shiftAndExecuteNext(t);n.ended=!1,console.assert(!n.updating,t+" sourceBuffer must not be updating"),n.appendBuffer(e)},t.blockBuffers=function(e,t){var r=this;if(void 0===t&&(t=this.getSourceBufferTypes()),!t.length)return a.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(e);var n=this.operationQueue,i=t.map((function(e){return n.appendBlocker(e)}));Promise.all(i).then((function(){e(),t.forEach((function(e){var t=r.sourceBuffer[e];t&&t.updating||n.shiftAndExecuteNext(e)}))}))},t.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},t.addBufferListener=function(e,t,r){var n=this.sourceBuffer[e];if(n){var i=r.bind(this,e);this.listeners[e].push({event:t,listener:i}),n.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,r){"use strict";r.r(t),r.d(t,"default",(function(){return i}));var n=r(/*! ../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 r=this.queues[t];r.push(e),1===r.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,r=new Promise((function(e){t=e})),n={execute:t,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(n,e),r},t.executeNext=function(e){var t=this.buffers,r=this.queues,i=t[e],a=r[e];if(a.length){var s=a[0];try{s.execute()}catch(t){n.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),s.onError(t),i&&i.updating||(a.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,r){"use strict";r.r(t);var n=r(/*! ../events */"./src/events.ts");function i(e,t){for(var r=0;r0&&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}}},s.getMaxLevel=function(t){var r=this,n=this.hls.levels;if(!n.length)return-1;var i=n.filter((function(n,i){return e.isLevelAllowed(i,r.restrictedLevels)&&i<=t}));return this.clientRect=null,e.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},s.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())},s.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},s.getDimensions=function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,t.width||t.height||(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.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,r){if(!e||!e.length)return-1;for(var n,i,a=e.length-1,s=0;s=t||o.height>=r)&&(n=o,!(i=e[s+1])||n.width!==i.width||n.height!==i.height)){a=s;break}}return a},t=e,a=[{key:"contentScaleFactor",get:function(){var e=1;try{e=self.devicePixelRatio}catch(e){}return e}}],(r=[{key:"mediaWidth",get:function(){return this.getDimensions().width*e.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*e.contentScaleFactor}}])&&i(t.prototype,r),a&&i(t,a),e}();t.default=a},"./src/controller/cmcd-controller.ts": /*!*******************************************!*\ !*** ./src/controller/cmcd-controller.ts ***! \*******************************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return f}));var n=r(/*! ../events */"./src/events.ts"),i=r(/*! ../types/cmcd */"./src/types/cmcd.ts"),a=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts");function o(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}}}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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rr&&(r=a.bitrate)}return r>0?r:NaN},t.getBufferLength=function(e){var t=this.hls.media,r=e===i.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return r&&t?1e3*a.BufferHelper.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,r=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new r(e)}var n=e.prototype;return n.destroy=function(){this.loader.destroy()},n.abort=function(){this.loader.abort()},n.load=function(e,r,n){t(e),this.loader.load(e,r,n)},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,r=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new r(e)}var n=e.prototype;return n.destroy=function(){this.loader.destroy()},n.abort=function(){this.loader.abort()},n.load=function(e,r,n){t(e),this.loader.load(e,r,n)},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,r=[],n=function(e){return!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e},i=function(e){return Math.round(e)},a=function(e){return 100*i(e/100)},s={br:i,d:i,bl:a,dl:a,mtp:a,nor:function(e){return encodeURIComponent(e)},rtp:a,tb:i},o=u(Object.keys(e||{}).sort());!(t=o()).done;){var l=t.value,c=e[l];if(n(c)&&!("v"===l&&1===c||"pr"==l&&1===c)){var d=s[l];d&&(c=d(c));var f=typeof c,h=void 0;h="ot"===l||"sf"===l||"st"===l?l+"="+c:"boolean"===f?l:"number"===f?l+"="+c:l+"="+JSON.stringify(c),r.push(h)}}return r.join(",")},e.toHeaders=function(t){for(var r={},n=["Object","Request","Session","Status"],i=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},s=0,o=Object.keys(t);s3)return void this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var u=3-this._requestLicenseFailureCount+1;a.logger.warn("Retrying license request, "+u+" attempts left"),this._requestLicense(r,s)}}},u._generateLicenseRequestChallenge=function(e,t){switch(e.mediaKeySystemDomain){case s.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+e.mediaKeySystemDomain)},u._requestLicense=function(e,t){a.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r)return a.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var s=this.getLicenseServerUrl(r.mediaKeySystemDomain),o=this._createLicenseXhr(s,e,t);a.logger.log("Sending license request to URL: "+s);var l=this._generateLicenseRequestChallenge(r,e);o.send(l)}catch(e){a.logger.error("Failure requesting DRM license: "+e),this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},u.onMediaAttached=function(e,t){if(this._emeEnabled){var r=t.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)}},u.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(){})))},u.onManifestParsed=function(e,t){if(this._emeEnabled){var r=t.levels.map((function(e){return e.audioCodec})).filter((function(e){return!!e})),n=t.levels.map((function(e){return e.videoCodec})).filter((function(e){return!!e}));this._attemptKeySystemAccess(s.KeySystems.WIDEVINE,r,n)}},t=e,(r=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&o(t.prototype,r),l&&o(t,l),e}();t.default=l},"./src/controller/fps-controller.ts": /*!******************************************!*\ !*** ./src/controller/fps-controller.ts ***! \******************************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../events */"./src/events.ts"),i=r(/*! ../utils/logger */"./src/utils/logger.ts"),a=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(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.unregisterListeners=function(){this.hls.off(n.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 r=this.hls.config;if(r.capLevelOnFPSDrop){var n=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=n,n&&"function"==typeof n.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},t.checkFPS=function(e,t,r){var a=performance.now();if(t){if(this.lastTime){var s=a-this.lastTime,o=r-this.lastDroppedFrames,l=t-this.lastDecodedFrames,u=1e3*o/s,c=this.hls;if(c.trigger(n.Events.FPS_DROP,{currentDropped:o,currentDecoded:l,totalDroppedFrames:r}),u>0&&o>c.config.fpsDroppedMonitoringThreshold*l){var d=c.currentLevel;i.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===c.autoLevelCapping||c.autoLevelCapping>=d)&&(d-=1,c.trigger(n.Events.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:c.currentLevel}),c.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=r,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=a},"./src/controller/fragment-finders.ts": /*!********************************************!*\ !*** ./src/controller/fragment-finders.ts ***! \********************************************/ /*! exports provided: findFragmentByPDT, findFragmentByPTS, fragmentWithinToleranceTest, pdtWithinToleranceTest, findFragWithCC */function(e,t,r){"use strict";r.r(t),r.d(t,"findFragmentByPDT",(function(){return a})),r.d(t,"findFragmentByPTS",(function(){return s})),r.d(t,"fragmentWithinToleranceTest",(function(){return o})),r.d(t,"pdtWithinToleranceTest",(function(){return l})),r.d(t,"findFragWithCC",(function(){return u}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ../utils/binary-search */"./src/utils/binary-search.ts");function a(e,t,r){if(null===t||!Array.isArray(e)||!e.length||!Object(n.isFiniteNumber)(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;r=r||0;for(var i=0;ie&&r.start?-1:0}function l(e,t,r){var n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-n>e}function u(e,t){return i.default.search(e,(function(e){return e.cct?-1:0}))}},"./src/controller/fragment-tracker.ts": /*!********************************************!*\ !*** ./src/controller/fragment-tracker.ts ***! \********************************************/ /*! exports provided: FragmentState, FragmentTracker */function(e,t,r){"use strict";r.r(t),r.d(t,"FragmentState",(function(){return n})),r.d(t,"FragmentTracker",(function(){return s}));var n,i=r(/*! ../events */"./src/events.ts"),a=r(/*! ../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"}(n||(n={}));var s=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===a.PlaylistLevelType.MAIN){var r=this.activeFragment,n=this.activeParts;if(!r)return null;if(n)for(var i=n.length;i--;){var s=n[i],o=s?s.end:r.appendedPTS;if(s.start<=e&&void 0!==o&&e<=o)return i>9&&(this.activeParts=n.slice(i-9)),s}else if(r.start<=e&&void 0!==r.appendedPTS&&e<=r.appendedPTS)return r}return this.getBufferedFrag(e,t)},t.getBufferedFrag=function(e,t){for(var r=this.fragments,n=Object.keys(r),i=n.length;i--;){var a=r[n[i]];if((null==a?void 0:a.body.type)===t&&a.buffered){var s=a.body;if(s.start<=e&&e<=s.end)return s}}return null},t.detectEvictedFragments=function(e,t,r){var n=this;Object.keys(this.fragments).forEach((function(i){var a=n.fragments[i];if(a)if(a.buffered){var s=a.range[e];s&&s.time.some((function(e){var r=!n.isTimeBuffered(e.startPTS,e.endPTS,t);return r&&n.removeFragment(a.body),r}))}else a.body.type===r&&n.removeFragment(a.body)}))},t.detectPartialFragments=function(e){var t=this,r=this.timeRanges,n=e.frag,i=e.part;if(r&&"initSegment"!==n.sn){var a=l(n),s=this.fragments[a];s&&(Object.keys(r).forEach((function(e){var a=n.elementaryStreams[e];if(a){var o=r[e],l=null!==i||!0===a.partial;s.range[e]=t.getBufferedTimes(n,i,l,o)}})),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body))}},t.fragBuffered=function(e){var t=l(e),r=this.fragments[t];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},t.getBufferedTimes=function(e,t,r,n){for(var i={time:[],partial:r},a=t?t.start:e.start,s=t?t.end:e.end,o=e.minEndPTS||s,l=e.maxStartPTS||a,u=0;u=c&&o<=d){i.time.push({startPTS:Math.max(a,n.start(u)),endPTS:Math.min(s,n.end(u))});break}if(ac)i.partial=!0,i.time.push({startPTS:Math.max(a,n.start(u)),endPTS:Math.min(s,n.end(u))});else if(s<=c)break}return i},t.getPartialFragment=function(e){var t,r,n,i=null,a=0,s=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach((function(u){var c=l[u];c&&o(c)&&(r=c.body.start-s,n=c.body.end+s,e>=r&&e<=n&&(t=Math.min(e-r,n-e),a<=t&&(i=c.body,a=t)))})),i},t.getState=function(e){var t=l(e),r=this.fragments[t];return r?r.buffered?o(r)?n.PARTIAL:n.OK:r.backtrack?n.BACKTRACKED:n.APPENDING:n.NOT_LOADED},t.backtrack=function(e,t){var r=l(e),n=this.fragments[r];if(!n||n.backtrack)return null;var i=n.backtrack=t||n.loaded;return n.loaded=null,i},t.getBacktrackData=function(e){var t=l(e),r=this.fragments[t];if(r){var n,i=r.backtrack;if(null!=i&&null!==(n=i.payload)&&void 0!==n&&n.byteLength)return i;this.removeFragment(e)}return null},t.isTimeBuffered=function(e,t,r){for(var n,i,a=0;a=n&&t<=i)return!0;if(t<=n)return!1}return!1},t.onFragLoaded=function(e,t){var r=t.frag,n=t.part;if("initSegment"!==r.sn&&!r.bitrateTest&&!n){var i=l(r);this.fragments[i]={body:r,loaded:t,backtrack:null,buffered:!1,range:Object.create(null)}}},t.onBufferAppended=function(e,t){var r=this,n=t.frag,i=t.part,s=t.timeRanges;if(n.type===a.PlaylistLevelType.MAIN)if(this.activeFragment=n,i){var o=this.activeParts;o||(this.activeParts=o=[]),o.push(i)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach((function(e){var t=s[e];if(r.detectEvictedFragments(e,t),!i)for(var a=0;ae&&n.removeFragment(s)}}))},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 o(e){var t,r;return e.buffered&&((null===(t=e.range.video)||void 0===t?void 0:t.partial)||(null===(r=e.range.audio)||void 0===r?void 0:r.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,r){"use strict";r.r(t),r.d(t,"STALL_MINIMUM_DURATION_MS",(function(){return o})),r.d(t,"MAX_START_GAP_JUMP",(function(){return l})),r.d(t,"SKIP_BUFFER_HOLE_STEP_SECONDS",(function(){return u})),r.d(t,"SKIP_BUFFER_RANGE_START",(function(){return c})),r.d(t,"default",(function(){return d}));var n=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),i=r(/*! ../errors */"./src/errors.ts"),a=r(/*! ../events */"./src/events.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=250,l=2,u=.1,c=.05,d=function(){function e(e,t,r,n){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=r,this.hls=n}var t=e.prototype;return t.destroy=function(){this.hls=this.fragmentTracker=this.media=null},t.poll=function(e){var t=this.config,r=this.media,i=this.stalled,a=r.currentTime,u=r.seeking,c=this.seeking&&!u,d=!this.seeking&&u;if(this.seeking=u,a===e){if((d||c)&&(this.stalled=null),!r.paused&&!r.ended&&0!==r.playbackRate&&n.BufferHelper.getBuffered(r).length){var f=n.BufferHelper.bufferInfo(r,a,0),h=f.len>0,p=f.nextStart||0;if(h||p){if(u){var g=f.len>l,m=!p||p-a>l&&!this.fragmentTracker.getPartialFragment(a);if(g||m)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var v,y=Math.max(p,f.start||0)-a,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,E=(null==b||null===(v=b.details)||void 0===v?void 0:v.live)?2*b.details.targetduration:l;if(y>0&&y<=E)return void this._trySkipBufferHole(null)}var x=self.performance.now();if(null!==i){var S=x-i;!u&&S>=o&&this._reportStall(f.len);var T=n.BufferHelper.bufferInfo(r,a,t.maxBufferHole);this._tryFixBufferStall(T,S)}else this.stalled=x}}}else if(this.moved=!0,null!==i){if(this.stallReported){var k=self.performance.now()-i;s.logger.warn("playback not stuck anymore @"+a+", after "+Math.round(k)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},t._tryFixBufferStall=function(e,t){var r=this.config,n=this.fragmentTracker,i=this.media.currentTime,a=n.getPartialFragment(i);a&&this._trySkipBufferHole(a)||e.len>r.maxBufferHole&&t>1e3*r.highBufferWatchdogPeriod&&(s.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},t._reportStall=function(e){var t=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,s.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+e+")"),t.trigger(a.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,r=this.hls,o=this.media,l=o.currentTime,d=0,f=n.BufferHelper.getBuffered(o),h=0;h=d&&l.05&&this.forwardBufferLength>1){var u=Math.min(2,Math.max(1,a)),c=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(u,Math.max(1,c))}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,(r=[{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,r=e.partHoldBack,n=e.targetduration,i=this.config,a=i.liveSyncDuration,s=i.liveSyncDurationCount,o=i.lowLatencyMode,l=this.hls.userConfig,u=o&&r||t;(l.liveSyncDuration||l.liveSyncDurationCount||0===u)&&(u=void 0!==a?a:s*n);var c=n;return u+Math.min(1*this.stallCount,c)}},{key:"liveSyncPosition",get:function(){var e=this.estimateLiveEdge(),t=this.targetLatency,r=this.levelDetails;if(null===e||null===t||null===r)return null;var n=r.edge,i=e-t-this.edgeStalled,a=n-r.totalduration,s=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,i),s)}},{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 r=e.buffered.length;return r?e.buffered.end(r-1):t.edge-this.currentTime}}])&&s(t.prototype,r),o&&s(t,o),e}()},"./src/controller/level-controller.ts": /*!********************************************!*\ !*** ./src/controller/level-controller.ts ***! \********************************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return p}));var n=r(/*! ../types/level */"./src/types/level.ts"),i=r(/*! ../events */"./src/events.ts"),a=r(/*! ../errors */"./src/errors.ts"),s=r(/*! ../utils/codecs */"./src/utils/codecs.ts"),o=r(/*! ./level-helper */"./src/controller/level-helper.ts"),l=r(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),u=r(/*! ../types/loader */"./src/types/loader.ts");function c(){return(c=Object.assign||function(e){for(var t=1;t0){r=u[0].bitrate,u.sort((function(e,t){return e.bitrate-t.bitrate})),this._levels=u;for(var v=0;vthis.hls.config.fragLoadingMaxRetry&&(s=r.frag.level)):s=r.frag.level}break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:n&&(n.deliveryDirectives&&(l=!1),s=n.level),o=!0;break;case a.ErrorDetails.REMUX_ALLOC_ERROR:s=r.level,o=!0}void 0!==s&&this.recoverLevel(r,s,o,l)}}},v.recoverLevel=function(e,t,r,n){var i=e.details,a=this._levels[t];if(a.loadError++,r){if(!this.retryLoadingOrFail(e))return void(this.currentLevelIndex=-1);e.levelRetry=!0}if(n){var s=a.url.length;if(s>1&&a.loadError1){var n=(t.urlId+1)%r;this.warn("Switching to redundant URL-id "+n),this._levels.forEach((function(e){e.urlId=n})),this.level=e}},v.onFragLoaded=function(e,t){var r=t.frag;if(void 0!==r&&r.type===u.PlaylistLevelType.MAIN){var n=this._levels[r.level];void 0!==n&&(n.fragmentError=0,n.loadError=0)}},v.onLevelLoaded=function(e,t){var r,n,i=t.level,a=t.details,s=this._levels[i];if(!s)return this.warn("Invalid level index "+i),void(null!==(n=t.deliveryDirectives)&&void 0!==n&&n.skip&&(a.deltaUpdateFailed=!0));i===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0,this.retryCount=0),this.playlistLoaded(i,t,s.details)):null!==(r=t.deliveryDirectives)&&void 0!==r&&r.skip&&(a.deltaUpdateFailed=!0)},v.onAudioTrackSwitched=function(e,t){var r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var n=-1,i=this.hls.audioTracks[t.id].groupId,a=0;a0){var n=r.urlId,a=r.url[n];if(e)try{a=e.addDirectives(a)}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 "+n+" "+a),this.clearTimer(),this.hls.trigger(i.Events.LEVEL_LOADING,{url:a,level:t,id:n,deliveryDirectives:e||null})}},v.removeLevel=function(e,t){var r=function(e,r){return r!==t},n=this._levels.filter((function(n,i){return i!==e||n.url.length>1&&void 0!==t&&(n.url=n.url.filter(r),n.audioGroupIds&&(n.audioGroupIds=n.audioGroupIds.filter(r)),n.textGroupIds&&(n.textGroupIds=n.textGroupIds.filter(r)),n.urlId=0,!0)})).map((function(e,t){var r=e.details;return null!=r&&r.fragments&&r.fragments.forEach((function(e){e.level=t})),e}));this._levels=n,this.hls.trigger(i.Events.LEVELS_UPDATED,{levels:n})},p=l,(g=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t,r=this._levels;if(0!==r.length&&(this.currentLevelIndex!==e||null===(t=r[e])||void 0===t||!t.details)){if(e<0||e>=r.length){var n=e<0;if(this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:n,reason:"invalid level idx"}),n)return;e=Math.min(e,r.length-1)}this.clearTimer();var s=this.currentLevelIndex,o=r[s],l=r[e];this.log("switching to level "+e+" from "+s),this.currentLevelIndex=e;var u=c({},l,{level:e,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete u._urlId,this.hls.trigger(i.Events.LEVEL_SWITCHING,u);var d=l.details;if(!d||d.live){var f=this.switchParams(l.uri,null==o?void 0:o.details);this.loadPlaylist(f)}}}},{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)}}])&&d(p.prototype,g),m&&d(p,m),l}(l.default)},"./src/controller/level-helper.ts": /*!****************************************!*\ !*** ./src/controller/level-helper.ts ***! \****************************************/ /*! exports provided: addGroupId, assignTrackIdsByGroup, updatePTS, updateFragPTSDTS, mergeDetails, mapPartIntersection, mapFragmentIntersection, adjustSliding, addSliding, computeReloadInterval, getFragmentWithSN, getPartWith */function(e,t,r){"use strict";r.r(t),r.d(t,"addGroupId",(function(){return a})),r.d(t,"assignTrackIdsByGroup",(function(){return s})),r.d(t,"updatePTS",(function(){return o})),r.d(t,"updateFragPTSDTS",(function(){return u})),r.d(t,"mergeDetails",(function(){return c})),r.d(t,"mapPartIntersection",(function(){return d})),r.d(t,"mapFragmentIntersection",(function(){return f})),r.d(t,"adjustSliding",(function(){return h})),r.d(t,"addSliding",(function(){return p})),r.d(t,"computeReloadInterval",(function(){return g})),r.d(t,"getFragmentWithSN",(function(){return m})),r.d(t,"getPartWith",(function(){return v}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ../utils/logger */"./src/utils/logger.ts");function a(e,t,r){switch(t){case"audio":e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds.push(r);break;case"text":e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds.push(r)}}function s(e){var t={};e.forEach((function(e){var r=e.groupId||"";e.id=t[r]=t[r]||0,t[r]++}))}function o(e,t,r){l(e[t],e[r])}function l(e,t){var r=t.startPTS;if(Object(n.isFiniteNumber)(r)){var i,a=0;t.sn>e.sn?(a=r-e.start,i=e):(a=e.start-r,i=t),i.duration!==a&&(i.duration=a)}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 u(e,t,r,a,s,o){a-r<=0&&(i.logger.warn("Fragment should have a positive duration",t),a=r+t.duration,o=s+t.duration);var u=r,c=a,d=t.startPTS,f=t.endPTS;if(Object(n.isFiniteNumber)(d)){var h=Math.abs(d-r);Object(n.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(h,t.deltaPTS):t.deltaPTS=h,u=Math.max(r,d),r=Math.min(r,d),s=Math.min(s,t.startDTS),c=Math.min(a,f),a=Math.max(a,f),o=Math.max(o,t.endDTS)}t.duration=a-r;var p=r-t.start;t.appendedPTS=a,t.start=t.startPTS=r,t.maxStartPTS=u,t.startDTS=s,t.endPTS=a,t.minEndPTS=c,t.endDTS=o;var g,m=t.sn;if(!e||me.endSN)return 0;var v=m-e.startSN,y=e.fragments;for(y[v]=t,g=v;g>0;g--)l(y[g],y[g-1]);for(g=v;g=0;s--){var o=a[s].initSegment;if(o){r=o;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var l,c=0;if(f(e,t,(function(e,i){e.relurl&&(c=e.cc-i.cc),Object(n.isFiniteNumber)(e.startPTS)&&Object(n.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,r=e.initSegment)})),r&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((function(e){var t;e.initSegment&&e.initSegment.relurl!==(null===(t=r)||void 0===t?void 0:t.relurl)||(e.initSegment=r)})),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 g=t.fragments;if(c){i.logger.warn("discontinuity sliding from playlist, take drift into account");for(var m=0;m=n.length||p(t,n[r].start)}function p(e,t){if(t){for(var r=e.fragments,n=e.skippedSegments;n0&&a<3*n,o=t.loading.end-t.loading.start,l=e.availabilityDelay;if(!1===e.updated)if(s){var u=333*e.misses;r=Math.max(Math.min(i,2*o),u),e.availabilityDelay=(e.availabilityDelay||0)+r}else r=i;else s?(l=Math.min(l||n/2,a),e.availabilityDelay=l,r=l+n-a):r=n-o;return Math.round(r)}function m(e,t,r){if(!e||!e.details)return null;var n=e.details,i=n.fragments[t-n.startSN];return i||((i=n.fragmentHint)&&i.sn===t?i:t0&&-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},S.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_LEVEL:var e,t=this.levels,r=this.level,n=null==t||null===(e=t[r])||void 0===e?void 0:e.details;if(n&&(!n.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(n))break;this.state=i.State.IDLE;break}break;case i.State.FRAG_LOADING_WAITING_RETRY:var a,s=self.performance.now(),o=this.retryDate;(!o||s>=o||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=i.State.IDLE)}this.onTickEnd()},S.onTickEnd=function(){e.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var e,t,r=this.hls,n=this.levelLastLoaded,a=this.levels,o=this.media,d=r.config,f=r.nextLoadLevel;if(null!==n&&(o||!this.startFragRequested&&d.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&a&&a[f]){var h=a[f];this.level=r.nextLoadLevel=f;var p=h.details;if(!p||this.state===i.State.WAITING_LEVEL||p.live&&this.levelLastLoaded!==f)this.state=i.State.WAITING_LEVEL;else{var g=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:o,u.PlaylistLevelType.MAIN);if(null!==g&&!(g.len>=this.getMaxBufferLength(h.maxBitrate))){if(this._streamEnded(g,p)){var m={};return this.altAudio&&(m.type="video"),this.hls.trigger(s.Events.BUFFER_EOS,m),void(this.state=i.State.ENDED)}var v=g.end,y=this.getNextFragment(v,p);if(this.couldBacktrack&&!this.fragPrevious&&y&&"initSegment"!==y.sn){var b=y.sn-p.startSN;b>1&&(y=p.fragments[b-1],this.fragmentTracker.removeFragment(y))}if(y&&this.fragmentTracker.getState(y)===l.FragmentState.OK&&this.nextLoadPosition>v){var E=this.audioOnly&&!this.altAudio?c.ElementaryStreamTypes.AUDIO:c.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(o,E,u.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))}}}},S.loadFragment=function(t,r,n){var i,a=this.fragmentTracker.getState(t);if(this.fragCurrent=t,a===l.FragmentState.BACKTRACKED){var s=this.fragmentTracker.getBacktrackData(t);if(s)return this._handleFragmentLoadProgress(s),void this._handleFragmentLoadComplete(s);a=l.FragmentState.NOT_LOADED}a===l.FragmentState.NOT_LOADED||a===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,r,n)):a===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()},S.getAppendedFrag=function(e){var t=this.fragmentTracker.getAppendedFrag(e,u.PlaylistLevelType.MAIN);return t&&"fragment"in t?t.fragment:t},S.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,u.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var r,n=this.getAppendedFrag(t.currentTime);if(n&&n.start>1&&this.flushMainBuffer(0,n.start-1),!t.paused&&e){var i=e[this.hls.nextLoadLevel],a=this.fragLastKbps;r=a&&this.fragCurrent?this.fragCurrent.duration*i.maxBitrate/(1e3*a)+1:0}else r=0;var s=this.getBufferedFrag(t.currentTime+r);if(s){var o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();var l=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,c=Math.max(s.end,l+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,.5*u),.75*u));this.flushMainBuffer(c,Number.POSITIVE_INFINITY)}}}},S.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()},S.flushMainBuffer=function(t,r){e.prototype.flushMainBuffer.call(this,t,r,this.altAudio?"video":null)},S.onMediaAttached=function(t,r){e.prototype.onMediaAttached.call(this,t,r);var n=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),n.addEventListener("playing",this.onvplaying),n.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,n,this.fragmentTracker,this.hls)},S.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)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:null;Object(n.isFiniteNumber)(t)&&this.log("Media seeked to "+t.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(s.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},S.onManifestParsed=function(e,t){var r,n=!1,i=!1;t.levels.forEach((function(e){(r=e.audioCodec)&&(-1!==r.indexOf("mp4a.40.2")&&(n=!0),-1!==r.indexOf("mp4a.40.5")&&(i=!0))})),this.audioCodecSwitch=n&&i&&!Object(a.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},S.onLevelLoading=function(e,t){var r=this.levels;if(r&&this.state===i.State.IDLE){var n=r[t.level];(!n.details||n.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(n.details))&&(this.state=i.State.WAITING_LEVEL)}},S.onLevelLoaded=function(e,t){var r,n=this.levels,a=t.level,o=t.details,l=o.totalduration;if(n){this.log("Level "+a+" loaded ["+o.startSN+","+o.endSN+"], cc ["+o.startCC+", "+o.endCC+"] duration:"+l);var u=this.fragCurrent;!u||this.state!==i.State.FRAG_LOADING&&this.state!==i.State.FRAG_LOADING_WAITING_RETRY||u.level!==t.level&&u.loader&&(this.state=i.State.IDLE,u.loader.abort());var c=n[a],d=0;if(o.live||null!==(r=c.details)&&void 0!==r&&r.live){if(o.fragments[0]||(o.deltaUpdateFailed=!0),o.deltaUpdateFailed)return;d=this.alignPlaylists(o,c.details)}if(c.details=o,this.levelLastLoaded=a,this.hls.trigger(s.Events.LEVEL_UPDATED,{details:o,level:a}),this.state===i.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(o))return;this.state=i.State.IDLE}this.startFragRequested?o.live&&this.synchronizeToLiveEdge(o):this.setStartPosition(o,d),this.tick()}else this.warn("Levels were reset while loading level "+a)},S._handleFragmentLoadProgress=function(e){var t,r=e.frag,n=e.part,i=e.payload,a=this.levels;if(a){var s=a[r.level],o=s.details;if(o){var l=s.videoCodec,c=o.PTSKnown||!o.live,h=null===(t=r.initSegment)||void 0===t?void 0:t.data,p=this._getAudioCodec(s),g=this.transmuxer=this.transmuxer||new d.default(this.hls,u.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),m=n?n.index:-1,v=-1!==m,y=new f.ChunkMetadata(r.level,r.sn,r.stats.chunkCount,i.byteLength,m,v),b=this.initPTS[r.cc];g.push(i,h,p,l,r,n,o.totalduration,c,y,b)}else this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},S.onAudioTrackSwitching=function(e,t){var r=this.altAudio,n=!!t.url,i=t.id;if(!n){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var a=this.fragCurrent;null!=a&&a.loader&&(this.log("Switching to main audio track, cancel main fragment load"),a.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var o=this.hls;r&&o.trigger(s.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),o.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:i})}},S.onAudioTrackSwitched=function(e,t){var r=t.id,n=!!this.hls.audioTracks[r].url;if(n){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=n,this.tick()},S.onBufferCreated=function(e,t){var r,n,i=t.tracks,a=!1;for(var s in i){var o=i[s];if("main"===o.id){if(n=s,r=o,"video"===s){var l=i[s];l&&(this.videoBuffer=l.buffer)}}else a=!0}a&&r?(this.log("Alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(e,t){var r=t.frag,n=t.part;if(!r||r.type===u.PlaylistLevelType.MAIN){if(this.fragContextChanged(r))return this.warn("Fragment "+r.sn+(n?" p: "+n.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===i.State.PARSED&&(this.state=i.State.IDLE));var a=n?n.stats:r.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,n)}},S.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(u.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 r=!0,n=this.getFwdBufferInfo(this.media,u.PlaylistLevelType.MAIN);n&&n.len>.5&&(r=!this.reduceMaxBufferLength(n.len)),r&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},S.checkBuffer=function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){var r=o.BufferHelper.getBuffered(e);!this.loadedmetadata&&r.length?(this.loadedmetadata=!0,this.seekToStartPos()):t.poll(this.lastCurrentTime),this.lastCurrentTime=e.currentTime}},S.onFragLoadEmergencyAborted=function(){this.state=i.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(e,t){var r=t.type;if(r!==c.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var n=(r===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(n,r,u.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(e,t){this.levels=t.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var e=this.media,t=e.currentTime,r=this.startPosition;if(r>=0&&t0&&(i1&&!1===e.seeking){var r=e.currentTime;if(o.BufferHelper.isBuffered(e,r)?t=this.getAppendedFrag(r):o.BufferHelper.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){var n=this.fragPlaying,i=t.level;n&&t.sn===n.sn&&n.level===i&&t.urlId===n.urlId||(this.hls.trigger(s.Events.FRAG_CHANGED,{frag:t}),n&&n.level===i||this.hls.trigger(s.Events.LEVEL_SWITCHED,{level:i}),this.fragPlaying=t)}}},b=y,(E=[{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}}])&&m(b.prototype,E),x&&m(b,x),y}(i.default)},"./src/controller/subtitle-stream-controller.ts": /*!******************************************************!*\ !*** ./src/controller/subtitle-stream-controller.ts ***! \******************************************************/ /*! exports provided: SubtitleStreamController */function(e,t,r){"use strict";r.r(t),r.d(t,"SubtitleStreamController",(function(){return g}));var n=r(/*! ../events */"./src/events.ts"),i=r(/*! ../utils/logger */"./src/utils/logger.ts"),a=r(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),s=r(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),o=r(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),l=r(/*! ./level-helper */"./src/controller/level-helper.ts"),u=r(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),c=r(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),d=r(/*! ../types/loader */"./src/types/loader.ts"),f=r(/*! ../types/level */"./src/types/level.ts");function h(e,t){for(var r=0;r=i[o].start&&s<=i[o].end){a=i[o];break}var l=r.start+r.duration;a?a.end=l:(a={start:s,end:l},i.push(a)),this.fragmentTracker.fragBuffered(r)}}},b.onBufferFlushing=function(e,t){var r=t.startOffset,n=t.endOffset;if(0===r&&n!==Number.POSITIVE_INFINITY){var i=this.currentTrackId,a=this.levels;if(!a.length||!a[i]||!a[i].details)return;var s=n-a[i].details.targetduration;if(s<=0)return;t.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach((function(e){for(var t=0;t=u.length||i!==a)&&d){if(this.mediaBuffer=this.mediaBufferTimeRanges,n.live||null!==(r=d.details)&&void 0!==r&&r.live){var f=this.mainDetails;if(n.deltaUpdateFailed||!f)return;var h=f.fragments[0];d.details?0===this.alignPlaylists(n,d.details)&&h&&Object(l.addSliding)(n,h.start):n.hasProgramDateTime&&f.hasProgramDateTime?Object(o.alignMediaPlaylistByPDT)(n,f):h&&Object(l.addSliding)(n,h.start)}d.details=n,this.levelLastLoaded=i,this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===c.State.IDLE&&(Object(s.findFragmentByPTS)(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),d.details=void 0))}}},b._handleFragmentLoadComplete=function(e){var t=e.frag,r=e.payload,i=t.decryptdata,a=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){var s=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer).then((function(e){var r=performance.now();a.trigger(n.Events.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:s,tdecrypt:r}})}))}},b.doTick=function(){if(this.media){if(this.state===c.State.IDLE){var e,t=this.currentTrackId,r=this.levels;if(!r.length||!r[t]||!r[t].details)return;var o=r[t].details,l=o.targetduration,d=this.config,f=this.media,h=a.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,f.currentTime-l,d.maxBufferHole),p=h.end;if(h.len>this.getMaxBufferLength()+l)return;console.assert(o,"Subtitle track details are defined on idle subtitle stream controller tick");var g,m=o.fragments,v=m.length,y=o.edge,b=this.fragPrevious;if(p-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},h.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},h.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),c(this.media.textTracks).forEach((function(e){Object(i.clearCurrentCues)(e)})),this.subtitleTrack=-1,this.media=null)},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},h.onSubtitleTrackLoaded=function(e,t){var r=t.id,n=t.details,i=this.trackId,a=this.tracksInGroup[i];if(a){var s=a.details;a.details=t.details,this.log("subtitle track "+r+" loaded ["+n.startSN+"-"+n.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,t,s))}else this.warn("Invalid subtitle track id "+r)},h.onLevelLoading=function(e,t){this.switchLevel(t.level)},h.onLevelSwitching=function(e,t){this.switchLevel(t.level)},h.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.textGroupIds){var r=t.textGroupIds[t.urlId];if(this.groupId!==r){var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,a=this.tracks.filter((function(e){return!r||e.groupId===r}));this.tracksInGroup=a;var s=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=r;var o={subtitleTracks:a};this.log("Updating subtitle tracks, "+a.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(n.Events.SUBTITLE_TRACKS_UPDATED,o),-1!==s&&this.setSubtitleTrack(s,i)}}},h.findTrackId=function(e){for(var t=this.tracksInGroup,r=0;r=i.length)){this.clearTimer();var a=i[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,a){var s=a.id,o=a.groupId,l=void 0===o?"":o,u=a.name,c=a.type,d=a.url;this.hls.trigger(n.Events.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:u,type:c,url:d});var f=this.switchParams(a.url,null==t?void 0:t.details);this.loadPlaylist(f)}else this.hls.trigger(n.Events.SUBTITLE_TRACK_SWITCH,{id:e})}}else this.queuedDefaultTrack=e},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var e=-1,t=c(this.media.textTracks),r=0;r=0&&(f[0]=Math.min(f[0],t),f[1]=Math.max(f[1],r),c=!0,h/(r-t)>.5))return}if(c||a.push([t,r]),this.config.renderTextTracksNatively){var p=this.captionsTracks[e];this.Cues.newCue(p,t,r,n)}else{var g=this.Cues.newCue(null,t,r,n);this.hls.trigger(i.Events.CUES_PARSED,{type:"captions",cues:g,track:e})}},t.onInitPtsFound=function(e,t){var r=this,n=t.frag,a=t.id,s=t.initPTS,o=t.timescale,l=this.unparsedVttFrags;"main"===a&&(this.initPTS[n.cc]=s,this.timescale[n.cc]=o),l.length&&(this.unparsedVttFrags=[],l.forEach((function(e){r.onFragLoaded(i.Events.FRAG_LOADED,e)})))},t.getExistingTrack=function(e){var t=this.media;if(t)for(var r=0;r>>8^255&m^99,e[h]=m,t[m]=h;var v=f[h],y=f[v],b=f[y],E=257*f[m]^16843008*m;n[h]=E<<24|E>>>8,i[h]=E<<16|E>>>16,a[h]=E<<8|E>>>24,s[h]=E,E=16843009*b^65537*y^257*v^16843008*h,l[m]=E<<24|E>>>8,u[m]=E<<16|E>>>16,c[m]=E<<8|E>>>24,d[m]=E,h?(h=v^f[f[f[b^v]]],p^=f[f[p]]):h=p=1}},t.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;n>>6);var p=(60&t[r+2])>>>2;if(!(p>h.length-1))return u=(1&t[r+2])<<2,u|=(192&t[r+3])>>>6,n.logger.log("manifest codec:"+s+", ADTS type:"+o+", samplingIndex:"+p),/firefox/i.test(d)?p>=6?(o=5,c=new Array(4),l=p-3):(o=2,c=new Array(2),l=p):-1!==d.indexOf("android")?(o=2,c=new Array(2),l=p):(o=5,c=new Array(4),s&&(-1!==s.indexOf("mp4a.40.29")||-1!==s.indexOf("mp4a.40.5"))||!s&&p>=6?l=p-3:((s&&-1!==s.indexOf("mp4a.40.2")&&(p>=6&&1===u||/vivaldi/i.test(d))||!s&&1===u)&&(o=2,c=new Array(2)),l=p)),c[0]=o<<3,c[0]|=(14&p)>>1,c[1]|=(1&p)<<7,c[1]|=u<<3,5===o&&(c[1]|=(14&l)>>1,c[2]=(1&l)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:h[p],channelCount:u,codec:"mp4a.40."+o,manifestCodec:f};e.trigger(a.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+p})}function o(e,t){return 255===e[t]&&240==(246&e[t+1])}function l(e,t){return 1&e[t+1]?7:9}function u(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function c(e,t){return t+5=e.length)return!1;var n=u(e,t);if(n<=r)return!1;var i=t+n;return i===e.length||d(e,i)}return!1}function p(e,t,r,i,a){if(!e.samplerate){var o=s(t,r,i,a);if(!o)return;e.config=o.config,e.samplerate=o.samplerate,e.channelCount=o.channelCount,e.codec=o.codec,e.manifestCodec=o.manifestCodec,n.logger.log("parsed codec:"+e.codec+", rate:"+o.samplerate+", channels:"+o.channelCount)}}function g(e){return 9216e4/e}function m(e,t,r,n,i){var a=l(e,t),s=u(e,t);if((s-=a)>0)return{headerLength:a,frameLength:s,stamp:r+n*i}}function v(e,t,r,n,i){var a=m(t,r,n,i,g(e.samplerate));if(a){var s,o=a.frameLength,l=a.headerLength,u=a.stamp,c=l+o,d=Math.max(0,r+c-t.length);d?(s=new Uint8Array(c-l)).set(t.subarray(r+l,t.length),0):s=t.subarray(r+l,r+c);var f={unit:s,pts:u};return d||e.samples.push(f),{sample:f,length:c,missing:d}}}},"./src/demux/base-audio-demuxer.ts": /*!*****************************************!*\ !*** ./src/demux/base-audio-demuxer.ts ***! \*****************************************/ /*! exports provided: initPTSFn, default */function(e,t,r){"use strict";r.r(t),r.d(t,"initPTSFn",(function(){return u}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ../demux/id3 */"./src/demux/id3.ts"),a=r(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),s=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),o=r(/*! ../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,r){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,r){},t.demux=function(e,t){this.cachedData&&(e=Object(s.appendUint8Array)(this.cachedData,e),this.cachedData=null);var r,n,l=i.getID3Data(e,0),c=l?l.length:0,d=this._audioTrack,f=this._id3Track,h=l?i.getTimeStamp(l):void 0,p=e.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=u(h,t)),l&&l.length>0&&f.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),n=this.initPTS;ce?(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),r=this.word>>>32-t;return e>32&&n.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?r<>>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,r=8,n=0;n0)return e.subarray(r,r+n)},o=function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3]},l=function(e,t){return i(e,t)&&o(e,t+6)+10<=e.length-t},u=function(e){for(var t=f(e),r=0;r>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:u+=String.fromCharCode(a);break;case 12:case 13:s=e[c++],u+=String.fromCharCode((31&a)<<6|63&s);break;case 14:s=e[c++],o=e[c++],u+=String.fromCharCode((15&a)<<12|(63&s)<<6|(63&o)<<0)}}return u},b={decodeTextFrame:g};function E(){return n||void 0===self.TextDecoder||(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts": /*!*********************************!*\ !*** ./src/demux/mp3demuxer.ts ***! \*********************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t);var n=r(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),i=r(/*! ../demux/id3 */"./src/demux/id3.ts"),a=r(/*! ../utils/logger */"./src/utils/logger.ts"),s=r(/*! ./mpegaudio */"./src/demux/mpegaudio.ts");function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,o(t,r);var l=n.prototype;return l.resetInitSegment=function(t,r,n){e.prototype.resetInitSegment.call(this,t,r,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}},n.probe=function(e){if(!e)return!1;for(var t=(i.getID3Data(e,0)||[]).length,r=e.length;t0},t.demux=function(e){var t=e,r=Object(i.dummyTrack)();if(this.config.progressive){this.remainderData&&(t=Object(n.appendUint8Array)(this.remainderData,e));var a=Object(n.segmentValidRange)(t);this.remainderData=a.remainder,r.samples=a.valid||new Uint8Array}else r.samples=t;return{audioTrack:Object(i.dummyTrack)(),avcTrack:r,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,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy=function(){},e}();a.minProbeByteLength=1024,t.default=a},"./src/demux/mpegaudio.ts": /*!********************************!*\ !*** ./src/demux/mpegaudio.ts ***! \********************************/ /*! exports provided: appendFrame, parseHeader, isHeaderPattern, isHeader, canParse, probe */function(e,t,r){"use strict";r.r(t),r.d(t,"appendFrame",(function(){return l})),r.d(t,"parseHeader",(function(){return u})),r.d(t,"isHeaderPattern",(function(){return c})),r.d(t,"isHeader",(function(){return d})),r.d(t,"canParse",(function(){return f})),r.d(t,"probe",(function(){return h}));var n=null,i=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],a=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],s=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],o=[0,1,1,4];function l(e,t,r,n,i){if(!(r+24>t.length)){var a=u(t,r);if(a&&r+a.frameLength<=t.length){var s=n+i*(9e4*a.samplesPerFrame/a.sampleRate),o={unit:t.subarray(r,r+a.frameLength),pts:s,dts:s};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(o),{sample:o,length:a.frameLength,missing:0}}}}function u(e,t){var r=e[t+1]>>3&3,l=e[t+1]>>1&3,u=e[t+2]>>4&15,c=e[t+2]>>2&3;if(1!==r&&0!==u&&15!==u&&3!==c){var d=e[t+2]>>1&1,f=e[t+3]>>6,h=1e3*i[14*(3===r?3-l:3===l?3:4)+u-1],p=a[3*(3===r?0:2===r?1:2)+c],g=3===f?1:2,m=s[r][l],v=o[l],y=8*m*v,b=Math.floor(m*h/p+d)*v;if(null===n){var E=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);n=E?parseInt(E[1]):0}return!!n&&n<=87&&2===l&&h>=224e3&&0===f&&(e[t+3]=128|e[t+3]),{sampleRate:p,channelCount:g,frameLength:b,samplesPerFrame:y}}}function c(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function d(e,t){return t+1=e.length)return void r();if(!(e[t].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,n),!n)return}}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,i=32;i<=e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r},t.getAvcDecryptedUnit=function(e,t){for(var r=new Uint8Array(t),n=0,i=32;i<=e.length-16;i+=160,n+=16)e.set(r.subarray(n,n+16),i);return e},t.decryptAvcSample=function(e,t,r,n,a,s){var o=Object(i.discardEPB)(a.data),l=this.getAvcEncryptedData(o),u=this;this.decryptBuffer(l.buffer,(function(i){a.data=u.getAvcDecryptedUnit(o,i),s||u.decryptAvcSamples(e,t,r+1,n)}))},t.decryptAvcSamples=function(e,t,r,n){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length)return void n();for(var i=e[t].units;!(r>=i.length);r++){var a=i[r];if(!(a.data.length<=48||1!==a.type&&5!==a.type)){var s=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,n,a,s),!s)return}}}},e}();t.default=a},"./src/demux/transmuxer-interface.ts": /*!*******************************************!*\ !*** ./src/demux/transmuxer-interface.ts ***! \*******************************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return d}));var n=r(/*! webworkify-webpack */"./node_modules/webworkify-webpack/index.js"),i=r(/*! ../events */"./src/events.ts"),a=r(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=r(/*! ../errors */"./src/errors.ts"),l=r(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),u=r(/*! eventemitter3 */"./node_modules/eventemitter3/index.js"),c=Object(l.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function e(e,t,r,l){var d=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=r,this.onFlush=l;var f=e.config,h=function(t,r){(r=r||{}).frag=d.frag,r.id=d.id,e.trigger(t,r)};this.observer=new u.EventEmitter,this.observer.on(i.Events.FRAG_DECRYPTED,h),this.observer.on(i.Events.ERROR,h);var p={mp4:c.isTypeSupported("video/mp4"),mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(f.enableWorker&&"undefined"!=typeof Worker){var m;s.logger.log("demuxing in webworker");try{m=this.worker=n(/*! ../demux/transmuxer-worker.ts */"./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(t){e.trigger(i.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(t.message+" ("+t.filename+":"+t.lineno+")")})},m.postMessage({cmd:"init",typeSupported:p,vendor:g,id:t,config:JSON.stringify(f)})}catch(e){s.logger.warn("Error in worker:",e),s.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new a.default(this.observer,p,f,g,t),this.worker=null}}else this.transmuxer=new a.default(this.observer,p,f,g,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 r=this.observer;r&&r.removeAllListeners(),this.observer=null},t.push=function(e,t,r,n,i,o,l,u,c,d){var f=this;c.transmuxing.start=self.performance.now();var h=this.transmuxer,p=this.worker,g=o?o.start:i.start,m=i.decryptdata,v=this.frag,y=!(v&&i.cc===v.cc),b=!(v&&c.level===v.level),E=v?c.sn-v.sn:-1,x=this.part?c.part-this.part.index:1,S=!b&&(1===E||0===E&&1===x),T=self.performance.now();(b||E||0===i.stats.parsing.start)&&(i.stats.parsing.start=T),!o||!x&&S||(o.stats.parsing.start=T);var k=new a.TransmuxState(y,S,u,b,g);if(!S||y){s.logger.log("[transmuxer-interface, "+i.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+"\n discontinuity: "+y+"\n trackSwitch: "+b+"\n contiguous: "+S+"\n accurateTimeOffset: "+u+"\n timeOffset: "+g);var w=new a.TransmuxConfig(r,n,t,l,d);this.configureTransmuxer(w)}if(this.frag=i,this.part=o,p)p.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:c,state:k},e instanceof ArrayBuffer?[e]:[]);else if(h){var C=h.push(e,m,c,k);Object(a.isPromise)(C)?C.then((function(e){f.handleTransmuxComplete(e)})):this.handleTransmuxComplete(C)}},t.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var r=this.transmuxer,n=this.worker;if(n)n.postMessage({cmd:"flush",chunkMeta:e});else if(r){var i=r.flush(e);Object(a.isPromise)(i)?i.then((function(r){t.handleFlushResult(r,e)})):this.handleFlushResult(i,e)}},t.handleFlushResult=function(e,t){var r=this;e.forEach((function(e){r.handleTransmuxComplete(e)})),this.onFlush(t)},t.onWorkerMessage=function(e){var t=e.data,r=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,r.trigger(t.event,t.data)}},t.configureTransmuxer=function(e){var t=this.worker,r=this.transmuxer;t?t.postMessage({cmd:"configure",config:e}):r&&r.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,r){"use strict";r.r(t),r.d(t,"default",(function(){return o}));var n=r(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),i=r(/*! ../events */"./src/events.ts"),a=r(/*! ../utils/logger */"./src/utils/logger.ts"),s=r(/*! eventemitter3 */"./node_modules/eventemitter3/index.js");function o(e){var t=new s.EventEmitter,r=function(t,r){e.postMessage({event:t,data:r})};t.on(i.Events.FRAG_DECRYPTED,r),t.on(i.Events.ERROR,r),e.addEventListener("message",(function(i){var s=i.data;switch(s.cmd){case"init":var o=JSON.parse(s.config);e.transmuxer=new n.default(t,s.typeSupported,o,s.vendor,s.id),Object(a.enableLogs)(o.debug),r("init",null);break;case"configure":e.transmuxer.configure(s.config);break;case"demux":var u=e.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(n.isPromise)(u)?u.then((function(t){l(e,t)})):l(e,u);break;case"flush":var d=s.chunkMeta,f=e.transmuxer.flush(d);Object(n.isPromise)(f)?f.then((function(t){c(e,t,d)})):c(e,f,d)}}))}function l(e,t){if((r=t.remuxResult).audio||r.video||r.text||r.id3||r.initSegment){var r,n=[],i=t.remuxResult,a=i.audio,s=i.video;a&&u(n,a),s&&u(n,s),e.postMessage({event:"transmuxComplete",data:t},n)}}function u(e,t){t.data1&&e.push(t.data1.buffer),t.data2&&e.push(t.data2.buffer)}function c(e,t,r){t.forEach((function(t){l(e,t)})),e.postMessage({event:"flush",data:r})}},"./src/demux/transmuxer.ts": /*!*********************************!*\ !*** ./src/demux/transmuxer.ts ***! \*********************************/ /*! exports provided: default, isPromise, TransmuxConfig, TransmuxState */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return y})),r.d(t,"isPromise",(function(){return E})),r.d(t,"TransmuxConfig",(function(){return x})),r.d(t,"TransmuxState",(function(){return S}));var n,i=r(/*! ../events */"./src/events.ts"),a=r(/*! ../errors */"./src/errors.ts"),s=r(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),o=r(/*! ../demux/aacdemuxer */"./src/demux/aacdemuxer.ts"),l=r(/*! ../demux/mp4demuxer */"./src/demux/mp4demuxer.ts"),u=r(/*! ../demux/tsdemuxer */"./src/demux/tsdemuxer.ts"),c=r(/*! ../demux/mp3demuxer */"./src/demux/mp3demuxer.ts"),d=r(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.ts"),f=r(/*! ../remux/passthrough-remuxer */"./src/remux/passthrough-remuxer.ts"),h=r(/*! ./chunk-cache */"./src/demux/chunk-cache.ts"),p=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),g=r(/*! ../utils/logger */"./src/utils/logger.ts");try{n=self.performance.now.bind(self.performance)}catch(e){g.logger.debug("Unable to use Performance API on this environment"),n=self.Date.now}var m=[{demux:u.default,remux:d.default},{demux:l.default,remux:f.default},{demux:o.default,remux:d.default},{demux:c.default,remux:d.default}],v=1024;m.forEach((function(e){var t=e.demux;v=Math.max(v,t.minProbeByteLength)}));var y=function(){function e(e,t,r,n,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 h.default,this.observer=e,this.typeSupported=t,this.config=r,this.vendor=n,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,r,i){var a=this,s=r.transmuxing;s.executeStart=n();var o=new Uint8Array(e),l=this.cache,u=this.config,c=this.currentTransmuxState,d=this.transmuxConfig;i&&(this.currentTransmuxState=i);var f=function(e,t){var r=null;return e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(r=t),r}(o,t);if(f&&"AES-128"===f.method){var h=this.getDecrypter();if(!u.enableSoftwareAES)return this.decryptionPromise=h.webCryptoDecrypt(o,f.key.buffer,f.iv.buffer).then((function(e){var t=a.push(e,null,r);return a.decryptionPromise=null,t})),this.decryptionPromise;var g=h.softwareDecrypt(o,f.key.buffer,f.iv.buffer);if(!g)return s.executeEnd=n(),b(r);o=new Uint8Array(g)}var m=i||c,v=m.contiguous,y=m.discontinuity,E=m.trackSwitch,x=m.accurateTimeOffset,S=m.timeOffset,T=d.audioCodec,k=d.videoCodec,w=d.defaultInitPts,C=d.duration,L=d.initSegmentData;if((y||E)&&this.resetInitSegment(L,T,k,C),y&&this.resetInitialTimestamp(w),v||this.resetContiguity(),this.needsProbing(o,y,E)){if(l.dataLength){var A=l.flush();o=Object(p.appendUint8Array)(A,o)}this.configureTransmuxer(o,d)}var D=this.transmux(o,f,S,x,r),O=this.currentTransmuxState;return O.contiguous=!0,O.discontinuity=!1,O.trackSwitch=!1,s.executeEnd=n(),D},t.flush=function(e){var t=this,r=e.transmuxing;r.executeStart=n();var s=this.decrypter,o=this.cache,l=this.currentTransmuxState,u=this.decryptionPromise;if(u)return u.then((function(){return t.flush(e)}));var c=[],d=l.timeOffset;if(s){var f=s.flush();f&&c.push(this.push(f,null,e))}var h=o.dataLength;o.reset();var p=this.demuxer,g=this.remuxer;if(!p||!g)return h>=v&&this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:a.ErrorTypes.MEDIA_ERROR,details:a.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),r.executeEnd=n(),[b(e)];var m=p.flush(d);return E(m)?m.then((function(r){return t.flushRemux(c,r,e),c})):(this.flushRemux(c,m,e),c)},t.flushRemux=function(e,t,r){var i=t.audioTrack,a=t.avcTrack,s=t.id3Track,o=t.textTrack,l=this.currentTransmuxState,u=l.accurateTimeOffset,c=l.timeOffset;g.logger.log("[transmuxer.ts]: Flushed fragment "+r.sn+(r.part>-1?" p: "+r.part:"")+" of level "+r.level);var d=this.remuxer.remux(i,a,s,o,c,u,!0,this.id);e.push({remuxResult:d,chunkMeta:r}),r.transmuxing.executeEnd=n()},t.resetInitialTimestamp=function(e){var t=this.demuxer,r=this.remuxer;t&&r&&(t.resetTimeStamp(e),r.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,r,n){var i=this.demuxer,a=this.remuxer;i&&a&&(i.resetInitSegment(t,r,n),a.resetInitSegment(e,t,r))},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,r,n,i){return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,r,n,i):this.transmuxUnencrypted(e,r,n,i)},t.transmuxUnencrypted=function(e,t,r,n){var i=this.demuxer.demux(e,t,!1,!this.config.progressive),a=i.audioTrack,s=i.avcTrack,o=i.id3Track,l=i.textTrack;return{remuxResult:this.remuxer.remux(a,s,o,l,t,r,!1,this.id),chunkMeta:n}},t.transmuxSampleAes=function(e,t,r,n,i){var a=this;return this.demuxer.demuxSampleAes(e,t,r).then((function(e){return{remuxResult:a.remuxer.remux(e.audioTrack,e.avcTrack,e.id3Track,e.textTrack,r,n,!1,a.id),chunkMeta:i}}))},t.configureTransmuxer=function(e,t){for(var r,n=this.config,i=this.observer,a=this.typeSupported,s=this.vendor,o=t.audioCodec,u=t.defaultInitPts,c=t.duration,d=t.initSegmentData,h=t.videoCodec,p=0,v=m.length;p>4>1){if((O=L+5+t[L+4])===L+188)continue}else O=L+4;switch(D){case h:A&&(p&&(a=v(p))&&this.parseAVCPES(a,!1),p={data:[],size:0}),p&&(p.data.push(t.subarray(O,L+188)),p.size+=L+188-O);break;case y:A&&(E&&(a=v(E))&&(o.isAAC?this.parseAACPES(a):this.parseMPEGPES(a)),E={data:[],size:0}),E&&(E.data.push(t.subarray(O,L+188)),E.size+=L+188-O);break;case b:A&&(x&&(a=v(x))&&this.parseID3PES(a),x={data:[],size:0}),x&&(x.data.push(t.subarray(O,L+188)),x.size+=L+188-O);break;case 0:A&&(O+=t[O]+1),k=this._pmtId=g(t,O);break;case k:A&&(O+=t[O]+1);var _=m(t,O,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,n);(h=_.avc)>0&&(s.pid=h),(y=_.audio)>0&&(o.pid=y,o.isAAC=_.isAAC),(b=_.id3)>0&&(f.pid=b),S&&!T&&(c.logger.log("reparse from beginning"),S=!1,L=C-188),T=this.pmtParsed=!0;break;case 17:case 8191:break;default:S=!0}}else this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});s.pesData=p,o.pesData=E,f.pesData=x;var R={audioTrack:o,avcTrack:s,id3Track:f,textTrack:this._txtTrack};return i&&this.extractRemainingSamples(R),R},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,r=e.audioTrack,n=e.avcTrack,i=e.id3Track,a=n.pesData,s=r.pesData,o=i.pesData;a&&(t=v(a))?(this.parseAVCPES(t,!0),n.pesData=null):n.pesData=a,s&&(t=v(s))?(r.isAAC?this.parseAACPES(t):this.parseMPEGPES(t),r.pesData=null):(null!=s&&s.size&&c.logger.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=s),o&&(t=v(o))?(this.parseID3PES(t),i.pesData=null):i.pesData=o},t.demuxSampleAes=function(e,t,r){var n=this.demux(e,r,!0,!this.config.progressive),i=this.sampleAes=new o.default(this.observer,this.config,t);return this.decrypt(n,i)},t.decrypt=function(e,t){return new Promise((function(r){var n=e.audioTrack,i=e.avcTrack;n.samples&&n.isAAC?t.decryptAacSamples(n.samples,0,(function(){i.samples?t.decryptAvcSamples(i.samples,0,0,(function(){r(e)})):r(e)})):i.samples&&t.decryptAvcSamples(i.samples,0,0,(function(){r(e)}))}))},t.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},t.parseAVCPES=function(e,t){var r,n=this,i=this._avcTrack,o=this.parseAVCNALu(e.data),l=this.avcSample,u=!1;e.data=null,l&&o.length&&!i.audFound&&(y(l,i),l=this.avcSample=p(!1,e.pts,e.dts,"")),o.forEach((function(t){switch(t.type){case 1:r=!0,l||(l=n.avcSample=p(!0,e.pts,e.dts,"")),l.frame=!0;var o=t.data;if(u&&o.length>4){var c=new a.default(o).readSliceType();2!==c&&4!==c&&7!==c&&9!==c||(l.key=!0)}break;case 5:r=!0,l||(l=n.avcSample=p(!0,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:r=!0;var d=new a.default(E(t.data));d.readUByte();for(var f=0,h=0,g=!1,m=0;!g&&d.bytesAvailable>1;){f=0;do{f+=m=d.readUByte()}while(255===m);h=0;do{h+=m=d.readUByte()}while(255===m);if(4===f&&0!==d.bytesAvailable){if(g=!0,181===d.readUByte()&&49===d.readUShort()&&1195456820===d.readUInt()&&3===d.readUByte()){for(var v=d.readUByte(),x=31&v,S=[v,d.readUByte()],T=0;T16){for(var k=[],w=0;w<16;w++)k.push(d.readUByte().toString(16)),3!==w&&5!==w&&7!==w&&9!==w||k.push("-");for(var C=h-16,L=new Uint8Array(C),A=0;A=0){var d={data:e.subarray(u,l-a-1),type:c};o.push(d)}else{var f=this.getLastNalUnit();if(f&&(s&&l<=4-s&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-s)),(r=l-a-1)>0)){var h=new Uint8Array(f.data.byteLength+r);h.set(f.data,0),h.set(e.subarray(0,r),f.data.byteLength),f.data=h,f.state=0}}l=0&&a>=0){var p={data:e.subarray(u,n),type:c,state:a};o.push(p)}if(0===o.length){var g=this.getLastNalUnit();if(g){var m=new Uint8Array(g.data.byteLength+e.byteLength);m.set(g.data,0),m.set(e,g.data.byteLength),g.data=m}}return i.naluState=a,o},t.parseAACPES=function(e){var t,r,i,a,s,o=0,u=this._audioTrack,f=this.aacOverFlow,h=e.data;if(f){this.aacOverFlow=null;var p=f.sample.unit.byteLength,g=Math.min(f.missing,p),m=p-g;f.sample.unit.set(h.subarray(0,g),m),u.samples.push(f.sample),o=f.missing}for(t=o,r=h.length;t1;){var l=new Uint8Array(o[0].length+o[1].length);l.set(o[0]),l.set(o[1],o[0].length),o[0]=l,o.splice(1,1)}if(1===((t=o[0])[0]<<16)+(t[1]<<8)+t[2]){if((r=(t[4]<<8)+t[5])&&r>e.size-6)return null;var u=t[7];192&u&&(i=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&u?i-(a=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>54e5&&(c.logger.warn(Math.round((i-a)/9e4)+"s delta between PTS and DTS, align them"),i=a):a=i);var d=(n=t[8])+9;if(e.size<=d)return null;e.size-=d;for(var f=new Uint8Array(e.size),h=0,p=o.length;hg){d-=g;continue}t=t.subarray(d),g-=d,d=0}f.set(t,s),s+=g}return r&&(r-=n+3),{data:f,pts:i,dts:a,len:r}}return null}function y(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var r=t.samples,n=r.length;if(!n)return void t.dropped++;var i=r[n-1];e.pts=i.pts,e.dts=i.dts}t.samples.push(e)}e.debug.length&&c.logger.log(e.pts+"/"+e.dts+":"+e.debug)}function b(e,t){var r=e.length;if(r>0){if(t.pts>=e[r-1].pts)e.push(t);else for(var n=r-1;n>=0;n--)if(t.ptst)return n;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,r),y&&v(t,y),e}();y.defaultConfig=void 0},"./src/is-supported.ts": /*!*****************************!*\ !*** ./src/is-supported.ts ***! \*****************************/ /*! exports provided: isSupported, changeTypeSupported */function(e,t,r){"use strict";r.r(t),r.d(t,"isSupported",(function(){return a})),r.d(t,"changeTypeSupported",(function(){return s}));var n=r(/*! ./utils/mediasource-helper */"./src/utils/mediasource-helper.ts");function i(){return self.SourceBuffer||self.WebKitSourceBuffer}function a(){var e=Object(n.getMediaSource)();if(!e)return!1;var t=i(),r=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),a=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!r&&!!a}function s(){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,r){"use strict";r.r(t),r.d(t,"default",(function(){return d})),r.d(t,"LoadError",(function(){return h}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ../errors */"./src/errors.ts");function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;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,n)}function n(){return s(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,e)})(e)}function s(e,t,r){return(s=o()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&l(i,r.prototype),i}).apply(null,arguments)}function o(){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 u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var c=Math.pow(2,17),d=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 r=this,n=e.url;if(!n)return Promise.reject(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,networkDetails:null},"Fragment does not have a "+(n?"part list":"url")));this.abort();var a=this.config,s=a.fLoader,o=a.loader;return new Promise((function(n,l){r.loader&&r.loader.destroy();var u=r.loader=e.loader=s?new s(a):new o(a),d=f(e),p={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:c};e.stats=u.stats,u.load(d,p,{onSuccess:function(t,i,a,s){r.resetLoader(e,u),n({frag:e,part:null,payload:t.data,networkDetails:s})},onError:function(t,n,a){r.resetLoader(e,u),l(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:t,networkDetails:a}))},onAbort:function(t,n,a){r.resetLoader(e,u),l(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,networkDetails:a}))},onTimeout:function(t,n,a){r.resetLoader(e,u),l(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,networkDetails:a}))},onProgress:function(r,n,i,a){t&&t({frag:e,part:null,payload:i,networkDetails:a})}})}))},t.loadPart=function(e,t,r){var n=this;this.abort();var a=this.config,s=a.fLoader,o=a.loader;return new Promise((function(l,u){n.loader&&n.loader.destroy();var d=n.loader=e.loader=s?new s(a):new o(a),p=f(e,t),g={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:c};t.stats=d.stats,d.load(p,g,{onSuccess:function(i,a,s,o){n.resetLoader(e,d),n.updateStatsFromPart(e,t);var u={frag:e,part:t,payload:i.data,networkDetails:o};r(u),l(u)},onError:function(r,a,s){n.resetLoader(e,d),u(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:r,networkDetails:s}))},onAbort:function(r,a,s){e.stats.aborted=t.stats.aborted,n.resetLoader(e,d),u(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,networkDetails:s}))},onTimeout:function(r,a,s){n.resetLoader(e,d),u(new h({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,networkDetails:s}))}})}))},t.updateStatsFromPart=function(e,t){var r=e.stats,n=t.stats,i=n.total;if(r.loaded+=n.loaded,i){var a=Math.round(e.duration/t.duration),s=Math.min(Math.round(r.loaded/i),a),o=(a-s)*Math.round(r.loaded/s);r.total=r.loaded+o}else r.total=Math.max(r.loaded,r.total);var l=r.loading,u=n.loading;l.start?l.first+=u.first-u.start:(l.start=u.start,l.first=u.first),l.end=u.end},t.resetLoader=function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()},e}();function f(e,t){void 0===t&&(t=null);var r=t||e,i={frag:e,part:t,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},a=r.byteRangeStartOffset,s=r.byteRangeEndOffset;return Object(n.isFiniteNumber)(a)&&Object(n.isFiniteNumber)(s)&&(i.rangeStart=a,i.rangeEnd=s),i}var h=function(e){var t,r;function n(t){for(var r,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a>8*(15-r)&255;return t},r.setDecryptDataFromLevelKey=function(e,t){var r=e;return"AES-128"===(null==e?void 0:e.method)&&e.uri&&!e.iv&&((r=o.LevelKey.fromURI(e.uri)).method=e.method,r.iv=this.createInitializationVector(t),r.keyFormat="identity"),r},r.setElementaryStreamInfo=function(e,t,r,n,i,a){void 0===a&&(a=!1);var s=this.elementaryStreams,o=s[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,r),o.startDTS=Math.min(o.startDTS,n),o.endDTS=Math.max(o.endDTS,i)):s[e]={startPTS:t,endPTS:r,startDTS:n,endDTS:i,partial:a}},r.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[n.AUDIO]=null,e[n.VIDEO]=null,e[n.AUDIOVIDEO]=null},f(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&&s.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}(h),g=function(e){function t(t,r,n,i,a){var s;(s=e.call(this,n)||this).fragOffset=0,s.duration=0,s.gap=!1,s.independent=!1,s.relurl=void 0,s.fragment=void 0,s.index=void 0,s.stats=new l.LoadStats,s.duration=t.decimalFloatingPoint("DURATION"),s.gap=t.bool("GAP"),s.independent=t.bool("INDEPENDENT"),s.relurl=t.enumeratedString("URI"),s.fragment=r,s.index=i;var o=t.enumeratedString("BYTERANGE");return o&&s.setByteRange(o,a),a&&(s.fragOffset=a.fragOffset+a.duration),s}return u(t,e),f(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}(h)},"./src/loader/key-loader.ts": /*!**********************************!*\ !*** ./src/loader/key-loader.ts ***! \**********************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return s}));var n=r(/*! ../events */"./src/events.ts"),i=r(/*! ../errors */"./src/errors.ts"),a=r(/*! ../utils/logger */"./src/utils/logger.ts"),s=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(n.Events.KEY_LOADING,this.onKeyLoading,this)},t._unregisterListeners=function(){this.hls.off(n.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 r=t.frag,i=r.type,s=this.loaders[i];if(r.decryptdata){var o=r.decryptdata.uri;if(o!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(s&&(a.logger.warn("abort previous key loader for type:"+i),s.abort()),!o)return void a.logger.warn("key uri is falsy");var u=l.loader,c=r.loader=this.loaders[i]=new u(l);this.decrypturl=o,this.decryptkey=null;var d={url:o,frag:r,responseType:"arraybuffer"},f={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(d,f,h)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(n.Events.KEY_LOADED,{frag:r}))}else a.logger.warn("Missing decryption data on fragment in onKeyLoading")},t.loadsuccess=function(e,t,r){var i=r.frag;i.decryptdata?(this.decryptkey=i.decryptdata.key=new Uint8Array(e.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(n.Events.KEY_LOADED,{frag:i})):a.logger.error("after key load, decryptdata unset")},t.loaderror=function(e,t){var r=t.frag,a=r.loader;a&&a.abort(),delete this.loaders[r.type],this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})},t.loadtimeout=function(e,t){var r=t.frag,a=r.loader;a&&a.abort(),delete this.loaders[r.type],this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},e}()},"./src/loader/level-details.ts": /*!*************************************!*\ !*** ./src/loader/level-details.ts ***! \*************************************/ /*! exports provided: LevelDetails */function(e,t,r){"use strict";r.r(t),r.d(t,"LevelDetails",(function(){return a}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts");function i(e,t){for(var r=0;re.endSN||t>0||0===t&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay},t=e,(r=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(n.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,r),a&&i(t,a),e}()},"./src/loader/level-key.ts": /*!*********************************!*\ !*** ./src/loader/level-key.ts ***! \*********************************/ /*! exports provided: LevelKey */function(e,t,r){"use strict";r.r(t),r.d(t,"LevelKey",(function(){return a}));var n=r(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js");function i(e,t){for(var r=0;r2){var r=t.shift()+".";return r+=parseInt(t.shift()).toString(16),r+=("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,r){var n,i=[],a={},s=!1;for(d.lastIndex=0;null!=(n=d.exec(t));)if(n[1]){var o=new l.AttrList(n[1]),u={attrs:o,bitrate:o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),name:o.NAME,url:e.resolve(n[2],r)},c=o.decimalResolution("RESOLUTION");c&&(u.width=c.width,u.height=c.height),v((o.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),u),u.videoCodec&&-1!==u.videoCodec.indexOf("avc1")&&(u.videoCodec=e.convertAVC1ToAVCOTI(u.videoCodec)),i.push(u)}else if(n[3]){var f=new l.AttrList(n[3]);f["DATA-ID"]&&(s=!0,a[f["DATA-ID"]]=f)}return{levels:i,sessionData:s?a:null}},e.parseMasterPlaylistMedia=function(t,r,n,i){var a;void 0===i&&(i=[]);var s=[],o=0;for(f.lastIndex=0;null!==(a=f.exec(t));){var u=new l.AttrList(a[1]);if(u.TYPE===n){var c={attrs:u,bitrate:0,id:o++,groupId:u["GROUP-ID"],instreamId:u["INSTREAM-ID"],name:u.NAME||u.LANGUAGE||"",type:n,default:u.bool("DEFAULT"),autoselect:u.bool("AUTOSELECT"),forced:u.bool("FORCED"),lang:u.LANGUAGE,url:u.URI?e.resolve(u.URI,r):""};if(i.length){var d=e.findGroup(i,c.groupId)||i[0];y(c,d,"audioCodec"),y(c,d,"textCodec")}s.push(c)}}return s},e.parseLevelPlaylist=function(e,t,r,c,d){var f,m,v,y=new s.LevelDetails(t),E=y.fragments,x=null,S=0,T=0,k=0,w=0,C=null,L=new a.Fragment(c,t),A=-1,D=!1;for(h.lastIndex=0,y.m3u8=e;null!==(f=h.exec(e));){D&&(D=!1,(L=new a.Fragment(c,t)).start=k,L.sn=S,L.cc=w,L.level=r,x&&(L.initSegment=x,L.rawProgramDateTime=x.rawProgramDateTime));var O=f[1];if(O){L.duration=parseFloat(O);var _=(" "+f[2]).slice(1);L.title=_||null,L.tagList.push(_?["INF",O,_]:["INF",O])}else if(f[3])Object(n.isFiniteNumber)(L.duration)&&(L.start=k,v&&(L.levelkey=v),L.sn=S,L.level=r,L.cc=w,L.urlId=d,E.push(L),L.relurl=(" "+f[3]).slice(1),b(L,C),C=L,k+=L.duration,S++,T=0,D=!0);else if(f[4]){var R=(" "+f[4]).slice(1);C?L.setByteRange(R,C):L.setByteRange(R)}else if(f[5])L.rawProgramDateTime=(" "+f[5]).slice(1),L.tagList.push(["PROGRAM-DATE-TIME",L.rawProgramDateTime]),-1===A&&(A=E.length);else{if(!(f=f[0].match(p))){u.logger.warn("No matches on slow regex match for level playlist!");continue}for(m=1;m-1){u.logger.warn("Keyformat "+q+" is not supported from the manifest");continue}if("identity"!==q)continue;G&&(v=o.LevelKey.fromURL(t,W),W&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(G)>=0&&(v.method=G,v.keyFormat=q,V&&(v.keyID=V),K&&(v.keyFormatVersions=K),v.iv=z));break;case"START":var $=new l.AttrList(M).decimalFloatingPoint("TIME-OFFSET");Object(n.isFiniteNumber)($)&&(y.startTimeOffset=$);break;case"MAP":var Y=new l.AttrList(M);L.relurl=Y.URI,Y.BYTERANGE&&L.setByteRange(Y.BYTERANGE),L.level=r,L.sn="initSegment",v&&(L.levelkey=v),L.initSegment=null,x=L,D=!0;break;case"SERVER-CONTROL":var X=new l.AttrList(M);y.canBlockReload=X.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=X.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&X.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=X.optionalFloat("PART-HOLD-BACK",0),y.holdBack=X.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var Z=new l.AttrList(M);y.partTarget=Z.decimalFloatingPoint("PART-TARGET");break;case"PART":var Q=y.partList;Q||(Q=y.partList=[]);var J=T>0?Q[Q.length-1]:void 0,ee=T++,te=new a.Part(new l.AttrList(M),L,t,ee,J);Q.push(te),L.duration+=te.duration;break;case"PRELOAD-HINT":var re=new l.AttrList(M);y.preloadHint=re;break;case"RENDITION-REPORT":var ne=new l.AttrList(M);y.renditionReports=y.renditionReports||[],y.renditionReports.push(ne);break;default:u.logger.warn("line parsed but not handled: "+f)}}}C&&!C.relurl?(E.pop(),k-=C.duration,y.partList&&(y.fragmentHint=C)):y.partList&&(b(L,C),L.cc=w,y.fragmentHint=L);var ie=E.length,ae=E[0],se=E[ie-1];if((k+=y.skippedSegments*y.targetduration)>0&&ie&&se){y.averagetargetduration=k/ie;var oe=se.sn;y.endSN="initSegment"!==oe?oe:0,ae&&(y.startCC=ae.cc,ae.initSegment||y.fragments.every((function(e){return e.relurl&&(t=e.relurl,g.test(null!=(r=null===(n=i.parseURL(t))||void 0===n?void 0:n.path)?r:""));var t,r,n}))&&(u.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(L=new a.Fragment(c,t)).relurl=se.relurl,L.level=r,L.sn="initSegment",ae.initSegment=L,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(k+=y.fragmentHint.duration),y.totalduration=k,y.endCC=w,A>0&&function(e,t){for(var r=e[t],n=t;n--;){var i=e[n];if(!i)return;i.programDateTime=r.programDateTime-1e3*i.duration,r=i}}(E,A),y},e}();function v(e,t){["video","audio","text"].forEach((function(r){var n=e.filter((function(e){return Object(c.isCodecType)(e,r)}));if(n.length){var i=n.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[r+"Codec"]=i.length>0?i[0]:n[0],e=e.filter((function(e){return-1===n.indexOf(e)}))}})),t.unknownCodecs=e}function y(e,t,r){var n=t[r];n&&(e[r]=n)}function b(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Object(n.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,r){"use strict";r.r(t);var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ../events */"./src/events.ts"),a=r(/*! ../errors */"./src/errors.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),l=r(/*! ./m3u8-parser */"./src/loader/m3u8-parser.ts"),u=r(/*! ../types/loader */"./src/types/loader.ts"),c=r(/*! ../utils/attr-list */"./src/utils/attr-list.ts");function d(e,t){var r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r}var f=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,r=t.pLoader,n=t.loader,i=new(r||n)(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 r=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:u.PlaylistContextType.MANIFEST,url:r,deliveryDirectives:null})},t.onLevelLoading=function(e,t){var r=t.id,n=t.level,i=t.url,a=t.deliveryDirectives;this.load({id:r,groupId:null,level:n,responseType:"text",type:u.PlaylistContextType.LEVEL,url:i,deliveryDirectives:a})},t.onAudioTrackLoading=function(e,t){var r=t.id,n=t.groupId,i=t.url,a=t.deliveryDirectives;this.load({id:r,groupId:n,level:null,responseType:"text",type:u.PlaylistContextType.AUDIO_TRACK,url:i,deliveryDirectives:a})},t.onSubtitleTrackLoading=function(e,t){var r=t.id,n=t.groupId,i=t.url,a=t.deliveryDirectives;this.load({id:r,groupId:n,level:null,responseType:"text",type:u.PlaylistContextType.SUBTITLE_TRACK,url:i,deliveryDirectives:a})},t.load=function(e){var t,r,n,i,a,o,l=this.hls.config,c=this.getInternalLoader(e);if(c){var d=c.context;if(d&&d.url===e.url)return void s.logger.trace("[playlist-loader]: playlist request ongoing");s.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),c.abort()}switch(e.type){case u.PlaylistContextType.MANIFEST:r=l.manifestLoadingMaxRetry,n=l.manifestLoadingTimeOut,i=l.manifestLoadingRetryDelay,a=l.manifestLoadingMaxRetryTimeout;break;case u.PlaylistContextType.LEVEL:case u.PlaylistContextType.AUDIO_TRACK:case u.PlaylistContextType.SUBTITLE_TRACK:r=0,n=l.levelLoadingTimeOut;break;default:r=l.levelLoadingMaxRetry,n=l.levelLoadingTimeOut,i=l.levelLoadingRetryDelay,a=l.levelLoadingMaxRetryTimeout}if(c=this.createInternalLoader(e),null!==(t=e.deliveryDirectives)&&void 0!==t&&t.part&&(e.type===u.PlaylistContextType.LEVEL&&null!==e.level?o=this.hls.levels[e.level].details:e.type===u.PlaylistContextType.AUDIO_TRACK&&null!==e.id?o=this.hls.audioTracks[e.id].details:e.type===u.PlaylistContextType.SUBTITLE_TRACK&&null!==e.id&&(o=this.hls.subtitleTracks[e.id].details),o)){var f=o.partTarget,h=o.targetduration;f&&h&&(n=Math.min(1e3*Math.max(3*f,.8*h),n))}var p={timeout:n,maxRetry:r,retryDelay:i,maxRetryDelay:a,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(e,p,g)},t.loadsuccess=function(e,t,r,n){if(void 0===n&&(n=null),r.isSidxRequest)return this.handleSidxRequest(e,r),void this.handlePlaylistLoaded(e,t,r,n);this.resetInternalLoader(r.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,r,n):this.handleMasterPlaylist(e,t,r,n)):this.handleManifestParsingError(e,r,"no EXTM3U delimiter",n)},t.loaderror=function(e,t,r){void 0===r&&(r=null),this.handleNetworkError(t,r,!1,e)},t.loadtimeout=function(e,t,r){void 0===r&&(r=null),this.handleNetworkError(t,r,!0)},t.handleMasterPlaylist=function(e,t,r,n){var a=this.hls,o=e.data,u=d(e,r),f=l.default.parseMasterPlaylist(o,u),h=f.levels,p=f.sessionData;if(h.length){var g=h.map((function(e){return{id:e.attrs.AUDIO,audioCodec:e.audioCodec}})),m=h.map((function(e){return{id:e.attrs.SUBTITLES,textCodec:e.textCodec}})),v=l.default.parseMasterPlaylistMedia(o,u,"AUDIO",g),y=l.default.parseMasterPlaylistMedia(o,u,"SUBTITLES",m),b=l.default.parseMasterPlaylistMedia(o,u,"CLOSED-CAPTIONS");v.length&&(v.some((function(e){return!e.url}))||!h[0].audioCodec||h[0].attrs.AUDIO||(s.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 c.AttrList({}),bitrate:0,url:""}))),a.trigger(i.Events.MANIFEST_LOADED,{levels:h,audioTracks:v,subtitles:y,captions:b,url:u,stats:t,networkDetails:n,sessionData:p})}else this.handleManifestParsingError(e,r,"no level found in manifest",n)},t.handleTrackOrLevelPlaylist=function(e,t,r,s){var o=this.hls,f=r.id,h=r.level,p=r.type,g=d(e,r),m=Object(n.isFiniteNumber)(f)?f:0,v=Object(n.isFiniteNumber)(h)?h:m,y=function(e){switch(e.type){case u.PlaylistContextType.AUDIO_TRACK:return u.PlaylistLevelType.AUDIO;case u.PlaylistContextType.SUBTITLE_TRACK:return u.PlaylistLevelType.SUBTITLE;default:return u.PlaylistLevelType.MAIN}}(r),b=l.default.parseLevelPlaylist(e.data,g,v,y,m);if(b.fragments.length){if(p===u.PlaylistContextType.MANIFEST){var E={attrs:new c.AttrList({}),bitrate:0,details:b,name:"",url:g};o.trigger(i.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:g,stats:t,networkDetails:s,sessionData:null})}if(t.parsing.end=performance.now(),b.needSidxRanges){var x,S=null===(x=b.fragments[0].initSegment)||void 0===x?void 0:x.url;this.load({url:S,isSidxRequest:!0,type:p,level:h,levelDetails:b,id:f,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else r.levelDetails=b,this.handlePlaylistLoaded(e,t,r,s)}else o.trigger(i.Events.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:"number"==typeof r.level?r.level:void 0})},t.handleSidxRequest=function(e,t){var r=Object(o.parseSegmentIndex)(new Uint8Array(e.data));if(r){var n=r.references,i=t.levelDetails;n.forEach((function(e,t){var n=e.info,a=i.fragments[t];0===a.byteRange.length&&a.setByteRange(String(1+n.end-n.start)+"@"+String(n.start)),a.initSegment&&a.initSegment.setByteRange(String(r.moovEndOffset)+"@0")}))}},t.handleManifestParsingError=function(e,t,r,n){this.hls.trigger(i.Events.ERROR,{type:a.ErrorTypes.NETWORK_ERROR,details:a.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===u.PlaylistContextType.MANIFEST,url:e.url,reason:r,response:e,context:t,networkDetails:n})},t.handleNetworkError=function(e,t,r,n){void 0===r&&(r=!1),s.logger.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var o=a.ErrorDetails.UNKNOWN,l=!1,c=this.getInternalLoader(e);switch(e.type){case u.PlaylistContextType.MANIFEST:o=r?a.ErrorDetails.MANIFEST_LOAD_TIMEOUT:a.ErrorDetails.MANIFEST_LOAD_ERROR,l=!0;break;case u.PlaylistContextType.LEVEL:o=r?a.ErrorDetails.LEVEL_LOAD_TIMEOUT:a.ErrorDetails.LEVEL_LOAD_ERROR,l=!1;break;case u.PlaylistContextType.AUDIO_TRACK:o=r?a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case u.PlaylistContextType.SUBTITLE_TRACK:o=r?a.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:a.ErrorDetails.SUBTITLE_LOAD_ERROR,l=!1}c&&this.resetInternalLoader(e.type);var d={type:a.ErrorTypes.NETWORK_ERROR,details:o,fatal:l,url:e.url,loader:c,context:e,networkDetails:t};n&&(d.response=n),this.hls.trigger(i.Events.ERROR,d)},t.handlePlaylistLoaded=function(e,t,r,n){var a=r.type,s=r.level,o=r.id,l=r.groupId,c=r.loader,d=r.levelDetails,f=r.deliveryDirectives;if(null!=d&&d.targetduration){if(c)switch(d.live&&(c.getCacheAge&&(d.ageHeader=c.getCacheAge()||0),c.getCacheAge&&!isNaN(d.ageHeader)||(d.ageHeader=0)),a){case u.PlaylistContextType.MANIFEST:case u.PlaylistContextType.LEVEL:this.hls.trigger(i.Events.LEVEL_LOADED,{details:d,level:s||0,id:o||0,stats:t,networkDetails:n,deliveryDirectives:f});break;case u.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(i.Events.AUDIO_TRACK_LOADED,{details:d,id:o||0,groupId:l||"",stats:t,networkDetails:n,deliveryDirectives:f});break;case u.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(i.Events.SUBTITLE_TRACK_LOADED,{details:d,id:o||0,groupId:l||"",stats:t,networkDetails:n,deliveryDirectives:f})}}else this.handleManifestParsingError(e,r,"invalid target duration",n)},e}();t.default=f},"./src/polyfills/number.ts": /*!*********************************!*\ !*** ./src/polyfills/number.ts ***! \*********************************/ /*! exports provided: isFiniteNumber, MAX_SAFE_INTEGER */function(e,t,r){"use strict";r.r(t),r.d(t,"isFiniteNumber",(function(){return n})),r.d(t,"MAX_SAFE_INTEGER",(function(){return i}));var n=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,r){"use strict";r.r(t);var n=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=n},"./src/remux/mp4-generator.ts": /*!************************************!*\ !*** ./src/remux/mp4-generator.ts ***! \************************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t);var n=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 r=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=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:r,audio:n};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=a,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 s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,s,l,s,o),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,i))},e.box=function(e){for(var t=8,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i>24&255,o[1]=t>>16&255,o[2]=t>>8&255,o[3]=255&t,o.set(e,4),a=0,t=8;a>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,a>>24,a>>16&255,a>>8&255,255&a,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,r,n){return e.box(e.types.moof,e.mfhd(t),e.traf(n,r))},e.moov=function(t){for(var r=t.length,n=[];r--;)n[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(n).concat(e.mvex(t)))},e.mvex=function(t){for(var r=t.length,n=[];r--;)n[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(n))},e.mvhd=function(t,r){r*=t;var i=Math.floor(r/(n+1)),a=Math.floor(r%(n+1)),s=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,a>>24,a>>16&255,a>>8&255,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,s)},e.sdtp=function(t){var r,n,i=t.samples||[],a=new Uint8Array(4+i.length);for(r=0;r>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(n));for(r=0;r>>8&255),s.push(255&i),s=s.concat(Array.prototype.slice.call(n));var o=e.box(e.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|t.sps.length].concat(a).concat([t.pps.length]).concat(s))),l=t.width,u=t.height,c=t.pixelRatio[0],d=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,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,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([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))},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 r=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,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var r=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,r>>8&255,255&r,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 r=t.id,i=t.duration*t.timescale,a=t.width,s=t.height,o=Math.floor(i/(n+1)),l=Math.floor(i%(n+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,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,s>>8&255,255&s,0,0]))},e.traf=function(t,r){var i=e.sdtp(t),a=t.id,s=Math.floor(r/(n+1)),o=Math.floor(r%(n+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o])),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 r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,r){var n,i,a,s,o,l,u=t.samples||[],c=u.length,d=12+16*c,f=new Uint8Array(d);for(r+=8+d,f.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),n=0;n>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*n);return e.box(e.types.trun,f)},e.initSegment=function(t){e.types||e.init();var r=e.moov(t),n=new Uint8Array(e.FTYP.byteLength+r.byteLength);return n.set(e.FTYP),n.set(r,e.FTYP.byteLength),n},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,r){"use strict";r.r(t),r.d(t,"default",(function(){return g})),r.d(t,"normalizePts",(function(){return m}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ./aac-helper */"./src/remux/aac-helper.ts"),a=r(/*! ./mp4-generator */"./src/remux/mp4-generator.ts"),s=r(/*! ../events */"./src/events.ts"),o=r(/*! ../errors */"./src/errors.ts"),l=r(/*! ../utils/logger */"./src/utils/logger.ts"),u=r(/*! ../types/loader */"./src/types/loader.ts"),c=r(/*! ../utils/timescale-conversion */"./src/utils/timescale-conversion.ts");function d(){return(d=Object.assign||function(e){for(var t=1;t0?e:r.pts}),e[0].pts);return t&&l.logger.debug("PTS rollover detected"),r},t.remux=function(e,t,r,n,i,a,s,o){var c,d,f,h,p,g,v=i,y=i,b=e.pid>-1,E=t.pid>-1,x=t.samples.length,S=e.samples.length>0,T=x>1;if((!b||S)&&(!E||T)||this.ISGenerated||s){this.ISGenerated||(f=this.generateIS(e,t,i));var k=this.isVideoContiguous,w=-1;if(T&&(w=function(e){for(var t=0;t0){l.logger.warn("[mp4-remuxer]: Dropped "+w+" out of "+x+" video samples due to a missing keyframe");var C=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(w),t.dropped+=w,y+=(t.samples[0].pts-C)/(t.timescale||9e4)}else-1===w&&(l.logger.warn("[mp4-remuxer]: No keyframe found out of "+x+" video samples"),g=!1);if(this.ISGenerated){if(S&&T){var L=this.getVideoStartPts(t.samples),A=(m(e.samples[0].pts,L)-L)/t.inputTimeScale;v+=Math.max(0,A),y+=Math.max(0,-A)}if(S){if(e.samplerate||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),f=this.generateIS(e,t,i)),d=this.remuxAudio(e,v,this.isAudioContiguous,a,E||T||o===u.PlaylistLevelType.AUDIO?y:void 0),T){var D=d?d.endPTS-d.startPTS:0;t.inputTimeScale||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),f=this.generateIS(e,t,i)),c=this.remuxVideo(t,y,k,D)}}else T&&(c=this.remuxVideo(t,y,k,0));c&&(c.firstKeyFrame=w,c.independent=-1!==w)}}return this.ISGenerated&&(r.samples.length&&(p=this.remuxID3(r,i)),n.samples.length&&(h=this.remuxText(n,i))),{audio:d,video:c,initSegment:f,independent:g,text:h,id3:p}},t.generateIS=function(e,t,r){var i,s,o,l=e.samples,u=t.samples,c=this.typeSupported,d={},f=!Object(n.isFiniteNumber)(this._initPTS),h="audio/mp4";if(f&&(i=s=1/0),e.config&&l.length&&(e.timescale=e.samplerate,e.isAAC||(c.mpeg?(h="audio/mpeg",e.codec=""):c.mp3&&(e.codec="mp3")),d.audio={id:"audio",container:h,codec:e.codec,initSegment:!e.isAAC&&c.mpeg?new Uint8Array(0):a.default.initSegment([e]),metadata:{channelCount:e.channelCount}},f&&(o=e.inputTimeScale,i=s=l[0].pts-Math.round(o*r))),t.sps&&t.pps&&u.length&&(t.timescale=t.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:a.default.initSegment([t]),metadata:{width:t.width,height:t.height}},f)){o=t.inputTimeScale;var p=this.getVideoStartPts(u),g=Math.round(o*r);s=Math.min(s,m(u[0].dts,p)-g),i=Math.min(i,p-g)}if(Object.keys(d).length)return this.ISGenerated=!0,f&&(this._initPTS=i,this._initDTS=s),{tracks:d,initPTS:i,timescale:o}},t.remuxVideo=function(e,t,r,n){var i,u,h,g=e.inputTimeScale,y=e.samples,b=[],E=y.length,x=this._initPTS,S=this.nextAvcDts,T=8,k=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY,C=0,L=!1;r&&null!==S||(S=t*g-(y[0].pts-m(y[0].dts,y[0].pts)));for(var A=0;AD.pts&&(C=Math.max(Math.min(C,D.pts-D.dts),-18e3)),D.dts0?A-1:A].dts&&(L=!0)}L&&y.sort((function(e,t){var r=e.dts-t.dts,n=e.pts-t.pts;return r||n})),u=y[0].dts,h=y[y.length-1].dts;var O=Math.round((h-u)/(E-1));if(C<0){if(C<-2*O){l.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(c.toMsFromMpegTsClock)(-O,!0)+" ms");for(var _=C,R=0;RO;if(F||M<-1){F?l.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(M,!0)+" ms ("+M+"dts) hole between fragments detected, filling it"):l.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(-M,!0)+" ms ("+M+"dts) overlapping between fragments detected"),u=S;var P=y[0].pts-M;y[0].dts=u,y[0].pts=P,l.logger.log("Video: First PTS/DTS adjusted: "+Object(c.toMsFromMpegTsClock)(P,!0)+"/"+Object(c.toMsFromMpegTsClock)(u,!0)+", delta: "+Object(c.toMsFromMpegTsClock)(M,!0)+" ms")}}p&&(u=Math.max(0,u));for(var N=0,B=0,j=0;j0?$-1:$].dts;if(ne.stretchShortVideoTrack&&null!==this.nextAudioPts){var ae=Math.floor(ne.maxBufferHole*g),se=(n?k+n*g:this.nextAudioPts)-Y.pts;se>ae?((i=se-ie)<0&&(i=ie),l.logger.log("[mp4-remuxer]: It is approximately "+se/90+" ms to the next segment; using duration "+i/90+" ms for the last video frame.")):i=ie}else i=ie}var oe=Math.round(Y.pts-Y.dts);b.push(new v(Y.key,i,Z,oe))}if(b.length&&f&&f<70){var le=b[0].flags;le.dependsOn=2,le.isNonSync=0}console.assert(void 0!==i,"mp4SampleDuration must be computed"),this.nextAvcDts=S=h+i,this.isVideoContiguous=!0;var ue={data1:a.default.moof(e.sequenceNumber++,u,d({},e,{samples:b})),data2:K,startPTS:k/g,endPTS:(w+i)/g,startDTS:u/g,endDTS:S/g,type:"video",hasAudio:!1,hasVideo:!0,nb:b.length,dropped:e.dropped};return e.samples=[],e.dropped=0,console.assert(K.length,"MDAT length must not be zero"),ue},t.remuxAudio=function(e,t,r,n,u){var c=e.inputTimeScale,f=c/(e.samplerate?e.samplerate:c),h=e.isAAC?1024:1152,p=h*f,g=this._initPTS,y=!e.isAAC&&this.typeSupported.mpeg,b=[],E=e.samples,x=y?0:8,S=this.nextAudioPts||-1,T=t*c;if(this.isAudioContiguous=r=r||E.length&&S>0&&(n&&Math.abs(T-S)<9e3||Math.abs(m(E[0].pts-g,T)-S)<20*p),E.forEach((function(e){e.pts=m(e.pts-g,T)})),!r||S<0){if(!(E=E.filter((function(e){return e.pts>=0}))).length)return;S=0===u?0:n?Math.max(0,T):E[0].pts}if(e.isAAC)for(var k=void 0!==u,w=this.config.maxAudioFramesDrift,C=0,L=S;C=w*p&&_<1e4&&k){var R=Math.round(O/p);(L=D-R*p)<0&&(R--,L+=p),0===C&&(this.nextAudioPts=S=L),l.logger.warn("[mp4-remuxer]: Injecting "+R+" audio frame @ "+(L/c).toFixed(3)+"s due to "+Math.round(1e3*O/c)+" ms gap.");for(var I=0;I0))return;j+=x;try{P=new Uint8Array(j)}catch(e){return void this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:o.ErrorTypes.MUX_ERROR,details:o.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:j,reason:"fail allocating audio mdat "+j})}y||(new DataView(P.buffer).setUint32(0,j),P.set(a.default.types.mdat,4))}P.set(z,x);var V=z.byteLength;x+=V,b.push(new v(!0,h,V,0)),B=K}var q=b.length;if(q){var $=b[b.length-1];this.nextAudioPts=S=B+f*$.duration;var Y=y?new Uint8Array(0):a.default.moof(e.sequenceNumber++,N/f,d({},e,{samples:b}));e.samples=[];var X=N/c,Z=S/c,Q={data1:Y,data2:P,startPTS:X,endPTS:Z,startDTS:X,endDTS:Z,type:"audio",hasAudio:!0,hasVideo:!1,nb:q};return this.isAudioContiguous=!0,console.assert(P.length,"MDAT length must not be zero"),Q}},t.remuxEmptyAudio=function(e,t,r,n){var a=e.inputTimeScale,s=a/(e.samplerate?e.samplerate:a),o=this.nextAudioPts,u=(null!==o?o:n.startDTS*a)+this._initDTS,c=n.endDTS*a+this._initDTS,d=1024*s,f=Math.ceil((c-u)/d),h=i.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(l.logger.warn("[mp4-remuxer]: remux empty Audio"),h){for(var p=[],g=0;g4294967296;)e+=r;return e}var v=function(e,t,r,n){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=r,this.cts=n,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,r){"use strict";r.r(t);var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),a=r(/*! ../loader/fragment */"./src/loader/fragment.ts"),s=r(/*! ../utils/logger */"./src/utils/logger.ts"),o=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,r){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(e),this.emitInitSegment=!0},t.generateInitSegment=function(e){var t=this.audioCodec,r=this.videoCodec;if(!e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var n=this.initData=Object(i.parseInitSegment)(e);t||(t=u(n.audio,a.ElementaryStreamTypes.AUDIO)),r||(r=u(n.video,a.ElementaryStreamTypes.VIDEO));var o={};n.audio&&n.video?o.audiovideo={container:"video/mp4",codec:t+","+r,initSegment:e,id:"main"}:n.audio?o.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:n.video?o.video={container:"video/mp4",codec:r,initSegment:e,id:"main"}:s.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},t.remux=function(e,t,r,a,o){var u=this.initPTS,c=this.lastEndDTS,d={audio:void 0,video:void 0,text:a,id3:r,initSegment:void 0};Object(n.isFiniteNumber)(c)||(c=this.lastEndDTS=o||0);var f=t.samples;if(!f||!f.length)return d;var h={initPTS:void 0,timescale:1},p=this.initData;if(p&&p.length||(this.generateInitSegment(f),p=this.initData),!p||!p.length)return s.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1),Object(n.isFiniteNumber)(u)||(this.initPTS=h.initPTS=u=l(p,f,c));var g=Object(i.getDuration)(f,p),m=c,v=g+m;Object(i.offsetStartDTS)(p,f,u),g>0?this.lastEndDTS=v:(s.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var y=!!p.audio,b=!!p.video,E="";y&&(E+="audio"),b&&(E+="video");var x={data1:f,startPTS:m,startDTS:m,endPTS:v,endDTS:v,type:E,hasAudio:y,hasVideo:b,nb:1,dropped:0};return d.audio="audio"===x.type?x:void 0,d.video="audio"!==x.type?x:void 0,d.text=a,d.id3=r,d.initSegment=h,d},e}(),l=function(e,t,r){return Object(i.getStartDTS)(e,t)-r};function u(e,t){var r=null==e?void 0:e.codec;return r&&r.length>4?r:"hvc1"===r?"hvc1.1.c.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||t===a.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}t.default=o},"./src/task-loop.ts": /*!**************************!*\ !*** ./src/task-loop.ts ***! \**************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return n}));var n=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,r){"use strict";r.r(t),r.d(t,"CMCDVersion",(function(){return s})),r.d(t,"CMCDObjectType",(function(){return n})),r.d(t,"CMCDStreamingFormat",(function(){return i})),r.d(t,"CMCDStreamType",(function(){return a}));var n,i,a,s=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"}(n||(n={})),function(e){e.DASH="d",e.HLS="h",e.SMOOTH="s",e.OTHER="o"}(i||(i={})),function(e){e.VOD="v",e.LIVE="l"}(a||(a={}))},"./src/types/level.ts": /*!****************************!*\ !*** ./src/types/level.ts ***! \****************************/ /*! exports provided: HlsSkip, getSkipValue, HlsUrlParameters, Level */function(e,t,r){"use strict";function n(e,t){for(var r=0;rNumber.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 r=new Uint8Array(t.length/2),n=0;nNumber.MAX_SAFE_INTEGER?1/0:t},t.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.optionalFloat=function(e,t){var r=this[e];return r?parseFloat(r):t},t.enumeratedString=function(e){return this[e]},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){var t=n.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(e){var t,r={};for(i.lastIndex=0;null!==(t=i.exec(e));){var n=t[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[t[1]]=n}return r},e}()},"./src/utils/binary-search.ts": /*!************************************!*\ !*** ./src/utils/binary-search.ts ***! \************************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t),t.default={search:function(e,t){for(var r=0,n=e.length-1,i=null,a=null;r<=n;){var s=t(a=e[i=(r+n)/2|0]);if(s>0)r=i+1;else{if(!(s<0))return a;n=i-1}}return null}}},"./src/utils/buffer-helper.ts": /*!************************************!*\ !*** ./src/utils/buffer-helper.ts ***! \************************************/ /*! exports provided: BufferHelper */function(e,t,r){"use strict";r.r(t),r.d(t,"BufferHelper",(function(){return a}));var n=r(/*! ./logger */"./src/utils/logger.ts"),i={length:0,start:function(){return 0},end:function(){return 0}},a=function(){function e(){}return e.isBuffered=function(t,r){try{if(t)for(var n=e.getBuffered(t),i=0;i=n.start(i)&&r<=n.end(i))return!0}catch(e){}return!1},e.bufferInfo=function(t,r,n){try{if(t){var i,a=e.getBuffered(t),s=[];for(i=0;is&&(n[a-1].end=e[i].end):n.push(e[i])}else n.push(e[i])}else n=e;for(var o,l=0,u=t,c=t,d=0;d=f&&t=e&&i.logger.log(this.time+" ["+e+"] "+t)},e}(),h=function(e){for(var t=[],r=0;r100&&(this.logger.log(n.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},t.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var r=this.pos+1;r=144&&this.backSpace();var t=s(e);this.pos>=100?this.logger.log(n.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,r=0;r<100;r++){var n=this.chars[r].uchar;" "!==n&&(t=!1),e.push(n)}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 m(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,r=0;r<15;r++)if(!this.rows[r].equals(e.rows[r])){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(n.INFO,"setCursor: "+e),this.rows[this.currRow].setCursor(e)},t.setPAC=function(e){this.logger.log(n.INFO,"pacData = "+JSON.stringify(e));var t=e.row-1;if(this.nrRollUpRows&&t0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r},t.getTextAndFormat=function(){return this.rows},e}(),y=function(){function e(e,t,r){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(r),this.nonDisplayedMemory=new v(r),this.lastOutputScreen=new v(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}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(n.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=46,t.italics)t.foreground="white";else{var r=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}this.logger.log(n.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,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var n=new f;this.channels=[null,new y(e,t,n),new y(e+1,r,n)],this.cmdHistory={a:null,b:null},this.logger=n}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 r,i,a,s=!1;this.logger.time=e;for(var o=0;o ("+h([i,a])+")"),(r=this.parseCmd(i,a))||(r=this.parseMidrow(i,a)),r||(r=this.parsePAC(i,a)),r||(r=this.parseBackgroundAttributes(i,a)),!r&&(s=this.parseChars(i,a))){var l=this.currentChannel;l&&l>0?this.channels[l].insertChars(s):this.logger.log(n.WARNING,"No channel found yet. TEXT-MODE?")}r||s||this.logger.log(n.WARNING,"Couldn't parse cleaned data "+h([i,a])+" orig: "+h([t[o],t[o+1]]))}},t.parseCmd=function(e,t){var r=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(x(e,t,r))return E(null,null,r),this.logger.log(n.DEBUG,"Repeated command ("+h([e,t])+") is dropped"),!0;var i=20===e||21===e||23===e?1:2,a=this.channels[i];return 20===e||21===e||28===e||29===e?32===t?a.ccRCL():33===t?a.ccBS():34===t?a.ccAOF():35===t?a.ccAON():36===t?a.ccDER():37===t?a.ccRU(2):38===t?a.ccRU(3):39===t?a.ccRU(4):40===t?a.ccFON():41===t?a.ccRDC():42===t?a.ccTR():43===t?a.ccRTD():44===t?a.ccEDM():45===t?a.ccCR():46===t?a.ccENM():47===t&&a.ccEOC():a.ccTO(t-32),E(e,t,r),this.currentChannel=i,!0},t.parseMidrow=function(e,t){var r=0;if((17===e||25===e)&&t>=32&&t<=47){if((r=17===e?1:2)!==this.currentChannel)return this.logger.log(n.ERROR,"Mismatch channel in midrow parsing"),!1;var i=this.channels[r];return!!i&&(i.ccMIDROW(t),this.logger.log(n.DEBUG,"MIDROW ("+h([e,t])+")"),!0)}return!1},t.parsePAC=function(e,t){var r,n=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(x(e,t,n))return E(null,null,n),!0;var i=e<=23?1:2;r=t>=64&&t<=95?1===i?o[e]:u[e]:1===i?l[e]:c[e];var a=this.channels[i];return!!a&&(a.setPAC(this.interpretPAC(r,t)),E(e,t,n),this.currentChannel=i,!0)},t.interpretPAC=function(e,t){var r,n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=1==(1&r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n},t.parseChars=function(e,t){var r,i,a=null,o=null;if(e>=25?(r=2,o=e-8):(r=1,o=e),o>=17&&o<=19?(i=17===o?t+80:18===o?t+112:t+144,this.logger.log(n.INFO,"Special char '"+s(i)+"' in channel "+r),a=[i]):e>=32&&e<=127&&(a=0===t?[e]:[e,t]),a){var l=h(a);this.logger.log(n.DEBUG,"Char codes = "+l.join(",")),E(e,t,this.cmdHistory)}return a},t.parseBackgroundAttributes=function(e,t){var r;if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;var n={};16===e||24===e?(r=Math.floor((t-32)/2),n.background=d[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0));var i=e<=23?1:2;return this.channels[i].setBkgData(n),E(e,t,this.cmdHistory),!0},t.reset=function(){for(var e=0;e=16?d--:d++;var v=Object(n.fixLineBreaks)(f.trim()),y=Object(i.generateCueId)(t,r,v);e&&e.cues&&e.cues.getCueById(y)||((u=new p(t,r,v)).id=y,u.line=g+1,u.align="left",u.position=10+Math.min(80,10*Math.floor(8*d/32)),h.push(u))}return e&&h.length&&(h.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})),h.forEach((function(t){return Object(a.addCueToTrack)(e,t)}))),h}};t.default=o},"./src/utils/discontinuities.ts": /*!**************************************!*\ !*** ./src/utils/discontinuities.ts ***! \**************************************/ /*! exports provided: findFirstFragWithCC, shouldAlignOnDiscontinuities, findDiscontinuousReferenceFrag, adjustSlidingStart, alignStream, alignPDT, alignFragmentByPDTDelta, alignMediaPlaylistByPDT */function(e,t,r){"use strict";r.r(t),r.d(t,"findFirstFragWithCC",(function(){return s})),r.d(t,"shouldAlignOnDiscontinuities",(function(){return o})),r.d(t,"findDiscontinuousReferenceFrag",(function(){return l})),r.d(t,"adjustSlidingStart",(function(){return c})),r.d(t,"alignStream",(function(){return d})),r.d(t,"alignPDT",(function(){return f})),r.d(t,"alignFragmentByPDTDelta",(function(){return h})),r.d(t,"alignMediaPlaylistByPDT",(function(){return p}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ./logger */"./src/utils/logger.ts"),a=r(/*! ../controller/level-helper */"./src/controller/level-helper.ts");function s(e,t){for(var r=null,n=0,i=e.length;nr.startCC||e&&e.cc=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,r){"use strict";r.r(t);var n=function(){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=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_=r}var t=e.prototype;return t.sample=function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*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=n},"./src/utils/fetch-loader.ts": /*!***********************************!*\ !*** ./src/utils/fetch-loader.ts ***! \***********************************/ /*! exports provided: fetchSupported, default */function(e,t,r){"use strict";r.r(t),r.d(t,"fetchSupported",(function(){return f}));var n=r(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),i=r(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),a=r(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts");function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;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,n)}function n(){return o(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)})(e)}function o(e,t,r){return(o=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&u(i,r.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 u(e,t){return(u=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)}function d(){return(d=Object.assign||function(e){for(var t=1;t=n&&i(t,r,s.flush(),e)):i(t,r,l,e),a()})).catch((function(){return Promise.reject()}))}()},e}();function p(e,t){return new self.Request(e.url,t)}var g=function(e){var t,r;function n(t,r,n){var i;return(i=e.call(this,t)||this).code=void 0,i.details=void 0,i.code=r,i.details=n,i}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,u(t,r),n}(s(Error));t.default=h},"./src/utils/imsc1-ttml-parser.ts": /*!****************************************!*\ !*** ./src/utils/imsc1-ttml-parser.ts ***! \****************************************/ /*! exports provided: IMSC1_CODEC, parseIMSC1 */function(e,t,r){"use strict";r.r(t),r.d(t,"IMSC1_CODEC",(function(){return c})),r.d(t,"parseIMSC1",(function(){return p}));var n=r(/*! ./mp4-tools */"./src/utils/mp4-tools.ts"),i=r(/*! ./vttparser */"./src/utils/vttparser.ts"),a=r(/*! ./vttcue */"./src/utils/vttcue.ts"),s=r(/*! ../demux/id3 */"./src/demux/id3.ts"),o=r(/*! ./timescale-conversion */"./src/utils/timescale-conversion.ts"),l=r(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts");function u(){return(u=Object.assign||function(e){for(var t=1;t"):n}function o(e){if(self.console&&!0===e||"object"==typeof e){!function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function d(e,t){var r,n,i,a=[];if(!t.length)return a;"data"in e?(r=e.data,n=e.start,i=e.end):(n=0,i=(r=e).byteLength);for(var l=n;l1?l+c:i;if(o(r.subarray(l+4,l+8))===t[0])if(1===t.length)a.push({data:r,start:l+8,end:f});else{var h=d({data:r,start:l+8,end:f},t.slice(1));h.length&&s.apply(a,h)}l=f}return a}function f(e){var t=d(e,["moov"])[0],r=t?t.end:null,n=d(e,["sidx"]);if(!n||!n[0])return null;var i=[],a=n[0],s=a.data[0],o=0===s?8:16,c=u(a,o);o+=4,o+=0===s?8:16,o+=2;var f=a.end+0,h=l(a,o);o+=2;for(var p=0;p>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var y=u(a,g);g+=4,i.push({referenceSize:v,subsegmentDuration:y,info:{duration:y/c,start:f,end:f+v-1}}),f+=v,o=g+=4}return{earliestPresentationTime:0,timescale:c,version:s,referencesCount:h,references:i,moovEndOffset:r}}function h(e){for(var t=[],r=d(e,["moov","trak"]),n=0;ne)&&(this.startTime=e),this.endTime=t,this.screen=r,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,r){"use strict";r.r(t),r.d(t,"sendAddTrackEvent",(function(){return i})),r.d(t,"addCueToTrack",(function(){return a})),r.d(t,"clearCurrentCues",(function(){return s})),r.d(t,"removeCuesInRange",(function(){return o})),r.d(t,"getCuesInRange",(function(){return l}));var n=r(/*! ./logger */"./src/utils/logger.ts");function i(e,t){var r;try{r=new Event("addtrack")}catch(e){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function a(e,t){var r=e.mode;if("disabled"===r&&(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(r){n.logger.debug("[texttrack-utils]: "+r);var i=new self.TextTrackCue(t.startTime,t.endTime,t.text);i.id=t.id,e.addCue(i)}"disabled"===r&&(e.mode=r)}function s(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var r=e.cues.length;r--;)e.removeCue(e.cues[r]);"disabled"===t&&(e.mode=t)}function o(e,t,r){var n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var i=l(e.cues,t,r),a=0;ae[r].endTime)return-1;for(var n=0,i=r;n<=i;){var a=Math.floor((i+n)/2);if(te[a].startTime&&n-1)for(var a=i,s=e.length;a=t&&o.endTime<=r)n.push(o);else if(o.startTime>r)return n}return n}},"./src/utils/time-ranges.ts": /*!**********************************!*\ !*** ./src/utils/time-ranges.ts ***! \**********************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t),t.default={toString:function(e){for(var t="",r=e.length,n=0;n1?t-1:0),n=1;n100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",i({},l,{get:function(){return E},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",i({},l,{get:function(){return x},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");x=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",i({},l,{get:function(){return S},set:function(e){var t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");S=t,this.hasBeenReset=!0}})),o.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}()},"./src/utils/vttparser.ts": /*!********************************!*\ !*** ./src/utils/vttparser.ts ***! \********************************/ /*! exports provided: parseTimeStamp, fixLineBreaks, VTTParser */function(e,t,r){"use strict";r.r(t),r.d(t,"parseTimeStamp",(function(){return a})),r.d(t,"fixLineBreaks",(function(){return d})),r.d(t,"VTTParser",(function(){return f}));var n=r(/*! ./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 a(e){function t(e,t,r,n){return 3600*(0|e)+60*(0|t)+(0|r)+parseFloat(n||0)}var r=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?t(r[2],r[3],0,r[4]):t(r[1],r[2],r[3],r[4]):null}var s=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,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t},t.has=function(e){return e in this.values},t.alt=function(e,t,r){for(var n=0;n=0&&r<=100)return this.set(e,r),!0}return!1},e}();function o(e,t,r,n){var i=n?e.split(n):[e];for(var a in i)if("string"==typeof i[a]){var s=i[a].split(r);2===s.length&&t(s[0],s[1])}}var l=new n.default(0,0,""),u="middle"===l.align?"middle":"center";function c(e,t,r){var n=e;function i(){var t=a(e);if(null===t)throw new Error("Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function c(){e=e.replace(/^\s+/,"")}if(c(),t.startTime=i(),c(),"--\x3e"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),c(),t.endTime=i(),c(),function(e,t){var n=new s;o(e,(function(e,t){var i;switch(e){case"region":for(var a=r.length-1;a>=0;a--)if(r[a].id===t){n.set(e,r[a].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":i=t.split(","),n.integer(e,i[0]),n.percent(e,i[0])&&n.set("snapToLines",!1),n.alt(e,i[0],["auto"]),2===i.length&&n.alt("lineAlign",i[1],["start",u,"end"]);break;case"position":i=t.split(","),n.percent(e,i[0]),2===i.length&&n.alt("positionAlign",i[1],["start",u,"end","line-left","line-right","auto"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start",u,"end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");var i=n.get("line","auto");"auto"===i&&-1===l.line&&(i=-1),t.line=i,t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align",u);var a=n.get("position","auto");"auto"===a&&50===l.position&&(a="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=a}(e,t)}function d(e){return e.replace(//gi,"\n")}var f=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 r(){var e=t.buffer,r=0;for(e=d(e);r>>0).toString()};function d(e,t,r){return c(e.toString())+c(t.toString())+c(r)}function f(e,t,r,c,f,h,p,g){var m,v=new i.VTTParser,y=Object(a.utf8ArrayToStr)(new Uint8Array(e)).trim().replace(l,"\n").split("\n"),b=[],E=Object(s.toMpegTsClockFromTimescale)(t,r),x="00:00.000",S=0,T=0,k=!0,w=!1;v.oncue=function(e){var t=c[f],r=c.ccOffset,n=(S-E)/9e4;if(null!=t&&t.new&&(void 0!==T?r=c.ccOffset=t.start:function(e,t,r){var n=e[t],i=e[n.prevCC];if(!i||!i.new&&n.new)return e.ccOffset=e.presentationOffset=n.start,void(n.new=!1);for(;null!==(a=i)&&void 0!==a&&a.new;){var a;e.ccOffset+=n.start-i.start,n.new=!1,i=e[(n=i).prevCC]}e.presentationOffset=r}(c,f,n)),n&&(r=n-c.presentationOffset),w){var i=e.endTime-e.startTime,a=Object(o.normalizePts)(9e4*(e.startTime+r-T),9e4*h)/9e4;e.startTime=a,e.endTime=a+i}var s=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(s)),e.id||(e.id=d(e.startTime,e.endTime,s)),e.endTime>0&&b.push(e)},v.onparsingerror=function(e){m=e},v.onflush=function(){m?g(m):p(b)},y.forEach((function(e){if(k){if(u(e,"X-TIMESTAMP-MAP=")){k=!1,w=!0,e.substr(16).split(",").forEach((function(e){u(e,"LOCAL:")?x=e.substr(6):u(e,"MPEGTS:")&&(S=parseInt(e.substr(7)))}));try{T=function(e){var t=parseInt(e.substr(-3)),r=parseInt(e.substr(-6,2)),i=parseInt(e.substr(-9,2)),a=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;if(!(Object(n.isFiniteNumber)(t)&&Object(n.isFiniteNumber)(r)&&Object(n.isFiniteNumber)(i)&&Object(n.isFiniteNumber)(a)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*r,t+=6e4*i,t+=36e5*a}(x)/1e3}catch(e){w=!1,m=e}return}""===e&&(k=!1)}v.parse(e+"\n")})),v.flush()}},"./src/utils/xhr-loader.ts": /*!*********************************!*\ !*** ./src/utils/xhr-loader.ts ***! \*********************************/ /*! exports provided: default */function(e,t,r){"use strict";r.r(t);var n=r(/*! ../utils/logger */"./src/utils/logger.ts"),i=r(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),a=/^age:\s*[\d.]+\s*$/m,s=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,r){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=r,this.retryDelay=t.retryDelay,this.loadInternal()},t.loadInternal=function(){var e=this.config,t=this.context;if(e){var r=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;var i=this.xhrSetup;try{if(i)try{i(r,t.url)}catch(e){r.open("GET",t.url,!0),i(r,t.url)}r.readyState||r.open("GET",t.url,!0);var a=this.context.headers;if(a)for(var s in a)r.setRequestHeader(s,a[s])}catch(e){return void this.callbacks.onError({code:r.status,text:e.message},t,r)}t.rangeEnd&&r.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),r.onreadystatechange=this.readystatechange.bind(this),r.onprogress=this.loadprogress.bind(this),r.responseType=t.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),e.timeout),r.send()}},t.readystatechange=function(){var e=this.context,t=this.loader,r=this.stats;if(e&&t){var i=t.readyState,a=this.config;if(!r.aborted&&i>=2)if(self.clearTimeout(this.requestTimeout),0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),4===i){t.onreadystatechange=null,t.onprogress=null;var s=t.status;if(s>=200&&s<300){var o,l;if(r.loading.end=Math.max(self.performance.now(),r.loading.first),l="arraybuffer"===e.responseType?(o=t.response).byteLength:(o=t.responseText).length,r.loaded=r.total=l,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(r,e,o,t),!this.callbacks)return;var c={url:t.responseURL,data:o};this.callbacks.onSuccess(c,r,e,t)}else r.retry>=a.maxRetry||s>=400&&s<499?(n.logger.error(s+" while loading "+e.url),this.callbacks.onError({code:s,text:t.statusText},e,t)):(n.logger.warn(s+" 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,a.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)}},t.loadtimeout=function(){n.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&&a.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e},e}();t.default=s}}).default},e.exports=n())},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,r){e.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);