@antv/g-canvas 1.1.7 → 1.1.8-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,13 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g"),require("mana-syringe")):"function"==typeof define&&define.amd?define(["exports","@antv/g","mana-syringe"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.CanvasKit={}),t.window.G,t.window.G.ManaSyringe)}(this,(function(t,e,n){"use strict";function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}function i(t,e,n,r){var i,o=arguments.length,a=3>o?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(a=(3>o?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function o(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function a(){
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g")):"function"==typeof define&&define.amd?define(["exports","@antv/g"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.Canvas2D={}),t.window.G)}(this,(function(t,e){"use strict";function r(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3
- a=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=Object.create((e&&e.prototype instanceof f?e:f).prototype),o=new S(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===h)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,o),i}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function f(){}function d(){}function v(){}var p={};s(p,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(P([])));g&&g!==e&&n.call(g,i)&&(p=g);var m=v.prototype=f.prototype=Object.create(p);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(i,o,a,c){var s=l(t[i],t,o);if("throw"!==s.type){var u=s.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:C}}function C(){return{value:void 0,done:!0}}return d.prototype=v,s(m,"constructor",v),s(v,"constructor",d),d.displayName=s(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},x(b.prototype),s(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new b(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(m),s(m,c,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=P,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(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),h},finish:function(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),L(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function c(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,i)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){c(o,r,i,a,s,"next",t)}function s(t){c(o,r,i,a,s,"throw",t)}a(void 0)}))}}var u,l,h=(u=function(){function t(){this.contextService=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView,r=function(e){t.hooks.pointerMove.call(e)},i=function(e){t.hooks.pointerUp.call(e)},o=function(e){t.hooks.pointerDown.call(e)},c=function(e){t.hooks.pointerOver.call(e)},u=function(e){t.hooks.pointerOut.call(e)},h=function(e){t.hooks.pointerCancel.call(e)},f=function(e){t.hooks.pointerWheel.call(e)},d=function(t){globalThis.document.addEventListener("pointermove",r,!0),t.addEventListener("pointerdown",o,!0),t.addEventListener("pointerleave",u,!0),t.addEventListener("pointerover",c,!0),globalThis.addEventListener("pointerup",i,!0)},v=function(t){t.addEventListener("touchstart",o,!0),t.addEventListener("touchend",i,!0),t.addEventListener("touchmove",r,!0),t.addEventListener("touchcancel",h,!0)},p=function(t){globalThis.document.addEventListener("mousemove",r,!0),t.addEventListener("mousedown",o,!0),t.addEventListener("mouseout",u,!0),t.addEventListener("mouseover",c,!0),globalThis.addEventListener("mouseup",i,!0)};t.hooks.init.tapPromise(l.tag,s(a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.contextService.getDomElement(),globalThis.navigator.msPointerEnabled?(r.style.msContentZooming="none",r.style.msTouchAction="none"):n.supportsPointerEvents&&(r.style.touchAction="none"),n.supportsPointerEvents?d(r):p(r),n.supportsTouchEvents&&v(r),r.addEventListener("wheel",f,{passive:!0,capture:!0});case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(l.tag,(function(){var t=e.contextService.getDomElement();n.supportsPointerEvents?function(t){globalThis.document.removeEventListener("pointermove",r,!0),t.removeEventListener("pointerdown",o,!0),t.removeEventListener("pointerleave",u,!0),t.removeEventListener("pointerover",c,!0),globalThis.removeEventListener("pointerup",i,!0)}(t):function(t){globalThis.document.removeEventListener("mousemove",r,!0),t.removeEventListener("mousedown",o,!0),t.removeEventListener("mouseout",u,!0),t.removeEventListener("mouseover",c,!0),globalThis.removeEventListener("mouseup",i,!0)}(t),n.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",o,!0),t.removeEventListener("touchend",i,!0),t.removeEventListener("touchmove",r,!0)}(t),t.removeEventListener("wheel",f,!0)}))},t}(),u.tag="DOMInteraction",l=u);i([n.inject(e.ContextService),o("design:type",Object)],h.prototype,"contextService",void 0),i([n.inject(e.RenderingContext),o("design:type",Object)],h.prototype,"renderingContext",void 0),h=l=i([n.singleton({contrib:e.RenderingPluginContribution})],h);var f=n.Module((function(t){t(h)})),d=function(){function t(){this.name="dom-interaction"}var e=t.prototype;return e.init=function(t){t.load(f,!0)},e.destroy=function(t){t.unload(f)},t}(),v=Object.freeze({__proto__:null,Plugin:d});function p(t,e,n,r,i){y(t,e,n||0,r||t.length-1,i||m)}function y(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,c=Math.log(o),s=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*s*(o-s)/o)*(0>a-o/2?-1:1);y(t,e,Math.max(n,Math.floor(e-a*s/o+u)),Math.min(r,Math.floor(e+(o-a)*s/o+u)),i)}var l=t[e],h=n,f=r;for(g(t,n,e),i(t[r],l)>0&&g(t,n,r);f>h;){for(g(t,h,f),h++,f--;0>i(t[h],l);)h++;for(;i(t[f],l)>0;)f--}0===i(t[n],l)?g(t,n,f):g(t,++f,r),f>e||(n=f+1),e>f||(r=f-1)}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e){return e>t?-1:t>e?1:0}class x{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!T(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;e.children.length>o;o++){const a=e.children[o],c=e.leaf?r(a):a;T(t,c)&&(e.leaf?n.push(a):O(t,c)?this._all(a,n):i.push(a))}e=i.pop()}return n}collides(t){let e=this.data;if(!T(t,e))return!1;const n=[];for(;e;){for(let r=0;e.children.length>r;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(T(t,o)){if(e.leaf||O(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(let e=0;t.length>e;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(e.height>this.data.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=N([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let a,c,s;for(;n||i.length;){if(n||(n=i.pop(),c=i[i.length-1],a=o.pop(),s=!0),n.leaf){const r=b(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}s||n.leaf||!O(n,r)?c?(a++,n=c.children[a],s=!1):n=null:(i.push(n),o.push(a),a=0,c=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,a=this._maxEntries;if(a>=i)return o=N(t.slice(e,n+1)),w(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=N([]),o.leaf=!1,o.height=r;const c=Math.ceil(i/a),s=c*Math.ceil(Math.sqrt(a));j(t,e,n,s,this.compareMinX);for(let i=e;n>=i;i+=s){const e=Math.min(i+s-1,n);j(t,i,e,c,this.compareMinY);for(let n=i;e>=n;n+=c){const i=Math.min(n+c-1,e);o.children.push(this._build(t,n,i,r-1))}}return w(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let c=0;e.children.length>c;c++){const s=e.children[c],u=C(s),l=(i=t,o=s,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);a>l?(a=l,r=r>u?u:r,n=s):l===a&&r>u&&(r=u,n=s)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),L(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=N(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,w(n,this.toBBox),w(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=N([t,e]),this.data.height=t.height+1,this.data.leaf=!1,w(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let a=e;n-e>=a;a++){const e=E(t,0,a,this.toBBox),c=E(t,a,n,this.toBBox),s=k(e,c),u=C(e)+C(c);i>s?(i=s,r=a,o=o>u?u:o):s===i&&o>u&&(o=u,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:S,i=t.leaf?this.compareMinY:P,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=E(t,0,e,i),a=E(t,n-e,n,i);let c=M(o)+M(a);for(let r=e;n-e>r;r++){const e=t.children[r];L(o,t.leaf?i(e):e),c+=M(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];L(a,t.leaf?i(e):e),c+=M(a)}return c}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)L(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():w(t[n],this.toBBox)}}function b(t,e,n){if(!n)return e.indexOf(t);for(let r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function w(t,e){E(t,0,t.children.length,e,t)}function E(t,e,n,r,i){i||(i=N(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;n>o;o++){const e=t.children[o];L(i,t.leaf?r(e):e)}return i}function L(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function S(t,e){return t.minX-e.minX}function P(t,e){return t.minY-e.minY}function C(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function M(t){return t.maxX-t.minX+(t.maxY-t.minY)}function k(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function O(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function T(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function N(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function j(t,e,n,r,i){const o=[e,n];for(;o.length;){if(r>=(n=o.pop())-(e=o.pop()))continue;const a=e+Math.ceil((n-e)/r/2)*r;p(t,a,e,n,i),o.push(e,a,a,n)}}function _(){
3
+ r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function f(){}function v(){}function d(){}var p={};u(p,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(S([])));g&&g!==e&&n.call(g,i)&&(p=g);var m=d.prototype=f.prototype=Object.create(p);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,h=s.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function E(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return v.prototype=d,u(m,"constructor",d),u(d,"constructor",v),v.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(x.prototype),u(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(this.prev>=i.tryLoc){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return r(i.catchLoc,!0);if(i.finallyLoc>this.prev)return r(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(this.prev>=o.tryLoc&&n.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(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),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}var i=e.Syringe.defineToken("PathGeneratorFactory"),a=e.Syringe.defineToken("PathGenerator");function c(t,e){var r=e.r;t.arc(r.value,r.value,r.value,0,2*Math.PI,!1)}function u(t,e){var r=e.rx.value,n=e.ry.value;if(t.ellipse)t.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var o=r>n?r:n,i=r>n?1:r/n,a=r>n?n/r:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI)}}function s(t,e){var r=e.x2,n=e.y2,o=e.defX,i=void 0===o?0:o,a=e.defY,c=void 0===a?0:a;t.moveTo(e.x1.value-i,e.y1.value-c),t.lineTo(r.value-i,n.value-c)}function l(t,e){var r=e.defX,n=void 0===r?0:r,o=e.defY,i=void 0===o?0:o,a=e.path,c=a.zCommandIndexes,u=[].concat(a.curve);c.forEach((function(t,e){u.splice(t+e,1,["Z"])}));for(var s=0;u.length>s;s++){var l=u[s];switch(l[0]){case"M":t.moveTo(l[1]-n,l[2]-i);break;case"C":t.bezierCurveTo(l[1]-n,l[2]-i,l[3]-n,l[4]-i,l[5]-n,l[6]-i);break;case"Z":t.closePath()}}}function h(t,e){var r=e.defX,n=void 0===r?0:r,o=e.defY,i=void 0===o?0:o,a=e.points.points,c=a.length,u=a[c-1][0]-n,s=a[c-1][1]-i;t.moveTo(a[0][0]-n,a[0][1]-i);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-n,h[1]-i)}t.lineTo(u,s)}function f(t,e){var r=e.defX,n=void 0===r?0:r,o=e.defY,i=void 0===o?0:o,a=e.points.points,c=a.length,u=a[c-1][0]-n,s=a[c-1][1]-i;t.moveTo(a[0][0]-n,a[0][1]-i);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-n,h[1]-i)}t.lineTo(u,s)}function v(t,e){var r=e.radius,n=e.width.value,o=e.height.value;if(r&&r.some((function(t){return 0!==t.value}))){var i=r.map((function(t){return t.value})),a=i[0],c=i[1],u=i[2],s=i[3];t.moveTo(a,0),t.lineTo(n-c,0),0!==c&&t.arc(n-c,c,c,-Math.PI/2,0),t.lineTo(n,o-u),0!==u&&t.arc(n-u,o-u,u,0,Math.PI/2),t.lineTo(s,o),0!==s&&t.arc(s,o-s,s,Math.PI/2,Math.PI),t.lineTo(0,a),0!==a&&t.arc(a,a,a,Math.PI,1.5*Math.PI)}else t.rect(0,0,n,o)}var d=e.Module((function(t){t({token:{token:a,named:e.Shape.CIRCLE},useValue:c}),t({token:{token:a,named:e.Shape.ELLIPSE},useValue:u}),t({token:{token:a,named:e.Shape.RECT},useValue:v}),t({token:{token:a,named:e.Shape.LINE},useValue:s}),t({token:{token:a,named:e.Shape.POLYLINE},useValue:f}),t({token:{token:a,named:e.Shape.POLYGON},useValue:h}),t({token:{token:a,named:e.Shape.PATH},useValue:l}),t({token:i,useFactory:function(t){return function(e){return t.container.isBoundNamed(a,e)?t.container.getNamed(a,e):null}}})})),p=function(){function t(){this.name="canvas-path-generator"}var e=t.prototype;return e.init=function(t){t.load(d,!0)},e.destroy=function(t){t.unload(d)},t}();function y(t,e,r,n){var o,i=arguments.length,a=3>i?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(3>i?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function g(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function m(){
4
4
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
5
- _=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new L(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=u(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,o),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function h(){}function f(){}function d(){}var v={};c(v,i,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(S([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=d.prototype=h.prototype=Object.create(v);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,c){var s=u(t[i],t,o);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(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 E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=d,c(g,"constructor",d),c(d,"constructor",f),f.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(x.prototype),c(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(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),l},finish:function(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),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function B(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,i)}function R(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){B(o,r,i,a,c,"next",t)}function c(t){B(o,r,i,a,c,"throw",t)}a(void 0)}))}}function A(){return A=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},A.apply(this,arguments)}function I(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,G(t,e)}function G(t,e){return G=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},G(t,e)}var D="undefined"!=typeof Float32Array?Float32Array:Array;function F(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],c=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,c),t}function Y(){var t=new D(3);return D!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function X(t,e,n){var r=new D(3);return r[0]=t,r[1]=e,r[2]=n,r}function H(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],c=n[1],s=n[2];return t[0]=i*s-o*c,t[1]=o*a-r*s,t[2]=r*c-i*a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var $,W=function(t){return Math.hypot(t[0],t[1],t[2])};$=Y();!function(){var t,e=(t=new D(4),D!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function U(){var t=new D(4);return D!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function q(t,e,n,r){var i,o,a,c,s,u=e[0],l=e[1],h=e[2],f=e[3],d=n[0],v=n[1],p=n[2],y=n[3];return 0>(o=u*d+l*v+h*p+f*y)&&(o=-o,d=-d,v=-v,p=-p,y=-y),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),c=Math.sin((1-r)*i)/a,s=Math.sin(r*i)/a):(c=1-r,s=r),t[0]=c*u+s*d,t[1]=c*l+s*v,t[2]=c*h+s*p,t[3]=c*f+s*y,t}var V,z,Q,J,K,Z,tt,et=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t},nt=(V=Y(),z=X(1,0,0),Q=X(0,1,0),J=U(),K=U(),Z=new D(9),D!=Float32Array&&(Z[1]=0,Z[2]=0,Z[3]=0,Z[5]=0,Z[6]=0,Z[7]=0),Z[0]=1,Z[4]=1,Z[8]=1,tt=Z,function(){this.aabb=void 0});nt.tag="c-canvas-rbush-node";var rt=function(){function t(){this.gradientCache={}}var n=t.prototype;return n.getOrCreateGradient=function(t,n){var r=this.generateCacheKey(t),i=t.type,o=t.x0,a=t.y0,c=t.x1,s=t.y1,u=t.steps,l=t.width,h=t.height;if(this.gradientCache[r])return this.gradientCache[r];var f=null;if(i===e.GradientPatternType.LinearGradient)f=n.createLinearGradient(o*l,a*h,c*l,s*h);else if(i===e.GradientPatternType.RadialGradient){var d=Math.sqrt(l*l+h*h)/2;f=n.createRadialGradient(o*l,a*h,0,c*l,s*h,t.r1*d)}return f&&(u.forEach((function(t){var e,n=t[1];null===(e=f)||void 0===e||e.addColorStop(Number(t[0]),n)})),this.gradientCache[r]=f),this.gradientCache[r]},n.generateCacheKey=function(t){return"gradient-"+t.type+"-"+t.x0+"-"+t.y0+"-"+t.x1+"-"+t.y1+"-"+(t.r1||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return t.join("")})).join("-")},t}();rt=i([n.singleton()],rt);var it=function(){function t(){this.imageCache={},this.patternCache={},this.canvasConfig=void 0}var n=t.prototype;return n.getImageSync=function(t){return this.imageCache[t]},n.getOrCreateImage=function(t){var n=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var r=this.canvasConfig.createImage;return new Promise((function(i,o){var a;r?a=r(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){i(a)},a.onerror=function(t){o(t)},a.crossOrigin="Anonymous",a.src=t,n.imageCache[t]=a)}))},n.getPatternSync=function(t){var e=this.generatePatternKey(t);if(this.patternCache[e])return this.patternCache[e]},n.createPattern=function(t,e){var n=this;return this.getOrCreateImage(t.src).then((function(r){var i=n.generatePatternKey(t),o=e.createPattern(r,t.repetition);return o&&(n.patternCache[i]=o),n.patternCache[i]}))},n.generatePatternKey=function(t){return"pattern-"+t.src+"-"+t.repetition},t}();function ot(t,e){var n=e.r;t.arc(n.value,n.value,n.value,0,2*Math.PI,!1)}function at(t,e){var n=e.rx.value,r=e.ry.value;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(o,a),t.arc(0,0,i,0,2*Math.PI)}}function ct(t,e){var n=e.radius,r=e.width.value,i=e.height.value;if(n&&n.some((function(t){return 0!==t.value}))){var o=n.map((function(t){return t.value})),a=o[0],c=o[1],s=o[2],u=o[3];t.moveTo(a,0),t.lineTo(r-c,0),0!==c&&t.arc(r-c,c,c,-Math.PI/2,0),t.lineTo(r,i-s),0!==s&&t.arc(r-s,i-s,s,0,Math.PI/2),t.lineTo(u,i),0!==u&&t.arc(u,i-u,u,Math.PI/2,Math.PI),t.lineTo(0,a),0!==a&&t.arc(a,a,a,Math.PI,1.5*Math.PI)}else t.rect(0,0,r,i)}function st(t,e){var n=e.x2,r=e.y2,i=e.defX,o=void 0===i?0:i,a=e.defY,c=void 0===a?0:a;t.moveTo(e.x1.value-o,e.y1.value-c),t.lineTo(n.value-o,r.value-c)}function ut(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.points.points,c=a.length,s=a[c-1][0]-r,u=a[c-1][1]-o;t.moveTo(a[0][0]-r,a[0][1]-o);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-r,h[1]-o)}t.lineTo(s,u)}function lt(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.points.points,c=a.length,s=a[c-1][0]-r,u=a[c-1][1]-o;t.moveTo(a[0][0]-r,a[0][1]-o);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-r,h[1]-o)}t.lineTo(s,u)}function ht(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.path,c=a.zCommandIndexes,s=[].concat(a.curve);c.forEach((function(t,e){s.splice(t+e,1,["Z"])}));for(var u=0;s.length>u;u++){var l=s[u];switch(l[0]){case"M":t.moveTo(l[1]-r,l[2]-o);break;case"C":t.bezierCurveTo(l[1]-r,l[2]-o,l[3]-r,l[4]-o,l[5]-r,l[6]-o);break;case"Z":t.closePath()}}}i([n.inject(e.CanvasConfig),o("design:type",Object)],it.prototype,"canvasConfig",void 0),it=i([n.singleton()],it);var ft=n.Syringe.defineToken("PathGeneratorFactory"),dt=n.Syringe.defineToken("PathGenerator"),vt=n.Syringe.defineToken("StyleRendererFactory"),pt=n.Syringe.defineToken("CircleRenderer",{multiple:!1}),yt=n.Syringe.defineToken("EllipseRenderer",{multiple:!1}),gt=n.Syringe.defineToken("RectRenderer",{multiple:!1}),mt=n.Syringe.defineToken("LineRenderer",{multiple:!1}),xt=n.Syringe.defineToken("PolylineRenderer",{multiple:!1}),bt=n.Syringe.defineToken("PolygonRenderer",{multiple:!1}),wt=n.Syringe.defineToken("PathRenderer",{multiple:!1}),Et=n.Syringe.defineToken("TextRenderer",{multiple:!1}),Lt=n.Syringe.defineToken("ImageRenderer",{multiple:!1}),St=function(){function t(){this.imagePool=void 0}var n=t.prototype;return n.hash=function(t){return""},n.render=function(t,n){var r,i=n.img,o=n.width.value,a=n.height.value;if(e.isString(i)?r=this.imagePool.getImageSync(i):(o||(o=i.width),a||(a=i.height),r=i),r)try{t.drawImage(r,0,0,o,a)}catch(t){}},t}();i([n.inject(it),o("design:type",it)],St.prototype,"imagePool",void 0),St=i([n.singleton({token:Lt})],St);var Pt=function(){function t(){}var n=t.prototype;return n.hash=function(t){return""},n.render=function(t,n,r){var i=n.lineWidth,o=n.textAlign,a=n.textBaseline,c=n.lineJoin,s=n.miterLimit,u=void 0===s?0:s,l=n.letterSpacing,h=void 0===l?0:l,f=n.stroke,d=n.fill,v=n.fillOpacity,p=n.strokeOpacity,y=n.opacity,g=n.metrics,m=n.dx,x=n.dy,b=g.lines,w=g.height,E=g.lineHeight,L=g.lineMetrics;t.font=g.font,t.lineWidth=i.value,t.textAlign=o.value,t.textBaseline=a.value,t.lineJoin=c.value,t.miterLimit=u;var S=0;"middle"===a.value?S=-w/2-E/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?S=-w:"top"!==a.value&&"hanging"!==a.value||(S=-E);var P=0;m&&m.unit===e.UnitType.kPixels&&(P+=m.value),x&&x.unit===e.UnitType.kPixels&&(S+=x.value);for(var C=0;b.length>C;C++){var M=i.value/2+P;S+=E,!e.isNil(f)&&!f.isNone&&i&&i.value&&this.drawLetterSpacing(t,b[C],L[C],o.value,M,S,h,v.value,p.value,y.value,!0),e.isNil(d)||this.drawLetterSpacing(t,b[C],L[C],o.value,M,S,h,v.value,p.value,y.value)}},n.drawLetterSpacing=function(t,e,n,r,i,o,a,c,s,u,l){if(void 0===l&&(l=!1),0!==a){var h=t.textAlign;t.textAlign="left";var f=i;"center"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width);for(var d=Array.from(e),v=t.measureText(e).width,p=0,y=0;d.length>y;++y){var g=d[y];l?this.strokeText(t,g,f,o,s):this.fillText(t,g,f,o,c,u),f+=v-(p=t.measureText(e.substring(y+1)).width)+a,v=p}t.textAlign=h}else l?this.strokeText(t,e,i,o,s):this.fillText(t,e,i,o,c,u)},n.fillText=function(t,n,r,i,o,a){var c,s=!e.isNil(o)&&1!==o;s&&(c=t.globalAlpha,t.globalAlpha=o*a),t.fillText(n,r,i),s&&(t.globalAlpha=c)},n.strokeText=function(t,n,r,i,o){var a,c=!e.isNil(o)&&1!==o;c&&(a=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,r,i),c&&(t.globalAlpha=a)},t}();Pt=i([n.singleton({token:Et})],Pt);var Ct=function(){function t(){}var n=t.prototype;return n.hash=function(t){return""},n.render=function(t,n){var r=n.fill,i=n.opacity,o=n.fillOpacity,a=n.stroke,c=n.strokeOpacity,s=n.lineWidth,u=n.lineCap,l=n.lineJoin,h=n.shadowColor,f=n.filter,d=n.miterLimit,v=!e.isNil(r)&&!r.isNone,p=!e.isNil(a)&&!a.isNone,y=0===r.alpha;if(v&&(e.isNil(o)||1===o.value?t.fill():(t.globalAlpha=o.value,t.fill(),t.globalAlpha=i.value)),p&&s&&s.value>0){var g,m,x;!e.isNil(c)&&1!==c.value&&(t.globalAlpha=c.value),t.lineWidth=s.value,e.isNil(d)||(t.miterLimit=d),e.isNil(u)||(t.lineCap=u.value),e.isNil(l)||(t.lineJoin=l.value);var b=!e.isNil(h),w=!e.isNil(f);b&&(m=t.shadowColor,e.isNil(g=t.shadowBlur)||(t.shadowColor="transparent",t.shadowBlur=0)),w&&!e.isNil(x=t.filter)&&x.indexOf("drop-shadow")>-1&&(t.filter=x.replace(/drop-shadow\([^)]*\)/,"").trim()||"none");var E=v&&!y;E&&t.stroke(),b&&(t.shadowColor=m,t.shadowBlur=g),w&&(t.filter=x),E||t.stroke()}},t}(),Mt=function(t){function e(){return t.apply(this,arguments)||this}return I(e,t),e}(Ct=i([n.singleton()],Ct));Mt=i([n.singleton({token:gt})],Mt);var kt=function(t){function e(){return t.apply(this,arguments)||this}return I(e,t),e}(Ct);kt=i([n.singleton({token:pt})],kt);var Ot=function(t){function e(){return t.apply(this,arguments)||this}return I(e,t),e}(Ct);Ot=i([n.singleton({token:yt})],Ot);var Tt=function(t){function e(){return t.apply(this,arguments)||this}return I(e,t),e}(Ct);Tt=i([n.singleton({token:mt})],Tt);var Nt=function(t){function e(){return t.apply(this,arguments)||this}return I(e,t),e}(Ct);Nt=i([n.singleton({token:xt})],Nt);var jt=function(t){function e(){return t.apply(this,arguments)||this}return I(e,t),e}(Ct);jt=i([n.singleton({token:bt})],jt);var _t,Bt,Rt=function(t){function e(){return t.apply(this,arguments)||this}return I(e,t),e}(Ct);Rt=i([n.singleton({token:wt})],Rt);var At,It,Gt="RBushRoot",Dt=(_t=function(){function t(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.imagePool=void 0,this.gradientPool=void 0,this.pathGeneratorFactory=void 0,this.styleRendererFactory=void 0,this.displayObjectPool=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.enableBatch=!1,this.batchedStyleHash="",this.batchedDisplayObject=null,this.toSync=new Set}var n=t.prototype;return n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],c=o[1],s=i.getMax();r.aabb={id:n.entity,minX:a,minY:c,maxX:s[0],maxY:s[1]}}r.aabb&&e.push(r.aabb)})),this.rBush.load(e),this.toSync.clear()},n.pushToSync=function(t){var e=this;t.forEach((function(t){e.toSync.add(t)}))},n.apply=function(t){var n=this,r=function(t){t.target.rBushNode=new nt,n.pushToSync(t.composedPath().slice(0,-2))},i=function(t){var e=t.target,r=e.rBushNode;r.aabb&&(n.rBush.remove(r.aabb),n.toSync.delete(e),n.removedRBushNodeAABBs.push(r.aabb))},o=function(t){var e,r=t.target;(null===(e=r.ownerDocument)||void 0===e?void 0:e.documentElement)===n.renderingContext.root&&(t.detail.affectChildren&&r.forEach((function(t){n.pushToSync([t])})),n.pushToSync(t.composedPath().slice(0,-2)))};t.hooks.init.tapPromise(Bt.tag,R(_().mark((function t(){var a,c,s,u;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,i),n.renderingContext.root.addEventListener(e.ElementEvent.BOUNDS_CHANGED,o),c=(a=n.canvasConfig).width,s=a.height,u=n.contextService.getContext(),n.clearRect(u,0,0,c,s);case 6:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(Bt.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,i),n.renderingContext.root.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,o)})),t.hooks.beginFrame.tap(Bt.tag,(function(){var t=n.contextService.getContext(),r=n.canvasConfig,i=r.width,o=r.height,a=r.renderer.getConfig();n.clearFullScreen=!a.enableDirtyRectangleRendering||n.renderingContext.renderReasons.has(e.RenderReason.CAMERA_CHANGED),t&&(t.save(),n.clearFullScreen&&n.clearRect(t,0,0,i,o),n.applyTransform(t,n.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(Bt.tag,(function(){n.syncRTree();var r=n.canvasConfig.renderer.getConfig(),i=r.enableDirtyRectangleRendering,o=r.enableDirtyRectangleRenderingDebug,a=n.contextService.getContext(),c=n.renderQueue;if(i){if(!n.clearFullScreen){var s=n.safeMergeAABB.apply(n,[n.mergeDirtyAABBs(n.renderQueue)].concat(n.removedRBushNodeAABBs.map((function(t){var n=t.minX,r=t.minY,i=t.maxX,o=t.maxY,a=new e.AABB;return a.setMinMax(X(n,r,0),X(i,o,0)),a}))));if(n.removedRBushNodeAABBs=[],e.AABB.isEmpty(s))return void(n.renderQueue=[]);var u=n.convertAABB2Rect(s),l=u.x,h=u.y,f=u.width,d=u.height;n.clearRect(a,l,h,f,d),a.beginPath(),a.rect(l,h,f,d),a.clip(),o&&(a.lineWidth=4,a.strokeStyle="rgba("+255*Math.random()+", "+255*Math.random()+", "+255*Math.random()+", 1)",a.strokeRect(l,h,f,d)),c=n.searchDirtyObjects(s)}c.sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&n.renderDisplayObject(e,t)})),n.enableBatch&&n.batchedStyleHash&&n.flush(a,t),n.renderQueue.forEach((function(t){n.saveDirtyAABB(t)})),n.renderQueue=[]}n.restoreStack.forEach((function(t){a.restore()})),n.restoreStack=[],n.clearFullScreen=!1,a.restore()})),t.hooks.render.tap(Bt.tag,(function(e){n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?n.renderQueue.push(e):e.isVisible()&&!e.isCulled()&&n.renderDisplayObject(e,t)}))},n.clearRect=function(t,e,n,r,i){t.clearRect(e,n,r,i);var o=this.canvasConfig.background;o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},n.flush=function(t,e){if(this.batchedDisplayObject){var n=this.styleRendererFactory(this.batchedDisplayObject.nodeName);n&&(this.applyAttributesToContext(t,this.batchedDisplayObject,e),t.closePath(),n.render(t,this.batchedDisplayObject.parsedStyle,this.batchedDisplayObject),t.restore()),this.batchedStyleHash="",this.batchedDisplayObject=null}},n.renderDisplayObject=function(t,n){for(var r=this,i=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)i.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var a=this.styleRendererFactory(t.nodeName),c=!1;if(this.enableBatch&&a){var s=a.hash(t.attributes);this.batchedStyleHash&&s!==this.batchedStyleHash&&this.flush(i,n),this.batchedStyleHash||(this.batchedStyleHash=s,this.batchedDisplayObject=t,c=!0)}i.save(),this.applyTransform(i,t.getLocalTransform());var u=t.style.clipPath;if(u){i.save(),this.applyTransform(i,u.getLocalTransform());var l=this.pathGeneratorFactory(u.nodeName);l&&this.useAnchor(i,u,(function(){i.beginPath(),l(i,u.parsedStyle),i.closePath()})),i.restore(),i.clip()}this.enableBatch||(i.save(),this.applyAttributesToContext(i,t,n)),this.useAnchor(i,t,(function(){var n=r.pathGeneratorFactory(t.nodeName);n&&(!c&&r.enableBatch||i.beginPath(),n(i,t.parsedStyle),r.enableBatch||t.nodeName===e.Shape.LINE||t.nodeName===e.Shape.PATH||t.nodeName===e.Shape.POLYLINE||i.closePath()),a&&!r.enableBatch&&a.render(i,t.parsedStyle,t)})),this.enableBatch||i.restore(),t.renderable.dirty=!1,this.restoreStack.push(t)},n.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},n.mergeDirtyAABBs=function(t){var n=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();n.add(e);var r=t.renderable.dirtyRenderBounds;r&&n.add(r)})),n},n.searchDirtyObjects=function(t){var e=this,n=t.getMin(),r=n[0],i=n[1],o=t.getMax();return this.rBush.search({minX:r,minY:i,maxX:o[0],maxY:o[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},n.saveDirtyAABB=function(t){var n=t.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new e.AABB);var r=t.getRenderBounds();r&&n.dirtyRenderBounds.update(r.center,r.halfExtents)},n.applyTransform=function(t,n){var r=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}(Y(),n),i=r[0],o=r[1],a=F(Y(),n),c=a[0],s=a[1],u=function(t,e){var n=new D(3);F(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,c=e[1]*i,s=e[2]*o,u=e[4]*r,l=e[5]*i,h=e[6]*o,f=e[8]*r,d=e[9]*i,v=e[10]*o,p=a+l+v,y=0;return p>0?(y=2*Math.sqrt(p+1),t[3]=.25*y,t[0]=(h-d)/y,t[1]=(f-s)/y,t[2]=(c-u)/y):a>l&&a>v?(y=2*Math.sqrt(1+a-l-v),t[3]=(h-d)/y,t[0]=.25*y,t[1]=(c+u)/y,t[2]=(f+s)/y):l>v?(y=2*Math.sqrt(1+l-a-v),t[3]=(f-s)/y,t[0]=(c+u)/y,t[1]=.25*y,t[2]=(h+d)/y):(y=2*Math.sqrt(1+v-a-l),t[3]=(c-u)/y,t[0]=(f+s)/y,t[1]=(h+d)/y,t[2]=.25*y),t}(U(),n),l=e.getEuler(Y(),u),h=e.fromRotationTranslationScale(l[0]||l[2],i,o,c,s);t.transform(h[0],h[1],h[3],h[4],h[6],h[7])},n.getColor=function(t,n,r,i){var o;if(t instanceof e.CSSGradientValue){if(t.type===e.GradientPatternType.LinearGradient||t.type===e.GradientPatternType.RadialGradient){var a=n.getGeometryBounds();o=this.gradientPool.getOrCreateGradient(A({type:t.type},t.value,{width:a&&2*a.halfExtents[0]||0,height:a&&2*a.halfExtents[1]||0}),r)}else if(t.type===e.GradientPatternType.Pattern){var c=this.imagePool.getPatternSync(t.value);c?o=c:this.imagePool.createPattern(t.value,r).then((function(){n.renderable.dirty=!0,i.dirtify()}))}}else o=t.toString();return o},n.applyAttributesToContext=function(t,n,r){var i=n.parsedStyle,o=i.stroke,a=i.fill,c=i.opacity,s=i.lineDash,u=i.lineDashOffset,l=i.filter,h=i.shadowColor,f=i.shadowBlur,d=i.shadowOffsetX,v=i.shadowOffsetY;s&&Array.isArray(s)&&t.setLineDash(s.map((function(t){return t.value}))),e.isNil(u)||(t.lineDashOffset=u.value),e.isNil(c)||(t.globalAlpha*=c.value),e.isNil(o)||o.isNone||(t.strokeStyle=this.getColor(o,n,t,r)),e.isNil(a)||a.isNone||(t.fillStyle=this.getColor(a,n,t,r)),e.isNil(l)||(t.filter=n.style.filter),e.isNil(h)||(t.shadowColor=h.toString(),t.shadowBlur=f&&f.value||0,t.shadowOffsetX=d&&d.value||0,t.shadowOffsetY=v&&v.value||0)},n.useAnchor=function(t,e,n){var r=e.getGeometryBounds();if(r){var i=r.halfExtents,o=(e.parsedStyle||{}).anchor;t.translate(-(o&&o[0].value||0)*i[0]*2,-(o&&o[1].value||0)*i[1]*2),n()}else n()},n.safeMergeAABB=function(){for(var t=new e.AABB,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(e){t.add(e)})),t},t}(),_t.tag="CanvasRenderer",Bt=_t);i([n.inject(e.CanvasConfig),o("design:type",Object)],Dt.prototype,"canvasConfig",void 0),i([n.inject(e.DefaultCamera),o("design:type",e.Camera)],Dt.prototype,"camera",void 0),i([n.inject(e.ContextService),o("design:type",Object)],Dt.prototype,"contextService",void 0),i([n.inject(e.RenderingContext),o("design:type",Object)],Dt.prototype,"renderingContext",void 0),i([n.inject(it),o("design:type",it)],Dt.prototype,"imagePool",void 0),i([n.inject(rt),o("design:type",rt)],Dt.prototype,"gradientPool",void 0),i([n.inject(ft),o("design:type",Function)],Dt.prototype,"pathGeneratorFactory",void 0),i([n.inject(vt),o("design:type",Function)],Dt.prototype,"styleRendererFactory",void 0),i([n.inject(e.DisplayObjectPool),o("design:type",e.DisplayObjectPool)],Dt.prototype,"displayObjectPool",void 0),i([n.inject(Gt),o("design:type",x)],Dt.prototype,"rBush",void 0),Dt=Bt=i([n.singleton({contrib:e.RenderingPluginContribution})],Dt);var Ft=(At=function(){function t(){this.imagePool=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var n=this,r=function(r){var i=r.target;if(i.nodeName===e.Shape.IMAGE){var o=i.attributes.img;e.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,t.dirtify()}))}},i=function(r){var i=r.target,o=r.newValue;i.nodeName===e.Shape.IMAGE&&"img"===r.attrName&&e.isString(o)&&n.imagePool.getOrCreateImage(o).then((function(){i.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(It.tag,R(_().mark((function t(){return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,i);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(It.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,i)}))},t}(),At.tag="LoadImage",It=At);i([n.inject(it),o("design:type",it)],Ft.prototype,"imagePool",void 0),i([n.inject(e.RenderingContext),o("design:type",Object)],Ft.prototype,"renderingContext",void 0),Ft=It=i([n.singleton({contrib:e.RenderingPluginContribution})],Ft);var Yt=n.Module((function(t){var n;t(it),t({token:Gt,useValue:new x}),t(kt),t(Ot),t(Mt),t(St),t(Pt),t(Tt),t(Nt),t(jt),t(Rt);var r=((n={})[e.Shape.CIRCLE]=pt,n[e.Shape.ELLIPSE]=yt,n[e.Shape.RECT]=gt,n[e.Shape.IMAGE]=Lt,n[e.Shape.TEXT]=Et,n[e.Shape.LINE]=mt,n[e.Shape.POLYLINE]=xt,n[e.Shape.POLYGON]=bt,n[e.Shape.PATH]=wt,n);t({token:vt,useFactory:function(t){var e={};return function(n){var i=r[n];return i&&!e[n]&&t.container.isBound(i)&&(e[n]=t.container.get(i)),e[n]}}}),t(rt),t(Dt),t(Ft)})),Xt=function(){function t(){this.name="canvas-renderer"}var r=t.prototype;return r.init=function(t){n.GlobalContainer.isBound(ft)||(n.GlobalContainer.register({token:{token:dt,named:e.Shape.CIRCLE},useValue:ot}),n.GlobalContainer.register({token:{token:dt,named:e.Shape.ELLIPSE},useValue:at}),n.GlobalContainer.register({token:{token:dt,named:e.Shape.RECT},useValue:ct}),n.GlobalContainer.register({token:{token:dt,named:e.Shape.LINE},useValue:st}),n.GlobalContainer.register({token:{token:dt,named:e.Shape.POLYLINE},useValue:ut}),n.GlobalContainer.register({token:{token:dt,named:e.Shape.POLYGON},useValue:lt}),n.GlobalContainer.register({token:{token:dt,named:e.Shape.PATH},useValue:ht}),n.GlobalContainer.register({token:ft,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(dt,n)&&(e[n]=t.container.getNamed(dt,n)),e[n]}}})),t.load(Yt,!0)},r.destroy=function(t){t.unload(Yt)},t}(),Ht=Object.freeze({__proto__:null,get CircleRenderer(){return kt},CircleRendererContribution:pt,get EllipseRenderer(){return Ot},EllipseRendererContribution:yt,get ImageRenderer(){return St},ImageRendererContribution:Lt,get LineRenderer(){return Tt},LineRendererContribution:mt,PathGenerator:dt,PathGeneratorFactory:ft,get PathRenderer(){return Rt},PathRendererContribution:wt,Plugin:Xt,get PolygonRenderer(){return jt},PolygonRendererContribution:bt,get PolylineRenderer(){return Nt},PolylineRendererContribution:xt,RBushNode:nt,RBushRoot:Gt,get RectRenderer(){return Mt},RectRendererContribution:gt,StyleRendererFactory:vt,get TextRenderer(){return Pt},TextRendererContribution:Et,RBush:x});function $t(){
5
+ m=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(S([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function E(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(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 L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},w(x.prototype),c(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(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),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function w(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var x="undefined"!=typeof Float32Array?Float32Array:Array;function E(){var t=new x(9);return x!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function b(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],c=e[4],u=e[5],s=e[6],l=e[7],h=e[8],f=r[0],v=r[1],d=r[2],p=r[3],y=r[4],g=r[5],m=r[6],w=r[7],x=r[8];return t[0]=f*n+v*a+d*s,t[1]=f*o+v*c+d*l,t[2]=f*i+v*u+d*h,t[3]=p*n+y*a+g*s,t[4]=p*o+y*c+g*l,t[5]=p*i+y*u+g*h,t[6]=m*n+w*a+x*s,t[7]=m*o+w*c+x*l,t[8]=m*i+w*u+x*h,t}function L(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function P(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function S(){var t=new x(16);return x!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function k(){var t=new x(3);return x!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function C(t,e,r){var n=new x(3);return n[0]=t,n[1]=e,n[2]=r,n}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var O;O=k();function N(t,e){var r=new x(2);return r[0]=t,r[1]=e,r}function T(t,e,r){var n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}!function(){var t,e=(t=new x(2),x!=Float32Array&&(t[0]=0,t[1]=0),t)}();var j,M,A=e.Syringe.defineToken("PointInPathPicker"),_=(j=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.pointInPathPickerFactory=void 0,this.isHit=function(r,n,o){var i,a,c,u,s,l,h,f,v,d,p,y,g,m,w,x,E,b,L,P,O,N,T,j,M,A,_,F,G,I,R,B=t.pointInPathPickerFactory(r.nodeName);if(B){var D=(i=S(),(R=(L=(c=(a=o)[0])*(f=a[5])-(u=a[1])*(h=a[4]))*(I=(g=a[10])*(b=a[15])-(m=a[11])*(E=a[14]))-(P=c*(v=a[6])-(s=a[2])*h)*(G=(y=a[9])*b-m*(x=a[13]))+(O=c*(d=a[7])-(l=a[3])*h)*(F=y*E-g*x)+(N=u*v-s*f)*(_=(p=a[8])*b-m*(w=a[12]))-(T=u*d-l*f)*(A=p*E-g*w)+(j=s*d-l*v)*(M=p*x-y*w))?(i[0]=(f*I-v*G+d*F)*(R=1/R),i[1]=(s*G-u*I-l*F)*R,i[2]=(x*j-E*T+b*N)*R,i[3]=(g*T-y*j-m*N)*R,i[4]=(v*_-h*I-d*A)*R,i[5]=(c*I-s*_+l*A)*R,i[6]=(E*O-w*j-b*P)*R,i[7]=(p*j-g*O+m*P)*R,i[8]=(h*G-f*_+d*M)*R,i[9]=(u*_-c*G-l*M)*R,i[10]=(w*T-x*O+b*L)*R,i[11]=(y*O-p*T-m*L)*R,i[12]=(f*A-h*F-v*M)*R,i[13]=(c*F-u*A+s*M)*R,i[14]=(x*P-w*N-E*L)*R,i[15]=(p*N-y*P+g*L)*R,i):null),Y=function(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}(k(),C(n[0],n[1],0),D),$=r.getGeometryBounds().halfExtents,W=r.parsedStyle.anchor;if(Y[0]+=(W&&W[0].value||0)*$[0]*2,Y[1]+=(W&&W[1].value||0)*$[1]*2,B(r,new e.Point(Y[0],Y[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,r){var n=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas);void 0===t.pathGeneratorFactoryCache[e.nodeName]&&(t.pathGeneratorFactoryCache[e.nodeName]=t.pathGeneratorFactory(e.nodeName));var o=t.pathGeneratorFactoryCache[e.nodeName];return o&&o(n,e.parsedStyle),n.isPointInPath(r.x,r.y)}}return t.prototype.apply=function(t){var e=this;t.hooks.pick.tapPromise(M.tag,function(){var t,r=(t=m().mark((function t(r){var n,o,i,a,c,u,s,l,h,f,v,d,p;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.topmost,i=C((o=r.position).x,o.y,0),a=e.rBush.search({minX:i[0],minY:i[1],maxX:i[0],maxY:i[1]}),c=a.map((function(t){return t.id})),u=[],a.forEach((function(t){var r=e.displayObjectPool.getByEntity(t.id);if(r.isVisible()&&!r.isCulled()&&r.isInteractive()){if(r.parentNode&&-1===c.indexOf(r.parentNode.entity))return;u.push(r)}})),u.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),s=[],l=0,h=u;case 9:if(l>=h.length){t.next=25;break}if(d=(v=(f=h[l]).parsedStyle.clipPath)||f,p=f.getWorldTransform(),v&&(y=S(),g=p,m=v.getLocalTransform(),w=void 0,x=void 0,E=void 0,b=void 0,L=void 0,P=void 0,k=void 0,O=void 0,N=void 0,T=void 0,j=void 0,M=void 0,A=void 0,_=void 0,F=void 0,G=void 0,I=void 0,R=void 0,B=void 0,D=void 0,x=g[1],E=g[2],b=g[3],P=g[5],k=g[6],O=g[7],T=g[9],j=g[10],M=g[11],_=g[13],F=g[14],G=g[15],y[0]=(I=m[0])*(w=g[0])+(R=m[1])*(L=g[4])+(B=m[2])*(N=g[8])+(D=m[3])*(A=g[12]),y[1]=I*x+R*P+B*T+D*_,y[2]=I*E+R*k+B*j+D*F,y[3]=I*b+R*O+B*M+D*G,y[4]=(I=m[4])*w+(R=m[5])*L+(B=m[6])*N+(D=m[7])*A,y[5]=I*x+R*P+B*T+D*_,y[6]=I*E+R*k+B*j+D*F,y[7]=I*b+R*O+B*M+D*G,y[8]=(I=m[8])*w+(R=m[9])*L+(B=m[10])*N+(D=m[11])*A,y[9]=I*x+R*P+B*T+D*_,y[10]=I*E+R*k+B*j+D*F,y[11]=I*b+R*O+B*M+D*G,y[12]=(I=m[12])*w+(R=m[13])*L+(B=m[14])*N+(D=m[15])*A,y[13]=I*x+R*P+B*T+D*_,y[14]=I*E+R*k+B*j+D*F,y[15]=I*b+R*O+B*M+D*G,p=y),!e.isHit(d,i,p)){t.next=22;break}if(!n){t.next=21;break}return r.picked=[f],t.abrupt("return",r);case 21:s.push(f);case 22:l++,t.next=9;break;case 25:return r.picked=s,t.abrupt("return",r);case 27:case"end":return t.stop()}var y,g,m,w,x,E,b,L,P,k,O,N,T,j,M,A,_,F,G,I,R,B,D}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){w(i,n,o,a,c,"next",t)}function c(t){w(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}())},t}(),j.tag="CanvasPicker",M=j);function F(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function G(t,e){return.001>Math.abs(t-e)}function I(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}function R(t){return(t+2*Math.PI)%(2*Math.PI)}y([e.inject(e.DisplayObjectPool),g("design:type",e.DisplayObjectPool)],_.prototype,"displayObjectPool",void 0),y([e.inject(e.CanvasConfig),g("design:type",Object)],_.prototype,"canvasConfig",void 0),y([e.inject(e.OffscreenCanvasCreator),g("design:type",e.OffscreenCanvasCreator)],_.prototype,"offscreenCanvas",void 0),y([e.inject(e.RBushRoot),g("design:type",e.RBush)],_.prototype,"rBush",void 0),y([e.inject(i),g("design:type",Function)],_.prototype,"pathGeneratorFactory",void 0),y([e.inject(A),g("design:type",Function)],_.prototype,"pointInPathPickerFactory",void 0),_=M=y([e.singleton({contrib:e.RenderingPluginContribution})],_);var B=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},D=function(t,e,r,n,o,i){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([o-t,i-e],c))};function Y(t,e,r,n,o,i){var a=-1,c=1/0,u=[r,n],s=20;i&&i>200&&(s=i/10);for(var l=1/s,h=l/10,f=0;s>=f;f++){var v=f*l,d=[o.apply(void 0,t.concat([v])),o.apply(void 0,e.concat([v]))],p=F(u[0],u[1],d[0],d[1]);c>p&&(a=v,c=p)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&1e-4<=h;g++){var m=a-h,w=a+h,x=[o.apply(void 0,t.concat([m])),o.apply(void 0,e.concat([m]))],E=F(u[0],u[1],x[0],x[1]);if(m>=0&&c>E)a=m,c=E;else{var b=[o.apply(void 0,t.concat([w])),o.apply(void 0,e.concat([w]))],L=F(u[0],u[1],b[0],b[1]);1>=w&&c>L?(a=w,c=L):h*=.5}}return{x:o.apply(void 0,t.concat([a])),y:o.apply(void 0,e.concat([a]))}}function $(t,e,r,n){var o=1-n;return o*o*t+2*n*o*e+n*n*r}function W(t,e,r){var n=t+r-2*e;if(G(n,0))return[.5];var o=(t-e)/n;return o>1||0>o?[]:[o]}function H(t,e,r,n){return 2*(1-n)*(e-t)+2*n*(r-e)}function U(t,e,r,n,o,i,a){var c=$(t,r,o,a),u=$(e,n,i,a),s=B(t,e,r,n,a),l=B(r,n,o,i,a);return[[t,e,s.x,s.y,c,u],[c,u,l.x,l.y,o,i]]}function X(t,e,r,n,o,i,a){if(0===a)return(F(t,e,r,n)+F(r,n,o,i)+F(t,e,o,i))/2;var c=U(t,e,r,n,o,i,.5),u=c[0],s=c[1];return u.push(a-1),s.push(a-1),X.apply(void 0,u)+X.apply(void 0,s)}var q={box:function(t,e,r,n,o,i){var a=W(t,r,o)[0],c=W(e,n,i)[0],u=[t,o],s=[e,i];return void 0!==a&&u.push($(t,r,o,a)),void 0!==c&&s.push($(e,n,i,c)),I(u,s)},length:function(t,e,r,n,o,i){return X(t,e,r,n,o,i,3)},nearestPoint:function(t,e,r,n,o,i,a,c){return Y([t,r,o],[e,n,i],a,c,$)},pointDistance:function(t,e,r,n,o,i,a,c){var u=this.nearestPoint(t,e,r,n,o,i,a,c);return F(u.x,u.y,a,c)},interpolationAt:$,pointAt:function(t,e,r,n,o,i,a){return{x:$(t,r,o,a),y:$(e,n,i,a)}},divide:function(t,e,r,n,o,i,a){return U(t,e,r,n,o,i,a)},tangentAngle:function(t,e,r,n,o,i,a){var c=H(t,r,o,a),u=H(e,n,i,a);return R(Math.atan2(u,c))}};function V(t,e,r,n,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*r*o*o*i+n*o*o*o}function z(t,e,r,n,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(r-e)+o*o*(n-r))}function Q(t,e,r,n){var o,i,a,c=-3*t+9*e-9*r+3*n,u=6*t-12*e+6*r,s=3*e-3*t,l=[];if(G(c,0))G(u,0)||0>(o=-s/u)||o>1||l.push(o);else{var h=u*u-4*c*s;G(h,0)?l.push(-u/(2*c)):h>0&&(i=(-u-(a=Math.sqrt(h)))/(2*c),0>(o=(-u+a)/(2*c))||o>1||l.push(o),0>i||i>1||l.push(i))}return l}function K(t,e,r,n,o,i,a,c,u){var s=V(t,r,o,a,u),l=V(e,n,i,c,u),h=B(t,e,r,n,u),f=B(r,n,o,i,u),v=B(o,i,a,c,u),d=B(h.x,h.y,f.x,f.y,u),p=B(f.x,f.y,v.x,v.y,u);return[[t,e,h.x,h.y,d.x,d.y,s,l],[s,l,p.x,p.y,v.x,v.y,a,c]]}function J(t,e,r,n,o,i,a,c,u){if(0===u)return function(t,e){for(var r=0,n=t.length,o=0;n>o;o++)r+=F(t[o],e[o],t[(o+1)%n],e[(o+1)%n]);return r/2}([t,r,o,a],[e,n,i,c]);var s=K(t,e,r,n,o,i,a,c,.5),l=[].concat(s[0],[u-1]),h=[].concat(s[1],[u-1]);return J.apply(void 0,l)+J.apply(void 0,h)}var Z={extrema:Q,box:function(t,e,r,n,o,i,a,c){for(var u=[t,a],s=[e,c],l=Q(t,r,o,a),h=Q(e,n,i,c),f=0;l.length>f;f++)u.push(V(t,r,o,a,l[f]));for(var v=0;h.length>v;v++)s.push(V(e,n,i,c,h[v]));return I(u,s)},length:function(t,e,r,n,o,i,a,c){return J(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,u,s,l){return Y([t,r,o,a],[e,n,i,c],u,s,V,l)},pointDistance:function(t,e,r,n,o,i,a,c,u,s,l){var h=this.nearestPoint(t,e,r,n,o,i,a,c,u,s,l);return F(h.x,h.y,u,s)},interpolationAt:V,pointAt:function(t,e,r,n,o,i,a,c,u){return{x:V(t,r,o,a,u),y:V(e,n,i,c,u)}},divide:function(t,e,r,n,o,i,a,c,u){return K(t,e,r,n,o,i,a,c,u)},tangentAngle:function(t,e,r,n,o,i,a,c,u){var s=z(t,r,o,a,u),l=z(e,n,i,c,u);return R(Math.atan2(l,s))}};function tt(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function et(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function rt(t,e,r,n,o,i,a,c){var u=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(n>u||u>o)return!1;var s={x:t+r*Math.cos(u),y:e+r*Math.sin(u)};return tt(s.x,s.y,a,c)<=i/2}function nt(t,e,r,n,o,i,a){var c=Math.min(t,r),u=Math.max(t,r),s=Math.min(e,n),l=Math.max(e,n),h=o/2;return!(c-h>i||i>u+h||s-h>a||a>l+h)&&D(t,e,r,n,i,a)<=o/2}function ot(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(nt(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(o){var c=t[0],u=t[i-1];if(nt(c[0],c[1],u[0],u[1],e,r,n))return!0}return!1}function it(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function at(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function ct(t,e,r){var n=!1,o=t.length;if(2>=o)return!1;for(var i=0;o>i;i++){var a=t[i],c=t[(i+1)%o];if(at(a,c,[e,r]))return!0;it(a[1]-r)>0!=it(c[1]-r)>0&&0>it(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function ut(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=ct(t[o],e,r))break}return n}function st(t,e){var r=t.parsedStyle,n=r.fill,o=r.stroke,i=r.lineWidth,a=r.increasedLineWidthForHitTesting,c=r.clipPathTargets,u=r.r.value,s=((i&&i.value||0)+(a&&a.value||0))/2,l=tt(u,u,e.x,e.y),h=n&&!n.isNone,f=o&&!o.isNone;return h&&f||!!(null==c?void 0:c.length)?u+s>=l:h?u>=l:!!f&&(l>=u-s&&u+s>=l)}function lt(t,e,r,n){return t/(r*r)+e/(n*n)}function ht(t,e){var r=e.x,n=e.y,o=t.parsedStyle,i=o.fill,a=o.stroke,c=o.lineWidth,u=o.clipPathTargets,s=i&&!i.isNone,l=a&&!a.isNone,h=o.rx.value,f=o.ry.value,v=(((null==c?void 0:c.value)||0)+o.increasedLineWidthForHitTesting.value)/2,d=(r-h)*(r-h),p=(n-f)*(n-f);return s&&l||!!(null==u?void 0:u.length)?1>=lt(d,p,h+v,f+v):s?1>=lt(d,p,h,f):!!l&&(lt(d,p,h-v,f-v)>=1&&1>=lt(d,p,h+v,f+v))}function ft(t,e){var r=t.parsedStyle,n=r.defX,o=r.defY;return nt(r.x1.value,r.y1.value,r.x2.value,r.y2.value,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+(void 0===n?0:n),e.y+(void 0===o?0:o))}function vt(t,e,r){var n=t.parsedStyle,o=n.stroke,i=n.fill,a=n.defX,c=void 0===a?0:a,u=n.defY,s=void 0===u?0:u,l=n.clipPathTargets,h=n.path,f=i&&!i.isNone,v=h.hasArc,d=h.polylines,p=h.polygons,y=!!(null==l?void 0:l.length),g=!1;return(o&&!o.isNone||y)&&(g=function(t,e,r,n,o,i,a){for(var c,u,s=!1,l=e/2,h=0;t.length>h;h++){var f=t[h],v=f.currentPoint,d=f.params,p=f.prePoint,y=f.box;if(!y||et(y.x-l,y.y-l,y.width+e,y.height+e,r,n)){switch(f.command){case"L":case"Z":s=nt(p[0],p[1],v[0],v[1],e,r,n);break;case"Q":s=e/2>=q.pointDistance(p[0],p[1],d[1],d[2],d[3],d[4],r,n);break;case"C":s=e/2>=Z.pointDistance(p[0],p[1],d[1],d[2],d[3],d[4],d[5],d[6],r,n,o);break;case"A":var g=f.arcParams,m=g.rx,w=g.ry,x=g.startAngle,S=g.endAngle,k=g.xRotation,C=m>w?m:w,O=m>w?1:m/w,j=m>w?w/m:1,M=(u=[-g.cx,-g.cy],(c=E())[0]=1,c[1]=0,c[2]=0,c[3]=0,c[4]=1,c[5]=0,c[6]=u[0],c[7]=u[1],c[8]=1,c);b(M,L(E(),-k),M),b(M,P(E(),[1/O,1/j]),M);var A=N(r,n);s=rt(0,0,C,x,S,e,(A=T(A,A,M))[0],A[1])}if(s)break}}return s}(h.segments,n.lineWidth.value+n.increasedLineWidthForHitTesting.value,e.x+c,e.y+s,h.totalLength)),g||!f&&!y||(g=v?r(t,e):ut(p,e.x+c,e.y+s)||ut(d,e.x+c,e.y+s)),g}function dt(t,e){var r=t.parsedStyle,n=r.stroke,o=r.fill,i=r.points,a=r.defX,c=void 0===a?0:a,u=r.defY,s=void 0===u?0:u,l=r.clipPathTargets,h=!!(null==l?void 0:l.length),f=o&&!o.isNone,v=!1;return(n&&!n.isNone||h)&&(v=ot(i.points,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+c,e.y+s,!0)),v||!f&&!h||(v=ct(i.points,e.x+c,e.y+s)),v}function pt(t,e){var r=t.parsedStyle,n=r.stroke,o=r.lineWidth,i=r.defX,a=r.defY,c=r.clipPathTargets;return!((!n||n.isNone)&&!(null==c?void 0:c.length)||!o)&&ot(r.points.points,o.value+r.increasedLineWidthForHitTesting.value,e.x+(void 0===i?0:i),e.y+(void 0===a?0:a),!1)}function yt(t,r,n){var o=t.parsedStyle,i=o.radius,a=o.fill,c=o.stroke,u=o.lineWidth,s=o.increasedLineWidthForHitTesting,l=o.width,h=o.height,f=o.clipPathTargets,v=!!(null==f?void 0:f.length),d=a&&!a.isNone,p=c&&!c.isNone,y=i&&i.some((function(t){return 0!==t.value})),g=l.unit,m=h.unit,w=0,x=0;g!==e.UnitType.kNumber&&g!==e.UnitType.kPixels||(w=l.value),m!==e.UnitType.kNumber&&m!==e.UnitType.kPixels||(x=h.value);var E=u.value+s.value;if(y){var b=!1;return(p||v)&&(b=function(t,e,r,n,o,i,a,c){var u=o[0],s=o[1],l=o[2],h=o[3];return nt(t+u,e,t+r-s,e,i,a,c)||nt(t+r,e+s,t+r,e+n-l,i,a,c)||nt(t+r-l,e+n,t+h,e+n,i,a,c)||nt(t,e+n-h,t,e+u,i,a,c)||rt(t+r-s,e+s,s,1.5*Math.PI,2*Math.PI,i,a,c)||rt(t+r-l,e+n-l,l,0,.5*Math.PI,i,a,c)||rt(t+h,e+n-h,h,.5*Math.PI,Math.PI,i,a,c)||rt(t+u,e+u,u,Math.PI,1.5*Math.PI,i,a,c)}(0,0,w,x,i.map((function(t){return t.value})),E,r.x,r.y)),b||!d&&!v||(b=n(t,r)),b}var L=E/2;return d&&p||v?et(0-L,0-L,w+L,x+L,r.x,r.y):d?et(0,0,w,x,r.x,r.y):!!p&&function(t,e,r,n,o,i,a){var c=o/2;return et(t-c,e-c,r,o,i,a)||et(t+r-c,e-c,o,n,i,a)||et(t+c,e+n-c,r,o,i,a)||et(t-c,e+c,o,n,i,a)}(0,0,w,x,E,r.x,r.y)}var gt,mt,wt=e.Module((function(t){t({token:A,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?st:t===e.Shape.ELLIPSE?ht:t===e.Shape.RECT?yt:t===e.Shape.LINE?ft:t===e.Shape.POLYLINE?pt:t===e.Shape.POLYGON?dt:t===e.Shape.PATH?vt:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(_)})),xt=function(){function t(){this.name="canvas-picker"}var e=t.prototype;return e.init=function(t){t.load(wt,!0)},e.destroy=function(t){t.unload(wt)},t}(),Et=function(){function t(){this.imageCache={},this.patternCache={},this.canvasConfig=void 0}var r=t.prototype;return r.getImageSync=function(t){return this.imageCache[t]},r.getOrCreateImage=function(t){var r=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(o,i){var a;n?a=n(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){o(a)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=t,r.imageCache[t]=a)}))},r.getPatternSync=function(t){var e=this.generatePatternKey(t);if(this.patternCache[e])return this.patternCache[e]},r.createPattern=function(t,e){var r=this;return this.getOrCreateImage(t.src).then((function(n){var o=r.generatePatternKey(t),i=e.createPattern(n,t.repetition);return i&&(r.patternCache[o]=i),r.patternCache[o]}))},r.generatePatternKey=function(t){return"pattern-"+t.src+"-"+t.repetition},t}();function bt(){
6
6
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
7
- $t=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new L(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=u(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,o),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function h(){}function f(){}function d(){}var v={};c(v,i,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(S([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=d.prototype=h.prototype=Object.create(v);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,c){var s=u(t[i],t,o);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(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 E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=d,c(g,"constructor",d),c(d,"constructor",f),f.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(x.prototype),c(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(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),l},finish:function(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),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function Wt(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,i)}var Ut="undefined"!=typeof Float32Array?Float32Array:Array;function qt(){var t=new Ut(9);return Ut!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],c=e[4],s=e[5],u=e[6],l=e[7],h=e[8],f=n[0],d=n[1],v=n[2],p=n[3],y=n[4],g=n[5],m=n[6],x=n[7],b=n[8];return t[0]=f*r+d*a+v*u,t[1]=f*i+d*c+v*l,t[2]=f*o+d*s+v*h,t[3]=p*r+y*a+g*u,t[4]=p*i+y*c+g*l,t[5]=p*o+y*s+g*h,t[6]=m*r+x*a+b*u,t[7]=m*i+x*c+b*l,t[8]=m*o+x*s+b*h,t}function zt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Qt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Jt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Kt(){var t=new Ut(16);return Ut!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Zt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],c=e[4],s=e[5],u=e[6],l=e[7],h=e[8],f=e[9],d=e[10],v=e[11],p=e[12],y=e[13],g=e[14],m=e[15],x=n[0],b=n[1],w=n[2],E=n[3];return t[0]=x*r+b*c+w*h+E*p,t[1]=x*i+b*s+w*f+E*y,t[2]=x*o+b*u+w*d+E*g,t[3]=x*a+b*l+w*v+E*m,t[4]=(x=n[4])*r+(b=n[5])*c+(w=n[6])*h+(E=n[7])*p,t[5]=x*i+b*s+w*f+E*y,t[6]=x*o+b*u+w*d+E*g,t[7]=x*a+b*l+w*v+E*m,t[8]=(x=n[8])*r+(b=n[9])*c+(w=n[10])*h+(E=n[11])*p,t[9]=x*i+b*s+w*f+E*y,t[10]=x*o+b*u+w*d+E*g,t[11]=x*a+b*l+w*v+E*m,t[12]=(x=n[12])*r+(b=n[13])*c+(w=n[14])*h+(E=n[15])*p,t[13]=x*i+b*s+w*f+E*y,t[14]=x*o+b*u+w*d+E*g,t[15]=x*a+b*l+w*v+E*m,t}function te(){var t=new Ut(3);return Ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ee(t,e,n){var r=new Ut(3);return r[0]=t,r[1]=e,r[2]=n,r}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});!function(){var t=te()}();function ne(t,e){var n=new Ut(2);return n[0]=t,n[1]=e,n}function re(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}!function(){var t=function(){var t=new Ut(2);return Ut!=Float32Array&&(t[0]=0,t[1]=0),t}()}();var ie,oe,ae=n.Syringe.defineToken("PointInPathPicker"),ce=(ie=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pointInPathPickerFactory=void 0,this.isHit=function(n,r,i){var o=t.pointInPathPickerFactory(n.nodeName);if(o){var a=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],s=e[6],u=e[7],l=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],g=e[15],m=n*c-r*a,x=n*s-i*a,b=n*u-o*a,w=r*s-i*c,E=r*u-o*c,L=i*u-o*s,S=l*p-h*v,P=l*y-f*v,C=l*g-d*v,M=h*y-f*p,k=h*g-d*p,O=f*g-d*y,T=m*O-x*k+b*M+w*C-E*P+L*S;return T?(t[0]=(c*O-s*k+u*M)*(T=1/T),t[1]=(i*k-r*O-o*M)*T,t[2]=(p*L-y*E+g*w)*T,t[3]=(f*E-h*L-d*w)*T,t[4]=(s*C-a*O-u*P)*T,t[5]=(n*O-i*C+o*P)*T,t[6]=(y*b-v*L-g*x)*T,t[7]=(l*L-f*b+d*x)*T,t[8]=(a*k-c*C+u*S)*T,t[9]=(r*C-n*k-o*S)*T,t[10]=(v*E-p*b+g*m)*T,t[11]=(h*b-l*E-d*m)*T,t[12]=(c*P-a*M-s*S)*T,t[13]=(n*M-r*P+i*S)*T,t[14]=(p*x-v*w-y*m)*T,t[15]=(l*w-h*x+f*m)*T,t):null}(Kt(),i),c=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}(te(),ee(r[0],r[1],0),a),s=n.getGeometryBounds().halfExtents,u=n.parsedStyle.anchor;if(c[0]+=(u&&u[0].value||0)*s[0]*2,c[1]+=(u&&u[1].value||0)*s[1]*2,o(n,new e.Point(c[0],c[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,n){var r=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas),i=t.pathGeneratorFactory(e.nodeName);return i&&i(r,e.parsedStyle),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(t){var e=this;t.hooks.pick.tapPromise(oe.tag,function(){var t,n=(t=$t().mark((function t(n){var r,i,o,a,c,s,u,l,h,f,d,v,p;return $t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.topmost,o=ee((i=n.position).x,i.y,0),a=e.rBush.search({minX:o[0],minY:o[1],maxX:o[0],maxY:o[1]}),c=a.map((function(t){return t.id})),s=[],a.forEach((function(t){var n=e.displayObjectPool.getByEntity(t.id);if(n.isVisible()&&!n.isCulled()&&n.isInteractive()){if(n.parentNode&&-1===c.indexOf(n.parentNode.entity))return;s.push(n)}})),s.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),u=[],l=0,h=s;case 9:if(l>=h.length){t.next=25;break}if(v=(d=(f=h[l]).parsedStyle.clipPath)||f,p=f.getWorldTransform(),d&&(p=Zt(Kt(),p,d.getLocalTransform())),!e.isHit(v,o,p)){t.next=22;break}if(!r){t.next=21;break}return n.picked=[f],t.abrupt("return",n);case 21:u.push(f);case 22:l++,t.next=9;break;case 25:return n.picked=u,t.abrupt("return",n);case 27:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Wt(o,r,i,a,c,"next",t)}function c(t){Wt(o,r,i,a,c,"throw",t)}a(void 0)}))});return function(t){return n.apply(this,arguments)}}())},t}(),ie.tag="CanvasPicker",oe=ie);function se(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function ue(t,e){return.001>Math.abs(t-e)}function le(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}function he(t){return(t+2*Math.PI)%(2*Math.PI)}i([n.inject(e.DisplayObjectPool),o("design:type",e.DisplayObjectPool)],ce.prototype,"displayObjectPool",void 0),i([n.inject(e.CanvasConfig),o("design:type",Object)],ce.prototype,"canvasConfig",void 0),i([n.inject(e.OffscreenCanvasCreator),o("design:type",e.OffscreenCanvasCreator)],ce.prototype,"offscreenCanvas",void 0),i([n.inject(Gt),o("design:type",x)],ce.prototype,"rBush",void 0),i([n.inject(ft),o("design:type",Function)],ce.prototype,"pathGeneratorFactory",void 0),i([n.inject(ae),o("design:type",Function)],ce.prototype,"pointInPathPickerFactory",void 0),ce=oe=i([n.singleton({contrib:e.RenderingPluginContribution})],ce);var fe=function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},de=function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var c=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],c))};function ve(t,e,n,r,i,o){var a=-1,c=1/0,s=[n,r],u=20;o&&o>200&&(u=o/10);for(var l=1/u,h=l/10,f=0;u>=f;f++){var d=f*l,v=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],p=se(s[0],s[1],v[0],v[1]);c>p&&(a=d,c=p)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&1e-4<=h;g++){var m=a-h,x=a+h,b=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],w=se(s[0],s[1],b[0],b[1]);if(m>=0&&c>w)a=m,c=w;else{var E=[i.apply(void 0,t.concat([x])),i.apply(void 0,e.concat([x]))],L=se(s[0],s[1],E[0],E[1]);1>=x&&c>L?(a=x,c=L):h*=.5}}return{x:i.apply(void 0,t.concat([a])),y:i.apply(void 0,e.concat([a]))}}function pe(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function ye(t,e,n){var r=t+n-2*e;if(ue(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function ge(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function me(t,e,n,r,i,o,a){var c=pe(t,n,i,a),s=pe(e,r,o,a),u=fe(t,e,n,r,a),l=fe(n,r,i,o,a);return[[t,e,u.x,u.y,c,s],[c,s,l.x,l.y,i,o]]}function xe(t,e,n,r,i,o,a){if(0===a)return(se(t,e,n,r)+se(n,r,i,o)+se(t,e,i,o))/2;var c=me(t,e,n,r,i,o,.5),s=c[0],u=c[1];return s.push(a-1),u.push(a-1),xe.apply(void 0,s)+xe.apply(void 0,u)}var be={box:function(t,e,n,r,i,o){var a=ye(t,n,i)[0],c=ye(e,r,o)[0],s=[t,i],u=[e,o];return void 0!==a&&s.push(pe(t,n,i,a)),void 0!==c&&u.push(pe(e,r,o,c)),le(s,u)},length:function(t,e,n,r,i,o){return xe(t,e,n,r,i,o,3)},nearestPoint:function(t,e,n,r,i,o,a,c){return ve([t,n,i],[e,r,o],a,c,pe)},pointDistance:function(t,e,n,r,i,o,a,c){var s=this.nearestPoint(t,e,n,r,i,o,a,c);return se(s.x,s.y,a,c)},interpolationAt:pe,pointAt:function(t,e,n,r,i,o,a){return{x:pe(t,n,i,a),y:pe(e,r,o,a)}},divide:function(t,e,n,r,i,o,a){return me(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,i,o,a){var c=ge(t,n,i,a),s=ge(e,r,o,a);return he(Math.atan2(s,c))}};function we(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Ee(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function Le(t,e,n,r){var i,o,a,c=-3*t+9*e-9*n+3*r,s=6*t-12*e+6*n,u=3*e-3*t,l=[];if(ue(c,0))ue(s,0)||0>(i=-u/s)||i>1||l.push(i);else{var h=s*s-4*c*u;ue(h,0)?l.push(-s/(2*c)):h>0&&(o=(-s-(a=Math.sqrt(h)))/(2*c),0>(i=(-s+a)/(2*c))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function Se(t,e,n,r,i,o,a,c,s){var u=we(t,n,i,a,s),l=we(e,r,o,c,s),h=fe(t,e,n,r,s),f=fe(n,r,i,o,s),d=fe(i,o,a,c,s),v=fe(h.x,h.y,f.x,f.y,s),p=fe(f.x,f.y,d.x,d.y,s);return[[t,e,h.x,h.y,v.x,v.y,u,l],[u,l,p.x,p.y,d.x,d.y,a,c]]}function Pe(t,e,n,r,i,o,a,c,s){if(0===s)return function(t,e){for(var n=0,r=t.length,i=0;r>i;i++)n+=se(t[i],e[i],t[(i+1)%r],e[(i+1)%r]);return n/2}([t,n,i,a],[e,r,o,c]);var u=Se(t,e,n,r,i,o,a,c,.5),l=[].concat(u[0],[s-1]),h=[].concat(u[1],[s-1]);return Pe.apply(void 0,l)+Pe.apply(void 0,h)}var Ce={extrema:Le,box:function(t,e,n,r,i,o,a,c){for(var s=[t,a],u=[e,c],l=Le(t,n,i,a),h=Le(e,r,o,c),f=0;l.length>f;f++)s.push(we(t,n,i,a,l[f]));for(var d=0;h.length>d;d++)u.push(we(e,r,o,c,h[d]));return le(s,u)},length:function(t,e,n,r,i,o,a,c){return Pe(t,e,n,r,i,o,a,c,3)},nearestPoint:function(t,e,n,r,i,o,a,c,s,u,l){return ve([t,n,i,a],[e,r,o,c],s,u,we,l)},pointDistance:function(t,e,n,r,i,o,a,c,s,u,l){var h=this.nearestPoint(t,e,n,r,i,o,a,c,s,u,l);return se(h.x,h.y,s,u)},interpolationAt:we,pointAt:function(t,e,n,r,i,o,a,c,s){return{x:we(t,n,i,a,s),y:we(e,r,o,c,s)}},divide:function(t,e,n,r,i,o,a,c,s){return Se(t,e,n,r,i,o,a,c,s)},tangentAngle:function(t,e,n,r,i,o,a,c,s){var u=Ee(t,n,i,a,s),l=Ee(e,r,o,c,s);return he(Math.atan2(l,u))}};function Me(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function ke(t,e,n,r,i,o){return!(t>i||i>t+n||e>o||o>e+r)}function Oe(t,e,n,r,i,o,a,c){var s=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(r>s||s>i)return!1;var u={x:t+n*Math.cos(s),y:e+n*Math.sin(s)};return Me(u.x,u.y,a,c)<=o/2}function Te(t,e,n,r,i,o,a){var c=Math.min(t,n),s=Math.max(t,n),u=Math.min(e,r),l=Math.max(e,r),h=i/2;return!(c-h>o||o>s+h||u-h>a||a>l+h)&&de(t,e,n,r,o,a)<=i/2}function Ne(t,e,n,r,i){var o=t.length;if(2>o)return!1;for(var a=0;o-1>a;a++){if(Te(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var c=t[0],s=t[o-1];if(Te(c[0],c[1],s[0],s[1],e,n,r))return!0}return!1}function je(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function _e(t,e,n){return!((n[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(n[1]-t[1])||Math.min(t[0],e[0])>n[0]||n[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>n[1]||n[1]>Math.max(t[1],e[1]))}function Be(t,e,n){var r=!1,i=t.length;if(2>=i)return!1;for(var o=0;i>o;o++){var a=t[o],c=t[(o+1)%i];if(_e(a,c,[e,n]))return!0;je(a[1]-n)>0!=je(c[1]-n)>0&&0>je(e-(n-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(r=!r)}return r}function Re(t,e,n){for(var r=!1,i=0;t.length>i;i++){if(r=Be(t[i],e,n))break}return r}function Ae(t,e){var n=t.parsedStyle,r=n.fill,i=n.stroke,o=n.lineWidth,a=n.increasedLineWidthForHitTesting,c=n.clipPathTargets,s=n.r.value,u=((o&&o.value||0)+(a&&a.value||0))/2,l=Me(s,s,e.x,e.y),h=r&&!r.isNone,f=i&&!i.isNone;return h&&f||!!(null==c?void 0:c.length)?s+u>=l:h?s>=l:!!f&&(l>=s-u&&s+u>=l)}function Ie(t,e,n,r){return t/(n*n)+e/(r*r)}function Ge(t,e){var n=e.x,r=e.y,i=t.parsedStyle,o=i.fill,a=i.stroke,c=i.lineWidth,s=i.clipPathTargets,u=o&&!o.isNone,l=a&&!a.isNone,h=i.rx.value,f=i.ry.value,d=(((null==c?void 0:c.value)||0)+i.increasedLineWidthForHitTesting.value)/2,v=(n-h)*(n-h),p=(r-f)*(r-f);return u&&l||!!(null==s?void 0:s.length)?1>=Ie(v,p,h+d,f+d):u?1>=Ie(v,p,h,f):!!l&&(Ie(v,p,h-d,f-d)>=1&&1>=Ie(v,p,h+d,f+d))}function De(t,e){var n=t.parsedStyle,r=n.defX,i=n.defY;return Te(n.x1.value,n.y1.value,n.x2.value,n.y2.value,n.lineWidth.value+n.increasedLineWidthForHitTesting.value,e.x+(void 0===r?0:r),e.y+(void 0===i?0:i))}function Fe(t,e){var n=t.parsedStyle,r=n.stroke,i=n.lineWidth,o=n.defX,a=n.defY,c=n.clipPathTargets;return!((!r||r.isNone)&&!(null==c?void 0:c.length)||!i)&&Ne(n.points.points,i.value+n.increasedLineWidthForHitTesting.value,e.x+(void 0===o?0:o),e.y+(void 0===a?0:a),!1)}function Ye(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.defX,c=void 0===a?0:a,s=r.defY,u=void 0===s?0:s,l=r.clipPathTargets,h=r.path,f=o&&!o.isNone,d=h.hasArc,v=h.polylines,p=h.polygons,y=!!(null==l?void 0:l.length),g=!1;return(i&&!i.isNone||y)&&(g=function(t,e,n,r,i,o,a){for(var c=!1,s=e/2,u=0;t.length>u;u++){var l=t[u],h=l.currentPoint,f=l.params,d=l.prePoint,v=l.box;if(!v||ke(v.x-s,v.y-s,v.width+e,v.height+e,n,r)){switch(l.command){case"L":case"Z":c=Te(d[0],d[1],h[0],h[1],e,n,r);break;case"Q":c=e/2>=be.pointDistance(d[0],d[1],f[1],f[2],f[3],f[4],n,r);break;case"C":c=e/2>=Ce.pointDistance(d[0],d[1],f[1],f[2],f[3],f[4],f[5],f[6],n,r,i);break;case"A":var p=l.arcParams,y=p.cx,g=p.cy,m=p.rx,x=p.ry,b=p.startAngle,w=p.endAngle,E=p.xRotation,L=m>x?m:x,S=m>x?1:m/x,P=m>x?x/m:1,C=zt(qt(),[-y,-g]);Vt(C,Qt(qt(),-E),C),Vt(C,Jt(qt(),[1/S,1/P]),C);var M=ne(n,r);c=Oe(0,0,L,b,w,e,(M=re(M,M,C))[0],M[1])}if(c)break}}return c}(h.segments,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+c,e.y+u,h.totalLength)),g||!f&&!y||(g=d?n(t,e):Re(p,e.x+c,e.y+u)||Re(v,e.x+c,e.y+u)),g}function Xe(t,n,r){var i=t.parsedStyle,o=i.radius,a=i.fill,c=i.stroke,s=i.lineWidth,u=i.increasedLineWidthForHitTesting,l=i.width,h=i.height,f=i.clipPathTargets,d=!!(null==f?void 0:f.length),v=a&&!a.isNone,p=c&&!c.isNone,y=o&&o.some((function(t){return 0!==t.value})),g=l.unit,m=h.unit,x=0,b=0;g!==e.UnitType.kNumber&&g!==e.UnitType.kPixels||(x=l.value),m!==e.UnitType.kNumber&&m!==e.UnitType.kPixels||(b=h.value);var w=s.value+u.value;if(y){var E=!1;return(p||d)&&(E=function(t,e,n,r,i,o,a,c){var s=i[0],u=i[1],l=i[2],h=i[3];return Te(t+s,e,t+n-u,e,o,a,c)||Te(t+n,e+u,t+n,e+r-l,o,a,c)||Te(t+n-l,e+r,t+h,e+r,o,a,c)||Te(t,e+r-h,t,e+s,o,a,c)||Oe(t+n-u,e+u,u,1.5*Math.PI,2*Math.PI,o,a,c)||Oe(t+n-l,e+r-l,l,0,.5*Math.PI,o,a,c)||Oe(t+h,e+r-h,h,.5*Math.PI,Math.PI,o,a,c)||Oe(t+s,e+s,s,Math.PI,1.5*Math.PI,o,a,c)}(0,0,x,b,o.map((function(t){return t.value})),w,n.x,n.y)),E||!v&&!d||(E=r(t,n)),E}var L=w/2;return v&&p||d?ke(0-L,0-L,x+L,b+L,n.x,n.y):v?ke(0,0,x,b,n.x,n.y):!!p&&function(t,e,n,r,i,o,a){var c=i/2;return ke(t-c,e-c,n,i,o,a)||ke(t+n-c,e-c,i,r,o,a)||ke(t+c,e+r-c,n,i,o,a)||ke(t-c,e+c,i,r,o,a)}(0,0,x,b,w,n.x,n.y)}function He(t,e){var n=t.parsedStyle,r=n.stroke,i=n.fill,o=n.points,a=n.defX,c=void 0===a?0:a,s=n.defY,u=void 0===s?0:s,l=n.clipPathTargets,h=!!(null==l?void 0:l.length),f=i&&!i.isNone,d=!1;return(r&&!r.isNone||h)&&(d=Ne(o.points,n.lineWidth.value+n.increasedLineWidthForHitTesting.value,e.x+c,e.y+u,!0)),d||!f&&!h||(d=Be(o.points,e.x+c,e.y+u)),d}var $e,We,Ue=n.Module((function(t){t({token:ae,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?Ae:t===e.Shape.ELLIPSE?Ge:t===e.Shape.RECT?Xe:t===e.Shape.LINE?De:t===e.Shape.POLYLINE?Fe:t===e.Shape.POLYGON?He:t===e.Shape.PATH?Ye:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(ce)})),qe=function(){function t(){this.name="canvas-picker"}var e=t.prototype;return e.init=function(t){t.load(Ue,!0)},e.destroy=function(t){t.unload(Ue)},t}(),Ve=Object.freeze({__proto__:null,Plugin:qe});function ze(){
7
+ bt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(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 b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(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),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function Lt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Lt(i,n,o,a,c,"next",t)}function c(t){Lt(i,n,o,a,c,"throw",t)}a(void 0)}))}}y([e.inject(e.CanvasConfig),g("design:type",Object)],Et.prototype,"canvasConfig",void 0),Et=y([e.singleton()],Et);var St=(gt=function(){function t(){this.imagePool=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var r=this,n=function(n){var o=n.target;if(o.nodeName===e.Shape.IMAGE){var i=o.attributes.img;e.isString(i)&&r.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var o=n.target,i=n.newValue;o.nodeName===e.Shape.IMAGE&&"img"===n.attrName&&e.isString(i)&&r.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(mt.tag,Pt(bt().mark((function t(){return bt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,o);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(mt.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},t}(),gt.tag="LoadImage",mt=gt);y([e.inject(Et),g("design:type",Et)],St.prototype,"imagePool",void 0),y([e.inject(e.RenderingContext),g("design:type",Object)],St.prototype,"renderingContext",void 0),St=mt=y([e.singleton({contrib:e.RenderingPluginContribution})],St);var kt=e.Module((function(t){t(Et),t(St)})),Ct=function(){function t(){this.name="image-loader"}var e=t.prototype;return e.init=function(t){t.load(kt,!0)},e.destroy=function(t){t.unload(kt)},t}();function Ot(){
8
8
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
9
- ze=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new L(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=b(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=u(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(t,n,o),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l={};function h(){}function f(){}function d(){}var v={};c(v,i,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(S([])));y&&y!==e&&n.call(y,i)&&(v=y);var g=d.prototype=h.prototype=Object.create(v);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,c){var s=u(t[i],t,o);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(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 E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return f.prototype=d,c(g,"constructor",d),c(d,"constructor",f),f.displayName=c(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(x.prototype),c(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(s(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(c){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(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),l},finish:function(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),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function Qe(t,e,n,r,i,o,a){try{var c=t[o](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,i)}function Je(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Qe(o,r,i,a,c,"next",t)}function c(t){Qe(o,r,i,a,c,"throw",t)}a(void 0)}))}}var Ke=($e=function(){function t(){this.contextService=void 0,this.renderingContext=void 0,this.canvasConfig=void 0,this.$camera=void 0}var n=t.prototype;return n.apply=function(t){var n=this,r=function(t){var r=t.target;if(r.nodeName===e.Shape.HTML){var i=n.getOrCreateEl(r),o=r.ownerDocument.documentElement.attributes;Object.keys(o).forEach((function(t){i.style[t]=o[t]})),Object.keys(r.attributes).forEach((function(t){n.updateAttribute(t,r)}))}},i=function(t){var r=t.target;if(r.nodeName===e.Shape.HTML){var i=n.getId(r),o=n.contextService.getDomElement().parentNode;if(o){var a=o.querySelector("#"+i);a&&o.removeChild(a)}}},o=function(t){var r=t.target;r.nodeName===e.Shape.HTML&&n.updateAttribute(t.attrName,r)};t.hooks.init.tapPromise(We.tag,Je(ze().mark((function t(){return ze().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,i),n.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,o);case 3:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(We.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,i),n.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},n.getId=function(t){return t.id||"g-html-"+t.entity},n.getOrCreateEl=function(t){var e=this.canvasConfig.document,n=this.getId(t),r=this.contextService.getDomElement().parentNode;if(r){var i=r.querySelector("#"+n);if(!i){i=(e||document).createElement("div"),t.parsedStyle.$el=i,i.id=n,t.name&&i.setAttribute("name",t.name),t.className&&(i.className=t.className),r.appendChild(i),i.style.position="absolute",i.style.left="0",i.style.top="0",i.style["will-change"]="transform";var o=t.getWorldTransform();i.style.transform="matrix("+[o[0],o[1],o[4],o[5],o[12],o[13]].join(",")+")"}return i}return null},n.updateAttribute=function(t,n){var r=this.getOrCreateEl(n);switch(t){case"innerHTML":var i=n.parsedStyle.innerHTML;e.isString(i)?r.innerHTML=i:(r.innerHTML="",r.appendChild(i));break;case"modelMatrix":case"transformOrigin":var o=n.parsedStyle.transformOrigin;r.style["transform-origin"]=o[0].value+" "+o[1].value;var a=n.getWorldTransform();r.style.transform="matrix("+[a[0],a[1],a[4],a[5],a[12],a[13]].join(",")+")";break;case"width":var c=n.computedStyleMap().get("width");r.style.width=c.toString();break;case"height":var s=n.computedStyleMap().get("height");r.style.height=s.toString();break;case"zIndex":r.style["z-index"]=""+n.parsedStyle.zIndex.value;break;case"visibility":r.style.visibility=n.parsedStyle.visibility.value;break;case"pointerEvents":r.style.pointerEvents=n.parsedStyle.pointerEvents.value;break;case"opacity":r.style.opacity=""+n.parsedStyle.opacity.value;break;case"fill":var u=n.parsedStyle.fill,l="";if(u instanceof e.CSSRGB)l=u.toString();else if(u instanceof e.CSSGradientValue){if(u.type===e.GradientPatternType.LinearGradient)l="linear-gradient(to right, "+u.value.steps.map((function(t){return t[1]+" "+100*Number(t[0])+"%"})).join(",")+");"}r.style.background=l;break;case"stroke":r.style["border-color"]=n.parsedStyle.stroke.toString(),r.style["border-style"]="solid";break;case"lineWidth":r.style["border-width"]=(n.parsedStyle.lineWidth.value||0)+"px";break;case"lineDash":r.style["border-style"]="dashed";break;case"filter":r.style.filter=n.parsedStyle.filter}},t}(),$e.tag="HTMLRendering",We=$e);i([n.inject(e.ContextService),o("design:type",Object)],Ke.prototype,"contextService",void 0),i([n.inject(e.RenderingContext),o("design:type",Object)],Ke.prototype,"renderingContext",void 0),i([n.inject(e.CanvasConfig),o("design:type",Object)],Ke.prototype,"canvasConfig",void 0),Ke=We=i([n.singleton({contrib:e.RenderingPluginContribution})],Ke);var Ze=n.Module((function(t){t(Ke)})),tn=function(){function t(){this.name="html-renderer"}var e=t.prototype;return e.init=function(t){t.load(Ze,!0)},e.destroy=function(t){t.unload(Ze)},t}(),en=Object.freeze({__proto__:null,Plugin:tn}),nn=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var n=t.prototype;return n.init=function(){var t=this.canvasConfig,n=t.container,r=t.canvas,i=t.devicePixelRatio;if(r)this.$canvas=r,n&&r.parentElement!==n&&n.appendChild(r),this.$container=r.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=e.isString(n)?document.getElementById(n):n,this.$container)){var o=document.createElement("canvas");this.$container.appendChild(o),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=o}this.context=this.$canvas.getContext("2d");var a=i||e.isBrowser&&window.devicePixelRatio||1;a=1>a?1:Math.ceil(a),this.dpr=a,this.resize(this.canvasConfig.width,this.canvasConfig.height)},n.getContext=function(){return this.context},n.getDomElement=function(){return this.$canvas},n.getDPR=function(){return this.dpr},n.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},n.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},n.resize=function(t,n){if(this.$canvas){this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*n,e.setDOMSize(this.$canvas,t,n);var r=this.getDPR();this.context.scale(r,r)}},n.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t}();i([n.inject(e.CanvasConfig),o("design:type",Object)],nn.prototype,"canvasConfig",void 0),nn=i([n.singleton({token:e.ContextService})],nn);var rn=n.Module((function(t){t(nn)})),on=function(){function t(){this.name="canvas-context-register"}var e=t.prototype;return e.init=function(t){t.load(rn,!0)},e.destroy=function(t){t.unload(rn)},t}(),an=function(t){var e,n;function i(e){var n;return(n=t.call(this,e)||this).registerPlugin(new on),n.registerPlugin(new Xt),n.registerPlugin(new d),n.registerPlugin(new qe),n.registerPlugin(new tn),n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,r(e,n),i}(e.AbstractRenderer);t.CanvasPicker=Ve,t.CanvasRenderer=Ht,t.DomInteraction=v,t.HTMLRenderer=en,t.Renderer=an,Object.defineProperty(t,"__esModule",{value:!0})}));
9
+ Ot=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(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 b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(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),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function Nt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Tt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Nt(i,n,o,a,c,"next",t)}function c(t){Nt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function jt(){return jt=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},jt.apply(this,arguments)}function Mt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,At(t,e)}function At(t,e){return At=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},At(t,e)}var _t="undefined"!=typeof Float32Array?Float32Array:Array;function Ft(t,e){var r=e[4],n=e[5],o=e[6],i=e[8],a=e[9],c=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(r,n,o),t[2]=Math.hypot(i,a,c),t}function Gt(){var t=new _t(3);return _t!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function It(t,e,r){var n=new _t(3);return n[0]=t,n[1]=e,n[2]=r,n}function Rt(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[0],c=r[1],u=r[2];return t[0]=o*u-i*c,t[1]=i*a-n*u,t[2]=n*c-o*a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Bt=function(t){return Math.hypot(t[0],t[1],t[2])};!function(){var t=Gt()}();!function(){var t,e=(t=new _t(4),_t!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Dt(){var t=new _t(4);return _t!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Yt(t,e,r,n){var o,i,a,c,u,s=e[0],l=e[1],h=e[2],f=e[3],v=r[0],d=r[1],p=r[2],y=r[3];return 0>(i=s*v+l*d+h*p+f*y)&&(i=-i,v=-v,d=-d,p=-p,y=-y),1-i>1e-6?(o=Math.acos(i),a=Math.sin(o),c=Math.sin((1-n)*o)/a,u=Math.sin(n*o)/a):(c=1-n,u=n),t[0]=c*s+u*v,t[1]=c*l+u*d,t[2]=c*h+u*p,t[3]=c*f+u*y,t}var $t,Wt,Ht,Ut,Xt,qt,Vt,zt=function(t,e){var r=e[0],n=e[1],o=e[2],i=e[3],a=r*r+n*n+o*o+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=o*a,t[3]=i*a,t},Qt=($t=Gt(),Wt=It(1,0,0),Ht=It(0,1,0),Ut=Dt(),Xt=Dt(),qt=new _t(9),_t!=Float32Array&&(qt[1]=0,qt[2]=0,qt[3]=0,qt[5]=0,qt[6]=0,qt[7]=0),qt[0]=1,qt[4]=1,qt[8]=1,Vt=qt,function(){function t(){this.gradientCache={}}var r=t.prototype;return r.getOrCreateGradient=function(t,r){var n=this.generateCacheKey(t),o=t.type,i=t.x0,a=t.y0,c=t.x1,u=t.y1,s=t.steps,l=t.width,h=t.height;if(this.gradientCache[n])return this.gradientCache[n];var f=null;if(o===e.GradientPatternType.LinearGradient)f=r.createLinearGradient(i*l,a*h,c*l,u*h);else if(o===e.GradientPatternType.RadialGradient){var v=Math.sqrt(l*l+h*h)/2;f=r.createRadialGradient(i*l,a*h,0,c*l,u*h,t.r1*v)}return f&&(s.forEach((function(t){var e,r=t[1];null===(e=f)||void 0===e||e.addColorStop(Number(t[0]),r)})),this.gradientCache[n]=f),this.gradientCache[n]},r.generateCacheKey=function(t){return"gradient-"+t.type+"-"+t.x0+"-"+t.y0+"-"+t.x1+"-"+t.y1+"-"+(t.r1||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return t.join("")})).join("-")},t}());Qt=y([e.singleton()],Qt);var Kt=e.Syringe.defineToken("StyleRendererFactory"),Jt=e.Syringe.defineToken("CircleRenderer",{multiple:!1}),Zt=e.Syringe.defineToken("EllipseRenderer",{multiple:!1}),te=e.Syringe.defineToken("RectRenderer",{multiple:!1}),ee=e.Syringe.defineToken("LineRenderer",{multiple:!1}),re=e.Syringe.defineToken("PolylineRenderer",{multiple:!1}),ne=e.Syringe.defineToken("PolygonRenderer",{multiple:!1}),oe=e.Syringe.defineToken("PathRenderer",{multiple:!1}),ie=e.Syringe.defineToken("TextRenderer",{multiple:!1}),ae=e.Syringe.defineToken("ImageRenderer",{multiple:!1}),ce=function(){function t(){this.imagePool=void 0}return t.prototype.render=function(t,r){var n,o=r.img,i=r.width.value,a=r.height.value;if(e.isString(o)?n=this.imagePool.getImageSync(o):(i||(i=o.width),a||(a=o.height),n=o),n)try{t.drawImage(n,0,0,i,a)}catch(t){}},t}();y([e.inject(Et),g("design:type",Et)],ce.prototype,"imagePool",void 0),ce=y([e.singleton({token:ae})],ce);var ue=function(){function t(){}var r=t.prototype;return r.render=function(t,r,n){var o=r.lineWidth,i=r.textAlign,a=r.textBaseline,c=r.lineJoin,u=r.miterLimit,s=void 0===u?0:u,l=r.letterSpacing,h=void 0===l?0:l,f=r.stroke,v=r.fill,d=r.fillOpacity,p=r.strokeOpacity,y=r.opacity,g=r.metrics,m=r.dx,w=r.dy,x=g.lines,E=g.height,b=g.lineHeight,L=g.lineMetrics;t.font=g.font,t.lineWidth=o.value,t.textAlign=i.value,t.textBaseline=a.value,t.lineJoin=c.value,t.miterLimit=s;var P=0;"middle"===a.value?P=-E/2-b/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?P=-E:"top"!==a.value&&"hanging"!==a.value||(P=-b);var S=0;m&&m.unit===e.UnitType.kPixels&&(S+=m.value),w&&w.unit===e.UnitType.kPixels&&(P+=w.value);for(var k=0;x.length>k;k++){var C=o.value/2+S;P+=b,!e.isNil(f)&&!f.isNone&&o&&o.value&&this.drawLetterSpacing(t,x[k],L[k],i.value,C,P,h,d.value,p.value,y.value,!0),e.isNil(v)||this.drawLetterSpacing(t,x[k],L[k],i.value,C,P,h,d.value,p.value,y.value)}},r.drawLetterSpacing=function(t,e,r,n,o,i,a,c,u,s,l){if(void 0===l&&(l=!1),0!==a){var h=t.textAlign;t.textAlign="left";var f=o;"center"===n?f=o-r.width/2:"right"!==n&&"end"!==n||(f=o-r.width);for(var v=Array.from(e),d=t.measureText(e).width,p=0,y=0;v.length>y;++y){var g=v[y];l?this.strokeText(t,g,f,i,u):this.fillText(t,g,f,i,c,s),f+=d-(p=t.measureText(e.substring(y+1)).width)+a,d=p}t.textAlign=h}else l?this.strokeText(t,e,o,i,u):this.fillText(t,e,o,i,c,s)},r.fillText=function(t,r,n,o,i,a){var c,u=!e.isNil(i)&&1!==i;u&&(c=t.globalAlpha,t.globalAlpha=i*a),t.fillText(r,n,o),u&&(t.globalAlpha=c)},r.strokeText=function(t,r,n,o,i){var a,c=!e.isNil(i)&&1!==i;c&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(r,n,o),c&&(t.globalAlpha=a)},t}();ue=y([e.singleton({token:ie})],ue);var se=function(){function t(){}return t.prototype.render=function(t,r){var n=r.fill,o=r.opacity,i=r.fillOpacity,a=r.stroke,c=r.strokeOpacity,u=r.lineWidth,s=r.lineCap,l=r.lineJoin,h=r.shadowColor,f=r.filter,v=r.miterLimit,d=!e.isNil(n)&&!n.isNone,p=!e.isNil(a)&&!a.isNone,y=0===n.alpha;if(d&&(e.isNil(i)||1===i.value?t.fill():(t.globalAlpha=i.value,t.fill(),t.globalAlpha=o.value)),p&&u&&u.value>0){var g,m,w;!e.isNil(c)&&1!==c.value&&(t.globalAlpha=c.value),t.lineWidth=u.value,e.isNil(v)||(t.miterLimit=v),e.isNil(s)||(t.lineCap=s.value),e.isNil(l)||(t.lineJoin=l.value);var x=!e.isNil(h),E=!e.isNil(f);x&&(m=t.shadowColor,e.isNil(g=t.shadowBlur)||(t.shadowColor="transparent",t.shadowBlur=0)),E&&!e.isNil(w=t.filter)&&w.indexOf("drop-shadow")>-1&&(t.filter=w.replace(/drop-shadow\([^)]*\)/,"").trim()||"none");var b=d&&!y;b&&t.stroke(),x&&(t.shadowColor=m,t.shadowBlur=g),E&&(t.filter=w),b||t.stroke()}},t}(),le=function(t){function e(){return t.apply(this,arguments)||this}return Mt(e,t),e}(se=y([e.singleton()],se));le=y([e.singleton({token:te})],le);var he=function(t){function e(){return t.apply(this,arguments)||this}return Mt(e,t),e}(se);he=y([e.singleton({token:Jt})],he);var fe=function(t){function e(){return t.apply(this,arguments)||this}return Mt(e,t),e}(se);fe=y([e.singleton({token:Zt})],fe);var ve=function(t){function e(){return t.apply(this,arguments)||this}return Mt(e,t),e}(se);ve=y([e.singleton({token:ee})],ve);var de=function(t){function e(){return t.apply(this,arguments)||this}return Mt(e,t),e}(se);de=y([e.singleton({token:re})],de);var pe=function(t){function e(){return t.apply(this,arguments)||this}return Mt(e,t),e}(se);pe=y([e.singleton({token:ne})],pe);var ye,ge,me=function(t){function e(){return t.apply(this,arguments)||this}return Mt(e,t),e}(se);me=y([e.singleton({token:oe})],me);var we=(ye=function(){function t(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.imagePool=void 0,this.gradientPool=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.styleRendererFactory=void 0,this.styleRendererFactoryCache={},this.displayObjectPool=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.tmpVec3=Gt(),this.tmpMat4=function(){var t=new _t(16);return _t!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}()}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},o=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(ge.tag,Tt(Ot().mark((function t(){var i,a,c,u;return Ot().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.CULLED,o),a=(i=r.canvasConfig).width,c=i.height,u=r.contextService.getContext(),r.clearRect(u,0,0,a,c);case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(ge.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,o)})),t.hooks.beginFrame.tap(ge.tag,(function(){var t=r.contextService.getContext(),e=r.canvasConfig,n=e.width,o=e.height;r.clearFullScreen=r.shouldClearFullScreen(),t&&(t.save(),r.clearFullScreen&&r.clearRect(t,0,0,n,o),r.applyTransform(t,r.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(ge.tag,(function(){var n=r.contextService.getContext();if(r.clearFullScreen);else{var o=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(r.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(It(r,n,0),It(o,i,0)),a}))));if(r.removedRBushNodeAABBs=[],e.AABB.isEmpty(o))return void(r.renderQueue=[]);var i=r.convertAABB2Rect(o),a=i.x,c=i.y,u=i.width,s=i.height;r.clearRect(n,a,c,u,s),n.beginPath(),n.rect(a,c,u,s),n.clip(),r.searchDirtyObjects(o).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t)})),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(t){n.restore()})),r.restoreStack=[],r.clearFullScreen=!1,n.restore()})),t.hooks.render.tap(ge.tag,(function(e){r.clearFullScreen?e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t):r.renderQueue.push(e)}))},r.clearRect=function(t,e,r,n,o){t.clearRect(e,r,n,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,r,n,o))},r.renderDisplayObject=function(t,r){for(var n=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)n.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var i=t.nodeName;void 0===this.styleRendererFactoryCache[i]&&(this.styleRendererFactoryCache[i]=this.styleRendererFactory(i));var a=this.styleRendererFactoryCache[i];n.save();var c=t.getLocalPosition(),u=c[0],s=c[1],l=t.getLocalScale(),h=l[0],f=l[1],v=t.getLocalRotation(),d=e.getEuler(this.tmpVec3,v),p=d[0],y=d[2],g=Math.cos(p||y),m=Math.sin(p||y);n.transform(h*g,f*m,-h*m,f*g,u,s);var w=t.style.clipPath;if(w){n.save(),this.applyTransform(n,w.getLocalTransform()),void 0===this.pathGeneratorFactoryCache[w.nodeName]&&(this.pathGeneratorFactoryCache[w.nodeName]=this.pathGeneratorFactory(w.nodeName));var x=this.pathGeneratorFactoryCache[w.nodeName];x&&(this.useAnchor(n,w),n.beginPath(),x(n,w.parsedStyle),n.closePath()),n.restore(),n.clip()}n.save(),this.applyAttributesToContext(n,t,r),this.useAnchor(n,t),void 0===this.pathGeneratorFactoryCache[t.nodeName]&&(this.pathGeneratorFactoryCache[t.nodeName]=this.pathGeneratorFactory(t.nodeName));var E=this.pathGeneratorFactoryCache[t.nodeName];E&&(n.beginPath(),E(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),a&&a.render(n,t.parsedStyle,t),n.restore(),t.renderable.dirty=!1,this.restoreStack.push(t)},r.shouldClearFullScreen=function(){return!this.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering||this.renderingContext.renderReasons.has(e.RenderReason.CAMERA_CHANGED)},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),o=Math.floor(e[1]);return{x:n,y:o,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-o}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],o=r[1],i=t.getMax();return this.rBush.search({minX:n,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyTransform=function(t,r){var n=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}(Gt(),r),o=n[0],i=n[1],a=Ft(Gt(),r),c=a[0],u=a[1],s=function(t,e){var r=new _t(3);Ft(r,e);var n=1/r[0],o=1/r[1],i=1/r[2],a=e[0]*n,c=e[1]*o,u=e[2]*i,s=e[4]*n,l=e[5]*o,h=e[6]*i,f=e[8]*n,v=e[9]*o,d=e[10]*i,p=a+l+d,y=0;return p>0?(y=2*Math.sqrt(p+1),t[3]=.25*y,t[0]=(h-v)/y,t[1]=(f-u)/y,t[2]=(c-s)/y):a>l&&a>d?(y=2*Math.sqrt(1+a-l-d),t[3]=(h-v)/y,t[0]=.25*y,t[1]=(c+s)/y,t[2]=(f+u)/y):l>d?(y=2*Math.sqrt(1+l-a-d),t[3]=(f-u)/y,t[0]=(c+s)/y,t[1]=.25*y,t[2]=(h+v)/y):(y=2*Math.sqrt(1+d-a-l),t[3]=(c-s)/y,t[0]=(f+u)/y,t[1]=(h+v)/y,t[2]=.25*y),t}(Dt(),r),l=e.getEuler(Gt(),s),h=e.fromRotationTranslationScale(l[0]||l[2],o,i,c,u);t.transform(h[0],h[1],h[3],h[4],h[6],h[7])},r.getColor=function(t,r,n,o,i){var a;if(t instanceof e.CSSGradientValue){if(t.type===e.GradientPatternType.LinearGradient||t.type===e.GradientPatternType.RadialGradient){var c=n.getGeometryBounds();a=this.gradientPool.getOrCreateGradient(jt({type:t.type},t.value,{width:c&&2*c.halfExtents[0]||0,height:c&&2*c.halfExtents[1]||0}),o)}else if(t.type===e.GradientPatternType.Pattern){var u=this.imagePool.getPatternSync(t.value);u?a=u:this.imagePool.createPattern(t.value,o).then((function(){n.renderable.dirty=!0,i.dirtify()}))}}else a=n.attributes[r];return a},r.applyAttributesToContext=function(t,r,n){var o=r.parsedStyle,i=o.stroke,a=o.fill,c=o.opacity,u=o.lineDash,s=o.lineDashOffset,l=o.filter,h=o.shadowColor,f=o.shadowBlur,v=o.shadowOffsetX,d=o.shadowOffsetY;u&&Array.isArray(u)&&t.setLineDash(u.map((function(t){return t.value}))),e.isNil(s)||(t.lineDashOffset=s.value),e.isNil(c)||(t.globalAlpha*=c.value),e.isNil(i)||i.isNone||(t.strokeStyle=this.getColor(i,"stroke",r,t,n)),e.isNil(a)||a.isNone||(t.fillStyle=this.getColor(a,"fill",r,t,n)),e.isNil(l)||(t.filter=r.style.filter),e.isNil(h)||(t.shadowColor=h.toString(),t.shadowBlur=f&&f.value||0,t.shadowOffsetX=v&&v.value||0,t.shadowOffsetY=d&&d.value||0)},r.useAnchor=function(t,e){var r=(e.parsedStyle||{}).anchor;if(r&&(0!==r[0].value||0!==r[1].value)){var n=e.getGeometryBounds();if(n){var o=n.halfExtents;t.translate(-r[0].value*o[0]*2,-r[1].value*o[1]*2)}}},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return n.forEach((function(e){t.add(e)})),t},t}(),ye.tag="CanvasRenderer",ge=ye);y([e.inject(e.CanvasConfig),g("design:type",Object)],we.prototype,"canvasConfig",void 0),y([e.inject(e.DefaultCamera),g("design:type",e.Camera)],we.prototype,"camera",void 0),y([e.inject(e.ContextService),g("design:type",Object)],we.prototype,"contextService",void 0),y([e.inject(e.RenderingContext),g("design:type",Object)],we.prototype,"renderingContext",void 0),y([e.inject(Et),g("design:type",Et)],we.prototype,"imagePool",void 0),y([e.inject(Qt),g("design:type",Qt)],we.prototype,"gradientPool",void 0),y([e.inject(i),g("design:type",Function)],we.prototype,"pathGeneratorFactory",void 0),y([e.inject(Kt),g("design:type",Function)],we.prototype,"styleRendererFactory",void 0),y([e.inject(e.DisplayObjectPool),g("design:type",e.DisplayObjectPool)],we.prototype,"displayObjectPool",void 0),y([e.inject(e.RBushRoot),g("design:type",Function)],we.prototype,"rBush",void 0),we=ge=y([e.singleton({contrib:e.RenderingPluginContribution})],we);var xe,Ee,be=e.Module((function(t){var r;t(he),t(fe),t(le),t(ce),t(ue),t(ve),t(de),t(pe),t(me);var n=((r={})[e.Shape.CIRCLE]=Jt,r[e.Shape.ELLIPSE]=Zt,r[e.Shape.RECT]=te,r[e.Shape.IMAGE]=ae,r[e.Shape.TEXT]=ie,r[e.Shape.LINE]=ee,r[e.Shape.POLYLINE]=re,r[e.Shape.POLYGON]=ne,r[e.Shape.PATH]=oe,r);t({token:Kt,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(Qt),t(we)})),Le=function(){function t(){this.name="canvas-renderer"}var e=t.prototype;return e.init=function(t){t.load(be,!0)},e.destroy=function(t){t.unload(be)},t}();function Pe(){
10
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
11
+ Pe=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(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 b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(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),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function Se(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function ke(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Se(i,n,o,a,c,"next",t)}function c(t){Se(i,n,o,a,c,"throw",t)}a(void 0)}))}}var Ce=(xe=function(){function t(){this.contextService=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var e=this,r=this.renderingContext.root.ownerDocument.defaultView,n=function(e){t.hooks.pointerMove.call(e)},o=function(e){t.hooks.pointerUp.call(e)},i=function(e){t.hooks.pointerDown.call(e)},a=function(e){t.hooks.pointerOver.call(e)},c=function(e){t.hooks.pointerOut.call(e)},u=function(e){t.hooks.pointerCancel.call(e)},s=function(e){t.hooks.pointerWheel.call(e)},l=function(t){globalThis.document.addEventListener("pointermove",n,!0),t.addEventListener("pointerdown",i,!0),t.addEventListener("pointerleave",c,!0),t.addEventListener("pointerover",a,!0),globalThis.addEventListener("pointerup",o,!0)},h=function(t){t.addEventListener("touchstart",i,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",n,!0),t.addEventListener("touchcancel",u,!0)},f=function(t){globalThis.document.addEventListener("mousemove",n,!0),t.addEventListener("mousedown",i,!0),t.addEventListener("mouseout",c,!0),t.addEventListener("mouseover",a,!0),globalThis.addEventListener("mouseup",o,!0)};t.hooks.init.tapPromise(Ee.tag,ke(Pe().mark((function t(){var n;return Pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.contextService.getDomElement(),globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):r.supportsPointerEvents&&(n.style.touchAction="none"),r.supportsPointerEvents?l(n):f(n),r.supportsTouchEvents&&h(n),n.addEventListener("wheel",s,{passive:!0,capture:!0});case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(Ee.tag,(function(){var t=e.contextService.getDomElement();r.supportsPointerEvents?function(t){globalThis.document.removeEventListener("pointermove",n,!0),t.removeEventListener("pointerdown",i,!0),t.removeEventListener("pointerleave",c,!0),t.removeEventListener("pointerover",a,!0),globalThis.removeEventListener("pointerup",o,!0)}(t):function(t){globalThis.document.removeEventListener("mousemove",n,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",c,!0),t.removeEventListener("mouseover",a,!0),globalThis.removeEventListener("mouseup",o,!0)}(t),r.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",n,!0)}(t),t.removeEventListener("wheel",s,!0)}))},t}(),xe.tag="DOMInteraction",Ee=xe);y([e.inject(e.ContextService),g("design:type",Object)],Ce.prototype,"contextService",void 0),y([e.inject(e.RenderingContext),g("design:type",Object)],Ce.prototype,"renderingContext",void 0),Ce=Ee=y([e.singleton({contrib:e.RenderingPluginContribution})],Ce);var Oe,Ne,Te=e.Module((function(t){t(Ce)})),je=function(){function t(){this.name="dom-interaction"}var e=t.prototype;return e.init=function(t){t.load(Te,!0)},e.destroy=function(t){t.unload(Te)},t}();function Me(){
12
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
13
+ Me=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(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 b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(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),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function Ae(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _e(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ae(i,n,o,a,c,"next",t)}function c(t){Ae(i,n,o,a,c,"throw",t)}a(void 0)}))}}var Fe=(Oe=function(){function t(){this.contextService=void 0,this.renderingContext=void 0,this.canvasConfig=void 0,this.$camera=void 0}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getOrCreateEl(n),i=n.ownerDocument.documentElement.attributes;Object.keys(i).forEach((function(t){o.style[t]=i[t]})),Object.keys(n.attributes).forEach((function(t){r.updateAttribute(t,n)}))}},o=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getId(n),i=r.contextService.getDomElement().parentNode;if(i){var a=i.querySelector("#"+o);a&&i.removeChild(a)}}},i=function(t){var n=t.target;n.nodeName===e.Shape.HTML&&r.updateAttribute(t.attrName,n)};t.hooks.init.tapPromise(Ne.tag,_e(Me().mark((function t(){return Me().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,i);case 3:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(Ne.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,i)}))},r.getId=function(t){return t.id||"g-html-"+t.entity},r.getOrCreateEl=function(t){var e=this.canvasConfig.document,r=this.getId(t),n=this.contextService.getDomElement().parentNode;if(n){var o=n.querySelector("#"+r);if(!o){o=(e||document).createElement("div"),t.parsedStyle.$el=o,o.id=r,t.name&&o.setAttribute("name",t.name),t.className&&(o.className=t.className),n.appendChild(o),o.style.position="absolute",o.style.left="0",o.style.top="0",o.style["will-change"]="transform";var i=t.getWorldTransform();o.style.transform="matrix("+[i[0],i[1],i[4],i[5],i[12],i[13]].join(",")+")"}return o}return null},r.updateAttribute=function(t,r){var n=this.getOrCreateEl(r);switch(t){case"innerHTML":var o=r.parsedStyle.innerHTML;e.isString(o)?n.innerHTML=o:(n.innerHTML="",n.appendChild(o));break;case"modelMatrix":case"transformOrigin":var i=r.parsedStyle.transformOrigin;n.style["transform-origin"]=i[0].value+" "+i[1].value;var a=r.getWorldTransform();n.style.transform="matrix("+[a[0],a[1],a[4],a[5],a[12],a[13]].join(",")+")";break;case"width":var c=r.computedStyleMap().get("width");n.style.width=c.toString();break;case"height":var u=r.computedStyleMap().get("height");n.style.height=u.toString();break;case"zIndex":n.style["z-index"]=""+r.parsedStyle.zIndex.value;break;case"visibility":n.style.visibility=r.parsedStyle.visibility.value;break;case"pointerEvents":n.style.pointerEvents=r.parsedStyle.pointerEvents.value;break;case"opacity":n.style.opacity=""+r.parsedStyle.opacity.value;break;case"fill":var s=r.parsedStyle.fill,l="";if(s instanceof e.CSSRGB)l=s.toString();else if(s instanceof e.CSSGradientValue){if(s.type===e.GradientPatternType.LinearGradient)l="linear-gradient(to right, "+s.value.steps.map((function(t){return t[1]+" "+100*Number(t[0])+"%"})).join(",")+");"}n.style.background=l;break;case"stroke":n.style["border-color"]=r.parsedStyle.stroke.toString(),n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]=(r.parsedStyle.lineWidth.value||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=r.parsedStyle.filter}},t}(),Oe.tag="HTMLRendering",Ne=Oe);y([e.inject(e.ContextService),g("design:type",Object)],Fe.prototype,"contextService",void 0),y([e.inject(e.RenderingContext),g("design:type",Object)],Fe.prototype,"renderingContext",void 0),y([e.inject(e.CanvasConfig),g("design:type",Object)],Fe.prototype,"canvasConfig",void 0),Fe=Ne=y([e.singleton({contrib:e.RenderingPluginContribution})],Fe);var Ge=e.Module((function(t){t(Fe)})),Ie=function(){function t(){this.name="html-renderer"}var e=t.prototype;return e.init=function(t){t.load(Ge,!0)},e.destroy=function(t){t.unload(Ge)},t}(),Re=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var o=t.prototype;return o.init=function(){var t,o=(t=r().mark((function t(){var n,o,i,a,c,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(n=this.canvasConfig).container,a=n.devicePixelRatio,(i=n.canvas)?(this.$canvas=i,o&&i.parentElement!==o&&o.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container):o&&(this.$container=e.isString(o)?document.getElementById(o):o,this.$container&&(c=document.createElement("canvas"),this.$container.appendChild(c),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=c)),this.context=this.$canvas.getContext("2d"),u=1>(u=a||e.isBrowser&&window.devicePixelRatio||1)?1:Math.ceil(u),this.dpr=u,this.resize(this.canvasConfig.width,this.canvasConfig.height);case 7:case"end":return t.stop()}}),t,this)})),function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(){return o.apply(this,arguments)}}(),o.getContext=function(){return this.context},o.getDomElement=function(){return this.$canvas},o.getDPR=function(){return this.dpr},o.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},o.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},o.resize=function(t,r){if(this.$canvas){this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*r,e.setDOMSize(this.$canvas,t,r);var n=this.getDPR();this.context.scale(n,n)}},o.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t}();y([e.inject(e.CanvasConfig),g("design:type",Object)],Re.prototype,"canvasConfig",void 0),Re=y([e.singleton({token:e.ContextService})],Re);var Be=e.Module((function(t){t(Re)})),De=function(){function t(){this.name="canvas-context-register"}var e=t.prototype;return e.init=function(t){t.load(Be,!0)},e.destroy=function(t){t.unload(Be)},t}();t.Renderer=function(t){var e,r;function n(e){var r;return(r=t.call(this,e)||this).registerPlugin(new De),r.registerPlugin(new Ct),r.registerPlugin(new p),r.registerPlugin(new Le),r.registerPlugin(new je),r.registerPlugin(new xt),r.registerPlugin(new Ie),r}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,o(e,r),n}(e.AbstractRenderer),Object.defineProperty(t,"__esModule",{value:!0})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g-canvas",
3
- "version": "1.1.7",
3
+ "version": "1.1.8-alpha.2",
4
4
  "description": "A renderer implemented by Canvas 2D API",
5
5
  "keywords": [
6
6
  "antv",
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "author": "https://github.com/orgs/antvis/people",
21
+ "sideEffects": true,
21
22
  "main": "dist/index.js",
22
23
  "unpkg": "dist/index.umd.min.js",
23
24
  "module": "dist/index.esm.js",
@@ -29,10 +30,12 @@
29
30
  "README.md"
30
31
  ],
31
32
  "dependencies": {
32
- "@antv/g-plugin-canvas-picker": "^1.1.7",
33
- "@antv/g-plugin-canvas-renderer": "^1.1.7",
34
- "@antv/g-plugin-dom-interaction": "^1.1.7",
35
- "@antv/g-plugin-html-renderer": "^1.1.7",
33
+ "@antv/g-plugin-canvas-path-generator": "^0.0.1-alpha.1",
34
+ "@antv/g-plugin-canvas-picker": "^1.1.8-alpha.1",
35
+ "@antv/g-plugin-canvas-renderer": "^1.1.8-alpha.1",
36
+ "@antv/g-plugin-dom-interaction": "^1.1.8-alpha.1",
37
+ "@antv/g-plugin-html-renderer": "^1.1.8-alpha.1",
38
+ "@antv/g-plugin-image-loader": "^0.0.1-alpha.1",
36
39
  "tslib": "^2.3.1"
37
40
  },
38
41
  "devDependencies": {
@@ -40,11 +43,10 @@
40
43
  "@types/jest": "^25.0.0"
41
44
  },
42
45
  "peerDependencies": {
43
- "@antv/g": "^5.0.1",
44
- "mana-syringe": "^0.3.0"
46
+ "@antv/g": "^5.0.1"
45
47
  },
46
48
  "publishConfig": {
47
49
  "access": "public"
48
50
  },
49
- "gitHead": "1cc3651074e82fc185a7a65d01123706ab958f09"
51
+ "gitHead": "a57232cfdc74aaf0a9812feea28d5b7c8ca243a8"
50
52
  }