svgedit/dist/editor/system/extensions/ext-server_opensave/ext-server_opensave.js

10 lines
137 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters!

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

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

System.register([],(function(t){"use strict";return{execute:function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&n.path)}},n.exports),n.exports}var check=function(t){return t&&t.Math==Math&&t},n=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof e&&e)||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},i=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,l={f:s&&!o.call({1:2},1)?function propertyIsEnumerable(t){var e=s(this,t);return!!e&&e.enumerable}:o},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},u={}.toString,classofRaw=function(t){return u.call(t).slice(8,-1)},h="".split,p=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?h.call(t,""):Object(t)}:Object,requireObjectCoercible=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},toIndexedObject=function(t){return p(requireObjectCoercible(t))},isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},toPrimitive=function(t,e){if(!isObject(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!isObject(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!isObject(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!isObject(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")},d={}.hasOwnProperty,has=function(t,e){return d.call(t,e)},v=n.document,g=isObject(v)&&isObject(v.createElement),documentCreateElement=function(t){return g?v.createElement(t):{}},b=!i&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),_=Object.getOwnPropertyDescriptor,w={f:i?_:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),b)try{return _(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!l.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},P=Object.defineProperty,C={f:i?P:function defineProperty(t,e,n){if(anObject(t),e=toPrimitive(e,!0),anObject(n),b)try{return P(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},k=i?function(t,e,n){return C.f(t,e,createPropertyDescriptor(1,n))}:function(t,e,n){return t[e]=n,t},setGlobal=function(t,e){try{k(n,t,e)}catch(i){n[t]=e}return e},E="__core-js_shared__",S=n[E]||setGlobal(E,{}),T=Function.toString;"function"!=typeof S.inspectSource&&(S.inspectSource=function(t){return T.call(t)});var A,O,M,V=S.inspectSource,B=n.WeakMap,R="function"==typeof B&&/native code/.test(V(B)),I=createCommonjsModule((function(t){(t.exports=function(t,e){return S[t]||(S[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),j=0,N=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++j+N).toString(36)},D=I("keys"),sharedKey=function(t){return D[t]||(D[t]=uid(t))},L={},G=n.WeakMap;if(R){var z=new G,W=z.get,X=z.has,$=z.set;A=function(t,e){return $.call(z,t,e),e},O=function(t){return W.call(z,t)||{}},M=function(t){return X.call(z,t)}}else{var U=sharedKey("state");L[U]=!0,A=function(t,e){return k(t,U,e),e},O=function(t){return has(t,U)?t[U]:{}},M=function(t){return has(t,U)}}var q,H,Y={set:A,get:O,has:M,enforce:function(t){return M(t)?O(t):A(t,{})},getterFor:function(t){return function(e){var n;if(!isObject(e)||(n=O(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},Q=createCommonjsModule((function(t){var e=Y.get,i=Y.enforce,o=String(String).split("String");(t.exports=function(t,e,s,l){var u=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,p=!!l&&!!l.noTargetGet;"function"==typeof s&&("string"!=typeof e||has(s,"name")||k(s,"name",e),i(s).source=o.join("string"==typeof e?e:"")),t!==n?(u?!p&&t[e]&&(h=!0):delete t[e],h?t[e]=s:k(t,e,s)):h?t[e]=s:setGlobal(e,s)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&e(this).source||V(this)}))})),Z=n,aFunction=function(t){return"function"==typeof t?t:void 0},getBuiltIn=function(t,e){return arguments.length<2?aFunction(Z[t])||aFunction(n[t]):Z[t]&&Z[t][e]||n[t]&&n[t][e]},J=Math.ceil,K=Math.floor,toInteger=function(t){return isNaN(t=+t)?0:(t>0?K:J)(t)},tt=Math.min,toLength=function(t){return t>0?tt(toInteger(t),9007199254740991):0},et=Math.max,rt=Math.min,toAbsoluteIndex=function(t,e){var n=toInteger(t);return n<0?et(n+e,0):rt(n,e)},createMethod=function(t){return function(e,n,i){var o,s=toIndexedObject(e),l=toLength(s.length),u=toAbsoluteIndex(i,l);if(t&&n!=n){for(;l>u;)if((o=s[u++])!=o)return!0}else for(;l>u;u++)if((t||u in s)&&s[u]===n)return t||u||0;return!t&&-1}},nt={includes:createMethod(!0),indexOf:createMethod(!1)},at=nt.indexOf,objectKeysInternal=function(t,e){var n,i=toIndexedObject(t),o=0,s=[];for(n in i)!has(L,n)&&has(i,n)&&s.push(n);for(;e.length>o;)has(i,n=e[o++])&&(~at(s,n)||s.push(n));return s},it=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ot=it.concat("length","prototype"),st={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,ot)}},lt={f:Object.getOwnPropertySymbols},ut=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var e=st.f(anObject(t)),n=lt.f;return n?e.concat(n(t)):e},copyConstructorProperties=function(t,e){for(var n=ut(e),i=C.f,o=w.f,s=0;s<n.length;s++){var l=n[s];has(t,l)||i(t,l,o(e,l))}},ct=/#|\.prototype\./,isForced=function(t,e){var n=ft[ht(t)];return n==dt||n!=pt&&("function"==typeof e?fails(e):!!e)},ht=isForced.normalize=function(t){return String(t).replace(ct,".").toLowerCase()},ft=isForced.data={},pt=isForced.NATIVE="N",dt=isForced.POLYFILL="P",vt=isForced,yt=w.f,_export=function(t,e){var i,o,s,l,u,h=t.target,p=t.global,d=t.stat;if(i=p?n:d?n[h]||setGlobal(h,{}):(n[h]||{}).prototype)for(o in e){if(l=e[o],s=t.noTargetGet?(u=yt(i,o))&&u.value:i[o],!vt(p?o:h+(d?".":"#")+o,t.forced)&&void 0!==s){if(typeof l==typeof s)continue;copyConstructorProperties(l,s)}(t.sham||s&&s.sham)&&k(l,"sham",!0),Q(i,o,l,t)}},gt=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},toObject=function(t){return Object(requireObjectCoercible(t))},createProperty=function(t,e,n){var i=toPrimitive(e);i in t?C.f(t,i,createPropertyDescriptor(0,n)):t[i]=n},mt=!!Object.getOwnPropertySymbols&&!fails((function(){return!String(Symbol())})),bt=mt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,_t=I("wks"),xt=n.Symbol,wt=bt?xt:xt&&xt.withoutSetter||uid,wellKnownSymbol=function(t){return has(_t,t)||(mt&&has(xt,t)?_t[t]=xt[t]:_t[t]=wt("Symbol."+t)),_t[t]},Pt=wellKnownSymbol("species"),arraySpeciesCreate=function(t,e){var n;return gt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!gt(n.prototype)?isObject(n)&&null===(n=n[Pt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Ct=getBuiltIn("navigator","userAgent")||"",kt=n.process,Et=kt&&kt.versions,St=Et&&Et.v8;St?H=(q=St.split("."))[0]+q[1]:Ct&&(!(q=Ct.match(/Edge\/(\d+)/))||q[1]>=74)&&(q=Ct.match(/Chrome\/(\d+)/))&&(H=q[1]);var Tt=H&&+H,At=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return Tt>=51||!fails((function(){var e=[];return(e.constructor={})[At]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ot=wellKnownSymbol("isConcatSpreadable"),Mt=9007199254740991,Vt="Maximum allowed index exceeded",Bt=Tt>=51||!fails((function(){var t=[];return t[Ot]=!1,t.concat()[0]!==t})),Rt=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!isObject(t))return!1;var e=t[Ot];return void 0!==e?!!e:gt(t)};_export({target:"Array",proto:!0,forced:!Bt||!Rt},{concat:function concat(t){var e,n,i,o,s,l=toObject(this),u=arraySpeciesCreate(l,0),h=0;for(e=-1,i=arguments.length;e<i;e++)if(isConcatSpreadable(s=-1===e?l:arguments[e])){if(h+(o=toLength(s.length))>Mt)throw TypeError(Vt);for(n=0;n<o;n++,h++)n in s&&createProperty(u,h,s[n])}else{if(h>=Mt)throw TypeError(Vt);createProperty(u,h++,s)}return u.length=h,u}});var arrayMethodIsStrict=function(t,e){var n=[][t];return!!n&&fails((function(){n.call(null,e||function(){throw 1},1)}))},It=[].join,jt=p!=Object,Nt=arrayMethodIsStrict("join",",");_export({target:"Array",proto:!0,forced:jt||!Nt},{join:function join(t){return It.call(toIndexedObject(this),void 0===t?",":t)}});var Dt={};Dt[wellKnownSymbol("toStringTag")]="z";var Lt="[object z]"===String(Dt),Ft=wellKnownSymbol("toStringTag"),Gt="Arguments"==classofRaw(function(){return arguments}()),zt=Lt?classofRaw:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ft))?n:Gt?classofRaw(e):"Object"==(i=classofRaw(e))&&"function"==typeof e.callee?"Arguments":i},Wt=Lt?{}.toString:function toString(){return"[object "+zt(this)+"]"};Lt||Q(Object.prototype,"toString",Wt,{unsafe:!0});var Xt=n.Promise,$t=C.f,Ut=wellKnownSymbol("toStringTag"),setToStringTag=function(t,e,n){t&&!has(t=n?t:t.prototype,Ut)&&$t(t,Ut,{configurable:!0,value:e})},qt=wellKnownSymbol("species"),aFunction$1=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Ht={},Yt=wellKnownSymbol("iterator"),Qt=Array.prototype,functionBindContext=function(t,e,n){if(aFunction$1(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}},Zt=wellKnownSymbol("iterator"),callWithSafeIterationClosing=function(t,e,n,i){try{return i?e(anObject(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&anObject(o.call(t)),e}},Jt=createCommonjsModule((function(t){var Result=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,e,n,i,o){var s,l,u,h,p,d,v,g,b=functionBindContext(e,n,i?2:1);if(o)s=t;else{if("function"!=typeof(l=function(t){if(null!=t)return t[Zt]||t["@@iterator"]||Ht[zt(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(g=l)&&(Ht.Array===g||Qt[Yt]===g)){for(u=0,h=toLength(t.length);h>u;u++)if((p=i?b(anObject(v=t[u])[0],v[1]):b(t[u]))&&p instanceof Result)return p;return new Result(!1)}s=l.call(t)}for(d=s.next;!(v=d.call(s)).done;)if("object"==typeof(p=callWithSafeIterationClosing(s,b,v.value,i))&&p&&p instanceof Result)return p;return new Result(!1)}).stop=function(t){return new Result(!0,t)}})),Kt=wellKnownSymbol("iterator"),te=!1;try{var ee=0,re={next:function(){return{done:!!ee++}},return:function(){te=!0}};re[Kt]=function(){return this},Array.from(re,(function(){throw 2}))}catch(t){}var ne,ae,ie,oe=wellKnownSymbol("species"),speciesConstructor=function(t,e){var n,i=anObject(t).constructor;return void 0===i||null==(n=anObject(i)[oe])?e:aFunction$1(n)},se=getBuiltIn("document","documentElement"),le=/(iphone|ipod|ipad).*applewebkit/i.test(Ct),ue=n.location,ce=n.setImmediate,he=n.clearImmediate,fe=n.process,pe=n.MessageChannel,de=n.Dispatch,ve=0,ye={},ge="onreadystatechange",run=function(t){if(ye.hasOwnProperty(t)){var e=ye[t];delete ye[t],e()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){n.postMessage(t+"",ue.protocol+"//"+ue.host)};ce&&he||(ce=function setImmediate(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return ye[++ve]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},ne(ve),ve},he=function clearImmediate(t){delete ye[t]},"process"==classofRaw(fe)?ne=function(t){fe.nextTick(runner(t))}:de&&de.now?ne=function(t){de.now(runner(t))}:pe&&!le?(ie=(ae=new pe).port2,ae.port1.onmessage=listener,ne=functionBindContext(ie.postMessage,ie,1)):!n.addEventListener||"function"!=typeof postMessage||n.importScripts||fails(post)||"file:"===ue.protocol?ne=ge in documentCreateElement("script")?function(t){se.appendChild(documentCreateElement("script")).onreadystatechange=function(){se.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)}:(ne=post,n.addEventListener("message",listener,!1)));var me,be,_e,xe,we,Pe,Ce,ke,Ee={set:ce,clear:he},Se=w.f,Te=Ee.set,Ae=n.MutationObserver||n.WebKitMutationObserver,Oe=n.process,Me=n.Promise,Ve="process"==classofRaw(Oe),Be=Se(n,"queueMicrotask"),Re=Be&&Be.value;Re||(me=function(){var t,e;for(Ve&&(t=Oe.domain)&&t.exit();be;){e=be.fn,be=be.next;try{e()}catch(t){throw be?xe():_e=void 0,t}}_e=void 0,t&&t.enter()},Ve?xe=function(){Oe.nextTick(me)}:Ae&&!le?(we=!0,Pe=document.createTextNode(""),new Ae(me).observe(Pe,{characterData:!0}),xe=function(){Pe.data=we=!we}):Me&&Me.resolve?(Ce=Me.resolve(void 0),ke=Ce.then,xe=function(){ke.call(Ce,me)}):xe=function(){Te.call(n,me)});var Ie,je,Ne,De,Le=Re||function(t){var e={fn:t,next:void 0};_e&&(_e.next=e),be||(be=e,xe()),_e=e},PromiseCapability=function(t){var e,n;this.promise=new t((function(t,i){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=i})),this.resolve=aFunction$1(e),this.reject=aFunction$1(n)},Fe={f:function(t){return new PromiseCapability(t)}},promiseResolve=function(t,e){if(anObject(t),isObject(e)&&e.constructor===t)return e;var n=Fe.f(t);return(0,n.resolve)(e),n.promise},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Ge=Ee.set,ze=wellKnownSymbol("species"),We="Promise",Xe=Y.get,$e=Y.set,Ue=Y.getterFor(We),qe=Xt,He=n.TypeError,Ye=n.document,Qe=n.process,Ze=getBuiltIn("fetch"),Je=Fe.f,Ke=Je,tr="process"==classofRaw(Qe),er=!!(Ye&&Ye.createEvent&&n.dispatchEvent),rr="unhandledrejection",nr=vt(We,(function(){if(!(V(qe)!==String(qe))){if(66===Tt)return!0;if(!tr&&"function"!=typeof PromiseRejectionEvent)return!0}if(Tt>=51&&/native code/.test(qe))return!1;var t=qe.resolve(1),FakePromise=function(t){t((function(){}),(function(){}))};return(t.constructor={})[ze]=FakePromise,!(t.then((function(){}))instanceof FakePromise)})),ar=nr||!function(t,e){if(!e&&!te)return!1;var n=!1;try{var i={};i[Kt]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}((function(t){qe.all(t).catch((function(){}))})),isThenable=function(t){var e;return!(!isObject(t)||"function"!=typeof(e=t.then))&&e},notify$1=function(t,e,n){if(!e.notified){e.notified=!0;var i=e.reactions;Le((function(){for(var o=e.value,s=1==e.state,l=0;i.length>l;){var u,h,p,d=i[l++],v=s?d.ok:d.fail,g=d.resolve,b=d.reject,_=d.domain;try{v?(s||(2===e.rejection&&onHandleUnhandled(t,e),e.rejection=1),!0===v?u=o:(_&&_.enter(),u=v(o),_&&(_.exit(),p=!0)),u===d.promise?b(He("Promise-chain cycle")):(h=isThenable(u))?h.call(u,g,b):g(u)):b(o)}catch(t){_&&!p&&_.exit(),b(t)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&onUnhandled(t,e)}))}},dispatchEvent=function(t,e,i){var o,s;er?((o=Ye.createEvent("Event")).promise=e,o.reason=i,o.initEvent(t,!1,!0),n.dispatchEvent(o)):o={promise:e,reason:i},(s=n["on"+t])?s(o):t===rr&&function(t,e){var i=n.console;i&&i.error&&(1===arguments.length?i.error(t):i.error(t,e))}("Unhandled promise rejection",i)},onUnhandled=function(t,e){Ge.call(n,(function(){var n,i=e.value;if(isUnhandled(e)&&(n=perform((function(){tr?Qe.emit("unhandledRejection",i,t):dispatchEvent(rr,t,i)})),e.rejection=tr||isUnhandled(e)?2:1,n.error))throw n.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t,e){Ge.call(n,(function(){tr?Qe.emit("rejectionHandled",t):dispatchEvent("rejectionhandled",t,e.value)}))},bind=function(t,e,n,i){return function(o){t(e,n,o,i)}},internalReject=function(t,e,n,i){e.done||(e.done=!0,i&&(e=i),e.value=n,e.state=2,notify$1(t,e,!0))},internalResolve=function(t,e,n,i){if(!e.done){e.done=!0,i&&(e=i);try{if(t===n)throw He("Promise can't be resolved itself");var o=isThenable(n);o?Le((function(){var i={done:!1};try{o.call(n,bind(internalResolve,t,i,e),bind(internalReject,t,i,e))}catch(n){internalReject(t,i,n,e)}})):(e.value=n,e.state=1,notify$1(t,e,!1))}catch(n){internalReject(t,{done:!1},n,e)}}};nr&&(qe=function Promise(t){!function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,qe,We),aFunction$1(t),Ie.call(this);var e=Xe(this);try{t(bind(internalResolve,this,e),bind(internalReject,this,e))}catch(t){internalReject(this,e,t)}},(Ie=function Promise(t){$e(this,{type:We,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(t,e,n){for(var i in e)Q(t,i,e[i],n);return t}(qe.prototype,{then:function then(t,e){var n=Ue(this),i=Je(speciesConstructor(this,qe));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=tr?Qe.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&notify$1(this,n,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),je=function(){var t=new Ie,e=Xe(t);this.promise=t,this.resolve=bind(internalResolve,t,e),this.reject=bind(internalReject,t,e)},Fe.f=Je=function(t){return t===qe||t===Ne?new je(t):Ke(t)},"function"==typeof Xt&&(De=Xt.prototype.then,Q(Xt.prototype,"then",(function then(t,e){var n=this;return new qe((function(t,e){De.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof Ze&&_export({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(t){return promiseResolve(qe,Ze.apply(n,arguments))}}))),_export({global:!0,wrap:!0,forced:nr},{Promise:qe}),setToStringTag(qe,We,!1),function(t){var e=getBuiltIn(t),n=C.f;i&&e&&!e[qt]&&n(e,qt,{configurable:!0,get:function(){return this}})}(We),Ne=getBuiltIn(We),_export({target:We,stat:!0,forced:nr},{reject:function reject(t){var e=Je(this);return e.reject.call(void 0,t),e.promise}}),_export({target:We,stat:!0,forced:nr},{resolve:function resolve(t){return promiseResolve(this,t)}}),_export({target:We,stat:!0,forced:ar},{all:function all(t){var e=this,n=Je(e),i=n.resolve,o=n.reject,s=perform((function(){var n=aFunction$1(e.resolve),s=[],l=0,u=1;Jt(t,(function(t){var h=l++,p=!1;s.push(void 0),u++,n.call(e,t).then((function(t){p||(p=!0,s[h]=t,--u||i(s))}),o)})),--u||i(s)}));return s.error&&o(s.value),n.promise},race:function race(t){var e=this,n=Je(e),i=n.reject,o=perform((function(){var o=aFunction$1(e.resolve);Jt(t,(function(t){o.call(e,t).then(n.resolve,i)}))}));return o.error&&i(o.value),n.promise}});var regexpFlags=function(){var t=anObject(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e};function RE(t,e){return RegExp(t,e)}var ir,or,sr={UNSUPPORTED_Y:fails((function(){var t=RE("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:fails((function(){var t=RE("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},lr=RegExp.prototype.exec,ur=String.prototype.replace,cr=lr,hr=(ir=/a/,or=/b*/g,lr.call(ir,"a"),lr.call(or,"a"),0!==ir.lastIndex||0!==or.lastIndex),fr=sr.UNSUPPORTED_Y||sr.BROKEN_CARET,pr=void 0!==/()??/.exec("")[1];(hr||pr||fr)&&(cr=function exec(t){var e,n,i,o,s=this,l=fr&&s.sticky,u=regexpFlags.call(s),h=s.source,p=0,d=t;return l&&(-1===(u=u.replace("y","")).indexOf("g")&&(u+="g"),d=String(t).slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==t[s.lastIndex-1])&&(h="(?: "+h+")",d=" "+d,p++),n=new RegExp("^(?:"+h+")",u)),pr&&(n=new RegExp("^"+h+"$(?!\\s)",u)),hr&&(e=s.lastIndex),i=lr.call(l?n:s,d),l?i?(i.input=i.input.slice(p),i[0]=i[0].slice(p),i.index=s.lastIndex,s.lastIndex+=i[0].length):s.lastIndex=0:hr&&i&&(s.lastIndex=s.global?i.index+i[0].length:e),pr&&i&&i.length>1&&ur.call(i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i});var dr=cr;_export({target:"RegExp",proto:!0,forced:/./.exec!==dr},{exec:dr});var vr=wellKnownSymbol("species"),yr=!fails((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),gr="$0"==="a".replace(/./,"$0"),mr=wellKnownSymbol("replace"),br=!!/./[mr]&&""===/./[mr]("a","$0"),_r=!fails((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),fixRegexpWellKnownSymbolLogic=function(t,e,n,i){var o=wellKnownSymbol(t),s=!fails((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),l=s&&!fails((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[vr]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return e=!0,null},n[o](""),!e}));if(!s||!l||"replace"===t&&(!yr||!gr||br)||"split"===t&&!_r){var u=/./[o],h=n(o,""[t],(function(t,e,n,i,o){return e.exec===dr?s&&!o?{done:!0,value:u.call(e,n,i)}:{done:!0,value:t.call(n,e,i)}:{done:!1}}),{REPLACE_KEEPS_$0:gr,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:br}),p=h[0],d=h[1];Q(String.prototype,t,p),Q(RegExp.prototype,o,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)})}i&&k(RegExp.prototype[o],"sham",!0)},createMethod$1=function(t){return function(e,n){var i,o,s=String(requireObjectCoercible(e)),l=toInteger(n),u=s.length;return l<0||l>=u?t?"":void 0:(i=s.charCodeAt(l))<55296||i>56319||l+1===u||(o=s.charCodeAt(l+1))<56320||o>57343?t?s.charAt(l):i:t?s.slice(l,l+2):o-56320+(i-55296<<10)+65536}},xr={codeAt:createMethod$1(!1),charAt:createMethod$1(!0)},wr=xr.charAt,advanceStringIndex=function(t,e,n){return e+(n?wr(t,e).length:1)},regexpExecAbstract=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==classofRaw(t))throw TypeError("RegExp#exec called on incompatible receiver");return dr.call(t,e)},Pr=Math.max,Cr=Math.min,kr=Math.floor,Er=/\$([$&'`]|\d\d?|<[^>]*>)/g,Sr=/\$([$&'`]|\d\d?)/g;fixRegexpWellKnownSymbolLogic("replace",2,(function(t,e,n,i){var o=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,s=i.REPLACE_KEEPS_$0,l=o?"$":"$0";return[function replace(n,i){var o=requireObjectCoercible(this),s=null==n?void 0:n[t];return void 0!==s?s.call(n,o,i):e.call(String(o),n,i)},function(t,i){if(!o&&s||"string"==typeof i&&-1===i.indexOf(l)){var u=n(e,t,this,i);if(u.done)return u.value}var h=anObject(t),p=String(this),d="function"==typeof i;d||(i=String(i));var v=h.global;if(v){var g=h.unicode;h.lastIndex=0}for(var b=[];;){var _=regexpExecAbstract(h,p);if(null===_)break;if(b.push(_),!v)break;""===String(_[0])&&(h.lastIndex=advanceStringIndex(p,toLength(h.lastIndex),g))}for(var w,P="",C=0,k=0;k<b.length;k++){_=b[k];for(var E=String(_[0]),S=Pr(Cr(toInteger(_.index),p.length),0),T=[],A=1;A<_.length;A++)T.push(void 0===(w=_[A])?w:String(w));var O=_.groups;if(d){var M=[E].concat(T,S,p);void 0!==O&&M.push(O);var V=String(i.apply(void 0,M))}else V=getSubstitution(E,p,S,T,O,i);S>=C&&(P+=p.slice(C,S)+V,C=S+E.length)}return P+p.slice(C)}];function getSubstitution(t,n,i,o,s,l){var u=i+t.length,h=o.length,p=Sr;return void 0!==s&&(s=toObject(s),p=Er),e.call(l,p,(function(e,l){var p;switch(l.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,i);case"'":return n.slice(u);case"<":p=s[l.slice(1,-1)];break;default:var d=+l;if(0===d)return e;if(d>h){var v=kr(d/10);return 0===v?e:v<=h?void 0===o[v-1]?l.charAt(1):o[v-1]+l.charAt(1):e}p=o[d-1]}return void 0===p?"":p}))}}));var Tr="\t\n\v\f\r    \u2028\u2029\ufeff",Ar="["+Tr+"]",Or=RegExp("^"+Ar+Ar+"*"),Mr=RegExp(Ar+Ar+"*$"),createMethod$2=function(t){return function(e){var n=String(requireObjectCoercible(e));return 1&t&&(n=n.replace(Or,"")),2&t&&(n=n.replace(Mr,"")),n}},Vr={start:createMethod$2(1),end:createMethod$2(2),trim:createMethod$2(3)},Br=Vr.trim;_export({target:"String",proto:!0,forced:function(t){return fails((function(){return!!Tr[t]()||"…"!="…"[t]()||Tr[t].name!==t}))}("trim")},{trim:function trim(){return Br(this)}});var Rr,Ir=Object.keys||function keys(t){return objectKeysInternal(t,it)},jr=i?Object.defineProperties:function defineProperties(t,e){anObject(t);for(var n,i=Ir(e),o=i.length,s=0;o>s;)C.f(t,n=i[s++],e[n]);return t},Nr=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObject=function(){try{Rr=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;NullProtoObject=Rr?function(t){t.write(scriptTag("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Rr):((e=documentCreateElement("iframe")).style.display="none",se.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F);for(var n=it.length;n--;)delete NullProtoObject.prototype[it[n]];return NullProtoObject()};L[Nr]=!0;var Dr=Object.create||function create(t,e){var n;return null!==t?(EmptyConstructor.prototype=anObject(t),n=new EmptyConstructor,EmptyConstructor.prototype=null,n[Nr]=t):n=NullProtoObject(),void 0===e?n:jr(n,e)},Lr=st.f,Fr={}.toString,Gr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],zr={f:function getOwnPropertyNames(t){return Gr&&"[object Window]"==Fr.call(t)?function(t){try{return Lr(t)}catch(t){return Gr.slice()}}(t):Lr(toIndexedObject(t))}},Wr={f:wellKnownSymbol},Xr=C.f,defineWellKnownSymbol=function(t){var e=Z.Symbol||(Z.Symbol={});has(e,t)||Xr(e,t,{value:Wr.f(t)})},$r=[].push,createMethod$3=function(t){var e=1==t,n=2==t,i=3==t,o=4==t,s=6==t,l=5==t||s;return function(u,h,d,v){for(var g,b,_=toObject(u),w=p(_),P=functionBindContext(h,d,3),C=toLength(w.length),k=0,E=v||arraySpeciesCreate,S=e?E(u,C):n?E(u,0):void 0;C>k;k++)if((l||k in w)&&(b=P(g=w[k],k,_),t))if(e)S[k]=b;else if(b)switch(t){case 3:return!0;case 5:return g;case 6:return k;case 2:$r.call(S,g)}else if(o)return!1;return s?-1:i||o?o:S}},Ur={forEach:createMethod$3(0),map:createMethod$3(1),filter:createMethod$3(2),some:createMethod$3(3),every:createMethod$3(4),find:createMethod$3(5),findIndex:createMethod$3(6)},qr=Ur.forEach,Hr=sharedKey("hidden"),Yr="Symbol",Qr=wellKnownSymbol("toPrimitive"),Zr=Y.set,Jr=Y.getterFor(Yr),Kr=Object.prototype,tn=n.Symbol,en=getBuiltIn("JSON","stringify"),rn=w.f,nn=C.f,an=zr.f,on=l.f,sn=I("symbols"),ln=I("op-symbols"),un=I("string-to-symbol-registry"),cn=I("symbol-to-string-registry"),hn=I("wks"),fn=n.QObject,pn=!fn||!fn.prototype||!fn.prototype.findChild,dn=i&&fails((function(){return 7!=Dr(nn({},"a",{get:function(){return nn(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=rn(Kr,e);i&&delete Kr[e],nn(t,e,n),i&&t!==Kr&&nn(Kr,e,i)}:nn,wrap=function(t,e){var n=sn[t]=Dr(tn.prototype);return Zr(n,{type:Yr,tag:t,description:e}),i||(n.description=e),n},vn=bt?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof tn},yn=function defineProperty(t,e,n){t===Kr&&yn(ln,e,n),anObject(t);var i=toPrimitive(e,!0);return anObject(n),has(sn,i)?(n.enumerable?(has(t,Hr)&&t[Hr][i]&&(t[Hr][i]=!1),n=Dr(n,{enumerable:createPropertyDescriptor(0,!1)})):(has(t,Hr)||nn(t,Hr,createPropertyDescriptor(1,{})),t[Hr][i]=!0),dn(t,i,n)):nn(t,i,n)},gn=function defineProperties(t,e){anObject(t);var n=toIndexedObject(e),o=Ir(n).concat(xn(n));return qr(o,(function(e){i&&!mn.call(n,e)||yn(t,e,n[e])})),t},mn=function propertyIsEnumerable(t){var e=toPrimitive(t,!0),n=on.call(this,e);return!(this===Kr&&has(sn,e)&&!has(ln,e))&&(!(n||!has(this,e)||!has(sn,e)||has(this,Hr)&&this[Hr][e])||n)},bn=function getOwnPropertyDescriptor(t,e){var n=toIndexedObject(t),i=toPrimitive(e,!0);if(n!==Kr||!has(sn,i)||has(ln,i)){var o=rn(n,i);return!o||!has(sn,i)||has(n,Hr)&&n[Hr][i]||(o.enumerable=!0),o}},_n=function getOwnPropertyNames(t){var e=an(toIndexedObject(t)),n=[];return qr(e,(function(t){has(sn,t)||has(L,t)||n.push(t)})),n},xn=function getOwnPropertySymbols(t){var e=t===Kr,n=an(e?ln:toIndexedObject(t)),i=[];return qr(n,(function(t){!has(sn,t)||e&&!has(Kr,t)||i.push(sn[t])})),i};if(mt||(Q((tn=function Symbol(){if(this instanceof tn)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=uid(t),setter=function(t){this===Kr&&setter.call(ln,t),has(this,Hr)&&has(this[Hr],e)&&(this[Hr][e]=!1),dn(this,e,createPropertyDescriptor(1,t))};return i&&pn&&dn(Kr,e,{configurable:!0,set:setter}),wrap(e,t)}).prototype,"toString",(function toString(){return Jr(this).tag})),Q(tn,"withoutSetter",(function(t){return wrap(uid(t),t)})),l.f=mn,C.f=yn,w.f=bn,st.f=zr.f=_n,lt.f=xn,Wr.f=function(t){return wrap(wellKnownSymbol(t),t)},i&&(nn(tn.prototype,"description",{configurable:!0,get:function description(){return Jr(this).description}}),Q(Kr,"propertyIsEnumerable",mn,{unsafe:!0}))),_export({global:!0,wrap:!0,forced:!mt,sham:!mt},{Symbol:tn}),qr(Ir(hn),(function(t){defineWellKnownSymbol(t)})),_export({target:Yr,stat:!0,forced:!mt},{for:function(t){var e=String(t);if(has(un,e))return un[e];var n=tn(e);return un[e]=n,cn[n]=e,n},keyFor:function keyFor(t){if(!vn(t))throw TypeError(t+" is not a symbol");if(has(cn,t))return cn[t]},useSetter:function(){pn=!0},useSimple:function(){pn=!1}}),_export({target:"Object",stat:!0,forced:!mt,sham:!i},{create:function create(t,e){return void 0===e?Dr(t):gn(Dr(t),e)},defineProperty:yn,defineProperties:gn,getOwnPropertyDescriptor:bn}),_export({target:"Object",stat:!0,forced:!mt},{getOwnPropertyNames:_n,getOwnPropertySymbols:xn}),_export({target:"Object",stat:!0,forced:fails((function(){lt.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(t){return lt.f(toObject(t))}}),en){var wn=!mt||fails((function(){var t=tn();return"[null]"!=en([t])||"{}"!=en({a:t})||"{}"!=en(Object(t))}));_export({target:"JSON",stat:!0,forced:wn},{stringify:function stringify(t,e,n){for(var i,o=[t],s=1;arguments.length>s;)o.push(arguments[s++]);if(i=e,(isObject(e)||void 0!==t)&&!vn(t))return gt(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!vn(e))return e}),o[1]=e,en.apply(null,o)}})}tn.prototype[Qr]||k(tn.prototype,Qr,tn.prototype.valueOf),setToStringTag(tn,Yr),L[Hr]=!0;var Pn=C.f,Cn=n.Symbol;if(i&&"function"==typeof Cn&&(!("description"in Cn.prototype)||void 0!==Cn().description)){var kn={},En=function Symbol(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof En?new Cn(t):void 0===t?Cn():Cn(t);return""===t&&(kn[e]=!0),e};copyConstructorProperties(En,Cn);var Sn=En.prototype=Cn.prototype;Sn.constructor=En;var Tn=Sn.toString,An="Symbol(test)"==String(Cn("test")),On=/^Symbol\((.*)\)[^)]+$/;Pn(Sn,"description",{configurable:!0,get:function description(){var t=isObject(this)?this.valueOf():this,e=Tn.call(t);if(has(kn,t))return"";var n=An?e.slice(7,-1):e.replace(On,"$1");return""===n?void 0:n}}),_export({global:!0,forced:!0},{Symbol:En})}defineWellKnownSymbol("asyncIterator"),defineWellKnownSymbol("iterator"),defineWellKnownSymbol("toStringTag");var Mn=Object.defineProperty,Vn={},thrower=function(t){throw t},arrayMethodUsesToLength=function(t,e){if(has(Vn,t))return Vn[t];e||(e={});var n=[][t],o=!!has(e,"ACCESSORS")&&e.ACCESSORS,s=has(e,0)?e[0]:thrower,l=has(e,1)?e[1]:void 0;return Vn[t]=!!n&&!fails((function(){if(o&&!i)return!0;var t={length:-1};o?Mn(t,1,{enumerable:!0,get:thrower}):t[1]=1,n.call(t,s,l)}))},Bn=Ur.forEach,Rn=arrayMethodIsStrict("forEach"),In=arrayMethodUsesToLength("forEach"),jn=Rn&&In?[].forEach:function forEach(t){return Bn(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=jn},{forEach:jn});var Nn=wellKnownSymbol("unscopables"),Dn=Array.prototype;null==Dn[Nn]&&C.f(Dn,Nn,{configurable:!0,value:Dr(null)});var Ln,Fn,Gn,addToUnscopables=function(t){Dn[Nn][t]=!0},zn=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),Wn=sharedKey("IE_PROTO"),Xn=Object.prototype,$n=zn?Object.getPrototypeOf:function(t){return t=toObject(t),has(t,Wn)?t[Wn]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Xn:null},Un=wellKnownSymbol("iterator"),qn=!1;[].keys&&("next"in(Gn=[].keys())?(Fn=$n($n(Gn)))!==Object.prototype&&(Ln=Fn):qn=!0),null==Ln&&(Ln={}),has(Ln,Un)||k(Ln,Un,(function(){return this}));var Hn={IteratorPrototype:Ln,BUGGY_SAFARI_ITERATORS:qn},Yn=Hn.IteratorPrototype,returnThis$1=function(){return this},Qn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function setPrototypeOf(n,i){return anObject(n),function(t){if(!isObject(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(i),e?t.call(n,i):n.__proto__=i,n}}():void 0),Zn=Hn.IteratorPrototype,Jn=Hn.BUGGY_SAFARI_ITERATORS,Kn=wellKnownSymbol("iterator"),ta="keys",ea="values",ra="entries",returnThis$2=function(){return this},defineIterator=function(t,e,n,i,o,s,l){!function(t,e,n){var i=e+" Iterator";t.prototype=Dr(Yn,{next:createPropertyDescriptor(1,n)}),setToStringTag(t,i,!1),Ht[i]=returnThis$1}(n,e,i);var u,h,p,getIterationMethod=function(t){if(t===o&&_)return _;if(!Jn&&t in g)return g[t];switch(t){case ta:return function keys(){return new n(this,t)};case ea:return function values(){return new n(this,t)};case ra:return function entries(){return new n(this,t)}}return function(){return new n(this)}},d=e+" Iterator",v=!1,g=t.prototype,b=g[Kn]||g["@@iterator"]||o&&g[o],_=!Jn&&b||getIterationMethod(o),w="Array"==e&&g.entries||b;if(w&&(u=$n(w.call(new t)),Zn!==Object.prototype&&u.next&&($n(u)!==Zn&&(Qn?Qn(u,Zn):"function"!=typeof u[Kn]&&k(u,Kn,returnThis$2)),setToStringTag(u,d,!0))),o==ea&&b&&b.name!==ea&&(v=!0,_=function values(){return b.call(this)}),g[Kn]!==_&&k(g,Kn,_),Ht[e]=_,o)if(h={values:getIterationMethod(ea),keys:s?_:getIterationMethod(ta),entries:getIterationMethod(ra)},l)for(p in h)(Jn||v||!(p in g))&&Q(g,p,h[p]);else _export({target:e,proto:!0,forced:Jn||v},h);return h},na="Array Iterator",aa=Y.set,ia=Y.getterFor(na),oa=defineIterator(Array,"Array",(function(t,e){aa(this,{type:na,target:toIndexedObject(t),index:0,kind:e})}),(function(){var t=ia(this),e=t.target,n=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values");Ht.Arguments=Ht.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries");var sa=[].reverse,la=[1,2];_export({target:"Array",proto:!0,forced:String(la)===String(la.reverse())},{reverse:function reverse(){return gt(this)&&(this.length=this.length),sa.call(this)}});var ua=arrayMethodHasSpeciesSupport("slice"),ca=arrayMethodUsesToLength("slice",{ACCESSORS:!0,0:0,1:2}),ha=wellKnownSymbol("species"),fa=[].slice,pa=Math.max;_export({target:"Array",proto:!0,forced:!ua||!ca},{slice:function slice(t,e){var n,i,o,s=toIndexedObject(this),l=toLength(s.length),u=toAbsoluteIndex(t,l),h=toAbsoluteIndex(void 0===e?l:e,l);if(gt(s)&&("function"!=typeof(n=s.constructor)||n!==Array&&!gt(n.prototype)?isObject(n)&&null===(n=n[ha])&&(n=void 0):n=void 0,n===Array||void 0===n))return fa.call(s,u,h);for(i=new(void 0===n?Array:n)(pa(h-u,0)),o=0;u<h;u++,o++)u in s&&createProperty(i,o,s[u]);return i.length=o,i}});var da=Date.prototype,va="Invalid Date",ya="toString",ga=da.toString,ma=da.getTime;new Date(NaN)+""!=va&&Q(da,ya,(function toString(){var t=ma.call(this);return t==t?ga.call(this):va}));var ba=C.f,_a=Function.prototype,xa=_a.toString,wa=/^\s*function ([^ (]*)/,Pa="name";i&&!(Pa in _a)&&ba(_a,Pa,{configurable:!0,get:function(){try{return xa.call(this).match(wa)[1]}catch(t){return""}}}),setToStringTag(n.JSON,"JSON",!0),setToStringTag(Math,"Math",!0),_export({target:"Object",stat:!0,sham:!i},{create:Dr}),_export({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:C.f});var Ca=fails((function(){$n(1)}));_export({target:"Object",stat:!0,forced:Ca,sham:!zn},{getPrototypeOf:function getPrototypeOf(t){return $n(toObject(t))}}),_export({target:"Object",stat:!0},{setPrototypeOf:Qn});var ka="toString",Ea=RegExp.prototype,Sa=Ea.toString,Ta=fails((function(){return"/a/b"!=Sa.call({source:"a",flags:"b"})})),Aa=Sa.name!=ka;(Ta||Aa)&&Q(RegExp.prototype,ka,(function toString(){var t=anObject(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in Ea)?regexpFlags.call(t):n)}),{unsafe:!0});var Oa=xr.charAt,Ma="String Iterator",Va=Y.set,Ba=Y.getterFor(Ma);defineIterator(String,"String",(function(t){Va(this,{type:Ma,string:String(t),index:0})}),(function next(){var t,e=Ba(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=Oa(n,i),e.index+=t.length,{value:t,done:!1})}));var Ra={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var Ia in Ra){var ja=n[Ia],Na=ja&&ja.prototype;if(Na&&Na.forEach!==jn)try{k(Na,"forEach",jn)}catch(t){Na.forEach=jn}}var Da=wellKnownSymbol("iterator"),La=wellKnownSymbol("toStringTag"),Fa=oa.values;for(var Ga in Ra){var za=n[Ga],Wa=za&&za.prototype;if(Wa){if(Wa[Da]!==Fa)try{k(Wa,Da,Fa)}catch(t){Wa[Da]=Fa}if(Wa[La]||k(Wa,La,Ga),Ra[Ga])for(var Xa in oa)if(Wa[Xa]!==oa[Xa])try{k(Wa,Xa,oa[Xa])}catch(t){Wa[Xa]=oa[Xa]}}}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function asyncGeneratorStep(t,e,n,i,o,s,l){try{var u=t[s](l),h=u.value}catch(t){return void n(t)}u.done?e(h):Promise.resolve(h).then(i,o)}function _asyncToGenerator(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function _next(t){asyncGeneratorStep(s,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(s,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_setPrototypeOf(t,e)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,e){return t.__proto__=e,t})(t,e)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function _construct(t,e,n){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(t,e,n){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return n&&_setPrototypeOf(o,n.prototype),o}).apply(null,arguments)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _possibleConstructorReturn(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?_assertThisInitialized(t):e}function _createSuper(t){var e=_isNativeReflectConstruct();return function _createSuperInternal(){var n,i=_getPrototypeOf(t);if(e){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _get(t,e,n){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,e,n){var i=function _superPropBase(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_getPrototypeOf(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function _slicedToArray(t,e){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,o=!1,s=void 0;try{for(var l,u=t[Symbol.iterator]();!(i=(l=u.next()).done)&&(n.push(l.value),!e||n.length!==e);i=!0);}catch(t){o=!0,s=t}finally{try{i||null==u.return||u.return()}finally{if(o)throw s}}return n}(t,e)||_unsupportedIterableToArray(t,e)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}createCommonjsModule((function(t){var e=function(t){var e,n=Object.prototype,i=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function define(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,n){return t[e]=n}}function wrap(t,e,n,i){var o=e&&e.prototype instanceof Generator?e:Generator,s=Object.create(o.prototype),l=new Context(i||[]);return s._invoke=function makeInvokeMethod(t,e,n){var i=h;return function invoke(o,s){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw s;return doneResult()}for(n.method=o,n.arg=s;;){var l=n.delegate;if(l){var u=maybeInvokeDelegate(l,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var b=tryCatch(t,e,n);if("normal"===b.type){if(i=n.done?v:p,b.arg===g)continue;return{value:b.arg,done:n.done}}"throw"===b.type&&(i=v,n.method="throw",n.arg=b.arg)}}}(t,n,l),s}function tryCatch(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",g={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var b={};b[s]=function(){return this};var _=Object.getPrototypeOf,w=_&&_(_(values([])));w&&w!==n&&i.call(w,s)&&(b=w);var P=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(b);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){var n;this._invoke=function enqueue(o,s){function callInvokeWithMethodAndArg(){return new e((function(n,l){!function invoke(n,o,s,l){var u=tryCatch(t[n],t,o);if("throw"!==u.type){var h=u.arg,p=h.value;return p&&"object"===_typeof(p)&&i.call(p,"__await")?e.resolve(p.__await).then((function(t){invoke("next",t,s,l)}),(function(t){invoke("throw",t,s,l)})):e.resolve(p).then((function(t){h.value=t,s(h)}),(function(t){return invoke("throw",t,s,l)}))}l(u.arg)}(o,s,n,l)}))}return n=n?n.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,n){var i=t.iterator[n.method];if(i===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,maybeInvokeDelegate(t,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=tryCatch(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var s=o.arg;return s?s.done?(n[t.resultName]=s.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,l=function next(){for(;++o<t.length;)if(i.call(t,o))return next.value=t[o],next.done=!1,next;return next.value=e,next.done=!0,next};return l.next=l}}return{next:doneResult}}function doneResult(){return{value:e,done:!0}}return GeneratorFunction.prototype=P.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(P),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[l]=function(){return this},t.AsyncIterator=AsyncIterator,t.async=function(e,n,i,o,s){void 0===s&&(s=Promise);var l=new AsyncIterator(wrap(e,n,i,o),s);return t.isGeneratorFunction(n)?l:l.next().then((function(t){return t.done?t.value:l.next()}))},defineIteratorMethods(P),define(P,u,"Generator"),P[s]=function(){return this},P.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function next(){for(;e.length;){var n=e.pop();if(n in t)return next.value=n,next.done=!1,next}return next.done=!0,next}},t.values=values,Context.prototype={constructor:Context,reset:function reset(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(resetTryEntry),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var n=this;function handle(i,o){return l.type="throw",l.arg=t,n.next=i,o&&(n.method="next",n.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],l=s.completion;if("root"===s.tryLoc)return handle("end");if(s.tryLoc<=this.prev){var u=i.call(s,"catchLoc"),h=i.call(s,"finallyLoc");if(u&&h){if(this.prev<s.catchLoc)return handle(s.catchLoc,!0);if(this.prev<s.finallyLoc)return handle(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return handle(s.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return handle(s.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var s=o;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var l=s?s.completion:{};return l.type=t,l.arg=e,s?(this.method="next",this.next=s.finallyLoc,g):this.complete(l)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),resetTryEntry(n),g}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,n,i){return this.delegate={iterator:values(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),g}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));var $a=Ur.every,Ua=arrayMethodIsStrict("every"),qa=arrayMethodUsesToLength("every");_export({target:"Array",proto:!0,forced:!Ua||!qa},{every:function every(t){return $a(this,t,arguments.length>1?arguments[1]:void 0)}});_export({target:"Array",proto:!0},{fill:function fill(t){for(var e=toObject(this),n=toLength(e.length),i=arguments.length,o=toAbsoluteIndex(i>1?arguments[1]:void 0,n),s=i>2?arguments[2]:void 0,l=void 0===s?n:toAbsoluteIndex(s,n);l>o;)e[o++]=t;return e}}),addToUnscopables("fill");var Ha=Ur.filter,Ya=arrayMethodHasSpeciesSupport("filter"),Qa=arrayMethodUsesToLength("filter");_export({target:"Array",proto:!0,forced:!Ya||!Qa},{filter:function filter(t){return Ha(this,t,arguments.length>1?arguments[1]:void 0)}});var Za=nt.includes,Ja=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:!Ja},{includes:function includes(t){return Za(this,t,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes");var Ka=nt.indexOf,ti=[].indexOf,ei=!!ti&&1/[1].indexOf(1,-0)<0,ri=arrayMethodIsStrict("indexOf"),ni=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:ei||!ri||!ni},{indexOf:function indexOf(t){return ei?ti.apply(this,arguments)||0:Ka(this,t,arguments.length>1?arguments[1]:void 0)}});var ai=Ur.map,ii=arrayMethodHasSpeciesSupport("map"),oi=arrayMethodUsesToLength("map");_export({target:"Array",proto:!0,forced:!ii||!oi},{map:function map(t){return ai(this,t,arguments.length>1?arguments[1]:void 0)}});var inheritIfRequired=function(t,e,n){var i,o;return Qn&&"function"==typeof(i=e.constructor)&&i!==n&&isObject(o=i.prototype)&&o!==n.prototype&&Qn(t,o),t},si=st.f,li=w.f,ui=C.f,ci=Vr.trim,hi="Number",fi=n.Number,pi=fi.prototype,di=classofRaw(Dr(pi))==hi,toNumber=function(t){var e,n,i,o,s,l,u,h,p=toPrimitive(t,!1);if("string"==typeof p&&p.length>2)if(43===(e=(p=ci(p)).charCodeAt(0))||45===e){if(88===(n=p.charCodeAt(2))||120===n)return NaN}else if(48===e){switch(p.charCodeAt(1)){case 66:case 98:i=2,o=49;break;case 79:case 111:i=8,o=55;break;default:return+p}for(l=(s=p.slice(2)).length,u=0;u<l;u++)if((h=s.charCodeAt(u))<48||h>o)return NaN;return parseInt(s,i)}return+p};if(vt(hi,!fi(" 0o1")||!fi("0b1")||fi("+0x1"))){for(var vi,yi=function Number(t){var e=arguments.length<1?0:t,n=this;return n instanceof yi&&(di?fails((function(){pi.valueOf.call(n)})):classofRaw(n)!=hi)?inheritIfRequired(new fi(toNumber(e)),n,yi):toNumber(e)},gi=i?si(fi):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),mi=0;gi.length>mi;mi++)has(fi,vi=gi[mi])&&!has(yi,vi)&&ui(yi,vi,li(fi,vi));yi.prototype=pi,pi.constructor=yi,Q(n,hi,yi)}var bi=Vr.trim,_i=n.parseFloat,xi=1/_i(Tr+"-0")!=-1/0?function parseFloat(t){var e=bi(String(t)),n=_i(e);return 0===n&&"-"==e.charAt(0)?-0:n}:_i;_export({target:"Number",stat:!0,forced:Number.parseFloat!=xi},{parseFloat:xi});var wi=Vr.trim,Pi=n.parseInt,Ci=/^[+-]?0[Xx]/,ki=8!==Pi(Tr+"08")||22!==Pi(Tr+"0x16")?function parseInt(t,e){var n=wi(String(t));return Pi(n,e>>>0||(Ci.test(n)?16:10))}:Pi;_export({target:"Number",stat:!0,forced:Number.parseInt!=ki},{parseInt:ki});var Ei=Object.assign,Si=Object.defineProperty,Ti=!Ei||fails((function(){if(i&&1!==Ei({b:1},Ei(Si({},"a",{enumerable:!0,get:function(){Si(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!=Ei({},t)[n]||Ir(Ei({},e)).join("")!=o}))?function assign(t,e){for(var n=toObject(t),o=arguments.length,s=1,u=lt.f,h=l.f;o>s;)for(var d,v=p(arguments[s++]),g=u?Ir(v).concat(u(v)):Ir(v),b=g.length,_=0;b>_;)d=g[_++],i&&!h.call(v,d)||(n[d]=v[d]);return n}:Ei;_export({target:"Object",stat:!0,forced:Object.assign!==Ti},{assign:Ti});var Ai=l.f,createMethod$4=function(t){return function(e){for(var n,o=toIndexedObject(e),s=Ir(o),l=s.length,u=0,h=[];l>u;)n=s[u++],i&&!Ai.call(o,n)||h.push(t?[n,o[n]]:o[n]);return h}},Oi={entries:createMethod$4(!0),values:createMethod$4(!1)}.entries;_export({target:"Object",stat:!0},{entries:function entries(t){return Oi(t)}});var Mi,Vi=wellKnownSymbol("match"),isRegexp=function(t){var e;return isObject(t)&&(void 0!==(e=t[Vi])?!!e:"RegExp"==classofRaw(t))},notARegexp=function(t){if(isRegexp(t))throw TypeError("The method doesn't accept regular expressions");return t},Bi=wellKnownSymbol("match"),correctIsRegexpLogic=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[Bi]=!1,"/./"[t](e)}catch(t){}}return!1},Ri=w.f,Ii="".endsWith,ji=Math.min,Ni=correctIsRegexpLogic("endsWith"),Di=!(Ni||(Mi=Ri(String.prototype,"endsWith"),!Mi||Mi.writable));_export({target:"String",proto:!0,forced:!Di&&!Ni},{endsWith:function endsWith(t){var e=String(requireObjectCoercible(this));notARegexp(t);var n=arguments.length>1?arguments[1]:void 0,i=toLength(e.length),o=void 0===n?i:ji(toLength(n),i),s=String(t);return Ii?Ii.call(e,s,o):e.slice(o-s.length,o)===s}}),_export({target:"String",proto:!0,forced:!correctIsRegexpLogic("includes")},{includes:function includes(t){return!!~String(requireObjectCoercible(this)).indexOf(notARegexp(t),arguments.length>1?arguments[1]:void 0)}}),fixRegexpWellKnownSymbolLogic("match",1,(function(t,e,n){return[function match(e){var n=requireObjectCoercible(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,n):new RegExp(e)[t](String(n))},function(t){var i=n(e,t,this);if(i.done)return i.value;var o=anObject(t),s=String(this);if(!o.global)return regexpExecAbstract(o,s);var l=o.unicode;o.lastIndex=0;for(var u,h=[],p=0;null!==(u=regexpExecAbstract(o,s));){var d=String(u[0]);h[p]=d,""===d&&(o.lastIndex=advanceStringIndex(s,toLength(o.lastIndex),l)),p++}return 0===p?null:h}]}));var Li=[].push,Fi=Math.min,Gi=4294967295,zi=!fails((function(){return!RegExp(Gi,"y")}));fixRegexpWellKnownSymbolLogic("split",2,(function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=String(requireObjectCoercible(this)),o=void 0===n?Gi:n>>>0;if(0===o)return[];if(void 0===t)return[i];if(!isRegexp(t))return e.call(i,t,o);for(var s,l,u,h=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),d=0,v=new RegExp(t.source,p+"g");(s=dr.call(v,i))&&!((l=v.lastIndex)>d&&(h.push(i.slice(d,s.index)),s.length>1&&s.index<i.length&&Li.apply(h,s.slice(1)),u=s[0].length,d=l,h.length>=o));)v.lastIndex===s.index&&v.lastIndex++;return d===i.length?!u&&v.test("")||h.push(""):h.push(i.slice(d)),h.length>o?h.slice(0,o):h}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function split(e,n){var o=requireObjectCoercible(this),s=null==e?void 0:e[t];return void 0!==s?s.call(e,o,n):i.call(String(o),e,n)},function(t,o){var s=n(i,t,this,o,i!==e);if(s.done)return s.value;var l=anObject(t),u=String(this),h=speciesConstructor(l,RegExp),p=l.unicode,d=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(zi?"y":"g"),v=new h(zi?l:"^(?:"+l.source+")",d),g=void 0===o?Gi:o>>>0;if(0===g)return[];if(0===u.length)return null===regexpExecAbstract(v,u)?[u]:[];for(var b=0,_=0,w=[];_<u.length;){v.lastIndex=zi?_:0;var P,C=regexpExecAbstract(v,zi?u:u.slice(_));if(null===C||(P=Fi(toLength(v.lastIndex+(zi?0:_)),u.length))===b)_=advanceStringIndex(u,_,p);else{if(w.push(u.slice(b,_)),w.length===g)return w;for(var k=1;k<=C.length-1;k++)if(w.push(C[k]),w.length===g)return w;_=b=P}}return w.push(u.slice(b)),w}]}),!zi);var Wi=w.f,Xi="".startsWith,$i=Math.min,Ui=correctIsRegexpLogic("startsWith"),qi=!Ui&&!!function(){var t=Wi(String.prototype,"startsWith");return t&&!t.writable}();_export({target:"String",proto:!0,forced:!qi&&!Ui},{startsWith:function startsWith(t){var e=String(requireObjectCoercible(this));notARegexp(t);var n=toLength($i(arguments.length>1?arguments[1]:void 0,e.length)),i=String(t);return Xi?Xi.call(e,i,n):e.slice(n,n+i.length)===i}});var flattenIntoArray=function(t,e,n,i,o,s,l,u){for(var h,p=o,d=0,v=!!l&&functionBindContext(l,u,3);d<i;){if(d in n){if(h=v?v(n[d],d,e):n[d],s>0&&gt(h))p=flattenIntoArray(t,e,h,toLength(h.length),p,s-1)-1;else{if(p>=9007199254740991)throw TypeError("Exceed the acceptable array length");t[p]=h}p++}d++}return p},Hi=flattenIntoArray;_export({target:"Array",proto:!0},{flatMap:function flatMap(t){var e,n=toObject(this),i=toLength(n.length);return aFunction$1(t),(e=arraySpeciesCreate(n,0)).length=Hi(e,n,n,i,0,1,t,arguments.length>1?arguments[1]:void 0),e}}),addToUnscopables("flatMap");var Yi=fails((function(){Ir(1)}));_export({target:"Object",stat:!0,forced:Yi},{keys:function keys(t){return Ir(toObject(t))}});
/**
* For parsing color values.
* @module RGBColor
* @author Stoyan Stefanov <sstoo@gmail.com>
* @see https://www.phpied.com/rgb-color-parser-in-javascript/
* @license MIT
*/
var Qi={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},Zi=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function process(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.map((function(t){return Number.parseInt(t)}))}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function process(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.map((function(t){return Number.parseInt(t,16)}))}},{re:/^(\w)(\w)(\w)$/,example:["#fb0","f0f"],process:function process(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.map((function(t){return Number.parseInt(t+t,16)}))}}],Ji=function(){function RGBColor(t){var e=this;_classCallCheck(this,RGBColor),this.ok=!1,"#"===t.charAt(0)&&(t=t.substr(1,6)),(t=(t=t.replace(/ /g,"")).toLowerCase())in Qi&&(t=Qi[t]),Zi.forEach((function(n){var i=n.re,o=n.process,s=i.exec(t);if(s){var l=_slicedToArray(o.apply(void 0,_toConsumableArray(s)),3),u=l[0],h=l[1],p=l[2];Object.assign(e,{r:u,g:h,b:p}),e.ok=!0}})),this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b}return _createClass(RGBColor,[{key:"toRGB",value:function toRGB(){return"rgb("+this.r+", "+this.g+", "+this.b+")"}},{key:"toHex",value:function toHex(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1===t.length&&(t="0"+t),1===e.length&&(e="0"+e),1===n.length&&(n="0"+n),"#"+t+e+n}}],[{key:"getHelpXML",value:function getHelpXML(){var t=[].concat(_toConsumableArray(Zi.flatMap((function(t){return t.example}))),_toConsumableArray(Object.keys(Qi))),e=document.createElement("ul");return e.setAttribute("id","rgbcolor-examples"),e.append.apply(e,_toConsumableArray(t.map((function(t){try{var e=document.createElement("li"),n=new RGBColor(t),i=document.createElement("div");i.style.cssText="\n margin: 3px;\n border: 1px solid black;\n background: ".concat(n.toHex(),";\n color: ").concat(n.toHex(),";"),i.append("test");var o=" ".concat(t," -> ").concat(n.toRGB()," -> ").concat(n.toHex());return e.append(i,o),e}catch(t){return""}})))),e}}]),RGBColor}();function _typeof$1(t){return(_typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Ki=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],to=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function processCanvasRGBA(t,e,n,i,o,s){if(!(isNaN(s)||s<1)){s|=0;var l=function getImageDataFromCanvas(t,e,n,i,o){if("string"==typeof t&&(t=document.getElementById(t)),!t||"object"!==_typeof$1(t)||!("getContext"in t))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var s=t.getContext("2d");try{return s.getImageData(e,n,i,o)}catch(t){throw new Error("unable to access image data: "+t)}}(t,e,n,i,o);l=function processImageDataRGBA(t,e,n,i,o,s){var l,u,h,p,d,v,g,b,_,w,P,C,k,E,S,T,A,O,M,V,B,R,I,j,N,D=t.data,L=2*s+1,G=i-1,z=o-1,W=s+1,X=W*(W+1)/2,$=new eo,U=$;for(h=1;h<L;h++)U=U.next=new eo,h===W&&(N=U);U.next=$;var q=null,H=null;g=v=0;var Y=Ki[s],Q=to[s];for(u=0;u<o;u++){for(T=A=O=M=b=_=w=P=0,C=W*(V=D[v]),k=W*(B=D[v+1]),E=W*(R=D[v+2]),S=W*(I=D[v+3]),b+=X*V,_+=X*B,w+=X*R,P+=X*I,U=$,h=0;h<W;h++)U.r=V,U.g=B,U.b=R,U.a=I,U=U.next;for(h=1;h<W;h++)p=v+((G<h?G:h)<<2),b+=(U.r=V=D[p])*(j=W-h),_+=(U.g=B=D[p+1])*j,w+=(U.b=R=D[p+2])*j,P+=(U.a=I=D[p+3])*j,T+=V,A+=B,O+=R,M+=I,U=U.next;for(q=$,H=N,l=0;l<i;l++)D[v+3]=I=P*Y>>Q,0!==I?(I=255/I,D[v]=(b*Y>>Q)*I,D[v+1]=(_*Y>>Q)*I,D[v+2]=(w*Y>>Q)*I):D[v]=D[v+1]=D[v+2]=0,b-=C,_-=k,w-=E,P-=S,C-=q.r,k-=q.g,E-=q.b,S-=q.a,p=g+((p=l+s+1)<G?p:G)<<2,b+=T+=q.r=D[p],_+=A+=q.g=D[p+1],w+=O+=q.b=D[p+2],P+=M+=q.a=D[p+3],q=q.next,C+=V=H.r,k+=B=H.g,E+=R=H.b,S+=I=H.a,T-=V,A-=B,O-=R,M-=I,H=H.next,v+=4;g+=i}for(l=0;l<i;l++){for(A=O=M=T=_=w=P=b=0,C=W*(V=D[v=l<<2]),k=W*(B=D[v+1]),E=W*(R=D[v+2]),S=W*(I=D[v+3]),b+=X*V,_+=X*B,w+=X*R,P+=X*I,U=$,h=0;h<W;h++)U.r=V,U.g=B,U.b=R,U.a=I,U=U.next;for(d=i,h=1;h<=s;h++)v=d+l<<2,b+=(U.r=V=D[v])*(j=W-h),_+=(U.g=B=D[v+1])*j,w+=(U.b=R=D[v+2])*j,P+=(U.a=I=D[v+3])*j,T+=V,A+=B,O+=R,M+=I,U=U.next,h<z&&(d+=i);for(v=l,q=$,H=N,u=0;u<o;u++)D[(p=v<<2)+3]=I=P*Y>>Q,I>0?(I=255/I,D[p]=(b*Y>>Q)*I,D[p+1]=(_*Y>>Q)*I,D[p+2]=(w*Y>>Q)*I):D[p]=D[p+1]=D[p+2]=0,b-=C,_-=k,w-=E,P-=S,C-=q.r,k-=q.g,E-=q.b,S-=q.a,p=l+((p=u+W)<z?p:z)*i<<2,b+=T+=q.r=D[p],_+=A+=q.g=D[p+1],w+=O+=q.b=D[p+2],P+=M+=q.a=D[p+3],q=q.next,C+=V=H.r,k+=B=H.g,E+=R=H.b,S+=I=H.a,T-=V,A-=B,O-=R,M-=I,H=H.next,v+=i}return t}(l,0,0,i,o,s),t.getContext("2d").putImageData(l,e,n)}}var eo=function BlurStack(){!function _classCallCheck$1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,BlurStack),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},ro=function isNullish(t){return null==t},no=function canvg(t,e,n){if(ro(t)&&ro(e)&&ro(n)){var i=document.querySelectorAll("svg");return Promise.all(_toConsumableArray(i).map((function(t){var e=document.createElement("canvas");e.width=t.clientWidth,e.height=t.clientHeight,t.before(e),t.remove();var n=document.createElement("div");return n.append(t),canvg(e,n.innerHTML)})))}"string"==typeof t&&(t=document.getElementById(t)),ro(t.svg)||t.svg.stop();var o=function build(t){var e={opts:t,FRAMERATE:30,MAX_VIRTUAL_PIXELS:3e4,log:function(t){}};!0===e.opts.log&&"undefined"!=typeof console&&(e.log=function(t){console.log(t)});e.init=function(t){var n=0;e.UniqueId=function(){return"canvg"+ ++n},e.Definitions={},e.Styles={},e.Animations=[],e.Images=[],e.ctx=t,e.ViewPort={viewPorts:[],Clear:function Clear(){this.viewPorts=[]},SetCurrent:function SetCurrent(t,e){this.viewPorts.push({width:t,height:e})},RemoveCurrent:function RemoveCurrent(){this.viewPorts.pop()},Current:function Current(){return this.viewPorts[this.viewPorts.length-1]},width:function width(){return this.Current().width},height:function height(){return this.Current().height},ComputeSize:function ComputeSize(t){return ro(t)||"number"!=typeof t?"x"===t?this.width():"y"===t?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2):t}}},e.init(),e.ImagesLoaded=function(){return e.Images.every((function(t){return t.loaded}))},e.trim=function(t){return t.replace(/^\s+|\s+$/g,"")},e.compressSpaces=function(t){return t.replace(/\s+/gm," ")},e.ajax=function(t,e){var n=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");return e?new Promise((function(e,i){n.open("GET",t,!0).addEventListener("load",(function(){e(n.responseText)})),n.send(null)})):(n.open("GET",t,!1),n.send(null),n.responseText)},e.parseXml=function(t){if(window.DOMParser)return(new DOMParser).parseFromString(t,"text/xml");t=t.replace(/<!DOCTYPE svg[^>]*>/,"");var e=new window.ActiveXObject("Microsoft.XMLDOM");return e.async="false",e.loadXML(t),e};var n={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};e.Property=function(){function Property(t,e){_classCallCheck(this,Property),this.name=t,this.value=e}return _createClass(Property,[{key:"getValue",value:function getValue(){return this.value}},{key:"hasValue",value:function hasValue(){return!ro(this.value)&&""!==this.value}},{key:"numValue",value:function numValue(){if(!this.hasValue())return 0;var t=Number.parseFloat(this.value);return String(this.value).endsWith("%")&&(t/=100),t}},{key:"valueOrDefault",value:function valueOrDefault(t){return this.hasValue()?this.value:t}},{key:"numValueOrDefault",value:function numValueOrDefault(t){return this.hasValue()?this.numValue():t}},{key:"addOpacity",value:function addOpacity(t){var n=this.value;if(!ro(t.value)&&""!==t.value&&"string"==typeof this.value){var i=new Ji(this.value);i.ok&&(n="rgba("+i.r+", "+i.g+", "+i.b+", "+t.numValue()+")")}return new e.Property(this.name,n)}},{key:"getDefinition",value:function getDefinition(){var t=this.value.match(/#([^)'"]+)/);return t&&(t=t[1]),t||(t=this.value),e.Definitions[t]}},{key:"isUrlDefinition",value:function isUrlDefinition(){return this.value.startsWith("url(")}},{key:"getFillStyleDefinition",value:function getFillStyleDefinition(t,n){var i=this.getDefinition();if(!ro(i)&&i.createGradient)return i.createGradient(e.ctx,t,n);if(!ro(i)&&i.createPattern){if(i.getHrefAttribute().hasValue()){var o=i.attribute("patternTransform");i=i.getHrefAttribute().getDefinition(),o.hasValue()&&(i.attribute("patternTransform",!0).value=o.value)}return i.createPattern(e.ctx,t)}return null}},{key:"getDPI",value:function getDPI(t){return 96}},{key:"getEM",value:function getEM(t){var n=12,i=new e.Property("fontSize",e.Font.Parse(e.ctx.font).fontSize);return i.hasValue()&&(n=i.toPixels(t)),n}},{key:"getUnits",value:function getUnits(){return String(this.value).replace(/[\d.-]/g,"")}},{key:"toPixels",value:function toPixels(t,n){if(!this.hasValue())return 0;var i=String(this.value);if(i.endsWith("em"))return this.numValue()*this.getEM(t);if(i.endsWith("ex"))return this.numValue()*this.getEM(t)/2;if(i.endsWith("px"))return this.numValue();if(i.endsWith("pt"))return this.numValue()*this.getDPI(t)*(1/72);if(i.endsWith("pc"))return 15*this.numValue();if(i.endsWith("cm"))return this.numValue()*this.getDPI(t)/2.54;if(i.endsWith("mm"))return this.numValue()*this.getDPI(t)/25.4;if(i.endsWith("in"))return this.numValue()*this.getDPI(t);if(i.endsWith("%"))return this.numValue()*e.ViewPort.ComputeSize(t);var o=this.numValue();return n&&o<1?o*e.ViewPort.ComputeSize(t):o}},{key:"toMilliseconds",value:function toMilliseconds(){if(!this.hasValue())return 0;var t=String(this.value);return t.endsWith("ms")?this.numValue():t.endsWith("s")?1e3*this.numValue():this.numValue()}},{key:"toRadians",value:function toRadians(){if(!this.hasValue())return 0;var t=String(this.value);return t.endsWith("deg")?this.numValue()*(Math.PI/180):t.endsWith("grad")?this.numValue()*(Math.PI/200):t.endsWith("rad")?this.numValue():this.numValue()*(Math.PI/180)}},{key:"toTextBaseline",value:function toTextBaseline(){return this.hasValue()?n[this.value]:null}}]),Property}(),e.Font={Styles:"normal|italic|oblique|inherit",Variants:"normal|small-caps|inherit",Weights:"normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit",CreateFont:function CreateFont(t,n,i,o,s,l){var u=ro(l)?this.CreateFont("","","","","",e.ctx.font):this.Parse(l);return{fontFamily:s||u.fontFamily,fontSize:o||u.fontSize,fontStyle:t||u.fontStyle,fontWeight:i||u.fontWeight,fontVariant:n||u.fontVariant,toString:function toString(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}},Parse:function Parse(t){var n=this,i={},o=e.trim(e.compressSpaces(t||"")).split(" "),s={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1},l="";return o.forEach((function(t){!s.fontStyle&&n.Styles.includes(t)?("inherit"!==t&&(i.fontStyle=t),s.fontStyle=!0):!s.fontVariant&&n.Variants.includes(t)?("inherit"!==t&&(i.fontVariant=t),s.fontStyle=s.fontVariant=!0):!s.fontWeight&&n.Weights.includes(t)?("inherit"!==t&&(i.fontWeight=t),s.fontStyle=s.fontVariant=s.fontWeight=!0):s.fontSize?"inherit"!==t&&(l+=t):("inherit"!==t&&(i.fontSize=t.split("/")[0]),s.fontStyle=s.fontVariant=s.fontWeight=s.fontSize=!0)})),""!==l&&(i.fontFamily=l),i}},e.ToNumberArray=function(t){return e.trim(e.compressSpaces((t||"").replace(/,/g," "))).split(" ").map((function(t){return Number.parseFloat(t)}))},e.Point=function(){function _class(t,e){_classCallCheck(this,_class),this.x=t,this.y=e}return _createClass(_class,[{key:"angleTo",value:function angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}},{key:"applyTransform",value:function applyTransform(t){var e=this.x*t[0]+this.y*t[2]+t[4],n=this.x*t[1]+this.y*t[3]+t[5];this.x=e,this.y=n}}]),_class}(),e.CreatePoint=function(t){var n=e.ToNumberArray(t);return new e.Point(n[0],n[1])},e.CreatePath=function(t){for(var n=e.ToNumberArray(t),i=[],o=0;o<n.length;o+=2)i.push(new e.Point(n[o],n[o+1]));return i},e.BoundingBox=function(){function _class2(t,e,n,i){_classCallCheck(this,_class2),this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(t,e),this.addPoint(n,i)}return _createClass(_class2,[{key:"x",value:function x(){return this.x1}},{key:"y",value:function y(){return this.y1}},{key:"width",value:function width(){return this.x2-this.x1}},{key:"height",value:function height(){return this.y2-this.y1}},{key:"addPoint",value:function addPoint(t,e){ro(t)||((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),ro(e)||((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}},{key:"addX",value:function addX(t){this.addPoint(t,null)}},{key:"addY",value:function addY(t){this.addPoint(null,t)}},{key:"addBoundingBox",value:function addBoundingBox(t){this.addPoint(t.x1,t.y1),this.addPoint(t.x2,t.y2)}},{key:"addQuadraticCurve",value:function addQuadraticCurve(t,e,n,i,o,s){var l=t+2/3*(n-t),u=e+2/3*(i-e),h=l+1/3*(o-t),p=u+1/3*(s-e);this.addBezierCurve(t,e,l,h,u,p,o,s)}},{key:"addBezierCurve",value:function addBezierCurve(t,e,n,i,o,s,l,u){var h=this,p=[t,e],d=[n,i],v=[o,s],g=[l,u];this.addPoint(p[0],p[1]),this.addPoint(g[0],g[1]);for(var b=function _loop(t){var e=function f(e){return Math.pow(1-e,3)*p[t]+3*Math.pow(1-e,2)*e*d[t]+3*(1-e)*Math.pow(e,2)*v[t]+Math.pow(e,3)*g[t]},n=6*p[t]-12*d[t]+6*v[t],i=-3*p[t]+9*d[t]-9*v[t]+3*g[t],o=3*d[t]-3*p[t];if(0===i){if(0===n)return"continue";var s=-o/n;return s>0&&s<1&&(0===t&&h.addX(e(s)),1===t&&h.addY(e(s))),"continue"}var l=Math.pow(n,2)-4*o*i;if(l<0)return"continue";var u=(-n+Math.sqrt(l))/(2*i);u>0&&u<1&&(0===t&&h.addX(e(u)),1===t&&h.addY(e(u)));var b=(-n-Math.sqrt(l))/(2*i);b>0&&b<1&&(0===t&&h.addX(e(b)),1===t&&h.addY(e(b)))},_=0;_<=1;_++)b(_)}},{key:"isPointInBox",value:function isPointInBox(t,e){return this.x1<=t&&t<=this.x2&&this.y1<=e&&e<=this.y2}}]),_class2}(),e.Transform=function(){function _class3(t){var n=this;_classCallCheck(this,_class3),this.Type={translate:function translate(t){_classCallCheck(this,translate),this.p=e.CreatePoint(t),this.apply=function(t){t.translate(this.p.x||0,this.p.y||0)},this.unapply=function(t){t.translate(-1*this.p.x||0,-1*this.p.y||0)},this.applyToPoint=function(t){t.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0])}},rotate:function rotate(t){_classCallCheck(this,rotate);var n=e.ToNumberArray(t);this.angle=new e.Property("angle",n[0]),this.cx=n[1]||0,this.cy=n[2]||0,this.apply=function(t){t.translate(this.cx,this.cy),t.rotate(this.angle.toRadians()),t.translate(-this.cx,-this.cy)},this.unapply=function(t){t.translate(this.cx,this.cy),t.rotate(-1*this.angle.toRadians()),t.translate(-this.cx,-this.cy)},this.applyToPoint=function(t){var e=this.angle.toRadians();t.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]),t.applyTransform([Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]),t.applyTransform([1,0,0,1,-this.p.x||0,-this.p.y||0])}},scale:function scale(t){_classCallCheck(this,scale),this.p=e.CreatePoint(t),this.apply=function(t){t.scale(this.p.x||1,this.p.y||this.p.x||1)},this.unapply=function(t){t.scale(1/this.p.x||1,1/this.p.y||this.p.x||1)},this.applyToPoint=function(t){t.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}},matrix:function matrix(t){_classCallCheck(this,matrix),this.m=e.ToNumberArray(t),this.apply=function(t){t.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])},this.applyToPoint=function(t){t.applyTransform(this.m)}}},Object.assign(this.Type,{SkewBase:function(t){_inherits(SkewBase,t);var n=_createSuper(SkewBase);function SkewBase(t){var i;return _classCallCheck(this,SkewBase),(i=n.call(this,t)).angle=new e.Property("angle",t),i}return SkewBase}(this.Type.matrix)}),Object.assign(this.Type,{skewX:function(t){_inherits(skewX,t);var e=_createSuper(skewX);function skewX(t){var n;return _classCallCheck(this,skewX),(n=e.call(this,t)).m=[1,0,Math.tan(n.angle.toRadians()),1,0,0],n}return skewX}(this.Type.SkewBase),skewY:function(t){_inherits(skewY,t);var e=_createSuper(skewY);function skewY(t){var n;return _classCallCheck(this,skewY),(n=e.call(this,t)).m=[1,Math.tan(n.angle.toRadians()),0,1,0,0],n}return skewY}(this.Type.SkewBase)});var i=e.trim(e.compressSpaces(t)).replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/);this.transforms=i.map((function(t){var i=e.trim(t.split("(")[0]),o=t.split("(")[1].replace(")",""),s=new n.Type[i](o);return s.type=i,s}))}return _createClass(_class3,[{key:"apply",value:function apply(t){this.transforms.forEach((function(e){e.apply(t)}))}},{key:"unapply",value:function unapply(t){for(var e=this.transforms.length-1;e>=0;e--)this.transforms[e].unapply(t)}},{key:"applyToPoint",value:function applyToPoint(t){this.transforms.forEach((function(e){e.applyToPoint(t)}))}}]),_class3}(),e.AspectRatio=function(t,n,i,o,s,l,u,h,p,d){var v=(n=(n=e.compressSpaces(n)).replace(/^defer\s/,"")).split(" ")[0]||"xMidYMid",g=n.split(" ")[1]||"meet",b=i/o,_=s/l,w=Math.min(b,_),P=Math.max(b,_);"meet"===g&&(o*=w,l*=w),"slice"===g&&(o*=P,l*=P),p=new e.Property("refX",p),d=new e.Property("refY",d),p.hasValue()&&d.hasValue()?t.translate(-w*p.toPixels("x"),-w*d.toPixels("y")):(v.startsWith("xMid")&&("meet"===g&&w===_||"slice"===g&&P===_)&&t.translate(i/2-o/2,0),v.endsWith("YMid")&&("meet"===g&&w===b||"slice"===g&&P===b)&&t.translate(0,s/2-l/2),v.startsWith("xMax")&&("meet"===g&&w===_||"slice"===g&&P===_)&&t.translate(i-o,0),v.endsWith("YMax")&&("meet"===g&&w===b||"slice"===g&&P===b)&&t.translate(0,s-l)),"none"===v?t.scale(b,_):"meet"===g?t.scale(w,w):"slice"===g&&t.scale(P,P),t.translate(ro(u)?0:-u,ro(h)?0:-h)},e.Element={},e.EmptyProperty=new e.Property("EMPTY",""),e.Element.ElementBase=function(){function _class4(t){var n=this;if(_classCallCheck(this,_class4),this.captureTextNodes=arguments[1],this.attributes={},this.styles={},this.children=[],!ro(t)&&1===t.nodeType){_toConsumableArray(t.childNodes).forEach((function(t){if(1===t.nodeType&&n.addChild(t,!0),n.captureTextNodes&&(3===t.nodeType||4===t.nodeType)){var i=t.nodeValue||t.text||"";""!==e.trim(e.compressSpaces(i))&&n.addChild(new e.Element.tspan(t),!1)}})),_toConsumableArray(t.attributes).forEach((function(t){var i=t.nodeName,o=t.nodeValue;n.attributes[i]=new e.Property(i,o)}));var i=e.Styles[t.nodeName];if(ro(i)||Object.entries(i).forEach((function(t){var e=_slicedToArray(t,2),i=e[0],o=e[1];n.styles[i]=o})),this.attribute("class").hasValue())e.compressSpaces(this.attribute("class").value).split(" ").forEach((function(o){i=e.Styles["."+o],ro(i)||Object.entries(i).forEach((function(t){var e=_slicedToArray(t,2),i=e[0],o=e[1];n.styles[i]=o})),i=e.Styles[t.nodeName+"."+o],ro(i)||Object.entries(i).forEach((function(t){var e=_slicedToArray(t,2),i=e[0],o=e[1];n.styles[i]=o}))}));if(this.attribute("id").hasValue()){var o=e.Styles["#"+this.attribute("id").value];ro(o)||Object.entries(o).forEach((function(t){var e=_slicedToArray(t,2),i=e[0],o=e[1];n.styles[i]=o}))}if(this.attribute("style").hasValue())this.attribute("style").value.split(";").forEach((function(t){if(""!==e.trim(t)){var i=t.split(":"),o=i.name,s=i.value;o=e.trim(o),s=e.trim(s),n.styles[o]=new e.Property(o,s)}}));this.attribute("id").hasValue()&&ro(e.Definitions[this.attribute("id").value])&&(e.Definitions[this.attribute("id").value]=this)}}return _createClass(_class4,[{key:"attribute",value:function attribute(t,n){var i=this.attributes[t];return ro(i)?(!0===n&&(i=new e.Property(t,""),this.attributes[t]=i),i||e.EmptyProperty):i}},{key:"getHrefAttribute",value:function getHrefAttribute(){for(var t in this.attributes)if(t.endsWith(":href"))return this.attributes[t];return e.EmptyProperty}},{key:"style",value:function style(t,n,i){var o=this.styles[t];if(!ro(o))return o;var s=this.attribute(t);if(!ro(s)&&s.hasValue())return this.styles[t]=s,s;if(!0!==i){var l=this.parent;if(!ro(l)){var u=l.style(t);if(!ro(u)&&u.hasValue())return u}}return!0===n&&(o=new e.Property(t,""),this.styles[t]=o),o||e.EmptyProperty}},{key:"render",value:function render(t){if("none"!==this.style("display").value&&"hidden"!==this.style("visibility").value){if(t.save(),this.attribute("mask").hasValue()){var e=this.attribute("mask").getDefinition();ro(e)||e.apply(t,this)}else if(this.style("filter").hasValue()){var n=this.style("filter").getDefinition();ro(n)||n.apply(t,this)}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}},{key:"setContext",value:function setContext(t){}},{key:"clearContext",value:function clearContext(t){}},{key:"renderChildren",value:function renderChildren(t){this.children.forEach((function(e){e.render(t)}))}},{key:"addChild",value:function addChild(t,n){var i=n?e.CreateElement(t):t;i.parent=this,"title"!==i.type&&this.children.push(i)}}]),_class4}(),e.Element.RenderedElementBase=function(t){_inherits(_class5,t);var n=_createSuper(_class5);function _class5(){return _classCallCheck(this,_class5),n.apply(this,arguments)}return _createClass(_class5,[{key:"setContext",value:function setContext(t){if(this.style("fill").isUrlDefinition()){var n=this.style("fill").getFillStyleDefinition(this,this.style("fill-opacity"));ro(n)||(t.fillStyle=n)}else if(this.style("fill").hasValue()){var i=this.style("fill");"currentColor"===i.value&&(i.value=this.style("color").value),t.fillStyle="none"===i.value?"rgba(0,0,0,0)":i.value}if(this.style("fill-opacity").hasValue()){var o=new e.Property("fill",t.fillStyle);o=o.addOpacity(this.style("fill-opacity")),t.fillStyle=o.value}if(this.style("stroke").isUrlDefinition()){var s=this.style("stroke").getFillStyleDefinition(this,this.style("stroke-opacity"));ro(s)||(t.strokeStyle=s)}else if(this.style("stroke").hasValue()){var l=this.style("stroke");"currentColor"===l.value&&(l.value=this.style("color").value),t.strokeStyle="none"===l.value?"rgba(0,0,0,0)":l.value}if(this.style("stroke-opacity").hasValue()){var u=new e.Property("stroke",t.strokeStyle);u=u.addOpacity(this.style("stroke-opacity")),t.strokeStyle=u.value}if(this.style("stroke-width").hasValue()){var h=this.style("stroke-width").toPixels();t.lineWidth=0===h?.001:h}if(this.style("stroke-linecap").hasValue()&&(t.lineCap=this.style("stroke-linecap").value),this.style("stroke-linejoin").hasValue()&&(t.lineJoin=this.style("stroke-linejoin").value),this.style("stroke-miterlimit").hasValue()&&(t.miterLimit=this.style("stroke-miterlimit").value),this.style("stroke-dasharray").hasValue()&&"none"!==this.style("stroke-dasharray").value){var p=e.ToNumberArray(this.style("stroke-dasharray").value);void 0!==t.setLineDash?t.setLineDash(p):void 0!==t.webkitLineDash?t.webkitLineDash=p:void 0===t.mozDash||1===p.length&&0===p[0]||(t.mozDash=p);var d=this.style("stroke-dashoffset").numValueOrDefault(1);void 0!==t.lineDashOffset?t.lineDashOffset=d:void 0!==t.webkitLineDashOffset?t.webkitLineDashOffset=d:void 0!==t.mozDashOffset&&(t.mozDashOffset=d)}(void 0!==t.font&&(t.font=e.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").toPixels()+"px":"",this.style("font-family").value).toString()),this.attribute("transform").hasValue())&&new e.Transform(this.attribute("transform").value).apply(t);if(this.style("clip-path",!1,!0).hasValue()){var v=this.style("clip-path",!1,!0).getDefinition();ro(v)||v.apply(t)}this.style("opacity").hasValue()&&(t.globalAlpha=this.style("opacity").numValue())}}]),_class5}(e.Element.ElementBase),e.Element.PathElementBase=function(t){_inherits(_class6,t);var n=_createSuper(_class6);function _class6(){return _classCallCheck(this,_class6),n.apply(this,arguments)}return _createClass(_class6,[{key:"path",value:function path(t){return ro(t)||t.beginPath(),new e.BoundingBox}},{key:"renderChildren",value:function renderChildren(t){this.path(t),e.Mouse.checkPath(this,t),""!==t.fillStyle&&("inherit"!==this.style("fill-rule").valueOrDefault("inherit")?t.fill(this.style("fill-rule").value):t.fill()),""!==t.strokeStyle&&t.stroke();var n=this.getMarkers();if(!ro(n)){if(this.style("marker-start").isUrlDefinition())this.style("marker-start").getDefinition().render(t,n[0][0],n[0][1]);if(this.style("marker-mid").isUrlDefinition())for(var i=this.style("marker-mid").getDefinition(),o=1;o<n.length-1;o++)i.render(t,n[o][0],n[o][1]);if(this.style("marker-end").isUrlDefinition())this.style("marker-end").getDefinition().render(t,n[n.length-1][0],n[n.length-1][1])}}},{key:"getBoundingBox",value:function getBoundingBox(){return this.path()}},{key:"getMarkers",value:function getMarkers(){return null}}]),_class6}(e.Element.RenderedElementBase),e.Element.svg=function(t){_inherits(_class7,t);var n=_createSuper(_class7);function _class7(){return _classCallCheck(this,_class7),n.apply(this,arguments)}return _createClass(_class7,[{key:"clearContext",value:function clearContext(t){_get(_getPrototypeOf(_class7.prototype),"clearContext",this).call(this,t),e.ViewPort.RemoveCurrent()}},{key:"setContext",value:function setContext(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4,void 0!==t.font&&void 0!==window.getComputedStyle&&(t.font=window.getComputedStyle(t.canvas).getPropertyValue("font")),_get(_getPrototypeOf(_class7.prototype),"setContext",this).call(this,t),this.attribute("x").hasValue()||(this.attribute("x",!0).value=0),this.attribute("y").hasValue()||(this.attribute("y",!0).value=0),t.translate(this.attribute("x").toPixels("x"),this.attribute("y").toPixels("y"));var n=e.ViewPort.width(),i=e.ViewPort.height();if(this.attribute("width").hasValue()||(this.attribute("width",!0).value="100%"),this.attribute("height").hasValue()||(this.attribute("height",!0).value="100%"),void 0===this.root){n=this.attribute("width").toPixels("x"),i=this.attribute("height").toPixels("y");var o=0,s=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(o=-this.attribute("refX").toPixels("x"),s=-this.attribute("refY").toPixels("y")),"visible"!==this.attribute("overflow").valueOrDefault("hidden")&&(t.beginPath(),t.moveTo(o,s),t.lineTo(n,s),t.lineTo(n,i),t.lineTo(o,i),t.closePath(),t.clip())}if(e.ViewPort.SetCurrent(n,i),this.attribute("viewBox").hasValue()){var l=e.ToNumberArray(this.attribute("viewBox").value),u=l[0],h=l[1];n=l[2],i=l[3],e.AspectRatio(t,this.attribute("preserveAspectRatio").value,e.ViewPort.width(),n,e.ViewPort.height(),i,u,h,this.attribute("refX").value,this.attribute("refY").value),e.ViewPort.RemoveCurrent(),e.ViewPort.SetCurrent(l[2],l[3])}}}]),_class7}(e.Element.RenderedElementBase),e.Element.rect=function(t){_inherits(_class8,t);var n=_createSuper(_class8);function _class8(){return _classCallCheck(this,_class8),n.apply(this,arguments)}return _createClass(_class8,[{key:"path",value:function path(t){var n=this.attribute("x").toPixels("x"),i=this.attribute("y").toPixels("y"),o=this.attribute("width").toPixels("x"),s=this.attribute("height").toPixels("y"),l=this.attribute("rx").toPixels("x"),u=this.attribute("ry").toPixels("y");return this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(u=l),this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(l=u),l=Math.min(l,o/2),u=Math.min(u,s/2),ro(t)||(t.beginPath(),t.moveTo(n+l,i),t.lineTo(n+o-l,i),t.quadraticCurveTo(n+o,i,n+o,i+u),t.lineTo(n+o,i+s-u),t.quadraticCurveTo(n+o,i+s,n+o-l,i+s),t.lineTo(n+l,i+s),t.quadraticCurveTo(n,i+s,n,i+s-u),t.lineTo(n,i+u),t.quadraticCurveTo(n,i,n+l,i),t.closePath()),new e.BoundingBox(n,i,n+o,i+s)}}]),_class8}(e.Element.PathElementBase),e.Element.circle=function(t){_inherits(_class9,t);var n=_createSuper(_class9);function _class9(){return _classCallCheck(this,_class9),n.apply(this,arguments)}return _createClass(_class9,[{key:"path",value:function path(t){var n=this.attribute("cx").toPixels("x"),i=this.attribute("cy").toPixels("y"),o=this.attribute("r").toPixels();return ro(t)||(t.beginPath(),t.arc(n,i,o,0,2*Math.PI,!0),t.closePath()),new e.BoundingBox(n-o,i-o,n+o,i+o)}}]),_class9}(e.Element.PathElementBase);var i=(Math.sqrt(2)-1)/3*4;function imGet(t,e,n,i,o,s){return t[n*i*4+4*e+s]}function imSet(t,e,n,i,o,s,l){t[n*i*4+4*e+s]=l}return e.Element.ellipse=function(t){_inherits(_class10,t);var n=_createSuper(_class10);function _class10(){return _classCallCheck(this,_class10),n.apply(this,arguments)}return _createClass(_class10,[{key:"path",value:function path(t){var n=this.attribute("rx").toPixels("x"),o=this.attribute("ry").toPixels("y"),s=this.attribute("cx").toPixels("x"),l=this.attribute("cy").toPixels("y");return ro(t)||(t.beginPath(),t.moveTo(s,l-o),t.bezierCurveTo(s+i*n,l-o,s+n,l-i*o,s+n,l),t.bezierCurveTo(s+n,l+i*o,s+i*n,l+o,s,l+o),t.bezierCurveTo(s-i*n,l+o,s-n,l+i*o,s-n,l),t.bezierCurveTo(s-n,l-i*o,s-i*n,l-o,s,l-o),t.closePath()),new e.BoundingBox(s-n,l-o,s+n,l+o)}}]),_class10}(e.Element.PathElementBase),e.Element.line=function(t){_inherits(_class11,t);var n=_createSuper(_class11);function _class11(){return _classCallCheck(this,_class11),n.apply(this,arguments)}return _createClass(_class11,[{key:"getPoints",value:function getPoints(){return[new e.Point(this.attribute("x1").toPixels("x"),this.attribute("y1").toPixels("y")),new e.Point(this.attribute("x2").toPixels("x"),this.attribute("y2").toPixels("y"))]}},{key:"path",value:function path(t){var n=this.getPoints();return ro(t)||(t.beginPath(),t.moveTo(n[0].x,n[0].y),t.lineTo(n[1].x,n[1].y)),new e.BoundingBox(n[0].x,n[0].y,n[1].x,n[1].y)}},{key:"getMarkers",value:function getMarkers(){var t=this.getPoints(),e=t[0].angleTo(t[1]);return[[t[0],e],[t[1],e]]}}]),_class11}(e.Element.PathElementBase),e.Element.polyline=function(t){_inherits(_class12,t);var n=_createSuper(_class12);function _class12(t){var i;return _classCallCheck(this,_class12),(i=n.call(this,t)).points=e.CreatePath(i.attribute("points").value),i}return _createClass(_class12,[{key:"path",value:function path(t){var n=this.points[0],i=n.x,o=n.y,s=new e.BoundingBox(i,o);ro(t)||(t.beginPath(),t.moveTo(i,o));for(var l=1;l<this.points.length;l++){var u=this.points[l],h=u.x,p=u.y;s.addPoint(h,p),ro(t)||t.lineTo(h,p)}return s}},{key:"getMarkers",value:function getMarkers(){for(var t=[],e=0;e<this.points.length-1;e++)t.push([this.points[e],this.points[e].angleTo(this.points[e+1])]);return t.push([this.points[this.points.length-1],t[t.length-1][1]]),t}}]),_class12}(e.Element.PathElementBase),e.Element.polygon=function(t){_inherits(_class13,t);var e=_createSuper(_class13);function _class13(){return _classCallCheck(this,_class13),e.apply(this,arguments)}return _createClass(_class13,[{key:"path",value:function path(t){var e=_get(_getPrototypeOf(_class13.prototype),"path",this).call(this,t);return ro(t)||(t.lineTo(this.points[0].x,this.points[0].y),t.closePath()),e}}]),_class13}(e.Element.polyline),e.Element.path=function(t){_inherits(_class14,t);var n=_createSuper(_class14);function _class14(t){var i;_classCallCheck(this,_class14);var o=(i=n.call(this,t)).attribute("d").value.replace(/,/gm," ").replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2").replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2").replace(/([MmZzLlHhVvCcSsQqTtAa])(\S)/gm,"$1 $2").replace(/(\S)([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2").replace(/(\d)([+-])/gm,"$1 $2").replace(/(\.\d*)(\.)/gm,"$1 $2").replace(/([Aa](\s+\d+)(\s+\d+)(\s+\d+))\s+([01])\s*([01])/gm,"$1 $5 $6 ");return o=e.compressSpaces(o),o=e.trim(o),i.PathParser={tokens:o.split(" "),reset:function reset(){this.i=-1,this.command="",this.previousCommand="",this.start=new e.Point(0,0),this.control=new e.Point(0,0),this.current=new e.Point(0,0),this.points=[],this.angles=[]},isEnd:function isEnd(){return this.i>=this.tokens.length-1},isCommandOrEnd:function isCommandOrEnd(){return!!this.isEnd()||!ro(this.tokens[this.i+1].match(/^[A-Za-z]$/))},isRelativeCommand:function isRelativeCommand(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0}return!1},getToken:function getToken(){return this.i++,this.tokens[this.i]},getScalar:function getScalar(){return Number.parseFloat(this.getToken())},nextCommand:function nextCommand(){this.previousCommand=this.command,this.command=this.getToken()},getPoint:function getPoint(){var t=new e.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(t)},getAsControlPoint:function getAsControlPoint(){var t=this.getPoint();return this.control=t,t},getAsCurrentPoint:function getAsCurrentPoint(){var t=this.getPoint();return this.current=t,t},getReflectedControlPoint:function getReflectedControlPoint(){return"c"!==this.previousCommand.toLowerCase()&&"s"!==this.previousCommand.toLowerCase()&&"q"!==this.previousCommand.toLowerCase()&&"t"!==this.previousCommand.toLowerCase()?this.current:new e.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y)},makeAbsolute:function makeAbsolute(t){return this.isRelativeCommand()&&(t.x+=this.current.x,t.y+=this.current.y),t},addMarker:function addMarker(t,e,n){!ro(n)&&this.angles.length>0&&ro(this.angles[this.angles.length-1])&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(n)),this.addMarkerAngle(t,ro(e)?null:e.angleTo(t))},addMarkerAngle:function addMarkerAngle(t,e){this.points.push(t),this.angles.push(e)},getMarkerPoints:function getMarkerPoints(){return this.points},getMarkerAngles:function getMarkerAngles(){for(var t=0;t<this.angles.length;t++)if(ro(this.angles[t]))for(var e=t+1;e<this.angles.length;e++)if(!ro(this.angles[e])){this.angles[t]=this.angles[e];break}return this.angles}},i}return _createClass(_class14,[{key:"path",value:function path(t){var n=this.PathParser;n.reset();var i=new e.BoundingBox;for(ro(t)||t.beginPath();!n.isEnd();)switch(n.nextCommand(),n.command){case"M":case"m":var o=n.getAsCurrentPoint();for(n.addMarker(o),i.addPoint(o.x,o.y),ro(t)||t.moveTo(o.x,o.y),n.start=n.current;!n.isCommandOrEnd();){var s=n.getAsCurrentPoint();n.addMarker(s,n.start),i.addPoint(s.x,s.y),ro(t)||t.lineTo(s.x,s.y)}break;case"L":case"l":for(;!n.isCommandOrEnd();){var l=n.current,u=n.getAsCurrentPoint();n.addMarker(u,l),i.addPoint(u.x,u.y),ro(t)||t.lineTo(u.x,u.y)}break;case"H":case"h":for(;!n.isCommandOrEnd();){var h=new e.Point((n.isRelativeCommand()?n.current.x:0)+n.getScalar(),n.current.y);n.addMarker(h,n.current),n.current=h,i.addPoint(n.current.x,n.current.y),ro(t)||t.lineTo(n.current.x,n.current.y)}break;case"V":case"v":for(;!n.isCommandOrEnd();){var p=new e.Point(n.current.x,(n.isRelativeCommand()?n.current.y:0)+n.getScalar());n.addMarker(p,n.current),n.current=p,i.addPoint(n.current.x,n.current.y),ro(t)||t.lineTo(n.current.x,n.current.y)}break;case"C":case"c":for(;!n.isCommandOrEnd();){var d=n.current,v=n.getPoint(),g=n.getAsControlPoint(),b=n.getAsCurrentPoint();n.addMarker(b,g,v),i.addBezierCurve(d.x,d.y,v.x,v.y,g.x,g.y,b.x,b.y),ro(t)||t.bezierCurveTo(v.x,v.y,g.x,g.y,b.x,b.y)}break;case"S":case"s":for(;!n.isCommandOrEnd();){var _=n.current,w=n.getReflectedControlPoint(),P=n.getAsControlPoint(),C=n.getAsCurrentPoint();n.addMarker(C,P,w),i.addBezierCurve(_.x,_.y,w.x,w.y,P.x,P.y,C.x,C.y),ro(t)||t.bezierCurveTo(w.x,w.y,P.x,P.y,C.x,C.y)}break;case"Q":case"q":for(;!n.isCommandOrEnd();){var k=n.current,E=n.getAsControlPoint(),S=n.getAsCurrentPoint();n.addMarker(S,E,E),i.addQuadraticCurve(k.x,k.y,E.x,E.y,S.x,S.y),ro(t)||t.quadraticCurveTo(E.x,E.y,S.x,S.y)}break;case"T":case"t":for(;!n.isCommandOrEnd();){var T=n.current,A=n.getReflectedControlPoint();n.control=A;var O=n.getAsCurrentPoint();n.addMarker(O,A,A),i.addQuadraticCurve(T.x,T.y,A.x,A.y,O.x,O.y),ro(t)||t.quadraticCurveTo(A.x,A.y,O.x,O.y)}break;case"A":case"a":for(var M=function _loop2(){var o=n.current,s=n.getScalar(),l=n.getScalar(),u=n.getScalar()*(Math.PI/180),h=n.getScalar(),p=n.getScalar(),d=n.getAsCurrentPoint(),v=new e.Point(Math.cos(u)*(o.x-d.x)/2+Math.sin(u)*(o.y-d.y)/2,-Math.sin(u)*(o.x-d.x)/2+Math.cos(u)*(o.y-d.y)/2),g=Math.pow(v.x,2)/Math.pow(s,2)+Math.pow(v.y,2)/Math.pow(l,2);g>1&&(s*=Math.sqrt(g),l*=Math.sqrt(g));var b=(h===p?-1:1)*Math.sqrt((Math.pow(s,2)*Math.pow(l,2)-Math.pow(s,2)*Math.pow(v.y,2)-Math.pow(l,2)*Math.pow(v.x,2))/(Math.pow(s,2)*Math.pow(v.y,2)+Math.pow(l,2)*Math.pow(v.x,2)));isNaN(b)&&(b=0);var _=new e.Point(b*s*v.y/l,b*-l*v.x/s),w=new e.Point((o.x+d.x)/2+Math.cos(u)*_.x-Math.sin(u)*_.y,(o.y+d.y)/2+Math.sin(u)*_.x+Math.cos(u)*_.y),P=function m(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))},C=function r(t,e){return(t[0]*e[0]+t[1]*e[1])/(P(t)*P(e))},k=function a(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(C(t,e))},E=k([1,0],[(v.x-_.x)/s,(v.y-_.y)/l]),S=[(v.x-_.x)/s,(v.y-_.y)/l],T=[(-v.x-_.x)/s,(-v.y-_.y)/l],A=k(S,T);C(S,T)<=-1&&(A=Math.PI),C(S,T)>=1&&(A=0);var O=1-p?1:-1,M=E+O*(A/2),V=new e.Point(w.x+s*Math.cos(M),w.y+l*Math.sin(M));if(n.addMarkerAngle(V,M-O*Math.PI/2),n.addMarkerAngle(d,M-O*Math.PI),i.addPoint(d.x,d.y),!ro(t)){var B=s>l?s:l,R=s>l?1:s/l,I=s>l?l/s:1;t.translate(w.x,w.y),t.rotate(u),t.scale(R,I),t.arc(0,0,B,E,E+A,1-p),t.scale(1/R,1/I),t.rotate(-u),t.translate(-w.x,-w.y)}};!n.isCommandOrEnd();)M();break;case"Z":case"z":ro(t)||t.closePath(),n.current=n.start}return i}},{key:"getMarkers",value:function getMarkers(){var t=this.PathParser.getMarkerPoints(),e=this.PathParser.getMarkerAngles();return t.map((function(t,n){return[t,e[n]]}))}}]),_class14}(e.Element.PathElementBase),e.Element.pattern=function(t){_inherits(_class15,t);var n=_createSuper(_class15);function _class15(){return _classCallCheck(this,_class15),n.apply(this,arguments)}return _createClass(_class15,[{key:"createPattern",value:function createPattern(t,n){var i=this.attribute("width").toPixels("x",!0),o=this.attribute("height").toPixels("y",!0),s=new e.Element.svg;s.attributes.viewBox=new e.Property("viewBox",this.attribute("viewBox").value),s.attributes.width=new e.Property("width",i+"px"),s.attributes.height=new e.Property("height",o+"px"),s.attributes.transform=new e.Property("transform",this.attribute("patternTransform").value),s.children=this.children;var l=document.createElement("canvas");l.width=i,l.height=o;var u=l.getContext("2d");this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&u.translate(this.attribute("x").toPixels("x",!0),this.attribute("y").toPixels("y",!0));for(var h=-1;h<=1;h++)for(var p=-1;p<=1;p++)u.save(),u.translate(h*l.width,p*l.height),s.render(u),u.restore();return t.createPattern(l,"repeat")}}]),_class15}(e.Element.ElementBase),e.Element.marker=function(t){_inherits(_class16,t);var n=_createSuper(_class16);function _class16(){return _classCallCheck(this,_class16),n.apply(this,arguments)}return _createClass(_class16,[{key:"render",value:function render(t,n,i){t.translate(n.x,n.y),"auto"===this.attribute("orient").valueOrDefault("auto")&&t.rotate(i),"strokeWidth"===this.attribute("markerUnits").valueOrDefault("strokeWidth")&&t.scale(t.lineWidth,t.lineWidth),t.save();var o=new e.Element.svg;o.attributes.viewBox=new e.Property("viewBox",this.attribute("viewBox").value),o.attributes.refX=new e.Property("refX",this.attribute("refX").value),o.attributes.refY=new e.Property("refY",this.attribute("refY").value),o.attributes.width=new e.Property("width",this.attribute("markerWidth").value),o.attributes.height=new e.Property("height",this.attribute("markerHeight").value),o.attributes.fill=new e.Property("fill",this.attribute("fill").valueOrDefault("black")),o.attributes.stroke=new e.Property("stroke",this.attribute("stroke").valueOrDefault("none")),o.children=this.children,o.render(t),t.restore(),"strokeWidth"===this.attribute("markerUnits").valueOrDefault("strokeWidth")&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===this.attribute("orient").valueOrDefault("auto")&&t.rotate(-i),t.translate(-n.x,-n.y)}}]),_class16}(e.Element.ElementBase),e.Element.defs=function(t){_inherits(_class17,t);var e=_createSuper(_class17);function _class17(){return _classCallCheck(this,_class17),e.apply(this,arguments)}return _createClass(_class17,[{key:"render",value:function render(t){}}]),_class17}(e.Element.ElementBase),e.Element.GradientBase=function(t){_inherits(_class18,t);var n=_createSuper(_class18);function _class18(t){var e;return _classCallCheck(this,_class18),(e=n.call(this,t)).gradientUnits=e.attribute("gradientUnits").valueOrDefault("objectBoundingBox"),e.stops=[],e.children.forEach((function(t){"stop"===t.type&&e.stops.push(t)})),e}return _createClass(_class18,[{key:"getGradient",value:function getGradient(){}},{key:"createGradient",value:function createGradient(t,n,i){var o=this.getHrefAttribute().hasValue()?this.getHrefAttribute().getDefinition():this,s=function addParentOpacity(t){return i.hasValue()?new e.Property("color",t).addOpacity(i).value:t},l=this.getGradient(t,n);if(ro(l))return s(o.stops[o.stops.length-1].color);if(o.stops.forEach((function(t){var e=t.offset,n=t.color;l.addColorStop(e,s(n))})),this.attribute("gradientTransform").hasValue()){var u=e.ViewPort.viewPorts[0],h=new e.Element.rect;h.attributes.x=new e.Property("x",-e.MAX_VIRTUAL_PIXELS/3),h.attributes.y=new e.Property("y",-e.MAX_VIRTUAL_PIXELS/3),h.attributes.width=new e.Property("width",e.MAX_VIRTUAL_PIXELS),h.attributes.height=new e.Property("height",e.MAX_VIRTUAL_PIXELS);var p=new e.Element.g;p.attributes.transform=new e.Property("transform",this.attribute("gradientTransform").value),p.children=[h];var d=new e.Element.svg;d.attributes.x=new e.Property("x",0),d.attributes.y=new e.Property("y",0),d.attributes.width=new e.Property("width",u.width),d.attributes.height=new e.Property("height",u.height),d.children=[p];var v=document.createElement("canvas");v.width=u.width,v.height=u.height;var g=v.getContext("2d");return g.fillStyle=l,d.render(g),g.createPattern(v,"no-repeat")}return l}}]),_class18}(e.Element.ElementBase),e.Element.linearGradient=function(t){_inherits(_class19,t);var e=_createSuper(_class19);function _class19(){return _classCallCheck(this,_class19),e.apply(this,arguments)}return _createClass(_class19,[{key:"getGradient",value:function getGradient(t,e){var n="objectBoundingBox"===this.gradientUnits&&e.getBoundingBox,i=n?e.getBoundingBox():null;this.attribute("x1").hasValue()||this.attribute("y1").hasValue()||this.attribute("x2").hasValue()||this.attribute("y2").hasValue()||(this.attribute("x1",!0).value=0,this.attribute("y1",!0).value=0,this.attribute("x2",!0).value=1,this.attribute("y2",!0).value=0);var o=n?i.x()+i.width()*this.attribute("x1").numValue():this.attribute("x1").toPixels("x"),s=n?i.y()+i.height()*this.attribute("y1").numValue():this.attribute("y1").toPixels("y"),l=n?i.x()+i.width()*this.attribute("x2").numValue():this.attribute("x2").toPixels("x"),u=n?i.y()+i.height()*this.attribute("y2").numValue():this.attribute("y2").toPixels("y");return o===l&&s===u?null:t.createLinearGradient(o,s,l,u)}}]),_class19}(e.Element.GradientBase),e.Element.radialGradient=function(t){_inherits(_class20,t);var e=_createSuper(_class20);function _class20(){return _classCallCheck(this,_class20),e.apply(this,arguments)}return _createClass(_class20,[{key:"getGradient",value:function getGradient(t,e){var n="objectBoundingBox"===this.gradientUnits&&e.getBoundingBox,i=n?e.getBoundingBox():null;this.attribute("cx").hasValue()||(this.attribute("cx",!0).value="50%"),this.attribute("cy").hasValue()||(this.attribute("cy",!0).value="50%"),this.attribute("r").hasValue()||(this.attribute("r",!0).value="50%");var o=n?i.x()+i.width()*this.attribute("cx").numValue():this.attribute("cx").toPixels("x"),s=n?i.y()+i.height()*this.attribute("cy").numValue():this.attribute("cy").toPixels("y"),l=o,u=s;this.attribute("fx").hasValue()&&(l=n?i.x()+i.width()*this.attribute("fx").numValue():this.attribute("fx").toPixels("x")),this.attribute("fy").hasValue()&&(u=n?i.y()+i.height()*this.attribute("fy").numValue():this.attribute("fy").toPixels("y"));var h=n?(i.width()+i.height())/2*this.attribute("r").numValue():this.attribute("r").toPixels();return t.createRadialGradient(l,u,0,o,s,h)}}]),_class20}(e.Element.GradientBase),e.Element.stop=function(t){_inherits(_class21,t);var e=_createSuper(_class21);function _class21(t){var n;_classCallCheck(this,_class21),(n=e.call(this,t)).offset=n.attribute("offset").numValue(),n.offset<0&&(n.offset=0),n.offset>1&&(n.offset=1);var i=n.style("stop-color");return n.style("stop-opacity").hasValue()&&(i=i.addOpacity(n.style("stop-opacity"))),n.color=i.value,n}return _class21}(e.Element.ElementBase),e.Element.AnimateBase=function(t){_inherits(_class22,t);var n=_createSuper(_class22);function _class22(t){var i;return _classCallCheck(this,_class22),i=n.call(this,t),e.Animations.push(_assertThisInitialized(i)),i.duration=0,i.begin=i.attribute("begin").toMilliseconds(),i.maxDuration=i.begin+i.attribute("dur").toMilliseconds(),i.initialValue=null,i.initialUnits="",i.removed=!1,i.from=i.attribute("from"),i.to=i.attribute("to"),i.values=i.attribute("values"),i.values.hasValue()&&(i.values.value=i.values.value.split(";")),i}return _createClass(_class22,[{key:"getProperty",value:function getProperty(){var t=this.attribute("attributeType").value,e=this.attribute("attributeName").value;return"CSS"===t?this.parent.style(e,!0):this.parent.attribute(e,!0)}},{key:"calcValue",value:function calcValue(){return""}},{key:"update",value:function update(t){if(ro(this.initialValue)&&(this.initialValue=this.getProperty().value,this.initialUnits=this.getProperty().getUnits()),this.duration>this.maxDuration){if("indefinite"===this.attribute("repeatCount").value||"indefinite"===this.attribute("repeatDur").value)this.duration=0;else if("freeze"!==this.attribute("fill").valueOrDefault("remove")||this.frozen){if("remove"===this.attribute("fill").valueOrDefault("remove")&&!this.removed)return this.removed=!0,this.getProperty().value=this.parent.animationFrozen?this.parent.animationFrozenValue:this.initialValue,!0}else this.frozen=!0,this.parent.animationFrozen=!0,this.parent.animationFrozenValue=this.getProperty().value;return!1}this.duration+=t;var e=!1;if(this.begin<this.duration){var n=this.calcValue();if(this.attribute("type").hasValue())n=this.attribute("type").value+"("+n+")";this.getProperty().value=n,e=!0}return e}},{key:"progress",value:function progress(){var t={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(this.values.hasValue()){var n=t.progress*(this.values.value.length-1),i=Math.floor(n),o=Math.ceil(n);t.from=new e.Property("from",Number.parseFloat(this.values.value[i])),t.to=new e.Property("to",Number.parseFloat(this.values.value[o])),t.progress=(n-i)/(o-i)}else t.from=this.from,t.to=this.to;return t}}]),_class22}(e.Element.ElementBase),e.Element.animate=function(t){_inherits(_class23,t);var e=_createSuper(_class23);function _class23(){return _classCallCheck(this,_class23),e.apply(this,arguments)}return _createClass(_class23,[{key:"calcValue",value:function calcValue(){var t=this.progress();return t.from.numValue()+(t.to.numValue()-t.from.numValue())*t.progress+this.initialUnits}}]),_class23}(e.Element.AnimateBase),e.Element.animateColor=function(t){_inherits(_class24,t);var e=_createSuper(_class24);function _class24(){return _classCallCheck(this,_class24),e.apply(this,arguments)}return _createClass(_class24,[{key:"calcValue",value:function calcValue(){var t=this.progress(),e=new Ji(t.from.value),n=new Ji(t.to.value);if(e.ok&&n.ok){var i=e.r+(n.r-e.r)*t.progress,o=e.g+(n.g-e.g)*t.progress,s=e.b+(n.b-e.b)*t.progress;return"rgb("+Number.parseInt(i)+","+Number.parseInt(o)+","+Number.parseInt(s)+")"}return this.attribute("from").value}}]),_class24}(e.Element.AnimateBase),e.Element.animateTransform=function(t){_inherits(_class25,t);var n=_createSuper(_class25);function _class25(){return _classCallCheck(this,_class25),n.apply(this,arguments)}return _createClass(_class25,[{key:"calcValue",value:function calcValue(){var t=this.progress(),n=e.ToNumberArray(t.from.value),i=e.ToNumberArray(t.to.value),o="";return n.forEach((function(e,n){o+=e+(i[n]-e)*t.progress+" "})),o}}]),_class25}(e.Element.animate),e.Element.font=function(t){_inherits(_class26,t);var n=_createSuper(_class26);function _class26(t){var i;return _classCallCheck(this,_class26),(i=n.call(this,t)).horizAdvX=i.attribute("horiz-adv-x").numValue(),i.isRTL=!1,i.isArabic=!1,i.fontFace=null,i.missingGlyph=null,i.glyphs=[],i.children.forEach((function(t){"font-face"===t.type?(i.fontFace=t,t.style("font-family").hasValue()&&(e.Definitions[t.style("font-family").value]=_assertThisInitialized(i))):"missing-glyph"===t.type?i.missingGlyph=t:"glyph"===t.type&&(""!==t.arabicForm?(i.isRTL=!0,i.isArabic=!0,void 0===i.glyphs[t.unicode]&&(i.glyphs[t.unicode]=[]),i.glyphs[t.unicode][t.arabicForm]=t):i.glyphs[t.unicode]=t)})),i}return _class26}(e.Element.ElementBase),e.Element.fontface=function(t){_inherits(_class27,t);var e=_createSuper(_class27);function _class27(t){var n;return _classCallCheck(this,_class27),(n=e.call(this,t)).ascent=n.attribute("ascent").value,n.descent=n.attribute("descent").value,n.unitsPerEm=n.attribute("units-per-em").numValue(),n}return _class27}(e.Element.ElementBase),e.Element.missingglyph=function(t){_inherits(_class28,t);var e=_createSuper(_class28);function _class28(t){var n;return _classCallCheck(this,_class28),(n=e.call(this,t)).horizAdvX=0,n}return _class28}(e.Element.path),e.Element.glyph=function(t){_inherits(_class29,t);var e=_createSuper(_class29);function _class29(t){var n;return _classCallCheck(this,_class29),(n=e.call(this,t)).horizAdvX=n.attribute("horiz-adv-x").numValue(),n.unicode=n.attribute("unicode").value,n.arabicForm=n.attribute("arabic-form").value,n}return _class29}(e.Element.path),e.Element.text=function(t){_inherits(_class30,t);var n=_createSuper(_class30);function _class30(t){return _classCallCheck(this,_class30),n.call(this,t,!0)}return _createClass(_class30,[{key:"setContext",value:function setContext(t){_get(_getPrototypeOf(_class30.prototype),"setContext",this).call(this,t);var e=this.style("dominant-baseline").toTextBaseline();ro(e)&&(e=this.style("alignment-baseline").toTextBaseline()),ro(e)||(t.textBaseline=e)}},{key:"getBoundingBox",value:function getBoundingBox(){var t=this.attribute("x").toPixels("x"),n=this.attribute("y").toPixels("y"),i=this.parent.style("font-size").numValueOrDefault(e.Font.Parse(e.ctx.font).fontSize);return new e.BoundingBox(t,n-i,t+Math.floor(2*i/3)*this.children[0].getText().length,n)}},{key:"renderChildren",value:function renderChildren(t){var e=this;this.x=this.attribute("x").toPixels("x"),this.y=this.attribute("y").toPixels("y"),this.x+=this.getAnchorDelta(t,this,0),this.children.forEach((function(n,i){e.renderChild(t,e,i)}))}},{key:"getAnchorDelta",value:function getAnchorDelta(t,e,n){var i=this.style("text-anchor").valueOrDefault("start");if("start"!==i){for(var o=0,s=n;s<e.children.length;s++){var l=e.children[s];if(s>n&&l.attribute("x").hasValue())break;o+=l.measureTextRecursive(t)}return-1*("end"===i?o:o/2)}return 0}},{key:"renderChild",value:function renderChild(t,e,n){var i=e.children[n];i.attribute("x").hasValue()?(i.x=i.attribute("x").toPixels("x")+this.getAnchorDelta(t,e,n),i.attribute("dx").hasValue()&&(i.x+=i.attribute("dx").toPixels("x"))):(this.attribute("dx").hasValue()&&(this.x+=this.attribute("dx").toPixels("x")),i.attribute("dx").hasValue()&&(this.x+=i.attribute("dx").toPixels("x")),i.x=this.x),this.x=i.x+i.measureText(t),i.attribute("y").hasValue()?(i.y=i.attribute("y").toPixels("y"),i.attribute("dy").hasValue()&&(i.y+=i.attribute("dy").toPixels("y"))):(this.attribute("dy").hasValue()&&(this.y+=this.attribute("dy").toPixels("y")),i.attribute("dy").hasValue()&&(this.y+=i.attribute("dy").toPixels("y")),i.y=this.y),this.y=i.y,i.render(t);for(var o=0;o<i.children.length;o++)this.renderChild(t,i,o)}}]),_class30}(e.Element.RenderedElementBase),e.Element.TextElementBase=function(t){_inherits(_class31,t);var n=_createSuper(_class31);function _class31(){return _classCallCheck(this,_class31),n.apply(this,arguments)}return _createClass(_class31,[{key:"getGlyph",value:function getGlyph(t,e,n){var i=e[n],o=null;if(t.isArabic){var s="isolated";(0===n||" "===e[n-1])&&n<e.length-2&&" "!==e[n+1]&&(s="terminal"),n>0&&" "!==e[n-1]&&n<e.length-2&&" "!==e[n+1]&&(s="medial"),n>0&&" "!==e[n-1]&&(n===e.length-1||" "===e[n+1])&&(s="initial"),void 0!==t.glyphs[i]&&(o=t.glyphs[i][s],ro(o)&&"glyph"===t.glyphs[i].type&&(o=t.glyphs[i]))}else o=t.glyphs[i];return ro(o)&&(o=t.missingGlyph),o}},{key:"renderChildren",value:function renderChildren(t){var n=this.parent.style("font-family").getDefinition();if(ro(n))""!==t.fillStyle&&t.fillText(e.compressSpaces(this.getText()),this.x,this.y),""!==t.strokeStyle&&t.strokeText(e.compressSpaces(this.getText()),this.x,this.y);else{var i=this.parent.style("font-size").numValueOrDefault(e.Font.Parse(e.ctx.font).fontSize),o=this.parent.style("font-style").valueOrDefault(e.Font.Parse(e.ctx.font).fontStyle),s=this.getText();n.isRTL&&(s=s.split("").reverse().join(""));for(var l=e.ToNumberArray(this.parent.attribute("dx").value),u=0;u<s.length;u++){var h=this.getGlyph(n,s,u),p=i/n.fontFace.unitsPerEm;t.translate(this.x,this.y),t.scale(p,-p);var d=t.lineWidth;t.lineWidth=t.lineWidth*n.fontFace.unitsPerEm/i,"italic"===o&&t.transform(1,0,.4,1,0,0),h.render(t),"italic"===o&&t.transform(1,0,-.4,1,0,0),t.lineWidth=d,t.scale(1/p,-1/p),t.translate(-this.x,-this.y),this.x+=i*(h.horizAdvX||n.horizAdvX)/n.fontFace.unitsPerEm,void 0===l[u]||isNaN(l[u])||(this.x+=l[u])}}}},{key:"getText",value:function getText(){}},{key:"measureTextRecursive",value:function measureTextRecursive(t){var e=this.measureText(t);return this.children.forEach((function(n){e+=n.measureTextRecursive(t)})),e}},{key:"measureText",value:function measureText(t){var n=this.parent.style("font-family").getDefinition();if(!ro(n)){var i=this.parent.style("font-size").numValueOrDefault(e.Font.Parse(e.ctx.font).fontSize),o=0,s=this.getText();n.isRTL&&(s=s.split("").reverse().join(""));for(var l=e.ToNumberArray(this.parent.attribute("dx").value),u=0;u<s.length;u++){o+=(this.getGlyph(n,s,u).horizAdvX||n.horizAdvX)*i/n.fontFace.unitsPerEm,void 0===l[u]||isNaN(l[u])||(o+=l[u])}return o}var h=e.compressSpaces(this.getText());if(!t.measureText)return 10*h.length;t.save(),this.setContext(t);var p=t.measureText(h).width;return t.restore(),p}}]),_class31}(e.Element.RenderedElementBase),e.Element.tspan=function(t){_inherits(_class32,t);var e=_createSuper(_class32);function _class32(t){var n;return _classCallCheck(this,_class32),(n=e.call(this,t,!0)).text=t.nodeValue||t.text||"",n}return _createClass(_class32,[{key:"getText",value:function getText(){return this.text}}]),_class32}(e.Element.TextElementBase),e.Element.tref=function(t){_inherits(_class33,t);var e=_createSuper(_class33);function _class33(){return _classCallCheck(this,_class33),e.apply(this,arguments)}return _createClass(_class33,[{key:"getText",value:function getText(){var t=this.getHrefAttribute().getDefinition();if(!ro(t))return t.children[0].getText()}}]),_class33}(e.Element.TextElementBase),e.Element.a=function(t){_inherits(_class34,t);var n=_createSuper(_class34);function _class34(t){var e;return _classCallCheck(this,_class34),(e=n.call(this,t)).hasText=!0,_toConsumableArray(t.childNodes).forEach((function(t){3!==t.nodeType&&(e.hasText=!1)})),e.text=e.hasText?t.childNodes[0].nodeValue:"",e}return _createClass(_class34,[{key:"getText",value:function getText(){return this.text}},{key:"renderChildren",value:function renderChildren(t){if(this.hasText){_get(_getPrototypeOf(_class34.prototype),"renderChildren",this).call(this,t);var n=new e.Property("fontSize",e.Font.Parse(e.ctx.font).fontSize);e.Mouse.checkBoundingBox(this,new e.BoundingBox(this.x,this.y-n.toPixels("y"),this.x+this.measureText(t),this.y))}else{var i=new e.Element.g;i.children=this.children,i.parent=this,i.render(t)}}},{key:"onclick",value:function onclick(){window.open(this.getHrefAttribute().value)}},{key:"onmousemove",value:function onmousemove(){e.ctx.canvas.style.cursor="pointer"}}]),_class34}(e.Element.TextElementBase),e.Element.image=function(t){_inherits(_class35,t);var n=_createSuper(_class35);function _class35(t){var i;_classCallCheck(this,_class35);var o=(i=n.call(this,t)).getHrefAttribute().value;return""===o?_possibleConstructorReturn(i):(i._isSvg=o.match(/\.svg$/),e.Images.push(_assertThisInitialized(i)),i.loaded=!1,i._isSvg?e.ajax(o,!0).then((function(t){i.img=t,i.loaded=!0})).catch((function(t){i.erred=!0,console.error("Ajax error for canvg",t)})):(i.img=document.createElement("img"),!0===e.opts.useCORS&&(i.img.crossOrigin="Anonymous"),i.img.addEventListener("load",(function(){i.loaded=!0})),i.img.addEventListener("error",(function(){e.log('ERROR: image "'+o+'" not found'),i.loaded=!0})),i.img.src=o),i)}return _createClass(_class35,[{key:"renderChildren",value:function renderChildren(t){var n=this.attribute("x").toPixels("x"),i=this.attribute("y").toPixels("y"),o=this.attribute("width").toPixels("x"),s=this.attribute("height").toPixels("y");0!==o&&0!==s&&(t.save(),this._isSvg?t.drawSvg(this.img,n,i,o,s):(t.translate(n,i),e.AspectRatio(t,this.attribute("preserveAspectRatio").value,o,this.img.width,s,this.img.height,0,0),t.drawImage(this.img,0,0)),t.restore())}},{key:"getBoundingBox",value:function getBoundingBox(){var t=this.attribute("x").toPixels("x"),n=this.attribute("y").toPixels("y"),i=this.attribute("width").toPixels("x"),o=this.attribute("height").toPixels("y");return new e.BoundingBox(t,n,t+i,n+o)}}]),_class35}(e.Element.RenderedElementBase),e.Element.g=function(t){_inherits(_class36,t);var n=_createSuper(_class36);function _class36(){return _classCallCheck(this,_class36),n.apply(this,arguments)}return _createClass(_class36,[{key:"getBoundingBox",value:function getBoundingBox(){var t=new e.BoundingBox;return this.children.forEach((function(e){t.addBoundingBox(e.getBoundingBox())})),t}}]),_class36}(e.Element.RenderedElementBase),e.Element.symbol=function(t){_inherits(_class37,t);var e=_createSuper(_class37);function _class37(){return _classCallCheck(this,_class37),e.apply(this,arguments)}return _createClass(_class37,[{key:"render",value:function render(t){}}]),_class37}(e.Element.RenderedElementBase),e.Element.style=function(t){_inherits(_class38,t);var n=_createSuper(_class38);function _class38(t){var i;_classCallCheck(this,_class38),i=n.call(this,t);var o="";return _toConsumableArray(t.childNodes).forEach((function(t){var e=t.nodeValue;o+=e})),o=o.replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^\s*\/\/.*)/gm,""),(o=e.compressSpaces(o)).split("}").forEach((function(t){if(""!==e.trim(t)){var n=_slicedToArray(t.split("{"),2),i=n[0],o=n[1];i=i.split(","),o=o.split(";"),i.forEach((function(t){if(""!==(t=e.trim(t))){var n={};if(o.forEach((function(t){var i=t.indexOf(":"),o=t.substr(0,i),s=t.substr(i+1,t.length-i);ro(o)||ro(s)||(n[e.trim(o)]=new e.Property(e.trim(o),e.trim(s)))})),e.Styles[t]=n,"@font-face"===t){var i=n["font-family"].value.replace(/"/g,"");n.src.value.split(",").forEach((function(t){if(t.includes('format("svg")')){var n=t.indexOf("url"),o=t.indexOf(")",n),s=t.substr(n+5,o-n-6);_toConsumableArray(e.parseXml(e.ajax(s)).getElementsByTagName("font")).forEach((function(t){t=e.CreateElement(t),e.Definitions[i]=t}))}}))}}}))}})),i}return _class38}(e.Element.ElementBase),e.Element.use=function(t){_inherits(_class39,t);var n=_createSuper(_class39);function _class39(t){var e;return _classCallCheck(this,_class39),(e=n.call(this,t))._el=e.getHrefAttribute().getDefinition(),e}return _createClass(_class39,[{key:"setContext",value:function setContext(t){_get(_getPrototypeOf(_class39.prototype),"setContext",this).call(this,t),this.attribute("x").hasValue()&&t.translate(this.attribute("x").toPixels("x"),0),this.attribute("y").hasValue()&&t.translate(0,this.attribute("y").toPixels("y"))}},{key:"path",value:function path(t){var e=this._el;ro(e)||e.path(t)}},{key:"getBoundingBox",value:function getBoundingBox(){var t=this._el;if(!ro(t))return t.getBoundingBox()}},{key:"renderChildren",value:function renderChildren(t){var n=this._el;if(!ro(n)){var i=n;"symbol"===n.type&&((i=new e.Element.svg).type="svg",i.attributes.viewBox=new e.Property("viewBox",n.attribute("viewBox").value),i.attributes.preserveAspectRatio=new e.Property("preserveAspectRatio",n.attribute("preserveAspectRatio").value),i.attributes.overflow=new e.Property("overflow",n.attribute("overflow").value),i.children=n.children),"svg"===i.type&&(this.attribute("width").hasValue()&&(i.attributes.width=new e.Property("width",this.attribute("width").value)),this.attribute("height").hasValue()&&(i.attributes.height=new e.Property("height",this.attribute("height").value)));var o=i.parent;i.parent=null,i.render(t),i.parent=o}}}]),_class39}(e.Element.RenderedElementBase),e.Element.mask=function(t){_inherits(_class40,t);var n=_createSuper(_class40);function _class40(){return _classCallCheck(this,_class40),n.apply(this,arguments)}return _createClass(_class40,[{key:"apply",value:function apply(t,n){var i=this.attribute("x").toPixels("x"),o=this.attribute("y").toPixels("y"),s=this.attribute("width").toPixels("x"),l=this.attribute("height").toPixels("y");if(0===s&&0===l){var u=new e.BoundingBox;this.children.forEach((function(t){u.addBoundingBox(t.getBoundingBox())})),i=Math.floor(u.x1),o=Math.floor(u.y1),s=Math.floor(u.width()),l=Math.floor(u.height())}var h=n.attribute("mask").value;n.attribute("mask").value="";var p=document.createElement("canvas");p.width=i+s,p.height=o+l;var d=p.getContext("2d");this.renderChildren(d);var v=document.createElement("canvas");v.width=i+s,v.height=o+l;var g=v.getContext("2d");n.render(g),g.globalCompositeOperation="destination-in",g.fillStyle=d.createPattern(p,"no-repeat"),g.fillRect(0,0,i+s,o+l),t.fillStyle=g.createPattern(v,"no-repeat"),t.fillRect(0,0,i+s,o+l),n.attribute("mask").value=h}},{key:"render",value:function render(t){}}]),_class40}(e.Element.ElementBase),e.Element.clipPath=function(t){_inherits(_class41,t);var n=_createSuper(_class41);function _class41(){return _classCallCheck(this,_class41),n.apply(this,arguments)}return _createClass(_class41,[{key:"apply",value:function apply(t){this.children.forEach((function(n){if(void 0!==n.path){var i=null;n.attribute("transform").hasValue()&&(i=new e.Transform(n.attribute("transform").value)).apply(t),n.path(t),t.clip(),i&&i.unapply(t)}}))}},{key:"render",value:function render(t){}}]),_class41}(e.Element.ElementBase),e.Element.filter=function(t){_inherits(_class42,t);var e=_createSuper(_class42);function _class42(){return _classCallCheck(this,_class42),e.apply(this,arguments)}return _createClass(_class42,[{key:"apply",value:function apply(t,e){var n=e.getBoundingBox(),i=Math.floor(n.x1),o=Math.floor(n.y1),s=Math.floor(n.width()),l=Math.floor(n.height()),u=e.style("filter").value;e.style("filter").value="";var h=0,p=0;this.children.forEach((function(t){var e=t.extraFilterDistance||0;h=Math.max(h,e),p=Math.max(p,e)}));var d=document.createElement("canvas");d.width=s+2*h,d.height=l+2*p;var v=d.getContext("2d");v.translate(-i+h,-o+p),e.render(v),this.children.forEach((function(t){t.apply(v,0,0,s+2*h,l+2*p)})),t.drawImage(d,0,0,s+2*h,l+2*p,i-h,o-p,s+2*h,l+2*p),e.style("filter",!0).value=u}},{key:"render",value:function render(t){}}]),_class42}(e.Element.ElementBase),e.Element.feMorphology=function(t){_inherits(_class43,t);var e=_createSuper(_class43);function _class43(){return _classCallCheck(this,_class43),e.apply(this,arguments)}return _createClass(_class43,[{key:"apply",value:function apply(t,e,n,i,o){}}]),_class43}(e.Element.ElementBase),e.Element.feComposite=function(t){_inherits(_class44,t);var e=_createSuper(_class44);function _class44(){return _classCallCheck(this,_class44),e.apply(this,arguments)}return _createClass(_class44,[{key:"apply",value:function apply(t,e,n,i,o){}}]),_class44}(e.Element.ElementBase),e.Element.feColorMatrix=function(t){_inherits(_class45,t);var n=_createSuper(_class45);function _class45(t){var i;_classCallCheck(this,_class45),i=n.call(this,t);var o=e.ToNumberArray(i.attribute("values").value);switch(i.attribute("type").valueOrDefault("matrix")){case"saturate":var s=o[0];o=[.213+.787*s,.715-.715*s,.072-.072*s,0,0,.213-.213*s,.715+.285*s,.072-.072*s,0,0,.213-.213*s,.715-.715*s,.072+.928*s,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var l=o[0]*Math.PI/180,u=function c(t,e,n){return t+Math.cos(l)*e+Math.sin(l)*n};o=[u(.213,.787,-.213),u(.715,-.715,-.715),u(.072,-.072,.928),0,0,u(.213,-.213,.143),u(.715,.285,.14),u(.072,-.072,-.283),0,0,u(.213,-.213,-.787),u(.715,-.715,.715),u(.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}return i.matrix=o,i._m=function(t,e){var n=o[t];return n*(n<0?e-255:e)},i}return _createClass(_class45,[{key:"apply",value:function apply(t,e,n,i,o){for(var s=this._m,l=t.getImageData(0,0,i,o),u=0;u<o;u++)for(var h=0;h<i;h++){var p=imGet(l.data,h,u,i,o,0),d=imGet(l.data,h,u,i,o,1),v=imGet(l.data,h,u,i,o,2),g=imGet(l.data,h,u,i,o,3);imSet(l.data,h,u,i,o,0,s(0,p)+s(1,d)+s(2,v)+s(3,g)+s(4,1)),imSet(l.data,h,u,i,o,1,s(5,p)+s(6,d)+s(7,v)+s(8,g)+s(9,1)),imSet(l.data,h,u,i,o,2,s(10,p)+s(11,d)+s(12,v)+s(13,g)+s(14,1)),imSet(l.data,h,u,i,o,3,s(15,p)+s(16,d)+s(17,v)+s(18,g)+s(19,1))}t.clearRect(0,0,i,o),t.putImageData(l,0,0)}}]),_class45}(e.Element.ElementBase),e.Element.feGaussianBlur=function(t){_inherits(_class46,t);var n=_createSuper(_class46);function _class46(t){var e;return _classCallCheck(this,_class46),(e=n.call(this,t)).blurRadius=Math.floor(e.attribute("stdDeviation").numValue()),e.extraFilterDistance=e.blurRadius,e}return _createClass(_class46,[{key:"apply",value:function apply(t,n,i,o,s){t.canvas.id=e.UniqueId(),t.canvas.style.display="none",document.body.append(t.canvas),processCanvasRGBA(t.canvas,n,i,o,s,this.blurRadius),t.canvas.remove()}}]),_class46}(e.Element.ElementBase),e.Element.title=function(t){_inherits(_class47,t);var e=_createSuper(_class47);function _class47(t){return _classCallCheck(this,_class47),e.call(this)}return _class47}(e.Element.ElementBase),e.Element.desc=function(t){_inherits(_class48,t);var e=_createSuper(_class48);function _class48(t){return _classCallCheck(this,_class48),e.call(this)}return _class48}(e.Element.ElementBase),e.Element.MISSING=function(t){_inherits(_class49,t);var n=_createSuper(_class49);function _class49(t){var i;return _classCallCheck(this,_class49),i=n.call(this),e.log("ERROR: Element '"+t.nodeName+"' not yet implemented."),i}return _class49}(e.Element.ElementBase),e.CreateElement=function(t){var n,i=t.nodeName.replace(/^[^:]+:/,"").replace(/-/g,"");return(n=void 0!==e.Element[i]?new e.Element[i](t):new e.Element.MISSING(t)).type=t.nodeName,n},e.load=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee(t,n){var i;return regeneratorRuntime.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,e.ajax(n,!0);case 2:return i=o.sent,o.abrupt("return",e.loadXml(t,i));case 4:case"end":return o.stop()}}),_callee)})));return function(e,n){return t.apply(this,arguments)}}(),e.loadXml=function(t,n){return e.loadXmlDoc(t,e.parseXml(n))},e.loadXmlDoc=function(t,n){var i;e.init(t);var o=function mapXY(e){for(var n=t.canvas;n;)e.x-=n.offsetLeft,e.y-=n.offsetTop,n=n.offsetParent;return window.scrollX&&(e.x+=window.scrollX),window.scrollY&&(e.y+=window.scrollY),e};!0!==e.opts.ignoreMouse&&(t.canvas.addEventListener("click",(function(t){var n=ro(t)?[event.clientX,event.clientY]:[t.clientX,t.clientY],i=o(_construct(e.Point,n)),s=i.x,l=i.y;e.Mouse.onclick(s,l)})),t.canvas.addEventListener("mousemove",(function(t){var n=ro(t)?[event.clientX,event.clientY]:[t.clientX,t.clientY],i=o(_construct(e.Point,n)),s=i.x,l=i.y;e.Mouse.onmousemove(s,l)})));var s=e.CreateElement(n.documentElement);s.root=!0;var l=!0,u=function draw(i){e.ViewPort.Clear(),t.canvas.parentNode&&e.ViewPort.SetCurrent(t.canvas.parentNode.clientWidth,t.canvas.parentNode.clientHeight),!0!==e.opts.ignoreDimensions&&(s.style("width").hasValue()&&(t.canvas.width=s.style("width").toPixels("x"),t.canvas.style.width=t.canvas.width+"px"),s.style("height").hasValue()&&(t.canvas.height=s.style("height").toPixels("y"),t.canvas.style.height=t.canvas.height+"px"));var o=t.canvas.clientWidth||t.canvas.width,u=t.canvas.clientHeight||t.canvas.height;if(!0===e.opts.ignoreDimensions&&s.style("width").hasValue()&&s.style("height").hasValue()&&(o=s.style("width").toPixels("x"),u=s.style("height").toPixels("y")),e.ViewPort.SetCurrent(o,u),ro(e.opts.offsetX)||(s.attribute("x",!0).value=e.opts.offsetX),ro(e.opts.offsetY)||(s.attribute("y",!0).value=e.opts.offsetY),!ro(e.opts.scaleWidth)||!ro(e.opts.scaleHeight)){var h=e.ToNumberArray(s.attribute("viewBox").value),p=null,d=null;ro(e.opts.scaleWidth)||(s.attribute("width").hasValue()?p=s.attribute("width").toPixels("x")/e.opts.scaleWidth:isNaN(h[2])||(p=h[2]/e.opts.scaleWidth)),ro(e.opts.scaleHeight)||(s.attribute("height").hasValue()?d=s.attribute("height").toPixels("y")/e.opts.scaleHeight:isNaN(h[3])||(d=h[3]/e.opts.scaleHeight)),ro(p)&&(p=d),ro(d)&&(d=p),s.attribute("width",!0).value=e.opts.scaleWidth,s.attribute("height",!0).value=e.opts.scaleHeight,s.attribute("viewBox",!0).value="0 0 "+o*p+" "+u*d,s.attribute("preserveAspectRatio",!0).value="none"}!0!==e.opts.ignoreClear&&t.clearRect(0,0,o,u),s.render(t),l&&(l=!1,i(n))},h=!0;return e.intervalID=setInterval((function(){var t=!1;h&&e.ImagesLoaded()&&(h=!1,t=!0),!0!==e.opts.ignoreMouse&&(t=t||e.Mouse.hasEvents()),!0!==e.opts.ignoreAnimation&&e.Animations.forEach((function(n){var i=n.update(1e3/e.FRAMERATE);t=t||i})),"function"==typeof e.opts.forceRedraw&&!0===e.opts.forceRedraw()&&(t=!0),t&&(u(i),e.Mouse.runEvents())}),1e3/e.FRAMERATE),new Promise((function(t,n){if(e.ImagesLoaded())return h=!1,void u(t);i=t}))},e.stop=function(){e.intervalID&&clearInterval(e.intervalID)},e.Mouse={events:[],hasEvents:function hasEvents(){return 0!==this.events.length},onclick:function onclick(t,e){this.events.push({type:"onclick",x:t,y:e,run:function run(t){t.onclick&&t.onclick()}})},onmousemove:function onmousemove(t,e){this.events.push({type:"onmousemove",x:t,y:e,run:function run(t){t.onmousemove&&t.onmousemove()}})},eventElements:[],checkPath:function checkPath(t,e){var n=this;this.events.forEach((function(i,o){var s=i.x,l=i.y;e.isPointInPath&&e.isPointInPath(s,l)&&(n.eventElements[o]=t)}))},checkBoundingBox:function checkBoundingBox(t,e){var n=this;this.events.forEach((function(i,o){var s=i.x,l=i.y;e.isPointInBox(s,l)&&(n.eventElements[o]=t)}))},runEvents:function runEvents(){var t=this;e.ctx.canvas.style.cursor="",this.events.forEach((function(e,n){for(var i=t.eventElements[n];i;)e.run(i),i=i.parent})),this.events=[],this.eventElements=[]}},e}(n||{});1===t.childNodes.length&&"OBJECT"===t.childNodes[0].nodeName||(t.svg=o);var s=t.getContext("2d");return void 0!==e.documentElement?o.loadXmlDoc(s,e):"<"===e.substr(0,1)?o.loadXml(s,e):o.load(s,e)};function __variableDynamicImportRuntime0__(t){switch(t){case"./locale/en.js":return Promise.resolve().then((function(){return io}));case"./locale/zh-CN.js":return Promise.resolve().then((function(){return oo}));default:return Promise.reject(new Error("Unknown variable dynamic import: "+t))}}"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.drawSvg=function(t,e,n,i,o){no(this.canvas,t,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:e,offsetY:n,scaleWidth:i,scaleHeight:o})});var ao=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee(t){var e;return regeneratorRuntime.wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,__variableDynamicImportRuntime0__("./locale/".concat(t,".js"));case 3:e=n.sent,n.next=12;break;case 6:return n.prev=6,n.t0=n.catch(0),console.error("Missing translation (".concat(t,") - using 'en'")),n.next=11,Promise.resolve().then((function(){return io}));case 11:e=n.sent;case 12:return n.abrupt("return",e.default);case 13:case"end":return n.stop()}}),_callee,null,[[0,6]])})));return function loadExtensionTranslation(e){return t.apply(this,arguments)}}(),io=(t("default",{name:"server_opensave",init:function init(t){var e=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee6(){var n,i,o,s,l,u,h,p,d,v,g,b,_,w,P,C,k,E,S,T,A,O,M,V;return regeneratorRuntime.wrap((function _callee6$(B){for(;;)switch(B.prev=B.next){case 0:return V=function _rebuildInput(t){t.empty();var e=n('<input type="file" name="svg_file">').appendTo(t);function submit(){return _submit.apply(this,arguments)}function _submit(){return(_submit=_asyncToGenerator(regeneratorRuntime.mark((function _callee5(){return regeneratorRuntime.wrap((function _callee5$(e){for(;;)switch(e.prev=e.next){case 0:return t.submit(),V(t),e.next=4,n.process_cancel(l.uploading);case 4:k=!0,n("#dialog_box").hide();case 6:case"end":return e.stop()}}),_callee5)})))).apply(this,arguments)}t[0]===A[0]?e.change(_asyncToGenerator(regeneratorRuntime.mark((function _callee3(){return regeneratorRuntime.wrap((function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.openPrep();case 2:if(e.sent){e.next=6;break}return V(t),e.abrupt("return");case 6:return e.next=8,submit();case 8:case"end":return e.stop()}}),_callee3)})))):e.change(_asyncToGenerator(regeneratorRuntime.mark((function _callee4(){return regeneratorRuntime.wrap((function _callee4$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,submit();case 2:case"end":return t.stop()}}),_callee4)}))))},w=function _clientDownloadSuppor(t,e,i){return!p&&!d&&(!(""!==n("<a>")[0].download)&&(n("<a>hidden</a>").attr({download:(t||"image")+e,href:i}).css("display","none").appendTo("body")[0].click(),!0))},_=function _xhtmlEscape(t){return t.replace(/&(?!amp;)/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")},b=function _getFileNameFromTitle(){return g.getDocumentTitle().trim().replace(/[/\\:*?"<>|]/g,"_")},n=t.$,i=t.decode64,o=t.encode64,s=e,B.next=8,ao(s.curPrefs.lang);case 8:if(l=B.sent,u=s.curConfig,h=u.extPath,p=u.avoidClientSide,d=u.avoidClientSideDownload,v=u.avoidClientSideOpen,g=s.canvas,P=h+"filesave.php",C=h+"filesave.php",k=!1,n('<iframe name="output_frame" title="'.concat(l.hiddenframe,'"\n style="width: 0; height: 0;" src="data:text/html;base64,PGh0bWw+"/>')).appendTo("body"),s.setCustomHandlers({save:function save(t,e){var i='<?xml version="1.0" encoding="UTF-8"?>\n'+e,s=b();w(s,".svg","data:image/svg+xml;charset=UTF-8;base64,"+o(i))||n("<form>").attr({method:"post",action:P,target:"output_frame"}).append('\n <input type="hidden" name="output_svg" value="'.concat(_(i),'">\n <input type="hidden" name="filename" value="').concat(_(s),'">\n ')).appendTo("body").submit().remove()},exportPDF:function exportPDF(t,e){var i=b(),o=e.output;w(i,".pdf",o)||n("<form>").attr({method:"post",action:C,target:"output_frame"}).append('\n <input type="hidden" name="output_img" value="'.concat(o,'">\n <input type="hidden" name="mime" value="application/pdf">\n <input type="hidden" name="filename" value="').concat(_(i),'">\n ')).appendTo("body").submit().remove()},exportImage:function exportImage(t,e){return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var t,i,o,s,l,u,h,p,d;return regeneratorRuntime.wrap((function _callee2$(v){for(;;)switch(v.prev=v.next){case 0:return t=e.issues,i=e.mimeType,o=e.quality,n("#export_canvas").length||n("<canvas>",{id:"export_canvas"}).hide().appendTo("body"),(s=n("#export_canvas")[0]).width=g.contentW,s.height=g.contentH,v.next=7,no(s,e.svg);case 7:if(l=o?s.toDataURL(i,o):s.toDataURL(i),h="",t.length&&(u="\n • ",h+="\n\n\n • "+t.join(u)),!h.length){v.next=13;break}return v.next=13,n.alert(h);case 13:if(p=b(),d="."+e.type.toLowerCase(),!w(p,d,l)){v.next=17;break}return v.abrupt("return");case 17:n("<form>").attr({method:"post",action:C,target:"output_frame"}).append('\n <input type="hidden" name="output_img" value="'.concat(l,'">\n <input type="hidden" name="mime" value="').concat(i,'">\n <input type="hidden" name="filename" value="').concat(_(p),'">\n ')).appendTo("body").submit().remove();case 18:case"end":return v.stop()}}),_callee2)})))()}}),!window.FileReader||v){B.next=16;break}return B.abrupt("return");case 16:E=h+"fileopen.php?type=load_svg",S=h+"fileopen.php?type=import_svg",T=h+"fileopen.php?type=import_img",s.processFile=function(t,e){var o;if(k)k=!1;else switch(n("#dialog_box").hide(),"import_img"!==e&&(o=i(t)),e){case"load_svg":g.clear(),g.setSvgString(o),s.updateCanvas();break;case"import_svg":g.importSvgString(o),s.updateCanvas();break;case"import_img":g.setGoodImage(t)}},(A=n("<form>")).attr({enctype:"multipart/form-data",method:"post",action:E,target:"output_frame"}),O=A.clone().attr("action",S),M=A.clone().attr("action",T),V(A),V(O),V(M),n("#tool_open").show().prepend(A),n("#tool_import").show().prepend(O),n("#tool_image").prepend(M);case 30:case"end":return B.stop()}}),_callee6)})))()}}),Object.freeze({__proto__:null,default:{uploading:"Uploading...",hiddenframe:"Opensave frame to store hidden values"}})),oo=Object.freeze({__proto__:null,default:{uploading:"正在上传...",hiddenframe:"Opensave frame to store hidden values"}})}}}));