You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
361 lines
1.1 MiB
361 lines
1.1 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[244,7,9,14],{"+NIl":function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";ae.defineMode("stex",function(X,M){"use strict";function K(O,A){O.cmdState.push(A)}function D(O){return O.cmdState.length>0?O.cmdState[O.cmdState.length-1]:null}function P(O){var A=O.cmdState.pop();A&&A.closeBracket()}function H(O){for(var A=O.cmdState,x=A.length-1;x>=0;x--){var d=A[x];if(d.name=="DEFAULT")continue;return d}return{styleIdentifier:function(){return null}}}function W(O,A,x){return function(){this.name=O,this.bracketNo=0,this.style=A,this.styles=x,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var _={};_.importmodule=W("importmodule","tag",["string","builtin"]),_.documentclass=W("documentclass","tag",["","atom"]),_.usepackage=W("usepackage","tag",["atom"]),_.begin=W("begin","tag",["atom"]),_.end=W("end","tag",["atom"]),_.label=W("label","tag",["atom"]),_.ref=W("ref","tag",["atom"]),_.eqref=W("eqref","tag",["atom"]),_.cite=W("cite","tag",["atom"]),_.bibitem=W("bibitem","tag",["atom"]),_.Bibitem=W("Bibitem","tag",["atom"]),_.RBibitem=W("RBibitem","tag",["atom"]),_.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(O,A){O.f=A}function y(O,A){var x;if(O.match(/^\\[a-zA-Z@]+/)){var d=O.current().slice(1);return x=_.hasOwnProperty(d)?_[d]:_.DEFAULT,x=new x,K(A,x),L(A,k),x.style}if(O.match(/^\\[$&%#{}_]/))return"tag";if(O.match(/^\\[,;!\/\\]/))return"tag";if(O.match("\\["))return L(A,function(l,s){return C(l,s,"\\]")}),"keyword";if(O.match("\\("))return L(A,function(l,s){return C(l,s,"\\)")}),"keyword";if(O.match("$$"))return L(A,function(l,s){return C(l,s,"$$")}),"keyword";if(O.match("$"))return L(A,function(l,s){return C(l,s,"$")}),"keyword";var a=O.next();if(a=="%")return O.skipToEnd(),"comment";if(a=="}"||a=="]"){if(x=D(A),x)x.closeBracket(a),L(A,k);else return"error";return"bracket"}else return a=="{"||a=="["?(x=_.DEFAULT,x=new x,K(A,x),"bracket"):/\d/.test(a)?(O.eatWhile(/[\w.%]/),"atom"):(O.eatWhile(/[\w\-_]/),x=H(A),x.name=="begin"&&(x.argument=O.current()),x.styleIdentifier())}function C(O,A,x){if(O.eatSpace())return null;if(x&&O.match(x))return L(A,y),"keyword";if(O.match(/^\\[a-zA-Z@]+/))return"tag";if(O.match(/^[a-zA-Z]+/))return"variable-2";if(O.match(/^\\[$&%#{}_]/))return"tag";if(O.match(/^\\[,;!\/]/))return"tag";if(O.match(/^[\^_&]/))return"tag";if(O.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(O.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var d=O.next();return d=="{"||d=="}"||d=="["||d=="]"||d=="("||d==")"?"bracket":d=="%"?(O.skipToEnd(),"comment"):"error"}function k(O,A){var x=O.peek(),d;return x=="{"||x=="["?(d=D(A),d.openBracket(x),O.eat(x),L(A,y),"bracket"):/[ \t\r]/.test(x)?(O.eat(x),null):(L(A,y),P(A),y(O,A))}return{startState:function(){var O=M.inMathMode?function(A,x){return C(A,x)}:y;return{cmdState:[],f:O}},copyState:function(O){return{cmdState:O.cmdState.slice(),f:O.f}},token:function(O,A){return A.f(O,A)},blankLine:function(O){O.f=y,O.cmdState.length=0},lineComment:"%"}}),ae.defineMIME("text/x-stex","stex"),ae.defineMIME("text/x-latex","stex")})},"/GNS":function(Ge,Fe,Q){Ge.exports=Q.p+"static/search1.c4136dd4.png"},"19Vz":function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"))})(function(ae){ae.defineOption("placeholder","",function(W,_,L){var y=L&&L!=ae.Init;if(_&&!y)W.on("blur",D),W.on("change",P),W.on("swapDoc",P),ae.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){K(W)}),P(W);else if(!_&&y){W.off("blur",D),W.off("change",P),W.off("swapDoc",P),ae.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),X(W);var C=W.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}_&&!W.hasFocus()&&D(W)});function X(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function M(W){X(W);var _=W.state.placeholder=document.createElement("pre");_.style.cssText="height: 0; overflow: visible",_.style.direction=W.getOption("direction"),_.className="CodeMirror-placeholder CodeMirror-line-like";var L=W.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),_.appendChild(L),W.display.lineSpace.insertBefore(_,W.display.lineSpace.firstChild)}function K(W){setTimeout(function(){var _=!1,L=W.getInputField();L.nodeName=="TEXTAREA"?_=!L.value:W.lineCount()==1&&(_=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),_?M(W):X(W)},20)}function D(W){H(W)&&M(W)}function P(W){var _=W.getWrapperElement(),L=H(W);_.className=_.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?M(W):X(W)}function H(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";var X={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},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ae.defineMode("xml",function(K,D){var P=K.indentUnit,H={},W=D.htmlMode?X:M;for(var _ in W)H[_]=W[_];for(var _ in D)H[_]=D[_];var L,y;function C(o,S){function b(z){return S.tokenize=z,z(o,S)}var T=o.next();if(T=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?b(A("atom","]]>")):null:o.match("--")?b(A("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),b(x(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),S.tokenize=A("meta","?>"),"meta"):(L=o.eat("/")?"closeTag":"openTag",S.tokenize=k,"tag bracket");if(T=="&"){var N;return o.eat("#")?o.eat("x")?N=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):N=o.eatWhile(/[\d]/)&&o.eat(";"):N=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),N?"atom":"error"}else return o.eatWhile(/[^&<]/),null}C.isInText=!0;function k(o,S){var b=o.next();if(b==">"||b=="/"&&o.eat(">"))return S.tokenize=C,L=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return L="equals",null;if(b=="<"){S.tokenize=C,S.state=s,S.tagName=S.tagStart=null;var T=S.tokenize(o,S);return T?T+" tag error":"tag error"}else return/[\'\"]/.test(b)?(S.tokenize=O(b),S.stringStartCol=o.column(),S.tokenize(o,S)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function O(o){var S=function(b,T){for(;!b.eol();)if(b.next()==o){T.tokenize=k;break}return"string"};return S.isInAttribute=!0,S}function A(o,S){return function(b,T){for(;!b.eol();){if(b.match(S)){T.tokenize=C;break}b.next()}return o}}function x(o){return function(S,b){for(var T;(T=S.next())!=null;){if(T=="<")return b.tokenize=x(o+1),b.tokenize(S,b);if(T==">")if(o==1){b.tokenize=C;break}else return b.tokenize=x(o-1),b.tokenize(S,b)}return"meta"}}function d(o,S,b){this.prev=o.context,this.tagName=S,this.indent=o.indented,this.startOfLine=b,(H.doNotIndent.hasOwnProperty(S)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function a(o){o.context&&(o.context=o.context.prev)}function l(o,S){for(var b;;){if(!o.context)return;if(b=o.context.tagName,!H.contextGrabbers.hasOwnProperty(b)||!H.contextGrabbers[b].hasOwnProperty(S))return;a(o)}}function s(o,S,b){return o=="openTag"?(b.tagStart=S.column(),v):o=="closeTag"?c:s}function v(o,S,b){return o=="word"?(b.tagName=S.current(),y="tag",E):H.allowMissingTagName&&o=="endTag"?(y="tag bracket",E(o,S,b)):(y="error",v)}function c(o,S,b){if(o=="word"){var T=S.current();return b.context&&b.context.tagName!=T&&H.implicitlyClosed.hasOwnProperty(b.context.tagName)&&a(b),b.context&&b.context.tagName==T||H.matchClosing===!1?(y="tag",m):(y="tag error",R)}else return H.allowMissingTagName&&o=="endTag"?(y="tag bracket",m(o,S,b)):(y="error",R)}function m(o,S,b){return o!="endTag"?(y="error",m):(a(b),s)}function R(o,S,b){return y="error",m(o,S,b)}function E(o,S,b){if(o=="word")return y="attribute",f;if(o=="endTag"||o=="selfcloseTag"){var T=b.tagName,N=b.tagStart;return b.tagName=b.tagStart=null,o=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(T)?l(b,T):(l(b,T),b.context=new d(b,T,N==b.indented)),s}return y="error",E}function f(o,S,b){return o=="equals"?g:(H.allowMissing||(y="error"),E(o,S,b))}function g(o,S,b){return o=="string"?h:o=="word"&&H.allowUnquoted?(y="string",E):(y="error",E(o,S,b))}function h(o,S,b){return o=="string"?h:E(o,S,b)}return{startState:function(o){var S={tokenize:C,state:s,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(S.baseIndent=o),S},token:function(o,S){if(!S.tagName&&o.sol()&&(S.indented=o.indentation()),o.eatSpace())return null;L=null;var b=S.tokenize(o,S);return(b||L)&&b!="comment"&&(y=null,S.state=S.state(L||b,o,S),y&&(b=y=="error"?b+" error":y)),b},indent:function(o,S,b){var T=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+P;if(T&&T.noIndent)return ae.Pass;if(o.tokenize!=k&&o.tokenize!=C)return b?b.match(/^(\s*)/)[0].length:0;if(o.tagName)return H.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+P*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(S))return 0;var N=S&&/^<(\/)?([\w_:\.-]*)/.exec(S);if(N&&N[1])for(;T;)if(T.tagName==N[2]){T=T.prev;break}else if(H.implicitlyClosed.hasOwnProperty(T.tagName))T=T.prev;else break;else if(N)for(;T;){var z=H.contextGrabbers[T.tagName];if(z&&z.hasOwnProperty(N[2]))T=T.prev;else break}for(;T&&T.prev&&!T.startOfLine;)T=T.prev;return T?T.indent+P:o.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(o){o.state==g&&(o.state=E)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var S=[],b=o.context;b;b=b.prev)b.tagName&&S.push(b.tagName);return S.reverse()}}}),ae.defineMIME("text/xml","xml"),ae.defineMIME("application/xml","xml"),ae.mimeModes.hasOwnProperty("text/html")||ae.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"4qgm":function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1PTckKNereENM1L6rFmaAc/PzRD3L6E9jlUabN+Swj2tfFB6o8Q7h0e/GQMPDcy9djBS7DjPJzthOJ+0lSPvzguyxonyz96E9mjwIpGHeGZ+lFYiEXMpP+ozQhcPgZmj7z95MUE1H8Ef7gIhnCszyXOPWqa5lWUDVcvsu3Mk5KrXsodEhUtOtNT6qwYj0allj2dXAIzvx+5CtvOwT9vQpEFVtTVMzuK8QJT1yY55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/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"7Cbv":function(Ge,Fe,Q){"use strict";var ae=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),X=new Uint8Array(16);function M(){if(!ae)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ae(X)}var K=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function D(k){return typeof k=="string"&&K.test(k)}for(var P=D,H=[],W=0;W<256;++W)H.push((W+256).toString(16).substr(1));function _(k){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=(H[k[O+0]]+H[k[O+1]]+H[k[O+2]]+H[k[O+3]]+"-"+H[k[O+4]]+H[k[O+5]]+"-"+H[k[O+6]]+H[k[O+7]]+"-"+H[k[O+8]]+H[k[O+9]]+"-"+H[k[O+10]]+H[k[O+11]]+H[k[O+12]]+H[k[O+13]]+H[k[O+14]]+H[k[O+15]]).toLowerCase();if(!P(A))throw TypeError("Stringified UUID is invalid");return A}var L=_;function y(k,O,A){k=k||{};var x=k.random||(k.rng||M)();if(x[6]=x[6]&15|64,x[8]=x[8]&63|128,O){A=A||0;for(var d=0;d<16;++d)O[A+d]=x[d];return O}return L(x)}var C=Fe.a=y},"7ZXX":function(Ge,Fe,Q){Ge.exports=Q.p+"static/err.6e7c5817.png"},"7ahc":function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return v});var ae=Q("k1fw"),X=Q("0Owb"),M=Q("+L6B"),K=Q("2/Rp"),D=Q("y8nQ"),P=Q("Vl3Y"),H=Q("tJVT"),W=Q("OaEy"),_=Q("2fM7"),L=Q("q1tI"),y=Q.n(L),C=Q("VrN/"),k=Q.n(C),O=Q("p77/"),A=Q.n(O),x=Q("c5Ni"),d=Q.n(x),a=_.a.Option,l={labelCol:{span:4},wrapperCol:{span:20}},s={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"]};Fe.b=function(c){var m=c.callback,R=c.onCancel,E=Object(L.useState)("python"),f=Object(H.a)(E,2),g=f[0],h=f[1];function o(b){h(s[b][1])}function S(b){m(b)}return y.a.createElement(P.a,Object(X.a)({},l,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:S}),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(_.a,{onChange:o},Object.keys(s).map(function(b){return y.a.createElement(a,{key:b,value:b},s[b][0])}))),y.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(v,{mode:g})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(K.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function v(c){var m=c.value,R=c.onChange,E=c.mode,f=c.options,g=f===void 0?{}:f,h=Object(L.useRef)(),o=Object(L.useState)(),S=Object(H.a)(o,2),b=S[0],T=S[1];return Object(L.useEffect)(function(){if(b){function N(z){var Y=z.getValue();R&&R(Y)}return b.on("change",N),function(){b.off("change",N)}}},[b,R]),Object(L.useEffect)(function(){b&&b.setOption("mode",E)},[b,E]),Object(L.useEffect)(function(){b&&((m!==b.getValue()||m==="")&&setTimeout(function(){b.setValue(m||" ")},300))},[b,m]),Object(L.useEffect)(function(){if(h.current&&!b){var N=k.a.fromTextArea(h.current,Object(ae.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},g));T(N)}},[h.current,b]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:h}))}},"7ixt":function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return M});var ae={adjustX:1,adjustY:1},X=[0,0],M={left:{points:["cr","cl"],overflow:ae,offset:[-4,0],targetOffset:X},right:{points:["cl","cr"],overflow:ae,offset:[4,0],targetOffset:X},top:{points:["bc","tc"],overflow:ae,offset:[0,-4],targetOffset:X},bottom:{points:["tc","bc"],overflow:ae,offset:[0,4],targetOffset:X},topLeft:{points:["bl","tl"],overflow:ae,offset:[0,-4],targetOffset:X},leftTop:{points:["tr","tl"],overflow:ae,offset:[-4,0],targetOffset:X},topRight:{points:["br","tr"],overflow:ae,offset:[0,-4],targetOffset:X},rightTop:{points:["tl","tr"],overflow:ae,offset:[4,0],targetOffset:X},bottomRight:{points:["tr","br"],overflow:ae,offset:[0,4],targetOffset:X},rightBottom:{points:["bl","br"],overflow:ae,offset:[4,0],targetOffset:X},bottomLeft:{points:["tl","bl"],overflow:ae,offset:[0,4],targetOffset:X},leftBottom:{points:["br","bl"],overflow:ae,offset:[-4,0],targetOffset:X}},K=M},"7qnI":function(Ge,Fe,Q){"use strict";var ae=Q("5Dmo"),X=Q("3S7+"),M=Q("fWQN"),K=Q("mtLc"),D=Q("yKVA"),P=Q("879j"),H=Q("5NDa"),W=Q("5rEg"),_=Q("q1tI"),L=Q.n(_),y=Q("O2Wb"),C=Q.n(y),k=W.a.TextArea,O=function(A){Object(D.a)(d,A);var x=Object(P.a)(d);function d(){return Object(M.a)(this,d),x.apply(this,arguments)}return Object(K.a)(d,[{key:"render",value:function(){var l=this,s=this.props,v=s.index,c=s.onAnswerChange,m=s.addChildAnswer,R=s.exerciseIsPublish,E=s.answers,f=s.activeOptionErrorIndex,g=s.flex,h=g===void 0?"0 0 1000px":g;return L.a.createElement("div",{className:C.a.flex},L.a.createElement("div",{className:"".concat(C.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",v+1,"):"),L.a.createElement("div",{className:"".concat(C.a.flex," ").concat(C.a.flex1),style:{flexDirection:"column"}},E.map(function(o,S){var b="".concat(v,"-").concat(S);return L.a.createElement("div",{className:"".concat(C.a.flex," ").concat(C.a.flex1),key:S},L.a.createElement("div",{className:C.a.flex1,style:{flex:h}},L.a.createElement("div",null,L.a.createElement(k,{className:b===f?C.a.error:"",spellCheck:!1,rows:4,value:o||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(S==0?"":"(\u53EF\u9009)"),onChange:function(N){return c(v,S,N.target.value)},style:{minHeight:95}}))),!R&&L.a.createElement(L.a.Fragment,null,S!=0&&L.a.createElement(X.a,{title:"\u5220\u9664"},L.a.createElement("i",{className:"".concat(C.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return l.props.deleteChildAnswer(v,S)},style:{float:"right"}})),S===0&&L.a.createElement(X.a,{title:"\u5220\u9664"},L.a.createElement("i",{className:"".concat(C.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return l.props.deleteChildAnswermain(v,S)},style:{float:"right"}})),L.a.createElement(X.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},L.a.createElement("i",{className:"".concat(C.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return m(v)},style:{float:"right",visibility:S==E.length-1?"":"hidden"}}))))})))}}]),d}(_.Component);Fe.a=O},"7v3h":function(Ge,Fe,Q){Ge.exports=Q.p+"static/empty2.dd73f390.png"},"8/bI":function(Ge,Fe,Q){Ge.exports=Q.p+"static/empty.8918e228.png"},"8EBN":function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";ae.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 X=0;X<ae.modeInfo.length;X++){var M=ae.modeInfo[X];M.mimes&&(M.mime=M.mimes[0])}ae.findModeByMIME=function(K){K=K.toLowerCase();for(var D=0;D<ae.modeInfo.length;D++){var P=ae.modeInfo[D];if(P.mime==K)return P;if(P.mimes){for(var H=0;H<P.mimes.length;H++)if(P.mimes[H]==K)return P}}if(/\+xml$/.test(K))return ae.findModeByMIME("application/xml");if(/\+json$/.test(K))return ae.findModeByMIME("application/json")},ae.findModeByExtension=function(K){K=K.toLowerCase();for(var D=0;D<ae.modeInfo.length;D++){var P=ae.modeInfo[D];if(P.ext){for(var H=0;H<P.ext.length;H++)if(P.ext[H]==K)return P}}},ae.findModeByFileName=function(K){for(var D=0;D<ae.modeInfo.length;D++){var P=ae.modeInfo[D];if(P.file&&P.file.test(K))return P}var H=K.lastIndexOf("."),W=H>-1&&K.substring(H+1,K.length);if(W)return ae.findModeByExtension(W)},ae.findModeByName=function(K){K=K.toLowerCase();for(var D=0;D<ae.modeInfo.length;D++){var P=ae.modeInfo[D];if(P.name.toLowerCase()==K)return P;if(P.alias){for(var H=0;H<P.alias.length;H++)if(P.alias[H].toLowerCase()==K)return P}}}})},"8hTe":function(Ge,Fe,Q){Ge.exports={button:"button___1wy9m"}},"9Bee":function(Ge,Fe,Q){"use strict";var ae=Q("DYRE"),X=Q("zeV3"),M=Q("+L6B"),K=Q("2/Rp"),D=Q("k1fw"),P=Q("9og8"),H=Q("tJVT"),W=Q("WmNS"),_=Q.n(W),L=Q("q1tI"),y=Q.n(L),C=Q("vg9a"),k=Q("DlQD"),O=Q.n(k),A=Q("rUJ1");function x(j,u){var p=j.match(/^(\s+)(?:```)/);if(p===null)return u;var I=p[1];return u.split(`
|
|
`).map(function(Z){var U=Z.match(/^\s+/);if(U===null)return Z;var be=Object(H.a)(U,1),Xe=be[0];return Xe.length>=I.length?Z.slice(I.length):Z}).join(`
|
|
`)}var d=[],a=["<ul>"],l=new O.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){d.length=0,a=["<ul>"]}var c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(j,u,p,I){if(u>=j.length||j[u].level<=p)return u;var Z=j[u];I.push("<li><a href='#"+Z.anchor+"'>"+Z.text+"</a>"),u++;var U=[];return u=m(j,u,Z.level,U),U.length>0&&(I.push("<ul>"),U.forEach(function(be){I.push(be)}),I.push("</ul>")),I.push("</li>"),u=m(j,u,p,I),u}function R(){return m(d,0,0,a),a.push("</ul>"),a.join("")}var E={heading:function(u){var p=s.exec(u);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},fences:function(u){var p=this.rules.block.fences.exec(u);if(p){var I=p[0],Z=x(I,p[3]||""),U=p[2]?p[2].trim():p[2];if(["latex","katex","math"].indexOf(U)>=0){var be=h(),Xe=Z;Z=be,o[be]={type:"block",expression:Xe}}return{type:"code",raw:I,lang:U,text:Z}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,g=0,h=function(){return"__special_katext_id_".concat(g++,"__")},o={};function S(){return o}function b(){g=0,o={}}function T(j){return j=j.replace(f,function(u,p){var I=h();return o[I]={type:"inline",expression:p},I}),j}var N=l.listitem;l.listitem=function(j){return N(T(j))};var z=l.paragraph;l.paragraph=function(j){return z(T(j))};var Y=l.tablecell;l.tablecell=function(j,u){return Y(T(j),u)},l.code=function(j,u,p){var I=(u||"").match(/\S*/)[0];return I?["latex","katex","math"].indexOf(I)>=0?"<p class='editormd-tex'>".concat(j,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(u,'">').concat(p?j:Object(A.escape)(j,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(p?j:Object(A.escape)(j,!0))+"</code></pre>"},l.heading=function(j,u,p){var I=this.options.headerPrefix+p.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return d.push({anchor:I,level:u,text:j}),"<h"+u+' id="'+I+'">'+j+"</h"+u+">"},O.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),O.a.use({tokenizer:E,renderer:l});var te=O.a,G=Q("SJMd"),F=Q("ulZh"),re=Q.n(F),le=Q("m3rI"),Ee=Q("Oy/b"),Oe=Q("p5ED"),Ye=Q("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Pe=function(j,u){return(Pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,I){p.__proto__=I}||function(p,I){for(var Z in I)Object.prototype.hasOwnProperty.call(I,Z)&&(p[Z]=I[Z])})(j,u)};function Be(j,u){function p(){this.constructor=j}Pe(j,u),j.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}function Ue(j,u,p,I){return new(p||(p=Promise))(function(Z,U){function be(It){try{gt(I.next(It))}catch(qe){U(qe)}}function Xe(It){try{gt(I.throw(It))}catch(qe){U(qe)}}function gt(It){var qe;It.done?Z(It.value):(qe=It.value,qe instanceof p?qe:new p(function(jt){jt(qe)})).then(be,Xe)}gt((I=I.apply(j,u||[])).next())})}function Ne(j,u){var p,I,Z,U,be={label:0,sent:function(){if(1&Z[0])throw Z[1];return Z[1]},trys:[],ops:[]};return U={next:Xe(0),throw:Xe(1),return:Xe(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function Xe(gt){return function(It){return function(qe){if(p)throw new TypeError("Generator is already executing.");for(;be;)try{if(p=1,I&&(Z=2&qe[0]?I.return:qe[0]?I.throw||((Z=I.return)&&Z.call(I),0):I.next)&&!(Z=Z.call(I,qe[1])).done)return Z;switch(I=0,Z&&(qe=[2&qe[0],Z.value]),qe[0]){case 0:case 1:Z=qe;break;case 4:return be.label++,{value:qe[1],done:!1};case 5:be.label++,I=qe[1],qe=[0];continue;case 7:qe=be.ops.pop(),be.trys.pop();continue;default:if(!(Z=be.trys,(Z=Z.length>0&&Z[Z.length-1])||qe[0]!==6&&qe[0]!==2)){be=0;continue}if(qe[0]===3&&(!Z||qe[1]>Z[0]&&qe[1]<Z[3])){be.label=qe[1];break}if(qe[0]===6&&be.label<Z[1]){be.label=Z[1],Z=qe;break}if(Z&&be.label<Z[2]){be.label=Z[2],be.ops.push(qe);break}Z[2]&&be.ops.pop(),be.trys.pop();continue}qe=u.call(j,be)}catch(jt){qe=[6,jt],I=0}finally{p=Z=0}if(5&qe[0])throw qe[1];return{value:qe[0]?qe[1]:void 0,done:!0}}([gt,It])}}}function Te(){for(var j=0,u=0,p=arguments.length;u<p;u++)j+=arguments[u].length;var I=Array(j),Z=0;for(u=0;u<p;u++)for(var U=arguments[u],be=0,Xe=U.length;be<Xe;be++,Z++)I[Z]=U[be];return I}var se=function(){function j(){}return j.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},j.setAttributes=function(u,p){for(var I=0,Z=p;I<Z.length;I++){var U=Z[I],be=U[0],Xe=U[1];u.setAttribute(be,Xe)}},j.createRect=function(u,p,I){var Z=document.createElementNS("http://www.w3.org/2000/svg","rect");return Z.setAttribute("width",u.toString()),Z.setAttribute("height",p.toString()),I&&j.setAttributes(Z,I),Z},j.createLine=function(u,p,I,Z,U){var be=document.createElementNS("http://www.w3.org/2000/svg","line");return be.setAttribute("x1",u.toString()),be.setAttribute("y1",p.toString()),be.setAttribute("x2",I.toString()),be.setAttribute("y2",Z.toString()),U&&j.setAttributes(be,U),be},j.createPolygon=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","polygon");return I.setAttribute("points",u),p&&j.setAttributes(I,p),I},j.createCircle=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","circle");return I.setAttribute("cx",(u/2).toString()),I.setAttribute("cy",(u/2).toString()),I.setAttribute("r",u.toString()),p&&j.setAttributes(I,p),I},j.createEllipse=function(u,p,I){var Z=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Z.setAttribute("cx",(u/2).toString()),Z.setAttribute("cy",(p/2).toString()),Z.setAttribute("rx",(u/2).toString()),Z.setAttribute("ry",(p/2).toString()),I&&j.setAttributes(Z,I),Z},j.createGroup=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return u&&j.setAttributes(p,u),p},j.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},j.createMarker=function(u,p,I,Z,U,be,Xe){var gt=document.createElementNS("http://www.w3.org/2000/svg","marker");return j.setAttributes(gt,[["id",u],["orient",p],["markerWidth",I.toString()],["markerHeight",Z.toString()],["refX",U.toString()],["refY",be.toString()]]),gt.appendChild(Xe),gt},j.createText=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),u&&j.setAttributes(p,u),p},j.createTSpan=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","tspan");return I.textContent=u,p&&j.setAttributes(I,p),I},j.createImage=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return u&&j.setAttributes(p,u),p},j.createPoint=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return I.x=u,I.y=p,I},j.createPath=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","path");return I.setAttribute("d",u),p&&j.setAttributes(I,p),I},j}(),ze=function(){function j(){}return j.addKey=function(u){j.key=u},Object.defineProperty(j,"isLicensed",{get:function(){return!!j.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(j.key)},enumerable:!1,configurable:!0}),j}(),xt=function(){function j(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return j.prototype.rasterize=function(u,p,I){var Z=this;return new Promise(function(U){var be=I!==void 0?I:document.createElement("canvas");u===null&&(Z.markersOnly=!0,Z.naturalSize=!1);var Xe=document.createElementNS("http://www.w3.org/2000/svg","svg");Xe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Xe.setAttribute("width",p.width.baseVal.valueAsString),Xe.setAttribute("height",p.height.baseVal.valueAsString),Xe.setAttribute("viewBox","0 0 "+p.viewBox.baseVal.width.toString()+" "+p.viewBox.baseVal.height.toString()),Xe.innerHTML=p.innerHTML,Z.naturalSize===!0?(Xe.width.baseVal.value=u.naturalWidth,Xe.height.baseVal.value=u.naturalHeight):Z.width!==void 0&&Z.height!==void 0&&(Xe.width.baseVal.value=Z.width,Xe.height.baseVal.value=Z.height),be.width=Xe.width.baseVal.value,be.height=Xe.height.baseVal.value;var gt=Xe.outerHTML,It=be.getContext("2d");Z.markersOnly!==!0&&It.drawImage(u,0,0,be.width,be.height);var qe=window.URL,jt=new Image(be.width,be.height);jt.setAttribute("crossOrigin","anonymous");var Cr=new Blob([gt],{type:"image/svg+xml"}),Nr=qe.createObjectURL(Cr);jt.onload=function(){It.drawImage(jt,0,0),qe.revokeObjectURL(Nr);var Rn=be.toDataURL(Z.imageType,Z.imageQuality);U(Rn)},jt.src=Nr})},j}(),ct=function(){},ft=function(){function j(u){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+u+"_"}return Object.defineProperty(j.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),j.prototype.addClass=function(u){return this.styleSheet===void 0&&this.addStyleSheet(),u.name=""+this.classNamePrefix+u.localName,this.classes.push(u),this.styleSheet.sheet.insertRule("."+u.name+" {"+u.style+"}",this.styleSheet.sheet.cssRules.length),u},j.prototype.addRule=function(u){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(u),this.styleSheet.sheet.insertRule(u.selector+" {"+u.style+"}",this.styleSheet.sheet.cssRules.length)},j.prototype.addStyleSheet=function(){var u;this.styleSheet=document.createElement("style"),((u=this.styleSheetRoot)!==null&&u!==void 0?u:document.head).appendChild(this.styleSheet),this.addRule(new Ct("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ct("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ct("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new He("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new He("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},j.prototype.removeStyleSheet=function(){var u;this.styleSheet&&(((u=this.styleSheetRoot)!==null&&u!==void 0?u:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},j}(),Ct=function(j,u){this.selector=j,this.style=u},He=function(j,u){this.localName=j,this.style=u},Ke=function(){function j(u,p,I,Z,U){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=u,this.displayMode=p,this.markerItems=I,this.uiStyleSettings=Z,this.styles=U,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return j.prototype.show=function(u){var p=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=u,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var I=document.createElement("div");I.className=this.toolbarBlockStyleClass.name,I.style.whiteSpace="nowrap",this.uiContainer.appendChild(I),this.addActionButton(I,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(I,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(I,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(I,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(I,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(I,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(I,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(I,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(U){var be=document.createElement("div");be.className=""+p.toolbarButtonStyleClass.name,be.setAttribute("data-type-name",U.typeName),be.innerHTML=U.icon,be.addEventListener("click",function(){p.markerToolbarButtonClicked(be,U)}),p.buttons.push(be),p.markerButtons.push(be)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Z=document.createElement("div");Z.className=this.toolbarBlockStyleClass.name,Z.style.whiteSpace="nowrap",Z.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Z),this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(Z,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},j.prototype.addButtonClickListener=function(u){this.buttonClickListeners.push(u)},j.prototype.removeButtonClickListener=function(u){this.buttonClickListeners.indexOf(u)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(u),1)},j.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},j.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var u=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var p=0;p<this.markerButtons.length;p++)p<u||p===u&&this.markerButtons.length-1===u?this.markerButtonBlock.appendChild(this.markerButtons[p]):(p===u&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[p]))}},j.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},j.prototype.resetButtonStyles=function(){var u=this;this.buttons.forEach(function(p){p.className=p.className.replace(u.uiStyleSettings.toolbarButtonStyleColorsClassName?u.uiStyleSettings.toolbarButtonStyleColorsClassName:u.toolbarButtonStyleColorsClass.name,"").trim(),p.className=p.className.replace(u.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?u.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:u.toolbarActiveButtonStyleColorsClass.name,"").trim(),p.className+=" "+(u.uiStyleSettings.toolbarButtonStyleColorsClassName?u.uiStyleSettings.toolbarButtonStyleColorsClassName:u.toolbarButtonStyleColorsClass.name)})},j.prototype.addActionButton=function(u,p,I){var Z=this,U=document.createElement("div");switch(U.className=""+this.toolbarButtonStyleClass.name,U.innerHTML=p,U.setAttribute("data-action",I),U.addEventListener("click",function(){Z.actionToolbarButtonClicked(U,I)}),I){case"select":U.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":U.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":U.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":U.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":U.style.fill=this.uiStyleSettings.closeButtonColor}u.appendChild(U),this.buttons.push(U)},j.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new He("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new He("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new He("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new He("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new He("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var u=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new He("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*u)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*u)+`px;
|
|
padding: `+u+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new He("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new He("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ct("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ct("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},j.prototype.markerToolbarButtonClicked=function(u,p){this.setActiveButton(u),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(I){return I("marker",p)}),this.markerButtonOverflowBlock.style.display="none"},j.prototype.actionToolbarButtonClicked=function(u,p){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(I){return I("action",p)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},j.prototype.setActiveButton=function(u){this.resetButtonStyles(),u.className=u.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),u.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},j.prototype.setActiveMarkerButton=function(u){var p=this.markerButtons.find(function(I){return I.getAttribute("data-type-name")===u});p&&this.setActiveButton(p)},j.prototype.setCurrentMarker=function(u){var p=this;this.currentMarker=u,this.buttons.filter(function(I){return/delete|notes/.test(I.getAttribute("data-action"))}).forEach(function(I){p.currentMarker===void 0?(I.style.fillOpacity="0.4",I.style.pointerEvents="none"):(I.style.fillOpacity="1",I.style.pointerEvents="all")})},j}(),ut=function(){function j(u,p,I,Z){this.panels=[],this.panelButtons=[],this.markerjsContainer=u,this.displayMode=p,this.uiStyleSettings=I,this.styles=Z,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return j.prototype.addStyles=function(){var u;this.toolboxStyleClass=this.styles.addClass(new He("toolbox",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: sans-serif;
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new He("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new He("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new He("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new He("toolbox-panel-row",`
|
|
display: flex;
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
cursor: default;
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
box-sizing: content-box;
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new He("toolbox-panel-row_colors",`
|
|
background-color: `+((u=this.uiStyleSettings.toolboxBackgroundColor)!==null&&u!==void 0?u:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new He("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new He("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new He("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ct("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ct("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},j.prototype.show=function(u){var p;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=u,this.uiContainer.className=this.toolboxStyleClass.name+" "+((p=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},j.prototype.setPanelButtons=function(u){var p,I,Z=this;this.panels=u,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((p=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(U){var be;U.uiStyleSettings=Z.uiStyleSettings;var Xe=document.createElement("div");Xe.className=Z.toolboxButtonStyleClass.name+" "+((be=Z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&be!==void 0?be:Z.toolboxButtonStyleColorsClass.name),Xe.innerHTML=U.icon,Xe.title=U.title,Xe.addEventListener("click",function(){Z.panelButtonClick(U)}),Z.panelButtons.push(Xe),Z.buttonRow.appendChild(Xe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},j.prototype.panelButtonClick=function(u){var p=this,I=-1;if(u!==this.activePanel){I=this.panels.indexOf(u),this.panelRow.innerHTML="";var Z=u.getUi();Z.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Z),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=u}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){p.displayMode==="inline"?p.panelRow.style.display="none":p.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(U,be){var Xe,gt;U.className=p.toolboxButtonStyleClass.name+" "+(be===I?""+((Xe=p.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Xe!==void 0?Xe:p.toolboxActiveButtonStyleColorsClass.name):""+((gt=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&>!==void 0?gt:p.toolboxButtonStyleColorsClass.name))})},j}(),vt=function(j,u){this.title=j,this.icon=u},ht=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return be.colors=[],be.addTransparent=!1,be.colorBoxes=[],be.colors=I,be.currentColor=Z,be.setCurrentColor=be.setCurrentColor.bind(be),be.getColorBox=be.getColorBox.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.whiteSpace="nowrap",this.colors.forEach(function(Z){var U=p.getColorBox(Z);I.appendChild(U),p.colorBoxes.push(U)}),I},u.prototype.getColorBox=function(p){var I=this,Z=this.uiStyleSettings.toolbarHeight/4,U=this.uiStyleSettings.toolbarHeight-Z,be=document.createElement("div");be.style.display="inline-block",be.style.boxSizing="content-box",be.style.width=U-2+"px",be.style.height=U-2+"px",be.style.padding="1px",be.style.marginRight="2px",be.style.marginBottom="2px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.borderRadius=(U+2)/2+"px",be.style.borderColor=p===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){I.setCurrentColor(p,be)});var Xe=document.createElement("div");return Xe.style.display="inline-block",Xe.style.width=U-2+"px",Xe.style.height=U-2+"px",Xe.style.backgroundColor=p,Xe.style.borderRadius=U/2+"px",p==="transparent"&&(Xe.style.fill=this.uiStyleSettings.toolboxAccentColor,Xe.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),be.appendChild(Xe),be},u.prototype.setCurrentColor=function(p,I){var Z=this;this.currentColor=p,this.colorBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(p)},u}(vt),et=function(){function j(u,p,I){this._state="new",this._isSelected=!1,this._container=u,this._overlayContainer=p,this.globalSettings=I,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(j.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(u){return!1},Object.defineProperty(j.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),j.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},j.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},j.prototype.pointerDown=function(u,p){},j.prototype.dblClick=function(u,p){},j.prototype.manipulate=function(u){},j.prototype.pointerUp=function(u){this.stateChanged()},j.prototype.dispose=function(){},j.prototype.addMarkerVisualToContainer=function(u){this.container.childNodes.length>0?this.container.insertBefore(u,this.container.childNodes[0]):this.container.appendChild(u)},j.prototype.getState=function(){return{typeName:j.typeName,state:this.state,notes:this.notes}},j.prototype.restoreState=function(u){this._state=u.state,this.notes=u.notes},j.prototype.scale=function(u,p){},j.prototype.colorChanged=function(u){this.onColorChanged&&this.onColorChanged(u),this.stateChanged()},j.prototype.fillColorChanged=function(u){this.onFillColorChanged&&this.onFillColorChanged(u),this.stateChanged()},j.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var u=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),u.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(u)&&this.onStateChanged(this)}},j.typeName="MarkerBase",j}(),Ze=function(){function j(){this.findGripByVisual=this.findGripByVisual.bind(this)}return j.prototype.findGripByVisual=function(u){return this.topLeft.ownsTarget(u)?this.topLeft:this.topCenter.ownsTarget(u)?this.topCenter:this.topRight.ownsTarget(u)?this.topRight:this.centerLeft.ownsTarget(u)?this.centerLeft:this.centerRight.ownsTarget(u)?this.centerRight:this.bottomLeft.ownsTarget(u)?this.bottomLeft:this.bottomCenter.ownsTarget(u)?this.bottomCenter:this.bottomRight.ownsTarget(u)?this.bottomRight:void 0},j}(),Tt=function(){function j(){this.GRIP_SIZE=10,this.visual=se.createGroup(),this.visual.appendChild(se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},j}(),bt=function(){function j(){}return j.toITransformMatrix=function(u){return{a:u.a,b:u.b,c:u.c,d:u.d,e:u.e,f:u.f}},j.toSVGMatrix=function(u,p){return u.a=p.a,u.b=p.b,u.c=p.c,u.d=p.d,u.e=p.e,u.f=p.f,u},j}(),St=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.left=0,U.top=0,U.width=0,U.height=0,U.defaultSize={x:50,y:20},U.offsetX=0,U.offsetY=0,U.rotationAngle=0,U.CB_DISTANCE=10,U._suppressMarkerCreateEvent=!1,U.container.transform.baseVal.appendItem(se.createTransform()),U.setupControlBox(),U}return Be(u,j),Object.defineProperty(u.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"visual",{get:function(){return this._visual},set:function(p){this._visual=p;var I=se.createTransform();this._visual.transform.baseVal.appendItem(I)},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(p){return!!j.prototype.ownsTarget.call(this,p)||!!(this.controlGrips.findGripByVisual(p)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(p))},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.left=p.x,this.top=p.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Z=this.unrotatePoint(p);if(this.manipulationStartX=Z.x,this.manipulationStartY=Z.y,this.offsetX=Z.x-this.left,this.offsetY=Z.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(I),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I)){this.activeGrip=this.rotatorGrip;var U=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=U.x-this.width/2,this.top=U.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var be=this.container.transform.baseVal.getItem(0);be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},u.prototype.pointerUp=function(p){var I=this.state;j.prototype.pointerUp.call(this,p),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(p),this._state="select",I==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},u.prototype.moveVisual=function(p){this.visual.style.transform="translate("+p.x+"px, "+p.y+"px)"},u.prototype.manipulate=function(p){var I=this.unrotatePoint(p);this.state==="creating"?this.resize(p):this.state==="move"?(this.left=this.manipulationStartLeft+(I.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(I.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(I):this.state==="rotate"&&this.rotate(p)},u.prototype.resize=function(p){var I=this.manipulationStartLeft,Z=this.manipulationStartWidth,U=this.manipulationStartTop,be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:I=this.manipulationStartLeft+p.x-this.manipulationStartX,Z=this.manipulationStartWidth+this.manipulationStartLeft-I;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Z=this.manipulationStartWidth+p.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:U=this.manipulationStartTop+p.y-this.manipulationStartY,be=this.manipulationStartHeight+this.manipulationStartTop-U;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:be=this.manipulationStartHeight+p.y-this.manipulationStartY}Z>=0?(this.left=I,this.width=Z):(this.left=I+Z,this.width=-Z),be>=0?(this.top=U,this.height=be):(this.top=U+be,this.height=-be),this.setSize()},u.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},u.prototype.rotate=function(p){if(Math.abs(p.x-this.centerX)>.1){var I=Math.sign(p.x-this.centerX);this.rotationAngle=180*Math.atan((p.y-this.centerY)/(p.x-this.centerX))/Math.PI+90*I,this.applyRotation()}},u.prototype.applyRotation=function(){var p=this.container.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(p,0)},u.prototype.rotatePoint=function(p){if(this.rotationAngle===0)return p;var I=this.container.getCTM(),Z=se.createPoint(p.x,p.y);return{x:(Z=Z.matrixTransform(I)).x,y:Z.y}},u.prototype.unrotatePoint=function(p){if(this.rotationAngle===0)return p;var I=this.container.getCTM();I=I.inverse();var Z=se.createPoint(p.x,p.y);return{x:(Z=Z.matrixTransform(I)).x,y:Z.y}},u.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var p=se.createTransform();p.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(p),this.container.appendChild(this.controlBox),this.controlRect=se.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=se.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ze,this.addControlGrips(),this.controlBox.style.display="none"},u.prototype.adjustControlBox=function(){var p=this.controlBox.transform.baseVal.getItem(0);p.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(p,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},u.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},u.prototype.createGrip=function(){var p=new Tt;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},u.prototype.positionGrips=function(){var p=this.controlGrips.topLeft.GRIP_SIZE,I=-p/2,Z=I,U=(this.width+this.CB_DISTANCE)/2-p/2,be=(this.height+this.CB_DISTANCE)/2-p/2,Xe=this.height+this.CB_DISTANCE-p/2,gt=this.width+this.CB_DISTANCE-p/2;this.positionGrip(this.controlGrips.topLeft.visual,I,Z),this.positionGrip(this.controlGrips.topCenter.visual,U,Z),this.positionGrip(this.controlGrips.topRight.visual,gt,Z),this.positionGrip(this.controlGrips.centerLeft.visual,I,be),this.positionGrip(this.controlGrips.centerRight.visual,gt,be),this.positionGrip(this.controlGrips.bottomLeft.visual,I,Xe),this.positionGrip(this.controlGrips.bottomCenter.visual,U,Xe),this.positionGrip(this.controlGrips.bottomRight.visual,gt,Xe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,U,Z-3*this.CB_DISTANCE)},u.prototype.positionGrip=function(p,I,Z){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,Z),p.transform.baseVal.replaceItem(U,0)},u.prototype.hideControlBox=function(){this.controlBox.style.display="none"},u.prototype.showControlBox=function(){this.controlBox.style.display=""},u.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:bt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:bt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},j.prototype.getState.call(this))},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.left=I.left,this.top=I.top,this.width=I.width,this.height=I.height,this.rotationAngle=I.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(bt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,I.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(bt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,I.containerTransformMatrix))},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I);var Z=this.rotatePoint({x:this.left,y:this.top}),U=this.unrotatePoint({x:Z.x*p,y:Z.y*I});this.left=U.x,this.top=U.y,this.width=this.width*p,this.height=this.height*I,this.adjustControlBox()},u}(et),lt=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.createVisual=U.createVisual.bind(U),U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual)},u.prototype.createVisual=function(){this.visual=se.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},u.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){j.prototype.resize.call(this,p),this.setSize()},u.prototype.setSize=function(){j.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(p){j.prototype.pointerUp.call(this,p),this.setSize()},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},u.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},u.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this))},u.prototype.restoreState=function(p){var I=p;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),j.prototype.restoreState.call(this,p),this.setSize()},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize()},u.title="Rectangle marker",u}(St),yt=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return be.widths=[],be.widthBoxes=[],be.widths=I,be.currentWidth=Z,be.setCurrentWidth=be.setCurrentWidth.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.widths.forEach(function(Z){var U=document.createElement("div");U.style.display="flex",U.style.flexGrow="2",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=Z===p.currentWidth?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentWidth(Z,U)}),I.appendChild(U);var be=document.createElement("div");be.innerText=Z.toString(),be.style.marginRight="5px",U.appendChild(be);var Xe=document.createElement("div");Xe.style.minHeight="20px",Xe.style.flexGrow="2",Xe.style.display="flex",Xe.style.alignItems="center";var gt=document.createElement("hr");gt.style.minWidth="20px",gt.style.border="0px",gt.style.borderTop=Z+"px solid "+p.uiStyleSettings.toolboxColor,gt.style.flexGrow="2",Xe.appendChild(gt),U.appendChild(Xe),p.widthBoxes.push(U)}),I},u.prototype.setCurrentWidth=function(p,I){var Z=this;this.currentWidth=p,this.widthBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},u}(vt),dt=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return be.styles=[],be.styleBoxes=[],be.styles=I,be.currentStyle=Z,be.setCurrentStyle=be.setCurrentStyle.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.styles.forEach(function(Z){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/p.styles.length-5+"%",U.style.borderColor=Z===p.currentStyle?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentStyle(Z,U)}),I.appendChild(U);var be=document.createElement("div");be.style.minHeight="20px",be.style.flexGrow="2",be.style.overflow="hidden";var Xe=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+p.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Z!==""?'stroke-dasharray="'+Z+'"':"")+` />
|
|
</svg>`;be.innerHTML=Xe,U.appendChild(be),p.styleBoxes.push(U)}),I},u.prototype.setCurrentStyle=function(p,I){var Z=this;this.currentStyle=p,this.styleBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},u}(vt),Qe=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.strokePanel=new ht("Line color",Z.defaultColorSet,Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new dt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Be(u,j),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="FrameMarker",u.title="Frame marker",u.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',u}(lt),Ie=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Et=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.x1=0,U.y1=0,U.x2=0,U.y2=0,U.defaultLength=50,U.manipulationStartX=0,U.manipulationStartY=0,U.manipulationStartX1=0,U.manipulationStartY1=0,U.manipulationStartX2=0,U.manipulationStartY2=0,U.setupControlBox(),U}return Be(u,j),u.prototype.ownsTarget=function(p){return!!j.prototype.ownsTarget.call(this,p)||!(!this.grip1.ownsTarget(p)&&!this.grip2.ownsTarget(p))},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.state==="new"&&(this.x1=p.x,this.y1=p.y,this.x2=p.x,this.y2=p.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(I)?this.activeGrip=this.grip1:this.grip2.ownsTarget(I)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},u.prototype.pointerUp=function(p){var I=this.state;j.prototype.pointerUp.call(this,p),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(p),this._state="select",I==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},u.prototype.adjustVisual=function(){},u.prototype.manipulate=function(p){this.state==="creating"?this.resize(p):this.state==="move"?(this.x1=this.manipulationStartX1+p.x-this.manipulationStartX,this.y1=this.manipulationStartY1+p.y-this.manipulationStartY,this.x2=this.manipulationStartX2+p.x-this.manipulationStartX,this.y2=this.manipulationStartY2+p.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(p)},u.prototype.resize=function(p){switch(this.activeGrip){case this.grip1:this.x1=p.x,this.y1=p.y;break;case this.grip2:case void 0:this.x2=p.x,this.y2=p.y}this.adjustVisual(),this.adjustControlBox()},u.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},u.prototype.adjustControlBox=function(){this.positionGrips()},u.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},u.prototype.createGrip=function(){var p=new Tt;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},u.prototype.positionGrips=function(){var p=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-p/2,this.y1-p/2),this.positionGrip(this.grip2.visual,this.x2-p/2,this.y2-p/2)},u.prototype.positionGrip=function(p,I,Z){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,Z),p.transform.baseVal.replaceItem(U,0)},u.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},j.prototype.getState.call(this))},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.x1=I.x1,this.y1=I.y1,this.x2=I.x2,this.y2=I.y2},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.x1=this.x1*p,this.y1=this.y1*I,this.x2=this.x2*p,this.y2=this.y2*I,this.adjustVisual(),this.adjustControlBox()},u}(et),$e=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.strokePanel=new ht("Line color",Z.defaultColorSet,Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new dt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorLine&&p!==this.visibleLine)},u.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},u.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.createVisual(),this.adjustVisual()},u.typeName="LineMarker",u.title="Line marker",u.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',u}(Et),_e=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return be.fonts=[],be.fontBoxes=[],be.fonts=I,be.currentFont=Z,be.setCurrentFont=be.setCurrentFont.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.flexGrow="2",this.fonts.forEach(function(Z){var U=document.createElement("div");U.style.display="inline-block",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/p.fonts.length-5+"%",U.style.borderColor=Z===p.currentFont?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentFont(Z,U)}),I.appendChild(U);var be=document.createElement("div");be.style.display="flex",be.style.minHeight="20px",be.style.flexGrow="2",be.style.fontFamily=Z,be.style.overflow="hidden";var Xe=document.createElement("div");Xe.style.whiteSpace="nowrap",Xe.style.overflow="hidden",Xe.style.textOverflow="ellipsis",Xe.innerHTML="The quick brown fox jumps over the lazy dog",be.appendChild(Xe),U.appendChild(be),p.fontBoxes.push(U)}),I},u.prototype.setCurrentFont=function(p,I){var Z=this;this.currentFont=p,this.fontBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},u}(vt),Je=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.color="transparent",U.padding=5,U.DEFAULT_TEXT="your text here",U.text=U.DEFAULT_TEXT,U.isMoved=!1,U.color=Z.defaultColor,U.fontFamily=Z.defaultFontFamily,U.defaultSize={x:100,y:30},U.setColor=U.setColor.bind(U),U.setFont=U.setFont.bind(U),U.renderText=U.renderText.bind(U),U.sizeText=U.sizeText.bind(U),U.textEditDivClicked=U.textEditDivClicked.bind(U),U.showTextEditor=U.showTextEditor.bind(U),U.setSize=U.setSize.bind(U),U.positionTextEditor=U.positionTextEditor.bind(U),U.colorPanel=new ht("Color",Z.defaultColorSet,Z.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.fontFamilyPanel=new _e("Font",Z.defaultFontFamilies,Z.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U}return Be(u,j),u.prototype.ownsTarget=function(p){if(j.prototype.ownsTarget.call(this,p)||p===this.visual||p===this.textElement||p===this.bgRectangle)return!0;var I=!1;return this.textElement.childNodes.forEach(function(Z){Z===p&&(I=!0)}),I},u.prototype.createVisual=function(){this.visual=se.createGroup(),this.bgRectangle=se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.isMoved=!1,this.pointerDownPoint=p,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},u.prototype.renderText=function(){var p=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(I){p.textElement.appendChild(se.createTSpan(I.trim()===""?" ":I.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},u.prototype.getTextScale=function(){var p=this.textElement.getBBox(),I=1;if(p.width>0&&p.height>0){var Z=(1*this.width-this.width*this.padding*2/100)/p.width,U=(1*this.height-this.height*this.padding*2/100)/p.height;I=Math.min(Z,U)}return I},u.prototype.getTextPosition=function(p){var I=this.textElement.getBBox(),Z=0,U=0;return I.width>0&&I.height>0&&(Z=(this.width-I.width*p)/2,U=this.height/2-I.height*p/2),{x:Z,y:U}},u.prototype.sizeText=function(){var p=this.textElement.getBBox(),I=this.getTextScale(),Z=this.getTextPosition(I);Z.y-=p.y*I,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Z.x+"px, "+Z.y+"px) scale("+I+", "+I+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Z.x,Z.y),this.textElement.transform.baseVal.getItem(1).setScale(I,I))},u.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(p.x-this.pointerDownPoint.x)>5||Math.abs(p.y-this.pointerDownPoint.y)>5)},u.prototype.resize=function(p){j.prototype.resize.call(this,p),this.isMoved=!0,this.setSize(),this.sizeText()},u.prototype.setSize=function(){j.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},u.prototype.pointerUp=function(p){var I=this.state;I==="creating"&&(this._suppressMarkerCreateEvent=!0),j.prototype.pointerUp.call(this,p),this.setSize(),(I==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},u.prototype.showTextEditor=function(){var p=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(I){I.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var I=Number.parseFloat(p.textEditor.style.fontSize);p.textEditor.clientWidth>=Number.parseInt(p.textEditor.style.maxWidth)&&I>.9;)I-=.1,p.textEditor.style.fontSize=Math.max(I,.9)+"em"}),this.textEditor.addEventListener("keyup",function(I){I.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(I){if(I.clipboardData){var Z=I.clipboardData.getData("text"),U=window.getSelection();if(!U.rangeCount)return!1;U.deleteFromDocument(),U.getRangeAt(0).insertNode(document.createTextNode(Z)),I.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){p.textEditDivClicked(p.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},u.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var p=this.getTextScale(),I=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Z=this.textElement.getBBox(),U={x:Z.width*p,y:Z.height*p};I.x-=U.x/2,I.y-=U.y/2,this.textEditor.style.top=I.y+"px",this.textEditor.style.left=I.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-I.x+"px",this.textEditor.style.fontSize=Math.max(16*p,12)+"px",this.textElement.style.display="none"}},u.prototype.textEditDivClicked=function(p){this.text=p.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},u.prototype.select=function(){j.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},u.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),j.prototype.deselect.call(this)},u.prototype.dblClick=function(p,I){j.prototype.dblClick.call(this,p,I),this.showTextEditor()},u.prototype.setColor=function(p){this.textElement&&se.setAttributes(this.textElement,[["fill",p]]),this.color=p,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(p)},u.prototype.setFont=function(p){this.textElement&&se.setAttributes(this.textElement,[["font-family",p]]),this.fontFamily=p,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},u.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},u.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){var I=p;this.color=I.color,this.fontFamily=I.fontFamily,this.padding=I.padding,this.text=I.text,this.createVisual(),j.prototype.restoreState.call(this,p),this.setSize()},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize(),this.sizeText(),this.positionTextEditor()},u.typeName="TextMarker",u.title="Text marker",u.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',u}(St),Se=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.color="transparent",U.lineWidth=3,U.drawing=!1,U.pixelRatio=1,U.color=Z.defaultColor,U.lineWidth=Z.defaultStrokeWidth,U.pixelRatio=Z.freehandPixelRatio,U.setColor=U.setColor.bind(U),U.addCanvas=U.addCanvas.bind(U),U.finishCreation=U.finishCreation.bind(U),U.setLineWidth=U.setLineWidth.bind(U),U.colorPanel=new ht("Color",Z.defaultColorSet,Z.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.lineWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.lineWidthPanel.onWidthChanged=U.setLineWidth,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.drawingImage)},u.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var p=se.createTransform();this.visual.transform.baseVal.appendItem(p),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,I){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(p.x,p.y),this.drawing=!0):j.prototype.pointerDown.call(this,p,I)},u.prototype.manipulate=function(p){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(p.x,p.y),this.canvasContext.stroke()):j.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){j.prototype.resize.call(this,p),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(p){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):j.prototype.pointerUp.call(this,p)},u.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},u.prototype.select=function(){this.state==="creating"&&this.finishCreation(),j.prototype.select.call(this)},u.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),j.prototype.deselect.call(this)},u.prototype.finishCreation=function(){for(var p=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),I=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Z=I[0],U=I[1],be=I[2],Xe=I[3],gt=!1,It=0;It<this.canvasElement.height;It++)for(var qe=0;qe<this.canvasElement.width;qe++)p.data[It*this.canvasElement.width*4+4*qe+3]>0&&(gt=!0,It<U&&(U=It),qe<Z&&(Z=qe),It>Xe&&(Xe=It),qe>be&&(be=qe));if(gt){this.left=Z/this.pixelRatio,this.top=U/this.pixelRatio,this.width=(be-Z)/this.pixelRatio,this.height=(Xe-U)/this.pixelRatio;var jt=document.createElement("canvas");jt.width=be-Z,jt.height=Xe-U,jt.getContext("2d").putImageData(this.canvasContext.getImageData(Z,U,be-Z,Xe-U),0,0),this.drawingImgUrl=jt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},u.prototype.setDrawingImage=function(){se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},u.prototype.setColor=function(p){this.color=p,this.colorChanged(p)},u.prototype.setLineWidth=function(p){this.lineWidth=p},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({drawingImgUrl:this.drawingImgUrl},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){this.createVisual(),j.prototype.restoreState.call(this,p),this.drawingImgUrl=p.drawingImgUrl,this.setDrawingImage()},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setDrawingImage()},u.typeName="FreehandMarker",u.title="Freehand marker",u.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',u}(St),me=function(j){function u(p,I,Z){var U=j.call(this,p,Z||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return U.typeBoxes=[],U.currentType=I,U.setCurrentType=U.setCurrentType.bind(U),U}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2";for(var Z=function(Xe){var gt="both";switch(Xe){case 0:gt="both";break;case 1:gt="start";break;case 2:gt="end";break;case 3:gt="none"}var It=document.createElement("div");if(It.style.display="flex",It.style.flexGrow="2",It.style.alignItems="center",It.style.justifyContent="space-between",It.style.padding="5px",It.style.borderWidth="2px",It.style.borderStyle="solid",It.style.borderColor=gt===U.currentType?U.uiStyleSettings.toolboxAccentColor:"transparent",It.addEventListener("click",function(){p.setCurrentType(gt,It)}),I.appendChild(It),gt==="both"||gt==="start"){var qe=document.createElement("div");qe.style.display="flex",qe.style.alignItems="center",qe.style.minHeight="20px",qe.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,qe.style.marginLeft="5px",It.appendChild(qe)}var jt=document.createElement("div");jt.style.display="flex",jt.style.alignItems="center",jt.style.minHeight="20px",jt.style.flexGrow="2";var Cr=document.createElement("hr");if(Cr.style.minWidth="20px",Cr.style.border="0px",Cr.style.borderTop="3px solid "+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee"),Cr.style.flexGrow="2",jt.appendChild(Cr),It.appendChild(jt),gt==="both"||gt==="end"){var Nr=document.createElement("div");Nr.style.display="flex",Nr.style.alignItems="center",Nr.style.minHeight="20px",Nr.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Nr.style.marginRight="5px",It.appendChild(Nr)}U.typeBoxes.push(It)},U=this,be=0;be<4;be++)Z(be);return I},u.prototype.setCurrentType=function(p,I){var Z=this;this.currentType=p,this.typeBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},u}(vt),ve=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.arrowType="end",U.arrowBaseHeight=10,U.arrowBaseWidth=10,U.getArrowPoints=U.getArrowPoints.bind(U),U.setArrowType=U.setArrowType.bind(U),U.arrowTypePanel=new me("Arrow type","end"),U.arrowTypePanel.onArrowTypeChanged=U.setArrowType,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.arrow1&&p!==this.arrow2)},u.prototype.getArrowPoints=function(p,I){var Z=this.arrowBaseWidth+2*this.strokeWidth,U=this.arrowBaseHeight+2*this.strokeWidth;return p-Z/2+","+(I+U/2)+" "+p+","+(I-U/2)+" "+(p+Z/2)+","+(I+U/2)},u.prototype.createTips=function(){this.arrow1=se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow2)},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(j.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.arrow1.transform.baseVal.getItem(0);I.setRotate(p,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(I,0);var Z=this.arrow2.transform.baseVal.getItem(0);Z.setRotate(p+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Z,0)}},u.prototype.setArrowType=function(p){this.arrowType=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({arrowType:this.arrowType},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.arrowType=I.arrowType,this.createTips(),this.adjustVisual()},u.typeName="ArrowMarker",u.title="Arrow marker",u.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',u}($e),ne=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.fillColor=Z.defaultFillColor,U.strokeWidth=0,U.fillPanel=new ht("Color",Z.defaultColorSet,Z.defaultFillColor),U.fillPanel.onColorChanged=U.setFillColor,U}return Be(u,j),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="CoverMarker",u.title="Cover marker",u.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',u}(lt),ie=function(j){function u(p,I,Z,U){var be=j.call(this,p,U||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return be.opacities=[],be.opacityBoxes=[],be.opacities=I,be.currentOpacity=Z,be.setCurrentOpacity=be.setCurrentOpacity.bind(be),be}return Be(u,j),u.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",I.style.justifyContent="space-between",this.opacities.forEach(function(Z){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="center",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=Z===p.currentOpacity?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentOpacity(Z,U)}),I.appendChild(U);var be=document.createElement("div");be.innerText=100*Z+"%",U.appendChild(be),p.opacityBoxes.push(U)}),I},u.prototype.setCurrentOpacity=function(p,I){var Z=this;this.currentOpacity=p,this.opacityBoxes.forEach(function(U){U.style.borderColor=U===I?Z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},u}(vt),de=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.setOpacity=U.setOpacity.bind(U),U.fillColor=Z.defaultHighlightColor,U.strokeWidth=0,U.opacity=Z.defaultHighlightOpacity,U.fillPanel=new ht("Color",Z.defaultColorSet,U.fillColor),U.fillPanel.onColorChanged=U.setFillColor,U.opacityPanel=new ie("Opacity",Z.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Be(u,j),u.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="HighlightMarker",u.title="Highlight marker",u.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',u}(ne),pe='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',xe=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.bgColor="transparent",U.tipPosition={x:0,y:0},U.tipBase1Position={x:0,y:0},U.tipBase2Position={x:0,y:0},U.tipMoving=!1,U.color=Z.defaultStrokeColor,U.bgColor=Z.defaultFillColor,U.fontFamily=Z.defaultFontFamily,U.defaultSize={x:100,y:30},U.setBgColor=U.setBgColor.bind(U),U.getTipPoints=U.getTipPoints.bind(U),U.positionTip=U.positionTip.bind(U),U.setTipPoints=U.setTipPoints.bind(U),U.colorPanel=new ht("Text color",Z.defaultColorSet,U.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),U.colorPanel.onColorChanged=U.setColor,U.bgColorPanel=new ht("Fill color",Z.defaultColorSet,U.bgColor,pe),U.bgColorPanel.onColorChanged=U.setBgColor,U.fontFamilyPanel=new _e("Font",Z.defaultFontFamilies,Z.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U.tipGrip=new Tt,U.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),U.controlBox.appendChild(U.tipGrip.visual),U}return Be(u,j),u.prototype.ownsTarget=function(p){return j.prototype.ownsTarget.call(this,p)||this.tipGrip.ownsTarget(p)||this.tip===p},u.prototype.createTip=function(){se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},u.prototype.pointerDown=function(p,I){this.state==="new"&&j.prototype.pointerDown.call(this,p,I),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(I)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):j.prototype.pointerDown.call(this,p,I)},u.prototype.pointerUp=function(p){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,j.prototype.pointerUp.call(this,p);else{var I=this.state==="creating";j.prototype.pointerUp.call(this,p),this.setTipPoints(I),this.positionTip()}},u.prototype.manipulate=function(p){if(this.tipMoving){var I=this.unrotatePoint(p);this.tipPosition={x:I.x-this.manipulationStartLeft,y:I.y-this.manipulationStartTop},this.positionTip()}else j.prototype.manipulate.call(this,p)},u.prototype.setBgColor=function(p){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",p]]),se.setAttributes(this.tip,[["fill",p]])),this.bgColor=p,this.fillColorChanged(p)},u.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},u.prototype.setTipPoints=function(p){p===void 0&&(p=!1);var I=Math.min(this.height/2,15),Z=this.height/5;p&&(this.tipPosition={x:I+Z/2,y:this.height+20});var U=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?U<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Z=this.width/5,I=Math.min(this.width/2,15),this.tipBase1Position={x:I,y:0},this.tipBase2Position={x:I+Z,y:0}):(this.tipBase1Position={x:0,y:I},this.tipBase2Position={x:0,y:I+Z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?U<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Z=this.width/5,I=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-I-Z,y:0},this.tipBase2Position={x:this.width-I,y:0}):(this.tipBase1Position={x:this.width,y:I},this.tipBase2Position={x:this.width,y:I+Z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?U<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Z=this.width/5,I=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-I-Z,y:this.height},this.tipBase2Position={x:this.width-I,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-I-Z},this.tipBase2Position={x:this.width,y:this.height-I}):U<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Z=this.width/5,I=Math.min(this.width/2,15),this.tipBase1Position={x:I,y:this.height},this.tipBase2Position={x:I+Z,y:this.height}):(this.tipBase1Position={x:0,y:this.height-I},this.tipBase2Position={x:0,y:this.height-I-Z})},u.prototype.resize=function(p){j.prototype.resize.call(this,p),this.positionTip()},u.prototype.positionTip=function(){se.setAttributes(this.tip,[["points",this.getTipPoints()]]);var p=this.tipGrip.visual.transform.baseVal.getItem(0);p.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(p,0)},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),u.prototype.select=function(){this.positionTip(),j.prototype.select.call(this)},u.prototype.getState=function(){var p=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){var I=p;this.bgColor=I.bgColor,this.tipPosition=I.tipPosition,j.prototype.restoreState.call(this,p),this.createTip(),this.setTipPoints()},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.tipPosition={x:this.tipPosition.x*p,y:this.tipPosition.y*I},this.positionTip()},u.typeName="CalloutMarker",u.title="Callout marker",u.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',u}(Je),Le=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.fillColor=Z.defaultFillColor,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.setOpacity=U.setOpacity.bind(U),U.createVisual=U.createVisual.bind(U),U.strokePanel=new ht("Line color",Te(Z.defaultColorSet,["transparent"]),Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.fillPanel=new ht("Fill color",Te(Z.defaultColorSet,["transparent"]),U.fillColor,pe),U.fillPanel.onColorChanged=U.setFillColor,U.strokeWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new dt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U.opacityPanel=new ie("Opacity",Z.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual)},u.prototype.createVisual=function(){this.visual=se.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},u.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){j.prototype.resize.call(this,p),this.setSize()},u.prototype.setSize=function(){j.prototype.setSize.call(this),se.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},u.prototype.pointerUp=function(p){j.prototype.pointerUp.call(this,p),this.setSize()},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},u.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(p),this.stateChanged()},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},u.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){var I=p;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),j.prototype.restoreState.call(this,p),this.setSize()},u.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize()},u.typeName="EllipseMarker",u.title="Ellipse marker",u.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',u}(St),je=function(j){function u(p,I,Z){return j.call(this,p,I,Z)||this}return Be(u,j),Object.defineProperty(u.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.tip1&&p!==this.tip2)},u.prototype.createTips=function(){this.tip1=se.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.tip1),this.tip2=se.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.tip2)},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(j.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(se.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.tip1.transform.baseVal.getItem(0);I.setRotate(p,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(I,0);var Z=this.tip2.transform.baseVal.getItem(0);Z.setRotate(p+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Z,0)}},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p),this.createTips(),this.adjustVisual()},u.typeName="MeasurementMarker",u.title="Measurement marker",u.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',u}($e),mt=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.strokePanel.colors=Z.defaultColorSet,U.fillColor="transparent",U}return Be(u,j),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=u.typeName,p},u.typeName="EllipseFrameMarker",u.title="Ellipse frame marker",u.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',u}(Le),Mt=function(){function j(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),j.prototype.addUndoStep=function(u){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(u)||(this.undoStack.push(u),JSON.stringify(this.lastRedoStep)!==JSON.stringify(u)&&this.redoStack.splice(0,this.redoStack.length))},j.prototype.replaceLastUndoStep=function(u){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=u)},j.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},j.prototype.undo=function(){if(this.undoStack.length>1){var u=this.undoStack.pop();return u!==void 0&&this.redoStack.push(u),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},j.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},j}(),Rt=function(j){function u(p,I,Z){var U=j.call(this,p,I,Z)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.curveX=0,U.curveY=0,U.manipulationStartCurveX=0,U.manipulationStartCurveY=0,U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.positionGrips=U.positionGrips.bind(U),U.addControlGrips=U.addControlGrips.bind(U),U.adjustVisual=U.adjustVisual.bind(U),U.setupControlBox=U.setupControlBox.bind(U),U.resize=U.resize.bind(U),U.strokeColor=Z.defaultColor,U.strokeWidth=Z.defaultStrokeWidth,U.strokeDasharray=Z.defaultStrokeDasharray,U.strokePanel=new ht("Line color",Z.defaultColorSet,Z.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new yt("Line width",Z.defaultStrokeWidths,Z.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new dt("Line style",Z.defaultStrokeDasharrays,Z.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Be(u,j),u.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorCurve&&p!==this.visibleCurve&&!this.curveGrip.ownsTarget(p))},u.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},u.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorCurve=se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=se.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=p.x,this.curveY=p.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(I)&&(this.activeGrip=this.curveGrip,this._state="resize")},u.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setupControlBox=function(){j.prototype.setupControlBox.call(this),this.curveControlLine1=se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=se.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},u.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,j.prototype.addControlGrips.call(this)},u.prototype.positionGrips=function(){j.prototype.positionGrips.call(this);var p=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-p/2,this.curveY-p/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},u.prototype.manipulate=function(p){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+p.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+p.y-this.manipulationStartY),j.prototype.manipulate.call(this,p)},u.prototype.resize=function(p){this.activeGrip===this.curveGrip&&(this.curveX=p.x,this.curveY=p.y),j.prototype.resize.call(this,p),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},u.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},u.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},u.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual()},u.prototype.scale=function(p,I){this.curveX=this.curveX*p,this.curveY=this.curveY*I,j.prototype.scale.call(this,p,I)},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},j.prototype.getState.call(this));return p.typeName=u.typeName,p},u.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.curveX=I.curveX,this.curveY=I.curveY,this.createVisual(),this.adjustVisual()},u.typeName="CurveMarker",u.title="Curve marker",u.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',u}(Et),Kt=function(){function j(u,p){p===void 0&&(p=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=u,this.cancelable=p}return Object.defineProperty(j.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),j.prototype.preventDefault=function(){this._defaultPrevented=!0},j}(),_t=function(j){function u(p,I,Z){var U=j.call(this,p,!1)||this;return U.dataUrl=I,U.state=Z,U}return Be(u,j),u}(Kt),ot=function(j){function u(p,I,Z){Z===void 0&&(Z=!1);var U=j.call(this,p,Z)||this;return U.marker=I,U}return Be(u,j),u}(Kt),Jt=function(){function j(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return j.prototype.addEventListener=function(u,p){this[u].push(p)},j.prototype.removeEventListener=function(u,p){var I=this[u].indexOf(p);I>-1&&this[u].splice(I,1)},j}(),Ut=function(){function j(u){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ie,this._isOpen=!1,this.undoRedoManager=new Mt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Jt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=j.instanceCounter++,this.styles=new ft(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=u,this.targetRoot=document.body,this.width=u.clientWidth,this.height=u.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(j.prototype,"ALL_MARKER_TYPES",{get:function(){return[Qe,Se,ve,Je,mt,Le,de,xe,je,ne,$e,Rt]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Qe,Se,ve,Je,Le,de,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Qe,Se,ve,Je,de]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(u){var p=this;this._availableMarkerTypes.splice(0),u.forEach(function(I){if(typeof I=="string"){var Z=p.ALL_MARKER_TYPES.find(function(U){return U.typeName===I});Z!==void 0&&p._availableMarkerTypes.push(Z)}else p._availableMarkerTypes.push(I)})},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(u){this._zoomLevel=u,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),j.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ze.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},j.prototype.show=function(){var u=this;this.styles.styleSheetRoot===void 0&&ct.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ct.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(p){return p(new Kt(u))})},j.prototype.render=function(){return Ue(this,void 0,void 0,function(){var u;return Ne(this,function(p){switch(p.label){case 0:return this.setCurrentMarker(),(u=new xt).naturalSize=this.renderAtNaturalSize,u.imageType=this.renderImageType,u.imageQuality=this.renderImageQuality,u.markersOnly=this.renderMarkersOnly,u.width=this.renderWidth,u.height=this.renderHeight,[4,u.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return p.sent(),[4,u.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,p.sent()]}})})},j.prototype.close=function(u){var p=this;if(u===void 0&&(u=!1),this.isOpen){var I=!1;u||this.eventListeners.beforeclose.forEach(function(Z){var U=new Kt(p,!0);Z(U),U.defaultPrevented&&(I=!0)}),I||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(Z){return Z(new Kt(p))}),this.detachEvents(),this._isOpen=!1)}},j.prototype.addMarkersToToolbar=function(){for(var u,p=[],I=0;I<arguments.length;I++)p[I]=arguments[I];(u=this._availableMarkerTypes).push.apply(u,p)},j.prototype.addRenderEventListener=function(u){this.addEventListener("render",function(p){u(p.dataUrl,p.state)})},j.prototype.removeRenderEventListener=function(u){},j.prototype.addCloseEventListener=function(u){this.addEventListener("close",function(){u()})},j.prototype.removeCloseEventListener=function(u){},j.prototype.setupResizeObserver=function(){var u=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){u.resize(u.target.clientWidth,u.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return u.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},j.prototype.onPopupTargetResize=function(){var u=1*this.target.clientWidth/this.target.clientHeight,p=this.editorCanvas.clientWidth/u>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*u:this.editorCanvas.clientWidth,I=p<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/u;this.resize(p,I)},j.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},j.prototype.resize=function(u,p){this._isResizing=!0;var I=u/this.imageWidth,Z=p/this.imageHeight;this.imageWidth=Math.round(u),this.imageHeight=Math.round(p),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(I,Z),this._isResizing=!1},j.prototype.scaleMarkers=function(u,p){var I,Z=this;this._currentMarker&&this._currentMarker instanceof Je?this._currentMarker.scale(u,p):(I=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(U){U!==Z._currentMarker&&U.scale(u,p)}),I!==void 0&&this.setCurrentMarker(I)},j.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},j.prototype.setTopLeft=function(){var u=this.editingTarget.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=u.left-p.left,this.top=u.top-p.top},j.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},j.prototype.addDefs=function(){for(var u,p=[],I=0;I<arguments.length;I++)p[I]=arguments[I];this.defs=se.createDefs(),this.addDefsToImage(),(u=this.defs).append.apply(u,p)},j.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},j.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},j.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},j.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},j.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},j.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},j.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},j.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var u=document.createElement("a");u.href="https://markerjs.com/",u.target="_blank",u.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',u.title="Powered by marker.js",u.style.display="grid",u.style.alignItems="center",u.style.justifyItems="center",u.style.padding="3px",u.style.width="20px",u.style.height="20px",this.logoUI.appendChild(u),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},j.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},j.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},j.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},j.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var u=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=u+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ke(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new ut(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},j.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},j.prototype.removeMarker=function(u){this.markerImage.removeChild(u.container),this.markers.indexOf(u)>-1&&this.markers.splice(this.markers.indexOf(u),1),u.dispose()},j.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},j.prototype.toolbarButtonClicked=function(u,p){if(u==="marker"&&p!==void 0)this.createNewMarker(p);else if(u==="action")switch(p){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},j.prototype.deleteSelectedMarker=function(){var u=this;if(this._currentMarker!==void 0){var p=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Z){var U=new ot(u,u._currentMarker,!0);Z(U),U.defaultPrevented&&(p=!0)}),!p){var I=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(Z){return Z(new ot(u,I))})}}},j.prototype.clear=function(){var u=this,p=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(be){var Xe=new ot(u,void 0,!0);be(Xe),Xe.defaultPrevented&&(p=!0)}),!p)){this.setCurrentMarker();for(var I=function(be){var Xe=Z.markers[be];Z.setCurrentMarker(Z.markers[be]),Z._currentMarker.dispose(),Z.markerImage.removeChild(Z._currentMarker.container),Z.markers.splice(Z.markers.indexOf(Z._currentMarker),1),Z.eventListeners.markerdelete.forEach(function(gt){return gt(new ot(u,Xe))})},Z=this,U=this.markers.length-1;U>=0;U--)I(U);this.addUndoStep()}},Object.defineProperty(j.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),j.prototype.showNotesEditor=function(){var u;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(u=this._currentMarker.notes)!==null&&u!==void 0?u:"",this.overlayContainer.appendChild(this.notesArea))},j.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},j.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},j.prototype.addUndoStep=function(){var u=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var p=this.getState(),I=this.undoRedoManager.getLastUndoStep();if(!I||I.width===p.width&&I.height===p.height){var Z=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(p),Z<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(U){return U(new Kt(u))})}else this.undoRedoManager.replaceLastUndoStep(p),this.eventListeners.statechange.forEach(function(U){return U(new Kt(u))})}},j.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},j.prototype.undoStep=function(){var u=this,p=this.undoRedoManager.undo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(I){return I(new Kt(u))}))},j.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},j.prototype.redoStep=function(){var u=this,p=this.undoRedoManager.redo();p!==void 0&&(this.restoreState(p),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(I){return I(new Kt(u))}))},j.prototype.stepZoom=function(){var u=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=u<this.zoomSteps.length-1?this.zoomSteps[u+1]:this.zoomSteps[0]},j.prototype.panTo=function(u){this.contentDiv.scrollBy({left:this.prevPanPoint.x-u.x,top:this.prevPanPoint.y-u.y}),this.prevPanPoint=u},j.prototype.startRenderAndClose=function(){return Ue(this,void 0,void 0,function(){var u,p,I=this;return Ne(this,function(Z){switch(Z.label){case 0:return[4,this.render()];case 1:return u=Z.sent(),p=this.getState(),this.eventListeners.render.forEach(function(U){return U(new _t(I,u,p))}),this.close(!0),[2]}})})},j.prototype.getState=function(u){u===!0&&this.setCurrentMarker();var p={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(I){return p.markers.push(I.getState())}),p},j.prototype.restoreState=function(u){var p=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);u.markers.forEach(function(I){var Z=p._availableMarkerTypes.find(function(be){return be.typeName===I.typeName});if(Z!==void 0){var U=p.addNewMarker(Z);U.restoreState(I),p.markers.push(U)}}),u.width&&u.height&&(u.width!==this.imageWidth||u.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/u.width,this.imageHeight/u.height),this.eventListeners.restorestate.forEach(function(I){return I(new Kt(p))})},j.prototype.addNewMarker=function(u){var p=se.createGroup();return this.markerImage.appendChild(p),new u(p,this.overlayContainer,this.settings)},j.prototype.createNewMarker=function(u){var p,I=this;(p=typeof u=="string"?this._availableMarkerTypes.find(function(Z){return Z.typeName===u}):u)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(p),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(p.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(Z){return Z(new ot(I,I._currentMarker))}))},j.prototype.markerCreated=function(u){var p=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(u),this.setCurrentMarker(u),u instanceof Se&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Se):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(I){return I(new ot(p,p._currentMarker))})},j.prototype.colorChanged=function(u){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=u,this.settings.defaultStrokeColor=u)},j.prototype.fillColorChanged=function(u){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=u)},j.prototype.markerStateChanged=function(u){var p=this;this.eventListeners.markerchange.forEach(function(I){return I(new ot(p,u))})},j.prototype.setCurrentMarker=function(u){var p=this;this._currentMarker!==u&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(I){return I(new ot(p,p._currentMarker))})),this._currentMarker=u,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(I){return I(new ot(p,p._currentMarker))}))},j.prototype.onPointerDown=function(u){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||u.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var p=this.markers.find(function(I){return I.ownsTarget(u.target)});p!==void 0?(this.setCurrentMarker(p),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(u.clientX,u.clientY),u.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:u.clientX,y:u.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(u.clientX,u.clientY))},j.prototype.onDblClick=function(u){if(this._isFocused||this.focus(),this.mode==="select"){var p=this.markers.find(function(I){return I.ownsTarget(u.target)});p!==void 0&&p!==this._currentMarker&&this.setCurrentMarker(p),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(u.clientX,u.clientY),u.target):this.setCurrentMarker()}},j.prototype.onPointerMove=function(u){this.touchPoints!==1&&u.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||u.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(u.clientX,u.clientY)):this.zoomLevel>1&&this.panTo({x:u.clientX,y:u.clientY}))},j.prototype.onPointerUp=function(u){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(u.clientX,u.clientY)),this.isDragging=!1,this.addUndoStep()},j.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},j.prototype.onKeyUp=function(u){this._currentMarker===void 0||this.notesArea!==void 0||u.key!=="Delete"&&u.key!=="Backspace"||this.deleteSelectedMarker()},j.prototype.clientToLocalCoordinates=function(u,p){var I=this.markerImage.getBoundingClientRect();return{x:(u-I.left)/this.zoomLevel,y:(p-I.top)/this.zoomLevel}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var u=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=u+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},j.prototype.addLicenseKey=function(u){ze.addKey(u)},j.prototype.addEventListener=function(u,p){this.eventListeners.addEventListener(u,p)},j.prototype.removeEventListener=function(u,p){this.eventListeners.removeEventListener(u,p)},j.prototype.renderState=function(u){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(u),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(j.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),j.prototype.focus=function(){var u=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(p){return p(new Kt(u))}))},j.prototype.blur=function(){var u=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(p){return p(new Kt(u))}))},j.instanceCounter=0,j}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Zt=function(j,u){return(Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,I){p.__proto__=I}||function(p,I){for(var Z in I)Object.prototype.hasOwnProperty.call(I,Z)&&(p[Z]=I[Z])})(j,u)};function nr(j,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function p(){this.constructor=j}Zt(j,u),j.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}function Ot(j,u,p,I){return new(p||(p=Promise))(function(Z,U){function be(It){try{gt(I.next(It))}catch(qe){U(qe)}}function Xe(It){try{gt(I.throw(It))}catch(qe){U(qe)}}function gt(It){var qe;It.done?Z(It.value):(qe=It.value,qe instanceof p?qe:new p(function(jt){jt(qe)})).then(be,Xe)}gt((I=I.apply(j,u||[])).next())})}function xr(j,u){var p,I,Z,U,be={label:0,sent:function(){if(1&Z[0])throw Z[1];return Z[1]},trys:[],ops:[]};return U={next:Xe(0),throw:Xe(1),return:Xe(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function Xe(gt){return function(It){return function(qe){if(p)throw new TypeError("Generator is already executing.");for(;be;)try{if(p=1,I&&(Z=2&qe[0]?I.return:qe[0]?I.throw||((Z=I.return)&&Z.call(I),0):I.next)&&!(Z=Z.call(I,qe[1])).done)return Z;switch(I=0,Z&&(qe=[2&qe[0],Z.value]),qe[0]){case 0:case 1:Z=qe;break;case 4:return be.label++,{value:qe[1],done:!1};case 5:be.label++,I=qe[1],qe=[0];continue;case 7:qe=be.ops.pop(),be.trys.pop();continue;default:if(!(Z=be.trys,(Z=Z.length>0&&Z[Z.length-1])||qe[0]!==6&&qe[0]!==2)){be=0;continue}if(qe[0]===3&&(!Z||qe[1]>Z[0]&&qe[1]<Z[3])){be.label=qe[1];break}if(qe[0]===6&&be.label<Z[1]){be.label=Z[1],Z=qe;break}if(Z&&be.label<Z[2]){be.label=Z[2],be.ops.push(qe);break}Z[2]&&be.ops.pop(),be.trys.pop();continue}qe=u.call(j,be)}catch(jt){qe=[6,jt],I=0}finally{p=Z=0}if(5&qe[0])throw qe[1];return{value:qe[0]?qe[1]:void 0,done:!0}}([gt,It])}}}var $t=function(){function j(){}return j.addKey=function(u){j.key=u},Object.defineProperty(j,"isLicensed",{get:function(){return!!j.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(j.key)},enumerable:!1,configurable:!0}),j}(),it=function(){function j(){}return j.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},j.setAttributes=function(u,p){for(var I=0,Z=p;I<Z.length;I++){var U=Z[I],be=U[0],Xe=U[1];u.setAttribute(be,Xe)}},j.createRect=function(u,p,I){var Z=document.createElementNS("http://www.w3.org/2000/svg","rect");return Z.setAttribute("width",u.toString()),Z.setAttribute("height",p.toString()),I&&j.setAttributes(Z,I),Z},j.createLine=function(u,p,I,Z,U){var be=document.createElementNS("http://www.w3.org/2000/svg","line");return be.setAttribute("x1",u.toString()),be.setAttribute("y1",p.toString()),be.setAttribute("x2",I.toString()),be.setAttribute("y2",Z.toString()),U&&j.setAttributes(be,U),be},j.createPolygon=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","polygon");return I.setAttribute("points",u),p&&j.setAttributes(I,p),I},j.createCircle=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","circle");return I.setAttribute("cx",(u/2).toString()),I.setAttribute("cy",(u/2).toString()),I.setAttribute("r",u.toString()),p&&j.setAttributes(I,p),I},j.createEllipse=function(u,p,I){var Z=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Z.setAttribute("cx",(u/2).toString()),Z.setAttribute("cy",(p/2).toString()),Z.setAttribute("rx",(u/2).toString()),Z.setAttribute("ry",(p/2).toString()),I&&j.setAttributes(Z,I),Z},j.createGroup=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","g");return u&&j.setAttributes(p,u),p},j.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},j.createMarker=function(u,p,I,Z,U,be,Xe){var gt=document.createElementNS("http://www.w3.org/2000/svg","marker");return j.setAttributes(gt,[["id",u],["orient",p],["markerWidth",I.toString()],["markerHeight",Z.toString()],["refX",U.toString()],["refY",be.toString()]]),gt.appendChild(Xe),gt},j.createText=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","text");return p.setAttribute("x","0"),p.setAttribute("y","0"),u&&j.setAttributes(p,u),p},j.createTSpan=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","tspan");return I.textContent=u,p&&j.setAttributes(I,p),I},j.createImage=function(u){var p=document.createElementNS("http://www.w3.org/2000/svg","image");return u&&j.setAttributes(p,u),p},j.createPoint=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return I.x=u,I.y=p,I},j.createPath=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg","path");return I.setAttribute("d",u),p&&j.setAttributes(I,p),I},j.createElement=function(u,p){var I=document.createElementNS("http://www.w3.org/2000/svg",u);return p&&j.setAttributes(I,p),I},j.getHollowRectanglePath=function(u,p,I,Z,U,be,Xe,gt){return"M"+u+","+p+"V"+(p+Z)+"H"+(u+I)+"V"+p+"H"+U+"V"+be+"H"+(U+Xe)+"V"+(be+gt)+"H"+U+"V"+p+"Z"},j}(),lr=function(){function j(u){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+u+"_"}return Object.defineProperty(j.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),j.prototype.addClass=function(u){return this.styleSheet===void 0&&this.addStyleSheet(),u.name=""+this.classNamePrefix+u.localName,this.classes.push(u),this.styleSheet.sheet.insertRule("."+u.name+" {"+u.style+"}",this.styleSheet.sheet.cssRules.length),u},j.prototype.addRule=function(u){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(u),this.styleSheet.sheet.insertRule(u.selector+" {"+u.style+"}",this.styleSheet.sheet.cssRules.length)},j.prototype.addStyleSheet=function(){var u;this.styleSheet=document.createElement("style"),((u=this.styleSheetRoot)!==null&&u!==void 0?u:document.head).appendChild(this.styleSheet),this.addRule(new nt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new yr("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new yr("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},j.prototype.removeStyleSheet=function(){var u;this.styleSheet&&(((u=this.styleSheetRoot)!==null&&u!==void 0?u:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},j}(),nt=function(j,u){this.selector=j,this.style=u},yr=function(j,u){this.localName=j,this.style=u},Lr=function(){function j(){this.blocks=[],this.display=""}return j.prototype.addButtonBlock=function(u){u.className=this.blockClassName,u.buttonClassName=this.buttonClassName,u.buttonColorsClassName=this.buttonColorsClassName,u.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(u)},j.prototype.addElementBlock=function(u){u.className===void 0&&(u.className=this.blockClassName),this.blocks.push(u)},j.prototype.getUI=function(){var u=document.createElement("div");return u.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,u.style.display=this.display,this.blocks.forEach(function(p){return u.appendChild(p.getUI())}),u},j}(),jr=function(){function j(){}return j.prototype.getUI=function(){var u=document.createElement("div");if(u.className=this.className,this.minWidth!==void 0&&(u.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":u.style.justifyContent="flex-start";break;case"center":u.style.justifyContent="center";break;case"end":u.style.justifyContent="flex-end"}return u.style.whiteSpace="nowrap",u},j}(),pn=function(j){function u(){var p=j!==null&&j.apply(this,arguments)||this;return p.buttons=[],p}return nr(u,j),u.prototype.addButton=function(p){p.className=this.buttonClassName,p.colorsClassName=this.buttonColorsClassName,p.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(p)},u.prototype.getUI=function(){var p=j.prototype.getUI.call(this);return this.buttons.forEach(function(I){return p.appendChild(I.getUI())}),p},u}(jr),br=function(){function j(u,p){this._isActive=!1,this._isHidden=!1,this._icon=u,this.title=p,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(j.prototype,"icon",{get:function(){return this._icon},set:function(u){this._icon=u,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isActive",{get:function(){return this._isActive},set:function(u){this._isActive=u,this.adjustClassName()},enumerable:!1,configurable:!0}),j.prototype.getUI=function(){var u=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return u.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},j.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},j.prototype.hide=function(){this._isHidden=!0},j}(),Lt=function(j){function u(){var p=j!==null&&j.apply(this,arguments)||this;return p.elements=[],p}return nr(u,j),u.prototype.addElement=function(p){this.elements.push(p)},u.prototype.getUI=function(){var p=j.prototype.getUI.call(this);return this.elements.forEach(function(I){return p.appendChild(I)}),p},u}(jr),Hn=function(){function j(u,p){this.horizontal=u,this.vertical=p}return Object.defineProperty(j.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),j.prototype.getVerticalLength=function(u){return u/this.ratio},j.prototype.getHorizontalLength=function(u){return u*this.ratio},j}(),Zn=function(){function j(){}return j.getIcon=function(u,p){if(u>0&&p>0){var I=new Hn(u,p),Z=I.ratio>=1?20:I.getHorizontalLength(20),U=I.ratio<1?20:I.getVerticalLength(20),be=document.createElementNS("http://www.w3.org/2000/svg","svg");be.setAttribute("xmlns","http://www.w3.org/2000/svg"),be.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(be);var Xe=it.createDefs();be.appendChild(Xe);var gt=it.createElement("clipPath",[["id","text-bg-clip"]]);Xe.appendChild(gt);var It=it.createPath(it.getHollowRectanglePath((24-Z)/2,(24-U)/2,Z,U,(24-Z)/2+2,(24-U)/2+2,Z-4,U-4));be.appendChild(It);var qe=it.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);qe.appendChild(it.createTSpan(u+":"+p)),be.appendChild(qe);var jt=qe.getBBox();it.setAttributes(qe,[["x",((24-jt.width)/2).toString()],["y",((24-jt.height)/2-jt.y).toString()]]);var Cr=it.createPath(it.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(jt.width))/2,(24-Math.ceil(jt.height))/2,Math.ceil(jt.width),Math.ceil(jt.height)));return gt.appendChild(Cr),it.setAttributes(It,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(be),be.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},j}(),ln=function(j){function u(p,I,Z){var U=j.call(this,p,I)||this;return U.isDropdownOpen=!1,U.onClick=U.dropdownButtonClicked,U.dropdownButtons=Z,U}return nr(u,j),u.prototype.setupDropdown=function(){var p=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(I){I.className=p.className,I.colorsClassName=p.colorsClassName,p.dropdownBlock.appendChild(I.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},u.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},u.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},u.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},u.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},u.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},u}(br),ir=function(){function j(u,p){this.GRIP_SIZE=10,this.color=u,this.fillColor=p,this.visual=it.createGroup(),this.visual.appendChild(it.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(it.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},j.prototype.setCenter=function(u,p){this.visual.childNodes.forEach(function(I){return it.setAttributes(I,[["cx",u.toString()],["cy",p.toString()]])})},j}(),Un=function(){function j(u,p,I,Z){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=u,this.canvasHeight=p,this.margin=I,this.container=Z,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(j.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(u){this._aspectRatio=u,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(u){this._isGridVisible=u,this.gridContainer&&it.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(u){this._zoomFactor=u,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),j.prototype.open=function(){var u=this;this.cropShadeElement=it.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=it.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var p=0;p<this.numberOfGridLines;p++)this.horizontalGridLines.push(it.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(it.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(I){return u.gridContainer.appendChild(I)}),this.verticalGridLines.forEach(function(I){return u.gridContainer.appendChild(I)}),this.cropRectElement=it.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ir(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ir(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ir(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ir(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},j.prototype.setCropRectangle=function(u){this.cropRect=u;var p=Object.assign({},this.cropRect);this.zoomFactor!==1&&(p.width=this.cropRect.width*this.zoomFactor,p.height=this.cropRect.height*this.zoomFactor,p.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-p.width/2,p.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-p.height/2),it.setAttributes(this.cropRectElement,[["x",p.x.toString()],["y",p.y.toString()],["width",p.width.toString()],["height",p.height.toString()]]);var I=p.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(U,be){var Xe=p.y+I*(be+1);it.setAttributes(U,[["x1",""+p.x],["y1",""+Xe],["x2",""+(p.x+p.width)],["y2",""+Xe]])});var Z=p.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(U,be){var Xe=p.x+Z*(be+1);it.setAttributes(U,[["x1",""+Xe],["y1",""+p.y],["x2",""+Xe],["y2",""+(p.y+p.height)]])}),it.setAttributes(this.cropShadeElement,[["d",it.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,p.x,p.y,p.width,p.height)]]),this.topLeftGrip.setCenter(p.x,p.y),this.topRightGrip.setCenter(p.x+p.width,p.y),this.bottomLeftGrip.setCenter(p.x,p.y+p.height),this.bottomRightGrip.setCenter(p.x+p.width,p.y+p.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},j.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},j.prototype.clientToLocalCoordinates=function(u,p){var I=this.container.getBoundingClientRect();return{x:u-I.left+this.margin,y:p-I.top+this.margin}},j.prototype.onPointerDown=function(u){this.container.setPointerCapture(u.pointerId),this.previousPoint=this.clientToLocalCoordinates(u.clientX,u.clientY),this.cropRectElement===u.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(u.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(u.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(u.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(u.target)&&(this.activeGrip=this.bottomRightGrip)},j.prototype.onPointerMove=function(u){if(this.isMoving)this.move(this.clientToLocalCoordinates(u.clientX,u.clientY));else if(this.activeGrip){var p=this.clientToLocalCoordinates(u.clientX,u.clientY);this.resize(p)}u.preventDefault()},j.prototype.onPointerUp=function(u){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(u.pointerId)},j.prototype.move=function(u){var p=u.x-this.previousPoint.x,I=u.y-this.previousPoint.y;this.zoomFactor!==1&&(p=-p/this.zoomFactor,I=-I/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+p),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+I),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=u},j.prototype.resize=function(u){var p=Object.assign({},this.cropRect),I=u.x-this.previousPoint.x,Z=u.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:p.x+I<this.margin&&(I=this.margin-p.x),p.x+=I,p.width=this.cropRect.x+this.cropRect.width-p.x;break;case this.bottomRightGrip:case this.topRightGrip:p.width+I>this.canvasWidth*this.zoomFactor&&(I=this.canvasWidth*this.zoomFactor-p.width),p.width+=I}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(p.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(I),p.height=this.aspectRatio.getVerticalLength(p.width)):(p.y+=Z,p.height=this.cropRect.y+this.cropRect.height-p.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?p.height=this.aspectRatio.getVerticalLength(p.width):p.height+=Z}p.width<10&&(p.x=this.cropRect.x,p.width=10),p.height<10&&(p.y=this.cropRect.y,p.height=10),this.previousPoint=u,p.x>=this.margin&&p.y>=this.margin&&p.x-this.margin+p.width<=this.canvasWidth&&p.y-this.margin+p.height<=this.canvasHeight&&(this.cropRect=p,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},j.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var u=this.cropRect.x+this.cropRect.width/2,p=this.cropRect.y+this.cropRect.height/2,I=this.aspectRatio.getHorizontalLength(this.cropRect.height),Z=this.aspectRatio.getVerticalLength(this.cropRect.width);I/this.canvasWidth<Z/this.canvasHeight?this.cropRect.width=I:this.cropRect.height=Z,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=u-this.cropRect.width/2,this.cropRect.y=p-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},j.prototype.getRescaledRect=function(u,p,I,Z,U,be){var Xe=I/u,gt=Z/p;return{x:(U.x-be)*Xe+be,y:(U.y-be)*gt+be,width:U.width*Xe,height:U.height*gt}},j.prototype.scaleCanvas=function(u,p){var I=this.getRescaledRect(this.canvasWidth,this.canvasHeight,u,p,this.cropRect,this.margin);this.canvasWidth=u,this.canvasHeight=p,this.onCropChange&&this.onCropChange(I),this.setCropRectangle(I)},j}(),Kn=function(){function j(u){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=u,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(j.prototype,"angle",{get:function(){return this._angle},set:function(u){this._angle=u,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),j.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},j.prototype.onPointerDown=function(u){this.controlContainer.setPointerCapture(u.pointerId),this.isDragging=!0,this.previousPoint={x:u.clientX,y:u.clientY}},j.prototype.onPointerMove=function(u){this.isDragging&&(this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.previousPoint.x=u.clientX)},j.prototype.onPointerUp=function(u){this.isDragging&&this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(u.pointerId)},j.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var u=this.angleLabelText.getBBox();it.setAttributes(this.angleLabelElement,[["x",((this.width-u.width)/2).toString()],["y",(this.height/2).toString()]])}},j.prototype.positionScaleShape=function(){if(this.scaleShape){var u=this.scaleShape.transform.baseVal.getItem(0);u.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(u,0)}},j.prototype.getVisual=function(){var u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("xmlns","http://www.w3.org/2000/svg"),u.setAttribute("width",this.width+"px"),u.setAttribute("height",this.height+"px"),u.setAttribute("viewBox","0 0 "+this.width+" "+this.height),u.style.flexShrink="0",document.body.appendChild(u);for(var p="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,I=1;I<=this.width/5+10;I++){var Z=I%5==0?this.height/3:this.height/6;p+="h4v"+-Z+"h1v"+Z}p+="v1H0Z",this.scaleShape=it.createPath(p);var U=it.createTransform();this.scaleShape.transform.baseVal.appendItem(U),u.appendChild(this.scaleShape),this.angleLabelElement=it.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=it.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var be=it.createTSpan("");return be.innerHTML="°",this.angleLabelElement.appendChild(be),u.appendChild(this.angleLabelElement),document.body.removeChild(u),u},j}(),ai=function(){function j(){this.naturalSize=!1,this.imageType="image/png"}return j.prototype.rasterize=function(u,p,I,Z,U,be,Xe){var gt=this;return new Promise(function(It){var qe=document.createElement("canvas");qe.width=u.width.baseVal.value-2*Z,qe.height=u.height.baseVal.value-2*Z;var jt=1,Cr=1;gt.naturalSize===!0?(jt=p.naturalWidth/(u.width.baseVal.value-2*Z)/be,Cr=p.naturalHeight/(u.height.baseVal.value-2*Z)/Xe,qe.width=p.naturalWidth/be,qe.height=p.naturalHeight/Xe):gt.width!==void 0&>.height!==void 0&&(jt=gt.width/I.width,Cr=gt.height/I.height,qe.width*=jt,qe.height*=Cr);var Nr=qe.getContext("2d");Nr.translate(qe.width/2,qe.height/2),Nr.rotate(U*Math.PI/180),Nr.scale(be,Xe),Nr.translate(-qe.width/2,-qe.height/2),Nr.drawImage(p,0,0,qe.width,qe.height);var Rn=document.createElement("canvas");Rn.width=I.width*jt,Rn.height=I.height*Cr,Rn.getContext("2d").putImageData(Nr.getImageData((I.x-Z)*jt,(I.y-Z)*Cr,I.width*jt,I.height*Cr),0,0),It(Rn.toDataURL(gt.imageType,gt.imageQuality))})},j}(),rt=function(){function j(u){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=j.instanceCounter++,this.styles=new lr(this.instanceNo),this.target=u,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(u){this._zoomToCropEnabled=u,u?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(u){this._isGridVisible=u,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"gridLines",{get:function(){return this._gridLines},set:function(u){this._gridLines=u,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(u){this._rotationAngle=u,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"aspectRatio",{get:function(){var u;return(u=this._aspectRatio)!==null&&u!==void 0?u:this.aspectRatios[0]},set:function(u){this._aspectRatio=u},enumerable:!1,configurable:!0}),j.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},j.prototype.show=function(){this.showUI(),this.open()},j.prototype.close=function(u){u===void 0&&(u=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),u||this.closeEventListeners.forEach(function(p){return p()}),this._isOpen=!1)},j.prototype.addRenderEventListener=function(u){this.renderEventListeners.push(u)},j.prototype.removeRenderEventListener=function(u){this.renderEventListeners.indexOf(u)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(u),1)},j.prototype.addCloseEventListener=function(u){this.closeEventListeners.push(u)},j.prototype.removeCloseEventListener=function(u){this.closeEventListeners.indexOf(u)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(u),1)},j.prototype.setupResizeObserver=function(){var u=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){u.resize(u.target.clientWidth,u.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},j.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var u=1*this.target.clientWidth/this.target.clientHeight,p=this.contentDiv.clientWidth/u>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*u:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,I=p+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/u;this.resize(p,I)}},j.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},j.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",it.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},j.prototype.resize=function(u,p){this.imageWidth=Math.round(u),this.imageHeight=Math.round(p),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},j.prototype.setEditingTarget=function(){var u=document.createElement("canvas");u.width=this.target.naturalWidth,u.height=this.target.naturalHeight,u.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var p=u.toDataURL();it.setAttributes(this.editingTarget,[["href",p]]),this.setEditingTargetSize()},j.prototype.setTopLeft=function(){var u=this.target.getBoundingClientRect(),p=this.editorCanvas.getBoundingClientRect();this.left=u.left-p.left-this.CANVAS_MARGIN,this.top=u.top-p.top-this.CANVAS_MARGIN},j.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=it.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=it.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=it.createGroup(),this.editingTargetRotationScaleContainer=it.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var u=it.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(u);var p=it.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(p),this.editingTargetContainer=it.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},j.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},j.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=it.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Un(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},j.prototype.zoomToCrop=function(){if(this.cropRect){var u=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,p=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=u+"px "+p+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-u+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-p+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},j.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},j.prototype.cropRectChanged=function(u){this.cropRect=u,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},j.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},j.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},j.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},j.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var u=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,p=this.target.offsetTop>u+this.CANVAS_MARGIN?this.target.offsetTop-(u+this.CANVAS_MARGIN):0;this.coverDiv.style.top=p+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},j.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},j.prototype.addTopToolbar=function(){var u=this;this.topToolbar=new Lr,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var p=new pn;p.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(p);var I=[];this.aspectRatios.forEach(function(Cr){var Nr=new br(Zn.getIcon(Cr.horizontal,Cr.vertical),Cr.horizontal===0&&Cr.vertical===0?"FREE":Cr.horizontal+":"+Cr.vertical);Nr.onClick=function(){return u.ratioButtonClicked(Cr)},I.push(Nr)}),this.aspectRatioButton=new ln(Zn.getIcon(0,0),"Aspect ratio",I),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,p.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Z=new br('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");Z.isActive=this.isGridVisible,Z.onClick=function(){u.isGridVisible=!u.isGridVisible,Z.isActive=u.isGridVisible},p.addButton(Z);var U=new br('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(U.isActive=this.zoomToCropEnabled,U.onClick=function(){u.zoomToCropEnabled=!u.zoomToCropEnabled,U.isActive=u.zoomToCropEnabled},p.addButton(U),!$t.isLicensed){var be=new Lt;this.topToolbar.addElementBlock(be);var Xe=document.createElement("div");Xe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var gt=document.createElement("a");gt.style.color="currentColor",gt.href="https://markerjs.com/products/cropro",gt.target="_blank",gt.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',Xe.appendChild(gt),be.addElement(Xe)}var It=new pn;It.minWidth=3*this.toolbarHeight+"px",It.contentAlign="end",this.topToolbar.addButtonBlock(It);var qe=new br('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");qe.onClick=this.startRenderAndClose,It.addButton(qe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(qe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var jt=new br('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");jt.onClick=this.close,It.addButton(jt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(jt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},j.prototype.addBottomToolbar=function(){var u=this;this.bottomToolbar=new Lr,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var p=new pn;p.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(p);var I=new br('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");I.onClick=this.rotateLeftButtonClicked,p.addButton(I);var Z=new br('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");Z.onClick=this.rotateRightButtonClicked,p.addButton(Z);var U=new Lt;U.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(U),this.straightener=new Kn("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(It){u.rotateBy(It),u.straightener.angle=u.rotationAngle},U.addElement(this.straightener.getUI());var be=new pn;be.minWidth=2*this.toolbarHeight+"px",be.contentAlign="end",this.bottomToolbar.addButtonBlock(be);var Xe=new br('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");Xe.onClick=this.flipHorizontallyButtonClicked,be.addButton(Xe);var gt=new br('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");gt.onClick=this.flipVerticallyButtonClicked,be.addButton(gt)},j.prototype.ratioButtonClicked=function(u){this.aspectRatio=u,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},j.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Zn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},j.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Hn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},j.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},j.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},j.prototype.restoreState=function(u){if(u){var p=this.cropLayer.getRescaledRect(u.width,u.height,this.imageWidth,this.imageHeight,u.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(p),this.cropRectChanged(p),this.flippedHorizontally=u.flippedHorizontally,this.flippedVertically=u.flippedVertically,this.applyFlip(),this.rotationAngle=u.rotationAngle,this.applyRotation()}},j.prototype.clientToLocalCoordinates=function(u,p){var I=this.cropImage.getBoundingClientRect();return{x:u-I.left,y:p-I.top}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var u=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=u+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},j.prototype.rotateLeftButtonClicked=function(){var u=this.rotationAngle-90;this.rotationAngle%90!=0&&(u+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(u)},j.prototype.rotateRightButtonClicked=function(){var u=this.rotationAngle+90;this.rotationAngle%90!=0&&(u-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(u)},j.prototype.rotateTo=function(u){u=(u=u>180?u-360:u)<=-180?u+360:u,this.rotationAngle=u,this.applyRotation()},j.prototype.rotateBy=function(u){this.rotateTo((this.rotationAngle+u)%360)},j.prototype.applyRotation=function(){var u=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var p=this.editingTargetRotationContainer.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(p,0);var I=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/I.width,this.imageHeight/I.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=u},j.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},j.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},j.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},j.prototype.startRenderAndClose=function(){return Ot(this,void 0,void 0,function(){var u,p;return xr(this,function(I){switch(I.label){case 0:return[4,this.render()];case 1:return u=I.sent(),p=this.getState(),this.renderEventListeners.forEach(function(Z){return Z(u,p)}),this.close(!0),[2]}})})},j.prototype.render=function(){return Ot(this,void 0,void 0,function(){var u;return xr(this,function(p){switch(p.label){case 0:return(u=new ai).naturalSize=this.renderAtNaturalSize,u.imageType=this.renderImageType,u.imageQuality=this.renderImageQuality,u.width=this.renderWidth,u.height=this.renderHeight,this.unzoomFromCrop(),it.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,u.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return p.sent(),[4,u.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,p.sent()]}})})},j.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new yr("toolbar",`
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
overflow: hidden;
|
|
line-height: 0px;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new yr("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new yr("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var u=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new yr("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*u)+`px;
|
|
height: `+(this.toolbarHeight-2*u)+`px;
|
|
padding: `+u+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new yr("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new yr("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new yr("toolbar_dropdown",`
|
|
position: absolute;
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
z-index: 20;
|
|
white-space: normal;
|
|
box-sizing: content-box;
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
line-height: 0px;
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new yr("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new yr("toolbar_straightener_block",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new yr("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*u)+`px;
|
|
padding: `+u+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new yr("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},j.instanceCounter=0,j}(),Wt=Q("8hTe"),zn=Q.n(Wt),ci=/<pre[^>]*>/g;function bi(j){var u=document.createElement("div");return u.innerHTML=j,u.childNodes.length===0?"":u.childNodes[0].nodeValue}var oi=Fe.a=function(j){var u=j.value,p=u===void 0?"":u,I=j.edit,Z=I===void 0?!1:I,U=j.className,be=j.showTextOnly,Xe=j.showLines,gt=j.replaces,It=j.zoomImg,qe=j.hasMask,jt=j.style,Cr=jt===void 0?{}:jt,Nr=j.stylesPrev,Rn=Nr===void 0?{}:Nr,bn=String(p),mn=Object(L.useRef)(),qn=Object(L.useRef)(),Rr=Object(L.useState)(""),Ft=Object(H.a)(Rr,2),Vt=Ft[0],er=Ft[1],wr=Object(L.useState)("office"),tr=Object(H.a)(wr,2),si=tr[0],nn=tr[1],Oi=function(){var Mr=new rt(qn.current);Mr.displayMode="popup",Mr.addRenderEventListener(function(){var an=Object(P.a)(_.a.mark(function cr(on){var Br;return _.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return mn.current.style.display="none",En.next=3,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on}});case 3:Br=En.sent,Br!=null&&Br.id&>(qn.current.getAttribute("src").replace(le.a.API_SERVER,""),"/api/attachments/".concat(Br==null?void 0:Br.id,"?type=").concat(Br.content_type));case 5:case"end":return En.stop()}},cr)}));return function(cr){return an.apply(this,arguments)}}()),Mr.show()},Fi=function(){var Mr=new Ut(qn.current);Mr.settings.displayMode="popup",Mr.addEventListener("render",function(){var an=Object(P.a)(_.a.mark(function cr(on){var Br;return _.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(mn.current.style.display="none",!qn.current){En.next=6;break}return En.next=4,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on.dataUrl}});case 4:Br=En.sent,Br!=null&&Br.id&>(qn.current.getAttribute("src").replace(le.a.API_SERVER,""),"/api/attachments/".concat(Br==null?void 0:Br.id,"?type=").concat(Br.content_type));case 6:case"end":return En.stop()}},cr)}));return function(cr){return an.apply(this,arguments)}}()),Mr.show(),window.markerArea=Mr},Pn=Object(L.useMemo)(function(){mn.current&&(mn.current.style.zIndex=-1);try{var $r=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Mr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,an=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;bn=bn.replace($r,"("+le.a.API_SERVER+"/api/attachments/").replace(Mr,'"'+le.a.API_SERVER+"/api/attachments/").replace(an,'"'+le.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(fi){}var cr=te(bn),on=S();if(bn.match(/\[TOC\]/)&&(cr=cr.replace("<p>[TOC]</p>",R()),v()),cr=cr.replace(/(__special_katext_id_\d+__)/g,function(fi,En){var Mn=on[En],Xi=Mn.type,Ri=Mn.expression;return Object(Ee.renderToString)(bi(Ri)||"",{displayMode:Xi==="block",throwOnError:!1,output:"html"})}),cr=cr.replace(/▁/g,"\u2581\u2581\u2581"),b(),be){var Br=document.createElement("div");return Br.innerHTML=cr,Br.innerText}return setTimeout(function(){return Ei()},500),cr},[bn]),qr=Object(L.useRef)();c.WebkitLineClamp=Xe,Xe&&(Cr=Object(D.a)(Object(D.a)({},Cr),c));function un($r){var Mr=$r.target;if(Mr.tagName.toUpperCase()==="IMG"){if(It){var an=Mr.getAttribute("src");er(an),nn("image")}}else if(Mr.tagName.toUpperCase()==="A"){var cr=Mr.getAttribute("href");if(cr.indexOf("office")>-1)$r.preventDefault(),er(cr),nn("office");else if(cr.indexOf("application/pdf")>-1)$r.preventDefault(),er(cr),nn("pdf");else if(cr.indexOf("text/html")>-1)$r.preventDefault(),er(cr),nn("html");else if(cr.startsWith("#")){$r.preventDefault();var on=document.getElementById(cr.replace("#",""));on&&on.scrollIntoView(!0)}}}var Ei=function(){var Mr,an=(Mr=qr.current)===null||Mr===void 0?void 0:Mr.querySelectorAll("video");an==null||an.forEach(function(cr){if(cr.oncontextmenu=function(){return!1},cr.src.indexOf(".m3u8")>-1&&!cr.canPlayType("application/vnd.apple.mpegurl")){if(re.a.isSupported()){var on=new re.a;on.loadSource(cr.src),on.attachMedia(cr)}}})};Object(L.useEffect)(function(){if(qr.current&&Pn&&(Pn.match(ci)&&window.PR.prettyPrint()),qr.current)return qr.current.addEventListener("click",un),function(){qr.current.removeEventListener("click",un),b(),v()}},[Pn,qr.current,un]);var hi=function(Mr){if(!Z)return;Mr.target.nodeName==="IMG"?(mn.current.style.zIndex=1,mn.current.style.display="flex",mn.current.style.width=Mr.target.clientWidth+"px",mn.current.style.height=Mr.target.clientHeight+"px",mn.current.style.top=Mr.target.offsetTop+"px",mn.current.style.left=Mr.target.offsetLeft+"px",qn.current.src=Mr.target.getAttribute("src")):mn.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:qr,style:Object(D.a)({},Cr),className:"".concat(U||""," markdown-body ").concat(zn.a.mdBody),onMouseOver:hi,dangerouslySetInnerHTML:{__html:Pn}}),y.a.createElement("div",{ref:mn,className:zn.a.button},y.a.createElement(X.a,null,y.a.createElement(K.a,{onClick:function(){return Oi()}},"\u88C1\u526A"),y.a.createElement(K.a,{onClick:function(){return Fi()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:qn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(Oe.a,{close:!0,data:Vt,type:Vt!=null&&Vt.length?si:"",style:Object(D.a)({},Rn),onClose:function(){return er("")}}))}},"9VGf":function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return M});var ae=Q("q1tI"),X=Q.n(ae);function M(K,D){var P=Object(ae.useRef)();Object(ae.useEffect)(function(){P.current=K}),Object(ae.useEffect)(function(){function H(){P.current()}if(D!==null){var W=setInterval(H,D);return function(){return clearInterval(W)}}},[D])}},"9ZNV":function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return L});var ae=Q("0Owb"),X=Q("+L6B"),M=Q("2/Rp"),K=Q("q1tI"),D=Q.n(K),P=Q("UUDw"),H=Q.n(P),W=Q("TSYQ"),_=Q.n(W),L=function(C){var k=C.cancelText,O=k===void 0?"\u53D6\u6D88":k,A=C.okText,x=A===void 0?"\u786E\u5B9A":A,d=C.loading,a=d===void 0?!1:d,l=C.hasOkBtn,s=l===void 0?!0:l,v=C.okButtonProps,c=v===void 0?{}:v,m=C.onCancel,R=m===void 0?function(){}:m,E=C.onOk,f=E===void 0?function(){}:E,g=C.className,h=g===void 0?"":g;return D.a.createElement("div",{className:_()(H.a.buttonFixed,h)},D.a.createElement("div",{className:H.a.buttonWrap},D.a.createElement(M.a,{size:"large",className:"".concat(H.a.button," mr20"),onClick:R},O),s&&D.a.createElement(M.a,Object(ae.a)({size:"large",type:"primary",className:"".concat(H.a.button," mr20"),loading:a,onClick:f},c),x)))}},"A/g1":function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4w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15ulp/tiGtPV6h0aIwaCDxUPc/F8sfOQdqTKnbrvjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"),Q("osHv"))})(function(ae){ae.defineOption("autoCloseTags",!1,function(_,L,y){if(y!=ae.Init&&y&&_.removeKeyMap("autoCloseTags"),!L)return;var C={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(C["'/'"]=function(k){return P(k)}),(typeof L!="object"||L.whenOpening!==!1)&&(C["'>'"]=function(k){return K(k)}),_.addKeyMap(C)});var X=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["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 K(_){if(_.getOption("disableInput"))return ae.Pass;for(var L=_.listSelections(),y=[],C=_.getOption("autoCloseTags"),k=0;k<L.length;k++){if(!L[k].empty())return ae.Pass;var O=L[k].head,A=_.getTokenAt(O),x=ae.innerMode(_.getMode(),A.state),d=x.state,a=x.mode.xmlCurrentTag&&x.mode.xmlCurrentTag(d),l=a&&a.name;if(!l)return ae.Pass;var s=x.mode.configuration=="html",v=typeof C=="object"&&C.dontCloseTags||s&&X,c=typeof C=="object"&&C.indentTags||s&&M;A.end>O.ch&&(l=l.slice(0,l.length-A.end+O.ch));var m=l.toLowerCase();if(!l||A.type=="string"&&(A.end!=O.ch||!/[\"\']/.test(A.string.charAt(A.string.length-1))||A.string.length==1)||A.type=="tag"&&a.close||A.string.indexOf("/")==O.ch-A.start-1||v&&H(v,m)>-1||W(_,x.mode.xmlCurrentContext&&x.mode.xmlCurrentContext(d)||[],l,O,!0))return ae.Pass;var R=typeof C=="object"&&C.emptyTags;if(R&&H(R,l)>-1){y[k]={text:"/>",newPos:ae.Pos(O.line,O.ch+2)};continue}var E=c&&H(c,m)>-1;y[k]={indent:E,text:">"+(E?`
|
|
|
|
`:"")+"</"+l+">",newPos:E?ae.Pos(O.line+1,0):ae.Pos(O.line,O.ch+1)}}for(var f=typeof C=="object"&&C.dontIndentOnAutoClose,k=L.length-1;k>=0;k--){var g=y[k];_.replaceRange(g.text,L[k].head,L[k].anchor,"+insert");var h=_.listSelections().slice(0);h[k]={head:g.newPos,anchor:g.newPos},_.setSelections(h),!f&&g.indent&&(_.indentLine(g.newPos.line,null,!0),_.indentLine(g.newPos.line+1,null,!0))}}function D(_,L){for(var y=_.listSelections(),C=[],k=L?"/":"</",O=_.getOption("autoCloseTags"),A=typeof O=="object"&&O.dontIndentOnSlash,x=0;x<y.length;x++){if(!y[x].empty())return ae.Pass;var d=y[x].head,a=_.getTokenAt(d),l=ae.innerMode(_.getMode(),a.state),s=l.state;if(L&&(a.type=="string"||a.string.charAt(0)!="<"||a.start!=d.ch-1))return ae.Pass;var v,c=l.mode.name!="xml"&&_.getMode().name=="htmlmixed";if(c&&l.mode.name=="javascript")v=k+"script";else if(c&&l.mode.name=="css")v=k+"style";else{var m=l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(s);if(!m||m.length&&W(_,m,m[m.length-1],d))return ae.Pass;v=k+m[m.length-1]}_.getLine(d.line).charAt(a.end)!=">"&&(v+=">"),C[x]=v}if(_.replaceSelections(C),y=_.listSelections(),!A)for(var x=0;x<y.length;x++)(x==y.length-1||y[x].head.line<y[x+1].head.line)&&_.indentLine(y[x].head.line)}function P(_){return _.getOption("disableInput")?ae.Pass:D(_,!0)}ae.commands.closeTag=function(_){return D(_)};function H(_,L){if(_.indexOf)return _.indexOf(L);for(var y=0,C=_.length;y<C;++y)if(_[y]==L)return y;return-1}function W(_,L,y,C,k){if(!ae.scanForClosingTag)return!1;var O=Math.min(_.lastLine()+1,C.line+500),A=ae.scanForClosingTag(_,C,null,O);if(!A||A.tag!=y)return!1;for(var x=k?1:0,d=L.length-1;d>=0&&L[d]==y;d--)++x;C=A.to;for(var d=1;d<x;d++){var a=ae.scanForClosingTag(_,C,null,O);if(!a||a.tag!=y)return!1;C=a.to}return!0}})},BjJ7:function(Ge,Fe,Q){"use strict";Q.d(Fe,"d",function(){return X}),Q.d(Fe,"c",function(){return M}),Q.d(Fe,"e",function(){return K}),Q.d(Fe,"b",function(){return D}),Q.d(Fe,"a",function(){return H});var ae=Q("m3rI");function X(W){var _=!0;if(W.length>0){for(var L=0;L<W.length;L++)if(W[L].compile_success==0||!W[L].compile_success){_=!1;break}}else _=!1;return _}function M(W){for(var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],y=0;y<W.length;y++){var C=W[y],k=_?"".concat(_,"/").concat(C.name):"".concat(C.name);L.push({title:C.name,isLeaf:!(C.type==="tree"),key:k})}return L}function K(W,_,L){for(var y=0;y<W.length;y++){var C=W[y];if(C.key===_){C.children=L;break}C.children&&K(C.children,_,L)}return W}function D(W,_,L){var y;return function(){var C=this,k=arguments,O=function(){y=null,L||W.apply(C,k)},A=L&&!y;clearTimeout(y),y=setTimeout(O,_),A&&W.apply(C,k)}}var P=!0,H=ae.a.API_SERVER},"C+DQ":function(Ge,Fe,Q){},DlQD:function(Ge,Fe,Q){(function(ae,X){Ge.exports=X()})(this,function(){"use strict";function ae(Se,me){for(var ve=0;ve<me.length;ve++){var ne=me[ve];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(Se,ne.key,ne)}}function X(Se,me,ve){return me&&ae(Se.prototype,me),ve&&ae(Se,ve),Se}function M(Se,me){if(!Se)return;if(typeof Se=="string")return K(Se,me);var ve=Object.prototype.toString.call(Se).slice(8,-1);if(ve==="Object"&&Se.constructor&&(ve=Se.constructor.name),ve==="Map"||ve==="Set")return Array.from(Se);if(ve==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ve))return K(Se,me)}function K(Se,me){(me==null||me>Se.length)&&(me=Se.length);for(var ve=0,ne=new Array(me);ve<me;ve++)ne[ve]=Se[ve];return ne}function D(Se,me){var ve;if(typeof Symbol=="undefined"||Se[Symbol.iterator]==null){if(Array.isArray(Se)||(ve=M(Se))||me&&Se&&typeof Se.length=="number"){ve&&(Se=ve);var ne=0;return function(){return ne>=Se.length?{done:!0}:{done:!1,value:Se[ne++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ve=Se[Symbol.iterator](),ve.next.bind(ve)}function P(Se,me){return me={exports:{}},Se(me,me.exports),me.exports}var H=P(function(Se){function me(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function ve(ne){Se.exports.defaults=ne}Se.exports={defaults:me(),getDefaults:me,changeDefaults:ve}}),W=H.defaults,_=H.getDefaults,L=H.changeDefaults,y=/[&<>"']/,C=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,O=/[<>"']|&(?!#?\w+;)/g,A={"&":"&","<":"<",">":">",'"':""","'":"'"},x=function(me){return A[me]};function d(Se,me){if(me){if(y.test(Se))return Se.replace(C,x)}else if(k.test(Se))return Se.replace(O,x);return Se}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function l(Se){return Se.replace(a,function(me,ve){return ve=ve.toLowerCase(),ve==="colon"?":":ve.charAt(0)==="#"?ve.charAt(1)==="x"?String.fromCharCode(parseInt(ve.substring(2),16)):String.fromCharCode(+ve.substring(1)):""})}var s=/(^|[^\[])\^/g;function v(Se,me){Se=Se.source||Se,me=me||"";var ve={replace:function(ie,de){return de=de.source||de,de=de.replace(s,"$1"),Se=Se.replace(ie,de),ve},getRegex:function(){return new RegExp(Se,me)}};return ve}var c=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Se,me,ve){if(Se){var ne;try{ne=decodeURIComponent(l(ve)).replace(c,"").toLowerCase()}catch(ie){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}me&&!m.test(ve)&&(ve=o(me,ve));try{ve=encodeURI(ve).replace(/%25/g,"%")}catch(ie){return null}return ve}var E={},f=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(Se,me){E[" "+Se]||(f.test(Se)?E[" "+Se]=Se+"/":E[" "+Se]=N(Se,"/",!0)),Se=E[" "+Se];var ve=Se.indexOf(":")===-1;return me.substring(0,2)==="//"?ve?me:Se.replace(g,"$1")+me:me.charAt(0)==="/"?ve?me:Se.replace(h,"$1")+me:Se+me}var S={exec:function(){}};function b(Se){for(var me=1,ve,ne;me<arguments.length;me++){ve=arguments[me];for(ne in ve)Object.prototype.hasOwnProperty.call(ve,ne)&&(Se[ne]=ve[ne])}return Se}function T(Se,me){var ve=Se.replace(/\|/g,function(de,pe,xe){for(var Le=!1,je=pe;--je>=0&&xe[je]==="\\";)Le=!Le;return Le?"|":" |"}),ne=ve.split(/ \|/),ie=0;if(ne.length>me)ne.splice(me);else for(;ne.length<me;)ne.push("");for(;ie<ne.length;ie++)ne[ie]=ne[ie].trim().replace(/\\\|/g,"|");return ne}function N(Se,me,ve){var ne=Se.length;if(ne===0)return"";for(var ie=0;ie<ne;){var de=Se.charAt(ne-ie-1);if(de===me&&!ve)ie++;else if(de!==me&&ve)ie++;else break}return Se.substr(0,ne-ie)}function z(Se,me){if(Se.indexOf(me[1])===-1)return-1;for(var ve=Se.length,ne=0,ie=0;ie<ve;ie++)if(Se[ie]==="\\")ie++;else if(Se[ie]===me[0])ne++;else if(Se[ie]===me[1]&&(ne--,ne<0))return ie;return-1}function Y(Se){Se&&Se.sanitize&&!Se.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var te={escape:d,unescape:l,edit:v,cleanUrl:R,resolveUrl:o,noopTest:S,merge:b,splitCells:T,rtrim:N,findClosingBracket:z,checkSanitizeDeprecation:Y},G=H.defaults,F=te.rtrim,re=te.splitCells,le=te.escape,Ee=te.findClosingBracket;function Oe(Se,me,ve){var ne=me.href,ie=me.title?le(me.title):null,de=Se[1].replace(/\\([\[\]])/g,"$1");return Se[0].charAt(0)!=="!"?{type:"link",raw:ve,href:ne,title:ie,text:de}:{type:"image",raw:ve,href:ne,title:ie,text:le(de)}}function Ye(Se,me){var ve=Se.match(/^(\s+)(?:```)/);if(ve===null)return me;var ne=ve[1];return me.split(`
|
|
`).map(function(ie){var de=ie.match(/^\s+/);if(de===null)return ie;var pe=de[0];return pe.length>=ne.length?ie.slice(ne.length):ie}).join(`
|
|
`)}var Pe=function(){function Se(ve){this.options=ve||G}var me=Se.prototype;return me.space=function(ne){var ie=this.rules.block.newline.exec(ne);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
|
|
`}},me.code=function(ne,ie){var de=this.rules.block.code.exec(ne);if(de){var pe=ie[ie.length-1];if(pe&&pe.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var xe=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?xe:F(xe,`
|
|
`)}}},me.fences=function(ne){var ie=this.rules.block.fences.exec(ne);if(ie){var de=ie[0],pe=Ye(de,ie[3]||"");return{type:"code",raw:de,lang:ie[2]?ie[2].trim():ie[2],text:pe}}},me.heading=function(ne){var ie=this.rules.block.heading.exec(ne);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},me.nptable=function(ne){var ie=this.rules.block.nptable.exec(ne);if(ie){var de={type:"table",header:re(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ie[0]};if(de.header.length===de.align.length){var pe=de.align.length,xe;for(xe=0;xe<pe;xe++)/^ *-+: *$/.test(de.align[xe])?de.align[xe]="right":/^ *:-+: *$/.test(de.align[xe])?de.align[xe]="center":/^ *:-+ *$/.test(de.align[xe])?de.align[xe]="left":de.align[xe]=null;for(pe=de.cells.length,xe=0;xe<pe;xe++)de.cells[xe]=re(de.cells[xe],de.header.length);return de}}},me.hr=function(ne){var ie=this.rules.block.hr.exec(ne);if(ie)return{type:"hr",raw:ie[0]}},me.blockquote=function(ne){var ie=this.rules.block.blockquote.exec(ne);if(ie){var de=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:de}}},me.list=function(ne){var ie=this.rules.block.list.exec(ne);if(ie){for(var de=ie[0],pe=ie[2],xe=pe.length>1,Le=pe[pe.length-1]===")",je={type:"list",raw:de,ordered:xe,start:xe?+pe.slice(0,-1):"",loose:!1,items:[]},mt=ie[0].match(this.rules.block.item),Mt=!1,Rt,Kt,_t,ot,Jt,Ut,Zt,nr=mt.length,Ot=0;Ot<nr;Ot++)Rt=mt[Ot],de=Rt,Kt=Rt.length,Rt=Rt.replace(/^ *([*+-]|\d+[.)]) */,""),~Rt.indexOf(`
|
|
`)&&(Kt-=Rt.length,Rt=this.options.pedantic?Rt.replace(/^ {1,4}/gm,""):Rt.replace(new RegExp("^ {1,"+Kt+"}","gm"),"")),Ot!==nr-1&&(_t=this.rules.block.bullet.exec(mt[Ot+1])[0],(xe?_t.length===1||!Le&&_t[_t.length-1]===")":_t.length>1||this.options.smartLists&&_t!==pe)&&(ot=mt.slice(Ot+1).join(`
|
|
`),je.raw=je.raw.substring(0,je.raw.length-ot.length),Ot=nr-1)),Jt=Mt||/\n\n(?!\s*$)/.test(Rt),Ot!==nr-1&&(Mt=Rt.charAt(Rt.length-1)===`
|
|
`,Jt||(Jt=Mt)),Jt&&(je.loose=!0),Ut=/^\[[ xX]\] /.test(Rt),Zt=void 0,Ut&&(Zt=Rt[1]!==" ",Rt=Rt.replace(/^\[[ xX]\] +/,"")),je.items.push({type:"list_item",raw:de,task:Ut,checked:Zt,loose:Jt,text:Rt});return je}},me.html=function(ne){var ie=this.rules.block.html.exec(ne);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):le(ie[0]):ie[0]}},me.def=function(ne){var ie=this.rules.block.def.exec(ne);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var de=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:ie[0],href:ie[2],title:ie[3]}}},me.table=function(ne){var ie=this.rules.block.table.exec(ne);if(ie){var de={type:"table",header:re(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
|
|
`):[]};if(de.header.length===de.align.length){de.raw=ie[0];var pe=de.align.length,xe;for(xe=0;xe<pe;xe++)/^ *-+: *$/.test(de.align[xe])?de.align[xe]="right":/^ *:-+: *$/.test(de.align[xe])?de.align[xe]="center":/^ *:-+ *$/.test(de.align[xe])?de.align[xe]="left":de.align[xe]=null;for(pe=de.cells.length,xe=0;xe<pe;xe++)de.cells[xe]=re(de.cells[xe].replace(/^ *\| *| *\| *$/g,""),de.header.length);return de}}},me.lheading=function(ne){var ie=this.rules.block.lheading.exec(ne);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},me.paragraph=function(ne){var ie=this.rules.block.paragraph.exec(ne);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
|
|
`?ie[1].slice(0,-1):ie[1]}},me.text=function(ne,ie){var de=this.rules.block.text.exec(ne);if(de){var pe=ie[ie.length-1];return pe&&pe.type==="text"?{raw:de[0],text:de[0]}:{type:"text",raw:de[0],text:de[0]}}},me.escape=function(ne){var ie=this.rules.inline.escape.exec(ne);if(ie)return{type:"escape",raw:ie[0],text:le(ie[1])}},me.tag=function(ne,ie,de){var pe=this.rules.inline.tag.exec(ne);if(pe)return!ie&&/^<a /i.test(pe[0])?ie=!0:ie&&/^<\/a>/i.test(pe[0])&&(ie=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(pe[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(pe[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:pe[0],inLink:ie,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):le(pe[0]):pe[0]}},me.link=function(ne){var ie=this.rules.inline.link.exec(ne);if(ie){var de=Ee(ie[2],"()");if(de>-1){var pe=ie[0].indexOf("!")===0?5:4,xe=pe+ie[1].length+de;ie[2]=ie[2].substring(0,de),ie[0]=ie[0].substring(0,xe).trim(),ie[3]=""}var Le=ie[2],je="";if(this.options.pedantic){var mt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);mt?(Le=mt[1],je=mt[3]):je=""}else je=ie[3]?ie[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var Mt=Oe(ie,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:je&&je.replace(this.rules.inline._escapes,"$1")},ie[0]);return Mt}},me.reflink=function(ne,ie){var de;if((de=this.rules.inline.reflink.exec(ne))||(de=this.rules.inline.nolink.exec(ne))){var pe=(de[2]||de[1]).replace(/\s+/g," ");if(pe=ie[pe.toLowerCase()],!pe||!pe.href){var xe=de[0].charAt(0);return{type:"text",raw:xe,text:xe}}var Le=Oe(de,pe,de[0]);return Le}},me.strong=function(ne,ie,de){de===void 0&&(de="");var pe=this.rules.inline.strong.start.exec(ne);if(pe&&(!pe[1]||pe[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ie=ie.slice(-1*ne.length);var xe=pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;xe.lastIndex=0;for(var Le;(pe=xe.exec(ie))!=null;)if(Le=this.rules.inline.strong.middle.exec(ie.slice(0,pe.index+3)),Le)return{type:"strong",raw:ne.slice(0,Le[0].length),text:ne.slice(2,Le[0].length-2)}}},me.em=function(ne,ie,de){de===void 0&&(de="");var pe=this.rules.inline.em.start.exec(ne);if(pe&&(!pe[1]||pe[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ie=ie.slice(-1*ne.length);var xe=pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;xe.lastIndex=0;for(var Le;(pe=xe.exec(ie))!=null;)if(Le=this.rules.inline.em.middle.exec(ie.slice(0,pe.index+2)),Le)return{type:"em",raw:ne.slice(0,Le[0].length),text:ne.slice(1,Le[0].length-1)}}},me.codespan=function(ne){var ie=this.rules.inline.code.exec(ne);if(ie){var de=ie[2].replace(/\n/g," "),pe=/[^ ]/.test(de),xe=de.startsWith(" ")&&de.endsWith(" ");return pe&&xe&&(de=de.substring(1,de.length-1)),de=le(de,!0),{type:"codespan",raw:ie[0],text:de}}},me.br=function(ne){var ie=this.rules.inline.br.exec(ne);if(ie)return{type:"br",raw:ie[0]}},me.del=function(ne){var ie=this.rules.inline.del.exec(ne);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},me.autolink=function(ne,ie){var de=this.rules.inline.autolink.exec(ne);if(de){var pe,xe;return de[2]==="@"?(pe=le(this.options.mangle?ie(de[1]):de[1]),xe="mailto:"+pe):(pe=le(de[1]),xe=pe),{type:"link",raw:de[0],text:pe,href:xe,tokens:[{type:"text",raw:pe,text:pe}]}}},me.url=function(ne,ie){var de;if(de=this.rules.inline.url.exec(ne)){var pe,xe;if(de[2]==="@")pe=le(this.options.mangle?ie(de[0]):de[0]),xe="mailto:"+pe;else{var Le;do Le=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(Le!==de[0]);pe=le(de[0]),de[1]==="www."?xe="http://"+pe:xe=pe}return{type:"link",raw:de[0],text:pe,href:xe,tokens:[{type:"text",raw:pe,text:pe}]}}},me.inlineText=function(ne,ie,de){var pe=this.rules.inline.text.exec(ne);if(pe){var xe;return ie?xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(pe[0]):le(pe[0]):pe[0]:xe=le(this.options.smartypants?de(pe[0]):pe[0]),{type:"text",raw:pe[0],text:xe}}},Se}(),Be=te.noopTest,Ue=te.edit,Ne=te.merge,Te={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Be,table:Be,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Te._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Te.def=Ue(Te.def).replace("label",Te._label).replace("title",Te._title).getRegex(),Te.bullet=/(?:[*+-]|\d{1,9}[.)])/,Te.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Te.item=Ue(Te.item,"gm").replace(/bull/g,Te.bullet).getRegex(),Te.list=Ue(Te.list).replace(/bull/g,Te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Te.def.source+")").getRegex(),Te._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",Te._comment=/<!--(?!-?>)[\s\S]*?-->/,Te.html=Ue(Te.html,"i").replace("comment",Te._comment).replace("tag",Te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Te.paragraph=Ue(Te._paragraph).replace("hr",Te.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Te._tag).getRegex(),Te.blockquote=Ue(Te.blockquote).replace("paragraph",Te.paragraph).getRegex(),Te.normal=Ne({},Te),Te.gfm=Ne({},Te.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*|$)"}),Te.gfm.nptable=Ue(Te.gfm.nptable).replace("hr",Te.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Te._tag).getRegex(),Te.gfm.table=Ue(Te.gfm.table).replace("hr",Te.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Te._tag).getRegex(),Te.pedantic=Ne({},Te.normal,{html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Te._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Be,paragraph:Ue(Te.normal._paragraph).replace("hr",Te.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",Te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Be,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Be,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",se.punctuation=Ue(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=Ue(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=Ue(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=Ue(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=Ue(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=Ue(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=Ue(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=Ue(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=Ue(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=Ue(se._blockSkip,"g").getRegex(),se.overlapSkip=Ue(se._overlapSkip,"g").getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=Ue(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=Ue(se.tag).replace("comment",Te._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=Ue(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=Ue(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=Ue(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=Ne({},se),se.pedantic=Ne({},se.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:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=Ne({},se.normal,{escape:Ue(se.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),se.gfm.url=Ue(se.gfm.url,"i").replace("email",se.gfm._extended_email).getRegex(),se.breaks=Ne({},se.gfm,{br:Ue(se.br).replace("{2,}","*").getRegex(),text:Ue(se.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ze={block:Te,inline:se},xt=H.defaults,ct=ze.block,ft=ze.inline;function Ct(Se){return Se.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function He(Se){var me="",ve,ne,ie=Se.length;for(ve=0;ve<ie;ve++)ne=Se.charCodeAt(ve),Math.random()>.5&&(ne="x"+ne.toString(16)),me+="&#"+ne+";";return me}var Ke=function(){function Se(ve){this.tokens=[],this.tokens.links=Object.create(null),this.options=ve||xt,this.options.tokenizer=this.options.tokenizer||new Pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:ct.normal,inline:ft.normal};this.options.pedantic?(ne.block=ct.pedantic,ne.inline=ft.pedantic):this.options.gfm&&(ne.block=ct.gfm,this.options.breaks?ne.inline=ft.breaks:ne.inline=ft.gfm),this.tokenizer.rules=ne}Se.lex=function(ne,ie){var de=new Se(ie);return de.lex(ne)};var me=Se.prototype;return me.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},me.blockTokens=function(ne,ie,de){ie===void 0&&(ie=[]),de===void 0&&(de=!0),ne=ne.replace(/^ +$/gm,"");for(var pe,xe,Le,je;ne;){if(pe=this.tokenizer.space(ne)){ne=ne.substring(pe.raw.length),pe.type&&ie.push(pe);continue}if(pe=this.tokenizer.code(ne,ie)){ne=ne.substring(pe.raw.length),pe.type?ie.push(pe):(je=ie[ie.length-1],je.raw+=`
|
|
`+pe.raw,je.text+=`
|
|
`+pe.text);continue}if(pe=this.tokenizer.fences(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.heading(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.nptable(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.hr(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.blockquote(ne)){ne=ne.substring(pe.raw.length),pe.tokens=this.blockTokens(pe.text,[],de),ie.push(pe);continue}if(pe=this.tokenizer.list(ne)){for(ne=ne.substring(pe.raw.length),Le=pe.items.length,xe=0;xe<Le;xe++)pe.items[xe].tokens=this.blockTokens(pe.items[xe].text,[],!1);ie.push(pe);continue}if(pe=this.tokenizer.html(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(de&&(pe=this.tokenizer.def(ne))){ne=ne.substring(pe.raw.length),this.tokens.links[pe.tag]||(this.tokens.links[pe.tag]={href:pe.href,title:pe.title});continue}if(pe=this.tokenizer.table(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.lheading(ne)){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(de&&(pe=this.tokenizer.paragraph(ne))){ne=ne.substring(pe.raw.length),ie.push(pe);continue}if(pe=this.tokenizer.text(ne,ie)){ne=ne.substring(pe.raw.length),pe.type?ie.push(pe):(je=ie[ie.length-1],je.raw+=`
|
|
`+pe.raw,je.text+=`
|
|
`+pe.text);continue}if(ne){var mt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(mt);break}else throw new Error(mt)}}return ie},me.inline=function(ne){var ie,de,pe,xe,Le,je,mt=ne.length;for(ie=0;ie<mt;ie++){je=ne[ie];switch(je.type){case"paragraph":case"text":case"heading":{je.tokens=[],this.inlineTokens(je.text,je.tokens);break}case"table":{for(je.tokens={header:[],cells:[]},xe=je.header.length,de=0;de<xe;de++)je.tokens.header[de]=[],this.inlineTokens(je.header[de],je.tokens.header[de]);for(xe=je.cells.length,de=0;de<xe;de++)for(Le=je.cells[de],je.tokens.cells[de]=[],pe=0;pe<Le.length;pe++)je.tokens.cells[de][pe]=[],this.inlineTokens(Le[pe],je.tokens.cells[de][pe]);break}case"blockquote":{this.inline(je.tokens);break}case"list":{for(xe=je.items.length,de=0;de<xe;de++)this.inline(je.items[de].tokens);break}}}return ne},me.inlineTokens=function(ne,ie,de,pe,xe){ie===void 0&&(ie=[]),de===void 0&&(de=!1),pe===void 0&&(pe=!1),xe===void 0&&(xe="");var Le,je=ne,mt;if(this.tokens.links){var Mt=Object.keys(this.tokens.links);if(Mt.length>0)for(;(mt=this.tokenizer.rules.inline.reflinkSearch.exec(je))!=null;)Mt.includes(mt[0].slice(mt[0].lastIndexOf("[")+1,-1))&&(je=je.slice(0,mt.index)+"["+"a".repeat(mt[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(mt=this.tokenizer.rules.inline.blockSkip.exec(je))!=null;)je=je.slice(0,mt.index)+"["+"a".repeat(mt[0].length-2)+"]"+je.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Le=this.tokenizer.escape(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.tag(ne,de,pe)){ne=ne.substring(Le.raw.length),de=Le.inLink,pe=Le.inRawBlock,ie.push(Le);continue}if(Le=this.tokenizer.link(ne)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,pe)),ie.push(Le);continue}if(Le=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,pe)),ie.push(Le);continue}if(Le=this.tokenizer.strong(ne,je,xe)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],de,pe),ie.push(Le);continue}if(Le=this.tokenizer.em(ne,je,xe)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],de,pe),ie.push(Le);continue}if(Le=this.tokenizer.codespan(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.br(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.del(ne)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],de,pe),ie.push(Le);continue}if(Le=this.tokenizer.autolink(ne,He)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(!de&&(Le=this.tokenizer.url(ne,He))){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.inlineText(ne,pe,Ct)){ne=ne.substring(Le.raw.length),xe=Le.raw.slice(-1),ie.push(Le);continue}if(ne){var Rt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(Rt);break}else throw new Error(Rt)}}return ie},X(Se,null,[{key:"rules",get:function(){return{block:ct,inline:ft}}}]),Se}(),ut=H.defaults,vt=te.cleanUrl,ht=te.escape,et=function(){function Se(ve){this.options=ve||ut}var me=Se.prototype;return me.code=function(ne,ie,de){var pe=(ie||"").match(/\S*/)[0];if(this.options.highlight){var xe=this.options.highlight(ne,pe);xe!=null&&xe!==ne&&(de=!0,ne=xe)}return pe?'<pre><code class="'+this.options.langPrefix+ht(pe,!0)+'">'+(de?ne:ht(ne,!0))+`</code></pre>
|
|
`:"<pre><code>"+(de?ne:ht(ne,!0))+`</code></pre>
|
|
`},me.blockquote=function(ne){return`<blockquote>
|
|
`+ne+`</blockquote>
|
|
`},me.html=function(ne){return ne},me.heading=function(ne,ie,de,pe){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+pe.slug(de)+'">'+ne+"</h"+ie+`>
|
|
`:"<h"+ie+">"+ne+"</h"+ie+`>
|
|
`},me.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},me.list=function(ne,ie,de){var pe=ie?"ol":"ul",xe=ie&&de!==1?' start="'+de+'"':"";return"<"+pe+xe+`>
|
|
`+ne+"</"+pe+`>
|
|
`},me.listitem=function(ne){return"<li>"+ne+`</li>
|
|
`},me.checkbox=function(ne){return"<input "+(ne?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},me.paragraph=function(ne){return"<p>"+ne+`</p>
|
|
`},me.table=function(ne,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ne+`</thead>
|
|
`+ie+`</table>
|
|
`},me.tablerow=function(ne){return`<tr>
|
|
`+ne+`</tr>
|
|
`},me.tablecell=function(ne,ie){var de=ie.header?"th":"td",pe=ie.align?"<"+de+' align="'+ie.align+'">':"<"+de+">";return pe+ne+"</"+de+`>
|
|
`},me.strong=function(ne){return"<strong>"+ne+"</strong>"},me.em=function(ne){return"<em>"+ne+"</em>"},me.codespan=function(ne){return"<code>"+ne+"</code>"},me.br=function(){return this.options.xhtml?"<br/>":"<br>"},me.del=function(ne){return"<del>"+ne+"</del>"},me.link=function(ne,ie,de){if(ne=vt(this.options.sanitize,this.options.baseUrl,ne),ne===null)return de;var pe='<a href="'+ht(ne)+'"';return ie&&(pe+=' title="'+ie+'"'),pe+=">"+de+"</a>",pe},me.image=function(ne,ie,de){if(ne=vt(this.options.sanitize,this.options.baseUrl,ne),ne===null)return de;var pe='<img src="'+ne+'" alt="'+de+'"';return ie&&(pe+=' title="'+ie+'"'),pe+=this.options.xhtml?"/>":">",pe},me.text=function(ne){return ne},Se}(),Ze=function(){function Se(){}var me=Se.prototype;return me.strong=function(ne){return ne},me.em=function(ne){return ne},me.codespan=function(ne){return ne},me.del=function(ne){return ne},me.html=function(ne){return ne},me.text=function(ne){return ne},me.link=function(ne,ie,de){return""+de},me.image=function(ne,ie,de){return""+de},me.br=function(){return""},Se}(),Tt=function(){function Se(){this.seen={}}var me=Se.prototype;return me.slug=function(ne){var ie=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var de=ie;do this.seen[de]++,ie=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},Se}(),bt=H.defaults,St=te.unescape,lt=function(){function Se(ve){this.options=ve||bt,this.options.renderer=this.options.renderer||new et,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ze,this.slugger=new Tt}Se.parse=function(ne,ie){var de=new Se(ie);return de.parse(ne)};var me=Se.prototype;return me.parse=function(ne,ie){ie===void 0&&(ie=!0);var de="",pe,xe,Le,je,mt,Mt,Rt,Kt,_t,ot,Jt,Ut,Zt,nr,Ot,xr,$t,it,lr=ne.length;for(pe=0;pe<lr;pe++){ot=ne[pe];switch(ot.type){case"space":continue;case"hr":{de+=this.renderer.hr();continue}case"heading":{de+=this.renderer.heading(this.parseInline(ot.tokens),ot.depth,St(this.parseInline(ot.tokens,this.textRenderer)),this.slugger);continue}case"code":{de+=this.renderer.code(ot.text,ot.lang,ot.escaped);continue}case"table":{for(Kt="",Rt="",je=ot.header.length,xe=0;xe<je;xe++)Rt+=this.renderer.tablecell(this.parseInline(ot.tokens.header[xe]),{header:!0,align:ot.align[xe]});for(Kt+=this.renderer.tablerow(Rt),_t="",je=ot.cells.length,xe=0;xe<je;xe++){for(Mt=ot.tokens.cells[xe],Rt="",mt=Mt.length,Le=0;Le<mt;Le++)Rt+=this.renderer.tablecell(this.parseInline(Mt[Le]),{header:!1,align:ot.align[Le]});_t+=this.renderer.tablerow(Rt)}de+=this.renderer.table(Kt,_t);continue}case"blockquote":{_t=this.parse(ot.tokens),de+=this.renderer.blockquote(_t);continue}case"list":{for(Jt=ot.ordered,Ut=ot.start,Zt=ot.loose,je=ot.items.length,_t="",xe=0;xe<je;xe++)Ot=ot.items[xe],xr=Ot.checked,$t=Ot.task,nr="",Ot.task&&(it=this.renderer.checkbox(xr),Zt?Ot.tokens.length>0&&Ot.tokens[0].type==="text"?(Ot.tokens[0].text=it+" "+Ot.tokens[0].text,Ot.tokens[0].tokens&&Ot.tokens[0].tokens.length>0&&Ot.tokens[0].tokens[0].type==="text"&&(Ot.tokens[0].tokens[0].text=it+" "+Ot.tokens[0].tokens[0].text)):Ot.tokens.unshift({type:"text",text:it}):nr+=it),nr+=this.parse(Ot.tokens,Zt),_t+=this.renderer.listitem(nr,$t,xr);de+=this.renderer.list(_t,Jt,Ut);continue}case"html":{de+=this.renderer.html(ot.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(_t=ot.tokens?this.parseInline(ot.tokens):ot.text;pe+1<lr&&ne[pe+1].type==="text";)ot=ne[++pe],_t+=`
|
|
`+(ot.tokens?this.parseInline(ot.tokens):ot.text);de+=ie?this.renderer.paragraph(_t):_t;continue}default:{var nt='Token with "'+ot.type+'" type was not found.';if(this.options.silent){console.error(nt);return}else throw new Error(nt)}}}return de},me.parseInline=function(ne,ie){ie=ie||this.renderer;var de="",pe,xe,Le=ne.length;for(pe=0;pe<Le;pe++){xe=ne[pe];switch(xe.type){case"escape":{de+=ie.text(xe.text);break}case"html":{de+=ie.html(xe.text);break}case"link":{de+=ie.link(xe.href,xe.title,this.parseInline(xe.tokens,ie));break}case"image":{de+=ie.image(xe.href,xe.title,xe.text);break}case"strong":{de+=ie.strong(this.parseInline(xe.tokens,ie));break}case"em":{de+=ie.em(this.parseInline(xe.tokens,ie));break}case"codespan":{de+=ie.codespan(xe.text);break}case"br":{de+=ie.br();break}case"del":{de+=ie.del(this.parseInline(xe.tokens,ie));break}case"text":{de+=ie.text(xe.text);break}default:{var je='Token with "'+xe.type+'" type was not found.';if(this.options.silent){console.error(je);return}else throw new Error(je)}}}return de},Se}(),yt=te.merge,dt=te.checkSanitizeDeprecation,Qe=te.escape,Ie=H.getDefaults,Et=H.changeDefaults,$e=H.defaults;function _e(Se,me,ve){if(typeof Se=="undefined"||Se===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Se!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Se)+", string expected");if(typeof me=="function"&&(ve=me,me=null),me=yt({},_e.defaults,me||{}),dt(me),ve){var ne=me.highlight,ie;try{ie=Ke.lex(Se,me)}catch(Le){return ve(Le)}var de=function(je){var mt;if(!je)try{mt=lt.parse(ie,me)}catch(Mt){je=Mt}return me.highlight=ne,je?ve(je):ve(null,mt)};if(!ne||ne.length<3)return de();if(delete me.highlight,!ie.length)return de();var pe=0;_e.walkTokens(ie,function(Le){Le.type==="code"&&(pe++,setTimeout(function(){ne(Le.text,Le.lang,function(je,mt){if(je)return de(je);mt!=null&&mt!==Le.text&&(Le.text=mt,Le.escaped=!0),pe--,pe===0&&de()})},0))}),pe===0&&de();return}try{var xe=Ke.lex(Se,me);return me.walkTokens&&_e.walkTokens(xe,me.walkTokens),lt.parse(xe,me)}catch(Le){if(Le.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,me.silent)return"<p>An error occurred:</p><pre>"+Qe(Le.message+"",!0)+"</pre>";throw Le}}_e.options=_e.setOptions=function(Se){return yt(_e.defaults,Se),Et(_e.defaults),_e},_e.getDefaults=Ie,_e.defaults=$e,_e.use=function(Se){var me=yt({},Se);if(Se.renderer&&function(){var ne=_e.defaults.renderer||new et,ie=function(xe){var Le=ne[xe];ne[xe]=function(){for(var je=arguments.length,mt=new Array(je),Mt=0;Mt<je;Mt++)mt[Mt]=arguments[Mt];var Rt=Se.renderer[xe].apply(ne,mt);return Rt===!1&&(Rt=Le.apply(ne,mt)),Rt}};for(var de in Se.renderer)ie(de);me.renderer=ne}(),Se.tokenizer&&function(){var ne=_e.defaults.tokenizer||new Pe,ie=function(xe){var Le=ne[xe];ne[xe]=function(){for(var je=arguments.length,mt=new Array(je),Mt=0;Mt<je;Mt++)mt[Mt]=arguments[Mt];var Rt=Se.tokenizer[xe].apply(ne,mt);return Rt===!1&&(Rt=Le.apply(ne,mt)),Rt}};for(var de in Se.tokenizer)ie(de);me.tokenizer=ne}(),Se.walkTokens){var ve=_e.defaults.walkTokens;me.walkTokens=function(ne){Se.walkTokens(ne),ve&&ve(ne)}}_e.setOptions(me)},_e.walkTokens=function(Se,me){for(var ve=D(Se),ne;!(ne=ve()).done;){var ie=ne.value;me(ie);switch(ie.type){case"table":{for(var de=D(ie.tokens.header),pe;!(pe=de()).done;){var xe=pe.value;_e.walkTokens(xe,me)}for(var Le=D(ie.tokens.cells),je;!(je=Le()).done;)for(var mt=je.value,Mt=D(mt),Rt;!(Rt=Mt()).done;){var Kt=Rt.value;_e.walkTokens(Kt,me)}break}case"list":{_e.walkTokens(ie.items,me);break}default:ie.tokens&&_e.walkTokens(ie.tokens,me)}}},_e.Parser=lt,_e.parser=lt.parse,_e.Renderer=et,_e.TextRenderer=Ze,_e.Lexer=Ke,_e.lexer=Ke.lex,_e.Tokenizer=Pe,_e.Slugger=Tt,_e.parse=_e;var Je=_e;return Je})},E7E6:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADUCAYAAADZTGx+AAAgAElEQVR4Xu2dC3BU13nHv7MrIQkQQoCEtAIEAmxig4GACxhogpM6NY7jOKZO4nimwcFot23SNNNO02napJN0JjN9TNMm5eG3x4+YSeI3ftUGjCDGQMBgG4wxb+0u4mEeQhJI2tP539WR7i77uPfuvXfvar8zs7Mr7bnn8Z3vt9/5zlMQB5aAQQmsW7fO397eHujp6Rkfi8XGExFeDX2vABHVSSlrhBDDiKhdSnlOCBGWUu4mol1lZWWv3nfffccNZueJaMITpeBCeEICjz/++LCOjo5GIpogpWwUQjT2vU/A/wCClNJvtbBCCCml3CaEeGzChAmPLF269LLVtNx6jgFxS9IeyOehhx6q7OnpmSilnEhE2gsA4L0PhjHZillRUUHl5WUUf6+giopyKi+Pv8rKyrSX3++nnp4e7XXpUgedP3+ezp37lE6ebKPe3l4tCyFEhIj+UwjxaHNz8+ls+ebrewYkX5J3IN9169YNv3DhwsRYLIbXJAWBDoZRmbKFYkPRhw4dqgEwdCgAwOfyPiDKyefzWS454D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tbU19vb2TpVSThGCphLJKVLSVCFoYrHCAwikpCNC0MdE4qCU9LEQ4qDf7/+4trb2aN/cRGFpeI6lLUpAMslMSulva2ub2NPT0+TzyUAsJup9PgpIKQNSinohtM/1RFRo5/1cFkJEpKSwEDIihAjHYhT2+WQkFhPhkpKSQ7W1tUdwsnmOOjWoHmdALDbn+fPnR3V2dgKW0ULEqmIxUSWlHCmErJJSVAlBVVIS3kcS4X9ULoQolVKWZnpHcaSU3UKI7szv1EUkzuNSKSEI7+eFkOelFOeFEOd8Pnz24fOZioqKcFVV1VmLVS3qx/4fQLyzKIIkCJoAAAAASUVORK5CYII="},ELLl:function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"))})(function(ae){var X={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=ae.Pos;ae.defineOption("autoCloseBrackets",!1,function(A,x,d){d&&d!=ae.Init&&(A.removeKeyMap(D),A.state.closeBrackets=null),x&&(P(K(x,"pairs")),A.state.closeBrackets=x,A.addKeyMap(D))});function K(A,x){return x=="pairs"&&typeof A=="string"?A:typeof A=="object"&&A[x]!=null?A[x]:X[x]}var D={Backspace:_,Enter:L};function P(A){for(var x=0;x<A.length;x++){var d=A.charAt(x),a="'"+d+"'";D[a]||(D[a]=H(d))}}P(X.pairs+"`");function H(A){return function(x){return C(x,A)}}function W(A){var x=A.state.closeBrackets;if(!x||x.override)return x;var d=A.getModeAt(A.getCursor());return d.closeBrackets||x}function _(A){var x=W(A);if(!x||A.getOption("disableInput"))return ae.Pass;for(var d=K(x,"pairs"),a=A.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return ae.Pass;var s=k(A,a[l].head);if(!s||d.indexOf(s)%2!=0)return ae.Pass}for(var l=a.length-1;l>=0;l--){var v=a[l].head;A.replaceRange("",M(v.line,v.ch-1),M(v.line,v.ch+1),"+delete")}}function L(A){var x=W(A),d=x&&K(x,"explode");if(!d||A.getOption("disableInput"))return ae.Pass;for(var a=A.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return ae.Pass;var s=k(A,a[l].head);if(!s||d.indexOf(s)%2!=0)return ae.Pass}A.operation(function(){var v=A.lineSeparator()||`
|
|
`;A.replaceSelection(v+v,null),A.execCommand("goCharLeft"),a=A.listSelections();for(var c=0;c<a.length;c++){var m=a[c].head.line;A.indentLine(m,null,!0),A.indentLine(m+1,null,!0)}})}function y(A){var x=ae.cmpPos(A.anchor,A.head)>0;return{anchor:new M(A.anchor.line,A.anchor.ch+(x?-1:1)),head:new M(A.head.line,A.head.ch+(x?1:-1))}}function C(A,x){var d=W(A);if(!d||A.getOption("disableInput"))return ae.Pass;var a=K(d,"pairs"),l=a.indexOf(x);if(l==-1)return ae.Pass;for(var s=K(d,"closeBefore"),v=K(d,"triples"),c=a.charAt(l+1)==x,m=A.listSelections(),R=l%2==0,E,f=0;f<m.length;f++){var g=m[f],h=g.head,o,S=A.getRange(h,M(h.line,h.ch+1));if(R&&!g.empty())o="surround";else if((c||!R)&&S==x)c&&O(A,h)?o="both":v.indexOf(x)>=0&&A.getRange(h,M(h.line,h.ch+3))==x+x+x?o="skipThree":o="skip";else if(c&&h.ch>1&&v.indexOf(x)>=0&&A.getRange(M(h.line,h.ch-2),h)==x+x){if(h.ch>2&&/\bstring/.test(A.getTokenTypeAt(M(h.line,h.ch-2))))return ae.Pass;o="addFour"}else if(c){var b=h.ch==0?" ":A.getRange(M(h.line,h.ch-1),h);if(!ae.isWordChar(S)&&b!=x&&!ae.isWordChar(b))o="both";else return ae.Pass}else if(R&&(S.length===0||/\s/.test(S)||s.indexOf(S)>-1))o="both";else return ae.Pass;if(!E)E=o;else if(E!=o)return ae.Pass}var T=l%2?a.charAt(l-1):x,N=l%2?x:a.charAt(l+1);A.operation(function(){if(E=="skip")A.execCommand("goCharRight");else if(E=="skipThree")for(var z=0;z<3;z++)A.execCommand("goCharRight");else if(E=="surround"){for(var Y=A.getSelections(),z=0;z<Y.length;z++)Y[z]=T+Y[z]+N;A.replaceSelections(Y,"around"),Y=A.listSelections().slice();for(var z=0;z<Y.length;z++)Y[z]=y(Y[z]);A.setSelections(Y)}else E=="both"?(A.replaceSelection(T+N,null),A.triggerElectric(T+N),A.execCommand("goCharLeft")):E=="addFour"&&(A.replaceSelection(T+T+T+T,"before"),A.execCommand("goCharRight"))})}function k(A,x){var d=A.getRange(M(x.line,x.ch-1),M(x.line,x.ch+1));return d.length==2?d:null}function O(A,x){var d=A.getTokenAt(M(x.line,x.ch+1));return/\bstring/.test(d.type)&&d.start==x.ch&&(x.ch==0||!/\bstring/.test(A.getTokenTypeAt(x)))}})},F8wB:function(Ge,Fe,Q){Ge.exports={loading:"loading___1SIOG"}},FOrL:function(Ge,Fe,Q){Ge.exports=Q.p+"static/nodata.a6b3f948.png"},FPkq:function(Ge,Fe,Q){Ge.exports=Q.p+"static/qrCode.dd0fe9b2.png"},GABl:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAKi0lEQVRoQ71ae3BU1Rn//e7dzYuioNRsHlSqRiUB2eUx0hbaKAHEAMWxiQ6PTUAUGCuIQNVOZ0xnrHUE5GHHIqOwCag8BlQiQnnUokgt5AEIK5GnBpIFXwjkAdl7vs7dkJCETXLvEj3/5d7v9/u+337nfN8554bowBHo16+3YRh3K7IPBHcRSIDI9QJ0AWkA8h0E3xM8DWAvde5x6Pqe+D17jnVUGLxWogqPp78SGSeC3wP4ZUR8pJ+Ct50O7e344uKjEXFcBkUkSERY6e43RkE9JcCgawngaiw3O6A/l7CvaHckvLYFhTKi5B8C3B2JQ6sYEhvpcMxKKioqs4ox7SwLkvT0mFNnz82HqKkCaHacRGxL1gDybHJp6WKSYoXHkqBytzuF4FoR6WOFtKNtCP4b0c7s5N27v22Pu11B5e7+6ZTgBgE6t0f2Y74n8IUjOuo+1+7dx9vy06agcrf7fgjXARLzYwZrnZsB6BzevaRkf2uYVgWdcruHKnAjRJzWHf4ElmSl5nTcnbRnT3k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P/KxQYbOThkB8R6g2/i8xwcsbfyjsJQX2x50XhNWboigGcBrKam7RKRMqce+vodYwiSIOihREYAPN5wJJGDGdkQsdc6Gpxp/AtTt/2t4c9mghIKJvcU1O0VQVQk084yhjgHxKac9i45I+VZsTj3/SGI/MIyvjF6VqBrbAoTC6vDCjIfulZM/KMo9YptchsAEk8HvPkvhdbVwYznIJJnA97EVBvLXlvfblZ0whG58nPWCvCHyJy0gyKPde7WOdVcP3JkWHfUqkOAxNn2Rcxn2vbZLXFhr15vW/nEdeeNcyUArr5ctO25OUAjH6z0+tZfzs4qRFJZiU1IHTySvPoDQKt3yeb1cFDJNhHcdI0amhQk7gh4fen1YoYPhgQ/ss/NzxHtHGj2nHDYNi/Hk9/MTQka2CoiN9t3fNVkUDr0/hU5b5SK5Gnw7yyCiMcWL+GH5sxkz80nWsO1e9uftHJysqHqtoigpy3nLYxJLgt4fY+EsnMg41FAltriIzciyjm2tcy0WuXCOUnKf/xGg1VvishwW0Fc8XIhNoYpJ7J9gfpLRByGyM8tc5FzkTromXBrxlJRaM2ReW0sSi0QQTfLwZiG1P582rv876Hs+DNehpKZFvEnoWE2U7dbbrrtTrmWjhPfeqybEby0ECLjrARF8ETML9DzxD2+WikbdifqDHND2vb/PpDm5/oXcV3XRey+tsaKH1tTLhyh661H0xCsmyaQCW1dg1HTHwpMWLbmcpneBJH7Wg+QVdCwFKI/z7R/fWdHyDULaiCIL5jdScM3Y6X+m04/aXIPQGJnwJs/OCTm8yEjYSDMLSurQPkI5CrcoK2ja0vobBTpsD3l2nKU/mGe43DFiV5Ksb8SNUCj9lrlhOUl5r8JwG9evjMBhDmdjkJYBp2luLPHHrL+nq8jxv8BV2A7FHmr6w0AAAAASUVORK5CYII="},Gytx:function(Ge,Fe){Ge.exports=function(ae,X,M,K){var D=M?M.call(K,ae,X):void 0;if(D!==void 0)return!!D;if(ae===X)return!0;if(typeof ae!="object"||!ae||typeof X!="object"||!X)return!1;var P=Object.keys(ae),H=Object.keys(X);if(P.length!==H.length)return!1;for(var W=Object.prototype.hasOwnProperty.bind(X),_=0;_<P.length;_++){var L=P[_];if(!W(L))return!1;var y=ae[L],C=X[L];if(D=M?M.call(K,y,C,L):void 0,D===!1||D===void 0&&y!==C)return!1}return!0}},HmJG:function(Ge,Fe,Q){},HpTS:function(Ge,Fe,Q){Ge.exports=Q.p+"static/small_program.f74069ec.png"},I8Z2:function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return K}),Q.d(Fe,"b",function(){return k}),Q.d(Fe,"c",function(){return A});var ae=Q("q1tI"),X=function(){var x=function(d,a){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,s){l.__proto__=s}||function(l,s){for(var v in s)s.hasOwnProperty(v)&&(l[v]=s[v])},x(d,a)};return function(d,a){x(d,a);function l(){this.constructor=d}d.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}}(),M=ae.createContext(null),K=function(x){X(d,x);function d(){return x!==null&&x.apply(this,arguments)||this}return d.prototype.render=function(){return ae.createElement(M.Provider,{value:this.props.store},this.props.children)},d}(ae.Component),D=Q("Gytx"),P=Q.n(D),H=Q("2mql"),W=Q.n(H),_=function(){var x=function(d,a){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,s){l.__proto__=s}||function(l,s){for(var v in s)s.hasOwnProperty(v)&&(l[v]=s[v])},x(d,a)};return function(d,a){x(d,a);function l(){this.constructor=d}d.prototype=a===null?Object.create(a):(l.prototype=a.prototype,new l)}}(),L=function(){return L=Object.assign||function(x){for(var d,a=1,l=arguments.length;a<l;a++){d=arguments[a];for(var s in d)Object.prototype.hasOwnProperty.call(d,s)&&(x[s]=d[s])}return x},L.apply(this,arguments)};function y(x){return x.displayName||x.name||"Component"}var C=function(){return{}};function k(x,d){d===void 0&&(d={});var a=!!x,l=x||C;return function(v){var c=function(R){_(E,R);function E(f,g){var h=R.call(this,f,g)||this;return h.unsubscribe=null,h.handleChange=function(){if(!h.unsubscribe)return;var o=l(h.store.getState(),h.props);h.setState({subscribed:o})},h.store=h.context,h.state={subscribed:l(h.store.getState(),f),store:h.store,props:f},h}return E.getDerivedStateFromProps=function(f,g){return x&&x.length===2&&f!==g.props?{subscribed:l(g.store.getState(),f),props:f}:{props:f}},E.prototype.componentDidMount=function(){this.trySubscribe()},E.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},E.prototype.shouldComponentUpdate=function(f,g){return!P()(this.props,f)||!P()(this.state.subscribed,g.subscribed)},E.prototype.trySubscribe=function(){a&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},E.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},E.prototype.render=function(){var f=L(L(L({},this.props),this.state.subscribed),{store:this.store});return ae.createElement(v,L({},f,{ref:this.props.miniStoreForwardedRef}))},E.displayName="Connect("+y(v)+")",E.contextType=M,E}(ae.Component);if(d.forwardRef){var m=ae.forwardRef(function(R,E){return ae.createElement(c,L({},R,{miniStoreForwardedRef:E}))});return W()(m,v)}return W()(c,v)}}var O=function(){return O=Object.assign||function(x){for(var d,a=1,l=arguments.length;a<l;a++){d=arguments[a];for(var s in d)Object.prototype.hasOwnProperty.call(d,s)&&(x[s]=d[s])}return x},O.apply(this,arguments)};function A(x){var d=x,a=[];function l(c){d=O(O({},d),c);for(var m=0;m<a.length;m++)a[m]()}function s(){return d}function v(c){return a.push(c),function(){var R=a.indexOf(c);a.splice(R,1)}}return{setState:l,getState:s,subscribe:v}}},JWDV:function(Ge,Fe,Q){Ge.exports=Q.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAAwCAYAAAD9wT87AAAe2UlEQVR4XtVcB5QUVbr+blV1T+ieGWaYBAwgOSgooJLjENeA6a2KCVfZNbum3VXXsG9VdFfc1TXtGlfXLCKgEiRnUAHJWRzAyTl3V9V957vV1dPTM+M4Hn2Pd8/xIHRV9f3vn77/+/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37l3d0aAfzL/cNSYZcT0LvEYnuqyvnIrIChHo/dbZYjDbPxslSFLAfGUEIIcZ3gppTpvd6zLqweOVZuI0TUVDRgSOzjVy5yWFKSmTNn6vv2LxlMx7jdEMtiZcbR6h/kdmh7nkIlctlUCiLnQNL7Xs7W5g6mrq+sTExNDg6gM9eE5xFEM4HhLL4pJKYdwvg5msCsgg4AwFceueyptKZ/XNO3pkIdqkPaXVdAGjfwkt1FTzeXveCAN7QYNp/gMDEzxYFhaLAaneaH8xTY5hrvasu1/5ebmzuvcuXOTn8KRUpLZ5sQpWVD+EgvfAKEcBWQ1mjUK554XYFvnw7YEhAhCSr6pYULTv2R6aklBAwC5Y3uJief2VyqtEoHGG5rT/4nVVN+EPaCsBB0pkT0gyyyDpq+HEB8DWNTSa/PNbbgt/yal5NkxyzI90VRVdI3+HSFpmyuk0MeTeGXnkspgrE/0aGgfyxxqoJPPQGe/BxxcDYtiBiQ042to2mfsZwkheGA/ywr9NhJlIBekZBFqOrZ5kgCFhYUJqampbAWzp9LCsgDLrgB/t0foByDkdkB1UrdFv5j0s0j1Ax8qpfxdqP/U8h1mIABN5EEYhyHELgBUBv87IAS98/9utUhA19TUZMXFxc0AcCZbIqG5A+YFvhvEMEQXVm4s6Jon6VKzA053dTI46OH8hMARhbwa5OCbboU/9e8//BRH8j9mLdQoDqqNCwAAAABJRU5ErkJggg=="},Jq4h:function(Ge,Fe,Q){Ge.exports=Q.p+"static/qrcode.2267e4d5.png"},LdHM:function(Ge,Fe,Q){"use strict";Q.d(Fe,"b",function(){return s}),Q.d(Fe,"a",function(){return c});var ae=Q("1OyB"),X=Q("vuIU"),M=Q("Ji7U"),K=Q("LK+K"),D=Q("q1tI"),P=Q("rePB"),H=Q("Ff2n"),W=Q("ODXe"),_=Q("4IlW"),L=Q("bX4T"),y=Q("YrtM"),C=Q("TSYQ"),k=Q.n(C),O=Q("+nKL"),A=Q("8OUc"),x=function(re,le){var Ee=re.prefixCls,Oe=re.id,Ye=re.flattenOptions,Pe=re.childrenAsData,Be=re.values,Ue=re.searchValue,Ne=re.multiple,Te=re.defaultActiveFirstOption,se=re.height,ze=re.itemHeight,xt=re.notFoundContent,ct=re.open,ft=re.menuItemSelectedIcon,Ct=re.virtual,He=re.onSelect,Ke=re.onToggleOpen,ut=re.onActiveValue,vt=re.onScroll,ht=re.onMouseEnter,et="".concat(Ee,"-item"),Ze=Object(y.a)(function(){return Ye},[ct,Ye],function(Je,Se){return Se[0]&&Je[1]!==Se[1]}),Tt=D.useRef(null),bt=function(Se){Se.preventDefault()},St=function(Se){Tt.current&&Tt.current.scrollTo({index:Se})},lt=function(Se){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ve=Ze.length,ne=0;ne<ve;ne+=1){var ie=(Se+ne*me+ve)%ve,de=Ze[ie],pe=de.group,xe=de.data;if(!pe&&!xe.disabled)return ie}return-1},yt=D.useState(function(){return lt(0)}),dt=Object(W.a)(yt,2),Qe=dt[0],Ie=dt[1],Et=function(Se){Ie(Se);var me=Ze[Se];if(!me){ut(null,-1);return}ut(me.data.value,Se)};D.useEffect(function(){Et(Te!==!1?lt(0):-1)},[Ze.length,Ue]),D.useEffect(function(){var Je=setTimeout(function(){if(!Ne&&ct&&Be.size===1){var Se=Array.from(Be)[0],me=Ze.findIndex(function(ve){var ne=ve.data;return ne.value===Se});Et(me),St(me)}});return function(){return clearTimeout(Je)}},[ct]);var $e=function(Se){Se!==void 0&&He(Se,{selected:!Be.has(Se)}),Ne||Ke(!1)};if(D.useImperativeHandle(le,function(){return{onKeyDown:function(Se){var me=Se.which;switch(me){case _.a.UP:case _.a.DOWN:{var ve=0;if(me===_.a.UP?ve=-1:me===_.a.DOWN&&(ve=1),ve!==0){var ne=lt(Qe+ve,ve);St(ne),Et(ne)}break}case _.a.ENTER:{var ie=Ze[Qe];ie&&!ie.data.disabled?$e(ie.data.value):$e(void 0),ct&&Se.preventDefault();break}case _.a.ESC:Ke(!1)}},onKeyUp:function(){},scrollTo:function(Se){St(Se)}}}),Ze.length===0)return D.createElement("div",{role:"listbox",id:"".concat(Oe,"_list"),className:"".concat(et,"-empty"),onMouseDown:bt},xt);function _e(Je){var Se=Ze[Je];if(!Se)return null;var me=Se.data||{},ve=me.value,ne=me.label,ie=me.children,de=Object(L.a)(me,!0),pe=Pe?ie:ne;return Se?D.createElement("div",Object.assign({"aria-label":typeof pe=="string"?pe:null},de,{key:Je,role:"option",id:"".concat(Oe,"_list_").concat(Je),"aria-selected":Be.has(ve)}),ve):null}return D.createElement(D.Fragment,null,D.createElement("div",{role:"listbox",id:"".concat(Oe,"_list"),style:{height:0,width:0,overflow:"hidden"}},_e(Qe-1),_e(Qe),_e(Qe+1)),D.createElement(O.a,{itemKey:"key",ref:Tt,data:Ze,height:se,itemHeight:ze,fullHeight:!1,onMouseDown:bt,onScroll:vt,virtual:Ct,onMouseEnter:ht},function(Je,Se){var me,ve=Je.group,ne=Je.groupOption,ie=Je.data,de=ie.label,pe=ie.key;if(ve)return D.createElement("div",{className:k()(et,"".concat(et,"-group"))},de!==void 0?de:pe);var xe=ie.disabled,Le=ie.value,je=ie.title,mt=ie.children,Mt=ie.style,Rt=ie.className,Kt=Object(H.a)(ie,["disabled","value","title","children","style","className"]),_t=Be.has(Le),ot="".concat(et,"-option"),Jt=k()(et,ot,Rt,(me={},Object(P.a)(me,"".concat(ot,"-grouped"),ne),Object(P.a)(me,"".concat(ot,"-active"),Qe===Se&&!xe),Object(P.a)(me,"".concat(ot,"-disabled"),xe),Object(P.a)(me,"".concat(ot,"-selected"),_t),me)),Ut=Pe?mt:de,Zt=!ft||typeof ft=="function"||_t;return D.createElement("div",Object.assign({},Kt,{"aria-selected":_t,className:Jt,title:je,onMouseMove:function(){if(Qe===Se||xe)return;Et(Se)},onClick:function(){xe||$e(Le)},style:Mt}),D.createElement("div",{className:"".concat(ot,"-content")},Ut||Le),D.isValidElement(ft)||_t,Zt&&D.createElement(A.a,{className:"".concat(et,"-option-state"),customizeIcon:ft,customizeIconProps:{isSelected:_t}},_t?"\u2713":null))}))},d=D.forwardRef(x);d.displayName="OptionList";var a=d,l=function(){return null};l.isSelectOption=!0;var s=l,v=function(){return null};v.isSelectOptGroup=!0;var c=v,m=Q("VTBJ"),R=Q("Zm9Q");function E(F){var re=F.key,le=F.props,Ee=le.children,Oe=le.value,Ye=Object(H.a)(le,["children","value"]);return Object(m.a)({key:re,value:Oe!==void 0?Oe:re,children:Ee},Ye)}function f(F){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(F).map(function(le,Ee){if(!D.isValidElement(le)||!le.type)return null;var Oe=le.type.isSelectOptGroup,Ye=le.key,Pe=le.props,Be=Pe.children,Ue=Object(H.a)(Pe,["children"]);return re||!Oe?E(le):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(Ye===null?Ee:Ye,"__"),label:Ye},Ue),{},{options:f(Be)})}).filter(function(le){return le})}var g=Q("2Qr1"),h=Q("qNPg"),o=Q("U8pU"),S=Q("Kwbf"),b=Q("WKfj");function T(F){var re=F.mode,le=F.options,Ee=F.children,Oe=F.backfill,Ye=F.allowClear,Pe=F.placeholder,Be=F.getInputElement,Ue=F.showSearch,Ne=F.onSearch,Te=F.defaultOpen,se=F.autoFocus,ze=F.labelInValue,xt=F.value,ct=F.inputValue,ft=F.optionLabelProp,Ct=re==="multiple"||re==="tags",He=Ue!==void 0?Ue:Ct||re==="combobox",Ke=le||f(Ee);if(Object(S.a)(re!=="tags"||Ke.every(function(et){return!et.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),re==="tags"||re==="combobox"){var ut=Ke.some(function(et){return et.options?et.options.some(function(Ze){return typeof("value"in Ze?Ze.value:Ze.key)=="number"}):typeof("value"in et?et.value:et.key)=="number"});Object(S.a)(!ut,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(S.a)(re!=="combobox"||!ft,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(S.a)(re==="combobox"||!Oe,"`backfill` only works with `combobox` mode."),Object(S.a)(re==="combobox"||!Be,"`getInputElement` only work with `combobox` mode."),Object(S.b)(re!=="combobox"||!Be||!Ye||!Pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ne&&!He&&re!=="combobox"&&re!=="tags"&&Object(S.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(S.b)(!Te||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),xt!=null){var vt=Object(b.d)(xt);Object(S.a)(!ze||vt.every(function(et){return Object(o.a)(et)==="object"&&("key"in et||"value"in et)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(S.a)(!Ct||Array.isArray(xt),"`value` should be array when `mode` is `multiple` or `tags`")}if(Ee){var ht=null;Object(R.a)(Ee).some(function(et){if(!D.isValidElement(et)||!et.type)return!1;var Ze=et.type;if(Ze.isSelectOption)return!1;if(Ze.isSelectOptGroup){var Tt=Object(R.a)(et.props.children).every(function(bt){return!D.isValidElement(bt)||!et.type||bt.type.isSelectOption?!0:(ht=bt.type,!1)});return!Tt}return ht=Ze,!0}),ht&&Object(S.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ht.displayName||ht.name||ht,"`.")),Object(S.a)(ct===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=T,z=Object(h.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:f,flattenOptions:g.d,getLabeledValue:g.e,filterOptions:g.b,isValueDisabled:g.g,findValueOption:g.c,warningProps:N,fillOptionsWithMissingValue:g.a}),Y=function(F){Object(M.a)(le,F);var re=Object(K.a)(le);function le(){var Ee;return Object(ae.a)(this,le),Ee=re.apply(this,arguments),Ee.selectRef=D.createRef(),Ee.focus=function(){Ee.selectRef.current.focus()},Ee.blur=function(){Ee.selectRef.current.blur()},Ee}return Object(X.a)(le,[{key:"render",value:function(){return D.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),le}(D.Component);Y.Option=s,Y.OptGroup=c;var te=Y,G=Fe.c=te},M8RZ:function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return _});var ae=Q("fWQN"),X=Q("mtLc"),M=Q("yKVA"),K=Q("879j"),D=Q("q1tI"),P=Q.n(D),H=Q("i8i4"),W=Q.n(H),_=function(L){Object(M.a)(C,L);var y=Object(K.a)(C);function C(k){var O;Object(ae.a)(this,C),O=y.call(this,k);var A=window.document;return O.node=A.createElement("div"),A.body.appendChild(O.node),O}return Object(X.a)(C,[{key:"render",value:function(){var O=this.props.children;return Object(H.createPortal)(O,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(P.a.Component)},Nmxd:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/YEVW3vt0RRLWjIRi35biLWkgmOhaz0SflleYMzZi3jAcaf+sGKqoAUVX3wbwnrN0FYveYoTj7xdiL2ggqKsvMnCyYnJcEBPw0nA4/kUuNM9AINX9MMnMIEDzXeSpIISvs/A1pJu2/TgzSZ4BRVf7ALxQQSVeqPuNcLy5qIHJcb7HS4ZKYxncNnOemH4DyqmehaiW58D8UKVFeOIn+gljY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nPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},O2Wb:function(Ge,Fe,Q){Ge.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(Ge,Fe,Q){"use strict";var ae=Q("U8pU"),X=Q("VTBJ"),M=Q("Ff2n"),K=Q("q1tI"),D=Q("uciX"),P=Q("7ixt"),H=function(k){var O=k.overlay,A=k.prefixCls,x=k.id,d=k.overlayInnerStyle;return K.createElement("div",{className:"".concat(A,"-inner"),id:x,role:"tooltip",style:d},typeof O=="function"?O():O)},W=H,_=function(k,O){var A=k.overlayClassName,x=k.trigger,d=x===void 0?["hover"]:x,a=k.mouseEnterDelay,l=a===void 0?0:a,s=k.mouseLeaveDelay,v=s===void 0?.1:s,c=k.overlayStyle,m=k.prefixCls,R=m===void 0?"rc-tooltip":m,E=k.children,f=k.onVisibleChange,g=k.afterVisibleChange,h=k.transitionName,o=k.animation,S=k.placement,b=S===void 0?"right":S,T=k.align,N=T===void 0?{}:T,z=k.destroyTooltipOnHide,Y=z===void 0?!1:z,te=k.defaultVisible,G=k.getTooltipContainer,F=k.overlayInnerStyle,re=Object(M.a)(k,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),le=Object(K.useRef)(null);Object(K.useImperativeHandle)(O,function(){return le.current});var Ee=Object(X.a)({},re);"visible"in k&&(Ee.popupVisible=k.visible);var Oe=function(){var Ne=k.arrowContent,Te=Ne===void 0?null:Ne,se=k.overlay,ze=k.id;return[K.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},Te),K.createElement(W,{key:"content",prefixCls:R,id:ze,overlay:se,overlayInnerStyle:F})]},Ye=!1,Pe=!1;if(typeof Y=="boolean")Ye=Y;else if(Y&&Object(ae.a)(Y)==="object"){var Be=Y.keepParent;Ye=Be===!0,Pe=Be===!1}return K.createElement(D.a,Object.assign({popupClassName:A,prefixCls:R,popup:Oe,action:d,builtinPlacements:P.a,popupPlacement:b,ref:le,popupAlign:N,getPopupContainer:G,onPopupVisibleChange:f,afterPopupVisibleChange:g,popupTransitionName:h,popupAnimation:o,defaultPopupVisible:te,destroyPopupOnHide:Ye,autoDestroy:Pe,mouseLeaveDelay:v,popupStyle:c,mouseEnterDelay:l},Ee),E)},L=Object(K.forwardRef)(_),y=Fe.a=L},Ohmc:function(Ge,Fe,Q){Ge.exports=Q.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Ge,Fe,Q){"use strict";var ae=Q("2qtc"),X=Q("kLXV"),M=Q("rAM+"),K=Q("miYZ"),D=Q("tsqr"),P=Q("9og8"),H=Q("tJVT"),W=Q("jrin"),_=Q("WmNS"),L=Q.n(_),y=Q("q1tI"),C=Q.n(y),k=Q("VrN/"),O=Q.n(k),A=Q("bdgK"),x=Q("p77/"),d=Q("Bd2K"),a=Q("ELLl"),l=Q("19Vz"),s=Q("lZu9"),v=Q("+NIl"),c=Q("kSUc"),m=Q("9Bee"),R=function(xe){var Le=xe.value,je=Le===void 0?"":Le,mt=xe.className,Mt=xe.showTextOnly,Rt=xe.showLines,Kt=xe.style,_t=Kt===void 0?{}:Kt,ot=Object(y.useMemo)(function(){return""},[je]);return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{dangerouslySetInnerHTML:{__html:ot}}))},E=Q("0Owb"),f=Q("dejd"),g=Q("C+DQ"),h=Q("1vsH"),o=Q("m3rI"),S=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function b(xe){var Le=xe.onActionCallback,je=xe.title,mt=xe.icon,Mt=xe.actionName,Rt=xe.className,Kt=Rt===void 0?"":Rt,_t=xe.children;function ot(){Le(Mt)}return C.a.createElement("a",{title:je,className:Kt,onClick:ot},C.a.createElement("i",{className:"md-iconfont ".concat(mt)}),_t)}var T=function(xe){var Le=xe.watch,je=xe.showNullButton,mt=xe.onActionCallback,Mt=xe.fullScreen,Rt=xe.insertTemp,Kt=xe.hidetoolBar,_t=xe.uuid,ot=xe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(_t,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var Jt=[].concat(S,[{title:"".concat(Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Le?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return C.a.createElement("ul",{className:"markdown-toolbar-container"},!Kt&&Jt.map(function(Ut,Zt){return C.a.createElement("li",{key:Zt},Ut.actionName?C.a.createElement(b,Object(E.a)({},Ut,{onActionCallback:mt})):C.a.createElement("span",{className:"v-line"}))}),je?C.a.createElement("li",null,C.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:mt},C.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Rt&&C.a.createElement("li",null,C.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Rt),onActionCallback:mt},C.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),C.a.createElement("li",{className:"btn-full-screen"},C.a.createElement(b,{icon:"".concat(Mt?"icon-shrink":"icon-enlarge"),title:Mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:mt})))},N=Q("M8RZ"),z=Q("+L6B"),Y=Q("2/Rp"),te=Q("y8nQ"),G=Q("Vl3Y"),F=Q("5NDa"),re=Q("5rEg"),le={labelCol:{span:4},wrapperCol:{span:20}},Ee=function(xe){var Le=xe.callback,je=xe.onCancel;function mt(Mt){Le(Mt)}return C.a.createElement(G.a,Object(E.a)({},le,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:mt}),C.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},C.a.createElement(re.a,null)),C.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},C.a.createElement(re.a,null)),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(Y.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))},Oe=Q("7ahc"),Ye=Q("HmJG"),Pe=Q("BjJ7"),Be=G.a.useForm,Ue={width:280,marginRight:10},Ne={labelCol:{span:5},wrapperCol:{span:19}},Te=function(xe){var Le=xe.callback,je=xe.onCancel,mt=Be(),Mt=Object(H.a)(mt,1),Rt=Mt[0];function Kt(Jt){Le(Jt)}function _t(Jt,Ut){if(Jt.status===-1){D.b.error(Jt.message);return}Rt.setFieldsValue({src:"/api/attachments/".concat(Jt.id),type:Ut.type})}function ot(Jt){var Ut=Jt.target.files[0];ze(Ut,_t)}return C.a.createElement(G.a,Object(E.a)({form:Rt},Ne,{className:"upload-image-panel",onFinish:Kt}),C.a.createElement(G.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},C.a.createElement("div",{className:"flex-container"},C.a.createElement(G.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},C.a.createElement(re.a,{style:Ue})),C.a.createElement(se,{onFileChange:ot}))),C.a.createElement(G.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},C.a.createElement(re.a,{style:{width:264}})),C.a.createElement(G.a.Item,{style:{textAlign:"right"}},C.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(Y.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))};function se(xe){var Le=xe.onFileChange;return C.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",C.a.createElement("input",{type:"file",onChange:Le}))}function ze(xe,Le){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var je=new FormData;je.append("editormd-image-file",xe),je.append("file_param_name","editormd-image-file"),je.append("byxhr","true");var mt=new window.XMLHttpRequest;mt.withCredentials=!0,mt.addEventListener("load",function(Mt){Le(JSON.parse(Mt.target.responseText),xe)},!1),mt.addEventListener("error",function(Mt){console.error(Mt)},!1),mt.open("POST","".concat(Pe.a,"/api/attachments.json")),mt.send(je)}var xt=Q("giR+"),ct=Q("fyUT"),ft=Q("7Kak"),Ct=Q("9yH6"),He=Ct.a.Group,Ke={margin:"0 8px"},ut=function(xe){var Le=xe.callback,je=xe.onCancel;function mt(Mt){Le(Mt)}return C.a.createElement(G.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:mt},C.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},C.a.createElement("span",{style:Ke},"\u5355\u5143\u683C\u6570\uFF1A"),C.a.createElement("span",{style:Ke},"\u884C\u6570"),C.a.createElement(G.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},C.a.createElement(ct.a,null)),C.a.createElement("span",{style:Ke},"\u5217\u6570"),C.a.createElement(G.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},C.a.createElement(ct.a,null))),C.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},C.a.createElement("span",{style:Ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),C.a.createElement(G.a.Item,{name:"align"},C.a.createElement(He,null,C.a.createElement(Ct.a,{value:"default"},C.a.createElement("i",{className:"fa fa-align-justify"})),C.a.createElement(Ct.a,{value:"left"},C.a.createElement("i",{className:"fa fa-align-left"})),C.a.createElement(Ct.a,{value:"center"},C.a.createElement("i",{className:"fa fa-align-center"})),C.a.createElement(Ct.a,{value:"right"},C.a.createElement("i",{className:"fa fa-align-right"}))))),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(Y.a,{type:"ghost",onClick:je},"\u53D6\u6D88")))},vt=Q("ErOA"),ht=Q("7Cbv"),et="link",Ze="upload-image",Tt="code-block",bt="add-table",St="------------",lt={default:St,left:":".concat(St),center:":".concat(St,":"),right:"".concat(St,":")},yt=Q("9VGf"),dt,Qe;function Ie(){}var Et=0,$e=1e4,_e="\u2581",Je=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Se(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}var me=navigator.platform.toUpperCase().indexOf("MAC")>=0,ve=me?"Cmd":"Ctrl",ne=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ie=(dt={},Object(W.a)(dt,ve+"-B","bold"),Object(W.a)(dt,ve+"-I","italic"),dt),de=(Qe={},Object(W.a)(Qe,et,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Qe,Tt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Qe,Ze,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Qe,bt,"\u6DFB\u52A0\u8868\u683C"),Qe),pe=Fe.a=function(xe){var Le=xe.defaultValue,je=Le===void 0?"":Le,mt=xe.onChange,Mt=xe.width,Rt=Mt===void 0?"100%":Mt,Kt=xe.height,_t=Kt===void 0?400:Kt,ot=xe.miniToolbar,Jt=ot===void 0?!1:ot,Ut=xe.isFocus,Zt=Ut===void 0?!1:Ut,nr=xe.watch,Ot=xe.insertTemp,xr=xe.mode,$t=xr===void 0?"markdown":xr,it=xe.id,lr=it===void 0?"markdown-editor-id":it,nt=xe.showResizeBar,yr=nt===void 0?!1:nt,Lr=xe.noStorage,jr=Lr===void 0?!1:Lr,pn=xe.showNullButton,br=pn===void 0?!1:pn,Lt=xe.hidetoolBar,Hn=Lt===void 0?!1:Lt,Zn=xe.fullScreen,ln=Zn===void 0?!1:Zn,ir=xe.onBlur,Un=xe.onCMBeforeChange,Kn=xe.onFullScreen,ai=xe.className,rt=ai===void 0?"":ai,Wt=xe.disablePaste,zn=Wt===void 0?!1:Wt,ci=xe.placeholder,bi=ci===void 0?"":ci,oi=xe.values,j=oi===void 0?"":oi,u=Object(y.useState)(null),p=Object(H.a)(u,2),I=p[0],Z=p[1],U=Object(y.useState)(je),be=Object(H.a)(U,2),Xe=be[0],gt=be[1],It=Object(y.useState)(nr),qe=Object(H.a)(It,2),jt=qe[0],Cr=qe[1],Nr=Object(y.useState)(ln),Rn=Object(H.a)(Nr,2),bn=Rn[0],mn=Rn[1],qn=Object(y.useState)(""),Rr=Object(H.a)(qn,2),Ft=Rr[0],Vt=Rr[1],er=Object(y.useState)(0),wr=Object(H.a)(er,2),tr=wr[0],si=wr[1],nn=Object(y.useState)(_t),Oi=Object(H.a)(nn,2),Fi=Oi[0],Pn=Oi[1],qr=Object(y.useState)(!1),un=Object(H.a)(qr,2),Ei=un[0],hi=un[1],$r=Object(y.useRef)(Object(ht.a)()),Mr=Object(y.useRef)(!1),an=Object(y.useRef)(),cr=Object(y.useRef)(),on=Object(y.useRef)(),Br=Object(y.useRef)(),fi=Object(y.useRef)(),En=function(){var Bt=Object(P.a)(L.a.mark(function qt(){var Ht,hr;return L.a.wrap(function(Ur){for(;;)switch(Ur.prev=Ur.next){case 0:return Ur.next=2,Object(vt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:$r.current}});case 2:hr=Ur.sent,hr!=null&&(Ht=hr.attachments)!==null&&Ht!==void 0&&Ht.length&&(console.log("cm:",I,cr),hr.attachments.map(function(Sr){Sr.content_type.indexOf("image")>-1?I.replaceSelection(".concat(Sr.content_type,")")):Sr.content_type.indexOf("video")>-1?I.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Sr.content_type.indexOf("pdf")>-1?I.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Sr.id,"?type=").concat(Sr.content_type,'&disposition=inline" target="_blank">').concat(Sr.name,"</a>")):I.replaceSelection("[".concat(Sr.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Sr.id,"?type=").concat(Sr.content_type,")"))}));case 4:case"end":return Ur.stop()}},qt)}));return function(){return Bt.apply(this,arguments)}}();Object(y.useEffect)(function(){gt(j),I==null||I.setValue(j)},[j]),Object(y.useEffect)(function(){Kn==null||Kn(bn)},[bn]),Object(y.useEffect)(function(){if(cr.current){var Bt=O.a.fromTextArea(cr.current,{mode:$t,lineNumbers:!Jt,lineWrapping:!0,value:je,autoCloseTags:!0,autoCloseBrackets:!0});Zt&&Bt.focus();function qt(Ht,hr){if(zn){hr.preventDefault();return}var Dr=hr.clipboardData;if(Dr){var Ur=Dr.types.toString(),Sr=Dr.items;if(Ur==="Files"||Dr.types.indexOf("Files")>-1){if(hr.preventDefault(),$t=="stex")return;try{var dn,Gn=Sr[1];((dn=Sr[0])===null||dn===void 0?void 0:dn.kind)==="file"&&(Gn=Sr[0]);var pr=Gn.getAsFile(),Ci=pr.name.split(".").pop();ze(pr,function(Ir){if(Ir.id){var _n,kn,ui;(pr==null||((_n=pr.type)===null||_n===void 0)?void 0:_n.indexOf("image"))>-1?Bt.replaceSelection(".concat(Ir.content_type,")")):(pr==null||((kn=pr.type)===null||kn===void 0)?void 0:kn.indexOf("video"))>-1?Bt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,'"></video>')):(pr==null||((ui=pr.type)===null||ui===void 0)?void 0:ui.indexOf("pdf"))>-1?Bt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,"?type=").concat(pr.type,'&disposition=inline" target="_blank">').concat(pr.name,"</a>")):ne.includes(Ci)?Bt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,'?type=office&disposition=inline" target="_blank">').concat(pr.name,"</a>")):Bt.replaceSelection("[".concat(pr.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,"?type=").concat(Ir.content_type,")"))}else(Ir==null?void 0:Ir.status)===401&&(document.location.href="/user/login")})}catch(Ir){D.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Bt.on("paste",qt),Bt.on("dragleave",function(Ht,hr){on.current.classList.remove("mouse-hover-md")}),Bt.on("dragover",function(Ht,hr){on.current.classList.add("mouse-hover-md")}),Bt.on("drop",function(Ht,hr){on.current.classList.add("mouse-hover-md");var Dr;if(Dr=hr.dataTransfer.files,Dr.length>0){hr.preventDefault(),hr.stopPropagation();for(var Ur=function(Gn){var pr=Dr[Gn],Ci=pr.name.split(".").pop();ze(pr,function(Ir){if(Ir.id){var _n,kn,ui;(pr==null||((_n=pr.type)===null||_n===void 0)?void 0:_n.indexOf("image"))>-1?Bt.replaceSelection(".concat(Ir.content_type,")")):(pr==null||((kn=pr.type)===null||kn===void 0)?void 0:kn.indexOf("video"))>-1?Bt.replaceSelection('<video width="100%" controls src="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,'"></video>')):(pr==null||((ui=pr.type)===null||ui===void 0)?void 0:ui.indexOf("pdf"))>-1?Bt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,"?type=").concat(pr.type,'&disposition=inline" target="_blank">').concat(pr.name,"</a>")):ne.includes(Ci)?Bt.replaceSelection('<a href="'.concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,'?type=office&disposition=inline" target="_blank">').concat(pr.name,"</a>")):Bt.replaceSelection("[".concat(pr.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(Ir.id,"?type=").concat(Ir.content_type,")"))}else(Ir==null?void 0:Ir.status)===401&&(document.location.href="/user/login")})},Sr=0;Sr<Dr.length;Sr++)Ur(Sr)}}),Z(Bt),function(){Bt.off("paste",qt)}}},[]);var Mn=Object(y.useCallback)(function(){if(on.current)try{}catch(Bt){console.log(Bt,"---- to set md editor body height")}},[Fi,on,bn]);Object(y.useEffect)(function(){function Bt(){var Ht=new A.default(function(hr){var Dr=Object(M.a)(hr),Ur;try{for(Dr.s();!(Ur=Dr.n()).done;){var Sr=Ur.value;(Sr.target.offsetHeight>0||Sr.target.offsetWidth>0)&&(Mn(),I.setSize("100%","100%"),I.refresh())}}catch(dn){Dr.e(dn)}finally{Dr.f()}});return Ht.observe(cr.current.parentElement),Ht}if(I){var qt=Bt();return function(){qt.unobserve(cr.current.parentElement)}}},[I,Mn]),Object(y.useEffect)(function(){if(I){for(var Bt=[],qt=function(){var Sr=hr[Ht];Dr=Object(H.a)(Sr,2);var dn=Dr[0],Gn=Dr[1],pr=Object(W.a)({},dn,function(){Xi(Gn)});Bt.push(pr),I.addKeyMap(pr)},Ht=0,hr=Object.entries(ie);Ht<hr.length;Ht++){var Dr;qt()}return an.current=setInterval(function(){Mr.current&&En()},4e3),function(){clearInterval(an.current);var Ur=Object(M.a)(Bt),Sr;try{for(Ur.s();!(Sr=Ur.n()).done;){var dn=Sr.value;I.removeKeyMap(dn)}}catch(Gn){Ur.e(Gn)}finally{Ur.f()}}}},[I]),Object(y.useEffect)(function(){ln!==bn&&mn(ln)},[ln]),Object(yt.a)(function(){if(!jr&&tr>0){var Bt=new Date().getTime(),qt=window.sessionStorage.getItem(lr);Bt>=tr+$e&&(!qt||qt!==Xe)&&(window.sessionStorage.setItem(lr,Xe),hi(!0))}},$e),Object(y.useEffect)(function(){Cr(nr)},[I,nr]),Object(y.useEffect)(function(){I&&(Zt&&I.focus())},[I,Zt]),Object(y.useEffect)(function(){if(jt&&I){var Bt=I.getScrollerElement();function qt(Ht){var hr=Ht.target;if(fi.current){var Dr=hr.scrollTop/hr.scrollHeight;fi.current.scrollTop=fi.current.scrollHeight*Dr}}return Bt.addEventListener("scroll",qt),function(){Bt.removeEventListener("scroll",qt)}}},[I,jt]),Object(y.useEffect)(function(){if(I&&Un){function Bt(qt,Ht){Un(qt,Ht)}return I.on("beforeChange",Bt),function(){I.off("beforeChange",Bt)}}},[I,Un]),Object(y.useEffect)(function(){if(I&&ir){function Bt(){ir(I.getValue())}return I.on("blur",Bt),function(){I.off("blur",Bt)}}},[I,ir]),Object(y.useEffect)(function(){if(I){function Bt(qt){var Ht=qt.getValue();gt(Ht),si(new Date().getTime()),qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),mt&&mt(Ht)}return I.on("change",Bt),function(){I.off("change",Bt)}}},[I,mt]),Object(y.useEffect)(function(){I&&(je==null?(I.setValue(""),gt("")):je!==I.getValue()&&(I.setValue(je),gt(je),I.setCursor(I.lineCount(),0)))},[I,je]);var Xi=Object(y.useCallback)(function(Bt){var qt=I.getCursor(),Ht=I.getSelection(),hr=Ht.split(`
|
|
`);switch(Bt){case"bold":return I.replaceSelection("**"+Ht+"**"),Ht===""&&I.setCursor(qt.line,qt.ch+2),I.focus();case"italic":return I.replaceSelection("*"+Ht+"*"),Ht===""&&I.setCursor(qt.line,qt.ch+1),I.focus();case"code":return I.replaceSelection("`"+Ht+"`"),Ht===""&&I.setCursor(qt.line,qt.ch+1),I.focus();case"inline-latex":return I.replaceSelection("`$$"+Ht+"$$`"),Ht===""&&I.setCursor(qt.line,qt.ch+3),I.focus();case"latex":return I.replaceSelection("```latex\n"+Ht+"\n```"),I.setCursor(qt.line+1,Ht.length+1),I.focus();case"line-break":return I.replaceSelection(`<br/>
|
|
`),I.focus();case"list-ul":return Ht===""?I.replaceSelection("- "+Ht):I.replaceSelection(hr.map(function(Dr){return Dr===""?"":"- ".concat(Dr)}).join(`
|
|
`)),I.focus();case"list-ol":return Ht===""?I.replaceSelection("1. "+Ht):I.replaceSelection(hr.map(function(Dr,Ur){return Dr===""?"":"".concat(Ur+1,". ").concat(Dr)}).join(`
|
|
`)),I.focus();case"add-null-ch":return Ht===""&&I.setCursor(qt.line,qt.ch+1),I.replaceSelection(_e),I.focus();case"inster-template-1":return Ht===""&&I.setCursor(qt.line,qt.ch),I.replaceSelection(Je),I.focus();case"eraser":return I.setValue(""),I.focus();case"trigger-watch":return Cr(!jt),I.focus();case"trigger-full-screen":return mn(!bn),I.focus();case et:Vt(et);return;case Tt:Vt(Tt);return;case Ze:Vt(Ze);return;case bt:Vt(bt);return;default:throw new Error}},[I,jt,bn]),Ri=Object(y.useCallback)(function(Bt){Vt("");switch(Ft){case et:var qt=Bt.title,Ht=Bt.link;return I.replaceSelection("[".concat(qt,"](").concat(Ht,")")),I.focus();case Tt:var hr=Bt.language,Dr=Bt.content;return I.replaceSelection(["```"+hr,Dr,"```"].join(`
|
|
`)),I.focus();case Ze:var Ur=Bt.src,Sr=Bt.alt;return Sr?I.replaceSelection(".concat(Ur,' "').concat(Sr,'" )')):I.replaceSelection("")),I.focus();case bt:for(var dn=Bt.row,Gn=Bt.col,pr=Bt.align,Ci=`
|
|
`,Ir=0;Ir<dn;Ir++){for(var _n=[],kn=[],ui=0;ui<Gn;ui++)Ir===1&&kn.push(lt[pr]),_n.push(" ");Ir===1&&(Ci+="| ".concat(kn.join(" | "),` |
|
|
`)),Ci+="| ".concat(_n.join(Gn===1?"":" | "),` |
|
|
`)}return I.replaceSelection(Ci+`
|
|
`),I.focus();default:throw new Error}},[I,Ft]),Mi=Object(y.useMemo)(function(){switch(Ft){case et:return C.a.createElement(Ee,{callback:Ri,onCancel:$n});case Tt:return C.a.createElement(Oe.b,{callback:Ri,onCancel:$n});case Ze:return C.a.createElement(Te,{callback:Ri,onCancel:$n});case bt:return C.a.createElement(ut,{callback:Ri,onCancel:$n});default:return null}},[Ft]);function $n(){Vt("")}Object(y.useEffect)(function(){if(Br.current){var Bt=Br.current,qt=!1,Ht=0;function hr(Sr){qt=!0,Ht=Sr.pageY}function Dr(){qt=!1}function Ur(Sr){if(qt){var dn=Sr.pageY-Ht;dn<0&&(dn=0),dn>300&&(dn=300);var Gn=_t+dn+"px";Pn(Gn)}}return Bt.addEventListener("mousedown",hr),document.addEventListener("mousemove",Ur),document.addEventListener("mouseup",Dr),function(){Bt.removeEventListener("mousedown",hr),document.removeEventListener("mousemove",Ur),document.removeEventListener("mouseup",Dr)}}},[I,Br]),Object(y.useEffect)(function(){Pn(_t)},[_t]);var ei=Se(Rt),sa=Se(Fi),li={width:ei,height:sa},la=Object(y.useMemo)(function(){if(tr){var Bt=new Date(tr),qt=Bt.getHours(),Ht=Bt.getMinutes(),hr=Bt.getSeconds();return qt=qt<10?"0"+qt:qt,Ht=Ht<10?"0"+Ht:Ht,hr=hr<10?"0"+hr:hr,"".concat(qt,":").concat(Ht,":").concat(hr)}return 0},[tr]);function ua(){window.sessionStorage.removeItem(lr),hi(!1),si(0)}function ji(){hi(!1),si(0),I.setValue(window.sessionStorage.getItem(lr))}function Ua(Bt,qt){var Ht=I.getValue();Ht=Ht.replace(Bt,qt),gt(Ht),I==null||I.setValue(Ht)}return C.a.createElement(y.Fragment,null,C.a.createElement("div",{className:"markdown-editor-wrapper",ref:on},C.a.createElement("div",{className:"markdown-editor-container ".concat(rt," ").concat(jt?"on-preview":""," ").concat(Jt?"mini":""," ").concat(bn?"full-screen":""),style:li},C.a.createElement(T,{insertTemp:Ot,watch:jt,fullScreen:bn,showNullButton:br,onActionCallback:Xi,hidetoolBar:Hn,uuid:$r.current,setOpenPhones:function(){Mr.current=!0}}),C.a.createElement("div",{className:"markdown-editor-body"},C.a.createElement("div",{className:"codemirror-container"},C.a.createElement("textarea",{ref:cr,placeholder:bi})),jt?C.a.createElement("div",{ref:fi,className:"preview-container"},$t==="stex"&&C.a.createElement(R,{value:Xe}),$t!=="stex"&&C.a.createElement(m.a,{edit:!0,value:Xe,replaces:Ua})):null))),yr?C.a.createElement("a",{ref:Br,className:"editor-resize"}):null,C.a.createElement(N.a,null,de[Ft]?C.a.createElement(X.a,{centered:!0,title:de[Ft],visible:!0,onCancel:$n,footer:null,className:"markdown-popup-form"},Mi):null))}},RMFE:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQiAoIdPQw1iJAgIBA+wYIECAQFRDo6GGsRYAAAYH2DRAgQCAqINDRw1iLAAECAu0bIECAQFRAoKOHsRYBAgQE2jdAgACBqIBARw9jLQIECAi0b4AAAQJRAYGOHsZaBAgQEGjfAAECBKICAh09jLUIECAg0L4BAgQIRAUEOnoYaxEgQECgfQMECBCICgh09DDWIkCAgED7BggQIBAVEOjoYaxFgAABgfYNECBAICog0NHDWIsAAQIC7RsgQIBAVECgo4exFgECBATaN0CAAIGogEBHD2MtAgQICLRvgAABAlEBgY4exloECBAQaN8AAQIEogICHT2MtQgQICDQvgECBAhEBQQ6ehhrESBAQKB9AwQIEIgKCHT0MNYiQICAQPsGCBAgEBUQ6OhhrEWAAAGB9g0QIEAgKiDQ0cNYiwABAgLtGyBAgEBUQKCjh7EWAQIEBNo3QIAAgaiAQEcPYy0CBAh8/5Tg6+vrp3/q7wgQIEDgPwKfz+c/v92v/Ac9CxMBAgRSAgKdOodlCBAgMAGBnoWJAAECKQGBTp3DMgQIEJiAQM/CRIAAgZSAQKfOYRkCBAhMQKBnYSJAgEBKQKBT57AMAQIEJiDQszARIEAgJSDQqXNYhgABAhMQ6FmYCBAgkBIQ6NQ5LEOAAIEJCPQsTAQIEEgJC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YE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IWAQL9Q9SYBAgQOBAT6ANETBAgQeCEg0C9UvUmAAIEDAYE+QPQEAQIEXggI9AtVbxIgQOBAQKAPED1BgACBFwIC/ULVmwQIEDgQEOgDRE8QIEDghYBAv1D1JgECBA4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Ge,Fe){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var Q,ae,X,M=!1,K,D;window.PR_SHOULD_USE_CONTINUATION=!0;var P,H;(function(){var W=window,_=["break,continue,do,else,for,if,return,while"],L=[_,"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"],y=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],C=[y,"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"],k=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],O=[y,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],A="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",x=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],d="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",a=[_,"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"],l=[_,"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"],s=[_,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[C,O,k,x,d,a,l,s],c=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",R="kwd",E="com",f="typ",g="lit",h="pun",o="pln",S="tag",b="dec",T="src",N="atn",z="atv",Y="nocode",te="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function G(He){for(var Ke=0,ut=!1,vt=!1,ht=0,et=He.length;ht<et;++ht){var Ze=He[ht];if(Ze.ignoreCase)vt=!0;else if(/[a-z]/i.test(Ze.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ut=!0,vt=!1;break}}var Tt={b:8,t:9,n:10,v:11,f:12,r:13};function bt(Qe){var Ie=Qe.charCodeAt(0);if(Ie!==92)return Ie;var Et=Qe.charAt(1);return Ie=Tt[Et],Ie||("0"<=Et&&Et<="7"?parseInt(Qe.substring(1),8):Et==="u"||Et==="x"?parseInt(Qe.substring(2),16):Qe.charCodeAt(1))}function St(Qe){if(Qe<32)return(Qe<16?"\\x0":"\\x")+Qe.toString(16);var Ie=String.fromCharCode(Qe);return Ie==="\\"||Ie==="-"||Ie==="]"||Ie==="^"?"\\"+Ie:Ie}function lt(Qe){var Ie=Qe.substring(1,Qe.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Et=[],$e=Ie[0]==="^",_e=["["];$e&&_e.push("^");for(var Je=$e?1:0,Se=Ie.length;Je<Se;++Je){var me=Ie[Je];if(/\\[bdsw]/i.test(me))_e.push(me);else{var ve=bt(me),ne;Je+2<Se&&Ie[Je+1]==="-"?(ne=bt(Ie[Je+2]),Je+=2):ne=ve,Et.push([ve,ne]),ne<65||ve>122||(ne<65||ve>90||Et.push([Math.max(65,ve)|32,Math.min(ne,90)|32]),ne<97||ve>122||Et.push([Math.max(97,ve)&~32,Math.min(ne,122)&~32]))}}Et.sort(function(xe,Le){return xe[0]-Le[0]||Le[1]-xe[1]});for(var ie=[],de=[],Je=0;Je<Et.length;++Je){var pe=Et[Je];pe[0]<=de[1]+1?de[1]=Math.max(de[1],pe[1]):ie.push(de=pe)}for(var Je=0;Je<ie.length;++Je){var pe=ie[Je];_e.push(St(pe[0])),pe[1]>pe[0]&&(pe[1]+1>pe[0]&&_e.push("-"),_e.push(St(pe[1])))}return _e.push("]"),_e.join("")}function yt(Qe){for(var Ie=Qe.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")),Et=Ie.length,$e=[],_e=0,Je=0;_e<Et;++_e){var Se=Ie[_e];if(Se==="(")++Je;else if(Se.charAt(0)==="\\"){var me=+Se.substring(1);me&&(me<=Je?$e[me]=-1:Ie[_e]=St(me))}}for(var _e=1;_e<$e.length;++_e)$e[_e]===-1&&($e[_e]=++Ke);for(var _e=0,Je=0;_e<Et;++_e){var Se=Ie[_e];if(Se==="(")++Je,$e[Je]||(Ie[_e]="(?:");else if(Se.charAt(0)==="\\"){var me=+Se.substring(1);me&&me<=Je&&(Ie[_e]="\\"+$e[me])}}for(var _e=0;_e<Et;++_e)Ie[_e]==="^"&&Ie[_e+1]!=="^"&&(Ie[_e]="");if(Qe.ignoreCase&&ut)for(var _e=0;_e<Et;++_e){var Se=Ie[_e],ve=Se.charAt(0);Se.length>=2&&ve==="["?Ie[_e]=lt(Se):ve!=="\\"&&(Ie[_e]=Se.replace(/[a-zA-Z]/g,function(de){var pe=de.charCodeAt(0);return"["+String.fromCharCode(pe&~32,pe|32)+"]"}))}return Ie.join("")}for(var dt=[],ht=0,et=He.length;ht<et;++ht){var Ze=He[ht];if(Ze.global||Ze.multiline)throw new Error(""+Ze);dt.push("(?:"+yt(Ze)+")")}return new RegExp(dt.join("|"),vt?"gi":"g")}function F(He,Ke){var ut=/(?:^|\s)nocode(?:\s|$)/,vt=[],ht=0,et=[],Ze=0;function Tt(bt){var St=bt.nodeType;if(St==1){if(ut.test(bt.className))return;for(var lt=bt.firstChild;lt;lt=lt.nextSibling)Tt(lt);var yt=bt.nodeName.toLowerCase();(yt==="br"||yt==="li")&&(vt[Ze]=`
|
|
`,et[Ze<<1]=ht++,et[Ze++<<1|1]=bt)}else if(St==3||St==4){var dt=bt.nodeValue;dt.length&&(Ke?dt=dt.replace(/\r\n?/g,`
|
|
`):dt=dt.replace(/[ \t\r\n]+/g," "),vt[Ze]=dt,et[Ze<<1]=ht,ht+=dt.length,et[Ze++<<1|1]=bt)}}return Tt(He),{sourceCode:vt.join("").replace(/\n$/,""),spans:et}}function re(He,Ke,ut,vt,ht){if(!ut)return;var et={sourceNode:He,pre:1,langExtension:null,numberLines:null,sourceCode:ut,spans:null,basePos:Ke,decorations:null};vt(et),ht.push.apply(ht,et.decorations)}var le=/\S/;function Ee(He){for(var Ke=void 0,ut=He.firstChild;ut;ut=ut.nextSibling){var vt=ut.nodeType;Ke=vt===1?Ke?He:ut:vt===3&&le.test(ut.nodeValue)?He:Ke}return Ke===He?void 0:Ke}function Oe(He,Ke){var ut={},vt;(function(){for(var Ze=He.concat(Ke),Tt=[],bt={},St=0,lt=Ze.length;St<lt;++St){var yt=Ze[St],dt=yt[3];if(dt)for(var Qe=dt.length;--Qe>=0;)ut[dt.charAt(Qe)]=yt;var Ie=yt[1],Et=""+Ie;bt.hasOwnProperty(Et)||(Tt.push(Ie),bt[Et]=null)}Tt.push(/[\0-\uffff]/),vt=G(Tt)})();var ht=Ke.length,et=function(Ze){for(var Tt=Ze.sourceCode,bt=Ze.basePos,St=Ze.sourceNode,lt=[bt,o],yt=0,dt=Tt.match(vt)||[],Qe={},Ie=0,Et=dt.length;Ie<Et;++Ie){var $e=dt[Ie],_e=Qe[$e],Je=void 0,Se;if(typeof _e=="string")Se=!1;else{var me=ut[$e.charAt(0)];if(me)Je=$e.match(me[1]),_e=me[0];else{for(var ve=0;ve<ht;++ve)if(me=Ke[ve],Je=$e.match(me[1]),Je){_e=me[0];break}Je||(_e=o)}Se=_e.length>=5&&_e.substring(0,5)==="lang-",Se&&!(Je&&typeof Je[1]=="string")&&(Se=!1,_e=T),Se||(Qe[$e]=_e)}var ne=yt;if(yt+=$e.length,!Se)lt.push(bt+ne,_e);else{var ie=Je[1],de=$e.indexOf(ie),pe=de+ie.length;Je[2]&&(pe=$e.length-Je[2].length,de=pe-ie.length);var xe=_e.substring(5);re(St,bt+ne,$e.substring(0,de),et,lt),re(St,bt+ne+de,ie,se(xe,ie),lt),re(St,bt+ne+pe,$e.substring(pe),et,lt)}}Ze.decorations=lt};return et}function Ye(He){var Ke=[],ut=[];He.tripleQuotedStrings?Ke.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):He.multiLineStrings?Ke.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ke.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),He.verbatimStrings&&ut.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var vt=He.hashComments;vt&&(He.cStyleComments?(vt>1?Ke.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ke.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ut.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ke.push([E,/^#[^\r\n]*/,null,"#"])),He.cStyleComments&&(ut.push([E,/^\/\/[^\r\n]*/,null]),ut.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ht=He.regexLiterals;if(ht){var et=ht>1?"":`
|
|
\r`,Ze=et?".":"[\\S\\s]",Tt="/(?=[^/*"+et+"])(?:[^/\\x5B\\x5C"+et+"]|\\x5C"+Ze+"|\\x5B(?:[^\\x5C\\x5D"+et+"]|\\x5C"+Ze+")*(?:\\x5D|$))+/";ut.push(["lang-regex",RegExp("^"+te+"("+Tt+")")])}var bt=He.types;bt&&ut.push([f,bt]);var St=(""+He.keywords).replace(/^ | $/g,"");St.length&&ut.push([R,new RegExp("^(?:"+St.replace(/[\s,]+/g,"|")+")\\b"),null]),Ke.push([o,/^\s+/,null,` \r
|
|
\xA0`]);var lt="^.[^\\s\\w.$@'\"`/\\\\]*";return He.regexLiterals&&(lt+="(?!s*/)"),ut.push([g,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[g,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[h,new RegExp(lt),null]),Oe(Ke,ut)}var Pe=Ye({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Be(He,Ke,ut){for(var vt=/(?:^|\s)nocode(?:\s|$)/,ht=/\r\n?|\n/,et=He.ownerDocument,Ze=et.createElement("li");He.firstChild;)Ze.appendChild(He.firstChild);var Tt=[Ze];function bt(Ie){var Et=Ie.nodeType;if(Et==1&&!vt.test(Ie.className))if(Ie.nodeName==="br")St(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var $e=Ie.firstChild;$e;$e=$e.nextSibling)bt($e);else if((Et==3||Et==4)&&ut){var _e=Ie.nodeValue,Je=_e.match(ht);if(Je){var Se=_e.substring(0,Je.index);Ie.nodeValue=Se;var me=_e.substring(Je.index+Je[0].length);if(me){var ve=Ie.parentNode;ve.insertBefore(et.createTextNode(me),Ie.nextSibling)}St(Ie),Se||Ie.parentNode.removeChild(Ie)}}}function St(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function Et(Je,Se){var me=Se?Je.cloneNode(!1):Je,ve=Je.parentNode;if(ve){var ne=Et(ve,1),ie=Je.nextSibling;ne.appendChild(me);for(var de=ie;de;de=ie)ie=de.nextSibling,ne.appendChild(de)}return me}for(var $e=Et(Ie.nextSibling,0),_e;(_e=$e.parentNode)&&_e.nodeType===1;)$e=_e;Tt.push($e)}for(var lt=0;lt<Tt.length;++lt)bt(Tt[lt]);Ke===(Ke|0)&&Tt[0].setAttribute("value",Ke);var yt=et.createElement("ol");yt.className="linenums";for(var dt=Math.max(0,Ke-1|0)||0,lt=0,Qe=Tt.length;lt<Qe;++lt)Ze=Tt[lt],Ze.className="L"+(lt+dt)%10,Ze.firstChild||Ze.appendChild(et.createTextNode("\xA0")),yt.appendChild(Ze);He.appendChild(yt)}function Ue(He){var Ke=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ke=Ke&&+Ke[1]<=8;var ut=/\n/g,vt=He.sourceCode,ht=vt.length,et=0,Ze=He.spans,Tt=Ze.length,bt=0,St=He.decorations,lt=St.length,yt=0;St[lt]=ht;var dt,Qe;for(Qe=dt=0;Qe<lt;)St[Qe]!==St[Qe+2]?(St[dt++]=St[Qe++],St[dt++]=St[Qe++]):Qe+=2;for(lt=dt,Qe=dt=0;Qe<lt;){for(var Ie=St[Qe],Et=St[Qe+1],$e=Qe+2;$e+2<=lt&&St[$e+1]===Et;)$e+=2;St[dt++]=Ie,St[dt++]=Et,Qe=$e}lt=St.length=dt;var _e=He.sourceNode,Je="";_e&&(Je=_e.style.display,_e.style.display="none");try{for(var Se=null;bt<Tt;){var me=Ze[bt],ve=Ze[bt+2]||ht,ne=St[yt+2]||ht,$e=Math.min(ve,ne),ie=Ze[bt+1],de;if(ie.nodeType!==1&&(de=vt.substring(et,$e))){Ke&&(de=de.replace(ut,"\r")),ie.nodeValue=de;var pe=ie.ownerDocument,xe=pe.createElement("span");xe.className=St[yt+1];var Le=ie.parentNode;Le.replaceChild(xe,ie),xe.appendChild(ie),et<ve&&(Ze[bt+1]=ie=pe.createTextNode(vt.substring($e,ve)),Le.insertBefore(ie,xe.nextSibling))}et=$e,et>=ve&&(bt+=2),et>=ne&&(yt+=2)}}finally{_e&&(_e.style.display=Je)}}var Ne={};function Te(He,Ke){for(var ut=Ke.length;--ut>=0;){var vt=Ke[ut];Ne.hasOwnProperty(vt)?W.console&&console.warn("cannot override language handler %s",vt):Ne[vt]=He}}function se(He,Ke){return He&&Ne.hasOwnProperty(He)||(He=/^\s*</.test(Ke)?"default-markup":"default-code"),Ne[He]}Te(Pe,["default-code"]),Te(Oe([],[[o,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Te(Oe([[o,/^[\s]+/,null,` \r
|
|
`],[z,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[S,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Te(Oe([],[[z,/^[\s\S]+/]]),["uq.val"]),Te(Ye({keywords:C,hashComments:!0,cStyleComments:!0,types:c}),["c","cc","cpp","cxx","cyc","m"]),Te(Ye({keywords:"null,true,false"}),["json"]),Te(Ye({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:c}),["cs"]),Te(Ye({keywords:k,cStyleComments:!0}),["java"]),Te(Ye({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Te(Ye({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Te(Ye({keywords:d,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Te(Ye({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Te(Ye({keywords:x,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Te(Ye({keywords:A,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Te(Oe([],[[m,/^[\s\S]+/]]),["regex"]);function ze(He){var Ke=He.langExtension;try{var ut=F(He.sourceNode,He.pre),vt=ut.sourceCode;He.sourceCode=vt,He.spans=ut.spans,He.basePos=0,se(Ke,vt)(He),Ue(He)}catch(ht){W.console&&console.log(ht&&ht.stack||ht)}}function xt(He,Ke,ut){var vt=ut||!1,ht=Ke||null,et=document.createElement("div");et.innerHTML="<pre>"+He+"</pre>",et=et.firstChild,vt&&Be(et,vt,!0);var Ze={langExtension:ht,numberLines:vt,sourceNode:et,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ze(Ze),et.innerHTML}function ct(He,Ke){var ut=Ke||document.body,vt=ut.ownerDocument||document;function ht(me){return ut.getElementsByTagName(me)}for(var et=[ht("pre"),ht("code"),ht("xmp")],Ze=[],Tt=0;Tt<et.length;++Tt)for(var bt=0,St=et[Tt].length;bt<St;++bt)Ze.push(et[Tt][bt]);et=null;var lt=Date;lt.now||(lt={now:function(){return+new Date}});var yt=0,dt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Qe=/\bprettyprint\b/,Ie=/\bprettyprinted\b/,Et=/pre|xmp/i,$e=/^code$/i,_e=/^(?:pre|code|xmp)$/i,Je={};function Se(){for(var me=W.PR_SHOULD_USE_CONTINUATION?lt.now()+250:Infinity;yt<Ze.length&<.now()<me;yt++){for(var ve=Ze[yt],ne=Je,ie=ve;ie=ie.previousSibling;){var de=ie.nodeType,pe=(de===7||de===8)&&ie.nodeValue;if(pe?!/^\??prettify\b/.test(pe):de!==3||/\S/.test(ie.nodeValue))break;if(pe){ne={},pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(nr,Ot,xr){ne[Ot]=xr});break}}var xe=ve.className;if((ne!==Je||Qe.test(xe))&&!Ie.test(xe)){for(var Le=!1,je=ve.parentNode;je;je=je.parentNode){var mt=je.tagName;if(_e.test(mt)&&je.className&&Qe.test(je.className)){Le=!0;break}}if(!Le){ve.className+=" prettyprinted";var Mt=ne.lang;if(!Mt){Mt=xe.match(dt);var Rt;!Mt&&(Rt=Ee(ve))&&$e.test(Rt.tagName)&&(Mt=Rt.className.match(dt)),Mt&&(Mt=Mt[1])}var Kt;if(Et.test(ve.tagName))Kt=1;else{var _t=ve.currentStyle,ot=vt.defaultView,Jt=_t?_t.whiteSpace:ot&&ot.getComputedStyle?ot.getComputedStyle(ve,null).getPropertyValue("white-space"):0;Kt=Jt&&Jt.substring(0,3)==="pre"}var Ut=ne.linenums;(Ut=Ut==="true"||+Ut)||(Ut=xe.match(/\blinenums\b(?::(\d+))?/),Ut=Ut?Ut[1]&&Ut[1].length?+Ut[1]:!0:!1),Ut&&Be(ve,Ut,Kt);var Zt={langExtension:Mt,sourceNode:ve,numberLines:Ut,pre:Kt,sourceCode:null,basePos:null,spans:null,decorations:null};ze(Zt)}}}yt<Ze.length?W.setTimeout(Se,250):typeof He=="function"&&He()}Se()}var ft=W.PR={createSimpleLexer:Oe,registerLangHandler:Te,sourceDecorator:Ye,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:z,PR_COMMENT:E,PR_DECLARATION:b,PR_KEYWORD:R,PR_LITERAL:g,PR_NOCODE:Y,PR_PLAIN:o,PR_PUNCTUATION:h,PR_SOURCE:T,PR_STRING:m,PR_TAG:S,PR_TYPE:f,prettyPrintOne:M?W.prettyPrintOne=xt:P=xt,prettyPrint:H=M?W.prettyPrint=ct:H=ct},Ct=W.define;typeof Ct=="function"&&Ct.amd&&Ct("google-code-prettify",[],function(){return ft})})()},SMhR:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHGCAYAAADuYispAAAAAklEQVR4AewaftIAABHTSURBVO3BQY4cy5IEQdNA3//KNo2/8NU8XzCQyCpSReivSJKk/zmRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJ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3nEiSpHEiSZLGiSRJGieSJGmcSJKkcSJJksaJJEkaP9FHA3KjbTZAngRk0zafDMiTgPyptrkB5Eltc6Nt3gTkTW1zA8imbZ7UNt/qRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdL4yZdrm28G5JO1zQ0gN9pmA2QDZNM2GyCbtrnRNk8BcqNtNkA2QN7UNhsgTwKyaZsNkE3bvAnIjbb5VCeSJGmcSJKkcSJJksaJJEkaJ5IkaZxIkqRxIkmSBv2VFwH5m7XNk4Bs2uZJQJ7UNjeA3GibTwXkRttsgNxomw2QG22zAXKjbW4AeVLbbIDcaJsNkCe1zVtOJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJA36K5Ik6X9OJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ40SSJI0TSZI0TiRJ0jiRJEnjRJIkjRNJkjROJEnSOJEkSeNEkiSNE0mSNE4kSdI4kSRJ4/8ATrCgy9kbxW8AAAAASUVORK5CYII="},TGq3:function(Ge,Fe,Q){Ge.exports=Q.p+"static/lockclose.365036e8.svg"},UUDw:function(Ge,Fe,Q){Ge.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UeE2:function(Ge,Fe,Q){"use strict";Q.r(Fe);var ae=Q("5NDa"),X=Q("5rEg"),M=Q("7Kak"),K=Q("9yH6"),D=Q("2qtc"),P=Q("kLXV"),H=Q("+L6B"),W=Q("2/Rp"),_=Q("miYZ"),L=Q("tsqr"),y=Q("9og8"),C=Q("k1fw"),k=Q("y8nQ"),O=Q("Vl3Y"),A=Q("tJVT"),x=Q("PpiC"),d=Q("Znn+"),a=Q("ZTPi"),l=Q("WmNS"),s=Q.n(l),v=Q("q1tI"),c=Q.n(v),m=Q("9kvl"),R=Q("Ot1p"),E=Q("9Bee"),f=Q("HBuW"),g=Q("14J3"),h=Q("BMrR"),o=Q("jCWc"),S=Q("kPKH"),b=Q("OaEy"),T=Q("2fM7"),N=Q("1vsH"),z=Q("uIXO"),Y=Q.n(z),te=Q("5Dmo"),G=Q("3S7+"),F=Q("oBTY"),re=Q("WXWZ"),le=Q.n(re),Ee=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Oe=function(yt,dt){var Qe=yt.editData,Ie=Object(v.useState)(["","","",""]),Et=Object(A.a)(Ie,2),$e=Et[0],_e=Et[1],Je=Object(v.useState)(),Se=Object(A.a)(Je,2),me=Se[0],ve=Se[1],ne=Object(v.useState)([]),ie=Object(A.a)(ne,2),de=ie[0],pe=ie[1],xe=Object(v.useState)(""),Le=Object(A.a)(xe,2),je=Le[0],mt=Le[1];Object(v.useEffect)(function(){var _t,ot;if(!Qe)return;mt(Qe==null?void 0:Qe.subject),_e(Qe==null||((_t=Qe.choose_contents)===null||_t===void 0)?void 0:_t.map(function(Ut){return Ut.option_name}));var Jt=[];Qe==null||((ot=Qe.choose_contents)===null||ot===void 0)||ot.map(function(Ut,Zt){Ut.right_key&&Jt.push(Zt)}),pe(Jt)},[Qe]),Object(v.useImperativeHandle)(dt,function(){return{onSave:Rt,Clear:Kt}});var Mt=function(){for(var ot=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Jt=Object(F.a)(ot),Ut=Jt.sort(),Zt=0;Zt<Ut.length-1;Zt++)if(Ut[Zt]==Ut[Zt+1])return!0;return!1},Rt=function(){if(!je)return L.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var ot=$e.findIndex(function(Ut){return!Ut});if(ot>-1)return L.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ee[ot]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log($e,"questionChoiceList"),Mt($e))return L.b.info("\u9009\u9879\u5DF2\u91CD\u590D"),!1;if(!de.length)return L.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;var Jt=$e.map(function(Ut,Zt){return{choice_text:Ut,is_answer:de.includes(Zt)?1:0}});return{name:je,choices:Jt}},Kt=function(){_e(["","","",""]),mt(""),pe([])};return c.a.createElement("section",{className:le.a.wrap},c.a.createElement("p",{className:le.a.titleWrap},c.a.createElement("span",{className:le.a.required},"*"),c.a.createElement("span",{className:le.a.title},"\u9898\u5E72\uFF1A")),c.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:je,onChange:function(ot){return mt(ot)}}),c.a.createElement("p",{className:le.a.titleWrap},c.a.createElement("span",{className:le.a.required},"*"),c.a.createElement("span",{className:le.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",c.a.createElement("span",{className:le.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),$e.map(function(_t,ot){return c.a.createElement("div",{className:le.a.choiceWrap,key:ot},c.a.createElement(G.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},c.a.createElement("div",{className:"".concat(le.a.answer," ").concat(de.includes(ot)?le.a.activeAnswer:""),onClick:function(){de.includes(ot)?pe(de.filter(function(Ut){return Ut!==ot})):pe([].concat(Object(F.a)(de),[ot]))}},Ee[ot])),c.a.createElement("div",{className:le.a.editorWrap},me===ot?c.a.createElement(R.a,{id:"single-question-option-".concat(ot),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:_t,onChange:function(Ut){$e[ot]=Ut,_e($e)}}):c.a.createElement("div",{className:le.a.htmlWrap,onClick:function(){return ve(ot)}},c.a.createElement(E.a,{value:_t}))),ot>1&&c.a.createElement(G.a,{title:"\u5220\u9664"},c.a.createElement("i",{className:"".concat(le.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return _e($e.filter(function(Ut,Zt){return Zt!==ot}))}})),ot<7&&ot===$e.length-1&&c.a.createElement(G.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},c.a.createElement("i",{className:"".concat(le.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return _e([].concat(Object(F.a)($e),[""]))}})))}),c.a.createElement("div",{className:"mt10 mb10"},c.a.createElement("span",{className:"c-grey-999"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898")))},Ye=Object(v.forwardRef)(Oe),Pe=Q("sRBo"),Be=Q("kaz8"),Ue=Q("kqOp"),Ne=Q("7qnI"),Te=function(yt,dt){var Qe=yt.editData,Ie=Object(v.useState)(""),Et=Object(A.a)(Ie,2),$e=Et[0],_e=Et[1],Je=Object(v.useState)([]),Se=Object(A.a)(Je,2),me=Se[0],ve=Se[1],ne=Object(v.useState)(""),ie=Object(A.a)(ne,2),de=ie[0],pe=ie[1],xe=Object(v.useState)(),Le=Object(A.a)(xe,2),je=Le[0],mt=Le[1],Mt=Object(v.useState)(!1),Rt=Object(A.a)(Mt,2),Kt=Rt[0],_t=Rt[1];Object(v.useEffect)(function(){if(!Qe)return;_e(Qe==null?void 0:Qe.subject),mt(Qe==null?void 0:Qe.is_ordered),_t(!0)},[Qe]),Object(v.useEffect)(function(){var $t;if(!Kt)return;var it=Qe==null||(($t=Qe.standard_answers)===null||$t===void 0)?void 0:$t.map(function(lr){return lr.text});ve(it),_t(!1)},[Kt]),Object(v.useImperativeHandle)(dt,function(){return{onSave:ot,Clear:Jt}}),console.log(me,"answerList");var ot=function(){var it=[],lr=!1;return me.forEach(function(nt,yr){it.push({position:yr+1,answer_text:[]}),nt.forEach(function(Lr,jr){it[yr].answer_text.push(Lr),(!Lr||!Object(N.db)(Lr,1e4))&&(pe("".concat(yr,"-").concat(jr)),L.b.info(Lr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),lr=!0)})}),lr?!1:(it==null?void 0:it.length)>20?(L.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:$e,standard_answers:it,is_ordered:je}},Jt=function(){_e(""),ve([]),mt(!1)},Ut=function(it,lr,nt){var yr=me.slice();if(lr&&yr.splice(it,lr),nt)for(var Lr=0;Lr<nt;Lr++)yr.splice(it+Lr,0,[""]);ve(yr)},Zt=function(it,lr,nt){pe("");var yr=me.slice();yr[it][lr]=nt,ve(yr)},nr=function(it){var lr=me.slice();lr[it]=[].concat(Object(F.a)(lr[it]),[""]),ve(lr)},Ot=function(it,lr){var nt=me.slice();if(!nt[it][lr]){nt[it]=nt[it].filter(function(yr,Lr){return Lr!==lr}),ve(nt);return}P.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:le.a.modal,onOk:function(){nt[it]=nt[it].filter(function(Lr,jr){return jr!==lr}),ve(nt)}})},xr=function(it){P.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:le.a.modal,onOk:function(){var nt=me.slice();nt=me.filter(function(yr,Lr){return it!==Lr}),ve(nt)}})};return c.a.createElement("section",{className:le.a.wrap},c.a.createElement("p",{className:le.a.titleWrap},c.a.createElement("span",{className:le.a.required},"*"),c.a.createElement("span",{className:le.a.title},"\u9898\u5E72\uFF1A")),c.a.createElement("div",null,c.a.createElement(Ue.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:$e,onChange:function(it){return _e(it)},showNullButton:!0,onPlaceholderChange:Ut})),c.a.createElement("div",{className:"mt20"},me.map(function($t,it){return c.a.createElement(Ne.a,{key:it,answers:$t,index:it,is_md:!0,activeOptionErrorIndex:de,onAnswerChange:Zt,addChildAnswer:nr,deleteChildAnswer:Ot,deleteChildAnswermain:xr})})),c.a.createElement("div",{className:"mt10 mb5"},me.length>1&&c.a.createElement("span",null,c.a.createElement(Be.a,{checked:je,onChange:function(it){return mt(it.target.checked)},className:le.a.color333},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),c.a.createElement("span",{className:"".concat(le.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))))},se=Object(v.forwardRef)(Te),ze=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],xt=function(yt,dt){var Qe=yt.editData,Ie=Object(v.useState)(),Et=Object(A.a)(Ie,2),$e=Et[0],_e=Et[1],Je=Object(v.useState)(""),Se=Object(A.a)(Je,2),me=Se[0],ve=Se[1];Object(v.useEffect)(function(){if(!Qe)return;ve(Qe==null?void 0:Qe.subject),_e((Qe==null?void 0:Qe.standard_answer)==="\u6B63\u786E"?"0":"1")},[Qe]),Object(v.useImperativeHandle)(dt,function(){return{onSave:ne,Clear:ie}});var ne=function(){if(!me)return L.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!$e)return L.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u5224\u65AD\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var pe=[{choice_text:"\u6B63\u786E",is_answer:$e==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:$e==="1"?1:0}];return{name:me,choices:pe}},ie=function(){ve(""),_e("")};return c.a.createElement("section",{className:le.a.wrap},c.a.createElement("p",{className:le.a.titleWrap},c.a.createElement("span",{className:le.a.required},"*"),c.a.createElement("span",{className:le.a.title},"\u9898\u5E72\uFF1A")),c.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:me,onChange:function(pe){return ve(pe)}}),c.a.createElement("p",{className:le.a.titleWrap},c.a.createElement("span",{className:le.a.required},"*"),c.a.createElement("span",{className:le.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",c.a.createElement("span",{className:le.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),c.a.createElement(K.a.Group,{className:"mb10",buttonStyle:"solid",value:$e,onChange:function(pe){return _e(pe.target.value)}},c.a.createElement(K.a.Button,{value:"0",className:"".concat(le.a.radio," mr40")},"\u6B63\u786E"),c.a.createElement(K.a.Button,{value:"1",className:le.a.radio},"\u9519\u8BEF")))},ct=Object(v.forwardRef)(xt),ft=function(yt){var dt=yt.visible,Qe=dt===void 0?!1:dt,Ie=yt.is_published,Et=yt.match,$e=yt.editData,_e=yt.onOk,Je=yt.onCancel,Se=Object(v.useState)([10,20]),me=Object(A.a)(Se,2),ve=me[0],ne=me[1],ie=O.a.useForm(),de=Object(A.a)(ie,1),pe=de[0],xe=Object(v.useState)({}),Le=Object(A.a)(xe,2),je=Le[0],mt=Le[1],Mt=Object(v.useRef)();Object(v.useEffect)(function(){return document.getElementById("modal-level-question").style.transform="none",function(){document.getElementById("modal-level-question").style.transform="translateX(0)"}},[]),Object(v.useEffect)(function(){Qe&&$e&&(pe.setFieldsValue(Object(C.a)({},$e)),ne(Rt[$e.difficult]))},[Qe]);var Rt={1:[10,20],2:[30,40,50,60],3:[70,80,90,100]},Kt=function(nr,Ot){mt(Object(C.a)({},Ot)),"difficult"in nr&&ot(nr.difficult)},_t=function(){var Zt=Object(y.a)(s.a.mark(function nr(){var Ot,xr,$t,it,lr,nt,yr;return s.a.wrap(function(jr){for(;;)switch(jr.prev=jr.next){case 0:return jr.next=2,Mt.current.onSave();case 2:if(Ot=jr.sent,Ot){jr.next=5;break}return jr.abrupt("return",!1);case 5:if(!(Qe===1)){jr.next=11;break}return xr="",$t={cnt:Ot==null?void 0:Ot.choices.map(function(pn){return pn.choice_text})},it={answer:Ot==null?void 0:Ot.choices.map(function(pn){return pn.is_answer})},it==null||it.answer.map(function(pn,br){pn&&(xr+=N.o[br])}),jr.abrupt("return",{challenge_choose:{subject:Ot.name,answer:je.task_pass,standard_answer:xr,score:je.score,difficult:je.difficult},question:$t,choice:it});case 11:if(!(Qe===2)){jr.next=13;break}return jr.abrupt("return",{challenge_choose:{subject:Ot.name,answer:je.task_pass,score:je.score,difficult:je.difficult},blank_answers:Ot==null?void 0:Ot.standard_answers,is_ordered:Ot==null?void 0:Ot.is_ordered});case 13:if(!(Qe===3)){jr.next=16;break}return yr=Ot!=null&&(lr=Ot.choices)!==null&&lr!==void 0&&(nt=lr[0])!==null&&nt!==void 0&&nt.is_answer?"true":"false",jr.abrupt("return",{challenge_choose:{subject:Ot.name,answer:je.task_pass,standard_answer:yr,score:je.score,difficult:je.difficult}});case 16:case"end":return jr.stop()}},nr)}));return function(){return Zt.apply(this,arguments)}}(),ot=function(nr){var Ot=Rt[nr],xr=Ot==null?void 0:Ot[0];ne(Ot),pe.setFieldsValue({score:xr}),mt(Object(C.a)(Object(C.a)({},pe.getFieldsValue()),{score:xr}))},Jt=function(){var Zt=Object(y.a)(s.a.mark(function nr(Ot){var xr,$t,it;return s.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:return nt.next=2,_t();case 2:if(xr=nt.sent,xr){nt.next=5;break}return nt.abrupt("return");case 5:if(!$e){nt.next=25;break}return nt.t0=f.Nb,nt.t1=C.a,nt.t2=C.a,nt.t3=C.a,nt.t4={},nt.next=13,xr;case 13:return nt.t5=nt.sent,nt.t6=(0,nt.t3)(nt.t4,nt.t5),nt.t7=Et.params,nt.t8=(0,nt.t2)(nt.t6,nt.t7),nt.t9={},nt.t10={questionId:$e.choose_id,type:Qe},nt.t11=(0,nt.t1)(nt.t8,nt.t9,nt.t10),nt.next=22,(0,nt.t0)(nt.t11);case 22:return $t=nt.sent,$t.challenge_choose_id&&(L.b.success("\u64CD\u4F5C\u6210\u529F"),_e()),nt.abrupt("return");case 25:return nt.t12=f.c,nt.t13=C.a,nt.t14=C.a,nt.t15=C.a,nt.t16={},nt.next=32,xr;case 32:return nt.t17=nt.sent,nt.t18=(0,nt.t15)(nt.t16,nt.t17),nt.t19=Et.params,nt.t20=(0,nt.t14)(nt.t18,nt.t19),nt.t21={},nt.t22={type:Qe},nt.t23=(0,nt.t13)(nt.t20,nt.t21,nt.t22),nt.next=41,(0,nt.t12)(nt.t23);case 41:it=nt.sent,it.challenge_choose_id&&(L.b.success("\u64CD\u4F5C\u6210\u529F"),_e());case 43:case"end":return nt.stop()}},nr)}));return function(Ot){return Zt.apply(this,arguments)}}(),Ut=function(){var Zt=Object(y.a)(s.a.mark(function nr(){var Ot;return s.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Mt.current.onSave();case 2:if(Ot=$t.sent,Ot){$t.next=5;break}return $t.abrupt("return",!1);case 5:pe.submit();case 6:case"end":return $t.stop()}},nr)}));return function(){return Zt.apply(this,arguments)}}();return c.a.createElement("div",{className:Y.a.modal},c.a.createElement("div",{className:Y.a.main},c.a.createElement("div",{className:Y.a.title},c.a.createElement("span",{className:Y.a.name},$e?"\u7F16\u8F91\u9898\u76EE":"\u6DFB\u52A0\u9898\u76EE"),c.a.createElement("span",{className:Y.a.edit,onClick:Je}," ",c.a.createElement("i",{className:"iconfont icon-guanbi1"})," ")),c.a.createElement("div",{className:Y.a.body,id:"question-scroll"},c.a.createElement(O.a,{form:pe,className:Y.a.form,scrollToFirstError:!0,layout:"vertical",onValuesChange:Kt,onFinish:Jt,initialValues:{difficult:1,score:10}},Qe===1&&c.a.createElement(Ye,{ref:Mt,editData:$e}),Qe===2&&c.a.createElement(se,{ref:Mt,editData:$e}),Qe===3&&c.a.createElement(ct,{ref:Mt,editData:$e}),c.a.createElement(O.a.Item,{name:"task_pass",label:"\u53C2\u8003\u7B54\u6848:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848"},{max:35e3,message:"\u53C2\u8003\u7B54\u6848\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},c.a.createElement(R.a,{className:"mt5",watch:!0,defaultValue:($e==null?void 0:$e.answer)||""})),c.a.createElement(O.a.Item,{name:"difficult",label:"\u96BE\u5EA6\u7CFB\u6570:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570"}]},c.a.createElement(K.a.Group,{disabled:Ie},c.a.createElement(K.a,{value:1},"\u7B80\u5355"),c.a.createElement(K.a,{style:{marginLeft:80},value:2},"\u4E2D\u7B49"),c.a.createElement(K.a,{style:{marginLeft:80},className:"ml80",value:3},"\u56F0\u96BE"))),c.a.createElement(h.a,{className:"customAddItemSelect"},c.a.createElement(S.a,null,c.a.createElement(O.a.Item,{name:"score",label:"\u5956\u52B1\u91D1\u5E01:",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C"}]},c.a.createElement(T.a,{size:"large",disabled:Ie},ve.map(function(Zt){return c.a.createElement(T.a.Option,{key:Zt,value:Zt},Zt)})))),c.a.createElement(S.a,{style:{paddingTop:18}},c.a.createElement("div",{className:"font12 c-light-black ml10 mt20"},"\u5B66\u5458\u6B63\u786E\u7B54\u9898\u65F6\u83B7\u5F97\u91D1\u5E01\uFF0C\u5E76\u4E14\u83B7\u5F97\u7B49\u91CF\u7684\u7ECF\u9A8C\u503C\u3002\u5982\uFF1A+100\u91D1\u5E01\u3001+100\u7ECF\u9A8C\u503C\u3002"))))),c.a.createElement("div",{className:Y.a.btns},c.a.createElement(W.a,{size:"large",style:{marginRight:20},onClick:Je},"\u53D6\u6D88"),c.a.createElement(W.a,{size:"large",type:"primary",onClick:Ut},"\u4FDD\u5B58"))))},Ct=ft,He=Q("mepR"),Ke=Q.n(He),ut=Q("9ZNV"),vt=Q("nuEh"),ht=Q("UqFu"),et=Q("lzim"),Ze=Q("xKgJ"),Tt=a.a.TabPane,bt=function(yt){var dt,Qe,Ie=yt.shixunsDetail,Et=yt.practiceSetting,$e=yt.dispatch,_e=yt.match,Je=yt.location,Se=Object(x.a)(yt,["shixunsDetail","practiceSetting","dispatch","match","location"]),me=O.a.useForm(),ve=Object(A.a)(me,1),ne=ve[0],ie=Object(v.useState)({}),de=Object(A.a)(ie,2),pe=de[0],xe=de[1],Le=Object(v.useState)([]),je=Object(A.a)(Le,2),mt=je[0],Mt=je[1],Rt=Object(v.useState)(!0),Kt=Object(A.a)(Rt,2),_t=Kt[0],ot=Kt[1],Jt=Object(v.useState)(!0),Ut=Object(A.a)(Jt,2),Zt=Ut[0],nr=Ut[1],Ot=Object(v.useState)(!1),xr=Object(A.a)(Ot,2),$t=xr[0],it=xr[1],lr=Object(v.useState)(null),nt=Object(A.a)(lr,2),yr=nt[0],Lr=nt[1],jr=Object(v.useState)(null),pn=Object(A.a)(jr,2),br=pn[0],Lt=pn[1],Hn=Object(v.useState)("1"),Zn=Object(A.a)(Hn,2),ln=Zn[0],ir=Zn[1],Un=Object(v.useState)(1),Kn=Object(A.a)(Un,2),ai=Kn[0],rt=Kn[1],Wt=Object(v.useRef)({subject:"",task_pass:""}),zn=Object(v.useRef)(null),ci=Et.is_published,bi=Et.id,oi=Ie.challengesEdit,j=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];Object(v.useEffect)(function(){var Rr;return Je!=null&&(Rr=Je.query)!==null&&Rr!==void 0&&Rr.tab&&ir(Je.query.tab),I(),Z(),function(){clearTimeout(zn.current)}},[Je.pathname]);var u=function(){clearTimeout(zn.current),zn.current=setTimeout(function(){var Ft=ne.getFieldsValue(),Vt=Ft.subject,er=Ft.task_pass;Wt.current.subject!==""&&(Vt!==Wt.current.subject||er!==Wt.current.task_pass?$e({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):$e({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}))},500)},p=function(Ft,Vt){xe(Object(C.a)({},Vt)),u()},I=function(){var Rr=Object(y.a)(s.a.mark(function Ft(){var Vt;return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return nr(!0),wr.next=3,$e({type:"shixunsDetail/getChallengesEdit",payload:Object(C.a)({},_e.params)});case 3:Vt=wr.sent,Lt(Object(C.a)({},Vt)),Wt.current={subject:Vt.subject,task_pass:Object(ht.a)(Vt.task_pass),unity_3d_routes:Vt.unity_3d_routes},xe(Object(C.a)({},Wt.current)),ne.setFieldsValue(Object(C.a)({},Vt)),nr(!1);case 9:case"end":return wr.stop()}},Ft)}));return function(){return Rr.apply(this,arguments)}}(),Z=function(){var Rr=Object(y.a)(s.a.mark(function Ft(){var Vt;return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return ot(!0),wr.next=3,Object(f.bb)(Object(C.a)({},_e.params));case 3:Vt=wr.sent,Mt(Vt.data),ot(!1);case 6:case"end":return wr.stop()}},Ft)}));return function(){return Rr.apply(this,arguments)}}(),U=function(){var Rr=Object(y.a)(s.a.mark(function Ft(Vt){var er,wr,tr;return s.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return er=!(!Vt.unity_3d_routes||Vt.unity_3d_routes==""),wr=Object(C.a)(Object(C.a)(Object(C.a)({},Vt),_e.params),{},{unity_3d_routes:er?Vt.unity_3d_routes:null,unity_3d:er}),nn.next=4,Object(f.Mb)(wr);case 4:tr=nn.sent,tr.status===0&&(L.b.success(tr.message),$e({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),$e({type:"practiceSetting/setUpdateIndex"}),ir("2"),Nr());case 6:case"end":return nn.stop()}},Ft)}));return function(Vt){return Rr.apply(this,arguments)}}(),be=function(){return ln==="1"?null:c.a.createElement("div",{className:"mb10"},c.a.createElement(W.a,{onClick:function(){return it(1)},type:"primary",ghost:!0},"\u6DFB\u52A0\u9009\u62E9\u9898"),c.a.createElement(W.a,{onClick:function(){return it(2)},type:"primary",className:"ml20 mr20",ghost:!0},"\u6DFB\u52A0\u586B\u7A7A\u9898"),c.a.createElement(W.a,{onClick:function(){return it(3)},type:"primary",ghost:!0},"\u6DFB\u52A0\u5224\u65AD\u9898"))},Xe=function(Ft){var Vt,er=function(){ir(Ft),Nr(),$e({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};Et!=null&&(Vt=Et.sideBar)!==null&&Vt!==void 0&&Vt.confirmLeave?P.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){er()}}):er()},gt=function(Ft){var Vt=function(){var er=Object(y.a)(s.a.mark(function wr(){var tr;return s.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Object(f.w)(Object(C.a)(Object(C.a)({},_e.params),{},{questionId:Ft}));case 2:tr=nn.sent,tr.challenge_id&&(Z(),L.b.success("\u5220\u9664\u6210\u529F"));case 4:case"end":return nn.stop()}},wr)}));return function(){return er.apply(this,arguments)}}();P.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u5220\u9664\u9898\u76EE!",centered:!0,onOk:Vt})},It=function(){var Rr=Object(y.a)(s.a.mark(function Ft(Vt){var er;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,Object(f.Ib)(Object(C.a)(Object(C.a)({},_e.params),{},{questionId:Vt}));case 2:er=tr.sent,er.status===0&&Z();case 4:case"end":return tr.stop()}},Ft)}));return function(Vt){return Rr.apply(this,arguments)}}(),qe=function(){var Rr=Object(y.a)(s.a.mark(function Ft(Vt){var er;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,Object(f.C)(Object(C.a)(Object(C.a)({},_e.params),{},{questionId:Vt}));case 2:er=tr.sent,er.status===0&&Z();case 4:case"end":return tr.stop()}},Ft)}));return function(Vt){return Rr.apply(this,arguments)}}(),jt=function(){var Rr=Object(y.a)(s.a.mark(function Ft(Vt){var er;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,Object(f.Q)(Object(C.a)(Object(C.a)({},_e.params),{},{questionId:Vt}));case 2:er=tr.sent,Lr(Object(C.a)(Object(C.a)({},er),{},{choose_id:Vt})),it((er==null?void 0:er.question_name)==="\u5355\u9009\u9898/\u591A\u9009\u9898"?1:(er==null?void 0:er.question_name)==="\u586B\u7A7A\u9898"?2:3);case 5:case"end":return tr.stop()}},Ft)}));return function(Vt){return Rr.apply(this,arguments)}}(),Cr=function(){Rn()},Nr=function(){rt(ai+1),I()},Rn=function(){var Ft,Vt=function(){m.d.push("/shixuns/".concat(bi,"/challenges")),$e({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};Et!=null&&(Ft=Et.sideBar)!==null&&Ft!==void 0&&Ft.confirmLeave?P.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){Vt()}}):Vt()},bn=function(){return mt.map(function(Ft,Vt){var er=Ft.challenge_choose_id,wr=Ft.subject,tr=Ft.choose_contents,si=Ft.standard_answer,nn=Ft.answer,Oi=Ft.score,Fi=Ft.category,Pn=Ft.question_name,qr=Ft.standard_answers;return c.a.createElement("div",{key:er,className:Ke.a.list},c.a.createElement("div",{className:Ke.a.top},c.a.createElement("div",{className:Ke.a.left},c.a.createElement("div",{className:Ke.a.title},c.a.createElement("div",{className:Ke.a.fs},Vt+1,". "),c.a.createElement(E.a,{value:wr})),Pn==="\u5355\u9009\u9898/\u591A\u9009\u9898"&&(tr==null?void 0:tr.map(function(un,Ei){return c.a.createElement("ul",{key:Ei,className:un.right_key?Ke.a.qsActive:Ke.a.qs},c.a.createElement("li",null,j[un.position]),c.a.createElement("li",null,c.a.createElement(E.a,{value:un.option_name})))})),Pn==="\u5224\u65AD\u9898"&&c.a.createElement(K.a.Group,{className:"mb10",buttonStyle:"solid",value:si},c.a.createElement(K.a,{value:"\u6B63\u786E",className:"".concat(Ke.a.radio," mr40")},"\u6B63\u786E"),c.a.createElement(K.a,{value:"\u9519\u8BEF",className:Ke.a.radio},"\u9519\u8BEF"))),c.a.createElement("div",{className:Ke.a.right},c.a.createElement("i",{onClick:function(){return jt(er)},className:"iconfont icon-xiaoxiugai"}),c.a.createElement("i",{onClick:function(){return gt(er)},className:"iconfont icon-shanchu23"}),Vt!==mt.length-1&&c.a.createElement("i",{onClick:function(){return qe(er)},className:"iconfont icon-xiayi2"}),Vt!==0&&c.a.createElement("i",{onClick:function(){return It(er)},className:"iconfont icon-shangyi2"}))),c.a.createElement("div",{className:Ke.a.bt},"\u9898\u578B\uFF1A",Pn,"\xA0\xA0\xA0\xA0\u5956\u52B1\u91D1\u5E01\uFF1A",Oi),c.a.createElement("div",{className:Ke.a.answer},Pn==="\u586B\u7A7A\u9898"?qr==null?void 0:qr.map(function(un,Ei){var hi;return c.a.createElement("p",{key:Ei},"\u586B\u7A7A",Ei+1,"\uFF1A",un==null||((hi=un.text)===null||hi===void 0)?void 0:hi.join("\u3001"))}):c.a.createElement("p",null,"\u6807\u51C6\u7B54\u6848\uFF1A",si),c.a.createElement("p",null,c.a.createElement("div",{className:Ke.a.fs},"\u53C2\u8003\u7B54\u6848\uFF1A"),c.a.createElement(E.a,{value:nn}))))})},mn=function(){it(!1),Lr(null),Z()},qn=function(){it(!1),Lr(null)};return c.a.createElement("section",{className:Ke.a.bg,style:{marginBottom:ln==="1"?67:0}},c.a.createElement(a.a,{activeKey:ln,onChange:Xe,tabBarExtraContent:be()},c.a.createElement(Tt,{tab:"\u672C\u5173\u4EFB\u52A1",key:"1"},c.a.createElement(O.a,{key:ai,form:ne,scrollToFirstError:!0,className:Ke.a.formWrap,layout:"vertical",onValuesChange:p,onFinish:U},c.a.createElement("div",{className:Ke.a.fieldWrap},c.a.createElement(O.a.Item,{initialValue:"",name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},c.a.createElement(X.a,{bordered:!1,maxLength:60,suffix:"".concat(((dt=pe.subject)===null||dt===void 0?void 0:dt.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),c.a.createElement("div",{className:Ke.a.mdWrap},c.a.createElement(O.a.Item,{name:"task_pass",label:"\u4EFB\u52A1\u8981\u6C42:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},c.a.createElement(R.a,{key:_e.params.challengesId||"3",watch:!0,defaultValue:oi.task_pass}))),c.a.createElement(O.a.Item,{noStyle:!0},c.a.createElement(ut.a,{okButtonProps:{htmlType:"submit"},className:"customFixedButton",onCancel:Cr})),Object(Ze.o)()&&c.a.createElement("div",{className:Ke.a.fieldWrap},c.a.createElement(O.a.Item,{initialValue:"",name:"unity_3d_routes",label:"\u5D4C\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0:"},c.a.createElement(X.a,{bordered:!1,maxLength:60,suffix:"".concat(((Qe=pe.unity_3d_routes)===null||Qe===void 0?void 0:Qe.length)||0,"/60"),placeholder:"\u8BF7\u8F93\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0\u5730\u5740"}))))),c.a.createElement(Tt,{tab:"\u9898\u76EE",key:"2"},!!mt.length&&bn(),!mt.length&&c.a.createElement("div",{className:Ke.a.empty},c.a.createElement("img",{src:et.j,width:"258"}),c.a.createElement("span",{className:"c-grey-c"},"\u8BF7\u70B9\u51FB\u53F3\u4E0A\u89D2\u6DFB\u52A0\u9898\u76EE\u6309\u94AE\u8FDB\u884C\u9898\u76EE\u7684\u521B\u5EFA!"," ")))),!!$t&&c.a.createElement(Ct,{is_published:ci,visible:$t,onCancel:qn,onOk:mn,match:_e,editData:yr}),c.a.createElement(vt.a,{loading:Zt}))},St=Fe.default=Object(m.a)(function(lt){var yt=lt.shixunsDetail,dt=lt.newCourse,Qe=lt.globalSetting,Ie=lt.practiceSetting;return{shixunsDetail:yt,newCourse:dt,globalSetting:Qe,practiceSetting:Ie}})(bt)},UqFu:function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return ae});var ae=function(M){var K=document.createElement("textarea");return K.value=M,K.value}},"VrN/":function(Ge,Fe,Q){(function(ae,X){Ge.exports=X()})(this,function(){"use strict";var ae=navigator.userAgent,X=navigator.platform,M=/gecko\/\d/i.test(ae),K=/MSIE \d/.test(ae),D=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ae),P=/Edge\/(\d+)/.exec(ae),H=K||D||P,W=H&&(K?document.documentMode||6:+(P||D)[1]),_=!P&&/WebKit\//.test(ae),L=_&&/Qt\/\d+\.\d+/.test(ae),y=!P&&/Chrome\//.test(ae),C=/Opera\//.test(ae),k=/Apple Computer/.test(navigator.vendor),O=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ae),A=/PhantomJS/.test(ae),x=!P&&/AppleWebKit/.test(ae)&&/Mobile\/\w+/.test(ae),d=/Android/.test(ae),a=x||d||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ae),l=x||/Mac/.test(X),s=/\bCrOS\b/.test(ae),v=/win/i.test(X),c=C&&ae.match(/Version\/(\d*\.\d*)/);c&&(c=Number(c[1])),c&&c>=15&&(C=!1,_=!0);var m=l&&(L||C&&(c==null||c<12.11)),R=M||H&&W>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var f=function(e,t){var n=e.className,r=E(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function g(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function h(e,t){return g(e).appendChild(t)}function o(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var w=0;w<t.length;++w)i.appendChild(t[w]);return i}function S(e,t,n,r){var i=o(e,t,n,r);return i.setAttribute("role","presentation"),i}var b;document.createRange?b=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:b=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function T(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function N(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function z(e,t){var n=e.className;E(t).test(n)||(e.className+=(n?" ":"")+t)}function Y(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!E(n[r]).test(t)&&(t+=" "+n[r]);return t}var te=function(e){e.select()};x?te=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&(te=function(e){try{e.select()}catch(t){}});function G(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function F(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function re(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var w=r||0,B=i||0;;){var V=e.indexOf(" ",w);if(V<0||V>=t)return B+(t-w);B+=V-w,B+=n-B%n,w=V+1}}var le=function(){this.id=null,this.f=null,this.time=0,this.handler=G(this.onTimeout,this)};le.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},le.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function Ee(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Oe=50,Ye={toString:function(){return"CodeMirror.Pass"}},Pe={scroll:!1},Be={origin:"*mouse"},Ue={origin:"+move"};function Ne(e,t,n){for(var r=0,i=0;;){var w=e.indexOf(" ",r);w==-1&&(w=e.length);var B=w-r;if(w==e.length||i+B>=t)return r+Math.min(B,t-i);if(i+=w-r,i+=n-i%n,r=w+1,i>=t)return r}}var Te=[""];function se(e){for(;Te.length<=e;)Te.push(ze(Te)+" ");return Te[e]}function ze(e){return e[e.length-1]}function xt(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ct(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ft(){}function Ct(e,t){var n;return Object.create?n=Object.create(e):(ft.prototype=e,n=new ft),t&&F(t,n),n}var He=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ke(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||He.test(e))}function ut(e,t){return t?t.source.indexOf("\\w")>-1&&Ke(e)?!0:t.test(e):Ke(e)}function vt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ht=/[\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 et(e){return e.charCodeAt(0)>=768&&ht.test(e)}function Ze(e,t,n){for(;(n<0?t>0:t<e.length)&&et(e.charAt(t));)t+=n;return t}function Tt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,w=r<0?Math.ceil(i):Math.floor(i);if(w==t)return e(w)?t:n;e(w)?n=w:t=w+r}}function bt(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,w=0;w<e.length;++w){var B=e[w];(B.from<n&&B.to>t||t==n&&B.to==t)&&(r(Math.max(B.from,t),Math.min(B.to,n),B.level==1?"rtl":"ltr",w),i=!0)}i||r(t,n,"ltr")}var St=null;function lt(e,t,n){var r;St=null;for(var i=0;i<e.length;++i){var w=e[i];if(w.from<t&&w.to>t)return i;w.to==t&&(w.from!=w.to&&n=="before"?r=i:St=i),w.from==t&&(w.from!=w.to&&n!="before"?r=i:St=i)}return r!=null?r:St}var yt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n($){return $<=247?e.charAt($):1424<=$&&$<=1524?"R":1536<=$&&$<=1785?t.charAt($-1536):1774<=$&&$<=2220?"r":8192<=$&&$<=8203?"w":$==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,w=/[LRr]/,B=/[Lb1n]/,V=/[1n]/;function J($,he,ye){this.level=$,this.from=he,this.to=ye}return function($,he){var ye=he=="ltr"?"L":"R";if($.length==0||he=="ltr"&&!r.test($))return!1;for(var ke=$.length,Re=[],Ve=0;Ve<ke;++Ve)Re.push(n($.charCodeAt(Ve)));for(var tt=0,pt=ye;tt<ke;++tt){var wt=Re[tt];wt=="m"?Re[tt]=pt:pt=wt}for(var kt=0,Dt=ye;kt<ke;++kt){var Pt=Re[kt];Pt=="1"&&Dt=="r"?Re[kt]="n":w.test(Pt)&&(Dt=Pt,Pt=="r"&&(Re[kt]="R"))}for(var Yt=1,Gt=Re[0];Yt<ke-1;++Yt){var fr=Re[Yt];fr=="+"&&Gt=="1"&&Re[Yt+1]=="1"?Re[Yt]="1":fr==","&&Gt==Re[Yt+1]&&(Gt=="1"||Gt=="n")&&(Re[Yt]=Gt),Gt=fr}for(var Xr=0;Xr<ke;++Xr){var Ln=Re[Xr];if(Ln==",")Re[Xr]="N";else if(Ln=="%"){var sn=void 0;for(sn=Xr+1;sn<ke&&Re[sn]=="%";++sn);for(var di=Xr&&Re[Xr-1]=="!"||sn<ke&&Re[sn]=="1"?"1":"N",ri=Xr;ri<sn;++ri)Re[ri]=di;Xr=sn-1}}for(var xn=0,ni=ye;xn<ke;++xn){var Bn=Re[xn];ni=="L"&&Bn=="1"?Re[xn]="L":w.test(Bn)&&(ni=Bn)}for(var On=0;On<ke;++On)if(i.test(Re[On])){var Cn=void 0;for(Cn=On+1;Cn<ke&&i.test(Re[Cn]);++Cn);for(var fn=(On?Re[On-1]:ye)=="L",ii=(Cn<ke?Re[Cn]:ye)=="L",Na=fn==ii?fn?"L":"R":ye,oa=On;oa<Cn;++oa)Re[oa]=Na;On=Cn-1}for(var Wn=[],Ui,In=0;In<ke;)if(B.test(Re[In])){var ps=In;for(++In;In<ke&&B.test(Re[In]);++In);Wn.push(new J(0,ps,In))}else{var Qi=In,ga=Wn.length,va=he=="rtl"?1:0;for(++In;In<ke&&Re[In]!="L";++In);for(var Jn=Qi;Jn<In;)if(V.test(Re[Jn])){Qi<Jn&&(Wn.splice(ga,0,new J(1,Qi,Jn)),ga+=va);var Ba=Jn;for(++Jn;Jn<In&&V.test(Re[Jn]);++Jn);Wn.splice(ga,0,new J(2,Ba,Jn)),ga+=va,Qi=Jn}else++Jn;Qi<In&&Wn.splice(ga,0,new J(1,Qi,In))}return he=="ltr"&&(Wn[0].level==1&&(Ui=$.match(/^\s+/))&&(Wn[0].from=Ui[0].length,Wn.unshift(new J(0,0,Ui[0].length))),ze(Wn).level==1&&(Ui=$.match(/\s+$/))&&(ze(Wn).to-=Ui[0].length,Wn.push(new J(0,ke-Ui[0].length,ke)))),he=="rtl"?Wn.reverse():Wn}}();function dt(e,t){var n=e.order;return n==null&&(n=e.order=yt(e.text,t)),n}var Qe=[],Ie=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Qe).concat(n)}};function Et(e,t){return e._handlers&&e._handlers[t]||Qe}function $e(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var w=Ee(i,n);w>-1&&(r[t]=i.slice(0,w).concat(i.slice(w+1)))}}}function _e(e,t){var n=Et(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Je(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),_e(e,n||t.type,e,t),de(t)||t.codemirrorIgnore}function Se(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)Ee(n,t[r])==-1&&n.push(t[r])}function me(e,t){return Et(e,t).length>0}function ve(e){e.prototype.on=function(t,n){Ie(this,t,n)},e.prototype.off=function(t,n){$e(this,t,n)}}function ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function pe(e){ne(e),ie(e)}function xe(e){return e.target||e.srcElement}function Le(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),l&&e.ctrlKey&&t==1&&(t=3),t}var je=function(){if(H&&W<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),mt;function Mt(e){if(mt==null){var t=o("span","\u200B");h(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(mt=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&W<8))}var n=mt?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Rt;function Kt(e){if(Rt!=null)return Rt;var t=h(e,document.createTextNode("A\u062EA")),n=b(t,0,1).getBoundingClientRect(),r=b(t,1,2).getBoundingClientRect();return g(e),!n||n.left==n.right?!1:Rt=r.right-n.right<3}var _t=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
|
`,t);i==-1&&(i=e.length);var w=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),B=w.indexOf("\r");B!=-1?(n.push(w.slice(0,B)),t+=B+1):(n.push(w),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ot=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Jt=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ut=null;function Zt(e){if(Ut!=null)return Ut;var t=h(e,o("span","x")),n=t.getBoundingClientRect(),r=b(t,0,1).getBoundingClientRect();return Ut=Math.abs(n.left-r.left)>1}var nr={},Ot={};function xr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),nr[e]=t}function $t(e,t){Ot[e]=t}function it(e){if(typeof e=="string"&&Ot.hasOwnProperty(e))e=Ot[e];else if(e&&typeof e.name=="string"&&Ot.hasOwnProperty(e.name)){var t=Ot[e.name];typeof t=="string"&&(t={name:t}),e=Ct(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return it("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return it("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function lr(e,t){t=it(t);var n=nr[t.name];if(!n)return lr(e,"text/plain");var r=n(e,t);if(nt.hasOwnProperty(t.name)){var i=nt[t.name];for(var w in i){if(!i.hasOwnProperty(w))continue;r.hasOwnProperty(w)&&(r["_"+w]=r[w]),r[w]=i[w]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var B in t.modeProps)r[B]=t.modeProps[B];return r}var nt={};function yr(e,t){var n=nt.hasOwnProperty(e)?nt[e]:nt[e]={};F(t,n)}function Lr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function jr(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function pn(e,t,n){return e.startState?e.startState(t,n):!0}var br=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};br.prototype.eol=function(){return this.pos>=this.string.length},br.prototype.sol=function(){return this.pos==this.lineStart},br.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},br.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},br.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},br.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},br.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},br.prototype.skipToEnd=function(){this.pos=this.string.length},br.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},br.prototype.backUp=function(e){this.pos-=e},br.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=re(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?re(this.string,this.lineStart,this.tabSize):0)},br.prototype.indentation=function(){return re(this.string,null,this.tabSize)-(this.lineStart?re(this.string,this.lineStart,this.tabSize):0)},br.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(B){return n?B.toLowerCase():B},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var w=this.string.slice(this.pos).match(e);return w&&w.index>0?null:(w&&t!==!1&&(this.pos+=w[0].length),w)}},br.prototype.current=function(){return this.string.slice(this.start,this.pos)},br.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},br.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},br.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Lt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],w=i.chunkSize();if(t<w){n=i;break}t-=w}return n.lines[t]}function Hn(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(w){var B=w.text;i==n.line&&(B=B.slice(0,n.ch)),i==t.line&&(B=B.slice(t.ch)),r.push(B),++i}),r}function Zn(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function ln(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ir(e){if(e.parent==null)return null;for(var t=e.parent,n=Ee(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;!(r.children[i]==t);++i)n+=r.children[i].chunkSize();return n+t.first}function Un(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],w=i.height;if(t<w){e=i;continue e}t-=w,n+=i.chunkSize()}return n}while(!e.lines);for(var B=0;B<e.lines.length;++B){var V=e.lines[B],J=V.height;if(t<J)break;t-=J}return n+B}function Kn(e,t){return t>=e.first&&t<e.first+e.size}function ai(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function rt(e,t,n){if(n===void 0&&(n=null),!(this instanceof rt))return new rt(e,t,n);this.line=e,this.ch=t,this.sticky=n}function Wt(e,t){return e.line-t.line||e.ch-t.ch}function zn(e,t){return e.sticky==t.sticky&&Wt(e,t)==0}function ci(e){return rt(e.line,e.ch)}function bi(e,t){return Wt(e,t)<0?t:e}function oi(e,t){return Wt(e,t)<0?e:t}function j(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function u(e,t){if(t.line<e.first)return rt(e.first,0);var n=e.first+e.size-1;return t.line>n?rt(n,Lt(e,n).text.length):p(t,Lt(e,t.line).text.length)}function p(e,t){var n=e.ch;return n==null||n>t?rt(e.line,t):n<0?rt(e.line,0):e}function I(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=u(e,t[r]);return n}var Z=function(e,t){this.state=e,this.lookAhead=t},U=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};U.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},U.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}},U.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},U.fromSaved=function(e,t,n){return t instanceof Z?new U(e,Lr(e.mode,t.state),n,t.lookAhead):new U(e,Lr(e.mode,t),n)},U.prototype.save=function(e){var t=e!==!1?Lr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Z(t,this.maxLookAhead):t};function be(e,t,n,r){var i=[e.state.modeGen],w={};bn(e,t.text,e.doc.mode,n,function($,he){return i.push($,he)},w,r);for(var B=n.state,V=function($){n.baseTokens=i;var he=e.state.overlays[$],ye=1,ke=0;n.state=!0,bn(e,t.text,he.mode,n,function(Re,Ve){for(var tt=ye;ke<Re;){var pt=i[ye];pt>Re&&i.splice(ye,1,Re,i[ye+1],pt),ye+=2,ke=Math.min(Re,pt)}if(!Ve)return;if(he.opaque)i.splice(tt,ye-tt,Re,"overlay "+Ve),ye=tt+2;else for(;tt<ye;tt+=2){var wt=i[tt+1];i[tt+1]=(wt?wt+" ":"")+"overlay "+Ve}},w),n.state=B,n.baseTokens=null,n.baseTokenPos=1},J=0;J<e.state.overlays.length;++J)V(J);return{styles:i,classes:w.bgClass||w.textClass?w:null}}function Xe(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=gt(e,ir(t)),i=t.text.length>e.options.maxHighlightLength&&Lr(e.doc.mode,r.state),w=be(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=w.styles,w.classes?t.styleClasses=w.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function gt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new U(r,!0,t);var w=mn(e,t,n),B=w>r.first&&Lt(r,w-1).stateAfter,V=B?U.fromSaved(r,B,w):new U(r,pn(r.mode),w);return r.iter(w,t,function(J){It(e,J.text,V);var $=V.line;J.stateAfter=$==t-1||$%5==0||$>=i.viewFrom&&$<i.viewTo?V.save():null,V.nextLine()}),n&&(r.modeFrontier=V.line),V}function It(e,t,n,r){var i=e.doc.mode,w=new br(t,e.options.tabSize,n);for(w.start=w.pos=r||0,t==""&&qe(i,n.state);!w.eol();)jt(i,w,n.state),w.start=w.pos}function qe(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=jr(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function jt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=jr(e,n).mode);var w=e.token(t,n);if(t.pos>t.start)return w}throw new Error("Mode "+e.name+" failed to advance stream.")}var Cr=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Nr(e,t,n,r){var i=e.doc,w=i.mode,B;t=u(i,t);var V=Lt(i,t.line),J=gt(e,t.line,n),$=new br(V.text,e.options.tabSize,J),he;for(r&&(he=[]);(r||$.pos<t.ch)&&!$.eol();)$.start=$.pos,B=jt(w,$,J.state),r&&he.push(new Cr($,B,Lr(i.mode,J.state)));return r?he:new Cr($,B,J.state)}function Rn(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function bn(e,t,n,r,i,w,B){var V=n.flattenSpans;V==null&&(V=e.options.flattenSpans);var J=0,$=null,he=new br(t,e.options.tabSize,r),ye,ke=e.options.addModeClass&&[null];for(t==""&&Rn(qe(n,r.state),w);!he.eol();){if(he.pos>e.options.maxHighlightLength?(V=!1,B&&It(e,t,r,he.pos),he.pos=t.length,ye=null):ye=Rn(jt(n,he,r.state,ke),w),ke){var Re=ke[0].name;Re&&(ye="m-"+(ye?Re+" "+ye:Re))}if(!V||$!=ye){for(;J<he.start;)J=Math.min(he.start,J+5e3),i(J,$);$=ye}he.start=he.pos}for(;J<he.pos;){var Ve=Math.min(he.pos,J+5e3);i(Ve,$),J=Ve}}function mn(e,t,n){for(var r,i,w=e.doc,B=n?-1:t-(e.doc.mode.innerMode?1e3:100),V=t;V>B;--V){if(V<=w.first)return w.first;var J=Lt(w,V-1),$=J.stateAfter;if($&&(!n||V+($ instanceof Z?$.lookAhead:0)<=w.modeFrontier))return V;var he=re(J.text,null,e.options.tabSize);(i==null||r>he)&&(i=V-1,r=he)}return i}function qn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var n=e.first,r=t-1;r>n;r--){var i=Lt(e,r).stateAfter;if(i&&(!(i instanceof Z)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}var Rr=!1,Ft=!1;function Vt(){Rr=!0}function er(){Ft=!0}function wr(e,t,n){this.marker=e,this.from=t,this.to=n}function tr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function si(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function nn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Oi(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var w=e[i],B=w.marker,V=w.from==null||(B.inclusiveLeft?w.from<=t:w.from<t);if(V||w.from==t&&B.type=="bookmark"&&(!n||!w.marker.insertLeft)){var J=w.to==null||(B.inclusiveRight?w.to>=t:w.to>t);(r||(r=[])).push(new wr(B,w.from,J?null:w.to))}}return r}function Fi(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var w=e[i],B=w.marker,V=w.to==null||(B.inclusiveRight?w.to>=t:w.to>t);if(V||w.from==t&&B.type=="bookmark"&&(!n||w.marker.insertLeft)){var J=w.from==null||(B.inclusiveLeft?w.from<=t:w.from<t);(r||(r=[])).push(new wr(B,J?null:w.from-t,w.to==null?null:w.to-t))}}return r}function Pn(e,t){if(t.full)return null;var n=Kn(e,t.from.line)&&Lt(e,t.from.line).markedSpans,r=Kn(e,t.to.line)&&Lt(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,w=t.to.ch,B=Wt(t.from,t.to)==0,V=Oi(n,i,B),J=Fi(r,w,B),$=t.text.length==1,he=ze(t.text).length+($?i:0);if(V)for(var ye=0;ye<V.length;++ye){var ke=V[ye];if(ke.to==null){var Re=tr(J,ke.marker);Re?$&&(ke.to=Re.to==null?null:Re.to+he):ke.to=i}}if(J)for(var Ve=0;Ve<J.length;++Ve){var tt=J[Ve];if(tt.to!=null&&(tt.to+=he),tt.from==null){var pt=tr(V,tt.marker);pt||(tt.from=he,$&&(V||(V=[])).push(tt))}else tt.from+=he,$&&(V||(V=[])).push(tt)}V&&(V=qr(V)),J&&J!=V&&(J=qr(J));var wt=[V];if(!$){var kt=t.text.length-2,Dt;if(kt>0&&V)for(var Pt=0;Pt<V.length;++Pt)V[Pt].to==null&&(Dt||(Dt=[])).push(new wr(V[Pt].marker,null,null));for(var Yt=0;Yt<kt;++Yt)wt.push(Dt);wt.push(J)}return wt}function qr(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function un(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(Re){if(Re.markedSpans)for(var Ve=0;Ve<Re.markedSpans.length;++Ve){var tt=Re.markedSpans[Ve].marker;tt.readOnly&&(!r||Ee(r,tt)==-1)&&(r||(r=[])).push(tt)}}),!r)return null;for(var i=[{from:t,to:n}],w=0;w<r.length;++w)for(var B=r[w],V=B.find(0),J=0;J<i.length;++J){var $=i[J];if(Wt($.to,V.from)<0||Wt($.from,V.to)>0)continue;var he=[J,1],ye=Wt($.from,V.from),ke=Wt($.to,V.to);(ye<0||!B.inclusiveLeft&&!ye)&&he.push({from:$.from,to:V.from}),(ke>0||!B.inclusiveRight&&!ke)&&he.push({from:V.to,to:$.to}),i.splice.apply(i,he),J+=he.length-3}return i}function Ei(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function hi(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function $r(e){return e.inclusiveLeft?-1:0}function Mr(e){return e.inclusiveRight?1:0}function an(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),w=Wt(r.from,i.from)||$r(e)-$r(t);if(w)return-w;var B=Wt(r.to,i.to)||Mr(e)-Mr(t);return B||t.id-e.id}function cr(e,t){var n=Ft&&e.markedSpans,r;if(n)for(var i=void 0,w=0;w<n.length;++w)i=n[w],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||an(r,i.marker)<0)&&(r=i.marker);return r}function on(e){return cr(e,!0)}function Br(e){return cr(e,!1)}function fi(e,t){var n=Ft&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var w=n[i];w.marker.collapsed&&(w.from==null||w.from<t)&&(w.to==null||w.to>t)&&(!r||an(r,w.marker)<0)&&(r=w.marker)}return r}function En(e,t,n,r,i){var w=Lt(e,t),B=Ft&&w.markedSpans;if(B)for(var V=0;V<B.length;++V){var J=B[V];if(!J.marker.collapsed)continue;var $=J.marker.find(0),he=Wt($.from,n)||$r(J.marker)-$r(i),ye=Wt($.to,r)||Mr(J.marker)-Mr(i);if(he>=0&&ye<=0||he<=0&&ye>=0)continue;if(he<=0&&(J.marker.inclusiveRight&&i.inclusiveLeft?Wt($.to,n)>=0:Wt($.to,n)>0)||he>=0&&(J.marker.inclusiveRight&&i.inclusiveLeft?Wt($.from,r)<=0:Wt($.from,r)<0))return!0}}function Mn(e){for(var t;t=on(e);)e=t.find(-1,!0).line;return e}function Xi(e){for(var t;t=Br(e);)e=t.find(1,!0).line;return e}function Ri(e){for(var t,n;t=Br(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Mi(e,t){var n=Lt(e,t),r=Mn(n);return n==r?t:ir(r)}function $n(e,t){if(t>e.lastLine())return t;var n=Lt(e,t),r;if(!ei(e,n))return t;for(;r=Br(n);)n=r.find(1,!0).line;return ir(n)+1}function ei(e,t){var n=Ft&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i){if(r=n[i],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&sa(e,t,r))return!0}}function sa(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return sa(e,r.line,tr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,w=0;w<t.markedSpans.length;++w)if(i=t.markedSpans[w],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&sa(e,t,i))return!0}function li(e){e=Mn(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var w=n.parent;w;n=w,w=n.parent)for(var B=0;B<w.children.length;++B){var V=w.children[B];if(V==n)break;t+=V.height}return t}function la(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=on(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Br(r);){var w=n.find(0,!0);t-=r.text.length-w.from.ch,r=w.to.line,t+=r.text.length-w.to.ch}return t}function ua(e){var t=e.display,n=e.doc;t.maxLine=Lt(n,n.first),t.maxLineLength=la(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=la(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var ji=function(e,t,n){this.text=e,hi(this,t),this.height=n?n(this):1};ji.prototype.lineNo=function(){return ir(this)},ve(ji);function Ua(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ei(e),hi(e,n);var i=r?r(e):1;i!=e.height&&ln(e,i)}function Bt(e){e.parent=null,Ei(e)}var qt={},Ht={};function hr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ht:qt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Dr(e,t){var n=S("span",null,null,_?"padding-right: .1px":null),r={pre:S("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var w=i?t.rest[i-1]:t.line,B=void 0;r.pos=0,r.addToken=Sr,Kt(e.display.measure)&&(B=dt(w,e.doc.direction))&&(r.addToken=Gn(r.addToken,B)),r.map=[];var V=t!=e.display.externalMeasured&&ir(w);Ci(w,r,Xe(e,w,V)),w.styleClasses&&(w.styleClasses.bgClass&&(r.bgClass=Y(w.styleClasses.bgClass,r.bgClass||"")),w.styleClasses.textClass&&(r.textClass=Y(w.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Mt(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_){var J=r.content.lastChild;(/\bcm-tab\b/.test(J.className)||J.querySelector&&J.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return _e(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Y(r.pre.className,r.textClass||"")),r}function Ur(e){var t=o("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Sr(e,t,n,r,i,w,B){if(!t)return;var V=e.splitSpaces?dn(t,e.trailingSpace):t,J=e.cm.state.specialChars,$=!1,he;if(!J.test(t))e.col+=t.length,he=document.createTextNode(V),e.map.push(e.pos,e.pos+t.length,he),H&&W<9&&($=!0),e.pos+=t.length;else{he=document.createDocumentFragment();for(var ye=0;;){J.lastIndex=ye;var ke=J.exec(t),Re=ke?ke.index-ye:t.length-ye;if(Re){var Ve=document.createTextNode(V.slice(ye,ye+Re));H&&W<9?he.appendChild(o("span",[Ve])):he.appendChild(Ve),e.map.push(e.pos,e.pos+Re,Ve),e.col+=Re,e.pos+=Re}if(!ke)break;ye+=Re+1;var tt=void 0;if(ke[0]==" "){var pt=e.cm.options.tabSize,wt=pt-e.col%pt;tt=he.appendChild(o("span",se(wt),"cm-tab")),tt.setAttribute("role","presentation"),tt.setAttribute("cm-text"," "),e.col+=wt}else ke[0]=="\r"||ke[0]==`
|
|
`?(tt=he.appendChild(o("span",ke[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),tt.setAttribute("cm-text",ke[0]),e.col+=1):(tt=e.cm.options.specialCharPlaceholder(ke[0]),tt.setAttribute("cm-text",ke[0]),H&&W<9?he.appendChild(o("span",[tt])):he.appendChild(tt),e.col+=1);e.map.push(e.pos,e.pos+1,tt),e.pos++}}if(e.trailingSpace=V.charCodeAt(t.length-1)==32,n||r||i||$||w||B){var kt=n||"";r&&(kt+=r),i&&(kt+=i);var Dt=o("span",[he],kt,w);if(B)for(var Pt in B)B.hasOwnProperty(Pt)&&Pt!="style"&&Pt!="class"&&Dt.setAttribute(Pt,B[Pt]);return e.content.appendChild(Dt)}e.content.appendChild(he)}function dn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var w=e.charAt(i);w==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(w="\xA0"),r+=w,n=w==" "}return r}function Gn(e,t){return function(n,r,i,w,B,V,J){i=i?i+" cm-force-border":"cm-force-border";for(var $=n.pos,he=$+r.length;;){for(var ye=void 0,ke=0;ke<t.length&&!(ye=t[ke],ye.to>$&&ye.from<=$);ke++);if(ye.to>=he)return e(n,r,i,w,B,V,J);e(n,r.slice(0,ye.to-$),i,w,null,V,J),w=null,r=r.slice(ye.to-$),$=ye.to}}}function pr(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ci(e,t,n){var r=e.markedSpans,i=e.text,w=0;if(!r){for(var B=1;B<n.length;B+=2)t.addToken(t,i.slice(w,w=n[B]),hr(n[B+1],t.cm.options));return}for(var V=i.length,J=0,$=1,he="",ye,ke,Re=0,Ve,tt,pt,wt,kt;;){if(Re==J){Ve=tt=pt=ke="",kt=null,wt=null,Re=Infinity;for(var Dt=[],Pt=void 0,Yt=0;Yt<r.length;++Yt){var Gt=r[Yt],fr=Gt.marker;if(fr.type=="bookmark"&&Gt.from==J&&fr.widgetNode)Dt.push(fr);else if(Gt.from<=J&&(Gt.to==null||Gt.to>J||fr.collapsed&&Gt.to==J&&Gt.from==J)){if(Gt.to!=null&&Gt.to!=J&&Re>Gt.to&&(Re=Gt.to,tt=""),fr.className&&(Ve+=" "+fr.className),fr.css&&(ke=(ke?ke+";":"")+fr.css),fr.startStyle&&Gt.from==J&&(pt+=" "+fr.startStyle),fr.endStyle&&Gt.to==Re&&(Pt||(Pt=[])).push(fr.endStyle,Gt.to),fr.title&&((kt||(kt={})).title=fr.title),fr.attributes)for(var Xr in fr.attributes)(kt||(kt={}))[Xr]=fr.attributes[Xr];fr.collapsed&&(!wt||an(wt.marker,fr)<0)&&(wt=Gt)}else Gt.from>J&&Re>Gt.from&&(Re=Gt.from)}if(Pt)for(var Ln=0;Ln<Pt.length;Ln+=2)Pt[Ln+1]==Re&&(tt+=" "+Pt[Ln]);if(!wt||wt.from==J)for(var sn=0;sn<Dt.length;++sn)pr(t,0,Dt[sn]);if(wt&&(wt.from||0)==J){if(pr(t,(wt.to==null?V+1:wt.to)-J,wt.marker,wt.from==null),wt.to==null)return;wt.to==J&&(wt=!1)}}if(J>=V)break;for(var di=Math.min(V,Re);;){if(he){var ri=J+he.length;if(!wt){var xn=ri>di?he.slice(0,di-J):he;t.addToken(t,xn,ye?ye+Ve:Ve,pt,J+xn.length==Re?tt:"",ke,kt)}if(ri>=di){he=he.slice(di-J),J=di;break}J=ri,pt=""}he=i.slice(w,w=n[$++]),ye=hr(n[$++],t.cm.options)}}}function Ir(e,t,n){this.line=t,this.rest=Ri(t),this.size=this.rest?ir(ze(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ei(e,t)}function _n(e,t,n){for(var r=[],i,w=t;w<n;w=i){var B=new Ir(e.doc,Lt(e.doc,w),w);i=w+B.size,r.push(B)}return r}var kn=null;function ui(e){kn?kn.ops.push(e):e.ownsGroup=kn={ops:[e],delayedCallbacks:[]}}function Fa(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Ko(e,t){var n=e.ownsGroup;if(!n)return;try{Fa(n)}finally{kn=null,t(n)}}var Yi=null;function cn(e,t){var n=Et(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;kn?i=kn.delayedCallbacks:Yi?i=Yi:(i=Yi=[],setTimeout(go,0));for(var w=function(V){i.push(function(){return n[V].apply(null,r)})},B=0;B<n.length;++B)w(B)}function go(){var e=Yi;Yi=null;for(var t=0;t<e.length;++t)e[t]()}function vo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var w=t.changes[i];w=="text"?yo(e,t):w=="gutter"?Ha(e,t,n,r):w=="class"?Wa(e,t):w=="widget"&&Go(e,t,r)}t.changes=null}function da(e){return e.node==e.text&&(e.node=o("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),H&&W<8&&(e.node.style.zIndex=2)),e.node}function zo(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=da(t);t.background=r.insertBefore(o("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function ja(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Dr(e,t)}function yo(e,t){var n=t.text.className,r=ja(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Wa(e,t)):n&&(t.text.className=n)}function Wa(e,t){zo(e,t),t.line.wrapClass?da(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Ha(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=da(t);t.gutterBackground=o("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var w=t.line.gutterMarkers;if(e.options.lineNumbers||w){var B=da(t),V=t.gutter=o("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(V),B.insertBefore(V,t.text),t.line.gutterClass&&(V.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!w||!w["CodeMirror-linenumbers"])&&(t.lineNumber=V.appendChild(o("div",ai(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),w)for(var J=0;J<e.display.gutterSpecs.length;++J){var $=e.display.gutterSpecs[J].className,he=w.hasOwnProperty($)&&w[$];he&&V.appendChild(o("div",[he],"CodeMirror-gutter-elt","left: "+r.gutterLeft[$]+"px; width: "+r.gutterWidth[$]+"px"))}}}function Go(e,t,n){t.alignable&&(t.alignable=null);for(var r=E("CodeMirror-linewidget"),i=t.node.firstChild,w=void 0;i;i=w)w=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Ka(e,t,n)}function bo(e,t,n,r){var i=ja(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Wa(e,t),Ha(e,t,n,r),Ka(e,t,r),t.node}function Ka(e,t,n){if(Eo(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Eo(e,t.rest[r],t,n,!1)}function Eo(e,t,n,r,i){if(!t.widgets)return;for(var w=da(n),B=0,V=t.widgets;B<V.length;++B){var J=V[B],$=o("div",[J.node],"CodeMirror-linewidget"+(J.className?" "+J.className:""));J.handleMouseEvents||$.setAttribute("cm-ignore-events","true"),Vo(J,$,n,r),e.display.input.setUneditable($),i&&J.above?w.insertBefore($,n.gutter||n.text):w.appendChild($),cn(J,"redraw")}}function Vo(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Ji(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!T(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),h(t.display.measure,o("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Si(e,t){for(var n=xe(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function za(e){return e.lineSpace.offsetTop}function ue(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ce(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=h(e.measure,o("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function we(e){return Oe-e.display.nativeBarWidth}function ce(e){return e.display.scroller.clientWidth-we(e)-e.display.barWidth}function q(e){return e.display.scroller.clientHeight-we(e)-e.display.barHeight}function oe(e,t,n){var r=e.options.lineWrapping,i=r&&ce(e);if(!t.measure.heights||r&&t.measure.width!=i){var w=t.measure.heights=[];if(r){t.measure.width=i;for(var B=t.text.firstChild.getClientRects(),V=0;V<B.length-1;V++){var J=B[V],$=B[V+1];Math.abs(J.bottom-$.bottom)>2&&w.push((J.bottom+$.top)/2-n.top)}}w.push(n.bottom-n.top)}}function ee(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(ir(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function fe(e,t){t=Mn(t);var n=ir(t),r=e.display.externalMeasured=new Ir(e.doc,t,n);r.lineN=n;var i=r.built=Dr(e,r);return r.text=i.pre,h(e.display.lineMeasure,i.pre),r}function ge(e,t,n,r){return Me(e,Ae(e,t),n,r)}function De(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Qr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Ae(e,t){var n=ir(t),r=De(e,n);r&&!r.text?r=null:r&&r.changes&&(vo(e,r,n,en(e)),e.curOp.forceUpdate=!0),r||(r=fe(e,t));var i=ee(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Me(e,t,n,r,i){t.before&&(n=-1);var w=n+(r||""),B;return t.cache.hasOwnProperty(w)?B=t.cache[w]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(oe(e,t.view,t.rect),t.hasHeights=!0),B=At(e,t,n,r),B.bogus||(t.cache[w]=B)),{left:B.left,right:B.right,top:i?B.rtop:B.top,bottom:i?B.rbottom:B.bottom}}var We={left:0,right:0,top:0,bottom:0};function st(e,t,n){for(var r,i,w,B,V,J,$=0;$<e.length;$+=3)if(V=e[$],J=e[$+1],t<V?(i=0,w=1,B="left"):t<J?(i=t-V,w=i+1):($==e.length-3||t==J&&e[$+3]>t)&&(w=J-V,i=w-1,t>=J&&(B="right")),i!=null){if(r=e[$+2],V==J&&n==(r.insertLeft?"left":"right")&&(B=n),n=="left"&&i==0)for(;$&&e[$-2]==e[$-3]&&e[$-1].insertLeft;)r=e[($-=3)+2],B="left";if(n=="right"&&i==J-V)for(;$<e.length-3&&e[$+3]==e[$+4]&&!e[$+5].insertLeft;)r=e[($+=3)+2],B="right";break}return{node:r,start:i,end:w,collapse:B,coverStart:V,coverEnd:J}}function at(e,t){var n=We;if(t=="left")for(var r=0;r<e.length&&!((n=e[r]).left!=n.right);r++);else for(var i=e.length-1;i>=0&&!((n=e[i]).left!=n.right);i--);return n}function At(e,t,n,r){var i=st(t.map,n,r),w=i.node,B=i.start,V=i.end,J=i.collapse,$;if(w.nodeType==3){for(var he=0;he<4;he++){for(;B&&et(t.line.text.charAt(i.coverStart+B));)--B;for(;i.coverStart+V<i.coverEnd&&et(t.line.text.charAt(i.coverStart+V));)++V;if(H&&W<9&&B==0&&V==i.coverEnd-i.coverStart?$=w.parentNode.getBoundingClientRect():$=at(b(w,B,V).getClientRects(),r),$.left||$.right||B==0)break;V=B,B=B-1,J="right"}H&&W<11&&($=Xt(e.display.measure,$))}else{B>0&&(J=r="right");var ye;e.options.lineWrapping&&(ye=w.getClientRects()).length>1?$=ye[r=="right"?ye.length-1:0]:$=w.getBoundingClientRect()}if(H&&W<9&&!B&&(!$||!$.left&&!$.right)){var ke=w.parentNode.getClientRects()[0];ke?$={left:ke.left,right:ke.left+Sn(e.display),top:ke.top,bottom:ke.bottom}:$=We}for(var Re=$.top-t.rect.top,Ve=$.bottom-t.rect.top,tt=(Re+Ve)/2,pt=t.view.measure.heights,wt=0;wt<pt.length-1&&!(tt<pt[wt]);wt++);var kt=wt?pt[wt-1]:0,Dt=pt[wt],Pt={left:(J=="right"?$.right:$.left)-t.rect.left,right:(J=="left"?$.left:$.right)-t.rect.left,top:kt,bottom:Dt};return!$.left&&!$.right&&(Pt.bogus=!0),e.options.singleCursorHeightPerLine||(Pt.rtop=Re,Pt.rbottom=Ve),Pt}function Xt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Zt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function ur(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function rr(e){e.display.externalMeasure=null,g(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ur(e.display.view[t])}function ar(e){rr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function dr(){return y&&d?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function sr(){return y&&d?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function or(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Ji(e.widgets[n]));return t}function Ar(e,t,n,r,i){if(!i){var w=or(t);n.top+=w,n.bottom+=w}if(r=="line")return n;r||(r="local");var B=li(t);if(r=="local"?B+=za(e.display):B-=e.display.viewOffset,r=="page"||r=="window"){var V=e.display.lineSpace.getBoundingClientRect();B+=V.top+(r=="window"?0:sr());var J=V.left+(r=="window"?0:dr());n.left+=J,n.right+=J}return n.top+=B,n.bottom+=B,n}function mr(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=dr(),i-=sr();else if(n=="local"||!n){var w=e.display.sizer.getBoundingClientRect();r+=w.left,i+=w.top}var B=e.display.lineSpace.getBoundingClientRect();return{left:r-B.left,top:i-B.top}}function Yr(e,t,n,r,i){return r||(r=Lt(e.doc,t.line)),Ar(e,r,ge(e,r,t.ch,i),n)}function gr(e,t,n,r,i,w){r=r||Lt(e.doc,t.line),i||(i=Ae(e,r));function B(Ve,tt){var pt=Me(e,i,Ve,tt?"right":"left",w);return tt?pt.left=pt.right:pt.right=pt.left,Ar(e,r,pt,n)}var V=dt(r,e.doc.direction),J=t.ch,$=t.sticky;if(J>=r.text.length?(J=r.text.length,$="before"):J<=0&&(J=0,$="after"),!V)return B($=="before"?J-1:J,$=="before");function he(Ve,tt,pt){var wt=V[tt],kt=wt.level==1;return B(pt?Ve-1:Ve,kt!=pt)}var ye=lt(V,J,$),ke=St,Re=he(J,ye,$=="before");return ke!=null&&(Re.other=he(J,ke,$!="before")),Re}function Qt(e,t){var n=0;t=u(e.doc,t),e.options.lineWrapping||(n=Sn(e.display)*t.ch);var r=Lt(e.doc,t.line),i=li(r)+za(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function zt(e,t,n,r,i){var w=rt(e,t,n);return w.xRel=i,r&&(w.outside=r),w}function vr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return zt(r.first,0,null,-1,-1);var i=Un(r,n),w=r.first+r.size-1;if(i>w)return zt(r.first+r.size-1,Lt(r,w).text.length,null,1,1);t<0&&(t=0);for(var B=Lt(r,i);;){var V=Jr(e,B,i,t,n),J=fi(B,V.ch+(V.xRel>0||V.outside>0?1:0));if(!J)return V;var $=J.find(1);if($.line==i)return $;B=Lt(r,i=$.line)}}function Tr(e,t,n,r){r-=or(t);var i=t.text.length,w=Tt(function(B){return Me(e,n,B-1).bottom<=r},i,0);return i=Tt(function(B){return Me(e,n,B).top>r},w,i),{begin:w,end:i}}function Nt(e,t,n,r){n||(n=Ae(e,t));var i=Ar(e,t,Me(e,n,r),"line").top;return Tr(e,t,n,i)}function Or(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Jr(e,t,n,r,i){i-=li(t);var w=Ae(e,t),B=or(t),V=0,J=t.text.length,$=!0,he=dt(t,e.doc.direction);if(he){var ye=(e.options.lineWrapping?Kr:kr)(e,t,n,w,he,r,i);$=ye.level!=1,V=$?ye.from:ye.to-1,J=$?ye.to:ye.from-1}var ke=null,Re=null,Ve=Tt(function(Yt){var Gt=Me(e,w,Yt);return Gt.top+=B,Gt.bottom+=B,Or(Gt,r,i,!1)?(Gt.top<=i&&Gt.left<=r&&(ke=Yt,Re=Gt),!0):!1},V,J),tt,pt,wt=!1;if(Re){var kt=r-Re.left<Re.right-r,Dt=kt==$;Ve=ke+(Dt?0:1),pt=Dt?"after":"before",tt=kt?Re.left:Re.right}else{!$&&(Ve==J||Ve==V)&&Ve++,pt=Ve==0?"after":Ve==t.text.length?"before":Me(e,w,Ve-($?1:0)).bottom+B<=i==$?"after":"before";var Pt=gr(e,rt(n,Ve,pt),"line",t,w);tt=Pt.left,wt=i<Pt.top?-1:i>=Pt.bottom?1:0}return Ve=Ze(t.text,Ve,1),zt(n,Ve,pt,wt,r-tt)}function kr(e,t,n,r,i,w,B){var V=Tt(function(ye){var ke=i[ye],Re=ke.level!=1;return Or(gr(e,rt(n,Re?ke.to:ke.from,Re?"before":"after"),"line",t,r),w,B,!0)},0,i.length-1),J=i[V];if(V>0){var $=J.level!=1,he=gr(e,rt(n,$?J.from:J.to,$?"after":"before"),"line",t,r);Or(he,w,B,!0)&&he.top>B&&(J=i[V-1])}return J}function Kr(e,t,n,r,i,w,B){var V=Tr(e,t,r,B),J=V.begin,$=V.end;/\s/.test(t.text.charAt($-1))&&$--;for(var he=null,ye=null,ke=0;ke<i.length;ke++){var Re=i[ke];if(Re.from>=$||Re.to<=J)continue;var Ve=Re.level!=1,tt=Me(e,r,Ve?Math.min($,Re.to)-1:Math.max(J,Re.from)).right,pt=tt<w?w-tt+1e9:tt-w;(!he||ye>pt)&&(he=Re,ye=pt)}return he||(he=i[i.length-1]),he.from<J&&(he={from:J,to:he.to,level:he.level}),he.to>$&&(he={from:he.from,to:$,level:he.level}),he}var Wr;function hn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Wr==null){Wr=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Wr.appendChild(document.createTextNode("x")),Wr.appendChild(o("br"));Wr.appendChild(document.createTextNode("x"))}h(e.measure,Wr);var n=Wr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),g(e.measure),n||1}function Sn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),n=o("pre",[t],"CodeMirror-line-like");h(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function en(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,w=t.gutters.firstChild,B=0;w;w=w.nextSibling,++B){var V=e.display.gutterSpecs[B].className;n[V]=w.offsetLeft+w.clientLeft+i,r[V]=w.clientWidth}return{fixedPos:Fn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Fn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function pi(e){var t=hn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Sn(e.display)-3);return function(i){if(ei(e.doc,i))return 0;var w=0;if(i.widgets)for(var B=0;B<i.widgets.length;B++)i.widgets[B].height&&(w+=i.widgets[B].height);return n?w+(Math.ceil(i.text.length/r)||1)*t:w+t}}function Vn(e){var t=e.doc,n=pi(e);t.iter(function(r){var i=n(r);i!=r.height&&ln(r,i)})}function An(e,t,n,r){var i=e.display;if(!n&&xe(t).getAttribute("cm-not-content")=="true")return null;var w,B,V=i.lineSpace.getBoundingClientRect();try{w=t.clientX-V.left,B=t.clientY-V.top}catch(ye){return null}var J=vr(e,w,B),$;if(r&&J.xRel>0&&($=Lt(e.doc,J.line).text).length==J.ch){var he=re($,$.length,e.options.tabSize)-$.length;J=rt(J.line,Math.max(0,Math.round((w-Ce(e.display).left)/Sn(e.display))-he))}return J}function Qr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function zr(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Ft&&Mi(e.doc,t)<i.viewTo&&Zr(e);else if(n<=i.viewFrom)Ft&&$n(e.doc,n+r)>i.viewFrom?Zr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Zr(e);else if(t<=i.viewFrom){var w=mi(e,n,n+r,1);w?(i.view=i.view.slice(w.index),i.viewFrom=w.lineN,i.viewTo+=r):Zr(e)}else if(n>=i.viewTo){var B=mi(e,t,t,-1);B?(i.view=i.view.slice(0,B.index),i.viewTo=B.lineN):Zr(e)}else{var V=mi(e,t,t,-1),J=mi(e,n,n+r,1);V&&J?(i.view=i.view.slice(0,V.index).concat(_n(e,V.lineN,J.lineN)).concat(i.view.slice(J.index)),i.viewTo+=r):Zr(e)}var $=i.externalMeasured;$&&(n<$.lineN?$.lineN+=r:t<$.lineN+$.size&&(i.externalMeasured=null))}function tn(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var w=r.view[Qr(e,t)];if(w.node==null)return;var B=w.changes||(w.changes=[]);Ee(B,n)==-1&&B.push(n)}function Zr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function mi(e,t,n,r){var i=Qr(e,t),w,B=e.display.view;if(!Ft||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var V=e.display.viewFrom,J=0;J<i;J++)V+=B[J].size;if(V!=t){if(r>0){if(i==B.length-1)return null;w=V+B[i].size-t,i++}else w=V-t;t+=w,n+=w}for(;Mi(e.doc,n)!=n;){if(i==(r<0?0:B.length-1))return null;n+=r*B[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function ki(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=_n(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=_n(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Qr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(_n(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Qr(e,n)))),r.viewTo=n}function Li(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function Hr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function xi(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),w=r.selection=document.createDocumentFragment(),B=0;B<n.sel.ranges.length;B++){if(!t&&B==n.sel.primIndex)continue;var V=n.sel.ranges[B];if(V.from().line>=e.display.viewTo||V.to().line<e.display.viewFrom)continue;var J=V.empty();(J||e.options.showCursorWhenSelecting)&&Ii(e,V.head,i),J||Fr(e,V,w)}return r}function Ii(e,t,n){var r=gr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(o("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var w=n.appendChild(o("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));w.style.display="",w.style.left=r.other.left+"px",w.style.top=r.other.top+"px",w.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Vr(e,t){return e.top-t.top||e.left-t.left}function Fr(e,t,n){var r=e.display,i=e.doc,w=document.createDocumentFragment(),B=Ce(e.display),V=B.left,J=Math.max(r.sizerWidth,ce(e)-r.sizer.offsetLeft)-B.right,$=i.direction=="ltr";function he(Dt,Pt,Yt,Gt){Pt<0&&(Pt=0),Pt=Math.round(Pt),Gt=Math.round(Gt),w.appendChild(o("div",null,"CodeMirror-selected","position: absolute; left: "+Dt+`px;
|
|
top: `+Pt+"px; width: "+(Yt==null?J-Dt:Yt)+`px;
|
|
height: `+(Gt-Pt)+"px"))}function ye(Dt,Pt,Yt){var Gt=Lt(i,Dt),fr=Gt.text.length,Xr,Ln;function sn(xn,ni){return Yr(e,rt(Dt,xn),"div",Gt,ni)}function di(xn,ni,Bn){var On=Nt(e,Gt,null,xn),Cn=ni=="ltr"==(Bn=="after")?"left":"right",fn=Bn=="after"?On.begin:On.end-(/\s/.test(Gt.text.charAt(On.end-1))?2:1);return sn(fn,Cn)[Cn]}var ri=dt(Gt,i.direction);return bt(ri,Pt||0,Yt==null?fr:Yt,function(xn,ni,Bn,On){var Cn=Bn=="ltr",fn=sn(xn,Cn?"left":"right"),ii=sn(ni-1,Cn?"right":"left"),Na=Pt==null&&xn==0,oa=Yt==null&&ni==fr,Wn=On==0,Ui=!ri||On==ri.length-1;if(ii.top-fn.top<=3){var In=($?Na:oa)&&Wn,ps=($?oa:Na)&&Ui,Qi=In?V:(Cn?fn:ii).left,ga=ps?J:(Cn?ii:fn).right;he(Qi,fn.top,ga-Qi,fn.bottom)}else{var va,Jn,Ba,ms;Cn?(va=$&&Na&&Wn?V:fn.left,Jn=$?J:di(xn,Bn,"before"),Ba=$?V:di(ni,Bn,"after"),ms=$&&oa&&Ui?J:ii.right):(va=$?di(xn,Bn,"before"):V,Jn=!$&&Na&&Wn?J:fn.right,Ba=!$&&oa&&Ui?V:ii.left,ms=$?di(ni,Bn,"after"):J),he(va,fn.top,Jn-va,fn.bottom),fn.bottom<ii.top&&he(V,fn.bottom,null,ii.top),he(Ba,ii.top,ms-Ba,ii.bottom)}(!Xr||Vr(fn,Xr)<0)&&(Xr=fn),Vr(ii,Xr)<0&&(Xr=ii),(!Ln||Vr(fn,Ln)<0)&&(Ln=fn),Vr(ii,Ln)<0&&(Ln=ii)}),{start:Xr,end:Ln}}var ke=t.from(),Re=t.to();if(ke.line==Re.line)ye(ke.line,ke.ch,Re.ch);else{var Ve=Lt(i,ke.line),tt=Lt(i,Re.line),pt=Mn(Ve)==Mn(tt),wt=ye(ke.line,ke.ch,pt?Ve.text.length+1:null).end,kt=ye(Re.line,pt?0:null,Re.ch).start;pt&&(wt.top<kt.top-2?(he(wt.right,wt.top,null,wt.bottom),he(V,kt.top,kt.left,kt.bottom)):he(wt.right,wt.top,kt.left-wt.right,wt.bottom)),wt.bottom<kt.top&&he(V,wt.bottom,null,kt.top)}n.appendChild(w)}function Tn(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Zi(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function xo(e){e.state.focused||(e.display.input.focus(),Pi(e))}function Ga(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zi(e))},100)}function Pi(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(_e(e,"focus",e,t),e.state.focused=!0,z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),_&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Tn(e)}function Zi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(_e(e,"blur",e,t),e.state.focused=!1,f(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function ya(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],w=e.options.lineWrapping,B=void 0,V=0;if(i.hidden)continue;if(H&&W<8){var J=i.node.offsetTop+i.node.offsetHeight;B=J-n,n=J}else{var $=i.node.getBoundingClientRect();B=$.bottom-$.top,!w&&i.text.firstChild&&(V=i.text.firstChild.getBoundingClientRect().right-$.left-1)}var he=i.line.height-B;if((he>.005||he<-.005)&&(ln(i.line,B),Va(i.line),i.rest))for(var ye=0;ye<i.rest.length;ye++)Va(i.rest[ye]);if(V>e.display.sizerWidth){var ke=Math.ceil(V/Sn(e.display));ke>e.display.maxLineLength&&(e.display.maxLineLength=ke,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function Va(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function ba(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-za(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,w=Un(t,r),B=Un(t,i);if(n&&n.ensure){var V=n.ensure.from.line,J=n.ensure.to.line;V<w?(w=V,B=Un(t,li(Lt(t,V))+e.wrapper.clientHeight)):Math.min(J,t.lastLine())>=B&&(w=Un(t,li(Lt(t,J))-e.wrapper.clientHeight),B=J)}return{from:w,to:Math.max(B,w+1)}}function Qo(e,t){if(Je(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!A){var w=o("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-za(e.display))+`px;
|
|
height: `+(t.bottom-t.top+we(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(w),w.scrollIntoView(i),e.display.lineSpace.removeChild(w)}}function Xo(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?rt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?rt(t.line,t.ch+1,"before"):t);for(var w=0;w<5;w++){var B=!1,V=gr(e,t),J=!n||n==t?V:gr(e,n);i={left:Math.min(V.left,J.left),top:Math.min(V.top,J.top)-r,right:Math.max(V.left,J.left),bottom:Math.max(V.bottom,J.bottom)+r};var $=Qa(e,i),he=e.doc.scrollTop,ye=e.doc.scrollLeft;if($.scrollTop!=null&&(ea(e,$.scrollTop),Math.abs(e.doc.scrollTop-he)>1&&(B=!0)),$.scrollLeft!=null&&(gi(e,$.scrollLeft),Math.abs(e.doc.scrollLeft-ye)>1&&(B=!0)),!B)break}return i}function Co(e,t){var n=Qa(e,t);n.scrollTop!=null&&ea(e,n.scrollTop),n.scrollLeft!=null&&gi(e,n.scrollLeft)}function Qa(e,t){var n=e.display,r=hn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,w=q(e),B={};t.bottom-t.top>w&&(t.bottom=t.top+w);var V=e.doc.height+ue(n),J=t.top<r,$=t.bottom>V-r;if(t.top<i)B.scrollTop=J?0:t.top;else if(t.bottom>i+w){var he=Math.min(t.top,($?V:t.bottom)-w);he!=i&&(B.scrollTop=he)}var ye=e.options.fixedGutter?0:n.gutters.offsetWidth,ke=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ye,Re=ce(e)-n.gutters.offsetWidth,Ve=t.right-t.left>Re;return Ve&&(t.right=t.left+Re),t.left<10?B.scrollLeft=0:t.left<ke?B.scrollLeft=Math.max(0,t.left+ye-(Ve?0:10)):t.right>Re+ke-3&&(B.scrollLeft=t.right+(Ve?0:10)-Re),B}function Xa(e,t){if(t==null)return;Ea(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function qi(e){Ea(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function $i(e,t,n){(t!=null||n!=null)&&Ea(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Yo(e,t){Ea(e),e.curOp.scrollToPos=t}function Ea(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Qt(e,t.from),r=Qt(e,t.to);ca(e,n,r,t.margin)}}function ca(e,t,n,r){var i=Qa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});$i(e,i.scrollLeft,i.scrollTop)}function ea(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||pa(e,{top:t}),ta(e,t,!0),M&&pa(e),fa(e,100)}function ta(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function gi(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Er(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Wi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ue(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+we(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var _i=function(e,t,n){this.cm=n;var r=this.vert=o("div",[o("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=o("div",[o("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Ie(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ie(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};_i.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var w=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+w)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},_i.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},_i.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},_i.prototype.zeroWidthHack=function(){var e=l&&!O?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new le,this.disableVert=new le},_i.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),w=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);w!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},_i.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ha=function(){};ha.prototype.update=function(){return{bottom:0,right:0}},ha.prototype.setScrollLeft=function(){},ha.prototype.setScrollTop=function(){},ha.prototype.clear=function(){};function Hi(e,t){t||(t=Wi(e));var n=e.display.barWidth,r=e.display.barHeight;xa(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ya(e),xa(e,Wi(e)),n=e.display.barWidth,r=e.display.barHeight}function xa(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var Ya={native:_i,null:ha};function Ca(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&f(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ya[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ie(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?gi(e,t):ea(e,t)},e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var Ja=0;function Ni(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ja},ui(e.curOp)}function Ki(e){var t=e.curOp;t&&Ko(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;So(n)})}function So(e){for(var t=e.ops,n=0;n<t.length;n++)Jo(t[n]);for(var r=0;r<t.length;r++)Zo(t[r]);for(var i=0;i<t.length;i++)qo(t[i]);for(var w=0;w<t.length;w++)Za(t[w]);for(var B=0;B<t.length;B++)$o(t[B])}function Jo(e){var t=e.cm,n=t.display;Ao(t),e.updateMaxLine&&ua(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new vi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Zo(e){e.updatedDisplay=e.mustUpdate&&zi(e.cm,e.update)}function qo(e){var t=e.cm,n=t.display;e.updatedDisplay&&ya(t),e.barMeasure=Wi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ge(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+we(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-ce(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Za(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&gi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Hi(t,e.barMeasure),e.updatedDisplay&&_r(t,e.barMeasure),e.selectionChanged&&Tn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&xo(e.cm)}function $o(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Sa(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&ta(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&gi(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Xo(t,u(r,e.scrollToPos.from),u(r,e.scrollToPos.to),e.scrollToPos.margin);Qo(t,i)}var w=e.maybeHiddenMarkers,B=e.maybeUnhiddenMarkers;if(w)for(var V=0;V<w.length;++V)w[V].lines.length||_e(w[V],"hide");if(B)for(var J=0;J<B.length;++J)B[J].lines.length&&_e(B[J],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&_e(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Qn(e,t){if(e.curOp)return t();Ni(e);try{return t()}finally{Ki(e)}}function gn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ni(e);try{return t.apply(e,arguments)}finally{Ki(e)}}}function Nn(e){return function(){if(this.curOp)return e.apply(this,arguments);Ni(this);try{return e.apply(this,arguments)}finally{Ki(this)}}}function vn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ni(t);try{return e.apply(this,arguments)}finally{Ki(t)}}}function fa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,G(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=gt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(w){if(r.line>=e.display.viewFrom){var B=w.styles,V=w.text.length>e.options.maxHighlightLength?Lr(t.mode,r.state):null,J=be(e,w,r,!0);V&&(r.state=V),w.styles=J.styles;var $=w.styleClasses,he=J.classes;he?w.styleClasses=he:$&&(w.styleClasses=null);for(var ye=!B||B.length!=w.styles.length||$!=he&&(!$||!he||$.bgClass!=he.bgClass||$.textClass!=he.textClass),ke=0;!ye&&ke<B.length;++ke)ye=B[ke]!=w.styles[ke];ye&&i.push(r.line),w.stateAfter=r.save(),r.nextLine()}else w.text.length<=e.options.maxHighlightLength&&It(e,w.text,r),w.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return fa(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Qn(e,function(){for(var w=0;w<i.length;w++)tn(e,i[w],"text")})}var vi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ba(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=ce(e),this.force=n,this.dims=en(e),this.events=[]};vi.prototype.signal=function(e,t){me(e,t)&&this.events.push(arguments)},vi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)_e.apply(null,this.events[e])};function Ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=we(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=we(e)+"px",t.scrollbarsClipped=!0)}function To(e){if(e.hasFocus())return null;var t=N();if(!t||!T(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&T(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function wo(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&T(document.body,e.anchorNode)&&T(document.body,e.focusNode)){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function zi(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Zr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Li(e)==0)return!1;wn(e)&&(Zr(e),t.dims=en(e));var i=r.first+r.size,w=Math.max(t.visible.from-e.options.viewportMargin,r.first),B=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<w&&w-n.viewFrom<20&&(w=Math.max(r.first,n.viewFrom)),n.viewTo>B&&n.viewTo-B<20&&(B=Math.min(i,n.viewTo)),Ft&&(w=Mi(e.doc,w),B=$n(e.doc,B));var V=w!=n.viewFrom||B!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;ki(e,w,B),n.viewOffset=li(Lt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var J=Li(e);if(!V&&J==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var $=To(e);return J>4&&(n.lineDiv.style.display="none"),Do(e,n.updateLineNumbers,t.dims),J>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,wo($),g(n.cursorDiv),g(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,V&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,fa(e,400)),n.updateLineNumbers=null,!0}function Sa(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==ce(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ue(e.display)-q(e),n.top)}),t.visible=ba(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ba(e.display,e.doc,n));if(!zi(e,t))break;ya(e);var i=Wi(e);Hr(e),Hi(e,i),_r(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 pa(e,t){var n=new vi(e,t);if(zi(e,n)){ya(e),Sa(e,n);var r=Wi(e);Hr(e),Hi(e,r),_r(e,r),n.finish()}}function Do(e,t,n){var r=e.display,i=e.options.lineNumbers,w=r.lineDiv,B=w.firstChild;function V(Ve){var tt=Ve.nextSibling;return _&&l&&e.display.currentWheelTarget==Ve?Ve.style.display="none":Ve.parentNode.removeChild(Ve),tt}for(var J=r.view,$=r.viewFrom,he=0;he<J.length;he++){var ye=J[he];if(!ye.hidden)if(!ye.node||ye.node.parentNode!=w){var ke=bo(e,ye,$,n);w.insertBefore(ke,B)}else{for(;B!=ye.node;)B=V(B);var Re=i&&t!=null&&t<=$&&ye.lineNumber;ye.changes&&(Ee(ye.changes,"gutter")>-1&&(Re=!1),vo(e,ye,$,n)),Re&&(g(ye.lineNumber),ye.lineNumber.appendChild(document.createTextNode(ai(e.options,$)))),B=ye.node.nextSibling}$+=ye.size}for(;B;)B=V(B)}function Aa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function _r(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+we(e)+"px"}function Er(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Fn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,w=r+"px",B=0;B<n.length;B++)if(!n[B].hidden){e.options.fixedGutter&&(n[B].gutter&&(n[B].gutter.style.left=w),n[B].gutterBackground&&(n[B].gutterBackground.style.left=w));var V=n[B].alignable;if(V)for(var J=0;J<V.length;J++)V[J].style.left=w}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function wn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ai(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(o("div",[o("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),w=i.firstChild.offsetWidth,B=i.offsetWidth-w;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(w,r.lineGutter.offsetWidth-B)+1,r.lineNumWidth=r.lineNumInnerWidth+B,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Aa(e.display),!0}return!1}function Xn(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var w=e[i],B=null;if(typeof w!="string"&&(B=w.style,w=w.className),w=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:w,style:B})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ra(e){var t=e.gutters,n=e.gutterSpecs;g(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],w=i.className,B=i.style,V=t.appendChild(o("div",null,"CodeMirror-gutter "+w));B&&(V.style.cssText=B),w=="CodeMirror-linenumbers"&&(e.lineGutter=V,V.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Aa(e)}function Ai(e){ra(e.display),zr(e),Er(e)}function ma(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=o("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=o("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=S("div",null,"CodeMirror-code"),i.selectionDiv=o("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=o("div",null,"CodeMirror-cursors"),i.measure=o("div",null,"CodeMirror-measure"),i.lineMeasure=o("div",null,"CodeMirror-measure"),i.lineSpace=S("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var w=S("div",[i.lineSpace],"CodeMirror-lines");i.mover=o("div",[w],null,"position: relative"),i.sizer=o("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=o("div",null,null,"position: absolute; height: "+Oe+"px; width: 1px;"),i.gutters=o("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=o("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=o("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),H&&W<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!_&&!(M&&a)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Xn(r.gutters,r.lineNumbers),ra(i),n.init(i)}var Bi=0,Dn=null;H?Dn=-.53:M?Dn=15:y?Dn=-.7:k&&(Dn=-1/3);function Ta(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function qa(e){var t=Ta(e);return t.x*=Dn,t.y*=Dn,t}function $a(e,t){var n=Ta(t),r=n.x,i=n.y,w=e.display,B=w.scroller,V=B.scrollWidth>B.clientWidth,J=B.scrollHeight>B.clientHeight;if(!(r&&V||i&&J))return;if(i&&l&&_){e:for(var $=t.target,he=w.view;$!=B;$=$.parentNode)for(var ye=0;ye<he.length;ye++)if(he[ye].node==$){e.display.currentWheelTarget=$;break e}}if(r&&!M&&!C&&Dn!=null){i&&J&&ea(e,Math.max(0,B.scrollTop+i*Dn)),gi(e,Math.max(0,B.scrollLeft+r*Dn)),(!i||i&&J)&&ne(t),w.wheelStartX=null;return}if(i&&Dn!=null){var ke=i*Dn,Re=e.doc.scrollTop,Ve=Re+w.wrapper.clientHeight;ke<0?Re=Math.max(0,Re+ke-50):Ve=Math.min(e.doc.height,Ve+ke+50),pa(e,{top:Re,bottom:Ve})}Bi<20&&(w.wheelStartX==null?(w.wheelStartX=B.scrollLeft,w.wheelStartY=B.scrollTop,w.wheelDX=r,w.wheelDY=i,setTimeout(function(){if(w.wheelStartX==null)return;var tt=B.scrollLeft-w.wheelStartX,pt=B.scrollTop-w.wheelStartY,wt=pt&&w.wheelDY&&pt/w.wheelDY||tt&&w.wheelDX&&tt/w.wheelDX;if(w.wheelStartX=w.wheelStartY=null,!wt)return;Dn=(Dn*Bi+wt)/(Bi+1),++Bi},200)):(w.wheelDX+=r,w.wheelDY+=i))}var Yn=function(e,t){this.ranges=e,this.primIndex=t};Yn.prototype.primary=function(){return this.ranges[this.primIndex]},Yn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!zn(n.anchor,r.anchor)||!zn(n.head,r.head))return!1}return!0},Yn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Pr(ci(this.ranges[t].anchor),ci(this.ranges[t].head));return new Yn(e,this.primIndex)},Yn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Yn.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Wt(t,r.from())>=0&&Wt(e,r.to())<=0)return n}return-1};var Pr=function(e,t){this.anchor=e,this.head=t};Pr.prototype.from=function(){return oi(this.anchor,this.head)},Pr.prototype.to=function(){return bi(this.anchor,this.head)},Pr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function yi(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(ke,Re){return Wt(ke.from(),Re.from())}),n=Ee(t,i);for(var w=1;w<t.length;w++){var B=t[w],V=t[w-1],J=Wt(V.to(),B.from());if(r&&!B.empty()?J>0:J>=0){var $=oi(V.from(),B.from()),he=bi(V.to(),B.to()),ye=V.empty()?B.from()==B.head:V.from()==V.head;w<=n&&--n,t.splice(--w,2,new Pr(ye?he:$,ye?$:he))}}return new Yn(t,n)}function Ti(e,t){return new Yn([new Pr(e,t||e)],0)}function wi(e){return e.text?rt(e.from.line+e.text.length-1,ze(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function eo(e,t){if(Wt(e,t.from)<0)return e;if(Wt(e,t.to)<=0)return wi(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wi(t).ch-t.to.ch),rt(n,r)}function wa(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Pr(eo(i.anchor,t),eo(i.head,t)))}return yi(e.cm,n,e.sel.primIndex)}function Oo(e,t,n){return e.line==t.line?rt(n.line,e.ch-t.ch+n.ch):rt(n.line+(e.line-t.line),e.ch)}function Ro(e,t,n){for(var r=[],i=rt(e.first,0),w=i,B=0;B<t.length;B++){var V=t[B],J=Oo(V.from,i,w),$=Oo(wi(V),i,w);if(i=V.to,w=$,n=="around"){var he=e.sel.ranges[B],ye=Wt(he.head,he.anchor)<0;r[B]=new Pr(ye?$:J,ye?J:$)}else r[B]=new Pr(J,J)}return new Yn(r,e.sel.primIndex)}function Gi(e){e.doc.mode=lr(e.options,e.doc.modeOption),to(e)}function to(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,fa(e,100),e.state.modeGen++,e.curOp&&zr(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&ze(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,n,r){function i(kt){return n?n[kt]:null}function w(kt,Dt,Pt){Ua(kt,Dt,Pt,r),cn(kt,"change",kt,t)}function B(kt,Dt){for(var Pt=[],Yt=kt;Yt<Dt;++Yt)Pt.push(new ji($[Yt],i(Yt),r));return Pt}var V=t.from,J=t.to,$=t.text,he=Lt(e,V.line),ye=Lt(e,J.line),ke=ze($),Re=i($.length-1),Ve=J.line-V.line;if(t.full)e.insert(0,B(0,$.length)),e.remove($.length,e.size-$.length);else if(gs(e,t)){var tt=B(0,$.length-1);w(ye,ye.text,Re),Ve&&e.remove(V.line,Ve),tt.length&&e.insert(V.line,tt)}else if(he==ye)if($.length==1)w(he,he.text.slice(0,V.ch)+ke+he.text.slice(J.ch),Re);else{var pt=B(1,$.length-1);pt.push(new ji(ke+he.text.slice(J.ch),Re,r)),w(he,he.text.slice(0,V.ch)+$[0],i(0)),e.insert(V.line+1,pt)}else if($.length==1)w(he,he.text.slice(0,V.ch)+$[0]+ye.text.slice(J.ch),i(0)),e.remove(V.line+1,Ve);else{w(he,he.text.slice(0,V.ch)+$[0],i(0)),w(ye,ke+ye.text.slice(J.ch),Re);var wt=B(1,$.length-1);Ve>1&&e.remove(V.line+1,Ve-1),e.insert(V.line+1,wt)}cn(e,"change",e,t)}function na(e,t,n){function r(i,w,B){if(i.linked)for(var V=0;V<i.linked.length;++V){var J=i.linked[V];if(J.doc==w)continue;var $=B&&J.sharedHist;if(n&&!$)continue;t(J.doc,$),r(J.doc,i,$)}}r(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Vn(e),Gi(e),ys(e),e.options.lineWrapping||ua(e),e.options.mode=t.modeOption,zr(e)}function ys(e){(e.doc.direction=="rtl"?z:f)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Qn(e,function(){ys(e),zr(e)})}function Mo(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function rs(e,t){var n={from:ci(t.from),to:wi(t),text:Hn(e,t.from,t.to)};return xs(e,n,t.from.line,t.to.line+1),na(e,function(r){return xs(r,n,t.from.line,t.to.line+1)},!0),n}function bs(e){for(;e.length;){var t=ze(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return bs(e.done),ze(e.done);if(e.done.length&&!ze(e.done).ranges)return ze(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ze(e.done)}function Es(e,t,n,r){var i=e.history;i.undone.length=0;var w=+new Date,B,V;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>w-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(B=pl(i,i.lastOp==r)))V=ze(B.changes),Wt(t.from,t.to)==0&&Wt(t.from,V.to)==0?V.to=wi(t):B.changes.push(rs(e,t));else{var J=ze(i.done);for((!J||!J.ranges)&&ko(e.sel,i.done),B={changes:[rs(e,t)],generation:i.generation},i.done.push(B);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=w,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,V||_e(e,"historyAdded")}function ml(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var i=e.history,w=r&&r.origin;n==i.lastSelOp||w&&i.lastSelOrigin==w&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==w||ml(e,w,ze(i.done),t))?i.done[i.done.length-1]=t:ko(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=w,i.lastSelOp=n,r&&r.clearRedo!==!1&&bs(i.undone)}function ko(e,t){var n=ze(t);n&&n.ranges&&n.equals(e)||t.push(e)}function xs(e,t,n,r){var i=t["spans_"+e.id],w=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(B){B.markedSpans&&((i||(i=t["spans_"+e.id]={}))[w]=B.markedSpans),++w})}function vl(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function yl(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(vl(n[i]));return r}function Cs(e,t){var n=yl(e,t),r=Pn(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var w=n[i],B=r[i];if(w&&B){e:for(var V=0;V<B.length;++V){for(var J=B[V],$=0;$<w.length;++$)if(w[$].marker==J.marker)continue e;w.push(J)}}else B&&(n[i]=B)}return n}function Da(e,t,n){for(var r=[],i=0;i<e.length;++i){var w=e[i];if(w.ranges){r.push(n?Yn.prototype.deepCopy.call(w):w);continue}var B=w.changes,V=[];r.push({changes:V});for(var J=0;J<B.length;++J){var $=B[J],he=void 0;if(V.push({from:$.from,to:$.to,text:$.text}),t)for(var ye in $)(he=ye.match(/^spans_(\d+)$/))&&(Ee(t,Number(he[1]))>-1&&(ze(V)[ye]=$[ye],delete $[ye]))}}return r}function ns(e,t,n,r){if(r){var i=e.anchor;if(n){var w=Wt(t,i)<0;w!=Wt(n,i)<0?(i=t,t=n):w!=Wt(t,n)<0&&(t=n)}return new Pr(i,t)}else return new Pr(n||t,t)}function Lo(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),jn(e,new Yn([ns(e.sel.primary(),t,n,i)],0),r)}function Ss(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),w=0;w<e.sel.ranges.length;w++)r[w]=ns(e.sel.ranges[w],t[w],null,i);var B=yi(e.cm,r,e.sel.primIndex);jn(e,B,n)}function is(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,jn(e,yi(e.cm,i,e.sel.primIndex),r)}function As(e,t,n,r){jn(e,Ti(t,n),r)}function bl(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var w=0;w<i.length;w++)this.ranges[w]=new Pr(u(e,i[w].anchor),u(e,i[w].head))},origin:n&&n.origin};return _e(e,"beforeSelectionChange",e,r),e.cm&&_e(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?yi(e.cm,r.ranges,r.ranges.length-1):t}function Ts(e,t,n){var r=e.history.done,i=ze(r);i&&i.ranges?(r[r.length-1]=t,Io(e,t,n)):jn(e,t,n)}function jn(e,t,n){Io(e,t,n),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Io(e,t,n){(me(e,"beforeSelectionChange")||e.cm&&me(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,n));var r=n&&n.bias||(Wt(t.primary().head,e.sel.primary().head)<0?-1:1);ws(e,Os(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&qi(e.cm)}function ws(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Se(e.cm)),cn(e,"cursorActivity",e)}function Ds(e){ws(e,Os(e,e.sel,null,!1))}function Os(e,t,n,r){for(var i,w=0;w<t.ranges.length;w++){var B=t.ranges[w],V=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[w],J=Po(e,B.anchor,V&&V.anchor,n,r),$=Po(e,B.head,V&&V.head,n,r);(i||J!=B.anchor||$!=B.head)&&(i||(i=t.ranges.slice(0,w)),i[w]=new Pr(J,$))}return i?yi(e.cm,i,t.primIndex):t}function Oa(e,t,n,r,i){var w=Lt(e,t.line);if(w.markedSpans)for(var B=0;B<w.markedSpans.length;++B){var V=w.markedSpans[B],J=V.marker,$="selectLeft"in J?!J.selectLeft:J.inclusiveLeft,he="selectRight"in J?!J.selectRight:J.inclusiveRight;if((V.from==null||($?V.from<=t.ch:V.from<t.ch))&&(V.to==null||(he?V.to>=t.ch:V.to>t.ch))){if(i&&(_e(J,"beforeCursorEnter"),J.explicitlyCleared))if(w.markedSpans){--B;continue}else break;if(!J.atomic)continue;if(n){var ye=J.find(r<0?1:-1),ke=void 0;if((r<0?he:$)&&(ye=Rs(e,ye,-r,ye&&ye.line==t.line?w:null)),ye&&ye.line==t.line&&(ke=Wt(ye,n))&&(r<0?ke<0:ke>0))return Oa(e,ye,t,r,i)}var Re=J.find(r<0?-1:1);return(r<0?$:he)&&(Re=Rs(e,Re,r,Re.line==t.line?w:null)),Re?Oa(e,Re,t,r,i):null}}return t}function Po(e,t,n,r,i){var w=r||1,B=Oa(e,t,n,w,i)||!i&&Oa(e,t,n,w,!0)||Oa(e,t,n,-w,i)||!i&&Oa(e,t,n,-w,!0);return B||(e.cantEdit=!0,rt(e.first,0))}function Rs(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?u(e,rt(t.line-1)):null:n>0&&t.ch==(r||Lt(e,t.line)).text.length?t.line<e.first+e.size-1?rt(t.line+1,0):null:new rt(t.line,t.ch+n)}function Ms(e){e.setSelection(rt(e.firstLine(),0),rt(e.lastLine()),Pe)}function ks(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,w,B,V){i&&(r.from=u(e,i)),w&&(r.to=u(e,w)),B&&(r.text=B),V!==void 0&&(r.origin=V)}),_e(e,"beforeChange",e,r),e.cm&&_e(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ra(e,t,n){if(e.cm){if(!e.cm.curOp)return gn(e.cm,Ra)(e,t,n);if(e.cm.state.suppressEdits)return}if((me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"))&&(t=ks(e,t,!0),!t))return;var r=Rr&&!n&&un(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Ls(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&Wt(t.from,t.to)==0)return;var n=wa(e,t);Es(e,t,n,e.cm?e.cm.curOp.id:NaN),ro(e,t,n,Pn(e,t));var r=[];na(e,function(i,w){!w&&Ee(r,i.history)==-1&&(Ns(i.history,t),r.push(i.history)),ro(i,t,null,Pn(i,t))})}function _o(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var i=e.history,w,B=e.sel,V=t=="undo"?i.done:i.undone,J=t=="undo"?i.undone:i.done,$=0;$<V.length&&!(w=V[$],n?w.ranges&&!w.equals(e.sel):!w.ranges);$++);if($==V.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(w=V.pop(),w.ranges){if(ko(w,J),n&&!w.equals(e.sel)){jn(e,w,{clearRedo:!1});return}B=w}else if(r){V.push(w);return}else break;var he=[];ko(B,J),J.push({changes:he,generation:i.generation}),i.generation=w.generation||++i.maxGeneration;for(var ye=me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"),ke=function(tt){var pt=w.changes[tt];if(pt.origin=t,ye&&!ks(e,pt,!1))return V.length=0,{};he.push(rs(e,pt));var wt=tt?wa(e,pt):ze(V);ro(e,pt,wt,Cs(e,pt)),!tt&&e.cm&&e.cm.scrollIntoView({from:pt.from,to:wi(pt)});var kt=[];na(e,function(Dt,Pt){!Pt&&Ee(kt,Dt.history)==-1&&(Ns(Dt.history,pt),kt.push(Dt.history)),ro(Dt,pt,null,Cs(Dt,pt))})},Re=w.changes.length-1;Re>=0;--Re){var Ve=ke(Re);if(Ve)return Ve.v}}function Is(e,t){if(t==0)return;if(e.first+=t,e.sel=new Yn(xt(e.sel.ranges,function(i){return new Pr(rt(i.anchor.line+t,i.anchor.ch),rt(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){zr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)tn(e.cm,r,"gutter")}}function ro(e,t,n,r){if(e.cm&&!e.cm.curOp)return gn(e.cm,ro)(e,t,n,r);if(t.to.line<e.first){Is(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Is(e,i),t={from:rt(e.first,0),to:rt(t.to.line+i,t.to.ch),text:[ze(t.text)],origin:t.origin}}var w=e.lastLine();t.to.line>w&&(t={from:t.from,to:rt(w,Lt(e,w).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Hn(e,t.from,t.to),n||(n=wa(e,t)),e.cm?El(e.cm,t,r):ts(e,t,r),Io(e,n,Pe),e.cantEdit&&Po(e,rt(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,n){var r=e.doc,i=e.display,w=t.from,B=t.to,V=!1,J=w.line;e.options.lineWrapping||(J=ir(Mn(Lt(r,w.line))),r.iter(J,B.line+1,function(Re){if(Re==i.maxLine)return V=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Se(e),ts(r,t,n,pi(e)),e.options.lineWrapping||(r.iter(J,w.line+t.text.length,function(Re){var Ve=la(Re);Ve>i.maxLineLength&&(i.maxLine=Re,i.maxLineLength=Ve,i.maxLineChanged=!0,V=!1)}),V&&(e.curOp.updateMaxLine=!0)),qn(r,w.line),fa(e,400);var $=t.text.length-(B.line-w.line)-1;t.full?zr(e):w.line==B.line&&t.text.length==1&&!gs(e.doc,t)?tn(e,w.line,"text"):zr(e,w.line,B.line+1,$);var he=me(e,"changes"),ye=me(e,"change");if(ye||he){var ke={from:w,to:B,text:t.text,removed:t.removed,origin:t.origin};ye&&cn(e,"change",e,ke),he&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ke)}e.display.selForContextMenu=null}function Ma(e,t,n,r,i){var w;r||(r=n),Wt(r,n)<0&&(w=[r,n],n=w[0],r=w[1]),typeof t=="string"&&(t=e.splitLines(t)),Ra(e,{from:n,to:r,text:t,origin:i})}function Ps(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function _s(e,t,n,r){for(var i=0;i<e.length;++i){var w=e[i],B=!0;if(w.ranges){w.copied||(w=e[i]=w.deepCopy(),w.copied=!0);for(var V=0;V<w.ranges.length;V++)Ps(w.ranges[V].anchor,t,n,r),Ps(w.ranges[V].head,t,n,r);continue}for(var J=0;J<w.changes.length;++J){var $=w.changes[J];if(n<$.from.line)$.from=rt($.from.line+r,$.from.ch),$.to=rt($.to.line+r,$.to.ch);else if(t<=$.to.line){B=!1;break}}B||(e.splice(0,i+1),i=0)}}function Ns(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;_s(e.done,n,r,i),_s(e.undone,n,r,i)}function no(e,t,n,r){var i=t,w=t;return typeof t=="number"?w=Lt(e,j(e,t)):i=ir(t),i==null?null:(r(w,i)&&e.cm&&tn(e.cm,i,n),w)}function io(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}io.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Bt(i),cn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function ao(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}ao.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var w=Math.min(t,i-e),B=r.height;if(r.removeInner(e,w),this.height-=B-r.height,i==w&&(this.children.splice(n--,1),r.parent=null),(t-=w)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof io))){var V=[];this.collapse(V),this.children=[new io(V)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],w=i.chunkSize();if(e<=w){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var B=i.lines.length%25+25,V=B;V<i.lines.length;){var J=new io(i.lines.slice(V,V+=25));i.height-=J.height,this.children.splice(++r,0,J),J.parent=this}i.lines=i.lines.slice(0,B),this.maybeSpill()}break}e-=w}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new ao(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=Ee(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new ao(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],w=i.chunkSize();if(e<w){var B=Math.min(t,w-e);if(i.iterN(e,B,n))return!0;if((t-=B)==0)break;e=0}else e-=w}}};var oo=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};oo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ir(n);if(r==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var w=Ji(this);ln(n,Math.max(0,n.height-w)),e&&(Qn(e,function(){Bs(e,n,-w),tn(e,r,"widget")}),cn(e,"lineWidgetCleared",e,this,r))},oo.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Ji(this)-t;if(!i)return;ei(this.doc,r)||ln(r,r.height+i),n&&Qn(n,function(){n.curOp.forceUpdate=!0,Bs(n,r,i),cn(n,"lineWidgetChanged",n,e,ir(r))})},ve(oo);function Bs(e,t,n){li(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Xa(e,n)}function xl(e,t,n,r){var i=new oo(e,n,r),w=e.cm;return w&&i.noHScroll&&(w.display.alignWidgets=!0),no(e,t,"widget",function(B){var V=B.widgets||(B.widgets=[]);if(i.insertAt==null?V.push(i):V.splice(Math.min(V.length-1,Math.max(0,i.insertAt)),0,i),i.line=B,w&&!ei(e,B)){var J=li(B)<e.scrollTop;ln(B,B.height+Ji(i)),J&&Xa(w,i.height),w.curOp.forceUpdate=!0}return!0}),w&&cn(w,"lineWidgetAdded",w,i,typeof t=="number"?t:ir(t)),i}var Us=0,ia=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};ia.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ni(e),me(this,"clear")){var n=this.find();n&&cn(this,"clear",n.from,n.to)}for(var r=null,i=null,w=0;w<this.lines.length;++w){var B=this.lines[w],V=tr(B.markedSpans,this);e&&!this.collapsed?tn(e,ir(B),"text"):e&&(V.to!=null&&(i=ir(B)),V.from!=null&&(r=ir(B))),B.markedSpans=si(B.markedSpans,V),V.from==null&&this.collapsed&&!ei(this.doc,B)&&e&&ln(B,hn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var J=0;J<this.lines.length;++J){var $=Mn(this.lines[J]),he=la($);he>e.display.maxLineLength&&(e.display.maxLine=$,e.display.maxLineLength=he,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&zr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ds(e.doc)),e&&cn(e,"markerCleared",e,this,r,i),t&&Ki(e),this.parent&&this.parent.clear()},ia.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var w=this.lines[i],B=tr(w.markedSpans,this);if(B.from!=null&&(n=rt(t?w:ir(w),B.from),e==-1))return n;if(B.to!=null&&(r=rt(t?w:ir(w),B.to),e==1))return r}return n&&{from:n,to:r}},ia.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;if(!t||!r)return;Qn(r,function(){var i=t.line,w=ir(t.line),B=De(r,w);if(B&&(ur(B),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ei(n.doc,i)&&n.height!=null){var V=n.height;n.height=null;var J=Ji(n)-V;J&&ln(i,i.height+J)}cn(r,"markerChanged",r,e)})},ia.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Ee(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ia.prototype.detachLine=function(e){if(this.lines.splice(Ee(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ve(ia);function ka(e,t,n,r,i){if(r&&r.shared)return Cl(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return gn(e.cm,ka)(e,t,n,r,i);var w=new ia(e,i),B=Wt(t,n);if(r&&F(r,w,!1),B>0||B==0&&w.clearWhenEmpty!==!1)return w;if(w.replacedWith&&(w.collapsed=!0,w.widgetNode=S("span",[w.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||w.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(w.widgetNode.insertLeft=!0)),w.collapsed){if(En(e,t.line,t,n,w)||t.line!=n.line&&En(e,n.line,t,n,w))throw new Error("Inserting collapsed marker partially overlapping an existing one");er()}w.addToHistory&&Es(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var V=t.line,J=e.cm,$;if(e.iter(V,n.line+1,function(ye){J&&w.collapsed&&!J.options.lineWrapping&&Mn(ye)==J.display.maxLine&&($=!0),w.collapsed&&V!=t.line&&ln(ye,0),nn(ye,new wr(w,V==t.line?t.ch:null,V==n.line?n.ch:null)),++V}),w.collapsed&&e.iter(t.line,n.line+1,function(ye){ei(e,ye)&&ln(ye,0)}),w.clearOnEnter&&Ie(w,"beforeCursorEnter",function(){return w.clear()}),w.readOnly&&(Vt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),w.collapsed&&(w.id=++Us,w.atomic=!0),J){if($&&(J.curOp.updateMaxLine=!0),w.collapsed)zr(J,t.line,n.line+1);else if(w.className||w.startStyle||w.endStyle||w.css||w.attributes||w.title)for(var he=t.line;he<=n.line;he++)tn(J,he,"text");w.atomic&&Ds(J.doc),cn(J,"markerAdded",J,w)}return w}var so=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};so.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();cn(this,"clear")},so.prototype.find=function(e,t){return this.primary.find(e,t)},ve(so);function Cl(e,t,n,r,i){r=F(r),r.shared=!1;var w=[ka(e,t,n,r,i)],B=w[0],V=r.widgetNode;return na(e,function(J){V&&(r.widgetNode=V.cloneNode(!0)),w.push(ka(J,u(J,t),u(J,n),r,i));for(var $=0;$<J.linked.length;++$)if(J.linked[$].isParent)return;B=ze(w)}),new so(w,B)}function Fs(e){return e.findMarks(rt(e.first,0),e.clipPos(rt(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),w=e.clipPos(i.from),B=e.clipPos(i.to);if(Wt(w,B)){var V=ka(e,w,B,r.primary,r.primary.type);r.markers.push(V),V.parent=r}}}function Al(e){for(var t=function(r){var i=e[r],w=[i.primary.doc];na(i.primary.doc,function(J){return w.push(J)});for(var B=0;B<i.markers.length;B++){var V=i.markers[B];Ee(w,V.doc)==-1&&(V.parent=null,i.markers.splice(B--,1))}},n=0;n<e.length;n++)t(n)}var Tl=0,ti=function(e,t,n,r,i){if(!(this instanceof ti))return new ti(e,t,n,r,i);n==null&&(n=0),ao.call(this,[new io([new ji("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var w=rt(n,0);this.sel=Ti(w),this.history=new Mo(null),this.id=++Tl,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:w,to:w,text:e}),jn(this,Ti(w),Pe)};ti.prototype=Ct(ao.prototype,{constructor:ti,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Zn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:vn(function(e){var t=rt(this.first,0),n=this.first+this.size-1;Ra(this,{from:t,to:rt(n,Lt(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&$i(this.cm,0,0),jn(this,Ti(t),Pe)}),replaceRange:function(e,t,n,r){t=u(this,t),n=n?u(this,n):t,Ma(this,e,t,n,r)},getRange:function(e,t,n){var r=Hn(this,u(this,e),u(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Kn(this,e))return Lt(this,e)},getLineNumber:function(e){return ir(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Lt(this,e)),Mn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return u(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:vn(function(e,t,n){As(this,u(this,typeof e=="number"?rt(e,t||0):e),null,n)}),setSelection:vn(function(e,t,n){As(this,u(this,e),u(this,t||e),n)}),extendSelection:vn(function(e,t,n){Lo(this,u(this,e),t&&u(this,t),n)}),extendSelections:vn(function(e,t){Ss(this,I(this,e),t)}),extendSelectionsBy:vn(function(e,t){var n=xt(this.sel.ranges,e);Ss(this,I(this,n),t)}),setSelections:vn(function(e,t,n){if(!e.length)return;for(var r=[],i=0;i<e.length;i++)r[i]=new Pr(u(this,e[i].anchor),u(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),jn(this,yi(this.cm,r,t),n)}),addSelection:vn(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Pr(u(this,e),u(this,t||e))),jn(this,yi(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=Hn(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Hn(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:vn(function(e,t,n){for(var r=[],i=this.sel,w=0;w<i.ranges.length;w++){var B=i.ranges[w];r[w]={from:B.from(),to:B.to(),text:this.splitLines(e[w]),origin:n}}for(var V=t&&t!="end"&&Ro(this,r,t),J=r.length-1;J>=0;J--)Ra(this,r[J]);V?Ts(this,V):this.cm&&qi(this.cm)}),undo:vn(function(){_o(this,"undo")}),redo:vn(function(){_o(this,"redo")}),undoSelection:vn(function(){_o(this,"undo",!0)}),redoSelection:vn(function(){_o(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Mo(this.history.maxGeneration),na(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Da(this.history.done),undone:Da(this.history.undone)}},setHistory:function(e){var t=this.history=new Mo(this.history.maxGeneration);t.done=Da(e.done.slice(0),null,!0),t.undone=Da(e.undone.slice(0),null,!0)},setGutterMarker:vn(function(e,t,n){return no(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&vt(i)&&(r.gutterMarkers=null),!0})}),clearGutter:vn(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&no(t,n,"gutter",function(){return n.gutterMarkers[e]=null,vt(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Kn(this,e))return null;if(t=e,e=Lt(this,e),!e)return null}else if(t=ir(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:vn(function(e,t,n){return no(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(E(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:vn(function(e,t,n){return no(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",w=r[i];if(w)if(n==null)r[i]=null;else{var B=w.match(E(n));if(!B)return!1;var V=B.index+B[0].length;r[i]=w.slice(0,B.index)+(!B.index||V==w.length?"":" ")+w.slice(V)||null}else return!1;return!0})}),addLineWidget:vn(function(e,t,n){return xl(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return ka(this,u(this,e),u(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=u(this,e),ka(this,e,e,n,"bookmark")},findMarksAt:function(e){e=u(this,e);var t=[],n=Lt(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=u(this,e),t=u(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(w){var B=w.markedSpans;if(B)for(var V=0;V<B.length;V++){var J=B[V];!(J.to!=null&&i==e.line&&e.ch>=J.to||J.from==null&&i!=e.line||J.from!=null&&i==t.line&&J.from>=t.ch)&&(!n||n(J.marker))&&r.push(J.marker.parent||J.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var w=i.text.length+r;if(w>e)return t=e,!0;e-=w,++n}),u(this,rt(n,t))},indexFromPos:function(e){e=u(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new ti(Zn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new ti(Zn(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(r,Fs(this)),r},unlinkDoc:function(e){if(e instanceof rn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Al(Fs(this));break}if(e.history==this.history){var r=[e.id];na(e,function(i){return r.push(i.id)},!0),e.history=new Mo(null),e.history.done=Da(this.history.done,r),e.history.undone=Da(this.history.undone,r)}},iterLinkedDocs:function(e){na(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):_t(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:vn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),ti.prototype.eachLine=ti.prototype.iter;var js=0;function wl(e){var t=this;if(Ws(t),Je(t,e)||Si(t.display,e))return;ne(e),H&&(js=+new Date);var n=An(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,w=Array(i),B=0,V=function(){++B==i&&gn(t,function(){n=u(t.doc,n);var Re={from:n,to:n,text:t.doc.splitLines(w.filter(function(Ve){return Ve!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ra(t.doc,Re),Ts(t.doc,Ti(u(t.doc,n),u(t.doc,wi(Re))))})()},J=function(Re,Ve){if(t.options.allowDropFileTypes&&Ee(t.options.allowDropFileTypes,Re.type)==-1){V();return}var tt=new FileReader;tt.onerror=function(){return V()},tt.onload=function(){var pt=tt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(pt)){V();return}w[Ve]=pt,V()},tt.readAsText(Re)},$=0;$<r.length;$++)J(r[$],$);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var he=e.dataTransfer.getData("Text");if(he){var ye;if(t.state.draggingText&&!t.state.draggingText.copy&&(ye=t.listSelections()),Io(t.doc,Ti(n,n)),ye)for(var ke=0;ke<ye.length;++ke)Ma(t.doc,"",ye[ke].anchor,ye[ke].head,"drag");t.replaceSelection(he,"around","paste"),t.display.input.focus()}}catch(Re){}}}function Dl(e,t){if(H&&(!e.state.draggingText||+new Date-js<100)){pe(t);return}if(Je(e,t)||Si(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!k){var n=o("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",C&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),C&&n.parentNode.removeChild(n)}}function Ol(e,t){var n=An(e,t);if(!n)return;var r=document.createDocumentFragment();Ii(e,n,r),e.display.dragCursor||(e.display.dragCursor=o("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),h(e.display.dragCursor,r)}function Ws(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Hs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var w=0;w<n.length;w++)e(n[w])})}var Ks=!1;function Rl(){if(Ks)return;Ml(),Ks=!0}function Ml(){var e;Ie(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Hs(kl)},100))}),Ie(window,"blur",function(){return Hs(Zi)})}function kl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var aa={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},lo=0;lo<10;lo++)aa[lo+48]=aa[lo+96]=String(lo);for(var No=65;No<=90;No++)aa[No]=String.fromCharCode(No);for(var uo=1;uo<=12;uo++)aa[uo+111]=aa[uo+63235]="F"+uo;var Vi={};Vi.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"},Vi.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"},Vi.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"},Vi.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"]},Vi.default=l?Vi.macDefault:Vi.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,w,B=0;B<t.length-1;B++){var V=t[B];if(/^(cmd|meta|m)$/i.test(V))w=!0;else if(/^a(lt)?$/i.test(V))n=!0;else if(/^(c|ctrl|control)$/i.test(V))r=!0;else if(/^s(hift)?$/i.test(V))i=!0;else throw new Error("Unrecognized modifier name: "+V)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),w&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Il(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=xt(n.split(" "),Ll),w=0;w<i.length;w++){var B=void 0,V=void 0;w==i.length-1?(V=i.join(" "),B=r):(V=i.slice(0,w+1).join(" "),B="...");var J=t[V];if(!J)t[V]=B;else if(J!=B)throw new Error("Inconsistent bindings for "+V)}delete e[n]}for(var $ in t)e[$]=t[$];return e}function La(e,t,n,r){t=Bo(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return La(e,t.fallthrough,n,r);for(var w=0;w<t.fallthrough.length;w++){var B=La(e,t.fallthrough[w],n,r);if(B)return B}}}function zs(e){var t=typeof e=="string"?e:aa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(m?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(m?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(C&&e.keyCode==34&&e.char)return!1;var n=aa[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Gs(n,e,t))}function Bo(e){return typeof e=="string"?Vi[e]:e}function Ia(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var w=t(n[i]);r.length&&Wt(w.from,ze(r).to)<=0;){var B=r.pop();if(Wt(B.from,w.from)<0){w.from=B.from;break}}r.push(w)}Qn(e,function(){for(var V=r.length-1;V>=0;V--)Ma(e.doc,"",r[V].from,r[V].to,"+delete");qi(e)})}function as(e,t,n){var r=Ze(e.text,t+n,n);return r<0||r>e.text.length?null:r}function os(e,t,n){var r=as(e,t.ch,n);return r==null?null:new rt(t.line,r,n<0?"after":"before")}function ss(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var w=dt(n,t.doc.direction);if(w){var B=i<0?ze(w):w[0],V=i<0==(B.level==1),J=V?"after":"before",$;if(B.level>0||t.doc.direction=="rtl"){var he=Ae(t,n);$=i<0?n.text.length-1:0;var ye=Me(t,he,$).top;$=Tt(function(ke){return Me(t,he,ke).top==ye},i<0==(B.level==1)?B.from:B.to-1,$),J=="before"&&($=as(n,$,1))}else $=i<0?B.to:B.from;return new rt(r,$,J)}}return new rt(r,i<0?n.text.length:0,i<0?"before":"after")}function Pl(e,t,n,r){var i=dt(t,e.doc.direction);if(!i)return os(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var w=lt(i,n.ch,n.sticky),B=i[w];if(e.doc.direction=="ltr"&&B.level%2==0&&(r>0?B.to>n.ch:B.from<n.ch))return os(t,n,r);var V=function(wt,kt){return as(t,wt instanceof rt?wt.ch:wt,kt)},J,$=function(wt){return e.options.lineWrapping?(J=J||Ae(e,t),Nt(e,t,J,wt)):{begin:0,end:t.text.length}},he=$(n.sticky=="before"?V(n,-1):n.ch);if(e.doc.direction=="rtl"||B.level==1){var ye=B.level==1==r<0,ke=V(n,ye?1:-1);if(ke!=null&&(ye?ke<=B.to&&ke<=he.end:ke>=B.from&&ke>=he.begin)){var Re=ye?"before":"after";return new rt(n.line,ke,Re)}}var Ve=function(wt,kt,Dt){for(var Pt=function(Xr,Ln){return Ln?new rt(n.line,V(Xr,1),"before"):new rt(n.line,Xr,"after")};wt>=0&&wt<i.length;wt+=kt){var Yt=i[wt],Gt=kt>0==(Yt.level!=1),fr=Gt?Dt.begin:V(Dt.end,-1);if(Yt.from<=fr&&fr<Yt.to)return Pt(fr,Gt);if(fr=Gt?Yt.from:V(Yt.to,-1),Dt.begin<=fr&&fr<Dt.end)return Pt(fr,Gt)}},tt=Ve(w+r,r,he);if(tt)return tt;var pt=r>0?he.end:V(he.begin,-1);return pt!=null&&!(r>0&&pt==t.text.length)&&(tt=Ve(r>0?0:i.length-1,r,$(pt)),tt)?tt:null}var co={selectAll:Ms,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Pe)},killLine:function(e){return Ia(e,function(t){if(t.empty()){var n=Lt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:rt(t.head.line+1,0)}:{from:t.head,to:rt(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ia(e,function(t){return{from:rt(t.from().line,0),to:u(e.doc,rt(t.to().line+1,0))}})},delLineLeft:function(e){return Ia(e,function(t){return{from:rt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ia(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Ia(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(rt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(rt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Qs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return _l(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Ue)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Ue)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Xs(e,t.head):r},Ue)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var w=n[i].from(),B=re(e.getLine(w.line),w.ch,r);t.push(se(r-B%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Qn(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,w=Lt(e.doc,i.line).text;if(w){if(i.ch==w.length&&(i=new rt(i.line,i.ch-1)),i.ch>0)i=new rt(i.line,i.ch+1),e.replaceRange(w.charAt(i.ch-1)+w.charAt(i.ch-2),rt(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var B=Lt(e.doc,i.line-1).text;B&&(i=new rt(i.line,1),e.replaceRange(w.charAt(0)+e.doc.lineSeparator()+B.charAt(B.length-1),rt(i.line-1,B.length-1),i,"+transpose"))}}n.push(new Pr(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Qn(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);qi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Qs(e,t){var n=Lt(e.doc,t),r=Mn(n);return r!=n&&(t=ir(r)),ss(!0,e,r,t,1)}function _l(e,t){var n=Lt(e.doc,t),r=Xi(n);return r!=n&&(t=ir(r)),ss(!0,e,n,t,-1)}function Xs(e,t){var n=Qs(e,t.line),r=Lt(e.doc,n.line),i=dt(r,e.doc.direction);if(!i||i[0].level==0){var w=Math.max(n.ch,r.text.search(/\S/)),B=t.line==n.line&&t.ch<=w&&t.ch;return rt(n.line,B?0:w,n.sticky)}return n}function Uo(e,t,n){if(typeof t=="string"&&(t=co[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ye}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Nl(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=La(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&La(t,e.options.extraKeys,n,e)||La(t,e.options.keyMap,n,e)}var Bl=new le;function ho(e,t,n,r){var i=e.state.keySeq;if(i){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Ys(e,i+" "+t,n,r))return!0}return Ys(e,t,n,r)}function Ys(e,t,n,r){var i=Nl(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&cn(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(ne(n),Tn(e)),!!i}function Js(e,t){var n=Vs(t,!0);return n?t.shiftKey&&!e.state.keySeq?ho(e,"Shift-"+n,t,function(r){return Uo(e,r,!0)})||ho(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Uo(e,r)}):ho(e,n,t,function(r){return Uo(e,r)}):!1}function Ul(e,t,n){return ho(e,"'"+n+"'",t,function(r){return Uo(e,r,!0)})}var ls=null;function Zs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),Je(t,e))return;H&&W<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Js(t,e);C&&(ls=r?n:null,!r&&n==88&&!Jt&&(l?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),M&&!l&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;z(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(f(t,"CodeMirror-crosshair"),$e(document,"keyup",n),$e(document,"mouseover",n))}Ie(document,"keyup",n),Ie(document,"mouseover",n)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Je(this,e)}function $s(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Si(t.display,e)||Je(t,e)||e.ctrlKey&&!e.altKey||l&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(C&&n==ls){ls=null,ne(e);return}if(C&&(!e.which||e.which<10)&&Js(t,e))return;var i=String.fromCharCode(r==null?n:r);if(i=="\b")return;if(Ul(t,e,i))return;t.display.input.onKeyPress(e)}var jl=400,us=function(e,t,n){this.time=e,this.pos=t,this.button=n};us.prototype.compare=function(e,t,n){return this.time+jl>e&&Wt(t,this.pos)==0&&n==this.button};var fo,po;function Wl(e,t){var n=+new Date;return po&&po.compare(n,e,t)?(fo=po=null,"triple"):fo&&fo.compare(n,e,t)?(po=new us(n,e,t),fo=null,"double"):(fo=new us(n,e,t),po=null,"single")}function el(e){var t=this,n=t.display;if(Je(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,Si(n,e)){_||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(ds(t,e))return;var r=An(t,e),i=Le(e),w=r?Wl(r,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,i,r,w,e))return;i==1?r?zl(t,r,w,e):xe(e)==n.scroller&&ne(e):i==2?(r&&Lo(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(R?t.display.input.onContextMenu(e):Ga(t))}function Hl(e,t,n,r,i){var w="Click";return r=="double"?w="Double"+w:r=="triple"&&(w="Triple"+w),w=(t==1?"Left":t==2?"Middle":"Right")+w,ho(e,Gs(w,i),i,function(B){if(typeof B=="string"&&(B=co[B]),!B)return!1;var V=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),V=B(e,n)!=Ye}finally{e.state.suppressEdits=!1}return V})}function Kl(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var w=s?n.shiftKey&&n.metaKey:n.altKey;i.unit=w?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=l?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(l?n.altKey:n.ctrlKey)),i}function zl(e,t,n,r){H?setTimeout(G(xo,e),0):e.curOp.focus=N();var i=Kl(e,n,r),w=e.doc.sel,B;e.options.dragDrop&&je&&!e.isReadOnly()&&n=="single"&&(B=w.contains(t))>-1&&(Wt((B=w.ranges[B]).from(),t)<0||t.xRel>0)&&(Wt(B.to(),t)>0||t.xRel<0)?Gl(e,r,t,i):Vl(e,r,t,i)}function Gl(e,t,n,r){var i=e.display,w=!1,B=gn(e,function($){_&&(i.scroller.draggable=!1),e.state.draggingText=!1,$e(i.wrapper.ownerDocument,"mouseup",B),$e(i.wrapper.ownerDocument,"mousemove",V),$e(i.scroller,"dragstart",J),$e(i.scroller,"drop",B),w||(ne($),r.addNew||Lo(e.doc,n,null,null,r.extend),_&&!k||H&&W==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),V=function($){w=w||Math.abs(t.clientX-$.clientX)+Math.abs(t.clientY-$.clientY)>=10},J=function(){return w=!0};_&&(i.scroller.draggable=!0),e.state.draggingText=B,B.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),Ie(i.wrapper.ownerDocument,"mouseup",B),Ie(i.wrapper.ownerDocument,"mousemove",V),Ie(i.scroller,"dragstart",J),Ie(i.scroller,"drop",B),Ga(e),setTimeout(function(){return i.input.focus()},20)}function tl(e,t,n){if(n=="char")return new Pr(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Pr(rt(t.line,0),u(e.doc,rt(t.line+1,0)));var r=n(e,t);return new Pr(r.from,r.to)}function Vl(e,t,n,r){var i=e.display,w=e.doc;ne(t);var B,V,J=w.sel,$=J.ranges;if(r.addNew&&!r.extend?(V=w.sel.contains(n),V>-1?B=$[V]:B=new Pr(n,n)):(B=w.sel.primary(),V=w.sel.primIndex),r.unit=="rectangle")r.addNew||(B=new Pr(n,n)),n=An(e,t,!0,!0),V=-1;else{var he=tl(e,n,r.unit);r.extend?B=ns(B,he.anchor,he.head,r.extend):B=he}r.addNew?V==-1?(V=$.length,jn(w,yi(e,$.concat([B]),V),{scroll:!1,origin:"*mouse"})):$.length>1&&$[V].empty()&&r.unit=="char"&&!r.extend?(jn(w,yi(e,$.slice(0,V).concat($.slice(V+1)),0),{scroll:!1,origin:"*mouse"}),J=w.sel):is(w,V,B,Be):(V=0,jn(w,new Yn([B],0),Be),J=w.sel);var ye=n;function ke(Dt){if(Wt(ye,Dt)==0)return;if(ye=Dt,r.unit=="rectangle"){for(var Pt=[],Yt=e.options.tabSize,Gt=re(Lt(w,n.line).text,n.ch,Yt),fr=re(Lt(w,Dt.line).text,Dt.ch,Yt),Xr=Math.min(Gt,fr),Ln=Math.max(Gt,fr),sn=Math.min(n.line,Dt.line),di=Math.min(e.lastLine(),Math.max(n.line,Dt.line));sn<=di;sn++){var ri=Lt(w,sn).text,xn=Ne(ri,Xr,Yt);Xr==Ln?Pt.push(new Pr(rt(sn,xn),rt(sn,xn))):ri.length>xn&&Pt.push(new Pr(rt(sn,xn),rt(sn,Ne(ri,Ln,Yt))))}Pt.length||Pt.push(new Pr(n,n)),jn(w,yi(e,J.ranges.slice(0,V).concat(Pt),V),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Dt)}else{var ni=B,Bn=tl(e,Dt,r.unit),On=ni.anchor,Cn;Wt(Bn.anchor,On)>0?(Cn=Bn.head,On=oi(ni.from(),Bn.anchor)):(Cn=Bn.anchor,On=bi(ni.to(),Bn.head));var fn=J.ranges.slice(0);fn[V]=Ql(e,new Pr(u(w,On),Cn)),jn(w,yi(e,fn,V),Be)}}var Re=i.wrapper.getBoundingClientRect(),Ve=0;function tt(Dt){var Pt=++Ve,Yt=An(e,Dt,!0,r.unit=="rectangle");if(!Yt)return;if(Wt(Yt,ye)!=0){e.curOp.focus=N(),ke(Yt);var Gt=ba(i,w);(Yt.line>=Gt.to||Yt.line<Gt.from)&&setTimeout(gn(e,function(){Ve==Pt&&tt(Dt)}),150)}else{var fr=Dt.clientY<Re.top?-20:Dt.clientY>Re.bottom?20:0;fr&&setTimeout(gn(e,function(){if(Ve!=Pt)return;i.scroller.scrollTop+=fr,tt(Dt)}),50)}}function pt(Dt){e.state.selectingText=!1,Ve=Infinity,Dt&&(ne(Dt),i.input.focus()),$e(i.wrapper.ownerDocument,"mousemove",wt),$e(i.wrapper.ownerDocument,"mouseup",kt),w.history.lastSelOrigin=null}var wt=gn(e,function(Dt){Dt.buttons===0||!Le(Dt)?pt(Dt):tt(Dt)}),kt=gn(e,pt);e.state.selectingText=kt,Ie(i.wrapper.ownerDocument,"mousemove",wt),Ie(i.wrapper.ownerDocument,"mouseup",kt)}function Ql(e,t){var n=t.anchor,r=t.head,i=Lt(e.doc,n.line);if(Wt(n,r)==0&&n.sticky==r.sticky)return t;var w=dt(i);if(!w)return t;var B=lt(w,n.ch,n.sticky),V=w[B];if(V.from!=n.ch&&V.to!=n.ch)return t;var J=B+(V.from==n.ch==(V.level!=1)?0:1);if(J==0||J==w.length)return t;var $;if(r.line!=n.line)$=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var he=lt(w,r.ch,r.sticky),ye=he-B||(r.ch-n.ch)*(V.level==1?-1:1);he==J-1||he==J?$=ye<0:$=ye>0}var ke=w[J+($?-1:0)],Re=$==(ke.level==1),Ve=Re?ke.from:ke.to,tt=Re?"after":"before";return n.ch==Ve&&n.sticky==tt?t:new Pr(new rt(n.line,Ve,tt),r)}function rl(e,t,n,r){var i,w;if(t.touches)i=t.touches[0].clientX,w=t.touches[0].clientY;else try{i=t.clientX,w=t.clientY}catch(ke){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ne(t);var B=e.display,V=B.lineDiv.getBoundingClientRect();if(w>V.bottom||!me(e,n))return de(t);w-=V.top-B.viewOffset;for(var J=0;J<e.display.gutterSpecs.length;++J){var $=B.gutters.childNodes[J];if($&&$.getBoundingClientRect().right>=i){var he=Un(e.doc,w),ye=e.display.gutterSpecs[J];return _e(e,n,e,he,ye.className,t),de(t)}}}function ds(e,t){return rl(e,t,"gutterClick",!0)}function nl(e,t){if(Si(e.display,t)||Xl(e,t))return;if(Je(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Xl(e,t){return me(e,"gutterContextMenu")?rl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ar(e)}var Pa={toString:function(){return"CodeMirror.Init"}},al={},Fo={};function Yl(e){var t=e.optionHandlers;function n(r,i,w,B){e.defaults[r]=i,w&&(t[r]=B?function(V,J,$){$!=Pa&&w(V,J,$)}:w)}e.defineOption=n,e.Init=Pa,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Gi(r)},!0),n("indentUnit",2,Gi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){to(r),ar(r),zr(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!i)return;var w=[],B=r.doc.first;r.doc.iter(function(J){for(var $=0;;){var he=J.text.indexOf(i,$);if(he==-1)break;$=he+i.length,w.push(rt(B,he))}B++});for(var V=w.length-1;V>=0;V--)Ma(r.doc,i,w[V],rt(w[V].line,w[V].ch+i.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,w){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),w!=Pa&&r.refresh()}),n("specialCharPlaceholder",Ur,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!v),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){il(r),Ai(r)},!0),n("keyMap","default",function(r,i,w){var B=Bo(i),V=w!=Pa&&Bo(w);V&&V.detach&&V.detach(r,B),B.attach&&B.attach(r,V||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Xn(i,r.options.lineNumbers),Ai(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Fn(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Hi(r)},!0),n("scrollbarStyle","native",function(r){Ca(r),Hi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Xn(r.options.gutters,i),Ai(r)},!0),n("firstLineNumber",1,Ai,!0),n("lineNumberFormatter",function(r){return r},Ai,!0),n("showCursorWhenSelecting",!1,Hr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Zi(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Hr,!0),n("singleCursorHeightPerLine",!0,Hr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,to,!0),n("addModeClass",!1,to,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,to,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Jl(e,t,n){var r=n&&n!=Pa;if(!t!=!r){var i=e.display.dragFunctions,w=t?Ie:$e;w(e.display.scroller,"dragstart",i.start),w(e.display.scroller,"dragenter",i.enter),w(e.display.scroller,"dragover",i.over),w(e.display.scroller,"dragleave",i.leave),w(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(f(e.display.wrapper,"CodeMirror-wrap"),ua(e)),Vn(e),zr(e),ar(e),setTimeout(function(){return Hi(e)},100)}function rn(e,t){var n=this;if(!(this instanceof rn))return new rn(e,t);this.options=t=t?F(t):{},F(al,t,!1);var r=t.value;typeof r=="string"?r=new ti(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new rn.inputStyles[t.inputStyle](this),w=this.display=new ma(e,r,i,t);w.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ca(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 le,keySeq:null,specialChars:null},t.autofocus&&!a&&w.input.focus(),H&&W<11&&setTimeout(function(){return n.display.input.reset(!0)},20),ql(this),Rl(),Ni(this),this.curOp.forceUpdate=!0,vs(this,r),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Pi(n)},20):Zi(this);for(var B in Fo)Fo.hasOwnProperty(B)&&Fo[B](this,t[B],Pa);wn(this),t.finishInit&&t.finishInit(this);for(var V=0;V<cs.length;++V)cs[V](this);Ki(this),_&&t.lineWrapping&&getComputedStyle(w.lineDiv).textRendering=="optimizelegibility"&&(w.lineDiv.style.textRendering="auto")}rn.defaults=al,rn.optionHandlers=Fo;function ql(e){var t=e.display;Ie(t.scroller,"mousedown",gn(e,el)),H&&W<11?Ie(t.scroller,"dblclick",gn(e,function(J){if(Je(e,J))return;var $=An(e,J);if(!$||ds(e,J)||Si(e.display,J))return;ne(J);var he=e.findWordAt($);Lo(e.doc,he.anchor,he.head)})):Ie(t.scroller,"dblclick",function(J){return Je(e,J)||ne(J)}),Ie(t.scroller,"contextmenu",function(J){return nl(e,J)}),Ie(t.input.getField(),"contextmenu",function(J){t.scroller.contains(J.target)||nl(e,J)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function w(J){if(J.touches.length!=1)return!1;var $=J.touches[0];return $.radiusX<=1&&$.radiusY<=1}function B(J,$){if($.left==null)return!0;var he=$.left-J.left,ye=$.top-J.top;return he*he+ye*ye>20*20}Ie(t.scroller,"touchstart",function(J){if(!Je(e,J)&&!w(J)&&!ds(e,J)){t.input.ensurePolled(),clearTimeout(n);var $=+new Date;t.activeTouch={start:$,moved:!1,prev:$-r.end<=300?r:null},J.touches.length==1&&(t.activeTouch.left=J.touches[0].pageX,t.activeTouch.top=J.touches[0].pageY)}}),Ie(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ie(t.scroller,"touchend",function(J){var $=t.activeTouch;if($&&!Si(t,J)&&$.left!=null&&!$.moved&&new Date-$.start<300){var he=e.coordsChar(t.activeTouch,"page"),ye;!$.prev||B($,$.prev)?ye=new Pr(he,he):!$.prev.prev||B($,$.prev.prev)?ye=e.findWordAt(he):ye=new Pr(rt(he.line,0),u(e.doc,rt(he.line+1,0))),e.setSelection(ye.anchor,ye.head),e.focus(),ne(J)}i()}),Ie(t.scroller,"touchcancel",i),Ie(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ea(e,t.scroller.scrollTop),gi(e,t.scroller.scrollLeft,!0),_e(e,"scroll",e))}),Ie(t.scroller,"mousewheel",function(J){return $a(e,J)}),Ie(t.scroller,"DOMMouseScroll",function(J){return $a(e,J)}),Ie(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(J){Je(e,J)||pe(J)},over:function(J){Je(e,J)||(Ol(e,J),pe(J))},start:function(J){return Dl(e,J)},drop:gn(e,wl),leave:function(J){Je(e,J)||Ws(e)}};var V=t.input.getField();Ie(V,"keyup",function(J){return qs.call(e,J)}),Ie(V,"keydown",gn(e,Zs)),Ie(V,"keypress",gn(e,$s)),Ie(V,"focus",function(J){return Pi(e,J)}),Ie(V,"blur",function(J){return Zi(e,J)})}var cs=[];rn.defineInitHook=function(e){return cs.push(e)};function mo(e,t,n,r){var i=e.doc,w;n==null&&(n="add"),n=="smart"&&(i.mode.indent?w=gt(e,t).state:n="prev");var B=e.options.tabSize,V=Lt(i,t),J=re(V.text,null,B);V.stateAfter&&(V.stateAfter=null);var $=V.text.match(/^\s*/)[0],he;if(!r&&!/\S/.test(V.text))he=0,n="not";else if(n=="smart"&&(he=i.mode.indent(w,V.text.slice($.length),V.text),he==Ye||he>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?he=re(Lt(i,t-1).text,null,B):he=0:n=="add"?he=J+e.options.indentUnit:n=="subtract"?he=J-e.options.indentUnit:typeof n=="number"&&(he=J+n),he=Math.max(0,he);var ye="",ke=0;if(e.options.indentWithTabs)for(var Re=Math.floor(he/B);Re;--Re)ke+=B,ye+=" ";if(ke<he&&(ye+=se(he-ke)),ye!=$)return Ma(i,ye,rt(t,0),rt(t,$.length),"+input"),V.stateAfter=null,!0;for(var Ve=0;Ve<i.sel.ranges.length;Ve++){var tt=i.sel.ranges[Ve];if(tt.head.line==t&&tt.head.ch<$.length){var pt=rt(t,$.length);is(i,Ve,new Pr(pt,pt));break}}}var Di=null;function jo(e){Di=e}function hs(e,t,n,r,i){var w=e.doc;e.display.shift=!1,r||(r=w.sel);var B=+new Date-200,V=i=="paste"||e.state.pasteIncoming>B,J=_t(t),$=null;if(V&&r.ranges.length>1)if(Di&&Di.text.join(`
|
|
`)==t){if(r.ranges.length%Di.text.length==0){$=[];for(var he=0;he<Di.text.length;he++)$.push(w.splitLines(Di.text[he]))}}else J.length==r.ranges.length&&e.options.pasteLinesPerSelection&&($=xt(J,function(wt){return[wt]}));for(var ye=e.curOp.updateInput,ke=r.ranges.length-1;ke>=0;ke--){var Re=r.ranges[ke],Ve=Re.from(),tt=Re.to();Re.empty()&&(n&&n>0?Ve=rt(Ve.line,Ve.ch-n):e.state.overwrite&&!V?tt=rt(tt.line,Math.min(Lt(w,tt.line).text.length,tt.ch+ze(J).length)):V&&Di&&Di.lineWise&&Di.text.join(`
|
|
`)==J.join(`
|
|
`)&&(Ve=tt=rt(Ve.line,0)));var pt={from:Ve,to:tt,text:$?$[ke%$.length]:J,origin:i||(V?"paste":e.state.cutIncoming>B?"cut":"+input")};Ra(e.doc,pt),cn(e,"inputRead",e,pt)}t&&!V&&sl(e,t),qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ye),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Qn(t,function(){return hs(t,n,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var w=e.getModeAt(i.head),B=!1;if(w.electricChars){for(var V=0;V<w.electricChars.length;V++)if(t.indexOf(w.electricChars.charAt(V))>-1){B=mo(e,i.head.line,"smart");break}}else w.electricInput&&(w.electricInput.test(Lt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(B=mo(e,i.head.line,"smart")));B&&cn(e,"electricInput",e,i.head.line)}}function ll(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,w={anchor:rt(i,0),head:rt(i+1,0)};n.push(w),t.push(e.getRange(w.anchor,w.head))}return{text:t,ranges:n}}function ul(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=o("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=o("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return _?e.style.width="1000px":e.setAttribute("wrap","off"),x&&(e.style.border="1px solid black"),ul(e),t}function $l(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var w=this.options,B=w[r];if(w[r]==i&&r!="mode")return;w[r]=i,t.hasOwnProperty(r)&&gn(this,t[r])(this,i,B),_e(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Bo(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,w=0;w<i.length;++w)if(i[w]==r||i[w].name==r)return i.splice(w,1),!0},addOverlay:Nn(function(r,i){var w=r.token?r:e.getMode(this.options,r);if(w.startState)throw new Error("Overlays may not be stateful.");ct(this.state.overlays,{mode:w,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(B){return B.priority}),this.state.modeGen++,zr(this)}),removeOverlay:Nn(function(r){for(var i=this.state.overlays,w=0;w<i.length;++w){var B=i[w].modeSpec;if(B==r||typeof r=="string"&&B.name==r){i.splice(w,1),this.state.modeGen++,zr(this);return}}}),indentLine:Nn(function(r,i,w){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Kn(this.doc,r)&&mo(this,r,i,w)}),indentSelection:Nn(function(r){for(var i=this.doc.sel.ranges,w=-1,B=0;B<i.length;B++){var V=i[B];if(V.empty())V.head.line>w&&(mo(this,V.head.line,r,!0),w=V.head.line,B==this.doc.sel.primIndex&&qi(this));else{var J=V.from(),$=V.to(),he=Math.max(w,J.line);w=Math.min(this.lastLine(),$.line-($.ch?0:1))+1;for(var ye=he;ye<w;++ye)mo(this,ye,r);var ke=this.doc.sel.ranges;J.ch==0&&i.length==ke.length&&ke[B].from().ch>0&&is(this.doc,B,new Pr(J,ke[B].to()),Pe)}}}),getTokenAt:function(r,i){return Nr(this,r,i)},getLineTokens:function(r,i){return Nr(this,rt(r),i,!0)},getTokenTypeAt:function(r){r=u(this.doc,r);var i=Xe(this,Lt(this.doc,r.line)),w=0,B=(i.length-1)/2,V=r.ch,J;if(V==0)J=i[2];else for(;;){var $=w+B>>1;if(($?i[$*2-1]:0)>=V)B=$;else if(i[$*2+1]<V)w=$+1;else{J=i[$*2+2];break}}var he=J?J.indexOf("overlay "):-1;return he<0?J:he==0?null:J.slice(0,he-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var w=[];if(!n.hasOwnProperty(i))return w;var B=n[i],V=this.getModeAt(r);if(typeof V[i]=="string")B[V[i]]&&w.push(B[V[i]]);else if(V[i])for(var J=0;J<V[i].length;J++){var $=B[V[i][J]];$&&w.push($)}else V.helperType&&B[V.helperType]?w.push(B[V.helperType]):B[V.name]&&w.push(B[V.name]);for(var he=0;he<B._global.length;he++){var ye=B._global[he];ye.pred(V,this)&&Ee(w,ye.val)==-1&&w.push(ye.val)}return w},getStateAfter:function(r,i){var w=this.doc;return r=j(w,r==null?w.first+w.size-1:r),gt(this,r+1,i).state},cursorCoords:function(r,i){var w,B=this.doc.sel.primary();return r==null?w=B.head:typeof r=="object"?w=u(this.doc,r):w=r?B.from():B.to(),gr(this,w,i||"page")},charCoords:function(r,i){return Yr(this,u(this.doc,r),i||"page")},coordsChar:function(r,i){return r=mr(this,r,i||"page"),vr(this,r.left,r.top)},lineAtHeight:function(r,i){return r=mr(this,{top:r,left:0},i||"page").top,Un(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,w){var B=!1,V;if(typeof r=="number"){var J=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>J&&(r=J,B=!0),V=Lt(this.doc,r)}else V=r;return Ar(this,V,{top:0,left:0},i||"page",w||B).top+(B?this.doc.height-li(V):0)},defaultTextHeight:function(){return hn(this.display)},defaultCharWidth:function(){return Sn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,w,B,V){var J=this.display;r=gr(this,u(this.doc,r));var $=r.bottom,he=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),J.sizer.appendChild(i),B=="over")$=r.top;else if(B=="above"||B=="near"){var ye=Math.max(J.wrapper.clientHeight,this.doc.height),ke=Math.max(J.sizer.clientWidth,J.lineSpace.clientWidth);(B=="above"||r.bottom+i.offsetHeight>ye)&&r.top>i.offsetHeight?$=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=ye&&($=r.bottom),he+i.offsetWidth>ke&&(he=ke-i.offsetWidth)}i.style.top=$+"px",i.style.left=i.style.right="",V=="right"?(he=J.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(V=="left"?he=0:V=="middle"&&(he=(J.sizer.clientWidth-i.offsetWidth)/2),i.style.left=he+"px"),w&&Co(this,{left:he,top:$,right:he+i.offsetWidth,bottom:$+i.offsetHeight})},triggerOnKeyDown:Nn(Zs),triggerOnKeyPress:Nn($s),triggerOnKeyUp:qs,triggerOnMouseDown:Nn(el),execCommand:function(r){if(co.hasOwnProperty(r))return co[r].call(null,this)},triggerElectric:Nn(function(r){sl(this,r)}),findPosH:function(r,i,w,B){var V=1;i<0&&(V=-1,i=-i);for(var J=u(this.doc,r),$=0;$<i&&!(J=fs(this.doc,J,V,w,B),J.hitSide);++$);return J},moveH:Nn(function(r,i){var w=this;this.extendSelectionsBy(function(B){return w.display.shift||w.doc.extend||B.empty()?fs(w.doc,B.head,r,i,w.options.rtlMoveVisually):r<0?B.from():B.to()},Ue)}),deleteH:Nn(function(r,i){var w=this.doc.sel,B=this.doc;w.somethingSelected()?B.replaceSelection("",null,"+delete"):Ia(this,function(V){var J=fs(B,V.head,r,i,!1);return r<0?{from:J,to:V.head}:{from:V.head,to:J}})}),findPosV:function(r,i,w,B){var V=1,J=B;i<0&&(V=-1,i=-i);for(var $=u(this.doc,r),he=0;he<i;++he){var ye=gr(this,$,"div");if(J==null?J=ye.left:ye.left=J,$=cl(this,ye,V,w),$.hitSide)break}return $},moveV:Nn(function(r,i){var w=this,B=this.doc,V=[],J=!this.display.shift&&!B.extend&&B.sel.somethingSelected();if(B.extendSelectionsBy(function(he){if(J)return r<0?he.from():he.to();var ye=gr(w,he.head,"div");he.goalColumn!=null&&(ye.left=he.goalColumn),V.push(ye.left);var ke=cl(w,ye,r,i);return i=="page"&&he==B.sel.primary()&&Xa(w,Yr(w,ke,"div").top-ye.top),ke},Ue),V.length)for(var $=0;$<B.sel.ranges.length;$++)B.sel.ranges[$].goalColumn=V[$]}),findWordAt:function(r){var i=this.doc,w=Lt(i,r.line).text,B=r.ch,V=r.ch;if(w){var J=this.getHelper(r,"wordChars");(r.sticky=="before"||V==w.length)&&B?--B:++V;for(var $=w.charAt(B),he=ut($,J)?function(ye){return ut(ye,J)}:/\s/.test($)?function(ye){return/\s/.test(ye)}:function(ye){return!/\s/.test(ye)&&!ut(ye)};B>0&&he(w.charAt(B-1));)--B;for(;V<w.length&&he(w.charAt(V));)++V}return new Pr(rt(r.line,B),rt(r.line,V))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):f(this.display.cursorDiv,"CodeMirror-overwrite"),_e(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Nn(function(r,i){$i(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-we(this)-this.display.barHeight,width:r.scrollWidth-we(this)-this.display.barWidth,clientHeight:q(this),clientWidth:ce(this)}},scrollIntoView:Nn(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:rt(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Yo(this,r):ca(this,r.from,r.to,r.margin)}),setSize:Nn(function(r,i){var w=this,B=function(J){return typeof J=="number"||/^\d+$/.test(String(J))?J+"px":J};r!=null&&(this.display.wrapper.style.width=B(r)),i!=null&&(this.display.wrapper.style.height=B(i)),this.options.lineWrapping&&rr(this);var V=this.display.viewFrom;this.doc.iter(V,this.display.viewTo,function(J){if(J.widgets){for(var $=0;$<J.widgets.length;$++)if(J.widgets[$].noHScroll){tn(w,V,"widget");break}}++V}),this.curOp.forceUpdate=!0,_e(this,"refresh",this)}),operation:function(r){return Qn(this,r)},startOperation:function(){return Ni(this)},endOperation:function(){return Ki(this)},refresh:Nn(function(){var r=this.display.cachedTextHeight;zr(this),this.curOp.forceUpdate=!0,ar(this),$i(this,this.doc.scrollLeft,this.doc.scrollTop),Aa(this.display),(r==null||Math.abs(r-hn(this.display))>.5||this.options.lineWrapping)&&Vn(this),_e(this,"refresh",this)}),swapDoc:Nn(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,r),ar(this),this.display.input.reset(),$i(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,cn(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},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}},ve(e),e.registerHelper=function(r,i,w){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=w},e.registerGlobalHelper=function(r,i,w,B){e.registerHelper(r,i,B),n[r]._global.push({pred:w,val:B})}}function fs(e,t,n,r,i){var w=t,B=n,V=Lt(e,t.line),J=i&&e.direction=="rtl"?-n:n;function $(){var kt=t.line+J;return kt<e.first||kt>=e.first+e.size?!1:(t=new rt(kt,t.ch,t.sticky),V=Lt(e,kt))}function he(kt){var Dt;if(r=="codepoint"){var Pt=V.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Pt)?Dt=null:Dt=new rt(t.line,Math.max(0,Math.min(V.text.length,t.ch+n*(Pt>=55296&&Pt<56320?2:1))),-n)}else i?Dt=Pl(e.cm,V,t,n):Dt=os(V,t,n);if(Dt==null)if(!kt&&$())t=ss(i,e.cm,V,t.line,J);else return!1;else t=Dt;return!0}if(r=="char"||r=="codepoint")he();else if(r=="column")he(!0);else if(r=="word"||r=="group")for(var ye=null,ke=r=="group",Re=e.cm&&e.cm.getHelper(t,"wordChars"),Ve=!0;!(n<0&&!he(!Ve));Ve=!1){var tt=V.text.charAt(t.ch)||`
|
|
`,pt=ut(tt,Re)?"w":ke&&tt==`
|
|
`?"n":!ke||/\s/.test(tt)?null:"p";if(ke&&!Ve&&!pt&&(pt="s"),ye&&ye!=pt){n<0&&(n=1,he(),t.sticky="after");break}if(pt&&(ye=pt),n>0&&!he(!Ve))break}var wt=Po(e,t,w,B,!0);return zn(w,wt)&&(wt.hitSide=!0),wt}function cl(e,t,n,r){var i=e.doc,w=t.left,B;if(r=="page"){var V=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),J=Math.max(V-.5*hn(e.display),3);B=(n>0?t.bottom:t.top)+n*J}else r=="line"&&(B=n>0?t.bottom+3:t.top-3);for(var $;!($=vr(e,w,B),!$.outside);){if(n<0?B<=0:B>=i.height){$.hitSide=!0;break}B+=n*5}return $}var Gr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new le,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Gr.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;ul(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function w(V){for(var J=V.target;J;J=J.parentNode){if(J==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(J.className))break}return!1}Ie(i,"paste",function(V){if(!w(V)||Je(r,V)||ol(V,r))return;W<=11&&setTimeout(gn(r,function(){return t.updateFromDOM()}),20)}),Ie(i,"compositionstart",function(V){t.composing={data:V.data,done:!1}}),Ie(i,"compositionupdate",function(V){t.composing||(t.composing={data:V.data,done:!1})}),Ie(i,"compositionend",function(V){t.composing&&(V.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ie(i,"touchstart",function(){return n.forceCompositionEnd()}),Ie(i,"input",function(){t.composing||t.readFromDOMSoon()});function B(V){if(!w(V)||Je(r,V))return;if(r.somethingSelected())jo({lineWise:!1,text:r.getSelections()}),V.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var J=ll(r);jo({lineWise:!0,text:J.text}),V.type=="cut"&&r.operation(function(){r.setSelections(J.ranges,0,Pe),r.replaceSelection("",null,"cut")})}else return;if(V.clipboardData){V.clipboardData.clearData();var $=Di.text.join(`
|
|
`);if(V.clipboardData.setData("Text",$),V.clipboardData.getData("Text")==$){V.preventDefault();return}}var he=dl(),ye=he.firstChild;r.display.lineSpace.insertBefore(he,r.display.lineSpace.firstChild),ye.value=Di.text.join(`
|
|
`);var ke=document.activeElement;te(ye),setTimeout(function(){r.display.lineSpace.removeChild(he),ke.focus(),ke==i&&n.showPrimarySelection()},50)}Ie(i,"copy",B),Ie(i,"cut",B)},Gr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Gr.prototype.prepareSelection=function(){var e=xi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Gr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Gr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Gr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var w=Wo(t,e.anchorNode,e.anchorOffset),B=Wo(t,e.focusNode,e.focusOffset);if(w&&!w.bad&&B&&!B.bad&&Wt(oi(w,B),r)==0&&Wt(bi(w,B),i)==0)return;var V=t.display.view,J=r.line>=t.display.viewFrom&&hl(t,r)||{node:V[0].measure.map[2],offset:0},$=i.line<t.display.viewTo&&hl(t,i);if(!$){var he=V[V.length-1].measure,ye=he.maps?he.maps[he.maps.length-1]:he.map;$={node:ye[ye.length-1],offset:ye[ye.length-2]-ye[ye.length-3]}}if(!J||!$){e.removeAllRanges();return}var ke=e.rangeCount&&e.getRangeAt(0),Re;try{Re=b(J.node,J.offset,$.offset,$.node)}catch(Ve){}Re&&(!M&&t.state.focused?(e.collapse(J.node,J.offset),Re.collapsed||(e.removeAllRanges(),e.addRange(Re))):(e.removeAllRanges(),e.addRange(Re)),ke&&e.anchorNode==null?e.addRange(ke):M&&this.startGracePeriod()),this.rememberSelection()},Gr.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Gr.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},Gr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Gr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return T(this.div,t)},Gr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Gr.prototype.blur=function(){this.div.blur()},Gr.prototype.getField=function(){return this.div},Gr.prototype.supportsTouch=function(){return!0},Gr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Qn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Gr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Gr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(d&&y&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var n=Wo(t,e.anchorNode,e.anchorOffset),r=Wo(t,e.focusNode,e.focusOffset);n&&r&&Qn(t,function(){jn(t.doc,Ti(n,r),Pe),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Gr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=rt(r.line-1,Lt(e.doc,r.line-1).length)),i.ch==Lt(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=rt(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var w,B,V;r.line==t.viewFrom||(w=Qr(e,r.line))==0?(B=ir(t.view[0].line),V=t.view[0].node):(B=ir(t.view[w].line),V=t.view[w-1].node.nextSibling);var J=Qr(e,i.line),$,he;if(J==t.view.length-1?($=t.viewTo-1,he=t.lineDiv.lastChild):($=ir(t.view[J+1].line)-1,he=t.view[J+1].node.previousSibling),!V)return!1;for(var ye=e.doc.splitLines(tu(e,V,he,B,$)),ke=Hn(e.doc,rt(B,0),rt($,Lt(e.doc,$).text.length));ye.length>1&&ke.length>1;)if(ze(ye)==ze(ke))ye.pop(),ke.pop(),$--;else if(ye[0]==ke[0])ye.shift(),ke.shift(),B++;else break;for(var Re=0,Ve=0,tt=ye[0],pt=ke[0],wt=Math.min(tt.length,pt.length);Re<wt&&tt.charCodeAt(Re)==pt.charCodeAt(Re);)++Re;for(var kt=ze(ye),Dt=ze(ke),Pt=Math.min(kt.length-(ye.length==1?Re:0),Dt.length-(ke.length==1?Re:0));Ve<Pt&&kt.charCodeAt(kt.length-Ve-1)==Dt.charCodeAt(Dt.length-Ve-1);)++Ve;if(ye.length==1&&ke.length==1&&B==r.line)for(;Re&&Re>r.ch&&kt.charCodeAt(kt.length-Ve-1)==Dt.charCodeAt(Dt.length-Ve-1);)Re--,Ve++;ye[ye.length-1]=kt.slice(0,kt.length-Ve).replace(/^\u200b+/,""),ye[0]=ye[0].slice(Re).replace(/\u200b+$/,"");var Yt=rt(B,Re),Gt=rt($,ke.length?ze(ke).length-Ve:0);if(ye.length>1||ye[0]||Wt(Yt,Gt))return Ma(e.doc,ye,Yt,Gt,"+input"),!0},Gr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Gr.prototype.reset=function(){this.forceCompositionEnd()},Gr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Gr.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Gr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Qn(this.cm,function(){return zr(e.cm)})},Gr.prototype.setUneditable=function(e){e.contentEditable="false"},Gr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||gn(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Gr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Gr.prototype.onContextMenu=function(){},Gr.prototype.resetPosition=function(){},Gr.prototype.needsContentAttribute=!0;function hl(e,t){var n=De(e,t.line);if(!n||n.hidden)return null;var r=Lt(e.doc,t.line),i=ee(n,r,t.line),w=dt(r,e.doc.direction),B="left";if(w){var V=lt(w,t.ch);B=V%2?"right":"left"}var J=st(i.map,t.ch,B);return J.offset=J.collapse=="right"?J.end:J.start,J}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function _a(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,i){var w="",B=!1,V=e.doc.lineSeparator(),J=!1;function $(Re){return function(Ve){return Ve.id==Re}}function he(){B&&(w+=V,J&&(w+=V),B=J=!1)}function ye(Re){Re&&(he(),w+=Re)}function ke(Re){if(Re.nodeType==1){var Ve=Re.getAttribute("cm-text");if(Ve){ye(Ve);return}var tt=Re.getAttribute("cm-marker"),pt;if(tt){var wt=e.findMarks(rt(r,0),rt(i+1,0),$(+tt));wt.length&&(pt=wt[0].find(0))&&ye(Hn(e.doc,pt.from,pt.to).join(V));return}if(Re.getAttribute("contenteditable")=="false")return;var kt=/^(pre|div|p|li|table|br)$/i.test(Re.nodeName);if(!/^br$/i.test(Re.nodeName)&&Re.textContent.length==0)return;kt&&he();for(var Dt=0;Dt<Re.childNodes.length;Dt++)ke(Re.childNodes[Dt]);/^(pre|p)$/i.test(Re.nodeName)&&(J=!0),kt&&(B=!0)}else Re.nodeType==3&&ye(Re.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ke(t),t==n);)t=t.nextSibling,J=!1;return w}function Wo(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return _a(e.clipPos(rt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var w=e.display.view[i];if(w.node==r)return ru(w,t,n)}}function ru(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!T(r,t))return _a(rt(ir(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var w=e.rest?ze(e.rest):e.line;return _a(rt(ir(w),w.text.length),i)}var B=t.nodeType==3?t:null,V=t;for(!B&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(B=t.firstChild,n&&(n=B.nodeValue.length));V.parentNode!=r;)V=V.parentNode;var J=e.measure,$=J.maps;function he(pt,wt,kt){for(var Dt=-1;Dt<($?$.length:0);Dt++)for(var Pt=Dt<0?J.map:$[Dt],Yt=0;Yt<Pt.length;Yt+=3){var Gt=Pt[Yt+2];if(Gt==pt||Gt==wt){var fr=ir(Dt<0?e.line:e.rest[Dt]),Xr=Pt[Yt]+kt;return(kt<0||Gt!=pt)&&(Xr=Pt[Yt+(kt?1:0)]),rt(fr,Xr)}}}var ye=he(B,V,n);if(ye)return _a(ye,i);for(var ke=V.nextSibling,Re=B?B.nodeValue.length-n:0;ke;ke=ke.nextSibling){if(ye=he(ke,ke.firstChild,0),ye)return _a(rt(ye.line,ye.ch-Re),i);Re+=ke.textContent.length}for(var Ve=V.previousSibling,tt=n;Ve;Ve=Ve.previousSibling){if(ye=he(Ve,Ve.firstChild,-1),ye)return _a(rt(ye.line,ye.ch+tt),i);tt+=Ve.textContent.length}}var yn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new le,this.hasSelection=!1,this.composing=null};yn.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),x&&(i.style.width="0px"),Ie(i,"input",function(){H&&W>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Ie(i,"paste",function(B){if(Je(r,B)||ol(B,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function w(B){if(Je(r,B))return;if(r.somethingSelected())jo({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var V=ll(r);jo({lineWise:!0,text:V.text}),B.type=="cut"?r.setSelections(V.ranges,null,Pe):(n.prevInput="",i.value=V.text.join(`
|
|
`),te(i))}else return;B.type=="cut"&&(r.state.cutIncoming=+new Date)}Ie(i,"cut",w),Ie(i,"copy",w),Ie(e.scroller,"paste",function(B){if(Si(e,B)||Je(r,B))return;if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var V=new Event("paste");V.clipboardData=B.clipboardData,i.dispatchEvent(V)}),Ie(e.lineSpace,"selectstart",function(B){Si(e,B)||ne(B)}),Ie(i,"compositionstart",function(){var B=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:B,range:r.markText(B,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},yn.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},yn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},yn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=xi(e);if(e.options.moveInputWithCursor){var i=gr(e,n.sel.primary().head,"div"),w=t.wrapper.getBoundingClientRect(),B=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+B.top-w.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+B.left-w.left))}return r},yn.prototype.showSelection=function(e){var t=this.cm,n=t.display;h(n.cursorDiv,e.cursors),h(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},yn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&te(this.textarea),H&&W>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",H&&W>=9&&(this.hasSelection=null))},yn.prototype.getField=function(){return this.textarea},yn.prototype.supportsTouch=function(){return!1},yn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},yn.prototype.blur=function(){this.textarea.blur()},yn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},yn.prototype.receivedFocus=function(){this.slowPoll()},yn.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},yn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},yn.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||ot(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(H&&W>=9&&this.hasSelection===i||l&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var w=i.charCodeAt(0);if(w==8203&&!r&&(r="\u200B"),w==8666)return this.reset(),this.cm.execCommand("undo")}for(var B=0,V=Math.min(r.length,i.length);B<V&&r.charCodeAt(B)==i.charCodeAt(B);)++B;return Qn(t,function(){hs(t,i.slice(B),r.length-B,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},yn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},yn.prototype.onKeyPress=function(){H&&W>=9&&(this.hasSelection=null),this.fastPoll()},yn.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var w=An(n,e),B=r.scroller.scrollTop;if(!w||C)return;var V=n.options.resetSelectionOnContextMenu;V&&n.doc.sel.contains(w)==-1&&gn(n,jn)(n.doc,Ti(w),Pe);var J=i.style.cssText,$=t.wrapper.style.cssText,he=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-he.top-5)+"px; left: "+(e.clientX-he.left-5)+`px;
|
|
z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ye;_&&(ye=window.scrollY),r.input.focus(),_&&window.scrollTo(null,ye),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Re,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function ke(){if(i.selectionStart!=null){var tt=n.somethingSelected(),pt="\u200B"+(tt?i.value:"");i.value="\u21DA",i.value=pt,t.prevInput=tt?"":"\u200B",i.selectionStart=1,i.selectionEnd=pt.length,r.selForContextMenu=n.doc.sel}}function Re(){if(t.contextMenuPending!=Re)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=$,i.style.cssText=J,H&&W<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=B),i.selectionStart!=null){(!H||H&&W<9)&&ke();var tt=0,pt=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?gn(n,Ms)(n):tt++<10?r.detectingSelectAll=setTimeout(pt,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(pt,200)}}if(H&&W>=9&&ke(),R){pe(e);var Ve=function(){$e(window,"mouseup",Ve),setTimeout(Re,20)};Ie(window,"mouseup",Ve)}else setTimeout(Re,50)},yn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},yn.prototype.setUneditable=function(){},yn.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?F(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=N();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=V.getValue()}var i;if(e.form&&(Ie(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var w=e.form;i=w.submit;try{var B=w.submit=function(){r(),w.submit=i,w.submit(),w.submit=B}}catch(J){}}t.finishInit=function(J){J.save=r,J.getTextArea=function(){return e},J.toTextArea=function(){J.toTextArea=isNaN,r(),e.parentNode.removeChild(J.getWrapperElement()),e.style.display="",e.form&&($e(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var V=rn(function(J){return e.parentNode.insertBefore(J,e.nextSibling)},t);return V}function iu(e){e.off=$e,e.on=Ie,e.wheelEventPixels=qa,e.Doc=ti,e.splitLines=_t,e.countColumn=re,e.findColumn=Ne,e.isWordChar=Ke,e.Pass=Ye,e.signal=_e,e.Line=ji,e.changeEnd=wi,e.scrollbarModel=Ya,e.Pos=rt,e.cmpPos=Wt,e.modes=nr,e.mimeModes=Ot,e.resolveMode=it,e.getMode=lr,e.modeExtensions=nt,e.extendMode=yr,e.copyState=Lr,e.startState=pn,e.innerMode=jr,e.commands=co,e.keyMap=Vi,e.keyName=Vs,e.isModifierKey=zs,e.lookupKey=La,e.normalizeKeyMap=Il,e.StringStream=br,e.SharedTextMarker=so,e.TextMarker=ia,e.LineWidget=oo,e.e_preventDefault=ne,e.e_stopPropagation=ie,e.e_stop=pe,e.addClass=z,e.contains=T,e.rmClass=f,e.keyNames=aa}Yl(rn),$l(rn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ho in ti.prototype)ti.prototype.hasOwnProperty(Ho)&&Ee(au,Ho)<0&&(rn.prototype[Ho]=function(e){return function(){return e.apply(this.doc,arguments)}}(ti.prototype[Ho]));return ve(ti),rn.inputStyles={textarea:yn,contenteditable:Gr},rn.defineMode=function(e){!rn.defaults.mode&&e!="null"&&(rn.defaults.mode=e),xr.apply(this,arguments)},rn.defineMIME=$t,rn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),rn.defineMIME("text/plain","null"),rn.defineExtension=function(e,t){rn.prototype[e]=t},rn.defineDocExtension=function(e,t){ti.prototype[e]=t},rn.fromTextArea=nu,iu(rn),rn.version="5.58.2",rn})},W6BS:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAVs0lEQVRoQ+2aa6xlZ3nff++677Xv+9zPHM/YHo+xwQ4E14GKKESkiFsSM8bYQBIEkaBEAkqbRmo/9FulSoX2Qz9GVVQJqUJBhKKA1KRJCIlowwdDDDa+jOd65syc275f1v1d1fOufYYE2ZhJZKRWXjOjvffaa6/1/p//8/yfyzuqLMu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y9+y62trbwPO/WbuHf3z7TmvlcLDVmMBgwHIwYjSbMJ3Nm0ZxI5p3JjHk6RkbCgVfDsgN8ArP3N5juM5jdJD26xrOjq9TzCcfzkGYYcXrrbTz6xDs5OrrMeHzIjck+2eiA65OYdrjOPace5NzOw/hO10zW5ZDm27VDUxdLnMtwOctSk+NqtYDNzU3W1tfpdbvm2pc6bgE0u7IvsRUs56M4Yj6dmfJrOhwyGE8YjkaMxkNmszlpLDGbkeUx02RAlC2Y5UeUSZ+pdYyaz1k4Y9OdhE4D5dVoB6dZWbuLlneaXm2DPC1NR5BGCbF0CWVJEAQ0GnXanTb1sE69Xmdzc4uNjQ1ardZy4+dlN3fNF6+4R/9SP5eHJ0nMYhEh8TscDun3+0aoJuMJi8WCJMnRZgRZkJOR5FMKvWBz/QyN2gqqsEjTBE1q7iU5znZsfN83i2+32zSbTXq9HisrK6yurtJoNH4ympf49rYAvhzL1b5JSZqmZqGTyZT+4Jj+cd+4+mg4Yh7F5Kk0xqK4Jb7rVP87w1KGpU6nR6vVNMAEkPzrdDqGxX/McVsAb/dBsh0mKWgxnzMajxgOhhwf9+n3j5nNZ7RbbbrdrgElYE5Aua57u4962etfNYAvx7YISJIkxrXFxdvtlnFJW+Yiy+MnecrtIn/VAN7uQl6t618D+GpZ9md139cY/FlZ+tV6zmsMvlqW/Vnd9/8CAe3hZpCQX/4AAAAASUVORK5CYII="},WXWZ:function(Ge,Fe,Q){Ge.exports={wrap:"wrap___2531V",modal:"modal___2xp2g",titleWrap:"titleWrap___2wAWv",required:"required___1bxIH",title:"title___1z-An",colorGray:"colorGray___2WTHC",choiceWrap:"choiceWrap___138fi",answer:"answer___3tvn_",activeAnswer:"activeAnswer___2tZlb",deleteIcon:"deleteIcon___3kRsA",addIcon:"addIcon___fCAgt",editorWrap:"editorWrap___2bMGJ",htmlWrap:"htmlWrap___172le",radio:"radio___3dYD3",color333:"color333___kjbnX",color999:"color999___23KyG",fold:"fold___mk6fa",head:"head___2zxz9"}},Xsq0:function(Ge,Fe,Q){Ge.exports=Q.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(Ge,Fe,Q){"use strict";Q.r(Fe),Q.d(Fe,"ResizableTextArea",function(){return Ee});var ae=Q("wx14"),X=Q("1OyB"),M=Q("vuIU"),K=Q("Ji7U"),D=Q("LK+K"),P=Q("q1tI"),H=Q("VTBJ"),W=Q("rePB"),_=Q("Zm9Q"),L=Q("Kwbf"),y=Q("c+Xe"),C=Q("m+aA"),k=Q("bdgK"),O=new Map;function A(Pe){Pe.forEach(function(Be){var Ue,Ne=Be.target;(Ue=O.get(Ne))===null||Ue===void 0||Ue.forEach(function(Te){return Te(Ne)})})}var x=new k.default(A),d=null,a=null;function l(Pe,Be){O.has(Pe)||(O.set(Pe,new Set),x.observe(Pe)),O.get(Pe).add(Be)}function s(Pe,Be){O.has(Pe)&&(O.get(Pe).delete(Be),O.get(Pe).size||(x.unobserve(Pe),O.delete(Pe)))}var v=function(Pe){Object(K.a)(Ue,Pe);var Be=Object(D.a)(Ue);function Ue(){return Object(X.a)(this,Ue),Be.apply(this,arguments)}return Object(M.a)(Ue,[{key:"render",value:function(){return this.props.children}}]),Ue}(P.Component),c=P.createContext(null);function m(Pe){var Be=Pe.children,Ue=Pe.onBatchResize,Ne=P.useRef(0),Te=P.useRef([]),se=P.useContext(c),ze=P.useCallback(function(xt,ct,ft){Ne.current+=1;var Ct=Ne.current;Te.current.push({size:xt,element:ct,data:ft}),Promise.resolve().then(function(){Ct===Ne.current&&(Ue==null||Ue(Te.current),Te.current=[])}),se==null||se(xt,ct,ft)},[Ue,se]);return P.createElement(c.Provider,{value:ze},Be)}function R(Pe){var Be=Pe.children,Ue=Pe.disabled,Ne=P.useRef(null),Te=P.useRef(null),se=P.useContext(c),ze=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),xt=P.isValidElement(Be)&&Object(y.c)(Be),ct=xt?Be.ref:null,ft=P.useMemo(function(){return Object(y.a)(ct,Ne)},[ct,Ne]),Ct=P.useRef(Pe);Ct.current=Pe;var He=P.useCallback(function(Ke){var ut=Ct.current,vt=ut.onResize,ht=ut.data,et=Ke.getBoundingClientRect(),Ze=et.width,Tt=et.height,bt=Ke.offsetWidth,St=Ke.offsetHeight,lt=Math.floor(Ze),yt=Math.floor(Tt);if(ze.current.width!==lt||ze.current.height!==yt||ze.current.offsetWidth!==bt||ze.current.offsetHeight!==St){var dt={width:lt,height:yt,offsetWidth:bt,offsetHeight:St};ze.current=dt;var Qe=bt===Math.round(Ze)?Ze:bt,Ie=St===Math.round(Tt)?Tt:St,Et=Object(H.a)(Object(H.a)({},dt),{},{offsetWidth:Qe,offsetHeight:Ie});se==null||se(Et,Ke,ht),vt&&Promise.resolve().then(function(){vt(Et,Ke)})}},[]);return P.useEffect(function(){var Ke=Object(C.a)(Ne.current)||Object(C.a)(Te.current);return Ke&&!Ue&&l(Ke,He),function(){return s(Ke,He)}},[Ne.current,Ue]),P.createElement(v,{ref:Te},xt?P.cloneElement(Be,{ref:ft}):Be)}var E="rc-observer-key";function f(Pe){var Be=Pe.children,Ue=Object(_.a)(Be);return Ue.map(function(Ne,Te){var se=(Ne==null?void 0:Ne.key)||"".concat(E,"-").concat(Te);return P.createElement(R,Object(ae.a)({},Pe,{key:se}),Ne)})}f.Collection=m;var g=f,h=Q("bT9E"),o=Q("TSYQ"),S=Q.n(o),b=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,T=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],N={},z;function Y(Pe){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=Pe.getAttribute("id")||Pe.getAttribute("data-reactid")||Pe.getAttribute("name");if(Be&&N[Ue])return N[Ue];var Ne=window.getComputedStyle(Pe),Te=Ne.getPropertyValue("box-sizing")||Ne.getPropertyValue("-moz-box-sizing")||Ne.getPropertyValue("-webkit-box-sizing"),se=parseFloat(Ne.getPropertyValue("padding-bottom"))+parseFloat(Ne.getPropertyValue("padding-top")),ze=parseFloat(Ne.getPropertyValue("border-bottom-width"))+parseFloat(Ne.getPropertyValue("border-top-width")),xt=T.map(function(ft){return"".concat(ft,":").concat(Ne.getPropertyValue(ft))}).join(";"),ct={sizingStyle:xt,paddingSize:se,borderSize:ze,boxSizing:Te};return Be&&Ue&&(N[Ue]=ct),ct}function te(Pe){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ne=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;z||(z=document.createElement("textarea"),z.setAttribute("tab-index","-1"),z.setAttribute("aria-hidden","true"),document.body.appendChild(z)),Pe.getAttribute("wrap")?z.setAttribute("wrap",Pe.getAttribute("wrap")):z.removeAttribute("wrap");var Te=Y(Pe,Be),se=Te.paddingSize,ze=Te.borderSize,xt=Te.boxSizing,ct=Te.sizingStyle;z.setAttribute("style","".concat(ct,";").concat(b)),z.value=Pe.value||Pe.placeholder||"";var ft=Number.MIN_SAFE_INTEGER,Ct=Number.MAX_SAFE_INTEGER,He=z.scrollHeight,Ke;if(xt==="border-box"?He+=ze:xt==="content-box"&&(He-=se),Ue!==null||Ne!==null){z.value=" ";var ut=z.scrollHeight-se;Ue!==null&&(ft=ut*Ue,xt==="border-box"&&(ft=ft+se+ze),He=Math.max(ft,He)),Ne!==null&&(Ct=ut*Ne,xt==="border-box"&&(Ct=Ct+se+ze),Ke=He>Ct?"":"hidden",He=Math.min(Ct,He))}return{height:He,minHeight:ft,maxHeight:Ct,overflowY:Ke,resize:"none"}}var G=Q("Gytx"),F=Q.n(G),re;(function(Pe){Pe[Pe.NONE=0]="NONE",Pe[Pe.RESIZING=1]="RESIZING",Pe[Pe.RESIZED=2]="RESIZED"})(re||(re={}));var le=function(Pe){Object(K.a)(Ue,Pe);var Be=Object(D.a)(Ue);function Ue(Ne){var Te;return Object(X.a)(this,Ue),Te=Be.call(this,Ne),Te.nextFrameActionId=void 0,Te.resizeFrameId=void 0,Te.textArea=void 0,Te.saveTextArea=function(se){Te.textArea=se},Te.handleResize=function(se){var ze=Te.state.resizeStatus,xt=Te.props,ct=xt.autoSize,ft=xt.onResize;if(ze!==re.NONE)return;typeof ft=="function"&&ft(se),ct&&Te.resizeOnNextFrame()},Te.resizeOnNextFrame=function(){cancelAnimationFrame(Te.nextFrameActionId),Te.nextFrameActionId=requestAnimationFrame(Te.resizeTextarea)},Te.resizeTextarea=function(){var se=Te.props.autoSize;if(!se||!Te.textArea)return;var ze=se.minRows,xt=se.maxRows,ct=te(Te.textArea,!1,ze,xt);Te.setState({textareaStyles:ct,resizeStatus:re.RESIZING},function(){cancelAnimationFrame(Te.resizeFrameId),Te.resizeFrameId=requestAnimationFrame(function(){Te.setState({resizeStatus:re.RESIZED},function(){Te.resizeFrameId=requestAnimationFrame(function(){Te.setState({resizeStatus:re.NONE}),Te.fixFirefoxAutoScroll()})})})})},Te.renderTextArea=function(){var se=Te.props,ze=se.prefixCls,xt=ze===void 0?"rc-textarea":ze,ct=se.autoSize,ft=se.onResize,Ct=se.className,He=se.disabled,Ke=Te.state,ut=Ke.textareaStyles,vt=Ke.resizeStatus,ht=Object(h.a)(Te.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),et=S()(xt,Ct,Object(W.a)({},"".concat(xt,"-disabled"),He));"value"in ht&&(ht.value=ht.value||"");var Ze=Object(H.a)(Object(H.a)(Object(H.a)({},Te.props.style),ut),vt===re.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(g,{onResize:Te.handleResize,disabled:!(ct||ft)},P.createElement("textarea",Object(ae.a)({},ht,{className:et,style:Ze,ref:Te.saveTextArea})))},Te.state={textareaStyles:{},resizeStatus:re.NONE},Te}return Object(M.a)(Ue,[{key:"componentDidUpdate",value:function(Te){(Te.value!==this.props.value||!F()(Te.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 Te=this.textArea.selectionStart,se=this.textArea.selectionEnd;this.textArea.setSelectionRange(Te,se)}}catch(ze){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ue}(P.Component),Ee=le,Oe=function(Pe){Object(K.a)(Ue,Pe);var Be=Object(D.a)(Ue);function Ue(Ne){var Te;Object(X.a)(this,Ue),Te=Be.call(this,Ne),Te.resizableTextArea=void 0,Te.focus=function(){Te.resizableTextArea.textArea.focus()},Te.saveTextArea=function(ze){Te.resizableTextArea=ze},Te.handleChange=function(ze){var xt=Te.props.onChange;Te.setValue(ze.target.value,function(){Te.resizableTextArea.resizeTextarea()}),xt&&xt(ze)},Te.handleKeyDown=function(ze){var xt=Te.props,ct=xt.onPressEnter,ft=xt.onKeyDown;ze.keyCode===13&&ct&&ct(ze),ft&&ft(ze)};var se=typeof Ne.value=="undefined"||Ne.value===null?Ne.defaultValue:Ne.value;return Te.state={value:se},Te}return Object(M.a)(Ue,[{key:"setValue",value:function(Te,se){"value"in this.props||this.setState({value:Te},se)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(Ee,Object(ae.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Te){return"value"in Te?{value:Te.value}:null}}]),Ue}(P.Component),Ye=Fe.default=Oe},ZpRC:function(Ge,Fe,Q){"use strict";function ae(y){return typeof y=="object"&&y!=null&&y.nodeType===1}function X(y,C){return(!C||y!=="hidden")&&y!=="visible"&&y!=="clip"}function M(y,C){if(y.clientHeight<y.scrollHeight||y.clientWidth<y.scrollWidth){var k=getComputedStyle(y,null);return X(k.overflowY,C)||X(k.overflowX,C)||function(O){var A=function(x){if(!x.ownerDocument||!x.ownerDocument.defaultView)return null;try{return x.ownerDocument.defaultView.frameElement}catch(d){return null}}(O);return!!A&&(A.clientHeight<O.scrollHeight||A.clientWidth<O.scrollWidth)}(y)}return!1}function K(y,C,k,O,A,x,d,a){return x<y&&d>C||x>y&&d<C?0:x<=y&&a<=k||d>=C&&a>=k?x-y-O:d>C&&a<k||x<y&&a>k?d-C+A:0}var D=function(y,C){var k=window,O=C.scrollMode,A=C.block,x=C.inline,d=C.boundary,a=C.skipOverflowHiddenElements,l=typeof d=="function"?d:function(ut){return ut!==d};if(!ae(y))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,v=[],c=y;ae(c)&&l(c);){if((c=c.parentElement)===s){v.push(c);break}c!=null&&c===document.body&&M(c)&&!M(document.documentElement)||c!=null&&M(c,a)&&v.push(c)}for(var m=k.visualViewport?k.visualViewport.width:innerWidth,R=k.visualViewport?k.visualViewport.height:innerHeight,E=window.scrollX||pageXOffset,f=window.scrollY||pageYOffset,g=y.getBoundingClientRect(),h=g.height,o=g.width,S=g.top,b=g.right,T=g.bottom,N=g.left,z=A==="start"||A==="nearest"?S:A==="end"?T:S+h/2,Y=x==="center"?N+o/2:x==="end"?b:N,te=[],G=0;G<v.length;G++){var F=v[G],re=F.getBoundingClientRect(),le=re.height,Ee=re.width,Oe=re.top,Ye=re.right,Pe=re.bottom,Be=re.left;if(O==="if-needed"&&S>=0&&N>=0&&T<=R&&b<=m&&S>=Oe&&T<=Pe&&N>=Be&&b<=Ye)return te;var Ue=getComputedStyle(F),Ne=parseInt(Ue.borderLeftWidth,10),Te=parseInt(Ue.borderTopWidth,10),se=parseInt(Ue.borderRightWidth,10),ze=parseInt(Ue.borderBottomWidth,10),xt=0,ct=0,ft="offsetWidth"in F?F.offsetWidth-F.clientWidth-Ne-se:0,Ct="offsetHeight"in F?F.offsetHeight-F.clientHeight-Te-ze:0;if(s===F)xt=A==="start"?z:A==="end"?z-R:A==="nearest"?K(f,f+R,R,Te,ze,f+z,f+z+h,h):z-R/2,ct=x==="start"?Y:x==="center"?Y-m/2:x==="end"?Y-m:K(E,E+m,m,Ne,se,E+Y,E+Y+o,o),xt=Math.max(0,xt+f),ct=Math.max(0,ct+E);else{xt=A==="start"?z-Oe-Te:A==="end"?z-Pe+ze+Ct:A==="nearest"?K(Oe,Pe,le,Te,ze+Ct,z,z+h,h):z-(Oe+le/2)+Ct/2,ct=x==="start"?Y-Be-Ne:x==="center"?Y-(Be+Ee/2)+ft/2:x==="end"?Y-Ye+se+ft:K(Be,Ye,Ee,Ne,se+ft,Y,Y+o,o);var He=F.scrollLeft,Ke=F.scrollTop;z+=Ke-(xt=Math.max(0,Math.min(Ke+xt,F.scrollHeight-le+Ct))),Y+=He-(ct=Math.max(0,Math.min(He+ct,F.scrollWidth-Ee+ft)))}te.push({el:F,top:xt,left:ct})}return te};function P(y){return y===Object(y)&&Object.keys(y).length!==0}function H(y,C){C===void 0&&(C="auto");var k="scrollBehavior"in document.body.style;y.forEach(function(O){var A=O.el,x=O.top,d=O.left;A.scroll&&k?A.scroll({top:x,left:d,behavior:C}):(A.scrollTop=x,A.scrollLeft=d)})}function W(y){return y===!1?{block:"end",inline:"nearest"}:P(y)?y:{block:"start",inline:"nearest"}}function _(y,C){var k=!y.ownerDocument.documentElement.contains(y);if(P(C)&&typeof C.behavior=="function")return C.behavior(k?[]:D(y,C));if(k)return;var O=W(C);return H(D(y,O),O.behavior)}var L=Fe.a=_},bT9E:function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return X});var ae=Q("VTBJ");function X(M,K){var D=Object(ae.a)({},M);return Array.isArray(K)&&K.forEach(function(P){delete D[P]}),D}},c5Ni:function(Ge,Fe,Q){},cRFk:function(Ge,Fe,Q){Ge.exports=Q.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(Ge,Fe,Q){Ge.exports=Q.p+"static/choose.4ad1045f.svg"},dejd:function(Ge,Fe,Q){},djh8:function(Ge,Fe,Q){Ge.exports=Q.p+"static/qrCode.d852fdfc.png"},dmUQ:function(Ge,Fe,Q){"use strict";var ae=Q("Ff2n"),X=Q("rePB"),M=Q("1OyB"),K=Q("vuIU"),D=Q("Ji7U"),P=Q("md7G"),H=Q("foSv"),W=Q("q1tI"),_=Q.n(W),L=Q("TSYQ"),y=Q.n(L),C=Q("4IlW");function k(h,o){var S=Object.keys(h);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(h);o&&(b=b.filter(function(T){return Object.getOwnPropertyDescriptor(h,T).enumerable})),S.push.apply(S,b)}return S}function O(h){for(var o=1;o<arguments.length;o++){var S=arguments[o]!=null?arguments[o]:{};o%2?k(Object(S),!0).forEach(function(b){Object(X.a)(h,b,S[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(S)):k(Object(S)).forEach(function(b){Object.defineProperty(h,b,Object.getOwnPropertyDescriptor(S,b))})}return h}function A(h){var o=x();return function(){var b=Object(H.a)(h),T;if(o){var N=Object(H.a)(this).constructor;T=Reflect.construct(b,arguments,N)}else T=b.apply(this,arguments);return Object(P.a)(this,T)}}function x(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(h){return!1}}function d(){}function a(h){h.preventDefault()}var l=function(o){return o.replace(/[^\w.-]+/g,"")},s=200,v=600,c=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,m=function(o){return o!=null},R=function(o,S){return S===o||typeof S=="number"&&typeof o=="number"&&isNaN(S)&&isNaN(o)},E=function(h){Object(D.a)(S,h);var o=A(S);function S(b){var T;Object(M.a)(this,S),T=o.call(this,b),T.onKeyDown=function(Y){var te=T.props,G=te.onKeyDown,F=te.onPressEnter;if(Y.keyCode===C.a.UP){var re=T.getRatio(Y);T.up(Y,re,null),T.stop()}else if(Y.keyCode===C.a.DOWN){var le=T.getRatio(Y);T.down(Y,le,null),T.stop()}else Y.keyCode===C.a.ENTER&&F&&F(Y);if(T.recordCursorPosition(),T.lastKeyCode=Y.keyCode,G){for(var Ee=arguments.length,Oe=new Array(Ee>1?Ee-1:0),Ye=1;Ye<Ee;Ye++)Oe[Ye-1]=arguments[Ye];G.apply(void 0,[Y].concat(Oe))}},T.onKeyUp=function(Y){var te=T.props.onKeyUp;if(T.stop(),T.recordCursorPosition(),te){for(var G=arguments.length,F=new Array(G>1?G-1:0),re=1;re<G;re++)F[re-1]=arguments[re];te.apply(void 0,[Y].concat(F))}},T.onChange=function(Y){var te=T.props.onChange;T.state.focused&&(T.inputting=!0),T.rawInput=T.props.parser(T.getValueFromEvent(Y)),T.setState({inputValue:T.rawInput}),te(T.toNumber(T.rawInput))},T.onMouseUp=function(){var Y=T.props.onMouseUp;T.recordCursorPosition(),Y&&Y.apply(void 0,arguments)},T.onFocus=function(){var Y;T.setState({focused:!0}),(Y=T.props).onFocus.apply(Y,arguments)},T.onBlur=function(){var Y=T.props.onBlur;T.inputting=!1,T.setState({focused:!1});var te=T.getCurrentValidValue(T.state.inputValue),G=T.setValue(te,d);if(Y){var F=T.input.value,re=T.getInputDisplayValue({focus:!1,value:G});T.input.value=re&&Number(re),Y.apply(void 0,arguments),T.input.value=F}},T.getRatio=function(Y){var te=1;return Y.metaKey||Y.ctrlKey?te=.1:Y.shiftKey&&(te=10),te},T.getFullNum=function(Y){return isNaN(Y)?Y:/e/i.test(String(Y))?Number(Y).toFixed(18).replace(/\.?0+$/,""):Y},T.getPrecision=function(Y){if(m(T.props.precision))return T.props.precision;var te=String(Y);if(te.indexOf("e-")>=0)return parseInt(te.slice(te.indexOf("e-")+2),10);var G=0;return te.indexOf(".")>=0&&(G=te.length-te.indexOf(".")-1),G},T.getInputDisplayValue=function(Y){var te=Y||T.state,G=te.focused,F=te.inputValue,re=te.value,le;G?le=F:le=T.toPrecisionAsStep(re),le==null&&(le="");var Ee=T.formatWrapper(le);return m(T.props.decimalSeparator)&&(Ee=Ee.toString().replace(".",T.props.decimalSeparator)),Ee},T.recordCursorPosition=function(){try{T.cursorStart=T.input.selectionStart,T.cursorEnd=T.input.selectionEnd,T.currentValue=T.input.value,T.cursorBefore=T.input.value.substring(0,T.cursorStart),T.cursorAfter=T.input.value.substring(T.cursorEnd)}catch(Y){}},T.restoreByAfter=function(Y){if(Y===void 0)return!1;var te=T.input.value,G=te.lastIndexOf(Y);if(G===-1)return!1;var F=T.cursorBefore.length;return T.lastKeyCode===C.a.DELETE&&T.cursorBefore.charAt(F-1)===Y[0]?(T.fixCaret(F,F),!0):G+Y.length===te.length?(T.fixCaret(G,G),!0):!1},T.partRestoreByAfter=function(Y){return Y===void 0?!1:Array.prototype.some.call(Y,function(te,G){var F=Y.substring(G);return T.restoreByAfter(F)})},T.isNotCompleteNumber=function(Y){return isNaN(Y)||Y===""||Y===null||Y&&Y.toString().indexOf(".")===Y.toString().length-1},T.stop=function(){T.autoStepTimer&&clearTimeout(T.autoStepTimer)},T.down=function(Y,te,G){T.pressingUpOrDown=!0,T.step("down",Y,te,G)},T.up=function(Y,te,G){T.pressingUpOrDown=!0,T.step("up",Y,te,G)},T.saveInput=function(Y){T.input=Y};var N=b.value;N===void 0&&(N=b.defaultValue),T.state={focused:b.autoFocus};var z=T.getValidValue(T.toNumber(N));return T.state=O(O({},T.state),{},{inputValue:T.toPrecisionAsStep(z),value:z}),T}return Object(K.a)(S,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(T){var N=this.props,z=N.value,Y=N.onChange,te=N.max,G=N.min,F=this.state.focused;if(T){if(!R(T.value,z)||!R(T.max,te)||!R(T.min,G)){var re=F?z:this.getValidValue(z),le;this.pressingUpOrDown?le=re:this.inputting?le=this.rawInput:le=this.toPrecisionAsStep(re),this.setState({value:re,inputValue:le})}var Ee="value"in this.props?z:this.state.value;"max"in this.props&&T.max!==te&&typeof Ee=="number"&&Ee>te&&Y&&Y(te),"min"in this.props&&T.min!==G&&typeof Ee=="number"&&Ee<G&&Y&&Y(G)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Oe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===C.a.BACKSPACE?Oe=this.cursorStart-1:this.lastKeyCode===C.a.DELETE&&(Oe=this.cursorStart):Oe=this.input.value.length,this.fixCaret(Oe,Oe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case C.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case C.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ye){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(T){var N=T;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(T){var N=T.target.value.trim().replace(/。/g,".");return m(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(T){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,Y=parseFloat(T);return isNaN(Y)?T:(Y<N&&(Y=N),Y>z&&(Y=z),Y)}},{key:"setValue",value:function(T,N){var z=this.props.precision,Y=this.isNotCompleteNumber(parseFloat(T))?null:parseFloat(T),te=this.state.value,G=te===void 0?null:te,F=this.state.inputValue,re=F===void 0?null:F,le=typeof Y=="number"?Y.toFixed(z):"".concat(Y),Ee=Y!==G||le!=="".concat(re);return"value"in this.props?(re=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:re},N)):this.setState({value:Y,inputValue:this.toPrecisionAsStep(T)},N),Ee&&this.props.onChange(Y),Y}},{key:"getMaxPrecision",value:function(T){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.props,Y=z.precision,te=z.step;if(m(Y))return Y;var G=this.getPrecision(N),F=this.getPrecision(te),re=this.getPrecision(T);return T?Math.max(re,G+F):G+F}},{key:"getPrecisionFactor",value:function(T){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.getMaxPrecision(T,N);return Math.pow(10,z)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(T){return this.props.formatter?this.props.formatter(T):T}},{key:"toPrecisionAsStep",value:function(T){if(this.isNotCompleteNumber(T)||T==="")return T;var N=Math.abs(this.getMaxPrecision(T));return isNaN(N)?T.toString():Number(T).toFixed(N)}},{key:"toNumber",value:function(T){var N=this.props.precision,z=this.state.focused,Y=T&&T.length>16&&z;return this.isNotCompleteNumber(T)||Y?T:m(N)?Math.round(T*Math.pow(10,N))/Math.pow(10,N):Number(T)}},{key:"upStep",value:function(T,N){var z=this.props.step,Y=this.getPrecisionFactor(T,N),te=Math.abs(this.getMaxPrecision(T,N)),G=((Y*T+Y*z*N)/Y).toFixed(te);return this.toNumber(G)}},{key:"downStep",value:function(T,N){var z=this.props.step,Y=this.getPrecisionFactor(T,N),te=Math.abs(this.getMaxPrecision(T,N)),G=((Y*T-Y*z*N)/Y).toFixed(te);return this.toNumber(G)}},{key:"step",value:function(T,N){var z=this,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,te=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var G=this.props;if(G.disabled)return;var F=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(F))return;var re=this["".concat(T,"Step")](F,Y),le=re>G.max||re<G.min;if(re>G.max?re=G.max:re<G.min&&(re=G.min),this.setValue(re,null),this.setState({focused:!0},function(){z.pressingUpOrDown=!1}),le)return;this.autoStepTimer=setTimeout(function(){z[T](N,Y,!0)},te?s:v)}},{key:"fixCaret",value:function(T,N){if(T===void 0||N===void 0||!this.input||!this.input.value)return;try{var z=this.input.selectionStart,Y=this.input.selectionEnd;(T!==z||N!==Y)&&this.input.setSelectionRange(T,N)}catch(te){}}},{key:"render",value:function(){var T,N=this.props,z=N.prefixCls,Y=N.disabled,te=N.readOnly,G=N.useTouch,F=N.autoComplete,re=N.upHandler,le=N.downHandler,Ee=N.className,Oe=N.max,Ye=N.min,Pe=N.style,Be=N.title,Ue=N.onMouseEnter,Ne=N.onMouseLeave,Te=N.onMouseOver,se=N.onMouseOut,ze=N.required,xt=N.onClick,ct=N.tabIndex,ft=N.type,Ct=N.placeholder,He=N.id,Ke=N.inputMode,ut=N.pattern,vt=N.step,ht=N.maxLength,et=N.autoFocus,Ze=N.name,Tt=N.onPaste,bt=N.onInput,St=Object(ae.a)(N,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),lt=this.state,yt=lt.value,dt=lt.focused,Qe=y()(z,(T={},Object(X.a)(T,Ee,!!Ee),Object(X.a)(T,"".concat(z,"-disabled"),Y),Object(X.a)(T,"".concat(z,"-focused"),dt),T)),Ie={};Object.keys(St).forEach(function(pe){(pe.substr(0,5)==="data-"||pe.substr(0,5)==="aria-"||pe==="role")&&(Ie[pe]=St[pe])});var Et=!te&&!Y,$e=this.getInputDisplayValue(null),_e=(yt||yt===0)&&(isNaN(yt)||Number(yt)>=Oe),Je=(yt||yt===0)&&(isNaN(yt)||Number(yt)<=Ye),Se=_e||Y||te,me=Je||Y||te,ve=y()("".concat(z,"-handler"),"".concat(z,"-handler-up"),Object(X.a)({},"".concat(z,"-handler-up-disabled"),Se)),ne=y()("".concat(z,"-handler"),"".concat(z,"-handler-down"),Object(X.a)({},"".concat(z,"-handler-down-disabled"),me)),ie=G?{onTouchStart:Se?d:this.up,onTouchEnd:this.stop}:{onMouseDown:Se?d:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=G?{onTouchStart:me?d:this.down,onTouchEnd:this.stop}:{onMouseDown:me?d:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return _.a.createElement("div",{className:Qe,style:Pe,title:Be,onMouseEnter:Ue,onMouseLeave:Ne,onMouseOver:Te,onMouseOut:se,onFocus:function(){return null},onBlur:function(){return null}},_.a.createElement("div",{className:"".concat(z,"-handler-wrap")},_.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":Se,className:ve}),re||_.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-up-inner"),onClick:a})),_.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":me,className:ne}),le||_.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-down-inner"),onClick:a}))),_.a.createElement("div",{className:"".concat(z,"-input-wrap")},_.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ye,"aria-valuemax":Oe,"aria-valuenow":yt,required:ze,type:ft,placeholder:Ct,onPaste:Tt,onClick:xt,onMouseUp:this.onMouseUp,className:"".concat(z,"-input"),tabIndex:ct,autoComplete:F,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Et?this.onKeyDown:d,onKeyUp:Et?this.onKeyUp:d,autoFocus:et,maxLength:ht,readOnly:te,disabled:Y,max:Oe,min:Ye,step:vt,name:Ze,title:Be,id:He,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum($e),pattern:ut,inputMode:Ke,onInput:bt},Ie))))}}]),S}(_.a.Component);E.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:c,min:-c,step:1,style:{},onChange:d,onKeyDown:d,onPressEnter:d,onFocus:d,onBlur:d,parser:l,required:!1,autoComplete:"off"};var f=E,g=Fe.a=f},ji0R:function(Ge,Fe,Q){Ge.exports=Q.p+"static/douyu.3e6df9ee.jpg"},k3GJ:function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return bo});var ae=Q("rePB"),X=Q("ODXe"),M=Q("Ff2n"),K=Q("VTBJ"),D=Q("q1tI"),P=Q("TSYQ"),H=Q.n(P),W=Q("Zm9Q"),_=Q("6cGi"),L=Q("KQm4"),y=Q("xEkU"),C=Q.n(y),k=Q("t23M");function O(ue){var Ce=Object(D.useRef)(),we=Object(D.useRef)(!1);function ce(){for(var q=arguments.length,oe=new Array(q),ee=0;ee<q;ee++)oe[ee]=arguments[ee];we.current||(C.a.cancel(Ce.current),Ce.current=C()(function(){ue.apply(void 0,oe)}))}return Object(D.useEffect)(function(){return function(){we.current=!0,C.a.cancel(Ce.current)}},[]),ce}function A(ue){var Ce=Object(D.useRef)([]),we=Object(D.useState)({}),ce=Object(X.a)(we,2),q=ce[1],oe=Object(D.useRef)(typeof ue=="function"?ue():ue),ee=O(function(){var ge=oe.current;Ce.current.forEach(function(De){ge=De(ge)}),Ce.current=[],oe.current=ge,q({})});function fe(ge){Ce.current.push(ge),ee()}return[oe.current,fe]}var x=Q("4IlW");function d(ue,Ce){var we,ce=ue.prefixCls,q=ue.id,oe=ue.active,ee=ue.rtl,fe=ue.tab,ge=fe.key,De=fe.tab,Ae=fe.disabled,Me=fe.closeIcon,We=ue.tabBarGutter,st=ue.tabPosition,at=ue.closable,At=ue.renderWrapper,Xt=ue.removeAriaLabel,ur=ue.editable,rr=ue.onClick,ar=ue.onRemove,dr=ue.onFocus,sr="".concat(ce,"-tab");D.useEffect(function(){return ar},[]);var or={};st==="top"||st==="bottom"?or[ee?"marginLeft":"marginRight"]=We:or.marginBottom=We;var Ar=ur&&at!==!1&&!Ae;function mr(Qt){if(Ae)return;rr(Qt)}function Yr(Qt){Qt.preventDefault(),Qt.stopPropagation(),ur.onEdit("remove",{key:ge,event:Qt})}var gr=D.createElement("div",{key:ge,ref:Ce,className:H()(sr,(we={},Object(ae.a)(we,"".concat(sr,"-with-remove"),Ar),Object(ae.a)(we,"".concat(sr,"-active"),oe),Object(ae.a)(we,"".concat(sr,"-disabled"),Ae),we)),style:or,onClick:mr},D.createElement("div",{role:"tab","aria-selected":oe,id:q&&"".concat(q,"-tab-").concat(ge),className:"".concat(sr,"-btn"),"aria-controls":q&&"".concat(q,"-panel-").concat(ge),"aria-disabled":Ae,tabIndex:Ae?null:0,onClick:function(zt){zt.stopPropagation(),mr(zt)},onKeyDown:function(zt){[x.a.SPACE,x.a.ENTER].includes(zt.which)&&(zt.preventDefault(),mr(zt))},onFocus:dr},De),Ar&&D.createElement("button",{type:"button","aria-label":Xt||"remove",tabIndex:0,className:"".concat(sr,"-remove"),onClick:function(zt){zt.stopPropagation(),Yr(zt)}},Me||ur.removeIcon||"\xD7"));return At&&(gr=At(gr)),gr}var a=D.forwardRef(d),l={width:0,height:0,left:0,top:0};function s(ue,Ce,we){return Object(D.useMemo)(function(){for(var ce,q=new Map,oe=Ce.get((ce=ue[0])===null||ce===void 0?void 0:ce.key)||l,ee=oe.left+oe.width,fe=0;fe<ue.length;fe+=1){var ge=ue[fe].key,De=Ce.get(ge);if(!De){var Ae;De=Ce.get((Ae=ue[fe-1])===null||Ae===void 0?void 0:Ae.key)||l}var Me=q.get(ge)||Object(K.a)({},De);Me.right=ee-Me.left-Me.width,q.set(ge,Me)}return q},[ue.map(function(ce){return ce.key}).join("_"),Ce,we])}var v={width:0,height:0,left:0,top:0,right:0};function c(ue,Ce,we,ce,q){var oe=q.tabs,ee=q.tabPosition,fe=q.rtl,ge,De,Ae;["top","bottom"].includes(ee)?(ge="width",De=fe?"right":"left",Ae=Math.abs(Ce.left)):(ge="height",De="top",Ae=-Ce.top);var Me=Ce[ge],We=we[ge],st=ce[ge],at=Me;return We+st>Me&&(at=Me-st),Object(D.useMemo)(function(){if(!oe.length)return[0,0];for(var At=oe.length,Xt=At,ur=0;ur<At;ur+=1){var rr=ue.get(oe[ur].key)||v;if(rr[De]+rr[ge]>Ae+at){Xt=ur-1;break}}for(var ar=0,dr=At-1;dr>=0;dr-=1){var sr=ue.get(oe[dr].key)||v;if(sr[De]<Ae){ar=dr+1;break}}return[ar,Xt]},[ue,Ae,at,ee,oe.map(function(At){return At.key}).join("_"),fe])}var m=Q("wx14"),R=Q("1OyB"),E=Q("vuIU"),f=Q("JX7q"),g=Q("Ji7U"),h=Q("LK+K"),o=Q("I8Z2"),S=Q("bT9E"),b=Q("2GS6"),T=Q("Gytx"),N=Q.n(T),z=Q("U8pU"),Y=/iPhone/i,te=/iPod/i,G=/iPad/i,F=/\bAndroid(?:.+)Mobile\b/i,re=/Android/i,le=/\bAndroid(?:.+)SD4930UR\b/i,Ee=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,Oe=/Windows Phone/i,Ye=/\bWindows(?:.+)ARM\b/i,Pe=/BlackBerry/i,Be=/BB10/i,Ue=/Opera Mini/i,Ne=/\b(CriOS|Chrome)(?:.+)Mobile/i,Te=/Mobile(?:.+)Firefox\b/i;function se(ue,Ce){return ue.test(Ce)}function ze(ue){var Ce=ue||(typeof navigator!="undefined"?navigator.userAgent:""),we=(Ce||"").split("[FBAN");if(typeof we[1]!="undefined"){var ce=we,q=Object(X.a)(ce,1);Ce=q[0]}if(we=Ce.split("Twitter"),typeof we[1]!="undefined"){var oe=we,ee=Object(X.a)(oe,1);Ce=ee[0]}var fe={apple:{phone:se(Y,Ce)&&!se(Oe,Ce),ipod:se(te,Ce),tablet:!se(Y,Ce)&&se(G,Ce)&&!se(Oe,Ce),device:(se(Y,Ce)||se(te,Ce)||se(G,Ce))&&!se(Oe,Ce)},amazon:{phone:se(le,Ce),tablet:!se(le,Ce)&&se(Ee,Ce),device:se(le,Ce)||se(Ee,Ce)},android:{phone:!se(Oe,Ce)&&se(le,Ce)||!se(Oe,Ce)&&se(F,Ce),tablet:!se(Oe,Ce)&&!se(le,Ce)&&!se(F,Ce)&&(se(Ee,Ce)||se(re,Ce)),device:!se(Oe,Ce)&&(se(le,Ce)||se(Ee,Ce)||se(F,Ce)||se(re,Ce))||se(/\bokhttp\b/i,Ce)},windows:{phone:se(Oe,Ce),tablet:se(Ye,Ce),device:se(Oe,Ce)||se(Ye,Ce)},other:{blackberry:se(Pe,Ce),blackberry10:se(Be,Ce),opera:se(Ue,Ce),firefox:se(Te,Ce),chrome:se(Ne,Ce),device:se(Pe,Ce)||se(Be,Ce)||se(Ue,Ce)||se(Te,Ce)||se(Ne,Ce)},any:null,phone:null,tablet:null};return fe.any=fe.apple.device||fe.android.device||fe.windows.device||fe.other.device,fe.phone=fe.apple.phone||fe.android.phone||fe.windows.phone,fe.tablet=fe.apple.tablet||fe.android.tablet||fe.windows.tablet,fe}var xt=Object(K.a)(Object(K.a)({},ze()),{},{isMobile:ze}),ct=xt;function ft(){}function Ct(ue,Ce,we){var ce=Ce||"";return ue.key||"".concat(ce,"item_").concat(we)}function He(ue){return"".concat(ue,"-menu-")}function Ke(ue,Ce){var we=-1;D.Children.forEach(ue,function(ce){we+=1,ce&&ce.type&&ce.type.isMenuItemGroup?D.Children.forEach(ce.props.children,function(q){we+=1,Ce(q,we)}):Ce(ce,we)})}function ut(ue,Ce,we){if(!ue||we.find)return;D.Children.forEach(ue,function(ce){if(ce){var q=ce.type;if(!q||!(q.isSubMenu||q.isMenuItem||q.isMenuItemGroup))return;Ce.indexOf(ce.key)!==-1?we.find=!0:ce.props.children&&ut(ce.props.children,Ce,we)}})}var vt=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],ht=function(Ce){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=Ce&&typeof Ce.getBoundingClientRect=="function"&&Ce.getBoundingClientRect().width;if(ce){if(we){var q=getComputedStyle(Ce),oe=q.marginLeft,ee=q.marginRight;ce+=+oe.replace("px","")+ +ee.replace("px","")}ce=+ce.toFixed(6)}return ce||0},et=function(Ce,we,ce){Ce&&Object(z.a)(Ce.style)==="object"&&(Ce.style[we]=ce)},Ze=function(){return ct.any},Tt=Q("bdgK"),bt=Q("i8i4"),St=Q.n(bt),lt=Q("wgJM"),yt=Q("l4aY"),dt=Q("m+aA"),Qe=Q("c+Xe"),Ie=Q("zT1h"),Et=Q("QC+M");function $e(ue,Ce,we){return we?ue[0]===Ce[0]:ue[0]===Ce[0]&&ue[1]===Ce[1]}function _e(ue,Ce,we){var ce=ue[Ce]||{};return Object(K.a)(Object(K.a)({},ce),we)}function Je(ue,Ce,we,ce){for(var q=we.points,oe=Object.keys(ue),ee=0;ee<oe.length;ee+=1){var fe=oe[ee];if($e(ue[fe].points,q,ce))return"".concat(Ce,"-placement-").concat(fe)}return""}var Se=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ue=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ue)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ue==null?void 0:ue.substr(0,4)))},me=Q("MNnm");function ve(ue,Ce){var we={};return we[ue.toLowerCase()]=Ce.toLowerCase(),we["Webkit".concat(ue)]="webkit".concat(Ce),we["Moz".concat(ue)]="moz".concat(Ce),we["ms".concat(ue)]="MS".concat(Ce),we["O".concat(ue)]="o".concat(Ce.toLowerCase()),we}function ne(ue,Ce){var we={animationend:ve("Animation","AnimationEnd"),transitionend:ve("Transition","TransitionEnd")};return ue&&("AnimationEvent"in Ce||delete we.animationend.animation,"TransitionEvent"in Ce||delete we.transitionend.transition),we}var ie=ne(Object(me.a)(),typeof window!="undefined"?window:{}),de={};if(Object(me.a)()){var pe=document.createElement("div");de=pe.style}var xe={};function Le(ue){if(xe[ue])return xe[ue];var Ce=ie[ue];if(Ce)for(var we=Object.keys(Ce),ce=we.length,q=0;q<ce;q+=1){var oe=we[q];if(Object.prototype.hasOwnProperty.call(Ce,oe)&&oe in de)return xe[ue]=Ce[oe],xe[ue]}return""}var je=Le("animationend"),mt=Le("transitionend"),Mt=!!(je&&mt),Rt=je||"animationend",Kt=mt||"transitionend";function _t(ue,Ce){if(!ue)return null;if(Object(z.a)(ue)==="object"){var we=Ce.replace(/-\w/g,function(ce){return ce[1].toUpperCase()});return ue[we]}return"".concat(ue,"-").concat(Ce)}var ot="none",Jt="appear",Ut="enter",Zt="leave",nr="none",Ot="prepare",xr="start",$t="active",it="end";function lr(ue){var Ce=Object(D.useRef)(!1),we=Object(D.useState)(ue),ce=Object(X.a)(we,2),q=ce[0],oe=ce[1];function ee(fe){Ce.current||oe(fe)}return Object(D.useEffect)(function(){return function(){Ce.current=!0}},[]),[q,ee]}var nt=Object(me.a)()?D.useLayoutEffect:D.useEffect,yr=nt,Lr=function(){var ue=D.useRef(null);function Ce(){lt.a.cancel(ue.current)}function we(ce){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Ce();var oe=Object(lt.a)(function(){q<=1?ce({isCanceled:function(){return oe!==ue.current}}):we(ce,q-1)});ue.current=oe}return D.useEffect(function(){return function(){Ce()}},[]),[we,Ce]},jr=[Ot,xr,$t,it],pn=!1,br=!0;function Lt(ue){return ue===$t||ue===it}var Hn=function(ue,Ce){var we=D.useState(nr),ce=Object(X.a)(we,2),q=ce[0],oe=ce[1],ee=Lr(),fe=Object(X.a)(ee,2),ge=fe[0],De=fe[1];function Ae(){oe(Ot)}return yr(function(){if(q!==nr&&q!==it){var Me=jr.indexOf(q),We=jr[Me+1],st=Ce(q);st===pn?oe(We):ge(function(at){function At(){if(at.isCanceled())return;oe(We)}st===!0?At():Promise.resolve(st).then(At)})}},[ue,q]),D.useEffect(function(){return function(){De()}},[]),[Ae,q]},Zn=function(ue){var Ce=Object(D.useRef)(),we=Object(D.useRef)(ue);we.current=ue;var ce=D.useCallback(function(ee){we.current(ee)},[]);function q(ee){ee&&(ee.removeEventListener(Kt,ce),ee.removeEventListener(Rt,ce))}function oe(ee){Ce.current&&Ce.current!==ee&&q(Ce.current),ee&&ee!==Ce.current&&(ee.addEventListener(Kt,ce),ee.addEventListener(Rt,ce),Ce.current=ee)}return D.useEffect(function(){return function(){q(Ce.current)}},[]),[oe,q]};function ln(ue,Ce,we,ce){var q=ce.motionEnter,oe=q===void 0?!0:q,ee=ce.motionAppear,fe=ee===void 0?!0:ee,ge=ce.motionLeave,De=ge===void 0?!0:ge,Ae=ce.motionDeadline,Me=ce.motionLeaveImmediately,We=ce.onAppearPrepare,st=ce.onEnterPrepare,at=ce.onLeavePrepare,At=ce.onAppearStart,Xt=ce.onEnterStart,ur=ce.onLeaveStart,rr=ce.onAppearActive,ar=ce.onEnterActive,dr=ce.onLeaveActive,sr=ce.onAppearEnd,or=ce.onEnterEnd,Ar=ce.onLeaveEnd,mr=ce.onVisibleChanged,Yr=lr(),gr=Object(X.a)(Yr,2),Qt=gr[0],zt=gr[1],vr=lr(ot),Tr=Object(X.a)(vr,2),Nt=Tr[0],Or=Tr[1],Jr=lr(null),kr=Object(X.a)(Jr,2),Kr=kr[0],Wr=kr[1],hn=Object(D.useRef)(!1),Sn=Object(D.useRef)(null),en=Object(D.useRef)(!1),Fn=Object(D.useRef)(null);function pi(){var Vr=we();return Vr||Fn.current}var Vn=Object(D.useRef)(!1);function An(Vr){var Fr=pi();if(Vr&&!Vr.deadline&&Vr.target!==Fr)return;var Tn;Nt===Jt&&Vn.current?Tn=sr==null?void 0:sr(Fr,Vr):Nt===Ut&&Vn.current?Tn=or==null?void 0:or(Fr,Vr):Nt===Zt&&Vn.current&&(Tn=Ar==null?void 0:Ar(Fr,Vr)),Tn!==!1&&!en.current&&(Or(ot),Wr(null))}var Qr=Zn(An),zr=Object(X.a)(Qr,1),tn=zr[0],Zr=D.useMemo(function(){var Vr,Fr,Tn;switch(Nt){case"appear":return Vr={},Object(ae.a)(Vr,Ot,We),Object(ae.a)(Vr,xr,At),Object(ae.a)(Vr,$t,rr),Vr;case"enter":return Fr={},Object(ae.a)(Fr,Ot,st),Object(ae.a)(Fr,xr,Xt),Object(ae.a)(Fr,$t,ar),Fr;case"leave":return Tn={},Object(ae.a)(Tn,Ot,at),Object(ae.a)(Tn,xr,ur),Object(ae.a)(Tn,$t,dr),Tn;default:return{}}},[Nt]),mi=Hn(Nt,function(Vr){if(Vr===Ot){var Fr=Zr[Ot];return Fr?Fr(pi()):pn}if(Hr in Zr){var Tn;Wr(((Tn=Zr[Hr])===null||Tn===void 0?void 0:Tn.call(Zr,pi(),null))||null)}return Hr===$t&&(tn(pi()),Ae>0&&(clearTimeout(Sn.current),Sn.current=setTimeout(function(){An({deadline:!0})},Ae))),br}),ki=Object(X.a)(mi,2),Li=ki[0],Hr=ki[1],xi=Lt(Hr);Vn.current=xi,yr(function(){zt(Ce);var Vr=hn.current;if(hn.current=!0,!ue)return;var Fr;!Vr&&Ce&&fe&&(Fr=Jt),Vr&&Ce&&oe&&(Fr=Ut),(Vr&&!Ce&&De||!Vr&&Me&&!Ce&&De)&&(Fr=Zt),Fr&&(Or(Fr),Li())},[Ce]),Object(D.useEffect)(function(){(Nt===Jt&&!fe||Nt===Ut&&!oe||Nt===Zt&&!De)&&Or(ot)},[fe,oe,De]),Object(D.useEffect)(function(){return function(){clearTimeout(Sn.current),en.current=!0}},[]),Object(D.useEffect)(function(){Qt!==void 0&&Nt===ot&&(mr==null||mr(Qt))},[Qt,Nt]);var Ii=Kr;return Zr[Ot]&&Hr===xr&&(Ii=Object(K.a)({transition:"none"},Ii)),[Nt,Hr,Ii,Qt!=null?Qt:Ce]}var ir=function(ue){Object(g.a)(we,ue);var Ce=Object(h.a)(we);function we(){return Object(R.a)(this,we),Ce.apply(this,arguments)}return Object(E.a)(we,[{key:"render",value:function(){return this.props.children}}]),we}(D.Component),Un=ir;function Kn(ue){var Ce=ue;Object(z.a)(ue)==="object"&&(Ce=ue.transitionSupport);function we(q){return!!(q.motionName&&Ce)}var ce=D.forwardRef(function(q,oe){var ee=q.visible,fe=ee===void 0?!0:ee,ge=q.removeOnLeave,De=ge===void 0?!0:ge,Ae=q.forceRender,Me=q.children,We=q.motionName,st=q.leavedClassName,at=q.eventProps,At=we(q),Xt=Object(D.useRef)(),ur=Object(D.useRef)();function rr(){try{return Object(dt.a)(Xt.current||ur.current)}catch(Or){return null}}var ar=ln(At,fe,rr,q),dr=Object(X.a)(ar,4),sr=dr[0],or=dr[1],Ar=dr[2],mr=dr[3],Yr=D.useRef(mr);mr&&(Yr.current=!0);var gr=Object(D.useRef)(oe);gr.current=oe;var Qt=D.useCallback(function(Or){Xt.current=Or,Object(Qe.b)(gr.current,Or)},[]),zt,vr=Object(K.a)(Object(K.a)({},at),{},{visible:fe});if(!Me)zt=null;else if(sr===ot||!we(q))mr?zt=Me(Object(K.a)({},vr),Qt):!De&&Yr.current?zt=Me(Object(K.a)(Object(K.a)({},vr),{},{className:st}),Qt):Ae?zt=Me(Object(K.a)(Object(K.a)({},vr),{},{style:{display:"none"}}),Qt):zt=null;else{var Tr,Nt;or===Ot?Nt="prepare":Lt(or)?Nt="active":or===xr&&(Nt="start"),zt=Me(Object(K.a)(Object(K.a)({},vr),{},{className:H()(_t(We,sr),(Tr={},Object(ae.a)(Tr,_t(We,"".concat(sr,"-").concat(Nt)),Nt),Object(ae.a)(Tr,We,typeof We=="string"),Tr)),style:Ar}),Qt)}return D.createElement(Un,{ref:ur},zt)});return ce.displayName="CSSMotion",ce}var ai=Kn(Mt),rt="add",Wt="keep",zn="remove",ci="removed";function bi(ue){var Ce;return ue&&Object(z.a)(ue)==="object"&&"key"in ue?Ce=ue:Ce={key:ue},Object(K.a)(Object(K.a)({},Ce),{},{key:String(Ce.key)})}function oi(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ue.map(bi)}function j(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],we=[],ce=0,q=Ce.length,oe=oi(ue),ee=oi(Ce);oe.forEach(function(De){for(var Ae=!1,Me=ce;Me<q;Me+=1){var We=ee[Me];if(We.key===De.key){ce<Me&&(we=we.concat(ee.slice(ce,Me).map(function(st){return Object(K.a)(Object(K.a)({},st),{},{status:rt})})),ce=Me),we.push(Object(K.a)(Object(K.a)({},We),{},{status:Wt})),ce+=1,Ae=!0;break}}Ae||we.push(Object(K.a)(Object(K.a)({},De),{},{status:zn}))}),ce<q&&(we=we.concat(ee.slice(ce).map(function(De){return Object(K.a)(Object(K.a)({},De),{},{status:rt})})));var fe={};we.forEach(function(De){var Ae=De.key;fe[Ae]=(fe[Ae]||0)+1});var ge=Object.keys(fe).filter(function(De){return fe[De]>1});return ge.forEach(function(De){we=we.filter(function(Ae){var Me=Ae.key,We=Ae.status;return Me!==De||We!==zn}),we.forEach(function(Ae){Ae.key===De&&(Ae.status=Wt)})}),we}var u=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function p(ue){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ai,we=function(ce){Object(g.a)(oe,ce);var q=Object(h.a)(oe);function oe(){var ee;return Object(R.a)(this,oe),ee=q.apply(this,arguments),ee.state={keyEntities:[]},ee.removeKey=function(fe){ee.setState(function(ge){var De=ge.keyEntities;return{keyEntities:De.map(function(Ae){return Ae.key!==fe?Ae:Object(K.a)(Object(K.a)({},Ae),{},{status:ci})})}})},ee}return Object(E.a)(oe,[{key:"render",value:function(){var fe=this,ge=this.state.keyEntities,De=this.props,Ae=De.component,Me=De.children,We=De.onVisibleChanged,st=Object(M.a)(De,["component","children","onVisibleChanged"]),at=Ae||D.Fragment,At={};return u.forEach(function(Xt){At[Xt]=st[Xt],delete st[Xt]}),delete st.keys,D.createElement(at,st,ge.map(function(Xt){var ur=Xt.status,rr=Object(M.a)(Xt,["status"]),ar=ur===rt||ur===Wt;return D.createElement(Ce,Object(m.a)({},At,{key:rr.key,visible:ar,eventProps:rr,onVisibleChanged:function(sr){We==null||We(sr,{key:rr.key}),sr||fe.removeKey(rr.key)}}),Me)}))}}],[{key:"getDerivedStateFromProps",value:function(fe,ge){var De=fe.keys,Ae=ge.keyEntities,Me=oi(De),We=j(Ae,Me);return{keyEntities:We.filter(function(st){var at=Ae.find(function(At){var Xt=At.key;return st.key===Xt});return!(at&&at.status===ci&&st.status===zn)})}}}]),oe}(D.Component);return we.defaultProps={component:"div"},we}var I=p(Mt),Z=ai;function U(ue){var Ce=ue.prefixCls,we=ue.motion,ce=ue.animation,q=ue.transitionName;return we||(ce?{motionName:"".concat(Ce,"-").concat(ce)}:q?{motionName:q}:null)}function be(ue){var Ce=ue.prefixCls,we=ue.visible,ce=ue.zIndex,q=ue.mask,oe=ue.maskMotion,ee=ue.maskAnimation,fe=ue.maskTransitionName;if(!q)return null;var ge={};return(oe||fe||ee)&&(ge=Object(K.a)({motionAppear:!0},U({motion:oe,prefixCls:Ce,transitionName:fe,animation:ee}))),D.createElement(Z,Object(m.a)({},ge,{visible:we,removeOnLeave:!0}),function(De){var Ae=De.className;return D.createElement("div",{style:{zIndex:ce},className:H()("".concat(Ce,"-mask"),Ae)})})}var Xe=Q("9mu1"),gt=Q("o0o1"),It=Q.n(gt),qe=Q("HaE+"),jt=["measure","align",null,"motion"],Cr=function(ue,Ce){var we=Object(D.useState)(null),ce=Object(X.a)(we,2),q=ce[0],oe=ce[1],ee=Object(D.useRef)(),fe=Object(D.useRef)(!1);function ge(Me){fe.current||oe(Me)}function De(){lt.a.cancel(ee.current)}function Ae(Me){De(),ee.current=Object(lt.a)(function(){ge(function(We){switch(q){case"align":return"motion";case"motion":return"stable";default:}return We}),Me==null||Me()})}return Object(D.useEffect)(function(){ge("measure")},[ue]),Object(D.useEffect)(function(){switch(q){case"measure":Ce();break;default:}q&&(ee.current=Object(lt.a)(Object(qe.a)(It.a.mark(function Me(){var We,st;return It.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:We=jt.indexOf(q),st=jt[We+1],st&&We!==-1&&ge(st);case 3:case"end":return At.stop()}},Me)}))))},[q]),Object(D.useEffect)(function(){return function(){fe.current=!0,De()}},[]),[q,Ae]},Nr=function(ue){var Ce=D.useState({width:0,height:0}),we=Object(X.a)(Ce,2),ce=we[0],q=we[1];function oe(fe){q({width:fe.offsetWidth,height:fe.offsetHeight})}var ee=D.useMemo(function(){var fe={};if(ue){var ge=ce.width,De=ce.height;ue.indexOf("height")!==-1&&De?fe.height=De:ue.indexOf("minHeight")!==-1&&De&&(fe.minHeight=De),ue.indexOf("width")!==-1&&ge?fe.width=ge:ue.indexOf("minWidth")!==-1&&ge&&(fe.minWidth=ge)}return fe},[ue,ce]);return[ee,oe]},Rn=D.forwardRef(function(ue,Ce){var we=ue.visible,ce=ue.prefixCls,q=ue.className,oe=ue.style,ee=ue.children,fe=ue.zIndex,ge=ue.stretch,De=ue.destroyPopupOnHide,Ae=ue.forceRender,Me=ue.align,We=ue.point,st=ue.getRootDomNode,at=ue.getClassNameFromAlign,At=ue.onAlign,Xt=ue.onMouseEnter,ur=ue.onMouseLeave,rr=ue.onMouseDown,ar=ue.onTouchStart,dr=Object(D.useRef)(),sr=Object(D.useRef)(),or=Object(D.useState)(),Ar=Object(X.a)(or,2),mr=Ar[0],Yr=Ar[1],gr=Nr(ge),Qt=Object(X.a)(gr,2),zt=Qt[0],vr=Qt[1];function Tr(){ge&&vr(st())}var Nt=Cr(we,Tr),Or=Object(X.a)(Nt,2),Jr=Or[0],kr=Or[1],Kr=Object(D.useRef)();function Wr(){return We||st}function hn(){var Qr;(Qr=dr.current)===null||Qr===void 0||Qr.forceAlign()}function Sn(Qr,zr){var tn=at(zr);mr!==tn&&Yr(tn),Jr==="align"&&(mr!==tn?Promise.resolve().then(function(){hn()}):kr(function(){var Zr;(Zr=Kr.current)===null||Zr===void 0||Zr.call(Kr)}),At==null||At(Qr,zr))}var en=Object(K.a)({},U(ue));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Qr){var zr=en[Qr];en[Qr]=function(tn,Zr){return kr(),zr==null?void 0:zr(tn,Zr)}});function Fn(){return new Promise(function(Qr){Kr.current=Qr})}D.useEffect(function(){!en.motionName&&Jr==="motion"&&kr()},[en.motionName,Jr]),D.useImperativeHandle(Ce,function(){return{forceAlign:hn,getElement:function(){return sr.current}}});var pi=Object(K.a)(Object(K.a)({},zt),{},{zIndex:fe,opacity:Jr==="motion"||Jr==="stable"||!we?void 0:0,pointerEvents:Jr==="stable"?void 0:"none"},oe),Vn=!0;(Me==null?void 0:Me.points)&&(Jr==="align"||Jr==="stable")&&(Vn=!1);var An=ee;return D.Children.count(ee)>1&&(An=D.createElement("div",{className:"".concat(ce,"-content")},ee)),D.createElement(Z,Object(m.a)({visible:we,ref:sr,leavedClassName:"".concat(ce,"-hidden")},en,{onAppearPrepare:Fn,onEnterPrepare:Fn,removeOnLeave:De,forceRender:Ae}),function(Qr,zr){var tn=Qr.className,Zr=Qr.style,mi=H()(ce,q,mr,tn);return D.createElement(Xe.a,{target:Wr(),key:"popup",ref:dr,monitorWindowResize:!0,disabled:Vn,align:Me,onAlign:Sn},D.createElement("div",{ref:zr,className:mi,onMouseEnter:Xt,onMouseLeave:ur,onMouseDownCapture:rr,onTouchStartCapture:ar,style:Object(K.a)(Object(K.a)({},Zr),pi)},An))})});Rn.displayName="PopupInner";var bn=Rn,mn=D.forwardRef(function(ue,Ce){var we=ue.prefixCls,ce=ue.visible,q=ue.zIndex,oe=ue.children,ee=ue.mobile;ee=ee===void 0?{}:ee;var fe=ee.popupClassName,ge=ee.popupStyle,De=ee.popupMotion,Ae=De===void 0?{}:De,Me=ee.popupRender,We=D.useRef();D.useImperativeHandle(Ce,function(){return{forceAlign:function(){},getElement:function(){return We.current}}});var st=Object(K.a)({zIndex:q},ge),at=oe;return D.Children.count(oe)>1&&(at=D.createElement("div",{className:"".concat(we,"-content")},oe)),Me&&(at=Me(at)),D.createElement(Z,Object(m.a)({visible:ce,ref:We,removeOnLeave:!0},Ae),function(At,Xt){var ur=At.className,rr=At.style,ar=H()(we,fe,ur);return D.createElement("div",{ref:Xt,className:ar,style:Object(K.a)(Object(K.a)({},rr),st)},at)})});mn.displayName="MobilePopupInner";var qn=mn,Rr=["visible","mobile"],Ft=D.forwardRef(function(ue,Ce){var we=ue.visible,ce=ue.mobile,q=Object(M.a)(ue,Rr),oe=Object(D.useState)(we),ee=Object(X.a)(oe,2),fe=ee[0],ge=ee[1],De=Object(D.useState)(!1),Ae=Object(X.a)(De,2),Me=Ae[0],We=Ae[1],st=Object(K.a)(Object(K.a)({},q),{},{visible:fe});Object(D.useEffect)(function(){ge(we),we&&ce&&We(Se())},[we,ce]);var at=Me?D.createElement(qn,Object(m.a)({},st,{mobile:ce,ref:Ce})):D.createElement(bn,Object(m.a)({},st,{ref:Ce}));return D.createElement("div",null,D.createElement(be,st),at)});Ft.displayName="Popup";var Vt=Ft,er=D.createContext(null),wr=er;function tr(){}function si(){return""}function nn(ue){return ue?ue.ownerDocument:window.document}var Oi=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Fi(ue){var Ce=function(we){Object(g.a)(q,we);var ce=Object(h.a)(q);function q(oe){var ee;Object(R.a)(this,q),ee=ce.call(this,oe),ee.popupRef=D.createRef(),ee.triggerRef=D.createRef(),ee.attachId=void 0,ee.clickOutsideHandler=void 0,ee.touchOutsideHandler=void 0,ee.contextMenuOutsideHandler1=void 0,ee.contextMenuOutsideHandler2=void 0,ee.mouseDownTimeout=void 0,ee.focusTime=void 0,ee.preClickTime=void 0,ee.preTouchTime=void 0,ee.delayTimer=void 0,ee.hasPopupMouseDown=void 0,ee.onMouseEnter=function(ge){var De=ee.props.mouseEnterDelay;ee.fireEvents("onMouseEnter",ge),ee.delaySetPopupVisible(!0,De,De?null:ge)},ee.onMouseMove=function(ge){ee.fireEvents("onMouseMove",ge),ee.setPoint(ge)},ee.onMouseLeave=function(ge){ee.fireEvents("onMouseLeave",ge),ee.delaySetPopupVisible(!1,ee.props.mouseLeaveDelay)},ee.onPopupMouseEnter=function(){ee.clearDelayTimer()},ee.onPopupMouseLeave=function(ge){var De;if(ge.relatedTarget&&!ge.relatedTarget.setTimeout&&Object(yt.a)((De=ee.popupRef.current)===null||De===void 0?void 0:De.getElement(),ge.relatedTarget))return;ee.delaySetPopupVisible(!1,ee.props.mouseLeaveDelay)},ee.onFocus=function(ge){ee.fireEvents("onFocus",ge),ee.clearDelayTimer(),ee.isFocusToShow()&&(ee.focusTime=Date.now(),ee.delaySetPopupVisible(!0,ee.props.focusDelay))},ee.onMouseDown=function(ge){ee.fireEvents("onMouseDown",ge),ee.preClickTime=Date.now()},ee.onTouchStart=function(ge){ee.fireEvents("onTouchStart",ge),ee.preTouchTime=Date.now()},ee.onBlur=function(ge){ee.fireEvents("onBlur",ge),ee.clearDelayTimer(),ee.isBlurToHide()&&ee.delaySetPopupVisible(!1,ee.props.blurDelay)},ee.onContextMenu=function(ge){ge.preventDefault(),ee.fireEvents("onContextMenu",ge),ee.setPopupVisible(!0,ge)},ee.onContextMenuClose=function(){ee.isContextMenuToShow()&&ee.close()},ee.onClick=function(ge){if(ee.fireEvents("onClick",ge),ee.focusTime){var De;if(ee.preClickTime&&ee.preTouchTime?De=Math.min(ee.preClickTime,ee.preTouchTime):ee.preClickTime?De=ee.preClickTime:ee.preTouchTime&&(De=ee.preTouchTime),Math.abs(De-ee.focusTime)<20)return;ee.focusTime=0}ee.preClickTime=0,ee.preTouchTime=0,ee.isClickToShow()&&(ee.isClickToHide()||ee.isBlurToHide())&&ge&&ge.preventDefault&&ge.preventDefault();var Ae=!ee.state.popupVisible;(ee.isClickToHide()&&!Ae||Ae&&ee.isClickToShow())&&ee.setPopupVisible(!ee.state.popupVisible,ge)},ee.onPopupMouseDown=function(){if(ee.hasPopupMouseDown=!0,clearTimeout(ee.mouseDownTimeout),ee.mouseDownTimeout=window.setTimeout(function(){ee.hasPopupMouseDown=!1},0),ee.context){var ge;(ge=ee.context).onPopupMouseDown.apply(ge,arguments)}},ee.onDocumentClick=function(ge){if(ee.props.mask&&!ee.props.maskClosable)return;var De=ge.target,Ae=ee.getRootDomNode(),Me=ee.getPopupDomNode();(!Object(yt.a)(Ae,De)||ee.isContextMenuOnly())&&!Object(yt.a)(Me,De)&&!ee.hasPopupMouseDown&&ee.close()},ee.getRootDomNode=function(){var ge=ee.props.getTriggerDOMNode;if(ge)return ge(ee.triggerRef.current);try{var De=Object(dt.a)(ee.triggerRef.current);if(De)return De}catch(Ae){}return St.a.findDOMNode(Object(f.a)(ee))},ee.getPopupClassNameFromAlign=function(ge){var De=[],Ae=ee.props,Me=Ae.popupPlacement,We=Ae.builtinPlacements,st=Ae.prefixCls,at=Ae.alignPoint,At=Ae.getPopupClassNameFromAlign;return Me&&We&&De.push(Je(We,st,ge,at)),At&&De.push(At(ge)),De.join(" ")},ee.getComponent=function(){var ge=ee.props,De=ge.prefixCls,Ae=ge.destroyPopupOnHide,Me=ge.popupClassName,We=ge.onPopupAlign,st=ge.popupMotion,at=ge.popupAnimation,At=ge.popupTransitionName,Xt=ge.popupStyle,ur=ge.mask,rr=ge.maskAnimation,ar=ge.maskTransitionName,dr=ge.maskMotion,sr=ge.zIndex,or=ge.popup,Ar=ge.stretch,mr=ge.alignPoint,Yr=ge.mobile,gr=ge.forceRender,Qt=ee.state,zt=Qt.popupVisible,vr=Qt.point,Tr=ee.getPopupAlign(),Nt={};return ee.isMouseEnterToShow()&&(Nt.onMouseEnter=ee.onPopupMouseEnter),ee.isMouseLeaveToHide()&&(Nt.onMouseLeave=ee.onPopupMouseLeave),Nt.onMouseDown=ee.onPopupMouseDown,Nt.onTouchStart=ee.onPopupMouseDown,D.createElement(Vt,Object(m.a)({prefixCls:De,destroyPopupOnHide:Ae,visible:zt,point:mr&&vr,className:Me,align:Tr,onAlign:We,animation:at,getClassNameFromAlign:ee.getPopupClassNameFromAlign},Nt,{stretch:Ar,getRootDomNode:ee.getRootDomNode,style:Xt,mask:ur,zIndex:sr,transitionName:At,maskAnimation:rr,maskTransitionName:ar,maskMotion:dr,ref:ee.popupRef,motion:st,mobile:Yr,forceRender:gr}),typeof or=="function"?or():or)},ee.attachParent=function(ge){lt.a.cancel(ee.attachId);var De=ee.props,Ae=De.getPopupContainer,Me=De.getDocument,We=ee.getRootDomNode(),st;Ae?(We||Ae.length===0)&&(st=Ae(We)):st=Me(ee.getRootDomNode()).body,st?st.appendChild(ge):ee.attachId=Object(lt.a)(function(){ee.attachParent(ge)})},ee.getContainer=function(){var ge=ee.props.getDocument,De=ge(ee.getRootDomNode()).createElement("div");return De.style.position="absolute",De.style.top="0",De.style.left="0",De.style.width="100%",ee.attachParent(De),De},ee.setPoint=function(ge){var De=ee.props.alignPoint;if(!De||!ge)return;ee.setState({point:{pageX:ge.pageX,pageY:ge.pageY}})},ee.handlePortalUpdate=function(){ee.state.prevPopupVisible!==ee.state.popupVisible&&ee.props.afterPopupVisibleChange(ee.state.popupVisible)},ee.triggerContextValue={onPopupMouseDown:ee.onPopupMouseDown};var fe;return"popupVisible"in oe?fe=!!oe.popupVisible:fe=!!oe.defaultPopupVisible,ee.state={prevPopupVisible:fe,popupVisible:fe},Oi.forEach(function(ge){ee["fire".concat(ge)]=function(De){ee.fireEvents(ge,De)}}),ee}return Object(E.a)(q,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ee=this.props,fe=this.state;if(fe.popupVisible){var ge;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ge=ee.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ie.a)(ge,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ge=ge||ee.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ie.a)(ge,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ge=ge||ee.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ie.a)(ge,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ie.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),lt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var ee;return((ee=this.popupRef.current)===null||ee===void 0?void 0:ee.getElement())||null}},{key:"getPopupAlign",value:function(){var ee=this.props,fe=ee.popupPlacement,ge=ee.popupAlign,De=ee.builtinPlacements;return fe&&De?_e(De,fe,ge):ge}},{key:"setPopupVisible",value:function(ee,fe){var ge=this.props.alignPoint,De=this.state.popupVisible;this.clearDelayTimer(),De!==ee&&("popupVisible"in this.props||this.setState({popupVisible:ee,prevPopupVisible:De}),this.props.onPopupVisibleChange(ee)),ge&&fe&&ee&&this.setPoint(fe)}},{key:"delaySetPopupVisible",value:function(ee,fe,ge){var De=this,Ae=fe*1e3;if(this.clearDelayTimer(),Ae){var Me=ge?{pageX:ge.pageX,pageY:ge.pageY}:null;this.delayTimer=window.setTimeout(function(){De.setPopupVisible(ee,Me),De.clearDelayTimer()},Ae)}else this.setPopupVisible(ee,ge)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(ee){var fe=this.props.children.props,ge=this.props;return fe[ee]&&ge[ee]?this["fire".concat(ee)]:fe[ee]||ge[ee]}},{key:"isClickToShow",value:function(){var ee=this.props,fe=ee.action,ge=ee.showAction;return fe.indexOf("click")!==-1||ge.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var ee=this.props.action;return ee==="contextMenu"||ee.length===1&&ee[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var ee=this.props,fe=ee.action,ge=ee.showAction;return fe.indexOf("contextMenu")!==-1||ge.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var ee=this.props,fe=ee.action,ge=ee.hideAction;return fe.indexOf("click")!==-1||ge.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var ee=this.props,fe=ee.action,ge=ee.showAction;return fe.indexOf("hover")!==-1||ge.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var ee=this.props,fe=ee.action,ge=ee.hideAction;return fe.indexOf("hover")!==-1||ge.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var ee=this.props,fe=ee.action,ge=ee.showAction;return fe.indexOf("focus")!==-1||ge.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var ee=this.props,fe=ee.action,ge=ee.hideAction;return fe.indexOf("focus")!==-1||ge.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var ee;(ee=this.popupRef.current)===null||ee===void 0||ee.forceAlign()}}},{key:"fireEvents",value:function(ee,fe){var ge=this.props.children.props[ee];ge&&ge(fe);var De=this.props[ee];De&&De(fe)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var ee=this.state.popupVisible,fe=this.props,ge=fe.children,De=fe.forceRender,Ae=fe.alignPoint,Me=fe.className,We=fe.autoDestroy,st=D.Children.only(ge),at={key:"trigger"};this.isContextMenuToShow()?at.onContextMenu=this.onContextMenu:at.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(at.onClick=this.onClick,at.onMouseDown=this.onMouseDown,at.onTouchStart=this.onTouchStart):(at.onClick=this.createTwoChains("onClick"),at.onMouseDown=this.createTwoChains("onMouseDown"),at.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(at.onMouseEnter=this.onMouseEnter,Ae&&(at.onMouseMove=this.onMouseMove)):at.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?at.onMouseLeave=this.onMouseLeave:at.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(at.onFocus=this.onFocus,at.onBlur=this.onBlur):(at.onFocus=this.createTwoChains("onFocus"),at.onBlur=this.createTwoChains("onBlur"));var At=H()(st&&st.props&&st.props.className,Me);At&&(at.className=At);var Xt=Object(K.a)({},at);Object(Qe.c)(st)&&(Xt.ref=Object(Qe.a)(this.triggerRef,st.ref));var ur=D.cloneElement(st,Xt),rr;return(ee||this.popupRef.current||De)&&(rr=D.createElement(ue,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!ee&&We&&(rr=null),D.createElement(wr.Provider,{value:this.triggerContextValue},ur,rr)}}],[{key:"getDerivedStateFromProps",value:function(ee,fe){var ge=ee.popupVisible,De={};return ge!==void 0&&fe.popupVisible!==ge&&(De.popupVisible=ge,De.prevPopupVisible=fe.popupVisible),De}}]),q}(D.Component);return Ce.contextType=wr,Ce.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:si,getDocument:nn,onPopupVisibleChange:tr,afterPopupVisibleChange:tr,onPopupAlign:tr,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Ce}var Pn=Fi(Et.a),qr={adjustX:1,adjustY:1},un={topLeft:{points:["bl","tl"],overflow:qr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qr,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:qr,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:qr,offset:[4,0]}},Ei={topLeft:{points:["bl","tl"],overflow:qr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qr,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:qr,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:qr,offset:[4,0]}},hi=un,$r=0,Mr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},an=function(Ce,we,ce){var q=He(we),oe=Ce.getState();Ce.setState({defaultActiveFirst:Object(K.a)(Object(K.a)({},oe.defaultActiveFirst),{},Object(ae.a)({},q,ce))})},cr=function(ue){Object(g.a)(we,ue);var Ce=Object(h.a)(we);function we(ce){var q;Object(R.a)(this,we),q=Ce.call(this,ce),q.onDestroy=function(Ae){q.props.onDestroy(Ae)},q.onKeyDown=function(Ae){var Me=Ae.keyCode,We=q.menuInstance,st=q.props.store,at=q.getVisible();if(Me===x.a.ENTER)return q.onTitleClick(Ae),an(st,q.props.eventKey,!0),!0;if(Me===x.a.RIGHT)return at?We.onKeyDown(Ae):(q.triggerOpenChange(!0),an(st,q.props.eventKey,!0)),!0;if(Me===x.a.LEFT){var At;if(at)At=We.onKeyDown(Ae);else return;return At||(q.triggerOpenChange(!1),At=!0),At}return at&&(Me===x.a.UP||Me===x.a.DOWN)?We.onKeyDown(Ae):void 0},q.onOpenChange=function(Ae){q.props.onOpenChange(Ae)},q.onPopupVisibleChange=function(Ae){q.triggerOpenChange(Ae,Ae?"mouseenter":"mouseleave")},q.onMouseEnter=function(Ae){var Me=q.props,We=Me.eventKey,st=Me.onMouseEnter,at=Me.store;an(at,q.props.eventKey,!1),st({key:We,domEvent:Ae})},q.onMouseLeave=function(Ae){var Me=q.props,We=Me.parentMenu,st=Me.eventKey,at=Me.onMouseLeave;We.subMenuInstance=Object(f.a)(q),at({key:st,domEvent:Ae})},q.onTitleMouseEnter=function(Ae){var Me=q.props,We=Me.eventKey,st=Me.onItemHover,at=Me.onTitleMouseEnter;st({key:We,hover:!0}),at({key:We,domEvent:Ae})},q.onTitleMouseLeave=function(Ae){var Me=q.props,We=Me.parentMenu,st=Me.eventKey,at=Me.onItemHover,At=Me.onTitleMouseLeave;We.subMenuInstance=Object(f.a)(q),at({key:st,hover:!1}),At({key:st,domEvent:Ae})},q.onTitleClick=function(Ae){var Me=Object(f.a)(q),We=Me.props;if(We.onTitleClick({key:We.eventKey,domEvent:Ae}),We.triggerSubMenuAction==="hover")return;q.triggerOpenChange(!q.getVisible(),"click"),an(We.store,q.props.eventKey,!1)},q.onSubMenuClick=function(Ae){typeof q.props.onClick=="function"&&q.props.onClick(q.addKeyPath(Ae))},q.onSelect=function(Ae){q.props.onSelect(Ae)},q.onDeselect=function(Ae){q.props.onDeselect(Ae)},q.getPrefixCls=function(){return"".concat(q.props.rootPrefixCls,"-submenu")},q.getActiveClassName=function(){return"".concat(q.getPrefixCls(),"-active")},q.getDisabledClassName=function(){return"".concat(q.getPrefixCls(),"-disabled")},q.getSelectedClassName=function(){return"".concat(q.getPrefixCls(),"-selected")},q.getOpenClassName=function(){return"".concat(q.props.rootPrefixCls,"-submenu-open")},q.getVisible=function(){return q.state.isOpen},q.getMode=function(){return q.state.mode},q.saveMenuInstance=function(Ae){q.menuInstance=Ae},q.addKeyPath=function(Ae){return Object(K.a)(Object(K.a)({},Ae),{},{keyPath:(Ae.keyPath||[]).concat(q.props.eventKey)})},q.triggerOpenChange=function(Ae,Me){var We=q.props.eventKey,st=function(){q.onOpenChange({key:We,item:Object(f.a)(q),trigger:Me,open:Ae})};Me==="mouseenter"?q.mouseenterTimeout=setTimeout(function(){st()},0):st()},q.isChildrenSelected=function(){var Ae={find:!1};return ut(q.props.children,q.props.selectedKeys,Ae),Ae.find},q.isInlineMode=function(){return q.getMode()==="inline"},q.adjustWidth=function(){if(!q.subMenuTitle||!q.menuInstance)return;var Ae=bt.findDOMNode(q.menuInstance);if(Ae.offsetWidth>=q.subMenuTitle.offsetWidth)return;Ae.style.minWidth="".concat(q.subMenuTitle.offsetWidth,"px")},q.saveSubMenuTitle=function(Ae){q.subMenuTitle=Ae},q.getBaseProps=function(){var Ae=Object(f.a)(q),Me=Ae.props,We=q.getMode();return{mode:We==="horizontal"?"vertical":We,visible:q.getVisible(),level:Me.level+1,inlineIndent:Me.inlineIndent,focusable:!1,onClick:q.onSubMenuClick,onSelect:q.onSelect,onDeselect:q.onDeselect,onDestroy:q.onDestroy,selectedKeys:Me.selectedKeys,eventKey:"".concat(Me.eventKey,"-menu-"),openKeys:Me.openKeys,motion:Me.motion,onOpenChange:q.onOpenChange,subMenuOpenDelay:Me.subMenuOpenDelay,parentMenu:Object(f.a)(q),subMenuCloseDelay:Me.subMenuCloseDelay,forceSubMenuRender:Me.forceSubMenuRender,triggerSubMenuAction:Me.triggerSubMenuAction,builtinPlacements:Me.builtinPlacements,defaultActiveFirst:Me.store.getState().defaultActiveFirst[He(Me.eventKey)],multiple:Me.multiple,prefixCls:Me.rootPrefixCls,id:q.internalMenuId,manualRef:q.saveMenuInstance,itemIcon:Me.itemIcon,expandIcon:Me.expandIcon,direction:Me.direction}},q.getMotion=function(Ae,Me){var We=Object(f.a)(q),st=We.haveRendered,at=q.props,At=at.motion,Xt=at.rootPrefixCls,ur=Object(K.a)(Object(K.a)({},At),{},{leavedClassName:"".concat(Xt,"-hidden"),removeOnLeave:!1,motionAppear:st||!Me||Ae!=="inline"});return ur};var oe=ce.store,ee=ce.eventKey,fe=oe.getState(),ge=fe.defaultActiveFirst;q.isRootMenu=!1;var De=!1;return ge&&(De=ge[ee]),an(oe,ee,De),q.state={mode:ce.mode,isOpen:ce.isOpen},q}return Object(E.a)(we,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var q=this,oe=this.props,ee=oe.mode,fe=oe.parentMenu,ge=oe.manualRef,De=oe.isOpen,Ae=function(){q.setState({mode:ee,isOpen:De})},Me=De!==this.state.isOpen,We=ee!==this.state.mode;if((We||Me)&&(lt.a.cancel(this.updateStateRaf),We?this.updateStateRaf=Object(lt.a)(Ae):Ae()),ge&&ge(this),ee!=="horizontal"||!(fe==null?void 0:fe.isRootMenu)||!De)return;this.minWidthTimeout=setTimeout(function(){return q.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var q=this.props,oe=q.onDestroy,ee=q.eventKey;oe&&oe(ee),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),lt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(q,oe){var ee=this.getBaseProps();return D.createElement(ua,Object(m.a)({},ee,{id:this.internalMenuId,className:q,style:oe}),this.props.children)}},{key:"renderChildren",value:function(){var q=this,oe=this.getBaseProps(),ee=oe.mode,fe=oe.visible,ge=oe.forceSubMenuRender,De=oe.direction,Ae=this.getMotion(ee,fe);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||fe||ge,!this.haveOpened)return D.createElement("div",null);var Me=H()("".concat(oe.prefixCls,"-sub"),Object(ae.a)({},"".concat(oe.prefixCls,"-rtl"),De==="rtl"));return this.isInlineMode()?D.createElement(Z,Object(m.a)({visible:oe.visible,forceRender:ge},Ae),function(We){var st=We.className,at=We.style,At=H()(Me,st);return q.renderPopupMenu(At,at)}):this.renderPopupMenu(Me)}},{key:"render",value:function(){var q,oe,ee,fe=Object(K.a)({},this.props),ge=this.getVisible(),De=this.getPrefixCls(),Ae=this.isInlineMode(),Me=this.getMode(),We=H()(De,"".concat(De,"-").concat(Me),(q={},Object(ae.a)(q,fe.className,!!fe.className),Object(ae.a)(q,this.getOpenClassName(),ge),Object(ae.a)(q,this.getActiveClassName(),fe.active||ge&&!Ae),Object(ae.a)(q,this.getDisabledClassName(),fe.disabled),Object(ae.a)(q,this.getSelectedClassName(),this.isChildrenSelected()),q));this.internalMenuId||(fe.eventKey?this.internalMenuId="".concat(fe.eventKey,"$Menu"):($r+=1,this.internalMenuId="$__$".concat($r,"$Menu")));var st={},at={},At={};fe.disabled||(st={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},at={onClick:this.onTitleClick},At={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Xt={},ur=fe.direction,rr=ur==="rtl";Ae&&(rr?Xt.paddingRight=fe.inlineIndent*fe.level:Xt.paddingLeft=fe.inlineIndent*fe.level);var ar={};this.getVisible()&&(ar={"aria-owns":this.internalMenuId});var dr=null;Me!=="horizontal"&&(dr=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(dr=D.createElement(this.props.expandIcon,Object(K.a)({},this.props))));var sr=D.createElement("div",Object(m.a)({ref:this.saveSubMenuTitle,style:Xt,className:"".concat(De,"-title"),role:"button"},At,at,{"aria-expanded":ge},ar,{"aria-haspopup":"true",title:typeof fe.title=="string"?fe.title:void 0}),fe.title,dr||D.createElement("i",{className:"".concat(De,"-arrow")})),or=this.renderChildren(),Ar=((oe=fe.parentMenu)===null||oe===void 0?void 0:oe.isRootMenu)?fe.parentMenu.props.getPopupContainer:function(Wr){return Wr.parentNode},mr=Mr[Me],Yr=fe.popupOffset?{offset:fe.popupOffset}:{},gr=H()((ee={},Object(ae.a)(ee,fe.popupClassName,fe.popupClassName&&!Ae),Object(ae.a)(ee,"".concat(De,"-rtl"),rr),ee)),Qt=fe.disabled,zt=fe.triggerSubMenuAction,vr=fe.subMenuOpenDelay,Tr=fe.forceSubMenuRender,Nt=fe.subMenuCloseDelay,Or=fe.builtinPlacements;vt.forEach(function(Wr){return delete fe[Wr]}),delete fe.onClick;var Jr=rr?Object(K.a)(Object(K.a)({},Ei),Or):Object(K.a)(Object(K.a)({},un),Or);delete fe.direction;var kr=this.getBaseProps(),Kr=Ae?null:this.getMotion(kr.mode,kr.visible);return D.createElement("li",Object(m.a)({},fe,st,{className:We,role:"menuitem"}),D.createElement(Pn,{prefixCls:De,popupClassName:H()("".concat(De,"-popup"),gr),getPopupContainer:Ar,builtinPlacements:Jr,popupPlacement:mr,popupVisible:Ae?!1:ge,popupAlign:Yr,popup:Ae?null:or,action:Qt||Ae?[]:[zt],mouseEnterDelay:vr,mouseLeaveDelay:Nt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Tr,popupMotion:Kr},sr),Ae?or:null)}}]),we}(D.Component);cr.defaultProps={onMouseEnter:ft,onMouseLeave:ft,onTitleMouseEnter:ft,onTitleMouseLeave:ft,onTitleClick:ft,manualRef:ft,mode:"vertical",title:""};var on=Object(o.b)(function(ue,Ce){var we=ue.openKeys,ce=ue.activeKey,q=ue.selectedKeys,oe=Ce.eventKey,ee=Ce.subMenuKey;return{isOpen:we.indexOf(oe)>-1,active:ce[ee]===oe,selectedKeys:q}})(cr);on.isSubMenu=!0;var Br=on,fi="menuitem-overflowed",En=.5,Mn=function(ue){Object(g.a)(we,ue);var Ce=Object(h.a)(we);function we(){var ce;return Object(R.a)(this,we),ce=Ce.apply(this,arguments),ce.resizeObserver=null,ce.mutationObserver=null,ce.originalTotalWidth=0,ce.overflowedItems=[],ce.menuItemSizes=[],ce.cancelFrameId=null,ce.state={lastVisibleIndex:void 0},ce.childRef=D.createRef(),ce.getMenuItemNodes=function(){var q=ce.props.prefixCls,oe=ce.childRef.current;return oe?[].slice.call(oe.children).filter(function(ee){return ee.className.split(" ").indexOf("".concat(q,"-overflowed-submenu"))<0}):[]},ce.getOverflowedSubMenuItem=function(q,oe,ee){var fe=ce.props,ge=fe.overflowedIndicator,De=fe.level,Ae=fe.mode,Me=fe.prefixCls,We=fe.theme;if(De!==1||Ae!=="horizontal")return null;var st=ce.props.children[0],at=st.props,At=at.children,Xt=at.title,ur=at.style,rr=Object(M.a)(at,["children","title","style"]),ar=Object(K.a)({},ur),dr="".concat(q,"-overflowed-indicator"),sr="".concat(q,"-overflowed-indicator");oe.length===0&&ee!==!0?ar=Object(K.a)(Object(K.a)({},ar),{},{display:"none"}):ee&&(ar=Object(K.a)(Object(K.a)({},ar),{},{visibility:"hidden",position:"absolute"}),dr="".concat(dr,"-placeholder"),sr="".concat(sr,"-placeholder"));var or=We?"".concat(Me,"-").concat(We):"",Ar={};return vt.forEach(function(mr){rr[mr]!==void 0&&(Ar[mr]=rr[mr])}),D.createElement(Br,Object(m.a)({title:ge,className:"".concat(Me,"-overflowed-submenu"),popupClassName:or},Ar,{key:dr,eventKey:sr,disabled:!1,style:ar}),oe)},ce.setChildrenWidthAndResize=function(){if(ce.props.mode!=="horizontal")return;var q=ce.childRef.current;if(!q)return;var oe=q.children;if(!oe||oe.length===0)return;var ee=q.children[oe.length-1];et(ee,"display","inline-block");var fe=ce.getMenuItemNodes(),ge=fe.filter(function(De){return De.className.split(" ").indexOf(fi)>=0});ge.forEach(function(De){et(De,"display","inline-block")}),ce.menuItemSizes=fe.map(function(De){return ht(De,!0)}),ge.forEach(function(De){et(De,"display","none")}),ce.overflowedIndicatorWidth=ht(q.children[q.children.length-1],!0),ce.originalTotalWidth=ce.menuItemSizes.reduce(function(De,Ae){return De+Ae},0),ce.handleResize(),et(ee,"display","none")},ce.handleResize=function(){if(ce.props.mode!=="horizontal")return;var q=ce.childRef.current;if(!q)return;var oe=ht(q);ce.overflowedItems=[];var ee=0,fe;ce.originalTotalWidth>oe+En&&(fe=-1,ce.menuItemSizes.forEach(function(ge){ee+=ge,ee+ce.overflowedIndicatorWidth<=oe&&(fe+=1)})),ce.setState({lastVisibleIndex:fe})},ce}return Object(E.a)(we,[{key:"componentDidMount",value:function(){var q=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var oe=this.childRef.current;if(!oe)return;this.resizeObserver=new Tt.default(function(ee){ee.forEach(function(){var fe=q.cancelFrameId;cancelAnimationFrame(fe),q.cancelFrameId=requestAnimationFrame(q.setChildrenWidthAndResize)})}),[].slice.call(oe.children).concat(oe).forEach(function(ee){q.resizeObserver.observe(ee)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){q.resizeObserver.disconnect(),[].slice.call(oe.children).concat(oe).forEach(function(ee){q.resizeObserver.observe(ee)}),q.setChildrenWidthAndResize()}),this.mutationObserver.observe(oe,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(q){var oe=this,ee=this.state.lastVisibleIndex;return(q||[]).reduce(function(fe,ge,De){var Ae=ge;if(oe.props.mode==="horizontal"){var Me=oe.getOverflowedSubMenuItem(ge.props.eventKey,[]);ee!==void 0&&oe.props.className.indexOf("".concat(oe.props.prefixCls,"-root"))!==-1&&(De>ee&&(Ae=D.cloneElement(ge,{style:{display:"none"},eventKey:"".concat(ge.props.eventKey,"-hidden"),className:"".concat(fi)})),De===ee+1&&(oe.overflowedItems=q.slice(ee+1).map(function(st){return D.cloneElement(st,{key:st.props.eventKey,mode:"vertical-left"})}),Me=oe.getOverflowedSubMenuItem(ge.props.eventKey,oe.overflowedItems)));var We=[].concat(Object(L.a)(fe),[Me,Ae]);return De===q.length-1&&We.push(oe.getOverflowedSubMenuItem(ge.props.eventKey,[],!0)),We}return[].concat(Object(L.a)(fe),[Ae])},[])}},{key:"render",value:function(){var q=this.props,oe=q.visible,ee=q.prefixCls,fe=q.overflowedIndicator,ge=q.mode,De=q.level,Ae=q.tag,Me=q.children,We=q.theme,st=Object(M.a)(q,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),at=Ae;return D.createElement(at,Object(m.a)({ref:this.childRef},st),this.renderChildren(Me))}}]),we}(D.Component);Mn.defaultProps={tag:"div",className:""};var Xi=Mn;function Ri(ue){return ue.length?ue.every(function(Ce){return!!Ce.props.disabled}):!0}function Mi(ue,Ce,we){var ce=ue.getState();ue.setState({activeKey:Object(K.a)(Object(K.a)({},ce.activeKey),{},Object(ae.a)({},Ce,we))})}function $n(ue){return ue.eventKey||"0-menu-"}function ei(ue,Ce){var we=Ce,ce=ue.children,q=ue.eventKey;if(we){var oe;if(Ke(ce,function(ee,fe){ee&&ee.props&&!ee.props.disabled&&we===Ct(ee,q,fe)&&(oe=!0)}),oe)return we}return we=null,ue.defaultActiveFirst&&Ke(ce,function(ee,fe){!we&&ee&&!ee.props.disabled&&(we=Ct(ee,q,fe))}),we}function sa(ue){if(!ue)return;var Ce=this.instanceArray.indexOf(ue);Ce!==-1?this.instanceArray[Ce]=ue:this.instanceArray.push(ue)}var li=function(ue){Object(g.a)(we,ue);var Ce=Object(h.a)(we);function we(ce){var q;return Object(R.a)(this,we),q=Ce.call(this,ce),q.onKeyDown=function(oe,ee){var fe=oe.keyCode,ge;if(q.getFlatInstanceArray().forEach(function(Ae){Ae&&Ae.props.active&&Ae.onKeyDown&&(ge=Ae.onKeyDown(oe))}),ge)return 1;var De=null;return(fe===x.a.UP||fe===x.a.DOWN)&&(De=q.step(fe===x.a.UP?-1:1)),De?(oe.preventDefault(),Mi(q.props.store,$n(q.props),De.props.eventKey),typeof ee=="function"&&ee(De),1):void 0},q.onItemHover=function(oe){var ee=oe.key,fe=oe.hover;Mi(q.props.store,$n(q.props),fe?ee:null)},q.onDeselect=function(oe){q.props.onDeselect(oe)},q.onSelect=function(oe){q.props.onSelect(oe)},q.onClick=function(oe){q.props.onClick(oe)},q.onOpenChange=function(oe){q.props.onOpenChange(oe)},q.onDestroy=function(oe){q.props.onDestroy(oe)},q.getFlatInstanceArray=function(){return q.instanceArray},q.step=function(oe){var ee=q.getFlatInstanceArray(),fe=q.props.store.getState().activeKey[$n(q.props)],ge=ee.length;if(!ge)return null;oe<0&&(ee=ee.concat().reverse());var De=-1;if(ee.every(function(st,at){return st&&st.props.eventKey===fe?(De=at,!1):!0}),!q.props.defaultActiveFirst&&De!==-1&&Ri(ee.slice(De,ge-1)))return;var Ae=(De+1)%ge,Me=Ae;do{var We=ee[Me];if(!We||We.props.disabled)Me=(Me+1)%ge;else return We}while(Me!==Ae);return null},q.renderCommonMenuItem=function(oe,ee,fe){var ge=q.props.store.getState(),De=Object(f.a)(q),Ae=De.props,Me=Ct(oe,Ae.eventKey,ee),We=oe.props;if(!We||typeof oe.type=="string")return oe;var st=Me===ge.activeKey,at=Object(K.a)(Object(K.a)({mode:We.mode||Ae.mode,level:Ae.level,inlineIndent:Ae.inlineIndent,renderMenuItem:q.renderMenuItem,rootPrefixCls:Ae.prefixCls,index:ee,parentMenu:Ae.parentMenu,manualRef:We.disabled?void 0:Object(b.a)(oe.ref,sa.bind(Object(f.a)(q))),eventKey:Me,active:!We.disabled&&st,multiple:Ae.multiple,onClick:function(Xt){(We.onClick||ft)(Xt),q.onClick(Xt)},onItemHover:q.onItemHover,motion:Ae.motion,subMenuOpenDelay:Ae.subMenuOpenDelay,subMenuCloseDelay:Ae.subMenuCloseDelay,forceSubMenuRender:Ae.forceSubMenuRender,onOpenChange:q.onOpenChange,onDeselect:q.onDeselect,onSelect:q.onSelect,builtinPlacements:Ae.builtinPlacements,itemIcon:We.itemIcon||q.props.itemIcon,expandIcon:We.expandIcon||q.props.expandIcon},fe),{},{direction:Ae.direction});return(Ae.mode==="inline"||Ze())&&(at.triggerSubMenuAction="click"),D.cloneElement(oe,Object(K.a)(Object(K.a)({},at),{},{key:Me||ee}))},q.renderMenuItem=function(oe,ee,fe){if(!oe)return null;var ge=q.props.store.getState(),De={openKeys:ge.openKeys,selectedKeys:ge.selectedKeys,triggerSubMenuAction:q.props.triggerSubMenuAction,subMenuKey:fe};return q.renderCommonMenuItem(oe,ee,De)},ce.store.setState({activeKey:Object(K.a)(Object(K.a)({},ce.store.getState().activeKey),{},Object(ae.a)({},ce.eventKey,ei(ce,ce.activeKey)))}),q.instanceArray=[],q}return Object(E.a)(we,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(q){return this.props.visible||q.visible||this.props.className!==q.className||!N()(this.props.style,q.style)}},{key:"componentDidUpdate",value:function(q){var oe=this.props,ee="activeKey"in oe?oe.activeKey:oe.store.getState().activeKey[$n(oe)],fe=ei(oe,ee);if(fe!==ee)Mi(oe.store,$n(oe),fe);else if("activeKey"in q){var ge=ei(q,q.activeKey);fe!==ge&&Mi(oe.store,$n(oe),fe)}}},{key:"render",value:function(){var q=this,oe=Object(m.a)({},this.props);this.instanceArray=[];var ee=H()(oe.prefixCls,oe.className,"".concat(oe.prefixCls,"-").concat(oe.mode)),fe={className:ee,role:oe.role||"menu"};oe.id&&(fe.id=oe.id),oe.focusable&&(fe.tabIndex=0,fe.onKeyDown=this.onKeyDown);var ge=oe.prefixCls,De=oe.eventKey,Ae=oe.visible,Me=oe.level,We=oe.mode,st=oe.overflowedIndicator,at=oe.theme;return vt.forEach(function(At){return delete oe[At]}),delete oe.onClick,D.createElement(Xi,Object(m.a)({},oe,{prefixCls:ge,mode:We,tag:"ul",level:Me,theme:at,visible:Ae,overflowedIndicator:st},fe),Object(W.a)(oe.children).map(function(At,Xt){return q.renderMenuItem(At,Xt,De||"0-menu-")}))}}]),we}(D.Component);li.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:ft};var la=Object(o.b)()(li),ua=la,ji=Q("Kwbf");function Ua(ue,Ce,we){var ce=ue.prefixCls,q=ue.motion,oe=ue.defaultMotions,ee=oe===void 0?{}:oe,fe=ue.openAnimation,ge=ue.openTransitionName,De=Ce.switchingModeFromInline;if(q)return q;if(Object(z.a)(fe)==="object"&&fe)Object(ji.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof fe=="string")return{motionName:"".concat(ce,"-open-").concat(fe)};if(ge)return{motionName:ge};var Ae=ee[we];return Ae||(De?null:ee.other)}var Bt=function(ue){Object(g.a)(we,ue);var Ce=Object(h.a)(we);function we(ce){var q;Object(R.a)(this,we),q=Ce.call(this,ce),q.onSelect=function(fe){var ge=Object(f.a)(q),De=ge.props;if(De.selectable){var Ae=q.store.getState(),Me=Ae.selectedKeys,We=fe.key;De.multiple?Me=Me.concat([We]):Me=[We],"selectedKeys"in De||q.store.setState({selectedKeys:Me}),De.onSelect(Object(K.a)(Object(K.a)({},fe),{},{selectedKeys:Me}))}},q.onClick=function(fe){var ge=q.getRealMenuMode(),De=Object(f.a)(q),Ae=De.store,Me=De.props.onOpenChange;ge!=="inline"&&!("openKeys"in q.props)&&(Ae.setState({openKeys:[]}),Me([])),q.props.onClick(fe)},q.onKeyDown=function(fe,ge){q.innerMenu.getWrappedInstance().onKeyDown(fe,ge)},q.onOpenChange=function(fe){var ge=Object(f.a)(q),De=ge.props,Ae=q.store.getState().openKeys.concat(),Me=!1,We=function(at){var At=!1;if(at.open)At=Ae.indexOf(at.key)===-1,At&&Ae.push(at.key);else{var Xt=Ae.indexOf(at.key);At=Xt!==-1,At&&Ae.splice(Xt,1)}Me=Me||At};Array.isArray(fe)?fe.forEach(We):We(fe),Me&&("openKeys"in q.props||q.store.setState({openKeys:Ae}),De.onOpenChange(Ae))},q.onDeselect=function(fe){var ge=Object(f.a)(q),De=ge.props;if(De.selectable){var Ae=q.store.getState().selectedKeys.concat(),Me=fe.key,We=Ae.indexOf(Me);We!==-1&&Ae.splice(We,1),"selectedKeys"in De||q.store.setState({selectedKeys:Ae}),De.onDeselect(Object(K.a)(Object(K.a)({},fe),{},{selectedKeys:Ae}))}},q.onMouseEnter=function(fe){q.restoreModeVerticalFromInline();var ge=q.props.onMouseEnter;ge&&ge(fe)},q.onTransitionEnd=function(fe){var ge=fe.propertyName==="width"&&fe.target===fe.currentTarget,De=fe.target.className,Ae=Object.prototype.toString.call(De)==="[object SVGAnimatedString]"?De.animVal:De,Me=fe.propertyName==="font-size"&&Ae.indexOf("anticon")>=0;(ge||Me)&&q.restoreModeVerticalFromInline()},q.setInnerMenu=function(fe){q.innerMenu=fe},q.isRootMenu=!0;var oe=ce.defaultSelectedKeys,ee=ce.defaultOpenKeys;return"selectedKeys"in ce&&(oe=ce.selectedKeys||[]),"openKeys"in ce&&(ee=ce.openKeys||[]),q.store=Object(o.c)({selectedKeys:oe,openKeys:ee,activeKey:{"0-menu-":ei(ce,ce.activeKey)}}),q.state={switchingModeFromInline:!1,prevProps:ce,inlineOpenKeys:[],store:q.store},q}return Object(E.a)(we,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(q){var oe=this.props,ee=oe.siderCollapsed,fe=oe.inlineCollapsed,ge=oe.onOpenChange;(!q.inlineCollapsed&&fe||!q.siderCollapsed&&ee)&&ge([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var q=this.props.collapsedWidth,oe=this.store,ee=this.prevOpenKeys,fe=this.getInlineCollapsed()&&(q===0||q==="0"||q==="0px");fe?(this.prevOpenKeys=oe.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ee&&(this.store.setState({openKeys:ee}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var q=this.props.mode,oe=this.state.switchingModeFromInline,ee=this.getInlineCollapsed();return oe&&ee?"inline":ee?"vertical":q}},{key:"getInlineCollapsed",value:function(){var q=this.props,oe=q.inlineCollapsed,ee=q.siderCollapsed;return ee!==void 0?ee:oe}},{key:"restoreModeVerticalFromInline",value:function(){var q=this.state.switchingModeFromInline;q&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var q=Object(K.a)({},Object(S.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),oe=this.getRealMenuMode();return q.className+=" ".concat(q.prefixCls,"-root"),q.direction==="rtl"&&(q.className+=" ".concat(q.prefixCls,"-rtl")),q=Object(K.a)(Object(K.a)({},q),{},{mode:oe,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ua(this.props,this.state,oe)}),delete q.openAnimation,delete q.openTransitionName,D.createElement(o.a,{store:this.store},D.createElement(ua,Object(m.a)({},q,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(q,oe){var ee=oe.prevProps,fe=oe.store,ge=fe.getState(),De={},Ae={prevProps:q};return ee.mode==="inline"&&q.mode!=="inline"&&(Ae.switchingModeFromInline=!0),"openKeys"in q?De.openKeys=q.openKeys||[]:((q.inlineCollapsed&&!ee.inlineCollapsed||q.siderCollapsed&&!ee.siderCollapsed)&&(Ae.switchingModeFromInline=!0,Ae.inlineOpenKeys=ge.openKeys,De.openKeys=[]),(!q.inlineCollapsed&&ee.inlineCollapsed||!q.siderCollapsed&&ee.siderCollapsed)&&(De.openKeys=oe.inlineOpenKeys,Ae.inlineOpenKeys=[])),Object.keys(De).length&&fe.setState(De),Ae}}]),we}(D.Component);Bt.defaultProps={selectable:!0,onClick:ft,onSelect:ft,onOpenChange:ft,onDeselect:ft,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:D.createElement("span",null,"\xB7\xB7\xB7")};var qt=Bt,Ht=function(ue){Object(g.a)(we,ue);var Ce=Object(h.a)(we);function we(){var ce;return Object(R.a)(this,we),ce=Ce.apply(this,arguments),ce.onKeyDown=function(q){var oe=q.keyCode;return oe===x.a.ENTER?(ce.onClick(q),!0):void 0},ce.onMouseLeave=function(q){var oe=ce.props,ee=oe.eventKey,fe=oe.onItemHover,ge=oe.onMouseLeave;fe({key:ee,hover:!1}),ge({key:ee,domEvent:q})},ce.onMouseEnter=function(q){var oe=ce.props,ee=oe.eventKey,fe=oe.onItemHover,ge=oe.onMouseEnter;fe({key:ee,hover:!0}),ge({key:ee,domEvent:q})},ce.onClick=function(q){var oe=ce.props,ee=oe.eventKey,fe=oe.multiple,ge=oe.onClick,De=oe.onSelect,Ae=oe.onDeselect,Me=oe.isSelected,We={key:ee,keyPath:[ee],item:Object(f.a)(ce),domEvent:q};ge(We),fe?Me?Ae(We):De(We):Me||De(We)},ce.saveNode=function(q){ce.node=q},ce}return Object(E.a)(we,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var q=this.props;q.onDestroy&&q.onDestroy(q.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var q,oe=Object(K.a)({},this.props),ee=H()(this.getPrefixCls(),oe.className,(q={},Object(ae.a)(q,this.getActiveClassName(),!oe.disabled&&oe.active),Object(ae.a)(q,this.getSelectedClassName(),oe.isSelected),Object(ae.a)(q,this.getDisabledClassName(),oe.disabled),q)),fe=Object(K.a)(Object(K.a)({},oe.attribute),{},{title:typeof oe.title=="string"?oe.title:void 0,className:ee,role:oe.role||"menuitem","aria-disabled":oe.disabled});oe.role==="option"?fe=Object(K.a)(Object(K.a)({},fe),{},{role:"option","aria-selected":oe.isSelected}):(oe.role===null||oe.role==="none")&&(fe.role="none");var ge={onClick:oe.disabled?null:this.onClick,onMouseLeave:oe.disabled?null:this.onMouseLeave,onMouseEnter:oe.disabled?null:this.onMouseEnter},De=Object(K.a)({},oe.style);oe.mode==="inline"&&(oe.direction==="rtl"?De.paddingRight=oe.inlineIndent*oe.level:De.paddingLeft=oe.inlineIndent*oe.level),vt.forEach(function(Me){return delete oe[Me]}),delete oe.direction;var Ae=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ae=D.createElement(this.props.itemIcon,this.props)),D.createElement("li",Object(m.a)({},Object(S.a)(oe,["onClick","onMouseEnter","onMouseLeave","onSelect"]),fe,ge,{style:De,ref:this.saveNode}),oe.children,Ae)}}]),we}(D.Component);Ht.isMenuItem=!0,Ht.defaultProps={onSelect:ft,onMouseEnter:ft,onMouseLeave:ft,manualRef:ft};var hr=Object(o.b)(function(ue,Ce){var we=ue.activeKey,ce=ue.selectedKeys,q=Ce.eventKey,oe=Ce.subMenuKey;return{active:we[oe]===q,isSelected:Array.isArray(ce)?ce.indexOf(q)!==-1:ce===q}})(Ht),Dr=hr,Ur=function(ue){Object(g.a)(we,ue);var Ce=Object(h.a)(we);function we(){var ce;return Object(R.a)(this,we),ce=Ce.apply(this,arguments),ce.renderInnerMenuItem=function(q){var oe=ce.props,ee=oe.renderMenuItem,fe=oe.index;return ee(q,fe,ce.props.subMenuKey)},ce}return Object(E.a)(we,[{key:"render",value:function(){var q=Object(m.a)({},this.props),oe=q.className,ee=oe===void 0?"":oe,fe=q.rootPrefixCls,ge="".concat(fe,"-item-group-title"),De="".concat(fe,"-item-group-list"),Ae=q.title,Me=q.children;return vt.forEach(function(We){return delete q[We]}),delete q.direction,D.createElement("li",Object(m.a)({},q,{onClick:function(st){return st.stopPropagation()},className:"".concat(ee," ").concat(fe,"-item-group")}),D.createElement("div",{className:ge,title:typeof Ae=="string"?Ae:void 0},Ae),D.createElement("ul",{className:De},D.Children.map(Me,this.renderInnerMenuItem)))}}]),we}(D.Component);Ur.isMenuItemGroup=!0,Ur.defaultProps={disabled:!0};var Sr=Ur,dn=function(Ce){var we=Ce.className,ce=Ce.rootPrefixCls,q=Ce.style;return D.createElement("li",{className:"".concat(we," ").concat(ce,"-item-divider"),style:q})};dn.defaultProps={disabled:!0,className:"",style:{}};var Gn=dn,pr=qt,Ci=Q("eDIo");function Ir(ue,Ce){var we=ue.prefixCls,ce=ue.editable,q=ue.locale,oe=ue.style;return!ce||ce.showAdd===!1?null:D.createElement("button",{ref:Ce,type:"button",className:"".concat(we,"-nav-add"),style:oe,"aria-label":(q==null?void 0:q.addAriaLabel)||"Add tab",onClick:function(fe){ce.onEdit("add",{event:fe})}},ce.addIcon||"+")}var _n=D.forwardRef(Ir);function kn(ue,Ce){var we=ue.prefixCls,ce=ue.id,q=ue.tabs,oe=ue.locale,ee=ue.mobile,fe=ue.moreIcon,ge=fe===void 0?"More":fe,De=ue.moreTransitionName,Ae=ue.style,Me=ue.className,We=ue.editable,st=ue.tabBarGutter,at=ue.rtl,At=ue.onTabClick,Xt=Object(D.useState)(!1),ur=Object(X.a)(Xt,2),rr=ur[0],ar=ur[1],dr=Object(D.useState)(null),sr=Object(X.a)(dr,2),or=sr[0],Ar=sr[1],mr="".concat(ce,"-more-popup"),Yr="".concat(we,"-dropdown"),gr=or!==null?"".concat(mr,"-").concat(or):null,Qt=oe==null?void 0:oe.dropdownAriaLabel,zt=D.createElement(pr,{onClick:function(Kr){var Wr=Kr.key,hn=Kr.domEvent;At(Wr,hn),ar(!1)},id:mr,tabIndex:-1,role:"listbox","aria-activedescendant":gr,selectedKeys:[or],"aria-label":Qt!==void 0?Qt:"expanded dropdown"},q.map(function(kr){return D.createElement(Dr,{key:kr.key,id:"".concat(mr,"-").concat(kr.key),role:"option","aria-controls":ce&&"".concat(ce,"-panel-").concat(kr.key),disabled:kr.disabled},kr.tab)}));function vr(kr){for(var Kr=q.filter(function(Fn){return!Fn.disabled}),Wr=Kr.findIndex(function(Fn){return Fn.key===or})||0,hn=Kr.length,Sn=0;Sn<hn;Sn+=1){Wr=(Wr+kr+hn)%hn;var en=Kr[Wr];if(!en.disabled){Ar(en.key);return}}}function Tr(kr){var Kr=kr.which;if(!rr){[x.a.DOWN,x.a.SPACE,x.a.ENTER].includes(Kr)&&(ar(!0),kr.preventDefault());return}switch(Kr){case x.a.UP:vr(-1),kr.preventDefault();break;case x.a.DOWN:vr(1),kr.preventDefault();break;case x.a.ESC:ar(!1);break;case x.a.SPACE:case x.a.ENTER:or!==null&&At(or,kr);break}}Object(D.useEffect)(function(){var kr=document.getElementById(gr);kr&&kr.scrollIntoView&&kr.scrollIntoView(!1)},[or]),Object(D.useEffect)(function(){rr||Ar(null)},[rr]);var Nt=Object(ae.a)({},at?"marginLeft":"marginRight",st);q.length||(Nt.visibility="hidden",Nt.order=1);var Or=H()(Object(ae.a)({},"".concat(Yr,"-rtl"),at)),Jr=ee?null:D.createElement(Ci.a,{prefixCls:Yr,overlay:zt,trigger:["hover"],visible:rr,transitionName:De,onVisibleChange:ar,overlayClassName:Or,mouseEnterDelay:.1,mouseLeaveDelay:.1},D.createElement("button",{type:"button",className:"".concat(we,"-nav-more"),style:Nt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":mr,id:"".concat(ce,"-more"),"aria-expanded":rr,onKeyDown:Tr},ge));return D.createElement("div",{className:H()("".concat(we,"-nav-operations"),Me),style:Ae,ref:Ce},Jr,D.createElement(_n,{prefixCls:we,locale:oe,editable:We}))}var ui=D.forwardRef(kn),Fa=Object(D.createContext)(null),Ko=.1,Yi=.01,cn=20,go=Math.pow(.995,cn);function vo(){var ue=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ue)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ue.substr(0,4)))}function da(ue,Ce){var we=Object(D.useState)(),ce=Object(X.a)(we,2),q=ce[0],oe=ce[1],ee=Object(D.useState)(0),fe=Object(X.a)(ee,2),ge=fe[0],De=fe[1],Ae=Object(D.useState)(0),Me=Object(X.a)(Ae,2),We=Me[0],st=Me[1],at=Object(D.useState)(),At=Object(X.a)(at,2),Xt=At[0],ur=At[1],rr=Object(D.useRef)();function ar(Qt){var zt=Qt.touches[0],vr=zt.screenX,Tr=zt.screenY;oe({x:vr,y:Tr}),window.clearInterval(rr.current)}function dr(Qt){if(!q)return;Qt.preventDefault();var zt=Qt.touches[0],vr=zt.screenX,Tr=zt.screenY;oe({x:vr,y:Tr});var Nt=vr-q.x,Or=Tr-q.y;Ce(Nt,Or);var Jr=Date.now();De(Jr),st(Jr-ge),ur({x:Nt,y:Or})}function sr(){if(!q)return;if(oe(null),ur(null),Xt){var Qt=Xt.x/We,zt=Xt.y/We,vr=Math.abs(Qt),Tr=Math.abs(zt);if(Math.max(vr,Tr)<Ko)return;var Nt=Qt,Or=zt;rr.current=window.setInterval(function(){if(Math.abs(Nt)<Yi&&Math.abs(Or)<Yi){window.clearInterval(rr.current);return}Nt*=go,Or*=go,Ce(Nt*cn,Or*cn)},cn)}}var or=Object(D.useRef)(0),Ar=Object(D.useRef)(!1),mr=Object(D.useRef)();function Yr(Qt){var zt=Qt.deltaX,vr=Qt.deltaY,Tr=0,Nt=Math.abs(zt),Or=Math.abs(vr);Nt===Or?Tr=mr.current==="x"?zt:vr:Nt>Or?(Tr=zt,mr.current="x"):(Tr=vr,mr.current="y");var Jr=Date.now();Jr-or.current>100&&(Ar.current=!1),(Ce(-Tr,-Tr)||Ar.current)&&(Qt.preventDefault(),Ar.current=!0),or.current=Jr}var gr=Object(D.useRef)(null);gr.current={onTouchStart:ar,onTouchMove:dr,onTouchEnd:sr,onWheel:Yr},D.useEffect(function(){function Qt(Nt){gr.current.onTouchStart(Nt)}function zt(Nt){gr.current.onTouchMove(Nt)}function vr(Nt){gr.current.onTouchEnd(Nt)}function Tr(Nt){gr.current.onWheel(Nt)}return document.addEventListener("touchmove",zt,{passive:!1}),document.addEventListener("touchend",vr,{passive:!1}),ue.current.addEventListener("touchstart",Qt,{passive:!1}),ue.current.addEventListener("wheel",Tr),function(){document.removeEventListener("touchmove",zt),document.removeEventListener("touchend",vr)}},[])}function zo(){var ue=Object(D.useRef)(new Map);function Ce(ce){return ue.current.has(ce)||ue.current.set(ce,D.createRef()),ue.current.get(ce)}function we(ce){ue.current.delete(ce)}return[Ce,we]}function ja(ue,Ce){var we=D.useRef(ue),ce=D.useState({}),q=Object(X.a)(ce,2),oe=q[1];function ee(fe){var ge=typeof fe=="function"?fe(we.current):fe;ge!==we.current&&Ce(ge,we.current),we.current=ge,oe({})}return[we.current,ee]}var yo=function(Ce){var we=Ce.position,ce=Ce.prefixCls,q=Ce.extra;if(!q)return null;var oe,ee=q;return we==="right"&&(oe=ee.right||!ee.left&&ee||null),we==="left"&&(oe=ee.left||null),oe?D.createElement("div",{className:"".concat(ce,"-extra-content")},oe):null};function Wa(ue,Ce){var we,ce=D.useContext(Fa),q=ce.prefixCls,oe=ce.tabs,ee=ue.className,fe=ue.style,ge=ue.id,De=ue.animated,Ae=ue.activeKey,Me=ue.rtl,We=ue.extra,st=ue.editable,at=ue.locale,At=ue.tabPosition,Xt=ue.tabBarGutter,ur=ue.children,rr=ue.onTabClick,ar=ue.onTabScroll,dr=Object(D.useRef)(),sr=Object(D.useRef)(),or=Object(D.useRef)(),Ar=Object(D.useRef)(),mr=zo(),Yr=Object(X.a)(mr,2),gr=Yr[0],Qt=Yr[1],zt=At==="top"||At==="bottom",vr=ja(0,function(_r,Er){zt&&ar&&ar({direction:_r>Er?"left":"right"})}),Tr=Object(X.a)(vr,2),Nt=Tr[0],Or=Tr[1],Jr=ja(0,function(_r,Er){!zt&&ar&&ar({direction:_r>Er?"top":"bottom"})}),kr=Object(X.a)(Jr,2),Kr=kr[0],Wr=kr[1],hn=Object(D.useState)(0),Sn=Object(X.a)(hn,2),en=Sn[0],Fn=Sn[1],pi=Object(D.useState)(0),Vn=Object(X.a)(pi,2),An=Vn[0],Qr=Vn[1],zr=Object(D.useState)(0),tn=Object(X.a)(zr,2),Zr=tn[0],mi=tn[1],ki=Object(D.useState)(0),Li=Object(X.a)(ki,2),Hr=Li[0],xi=Li[1],Ii=Object(D.useState)(null),Vr=Object(X.a)(Ii,2),Fr=Vr[0],Tn=Vr[1],xo=Object(D.useState)(null),Ga=Object(X.a)(xo,2),Pi=Ga[0],Zi=Ga[1],ya=Object(D.useState)(0),Va=Object(X.a)(ya,2),ba=Va[0],Qo=Va[1],Xo=Object(D.useState)(0),Co=Object(X.a)(Xo,2),Qa=Co[0],Xa=Co[1],qi=A(new Map),$i=Object(X.a)(qi,2),Yo=$i[0],Ea=$i[1],ca=s(oe,Yo,en),ea="".concat(q,"-nav-operations-hidden"),ta=0,gi=0;zt?Me?(ta=0,gi=Math.max(0,en-Fr)):(ta=Math.min(0,Fr-en),gi=0):(ta=Math.min(0,Pi-An),gi=0);function Wi(_r){return _r<ta?[ta,!1]:_r>gi?[gi,!1]:[_r,!0]}var _i=Object(D.useRef)(),ha=Object(D.useState)(),Hi=Object(X.a)(ha,2),xa=Hi[0],Ya=Hi[1];function Ca(){Ya(Date.now())}function Ja(){window.clearTimeout(_i.current)}da(dr,function(_r,Er){var wn=!1;function Xn(ra,Ai){ra(function(ma){var Bi=Wi(ma+Ai),Dn=Object(X.a)(Bi,2),Ta=Dn[0],qa=Dn[1];return wn=qa,Ta})}if(zt){if(Fr>=en)return wn;Xn(Or,_r)}else{if(Pi>=An)return wn;Xn(Wr,Er)}return Ja(),Ca(),wn}),Object(D.useEffect)(function(){return Ja(),xa&&(_i.current=window.setTimeout(function(){Ya(0)},100)),Ja},[xa]);function Ni(){var _r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ae,Er=ca.get(_r);if(!Er)return;if(zt){var wn=Nt;Me?Er.right<Nt?wn=Er.right:Er.right+Er.width>Nt+Fr&&(wn=Er.right+Er.width-Fr):Er.left<-Nt?wn=-Er.left:Er.left+Er.width>-Nt+Fr&&(wn=-(Er.left+Er.width-Fr)),Wr(0),Or(Wi(wn)[0])}else{var Xn=Kr;Er.top<-Kr?Xn=-Er.top:Er.top+Er.height>-Kr+Pi&&(Xn=-(Er.top+Er.height-Pi)),Or(0),Wr(Wi(Xn)[0])}}var Ki=c(ca,{width:Fr,height:Pi,left:Nt,top:Kr},{width:Zr,height:Hr},{width:ba,height:Qa},Object(K.a)(Object(K.a)({},ue),{},{tabs:oe})),So=Object(X.a)(Ki,2),Jo=So[0],Zo=So[1],qo=oe.map(function(_r){var Er=_r.key;return D.createElement(a,{id:ge,prefixCls:q,key:Er,rtl:Me,tab:_r,closable:_r.closable,editable:st,active:Er===Ae,tabPosition:At,tabBarGutter:Xt,renderWrapper:ur,removeAriaLabel:at==null?void 0:at.removeAriaLabel,ref:gr(Er),onClick:function(Xn){rr(Er,Xn)},onRemove:function(){Qt(Er)},onFocus:function(){Ni(Er),Ca(),Me||(dr.current.scrollLeft=0),dr.current.scrollTop=0}})}),Za=O(function(){var _r,Er,wn,Xn,ra,Ai,ma,Bi,Dn,Ta=((_r=dr.current)===null||_r===void 0?void 0:_r.offsetWidth)||0,qa=((Er=dr.current)===null||Er===void 0?void 0:Er.offsetHeight)||0,$a=((wn=Ar.current)===null||wn===void 0?void 0:wn.offsetWidth)||0,Yn=((Xn=Ar.current)===null||Xn===void 0?void 0:Xn.offsetHeight)||0,Pr=((ra=or.current)===null||ra===void 0?void 0:ra.offsetWidth)||0,yi=((Ai=or.current)===null||Ai===void 0?void 0:Ai.offsetHeight)||0;Tn(Ta),Zi(qa),Qo($a),Xa(Yn);var Ti=(((ma=sr.current)===null||ma===void 0?void 0:ma.offsetWidth)||0)-$a,wi=(((Bi=sr.current)===null||Bi===void 0?void 0:Bi.offsetHeight)||0)-Yn;Fn(Ti),Qr(wi);var eo=(Dn=or.current)===null||Dn===void 0?void 0:Dn.className.includes(ea);mi(Ti-(eo?0:Pr)),xi(wi-(eo?0:yi)),Ea(function(){var wa=new Map;return oe.forEach(function(Oo){var Ro=Oo.key,Gi=gr(Ro).current;Gi&&wa.set(Ro,{width:Gi.offsetWidth,height:Gi.offsetHeight,left:Gi.offsetLeft,top:Gi.offsetTop})}),wa})}),$o=oe.slice(0,Jo),Qn=oe.slice(Zo+1),gn=[].concat(Object(L.a)($o),Object(L.a)(Qn)),Nn=Object(D.useState)(),vn=Object(X.a)(Nn,2),fa=vn[0],es=vn[1],vi=ca.get(Ae),Ao=Object(D.useRef)();function To(){C.a.cancel(Ao.current)}Object(D.useEffect)(function(){var _r={};return vi&&(zt?(Me?_r.right=vi.right:_r.left=vi.left,_r.width=vi.width):(_r.top=vi.top,_r.height=vi.height)),To(),Ao.current=C()(function(){es(_r)}),To},[vi,zt,Me]),Object(D.useEffect)(function(){Ni()},[Ae,vi,ca,zt]),Object(D.useEffect)(function(){Za()},[Me,Xt,Ae,oe.map(function(_r){return _r.key}).join("_")]);var wo=!!gn.length,zi="".concat(q,"-nav-wrap"),Sa,pa,Do,Aa;return zt?Me?(pa=Nt>0,Sa=Nt+Fr<en):(Sa=Nt<0,pa=-Nt+Fr<en):(Do=Kr<0,Aa=-Kr+Pi<An),D.createElement("div",{ref:Ce,role:"tablist",className:H()("".concat(q,"-nav"),ee),style:fe,onKeyDown:function(){Ca()}},D.createElement(yo,{position:"left",extra:We,prefixCls:q}),D.createElement(k.a,{onResize:Za},D.createElement("div",{className:H()(zi,(we={},Object(ae.a)(we,"".concat(zi,"-ping-left"),Sa),Object(ae.a)(we,"".concat(zi,"-ping-right"),pa),Object(ae.a)(we,"".concat(zi,"-ping-top"),Do),Object(ae.a)(we,"".concat(zi,"-ping-bottom"),Aa),we)),ref:dr},D.createElement(k.a,{onResize:Za},D.createElement("div",{ref:sr,className:"".concat(q,"-nav-list"),style:{transform:"translate(".concat(Nt,"px, ").concat(Kr,"px)"),transition:xa?"none":void 0}},qo,D.createElement(_n,{ref:Ar,prefixCls:q,locale:at,editable:st,style:{visibility:wo?"hidden":null}}),D.createElement("div",{className:H()("".concat(q,"-ink-bar"),Object(ae.a)({},"".concat(q,"-ink-bar-animated"),De.inkBar)),style:fa}))))),D.createElement(ui,Object.assign({},ue,{ref:or,prefixCls:q,tabs:gn,className:!wo&&ea})),D.createElement(yo,{position:"right",extra:We,prefixCls:q}))}var Ha=D.forwardRef(Wa);function Go(ue){var Ce=ue.id,we=ue.activeKey,ce=ue.animated,q=ue.tabPosition,oe=ue.rtl,ee=ue.destroyInactiveTabPane,fe=D.useContext(Fa),ge=fe.prefixCls,De=fe.tabs,Ae=ce.tabPane,Me=De.findIndex(function(We){return We.key===we});return D.createElement("div",{className:H()("".concat(ge,"-content-holder"))},D.createElement("div",{className:H()("".concat(ge,"-content"),"".concat(ge,"-content-").concat(q),Object(ae.a)({},"".concat(ge,"-content-animated"),Ae)),style:Me&&Ae?Object(ae.a)({},oe?"marginRight":"marginLeft","-".concat(Me,"00%")):null},De.map(function(We){return D.cloneElement(We.node,{key:We.key,prefixCls:ge,tabKey:We.key,id:Ce,animated:Ae,active:We.key===we,destroyInactiveTabPane:ee})})))}function bo(ue){var Ce=ue.prefixCls,we=ue.forceRender,ce=ue.className,q=ue.style,oe=ue.id,ee=ue.active,fe=ue.animated,ge=ue.destroyInactiveTabPane,De=ue.tabKey,Ae=ue.children,Me=D.useState(we),We=Object(X.a)(Me,2),st=We[0],at=We[1];D.useEffect(function(){ee?at(!0):ge&&at(!1)},[ee,ge]);var At={};return ee||(fe?(At.visibility="hidden",At.height=0,At.overflowY="hidden"):At.display="none"),D.createElement("div",{id:oe&&"".concat(oe,"-panel-").concat(De),role:"tabpanel",tabIndex:ee?0:-1,"aria-labelledby":oe&&"".concat(oe,"-tab-").concat(De),"aria-hidden":!ee,style:Object(K.a)(Object(K.a)({},At),q),className:H()("".concat(Ce,"-tabpane"),ee&&"".concat(Ce,"-tabpane-active"),ce)},(ee||st||we)&&Ae)}var Ka=0;function Eo(ue){return Object(W.a)(ue).map(function(Ce){if(D.isValidElement(Ce)){var we=Ce.key!==void 0?String(Ce.key):void 0;return Object(K.a)(Object(K.a)({key:we},Ce.props),{},{node:Ce})}return null}).filter(function(Ce){return Ce})}function Vo(ue,Ce){var we,ce=ue.id,q=ue.prefixCls,oe=q===void 0?"rc-tabs":q,ee=ue.className,fe=ue.children,ge=ue.direction,De=ue.activeKey,Ae=ue.defaultActiveKey,Me=ue.editable,We=ue.animated,st=ue.tabPosition,at=st===void 0?"top":st,At=ue.tabBarGutter,Xt=ue.tabBarStyle,ur=ue.tabBarExtraContent,rr=ue.locale,ar=ue.moreIcon,dr=ue.moreTransitionName,sr=ue.destroyInactiveTabPane,or=ue.renderTabBar,Ar=ue.onChange,mr=ue.onTabClick,Yr=ue.onTabScroll,gr=Object(M.a)(ue,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Qt=Eo(fe),zt=ge==="rtl",vr;We===!1?vr={inkBar:!1,tabPane:!1}:vr=Object(K.a)({inkBar:!0,tabPane:!1},We!==!0?We:null);var Tr=Object(D.useState)(!1),Nt=Object(X.a)(Tr,2),Or=Nt[0],Jr=Nt[1];Object(D.useEffect)(function(){Jr(vo())},[]);var kr=Object(_.a)(function(){var Hr;return(Hr=Qt[0])===null||Hr===void 0?void 0:Hr.key},{value:De,defaultValue:Ae}),Kr=Object(X.a)(kr,2),Wr=Kr[0],hn=Kr[1],Sn=Object(D.useState)(function(){return Qt.findIndex(function(Hr){return Hr.key===Wr})}),en=Object(X.a)(Sn,2),Fn=en[0],pi=en[1];Object(D.useEffect)(function(){var Hr=Qt.findIndex(function(Ii){return Ii.key===Wr});if(Hr===-1){var xi;Hr=Math.max(0,Math.min(Fn,Qt.length-1)),hn((xi=Qt[Hr])===null||xi===void 0?void 0:xi.key)}pi(Hr)},[Qt.map(function(Hr){return Hr.key}).join("_"),Wr,Fn]);var Vn=Object(_.a)(null,{value:ce}),An=Object(X.a)(Vn,2),Qr=An[0],zr=An[1],tn=at;Or&&!["left","right"].includes(at)&&(tn="top"),Object(D.useEffect)(function(){ce||(zr("rc-tabs-".concat(Ka)),Ka+=1)},[]);function Zr(Hr,xi){mr==null||mr(Hr,xi),hn(Hr),Ar==null||Ar(Hr)}var mi={id:Qr,activeKey:Wr,animated:vr,tabPosition:tn,rtl:zt,mobile:Or},ki,Li=Object(K.a)(Object(K.a)({},mi),{},{editable:Me,locale:rr,moreIcon:ar,moreTransitionName:dr,tabBarGutter:At,onTabClick:Zr,onTabScroll:Yr,extra:ur,style:Xt,panes:fe});return or?ki=or(Li,Ha):ki=D.createElement(Ha,Object.assign({},Li)),D.createElement(Fa.Provider,{value:{tabs:Qt,prefixCls:oe}},D.createElement("div",Object.assign({ref:Ce,id:ce,className:H()(oe,"".concat(oe,"-").concat(tn),(we={},Object(ae.a)(we,"".concat(oe,"-mobile"),Or),Object(ae.a)(we,"".concat(oe,"-editable"),Me),Object(ae.a)(we,"".concat(oe,"-rtl"),zt),we),ee)},gr),ki,D.createElement(Go,Object.assign({destroyInactiveTabPane:sr},mi,{animated:vr}))))}var Ji=D.forwardRef(Vo);Ji.TabPane=bo;var Si=Ji,za=Fe.b=Si},kPWJ:function(Ge,Fe,Q){Ge.exports=Q.p+"static/question.cb52bef9.gif"},kPYp:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAAAUCAYAAADr0+FaAAANEklEQVRYR8WZe5RX1XXHP/vce3/zHoaXgFp5DQyOQLRgUTEtDW1qYyVmZUGNklRdiRpKE3lHfPyc4TngIBgfC0wx1ixt1NRWal2kotbE2lbRiCIISBCGhzDAvGd+87v37K5z5zfDzMCM46pr9fw1a+45+5zz3fvs/d3fn4yr1F8Do0UIUb74UFR8Gm3IO/Wf8MThat7mOYnaDZUmNUF/htpWLlePK4xwCcoQICHQbOGoKDuM4U1p5r0Px1DNrDPrezzQs+qNPUh/o4xXj6tRJhlhGEqeQNrCCYXdGvGfFt5JNHLoozJp7WyvdI0OtR4LEK7CstUIWyJLTSRcLfCnvlAiUKSgCEfV8o6NeMVE/G53itOUiXX3Sxcx2ov4qhG+qjBWoFChWYUqIt6VgFeblR0H5lEL0oGyjKvU1yHezPviyHdZ0Ro180basvD398n77svIFTokK5vrgW8LTELJRwgA6bTSHcaBckot/y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pYcXXUauYOus8Mdns1W2eIpy3Y18FGXrjipZmzAMLIoM4ZZQqwmdh7Oaltv3E0id1lMlR1hRJnk8PK+H0mqu7DmHBDB4vw6HtneQ8N06YNalIp4HmF6X8EfV6ljRfk5EmNxJvIdn09ksdYIs7oV2d7h7uGrhUOEzP14ibzoNgXmC3wjQx3dbwZdwM6YcbHpNJFDKjxr4dHOunv3rcY9rANNC7dbR4WFkbhIP7ddFxSxTK3Cr0nzgFMz2+05Su37saTsWJRVS5VnuHnnAnmtp8vPnKne+1NY4jlZwtDfWpob6ijzhQ098fyLVmn/bJ97PMPtQJ5r8Dxck5VUMyqXP0wEzEHjNFHQR438rPPZtuyiKpTtmsdjrji7SGmJmBJrGYZSlIsyfYD7oaJVlVqEAwbejSJeafR5t6dOsfOGTuXMTTHeBExHmCzCaDTurLPEFWOlXqFKlI+s8prfwG92lnXVXkoq9HwTcD/KdSp8mGrmyVSaf+pJJmjff/gKHZaTxR3G8E1rKWyoY4MvbOwJfIdIcSUX+8Ic1yg6yT6Eb7Q1Wc4BORRk+RQZQ2DD3n8Y+Lwn4edT/cEcOd0xL6nmyn5knWghPzuL7JQQJMC0umjzafUbaG5J0XigjFSfeHuHYZXSJIH0Iz+VJtczBL6H58pLZAhTaVqKCmnYfoSWc4l6Tko/nscg8clvMtQPyOFUn/oRVCauJZcs+jeHJFLHOX1wFTW9MkEnyg0kP2EpitJ4+YVU/S8v1xqrW4H9MAAAAABJRU5ErkJggg=="},kSUc:function(Ge,Fe,Q){},kqOp:function(Ge,Fe,Q){"use strict";Q.d(Fe,"a",function(){return L});var ae=Q("0Owb"),X=Q("fWQN"),M=Q("mtLc"),K=Q("yKVA"),D=Q("879j"),P=Q("q1tI"),H=Q.n(P),W=Q("Ot1p"),_="\u2581",L=function(y){Object(K.a)(k,y);var C=Object(D.a)(k);function k(){var O;Object(X.a)(this,k);for(var A=arguments.length,x=new Array(A),d=0;d<A;d++)x[d]=arguments[d];return O=C.call.apply(C,[this].concat(x)),O.getChCountBeforeCursor=function(a,l){for(var s=l.line,v=0,c=0;c<s;c++)v+=a.getLine(c).split(_).length-1;var m=a.getLine(s).substring(0,l.ch);return v+=m.split(_).length-1,v},O.onCMBeforeChange=function(a,l){var s=a.getRange(l.from,l.to),v=0;if(l.text.forEach(function(E){v+=E.split(_).length-1}),s&&s.indexOf(_)!=-1){var c=s.split(_).length-1,m=O.getChCountBeforeCursor(a,l.from);console.log("\u5220\u9664".concat(c,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(m,"\u4E2A\uFF0C\u65B0\u589E").concat(v,"\u4E2A")),O.props.deleteEmptyDisabled?l.cancel():O.props.onPlaceholderChange&&O.props.onPlaceholderChange(m,c,v)}else if(v){var R=O.getChCountBeforeCursor(a,l.from);console.log("\u65B0\u589E".concat(v,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(R,"\u4E2A")),O.props.onPlaceholderChange&&O.props.onPlaceholderChange(R,0,v)}},O}return Object(M.a)(k,[{key:"render",value:function(){return H.a.createElement(W.a,Object(ae.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),k}(P.Component)},l2Kq:function(Ge,Fe,Q){Ge.exports=Q.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"),Q("1eCo"),Q("8EBN"))})(function(ae){"use strict";ae.defineMode("markdown",function(X,M){var K=ae.getMode(X,"text/html"),D=K.name=="null";function P(G){if(ae.findModeByName){var F=ae.findModeByName(G);F&&(G=F.mime||F.mimes[0])}var re=ae.getMode(X,G);return re.name=="null"?null:re}M.highlightFormatting===void 0&&(M.highlightFormatting=!1),M.maxBlockquoteDepth===void 0&&(M.maxBlockquoteDepth=0),M.taskLists===void 0&&(M.taskLists=!1),M.strikethrough===void 0&&(M.strikethrough=!1),M.emoji===void 0&&(M.emoji=!1),M.fencedCodeBlockHighlighting===void 0&&(M.fencedCodeBlockHighlighting=!0),M.fencedCodeBlockDefaultMode===void 0&&(M.fencedCodeBlockDefaultMode="text/plain"),M.xml===void 0&&(M.xml=!0),M.tokenTypeOverrides===void 0&&(M.tokenTypeOverrides={});var H={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 W in H)H.hasOwnProperty(W)&&M.tokenTypeOverrides[W]&&(H[W]=M.tokenTypeOverrides[W]);var _=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,C=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,k=/^ {0,3}(?:\={1,}|-{2,})\s*$/,O=/^[^#!\[\]*_\\<>` "'(~:]+/,A=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,x=/^\s*\[[^\]]+?\]:.*$/,d=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,a=" ";function l(G,F,re){return F.f=F.inline=re,re(G,F)}function s(G,F,re){return F.f=F.block=re,re(G,F)}function v(G){return!G||!/\S/.test(G.string)}function c(G){if(G.linkTitle=!1,G.linkHref=!1,G.linkText=!1,G.em=!1,G.strong=!1,G.strikethrough=!1,G.quote=0,G.indentedCode=!1,G.f==R){var F=D;if(!F){var re=ae.innerMode(K,G.htmlState);F=re.mode.name=="xml"&&re.state.tagStart===null&&!re.state.context&&re.state.tokenize.isInText}F&&(G.f=h,G.block=m,G.htmlState=null)}return G.trailingSpace=0,G.trailingSpaceNewLine=!1,G.prevLine=G.thisLine,G.thisLine={stream:null},null}function m(G,F){var re=G.column()===F.indentation,le=v(F.prevLine.stream),Ee=F.indentedCode,Oe=F.prevLine.hr,Ye=F.list!==!1,Pe=(F.listStack[F.listStack.length-1]||0)+3;F.indentedCode=!1;var Be=F.indentation;if(F.indentationDiff===null&&(F.indentationDiff=F.indentation,Ye)){for(F.list=null;Be<F.listStack[F.listStack.length-1];)F.listStack.pop(),F.listStack.length?F.indentation=F.listStack[F.listStack.length-1]:F.list=!1;F.list!==!1&&(F.indentationDiff=Be-F.listStack[F.listStack.length-1])}var Ue=!le&&!Oe&&!F.prevLine.header&&(!Ye||!Ee)&&!F.prevLine.fencedCodeEnd,Ne=(F.list===!1||Oe||le)&&F.indentation<=Pe&&G.match(_),Te=null;if(F.indentationDiff>=4&&(Ee||F.prevLine.fencedCodeEnd||F.prevLine.header||le))return G.skipToEnd(),F.indentedCode=!0,H.code;if(G.eatSpace())return null;if(re&&F.indentation<=Pe&&(Te=G.match(C))&&Te[1].length<=6)return F.quote=0,F.header=Te[1].length,F.thisLine.header=!0,M.highlightFormatting&&(F.formatting="header"),F.f=F.inline,f(F);if(F.indentation<=Pe&&G.eat(">"))return F.quote=re?1:F.quote+1,M.highlightFormatting&&(F.formatting="quote"),G.eatSpace(),f(F);if(!Ne&&!F.setext&&re&&F.indentation<=Pe&&(Te=G.match(L))){var se=Te[1]?"ol":"ul";return F.indentation=Be+G.current().length,F.list=!0,F.quote=0,F.listStack.push(F.indentation),F.em=!1,F.strong=!1,F.code=!1,F.strikethrough=!1,M.taskLists&&G.match(y,!1)&&(F.taskList=!0),F.f=F.inline,M.highlightFormatting&&(F.formatting=["list","list-"+se]),f(F)}else{if(re&&F.indentation<=Pe&&(Te=G.match(A,!0)))return F.quote=0,F.fencedEndRE=new RegExp(Te[1]+"+ *$"),F.localMode=M.fencedCodeBlockHighlighting&&P(Te[2]||M.fencedCodeBlockDefaultMode),F.localMode&&(F.localState=ae.startState(F.localMode)),F.f=F.block=E,M.highlightFormatting&&(F.formatting="code-block"),F.code=-1,f(F);if(F.setext||(!Ue||!Ye)&&!F.quote&&F.list===!1&&!F.code&&!Ne&&!x.test(G.string)&&(Te=G.lookAhead(1))&&(Te=Te.match(k)))return F.setext?(F.header=F.setext,F.setext=0,G.skipToEnd(),M.highlightFormatting&&(F.formatting="header")):(F.header=Te[0].charAt(0)=="="?1:2,F.setext=F.header),F.thisLine.header=!0,F.f=F.inline,f(F);if(Ne)return G.skipToEnd(),F.hr=!0,F.thisLine.hr=!0,H.hr;if(G.peek()==="[")return l(G,F,N)}return l(G,F,F.inline)}function R(G,F){var re=K.token(G,F.htmlState);if(!D){var le=ae.innerMode(K,F.htmlState);(le.mode.name=="xml"&&le.state.tagStart===null&&!le.state.context&&le.state.tokenize.isInText||F.md_inside&&G.current().indexOf(">")>-1)&&(F.f=h,F.block=m,F.htmlState=null)}return re}function E(G,F){var re=F.listStack[F.listStack.length-1]||0,le=F.indentation<re,Ee=re+3;if(F.fencedEndRE&&F.indentation<=Ee&&(le||G.match(F.fencedEndRE))){M.highlightFormatting&&(F.formatting="code-block");var Oe;return le||(Oe=f(F)),F.localMode=F.localState=null,F.block=m,F.f=h,F.fencedEndRE=null,F.code=0,F.thisLine.fencedCodeEnd=!0,le?s(G,F,F.block):Oe}else return F.localMode?F.localMode.token(G,F.localState):(G.skipToEnd(),H.code)}function f(G){var F=[];if(G.formatting){F.push(H.formatting),typeof G.formatting=="string"&&(G.formatting=[G.formatting]);for(var re=0;re<G.formatting.length;re++)F.push(H.formatting+"-"+G.formatting[re]),G.formatting[re]==="header"&&F.push(H.formatting+"-"+G.formatting[re]+"-"+G.header),G.formatting[re]==="quote"&&(!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=G.quote?F.push(H.formatting+"-"+G.formatting[re]+"-"+G.quote):F.push("error"))}if(G.taskOpen)return F.push("meta"),F.length?F.join(" "):null;if(G.taskClosed)return F.push("property"),F.length?F.join(" "):null;if(G.linkHref?F.push(H.linkHref,"url"):(G.strong&&F.push(H.strong),G.em&&F.push(H.em),G.strikethrough&&F.push(H.strikethrough),G.emoji&&F.push(H.emoji),G.linkText&&F.push(H.linkText),G.code&&F.push(H.code),G.image&&F.push(H.image),G.imageAltText&&F.push(H.imageAltText,"link"),G.imageMarker&&F.push(H.imageMarker)),G.header&&F.push(H.header,H.header+"-"+G.header),G.quote&&(F.push(H.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=G.quote?F.push(H.quote+"-"+G.quote):F.push(H.quote+"-"+M.maxBlockquoteDepth)),G.list!==!1){var le=(G.listStack.length-1)%3;le?le===1?F.push(H.list2):F.push(H.list3):F.push(H.list1)}return G.trailingSpaceNewLine?F.push("trailing-space-new-line"):G.trailingSpace&&F.push("trailing-space-"+(G.trailingSpace%2?"a":"b")),F.length?F.join(" "):null}function g(G,F){return G.match(O,!0)?f(F):void 0}function h(G,F){var re=F.text(G,F);if(typeof re!="undefined")return re;if(F.list)return F.list=null,f(F);if(F.taskList){var le=G.match(y,!0)[1]===" ";return le?F.taskOpen=!0:F.taskClosed=!0,M.highlightFormatting&&(F.formatting="task"),F.taskList=!1,f(F)}if(F.taskOpen=!1,F.taskClosed=!1,F.header&&G.match(/^#+$/,!0))return M.highlightFormatting&&(F.formatting="header"),f(F);var Ee=G.next();if(F.linkTitle){F.linkTitle=!1;var Oe=Ee;Ee==="("&&(Oe=")"),Oe=(Oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ye="^\\s*(?:[^"+Oe+"\\\\]+|\\\\\\\\|\\\\.)"+Oe;if(G.match(new RegExp(Ye),!0))return H.linkHref}if(Ee==="`"){var Pe=F.formatting;M.highlightFormatting&&(F.formatting="code"),G.eatWhile("`");var Be=G.current().length;if(F.code==0&&(!F.quote||Be==1))return F.code=Be,f(F);if(Be==F.code){var Ue=f(F);return F.code=0,Ue}else return F.formatting=Pe,f(F)}else if(F.code)return f(F);if(Ee==="\\"&&(G.next(),M.highlightFormatting)){var Ne=f(F),Te=H.formatting+"-escape";return Ne?Ne+" "+Te:Te}if(Ee==="!"&&G.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return F.imageMarker=!0,F.image=!0,M.highlightFormatting&&(F.formatting="image"),f(F);if(Ee==="["&&F.imageMarker&&G.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return F.imageMarker=!1,F.imageAltText=!0,M.highlightFormatting&&(F.formatting="image"),f(F);if(Ee==="]"&&F.imageAltText){M.highlightFormatting&&(F.formatting="image");var Ne=f(F);return F.imageAltText=!1,F.image=!1,F.inline=F.f=S,Ne}if(Ee==="["&&!F.image)return F.linkText&&G.match(/^.*?\]/)||(F.linkText=!0,M.highlightFormatting&&(F.formatting="link")),f(F);if(Ee==="]"&&F.linkText){M.highlightFormatting&&(F.formatting="link");var Ne=f(F);return F.linkText=!1,F.inline=F.f=G.match(/\(.*?\)| ?\[.*?\]/,!1)?S:h,Ne}if(Ee==="<"&&G.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=o,M.highlightFormatting&&(F.formatting="link");var Ne=f(F);return Ne?Ne+=" ":Ne="",Ne+H.linkInline}if(Ee==="<"&&G.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){F.f=F.inline=o,M.highlightFormatting&&(F.formatting="link");var Ne=f(F);return Ne?Ne+=" ":Ne="",Ne+H.linkEmail}if(M.xml&&Ee==="<"&&G.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var se=G.string.indexOf(">",G.pos);if(se!=-1){var ze=G.string.substring(G.start,se);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ze)&&(F.md_inside=!0)}return G.backUp(1),F.htmlState=ae.startState(K),s(G,F,R)}if(M.xml&&Ee==="<"&&G.match(/^\/\w*?>/))return F.md_inside=!1,"tag";if(Ee==="*"||Ee==="_"){for(var xt=1,ct=G.pos==1?" ":G.string.charAt(G.pos-2);xt<3&&G.eat(Ee);)xt++;var ft=G.peek()||" ",Ct=!/\s/.test(ft)&&(!d.test(ft)||/\s/.test(ct)||d.test(ct)),He=!/\s/.test(ct)&&(!d.test(ct)||/\s/.test(ft)||d.test(ft)),Ke=null,ut=null;if(xt%2&&(!F.em&&Ct&&(Ee==="*"||!He||d.test(ct))?Ke=!0:F.em==Ee&&He&&(Ee==="*"||!Ct||d.test(ft))&&(Ke=!1)),xt>1&&(!F.strong&&Ct&&(Ee==="*"||!He||d.test(ct))?ut=!0:F.strong==Ee&&He&&(Ee==="*"||!Ct||d.test(ft))&&(ut=!1)),ut!=null||Ke!=null){M.highlightFormatting&&(F.formatting=Ke==null?"strong":ut==null?"em":"strong em"),Ke===!0&&(F.em=Ee),ut===!0&&(F.strong=Ee);var Ue=f(F);return Ke===!1&&(F.em=!1),ut===!1&&(F.strong=!1),Ue}}else if(Ee===" "&&(G.eat("*")||G.eat("_"))){if(G.peek()===" ")return f(F);G.backUp(1)}if(M.strikethrough){if(Ee==="~"&&G.eatWhile(Ee)){if(F.strikethrough){M.highlightFormatting&&(F.formatting="strikethrough");var Ue=f(F);return F.strikethrough=!1,Ue}else if(G.match(/^[^\s]/,!1))return F.strikethrough=!0,M.highlightFormatting&&(F.formatting="strikethrough"),f(F)}else if(Ee===" "&&G.match(/^~~/,!0)){if(G.peek()===" ")return f(F);G.backUp(2)}}if(M.emoji&&Ee===":"&&G.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){F.emoji=!0,M.highlightFormatting&&(F.formatting="emoji");var vt=f(F);return F.emoji=!1,vt}return Ee===" "&&(G.match(/^ +$/,!1)?F.trailingSpace++:F.trailingSpace&&(F.trailingSpaceNewLine=!0)),f(F)}function o(G,F){var re=G.next();if(re===">"){F.f=F.inline=h,M.highlightFormatting&&(F.formatting="link");var le=f(F);return le?le+=" ":le="",le+H.linkInline}return G.match(/^[^>]+/,!0),H.linkInline}function S(G,F){if(G.eatSpace())return null;var re=G.next();return re==="("||re==="["?(F.f=F.inline=T(re==="("?")":"]"),M.highlightFormatting&&(F.formatting="link-string"),F.linkHref=!0,f(F)):"error"}var b={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function T(G){return function(F,re){var le=F.next();if(le===G){re.f=re.inline=h,M.highlightFormatting&&(re.formatting="link-string");var Ee=f(re);return re.linkHref=!1,Ee}return F.match(b[G]),re.linkHref=!0,f(re)}}function N(G,F){return G.match(/^([^\]\\]|\\.)*\]:/,!1)?(F.f=z,G.next(),M.highlightFormatting&&(F.formatting="link"),F.linkText=!0,f(F)):l(G,F,h)}function z(G,F){if(G.match(/^\]:/,!0)){F.f=F.inline=Y,M.highlightFormatting&&(F.formatting="link");var re=f(F);return F.linkText=!1,re}return G.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function Y(G,F){return G.eatSpace()?null:(G.match(/^[^\s]+/,!0),G.peek()===void 0?F.linkTitle=!0:G.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),F.f=F.inline=h,H.linkHref+" url")}var te={startState:function(){return{f:m,prevLine:{stream:null},thisLine:{stream:null},block:m,htmlState:null,indentation:0,inline:h,text:g,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(G){return{f:G.f,prevLine:G.prevLine,thisLine:G.thisLine,block:G.block,htmlState:G.htmlState&&ae.copyState(K,G.htmlState),indentation:G.indentation,localMode:G.localMode,localState:G.localMode?ae.copyState(G.localMode,G.localState):null,inline:G.inline,text:G.text,formatting:!1,linkText:G.linkText,linkTitle:G.linkTitle,linkHref:G.linkHref,code:G.code,em:G.em,strong:G.strong,strikethrough:G.strikethrough,emoji:G.emoji,header:G.header,setext:G.setext,hr:G.hr,taskList:G.taskList,list:G.list,listStack:G.listStack.slice(0),quote:G.quote,indentedCode:G.indentedCode,trailingSpace:G.trailingSpace,trailingSpaceNewLine:G.trailingSpaceNewLine,md_inside:G.md_inside,fencedEndRE:G.fencedEndRE}},token:function(G,F){if(F.formatting=!1,G!=F.thisLine.stream){if(F.header=0,F.hr=!1,G.match(/^\s*$/,!0))return c(F),null;if(F.prevLine=F.thisLine,F.thisLine={stream:G},F.taskList=!1,F.trailingSpace=0,F.trailingSpaceNewLine=!1,!F.localState&&(F.f=F.block,F.f!=R)){var re=G.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(F.indentation=re,F.indentationDiff=null,re>0)return null}}return F.f(G,F)},innerMode:function(G){return G.block==R?{state:G.htmlState,mode:K}:G.localState?{state:G.localState,mode:G.localMode}:{state:G,mode:te}},indent:function(G,F,re){return G.block==R&&K.indent?K.indent(G.htmlState,F,re):G.localState&&G.localMode.indent?G.localMode.indent(G.localState,F,re):ae.Pass},blankLine:c,getType:f,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return te},"xml"),ae.defineMIME("text/markdown","markdown"),ae.defineMIME("text/x-markdown","markdown")})},lzim:function(Ge,Fe,Q){"use strict";var ae=Q("E7E6"),X=Q.n(ae);Q.d(Fe,"w",function(){return X.a});var M=Q("/GNS"),K=Q.n(M);Q.d(Fe,"v",function(){return K.a});var D=Q("FOrL"),P=Q.n(D);Q.d(Fe,"q",function(){return P.a});var H=Q("HpTS"),W=Q.n(H);Q.d(Fe,"x",function(){return W.a});var _=Q("tWlo"),L=Q.n(_);Q.d(Fe,"a",function(){return L.a});var y=Q("7ZXX"),C=Q.n(y);Q.d(Fe,"l",function(){return C.a});var k=Q("GABl"),O=Q.n(k);Q.d(Fe,"e",function(){return O.a});var A=Q("onxn"),x=Q.n(A);Q.d(Fe,"n",function(){return x.a});var d=Q("nKGa"),a=Q.n(d);Q.d(Fe,"m",function(){return a.a});var l=Q("4qgm"),s=Q.n(l);Q.d(Fe,"y",function(){return s.a});var v=Q("JeFH"),c=Q.n(v);Q.d(Fe,"b",function(){return c.a});var m=Q("ji0R"),R=Q.n(m);Q.d(Fe,"i",function(){return R.a});var E=Q("W6BS"),f=Q.n(E);Q.d(Fe,"z",function(){return f.a});var g=Q("kPYp"),h=Q.n(g);Q.d(Fe,"A",function(){return h.a});var o=Q("nukY"),S=Q.n(o),b=Q("4u4S"),T=Q.n(b),N=Q("yslc"),z=Q.n(N),Y=Q("l2Kq"),te=Q.n(Y),G=Q("RMFE"),F=Q.n(G);Q.d(Fe,"o",function(){return F.a});var re=Q("TGq3"),le=Q.n(re),Ee=Q("SMhR"),Oe=Q.n(Ee),Ye=Q("8/bI"),Pe=Q.n(Ye);Q.d(Fe,"j",function(){return Pe.a});var Be=Q("JWDV"),Ue=Q.n(Be),Ne=Q("Xsq0"),Te=Q.n(Ne);Q.d(Fe,"p",function(){return Te.a});var se=Q("Ohmc"),ze=Q.n(se);Q.d(Fe,"c",function(){return ze.a});var xt=Q("csWT"),ct=Q.n(xt);Q.d(Fe,"d",function(){return ct.a});var ft=Q("7v3h"),Ct=Q.n(ft);Q.d(Fe,"k",function(){return Ct.a});var He=Q("cRFk"),Ke=Q.n(He);Q.d(Fe,"u",function(){return Ke.a});var ut=Q("kPWJ"),vt=Q.n(ut);Q.d(Fe,"t",function(){return vt.a});var ht=Q("qgvg"),et=Q.n(ht);Q.d(Fe,"r",function(){return et.a});var Ze=Q("FPkq"),Tt=Q.n(Ze);Q.d(Fe,"s",function(){return Tt.a});var bt=Q("A/g1"),St=Q.n(bt);Q.d(Fe,"f",function(){return St.a});var lt=Q("Nmxd"),yt=Q.n(lt);Q.d(Fe,"g",function(){return yt.a});var dt=Q("5D2P"),Qe=Q.n(dt);Q.d(Fe,"h",function(){return Qe.a});var Ie=Q("djh8"),Et=Q.n(Ie),$e=Q("Jq4h"),_e=Q.n($e)},mepR:function(Ge,Fe,Q){Ge.exports={flex_box_center:"flex_box_center___3PiSf",flex_space_between:"flex_space_between___3wd5O",flex_box_vertical_center:"flex_box_vertical_center___3qKIW",flex_box_center_end:"flex_box_center_end___2PBRG",flex_box_column:"flex_box_column___39GGe",bg:"bg___3lEyf",formWrap:"formWrap___1e8Z1",empty:"empty___2jgvs",list:"list___3m2Ed",fs:"fs___2PURZ",top:"top___2EfKX",left:"left___3Bk5W",title:"title___1hcE1",qs:"qs___KHjhf",qsActive:"qsActive___2FXkO",right:"right___2XWtX",bt:"bt___2mIBt",answer:"answer___1TBgK",addBtn:"addBtn___NMPyJ"}},nKGa:function(Ge,Fe,Q){Ge.exports=Q.p+"static/export_exercise-template.f7655c19.png"},nuEh:function(Ge,Fe,Q){"use strict";var ae=Q("T2oS"),X=Q("W9HT"),M=Q("q1tI"),K=Q.n(M),D=Q("F8wB"),P=Q.n(D),H=function(_){var L=_.loading;return L?K.a.createElement("div",{className:P.a.loading},K.a.createElement(X.a,null)):K.a.createElement(K.a.Fragment,null)};Fe.a=H},nukY:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAMkklEQVR4Xu2dWWwcSRnHv7Yd577v+74vkgWEQCAEy6IVWuCB62GVICFIYkcsvMC+LW8LL7BIiTiEhCweInjgPrRCC2KBJ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XHD7AzTpnYSFWB0vHlzS2TDiz/cPn4vx2YAML/AxiD3K8wfl5pAAAAAElFTkSuQmCC"},osHv:function(Ge,Fe,Q){(function(ae){ae(Q("VrN/"))})(function(ae){"use strict";var X=ae.Pos;function M(d,a){return d.line-a.line||d.ch-a.ch}var K="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",D=K+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",P=new RegExp("<(/?)(["+K+"]["+D+"]*)","g");function H(d,a,l,s){this.line=a,this.ch=l,this.cm=d,this.text=d.getLine(a),this.min=s?Math.max(s.from,d.firstLine()):d.firstLine(),this.max=s?Math.min(s.to-1,d.lastLine()):d.lastLine()}function W(d,a){var l=d.cm.getTokenTypeAt(X(d.line,a));return l&&/\btag\b/.test(l)}function _(d){return d.line>=d.max?void 0:(d.ch=0,d.text=d.cm.getLine(++d.line),!0)}function L(d){return d.line<=d.min?void 0:(d.text=d.cm.getLine(--d.line),d.ch=d.text.length,!0)}function y(d){for(;;){var a=d.text.indexOf(">",d.ch);if(a==-1){if(_(d))continue;return}if(!W(d,a+1)){d.ch=a+1;continue}var l=d.text.lastIndexOf("/",a),s=l>-1&&!/\S/.test(d.text.slice(l+1,a));return d.ch=a+1,s?"selfClose":"regular"}}function C(d){for(;;){var a=d.ch?d.text.lastIndexOf("<",d.ch-1):-1;if(a==-1){if(L(d))continue;return}if(!W(d,a+1)){d.ch=a;continue}P.lastIndex=a,d.ch=a;var l=P.exec(d.text);if(l&&l.index==a)return l}}function k(d){for(;;){P.lastIndex=d.ch;var a=P.exec(d.text);if(!a){if(_(d))continue;return}if(!W(d,a.index+1)){d.ch=a.index+1;continue}return d.ch=a.index+a[0].length,a}}function O(d){for(;;){var a=d.ch?d.text.lastIndexOf(">",d.ch-1):-1;if(a==-1){if(L(d))continue;return}if(!W(d,a+1)){d.ch=a;continue}var l=d.text.lastIndexOf("/",a),s=l>-1&&!/\S/.test(d.text.slice(l+1,a));return d.ch=a+1,s?"selfClose":"regular"}}function A(d,a){for(var l=[];;){var s=k(d),v,c=d.line,m=d.ch-(s?s[0].length:0);if(!s||!(v=y(d)))return;if(v=="selfClose")continue;if(s[1]){for(var R=l.length-1;R>=0;--R)if(l[R]==s[2]){l.length=R;break}if(R<0&&(!a||a==s[2]))return{tag:s[2],from:X(c,m),to:X(d.line,d.ch)}}else l.push(s[2])}}function x(d,a){for(var l=[];;){var s=O(d);if(!s)return;if(s=="selfClose"){C(d);continue}var v=d.line,c=d.ch,m=C(d);if(!m)return;if(m[1])l.push(m[2]);else{for(var R=l.length-1;R>=0;--R)if(l[R]==m[2]){l.length=R;break}if(R<0&&(!a||a==m[2]))return{tag:m[2],from:X(d.line,d.ch),to:X(v,c)}}}}ae.registerHelper("fold","xml",function(d,a){for(var l=new H(d,a.line,0);;){var s=k(l);if(!s||l.line!=a.line)return;var v=y(l);if(!v)return;if(!s[1]&&v!="selfClose"){var c=X(l.line,l.ch),m=A(l,s[2]);return m&&M(m.from,c)>0?{from:c,to:m.from}:null}}}),ae.findMatchingTag=function(d,a,l){var s=new H(d,a.line,a.ch,l);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var v=y(s),c=v&&X(s.line,s.ch),m=v&&C(s);if(!v||!m||M(s,a)>0)return;var R={from:X(s.line,s.ch),to:c,tag:m[2]};return v=="selfClose"?{open:R,close:null,at:"open"}:m[1]?{open:x(s,m[2]),close:R,at:"close"}:(s=new H(d,c.line,c.ch,l),{open:R,close:A(s,m[2]),at:"open"})},ae.findEnclosingTag=function(d,a,l,s){for(var v=new H(d,a.line,a.ch,l);;){var c=x(v,s);if(!c)break;var m=new H(d,a.line,a.ch,l),R=A(m,c.tag);if(R)return{open:c,close:R}}},ae.scanForClosingTag=function(d,a,l,s){var v=new H(d,a.line,a.ch,s?{from:0,to:s}:null);return A(v,l)}})},p5ED:function(Ge,Fe,Q){"use strict";var ae=Q("+L6B"),X=Q("2/Rp"),M=Q("5Dmo"),K=Q("3S7+"),D=Q("k1fw"),P=Q("9og8"),H=Q("tJVT"),W=Q("WmNS"),_=Q.n(W),L=Q("q1tI"),y=Q.n(L),C=Q("vHTk"),k=Q.n(C),O=Q("yEEn"),A=Q("ZW9T"),x=Q("1vsH"),d=Q("V0Rq"),a=Q("m3rI");Fe.a=function(l){var s,v,c,m,R,E,f,g=l.editOffice,h=g===void 0?"view":g,o=l.data,S=l.theme,b=l.type,T=l.filename,N=l.monacoEditor,z=l.className,Y=l.style,te=l.close,G=l.onClose,F=l.hasMask,re=l.disabledDownload,le=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Ee=Object(H.a)(le,2),Oe=Ee[0],Ye=Ee[1],Pe=Object(L.useState)(""),Be=Object(H.a)(Pe,2),Ue=Be[0],Ne=Be[1],Te=Object(L.useState)(),se=Object(H.a)(Te,2),ze=se[0],xt=se[1],ct=window.ENV==="build"?"/react/build":"",ft=a.a.PROXY_SERVER||location.origin,Ct,He=1024*1024,Ke=10*He,ut=Object(L.useRef)();(s=o)!==null&&s!==void 0&&s.startsWith("/api")&&b!=="txt"&&(o=a.a.API_SERVER+o),b==="office"&&(Ct=Object(x.T)(o).filesize,Ct>Ke&&(b="other")),T&&N&&(N.filename=T),Object(L.useEffect)(function(){var Ze,Tt,bt=(Ze=document.cookie)===null||Ze===void 0||((Tt=Ze.replace(/\s/g,""))===null||Tt===void 0)?void 0:Tt.split(";");bt==null||bt.map(function(St){var lt=St.split("=");lt[0]==="_educoder_session"&&Ne(lt[1])})},[]),Object(L.useEffect)(function(){b==="office"&&vt()},[b,o]);var vt=function(){var Ze=Object(P.a)(_.a.mark(function Tt(){var bt,St,lt;return _.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return console.log("data:",o),bt=o,o.startsWith("http")||(bt=location.origin+bt),St=new URL(bt).pathname.split("/").pop(),dt.next=6,Object(d.W)({attachment_id:St});case 6:lt=dt.sent,xt(lt);case 8:case"end":return dt.stop()}},Tt)}));return function(){return Ze.apply(this,arguments)}}(),ht=function(){if(o.startsWith("http")||o.startsWith("blob:")){et();return}Object(x.z)(T||"educoder",o,T)},et=function(){Object(x.x)(T||"educoder",decodeURIComponent(o))};return y.a.createElement("div",{style:Object(D.a)({},Y||{}),className:"".concat(F&&k.a.bgBlack," ").concat(b?k.a.wrp:"hide")},te&&y.a.createElement("div",{className:k.a.close,ref:ut},!re&&y.a.createElement(K.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ut.current}},y.a.createElement("span",{onClick:et},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(K.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ut.current}},y.a.createElement("span",{className:"",onClick:G},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(k.a[z]," ").concat(z," ").concat(k.a.monaco," ").concat(b==="txt"?"show":"hide")},b==="txt"&&y.a.createElement(A.b,N)),b==="audio"&&y.a.createElement("audio",{src:"".concat(((v=o)===null||v===void 0?void 0:v.indexOf("http://"))>-1||((c=o)===null||c===void 0?void 0:c.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(o),autoPlay:!0}),b==="video"&&y.a.createElement(y.a.Fragment,null,((m=o)===null||m===void 0?void 0:m.indexOf("http"))>-1?y.a.createElement("video",{controls:!0,src:"".concat(o),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(o),autoPlay:!0})),b==="office"&&ze&&y.a.createElement("iframe",{src:"".concat(ct,"/office.html?key=").concat(ze.key,"&url=").concat(ft+ze.url,"&callbackUrl=").concat(ft+ze.callbackUrl,"&fileType=").concat(ze.fileType,"&title=").concat(ze.title,"&model=").concat(h,"&officeServer=").concat(a.a.OFFICE_SERVER,"&disabledDownload=").concat(!!re)}),b==="html"&&y.a.createElement("iframe",{src:o+"&disposition=inline"}),b==="pdf"&&y.a.createElement("iframe",{src:"".concat(ct,"/js/pdfview/index.html?url=").concat(o,"&disabledDownload=").concat(!!re)}),b==="image"&&y.a.createElement("img",{src:"".concat(((R=o)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((E=o)===null||E===void 0?void 0:E.indexOf("https://"))>-1||(f=o)!==null&&f!==void 0&&f.startsWith("/api")?"":"data:image/png;base64,").concat(o)}),b==="other"&&y.a.createElement("div",null,y.a.createElement(X.a,{type:"primary",size:"large",onClick:ht},y.a.createElement(O.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),b==="download"&&y.a.createElement(X.a,{type:"primary",size:"large",onClick:ht},y.a.createElement(O.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ge,Fe,Q){},qgvg:function(Ge,Fe){Ge.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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bnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},rUJ1:function(Ge,Fe){const Q=/[&<>"']/,ae=/[&<>"']/g,X=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,K={"&":"&","<":"<",">":">",'"':""","'":"'"},D=E=>K[E];function P(E,f){if(f){if(Q.test(E))return E.replace(ae,D)}else if(X.test(E))return E.replace(M,D);return E}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(E){return E.replace(H,(f,g)=>(g=g.toLowerCase(),g==="colon"?":":g.charAt(0)==="#"?g.charAt(1)==="x"?String.fromCharCode(parseInt(g.substring(2),16)):String.fromCharCode(+g.substring(1)):""))}const _=/(^|[^\[])\^/g;function L(E,f){E=E.source||E,f=f||"";const g={replace:(h,o)=>(o=o.source||o,o=o.replace(_,"$1"),E=E.replace(h,o),g),getRegex:()=>new RegExp(E,f)};return g}const y=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(E,f,g){if(E){let h;try{h=decodeURIComponent(W(g)).replace(y,"").toLowerCase()}catch(o){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}f&&!C.test(g)&&(g=a(f,g));try{g=encodeURI(g).replace(/%25/g,"%")}catch(h){return null}return g}const O={},A=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(E,f){O[" "+E]||(A.test(E)?O[" "+E]=E+"/":O[" "+E]=c(E,"/",!0)),E=O[" "+E];const g=E.indexOf(":")===-1;return f.substring(0,2)==="//"?g?f:E.replace(x,"$1")+f:f.charAt(0)==="/"?g?f:E.replace(d,"$1")+f:E+f}const l={exec:function(){}};function s(E){let f=1,g,h;for(;f<arguments.length;f++){g=arguments[f];for(h in g)Object.prototype.hasOwnProperty.call(g,h)&&(E[h]=g[h])}return E}function v(E,f){const g=E.replace(/\|/g,(S,b,T)=>{let N=!1,z=b;for(;--z>=0&&T[z]==="\\";)N=!N;return N?"|":" |"}),h=g.split(/ \|/);let o=0;if(h.length>f)h.splice(f);else for(;h.length<f;)h.push("");for(;o<h.length;o++)h[o]=h[o].trim().replace(/\\\|/g,"|");return h}function c(E,f,g){const h=E.length;if(h===0)return"";let o=0;for(;o<h;){const S=E.charAt(h-o-1);if(S===f&&!g)o++;else if(S!==f&&g)o++;else break}return E.substr(0,h-o)}function m(E,f){if(E.indexOf(f[1])===-1)return-1;const g=E.length;let h=0,o=0;for(;o<g;o++)if(E[o]==="\\")o++;else if(E[o]===f[0])h++;else if(E[o]===f[1]&&(h--,h<0))return o;return-1}function R(E){E&&E.sanitize&&!E.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Ge.exports={escape:P,unescape:W,edit:L,cleanUrl:k,resolveUrl:a,noopTest:l,merge:s,splitCells:v,rtrim:c,findClosingBracket:m,checkSanitizeDeprecation:R}},t23M:function(Ge,Fe,Q){"use strict";var ae=Q("VTBJ"),X=Q("1OyB"),M=Q("vuIU"),K=Q("Ji7U"),D=Q("LK+K"),P=Q("q1tI"),H=Q.n(P),W=Q("m+aA"),_=Q("Zm9Q"),L=Q("Kwbf"),y=Q("c+Xe"),C=Q("bdgK"),k="rc-observer-key",O=function(A){Object(K.a)(d,A);var x=Object(D.a)(d);function d(){var a;return Object(X.a)(this,d),a=x.apply(this,arguments),a.resizeObserver=null,a.childNode=null,a.currentElement=null,a.state={width:0,height:0,offsetHeight:0,offsetWidth:0},a.onResize=function(l){var s=a.props.onResize,v=l[0].target,c=v.getBoundingClientRect(),m=c.width,R=c.height,E=v.offsetWidth,f=v.offsetHeight,g=Math.floor(m),h=Math.floor(R);if(a.state.width!==g||a.state.height!==h||a.state.offsetWidth!==E||a.state.offsetHeight!==f){var o={width:g,height:h,offsetWidth:E,offsetHeight:f};a.setState(o),s&&Promise.resolve().then(function(){s(Object(ae.a)(Object(ae.a)({},o),{},{offsetWidth:E,offsetHeight:f}))})}},a.setChildNode=function(l){a.childNode=l},a}return Object(M.a)(d,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var l=this.props.disabled;if(l){this.destroyObserver();return}var s=Object(W.a)(this.childNode||this),v=s!==this.currentElement;v&&(this.destroyObserver(),this.currentElement=s),!this.resizeObserver&&s&&(this.resizeObserver=new C.default(this.onResize),this.resizeObserver.observe(s))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var l=this.props.children,s=Object(_.a)(l);if(s.length>1)Object(L.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(s.length===0)return Object(L.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var v=s[0];if(P.isValidElement(v)&&Object(y.c)(v)){var c=v.ref;s[0]=P.cloneElement(v,{ref:Object(y.a)(c,this.setChildNode)})}return s.length===1?s[0]:s.map(function(m,R){return!P.isValidElement(m)||"key"in m&&m.key!==null?m:P.cloneElement(m,{key:"".concat(k,"-").concat(R)})})}}]),d}(P.Component);O.displayName="ResizeObserver",Fe.a=O},tWlo:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY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GxTV6HqA8F6sMfR5z0qiDUKsjQpoEuPQ1SsSILVPDd1FJTrDA/Fwry9NDX1w9dxh7MSs2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},uIXO:function(Ge,Fe,Q){Ge.exports={flex_box_center:"flex_box_center___1HoSW",flex_space_between:"flex_space_between___1NTlm",flex_box_vertical_center:"flex_box_vertical_center___1RREG",flex_box_center_end:"flex_box_center_end___-OJaq",flex_box_column:"flex_box_column___11ry4",modal:"modal___32KcS",main:"main___3HP_p",title:"title___1Kjif",name:"name___3ysu_",body:"body___33mTT",form:"form___2fckF",btns:"btns___3SmLH"}},ulZh:function(Ge,Fe,Q){typeof window!="undefined"&&function(X,M){Ge.exports=M()}(this,function(){return function(ae){var X={};function M(K){if(X[K])return X[K].exports;var D=X[K]={i:K,l:!1,exports:{}};return ae[K].call(D.exports,D,D.exports,M),D.l=!0,D.exports}return M.m=ae,M.c=X,M.d=function(K,D,P){M.o(K,D)||Object.defineProperty(K,D,{enumerable:!0,get:P})},M.r=function(K){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(K,"__esModule",{value:!0})},M.t=function(K,D){if(D&1&&(K=M(K)),D&8)return K;if(D&4&&typeof K=="object"&&K&&K.__esModule)return K;var P=Object.create(null);if(M.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:K}),D&2&&typeof K!="string")for(var H in K)M.d(P,H,function(W){return K[W]}.bind(null,H));return P},M.n=function(K){var D=K&&K.__esModule?function(){return K.default}:function(){return K};return M.d(D,"a",D),D},M.o=function(K,D){return Object.prototype.hasOwnProperty.call(K,D)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ae,X,M){"use strict";var K=Object.prototype.hasOwnProperty,D="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(D=!1));function H(y,C,k){this.fn=y,this.context=C,this.once=k||!1}function W(y,C,k,O,A){if(typeof k!="function")throw new TypeError("The listener must be a function");var x=new H(k,O||y,A),d=D?D+C:C;return y._events[d]?y._events[d].fn?y._events[d]=[y._events[d],x]:y._events[d].push(x):(y._events[d]=x,y._eventsCount++),y}function _(y,C){--y._eventsCount===0?y._events=new P:delete y._events[C]}function L(){this._events=new P,this._eventsCount=0}L.prototype.eventNames=function(){var C=[],k,O;if(this._eventsCount===0)return C;for(O in k=this._events)K.call(k,O)&&C.push(D?O.slice(1):O);return Object.getOwnPropertySymbols?C.concat(Object.getOwnPropertySymbols(k)):C},L.prototype.listeners=function(C){var k=D?D+C:C,O=this._events[k];if(!O)return[];if(O.fn)return[O.fn];for(var A=0,x=O.length,d=new Array(x);A<x;A++)d[A]=O[A].fn;return d},L.prototype.listenerCount=function(C){var k=D?D+C:C,O=this._events[k];return O?O.fn?1:O.length:0},L.prototype.emit=function(C,k,O,A,x,d){var a=D?D+C:C;if(!this._events[a])return!1;var l=this._events[a],s=arguments.length,v,c;if(l.fn){l.once&&this.removeListener(C,l.fn,void 0,!0);switch(s){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,k),!0;case 3:return l.fn.call(l.context,k,O),!0;case 4:return l.fn.call(l.context,k,O,A),!0;case 5:return l.fn.call(l.context,k,O,A,x),!0;case 6:return l.fn.call(l.context,k,O,A,x,d),!0}for(c=1,v=new Array(s-1);c<s;c++)v[c-1]=arguments[c];l.fn.apply(l.context,v)}else{var m=l.length,R;for(c=0;c<m;c++){l[c].once&&this.removeListener(C,l[c].fn,void 0,!0);switch(s){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,k);break;case 3:l[c].fn.call(l[c].context,k,O);break;case 4:l[c].fn.call(l[c].context,k,O,A);break;default:if(!v)for(R=1,v=new Array(s-1);R<s;R++)v[R-1]=arguments[R];l[c].fn.apply(l[c].context,v)}}}return!0},L.prototype.on=function(C,k,O){return W(this,C,k,O,!1)},L.prototype.once=function(C,k,O){return W(this,C,k,O,!0)},L.prototype.removeListener=function(C,k,O,A){var x=D?D+C:C;if(!this._events[x])return this;if(!k)return _(this,x),this;var d=this._events[x];if(d.fn)d.fn===k&&(!A||d.once)&&(!O||d.context===O)&&_(this,x);else{for(var a=0,l=[],s=d.length;a<s;a++)(d[a].fn!==k||A&&!d[a].once||O&&d[a].context!==O)&&l.push(d[a]);l.length?this._events[x]=l.length===1?l[0]:l:_(this,x)}return this},L.prototype.removeAllListeners=function(C){var k;return C?(k=D?D+C:C,this._events[k]&&_(this,k)):(this._events=new P,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=D,L.EventEmitter=L,ae.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(ae,X,M){(function(K){var D=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,P=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,W=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,_={buildAbsoluteURL:function(L,y,C){if(C=C||{},L=L.trim(),y=y.trim(),!y){if(!C.alwaysNormalize)return L;var k=_.parseURL(L);if(!k)throw new Error("Error trying to parse base URL.");return k.path=_.normalizePath(k.path),_.buildURLFromParts(k)}var O=_.parseURL(y);if(!O)throw new Error("Error trying to parse relative URL.");if(O.scheme)return C.alwaysNormalize?(O.path=_.normalizePath(O.path),_.buildURLFromParts(O)):y;var A=_.parseURL(L);if(!A)throw new Error("Error trying to parse base URL.");if(!A.netLoc&&A.path&&A.path[0]!=="/"){var x=P.exec(A.path);A.netLoc=x[1],A.path=x[2]}A.netLoc&&!A.path&&(A.path="/");var d={scheme:A.scheme,netLoc:O.netLoc,path:null,params:O.params,query:O.query,fragment:O.fragment};if(!O.netLoc&&(d.netLoc=A.netLoc,O.path[0]!=="/"))if(!O.path)d.path=A.path,O.params||(d.params=A.params,O.query||(d.query=A.query));else{var a=A.path,l=a.substring(0,a.lastIndexOf("/")+1)+O.path;d.path=_.normalizePath(l)}return d.path===null&&(d.path=C.alwaysNormalize?_.normalizePath(O.path):O.path),_.buildURLFromParts(d)},parseURL:function(L){var y=D.exec(L);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(H,"");L.length!==(L=L.replace(W,"")).length;);return L.split("").reverse().join("")},buildURLFromParts:function(L){return L.scheme+L.netLoc+L.path+L.params+L.query+L.fragment}};ae.exports=_})(this)},"./node_modules/webworkify-webpack/index.js":function(ae,X,M){function K(C){var k={};function O(x){if(k[x])return k[x].exports;var d=k[x]={i:x,l:!1,exports:{}};return C[x].call(d.exports,d,d.exports,O),d.l=!0,d.exports}O.m=C,O.c=k,O.i=function(x){return x},O.d=function(x,d,a){O.o(x,d)||Object.defineProperty(x,d,{configurable:!1,enumerable:!0,get:a})},O.r=function(x){Object.defineProperty(x,"__esModule",{value:!0})},O.n=function(x){var d=x&&x.__esModule?function(){return x.default}:function(){return x};return O.d(d,"a",d),d},O.o=function(x,d){return Object.prototype.hasOwnProperty.call(x,d)},O.p="/",O.oe=function(x){throw console.error(x),x};var A=O(O.s=ENTRY_MODULE);return A.default||A}var D="[\\.|\\-|\\+|\\w|/|@]+",P="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+D+").*?\\)";function H(C){return(C+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function W(C){return!isNaN(1*C)}function _(C,k,O){var A={};A[O]=[];var x=k.toString(),d=x.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!d)return A;for(var a=d[1],l=new RegExp("(\\\\n|\\W)"+H(a)+P,"g"),s;s=l.exec(x);){if(s[3]==="dll-reference")continue;A[O].push(s[3])}for(l=new RegExp("\\("+H(a)+'\\("(dll-reference\\s('+D+'))"\\)\\)'+P,"g");s=l.exec(x);)C[s[2]]||(A[O].push(s[1]),C[s[2]]=M(s[1]).m),A[s[2]]=A[s[2]]||[],A[s[2]].push(s[4]);for(var v=Object.keys(A),c=0;c<v.length;c++)for(var m=0;m<A[v[c]].length;m++)W(A[v[c]][m])&&(A[v[c]][m]=1*A[v[c]][m]);return A}function L(C){var k=Object.keys(C);return k.reduce(function(O,A){return O||C[A].length>0},!1)}function y(C,k){for(var O={main:[k]},A={main:[]},x={main:{}};L(O);)for(var d=Object.keys(O),a=0;a<d.length;a++){var l=d[a],s=O[l],v=s.pop();if(x[l]=x[l]||{},x[l][v]||!C[l][v])continue;x[l][v]=!0,A[l]=A[l]||[],A[l].push(v);for(var c=_(C,C[l][v],l),m=Object.keys(c),R=0;R<m.length;R++)O[m[R]]=O[m[R]]||[],O[m[R]]=O[m[R]].concat(c[m[R]])}return A}ae.exports=function(C,k){k=k||{};var O={main:M.m},A=k.all?{main:Object.keys(O.main)}:y(O,C),x="";Object.keys(A).filter(function(v){return v!=="main"}).forEach(function(v){for(var c=0;A[v][c];)c++;A[v].push(c),O[v][c]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",x=x+"var "+v+" = ("+K.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+A[v].map(function(m){return""+JSON.stringify(m)+": "+O[v][m].toString()}).join(",")+`});
|
|
`}),x=x+"new (("+K.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+A.main.map(function(v){return""+JSON.stringify(v)+": "+O.main[v].toString()}).join(",")+"}))(self);";var d=new window.Blob([x],{type:"text/javascript"});if(k.bare)return d;var a=window.URL||window.webkitURL||window.mozURL||window.msURL,l=a.createObjectURL(d),s=new window.Worker(l);return s.objectURL=l,s}},"./src/config.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"hlsDefaultConfig",function(){return R}),M.d(X,"mergeConfig",function(){return f}),M.d(X,"enableStreamingMode",function(){return g});var K=M("./src/controller/abr-controller.ts"),D=M("./src/controller/audio-stream-controller.ts"),P=M("./src/controller/audio-track-controller.ts"),H=M("./src/controller/subtitle-stream-controller.ts"),W=M("./src/controller/subtitle-track-controller.ts"),_=M("./src/controller/buffer-controller.ts"),L=M("./src/controller/timeline-controller.ts"),y=M("./src/controller/cap-level-controller.ts"),C=M("./src/controller/fps-controller.ts"),k=M("./src/controller/eme-controller.ts"),O=M("./src/controller/cmcd-controller.ts"),A=M("./src/utils/xhr-loader.ts"),x=M("./src/utils/fetch-loader.ts"),d=M("./src/utils/cues.ts"),a=M("./src/utils/mediakeys-helper.ts"),l=M("./src/utils/logger.ts");function s(){return s=Object.assign||function(h){for(var o=1;o<arguments.length;o++){var S=arguments[o];for(var b in S)Object.prototype.hasOwnProperty.call(S,b)&&(h[b]=S[b])}return h},s.apply(this,arguments)}function v(h,o){var S=Object.keys(h);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(h);o&&(b=b.filter(function(T){return Object.getOwnPropertyDescriptor(h,T).enumerable})),S.push.apply(S,b)}return S}function c(h){for(var o=1;o<arguments.length;o++){var S=arguments[o]!=null?arguments[o]:{};o%2?v(Object(S),!0).forEach(function(b){m(h,b,S[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(S)):v(Object(S)).forEach(function(b){Object.defineProperty(h,b,Object.getOwnPropertyDescriptor(S,b))})}return h}function m(h,o,S){return o in h?Object.defineProperty(h,o,{value:S,enumerable:!0,configurable:!0,writable:!0}):h[o]=S,h}var R=c(c({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:A.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:K.default,bufferController:_.default,capLevelController:y.default,fpsController:C.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:a.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},E()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:W.default,timelineController:L.TimelineController,audioStreamController:D.default,audioTrackController:P.default,emeController:k.default,cmcdController:O.default});function E(){return{cueHandler:d.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function f(h,o){if((o.liveSyncDurationCount||o.liveMaxLatencyDurationCount)&&(o.liveSyncDuration||o.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(o.liveMaxLatencyDurationCount!==void 0&&(o.liveSyncDurationCount===void 0||o.liveMaxLatencyDurationCount<=o.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(o.liveMaxLatencyDuration!==void 0&&(o.liveSyncDuration===void 0||o.liveMaxLatencyDuration<=o.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return s({},h,o)}function g(h){var o=h.loader;if(o!==x.default&&o!==A.default)l.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var S=Object(x.fetchSupported)();S&&(h.loader=x.default,h.progressive=!0,h.enableSoftwareAES=!0,l.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/polyfills/number.ts"),D=M("./src/utils/ewma-bandwidth-estimator.ts"),P=M("./src/events.ts"),H=M("./src/utils/buffer-helper.ts"),W=M("./src/errors.ts"),_=M("./src/types/loader.ts"),L=M("./src/utils/logger.ts");function y(O,A){for(var x=0;x<A.length;x++){var d=A[x];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(O,d.key,d)}}function C(O,A,x){return A&&y(O.prototype,A),x&&y(O,x),O}var k=function(){function O(x){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=x;var d=x.config;this.bwEstimator=new D.default(d.abrEwmaSlowVoD,d.abrEwmaFastVoD,d.abrEwmaDefaultEstimate),this.registerListeners()}var A=O.prototype;return A.registerListeners=function(){var d=this.hls;d.on(P.Events.FRAG_LOADING,this.onFragLoading,this),d.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),d.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(P.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var d=this.hls;d.off(P.Events.FRAG_LOADING,this.onFragLoading,this),d.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(P.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},A.onFragLoading=function(d,a){var l=a.frag;if(l.type===_.PlaylistLevelType.MAIN&&!this.timer){var s;this.fragCurrent=l,this.partCurrent=(s=a.part)!=null?s:null,this.timer=self.setInterval(this.onCheck,100)}},A.onLevelLoaded=function(d,a){var l=this.hls.config;a.details.live?this.bwEstimator.update(l.abrEwmaSlowLive,l.abrEwmaFastLive):this.bwEstimator.update(l.abrEwmaSlowVoD,l.abrEwmaFastVoD)},A._abandonRulesCheck=function(){var d=this.fragCurrent,a=this.partCurrent,l=this.hls,s=l.autoLevelEnabled,v=l.config,c=l.media;if(!d||!c)return;var m=a?a.stats:d.stats,R=a?a.duration:d.duration;if(m.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!s||c.paused||!c.playbackRate||!c.readyState)return;var E=performance.now()-m.loading.start,f=Math.abs(c.playbackRate);if(E<=500*R/f)return;var g=l.levels,h=l.minAutoLevel,o=g[d.level],S=m.total||Math.max(m.loaded,Math.round(R*o.maxBitrate/8)),b=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/E),T=(S-m.loaded)/b,N=c.currentTime,z=(H.BufferHelper.bufferInfo(c,N,v.maxBufferHole).end-N)/f;if(z>=2*R/f||T<=z)return;var Y=Number.POSITIVE_INFINITY,te;for(te=d.level-1;te>h;te--){var G=g[te].maxBitrate;if(Y=R*G/(8*.8*b),Y<z)break}if(Y>=T)return;var F=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+d.sn+(a?" part "+a.index:"")+" of level "+d.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+te+`
|
|
Current BW estimate: `+(Object(K.isFiniteNumber)(F)?(F/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+T.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+Y.toFixed(3)+` s
|
|
Time to underbuffer: `+z.toFixed(3)+" s"),l.nextLoadLevel=te,this.bwEstimator.sample(E,m.loaded),this.clearTimer(),d.loader&&(this.fragCurrent=this.partCurrent=null,d.loader.abort()),l.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:d,part:a,stats:m})},A.onFragLoaded=function(d,a){var l=a.frag,s=a.part;if(l.type===_.PlaylistLevelType.MAIN&&Object(K.isFiniteNumber)(l.sn)){var v=s?s.stats:l.stats,c=s?s.duration:l.duration;if(this.clearTimer(),this.lastLoadedFragLevel=l.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[l.level],R=(m.loaded?m.loaded.bytes:0)+v.loaded,E=(m.loaded?m.loaded.duration:0)+c;m.loaded={bytes:R,duration:E},m.realBitrate=Math.round(8*R/E)}if(l.bitrateTest){var f={stats:v,frag:l,part:s,id:l.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,f),l.bitrateTest=!1}}},A.onFragBuffered=function(d,a){var l=a.frag,s=a.part,v=s?s.stats:l.stats;if(v.aborted)return;if(l.type!==_.PlaylistLevelType.MAIN||l.sn==="initSegment")return;var c=v.parsing.end-v.loading.start;this.bwEstimator.sample(c,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),l.bitrateTest?this.bitrateTestDelay=c/1e3:this.bitrateTestDelay=0},A.onError=function(d,a){switch(a.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},A.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},A.getNextABRAutoLevel=function(){var d=this.fragCurrent,a=this.partCurrent,l=this.hls,s=l.maxAutoLevel,v=l.config,c=l.minAutoLevel,m=l.media,R=a?a.duration:d?d.duration:0,E=m?m.currentTime:0,f=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,g=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,h=(H.BufferHelper.bufferInfo(m,E,v.maxBufferHole).end-E)/f,o=this.findBestLevel(g,c,s,h,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(o>=0)return o;L.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var S=R?Math.min(R,v.maxStarvationDelay):v.maxStarvationDelay,b=v.abrBandWidthFactor,T=v.abrBandWidthUpFactor;if(!h){var N=this.bitrateTestDelay;if(N){var z=R?Math.min(R,v.maxLoadingDelay):v.maxLoadingDelay;S=z-N,L.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*S)+" ms"),b=T=1}}return o=this.findBestLevel(g,c,s,h+S,b,T),Math.max(o,0)},A.findBestLevel=function(d,a,l,s,v,c){for(var m,R=this.fragCurrent,E=this.partCurrent,f=this.lastLoadedFragLevel,g=this.hls.levels,h=g[f],o=!!(h!=null&&(m=h.details)!==null&&m!==void 0&&m.live),S=h==null?void 0:h.codecSet,b=E?E.duration:R?R.duration:0,T=l;T>=a;T--){var N=g[T];if(!N||S&&N.codecSet!==S)continue;var z=N.details,Y=(E?z==null?void 0:z.partTarget:z==null?void 0:z.averagetargetduration)||b,te=void 0;T<=f?te=v*d:te=c*d;var G=g[T].maxBitrate,F=G*Y/te;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+T+"/"+Math.round(te)+"/"+G+"/"+Y+"/"+s+"/"+F),te>G&&(!F||o&&!this.bitrateTestDelay||F<s))return T}return-1},C(O,[{key:"nextAutoLevel",get:function(){var d=this._nextAutoLevel,a=this.bwEstimator;if(d!==-1&&(!a||!a.canEstimate()))return d;var l=this.getNextABRAutoLevel();return d!==-1&&(l=Math.min(d,l)),l},set:function(d){this._nextAutoLevel=d}}]),O}();X.default=k},"./src/controller/audio-stream-controller.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/polyfills/number.ts"),D=M("./src/controller/base-stream-controller.ts"),P=M("./src/events.ts"),H=M("./src/utils/buffer-helper.ts"),W=M("./src/controller/fragment-tracker.ts"),_=M("./src/types/level.ts"),L=M("./src/types/loader.ts"),y=M("./src/loader/fragment.ts"),C=M("./src/demux/chunk-cache.ts"),k=M("./src/demux/transmuxer-interface.ts"),O=M("./src/types/transmuxer.ts"),A=M("./src/controller/fragment-finders.ts"),x=M("./src/utils/discontinuities.ts"),d=M("./src/errors.ts"),a=M("./src/utils/logger.ts");function l(){return l=Object.assign||function(R){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(R[g]=f[g])}return R},l.apply(this,arguments)}function s(R,E){R.prototype=Object.create(E.prototype),R.prototype.constructor=R,v(R,E)}function v(R,E){return v=Object.setPrototypeOf||function(g,h){return g.__proto__=h,g},v(R,E)}var c=100,m=function(R){s(E,R);function E(g,h){var o;return o=R.call(this,g,h,"[audio-stream-controller]")||this,o.videoBuffer=null,o.videoTrackCC=-1,o.waitingVideoCC=-1,o.audioSwitch=!1,o.trackId=-1,o.waitingData=null,o.mainDetails=null,o.bufferFlushed=!1,o._registerListeners(),o}var f=E.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var h=this.hls;h.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(P.Events.ERROR,this.onError,this),h.on(P.Events.BUFFER_RESET,this.onBufferReset,this),h.on(P.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var h=this.hls;h.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(P.Events.ERROR,this.onError,this),h.off(P.Events.BUFFER_RESET,this.onBufferReset,this),h.off(P.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f.onInitPtsFound=function(h,o){var S=o.frag,b=o.id,T=o.initPTS;if(b==="main"){var N=S.cc;this.initPTS[S.cc]=T,this.log("InitPTS for cc: "+N+" found from main: "+T),this.videoTrackCC=N,this.state===D.State.WAITING_INIT_PTS&&this.tick()}},f.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=D.State.STOPPED;return}var o=this.lastCurrentTime;this.stopLoad(),this.setInterval(c),this.fragLoadError=0,o>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),this.state=D.State.IDLE):(this.loadedmetadata=!1,this.state=D.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},f.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_TRACK:{var h,o=this.levels,S=this.trackId,b=o==null||((h=o[S])===null||h===void 0)?void 0:h.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=D.State.WAITING_INIT_PTS}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var T,N=performance.now(),z=this.retryDate;(!z||N>=z||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=D.State.IDLE);break}case D.State.WAITING_INIT_PTS:{var Y=this.waitingData;if(Y){var te=Y.frag,G=Y.part,F=Y.cache,re=Y.complete;if(this.initPTS[te.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.FRAG_LOADING;var le=F.flush(),Ee={frag:te,part:G,payload:le,networkDetails:null};this._handleFragmentLoadProgress(Ee),re&&R.prototype._handleFragmentLoadComplete.call(this,Ee)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+te.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Oe=this.getLoadPosition(),Ye=H.BufferHelper.bufferInfo(this.mediaBuffer,Oe,this.config.maxBufferHole),Pe=Object(A.fragmentWithinToleranceTest)(Ye.end,this.config.maxFragLookUpTolerance,te);Pe<0&&(a.logger.log("Waiting fragment cc ("+te.cc+") @ "+te.start+" cancelled because another fragment at "+Ye.end+" is needed"),this.clearWaitingFragment())}}else this.state=D.State.IDLE}}this.onTickEnd()},f.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=D.State.IDLE)},f.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var o=this.mediaBuffer?this.mediaBuffer:h,S=o.buffered;!this.loadedmetadata&&S.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},f.doTickIdle=function(){var h,o,S=this.hls,b=this.levels,T=this.media,N=this.trackId,z=S.config;if(!b||!b[N])return;if(!T&&(this.startFragRequested||!z.startFragPrefetch))return;var Y=b[N],te=Y.details;if(!te||te.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(te)){this.state=D.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var G=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(G===null)return;var F=G.len,re=this.getMaxBufferLength(),le=this.audioSwitch;if(F>=re&&!le)return;if(!le&&this._streamEnded(G,te)){S.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=D.State.ENDED;return}var Ee=te.fragments,Oe=Ee[0].start,Ye=G.end;if(le){var Pe=this.getLoadPosition();Ye=Pe,te.PTSKnown&&Pe<Oe&&((G.end>Oe||G.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),T.currentTime=Oe+.05))}var Be=this.getNextFragment(Ye,te);if(!Be){this.bufferFlushed=!0;return}((h=Be.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((o=Be.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(Be,te):this.loadFragment(Be,te,Ye)},f.getMaxBufferLength=function(){var h=R.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return o===null?h:Math.max(h,o.len)},f.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(h,o){var S=o.audioTracks;this.resetTransmuxer(),this.levels=S.map(function(b){return new _.Level(b)})},f.onAudioTrackSwitching=function(h,o){var S=!!o.url;this.trackId=o.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),S?this.setInterval(c):this.resetTransmuxer(),S?(this.audioSwitch=!0,this.state=D.State.IDLE):this.state=D.State.STOPPED,this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},f.onLevelLoaded=function(h,o){this.mainDetails=o.details},f.onAudioTrackLoaded=function(h,o){var S,b=this.levels,T=o.details,N=o.id;if(!b){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+T.startSN+","+T.endSN+"],duration:"+T.totalduration);var z=b[N],Y=0;if(T.live||(S=z.details)!==null&&S!==void 0&&S.live){var te=this.mainDetails;if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed||!te)return;!z.details&&T.hasProgramDateTime&&te.hasProgramDateTime?(Object(x.alignMediaPlaylistByPDT)(T,te),Y=T.fragments[0].start):Y=this.alignPlaylists(T,z.details)}z.details=T,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!T.live)&&this.setStartPosition(z.details,Y),this.state===D.State.WAITING_TRACK&&!this.waitForCdnTuneIn(T)&&(this.state=D.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(h){var o,S=h.frag,b=h.part,T=h.payload,N=this.config,z=this.trackId,Y=this.levels;if(!Y){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+S.sn+" of level "+S.level+" will not be buffered");return}var te=Y[z];console.assert(te,"Audio track is defined on fragment load progress");var G=te.details;console.assert(G,"Audio track details are defined on fragment load progress");var F=N.defaultAudioCodec||te.audioCodec||"mp4a.40.2",re=this.transmuxer;re||(re=this.transmuxer=new k.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var le=this.initPTS[S.cc],Ee=(o=S.initSegment)===null||o===void 0?void 0:o.data;if(le!==void 0){var Oe=!1,Ye=b?b.index:-1,Pe=Ye!==-1,Be=new O.ChunkMetadata(S.level,S.sn,S.stats.chunkCount,T.byteLength,Ye,Pe);re.push(T,Ee,F,"",S,b,G.totalduration,Oe,Be,le)}else{a.logger.log("Unknown video PTS for cc "+S.cc+", waiting for video PTS before demuxing audio frag "+S.sn+" of ["+G.startSN+" ,"+G.endSN+"],track "+z);var Ue=this.waitingData=this.waitingData||{frag:S,part:b,cache:new C.default,complete:!1},Ne=Ue.cache;Ne.push(new Uint8Array(T)),this.waitingVideoCC=this.videoTrackCC,this.state=D.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,h)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(h,o){var S=o.tracks.audio;S&&(this.mediaBuffer=S.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},f.onFragBuffered=function(h,o){var S=o.frag,b=o.part;if(S.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(S)){this.warn("Fragment "+S.sn+(b?" p: "+b.index:"")+" of level "+S.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}S.sn!=="initSegment"&&(this.fragPrevious=S,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(S,b)},f.onError=function(h,o){switch(o.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,o);break;case d.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case d.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==D.State.ERROR&&this.state!==D.State.STOPPED&&(this.state=o.fatal?D.State.ERROR:D.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var S=!0,b=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);b&&b.len>.5&&(S=!this.reduceMaxBufferLength(b.len)),S&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},f.onBufferFlushed=function(h,o){var S=o.type;S===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(h){var o,S="audio",b=this.hls,T=h.remuxResult,N=h.chunkMeta,z=this.getCurrentContext(N);if(!z){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var Y=z.frag,te=z.part,G=T.audio,F=T.text,re=T.id3,le=T.initSegment;if(this.fragContextChanged(Y))return;if(this.state=D.State.PARSING,this.audioSwitch&&G&&this.completeAudioSwitch(),le!=null&&le.tracks&&(this._bufferInitSegment(le.tracks,Y,N),b.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:Y,id:S,tracks:le.tracks})),G){var Ee=G.startPTS,Oe=G.endPTS,Ye=G.startDTS,Pe=G.endDTS;te&&(te.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:Ee,endPTS:Oe,startDTS:Ye,endDTS:Pe}),Y.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,Ee,Oe,Ye,Pe),this.bufferFragmentData(G,Y,te,N)}if(re!=null&&(o=re.samples)!==null&&o!==void 0&&o.length){var Be=l({frag:Y,id:S},re);b.trigger(P.Events.FRAG_PARSING_METADATA,Be)}if(F){var Ue=l({frag:Y,id:S},F);b.trigger(P.Events.FRAG_PARSING_USERDATA,Ue)}},f._bufferInitSegment=function(h,o,S){if(this.state!==D.State.PARSING)return;h.video&&delete h.video;var b=h.audio;if(!b)return;b.levelCodec=b.codec,b.id="audio",this.log("Init audio buffer, container:"+b.container+", codecs[parsed]=["+b.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,h);var T=b.initSegment;if(T!=null&&T.byteLength){var N={type:"audio",frag:o,part:null,chunkMeta:S,parent:o.type,data:T};this.hls.trigger(P.Events.BUFFER_APPENDING,N)}this.tick()},f.loadFragment=function(h,o,S){var b=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||b===W.FragmentState.NOT_LOADED||b===W.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):o.live&&!Object(K.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=D.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,h,o,S)))},f.completeAudioSwitch=function(){var h=this.hls,o=this.media,S=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:S})},E}(D.default);X.default=m},"./src/controller/audio-track-controller.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/events.ts"),D=M("./src/errors.ts"),P=M("./src/controller/base-playlist-controller.ts"),H=M("./src/types/loader.ts");function W(k,O){for(var A=0;A<O.length;A++){var x=O[A];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(k,x.key,x)}}function _(k,O,A){return O&&W(k.prototype,O),A&&W(k,A),k}function L(k,O){k.prototype=Object.create(O.prototype),k.prototype.constructor=k,y(k,O)}function y(k,O){return y=Object.setPrototypeOf||function(x,d){return x.__proto__=d,x},y(k,O)}var C=function(k){L(O,k);function O(x){var d;return d=k.call(this,x,"[audio-track-controller]")||this,d.tracks=[],d.groupId=null,d.tracksInGroup=[],d.trackId=-1,d.trackName="",d.selectDefaultTrack=!0,d.registerListeners(),d}var A=O.prototype;return A.registerListeners=function(){var d=this.hls;d.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.on(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(K.Events.ERROR,this.onError,this)},A.unregisterListeners=function(){var d=this.hls;d.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),d.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),d.off(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(K.Events.ERROR,this.onError,this)},A.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,k.prototype.destroy.call(this)},A.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},A.onManifestParsed=function(d,a){this.tracks=a.audioTracks||[]},A.onAudioTrackLoaded=function(d,a){var l=a.id,s=a.details,v=this.tracksInGroup[l];if(!v){this.warn("Invalid audio track id "+l);return}var c=v.details;v.details=a.details,this.log("audioTrack "+l+" loaded ["+s.startSN+"-"+s.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,a,c))},A.onLevelLoading=function(d,a){this.switchLevel(a.level)},A.onLevelSwitching=function(d,a){this.switchLevel(a.level)},A.switchLevel=function(d){var a=this.hls.levels[d];if(!(a!=null&&a.audioGroupIds))return;var l=a.audioGroupIds[a.urlId];if(this.groupId!==l){this.groupId=l;var s=this.tracks.filter(function(c){return!l||c.groupId===l});this.selectDefaultTrack&&!s.some(function(c){return c.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=s;var v={audioTracks:s};this.log("Updating audio tracks, "+s.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(K.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},A.onError=function(d,a){if(k.prototype.onError.call(this,d,a),a.fatal||!a.context)return;a.context.type===H.PlaylistContextType.AUDIO_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},A.setAudioTrack=function(d){var a=this.tracksInGroup;if(d<0||d>=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var l=a[this.trackId];this.log("Now switching to audio-track index "+d);var s=a[d],v=s.id,c=s.groupId,m=c===void 0?"":c,R=s.name,E=s.type,f=s.url;if(this.trackId=d,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(K.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:m,name:R,type:E,url:f}),s.details&&!s.details.live)return;var g=this.switchParams(s.url,l==null?void 0:l.details);this.loadPlaylist(g)},A.selectInitialTrack=function(){var d=this.tracksInGroup;console.assert(d.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,l=this.findTrackId(a)||this.findTrackId();l!==-1?this.setAudioTrack(l):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},A.findTrackId=function(d){for(var a=this.tracksInGroup,l=0;l<a.length;l++){var s=a[l];if((!this.selectDefaultTrack||s.default)&&(!d||d===s.name))return s.id}return-1},A.loadPlaylist=function(d){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var l=a.id,s=a.groupId,v=a.url;if(d)try{v=d.addDirectives(v)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("loading audio-track playlist for id: "+l),this.clearTimer(),this.hls.trigger(K.Events.AUDIO_TRACK_LOADING,{url:v,id:l,groupId:s,deliveryDirectives:d||null})}},_(O,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(d){this.selectDefaultTrack=!1,this.setAudioTrack(d)}}]),O}(P.default);X.default=C},"./src/controller/base-playlist-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return _});var K=M("./src/polyfills/number.ts"),D=M("./src/types/level.ts"),P=M("./src/controller/level-helper.ts"),H=M("./src/utils/logger.ts"),W=M("./src/errors.ts"),_=function(){function L(C,k){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,k+":"),this.warn=H.logger.warn.bind(H.logger,k+":"),this.hls=C}var y=L.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(k,O){O.fatal&&O.type===W.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(k,O){var A=O==null?void 0:O.renditionReports;if(A)for(var x=0;x<A.length;x++){var d=A[x],a=""+d.URI;if(a===k.substr(-a.length)){var l=parseInt(d["LAST-MSN"]),s=parseInt(d["LAST-PART"]);if(O&&this.hls.config.lowLatencyMode){var v=Math.min(O.age-O.partTarget,O.targetduration);s!==void 0&&v>O.partTarget&&(s+=1)}if(Object(K.isFiniteNumber)(l))return new D.HlsUrlParameters(l,Object(K.isFiniteNumber)(s)?s:void 0,D.HlsSkip.No)}}},y.loadPlaylist=function(k){},y.shouldLoadTrack=function(k){return this.canLoad&&k&&!!k.url&&(!k.details||k.details.live)},y.playlistLoaded=function(k,O,A){var x=this,d=O.details,a=O.stats,l=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(d.advancedDateTime=Date.now()-l,d.live||A!=null&&A.live){if(d.reloaded(A),A&&this.log("live playlist "+k+" "+(d.advanced?"REFRESHED "+d.lastPartSn+"-"+d.lastPartIndex:"MISSED")),A&&d.fragments.length>0&&Object(P.mergeDetails)(A,d),!this.canLoad||!d.live)return;var s,v=void 0,c=void 0;if(d.canBlockReload&&d.endSN&&d.advanced){var m=this.hls.config.lowLatencyMode,R=d.lastPartSn,E=d.endSN,f=d.lastPartIndex,g=f!==-1,h=R===E,o=m?0:f;g?(v=h?E+1:R,c=h?o:f+1):v=E+1;var S=d.age,b=S+d.ageHeader,T=Math.min(b-d.partTarget,d.targetduration*1.5);if(T>0){if(A&&T>A.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+A.tuneInGoal+" to: "+T+" with playlist age: "+d.age),T=0;else{var N=Math.floor(T/d.targetduration);if(v+=N,c!==void 0){var z=Math.round(T%d.targetduration/d.partTarget);c+=z}this.log("CDN Tune-in age: "+d.ageHeader+"s last advanced "+S.toFixed(2)+"s goal: "+T+" skip sn "+N+" to part "+c)}d.tuneInGoal=T}if(s=this.getDeliveryDirectives(d,O.deliveryDirectives,v,c),m||!h){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(d,O.deliveryDirectives,v,c);var Y=Object(P.computeReloadInterval)(d,a);v!==void 0&&d.canBlockReload&&(Y-=d.partTarget||1),this.log("reload live playlist "+k+" in "+Math.round(Y)+" ms"),this.timer=self.setTimeout(function(){return x.loadPlaylist(s)},Y)}else this.clearTimer()},y.getDeliveryDirectives=function(k,O,A,x){var d=Object(D.getSkipValue)(k,A);return O!=null&&O.skip&&k.deltaUpdateFailed&&(A=O.msn,x=O.part,d=D.HlsSkip.No),new D.HlsUrlParameters(A,x,d)},y.retryLoadingOrFail=function(k){var O=this,A=this.hls.config,x=this.retryCount<A.levelLoadingMaxRetry;if(x){var d;if(this.retryCount++,k.details.indexOf("LoadTimeOut")>-1&&(d=k.context)!==null&&d!==void 0&&d.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+k.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*A.levelLoadingRetryDelay,A.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return O.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+k.details+'"')}}else this.warn('cannot recover from error "'+k.details+'"'),this.clearTimer(),k.fatal=!0;return x},L}()},"./src/controller/base-stream-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"State",function(){return E}),M.d(X,"default",function(){return f});var K=M("./src/polyfills/number.ts"),D=M("./src/task-loop.ts"),P=M("./src/controller/fragment-tracker.ts"),H=M("./src/utils/buffer-helper.ts"),W=M("./src/utils/logger.ts"),_=M("./src/events.ts"),L=M("./src/errors.ts"),y=M("./src/types/transmuxer.ts"),C=M("./src/utils/mp4-tools.ts"),k=M("./src/utils/discontinuities.ts"),O=M("./src/controller/fragment-finders.ts"),A=M("./src/controller/level-helper.ts"),x=M("./src/loader/fragment-loader.ts"),d=M("./src/crypt/decrypter.ts"),a=M("./src/utils/time-ranges.ts"),l=M("./src/types/loader.ts");function s(g,h){for(var o=0;o<h.length;o++){var S=h[o];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(g,S.key,S)}}function v(g,h,o){return h&&s(g.prototype,h),o&&s(g,o),g}function c(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function m(g,h){g.prototype=Object.create(h.prototype),g.prototype.constructor=g,R(g,h)}function R(g,h){return R=Object.setPrototypeOf||function(S,b){return S.__proto__=b,S},R(g,h)}var E={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},f=function(g){m(h,g);function h(S,b,T){var N;return N=g.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=E.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=T,N.log=W.logger.log.bind(W.logger,T+":"),N.warn=W.logger.warn.bind(W.logger,T+":"),N.hls=S,N.fragmentLoader=new x.default(S.config),N.fragmentTracker=b,N.config=S.config,N.decrypter=new d.default(S,S.config),S.on(_.Events.KEY_LOADED,N.onKeyLoaded,c(N)),N}var o=h.prototype;return o.doTick=function(){this.onTickEnd()},o.onTickEnd=function(){},o.startLoad=function(b){},o.stopLoad=function(){this.fragmentLoader.abort();var b=this.fragCurrent;b&&this.fragmentTracker.removeFragment(b),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=E.STOPPED},o._streamEnded=function(b,T){var N=this.fragCurrent,z=this.fragmentTracker;if(!T.live&&N&&N.sn===T.endSN&&!b.nextStart){var Y=z.getState(N);return Y===P.FragmentState.PARTIAL||Y===P.FragmentState.OK}return!1},o.onMediaAttached=function(b,T){var N=this.media=this.mediaBuffer=T.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var z=this.config;this.levels&&z.autoStartLoad&&this.state===E.STOPPED&&this.startLoad(z.startPosition)},o.onMediaDetaching=function(){var b=this.media;b!=null&&b.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),b&&(b.removeEventListener("seeking",this.onvseeking),b.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},o.onMediaSeeking=function(){var b=this.config,T=this.fragCurrent,N=this.media,z=this.mediaBuffer,Y=this.state,te=N?N.currentTime:0,G=H.BufferHelper.bufferInfo(z||N,te,b.maxBufferHole);if(this.log("media seeking to "+(Object(K.isFiniteNumber)(te)?te.toFixed(3):te)+", state: "+Y),Y===E.ENDED)this.resetLoadingState();else if(T&&!G.len){var F=b.maxFragLookUpTolerance,re=T.start-F,le=T.start+T.duration+F,Ee=te>le;(te<re||Ee)&&(Ee&&T.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),T.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=te),!this.loadedmetadata&&!G.len&&(this.nextLoadPosition=this.startPosition=te),this.tickImmediate()},o.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},o.onKeyLoaded=function(b,T){if(this.state!==E.KEY_LOADING||T.frag!==this.fragCurrent||!this.levels)return;this.state=E.IDLE;var N=this.levels[T.frag.level].details;N&&this.loadFragment(T.frag,N,T.frag.start)},o.onHandlerDestroying=function(){this.stopLoad(),g.prototype.onHandlerDestroying.call(this)},o.onHandlerDestroyed=function(){this.state=E.STOPPED,this.hls.off(_.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,g.prototype.onHandlerDestroyed.call(this)},o.loadKey=function(b,T){this.log("Loading key for "+b.sn+" of ["+T.startSN+"-"+T.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=E.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(_.Events.KEY_LOADING,{frag:b})},o.loadFragment=function(b,T,N){this._loadFragForPlayback(b,T,N)},o._loadFragForPlayback=function(b,T,N){var z=this,Y=function(G){if(z.fragContextChanged(b)){z.warn("Fragment "+b.sn+(G.part?" p: "+G.part.index:"")+" of level "+b.level+" was dropped during download."),z.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,z._handleFragmentLoadProgress(G)};this._doFragLoad(b,T,N,Y).then(function(te){if(!te)return;z.fragLoadError=0;var G=z.state;if(z.fragContextChanged(b)){(G===E.FRAG_LOADING||G===E.BACKTRACKING||!z.fragCurrent&&G===E.PARSING)&&(z.fragmentTracker.removeFragment(b),z.state=E.IDLE);return}if("payload"in te&&(z.log("Loaded fragment "+b.sn+" of level "+b.level),z.hls.trigger(_.Events.FRAG_LOADED,te),z.state===E.BACKTRACKING)){z.fragmentTracker.backtrack(b,te),z.resetFragmentLoading(b);return}z._handleFragmentLoadComplete(te)}).catch(function(te){z.warn(te),z.resetFragmentLoading(b)})},o.flushMainBuffer=function(b,T,N){if(N===void 0&&(N=null),!(b-T))return;var z={startOffset:b,endOffset:T,type:N};this.fragLoadError=0,this.hls.trigger(_.Events.BUFFER_FLUSHING,z)},o._loadInitSegment=function(b){var T=this;this._doFragLoad(b).then(function(N){if(!N||T.fragContextChanged(b)||!T.levels)throw new Error("init load aborted");return N}).then(function(N){var z=T.hls,Y=N.payload,te=b.decryptdata;if(Y&&Y.byteLength>0&&te&&te.key&&te.iv&&te.method==="AES-128"){var G=self.performance.now();return T.decrypter.webCryptoDecrypt(new Uint8Array(Y),te.key.buffer,te.iv.buffer).then(function(F){var re=self.performance.now();return z.trigger(_.Events.FRAG_DECRYPTED,{frag:b,payload:F,stats:{tstart:G,tdecrypt:re}}),N.payload=F,N})}return N}).then(function(N){var z=T.fragCurrent,Y=T.hls,te=T.levels;if(!te)throw new Error("init load aborted, missing levels");var G=te[b.level].details;console.assert(G,"Level details are defined when init segment is loaded");var F=b.stats;T.state=E.IDLE,T.fragLoadError=0,b.data=new Uint8Array(N.payload),F.parsing.start=F.buffering.start=self.performance.now(),F.parsing.end=F.buffering.end=self.performance.now(),N.frag===z&&Y.trigger(_.Events.FRAG_BUFFERED,{stats:F,frag:z,part:null,id:b.type}),T.tick()}).catch(function(N){T.warn(N),T.resetFragmentLoading(b)})},o.fragContextChanged=function(b){var T=this.fragCurrent;return!b||!T||b.level!==T.level||b.sn!==T.sn||b.urlId!==T.urlId},o.fragBufferedComplete=function(b,T){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(T?" part: "+T.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+a.default.toString(H.BufferHelper.getBuffered(N))),this.state=E.IDLE,this.tick()},o._handleFragmentLoadComplete=function(b){var T=this.transmuxer;if(!T)return;var N=b.frag,z=b.part,Y=b.partsLoaded,te=!Y||Y.length===0||Y.some(function(F){return!F}),G=new y.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,z?z.index:-1,!te);T.flush(G)},o._handleFragmentLoadProgress=function(b){},o._doFragLoad=function(b,T,N,z){var Y=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(b.start,N||0),this.config.lowLatencyMode&&T){var te=T.partList;if(te&&z){N>b.end&&T.fragmentHint&&(b=T.fragmentHint);var G=this.getNextPart(te,b,N);if(G>-1){var F=te[G];return this.log("Loading part sn: "+b.sn+" p: "+F.index+" cc: "+b.cc+" of playlist ["+T.startSN+"-"+T.endSN+"] parts [0-"+G+"-"+(te.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=F.start+F.duration,this.state=E.FRAG_LOADING,this.hls.trigger(_.Events.FRAG_LOADING,{frag:b,part:te[G],targetBufferTime:N}),this.doFragPartsLoad(b,te,G,z).catch(function(re){return Y.handleFragLoadError(re)})}else if(!b.url||this.loadedEndOfParts(te,N))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(T?"of ["+T.startSN+"-"+T.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(N.toFixed(3))),Object(K.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=E.FRAG_LOADING,this.hls.trigger(_.Events.FRAG_LOADING,{frag:b,targetBufferTime:N}),this.fragmentLoader.load(b,z).catch(function(re){return Y.handleFragLoadError(re)})},o.doFragPartsLoad=function(b,T,N,z){var Y=this;return new Promise(function(te,G){var F=[],re=function le(Ee){var Oe=T[Ee];Y.fragmentLoader.loadPart(b,Oe,z).then(function(Ye){F[Oe.index]=Ye;var Pe=Ye.part;Y.hls.trigger(_.Events.FRAG_LOADED,Ye);var Be=T[Ee+1];if(Be&&Be.fragment===b)le(Ee+1);else return te({frag:b,part:Pe,partsLoaded:F})}).catch(G)};re(N)})},o.handleFragLoadError=function(b){var T=b.data;return T&&T.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(T.frag,T.part):this.hls.trigger(_.Events.ERROR,T),null},o._handleTransmuxerFlush=function(b){var T=this.getCurrentContext(b);if(!T||this.state!==E.PARSING){this.fragCurrent||(this.state=E.IDLE);return}var N=T.frag,z=T.part,Y=T.level,te=self.performance.now();N.stats.parsing.end=te,z&&(z.stats.parsing.end=te),this.updateLevelTiming(N,z,Y,b.partial)},o.getCurrentContext=function(b){var T=this.levels,N=b.level,z=b.sn,Y=b.part;if(!T||!T[N])return this.warn("Levels object was unset while buffering fragment "+z+" of level "+N+". The current chunk will not be buffered."),null;var te=T[N],G=Y>-1?Object(A.getPartWith)(te,z,Y):null,F=G?G.fragment:Object(A.getFragmentWithSN)(te,z,this.fragCurrent);return F?{frag:F,part:G,level:te}:null},o.bufferFragmentData=function(b,T,N,z){if(!b||this.state!==E.PARSING)return;var Y=b.data1,te=b.data2,G=Y;if(Y&&te&&(G=Object(C.appendUint8Array)(Y,te)),!G||!G.length)return;var F={type:b.type,frag:T,part:N,chunkMeta:z,parent:T.type,data:G};this.hls.trigger(_.Events.BUFFER_APPENDING,F),b.dropped&&b.independent&&!N&&this.flushBufferGap(T)},o.flushBufferGap=function(b){var T=this.media;if(!T)return;if(!H.BufferHelper.isBuffered(T,T.currentTime)){this.flushMainBuffer(0,b.start);return}var N=T.currentTime,z=H.BufferHelper.bufferInfo(T,N,0),Y=b.duration,te=Math.min(this.config.maxFragLookUpTolerance*2,Y*.25),G=Math.max(Math.min(b.start-te,z.end-te),N+te);b.start-G>te&&this.flushMainBuffer(G,b.start)},o.getFwdBufferInfo=function(b,T){var N=this.config,z=this.getLoadPosition();if(!Object(K.isFiniteNumber)(z))return null;var Y=H.BufferHelper.bufferInfo(b,z,N.maxBufferHole);if(Y.len===0&&Y.nextStart!==void 0){var te=this.fragmentTracker.getBufferedFrag(z,T);if(te&&Y.nextStart<te.end)return H.BufferHelper.bufferInfo(b,z,Math.max(Y.nextStart,N.maxBufferHole))}return Y},o.getMaxBufferLength=function(b){var T=this.config,N;return b?N=Math.max(8*T.maxBufferSize/b,T.maxBufferLength):N=T.maxBufferLength,Math.min(N,T.maxMaxBufferLength)},o.reduceMaxBufferLength=function(b){var T=this.config,N=b||T.maxBufferLength;return T.maxMaxBufferLength>=N?(T.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+T.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(b,T){var N,z,Y=T.fragments,te=Y.length;if(!te)return null;var G=this.config,F=Y[0].start,re;if(T.live){var le=G.initialLiveManifestSize;if(te<le)return this.warn("Not enough fragments to start playback (have: "+te+", need: "+le+")"),null;!T.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(re=this.getInitialLiveFragment(T,Y),this.startPosition=re?this.hls.liveSyncPosition||re.start:b)}else b<=F&&(re=Y[0]);if(!re){var Ee=G.lowLatencyMode?T.partEnd:T.fragmentEnd;re=this.getFragmentAtPosition(b,Ee,T)}return(N=re)!==null&&N!==void 0&&N.initSegment&&!((z=re)!==null&&z!==void 0&&z.initSegment.data)&&!this.bitrateTest&&(re=re.initSegment),re},o.getNextPart=function(b,T,N){for(var z=-1,Y=!1,te=!0,G=0,F=b.length;G<F;G++){var re=b[G];if(te=te&&!re.independent,z>-1&&N<re.start)break;var le=re.loaded;!le&&(Y||re.independent||te)&&re.fragment===T&&(z=G),Y=le}return z},o.loadedEndOfParts=function(b,T){var N=b[b.length-1];return N&&T>N.start&&N.loaded},o.getInitialLiveFragment=function(b,T){var N=this.fragPrevious,z=null;if(N){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),z=Object(O.findFragmentByPDT)(T,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!z){var Y=N.sn+1;if(Y>=b.startSN&&Y<=b.endSN){var te=T[Y-b.startSN];N.cc===te.cc&&(z=te,this.log("Live playlist, switching playlist, load frag with next SN: "+z.sn))}z||(z=Object(O.findFragWithCC)(T,N.cc),z&&this.log("Live playlist, switching playlist, load frag with same CC: "+z.sn))}}else{var G=this.hls.liveSyncPosition;G!==null&&(z=this.getFragmentAtPosition(G,this.bitrateTest?b.fragmentEnd:b.edge,b))}return z},o.getFragmentAtPosition=function(b,T,N){var z=this.config,Y=this.fragPrevious,te=N.fragments,G=N.endSN,F=N.fragmentHint,re=z.maxFragLookUpTolerance,le=!!(z.lowLatencyMode&&N.partList&&F);le&&F&&!this.bitrateTest&&(te=te.concat(F),G=F.sn);var Ee;if(b<T){var Oe=b>T-re?0:re;Ee=Object(O.findFragmentByPTS)(Y,te,b,Oe)}else Ee=te[te.length-1];if(Ee){var Ye=Ee.sn-N.startSN,Pe=Y&&Ee.level===Y.level,Be=te[Ye+1],Ue=this.fragmentTracker.getState(Ee);if(Ue===P.FragmentState.BACKTRACKED){Ee=null;for(var Ne=Ye;te[Ne]&&this.fragmentTracker.getState(te[Ne])===P.FragmentState.BACKTRACKED;)Y?Ee=te[Ne--]:Ee=te[--Ne];Ee||(Ee=Be)}else Y&&Ee.sn===Y.sn&&!le&&(Pe&&(Ee.sn<G&&this.fragmentTracker.getState(Be)!==P.FragmentState.OK?(this.log("SN "+Ee.sn+" just loaded, load next one: "+Be.sn),Ee=Be):Ee=null))}return Ee},o.synchronizeToLiveEdge=function(b){var T=this.config,N=this.media;if(!N)return;var z=this.hls.liveSyncPosition,Y=N.currentTime,te=b.fragments[0].start,G=b.edge,F=Y>=te-T.maxFragLookUpTolerance&&Y<=G;if(z!==null&&N.duration>z&&(Y<z||!F)){var re=T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:T.liveMaxLatencyDurationCount*b.targetduration;(!F&&N.readyState<4||Y<G-re)&&(this.loadedmetadata||(this.nextLoadPosition=z),N.readyState&&(this.warn("Playback: "+Y.toFixed(3)+" is located too far from the end of live sliding playlist: "+G+", reset currentTime to : "+z.toFixed(3)),N.currentTime=z))}},o.alignPlaylists=function(b,T){var N=this.levels,z=this.levelLastLoaded,Y=this.fragPrevious,te=z!==null?N[z]:null,G=b.fragments.length;if(!G)return this.warn("No fragments in live playlist"),0;var F=b.fragments[0].start,re=!T,le=b.alignedSliding&&Object(K.isFiniteNumber)(F);if(re||!le&&!F){Object(k.alignStream)(Y,te,b);var Ee=b.fragments[0].start;return this.log("Live playlist sliding: "+Ee.toFixed(2)+" start-sn: "+(T?T.startSN:"na")+"->"+b.startSN+" prev-sn: "+(Y?Y.sn:"na")+" fragments: "+G),Ee}return F},o.waitForCdnTuneIn=function(b){var T=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*T)},o.setStartPosition=function(b,T){var N=this.startPosition;if(N<T&&(N=-1),N===-1||this.lastCurrentTime===-1){var z=b.startTimeOffset;Object(K.isFiniteNumber)(z)?(N=T+z,z<0&&(N+=b.totalduration),N=Math.min(Math.max(T,N),T+b.totalduration),this.log("Start time offset "+z+" found in playlist, adjust startPosition to "+N),this.startPosition=N):b.live?N=this.hls.liveSyncPosition||T:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},o.getLoadPosition=function(){var b=this.media,T=0;return this.loadedmetadata&&b?T=b.currentTime:this.nextLoadPosition&&(T=this.nextLoadPosition),T},o.handleFragLoadAborted=function(b,T){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(T?" part"+T.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},o.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=E.IDLE)},o.onFragmentOrKeyLoadError=function(b,T){if(T.fatal)return;var N=T.frag;if(!N||N.type!==b)return;var z=this.fragCurrent;console.assert(z&&N.sn===z.sn&&N.level===z.level&&N.urlId===z.urlId,"Frag load error must match current frag to retry");var Y=this.config;if(this.fragLoadError+1<=Y.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var te=Math.min(Math.pow(2,this.fragLoadError)*Y.fragLoadingRetryDelay,Y.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+b+" "+N.level+" failed to load, retrying in "+te+"ms"),this.retryDate=self.performance.now()+te,this.fragLoadError++,this.state=E.FRAG_LOADING_WAITING_RETRY}else T.levelRetry?(b===l.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=E.IDLE):(W.logger.error(T.details+" reaches max retry, redispatch as fatal ..."),T.fatal=!0,this.hls.stopLoad(),this.state=E.ERROR)},o.afterBufferFlushed=function(b,T,N){if(!b)return;var z=H.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(T,z,N),this.state===E.ENDED&&this.resetLoadingState()},o.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=E.IDLE},o.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var T=this.levels?this.levels[b].details:null;if(T!=null&&T.live)return this.startPosition=-1,this.setStartPosition(T,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},o.updateLevelTiming=function(b,T,N,z){var Y=this,te=N.details;console.assert(!!te,"level.details must be defined");var G=Object.keys(b.elementaryStreams).reduce(function(F,re){var le=b.elementaryStreams[re];if(le){var Ee=le.endPTS-le.startPTS;if(Ee<=0)return Y.warn("Could not parse fragment "+b.sn+" "+re+" duration reliably ("+Ee+") resetting transmuxer to fallback to playlist timing"),Y.resetTransmuxer(),F||!1;var Oe=z?0:Object(A.updateFragPTSDTS)(te,b,le.startPTS,le.endPTS,le.startDTS,le.endDTS);return Y.hls.trigger(_.Events.LEVEL_PTS_UPDATED,{details:te,level:N,drift:Oe,type:re,frag:b,start:le.startPTS,end:le.endPTS}),!0}return F},!1);G?(this.state=E.PARSED,this.hls.trigger(_.Events.FRAG_PARSED,{frag:b,part:T})):this.resetLoadingState()},o.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(h,[{key:"state",get:function(){return this._state},set:function(b){var T=this._state;T!==b&&(this._state=b,this.log(T+"->"+b))}}]),h}(D.default)},"./src/controller/buffer-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return O});var K=M("./src/polyfills/number.ts"),D=M("./src/events.ts"),P=M("./src/utils/logger.ts"),H=M("./src/errors.ts"),W=M("./src/utils/buffer-helper.ts"),_=M("./src/utils/mediasource-helper.ts"),L=M("./src/loader/fragment.ts"),y=M("./src/controller/buffer-operation-queue.ts"),C=Object(_.getMediaSource)(),k=/([ha]vc.)(?:\.[^.,]+)+/,O=function(){function A(d){var a=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 l=a.hls,s=a.media,v=a.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),s&&(a.updateMediaElementDuration(),l.trigger(D.Events.MEDIA_ATTACHED,{media:s})),v&&v.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.logger.log("[buffer-controller]: Media source ended")},this.hls=d,this._initSourceBuffer(),this.registerListeners()}var x=A.prototype;return x.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},x.destroy=function(){this.unregisterListeners(),this.details=null},x.registerListeners=function(){var a=this.hls;a.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(D.Events.BUFFER_RESET,this.onBufferReset,this),a.on(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(D.Events.BUFFER_EOS,this.onBufferEos,this),a.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(D.Events.FRAG_PARSED,this.onFragParsed,this),a.on(D.Events.FRAG_CHANGED,this.onFragChanged,this)},x.unregisterListeners=function(){var a=this.hls;a.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(D.Events.BUFFER_RESET,this.onBufferReset,this),a.off(D.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(D.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(D.Events.BUFFER_EOS,this.onBufferEos,this),a.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(D.Events.FRAG_PARSED,this.onFragParsed,this),a.off(D.Events.FRAG_CHANGED,this.onFragChanged,this)},x._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},x.onManifestParsed=function(a,l){var s=2;(l.audio&&!l.video||!l.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},x.onMediaAttaching=function(a,l){var s=this.media=l.media;if(s&&C){var v=this.mediaSource=new C;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(v),this._objectUrl=s.src}},x.onMediaDetaching=function(){var a=this.media,l=this.mediaSource,s=this._objectUrl;if(l){if(P.logger.log("[buffer-controller]: media source detaching"),l.readyState==="open")try{l.endOfStream()}catch(v){P.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),l.removeEventListener("sourceopen",this._onMediaSourceOpen),l.removeEventListener("sourceended",this._onMediaSourceEnded),l.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(s&&self.URL.revokeObjectURL(s),a.src===s?(a.removeAttribute("src"),a.load()):P.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(D.Events.MEDIA_DETACHED,void 0)},x.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(l){var s=a.sourceBuffer[l];try{s&&(a.removeBufferListeners(l),a.mediaSource&&a.mediaSource.removeSourceBuffer(s),a.sourceBuffer[l]=void 0)}catch(v){P.logger.warn("[buffer-controller]: Failed to reset the "+l+" buffer",v)}}),this._initSourceBuffer()},x.onBufferCodecs=function(a,l){var s=this,v=this.getSourceBufferTypes().length;if(Object.keys(l).forEach(function(c){if(v){var m=s.tracks[c];if(m&&typeof m.buffer.changeType=="function"){var R=l[c],E=R.codec,f=R.levelCodec,g=R.container,h=(m.levelCodec||m.codec).replace(k,"$1"),o=(f||E).replace(k,"$1");if(h!==o){var S=g+";codecs="+(f||E);s.appendChangeType(c,S)}}}else s.pendingTracks[c]=l[c]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},x.appendChangeType=function(a,l){var s=this,v=this.operationQueue,c={execute:function(){var R=s.sourceBuffer[a];R&&(P.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+l),R.changeType(l)),v.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(R){P.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",R)}};v.append(c,a)},x.onBufferAppending=function(a,l){var s=this,v=this.hls,c=this.operationQueue,m=this.tracks,R=l.data,E=l.type,f=l.frag,g=l.part,h=l.chunkMeta,o=h.buffering[E],S=self.performance.now();o.start=S;var b=f.stats.buffering,T=g?g.stats.buffering:null;b.start===0&&(b.start=S),T&&T.start===0&&(T.start=S);var N=m.audio,z=E==="audio"&&h.id===1&&(N==null?void 0:N.container)==="audio/mpeg",Y={execute:function(){if(o.executeStart=self.performance.now(),z){var G=s.sourceBuffer[E];if(G){var F=f.start-G.timestampOffset;Math.abs(F)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+F+") sn: "+f.sn+")"),G.timestampOffset=f.start)}}s.appendExecutor(R,E)},onStart:function(){},onComplete:function(){var G=self.performance.now();o.executeEnd=o.end=G,b.first===0&&(b.first=G),T&&T.first===0&&(T.first=G);var F=s.sourceBuffer,re={};for(var le in F)re[le]=W.BufferHelper.getBuffered(F[le]);s.appendError=0,s.hls.trigger(D.Events.BUFFER_APPENDED,{type:E,frag:f,part:g,chunkMeta:h,parent:f.type,timeRanges:re})},onError:function(G){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",G);var F={type:H.ErrorTypes.MEDIA_ERROR,parent:f.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:G,fatal:!1};G.code===DOMException.QUOTA_EXCEEDED_ERR?F.details=H.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,F.details=H.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>v.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),F.fatal=!0)),v.trigger(D.Events.ERROR,F)}};c.append(Y,E)},x.onBufferFlushing=function(a,l){var s=this,v=this.operationQueue,c=function(R){return{execute:s.removeExecutor.bind(s,R,l.startOffset,l.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(D.Events.BUFFER_FLUSHED,{type:R})},onError:function(f){P.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",f)}}};l.type?v.append(c(l.type),l.type):this.getSourceBufferTypes().forEach(function(m){v.append(c(m),m)})},x.onFragParsed=function(a,l){var s=this,v=l.frag,c=l.part,m=[],R=c?c.elementaryStreams:v.elementaryStreams;R[L.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(R[L.ElementaryStreamTypes.AUDIO]&&m.push("audio"),R[L.ElementaryStreamTypes.VIDEO]&&m.push("video"));var E=function(){var g=self.performance.now();v.stats.buffering.end=g,c&&(c.stats.buffering.end=g);var h=c?c.stats:v.stats;s.hls.trigger(D.Events.FRAG_BUFFERED,{frag:v,part:c,stats:h,id:v.type})};m.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(E,m)},x.onFragChanged=function(a,l){this.flushBackBuffer()},x.onBufferEos=function(a,l){var s=this,v=this.getSourceBufferTypes().reduce(function(c,m){var R=s.sourceBuffer[m];return(!l.type||l.type===m)&&(R&&!R.ended&&(R.ended=!0,P.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),c&&!!(!R||R.ended)},!0);v&&this.blockBuffers(function(){var c=s.mediaSource;if(!c||c.readyState!=="open")return;c.endOfStream()})},x.onLevelUpdated=function(a,l){var s=l.details;if(!s.fragments.length)return;this.details=s,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},x.flushBackBuffer=function(){var a=this.hls,l=this.details,s=this.media,v=this.sourceBuffer;if(!s||l===null)return;var c=this.getSourceBufferTypes();if(!c.length)return;var m=l.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(K.isFiniteNumber)(m)||m<0)return;var R=s.currentTime,E=l.levelTargetDuration,f=Math.max(m,E),g=Math.floor(R/E)*E-f;c.forEach(function(h){var o=v[h];if(o){var S=W.BufferHelper.getBuffered(o);S.length>0&&g>S.start(0)&&(a.trigger(D.Events.BACK_BUFFER_REACHED,{bufferEnd:g}),l.live&&a.trigger(D.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:g}),a.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:g,type:h}))}})},x.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,l=this.hls,s=this.media,v=this.mediaSource,c=a.fragments[0].start+a.totalduration,m=s.duration,R=Object(K.isFiniteNumber)(v.duration)?v.duration:0;a.live&&l.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(a)):(c>R&&c>m||!Object(K.isFiniteNumber)(m))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+c.toFixed(3)),v.duration=c)},x.updateSeekableRange=function(a){var l=this.mediaSource,s=a.fragments,v=s.length;if(v&&a.live&&l!==null&&l!==void 0&&l.setLiveSeekableRange){var c=Math.max(0,s[0].start),m=Math.max(c,c+a.totalduration);l.setLiveSeekableRange(c,m)}},x.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,l=this.operationQueue,s=this.pendingTracks,v=Object.keys(s).length;if(v&&!a||v===2){this.createSourceBuffers(s),this.pendingTracks={};var c=this.getSourceBufferTypes();if(c.length===0){this.hls.trigger(D.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}c.forEach(function(m){l.executeNext(m)})}},x.createSourceBuffers=function(a){var l=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var c in a)if(!l[c]){var m=a[c];if(!m)throw Error("source buffer exists for track "+c+", however track does not");var R=m.levelCodec||m.codec,E=m.container+";codecs="+R;P.logger.log("[buffer-controller]: creating sourceBuffer("+E+")");try{var f=l[c]=s.addSourceBuffer(E),g=c;this.addBufferListener(g,"updatestart",this._onSBUpdateStart),this.addBufferListener(g,"updateend",this._onSBUpdateEnd),this.addBufferListener(g,"error",this._onSBUpdateError),this.tracks[c]={buffer:f,codec:R,container:m.container,levelCodec:m.levelCodec,id:m.id},v++}catch(h){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(D.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:E})}}v&&this.hls.trigger(D.Events.BUFFER_CREATED,{tracks:this.tracks})},x._onSBUpdateStart=function(a){var l=this.operationQueue,s=l.current(a);s.onStart()},x._onSBUpdateEnd=function(a){var l=this.operationQueue,s=l.current(a);s.onComplete(),l.shiftAndExecuteNext(a)},x._onSBUpdateError=function(a,l){P.logger.error("[buffer-controller]: "+a+" SourceBuffer error",l),this.hls.trigger(D.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(a);s&&s.onError(l)},x.removeExecutor=function(a,l,s){var v=this.media,c=this.mediaSource,m=this.operationQueue,R=this.sourceBuffer,E=R[a];if(!v||!c||!E){P.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(a);return}var f=Object(K.isFiniteNumber)(v.duration)?v.duration:Infinity,g=Object(K.isFiniteNumber)(c.duration)?c.duration:Infinity,h=Math.max(0,l),o=Math.min(s,f,g);o>h?(P.logger.log("[buffer-controller]: Removing ["+h+","+o+"] from the "+a+" SourceBuffer"),console.assert(!E.updating,a+" sourceBuffer must not be updating"),E.remove(h,o)):m.shiftAndExecuteNext(a)},x.appendExecutor=function(a,l){var s=this.operationQueue,v=this.sourceBuffer,c=v[l];if(!c){P.logger.warn("[buffer-controller]: Attempting to append to the "+l+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(l);return}c.ended=!1,console.assert(!c.updating,l+" sourceBuffer must not be updating"),c.appendBuffer(a)},x.blockBuffers=function(a,l){var s=this;if(l===void 0&&(l=this.getSourceBufferTypes()),!l.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var v=this.operationQueue,c=l.map(function(m){return v.appendBlocker(m)});Promise.all(c).then(function(){a(),l.forEach(function(m){var R=s.sourceBuffer[m];(!R||!R.updating)&&v.shiftAndExecuteNext(m)})})},x.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},x.addBufferListener=function(a,l,s){var v=this.sourceBuffer[a];if(!v)return;var c=s.bind(this,a);this.listeners[a].push({event:l,listener:c}),v.addEventListener(l,c)},x.removeBufferListeners=function(a){var l=this.sourceBuffer[a];if(!l)return;this.listeners[a].forEach(function(s){l.removeEventListener(s.event,s.listener)})},A}()},"./src/controller/buffer-operation-queue.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return D});var K=M("./src/utils/logger.ts"),D=function(){function P(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var H=P.prototype;return H.append=function(_,L){var y=this.queues[L];y.push(_),y.length===1&&this.buffers[L]&&this.executeNext(L)},H.insertAbort=function(_,L){var y=this.queues[L];y.unshift(_),this.executeNext(L)},H.appendBlocker=function(_){var L,y=new Promise(function(k){L=k}),C={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(C,_),y},H.executeNext=function(_){var L=this.buffers,y=this.queues,C=L[_],k=y[_];if(k.length){var O=k[0];try{O.execute()}catch(A){K.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),O.onError(A),(!C||!C.updating)&&(k.shift(),this.executeNext(_))}}},H.shiftAndExecuteNext=function(_){this.queues[_].shift(),this.executeNext(_)},H.current=function(_){return this.queues[_][0]},P}()},"./src/controller/cap-level-controller.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/events.ts");function D(W,_){for(var L=0;L<_.length;L++){var y=_[L];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(W,y.key,y)}}function P(W,_,L){return _&&D(W.prototype,_),L&&D(W,L),W}var H=function(){function W(L){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=L,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var _=W.prototype;return _.setStreamController=function(y){this.streamController=y},_.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},_.registerListeners=function(){var y=this.hls;y.on(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},_.unregisterListener=function(){var y=this.hls;y.off(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},_.onFpsDropLevelCapping=function(y,C){W.isLevelAllowed(C.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(C.droppedLevel)},_.onMediaAttaching=function(y,C){this.media=C.media instanceof HTMLVideoElement?C.media:null},_.onManifestParsed=function(y,C){var k=this.hls;this.restrictedLevels=[],this.firstLevel=C.firstLevel,k.config.capLevelToPlayerSize&&C.video&&this.startCapping()},_.onBufferCodecs=function(y,C){var k=this.hls;k.config.capLevelToPlayerSize&&C.video&&this.startCapping()},_.onMediaDetaching=function(){this.stopCapping()},_.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var C=this.hls;C.autoLevelCapping=this.getMaxLevel(y.length-1),C.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=C.autoLevelCapping}}},_.getMaxLevel=function(y){var C=this,k=this.hls.levels;if(!k.length)return-1;var O=k.filter(function(A,x){return W.isLevelAllowed(x,C.restrictedLevels)&&x<=y});return this.clientRect=null,W.getMaxLevelByMediaSize(O,this.mediaWidth,this.mediaHeight)},_.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},_.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},_.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,C={width:0,height:0};if(y){var k=y.getBoundingClientRect();C.width=k.width,C.height=k.height,!C.width&&!C.height&&(C.width=k.right-k.left||y.width||0,C.height=k.bottom-k.top||y.height||0)}return this.clientRect=C,C},W.isLevelAllowed=function(y,C){return C===void 0&&(C=[]),C.indexOf(y)===-1},W.getMaxLevelByMediaSize=function(y,C,k){if(!y||!y.length)return-1;for(var O=function(l,s){return s?l.width!==s.width||l.height!==s.height:!0},A=y.length-1,x=0;x<y.length;x+=1){var d=y[x];if((d.width>=C||d.height>=k)&&O(d,y[x+1])){A=x;break}}return A},P(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(C){}return y}}]),W}();X.default=H},"./src/controller/cmcd-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return O});var K=M("./src/events.ts"),D=M("./src/types/cmcd.ts"),P=M("./src/utils/buffer-helper.ts"),H=M("./src/utils/logger.ts");function W(A,x){for(var d=0;d<x.length;d++){var a=x[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(A,a.key,a)}}function _(A,x,d){return x&&W(A.prototype,x),d&&W(A,d),A}function L(A,x){var d=typeof Symbol!="undefined"&&A[Symbol.iterator]||A["@@iterator"];if(d)return(d=d.call(A)).next.bind(d);if(Array.isArray(A)||(d=y(A))||x&&A&&typeof A.length=="number"){d&&(A=d);var a=0;return function(){return a>=A.length?{done:!0}:{done:!1,value:A[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y(A,x){if(!A)return;if(typeof A=="string")return C(A,x);var d=Object.prototype.toString.call(A).slice(8,-1);if(d==="Object"&&A.constructor&&(d=A.constructor.name),d==="Map"||d==="Set")return Array.from(A);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return C(A,x)}function C(A,x){(x==null||x>A.length)&&(x=A.length);for(var d=0,a=new Array(x);d<x;d++)a[d]=A[d];return a}function k(){return k=Object.assign||function(A){for(var x=1;x<arguments.length;x++){var d=arguments[x];for(var a in d)Object.prototype.hasOwnProperty.call(d,a)&&(A[a]=d[a])}return A},k.apply(this,arguments)}var O=function(){function A(d){var a=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){a.initialized&&(a.starved=!0),a.buffering=!0},this.onPlaying=function(){a.initialized||(a.initialized=!0),a.buffering=!1},this.applyPlaylistData=function(v){try{a.apply(v,{ot:D.CMCDObjectType.MANIFEST,su:!a.initialized})}catch(c){H.logger.warn("Could not generate manifest CMCD data.",c)}},this.applyFragmentData=function(v){try{var c=v.frag,m=a.hls.levels[c.level],R=a.getObjectType(c),E={d:c.duration*1e3,ot:R};(R===D.CMCDObjectType.VIDEO||R===D.CMCDObjectType.AUDIO||R==D.CMCDObjectType.MUXED)&&(E.br=m.bitrate/1e3,E.tb=a.getTopBandwidth(R),E.bl=a.getBufferLength(R)),a.apply(v,E)}catch(f){H.logger.warn("Could not generate segment CMCD data.",f)}},this.hls=d;var l=this.config=d.config,s=l.cmcd;s!=null&&(l.pLoader=this.createPlaylistLoader(),l.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||A.uuid(),this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.registerListeners())}var x=A.prototype;return x.registerListeners=function(){var a=this.hls;a.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this)},x.unregisterListeners=function(){var a=this.hls;a.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),a.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},x.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},x.onMediaAttached=function(a,l){this.media=l.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},x.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},x.onBufferCreated=function(a,l){var s,v;this.audioBuffer=(s=l.tracks.audio)===null||s===void 0?void 0:s.buffer,this.videoBuffer=(v=l.tracks.video)===null||v===void 0?void 0:v.buffer},x.createData=function(){var a;return{v:D.CMCDVersion,sf:D.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(a=this.media)===null||a===void 0?void 0:a.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},x.apply=function(a,l){l===void 0&&(l={}),k(l,this.createData());var s=l.ot===D.CMCDObjectType.INIT||l.ot===D.CMCDObjectType.VIDEO||l.ot===D.CMCDObjectType.MUXED;if(this.starved&&s&&(l.bs=!0,l.su=!0,this.starved=!1),l.su==null&&(l.su=this.buffering),this.useHeaders){var v=A.toHeaders(l);if(!Object.keys(v).length)return;a.headers||(a.headers={}),k(a.headers,v)}else{var c=A.toQuery(l);if(!c)return;a.url=A.appendQueryToUri(a.url,c)}},x.getObjectType=function(a){var l=a.type;return l==="subtitle"?D.CMCDObjectType.TIMED_TEXT:a.sn==="initSegment"?D.CMCDObjectType.INIT:l==="audio"?D.CMCDObjectType.AUDIO:l==="main"?this.hls.audioTracks.length?D.CMCDObjectType.VIDEO:D.CMCDObjectType.MUXED:void 0},x.getTopBandwidth=function(a){for(var l=0,s=a===D.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=L(s),c;!(c=v()).done;){var m=c.value;m.bitrate>l&&(l=m.bitrate)}return l>0?l:NaN},x.getBufferLength=function(a){var l=this.hls.media,s=a===D.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!l)return NaN;var v=P.BufferHelper.bufferInfo(s,l.currentTime,this.config.maxBufferHole);return v.len*1e3},x.createPlaylistLoader=function(){var a=this.config.pLoader,l=this.applyPlaylistData,s=a||this.config.loader;return function(){function v(m){this.loader=void 0,this.loader=new s(m)}var c=v.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(R,E,f){l(R),this.loader.load(R,E,f)},_(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},x.createFragmentLoader=function(){var a=this.config.fLoader,l=this.applyFragmentData,s=a||this.config.loader;return function(){function v(m){this.loader=void 0,this.loader=new s(m)}var c=v.prototype;return c.destroy=function(){this.loader.destroy()},c.abort=function(){this.loader.abort()},c.load=function(R,E,f){l(R),this.loader.load(R,E,f)},_(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},A.uuid=function(){var a=URL.createObjectURL(new Blob),l=a.toString();return URL.revokeObjectURL(a),l.substr(l.lastIndexOf("/")+1)},A.serialize=function(a){for(var l=[],s=function(z){return!Number.isNaN(z)&&z!=null&&z!==""&&z!==!1},v=function(z){return Math.round(z)},c=function(z){return v(z/100)*100},m=function(z){return encodeURIComponent(z)},R={br:v,d:v,bl:c,dl:c,mtp:c,nor:m,rtp:c,tb:v},E=Object.keys(a||{}).sort(),f=L(E),g;!(g=f()).done;){var h=g.value,o=a[h];if(!s(o))continue;if(h==="v"&&o===1)continue;if(h=="pr"&&o===1)continue;var S=R[h];S&&(o=S(o));var b=typeof o,T=void 0;h==="ot"||h==="sf"||h==="st"?T=h+"="+o:b==="boolean"?T=h:b==="number"?T=h+"="+o:T=h+"="+JSON.stringify(o),l.push(T)}return l.join(",")},A.toHeaders=function(a){for(var l=Object.keys(a),s={},v=["Object","Request","Session","Status"],c=[{},{},{},{}],m={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},R=0,E=l;R<E.length;R++){var f=E[R],g=m[f]!=null?m[f]:1;c[g][f]=a[f]}for(var h=0;h<c.length;h++){var o=A.serialize(c[h]);o&&(s["CMCD-"+v[h]]=o)}return s},A.toQuery=function(a){return"CMCD="+encodeURIComponent(A.serialize(a))},A.appendQueryToUri=function(a,l){if(!l)return a;var s=a.includes("?")?"&":"?";return""+a+s+l},A}()},"./src/controller/eme-controller.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/events.ts"),D=M("./src/errors.ts"),P=M("./src/utils/logger.ts"),H=M("./src/utils/mediakeys-helper.ts");function W(O,A){for(var x=0;x<A.length;x++){var d=A[x];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(O,d.key,d)}}function _(O,A,x){return A&&W(O.prototype,A),x&&W(O,x),O}var L=3,y=function(A,x,d){var a={audioCapabilities:[],videoCapabilities:[]};return A.forEach(function(l){a.audioCapabilities.push({contentType:'audio/mp4; codecs="'+l+'"',robustness:d.audioRobustness||""})}),x.forEach(function(l){a.videoCapabilities.push({contentType:'video/mp4; codecs="'+l+'"',robustness:d.videoRobustness||""})}),[a]},C=function(A,x,d,a){switch(A){case H.KeySystems.WIDEVINE:return y(x,d,a);default:throw new Error("Unknown key-system: "+A)}},k=function(){function O(x){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=x,this._config=x.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var A=O.prototype;return A.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},A._registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A._unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},A.getLicenseServerUrl=function(d){switch(d){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+d+'"')},A._attemptKeySystemAccess=function(d,a,l){var s=this,v=C(d,a,l,this._drmSystemOptions);P.logger.log("Requesting encrypted media key-system access");var c=this.requestMediaKeySystemAccess(d,v);this.mediaKeysPromise=c.then(function(m){return s._onMediaKeySystemAccessObtained(d,m)}),c.catch(function(m){P.logger.error('Failed to obtain key-system "'+d+'" access:',m)})},A._onMediaKeySystemAccessObtained=function(d,a){var l=this;P.logger.log('Access for key-system "'+d+'" obtained');var s={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:a,mediaKeySystemDomain:d};this._mediaKeysList.push(s);var v=Promise.resolve().then(function(){return a.createMediaKeys()}).then(function(c){return s.mediaKeys=c,P.logger.log('Media-keys created for key-system "'+d+'"'),l._onMediaKeysCreated(),c});return v.catch(function(c){P.logger.error("Failed to create media-keys:",c)}),v},A._onMediaKeysCreated=function(){var d=this;this._mediaKeysList.forEach(function(a){a.mediaKeysSession||(a.mediaKeysSession=a.mediaKeys.createSession(),d._onNewMediaKeySession(a.mediaKeysSession))})},A._onNewMediaKeySession=function(d){var a=this;P.logger.log("New key-system session "+d.sessionId),d.addEventListener("message",function(l){a._onKeySessionMessage(d,l.message)},!1)},A._onKeySessionMessage=function(d,a){P.logger.log("Got EME message event, creating license request"),this._requestLicense(a,function(l){P.logger.log("Received license data (length: "+(l&&l.byteLength)+"), updating key-session"),d.update(l)})},A.onMediaEncrypted=function(d){var a=this;if(P.logger.log('Media is encrypted using "'+d.initDataType+'" init data type'),!this.mediaKeysPromise){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var l=function(v){if(!a._media)return;a._attemptSetMediaKeys(v),a._generateRequestWithPreferredKeySession(d.initDataType,d.initData)};this.mediaKeysPromise.then(l).catch(l)},A._attemptSetMediaKeys=function(d){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}P.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},A._generateRequestWithPreferredKeySession=function(d,a){var l=this,s=this._mediaKeysList[0];if(!s){P.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(s.mediaKeysSessionInitialized){P.logger.warn("Key-Session already initialized but requested again");return}var v=s.mediaKeysSession;if(!v){P.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!a){P.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}P.logger.log('Generating key-session request for "'+d+'" init data type'),s.mediaKeysSessionInitialized=!0,v.generateRequest(d,a).then(function(){P.logger.debug("Key-session generation succeeded")}).catch(function(c){P.logger.error("Error generating key-session request:",c),l.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},A._createLicenseXhr=function(d,a,l){var s=new XMLHttpRequest;s.responseType="arraybuffer",s.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,s,d,a,l);var v=this._licenseXhrSetup;if(v)try{v.call(this.hls,s,d),v=void 0}catch(c){P.logger.error(c)}try{s.readyState||s.open("POST",d,!0),v&&v.call(this.hls,s,d)}catch(c){throw new Error("issue setting up KeySystem license XHR "+c)}return s},A._onLicenseRequestReadyStageChange=function(d,a,l,s){switch(d.readyState){case 4:if(d.status===200){this._requestLicenseFailureCount=0,P.logger.log("License request succeeded");var v=d.response,c=this._licenseResponseCallback;if(c)try{v=c.call(this.hls,d,a)}catch(R){P.logger.error(R)}s(v)}else{if(P.logger.error("License Request XHR failed ("+a+"). Status: "+d.status+" ("+d.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=L-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(l,s)}break}},A._generateLicenseRequestChallenge=function(d,a){switch(d.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+d.mediaKeySystemDomain)},A._requestLicense=function(d,a){P.logger.log("Requesting content license for key-system");var l=this._mediaKeysList[0];if(!l){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(l.mediaKeySystemDomain),v=this._createLicenseXhr(s,d,a);P.logger.log("Sending license request to URL: "+s);var c=this._generateLicenseRequestChallenge(l,d);v.send(c)}catch(m){P.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.KEY_SYSTEM_ERROR,details:D.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},A.onMediaAttached=function(d,a){if(!this._emeEnabled)return;var l=a.media;this._media=l,l.addEventListener("encrypted",this._onMediaEncrypted)},A.onMediaDetached=function(){var d=this._media,a=this._mediaKeysList;if(!d)return;d.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(l){if(l.mediaKeysSession)return l.mediaKeysSession.close().catch(function(){})})).then(function(){return d.setMediaKeys(null)}).catch(function(){})},A.onManifestParsed=function(d,a){if(!this._emeEnabled)return;var l=a.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),s=a.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,l,s)},_(O,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),O}();X.default=k},"./src/controller/fps-controller.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/events.ts"),D=M("./src/utils/logger.ts"),P=function(){function H(_){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=_,this.registerListeners()}var W=H.prototype;return W.setStreamController=function(L){this.streamController=L},W.registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(L,y){var C=this.hls.config;if(C.capLevelOnFPSDrop){var k=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=k,k&&typeof k.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),C.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(L,y,C){var k=performance.now();if(y){if(this.lastTime){var O=k-this.lastTime,A=C-this.lastDroppedFrames,x=y-this.lastDecodedFrames,d=1e3*A/O,a=this.hls;if(a.trigger(K.Events.FPS_DROP,{currentDropped:A,currentDecoded:x,totalDroppedFrames:C}),d>0&&A>a.config.fpsDroppedMonitoringThreshold*x){var l=a.currentLevel;D.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=l)&&(l=l-1,a.trigger(K.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:a.currentLevel}),a.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=k,this.lastDroppedFrames=C,this.lastDecodedFrames=y}},W.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var y=L.getVideoPlaybackQuality();this.checkFPS(L,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},H}();X.default=P},"./src/controller/fragment-finders.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"findFragmentByPDT",function(){return P}),M.d(X,"findFragmentByPTS",function(){return H}),M.d(X,"fragmentWithinToleranceTest",function(){return W}),M.d(X,"pdtWithinToleranceTest",function(){return _}),M.d(X,"findFragWithCC",function(){return L});var K=M("./src/polyfills/number.ts"),D=M("./src/utils/binary-search.ts");function P(y,C,k){if(C===null||!Array.isArray(y)||!y.length||!Object(K.isFiniteNumber)(C))return null;var O=y[0].programDateTime;if(C<(O||0))return null;var A=y[y.length-1].endProgramDateTime;if(C>=(A||0))return null;k=k||0;for(var x=0;x<y.length;++x){var d=y[x];if(_(C,k,d))return d}return null}function H(y,C,k,O){k===void 0&&(k=0),O===void 0&&(O=0);var A=null;if(y?A=C[y.sn-C[0].sn+1]||null:k===0&&C[0].start===0&&(A=C[0]),A&&W(k,O,A)===0)return A;var x=D.default.search(C,W.bind(null,k,O));return x||A}function W(y,C,k){y===void 0&&(y=0),C===void 0&&(C=0);var O=Math.min(C,k.duration+(k.deltaPTS?k.deltaPTS:0));return k.start+k.duration-O<=y?1:k.start-O>y&&k.start?-1:0}function _(y,C,k){var O=Math.min(C,k.duration+(k.deltaPTS?k.deltaPTS:0))*1e3,A=k.endProgramDateTime||0;return A-O>y}function L(y,C){return D.default.search(y,function(k){return k.cc<C?1:k.cc>C?-1:0})}},"./src/controller/fragment-tracker.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"FragmentState",function(){return P}),M.d(X,"FragmentTracker",function(){return H});var K=M("./src/events.ts"),D=M("./src/types/loader.ts"),P;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(P||(P={}));var H=function(){function L(C){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=C,this._registerListeners()}var y=L.prototype;return y._registerListeners=function(){var k=this.hls;k.on(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.on(K.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var k=this.hls;k.off(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),k.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),k.off(K.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(k,O){if(O===D.PlaylistLevelType.MAIN){var A=this.activeFragment,x=this.activeParts;if(!A)return null;if(x)for(var d=x.length;d--;){var a=x[d],l=a?a.end:A.appendedPTS;if(a.start<=k&&l!==void 0&&k<=l)return d>9&&(this.activeParts=x.slice(d-9)),a}else if(A.start<=k&&A.appendedPTS!==void 0&&k<=A.appendedPTS)return A}return this.getBufferedFrag(k,O)},y.getBufferedFrag=function(k,O){for(var A=this.fragments,x=Object.keys(A),d=x.length;d--;){var a=A[x[d]];if((a==null?void 0:a.body.type)===O&&a.buffered){var l=a.body;if(l.start<=k&&k<=l.end)return l}}return null},y.detectEvictedFragments=function(k,O,A){var x=this;Object.keys(this.fragments).forEach(function(d){var a=x.fragments[d];if(!a)return;if(!a.buffered){a.body.type===A&&x.removeFragment(a.body);return}var l=a.range[k];if(!l)return;l.time.some(function(s){var v=!x.isTimeBuffered(s.startPTS,s.endPTS,O);return v&&x.removeFragment(a.body),v})})},y.detectPartialFragments=function(k){var O=this,A=this.timeRanges,x=k.frag,d=k.part;if(!A||x.sn==="initSegment")return;var a=_(x),l=this.fragments[a];if(!l)return;Object.keys(A).forEach(function(s){var v=x.elementaryStreams[s];if(!v)return;var c=A[s],m=d!==null||v.partial===!0;l.range[s]=O.getBufferedTimes(x,d,m,c)}),l.backtrack=l.loaded=null,Object.keys(l.range).length?l.buffered=!0:this.removeFragment(l.body)},y.fragBuffered=function(k){var O=_(k),A=this.fragments[O];A&&(A.backtrack=A.loaded=null,A.buffered=!0)},y.getBufferedTimes=function(k,O,A,x){for(var d={time:[],partial:A},a=O?O.start:k.start,l=O?O.end:k.end,s=k.minEndPTS||l,v=k.maxStartPTS||a,c=0;c<x.length;c++){var m=x.start(c)-this.bufferPadding,R=x.end(c)+this.bufferPadding;if(v>=m&&s<=R){d.time.push({startPTS:Math.max(a,x.start(c)),endPTS:Math.min(l,x.end(c))});break}else if(a<R&&l>m)d.partial=!0,d.time.push({startPTS:Math.max(a,x.start(c)),endPTS:Math.min(l,x.end(c))});else if(l<=m)break}return d},y.getPartialFragment=function(k){var O=null,A,x,d,a=0,l=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(v){var c=s[v];if(!c)return;W(c)&&(x=c.body.start-l,d=c.body.end+l,k>=x&&k<=d&&(A=Math.min(k-x,d-k),a<=A&&(O=c.body,a=A)))}),O},y.getState=function(k){var O=_(k),A=this.fragments[O];return A?A.buffered?W(A)?P.PARTIAL:P.OK:A.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},y.backtrack=function(k,O){var A=_(k),x=this.fragments[A];if(!x||x.backtrack)return null;var d=x.backtrack=O||x.loaded;return x.loaded=null,d},y.getBacktrackData=function(k){var O=_(k),A=this.fragments[O];if(A){var x,d=A.backtrack;if(d!=null&&(x=d.payload)!==null&&x!==void 0&&x.byteLength)return d;this.removeFragment(k)}return null},y.isTimeBuffered=function(k,O,A){for(var x,d,a=0;a<A.length;a++){if(x=A.start(a)-this.bufferPadding,d=A.end(a)+this.bufferPadding,k>=x&&O<=d)return!0;if(O<=x)return!1}return!1},y.onFragLoaded=function(k,O){var A=O.frag,x=O.part;if(A.sn==="initSegment"||A.bitrateTest||x)return;var d=_(A);this.fragments[d]={body:A,loaded:O,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(k,O){var A=this,x=O.frag,d=O.part,a=O.timeRanges;if(x.type===D.PlaylistLevelType.MAIN)if(this.activeFragment=x,d){var l=this.activeParts;l||(this.activeParts=l=[]),l.push(d)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(s){var v=a[s];if(A.detectEvictedFragments(s,v),!d)for(var c=0;c<v.length;c++)x.appendedPTS=Math.max(v.end(c),x.appendedPTS||0)})},y.onFragBuffered=function(k,O){this.detectPartialFragments(O)},y.hasFragment=function(k){var O=_(k);return!!this.fragments[O]},y.removeFragmentsInRange=function(k,O,A){var x=this;Object.keys(this.fragments).forEach(function(d){var a=x.fragments[d];if(!a)return;if(a.buffered){var l=a.body;l.type===A&&l.start<O&&l.end>k&&x.removeFragment(l)}})},y.removeFragment=function(k){var O=_(k);k.stats.loaded=0,k.clearElementaryStreamInfo(),delete this.fragments[O]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function W(L){var y,C;return L.buffered&&(((y=L.range.video)===null||y===void 0?void 0:y.partial)||((C=L.range.audio)===null||C===void 0?void 0:C.partial))}function _(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"STALL_MINIMUM_DURATION_MS",function(){return W}),M.d(X,"MAX_START_GAP_JUMP",function(){return _}),M.d(X,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),M.d(X,"SKIP_BUFFER_RANGE_START",function(){return y}),M.d(X,"default",function(){return C});var K=M("./src/utils/buffer-helper.ts"),D=M("./src/errors.ts"),P=M("./src/events.ts"),H=M("./src/utils/logger.ts"),W=250,_=2,L=.1,y=.05,C=function(){function k(A,x,d,a){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=A,this.media=x,this.fragmentTracker=d,this.hls=a}var O=k.prototype;return O.destroy=function(){this.hls=this.fragmentTracker=this.media=null},O.poll=function(x){var d=this.config,a=this.media,l=this.stalled,s=a.currentTime,v=a.seeking,c=this.seeking&&!v,m=!this.seeking&&v;if(this.seeking=v,s!==x){if(this.moved=!0,l!==null){if(this.stallReported){var R=self.performance.now()-l;H.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||c)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!K.BufferHelper.getBuffered(a).length)return;var E=K.BufferHelper.bufferInfo(a,s,0),f=E.len>0,g=E.nextStart||0;if(!f&&!g)return;if(v){var h=E.len>_,o=!g||g-s>_&&!this.fragmentTracker.getPartialFragment(s);if(h||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var S,b=Math.max(g,E.start||0)-s,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=T==null||((S=T.details)===null||S===void 0)?void 0:S.live,z=N?T.details.targetduration*2:_;if(b>0&&b<=z){this._trySkipBufferHole(null);return}}var Y=self.performance.now();if(l===null){this.stalled=Y;return}var te=Y-l;!v&&te>=W&&this._reportStall(E.len);var G=K.BufferHelper.bufferInfo(a,s,d.maxBufferHole);this._tryFixBufferStall(G,te)},O._tryFixBufferStall=function(x,d){var a=this.config,l=this.fragmentTracker,s=this.media,v=s.currentTime,c=l.getPartialFragment(v);if(c){var m=this._trySkipBufferHole(c);if(m)return}x.len>a.maxBufferHole&&d>a.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},O._reportStall=function(x){var d=this.hls,a=this.media,l=this.stallReported;l||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+x+")"),d.trigger(P.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:x}))},O._trySkipBufferHole=function(x){for(var d=this.config,a=this.hls,l=this.media,s=l.currentTime,v=0,c=K.BufferHelper.getBuffered(l),m=0;m<c.length;m++){var R=c.start(m);if(s+d.maxBufferHole>=v&&s<R){var E=Math.max(R+y,l.currentTime+L);return H.logger.warn("skipping hole, adjusting currentTime from "+s+" to "+E),this.moved=!0,this.stalled=null,l.currentTime=E,x&&a.trigger(P.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+s+" to "+E,frag:x}),E}v=c.end(m)}return 0},O._tryNudgeBuffer=function(){var x=this.config,d=this.hls,a=this.media,l=a.currentTime,s=(this.nudgeRetry||0)+1;if(this.nudgeRetry=s,s<x.nudgeMaxRetry){var v=l+s*x.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+l+" to "+v),a.currentTime=v,d.trigger(P.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+l+" after "+x.nudgeMaxRetry+" nudges"),d.trigger(P.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},k}()},"./src/controller/id3-track-controller.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/events.ts"),D=M("./src/utils/texttrack-utils.ts"),P=M("./src/demux/id3.ts"),H=.25,W=function(){function _(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var L=_.prototype;return L.destroy=function(){this._unregisterListeners()},L._registerListeners=function(){var C=this.hls;C.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),C.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L._unregisterListeners=function(){var C=this.hls;C.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),C.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L.onMediaAttached=function(C,k){this.media=k.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(D.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(C){if(!this.media)return;for(var k=0;k<C.length;k++){var O=C[k];if(O.kind==="metadata"&&O.label==="id3")return Object(D.sendAddTrackEvent)(O,this.media),O}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(C,k){if(!this.media)return;var O=k.frag,A=k.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var x=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,d=0;d<A.length;d++){var a=P.getID3Frames(A[d].data);if(a){var l=A[d].pts,s=d<A.length-1?A[d+1].pts:O.end,v=s-l;v<=0&&(s=l+H);for(var c=0;c<a.length;c++){var m=a[c];if(!P.isTimeStampFrame(m)){var R=new x(l,s,"");R.value=m,this.id3Track.addCue(R)}}}}},L.onBufferFlushing=function(C,k){var O=k.startOffset,A=k.endOffset,x=k.type;if(!x||x==="audio"){var d=this.id3Track;d&&Object(D.removeCuesInRange)(d,O,A)}},_}();X.default=W},"./src/controller/latency-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return _});var K=M("./src/errors.ts"),D=M("./src/events.ts"),P=M("./src/utils/logger.ts");function H(L,y){for(var C=0;C<y.length;C++){var k=y[C];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(L,k.key,k)}}function W(L,y,C){return y&&H(L.prototype,y),C&&H(L,C),L}var _=function(){function L(C){var k=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return k.timeupdate()},this.hls=C,this.config=C.config,this.registerListeners()}var y=L.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.registerListeners=function(){this.hls.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(D.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(D.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(D.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(D.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(D.Events.ERROR,this.onError)},y.onMediaAttached=function(k,O){this.media=O.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(k,O){var A=O.details;this.levelDetails=A,A.advanced&&this.timeupdate(),!A.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(k,O){if(O.details!==K.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,P.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var k=this.media,O=this.levelDetails;if(!k||!O)return;this.currentTime=k.currentTime;var A=this.computeLatency();if(A===null)return;this._latency=A;var x=this.config,d=x.lowLatencyMode,a=x.maxLiveSyncPlaybackRate;if(!d||a===1)return;var l=this.targetLatency;if(l===null)return;var s=A-l,v=Math.min(this.maxLatency,l+O.targetduration),c=s<v;if(O.live&&c&&s>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,a)),R=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;k.playbackRate=Math.min(m,Math.max(1,R))}else k.playbackRate!==1&&k.playbackRate!==0&&(k.playbackRate=1)},y.estimateLiveEdge=function(){var k=this.levelDetails;return k===null?null:k.edge+k.age},y.computeLatency=function(){var k=this.estimateLiveEdge();return k===null?null:k-this.currentTime},W(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var k=this.config,O=this.levelDetails;return k.liveMaxLatencyDuration!==void 0?k.liveMaxLatencyDuration:O?k.liveMaxLatencyDurationCount*O.targetduration:0}},{key:"targetLatency",get:function(){var k=this.levelDetails;if(k===null)return null;var O=k.holdBack,A=k.partHoldBack,x=k.targetduration,d=this.config,a=d.liveSyncDuration,l=d.liveSyncDurationCount,s=d.lowLatencyMode,v=this.hls.userConfig,c=s&&A||O;(v.liveSyncDuration||v.liveSyncDurationCount||c===0)&&(c=a!==void 0?a:l*x);var m=x,R=1;return c+Math.min(this.stallCount*R,m)}},{key:"liveSyncPosition",get:function(){var k=this.estimateLiveEdge(),O=this.targetLatency,A=this.levelDetails;if(k===null||O===null||A===null)return null;var x=A.edge,d=k-O-this.edgeStalled,a=x-A.totalduration,l=x-(this.config.lowLatencyMode&&A.partTarget||A.targetduration);return Math.min(Math.max(a,d),l)}},{key:"drift",get:function(){var k=this.levelDetails;return k===null?1:k.drift}},{key:"edgeStalled",get:function(){var k=this.levelDetails;if(k===null)return 0;var O=(this.config.lowLatencyMode&&k.partTarget||k.targetduration)*3;return Math.max(k.age-O,0)}},{key:"forwardBufferLength",get:function(){var k=this.media,O=this.levelDetails;if(!k||!O)return 0;var A=k.buffered.length;return A?k.buffered.end(A-1):O.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return d});var K=M("./src/types/level.ts"),D=M("./src/events.ts"),P=M("./src/errors.ts"),H=M("./src/utils/codecs.ts"),W=M("./src/controller/level-helper.ts"),_=M("./src/controller/base-playlist-controller.ts"),L=M("./src/types/loader.ts");function y(){return y=Object.assign||function(a){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var v in s)Object.prototype.hasOwnProperty.call(s,v)&&(a[v]=s[v])}return a},y.apply(this,arguments)}function C(a,l){for(var s=0;s<l.length;s++){var v=l[s];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(a,v.key,v)}}function k(a,l,s){return l&&C(a.prototype,l),s&&C(a,s),a}function O(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,A(a,l)}function A(a,l){return A=Object.setPrototypeOf||function(v,c){return v.__proto__=c,v},A(a,l)}var x=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),d=function(a){O(l,a);function l(v){var c;return c=a.call(this,v,"[level-controller]")||this,c._levels=[],c._firstLevel=-1,c._startLevel=void 0,c.currentLevelIndex=-1,c.manualLevelIndex=-1,c.onParsedComplete=void 0,c._registerListeners(),c}var s=l.prototype;return s._registerListeners=function(){var c=this.hls;c.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(D.Events.ERROR,this.onError,this)},s._unregisterListeners=function(){var c=this.hls;c.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(D.Events.ERROR,this.onError,this)},s.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,a.prototype.destroy.call(this)},s.startLoad=function(){var c=this._levels;c.forEach(function(m){m.loadError=0}),a.prototype.startLoad.call(this)},s.onManifestLoaded=function(c,m){var R=[],E=[],f=[],g,h={},o,S=!1,b=!1,T=!1;if(m.levels.forEach(function(te){var G=te.attrs;S=S||!!(te.width&&te.height),b=b||!!te.videoCodec,T=T||!!te.audioCodec,x&&te.audioCodec&&te.audioCodec.indexOf("mp4a.40.34")!==-1&&(te.audioCodec=void 0);var F=te.bitrate+"-"+te.attrs.RESOLUTION+"-"+te.attrs.CODECS;o=h[F],o?o.url.push(te.url):(o=new K.Level(te),h[F]=o,R.push(o)),G&&(G.AUDIO&&Object(W.addGroupId)(o,"audio",G.AUDIO),G.SUBTITLES&&Object(W.addGroupId)(o,"text",G.SUBTITLES))}),(S||b)&&T&&(R=R.filter(function(te){var G=te.videoCodec,F=te.width,re=te.height;return!!G||!!(F&&re)})),R=R.filter(function(te){var G=te.audioCodec,F=te.videoCodec;return(!G||Object(H.isCodecSupportedInMp4)(G,"audio"))&&(!F||Object(H.isCodecSupportedInMp4)(F,"video"))}),m.audioTracks&&(E=m.audioTracks.filter(function(te){return!te.audioCodec||Object(H.isCodecSupportedInMp4)(te.audioCodec,"audio")}),Object(W.assignTrackIdsByGroup)(E)),m.subtitles&&(f=m.subtitles,Object(W.assignTrackIdsByGroup)(f)),R.length>0){g=R[0].bitrate,R.sort(function(te,G){return te.bitrate-G.bitrate}),this._levels=R;for(var N=0;N<R.length;N++)if(R[N].bitrate===g){this._firstLevel=N,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+g);break}var z=T&&!b,Y={levels:R,audioTracks:E,subtitleTracks:f,firstLevel:this._firstLevel,stats:m.stats,audio:T,video:b,altAudio:!z&&E.some(function(te){return!!te.url})};this.hls.trigger(D.Events.MANIFEST_PARSED,Y),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(D.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:m.url,reason:"no level with compatible codecs found in manifest"})},s.onError=function(c,m){if(a.prototype.onError.call(this,c,m),m.fatal)return;var R=m.context,E=this._levels[this.currentLevelIndex];if(R&&(R.type===L.PlaylistContextType.AUDIO_TRACK&&E.audioGroupIds&&R.groupId===E.audioGroupIds[E.urlId]||R.type===L.PlaylistContextType.SUBTITLE_TRACK&&E.textGroupIds&&R.groupId===E.textGroupIds[E.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,g=!0,h;switch(m.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:if(m.frag){var o=this._levels[m.frag.level];o?(o.fragmentError++,o.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=m.frag.level)):h=m.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(g=!1),h=R.level),f=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:h=m.level,f=!0;break}h!==void 0&&this.recoverLevel(m,h,f,g)},s.recoverLevel=function(c,m,R,E){var f=c.details,g=this._levels[m];if(g.loadError++,R){var h=this.retryLoadingOrFail(c);if(h)c.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(E){var o=g.url.length;if(o>1&&g.loadError<o)c.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var S=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==S&&this._levels[S].loadError===0&&(this.warn(f+": switch to "+S),c.levelRetry=!0,this.hls.nextAutoLevel=S)}}},s.redundantFailover=function(c){var m=this._levels[c],R=m.url.length;if(R>1){var E=(m.urlId+1)%R;this.warn("Switching to redundant URL-id "+E),this._levels.forEach(function(f){f.urlId=E}),this.level=c}},s.onFragLoaded=function(c,m){var R=m.frag;if(R!==void 0&&R.type===L.PlaylistLevelType.MAIN){var E=this._levels[R.level];E!==void 0&&(E.fragmentError=0,E.loadError=0)}},s.onLevelLoaded=function(c,m){var R,E=m.level,f=m.details,g=this._levels[E];if(!g){var h;this.warn("Invalid level index "+E),(h=m.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(f.deltaUpdateFailed=!0);return}E===this.currentLevelIndex?(g.fragmentError===0&&(g.loadError=0,this.retryCount=0),this.playlistLoaded(E,m,g.details)):(R=m.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(f.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(c,m){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var E=-1,f=this.hls.audioTracks[m.id].groupId,g=0;g<R.audioGroupIds.length;g++)if(R.audioGroupIds[g]===f){E=g;break}E!==R.urlId&&(R.urlId=E,this.startLoad())}},s.loadPlaylist=function(c){var m=this.currentLevelIndex,R=this._levels[m];if(this.canLoad&&R&&R.url.length>0){var E=R.urlId,f=R.url[E];if(c)try{f=c.addDirectives(f)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("Attempt loading level index "+m+(c?" at sn "+c.msn+" part "+c.part:"")+" with URL-id "+E+" "+f),this.clearTimer(),this.hls.trigger(D.Events.LEVEL_LOADING,{url:f,level:m,id:E,deliveryDirectives:c||null})}},s.removeLevel=function(c,m){var R=function(g,h){return h!==m},E=this._levels.filter(function(f,g){return g!==c?!0:f.url.length>1&&m!==void 0?(f.url=f.url.filter(R),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(R)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(R)),f.urlId=0,!0):!1}).map(function(f,g){var h=f.details;return h!=null&&h.fragments&&h.fragments.forEach(function(o){o.level=g}),f});this._levels=E,this.hls.trigger(D.Events.LEVELS_UPDATED,{levels:E})},k(l,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(c){var m,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===c&&(m=R[c])!==null&&m!==void 0&&m.details)return;if(c<0||c>=R.length){var E=c<0;if(this.hls.trigger(D.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:c,fatal:E,reason:"invalid level idx"}),E)return;c=Math.min(c,R.length-1)}this.clearTimer();var f=this.currentLevelIndex,g=R[f],h=R[c];this.log("switching to level "+c+" from "+f),this.currentLevelIndex=c;var o=y({},h,{level:c,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete o._urlId,this.hls.trigger(D.Events.LEVEL_SWITCHING,o);var S=h.details;if(!S||S.live){var b=this.switchParams(h.uri,g==null?void 0:g.details);this.loadPlaylist(b)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(c){this.manualLevelIndex=c,this._startLevel===void 0&&(this._startLevel=c),c!==-1&&(this.level=c)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(c){this._firstLevel=c}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var c=this.hls.config.startLevel;return c!==void 0?c:this._firstLevel}else return this._startLevel},set:function(c){this._startLevel=c}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(c){this.level=c,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=c)}}]),l}(_.default)},"./src/controller/level-helper.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"addGroupId",function(){return P}),M.d(X,"assignTrackIdsByGroup",function(){return H}),M.d(X,"updatePTS",function(){return W}),M.d(X,"updateFragPTSDTS",function(){return L}),M.d(X,"mergeDetails",function(){return y}),M.d(X,"mapPartIntersection",function(){return C}),M.d(X,"mapFragmentIntersection",function(){return k}),M.d(X,"adjustSliding",function(){return O}),M.d(X,"addSliding",function(){return A}),M.d(X,"computeReloadInterval",function(){return x}),M.d(X,"getFragmentWithSN",function(){return d}),M.d(X,"getPartWith",function(){return a});var K=M("./src/polyfills/number.ts"),D=M("./src/utils/logger.ts");function P(l,s,v){switch(s){case"audio":l.audioGroupIds||(l.audioGroupIds=[]),l.audioGroupIds.push(v);break;case"text":l.textGroupIds||(l.textGroupIds=[]),l.textGroupIds.push(v);break}}function H(l){var s={};l.forEach(function(v){var c=v.groupId||"";v.id=s[c]=s[c]||0,s[c]++})}function W(l,s,v){var c=l[s],m=l[v];_(c,m)}function _(l,s){var v=s.startPTS;if(Object(K.isFiniteNumber)(v)){var c=0,m;s.sn>l.sn?(c=v-l.start,m=l):(c=l.start-v,m=s),m.duration!==c&&(m.duration=c)}else if(s.sn>l.sn){var R=l.cc===s.cc;R&&l.minEndPTS?s.start=l.start+(l.minEndPTS-l.start):s.start=l.start+l.duration}else s.start=Math.max(l.start-s.duration,0)}function L(l,s,v,c,m,R){var E=c-v;E<=0&&(D.logger.warn("Fragment should have a positive duration",s),c=v+s.duration,R=m+s.duration);var f=v,g=c,h=s.startPTS,o=s.endPTS;if(Object(K.isFiniteNumber)(h)){var S=Math.abs(h-v);Object(K.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(S,s.deltaPTS):s.deltaPTS=S,f=Math.max(v,h),v=Math.min(v,h),m=Math.min(m,s.startDTS),g=Math.min(c,o),c=Math.max(c,o),R=Math.max(R,s.endDTS)}s.duration=c-v;var b=v-s.start;s.appendedPTS=c,s.start=s.startPTS=v,s.maxStartPTS=f,s.startDTS=m,s.endPTS=c,s.minEndPTS=g,s.endDTS=R;var T=s.sn;if(!l||T<l.startSN||T>l.endSN)return 0;var N,z=T-l.startSN,Y=l.fragments;for(Y[z]=s,N=z;N>0;N--)_(Y[N],Y[N-1]);for(N=z;N<Y.length-1;N++)_(Y[N],Y[N+1]);return l.fragmentHint&&_(Y[Y.length-1],l.fragmentHint),l.PTSKnown=l.alignedSliding=!0,b}function y(l,s){for(var v=null,c=l.fragments,m=c.length-1;m>=0;m--){var R=c[m].initSegment;if(R){v=R;break}}l.fragmentHint&&delete l.fragmentHint.endPTS;var E=0,f;if(k(l,s,function(N,z){N.relurl&&(E=N.cc-z.cc),Object(K.isFiniteNumber)(N.startPTS)&&Object(K.isFiniteNumber)(N.endPTS)&&(z.start=z.startPTS=N.startPTS,z.startDTS=N.startDTS,z.appendedPTS=N.appendedPTS,z.maxStartPTS=N.maxStartPTS,z.endPTS=N.endPTS,z.endDTS=N.endDTS,z.minEndPTS=N.minEndPTS,z.duration=N.endPTS-N.startPTS,z.duration&&(f=z),s.PTSKnown=s.alignedSliding=!0),z.elementaryStreams=N.elementaryStreams,z.loader=N.loader,z.stats=N.stats,z.urlId=N.urlId,N.initSegment&&(z.initSegment=N.initSegment,v=N.initSegment)}),v){var g=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;g.forEach(function(N){var z;(!N.initSegment||N.initSegment.relurl===((z=v)===null||z===void 0?void 0:z.relurl))&&(N.initSegment=v)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(N){return!N}),s.deltaUpdateFailed)){D.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=s.skippedSegments;h--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var o=s.fragments;if(E){D.logger.warn("discontinuity sliding from playlist, take drift into account");for(var S=0;S<o.length;S++)o[S].cc+=E}s.skippedSegments&&(s.startCC=s.fragments[0].cc),C(l.partList,s.partList,function(N,z){z.elementaryStreams=N.elementaryStreams,z.stats=N.stats}),f?L(s,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):O(l,s),o.length&&(s.totalduration=s.edge-o[0].start),s.driftStartTime=l.driftStartTime,s.driftStart=l.driftStart;var b=s.advancedDateTime;if(s.advanced&&b){var T=s.edge;s.driftStart||(s.driftStartTime=b,s.driftStart=T),s.driftEndTime=b,s.driftEnd=T}else s.driftEndTime=l.driftEndTime,s.driftEnd=l.driftEnd,s.advancedDateTime=l.advancedDateTime}function C(l,s,v){if(l&&s)for(var c=0,m=0,R=l.length;m<=R;m++){var E=l[m],f=s[m+c];E&&f&&E.index===f.index&&E.fragment.sn===f.fragment.sn?v(E,f):c--}}function k(l,s,v){for(var c=s.skippedSegments,m=Math.max(l.startSN,s.startSN)-s.startSN,R=(l.fragmentHint?1:0)+(c?s.endSN:Math.min(l.endSN,s.endSN))-s.startSN,E=s.startSN-l.startSN,f=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,g=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments,h=m;h<=R;h++){var o=g[E+h],S=f[h];c&&!S&&h<c&&(S=s.fragments[h]=o),o&&S&&v(o,S)}}function O(l,s){var v=s.startSN+s.skippedSegments-l.startSN,c=l.fragments;if(v<0||v>=c.length)return;A(s,c[v].start)}function A(l,s){if(s){for(var v=l.fragments,c=l.skippedSegments;c<v.length;c++)v[c].start+=s;l.fragmentHint&&(l.fragmentHint.start+=s)}}function x(l,s){var v=1e3*l.levelTargetDuration,c=v/2,m=l.age,R=m>0&&m<v*3,E=s.loading.end-s.loading.start,f,g=l.availabilityDelay;if(l.updated===!1)if(R){var h=333*l.misses;f=Math.max(Math.min(c,E*2),h),l.availabilityDelay=(l.availabilityDelay||0)+f}else f=c;else R?(g=Math.min(g||v/2,m),l.availabilityDelay=g,f=g+v-m):f=v-E;return Math.round(f)}function d(l,s,v){if(!l||!l.details)return null;var c=l.details,m=c.fragments[s-c.startSN];return m||(m=c.fragmentHint,m&&m.sn===s?m:s<c.startSN&&v&&v.sn===s?v:null)}function a(l,s,v){if(!l||!l.details)return null;var c=l.details.partList;if(c)for(var m=c.length;m--;){var R=c[m];if(R.index===v&&R.fragment.sn===s)return R}return null}},"./src/controller/stream-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return c});var K=M("./src/polyfills/number.ts"),D=M("./src/controller/base-stream-controller.ts"),P=M("./src/is-supported.ts"),H=M("./src/events.ts"),W=M("./src/utils/buffer-helper.ts"),_=M("./src/controller/fragment-tracker.ts"),L=M("./src/types/loader.ts"),y=M("./src/loader/fragment.ts"),C=M("./src/demux/transmuxer-interface.ts"),k=M("./src/types/transmuxer.ts"),O=M("./src/controller/gap-controller.ts"),A=M("./src/errors.ts"),x=M("./src/utils/logger.ts");function d(m,R){for(var E=0;E<R.length;E++){var f=R[E];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function a(m,R,E){return R&&d(m.prototype,R),E&&d(m,E),m}function l(m,R){m.prototype=Object.create(R.prototype),m.prototype.constructor=m,s(m,R)}function s(m,R){return s=Object.setPrototypeOf||function(f,g){return f.__proto__=g,f},s(m,R)}var v=100,c=function(m){l(R,m);function R(f,g){var h;return h=m.call(this,f,g,"[stream-controller]")||this,h.audioCodecSwap=!1,h.gapController=null,h.level=-1,h._forceStartLoad=!1,h.altAudio=!1,h.audioOnly=!1,h.fragPlaying=null,h.onvplaying=null,h.onvseeked=null,h.fragLastKbps=0,h.stalled=!1,h.couldBacktrack=!1,h.audioCodecSwitch=!1,h.videoBuffer=null,h._registerListeners(),h}var E=R.prototype;return E._registerListeners=function(){var g=this.hls;g.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),g.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),g.on(H.Events.ERROR,this.onError,this),g.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),g.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var g=this.hls;g.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),g.off(H.Events.ERROR,this.onError,this),g.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),g.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},E.startLoad=function(g){if(this.levels){var h=this.lastCurrentTime,o=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var S=o.startLevel;S===-1&&(o.config.testBandwidth?(S=0,this.bitrateTest=!0):S=o.nextAutoLevel),this.level=o.nextLoadLevel=S,this.loadedmetadata=!1}h>0&&g===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),g=h),this.state=D.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()}else this._forceStartLoad=!0,this.state=D.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case D.State.IDLE:this.doTickIdle();break;case D.State.WAITING_LEVEL:{var g,h=this.levels,o=this.level,S=h==null||((g=h[o])===null||g===void 0)?void 0:g.details;if(S&&(!S.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(S))break;this.state=D.State.IDLE;break}break}case D.State.FRAG_LOADING_WAITING_RETRY:{var b,T=self.performance.now(),N=this.retryDate;(!N||T>=N||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=D.State.IDLE)}break;default:break}this.onTickEnd()},E.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var g,h,o=this.hls,S=this.levelLastLoaded,b=this.levels,T=this.media,N=o.config,z=o.nextLoadLevel;if(S===null||!T&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[z])return;var Y=b[z];this.level=o.nextLoadLevel=z;var te=Y.details;if(!te||this.state===D.State.WAITING_LEVEL||te.live&&this.levelLastLoaded!==z){this.state=D.State.WAITING_LEVEL;return}var G=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:T,L.PlaylistLevelType.MAIN);if(G===null)return;var F=G.len,re=this.getMaxBufferLength(Y.maxBitrate);if(F>=re)return;if(this._streamEnded(G,te)){var le={};this.altAudio&&(le.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,le),this.state=D.State.ENDED;return}var Ee=G.end,Oe=this.getNextFragment(Ee,te);if(this.couldBacktrack&&!this.fragPrevious&&Oe&&Oe.sn!=="initSegment"){var Ye=Oe.sn-te.startSN;Ye>1&&(Oe=te.fragments[Ye-1],this.fragmentTracker.removeFragment(Oe))}if(Oe&&this.fragmentTracker.getState(Oe)===_.FragmentState.OK&&this.nextLoadPosition>Ee){var Pe=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(T,Pe,L.PlaylistLevelType.MAIN),Oe=this.getNextFragment(this.nextLoadPosition,te)}if(!Oe)return;Oe.initSegment&&!Oe.initSegment.data&&!this.bitrateTest&&(Oe=Oe.initSegment),((g=Oe.decryptdata)===null||g===void 0?void 0:g.keyFormat)==="identity"&&!((h=Oe.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(Oe,te):this.loadFragment(Oe,te,Ee)},E.loadFragment=function(g,h,o){var S,b=this.fragmentTracker.getState(g);if(this.fragCurrent=g,b===_.FragmentState.BACKTRACKED){var T=this.fragmentTracker.getBacktrackData(g);if(T){this._handleFragmentLoadProgress(T),this._handleFragmentLoadComplete(T);return}else b=_.FragmentState.NOT_LOADED}b===_.FragmentState.NOT_LOADED||b===_.FragmentState.PARTIAL?g.sn==="initSegment"?this._loadInitSegment(g):this.bitrateTest?(g.bitrateTest=!0,this.log("Fragment "+g.sn+" of level "+g.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(g)):(this.startFragRequested=!0,m.prototype.loadFragment.call(this,g,h,o)):b===_.FragmentState.APPENDING?this.reduceMaxBufferLength(g.duration)&&this.fragmentTracker.removeFragment(g):((S=this.media)===null||S===void 0?void 0:S.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},E.getAppendedFrag=function(g){var h=this.fragmentTracker.getAppendedFrag(g,L.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},E.getBufferedFrag=function(g){return this.fragmentTracker.getBufferedFrag(g,L.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(g){return g?this.getBufferedFrag(g.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.nextLevelSwitch=function(){var g=this.levels,h=this.media;if(h!=null&&h.readyState){var o,S=this.getAppendedFrag(h.currentTime);if(S&&S.start>1&&this.flushMainBuffer(0,S.start-1),!h.paused&&g){var b=this.hls.nextLoadLevel,T=g[b],N=this.fragLastKbps;N&&this.fragCurrent?o=this.fragCurrent.duration*T.maxBitrate/(1e3*N)+1:o=0}else o=0;var z=this.getBufferedFrag(h.currentTime+o);if(z){var Y=this.followingBufferedFrag(z);if(Y){this.abortCurrentFrag();var te=Y.maxStartPTS?Y.maxStartPTS:Y.start,G=Y.duration,F=Math.max(z.end,te+Math.min(Math.max(G-this.config.maxFragLookUpTolerance,G*.5),G*.75));this.flushMainBuffer(F,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var g=this.fragCurrent;this.fragCurrent=null,g!=null&&g.loader&&g.loader.abort(),this.state===D.State.KEY_LOADING&&(this.state=D.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(g,h){m.prototype.flushMainBuffer.call(this,g,h,this.altAudio?"video":null)},E.onMediaAttached=function(g,h){m.prototype.onMediaAttached.call(this,g,h);var o=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new O.default(this.config,o,this.fragmentTracker,this.hls)},E.onMediaDetaching=function(){var g=this.media;g&&(g.removeEventListener("playing",this.onvplaying),g.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),m.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var g=this.media,h=g?g.currentTime:null;Object(K.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},E.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},E.onManifestParsed=function(g,h){var o=!1,S=!1,b;h.levels.forEach(function(T){b=T.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(o=!0),b.indexOf("mp4a.40.5")!==-1&&(S=!0))}),this.audioCodecSwitch=o&&S&&!Object(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},E.onLevelLoading=function(g,h){var o=this.levels;if(!o||this.state!==D.State.IDLE)return;var S=o[h.level];(!S.details||S.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(S.details))&&(this.state=D.State.WAITING_LEVEL)},E.onLevelLoaded=function(g,h){var o,S=this.levels,b=h.level,T=h.details,N=T.totalduration;if(!S){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+T.startSN+","+T.endSN+"], cc ["+T.startCC+", "+T.endCC+"] duration:"+N);var z=this.fragCurrent;z&&(this.state===D.State.FRAG_LOADING||this.state===D.State.FRAG_LOADING_WAITING_RETRY)&&(z.level!==h.level&&z.loader&&(this.state=D.State.IDLE,z.loader.abort()));var Y=S[b],te=0;if(T.live||(o=Y.details)!==null&&o!==void 0&&o.live){if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed)return;te=this.alignPlaylists(T,Y.details)}if(Y.details=T,this.levelLastLoaded=b,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:T,level:b}),this.state===D.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(T))return;this.state=D.State.IDLE}this.startFragRequested?T.live&&this.synchronizeToLiveEdge(T):this.setStartPosition(T,te),this.tick()},E._handleFragmentLoadProgress=function(g){var h,o=g.frag,S=g.part,b=g.payload,T=this.levels;if(!T){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var N=T[o.level],z=N.details;if(!z){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var Y=N.videoCodec,te=z.PTSKnown||!z.live,G=(h=o.initSegment)===null||h===void 0?void 0:h.data,F=this._getAudioCodec(N),re=this.transmuxer=this.transmuxer||new C.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),le=S?S.index:-1,Ee=le!==-1,Oe=new k.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,b.byteLength,le,Ee),Ye=this.initPTS[o.cc];re.push(b,G,F,Y,o,S,z.totalduration,te,Oe,Ye)},E.onAudioTrackSwitching=function(g,h){var o=this.altAudio,S=!!h.url,b=h.id;if(!S){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var T=this.fragCurrent;T!=null&&T.loader&&(this.log("Switching to main audio track, cancel main fragment load"),T.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;o&&N.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:b})}},E.onAudioTrackSwitched=function(g,h){var o=h.id,S=!!this.hls.audioTracks[o].url;if(S){var b=this.videoBuffer;b&&this.mediaBuffer!==b&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=b)}this.altAudio=S,this.tick()},E.onBufferCreated=function(g,h){var o=h.tracks,S,b,T=!1;for(var N in o){var z=o[N];if(z.id==="main"){if(b=N,S=z,N==="video"){var Y=o[N];Y&&(this.videoBuffer=Y.buffer)}}else T=!0}T&&S?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=S.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(g,h){var o=h.frag,S=h.part;if(o&&o.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(S?" p: "+S.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===D.State.PARSED&&(this.state=D.State.IDLE);return}var b=S?S.stats:o.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,S)},E.onError=function(g,h){switch(h.details){case A.ErrorDetails.FRAG_LOAD_ERROR:case A.ErrorDetails.FRAG_LOAD_TIMEOUT:case A.ErrorDetails.KEY_LOAD_ERROR:case A.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,h);break;case A.ErrorDetails.LEVEL_LOAD_ERROR:case A.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==D.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=D.State.ERROR):!h.levelRetry&&this.state===D.State.WAITING_LEVEL&&(this.state=D.State.IDLE));break;case A.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===D.State.PARSING||this.state===D.State.PARSED)){var o=!0,S=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);S&&S.len>.5&&(o=!this.reduceMaxBufferLength(S.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},E.checkBuffer=function(){var g=this.media,h=this.gapController;if(!g||!h||!g.readyState)return;var o=W.BufferHelper.getBuffered(g);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=g.currentTime},E.onFragLoadEmergencyAborted=function(){this.state=D.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(g,h){var o=h.type;if(o!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var S=(o===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(S,o,L.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(g,h){this.levels=h.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.seekToStartPos=function(){var g=this.media,h=g.currentTime,o=this.startPosition;if(o>=0&&h<o){if(g.seeking){x.logger.log("could not seek to "+o+", already seeking at "+h);return}var S=W.BufferHelper.getBuffered(g),b=S.length?S.start(0):0,T=b-o;T>0&&(T<this.config.maxBufferHole||T<this.config.maxFragLookUpTolerance)&&(x.logger.log("adjusting start position by "+T+" to match buffer start"),o+=T,this.startPosition=o),this.log("seek to target start position "+o+" from current time "+h),g.currentTime=o}},E._getAudioCodec=function(g){var h=this.config.defaultAudioCodec||g.audioCodec;return this.audioCodecSwap&&h&&(this.log("Swapping audio codec"),h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5"),h},E._loadBitrateTestFrag=function(g){var h=this;this._doFragLoad(g).then(function(o){var S=h.hls;if(!o||S.nextLoadLevel||h.fragContextChanged(g))return;h.fragLoadError=0,h.state=D.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var b=g.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),S.trigger(H.Events.FRAG_LOADED,o)})},E._handleTransmuxComplete=function(g){var h,o="main",S=this.hls,b=g.remuxResult,T=g.chunkMeta,N=this.getCurrentContext(T);if(!N){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(T.level);return}var z=N.frag,Y=N.part,te=N.level,G=b.video,F=b.text,re=b.id3,le=b.initSegment,Ee=this.altAudio?void 0:b.audio;if(this.fragContextChanged(z))return;if(this.state=D.State.PARSING,le){le.tracks&&(this._bufferInitSegment(te,le.tracks,z,T),S.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:o,tracks:le.tracks}));var Oe=le.initPTS,Ye=le.timescale;Object(K.isFiniteNumber)(Oe)&&(this.initPTS[z.cc]=Oe,S.trigger(H.Events.INIT_PTS_FOUND,{frag:z,id:o,initPTS:Oe,timescale:Ye}))}if(G&&b.independent!==!1){if(te.details){var Pe=G.startPTS,Be=G.endPTS,Ue=G.startDTS,Ne=G.endDTS;if(Y)Y.elementaryStreams[G.type]={startPTS:Pe,endPTS:Be,startDTS:Ue,endDTS:Ne};else if(G.firstKeyFrame&&G.independent&&(this.couldBacktrack=!0),G.dropped&&G.independent){var Te=this.getLoadPosition()+this.config.maxBufferHole;if(Te<Pe){this.backtrack(z);return}z.setElementaryStreamInfo(G.type,z.start,Be,z.start,Ne,!0)}z.setElementaryStreamInfo(G.type,Pe,Be,Ue,Ne),this.bufferFragmentData(G,z,Y,T)}}else if(b.independent===!1){this.backtrack(z);return}if(Ee){var se=Ee.startPTS,ze=Ee.endPTS,xt=Ee.startDTS,ct=Ee.endDTS;Y&&(Y.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:ze,startDTS:xt,endDTS:ct}),z.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,se,ze,xt,ct),this.bufferFragmentData(Ee,z,Y,T)}if(re!=null&&(h=re.samples)!==null&&h!==void 0&&h.length){var ft={frag:z,id:o,samples:re.samples};S.trigger(H.Events.FRAG_PARSING_METADATA,ft)}if(F){var Ct={frag:z,id:o,samples:F.samples};S.trigger(H.Events.FRAG_PARSING_USERDATA,Ct)}},E._bufferInitSegment=function(g,h,o,S){var b=this;if(this.state!==D.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var T=h.audio,N=h.video,z=h.audiovideo;if(T){var Y=g.audioCodec,te=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(Y&&(Y.indexOf("mp4a.40.5")!==-1?Y="mp4a.40.2":Y="mp4a.40.5"),T.metadata.channelCount!==1&&te.indexOf("firefox")===-1&&(Y="mp4a.40.5")),te.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(Y="mp4a.40.2",this.log("Android: force audio codec to "+Y)),g.audioCodec&&g.audioCodec!==Y&&this.log('Swapping manifest audio codec "'+g.audioCodec+'" for "'+Y+'"'),T.levelCodec=Y,T.id="main",this.log("Init audio buffer, container:"+T.container+", codecs[selected/level/parsed]=["+(Y||"")+"/"+(g.audioCodec||"")+"/"+T.codec+"]")}N&&(N.levelCodec=g.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(g.videoCodec||"")+"/"+N.codec+"]")),z&&this.log("Init audiovideo buffer, container:"+z.container+", codecs[level/parsed]=["+(g.attrs.CODECS||"")+"/"+z.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(G){var F=h[G],re=F.initSegment;re!=null&&re.byteLength&&b.hls.trigger(H.Events.BUFFER_APPENDING,{type:G,data:re,frag:o,part:null,chunkMeta:S,parent:o.type})}),this.tick()},E.backtrack=function(g){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(g);var h=this.fragmentTracker.backtrack(g);this.fragPrevious=null,this.nextLoadPosition=g.start,h?this.resetFragmentLoading(g):this.state=D.State.BACKTRACKING},E.checkFragmentChanged=function(){var g=this.media,h=null;if(g&&g.readyState>1&&g.seeking===!1){var o=g.currentTime;if(W.BufferHelper.isBuffered(g,o)?h=this.getAppendedFrag(o):W.BufferHelper.isBuffered(g,o+.1)&&(h=this.getAppendedFrag(o+.1)),h){var S=this.fragPlaying,b=h.level;(!S||h.sn!==S.sn||S.level!==b||h.urlId!==S.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:h}),(!S||S.level!==b)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=h)}}},a(R,[{key:"nextLevel",get:function(){var g=this.nextBufferedFrag;return g?g.level:-1}},{key:"currentLevel",get:function(){var g=this.media;if(g){var h=this.getAppendedFrag(g.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var g=this.media;if(g){var h=this.getAppendedFrag(g.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(D.default)},"./src/controller/subtitle-stream-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"SubtitleStreamController",function(){return l});var K=M("./src/events.ts"),D=M("./src/utils/logger.ts"),P=M("./src/utils/buffer-helper.ts"),H=M("./src/controller/fragment-finders.ts"),W=M("./src/utils/discontinuities.ts"),_=M("./src/controller/level-helper.ts"),L=M("./src/controller/fragment-tracker.ts"),y=M("./src/controller/base-stream-controller.ts"),C=M("./src/types/loader.ts"),k=M("./src/types/level.ts");function O(s,v){for(var c=0;c<v.length;c++){var m=v[c];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(s,m.key,m)}}function A(s,v,c){return v&&O(s.prototype,v),c&&O(s,c),s}function x(s,v){s.prototype=Object.create(v.prototype),s.prototype.constructor=s,d(s,v)}function d(s,v){return d=Object.setPrototypeOf||function(m,R){return m.__proto__=R,m},d(s,v)}var a=500,l=function(s){x(v,s);function v(m,R){var E;return E=s.call(this,m,R,"[subtitle-stream-controller]")||this,E.levels=[],E.currentTrackId=-1,E.tracksBuffered=[],E.mainDetails=null,E._registerListeners(),E}var c=v.prototype;return c.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},c._registerListeners=function(){var R=this.hls;R.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(K.Events.ERROR,this.onError,this),R.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c._unregisterListeners=function(){var R=this.hls;R.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(K.Events.ERROR,this.onError,this),R.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},c.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(a),this.tick()},c.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},c.onLevelLoaded=function(R,E){this.mainDetails=E.details},c.onSubtitleFragProcessed=function(R,E){var f=E.frag,g=E.success;if(this.fragPrevious=f,this.state=y.State.IDLE,!g)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var o,S=f.start,b=0;b<h.length;b++)if(S>=h[b].start&&S<=h[b].end){o=h[b];break}var T=f.start+f.duration;o?o.end=T:(o={start:S,end:T},h.push(o)),this.fragmentTracker.fragBuffered(f)},c.onBufferFlushing=function(R,E){var f=E.startOffset,g=E.endOffset;if(f===0&&g!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,o=this.levels;if(!o.length||!o[h]||!o[h].details)return;var S=o[h].details,b=S.targetduration,T=g-b;if(T<=0)return;E.endOffsetSubtitles=Math.max(0,T),this.tracksBuffered.forEach(function(N){for(var z=0;z<N.length;){if(N[z].end<=T){N.shift();continue}else if(N[z].start<T)N[z].start=T;else break;z++}}),this.fragmentTracker.removeFragmentsInRange(f,T,C.PlaylistLevelType.SUBTITLE)}},c.onError=function(R,E){var f,g=E.frag;if(!g||g.type!==C.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},c.onSubtitleTracksUpdated=function(R,E){var f=this,g=E.subtitleTracks;this.tracksBuffered=[],this.levels=g.map(function(h){return new k.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){f.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},c.onSubtitleTrackSwitch=function(R,E){if(this.currentTrackId=E.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var f=this.levels[this.currentTrackId];f!=null&&f.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,f&&this.setInterval(a)},c.onSubtitleTrackLoaded=function(R,E){var f,g=E.details,h=E.id,o=this.currentTrackId,S=this.levels;if(!S.length)return;var b=S[o];if(h>=S.length||h!==o||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,g.live||(f=b.details)!==null&&f!==void 0&&f.live){var T=this.mainDetails;if(g.deltaUpdateFailed||!T)return;var N=T.fragments[0];if(!b.details)g.hasProgramDateTime&&T.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(g,T):N&&Object(_.addSliding)(g,N.start);else{var z=this.alignPlaylists(g,b.details);z===0&&N&&Object(_.addSliding)(g,N.start)}}if(b.details=g,this.levelLastLoaded=h,this.tick(),g.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var Y=Object(H.findFragmentByPTS)(null,g.fragments,this.media.currentTime,0);Y||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},c._handleFragmentLoadComplete=function(R){var E=R.frag,f=R.payload,g=E.decryptdata,h=this.hls;if(this.fragContextChanged(E))return;if(f&&f.byteLength>0&&g&&g.key&&g.iv&&g.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),g.key.buffer,g.iv.buffer).then(function(S){var b=performance.now();h.trigger(K.Events.FRAG_DECRYPTED,{frag:E,payload:S,stats:{tstart:o,tdecrypt:b}})})}},c.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var R,E=this.currentTrackId,f=this.levels;if(!f.length||!f[E]||!f[E].details)return;var g=f[E].details,h=g.targetduration,o=this.config,S=this.media,b=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,S.currentTime-h,o.maxBufferHole),T=b.end,N=b.len,z=this.getMaxBufferLength()+h;if(N>z)return;console.assert(g,"Subtitle track details are defined on idle subtitle stream controller tick");var Y=g.fragments,te=Y.length,G=g.edge,F,re=this.fragPrevious;if(T<G){var le=o.maxFragLookUpTolerance;re&&g.hasProgramDateTime&&(F=Object(H.findFragmentByPDT)(Y,re.endProgramDateTime,le)),F||(F=Object(H.findFragmentByPTS)(re,Y,T,le),!F&&re&&re.start<Y[0].start&&(F=Y[0]))}else F=Y[te-1];(R=F)!==null&&R!==void 0&&R.encrypted?(D.logger.log("Loading key for "+F.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(K.Events.KEY_LOADING,{frag:F})):F&&this.fragmentTracker.getState(F)===L.FragmentState.NOT_LOADED&&this.loadFragment(F,g,T)}},c.loadFragment=function(R,E,f){this.fragCurrent=R,s.prototype.loadFragment.call(this,R,E,f)},A(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(y.default)},"./src/controller/subtitle-track-controller.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/events.ts"),D=M("./src/utils/texttrack-utils.ts"),P=M("./src/controller/base-playlist-controller.ts"),H=M("./src/types/loader.ts");function W(O,A){for(var x=0;x<A.length;x++){var d=A[x];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(O,d.key,d)}}function _(O,A,x){return A&&W(O.prototype,A),x&&W(O,x),O}function L(O,A){O.prototype=Object.create(A.prototype),O.prototype.constructor=O,y(O,A)}function y(O,A){return y=Object.setPrototypeOf||function(d,a){return d.__proto__=a,d},y(O,A)}var C=function(O){L(A,O);function A(d){var a;return a=O.call(this,d,"[subtitle-track-controller]")||this,a.media=null,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.selectDefaultTrack=!0,a.queuedDefaultTrack=-1,a.trackChangeListener=function(){return a.onTextTracksChanged()},a.asyncPollTrackChange=function(){return a.pollTrackChange(0)},a.useTextTrackPolling=!1,a.subtitlePollingInterval=-1,a.subtitleDisplay=!0,a.registerListeners(),a}var x=A.prototype;return x.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,O.prototype.destroy.call(this)},x.registerListeners=function(){var a=this.hls;a.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.on(K.Events.ERROR,this.onError,this)},x.unregisterListeners=function(){var a=this.hls;a.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),a.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),a.off(K.Events.ERROR,this.onError,this)},x.onMediaAttached=function(a,l){if(this.media=l.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},x.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},x.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var a=k(this.media.textTracks);a.forEach(function(l){Object(D.clearCurrentCues)(l)}),this.subtitleTrack=-1,this.media=null},x.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},x.onManifestParsed=function(a,l){this.tracks=l.subtitleTracks},x.onSubtitleTrackLoaded=function(a,l){var s=l.id,v=l.details,c=this.trackId,m=this.tracksInGroup[c];if(!m){this.warn("Invalid subtitle track id "+s);return}var R=m.details;m.details=l.details,this.log("subtitle track "+s+" loaded ["+v.startSN+"-"+v.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,l,R))},x.onLevelLoading=function(a,l){this.switchLevel(l.level)},x.onLevelSwitching=function(a,l){this.switchLevel(l.level)},x.switchLevel=function(a){var l=this.hls.levels[a];if(!(l!=null&&l.textGroupIds))return;var s=l.textGroupIds[l.urlId];if(this.groupId!==s){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,c=this.tracks.filter(function(E){return!s||E.groupId===s});this.tracksInGroup=c;var m=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=s;var R={subtitleTracks:c};this.log("Updating subtitle tracks, "+c.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(K.Events.SUBTITLE_TRACKS_UPDATED,R),m!==-1&&this.setSubtitleTrack(m,v)}},x.findTrackId=function(a){for(var l=this.tracksInGroup,s=0;s<l.length;s++){var v=l[s];if((!this.selectDefaultTrack||v.default)&&(!a||a===v.name))return v.id}return-1},x.onError=function(a,l){if(O.prototype.onError.call(this,a,l),l.fatal||!l.context)return;l.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&l.context.id===this.trackId&&l.context.groupId===this.groupId&&this.retryLoadingOrFail(l)},x.loadPlaylist=function(a){var l=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(l)){var s=l.id,v=l.groupId,c=l.url;if(a)try{c=a.addDirectives(c)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Loading subtitle playlist for id "+s),this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADING,{url:c,id:s,groupId:v,deliveryDirectives:a||null})}},x.toggleTrackModes=function(a){var l=this,s=this.media,v=this.subtitleDisplay,c=this.trackId;if(!s)return;var m=k(s.textTracks),R=m.filter(function(g){return g.groupId===l.groupId});if(a===-1)[].slice.call(m).forEach(function(g){g.mode="disabled"});else{var E=R[c];E&&(E.mode="disabled")}var f=R[a];f&&(f.mode=v?"showing":"hidden")},x.setSubtitleTrack=function(a,l){var s,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=a;return}if(this.trackId!==a&&this.toggleTrackModes(a),this.trackId===a&&(a===-1||(s=v[a])!==null&&s!==void 0&&s.details)||a<-1||a>=v.length)return;this.clearTimer();var c=v[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,c){var m=c.id,R=c.groupId,E=R===void 0?"":R,f=c.name,g=c.type,h=c.url;this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:E,name:f,type:g,url:h});var o=this.switchParams(c.url,l==null?void 0:l.details);this.loadPlaylist(o)}else this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:a})},x.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,l=k(this.media.textTracks),s=0;s<l.length;s++)if(l[s].mode==="hidden")a=s;else if(l[s].mode==="showing"){a=s;break}this.subtitleTrack!==a&&(this.subtitleTrack=a)},_(A,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1;var l=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(a,l)}}]),A}(P.default);function k(O){for(var A=[],x=0;x<O.length;x++){var d=O[x];d.kind==="subtitles"&&d.label&&A.push(O[x])}return A}X.default=C},"./src/controller/timeline-controller.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"TimelineController",function(){return k});var K=M("./src/polyfills/number.ts"),D=M("./src/events.ts"),P=M("./src/utils/cea-608-parser.ts"),H=M("./src/utils/output-filter.ts"),W=M("./src/utils/webvtt-parser.ts"),_=M("./src/utils/texttrack-utils.ts"),L=M("./src/utils/imsc1-ttml-parser.ts"),y=M("./src/types/loader.ts"),C=M("./src/utils/logger.ts"),k=function(){function d(l){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=x(),this.captionsProperties=void 0,this.hls=l,this.config=l.config,this.Cues=l.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var s=new H.default(this,"textTrack1"),v=new H.default(this,"textTrack2"),c=new H.default(this,"textTrack3"),m=new H.default(this,"textTrack4");this.cea608Parser1=new P.default(1,s,v),this.cea608Parser2=new P.default(3,c,m)}l.on(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),l.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),l.on(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),l.on(D.Events.FRAG_LOADING,this.onFragLoading,this),l.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),l.on(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),l.on(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),l.on(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var a=d.prototype;return a.destroy=function(){var s=this.hls;s.off(D.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(D.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.off(D.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.off(D.Events.FRAG_LOADING,this.onFragLoading,this),s.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(D.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.off(D.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.off(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.off(D.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.off(D.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},a.addCues=function(s,v,c,m,R){for(var E=!1,f=R.length;f--;){var g=R[f],h=A(g[0],g[1],v,c);if(h>=0&&(g[0]=Math.min(g[0],v),g[1]=Math.max(g[1],c),E=!0,h/(c-v)>.5))return}if(E||R.push([v,c]),this.config.renderTextTracksNatively){var o=this.captionsTracks[s];this.Cues.newCue(o,v,c,m)}else{var S=this.Cues.newCue(null,v,c,m);this.hls.trigger(D.Events.CUES_PARSED,{type:"captions",cues:S,track:s})}},a.onInitPtsFound=function(s,v){var c=this,m=v.frag,R=v.id,E=v.initPTS,f=v.timescale,g=this.unparsedVttFrags;R==="main"&&(this.initPTS[m.cc]=E,this.timescale[m.cc]=f),g.length&&(this.unparsedVttFrags=[],g.forEach(function(h){c.onFragLoaded(D.Events.FRAG_LOADED,h)}))},a.getExistingTrack=function(s){var v=this.media;if(v)for(var c=0;c<v.textTracks.length;c++){var m=v.textTracks[c];if(m[s])return m}return null},a.createCaptionsTrack=function(s){this.config.renderTextTracksNatively?this.createNativeTrack(s):this.createNonNativeTrack(s)},a.createNativeTrack=function(s){if(this.captionsTracks[s])return;var v=this.captionsProperties,c=this.captionsTracks,m=this.media,R=v[s],E=R.label,f=R.languageCode,g=this.getExistingTrack(s);if(g)c[s]=g,Object(_.clearCurrentCues)(c[s]),Object(_.sendAddTrackEvent)(c[s],m);else{var h=this.createTextTrack("captions",E,f);h&&(h[s]=!0,c[s]=h)}},a.createNonNativeTrack=function(s){if(this.nonNativeCaptionsTracks[s])return;var v=this.captionsProperties[s];if(!v)return;var c=v.label,m={_id:s,label:c,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[s]=m,this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},a.createTextTrack=function(s,v,c){var m=this.media;return m?m.addTextTrack(s,v,c):void 0},a.onMediaAttaching=function(s,v){this.media=v.media,this._cleanTracks()},a.onMediaDetaching=function(){var s=this.captionsTracks;Object.keys(s).forEach(function(v){Object(_.clearCurrentCues)(s[v]),delete s[v]}),this.nonNativeCaptionsTracks={}},a.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=x(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},a._cleanTracks=function(){var s=this.media;if(!s)return;var v=s.textTracks;if(v)for(var c=0;c<v.length;c++)Object(_.clearCurrentCues)(v[c])},a.onSubtitleTracksUpdated=function(s,v){var c=this;this.textTracks=[];var m=v.subtitleTracks||[],R=m.some(function(h){return h.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var E=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var f=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,o){var S;if(o<f.length){for(var b=null,T=0;T<f.length;T++)if(O(f[T],h)){b=f[T];break}b&&(S=b)}S?Object(_.clearCurrentCues)(S):(S=c.createTextTrack("subtitles",h.name,h.lang),S&&(S.mode="disabled")),S&&(S.groupId=h.groupId,c.textTracks.push(S))})}else if(!E&&this.tracks&&this.tracks.length){var g=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(D.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:g})}}},a.onManifestLoaded=function(s,v){var c=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(m){var R=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!R)return;var E="textTrack"+R[1],f=c.captionsProperties[E];if(!f)return;f.label=m.name,m.lang&&(f.languageCode=m.lang),f.media=m})},a.onFragLoading=function(s,v){var c=this.cea608Parser1,m=this.cea608Parser2,R=this.lastSn,E=this.lastPartIndex;if(!this.enabled||!(c&&m))return;if(v.frag.type===y.PlaylistLevelType.MAIN){var f,g,h=v.frag.sn,o=(f=v==null||((g=v.part)===null||g===void 0)?void 0:g.index)!=null?f:-1;h===R+1||h===R&&o===E+1||(c.reset(),m.reset()),this.lastSn=h,this.lastPartIndex=o}},a.onFragLoaded=function(s,v){var c=v.frag,m=v.payload,R=this.initPTS,E=this.unparsedVttFrags;if(c.type===y.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(K.isFiniteNumber)(R[c.cc])){E.push(v),R.length&&this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Missing initial subtitle PTS")});return}var f=c.decryptdata;if(f==null||f.key==null||f.method!=="AES-128"){var g=this.tracks[c.level],h=this.vttCCs;h[c.cc]||(h[c.cc]={start:c.start,prevCC:this.prevCC,new:!0},this.prevCC=c.cc),g&&g.textCodec===L.IMSC1_CODEC?this._parseIMSC1(c,m):this._parseVTTs(c,m,h)}}else this.hls.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:new Error("Empty subtitle payload")})},a._parseIMSC1=function(s,v){var c=this,m=this.hls;Object(L.parseIMSC1)(v,this.initPTS[s.cc],this.timescale[s.cc],function(R){c._appendCues(R,s.level),m.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(R){C.logger.log("Failed to parse IMSC1: "+R),m.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:R})})},a._parseVTTs=function(s,v,c){var m=this,R=this.hls;Object(W.parseWebVTT)(v,this.initPTS[s.cc],this.timescale[s.cc],c,s.cc,s.start,function(E){m._appendCues(E,s.level),R.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},function(E){m._fallbackToIMSC1(s,v),C.logger.log("Failed to parse VTT cue: "+E),R.trigger(D.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:E})})},a._fallbackToIMSC1=function(s,v){var c=this,m=this.tracks[s.level];m.textCodec||Object(L.parseIMSC1)(v,this.initPTS[s.cc],this.timescale[s.cc],function(){m.textCodec=L.IMSC1_CODEC,c._parseIMSC1(s,v)},function(){m.textCodec="wvtt"})},a._appendCues=function(s,v){var c=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[v];if(m.mode==="disabled")return;s.forEach(function(f){return Object(_.addCueToTrack)(m,f)})}else{var R=this.tracks[v],E=R.default?"default":"subtitles"+v;c.trigger(D.Events.CUES_PARSED,{type:"subtitles",cues:s,track:E})}},a.onFragDecrypted=function(s,v){var c=v.frag;if(c.type===y.PlaylistLevelType.SUBTITLE){if(!Object(K.isFiniteNumber)(this.initPTS[c.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(D.Events.FRAG_LOADED,v)}},a.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},a.onFragParsingUserdata=function(s,v){var c=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(c&&m))return;for(var R=0;R<v.samples.length;R++){var E=v.samples[R].bytes;if(E){var f=this.extractCea608Data(E);c.addData(v.samples[R].pts,f[0]),m.addData(v.samples[R].pts,f[1])}}},a.onBufferFlushing=function(s,v){var c=v.startOffset,m=v.endOffset,R=v.endOffsetSubtitles,E=v.type,f=this.media;if(!f||f.currentTime<m)return;if(!E||E==="video"){var g=this.captionsTracks;Object.keys(g).forEach(function(o){return Object(_.removeCuesInRange)(g[o],c,m)})}if(this.config.renderTextTracksNatively&&(c===0&&R!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(o){return Object(_.removeCuesInRange)(h[o],c,R)})}},a.extractCea608Data=function(s){for(var v=s[0]&31,c=2,m=[[],[]],R=0;R<v;R++){var E=s[c++],f=127&s[c++],g=127&s[c++],h=(4&E)!==0,o=3&E;if(f===0&&g===0)continue;h&&((o===0||o===1)&&(m[o].push(f),m[o].push(g)))}return m},d}();function O(d,a){return d&&d.label===a.name&&!(d.textTrack1||d.textTrack2)}function A(d,a,l,s){return Math.min(a,s)-Math.max(d,l)}function x(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return K});var K=function(){function D(H,W){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=W}var P=D.prototype;return P.decrypt=function(W,_){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},_,W)},D}()},"./src/crypt/aes-decryptor.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"removePadding",function(){return D}),M.d(X,"default",function(){return P});var K=M("./src/utils/typed-array.ts");function D(H){var W=H.byteLength,_=W&&new DataView(H.buffer).getUint8(W-1);return _?Object(K.sliceUint8)(H,0,W-_):H}var P=function(){function H(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var W=H.prototype;return W.uint8ArrayToUint32Array_=function(L){for(var y=new DataView(L),C=new Uint32Array(4),k=0;k<4;k++)C[k]=y.getUint32(k*4);return C},W.initTable=function(){var L=this.sBox,y=this.invSBox,C=this.subMix,k=C[0],O=C[1],A=C[2],x=C[3],d=this.invSubMix,a=d[0],l=d[1],s=d[2],v=d[3],c=new Uint32Array(256),m=0,R=0,E=0;for(E=0;E<256;E++)E<128?c[E]=E<<1:c[E]=E<<1^283;for(E=0;E<256;E++){var f=R^R<<1^R<<2^R<<3^R<<4;f=f>>>8^f&255^99,L[m]=f,y[f]=m;var g=c[m],h=c[g],o=c[h],S=c[f]*257^f*16843008;k[m]=S<<24|S>>>8,O[m]=S<<16|S>>>16,A[m]=S<<8|S>>>24,x[m]=S,S=o*16843009^h*65537^g*257^m*16843008,a[f]=S<<24|S>>>8,l[f]=S<<16|S>>>16,s[f]=S<<8|S>>>24,v[f]=S,m?(m=g^c[c[c[o^g]]],R^=c[c[R]]):m=R=1}},W.expandKey=function(L){for(var y=this.uint8ArrayToUint32Array_(L),C=!0,k=0;k<y.length&&C;)C=y[k]===this.key[k],k++;if(C)return;this.key=y;var O=this.keySize=y.length;if(O!==4&&O!==6&&O!==8)throw new Error("Invalid aes key size="+O);var A=this.ksRows=(O+6+1)*4,x,d,a=this.keySchedule=new Uint32Array(A),l=this.invKeySchedule=new Uint32Array(A),s=this.sBox,v=this.rcon,c=this.invSubMix,m=c[0],R=c[1],E=c[2],f=c[3],g,h;for(x=0;x<A;x++){if(x<O){g=a[x]=y[x];continue}h=g,x%O===0?(h=h<<8|h>>>24,h=s[h>>>24]<<24|s[h>>>16&255]<<16|s[h>>>8&255]<<8|s[h&255],h^=v[x/O|0]<<24):O>6&&x%O===4&&(h=s[h>>>24]<<24|s[h>>>16&255]<<16|s[h>>>8&255]<<8|s[h&255]),a[x]=g=(a[x-O]^h)>>>0}for(d=0;d<A;d++)x=A-d,d&3?h=a[x]:h=a[x-4],d<4||x<=4?l[d]=h:l[d]=m[s[h>>>24]]^R[s[h>>>16&255]]^E[s[h>>>8&255]]^f[s[h&255]],l[d]=l[d]>>>0},W.networkToHostOrderSwap=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},W.decrypt=function(L,y,C){for(var k=this.keySize+6,O=this.invKeySchedule,A=this.invSBox,x=this.invSubMix,d=x[0],a=x[1],l=x[2],s=x[3],v=this.uint8ArrayToUint32Array_(C),c=v[0],m=v[1],R=v[2],E=v[3],f=new Int32Array(L),g=new Int32Array(f.length),h,o,S,b,T,N,z,Y,te,G,F,re,le,Ee,Oe=this.networkToHostOrderSwap;y<f.length;){for(te=Oe(f[y]),G=Oe(f[y+1]),F=Oe(f[y+2]),re=Oe(f[y+3]),T=te^O[0],N=re^O[1],z=F^O[2],Y=G^O[3],le=4,Ee=1;Ee<k;Ee++)h=d[T>>>24]^a[N>>16&255]^l[z>>8&255]^s[Y&255]^O[le],o=d[N>>>24]^a[z>>16&255]^l[Y>>8&255]^s[T&255]^O[le+1],S=d[z>>>24]^a[Y>>16&255]^l[T>>8&255]^s[N&255]^O[le+2],b=d[Y>>>24]^a[T>>16&255]^l[N>>8&255]^s[z&255]^O[le+3],T=h,N=o,z=S,Y=b,le=le+4;h=A[T>>>24]<<24^A[N>>16&255]<<16^A[z>>8&255]<<8^A[Y&255]^O[le],o=A[N>>>24]<<24^A[z>>16&255]<<16^A[Y>>8&255]<<8^A[T&255]^O[le+1],S=A[z>>>24]<<24^A[Y>>16&255]<<16^A[T>>8&255]<<8^A[N&255]^O[le+2],b=A[Y>>>24]<<24^A[T>>16&255]<<16^A[N>>8&255]<<8^A[z&255]^O[le+3],g[y]=Oe(h^c),g[y+1]=Oe(b^m),g[y+2]=Oe(S^R),g[y+3]=Oe(o^E),c=te,m=G,R=F,E=re,y=y+4}return g.buffer},H}()},"./src/crypt/decrypter.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return y});var K=M("./src/crypt/aes-crypto.ts"),D=M("./src/crypt/fast-aes-key.ts"),P=M("./src/crypt/aes-decryptor.ts"),H=M("./src/utils/logger.ts"),W=M("./src/utils/mp4-tools.ts"),_=M("./src/utils/typed-array.ts"),L=16,y=function(){function C(O,A,x){var d=x===void 0?{}:x,a=d.removePKCS7Padding,l=a===void 0?!0:a;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=O,this.config=A,this.removePKCS7Padding=l,l)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var k=C.prototype;return k.destroy=function(){this.observer=null},k.isSync=function(){return this.config.enableSoftwareAES},k.flush=function(){var A=this.currentResult;if(!A){this.reset();return}var x=new Uint8Array(A);return this.reset(),this.removePKCS7Padding?Object(P.removePadding)(x):x},k.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},k.decrypt=function(A,x,d,a){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(A),x,d);var l=this.flush();l&&a(l.buffer)}else this.webCryptoDecrypt(new Uint8Array(A),x,d).then(a)},k.softwareDecrypt=function(A,x,d){var a=this.currentIV,l=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(A=Object(W.appendUint8Array)(s,A),this.remainderData=null);var v=this.getValidChunk(A);if(!v.length)return null;a&&(d=a);var c=this.softwareDecrypter;c||(c=this.softwareDecrypter=new P.default),c.expandKey(x);var m=l;return this.currentResult=c.decrypt(v.buffer,0,d),this.currentIV=Object(_.sliceUint8)(v,-16).buffer,m||null},k.webCryptoDecrypt=function(A,x,d){var a=this,l=this.subtle;return(this.key!==x||!this.fastAesKey)&&(this.key=x,this.fastAesKey=new D.default(l,x)),this.fastAesKey.expandKey().then(function(s){if(!l)return Promise.reject(new Error("web crypto not initialized"));var v=new K.default(l,d);return v.decrypt(A.buffer,s)}).catch(function(s){return a.onWebCryptoError(s,A,x,d)})},k.onWebCryptoError=function(A,x,d,a){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",A),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(x,d,a)},k.getValidChunk=function(A){var x=A,d=A.length-A.length%L;return d!==A.length&&(x=Object(_.sliceUint8)(A,0,d),this.remainderData=Object(_.sliceUint8)(A,d)),x},k.logOnce=function(A){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+A),this.logEnabled=!1},C}()},"./src/crypt/fast-aes-key.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return K});var K=function(){function D(H,W){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=W}var P=D.prototype;return P.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},D}()},"./src/demux/aacdemuxer.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/demux/base-audio-demuxer.ts"),D=M("./src/demux/adts.ts"),P=M("./src/utils/logger.ts"),H=M("./src/demux/id3.ts");function W(y,C){y.prototype=Object.create(C.prototype),y.prototype.constructor=y,_(y,C)}function _(y,C){return _=Object.setPrototypeOf||function(O,A){return O.__proto__=A,O},_(y,C)}var L=function(y){W(C,y);function C(O,A){var x;return x=y.call(this)||this,x.observer=void 0,x.config=void 0,x.observer=O,x.config=A,x}var k=C.prototype;return k.resetInitSegment=function(A,x,d){y.prototype.resetInitSegment.call(this,A,x,d),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:A,duration:d,inputTimeScale:9e4,dropped:0}},C.probe=function(A){if(!A)return!1;for(var x=H.getID3Data(A,0)||[],d=x.length,a=A.length;d<a;d++)if(D.probe(A,d))return P.logger.log("ADTS sync word found !"),!0;return!1},k.canParse=function(A,x){return D.canParse(A,x)},k.appendFrame=function(A,x,d){D.initTrackConfig(A,this.observer,x,d,A.manifestCodec);var a=D.appendFrame(A,x,d,this.initPTS,this.frameIndex);if(a&&a.missing===0)return a},C}(K.default);L.minProbeByteLength=9,X.default=L},"./src/demux/adts.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"getAudioConfig",function(){return H}),M.d(X,"isHeaderPattern",function(){return W}),M.d(X,"getHeaderLength",function(){return _}),M.d(X,"getFullFrameLength",function(){return L}),M.d(X,"canGetFrameLength",function(){return y}),M.d(X,"isHeader",function(){return C}),M.d(X,"canParse",function(){return k}),M.d(X,"probe",function(){return O}),M.d(X,"initTrackConfig",function(){return A}),M.d(X,"getFrameDuration",function(){return x}),M.d(X,"parseFrameHeader",function(){return d}),M.d(X,"appendFrame",function(){return a});var K=M("./src/utils/logger.ts"),D=M("./src/errors.ts"),P=M("./src/events.ts");function H(l,s,v,c){var m,R,E,f,g=navigator.userAgent.toLowerCase(),h=c,o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((s[v+2]&192)>>>6)+1;var S=(s[v+2]&60)>>>2;if(S>o.length-1){l.trigger(P.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+S});return}return E=(s[v+2]&1)<<2,E|=(s[v+3]&192)>>>6,K.logger.log("manifest codec:"+c+", ADTS type:"+m+", samplingIndex:"+S),/firefox/i.test(g)?S>=6?(m=5,f=new Array(4),R=S-3):(m=2,f=new Array(2),R=S):g.indexOf("android")!==-1?(m=2,f=new Array(2),R=S):(m=5,f=new Array(4),c&&(c.indexOf("mp4a.40.29")!==-1||c.indexOf("mp4a.40.5")!==-1)||!c&&S>=6?R=S-3:((c&&c.indexOf("mp4a.40.2")!==-1&&(S>=6&&E===1||/vivaldi/i.test(g))||!c&&E===1)&&(m=2,f=new Array(2)),R=S)),f[0]=m<<3,f[0]|=(S&14)>>1,f[1]|=(S&1)<<7,f[1]|=E<<3,m===5&&(f[1]|=(R&14)>>1,f[2]=(R&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:o[S],channelCount:E,codec:"mp4a.40."+m,manifestCodec:h}}function W(l,s){return l[s]===255&&(l[s+1]&246)===240}function _(l,s){return l[s+1]&1?7:9}function L(l,s){return(l[s+3]&3)<<11|l[s+4]<<3|(l[s+5]&224)>>>5}function y(l,s){return s+5<l.length}function C(l,s){return s+1<l.length&&W(l,s)}function k(l,s){return y(l,s)&&W(l,s)&&L(l,s)<=l.length-s}function O(l,s){if(C(l,s)){var v=_(l,s);if(s+v>=l.length)return!1;var c=L(l,s);if(c<=v)return!1;var m=s+c;return m===l.length||C(l,m)}return!1}function A(l,s,v,c,m){if(!l.samplerate){var R=H(s,v,c,m);if(!R)return;l.config=R.config,l.samplerate=R.samplerate,l.channelCount=R.channelCount,l.codec=R.codec,l.manifestCodec=R.manifestCodec,K.logger.log("parsed codec:"+l.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function x(l){return 1024*9e4/l}function d(l,s,v,c,m){var R=_(l,s),E=L(l,s);if(E-=R,E>0){var f=v+c*m;return{headerLength:R,frameLength:E,stamp:f}}}function a(l,s,v,c,m){var R=x(l.samplerate),E=d(s,v,c,m,R);if(E){var f=E.frameLength,g=E.headerLength,h=E.stamp,o=g+f,S=Math.max(0,v+o-s.length),b;S?(b=new Uint8Array(o-g),b.set(s.subarray(v+g,s.length),0)):b=s.subarray(v+g,v+o);var T={unit:b,pts:h};return S||l.samples.push(T),{sample:T,length:o,missing:S}}}},"./src/demux/base-audio-demuxer.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"initPTSFn",function(){return L});var K=M("./src/polyfills/number.ts"),D=M("./src/demux/id3.ts"),P=M("./src/demux/dummy-demuxed-track.ts"),H=M("./src/utils/mp4-tools.ts"),W=M("./src/utils/typed-array.ts"),_=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var C=y.prototype;return C.resetInitSegment=function(O,A,x){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},C.resetTimeStamp=function(){},C.resetContiguity=function(){},C.canParse=function(O,A){return!1},C.appendFrame=function(O,A,x){},C.demux=function(O,A){this.cachedData&&(O=Object(H.appendUint8Array)(this.cachedData,O),this.cachedData=null);var x=D.getID3Data(O,0),d=x?x.length:0,a,l,s=this._audioTrack,v=this._id3Track,c=x?D.getTimeStamp(x):void 0,m=O.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(c,A)),x&&x.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:x}),l=this.initPTS;d<m;){if(this.canParse(O,d)){var R=this.appendFrame(s,O,d);R?(this.frameIndex++,l=R.sample.pts,d+=R.length,a=d):d=m}else D.canParse(O,d)?(x=D.getID3Data(O,d),v.samples.push({pts:l,dts:l,data:x}),d+=x.length,a=d):d++;if(d===m&&a!==m){var E=Object(W.sliceUint8)(O,a);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,E):this.cachedData=E}}return{audioTrack:s,avcTrack:Object(P.dummyTrack)(),id3Track:v,textTrack:Object(P.dummyTrack)()}},C.demuxSampleAes=function(O,A,x){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},C.flush=function(O){var A=this.cachedData;return A&&(this.cachedData=null,this.demux(A,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(P.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(P.dummyTrack)()}},C.destroy=function(){},y}(),L=function(C,k){return Object(K.isFiniteNumber)(C)?C*90:k*9e4};X.default=_},"./src/demux/chunk-cache.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return K});var K=function(){function P(){this.chunks=[],this.dataLength=0}var H=P.prototype;return H.push=function(_){this.chunks.push(_),this.dataLength+=_.length},H.flush=function(){var _=this.chunks,L=this.dataLength,y;if(_.length)_.length===1?y=_[0]:y=D(_,L);else return new Uint8Array(0);return this.reset(),y},H.reset=function(){this.chunks.length=0,this.dataLength=0},P}();function D(P,H){for(var W=new Uint8Array(H),_=0,L=0;L<P.length;L++){var y=P[L];W.set(y,_),_+=y.length}return W}},"./src/demux/dummy-demuxed-track.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"dummyTrack",function(){return K});function K(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/utils/logger.ts"),D=function(){function P(W){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=W,this.bytesAvailable=W.byteLength,this.word=0,this.bitsAvailable=0}var H=P.prototype;return H.loadWord=function(){var _=this.data,L=this.bytesAvailable,y=_.byteLength-L,C=new Uint8Array(4),k=Math.min(4,L);if(k===0)throw new Error("no bytes available");C.set(_.subarray(y,y+k)),this.word=new DataView(C.buffer).getUint32(0),this.bitsAvailable=k*8,this.bytesAvailable-=k},H.skipBits=function(_){var L;this.bitsAvailable>_?(this.word<<=_,this.bitsAvailable-=_):(_-=this.bitsAvailable,L=_>>3,_-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=_,this.bitsAvailable-=_)},H.readBits=function(_){var L=Math.min(this.bitsAvailable,_),y=this.word>>>32-L;return _>32&&K.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=_-L,L>0&&this.bitsAvailable?y<<L|this.readBits(L):y},H.skipLZ=function(){var _;for(_=0;_<this.bitsAvailable;++_)if((this.word&2147483648>>>_)!==0)return this.word<<=_,this.bitsAvailable-=_,_;return this.loadWord(),_+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var _=this.skipLZ();return this.readBits(_+1)-1},H.readEG=function(){var _=this.readUEG();return 1&_?1+_>>>1:-1*(_>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(_){for(var L=8,y=8,C,k=0;k<_;k++)y!==0&&(C=this.readEG(),y=(L+C+256)%256),L=y===0?L:y},H.readSPS=function(){var _=0,L=0,y=0,C=0,k,O,A,x=this.readUByte.bind(this),d=this.readBits.bind(this),a=this.readUEG.bind(this),l=this.readBoolean.bind(this),s=this.skipBits.bind(this),v=this.skipEG.bind(this),c=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);x();var R=x();if(d(5),s(3),x(),c(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var E=a();if(E===3&&s(1),c(),c(),s(1),l())for(O=E!==3?8:12,A=0;A<O;A++)l()&&(A<6?m(16):m(64))}c();var f=a();if(f===0)a();else if(f===1)for(s(1),v(),v(),k=a(),A=0;A<k;A++)v();c(),s(1);var g=a(),h=a(),o=d(1);o===0&&s(1),s(1),l()&&(_=a(),L=a(),y=a(),C=a());var S=[1,1];if(l()&&l()){var b=x();switch(b){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:{S=[x()<<8|x(),x()<<8|x()];break}}}return{width:Math.ceil((g+1)*16-_*2-L*2),height:(2-o)*(h+1)*16-(o?2:4)*(y+C),pixelRatio:S}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},P}();X.default=D},"./src/demux/id3.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"isHeader",function(){return K}),M.d(X,"isFooter",function(){return D}),M.d(X,"getID3Data",function(){return P}),M.d(X,"canParse",function(){return W}),M.d(X,"getTimeStamp",function(){return _}),M.d(X,"isTimeStampFrame",function(){return L}),M.d(X,"getID3Frames",function(){return C}),M.d(X,"decodeFrame",function(){return k}),M.d(X,"utf8ArrayToStr",function(){return a}),M.d(X,"testables",function(){return l});var K=function(m,R){return R+10<=m.length&&(m[R]===73&&m[R+1]===68&&m[R+2]===51&&(m[R+3]<255&&m[R+4]<255&&(m[R+6]<128&&m[R+7]<128&&m[R+8]<128&&m[R+9]<128)))},D=function(m,R){return R+10<=m.length&&(m[R]===51&&m[R+1]===68&&m[R+2]===73&&(m[R+3]<255&&m[R+4]<255&&(m[R+6]<128&&m[R+7]<128&&m[R+8]<128&&m[R+9]<128)))},P=function(m,R){for(var E=R,f=0;K(m,R);){f+=10;var g=H(m,R+6);f+=g,D(m,R+10)&&(f+=10),R+=f}return f>0?m.subarray(E,E+f):void 0},H=function(m,R){var E=0;return E=(m[R]&127)<<21,E|=(m[R+1]&127)<<14,E|=(m[R+2]&127)<<7,E|=m[R+3]&127,E},W=function(m,R){return K(m,R)&&H(m,R+6)+10<=m.length-R},_=function(m){for(var R=C(m),E=0;E<R.length;E++){var f=R[E];if(L(f))return d(f)}return},L=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},y=function(m){var R=String.fromCharCode(m[0],m[1],m[2],m[3]),E=H(m,4),f=10;return{type:R,size:E,data:m.subarray(f,f+E)}},C=function(m){for(var R=0,E=[];K(m,R);){var f=H(m,R+6);R+=10;for(var g=R+f;R+8<g;){var h=y(m.subarray(R)),o=k(h);o&&E.push(o),R+=h.size+10}D(m,R)&&(R+=10)}return E},k=function(m){return m.type==="PRIV"?O(m):m.type[0]==="W"?x(m):A(m)},O=function(m){if(m.size<2)return;var R=a(m.data,!0),E=new Uint8Array(m.data.subarray(R.length+1));return{key:m.type,info:R,data:E.buffer}},A=function(m){if(m.size<2)return;if(m.type==="TXXX"){var R=1,E=a(m.data.subarray(R),!0);R+=E.length+1;var f=a(m.data.subarray(R));return{key:m.type,info:E,data:f}}var g=a(m.data.subarray(1));return{key:m.type,data:g}},x=function(m){if(m.type==="WXXX"){if(m.size<2)return;var R=1,E=a(m.data.subarray(R),!0);R+=E.length+1;var f=a(m.data.subarray(R));return{key:m.type,info:E,data:f}}var g=a(m.data);return{key:m.type,data:g}},d=function(m){if(m.data.byteLength===8){var R=new Uint8Array(m.data),E=R[3]&1,f=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return f/=45,E&&(f+=4772185884e-2),Math.round(f)}return},a=function(m,R){R===void 0&&(R=!1);var E=v();if(E){var f=E.decode(m);if(R){var g=f.indexOf("\0");return g!==-1?f.substring(0,g):f}return f.replace(/\0/g,"")}for(var h=m.length,o,S,b,T="",N=0;N<h;){if(o=m[N++],o===0&&R)return T;if(o===0||o===3)continue;switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:T+=String.fromCharCode(o);break;case 12:case 13:S=m[N++],T+=String.fromCharCode((o&31)<<6|S&63);break;case 14:S=m[N++],b=m[N++],T+=String.fromCharCode((o&15)<<12|(S&63)<<6|(b&63)<<0);break;default:}}return T},l={decodeTextFrame:A},s;function v(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/demux/base-audio-demuxer.ts"),D=M("./src/demux/id3.ts"),P=M("./src/utils/logger.ts"),H=M("./src/demux/mpegaudio.ts");function W(y,C){y.prototype=Object.create(C.prototype),y.prototype.constructor=y,_(y,C)}function _(y,C){return _=Object.setPrototypeOf||function(O,A){return O.__proto__=A,O},_(y,C)}var L=function(y){W(C,y);function C(){return y.apply(this,arguments)||this}var k=C.prototype;return k.resetInitSegment=function(A,x,d){y.prototype.resetInitSegment.call(this,A,x,d),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:A,duration:d,inputTimeScale:9e4,dropped:0}},C.probe=function(A){if(!A)return!1;for(var x=D.getID3Data(A,0)||[],d=x.length,a=A.length;d<a;d++)if(H.probe(A,d))return P.logger.log("MPEG Audio sync word found !"),!0;return!1},k.canParse=function(A,x){return H.canParse(A,x)},k.appendFrame=function(A,x,d){return this.initPTS===null?void 0:H.appendFrame(A,x,d,this.initPTS,this.frameIndex)},C}(K.default);L.minProbeByteLength=4,X.default=L},"./src/demux/mp4demuxer.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/utils/mp4-tools.ts"),D=M("./src/demux/dummy-demuxed-track.ts"),P=function(){function H(_,L){this.remainderData=null,this.config=void 0,this.config=L}var W=H.prototype;return W.resetTimeStamp=function(){},W.resetInitSegment=function(){},W.resetContiguity=function(){},H.probe=function(L){return Object(K.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},W.demux=function(L){var y=L,C=Object(D.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(K.appendUint8Array)(this.remainderData,L));var k=Object(K.segmentValidRange)(y);this.remainderData=k.remainder,C.samples=k.valid||new Uint8Array}else C.samples=y;return{audioTrack:Object(D.dummyTrack)(),avcTrack:C,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},W.flush=function(){var L=Object(D.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(D.dummyTrack)(),avcTrack:L,id3Track:Object(D.dummyTrack)(),textTrack:Object(D.dummyTrack)()}},W.demuxSampleAes=function(L,y,C){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},H}();P.minProbeByteLength=1024,X.default=P},"./src/demux/mpegaudio.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"appendFrame",function(){return _}),M.d(X,"parseHeader",function(){return L}),M.d(X,"isHeaderPattern",function(){return y}),M.d(X,"isHeader",function(){return C}),M.d(X,"canParse",function(){return k}),M.d(X,"probe",function(){return O});var K=null,D=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function _(A,x,d,a,l){if(d+24>x.length)return;var s=L(x,d);if(s&&d+s.frameLength<=x.length){var v=s.samplesPerFrame*9e4/s.sampleRate,c=a+l*v,m={unit:x.subarray(d,d+s.frameLength),pts:c,dts:c};return A.config=[],A.channelCount=s.channelCount,A.samplerate=s.sampleRate,A.samples.push(m),{sample:m,length:s.frameLength,missing:0}}}function L(A,x){var d=A[x+1]>>3&3,a=A[x+1]>>1&3,l=A[x+2]>>4&15,s=A[x+2]>>2&3;if(d!==1&&l!==0&&l!==15&&s!==3){var v=A[x+2]>>1&1,c=A[x+3]>>6,m=d===3?3-a:a===3?3:4,R=D[m*14+l-1]*1e3,E=d===3?0:d===2?1:2,f=P[E*3+s],g=c===3?1:2,h=H[d][a],o=W[a],S=h*8*o,b=Math.floor(h*R/f+v)*o;if(K===null){var T=navigator.userAgent||"",N=T.match(/Chrome\/(\d+)/i);K=N?parseInt(N[1]):0}var z=!!K&&K<=87;return z&&a===2&&R>=224e3&&c===0&&(A[x+3]=A[x+3]|128),{sampleRate:f,channelCount:g,frameLength:b,samplesPerFrame:S}}}function y(A,x){return A[x]===255&&(A[x+1]&224)===224&&(A[x+1]&6)!==0}function C(A,x){return x+1<A.length&&y(A,x)}function k(A,x){var d=4;return y(A,x)&&d<=A.length-x}function O(A,x){if(x+1<A.length&&y(A,x)){var d=4,a=L(A,x),l=d;a!=null&&a.frameLength&&(l=a.frameLength);var s=x+l;return s===A.length||C(A,s)}return!1}},"./src/demux/sample-aes.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/crypt/decrypter.ts"),D=M("./src/demux/tsdemuxer.ts"),P=function(){function H(_,L,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new K.default(_,L,{removePKCS7Padding:!1})}var W=H.prototype;return W.decryptBuffer=function(L,y){this.decrypter.decrypt(L,this.keyData.key.buffer,this.keyData.iv.buffer,y)},W.decryptAacSample=function(L,y,C,k){var O=L[y].unit,A=O.subarray(16,O.length-O.length%16),x=A.buffer.slice(A.byteOffset,A.byteOffset+A.length),d=this;this.decryptBuffer(x,function(a){var l=new Uint8Array(a);O.set(l,16),k||d.decryptAacSamples(L,y+1,C)})},W.decryptAacSamples=function(L,y,C){for(;;y++){if(y>=L.length){C();return}if(L[y].unit.length<32)continue;var k=this.decrypter.isSync();if(this.decryptAacSample(L,y,C,k),!k)return}},W.getAvcEncryptedData=function(L){for(var y=Math.floor((L.length-48)/160)*16+16,C=new Int8Array(y),k=0,O=32;O<=L.length-16;O+=160,k+=16)C.set(L.subarray(O,O+16),k);return C},W.getAvcDecryptedUnit=function(L,y){for(var C=new Uint8Array(y),k=0,O=32;O<=L.length-16;O+=160,k+=16)L.set(C.subarray(k,k+16),O);return L},W.decryptAvcSample=function(L,y,C,k,O,A){var x=Object(D.discardEPB)(O.data),d=this.getAvcEncryptedData(x),a=this;this.decryptBuffer(d.buffer,function(l){O.data=a.getAvcDecryptedUnit(x,l),A||a.decryptAvcSamples(L,y,C+1,k)})},W.decryptAvcSamples=function(L,y,C,k){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,C=0){if(y>=L.length){k();return}for(var O=L[y].units;!(C>=O.length);C++){var A=O[C];if(A.data.length<=48||A.type!==1&&A.type!==5)continue;var x=this.decrypter.isSync();if(this.decryptAvcSample(L,y,C,k,A,x),!x)return}}},H}();X.default=P},"./src/demux/transmuxer-interface.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return O});var K=M("./node_modules/webworkify-webpack/index.js"),D=M.n(K),P=M("./src/events.ts"),H=M("./src/demux/transmuxer.ts"),W=M("./src/utils/logger.ts"),_=M("./src/errors.ts"),L=M("./src/utils/mediasource-helper.ts"),y=M("./node_modules/eventemitter3/index.js"),C=M.n(y),k=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},O=function(){function A(d,a,l,s){var v=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=d,this.id=a,this.onTransmuxComplete=l,this.onFlush=s;var c=d.config,m=function(h,o){o=o||{},o.frag=v.frag,o.id=v.id,d.trigger(h,o)};this.observer=new y.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,m),this.observer.on(P.Events.ERROR,m);var R={mp4:k.isTypeSupported("video/mp4"),mpeg:k.isTypeSupported("audio/mpeg"),mp3:k.isTypeSupported('audio/mp4; codecs="mp3"')},E=navigator.vendor;if(c.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var f;try{f=this.worker=K("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.onerror=function(g){d.trigger(P.Events.ERROR,{type:_.ErrorTypes.OTHER_ERROR,details:_.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(g.message+" ("+g.filename+":"+g.lineno+")")})},f.postMessage({cmd:"init",typeSupported:R,vendor:E,id:a,config:JSON.stringify(c)})}catch(g){W.logger.warn("Error in worker:",g),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new H.default(this.observer,R,c,E,a),this.worker=null}}else this.transmuxer=new H.default(this.observer,R,c,E,a)}var x=A.prototype;return x.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var l=this.transmuxer;l&&(l.destroy(),this.transmuxer=null)}var s=this.observer;s&&s.removeAllListeners(),this.observer=null},x.push=function(a,l,s,v,c,m,R,E,f,g){var h=this;f.transmuxing.start=self.performance.now();var o=this.transmuxer,S=this.worker,b=m?m.start:c.start,T=c.decryptdata,N=this.frag,z=!(N&&c.cc===N.cc),Y=!(N&&f.level===N.level),te=N?f.sn-N.sn:-1,G=this.part?f.part-this.part.index:1,F=!Y&&(te===1||te===0&&G===1),re=self.performance.now();(Y||te||c.stats.parsing.start===0)&&(c.stats.parsing.start=re),m&&(G||!F)&&(m.stats.parsing.start=re);var le=new H.TransmuxState(z,F,E,Y,b);if(!F||z){W.logger.log("[transmuxer-interface, "+c.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+`
|
|
discontinuity: `+z+`
|
|
trackSwitch: `+Y+`
|
|
contiguous: `+F+`
|
|
accurateTimeOffset: `+E+`
|
|
timeOffset: `+b);var Ee=new H.TransmuxConfig(s,v,l,R,g);this.configureTransmuxer(Ee)}if(this.frag=c,this.part=m,S)S.postMessage({cmd:"demux",data:a,decryptdata:T,chunkMeta:f,state:le},a instanceof ArrayBuffer?[a]:[]);else if(o){var Oe=o.push(a,T,f,le);Object(H.isPromise)(Oe)?Oe.then(function(Ye){h.handleTransmuxComplete(Ye)}):this.handleTransmuxComplete(Oe)}},x.flush=function(a){var l=this;a.transmuxing.start=self.performance.now();var s=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:a});else if(s){var c=s.flush(a);Object(H.isPromise)(c)?c.then(function(m){l.handleFlushResult(m,a)}):this.handleFlushResult(c,a)}},x.handleFlushResult=function(a,l){var s=this;a.forEach(function(v){s.handleTransmuxComplete(v)}),this.onFlush(l)},x.onWorkerMessage=function(a){var l=a.data,s=this.hls;switch(l.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.id=this.id,s.trigger(l.event,l.data);break}}},x.configureTransmuxer=function(a){var l=this.worker,s=this.transmuxer;l?l.postMessage({cmd:"configure",config:a}):s&&s.configure(a)},x.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},A}()},"./src/demux/transmuxer-worker.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return _});var K=M("./src/demux/transmuxer.ts"),D=M("./src/events.ts"),P=M("./src/utils/logger.ts"),H=M("./node_modules/eventemitter3/index.js"),W=M.n(H);function _(O){var A=new H.EventEmitter,x=function(a,l){O.postMessage({event:a,data:l})};A.on(D.Events.FRAG_DECRYPTED,x),A.on(D.Events.ERROR,x),O.addEventListener("message",function(d){var a=d.data;switch(a.cmd){case"init":{var l=JSON.parse(a.config);O.transmuxer=new K.default(A,a.typeSupported,l,a.vendor,a.id),Object(P.enableLogs)(l.debug),x("init",null);break}case"configure":{O.transmuxer.configure(a.config);break}case"demux":{var s=O.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(K.isPromise)(s)?s.then(function(m){L(O,m)}):L(O,s);break}case"flush":{var v=a.chunkMeta,c=O.transmuxer.flush(v);Object(K.isPromise)(c)?c.then(function(m){C(O,m,v)}):C(O,c,v);break}default:break}})}function L(O,A){if(k(A.remuxResult))return;var x=[],d=A.remuxResult,a=d.audio,l=d.video;a&&y(x,a),l&&y(x,l),O.postMessage({event:"transmuxComplete",data:A},x)}function y(O,A){A.data1&&O.push(A.data1.buffer),A.data2&&O.push(A.data2.buffer)}function C(O,A,x){A.forEach(function(d){L(O,d)}),O.postMessage({event:"flush",data:x})}function k(O){return!O.audio&&!O.video&&!O.text&&!O.id3&&!O.initSegment}},"./src/demux/transmuxer.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return l}),M.d(X,"isPromise",function(){return c}),M.d(X,"TransmuxConfig",function(){return m}),M.d(X,"TransmuxState",function(){return R});var K=M("./src/events.ts"),D=M("./src/errors.ts"),P=M("./src/crypt/decrypter.ts"),H=M("./src/demux/aacdemuxer.ts"),W=M("./src/demux/mp4demuxer.ts"),_=M("./src/demux/tsdemuxer.ts"),L=M("./src/demux/mp3demuxer.ts"),y=M("./src/remux/mp4-remuxer.ts"),C=M("./src/remux/passthrough-remuxer.ts"),k=M("./src/demux/chunk-cache.ts"),O=M("./src/utils/mp4-tools.ts"),A=M("./src/utils/logger.ts"),x;try{x=self.performance.now.bind(self.performance)}catch(E){A.logger.debug("Unable to use Performance API on this environment"),x=self.Date.now}var d=[{demux:_.default,remux:y.default},{demux:W.default,remux:C.default},{demux:H.default,remux:y.default},{demux:L.default,remux:y.default}],a=1024;d.forEach(function(E){var f=E.demux;a=Math.max(a,f.minProbeByteLength)});var l=function(){function E(g,h,o,S,b){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 k.default,this.observer=g,this.typeSupported=h,this.config=o,this.vendor=S,this.id=b}var f=E.prototype;return f.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},f.push=function(h,o,S,b){var T=this,N=S.transmuxing;N.executeStart=x();var z=new Uint8Array(h),Y=this.cache,te=this.config,G=this.currentTransmuxState,F=this.transmuxConfig;b&&(this.currentTransmuxState=b);var re=s(z,o);if(re&&re.method==="AES-128"){var le=this.getDecrypter();if(te.enableSoftwareAES){var Ee=le.softwareDecrypt(z,re.key.buffer,re.iv.buffer);if(!Ee)return N.executeEnd=x(),v(S);z=new Uint8Array(Ee)}else return this.decryptionPromise=le.webCryptoDecrypt(z,re.key.buffer,re.iv.buffer).then(function(Ke){var ut=T.push(Ke,null,S);return T.decryptionPromise=null,ut}),this.decryptionPromise}var Oe=b||G,Ye=Oe.contiguous,Pe=Oe.discontinuity,Be=Oe.trackSwitch,Ue=Oe.accurateTimeOffset,Ne=Oe.timeOffset,Te=F.audioCodec,se=F.videoCodec,ze=F.defaultInitPts,xt=F.duration,ct=F.initSegmentData;if((Pe||Be)&&this.resetInitSegment(ct,Te,se,xt),Pe&&this.resetInitialTimestamp(ze),Ye||this.resetContiguity(),this.needsProbing(z,Pe,Be)){if(Y.dataLength){var ft=Y.flush();z=Object(O.appendUint8Array)(ft,z)}this.configureTransmuxer(z,F)}var Ct=this.transmux(z,re,Ne,Ue,S),He=this.currentTransmuxState;return He.contiguous=!0,He.discontinuity=!1,He.trackSwitch=!1,N.executeEnd=x(),Ct},f.flush=function(h){var o=this,S=h.transmuxing;S.executeStart=x();var b=this.decrypter,T=this.cache,N=this.currentTransmuxState,z=this.decryptionPromise;if(z)return z.then(function(){return o.flush(h)});var Y=[],te=N.timeOffset;if(b){var G=b.flush();G&&Y.push(this.push(G,null,h))}var F=T.dataLength;T.reset();var re=this.demuxer,le=this.remuxer;if(!re||!le)return F>=a&&this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),S.executeEnd=x(),[v(h)];var Ee=re.flush(te);return c(Ee)?Ee.then(function(Oe){return o.flushRemux(Y,Oe,h),Y}):(this.flushRemux(Y,Ee,h),Y)},f.flushRemux=function(h,o,S){var b=o.audioTrack,T=o.avcTrack,N=o.id3Track,z=o.textTrack,Y=this.currentTransmuxState,te=Y.accurateTimeOffset,G=Y.timeOffset;A.logger.log("[transmuxer.ts]: Flushed fragment "+S.sn+(S.part>-1?" p: "+S.part:"")+" of level "+S.level);var F=this.remuxer.remux(b,T,N,z,G,te,!0,this.id);h.push({remuxResult:F,chunkMeta:S}),S.transmuxing.executeEnd=x()},f.resetInitialTimestamp=function(h){var o=this.demuxer,S=this.remuxer;if(!o||!S)return;o.resetTimeStamp(h),S.resetTimeStamp(h)},f.resetContiguity=function(){var h=this.demuxer,o=this.remuxer;if(!h||!o)return;h.resetContiguity(),o.resetNextTimestamp()},f.resetInitSegment=function(h,o,S,b){var T=this.demuxer,N=this.remuxer;if(!T||!N)return;T.resetInitSegment(o,S,b),N.resetInitSegment(h,o,S)},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(h,o,S,b,T){var N;return o&&o.method==="SAMPLE-AES"?N=this.transmuxSampleAes(h,o,S,b,T):N=this.transmuxUnencrypted(h,S,b,T),N},f.transmuxUnencrypted=function(h,o,S,b){var T=this.demuxer.demux(h,o,!1,!this.config.progressive),N=T.audioTrack,z=T.avcTrack,Y=T.id3Track,te=T.textTrack,G=this.remuxer.remux(N,z,Y,te,o,S,!1,this.id);return{remuxResult:G,chunkMeta:b}},f.transmuxSampleAes=function(h,o,S,b,T){var N=this;return this.demuxer.demuxSampleAes(h,o,S).then(function(z){var Y=N.remuxer.remux(z.audioTrack,z.avcTrack,z.id3Track,z.textTrack,S,b,!1,N.id);return{remuxResult:Y,chunkMeta:T}})},f.configureTransmuxer=function(h,o){for(var S=this.config,b=this.observer,T=this.typeSupported,N=this.vendor,z=o.audioCodec,Y=o.defaultInitPts,te=o.duration,G=o.initSegmentData,F=o.videoCodec,re,le=0,Ee=d.length;le<Ee;le++)if(d[le].demux.probe(h)){re=d[le];break}re||(A.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),re={demux:W.default,remux:C.default});var Oe=this.demuxer,Ye=this.remuxer,Pe=re.remux,Be=re.demux;(!Ye||!(Ye instanceof Pe))&&(this.remuxer=new Pe(b,S,T,N)),(!Oe||!(Oe instanceof Be))&&(this.demuxer=new Be(b,S,T),this.probe=Be.probe),this.resetInitSegment(G,z,F,te),this.resetInitialTimestamp(Y)},f.needsProbing=function(h,o,S){return!this.demuxer||!this.remuxer||o||S},f.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new P.default(this.observer,this.config)),h},E}();function s(E,f){var g=null;return E.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(g=f),g}var v=function(f){return{remuxResult:{},chunkMeta:f}};function c(E){return"then"in E&&E.then instanceof Function}var m=function(f,g,h,o,S){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=g,this.initSegmentData=h,this.duration=o,this.defaultInitPts=S},R=function(f,g,h,o,S){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=f,this.contiguous=g,this.accurateTimeOffset=h,this.trackSwitch=o,this.timeOffset=S}},"./src/demux/tsdemuxer.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"discardEPB",function(){return v});var K=M("./src/demux/adts.ts"),D=M("./src/demux/mpegaudio.ts"),P=M("./src/demux/exp-golomb.ts"),H=M("./src/demux/id3.ts"),W=M("./src/demux/sample-aes.ts"),_=M("./src/events.ts"),L=M("./src/utils/mp4-tools.ts"),y=M("./src/utils/logger.ts"),C=M("./src/errors.ts"),k={video:1,audio:2,id3:3,text:4},O=function(){function c(R,E,f){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=R,this.config=E,this.typeSupported=f}c.probe=function(E){var f=c.syncOffset(E);return f<0?!1:(f&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},c.syncOffset=function(E){for(var f=Math.min(1e3,E.length-3*188),g=0;g<f;){if(E[g]===71&&E[g+188]===71&&E[g+2*188]===71)return g;g++}return-1},c.createTrack=function(E,f){return{container:E==="video"||E==="audio"?"video/mp2t":void 0,type:E,id:k[E],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:E==="audio"?f:void 0}};var m=c.prototype;return m.resetInitSegment=function(E,f,g){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=c.createTrack("video",g),this._audioTrack=c.createTrack("audio",g),this._id3Track=c.createTrack("id3",g),this._txtTrack=c.createTrack("text",g),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=E,this.videoCodec=f,this._duration=g},m.resetTimeStamp=function(){},m.resetContiguity=function(){var E=this._audioTrack,f=this._avcTrack,g=this._id3Track;E&&(E.pesData=null),f&&(f.pesData=null),g&&(g.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(E,f,g,h){g===void 0&&(g=!1),h===void 0&&(h=!1),g||(this.sampleAes=null);var o,S=this._avcTrack,b=this._audioTrack,T=this._id3Track,N=S.pid,z=S.pesData,Y=b.pid,te=T.pid,G=b.pesData,F=T.pesData,re=!1,le=this.pmtParsed,Ee=this._pmtId,Oe=E.length;if(this.remainderData&&(E=Object(L.appendUint8Array)(this.remainderData,E),Oe=E.length,this.remainderData=null),Oe<188&&!h)return this.remainderData=E,{audioTrack:b,avcTrack:S,id3Track:T,textTrack:this._txtTrack};var Ye=Math.max(0,c.syncOffset(E));Oe-=(Oe+Ye)%188,Oe<E.byteLength&&!h&&(this.remainderData=new Uint8Array(E.buffer,Oe,E.buffer.byteLength-Oe));for(var Pe=Ye;Pe<Oe;Pe+=188)if(E[Pe]===71){var Be=!!(E[Pe+1]&64),Ue=((E[Pe+1]&31)<<8)+E[Pe+2],Ne=(E[Pe+3]&48)>>4,Te=void 0;if(Ne>1){if(Te=Pe+5+E[Pe+4],Te===Pe+188)continue}else Te=Pe+4;switch(Ue){case N:Be&&(z&&(o=a(z))&&this.parseAVCPES(o,!1),z={data:[],size:0}),z&&(z.data.push(E.subarray(Te,Pe+188)),z.size+=Pe+188-Te);break;case Y:Be&&(G&&(o=a(G))&&(b.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),G={data:[],size:0}),G&&(G.data.push(E.subarray(Te,Pe+188)),G.size+=Pe+188-Te);break;case te:Be&&(F&&(o=a(F))&&this.parseID3PES(o),F={data:[],size:0}),F&&(F.data.push(E.subarray(Te,Pe+188)),F.size+=Pe+188-Te);break;case 0:Be&&(Te+=E[Te]+1),Ee=this._pmtId=x(E,Te);break;case Ee:{Be&&(Te+=E[Te]+1);var se=d(E,Te,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,g);N=se.avc,N>0&&(S.pid=N),Y=se.audio,Y>0&&(b.pid=Y,b.isAAC=se.isAAC),te=se.id3,te>0&&(T.pid=te),re&&!le&&(y.logger.log("reparse from beginning"),re=!1,Pe=Ye-188),le=this.pmtParsed=!0;break}case 17:case 8191:break;default:re=!0;break}}else this.observer.emit(_.Events.ERROR,_.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});S.pesData=z,b.pesData=G,T.pesData=F;var ze={audioTrack:b,avcTrack:S,id3Track:T,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(ze),ze},m.flush=function(){var E=this.remainderData;this.remainderData=null;var f;return E?f=this.demux(E,-1,!1,!0):f={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(f),this.sampleAes?this.decrypt(f,this.sampleAes):f},m.extractRemainingSamples=function(E){var f=E.audioTrack,g=E.avcTrack,h=E.id3Track,o=g.pesData,S=f.pesData,b=h.pesData,T;o&&(T=a(o))?(this.parseAVCPES(T,!0),g.pesData=null):g.pesData=o,S&&(T=a(S))?(f.isAAC?this.parseAACPES(T):this.parseMPEGPES(T),f.pesData=null):(S!=null&&S.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=S),b&&(T=a(b))?(this.parseID3PES(T),h.pesData=null):h.pesData=b},m.demuxSampleAes=function(E,f,g){var h=this.demux(E,g,!0,!this.config.progressive),o=this.sampleAes=new W.default(this.observer,this.config,f);return this.decrypt(h,o)},m.decrypt=function(E,f){return new Promise(function(g){var h=E.audioTrack,o=E.avcTrack;h.samples&&h.isAAC?f.decryptAacSamples(h.samples,0,function(){o.samples?f.decryptAvcSamples(o.samples,0,0,function(){g(E)}):g(E)}):o.samples&&f.decryptAvcSamples(o.samples,0,0,function(){g(E)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(E,f){var g=this,h=this._avcTrack,o=this.parseAVCNALu(E.data),S=!1,b=this.avcSample,T,N=!1;E.data=null,b&&o.length&&!h.audFound&&(l(b,h),b=this.avcSample=A(!1,E.pts,E.dts,"")),o.forEach(function(z){switch(z.type){case 1:{T=!0,b||(b=g.avcSample=A(!0,E.pts,E.dts,"")),S&&(b.debug+="NDR "),b.frame=!0;var Y=z.data;if(N&&Y.length>4){var te=new P.default(Y).readSliceType();(te===2||te===4||te===7||te===9)&&(b.key=!0)}break}case 5:T=!0,b||(b=g.avcSample=A(!0,E.pts,E.dts,"")),S&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{T=!0,S&&b&&(b.debug+="SEI ");var G=new P.default(v(z.data));G.readUByte();for(var F=0,re=0,le=!1,Ee=0;!le&&G.bytesAvailable>1;){F=0;do Ee=G.readUByte(),F+=Ee;while(Ee===255);re=0;do Ee=G.readUByte(),re+=Ee;while(Ee===255);if(F===4&&G.bytesAvailable!==0){le=!0;var Oe=G.readUByte();if(Oe===181){var Ye=G.readUShort();if(Ye===49){var Pe=G.readUInt();if(Pe===1195456820){var Be=G.readUByte();if(Be===3){for(var Ue=G.readUByte(),Ne=G.readUByte(),Te=31&Ue,se=[Ue,Ne],ze=0;ze<Te;ze++)se.push(G.readUByte()),se.push(G.readUByte()),se.push(G.readUByte());s(g._txtTrack.samples,{type:3,pts:E.pts,bytes:se})}}}}}else if(F===5&&G.bytesAvailable!==0){if(le=!0,re>16){for(var xt=[],ct=0;ct<16;ct++)xt.push(G.readUByte().toString(16)),(ct===3||ct===5||ct===7||ct===9)&&xt.push("-");for(var ft=re-16,Ct=new Uint8Array(ft),He=0;He<ft;He++)Ct[He]=G.readUByte();s(g._txtTrack.samples,{pts:E.pts,payloadType:F,uuid:xt.join(""),userData:Object(H.utf8ArrayToStr)(Ct),userDataBytes:Ct})}}else if(re<G.bytesAvailable)for(var Ke=0;Ke<re;Ke++)G.readUByte()}break}case 7:if(T=!0,N=!0,S&&b&&(b.debug+="SPS "),!h.sps){var ut=new P.default(z.data),vt=ut.readSPS();h.width=vt.width,h.height=vt.height,h.pixelRatio=vt.pixelRatio,h.sps=[z.data],h.duration=g._duration;for(var ht=z.data.subarray(1,4),et="avc1.",Ze=0;Ze<3;Ze++){var Tt=ht[Ze].toString(16);Tt.length<2&&(Tt="0"+Tt),et+=Tt}h.codec=et}break;case 8:T=!0,S&&b&&(b.debug+="PPS "),h.pps||(h.pps=[z.data]);break;case 9:T=!1,h.audFound=!0,b&&l(b,h),b=g.avcSample=A(!1,E.pts,E.dts,S?"AUD ":"");break;case 12:T=!1;break;default:T=!1,b&&(b.debug+="unknown NAL "+z.type+" ");break}if(b&&T){var bt=b.units;bt.push(z)}}),f&&b&&(l(b,h),this.avcSample=null)},m.getLastNalUnit=function(){var E,f=this.avcSample,g;if(!f||f.units.length===0){var h=this._avcTrack.samples;f=h[h.length-1]}if((E=f)!==null&&E!==void 0&&E.units){var o=f.units;g=o[o.length-1]}return g},m.parseAVCNALu=function(E){var f=E.byteLength,g=this._avcTrack,h=g.naluState||0,o=h,S=[],b=0,T,N,z,Y=-1,te=0;for(h===-1&&(Y=0,te=E[0]&31,h=0,b=1);b<f;){if(T=E[b++],!h){h=T?0:1;continue}if(h===1){h=T?0:2;continue}if(!T)h=3;else if(T===1){if(Y>=0){var G={data:E.subarray(Y,b-h-1),type:te};S.push(G)}else{var F=this.getLastNalUnit();if(F&&(o&&b<=4-o&&(F.state&&(F.data=F.data.subarray(0,F.data.byteLength-o))),N=b-h-1,N>0)){var re=new Uint8Array(F.data.byteLength+N);re.set(F.data,0),re.set(E.subarray(0,N),F.data.byteLength),F.data=re,F.state=0}}b<f?(z=E[b]&31,Y=b,te=z,h=0):h=-1}else h=0}if(Y>=0&&h>=0){var le={data:E.subarray(Y,f),type:te,state:h};S.push(le)}if(S.length===0){var Ee=this.getLastNalUnit();if(Ee){var Oe=new Uint8Array(Ee.data.byteLength+E.byteLength);Oe.set(Ee.data,0),Oe.set(E,Ee.data.byteLength),Ee.data=Oe}}return g.naluState=h,S},m.parseAACPES=function(E){var f=0,g=this._audioTrack,h=this.aacOverFlow,o=E.data;if(h){this.aacOverFlow=null;var S=h.sample.unit.byteLength,b=Math.min(h.missing,S),T=S-b;h.sample.unit.set(o.subarray(0,b),T),g.samples.push(h.sample),f=h.missing}var N,z;for(N=f,z=o.length;N<z-1&&!K.isHeader(o,N);N++);if(N!==f){var Y,te;if(N<z-1?(Y="AAC PES did not start with ADTS header,offset:"+N,te=!1):(Y="no ADTS header found in AAC PES",te=!0),y.logger.warn("parsing error:"+Y),this.observer.emit(_.Events.ERROR,_.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.FRAG_PARSING_ERROR,fatal:te,reason:Y}),te)return}K.initTrackConfig(g,this.observer,o,N,this.audioCodec);var G;if(E.pts!==void 0)G=E.pts;else if(h){var F=K.getFrameDuration(g.samplerate);G=h.sample.pts+F}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var re=0;N<z;)if(K.isHeader(o,N)){if(N+5<z){var le=K.appendFrame(g,o,N,G,re);if(le)if(le.missing)this.aacOverFlow=le;else{N+=le.length,re++;continue}}break}else N++},m.parseMPEGPES=function(E){var f=E.data,g=f.length,h=0,o=0,S=E.pts;if(S===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<g;)if(D.isHeader(f,o)){var b=D.appendFrame(this._audioTrack,f,o,S,h);if(b)o+=b.length,h++;else break}else o++},m.parseID3PES=function(E){if(E.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(E)},c}();O.minProbeByteLength=188;function A(c,m,R,E){return{key:c,frame:!1,pts:m,dts:R,units:[],debug:E,length:0}}function x(c,m){return(c[m+10]&31)<<8|c[m+11]}function d(c,m,R,E){var f={audio:-1,avc:-1,id3:-1,isAAC:!0},g=(c[m+1]&15)<<8|c[m+2],h=m+3+g-4,o=(c[m+10]&15)<<8|c[m+11];for(m+=12+o;m<h;){var S=(c[m+1]&31)<<8|c[m+2];switch(c[m]){case 207:if(!E){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:f.audio===-1&&(f.audio=S);break;case 21:f.id3===-1&&(f.id3=S);break;case 219:if(!E){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:f.avc===-1&&(f.avc=S);break;case 3:case 4:R?f.audio===-1&&(f.audio=S,f.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}m+=((c[m+3]&15)<<8|c[m+4])+5}return f}function a(c){var m=0,R,E,f,g,h,o=c.data;if(!c||c.size===0)return null;for(;o[0].length<19&&o.length>1;){var S=new Uint8Array(o[0].length+o[1].length);S.set(o[0]),S.set(o[1],o[0].length),o[0]=S,o.splice(1,1)}R=o[0];var b=(R[0]<<16)+(R[1]<<8)+R[2];if(b===1){if(E=(R[4]<<8)+R[5],E&&E>c.size-6)return null;var T=R[7];T&192&&(g=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,T&64?(h=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,g-h>60*9e4&&(y.logger.warn(Math.round((g-h)/9e4)+"s delta between PTS and DTS, align them"),g=h)):h=g),f=R[8];var N=f+9;if(c.size<=N)return null;c.size-=N;for(var z=new Uint8Array(c.size),Y=0,te=o.length;Y<te;Y++){R=o[Y];var G=R.byteLength;if(N)if(N>G){N-=G;continue}else R=R.subarray(N),G-=N,N=0;z.set(R,m),m+=G}return E&&(E-=f+3),{data:z,pts:g,dts:h,len:E}}return null}function l(c,m){if(c.units.length&&c.frame){if(c.pts===void 0){var R=m.samples,E=R.length;if(E){var f=R[E-1];c.pts=f.pts,c.dts=f.dts}else{m.dropped++;return}}m.samples.push(c)}c.debug.length&&y.logger.log(c.pts+"/"+c.dts+":"+c.debug)}function s(c,m){var R=c.length;if(R>0){if(m.pts>=c[R-1].pts)c.push(m);else for(var E=R-1;E>=0;E--)if(m.pts<c[E].pts){c.splice(E,0,m);break}}else c.push(m)}function v(c){for(var m=c.byteLength,R=[],E=1;E<m-2;)c[E]===0&&c[E+1]===0&&c[E+2]===3?(R.push(E+2),E+=2):E++;if(R.length===0)return c;var f=m-R.length,g=new Uint8Array(f),h=0;for(E=0;E<f;h++,E++)h===R[0]&&(h++,R.shift()),g[E]=c[h];return g}X.default=O},"./src/errors.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"ErrorTypes",function(){return K}),M.d(X,"ErrorDetails",function(){return D});var K;(function(P){P.NETWORK_ERROR="networkError",P.MEDIA_ERROR="mediaError",P.KEY_SYSTEM_ERROR="keySystemError",P.MUX_ERROR="muxError",P.OTHER_ERROR="otherError"})(K||(K={}));var D;(function(P){P.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",P.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",P.KEY_SYSTEM_NO_SESSION="keySystemNoSession",P.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",P.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",P.MANIFEST_LOAD_ERROR="manifestLoadError",P.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",P.MANIFEST_PARSING_ERROR="manifestParsingError",P.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",P.LEVEL_EMPTY_ERROR="levelEmptyError",P.LEVEL_LOAD_ERROR="levelLoadError",P.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",P.LEVEL_SWITCH_ERROR="levelSwitchError",P.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",P.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",P.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",P.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",P.FRAG_LOAD_ERROR="fragLoadError",P.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",P.FRAG_DECRYPT_ERROR="fragDecryptError",P.FRAG_PARSING_ERROR="fragParsingError",P.REMUX_ALLOC_ERROR="remuxAllocError",P.KEY_LOAD_ERROR="keyLoadError",P.KEY_LOAD_TIMEOUT="keyLoadTimeOut",P.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",P.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",P.BUFFER_APPEND_ERROR="bufferAppendError",P.BUFFER_APPENDING_ERROR="bufferAppendingError",P.BUFFER_STALLED_ERROR="bufferStalledError",P.BUFFER_FULL_ERROR="bufferFullError",P.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",P.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",P.INTERNAL_EXCEPTION="internalException",P.INTERNAL_ABORTED="aborted",P.UNKNOWN="unknown"})(D||(D={}))},"./src/events.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"Events",function(){return K});var K;(function(D){D.MEDIA_ATTACHING="hlsMediaAttaching",D.MEDIA_ATTACHED="hlsMediaAttached",D.MEDIA_DETACHING="hlsMediaDetaching",D.MEDIA_DETACHED="hlsMediaDetached",D.BUFFER_RESET="hlsBufferReset",D.BUFFER_CODECS="hlsBufferCodecs",D.BUFFER_CREATED="hlsBufferCreated",D.BUFFER_APPENDING="hlsBufferAppending",D.BUFFER_APPENDED="hlsBufferAppended",D.BUFFER_EOS="hlsBufferEos",D.BUFFER_FLUSHING="hlsBufferFlushing",D.BUFFER_FLUSHED="hlsBufferFlushed",D.MANIFEST_LOADING="hlsManifestLoading",D.MANIFEST_LOADED="hlsManifestLoaded",D.MANIFEST_PARSED="hlsManifestParsed",D.LEVEL_SWITCHING="hlsLevelSwitching",D.LEVEL_SWITCHED="hlsLevelSwitched",D.LEVEL_LOADING="hlsLevelLoading",D.LEVEL_LOADED="hlsLevelLoaded",D.LEVEL_UPDATED="hlsLevelUpdated",D.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",D.LEVELS_UPDATED="hlsLevelsUpdated",D.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",D.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",D.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",D.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",D.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",D.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",D.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",D.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",D.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",D.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",D.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",D.CUES_PARSED="hlsCuesParsed",D.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",D.INIT_PTS_FOUND="hlsInitPtsFound",D.FRAG_LOADING="hlsFragLoading",D.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",D.FRAG_LOADED="hlsFragLoaded",D.FRAG_DECRYPTED="hlsFragDecrypted",D.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",D.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",D.FRAG_PARSING_METADATA="hlsFragParsingMetadata",D.FRAG_PARSED="hlsFragParsed",D.FRAG_BUFFERED="hlsFragBuffered",D.FRAG_CHANGED="hlsFragChanged",D.FPS_DROP="hlsFpsDrop",D.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",D.ERROR="hlsError",D.DESTROYING="hlsDestroying",D.KEY_LOADING="hlsKeyLoading",D.KEY_LOADED="hlsKeyLoaded",D.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",D.BACK_BUFFER_REACHED="hlsBackBufferReached"})(K||(K={}))},"./src/hls.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return c});var K=M("./node_modules/url-toolkit/src/url-toolkit.js"),D=M.n(K),P=M("./src/loader/playlist-loader.ts"),H=M("./src/loader/key-loader.ts"),W=M("./src/controller/id3-track-controller.ts"),_=M("./src/controller/latency-controller.ts"),L=M("./src/controller/level-controller.ts"),y=M("./src/controller/fragment-tracker.ts"),C=M("./src/controller/stream-controller.ts"),k=M("./src/is-supported.ts"),O=M("./src/utils/logger.ts"),A=M("./src/config.ts"),x=M("./node_modules/eventemitter3/index.js"),d=M.n(x),a=M("./src/events.ts"),l=M("./src/errors.ts");function s(m,R){for(var E=0;E<R.length;E++){var f=R[E];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function v(m,R,E){return R&&s(m.prototype,R),E&&s(m,E),m}var c=function(){m.isSupported=function(){return Object(k.isSupported)()};function m(E){E===void 0&&(E={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new x.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var f=this.config=Object(A.mergeConfig)(m.DefaultConfig,E);this.userConfig=E,Object(O.enableLogs)(f.debug),this._autoLevelCapping=-1,f.progressive&&Object(A.enableStreamingMode)(f);var g=f.abrController,h=f.bufferController,o=f.capLevelController,S=f.fpsController,b=this.abrController=new g(this),T=this.bufferController=new h(this),N=this.capLevelController=new o(this),z=new S(this),Y=new P.default(this),te=new H.default(this),G=new W.default(this),F=this.levelController=new L.default(this),re=new y.FragmentTracker(this),le=this.streamController=new C.default(this,re);N.setStreamController(le),z.setStreamController(le);var Ee=[F,le];this.networkControllers=Ee;var Oe=[Y,te,b,T,N,z,G,re];this.audioTrackController=this.createController(f.audioTrackController,null,Ee),this.createController(f.audioStreamController,re,Ee),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,Ee),this.createController(f.subtitleStreamController,re,Ee),this.createController(f.timelineController,null,Oe),this.emeController=this.createController(f.emeController,null,Oe),this.cmcdController=this.createController(f.cmcdController,null,Oe),this.latencyController=this.createController(_.default,null,Oe),this.coreComponents=Oe}var R=m.prototype;return R.createController=function(f,g,h){if(f){var o=g?new f(this,g):new f(this);return h&&h.push(o),o}return null},R.on=function(f,g,h){h===void 0&&(h=this),this._emitter.on(f,g,h)},R.once=function(f,g,h){h===void 0&&(h=this),this._emitter.once(f,g,h)},R.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},R.off=function(f,g,h,o){h===void 0&&(h=this),this._emitter.off(f,g,h,o)},R.listeners=function(f){return this._emitter.listeners(f)},R.emit=function(f,g,h){return this._emitter.emit(f,g,h)},R.trigger=function(f,g){if(this.config.debug)return this.emit(f,f,g);try{return this.emit(f,f,g)}catch(h){O.logger.error("An internal error happened while handling event "+f+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(a.Events.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:h})}return!1},R.listenerCount=function(f){return this._emitter.listenerCount(f)},R.destroy=function(){O.logger.log("destroy"),this.trigger(a.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(f){return f.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(f){return f.destroy()}),this.coreComponents.length=0},R.attachMedia=function(f){O.logger.log("attachMedia"),this._media=f,this.trigger(a.Events.MEDIA_ATTACHING,{media:f})},R.detachMedia=function(){O.logger.log("detachMedia"),this.trigger(a.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(f){this.stopLoad();var g=this.media,h=this.url,o=this.url=K.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});O.logger.log("loadSource:"+o),g&&h&&h!==o&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(g)),this.trigger(a.Events.MANIFEST_LOADING,{url:f})},R.startLoad=function(f){f===void 0&&(f=-1),O.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(g){g.startLoad(f)})},R.stopLoad=function(){O.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},R.swapAudioCodec=function(){O.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){O.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},R.removeLevel=function(f,g){g===void 0&&(g=0),this.levelController.removeLevel(f,g)},v(m,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){O.logger.log("set currentLevel:"+f),this.loadLevel=f,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(f){O.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){O.logger.log("set loadLevel:"+f),this.levelController.manualLevel=f}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(f){this.levelController.nextLoadLevel=f}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(f){O.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){O.logger.log("set startLevel:"+f),f!==-1&&(f=Math.max(f,this.minAutoLevel)),this.levelController.startLevel=f}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(f){var g=!!f;g!==this.config.capLevelToPlayerSize&&(g?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=g)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(f){this._autoLevelCapping!==f&&(O.logger.log("set autoLevelCapping:"+f),this._autoLevelCapping=f)}},{key:"bandwidthEstimate",get:function(){var f=this.abrController.bwEstimator;return f?f.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var f=this.levels,g=this.config.minAutoBitrate;if(!f)return 0;for(var h=f.length,o=0;o<h;o++)if(f[o].maxBitrate>g)return o;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,g=this.autoLevelCapping,h;return g===-1&&f&&f.length?h=f.length-1:h=g,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var g=this.audioTrackController;g&&(g.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var g=this.subtitleTrackController;g&&(g.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var g=this.subtitleTrackController;g&&(g.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return a.Events}},{key:"ErrorTypes",get:function(){return l.ErrorTypes}},{key:"ErrorDetails",get:function(){return l.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:A.hlsDefaultConfig},set:function(f){m.defaultConfig=f}}]),m}();c.defaultConfig=void 0},"./src/is-supported.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"isSupported",function(){return P}),M.d(X,"changeTypeSupported",function(){return H});var K=M("./src/utils/mediasource-helper.ts");function D(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var W=Object(K.getMediaSource)();if(!W)return!1;var _=D(),L=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!_||_.prototype&&typeof _.prototype.appendBuffer=="function"&&typeof _.prototype.remove=="function";return!!L&&!!y}function H(){var W,_=D();return typeof(_==null||((W=_.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return O}),M.d(X,"LoadError",function(){return x});var K=M("./src/polyfills/number.ts"),D=M("./src/errors.ts");function P(d,a){d.prototype=Object.create(a.prototype),d.prototype.constructor=d,y(d,a)}function H(d){var a=typeof Map=="function"?new Map:void 0;return H=function(s){if(s===null||!L(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(s))return a.get(s);a.set(s,v)}function v(){return W(s,arguments,C(this).constructor)}return v.prototype=Object.create(s.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),y(v,s)},H(d)}function W(d,a,l){return _()?W=Reflect.construct:W=function(v,c,m){var R=[null];R.push.apply(R,c);var E=Function.bind.apply(v,R),f=new E;return m&&y(f,m.prototype),f},W.apply(null,arguments)}function _(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(d){return!1}}function L(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function y(d,a){return y=Object.setPrototypeOf||function(s,v){return s.__proto__=v,s},y(d,a)}function C(d){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},C(d)}var k=Math.pow(2,17),O=function(){function d(l){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=l}var a=d.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(s,v){var c=this,m=s.url;if(!m)return Promise.reject(new x({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var R=this.config,E=R.fLoader,f=R.loader;return new Promise(function(g,h){c.loader&&c.loader.destroy();var o=c.loader=s.loader=E?new E(R):new f(R),S=A(s),b={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:k};s.stats=o.stats,o.load(S,b,{onSuccess:function(N,z,Y,te){c.resetLoader(s,o),g({frag:s,part:null,payload:N.data,networkDetails:te})},onError:function(N,z,Y){c.resetLoader(s,o),h(new x({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:N,networkDetails:Y}))},onAbort:function(N,z,Y){c.resetLoader(s,o),h(new x({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:Y}))},onTimeout:function(N,z,Y){c.resetLoader(s,o),h(new x({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:Y}))},onProgress:function(N,z,Y,te){v&&v({frag:s,part:null,payload:Y,networkDetails:te})}})})},a.loadPart=function(s,v,c){var m=this;this.abort();var R=this.config,E=R.fLoader,f=R.loader;return new Promise(function(g,h){m.loader&&m.loader.destroy();var o=m.loader=s.loader=E?new E(R):new f(R),S=A(s,v),b={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:k};v.stats=o.stats,o.load(S,b,{onSuccess:function(N,z,Y,te){m.resetLoader(s,o),m.updateStatsFromPart(s,v);var G={frag:s,part:v,payload:N.data,networkDetails:te};c(G),g(G)},onError:function(N,z,Y){m.resetLoader(s,o),h(new x({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:v,response:N,networkDetails:Y}))},onAbort:function(N,z,Y){s.stats.aborted=v.stats.aborted,m.resetLoader(s,o),h(new x({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:v,networkDetails:Y}))},onTimeout:function(N,z,Y){m.resetLoader(s,o),h(new x({type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:v,networkDetails:Y}))}})})},a.updateStatsFromPart=function(s,v){var c=s.stats,m=v.stats,R=m.total;if(c.loaded+=m.loaded,R){var E=Math.round(s.duration/v.duration),f=Math.min(Math.round(c.loaded/R),E),g=E-f,h=g*Math.round(c.loaded/f);c.total=c.loaded+h}else c.total=Math.max(c.loaded,c.total);var o=c.loading,S=m.loading;o.start?o.first+=S.first-S.start:(o.start=S.start,o.first=S.first),o.end=S.end},a.resetLoader=function(s,v){s.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},d}();function A(d,a){a===void 0&&(a=null);var l=a||d,s={frag:d,part:a,responseType:"arraybuffer",url:l.url,headers:{},rangeStart:0,rangeEnd:0},v=l.byteRangeStartOffset,c=l.byteRangeEndOffset;return Object(K.isFiniteNumber)(v)&&Object(K.isFiniteNumber)(c)&&(s.rangeStart=v,s.rangeEnd=c),s}var x=function(d){P(a,d);function a(l){for(var s,v=arguments.length,c=new Array(v>1?v-1:0),m=1;m<v;m++)c[m-1]=arguments[m];return s=d.call.apply(d,[this].concat(c))||this,s.data=void 0,s.data=l,s}return a}(H(Error))},"./src/loader/fragment.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"ElementaryStreamTypes",function(){return O}),M.d(X,"BaseSegment",function(){return A}),M.d(X,"Fragment",function(){return x}),M.d(X,"Part",function(){return d});var K=M("./src/polyfills/number.ts"),D=M("./node_modules/url-toolkit/src/url-toolkit.js"),P=M.n(D),H=M("./src/utils/logger.ts"),W=M("./src/loader/level-key.ts"),_=M("./src/loader/load-stats.ts");function L(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,y(a,l)}function y(a,l){return y=Object.setPrototypeOf||function(v,c){return v.__proto__=c,v},y(a,l)}function C(a,l){for(var s=0;s<l.length;s++){var v=l[s];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(a,v.key,v)}}function k(a,l,s){return l&&C(a.prototype,l),s&&C(a,s),a}var O;(function(a){a.AUDIO="audio",a.VIDEO="video",a.AUDIOVIDEO="audiovideo"})(O||(O={}));var A=function(){function a(s){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[O.AUDIO]=null,v[O.VIDEO]=null,v[O.AUDIOVIDEO]=null,v),this.baseurl=s}var l=a.prototype;return l.setByteRange=function(v,c){var m=v.split("@",2),R=[];m.length===1?R[0]=c?c.byteRangeEndOffset:0:R[0]=parseInt(m[1]),R[1]=parseInt(m[0])+R[0],this._byteRange=R},k(a,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(D.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),a}(),x=function(a){L(l,a);function l(v,c){var m;return m=a.call(this,c)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkey=void 0,m.type=void 0,m.loader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new _.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.type=v,m}var s=l.prototype;return s.createInitializationVector=function(c){for(var m=new Uint8Array(16),R=12;R<16;R++)m[R]=c>>8*(15-R)&255;return m},s.setDecryptDataFromLevelKey=function(c,m){var R=c;return(c==null?void 0:c.method)==="AES-128"&&c.uri&&!c.iv&&(R=W.LevelKey.fromURI(c.uri),R.method=c.method,R.iv=this.createInitializationVector(m),R.keyFormat="identity"),R},s.setElementaryStreamInfo=function(c,m,R,E,f,g){g===void 0&&(g=!1);var h=this.elementaryStreams,o=h[c];if(!o){h[c]={startPTS:m,endPTS:R,startDTS:E,endDTS:f,partial:g};return}o.startPTS=Math.min(o.startPTS,m),o.endPTS=Math.max(o.endPTS,R),o.startDTS=Math.min(o.startDTS,E),o.endDTS=Math.max(o.endDTS,f)},s.clearElementaryStreamInfo=function(){var c=this.elementaryStreams;c[O.AUDIO]=null,c[O.VIDEO]=null,c[O.AUDIOVIDEO]=null},k(l,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var c=this.sn;typeof c!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),c=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,c)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(K.isFiniteNumber)(this.programDateTime))return null;var c=Object(K.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+c*1e3}},{key:"encrypted",get:function(){var c;return!!((c=this.decryptdata)!==null&&c!==void 0&&c.keyFormat&&this.decryptdata.uri)}}]),l}(A),d=function(a){L(l,a);function l(s,v,c,m,R){var E;E=a.call(this,c)||this,E.fragOffset=0,E.duration=0,E.gap=!1,E.independent=!1,E.relurl=void 0,E.fragment=void 0,E.index=void 0,E.stats=new _.LoadStats,E.duration=s.decimalFloatingPoint("DURATION"),E.gap=s.bool("GAP"),E.independent=s.bool("INDEPENDENT"),E.relurl=s.enumeratedString("URI"),E.fragment=v,E.index=m;var f=s.enumeratedString("BYTERANGE");return f&&E.setByteRange(f,R),R&&(E.fragOffset=R.fragOffset+R.duration),E}return k(l,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),l}(A)},"./src/loader/key-loader.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return H});var K=M("./src/events.ts"),D=M("./src/errors.ts"),P=M("./src/utils/logger.ts"),H=function(){function W(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var _=W.prototype;return _._registerListeners=function(){this.hls.on(K.Events.KEY_LOADING,this.onKeyLoading,this)},_._unregisterListeners=function(){this.hls.off(K.Events.KEY_LOADING,this.onKeyLoading)},_.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var C=this.loaders[y];C&&C.destroy()}this.loaders={}},_.onKeyLoading=function(y,C){var k=C.frag,O=k.type,A=this.loaders[O];if(!k.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var x=k.decryptdata.uri;if(x!==this.decrypturl||this.decryptkey===null){var d=this.hls.config;if(A&&(P.logger.warn("abort previous key loader for type:"+O),A.abort()),!x){P.logger.warn("key uri is falsy");return}var a=d.loader,l=k.loader=this.loaders[O]=new a(d);this.decrypturl=x,this.decryptkey=null;var s={url:x,frag:k,responseType:"arraybuffer"},v={timeout:d.fragLoadingTimeOut,maxRetry:0,retryDelay:d.fragLoadingRetryDelay,maxRetryDelay:d.fragLoadingMaxRetryTimeout,highWaterMark:0},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};l.load(s,v,c)}else this.decryptkey&&(k.decryptdata.key=this.decryptkey,this.hls.trigger(K.Events.KEY_LOADED,{frag:k}))},_.loadsuccess=function(y,C,k){var O=k.frag;if(!O.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=O.decryptdata.key=new Uint8Array(y.data),O.loader=null,delete this.loaders[O.type],this.hls.trigger(K.Events.KEY_LOADED,{frag:O})},_.loaderror=function(y,C){var k=C.frag,O=k.loader;O&&O.abort(),delete this.loaders[k.type],this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:k,response:y})},_.loadtimeout=function(y,C){var k=C.frag,O=k.loader;O&&O.abort(),delete this.loaders[k.type],this.hls.trigger(K.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:k})},W}()},"./src/loader/level-details.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"LevelDetails",function(){return W});var K=M("./src/polyfills/number.ts");function D(_,L){for(var y=0;y<L.length;y++){var C=L[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}function P(_,L,y){return L&&D(_.prototype,L),y&&D(_,y),_}var H=10,W=function(){function _(y){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=y}var L=_.prototype;return L.reloaded=function(C){if(!C){this.advanced=!0,this.updated=!0;return}var k=this.lastPartSn-C.lastPartSn,O=this.lastPartIndex-C.lastPartIndex;this.updated=this.endSN!==C.endSN||!!O||!!k,this.advanced=this.endSN>C.endSN||k>0||k===0&&O>0,this.updated||this.advanced?this.misses=Math.floor(C.misses*.6):this.misses=C.misses+1,this.availabilityDelay=C.availabilityDelay},P(_,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(K.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var C=this.driftEndTime-this.driftStartTime;if(C>0){var k=this.driftEnd-this.driftStart;return k*1e3/C}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var C;return(C=this.fragments)!==null&&C!==void 0&&C.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 C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var C;return(C=this.partList)!==null&&C!==void 0&&C.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),_}()},"./src/loader/level-key.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"LevelKey",function(){return W});var K=M("./node_modules/url-toolkit/src/url-toolkit.js"),D=M.n(K);function P(_,L){for(var y=0;y<L.length;y++){var C=L[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}function H(_,L,y){return L&&P(_.prototype,L),y&&P(_,y),_}var W=function(){_.fromURL=function(y,C){return new _(y,C)},_.fromURI=function(y){return new _(y)};function _(L,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object(K.buildAbsoluteURL)(L,y,{alwaysNormalize:!0}):this._uri=L}return H(_,[{key:"uri",get:function(){return this._uri}}]),_}()},"./src/loader/load-stats.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"LoadStats",function(){return K});var K=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return l});var K=M("./src/polyfills/number.ts"),D=M("./node_modules/url-toolkit/src/url-toolkit.js"),P=M.n(D),H=M("./src/loader/fragment.ts"),W=M("./src/loader/level-details.ts"),_=M("./src/loader/level-key.ts"),L=M("./src/utils/attr-list.ts"),y=M("./src/utils/logger.ts"),C=M("./src/utils/codecs.ts"),k=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,O=/#EXT-X-MEDIA:(.*)/g,A=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),x=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),d=/\.(mp4|m4s|m4v|m4a)$/i;function a(R){var E,f;return d.test((E=(f=D.parseURL(R))===null||f===void 0?void 0:f.path)!=null?E:"")}var l=function(){function R(){}return R.findGroup=function(f,g){for(var h=0;h<f.length;h++){var o=f[h];if(o.id===g)return o}},R.convertAVC1ToAVCOTI=function(f){var g=f.split(".");if(g.length>2){var h=g.shift()+".";return h+=parseInt(g.shift()).toString(16),h+=("000"+parseInt(g.shift()).toString(16)).substr(-4),h}return f},R.resolve=function(f,g){return D.buildAbsoluteURL(g,f,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(f,g){var h=[],o={},S=!1;k.lastIndex=0;for(var b;(b=k.exec(f))!=null;)if(b[1]){var T=new L.AttrList(b[1]),N={attrs:T,bitrate:T.decimalInteger("AVERAGE-BANDWIDTH")||T.decimalInteger("BANDWIDTH"),name:T.NAME,url:R.resolve(b[2],g)},z=T.decimalResolution("RESOLUTION");z&&(N.width=z.width,N.height=z.height),s((T.CODECS||"").split(/[ ,]+/).filter(function(te){return te}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=R.convertAVC1ToAVCOTI(N.videoCodec)),h.push(N)}else if(b[3]){var Y=new L.AttrList(b[3]);Y["DATA-ID"]&&(S=!0,o[Y["DATA-ID"]]=Y)}return{levels:h,sessionData:S?o:null}},R.parseMasterPlaylistMedia=function(f,g,h,o){o===void 0&&(o=[]);var S,b=[],T=0;for(O.lastIndex=0;(S=O.exec(f))!==null;){var N=new L.AttrList(S[1]);if(N.TYPE===h){var z={attrs:N,bitrate:0,id:T++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:h,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?R.resolve(N.URI,g):""};if(o.length){var Y=R.findGroup(o,z.groupId)||o[0];v(z,Y,"audioCodec"),v(z,Y,"textCodec")}b.push(z)}}return b},R.parseLevelPlaylist=function(f,g,h,o,S){var b=new W.LevelDetails(g),T=b.fragments,N=null,z=0,Y=0,te=0,G=0,F=null,re=new H.Fragment(o,g),le,Ee,Oe,Ye=-1,Pe=!1;for(A.lastIndex=0,b.m3u8=f;(le=A.exec(f))!==null;){Pe&&(Pe=!1,re=new H.Fragment(o,g),re.start=te,re.sn=z,re.cc=G,re.level=h,N&&(re.initSegment=N,re.rawProgramDateTime=N.rawProgramDateTime));var Be=le[1];if(Be){re.duration=parseFloat(Be);var Ue=(" "+le[2]).slice(1);re.title=Ue||null,re.tagList.push(Ue?["INF",Be,Ue]:["INF",Be])}else if(le[3])Object(K.isFiniteNumber)(re.duration)&&(re.start=te,Oe&&(re.levelkey=Oe),re.sn=z,re.level=h,re.cc=G,re.urlId=S,T.push(re),re.relurl=(" "+le[3]).slice(1),m(re,F),F=re,te+=re.duration,z++,Y=0,Pe=!0);else if(le[4]){var Ne=(" "+le[4]).slice(1);F?re.setByteRange(Ne,F):re.setByteRange(Ne)}else if(le[5])re.rawProgramDateTime=(" "+le[5]).slice(1),re.tagList.push(["PROGRAM-DATE-TIME",re.rawProgramDateTime]),Ye===-1&&(Ye=T.length);else{if(le=le[0].match(x),!le){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(Ee=1;Ee<le.length&&!(typeof le[Ee]!="undefined");Ee++);var Te=(" "+le[Ee]).slice(1),se=(" "+le[Ee+1]).slice(1),ze=le[Ee+2]?(" "+le[Ee+2]).slice(1):"";switch(Te){case"PLAYLIST-TYPE":b.type=se.toUpperCase();break;case"MEDIA-SEQUENCE":z=b.startSN=parseInt(se);break;case"SKIP":{var xt=new L.AttrList(se),ct=xt.decimalInteger("SKIPPED-SEGMENTS");if(Object(K.isFiniteNumber)(ct)){b.skippedSegments=ct;for(var ft=ct;ft--;)T.unshift(null);z+=ct}var Ct=xt.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ct&&(b.recentlyRemovedDateranges=Ct.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat(se);break;case"VERSION":b.version=parseInt(se);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":(se||ze)&&re.tagList.push(ze?[se,ze]:[se]);break;case"DIS":G++;case"GAP":re.tagList.push([Te]);break;case"BITRATE":re.tagList.push([Te,se]);break;case"DISCONTINUITY-SEQ":G=parseInt(se);break;case"KEY":{var He,Ke=new L.AttrList(se),ut=Ke.enumeratedString("METHOD"),vt=Ke.URI,ht=Ke.hexadecimalInteger("IV"),et=Ke.enumeratedString("KEYFORMATVERSIONS"),Ze=Ke.enumeratedString("KEYID"),Tt=(He=Ke.enumeratedString("KEYFORMAT"))!=null?He:"identity",bt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(bt.indexOf(Tt)>-1){y.logger.warn("Keyformat "+Tt+" is not supported from the manifest");continue}else if(Tt!=="identity")continue;ut&&(Oe=_.LevelKey.fromURL(g,vt),vt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ut)>=0&&(Oe.method=ut,Oe.keyFormat=Tt,Ze&&(Oe.keyID=Ze),et&&(Oe.keyFormatVersions=et),Oe.iv=ht));break}case"START":{var St=new L.AttrList(se),lt=St.decimalFloatingPoint("TIME-OFFSET");Object(K.isFiniteNumber)(lt)&&(b.startTimeOffset=lt);break}case"MAP":{var yt=new L.AttrList(se);re.relurl=yt.URI,yt.BYTERANGE&&re.setByteRange(yt.BYTERANGE),re.level=h,re.sn="initSegment",Oe&&(re.levelkey=Oe),re.initSegment=null,N=re,Pe=!0;break}case"SERVER-CONTROL":{var dt=new L.AttrList(se);b.canBlockReload=dt.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=dt.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&dt.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=dt.optionalFloat("PART-HOLD-BACK",0),b.holdBack=dt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Qe=new L.AttrList(se);b.partTarget=Qe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ie=b.partList;Ie||(Ie=b.partList=[]);var Et=Y>0?Ie[Ie.length-1]:void 0,$e=Y++,_e=new H.Part(new L.AttrList(se),re,g,$e,Et);Ie.push(_e),re.duration+=_e.duration;break}case"PRELOAD-HINT":{var Je=new L.AttrList(se);b.preloadHint=Je;break}case"RENDITION-REPORT":{var Se=new L.AttrList(se);b.renditionReports=b.renditionReports||[],b.renditionReports.push(Se);break}default:y.logger.warn("line parsed but not handled: "+le);break}}}F&&!F.relurl?(T.pop(),te-=F.duration,b.partList&&(b.fragmentHint=F)):b.partList&&(m(re,F),re.cc=G,b.fragmentHint=re);var me=T.length,ve=T[0],ne=T[me-1];if(te+=b.skippedSegments*b.targetduration,te>0&&me&&ne){b.averagetargetduration=te/me;var ie=ne.sn;b.endSN=ie!=="initSegment"?ie:0,ve&&(b.startCC=ve.cc,ve.initSegment||b.fragments.every(function(de){return de.relurl&&a(de.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),re=new H.Fragment(o,g),re.relurl=ne.relurl,re.level=h,re.sn="initSegment",ve.initSegment=re,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(te+=b.fragmentHint.duration),b.totalduration=te,b.endCC=G,Ye>0&&c(T,Ye),b},R}();function s(R,E){["video","audio","text"].forEach(function(f){var g=R.filter(function(o){return Object(C.isCodecType)(o,f)});if(g.length){var h=g.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});E[f+"Codec"]=h.length>0?h[0]:g[0],R=R.filter(function(o){return g.indexOf(o)===-1})}}),E.unknownCodecs=R}function v(R,E,f){var g=E[f];g&&(R[f]=g)}function c(R,E){for(var f=R[E],g=E;g--;){var h=R[g];if(!h)return;h.programDateTime=f.programDateTime-h.duration*1e3,f=h}}function m(R,E){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):E!=null&&E.programDateTime&&(R.programDateTime=E.endProgramDateTime),Object(K.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/polyfills/number.ts"),D=M("./src/events.ts"),P=M("./src/errors.ts"),H=M("./src/utils/logger.ts"),W=M("./src/utils/mp4-tools.ts"),_=M("./src/loader/m3u8-parser.ts"),L=M("./src/types/loader.ts"),y=M("./src/utils/attr-list.ts");function C(A){var x=A.type;switch(x){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function k(A,x){var d=A.url;return(d===void 0||d.indexOf("data:")===0)&&(d=x.url),d}var O=function(){function A(d){this.hls=void 0,this.loaders=Object.create(null),this.hls=d,this.registerListeners()}var x=A.prototype;return x.registerListeners=function(){var a=this.hls;a.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},x.unregisterListeners=function(){var a=this.hls;a.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(D.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(D.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(D.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},x.createInternalLoader=function(a){var l=this.hls.config,s=l.pLoader,v=l.loader,c=s||v,m=new c(l);return a.loader=m,this.loaders[a.type]=m,m},x.getInternalLoader=function(a){return this.loaders[a.type]},x.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},x.destroyInternalLoaders=function(){for(var a in this.loaders){var l=this.loaders[a];l&&l.destroy(),this.resetInternalLoader(a)}},x.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},x.onManifestLoading=function(a,l){var s=l.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},x.onLevelLoading=function(a,l){var s=l.id,v=l.level,c=l.url,m=l.deliveryDirectives;this.load({id:s,groupId:null,level:v,responseType:"text",type:L.PlaylistContextType.LEVEL,url:c,deliveryDirectives:m})},x.onAudioTrackLoading=function(a,l){var s=l.id,v=l.groupId,c=l.url,m=l.deliveryDirectives;this.load({id:s,groupId:v,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:c,deliveryDirectives:m})},x.onSubtitleTrackLoading=function(a,l){var s=l.id,v=l.groupId,c=l.url,m=l.deliveryDirectives;this.load({id:s,groupId:v,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:c,deliveryDirectives:m})},x.load=function(a){var l,s=this.hls.config,v=this.getInternalLoader(a);if(v){var c=v.context;if(c&&c.url===a.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),v.abort()}var m,R,E,f;switch(a.type){case L.PlaylistContextType.MANIFEST:m=s.manifestLoadingMaxRetry,R=s.manifestLoadingTimeOut,E=s.manifestLoadingRetryDelay,f=s.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:m=0,R=s.levelLoadingTimeOut;break;default:m=s.levelLoadingMaxRetry,R=s.levelLoadingTimeOut,E=s.levelLoadingRetryDelay,f=s.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(a),(l=a.deliveryDirectives)!==null&&l!==void 0&&l.part){var g;if(a.type===L.PlaylistContextType.LEVEL&&a.level!==null?g=this.hls.levels[a.level].details:a.type===L.PlaylistContextType.AUDIO_TRACK&&a.id!==null?g=this.hls.audioTracks[a.id].details:a.type===L.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(g=this.hls.subtitleTracks[a.id].details),g){var h=g.partTarget,o=g.targetduration;h&&o&&(R=Math.min(Math.max(h*3,o*.8)*1e3,R))}}var S={timeout:R,maxRetry:m,retryDelay:E,maxRetryDelay:f,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(a,S,b)},x.loadsuccess=function(a,l,s,v){if(v===void 0&&(v=null),s.isSidxRequest){this.handleSidxRequest(a,s),this.handlePlaylistLoaded(a,l,s,v);return}this.resetInternalLoader(s.type);var c=a.data;if(c.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,s,"no EXTM3U delimiter",v);return}l.parsing.start=performance.now(),c.indexOf("#EXTINF:")>0||c.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,l,s,v):this.handleMasterPlaylist(a,l,s,v)},x.loaderror=function(a,l,s){s===void 0&&(s=null),this.handleNetworkError(l,s,!1,a)},x.loadtimeout=function(a,l,s){s===void 0&&(s=null),this.handleNetworkError(l,s,!0)},x.handleMasterPlaylist=function(a,l,s,v){var c=this.hls,m=a.data,R=k(a,s),E=_.default.parseMasterPlaylist(m,R),f=E.levels,g=E.sessionData;if(!f.length){this.handleManifestParsingError(a,s,"no level found in manifest",v);return}var h=f.map(function(z){return{id:z.attrs.AUDIO,audioCodec:z.audioCodec}}),o=f.map(function(z){return{id:z.attrs.SUBTITLES,textCodec:z.textCodec}}),S=_.default.parseMasterPlaylistMedia(m,R,"AUDIO",h),b=_.default.parseMasterPlaylistMedia(m,R,"SUBTITLES",o),T=_.default.parseMasterPlaylistMedia(m,R,"CLOSED-CAPTIONS");if(S.length){var N=S.some(function(z){return!z.url});!N&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),S.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}c.trigger(D.Events.MANIFEST_LOADED,{levels:f,audioTracks:S,subtitles:b,captions:T,url:R,stats:l,networkDetails:v,sessionData:g})},x.handleTrackOrLevelPlaylist=function(a,l,s,v){var c=this.hls,m=s.id,R=s.level,E=s.type,f=k(a,s),g=Object(K.isFiniteNumber)(m)?m:0,h=Object(K.isFiniteNumber)(R)?R:g,o=C(s),S=_.default.parseLevelPlaylist(a.data,f,h,o,g);if(!S.fragments.length){c.trigger(D.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:f,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(E===L.PlaylistContextType.MANIFEST){var b={attrs:new y.AttrList({}),bitrate:0,details:S,name:"",url:f};c.trigger(D.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:f,stats:l,networkDetails:v,sessionData:null})}if(l.parsing.end=performance.now(),S.needSidxRanges){var T,N=(T=S.fragments[0].initSegment)===null||T===void 0?void 0:T.url;this.load({url:N,isSidxRequest:!0,type:E,level:R,levelDetails:S,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=S,this.handlePlaylistLoaded(a,l,s,v)},x.handleSidxRequest=function(a,l){var s=Object(W.parseSegmentIndex)(new Uint8Array(a.data));if(!s)return;var v=s.references,c=l.levelDetails;v.forEach(function(m,R){var E=m.info,f=c.fragments[R];f.byteRange.length===0&&f.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),f.initSegment&&f.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},x.handleManifestParsingError=function(a,l,s,v){this.hls.trigger(D.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:l.type===L.PlaylistContextType.MANIFEST,url:a.url,reason:s,response:a,context:l,networkDetails:v})},x.handleNetworkError=function(a,l,s,v){s===void 0&&(s=!1),H.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var c=P.ErrorDetails.UNKNOWN,m=!1,R=this.getInternalLoader(a);switch(a.type){case L.PlaylistContextType.MANIFEST:c=s?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case L.PlaylistContextType.LEVEL:c=s?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case L.PlaylistContextType.AUDIO_TRACK:c=s?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:c=s?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}R&&this.resetInternalLoader(a.type);var E={type:P.ErrorTypes.NETWORK_ERROR,details:c,fatal:m,url:a.url,loader:R,context:a,networkDetails:l};v&&(E.response=v),this.hls.trigger(D.Events.ERROR,E)},x.handlePlaylistLoaded=function(a,l,s,v){var c=s.type,m=s.level,R=s.id,E=s.groupId,f=s.loader,g=s.levelDetails,h=s.deliveryDirectives;if(!(g!=null&&g.targetduration)){this.handleManifestParsingError(a,s,"invalid target duration",v);return}if(!f)return;g.live&&(f.getCacheAge&&(g.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(g.ageHeader))&&(g.ageHeader=0));switch(c){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(D.Events.LEVEL_LOADED,{details:g,level:m||0,id:R||0,stats:l,networkDetails:v,deliveryDirectives:h});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(D.Events.AUDIO_TRACK_LOADED,{details:g,id:R||0,groupId:E||"",stats:l,networkDetails:v,deliveryDirectives:h});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(D.Events.SUBTITLE_TRACK_LOADED,{details:g,id:R||0,groupId:E||"",stats:l,networkDetails:v,deliveryDirectives:h});break}},A}();X.default=O},"./src/polyfills/number.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"isFiniteNumber",function(){return K}),M.d(X,"MAX_SAFE_INTEGER",function(){return D});var K=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},D=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ae,X,M){"use strict";M.r(X);var K=function(){function D(){}return D.getSilentFrame=function(H,W){switch(H){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(W===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(W===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(W===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},D}();X.default=K},"./src/remux/mp4-generator.ts":function(ae,X,M){"use strict";M.r(X);var K=Math.pow(2,32)-1,D=function(){function P(){}return P.init=function(){P.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var W;for(W in P.types)P.types.hasOwnProperty(W)&&(P.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var _=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]),L=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]);P.HDLR_TYPES={video:_,audio:L};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=C,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var k=new Uint8Array([105,115,111,109]),O=new Uint8Array([97,118,99,49]),A=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,k,A,k,O),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,y))},P.box=function(W){for(var _=8,L=arguments.length,y=new Array(L>1?L-1:0),C=1;C<L;C++)y[C-1]=arguments[C];for(var k=y.length,O=k;k--;)_+=y[k].byteLength;var A=new Uint8Array(_);for(A[0]=_>>24&255,A[1]=_>>16&255,A[2]=_>>8&255,A[3]=_&255,A.set(W,4),k=0,_=8;k<O;k++)A.set(y[k],_),_+=y[k].byteLength;return A},P.hdlr=function(W){return P.box(P.types.hdlr,P.HDLR_TYPES[W])},P.mdat=function(W){return P.box(P.types.mdat,W)},P.mdhd=function(W,_){_*=W;var L=Math.floor(_/(K+1)),y=Math.floor(_%(K+1));return P.box(P.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,L>>24,L>>16&255,L>>8&255,L&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},P.mdia=function(W){return P.box(P.types.mdia,P.mdhd(W.timescale,W.duration),P.hdlr(W.type),P.minf(W))},P.mfhd=function(W){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},P.minf=function(W){return W.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(W)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(W))},P.moof=function(W,_,L){return P.box(P.types.moof,P.mfhd(W),P.traf(L,_))},P.moov=function(W){for(var _=W.length,L=[];_--;)L[_]=P.trak(W[_]);return P.box.apply(null,[P.types.moov,P.mvhd(W[0].timescale,W[0].duration)].concat(L).concat(P.mvex(W)))},P.mvex=function(W){for(var _=W.length,L=[];_--;)L[_]=P.trex(W[_]);return P.box.apply(null,[P.types.mvex].concat(L))},P.mvhd=function(W,_){_*=W;var L=Math.floor(_/(K+1)),y=Math.floor(_%(K+1)),C=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,L>>24,L>>16&255,L>>8&255,L&255,y>>24,y>>16&255,y>>8&255,y&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return P.box(P.types.mvhd,C)},P.sdtp=function(W){var _=W.samples||[],L=new Uint8Array(4+_.length),y,C;for(y=0;y<_.length;y++)C=_[y].flags,L[y+4]=C.dependsOn<<4|C.isDependedOn<<2|C.hasRedundancy;return P.box(P.types.sdtp,L)},P.stbl=function(W){return P.box(P.types.stbl,P.stsd(W),P.box(P.types.stts,P.STTS),P.box(P.types.stsc,P.STSC),P.box(P.types.stsz,P.STSZ),P.box(P.types.stco,P.STCO))},P.avc1=function(W){var _=[],L=[],y,C,k;for(y=0;y<W.sps.length;y++)C=W.sps[y],k=C.byteLength,_.push(k>>>8&255),_.push(k&255),_=_.concat(Array.prototype.slice.call(C));for(y=0;y<W.pps.length;y++)C=W.pps[y],k=C.byteLength,L.push(k>>>8&255),L.push(k&255),L=L.concat(Array.prototype.slice.call(C));var O=P.box(P.types.avcC,new Uint8Array([1,_[3],_[4],_[5],252|3,224|W.sps.length].concat(_).concat([W.pps.length]).concat(L))),A=W.width,x=W.height,d=W.pixelRatio[0],a=W.pixelRatio[1];return P.box(P.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,A>>8&255,A&255,x>>8&255,x&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),O,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,a>>24,a>>16&255,a>>8&255,a&255])))},P.esds=function(W){var _=W.config.length;return new Uint8Array([0,0,0,0,3,23+_,0,1,0,4,15+_,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([_]).concat(W.config).concat([6,1,2]))},P.mp4a=function(W){var _=W.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,_>>8&255,_&255,0,0]),P.box(P.types.esds,P.esds(W)))},P.mp3=function(W){var _=W.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,_>>8&255,_&255,0,0]))},P.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(W)):P.box(P.types.stsd,P.STSD,P.mp4a(W)):P.box(P.types.stsd,P.STSD,P.avc1(W))},P.tkhd=function(W){var _=W.id,L=W.duration*W.timescale,y=W.width,C=W.height,k=Math.floor(L/(K+1)),O=Math.floor(L%(K+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,_>>24&255,_>>16&255,_>>8&255,_&255,0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,C>>8&255,C&255,0,0]))},P.traf=function(W,_){var L=P.sdtp(W),y=W.id,C=Math.floor(_/(K+1)),k=Math.floor(_%(K+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,C>>24,C>>16&255,C>>8&255,C&255,k>>24,k>>16&255,k>>8&255,k&255])),P.trun(W,L.length+16+20+8+16+8+8),L)},P.trak=function(W){return W.duration=W.duration||4294967295,P.box(P.types.trak,P.tkhd(W),P.mdia(W))},P.trex=function(W){var _=W.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(W,_){var L=W.samples||[],y=L.length,C=12+16*y,k=new Uint8Array(C),O,A,x,d,a,l;for(_+=8+C,k.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255],0),O=0;O<y;O++)A=L[O],x=A.duration,d=A.size,a=A.flags,l=A.cts,k.set([x>>>24&255,x>>>16&255,x>>>8&255,x&255,d>>>24&255,d>>>16&255,d>>>8&255,d&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,l>>>24&255,l>>>16&255,l>>>8&255,l&255],12+16*O);return P.box(P.types.trun,k)},P.initSegment=function(W){P.types||P.init();var _=P.moov(W),L=new Uint8Array(P.FTYP.byteLength+_.byteLength);return L.set(P.FTYP),L.set(_,P.FTYP.byteLength),L},P}();D.types=void 0,D.HDLR_TYPES=void 0,D.STTS=void 0,D.STSC=void 0,D.STCO=void 0,D.STSZ=void 0,D.VMHD=void 0,D.SMHD=void 0,D.STSD=void 0,D.FTYP=void 0,D.DINF=void 0,X.default=D},"./src/remux/mp4-remuxer.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return l}),M.d(X,"normalizePts",function(){return s});var K=M("./src/polyfills/number.ts"),D=M("./src/remux/aac-helper.ts"),P=M("./src/remux/mp4-generator.ts"),H=M("./src/events.ts"),W=M("./src/errors.ts"),_=M("./src/utils/logger.ts"),L=M("./src/types/loader.ts"),y=M("./src/utils/timescale-conversion.ts");function C(){return C=Object.assign||function(R){for(var E=1;E<arguments.length;E++){var f=arguments[E];for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(R[g]=f[g])}return R},C.apply(this,arguments)}var k=10*1e3,O=1024,A=1152,x=null,d=null,a=!1,l=function(){function R(f,g,h,o){if(o===void 0&&(o=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=f,this.config=g,this.typeSupported=h,this.ISGenerated=!1,x===null){var S=navigator.userAgent||"",b=S.match(/Chrome\/(\d+)/i);x=b?parseInt(b[1]):0}if(d===null){var T=navigator.userAgent.match(/Safari\/(\d+)/i);d=T?parseInt(T[1]):0}a=!!x&&x<75||!!d&&d<600}var E=R.prototype;return E.destroy=function(){},E.resetTimeStamp=function(g){_.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=g},E.resetNextTimestamp=function(){_.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},E.resetInitSegment=function(){_.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},E.getVideoStartPts=function(g){var h=!1,o=g.reduce(function(S,b){var T=b.pts-S;return T<-4294967296?(h=!0,s(S,b.pts)):T>0?S:b.pts},g[0].pts);return h&&_.logger.debug("PTS rollover detected"),o},E.remux=function(g,h,o,S,b,T,N,z){var Y,te,G,F,re,le,Ee=b,Oe=b,Ye=g.pid>-1,Pe=h.pid>-1,Be=h.samples.length,Ue=g.samples.length>0,Ne=Be>1,Te=(!Ye||Ue)&&(!Pe||Ne)||this.ISGenerated||N;if(Te){this.ISGenerated||(G=this.generateIS(g,h,b));var se=this.isVideoContiguous,ze=-1;if(Ne&&(ze=v(h.samples),!se&&this.config.forceKeyFrameOnDiscontinuity))if(le=!0,ze>0){_.logger.warn("[mp4-remuxer]: Dropped "+ze+" out of "+Be+" video samples due to a missing keyframe");var xt=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(ze),h.dropped+=ze,Oe+=(h.samples[0].pts-xt)/(h.timescale||9e4)}else ze===-1&&(_.logger.warn("[mp4-remuxer]: No keyframe found out of "+Be+" video samples"),le=!1);if(this.ISGenerated){if(Ue&&Ne){var ct=this.getVideoStartPts(h.samples),ft=s(g.samples[0].pts,ct)-ct,Ct=ft/h.inputTimeScale;Ee+=Math.max(0,Ct),Oe+=Math.max(0,-Ct)}if(Ue){if(g.samplerate||(_.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),G=this.generateIS(g,h,b)),te=this.remuxAudio(g,Ee,this.isAudioContiguous,T,Pe||Ne||z===L.PlaylistLevelType.AUDIO?Oe:void 0),Ne){var He=te?te.endPTS-te.startPTS:0;h.inputTimeScale||(_.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),G=this.generateIS(g,h,b)),Y=this.remuxVideo(h,Oe,se,He)}}else Ne&&(Y=this.remuxVideo(h,Oe,se,0));Y&&(Y.firstKeyFrame=ze,Y.independent=ze!==-1)}}return this.ISGenerated&&(o.samples.length&&(re=this.remuxID3(o,b)),S.samples.length&&(F=this.remuxText(S,b))),{audio:te,video:Y,initSegment:G,independent:le,text:F,id3:re}},E.generateIS=function(g,h,o){var S=g.samples,b=h.samples,T=this.typeSupported,N={},z=!Object(K.isFiniteNumber)(this._initPTS),Y="audio/mp4",te,G,F;if(z&&(te=G=Infinity),g.config&&S.length&&(g.timescale=g.samplerate,g.isAAC||(T.mpeg?(Y="audio/mpeg",g.codec=""):T.mp3&&(g.codec="mp3")),N.audio={id:"audio",container:Y,codec:g.codec,initSegment:!g.isAAC&&T.mpeg?new Uint8Array(0):P.default.initSegment([g]),metadata:{channelCount:g.channelCount}},z&&(F=g.inputTimeScale,te=G=S[0].pts-Math.round(F*o))),h.sps&&h.pps&&b.length&&(h.timescale=h.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:P.default.initSegment([h]),metadata:{width:h.width,height:h.height}},z)){F=h.inputTimeScale;var re=this.getVideoStartPts(b),le=Math.round(F*o);G=Math.min(G,s(b[0].dts,re)-le),te=Math.min(te,re-le)}if(Object.keys(N).length)return this.ISGenerated=!0,z&&(this._initPTS=te,this._initDTS=G),{tracks:N,initPTS:te,timescale:F}},E.remuxVideo=function(g,h,o,S){var b=g.inputTimeScale,T=g.samples,N=[],z=T.length,Y=this._initPTS,te=this.nextAvcDts,G=8,F,re,le,Ee=Number.POSITIVE_INFINITY,Oe=Number.NEGATIVE_INFINITY,Ye=0,Pe=!1;if(!o||te===null){var Be=h*b,Ue=T[0].pts-s(T[0].dts,T[0].pts);te=Be-Ue}for(var Ne=0;Ne<z;Ne++){var Te=T[Ne];if(Te.pts=s(Te.pts-Y,te),Te.dts=s(Te.dts-Y,te),Te.dts>Te.pts){var se=9e4*.2;Ye=Math.max(Math.min(Ye,Te.pts-Te.dts),-1*se)}Te.dts<T[Ne>0?Ne-1:Ne].dts&&(Pe=!0)}Pe&&T.sort(function(Kt,_t){var ot=Kt.dts-_t.dts,Jt=Kt.pts-_t.pts;return ot||Jt}),re=T[0].dts,le=T[T.length-1].dts;var ze=Math.round((le-re)/(z-1));if(Ye<0){if(Ye<ze*-2){_.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-ze,!0)+" ms");for(var xt=Ye,ct=0;ct<z;ct++)T[ct].dts=xt=Math.max(xt,T[ct].pts-ze),T[ct].pts=Math.max(xt,T[ct].pts)}else{_.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(Ye,!0)+" ms to overcome this issue");for(var ft=0;ft<z;ft++)T[ft].dts=T[ft].dts+Ye}re=T[0].dts}if(o){var Ct=re-te,He=Ct>ze,Ke=Ct<-1;if(He||Ke){He?_.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(Ct,!0)+" ms ("+Ct+"dts) hole between fragments detected, filling it"):_.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-Ct,!0)+" ms ("+Ct+"dts) overlapping between fragments detected"),re=te;var ut=T[0].pts-Ct;T[0].dts=re,T[0].pts=ut,_.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(ut,!0)+"/"+Object(y.toMsFromMpegTsClock)(re,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(Ct,!0)+" ms")}}a&&(re=Math.max(0,re));for(var vt=0,ht=0,et=0;et<z;et++){for(var Ze=T[et],Tt=Ze.units,bt=Tt.length,St=0,lt=0;lt<bt;lt++)St+=Tt[lt].data.length;ht+=St,vt+=bt,Ze.length=St,Ze.dts=Math.max(Ze.dts,re),Ze.pts=Math.max(Ze.pts,Ze.dts,0),Ee=Math.min(Ze.pts,Ee),Oe=Math.max(Ze.pts,Oe)}le=T[z-1].dts;var yt=ht+4*vt+8,dt;try{dt=new Uint8Array(yt)}catch(Kt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:yt,reason:"fail allocating video mdat "+yt});return}var Qe=new DataView(dt.buffer);Qe.setUint32(0,yt),dt.set(P.default.types.mdat,4);for(var Ie=0;Ie<z;Ie++){for(var Et=T[Ie],$e=Et.units,_e=0,Je=0,Se=$e.length;Je<Se;Je++){var me=$e[Je],ve=me.data,ne=me.data.byteLength;Qe.setUint32(G,ne),G+=4,dt.set(ve,G),G+=ne,_e+=4+ne}if(Ie<z-1)F=T[Ie+1].dts-Et.dts;else{var ie=this.config,de=Et.dts-T[Ie>0?Ie-1:Ie].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var pe=Math.floor(ie.maxBufferHole*b),xe=(S?Ee+S*b:this.nextAudioPts)-Et.pts;xe>pe?(F=xe-de,F<0&&(F=de),_.logger.log("[mp4-remuxer]: It is approximately "+xe/90+" ms to the next segment; using duration "+F/90+" ms for the last video frame.")):F=de}else F=de}var Le=Math.round(Et.pts-Et.dts);N.push(new c(Et.key,F,_e,Le))}if(N.length&&x&&x<70){var je=N[0].flags;je.dependsOn=2,je.isNonSync=0}console.assert(F!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=te=le+F,this.isVideoContiguous=!0;var mt=P.default.moof(g.sequenceNumber++,re,C({},g,{samples:N})),Mt="video",Rt={data1:mt,data2:dt,startPTS:Ee/b,endPTS:(Oe+F)/b,startDTS:re/b,endDTS:te/b,type:Mt,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:g.dropped};return g.samples=[],g.dropped=0,console.assert(dt.length,"MDAT length must not be zero"),Rt},E.remuxAudio=function(g,h,o,S,b){var T=g.inputTimeScale,N=g.samplerate?g.samplerate:T,z=T/N,Y=g.isAAC?O:A,te=Y*z,G=this._initPTS,F=!g.isAAC&&this.typeSupported.mpeg,re=[],le=g.samples,Ee=F?0:8,Oe=this.nextAudioPts||-1,Ye=h*T;if(this.isAudioContiguous=o=o||le.length&&Oe>0&&(S&&Math.abs(Ye-Oe)<9e3||Math.abs(s(le[0].pts-G,Ye)-Oe)<20*te),le.forEach(function(ve){ve.pts=s(ve.pts-G,Ye)}),!o||Oe<0){if(le=le.filter(function(ve){return ve.pts>=0}),!le.length)return;b===0?Oe=0:S?Oe=Math.max(0,Ye):Oe=le[0].pts}if(g.isAAC)for(var Pe=b!==void 0,Be=this.config.maxAudioFramesDrift,Ue=0,Ne=Oe;Ue<le.length;Ue++){var Te=le[Ue],se=Te.pts,ze=se-Ne,xt=Math.abs(1e3*ze/T);if(ze<=-Be*te&&Pe)Ue===0&&(_.logger.warn("Audio frame @ "+(se/T).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ze/T)+" ms."),this.nextAudioPts=Oe=Ne=se);else if(ze>=Be*te&&xt<k&&Pe){var ct=Math.round(ze/te);Ne=se-ct*te,Ne<0&&(ct--,Ne+=te),Ue===0&&(this.nextAudioPts=Oe=Ne),_.logger.warn("[mp4-remuxer]: Injecting "+ct+" audio frame @ "+(Ne/T).toFixed(3)+"s due to "+Math.round(1e3*ze/T)+" ms gap.");for(var ft=0;ft<ct;ft++){var Ct=Math.max(Ne,0),He=D.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);He||(_.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),He=Te.unit.subarray()),le.splice(Ue,0,{unit:He,pts:Ct}),Ne+=te,Ue++}}Te.pts=Ne,Ne+=te}for(var Ke=null,ut=null,vt,ht=0,et=le.length;et--;)ht+=le[et].unit.byteLength;for(var Ze=0,Tt=le.length;Ze<Tt;Ze++){var bt=le[Ze],St=bt.unit,lt=bt.pts;if(ut!==null){var yt=re[Ze-1];yt.duration=Math.round((lt-ut)/z)}else if(o&&g.isAAC&&(lt=Oe),Ke=lt,ht>0){ht+=Ee;try{vt=new Uint8Array(ht)}catch(ve){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ht,reason:"fail allocating audio mdat "+ht});return}if(!F){var dt=new DataView(vt.buffer);dt.setUint32(0,ht),vt.set(P.default.types.mdat,4)}}else return;vt.set(St,Ee);var Qe=St.byteLength;Ee+=Qe,re.push(new c(!0,Y,Qe,0)),ut=lt}var Ie=re.length;if(!Ie)return;var Et=re[re.length-1];this.nextAudioPts=Oe=ut+z*Et.duration;var $e=F?new Uint8Array(0):P.default.moof(g.sequenceNumber++,Ke/z,C({},g,{samples:re}));g.samples=[];var _e=Ke/T,Je=Oe/T,Se="audio",me={data1:$e,data2:vt,startPTS:_e,endPTS:Je,startDTS:_e,endDTS:Je,type:Se,hasAudio:!0,hasVideo:!1,nb:Ie};return this.isAudioContiguous=!0,console.assert(vt.length,"MDAT length must not be zero"),me},E.remuxEmptyAudio=function(g,h,o,S){var b=g.inputTimeScale,T=g.samplerate?g.samplerate:b,N=b/T,z=this.nextAudioPts,Y=(z!==null?z:S.startDTS*b)+this._initDTS,te=S.endDTS*b+this._initDTS,G=N*O,F=Math.ceil((te-Y)/G),re=D.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);if(_.logger.warn("[mp4-remuxer]: remux empty Audio"),!re){_.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var le=[],Ee=0;Ee<F;Ee++){var Oe=Y+Ee*G;le.push({unit:re,pts:Oe,dts:Oe})}return g.samples=le,this.remuxAudio(g,h,o,!1)},E.remuxID3=function(g,h){var o=g.samples.length;if(!o)return;for(var S=g.inputTimeScale,b=this._initPTS,T=this._initDTS,N=0;N<o;N++){var z=g.samples[N];z.pts=s(z.pts-b,h*S)/S,z.dts=s(z.dts-T,h*S)/S}var Y=g.samples;return g.samples=[],{samples:Y}},E.remuxText=function(g,h){var o=g.samples.length;if(!o)return;for(var S=g.inputTimeScale,b=this._initPTS,T=0;T<o;T++){var N=g.samples[T];N.pts=s(N.pts-b,h*S)/S}g.samples.sort(function(Y,te){return Y.pts-te.pts});var z=g.samples;return g.samples=[],{samples:z}},R}();function s(R,E){var f;if(E===null)return R;for(E<R?f=-8589934592:f=8589934592;Math.abs(R-E)>4294967296;)R+=f;return R}function v(R){for(var E=0;E<R.length;E++)if(R[E].key)return E;return-1}var c=function(E,f,g,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=f,this.size=g,this.cts=h,this.flags=new m(E)},m=function(E){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=E?2:1,this.isNonSync=E?0:1}},"./src/remux/passthrough-remuxer.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/polyfills/number.ts"),D=M("./src/utils/mp4-tools.ts"),P=M("./src/loader/fragment.ts"),H=M("./src/utils/logger.ts"),W=function(){function y(){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 C=y.prototype;return C.destroy=function(){},C.resetTimeStamp=function(O){this.initPTS=O,this.lastEndDTS=null},C.resetNextTimestamp=function(){this.lastEndDTS=null},C.resetInitSegment=function(O,A,x){this.audioCodec=A,this.videoCodec=x,this.generateInitSegment(O),this.emitInitSegment=!0},C.generateInitSegment=function(O){var A=this.audioCodec,x=this.videoCodec;if(!O||!O.byteLength){this.initTracks=void 0,this.initData=void 0;return}var d=this.initData=Object(D.parseInitSegment)(O);A||(A=L(d.audio,P.ElementaryStreamTypes.AUDIO)),x||(x=L(d.video,P.ElementaryStreamTypes.VIDEO));var a={};d.audio&&d.video?a.audiovideo={container:"video/mp4",codec:A+","+x,initSegment:O,id:"main"}:d.audio?a.audio={container:"audio/mp4",codec:A,initSegment:O,id:"audio"}:d.video?a.video={container:"video/mp4",codec:x,initSegment:O,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},C.remux=function(O,A,x,d,a){var l=this.initPTS,s=this.lastEndDTS,v={audio:void 0,video:void 0,text:d,id3:x,initSegment:void 0};Object(K.isFiniteNumber)(s)||(s=this.lastEndDTS=a||0);var c=A.samples;if(!c||!c.length)return v;var m={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(c),R=this.initData),!R||!R.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(K.isFiniteNumber)(l)||(this.initPTS=m.initPTS=l=_(R,c,s));var E=Object(D.getDuration)(c,R),f=s,g=E+f;Object(D.offsetStartDTS)(R,c,l),E>0?this.lastEndDTS=g:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!R.audio,o=!!R.video,S="";h&&(S+="audio"),o&&(S+="video");var b={data1:c,startPTS:f,startDTS:f,endPTS:g,endDTS:g,type:S,hasAudio:h,hasVideo:o,nb:1,dropped:0};return v.audio=b.type==="audio"?b:void 0,v.video=b.type!=="audio"?b:void 0,v.text=d,v.id3=x,v.initSegment=m,v},y}(),_=function(C,k,O){return Object(D.getStartDTS)(C,k)-O};function L(y,C){var k=y==null?void 0:y.codec;return k&&k.length>4?k:k==="hvc1"?"hvc1.1.c.L120.90":k==="av01"?"av01.0.04M.08":k==="avc1"||C===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}X.default=W},"./src/task-loop.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return K});var K=function(){function D(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=D.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},D}()},"./src/types/cmcd.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"CMCDVersion",function(){return K}),M.d(X,"CMCDObjectType",function(){return D}),M.d(X,"CMCDStreamingFormat",function(){return P}),M.d(X,"CMCDStreamType",function(){return H});var K=1,D;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(D||(D={}));var P;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(P||(P={}));var H;(function(W){W.VOD="v",W.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"HlsSkip",function(){return P}),M.d(X,"getSkipValue",function(){return H}),M.d(X,"HlsUrlParameters",function(){return W}),M.d(X,"Level",function(){return _});function K(L,y){for(var C=0;C<y.length;C++){var k=y[C];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(L,k.key,k)}}function D(L,y,C){return y&&K(L.prototype,y),C&&K(L,C),L}var P;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(P||(P={}));function H(L,y){var C=L.canSkipUntil,k=L.canSkipDateRanges,O=L.endSN,A=y!==void 0?y-O:0;return C&&A<C?k?P.v2:P.Yes:P.No}var W=function(){function L(C,k,O){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=C,this.part=k,this.skip=O}var y=L.prototype;return y.addDirectives=function(k){var O=new self.URL(k);return this.msn!==void 0&&O.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&O.searchParams.set("_HLS_part",this.part.toString()),this.skip&&O.searchParams.set("_HLS_skip",this.skip),O.toString()},L}(),_=function(){function L(y){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(C){return C}).join(",").replace(/\.[^.,]+/g,"")}return D(L,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(C){var k=C%this.url.length;this._urlId!==k&&(this.details=void 0,this._urlId=k)}}]),L}()},"./src/types/loader.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"PlaylistContextType",function(){return K}),M.d(X,"PlaylistLevelType",function(){return D});var K;(function(P){P.MANIFEST="manifest",P.LEVEL="level",P.AUDIO_TRACK="audioTrack",P.SUBTITLE_TRACK="subtitleTrack"})(K||(K={}));var D;(function(P){P.MAIN="main",P.AUDIO="audio",P.SUBTITLE="subtitle"})(D||(D={}))},"./src/types/transmuxer.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"ChunkMetadata",function(){return K});var K=function(H,W,_,L,y,C){L===void 0&&(L=0),y===void 0&&(y=-1),C===void 0&&(C=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=D(),this.buffering={audio:D(),video:D(),audiovideo:D()},this.level=H,this.sn=W,this.id=_,this.size=L,this.part=y,this.partial=C};function D(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"AttrList",function(){return P});var K=/^(\d+)x(\d+)$/,D=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,P=function(){function H(_){typeof _=="string"&&(_=H.parseAttrList(_));for(var L in _)_.hasOwnProperty(L)&&(this[L]=_[L])}var W=H.prototype;return W.decimalInteger=function(L){var y=parseInt(this[L],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},W.hexadecimalInteger=function(L){if(this[L]){var y=(this[L]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var C=new Uint8Array(y.length/2),k=0;k<y.length/2;k++)C[k]=parseInt(y.slice(k*2,k*2+2),16);return C}else return null},W.hexadecimalIntegerAsNumber=function(L){var y=parseInt(this[L],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},W.decimalFloatingPoint=function(L){return parseFloat(this[L])},W.optionalFloat=function(L,y){var C=this[L];return C?parseFloat(C):y},W.enumeratedString=function(L){return this[L]},W.bool=function(L){return this[L]==="YES"},W.decimalResolution=function(L){var y=K.exec(this[L]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},H.parseAttrList=function(L){var y,C={},k='"';for(D.lastIndex=0;(y=D.exec(L))!==null;){var O=y[2];O.indexOf(k)===0&&O.lastIndexOf(k)===O.length-1&&(O=O.slice(1,-1)),C[y[1]]=O}return C},H}()},"./src/utils/binary-search.ts":function(ae,X,M){"use strict";M.r(X);var K={search:function(P,H){for(var W=0,_=P.length-1,L=null,y=null;W<=_;){L=(W+_)/2|0,y=P[L];var C=H(y);if(C>0)W=L+1;else if(C<0)_=L-1;else return y}return null}};X.default=K},"./src/utils/buffer-helper.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"BufferHelper",function(){return P});var K=M("./src/utils/logger.ts"),D={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function H(){}return H.isBuffered=function(_,L){try{if(_){for(var y=H.getBuffered(_),C=0;C<y.length;C++)if(L>=y.start(C)&&L<=y.end(C))return!0}}catch(k){}return!1},H.bufferInfo=function(_,L,y){try{if(_){var C=H.getBuffered(_),k=[],O;for(O=0;O<C.length;O++)k.push({start:C.start(O),end:C.end(O)});return this.bufferedInfo(k,L,y)}}catch(A){}return{len:0,start:L,end:L,nextStart:void 0}},H.bufferedInfo=function(_,L,y){L=Math.max(0,L),_.sort(function(m,R){var E=m.start-R.start;return E||R.end-m.end});var C=[];if(y)for(var k=0;k<_.length;k++){var O=C.length;if(O){var A=C[O-1].end;_[k].start-A<y?_[k].end>A&&(C[O-1].end=_[k].end):C.push(_[k])}else C.push(_[k])}else C=_;for(var x=0,d,a=L,l=L,s=0;s<C.length;s++){var v=C[s].start,c=C[s].end;if(L+y>=v&&L<c)a=v,l=c,x=l-L;else if(L+y<v){d=v;break}}return{len:x,start:a||0,end:l||0,nextStart:d}},H.getBuffered=function(_){try{return _.buffered}catch(L){return K.logger.log("failed to get media.buffered",L),D}},H}()},"./src/utils/cea-608-parser.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"Row",function(){return l}),M.d(X,"CaptionScreen",function(){return s});var K=M("./src/utils/logger.ts"),D={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},P=function(g){var h=g;return D.hasOwnProperty(g)&&(h=D[g]),String.fromCharCode(h)},H=15,W=100,_={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},C={25:2,26:4,29:6,30:8,31:10,27:13,28:15},k=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],O;(function(f){f[f.ERROR=0]="ERROR",f[f.TEXT=1]="TEXT",f[f.WARNING=2]="WARNING",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f[f.DATA=3]="DATA"})(O||(O={}));var A=function(){function f(){this.time=null,this.verboseLevel=O.ERROR}var g=f.prototype;return g.log=function(o,S){this.verboseLevel>=o&&K.logger.log(this.time+" ["+o+"] "+S)},f}(),x=function(g){for(var h=[],o=0;o<g.length;o++)h.push(g[o].toString(16));return h},d=function(){function f(h,o,S,b,T){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=h||"white",this.underline=o||!1,this.italics=S||!1,this.background=b||"black",this.flash=T||!1}var g=f.prototype;return g.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},g.setStyles=function(o){for(var S=["foreground","underline","italics","background","flash"],b=0;b<S.length;b++){var T=S[b];o.hasOwnProperty(T)&&(this[T]=o[T])}},g.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},g.equals=function(o){return this.foreground===o.foreground&&this.underline===o.underline&&this.italics===o.italics&&this.background===o.background&&this.flash===o.flash},g.copy=function(o){this.foreground=o.foreground,this.underline=o.underline,this.italics=o.italics,this.background=o.background,this.flash=o.flash},g.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},f}(),a=function(){function f(h,o,S,b,T,N){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new d(o,S,b,T,N)}var g=f.prototype;return g.reset=function(){this.uchar=" ",this.penState.reset()},g.setChar=function(o,S){this.uchar=o,this.penState.copy(S)},g.setPenState=function(o){this.penState.copy(o)},g.equals=function(o){return this.uchar===o.uchar&&this.penState.equals(o.penState)},g.copy=function(o){this.uchar=o.uchar,this.penState.copy(o.penState)},g.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},f}(),l=function(){function f(h){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var o=0;o<W;o++)this.chars.push(new a);this.logger=h,this.pos=0,this.currPenState=new d}var g=f.prototype;return g.equals=function(o){for(var S=!0,b=0;b<W;b++)if(!this.chars[b].equals(o.chars[b])){S=!1;break}return S},g.copy=function(o){for(var S=0;S<W;S++)this.chars[S].copy(o.chars[S])},g.isEmpty=function(){for(var o=!0,S=0;S<W;S++)if(!this.chars[S].isEmpty()){o=!1;break}return o},g.setCursor=function(o){this.pos!==o&&(this.pos=o),this.pos<0?(this.logger.log(O.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>W&&(this.logger.log(O.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},g.moveCursor=function(o){var S=this.pos+o;if(o>1)for(var b=this.pos+1;b<S+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(S)},g.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},g.insertChar=function(o){o>=144&&this.backSpace();var S=P(o);if(this.pos>=W){this.logger.log(O.ERROR,"Cannot insert "+o.toString(16)+" ("+S+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(S,this.currPenState),this.moveCursor(1)},g.clearFromPos=function(o){var S;for(S=o;S<W;S++)this.chars[S].reset()},g.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},g.clearToEndOfRow=function(){this.clearFromPos(this.pos)},g.getTextString=function(){for(var o=[],S=!0,b=0;b<W;b++){var T=this.chars[b].uchar;T!==" "&&(S=!1),o.push(T)}return S?"":o.join("")},g.setPenStyles=function(o){this.currPenState.setStyles(o);var S=this.chars[this.pos];S.setPenState(this.currPenState)},f}(),s=function(){function f(h){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var o=0;o<H;o++)this.rows.push(new l(h));this.logger=h,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var g=f.prototype;return g.reset=function(){for(var o=0;o<H;o++)this.rows[o].clear();this.currRow=H-1},g.equals=function(o){for(var S=!0,b=0;b<H;b++)if(!this.rows[b].equals(o.rows[b])){S=!1;break}return S},g.copy=function(o){for(var S=0;S<H;S++)this.rows[S].copy(o.rows[S])},g.isEmpty=function(){for(var o=!0,S=0;S<H;S++)if(!this.rows[S].isEmpty()){o=!1;break}return o},g.backSpace=function(){var o=this.rows[this.currRow];o.backSpace()},g.clearToEndOfRow=function(){var o=this.rows[this.currRow];o.clearToEndOfRow()},g.insertChar=function(o){var S=this.rows[this.currRow];S.insertChar(o)},g.setPen=function(o){var S=this.rows[this.currRow];S.setPenStyles(o)},g.moveCursor=function(o){var S=this.rows[this.currRow];S.moveCursor(o)},g.setCursor=function(o){this.logger.log(O.INFO,"setCursor: "+o);var S=this.rows[this.currRow];S.setCursor(o)},g.setPAC=function(o){this.logger.log(O.INFO,"pacData = "+JSON.stringify(o));var S=o.row-1;if(this.nrRollUpRows&&S<this.nrRollUpRows-1&&(S=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==S){for(var b=0;b<H;b++)this.rows[b].clear();var T=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var z=N.rows[T].cueStartTime,Y=this.logger.time;if(z&&Y!==null&&z<Y)for(var te=0;te<this.nrRollUpRows;te++)this.rows[S-this.nrRollUpRows+te+1].copy(N.rows[T+te])}}this.currRow=S;var G=this.rows[this.currRow];if(o.indent!==null){var F=o.indent,re=Math.max(F-1,0);G.setCursor(o.indent),o.color=G.chars[re].penState.foreground}var le={foreground:o.color,underline:o.underline,italics:o.italics,background:"black",flash:!1};this.setPen(le)},g.setBkgData=function(o){this.logger.log(O.INFO,"bkgData = "+JSON.stringify(o)),this.backSpace(),this.setPen(o),this.insertChar(32)},g.setRollUpRows=function(o){this.nrRollUpRows=o},g.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(O.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(O.TEXT,this.getDisplayText());var o=this.currRow+1-this.nrRollUpRows,S=this.rows.splice(o,1)[0];S.clear(),this.rows.splice(this.currRow,0,S),this.logger.log(O.INFO,"Rolling up")},g.getDisplayText=function(o){o=o||!1;for(var S=[],b="",T=-1,N=0;N<H;N++){var z=this.rows[N].getTextString();z&&(T=N+1,o?S.push("Row "+T+": '"+z+"'"):S.push(z.trim()))}return S.length>0&&(o?b="["+S.join(" | ")+"]":b=S.join(`
|
|
`)),b},g.getTextAndFormat=function(){return this.rows},f}(),v=function(){function f(h,o,S){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=h,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new s(S),this.nonDisplayedMemory=new s(S),this.lastOutputScreen=new s(S),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=S}var g=f.prototype;return g.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},g.getHandler=function(){return this.outputFilter},g.setHandler=function(o){this.outputFilter=o},g.setPAC=function(o){this.writeScreen.setPAC(o)},g.setBkgData=function(o){this.writeScreen.setBkgData(o)},g.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(O.INFO,"MODE="+o),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=o},g.insertChars=function(o){for(var S=0;S<o.length;S++)this.writeScreen.insertChar(o[S]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(O.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(O.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},g.ccRCL=function(){this.logger.log(O.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},g.ccBS=function(){if(this.logger.log(O.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},g.ccAOF=function(){},g.ccAON=function(){},g.ccDER=function(){this.logger.log(O.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},g.ccRU=function(o){this.logger.log(O.INFO,"RU("+o+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(o)},g.ccFON=function(){this.logger.log(O.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},g.ccRDC=function(){this.logger.log(O.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},g.ccTR=function(){this.logger.log(O.INFO,"TR"),this.setMode("MODE_TEXT")},g.ccRTD=function(){this.logger.log(O.INFO,"RTD"),this.setMode("MODE_TEXT")},g.ccEDM=function(){this.logger.log(O.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},g.ccCR=function(){this.logger.log(O.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},g.ccENM=function(){this.logger.log(O.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},g.ccEOC=function(){if(this.logger.log(O.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var o=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=o,this.writeScreen=this.nonDisplayedMemory,this.logger.log(O.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},g.ccTO=function(o){this.logger.log(O.INFO,"TO("+o+") - Tab Offset"),this.writeScreen.moveCursor(o)},g.ccMIDROW=function(o){var S={flash:!1};if(S.underline=o%2===1,S.italics=o>=46,S.italics)S.foreground="white";else{var b=Math.floor(o/2)-16,T=["white","green","blue","cyan","red","yellow","magenta"];S.foreground=T[b]}this.logger.log(O.INFO,"MIDROW: "+JSON.stringify(S)),this.writeScreen.setPen(S)},g.outputDataUpdate=function(o){o===void 0&&(o=!1);var S=this.logger.time;if(S===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=S:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,S,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:S),this.lastOutputScreen.copy(this.displayedMemory))},g.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},f}(),c=function(){function f(h,o,S){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new A;this.channels=[null,new v(h,o,b),new v(h+1,S,b)],this.cmdHistory=E(),this.logger=b}var g=f.prototype;return g.getHandler=function(o){return this.channels[o].getHandler()},g.setHandler=function(o,S){this.channels[o].setHandler(S)},g.addData=function(o,S){var b,T,N,z=!1;this.logger.time=o;for(var Y=0;Y<S.length;Y+=2){if(T=S[Y]&127,N=S[Y+1]&127,T===0&&N===0)continue;if(this.logger.log(O.DATA,"["+x([S[Y],S[Y+1]])+"] -> ("+x([T,N])+")"),b=this.parseCmd(T,N),b||(b=this.parseMidrow(T,N)),b||(b=this.parsePAC(T,N)),b||(b=this.parseBackgroundAttributes(T,N)),!b&&(z=this.parseChars(T,N),z)){var te=this.currentChannel;if(te&&te>0){var G=this.channels[te];G.insertChars(z)}else this.logger.log(O.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!z&&this.logger.log(O.WARNING,"Couldn't parse cleaned data "+x([T,N])+" orig: "+x([S[Y],S[Y+1]]))}},g.parseCmd=function(o,S){var b=this.cmdHistory,T=(o===20||o===28||o===21||o===29)&&S>=32&&S<=47,N=(o===23||o===31)&&S>=33&&S<=35;if(!(T||N))return!1;if(R(o,S,b))return m(null,null,b),this.logger.log(O.DEBUG,"Repeated command ("+x([o,S])+") is dropped"),!0;var z=o===20||o===21||o===23?1:2,Y=this.channels[z];return o===20||o===21||o===28||o===29?S===32?Y.ccRCL():S===33?Y.ccBS():S===34?Y.ccAOF():S===35?Y.ccAON():S===36?Y.ccDER():S===37?Y.ccRU(2):S===38?Y.ccRU(3):S===39?Y.ccRU(4):S===40?Y.ccFON():S===41?Y.ccRDC():S===42?Y.ccTR():S===43?Y.ccRTD():S===44?Y.ccEDM():S===45?Y.ccCR():S===46?Y.ccENM():S===47&&Y.ccEOC():Y.ccTO(S-32),m(o,S,b),this.currentChannel=z,!0},g.parseMidrow=function(o,S){var b=0;if((o===17||o===25)&&S>=32&&S<=47){if(o===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(O.ERROR,"Mismatch channel in midrow parsing"),!1;var T=this.channels[b];return T?(T.ccMIDROW(S),this.logger.log(O.DEBUG,"MIDROW ("+x([o,S])+")"),!0):!1}return!1},g.parsePAC=function(o,S){var b,T=this.cmdHistory,N=(o>=17&&o<=23||o>=25&&o<=31)&&S>=64&&S<=127,z=(o===16||o===24)&&S>=64&&S<=95;if(!(N||z))return!1;if(R(o,S,T))return m(null,null,T),!0;var Y=o<=23?1:2;S>=64&&S<=95?b=Y===1?_[o]:y[o]:b=Y===1?L[o]:C[o];var te=this.channels[Y];return te?(te.setPAC(this.interpretPAC(b,S)),m(o,S,T),this.currentChannel=Y,!0):!1},g.interpretPAC=function(o,S){var b,T={color:null,italics:!1,indent:null,underline:!1,row:o};return S>95?b=S-96:b=S-64,T.underline=(b&1)===1,b<=13?T.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(T.italics=!0,T.color="white"):T.indent=Math.floor((b-16)/2)*4,T},g.parseChars=function(o,S){var b,T=null,N=null;if(o>=25?(b=2,N=o-8):(b=1,N=o),N>=17&&N<=19){var z;N===17?z=S+80:N===18?z=S+112:z=S+144,this.logger.log(O.INFO,"Special char '"+P(z)+"' in channel "+b),T=[z]}else o>=32&&o<=127&&(T=S===0?[o]:[o,S]);if(T){var Y=x(T);this.logger.log(O.DEBUG,"Char codes = "+Y.join(",")),m(o,S,this.cmdHistory)}return T},g.parseBackgroundAttributes=function(o,S){var b=(o===16||o===24)&&S>=32&&S<=47,T=(o===23||o===31)&&S>=45&&S<=47;if(!(b||T))return!1;var N,z={};o===16||o===24?(N=Math.floor((S-32)/2),z.background=k[N],S%2===1&&(z.background=z.background+"_semi")):S===45?z.background="transparent":(z.foreground="black",S===47&&(z.underline=!0));var Y=o<=23?1:2,te=this.channels[Y];return te.setBkgData(z),m(o,S,this.cmdHistory),!0},g.reset=function(){for(var o=0;o<Object.keys(this.channels).length;o++){var S=this.channels[o];S&&S.reset()}this.cmdHistory=E()},g.cueSplitAtTime=function(o){for(var S=0;S<this.channels.length;S++){var b=this.channels[S];b&&b.cueSplitAtTime(o)}},f}();function m(f,g,h){h.a=f,h.b=g}function R(f,g,h){return h.a===f&&h.b===g}function E(){return{a:null,b:null}}X.default=c},"./src/utils/codecs.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"isCodecType",function(){return D}),M.d(X,"isCodecSupportedInMp4",function(){return P});var K={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function D(H,W){var _=K[W];return!!_&&_[H.slice(0,4)]===!0}function P(H,W){return MediaSource.isTypeSupported((W||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/utils/vttparser.ts"),D=M("./src/utils/webvtt-parser.ts"),P=M("./src/utils/texttrack-utils.ts"),H=/\s/,W={newCue:function(L,y,C,k){for(var O=[],A,x,d,a,l,s=self.VTTCue||self.TextTrackCue,v=0;v<k.rows.length;v++)if(A=k.rows[v],d=!0,a=0,l="",!A.isEmpty()){for(var c=0;c<A.chars.length;c++)H.test(A.chars[c].uchar)&&d?a++:(l+=A.chars[c].uchar,d=!1);A.cueStartTime=y,y===C&&(C+=1e-4),a>=16?a--:a++;var m=Object(K.fixLineBreaks)(l.trim()),R=Object(D.generateCueId)(y,C,m);(!L||!L.cues||!L.cues.getCueById(R))&&(x=new s(y,C,m),x.id=R,x.line=v+1,x.align="left",x.position=10+Math.min(80,Math.floor(a*8/32)*10),O.push(x))}return L&&O.length&&(O.sort(function(E,f){return E.line==="auto"||f.line==="auto"?0:E.line>8&&f.line>8?f.line-E.line:E.line-f.line}),O.forEach(function(E){return Object(P.addCueToTrack)(L,E)})),O}};X.default=W},"./src/utils/discontinuities.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"findFirstFragWithCC",function(){return H}),M.d(X,"shouldAlignOnDiscontinuities",function(){return W}),M.d(X,"findDiscontinuousReferenceFrag",function(){return _}),M.d(X,"adjustSlidingStart",function(){return y}),M.d(X,"alignStream",function(){return C}),M.d(X,"alignPDT",function(){return O}),M.d(X,"alignFragmentByPDTDelta",function(){return A}),M.d(X,"alignMediaPlaylistByPDT",function(){return x});var K=M("./src/polyfills/number.ts"),D=M("./src/utils/logger.ts"),P=M("./src/controller/level-helper.ts");function H(d,a){for(var l=null,s=0,v=d.length;s<v;s++){var c=d[s];if(c&&c.cc===a){l=c;break}}return l}function W(d,a,l){return!!(a.details&&(l.endCC>l.startCC||d&&d.cc<l.startCC))}function _(d,a){var l=d.fragments,s=a.fragments;if(!s.length||!l.length){D.logger.log("No fragments to align");return}var v=H(l,s[0].cc);if(!v||v&&!v.startPTS){D.logger.log("No frag in previous level to align on");return}return v}function L(d,a){if(d){var l=d.start+a;d.start=d.startPTS=l,d.endPTS=l+d.duration}}function y(d,a){for(var l=a.fragments,s=0,v=l.length;s<v;s++)L(l[s],d);a.fragmentHint&&L(a.fragmentHint,d),a.alignedSliding=!0}function C(d,a,l){if(!a)return;k(d,l,a),!l.alignedSliding&&a.details&&O(l,a.details),!l.alignedSliding&&a.details&&!l.skippedSegments&&Object(P.adjustSliding)(a.details,l)}function k(d,a,l){if(W(d,l,a)){var s=_(l.details,a);s&&Object(K.isFiniteNumber)(s.start)&&(D.logger.log("Adjusting PTS using last level due to CC increase within current level "+a.url),y(s.start,a))}}function O(d,a){if(!a.fragments.length||!d.hasProgramDateTime||!a.hasProgramDateTime)return;var l=a.fragments[0].programDateTime,s=d.fragments[0].programDateTime,v=(s-l)/1e3+a.fragments[0].start;v&&Object(K.isFiniteNumber)(v)&&(D.logger.log("Adjusting PTS using programDateTime delta "+(s-l)+"ms, sliding:"+v.toFixed(3)+" "+d.url+" "),y(v,d))}function A(d,a){var l=d.programDateTime;if(!l)return;var s=(l-a)/1e3;d.start=d.startPTS=s,d.endPTS=s+d.duration}function x(d,a){if(!a.fragments.length||!d.hasProgramDateTime||!a.hasProgramDateTime)return;var l=a.fragments[0].programDateTime,s=a.fragments[0].start,v=l-s*1e3;d.fragments.forEach(function(c){A(c,v)}),d.fragmentHint&&A(d.fragmentHint,v),d.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/utils/ewma.ts"),D=function(){function P(W,_,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new K.default(W),this.fast_=new K.default(_)}var H=P.prototype;return H.update=function(_,L){var y=this.slow_,C=this.fast_;this.slow_.halfLife!==_&&(this.slow_=new K.default(_,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new K.default(L,C.getEstimate(),C.getTotalWeight()))},H.sample=function(_,L){_=Math.max(_,this.minDelayMs_);var y=8*L,C=_/1e3,k=y/C;this.fast_.sample(C,k),this.slow_.sample(C,k)},H.canEstimate=function(){var _=this.fast_;return _&&_.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},P}();X.default=D},"./src/utils/ewma.ts":function(ae,X,M){"use strict";M.r(X);var K=function(){function D(H,W,_){W===void 0&&(W=0),_===void 0&&(_=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=W,this.totalWeight_=_}var P=D.prototype;return P.sample=function(W,_){var L=Math.pow(this.alpha_,W);this.estimate_=_*(1-L)+L*this.estimate_,this.totalWeight_+=W},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},D}();X.default=K},"./src/utils/fetch-loader.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"fetchSupported",function(){return A});var K=M("./src/polyfills/number.ts"),D=M("./src/loader/load-stats.ts"),P=M("./src/demux/chunk-cache.ts");function H(s,v){s.prototype=Object.create(v.prototype),s.prototype.constructor=s,C(s,v)}function W(s){var v=typeof Map=="function"?new Map:void 0;return W=function(m){if(m===null||!y(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(m))return v.get(m);v.set(m,R)}function R(){return _(m,arguments,k(this).constructor)}return R.prototype=Object.create(m.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),C(R,m)},W(s)}function _(s,v,c){return L()?_=Reflect.construct:_=function(R,E,f){var g=[null];g.push.apply(g,E);var h=Function.bind.apply(R,g),o=new h;return f&&C(o,f.prototype),o},_.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function y(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function C(s,v){return C=Object.setPrototypeOf||function(m,R){return m.__proto__=R,m},C(s,v)}function k(s){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},k(s)}function O(){return O=Object.assign||function(s){for(var v=1;v<arguments.length;v++){var c=arguments[v];for(var m in c)Object.prototype.hasOwnProperty.call(c,m)&&(s[m]=c[m])}return s},O.apply(this,arguments)}function A(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(s){}return!1}var x=function(){function s(c){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=c.fetchSetup||a,this.controller=new self.AbortController,this.stats=new D.LoadStats}var v=s.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(m,R,E){var f=this,g=this.stats;if(g.loading.start)throw new Error("Loader can only be used once.");g.loading.start=self.performance.now();var h=d(m,this.controller.signal),o=E.onProgress,S=m.responseType==="arraybuffer",b=S?"byteLength":"length";this.context=m,this.config=R,this.callbacks=E,this.request=this.fetchSetup(m,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){f.abortInternal(),E.onTimeout(g,m,f.response)},R.timeout),self.fetch(this.request).then(function(T){if(f.response=f.loader=T,!T.ok){var N=T.status,z=T.statusText;throw new l(z||"fetch, bad network response",N,T)}return g.loading.first=Math.max(self.performance.now(),g.loading.start),g.total=parseInt(T.headers.get("Content-Length")||"0"),o&&Object(K.isFiniteNumber)(R.highWaterMark)?f.loadProgressively(T,g,m,R.highWaterMark,o):S?T.arrayBuffer():T.text()}).then(function(T){var N=f.response;self.clearTimeout(f.requestTimeout),g.loading.end=Math.max(self.performance.now(),g.loading.first),g.loaded=g.total=T[b];var z={url:N.url,data:T};o&&!Object(K.isFiniteNumber)(R.highWaterMark)&&o(g,m,T,N),E.onSuccess(z,g,m,N)}).catch(function(T){if(self.clearTimeout(f.requestTimeout),g.aborted)return;var N=T.code||0;E.onError({code:N,text:T.message},m,T.details)})},v.getCacheAge=function(){var m=null;if(this.response){var R=this.response.headers.get("age");m=R?parseFloat(R):null}return m},v.loadProgressively=function(m,R,E,f,g){f===void 0&&(f=0);var h=new P.default,o=m.body.getReader(),S=function b(){return o.read().then(function(T){if(T.done)return h.dataLength&&g(R,E,h.flush(),m),Promise.resolve(new ArrayBuffer(0));var N=T.value,z=N.length;return R.loaded+=z,z<f||h.dataLength?(h.push(N),h.dataLength>=f&&g(R,E,h.flush(),m)):g(R,E,N,m),b()}).catch(function(){return Promise.reject()})};return S()},s}();function d(s,v){var c={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(O({},s.headers))};return s.rangeEnd&&c.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),c}function a(s,v){return new self.Request(s.url,v)}var l=function(s){H(v,s);function v(c,m,R){var E;return E=s.call(this,c)||this,E.code=void 0,E.details=void 0,E.code=m,E.details=R,E}return v}(W(Error));X.default=x},"./src/utils/imsc1-ttml-parser.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"IMSC1_CODEC",function(){return y}),M.d(X,"parseIMSC1",function(){return A});var K=M("./src/utils/mp4-tools.ts"),D=M("./src/utils/vttparser.ts"),P=M("./src/utils/vttcue.ts"),H=M("./src/demux/id3.ts"),W=M("./src/utils/timescale-conversion.ts"),_=M("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(f){for(var g=1;g<arguments.length;g++){var h=arguments[g];for(var o in h)Object.prototype.hasOwnProperty.call(h,o)&&(f[o]=h[o])}return f},L.apply(this,arguments)}var y="stpp.ttml.im1t",C=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,k=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,O={left:"start",center:"center",right:"end",start:"start",end:"end"};function A(f,g,h,o,S){var b=Object(K.findBox)(new Uint8Array(f),["mdat"]);if(b.length===0){S(new Error("Could not parse IMSC1 mdat"));return}var T=b[0],N=Object(H.utf8ArrayToStr)(new Uint8Array(f,T.start,T.end-T.start)),z=Object(W.toTimescaleFromScale)(g,1,h);try{o(x(N,z))}catch(Y){S(Y)}}function x(f,g){var h=new DOMParser,o=h.parseFromString(f,"text/xml"),S=o.getElementsByTagName("tt")[0];if(!S)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},T=Object.keys(b).reduce(function(G,F){return G[F]=S.getAttribute("ttp:"+F)||b[F],G},{}),N=S.getAttribute("xml:space")!=="preserve",z=a(d(S,"styling","style")),Y=a(d(S,"layout","region")),te=d(S,"body","[begin]");return[].map.call(te,function(G){var F=l(G,N);if(!F||!G.hasAttribute("begin"))return null;var re=m(G.getAttribute("begin"),T),le=m(G.getAttribute("dur"),T),Ee=m(G.getAttribute("end"),T);if(re===null)throw c(G);if(Ee===null){if(le===null)throw c(G);Ee=re+le}var Oe=new P.default(re-g,Ee-g,F);Oe.id=Object(_.generateCueId)(Oe.startTime,Oe.endTime,Oe.text);var Ye=Y[G.getAttribute("region")],Pe=z[G.getAttribute("style")];Oe.position=10,Oe.size=80;var Be=s(Ye,Pe),Ue=Be.textAlign;if(Ue){var Ne=O[Ue];Ne&&(Oe.lineAlign=Ne),Oe.align=Ue}return L(Oe,Be),Oe}).filter(function(G){return G!==null})}function d(f,g,h){var o=f.getElementsByTagName(g)[0];return o?[].slice.call(o.querySelectorAll(h)):[]}function a(f){return f.reduce(function(g,h){var o=h.getAttribute("xml:id");return o&&(g[o]=h),g},{})}function l(f,g){return[].slice.call(f.childNodes).reduce(function(h,o,S){var b;return o.nodeName==="br"&&S?h+`
|
|
`:(b=o.childNodes)!==null&&b!==void 0&&b.length?l(o,g):g?h+o.textContent.trim().replace(/\s+/g," "):h+o.textContent},"")}function s(f,g){var h="http://www.w3.org/ns/ttml#styling",o=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return o.reduce(function(S,b){var T=v(g,h,b)||v(f,h,b);return T&&(S[b]=T),S},{})}function v(f,g,h){return f.hasAttributeNS(g,h)?f.getAttributeNS(g,h):null}function c(f){return new Error("Could not parse ttml timestamp "+f)}function m(f,g){if(!f)return null;var h=Object(D.parseTimeStamp)(f);return h===null&&(C.test(f)?h=R(f,g):k.test(f)&&(h=E(f,g))),h}function R(f,g){var h=C.exec(f),o=(h[4]|0)+(h[5]|0)/g.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+o/g.frameRate}function E(f,g){var h=k.exec(f),o=Number(h[1]),S=h[2];switch(S){case"h":return o*3600;case"m":return o*60;case"ms":return o*1e3;case"f":return o/g.frameRate;case"t":return o/g.tickRate}return o}},"./src/utils/logger.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"enableLogs",function(){return _}),M.d(X,"logger",function(){return L});var K=function(){},D={trace:K,debug:K,log:K,warn:K,info:K,error:K},P=D;function H(y){var C=self.console[y];return C?C.bind(self.console,"["+y+"] >"):K}function W(y){for(var C=arguments.length,k=new Array(C>1?C-1:0),O=1;O<C;O++)k[O-1]=arguments[O];k.forEach(function(A){P[A]=y[A]?y[A].bind(y):H(A)})}function _(y){if(self.console&&y===!0||typeof y=="object"){W(y,"debug","log","info","warn","error");try{P.log()}catch(C){P=D}}else P=D}var L=P},"./src/utils/mediakeys-helper.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"KeySystems",function(){return K}),M.d(X,"requestMediaKeySystemAccess",function(){return D});var K;(function(P){P.WIDEVINE="com.widevine.alpha",P.PLAYREADY="com.microsoft.playready"})(K||(K={}));var D=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"getMediaSource",function(){return K});function K(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"bin2str",function(){return W}),M.d(X,"readUint16",function(){return _}),M.d(X,"readUint32",function(){return L}),M.d(X,"writeUint32",function(){return y}),M.d(X,"findBox",function(){return C}),M.d(X,"parseSegmentIndex",function(){return k}),M.d(X,"parseInitSegment",function(){return O}),M.d(X,"getStartDTS",function(){return A}),M.d(X,"getDuration",function(){return x}),M.d(X,"computeRawDurationFromSamples",function(){return d}),M.d(X,"offsetStartDTS",function(){return a}),M.d(X,"segmentValidRange",function(){return l}),M.d(X,"appendUint8Array",function(){return s});var K=M("./src/utils/typed-array.ts"),D=M("./src/loader/fragment.ts"),P=Math.pow(2,32)-1,H=[].push;function W(v){return String.fromCharCode.apply(null,v)}function _(v,c){"data"in v&&(c+=v.start,v=v.data);var m=v[c]<<8|v[c+1];return m<0?65536+m:m}function L(v,c){"data"in v&&(c+=v.start,v=v.data);var m=v[c]<<24|v[c+1]<<16|v[c+2]<<8|v[c+3];return m<0?4294967296+m:m}function y(v,c,m){"data"in v&&(c+=v.start,v=v.data),v[c]=m>>24,v[c+1]=m>>16&255,v[c+2]=m>>8&255,v[c+3]=m&255}function C(v,c){var m=[];if(!c.length)return m;var R,E,f;"data"in v?(R=v.data,E=v.start,f=v.end):(R=v,E=0,f=R.byteLength);for(var g=E;g<f;){var h=L(R,g),o=W(R.subarray(g+4,g+8)),S=h>1?g+h:f;if(o===c[0])if(c.length===1)m.push({data:R,start:g+8,end:S});else{var b=C({data:R,start:g+8,end:S},c.slice(1));b.length&&H.apply(m,b)}g=S}return m}function k(v){var c=C(v,["moov"]),m=c[0],R=m?m.end:null,E=C(v,["sidx"]);if(!E||!E[0])return null;var f=[],g=E[0],h=g.data[0],o=h===0?8:16,S=L(g,o);o+=4;var b=0,T=0;h===0?o+=8:o+=16,o+=2;var N=g.end+T,z=_(g,o);o+=2;for(var Y=0;Y<z;Y++){var te=o,G=L(g,te);te+=4;var F=G&2147483647,re=(G&2147483648)>>>31;if(re===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var le=L(g,te);te+=4,f.push({referenceSize:F,subsegmentDuration:le,info:{duration:le/S,start:N,end:N+F-1}}),N+=F,te+=4,o=te}return{earliestPresentationTime:b,timescale:S,version:h,referencesCount:z,references:f,moovEndOffset:R}}function O(v){for(var c=[],m=C(v,["moov","trak"]),R=0;R<m.length;R++){var E=m[R],f=C(E,["tkhd"])[0];if(f){var g=f.data[f.start],h=g===0?12:20,o=L(f,h),S=C(E,["mdia","mdhd"])[0];if(S){g=S.data[S.start],h=g===0?12:20;var b=L(S,h),T=C(E,["mdia","hdlr"])[0];if(T){var N=W(T.data.subarray(T.start+8,T.start+12)),z={soun:D.ElementaryStreamTypes.AUDIO,vide:D.ElementaryStreamTypes.VIDEO}[N];if(z){var Y=C(E,["mdia","minf","stbl","stsd"])[0],te=void 0;Y&&(te=W(Y.data.subarray(Y.start+12,Y.start+16))),c[o]={timescale:b,type:z},c[z]={timescale:b,id:o,codec:te}}}}}}var G=C(v,["moov","mvex","trex"]);return G.forEach(function(F){var re=L(F,4),le=c[re];le&&(le.default={duration:L(F,12),flags:L(F,20)})}),c}function A(v,c){return C(c,["moof","traf"]).reduce(function(m,R){var E=C(R,["tfdt"])[0],f=E.data[E.start],g=C(R,["tfhd"]).reduce(function(h,o){var S=L(o,4),b=v[S];if(b){var T=L(E,4);f===1&&(T*=Math.pow(2,32),T+=L(E,8));var N=b.timescale||9e4,z=T/N;if(isFinite(z)&&(h===null||z<h))return z}return h},null);return g!==null&&isFinite(g)&&(m===null||g<m)?g:m},null)||0}function x(v,c){for(var m=0,R=0,E=0,f=C(v,["moof","traf"]),g=0;g<f.length;g++){var h=f[g],o=C(h,["tfhd"])[0],S=L(o,4),b=c[S];if(!b)continue;var T=b.default,N=L(o,0)|(T==null?void 0:T.flags),z=T==null?void 0:T.duration;N&8&&(N&2?z=L(o,12):z=L(o,8));for(var Y=b.timescale||9e4,te=C(h,["trun"]),G=0;G<te.length;G++){if(z){var F=L(te[G],4);m=z*F}else m=d(te[G]);b.type===D.ElementaryStreamTypes.VIDEO?R+=m/Y:b.type===D.ElementaryStreamTypes.AUDIO&&(E+=m/Y)}}if(R===0&&E===0){var re=k(v);if(re!=null&&re.references)return re.references.reduce(function(le,Ee){return le+Ee.info.duration||0},0)}return R||E}function d(v){var c=L(v,0),m=8;c&1&&(m+=4),c&4&&(m+=4);for(var R=0,E=L(v,4),f=0;f<E;f++){if(c&256){var g=L(v,m);R+=g,m+=4}c&512&&(m+=4),c&1024&&(m+=4),c&2048&&(m+=4)}return R}function a(v,c,m){C(c,["moof","traf"]).forEach(function(R){C(R,["tfhd"]).forEach(function(E){var f=L(E,4),g=v[f];if(!g)return;var h=g.timescale||9e4;C(R,["tfdt"]).forEach(function(o){var S=o.data[o.start],b=L(o,4);if(S===0)y(o,4,b-m*h);else{b*=Math.pow(2,32),b+=L(o,8),b-=m*h,b=Math.max(b,0);var T=Math.floor(b/(P+1)),N=Math.floor(b%(P+1));y(o,4,T),y(o,8,N)}})})})}function l(v){var c={valid:null,remainder:null},m=C(v,["moof"]);if(m){if(m.length<2)return c.remainder=v,c}else return c;var R=m[m.length-1];return c.valid=Object(K.sliceUint8)(v,0,R.start-8),c.remainder=Object(K.sliceUint8)(v,R.start-8),c}function s(v,c){var m=new Uint8Array(v.length+c.length);return m.set(v),m.set(c,v.length),m}},"./src/utils/output-filter.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"default",function(){return K});var K=function(){function D(H,W){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=W}var P=D.prototype;return P.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},P.newCue=function(W,_,L){(this.startTime===null||this.startTime>W)&&(this.startTime=W),this.endTime=_,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},D}()},"./src/utils/texttrack-utils.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"sendAddTrackEvent",function(){return D}),M.d(X,"addCueToTrack",function(){return P}),M.d(X,"clearCurrentCues",function(){return H}),M.d(X,"removeCuesInRange",function(){return W}),M.d(X,"getCuesInRange",function(){return L});var K=M("./src/utils/logger.ts");function D(y,C){var k;try{k=new Event("addtrack")}catch(O){k=document.createEvent("Event"),k.initEvent("addtrack",!1,!1)}k.track=y,C.dispatchEvent(k)}function P(y,C){var k=y.mode;if(k==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(C.id))try{if(y.addCue(C),!y.cues.getCueById(C.id))throw new Error("addCue is failed for: "+C)}catch(A){K.logger.debug("[texttrack-utils]: "+A);var O=new self.TextTrackCue(C.startTime,C.endTime,C.text);O.id=C.id,y.addCue(O)}k==="disabled"&&(y.mode=k)}function H(y){var C=y.mode;if(C==="disabled"&&(y.mode="hidden"),y.cues)for(var k=y.cues.length;k--;)y.removeCue(y.cues[k]);C==="disabled"&&(y.mode=C)}function W(y,C,k){var O=y.mode;if(O==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var A=L(y.cues,C,k),x=0;x<A.length;x++)y.removeCue(A[x]);O==="disabled"&&(y.mode=O)}function _(y,C){if(C<y[0].startTime)return 0;var k=y.length-1;if(C>y[k].endTime)return-1;for(var O=0,A=k;O<=A;){var x=Math.floor((A+O)/2);if(C<y[x].startTime)A=x-1;else if(C>y[x].startTime&&O<k)O=x+1;else return x}return y[O].startTime-C<C-y[A].startTime?O:A}function L(y,C,k){var O=[],A=_(y,C);if(A>-1)for(var x=A,d=y.length;x<d;x++){var a=y[x];if(a.startTime>=C&&a.endTime<=k)O.push(a);else if(a.startTime>k)return O}return O}},"./src/utils/time-ranges.ts":function(ae,X,M){"use strict";M.r(X);var K={toString:function(P){for(var H="",W=P.length,_=0;_<W;_++)H+="["+P.start(_).toFixed(3)+","+P.end(_).toFixed(3)+"]";return H}};X.default=K},"./src/utils/timescale-conversion.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"toTimescaleFromBase",function(){return D}),M.d(X,"toTimescaleFromScale",function(){return P}),M.d(X,"toMsFromMpegTsClock",function(){return H}),M.d(X,"toMpegTsClockFromTimescale",function(){return W});var K=9e4;function D(_,L,y,C){y===void 0&&(y=1),C===void 0&&(C=!1);var k=_*L*y;return C?Math.round(k):k}function P(_,L,y,C){return y===void 0&&(y=1),C===void 0&&(C=!1),D(_,L,1/y,C)}function H(_,L){return L===void 0&&(L=!1),D(_,1e3,1/K,L)}function W(_,L){return L===void 0&&(L=1),D(_,K,1/L)}},"./src/utils/typed-array.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"sliceUint8",function(){return K});function K(D,P,H){return Uint8Array.prototype.slice?D.slice(P,H):new Uint8Array(Array.prototype.slice.call(D,P,H))}},"./src/utils/vttcue.ts":function(ae,X,M){"use strict";M.r(X),X.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var K=["","lr","rl"],D=["start","middle","end","left","right"];function P(y,C){if(typeof C!="string")return!1;if(!Array.isArray(y))return!1;var k=C.toLowerCase();return~y.indexOf(k)?k:!1}function H(y){return P(K,y)}function W(y){return P(D,y)}function _(y){for(var C=arguments.length,k=new Array(C>1?C-1:0),O=1;O<C;O++)k[O-1]=arguments[O];for(var A=1;A<arguments.length;A++){var x=arguments[A];for(var d in x)y[d]=x[d]}return y}function L(y,C,k){var O=this,A={enumerable:!0};O.hasBeenReset=!1;var x="",d=!1,a=y,l=C,s=k,v=null,c="",m=!0,R="auto",E="start",f=50,g="middle",h=50,o="middle";Object.defineProperty(O,"id",_({},A,{get:function(){return x},set:function(b){x=""+b}})),Object.defineProperty(O,"pauseOnExit",_({},A,{get:function(){return d},set:function(b){d=!!b}})),Object.defineProperty(O,"startTime",_({},A,{get:function(){return a},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");a=b,this.hasBeenReset=!0}})),Object.defineProperty(O,"endTime",_({},A,{get:function(){return l},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");l=b,this.hasBeenReset=!0}})),Object.defineProperty(O,"text",_({},A,{get:function(){return s},set:function(b){s=""+b,this.hasBeenReset=!0}})),Object.defineProperty(O,"region",_({},A,{get:function(){return v},set:function(b){v=b,this.hasBeenReset=!0}})),Object.defineProperty(O,"vertical",_({},A,{get:function(){return c},set:function(b){var T=H(b);if(T===!1)throw new SyntaxError("An invalid or illegal string was specified.");c=T,this.hasBeenReset=!0}})),Object.defineProperty(O,"snapToLines",_({},A,{get:function(){return m},set:function(b){m=!!b,this.hasBeenReset=!0}})),Object.defineProperty(O,"line",_({},A,{get:function(){return R},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=b,this.hasBeenReset=!0}})),Object.defineProperty(O,"lineAlign",_({},A,{get:function(){return E},set:function(b){var T=W(b);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");E=T,this.hasBeenReset=!0}})),Object.defineProperty(O,"position",_({},A,{get:function(){return f},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");f=b,this.hasBeenReset=!0}})),Object.defineProperty(O,"positionAlign",_({},A,{get:function(){return g},set:function(b){var T=W(b);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");g=T,this.hasBeenReset=!0}})),Object.defineProperty(O,"size",_({},A,{get:function(){return h},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");h=b,this.hasBeenReset=!0}})),Object.defineProperty(O,"align",_({},A,{get:function(){return o},set:function(b){var T=W(b);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");o=T,this.hasBeenReset=!0}})),O.displayState=void 0}return L.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"parseTimeStamp",function(){return P}),M.d(X,"fixLineBreaks",function(){return C}),M.d(X,"VTTParser",function(){return k});var K=M("./src/utils/vttcue.ts"),D=function(){function O(){}var A=O.prototype;return A.decode=function(d,a){if(!d)return"";if(typeof d!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))},O}();function P(O){function A(d,a,l,s){return(d|0)*3600+(a|0)*60+(l|0)+parseFloat(s||0)}var x=O.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return x?parseFloat(x[2])>59?A(x[2],x[3],0,x[4]):A(x[1],x[2],x[3],x[4]):null}var H=function(){function O(){this.values=Object.create(null)}var A=O.prototype;return A.set=function(d,a){!this.get(d)&&a!==""&&(this.values[d]=a)},A.get=function(d,a,l){return l?this.has(d)?this.values[d]:a[l]:this.has(d)?this.values[d]:a},A.has=function(d){return d in this.values},A.alt=function(d,a,l){for(var s=0;s<l.length;++s)if(a===l[s]){this.set(d,a);break}},A.integer=function(d,a){/^-?\d+$/.test(a)&&this.set(d,parseInt(a,10))},A.percent=function(d,a){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(a)){var l=parseFloat(a);if(l>=0&&l<=100)return this.set(d,l),!0}return!1},O}();function W(O,A,x,d){var a=d?O.split(d):[O];for(var l in a){if(typeof a[l]!="string")continue;var s=a[l].split(x);if(s.length!==2)continue;var v=s[0],c=s[1];A(v,c)}}var _=new K.default(0,0,""),L=_.align==="middle"?"middle":"center";function y(O,A,x){var d=O;function a(){var v=P(O);if(v===null)throw new Error("Malformed timestamp: "+d);return O=O.replace(/^[^\sa-zA-Z-]+/,""),v}function l(v,c){var m=new H;W(v,function(f,g){var h;switch(f){case"region":for(var o=x.length-1;o>=0;o--)if(x[o].id===g){m.set(f,x[o].region);break}break;case"vertical":m.alt(f,g,["rl","lr"]);break;case"line":h=g.split(","),m.integer(f,h[0]),m.percent(f,h[0])&&m.set("snapToLines",!1),m.alt(f,h[0],["auto"]),h.length===2&&m.alt("lineAlign",h[1],["start",L,"end"]);break;case"position":h=g.split(","),m.percent(f,h[0]),h.length===2&&m.alt("positionAlign",h[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":m.percent(f,g);break;case"align":m.alt(f,g,["start",L,"end","left","right"]);break}},/:/,/\s/),c.region=m.get("region",null),c.vertical=m.get("vertical","");var R=m.get("line","auto");R==="auto"&&_.line===-1&&(R=-1),c.line=R,c.lineAlign=m.get("lineAlign","start"),c.snapToLines=m.get("snapToLines",!0),c.size=m.get("size",100),c.align=m.get("align",L);var E=m.get("position","auto");E==="auto"&&_.position===50&&(E=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=E}function s(){O=O.replace(/^\s+/,"")}if(s(),A.startTime=a(),s(),O.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+d);O=O.substr(3),s(),A.endTime=a(),s(),l(O,A)}function C(O){return O.replace(/<br(?: \/)?>/gi,`
|
|
`)}var k=function(){function O(){this.state="INITIAL",this.buffer="",this.decoder=new D,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var A=O.prototype;return A.parse=function(d){var a=this;d&&(a.buffer+=a.decoder.decode(d,{stream:!0}));function l(){var E=a.buffer,f=0;for(E=C(E);f<E.length&&E[f]!=="\r"&&E[f]!==`
|
|
`;)++f;var g=E.substr(0,f);return E[f]==="\r"&&++f,E[f]===`
|
|
`&&++f,a.buffer=E.substr(f),g}function s(E){W(E,function(f,g){},/:/)}try{var v="";if(a.state==="INITIAL"){if(!/\r\n|\n/.test(a.buffer))return this;v=l();var c=v.match(/^()?WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new Error("Malformed WebVTT signature.");a.state="HEADER"}for(var m=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;m?m=!1:v=l();switch(a.state){case"HEADER":/:/.test(v)?s(v):v||(a.state="ID");continue;case"NOTE":v||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){a.state="NOTE";break}if(!v)continue;if(a.cue=new K.default(0,0,""),a.state="CUE",v.indexOf("-->")===-1){a.cue.id=v;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{y(v,a.cue,a.regionList)}catch(E){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var R=v.indexOf("-->")!==-1;if(!v||R&&(m=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=`
|
|
`),a.cue.text+=v}continue;case"BADCUE":v||(a.state="ID")}}}catch(E){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},A.flush=function(){var d=this;try{if((d.cue||d.state==="HEADER")&&(d.buffer+=`
|
|
|
|
`,d.parse()),d.state==="INITIAL"||d.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(a){d.onparsingerror&&d.onparsingerror(a)}return d.onflush&&d.onflush(),this},O}()},"./src/utils/webvtt-parser.ts":function(ae,X,M){"use strict";M.r(X),M.d(X,"generateCueId",function(){return k}),M.d(X,"parseWebVTT",function(){return A});var K=M("./src/polyfills/number.ts"),D=M("./src/utils/vttparser.ts"),P=M("./src/demux/id3.ts"),H=M("./src/utils/timescale-conversion.ts"),W=M("./src/remux/mp4-remuxer.ts"),_=/\r\n|\n\r|\n|\r/g,L=function(d,a,l){return l===void 0&&(l=0),d.substr(l,a.length)===a},y=function(d){var a=parseInt(d.substr(-3)),l=parseInt(d.substr(-6,2)),s=parseInt(d.substr(-9,2)),v=d.length>9?parseInt(d.substr(0,d.indexOf(":"))):0;if(!Object(K.isFiniteNumber)(a)||!Object(K.isFiniteNumber)(l)||!Object(K.isFiniteNumber)(s)||!Object(K.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+d);return a+=1e3*l,a+=60*1e3*s,a+=60*60*1e3*v,a},C=function(d){for(var a=5381,l=d.length;l;)a=a*33^d.charCodeAt(--l);return(a>>>0).toString()};function k(x,d,a){return C(x.toString())+C(d.toString())+C(a)}var O=function(d,a,l){var s=d[a],v=d[s.prevCC];if(!v||!v.new&&s.new){d.ccOffset=d.presentationOffset=s.start,s.new=!1;return}for(;(c=v)!==null&&c!==void 0&&c.new;){var c;d.ccOffset+=s.start-v.start,s.new=!1,s=v,v=d[s.prevCC]}d.presentationOffset=l};function A(x,d,a,l,s,v,c,m){var R=new D.VTTParser,E=Object(P.utf8ArrayToStr)(new Uint8Array(x)).trim().replace(_,`
|
|
`).split(`
|
|
`),f=[],g=Object(H.toMpegTsClockFromTimescale)(d,a),h="00:00.000",o=0,S=0,b,T=!0,N=!1;R.oncue=function(z){var Y=l[s],te=l.ccOffset,G=(o-g)/9e4;if(Y!=null&&Y.new&&(S!==void 0?te=l.ccOffset=Y.start:O(l,s,G)),G&&(te=G-l.presentationOffset),N){var F=z.endTime-z.startTime,re=Object(W.normalizePts)((z.startTime+te-S)*9e4,v*9e4)/9e4;z.startTime=re,z.endTime=re+F}var le=z.text.trim();z.text=decodeURIComponent(encodeURIComponent(le)),z.id||(z.id=k(z.startTime,z.endTime,le)),z.endTime>0&&f.push(z)},R.onparsingerror=function(z){b=z},R.onflush=function(){if(b){m(b);return}c(f)},E.forEach(function(z){if(T)if(L(z,"X-TIMESTAMP-MAP=")){T=!1,N=!0,z.substr(16).split(",").forEach(function(Y){L(Y,"LOCAL:")?h=Y.substr(6):L(Y,"MPEGTS:")&&(o=parseInt(Y.substr(7)))});try{S=y(h)/1e3}catch(Y){N=!1,b=Y}return}else z===""&&(T=!1);R.parse(z+`
|
|
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(ae,X,M){"use strict";M.r(X);var K=M("./src/utils/logger.ts"),D=M("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,H=function(){function W(L){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=L?L.xhrSetup:null,this.stats=new D.LoadStats,this.retryDelay=0}var _=W.prototype;return _.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},_.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},_.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},_.load=function(y,C,k){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=C,this.callbacks=k,this.retryDelay=C.retryDelay,this.loadInternal()},_.loadInternal=function(){var y=this.config,C=this.context;if(!y)return;var k=this.loader=new self.XMLHttpRequest,O=this.stats;O.loading.first=0,O.loaded=0;var A=this.xhrSetup;try{if(A)try{A(k,C.url)}catch(a){k.open("GET",C.url,!0),A(k,C.url)}k.readyState||k.open("GET",C.url,!0);var x=this.context.headers;if(x)for(var d in x)k.setRequestHeader(d,x[d])}catch(a){this.callbacks.onError({code:k.status,text:a.message},C,k);return}C.rangeEnd&&k.setRequestHeader("Range","bytes="+C.rangeStart+"-"+(C.rangeEnd-1)),k.onreadystatechange=this.readystatechange.bind(this),k.onprogress=this.loadprogress.bind(this),k.responseType=C.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),k.send()},_.readystatechange=function(){var y=this.context,C=this.loader,k=this.stats;if(!y||!C)return;var O=C.readyState,A=this.config;if(k.aborted)return;if(O>=2)if(self.clearTimeout(this.requestTimeout),k.loading.first===0&&(k.loading.first=Math.max(self.performance.now(),k.loading.start)),O===4){C.onreadystatechange=null,C.onprogress=null;var x=C.status;if(x>=200&&x<300){k.loading.end=Math.max(self.performance.now(),k.loading.first);var d,a;if(y.responseType==="arraybuffer"?(d=C.response,a=d.byteLength):(d=C.responseText,a=d.length),k.loaded=k.total=a,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(k,y,d,C),!this.callbacks)return;var s={url:C.responseURL,data:d};this.callbacks.onSuccess(s,k,y,C)}else k.retry>=A.maxRetry||x>=400&&x<499?(K.logger.error(x+" while loading "+y.url),this.callbacks.onError({code:x,text:C.statusText},y,C)):(K.logger.warn(x+" while loading "+y.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),k.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),A.timeout)},_.loadtimeout=function(){K.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},_.loadprogress=function(y){var C=this.stats;C.loaded=y.loaded,y.lengthComputable&&(C.total=y.total)},_.getCacheAge=function(){var y=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var C=this.loader.getResponseHeader("age");y=C?parseFloat(C):null}return y},W}();X.default=H}}).default})},vHTk:function(Ge,Fe,Q){Ge.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},yslc:function(Ge,Fe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAAOHklEQVR4Xu1dCXQURRr+emZyTO6D3BCEgKCInCKeK3IoiyIqlxLyQBRBV8DNhCCrS3Z9Cq66KOoi68ECKocCcutTLhUERM1MEpBLEuQmQMKEnDNd+6onEzKTuXqmJ5l0V/EeL+mp+qu+r77UVP1V9TcHffZbIJgOlhgDMmaAA8lTwVDxJQh5UMY4GTSFM8AJ+PW6cIDsBEEfhfPB4MuUAYvQaTowOwV1NXtB0E6mWBksBTNwTeiUBENud/CmHwBEKZgTBl2GDNgKnQIsyBkCM9kEEI0M8TJICmWgqdCFkT17MngsUignDLYMGXAsdAo0XzcPILkyxMwgKZAB50InhIMhZxUIGalAXhhkmTHgXOgU6PG8UFwxbgdBf5nhZnAUxoBroVMyjryQgMraPSDoqDBuGFwZMeBe6MLi9IWuIHW7QUisjLAzKApiwDOhC25H3T3g8TUICVYQPwyqTBjwXOgUsD4nC4RfIhPsDIaCGBAndEHsujwQMkdBHDGoMmBAvNAtPvZlAMmUAX4GQSEMeCf0wrxgmCu+ASF3K4QnBrOVM+Cd0Cnoorw4mIw/guD6Vs4Ba74CGPBe6IInJicDZn4PgDYK4IpBbMUM+CZ0Qey5t4M3bw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