@antv/g-canvas 1.1.6 → 1.1.8-alpha.1

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.Canvas2D={}),t.window.G,t.window.G.ManaSyringe)}(this,(function(t,e,n){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function u(t,e){return u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},u(t,e)}function s(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function l(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=c(t);if(e){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}function h(t,e,n,r){var o,i=arguments.length,a=3>i?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--)(o=t[c])&&(a=(3>i?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function f(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function d(){
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.Canvas2D={}),t.window.G,t.window.G.ManaSyringe)}(this,(function(t,e,r){"use strict";function n(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3
- d=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,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new S(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return O()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=E(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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function f(){}function v(){}function p(){}var y={};u(y,i,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(L([])));m&&m!==e&&n.call(m,i)&&(y=m);var b=p.prototype=f.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(i,a,c,u){var s=l(t[i],t,a);if("throw"!==s.type){var h=s.arg,f=h.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,c,u)}),(function(t){o("throw",t,c,u)})):e.resolve(f).then((function(t){h.value=t,c(h)}),(function(t){return o("throw",t,c,u)}))}u(s.arg)}var i;this._invoke=function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}}function E(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,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 r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.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 k(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(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:O}}function O(){return{value:void 0,done:!0}}return v.prototype=p,u(b,"constructor",p),u(p,"constructor",v),v.displayName=u(p,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,p):(t.__proto__=p,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},x(w.prototype),u(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new w(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(b),u(b,c,"Generator"),u(b,i,(function(){return this})),u(b,"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=L,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(P),!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 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 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 n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(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 o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:L(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function v(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function p(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){v(i,r,o,a,c,"next",t)}function c(t){v(i,r,o,a,c,"throw",t)}a(void 0)}))}}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function m(t,e,n){return e&&g(t.prototype,e),n&&g(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var b,x,w=(b=function(){function t(){y(this,t),this.contextService=void 0,this.renderingContext=void 0}return m(t,[{key:"apply",value:function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView,r=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",r,!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",r,!0),t.addEventListener("touchcancel",u,!0)},f=function(t){globalThis.document.addEventListener("mousemove",r,!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(x.tag,p(d().mark((function t(){var r;return d().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?l(r):f(r),n.supportsTouchEvents&&h(r),r.addEventListener("wheel",s,{passive:!0,capture:!0});case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(x.tag,(function(){var t=e.contextService.getDomElement();n.supportsPointerEvents?function(t){globalThis.document.removeEventListener("pointermove",r,!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",r,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",c,!0),t.removeEventListener("mouseover",a,!0),globalThis.removeEventListener("mouseup",o,!0)}(t),n.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",r,!0)}(t),t.removeEventListener("wheel",s,!0)}))}}]),t}(),b.tag="DOMInteraction",x=b);h([n.inject(e.ContextService),f("design:type",Object)],w.prototype,"contextService",void 0),h([n.inject(e.RenderingContext),f("design:type",Object)],w.prototype,"renderingContext",void 0),w=x=h([n.singleton({contrib:e.RenderingPluginContribution})],w);var E=n.Module((function(t){t(w)})),k=function(){function t(){y(this,t),this.name="dom-interaction"}return m(t,[{key:"init",value:function(t){t.load(E,!0)}},{key:"destroy",value:function(t){t.unload(E)}}]),t}(),P=Object.freeze({__proto__:null,Plugin:k});function S(t,e,n,r,o){L(t,e,n||0,r||t.length-1,o||C)}function L(t,e,n,r,o){for(;r>n;){if(r-n>600){var i=r-n+1,a=e-n+1,c=Math.log(i),u=.5*Math.exp(2*c/3),s=.5*Math.sqrt(c*u*(i-u)/i)*(0>a-i/2?-1:1);L(t,e,Math.max(n,Math.floor(e-a*u/i+s)),Math.min(r,Math.floor(e+(i-a)*u/i+s)),o)}var l=t[e],h=n,f=r;for(O(t,n,e),o(t[r],l)>0&&O(t,n,r);f>h;){for(O(t,h,f),h++,f--;0>o(t[h],l);)h++;for(;o(t[f],l)>0;)f--}0===o(t[n],l)?O(t,n,f):O(t,++f,r),f>e||(n=f+1),e>f||(r=f-1)}}function O(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function C(t,e){return e>t?-1:t>e?1:0}class M{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(!F(t,e))return n;const r=this.toBBox,o=[];for(;e;){for(let i=0;e.children.length>i;i++){const a=e.children[i],c=e.leaf?r(a):a;F(t,c)&&(e.leaf?n.push(a):D(t,c)?this._all(a,n):o.push(a))}e=o.pop()}return n}collides(t){let e=this.data;if(!F(t,e))return!1;const n=[];for(;e;){for(let r=0;e.children.length>r;r++){const o=e.children[r],i=e.leaf?this.toBBox(o):o;if(F(t,i)){if(e.leaf||D(t,i))return!0;n.push(o)}}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=Y([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),o=[],i=[];let a,c,u;for(;n||o.length;){if(n||(n=o.pop(),c=o[o.length-1],a=i.pop(),u=!0),n.leaf){const r=T(t,n.children,e);if(-1!==r)return n.children.splice(r,1),o.push(n),this._condense(o),this}u||n.leaf||!D(n,r)?c?(a++,n=c.children[a],u=!1):n=null:(o.push(n),i.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 o=n-e+1;let i,a=this._maxEntries;if(a>=o)return i=Y(t.slice(e,n+1)),j(i,this.toBBox),i;r||(a=Math.ceil(o/Math.pow(a,(r=Math.ceil(Math.log(o)/Math.log(a)))-1))),i=Y([]),i.leaf=!1,i.height=r;const c=Math.ceil(o/a),u=c*Math.ceil(Math.sqrt(a));X(t,e,n,u,this.compareMinX);for(let o=e;n>=o;o+=u){const e=Math.min(o+u-1,n);X(t,o,e,c,this.compareMinY);for(let n=o;e>=n;n+=c){i.children.push(this._build(t,n,Math.min(n+c-1,e),r-1))}}return j(i,this.toBBox),i}_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 u=e.children[c],s=B(u),l=(Math.max((i=u).maxX,(o=t).maxX)-Math.min(i.minX,o.minX))*(Math.max(i.maxY,o.maxY)-Math.min(i.minY,o.minY))-s;a>l?(a=l,r=r>s?s:r,n=u):l===a&&r>s&&(r=s,n=u)}e=n||e.children[0]}var o,i;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),o=[],i=this._chooseSubtree(r,this.data,e,o);for(i.children.push(t),N(i,r);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)}_split(t,e){const n=t[e],r=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,r);const i=this._chooseSplitIndex(n,o,r),a=Y(n.children.splice(i,n.children.length-i));a.height=n.height,a.leaf=n.leaf,j(n,this.toBBox),j(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=Y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,j(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,o=1/0,i=1/0;for(let a=e;n-e>=a;a++){const e=A(t,0,a,this.toBBox),c=A(t,a,n,this.toBBox),u=G(e,c),s=B(e)+B(c);o>u?(o=u,r=a,i=i>s?s:i):u===o&&i>s&&(i=s,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:R,o=t.leaf?this.compareMinY:_,i=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,o)>i&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const o=this.toBBox,i=A(t,0,e,o),a=A(t,n-e,n,o);let c=I(i)+I(a);for(let r=e;n-e>r;r++){const e=t.children[r];N(i,t.leaf?o(e):e),c+=I(i)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];N(a,t.leaf?o(e):e),c+=I(a)}return c}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)N(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():j(t[n],this.toBBox)}}function T(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 j(t,e){A(t,0,t.children.length,e,t)}function A(t,e,n,r,o){o||(o=Y(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(let i=e;n>i;i++){const e=t.children[i];N(o,t.leaf?r(e):e)}return o}function N(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 R(t,e){return t.minX-e.minX}function _(t,e){return t.minY-e.minY}function B(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function I(t){return t.maxX-t.minX+(t.maxY-t.minY)}function G(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),o=Math.min(t.maxX,e.maxX),i=Math.min(t.maxY,e.maxY);return Math.max(0,o-n)*Math.max(0,i-r)}function D(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function F(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function Y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function X(t,e,n,r,o){const i=[e,n];for(;i.length;){if(r>=(n=i.pop())-(e=i.pop()))continue;const a=e+Math.ceil((n-e)/r/2)*r;S(t,a,e,n,o),i.push(e,a,a,n)}}function H(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function $(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?H(Object(n),!0).forEach((function(e){J(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function U(){
3
+ n=function(){return t};var t={},e=Object.prototype,r=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&&r.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 n(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&&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){s.value=t,a(s)}),(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 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 n=-1,o=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 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)&&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,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 o(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 i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}var a=r.Syringe.defineToken("PathGeneratorFactory"),c=r.Syringe.defineToken("PathGenerator");function u(t,e){var r=e.r;t.arc(r.value,r.value,r.value,0,2*Math.PI,!1)}function s(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 l(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 h(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 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.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 d(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 p=r.Module((function(t){t({token:{token:c,named:e.Shape.CIRCLE},useValue:u}),t({token:{token:c,named:e.Shape.ELLIPSE},useValue:s}),t({token:{token:c,named:e.Shape.RECT},useValue:d}),t({token:{token:c,named:e.Shape.LINE},useValue:l}),t({token:{token:c,named:e.Shape.POLYLINE},useValue:v}),t({token:{token:c,named:e.Shape.POLYGON},useValue:f}),t({token:{token:c,named:e.Shape.PATH},useValue:h}),t({token:a,useFactory:function(t){return function(e){return t.container.isBoundNamed(c,e)?t.container.getNamed(c,e):null}}})})),y=function(){function t(){this.name="canvas-path-generator"}var e=t.prototype;return e.init=function(t){t.load(p,!0)},e.destroy=function(t){t.unload(p)},t}();function g(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 m(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function w(){
4
4
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
5
- U=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,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new P(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return L()}for(n.method=o,n.arg=i;;){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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function f(){}function d(){}function v(){}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=v.prototype=f.prototype=Object.create(p);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function o(i,a,c,u){var s=l(t[i],t,a);if("throw"!==s.type){var h=s.arg,f=h.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,c,u)}),(function(t){o("throw",t,c,u)})):e.resolve(f).then((function(t){h.value=t,c(h)}),(function(t){return o("throw",t,c,u)}))}u(s.arg)}var i;this._invoke=function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}}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 o=r.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 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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,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:L}}function L(){return{value:void 0,done:!0}}return d.prototype=v,u(m,"constructor",v),u(v,"constructor",d),d.displayName=u(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,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(x.prototype),u(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new x(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(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 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,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(k),!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 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 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 n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(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 o=r.arg;k(n)}return o}}throw 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),h}},t}function W(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function q(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){W(i,r,o,a,c,"next",t)}function c(t){W(i,r,o,a,c,"throw",t)}a(void 0)}))}}function V(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Q(t,e,n){return e&&z(t.prototype,e),n&&z(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function J(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tt(t,e)}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Z(t)}function tt(t,e){return tt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},tt(t,e)}function et(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function nt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Z(t);if(e){var o=Z(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return et(this,n)}}function rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}(t,e)||it(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ot(t){return function(t){if(Array.isArray(t))return at(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||it(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function it(t,e){if(t){if("string"==typeof t)return at(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?at(t,e):void 0}}function at(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}var ct="undefined"!=typeof Float32Array?Float32Array:Array;function ut(t,e){var n=e[4],r=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(n,r,o),t[2]=Math.hypot(i,a,c),t}function st(){var t=new ct(3);return ct!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function lt(t,e,n){var r=new ct(3);return r[0]=t,r[1]=e,r[2]=n,r}function ht(t,e,n){var r=e[0],o=e[1],i=e[2],a=n[0],c=n[1],u=n[2];return t[0]=o*u-i*c,t[1]=i*a-r*u,t[2]=r*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 ft,dt=function(t){return Math.hypot(t[0],t[1],t[2])};ft=st();!function(){var t,e=(t=new ct(4),ct!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function vt(){var t=new ct(4);return ct!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function pt(t,e,n,r){var o,i,a,c,u,s=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>(i=s*d+l*v+h*p+f*y)&&(i=-i,d=-d,v=-v,p=-p,y=-y),1-i>1e-6?(a=Math.sin(o=Math.acos(i)),c=Math.sin((1-r)*o)/a,u=Math.sin(r*o)/a):(c=1-r,u=r),t[0]=c*s+u*d,t[1]=c*l+u*v,t[2]=c*h+u*p,t[3]=c*f+u*y,t}var yt,gt,mt,bt,xt,wt,Et,kt=function(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=n*n+r*r+o*o+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=o*a,t[3]=i*a,t},Pt=(yt=st(),gt=lt(1,0,0),mt=lt(0,1,0),bt=vt(),xt=vt(),wt=new ct(9),ct!=Float32Array&&(wt[1]=0,wt[2]=0,wt[3]=0,wt[5]=0,wt[6]=0,wt[7]=0),wt[0]=1,wt[4]=1,wt[8]=1,Et=wt,Q((function t(){V(this,t),this.aabb=void 0})));Pt.tag="c-canvas-rbush-node";var St=function(){function t(){V(this,t),this.gradientCache={}}return Q(t,[{key:"getOrCreateGradient",value:function(t,n){var r=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[r])return this.gradientCache[r];var f=null;if(o===e.GradientPatternType.LinearGradient)f=n.createLinearGradient(i*l,a*h,c*l,u*h);else if(o===e.GradientPatternType.RadialGradient){f=n.createRadialGradient(i*l,a*h,0,c*l,u*h,t.r1*(Math.sqrt(l*l+h*h)/2))}return f&&(s.forEach((function(t){var e,n=rt(t,2),r=n[1];null===(e=f)||void 0===e||e.addColorStop(Number(n[0]),r)})),this.gradientCache[r]=f),this.gradientCache[r]}},{key:"generateCacheKey",value:function(t){var e=t.x0,n=t.y0,r=t.x1,o=t.y1,i=t.r1,a=t.steps,c=t.width,u=t.height;return"gradient-".concat(t.type,"-").concat(e,"-").concat(n,"-").concat(r,"-").concat(o,"-").concat(i||0,"-").concat(c,"-").concat(u,"-").concat(a.map((function(t){return t.join("")})).join("-"))}}]),t}();St=h([n.singleton()],St);var Lt=function(){function t(){V(this,t),this.imageCache={},this.patternCache={},this.canvasConfig=void 0}return Q(t,[{key:"getImageSync",value:function(t){return this.imageCache[t]}},{key:"getOrCreateImage",value:function(t){var n=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var r=this.canvasConfig.createImage;return new Promise((function(o,i){var a;r?a=r(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,n.imageCache[t]=a)}))}},{key:"getPatternSync",value:function(t){var e=this.generatePatternKey(t);if(this.patternCache[e])return this.patternCache[e]}},{key:"createPattern",value:function(t,e){var n=this;return this.getOrCreateImage(t.src).then((function(r){var o=n.generatePatternKey(t),i=e.createPattern(r,t.repetition);return i&&(n.patternCache[o]=i),n.patternCache[o]}))}},{key:"generatePatternKey",value:function(t){var e=t.repetition;return"pattern-".concat(t.src,"-").concat(e)}}]),t}();h([n.inject(e.CanvasConfig),f("design:type",Object)],Lt.prototype,"canvasConfig",void 0),Lt=h([n.singleton()],Lt);var Ot=n.Syringe.defineToken("PathGeneratorFactory"),Ct=n.Syringe.defineToken("PathGenerator"),Mt=n.Syringe.defineToken("StyleRendererFactory"),Tt=n.Syringe.defineToken("CircleRenderer",{multiple:!1}),jt=n.Syringe.defineToken("EllipseRenderer",{multiple:!1}),At=n.Syringe.defineToken("RectRenderer",{multiple:!1}),Nt=n.Syringe.defineToken("LineRenderer",{multiple:!1}),Rt=n.Syringe.defineToken("PolylineRenderer",{multiple:!1}),_t=n.Syringe.defineToken("PolygonRenderer",{multiple:!1}),Bt=n.Syringe.defineToken("PathRenderer",{multiple:!1}),It=n.Syringe.defineToken("TextRenderer",{multiple:!1}),Gt=n.Syringe.defineToken("ImageRenderer",{multiple:!1}),Dt=function(){function t(){V(this,t),this.imagePool=void 0}return Q(t,[{key:"hash",value:function(t){return""}},{key:"render",value:function(t,n){var r,o=n.img,i=n.width.value,a=n.height.value;if(e.isString(o)?r=this.imagePool.getImageSync(o):(i||(i=o.width),a||(a=o.height),r=o),r)try{t.drawImage(r,0,0,i,a)}catch(t){}}}]),t}();h([n.inject(Lt),f("design:type",Lt)],Dt.prototype,"imagePool",void 0),Dt=h([n.singleton({token:Gt})],Dt);var Ft=function(){function t(){V(this,t)}return Q(t,[{key:"hash",value:function(t){return""}},{key:"render",value:function(t,n,r){var o=n.lineWidth,i=n.textAlign,a=n.textBaseline,c=n.lineJoin,u=n.miterLimit,s=void 0===u?0:u,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,b=n.dy,x=g.lines,w=g.height,E=g.lineHeight,k=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=-w/2-E/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?P=-w:"top"!==a.value&&"hanging"!==a.value||(P=-E);var S=0;m&&m.unit===e.UnitType.kPixels&&(S+=m.value),b&&b.unit===e.UnitType.kPixels&&(P+=b.value);for(var L=0;x.length>L;L++){var O=o.value/2+S;P+=E,!e.isNil(f)&&!f.isNone&&o&&o.value&&this.drawLetterSpacing(t,x[L],k[L],i.value,O,P,h,v.value,p.value,y.value,!0),e.isNil(d)||this.drawLetterSpacing(t,x[L],k[L],i.value,O,P,h,v.value,p.value,y.value)}}},{key:"drawLetterSpacing",value:function(t,e,n,r,o,i,a,c,u,s){var l=arguments.length>10&&void 0!==arguments[10]&&arguments[10];if(0!==a){var h=t.textAlign;t.textAlign="left";var f=o;"center"===r?f=o-n.width/2:"right"!==r&&"end"!==r||(f=o-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,i,u):this.fillText(t,g,f,i,c,s),f+=v-(p=t.measureText(e.substring(y+1)).width)+a,v=p}t.textAlign=h}else l?this.strokeText(t,e,o,i,u):this.fillText(t,e,o,i,c,s)}},{key:"fillText",value:function(t,n,r,o,i,a){var c,u=!e.isNil(i)&&1!==i;u&&(c=t.globalAlpha,t.globalAlpha=i*a),t.fillText(n,r,o),u&&(t.globalAlpha=c)}},{key:"strokeText",value:function(t,n,r,o,i){var a,c=!e.isNil(i)&&1!==i;c&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(n,r,o),c&&(t.globalAlpha=a)}}]),t}();Ft=h([n.singleton({token:It})],Ft);var Yt=function(){function t(){V(this,t)}return Q(t,[{key:"hash",value:function(t){return""}},{key:"render",value:function(t,n){var r=n.fill,o=n.opacity,i=n.fillOpacity,a=n.stroke,c=n.strokeOpacity,u=n.lineWidth,s=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(i)||1===i.value?t.fill():(t.globalAlpha=i.value,t.fill(),t.globalAlpha=o.value)),p&&u&&u.value>0){var g,m,b;!e.isNil(c)&&1!==c.value&&(t.globalAlpha=c.value),t.lineWidth=u.value,e.isNil(d)||(t.miterLimit=d),e.isNil(s)||(t.lineCap=s.value),e.isNil(l)||(t.lineJoin=l.value);var x=!e.isNil(h),w=!e.isNil(f);x&&(m=t.shadowColor,e.isNil(g=t.shadowBlur)||(t.shadowColor="transparent",t.shadowBlur=0)),w&&!e.isNil(b=t.filter)&&b.indexOf("drop-shadow")>-1&&(t.filter=b.replace(/drop-shadow\([^)]*\)/,"").trim()||"none");var E=v&&!y;E&&t.stroke(),x&&(t.shadowColor=m,t.shadowBlur=g),w&&(t.filter=b),E||t.stroke()}}}]),t}(),Xt=function(t){K(n,t);var e=nt(n);function n(){return V(this,n),e.apply(this,arguments)}return Q(n)}(Yt=h([n.singleton()],Yt));Xt=h([n.singleton({token:At})],Xt);var Ht=function(t){K(n,t);var e=nt(n);function n(){return V(this,n),e.apply(this,arguments)}return Q(n)}(Yt);Ht=h([n.singleton({token:Tt})],Ht);var $t=function(t){K(n,t);var e=nt(n);function n(){return V(this,n),e.apply(this,arguments)}return Q(n)}(Yt);$t=h([n.singleton({token:jt})],$t);var Ut=function(t){K(n,t);var e=nt(n);function n(){return V(this,n),e.apply(this,arguments)}return Q(n)}(Yt);Ut=h([n.singleton({token:Nt})],Ut);var Wt=function(t){K(n,t);var e=nt(n);function n(){return V(this,n),e.apply(this,arguments)}return Q(n)}(Yt);Wt=h([n.singleton({token:Rt})],Wt);var qt=function(t){K(n,t);var e=nt(n);function n(){return V(this,n),e.apply(this,arguments)}return Q(n)}(Yt);qt=h([n.singleton({token:_t})],qt);var Vt,zt,Qt=function(t){K(n,t);var e=nt(n);function n(){return V(this,n),e.apply(this,arguments)}return Q(n)}(Yt);Qt=h([n.singleton({token:Bt})],Qt);var Jt,Kt,Zt="RBushRoot",te=(Vt=function(){function t(){V(this,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}return Q(t,[{key:"syncRTree",value: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 o=n.getRenderBounds();if(o){var i=rt(o.getMin(),2),a=i[0],c=i[1],u=rt(o.getMax(),2);r.aabb={id:n.entity,minX:a,minY:c,maxX:u[0],maxY:u[1]}}r.aabb&&e.push(r.aabb)})),this.rBush.load(e),this.toSync.clear()}},{key:"pushToSync",value:function(t){var e=this;t.forEach((function(t){e.toSync.add(t)}))}},{key:"apply",value:function(t){var n=this,r=function(t){t.target.rBushNode=new Pt,n.pushToSync(t.composedPath().slice(0,-2))},o=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))},i=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(zt.tag,q(U().mark((function t(){var a,c,u,s;return U().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,o),n.renderingContext.root.addEventListener(e.ElementEvent.BOUNDS_CHANGED,i),c=(a=n.canvasConfig).width,u=a.height,s=n.contextService.getContext(),n.clearRect(s,0,0,c,u);case 6:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(zt.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),n.renderingContext.root.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,i)})),t.hooks.beginFrame.tap(zt.tag,(function(){var t=n.contextService.getContext(),r=n.canvasConfig,o=r.width,i=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,o,i),n.applyTransform(t,n.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(zt.tag,(function(){n.syncRTree();var r=n.canvasConfig.renderer.getConfig(),o=r.enableDirtyRectangleRendering,i=r.enableDirtyRectangleRenderingDebug,a=n.contextService.getContext(),c=n.renderQueue;if(o){if(!n.clearFullScreen){var u=n.safeMergeAABB.apply(n,[n.mergeDirtyAABBs(n.renderQueue)].concat(ot(n.removedRBushNodeAABBs.map((function(t){var n=t.minX,r=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(lt(n,r,0),lt(o,i,0)),a})))));if(n.removedRBushNodeAABBs=[],e.AABB.isEmpty(u))return void(n.renderQueue=[]);var s=n.convertAABB2Rect(u),l=s.x,h=s.y,f=s.width,d=s.height;n.clearRect(a,l,h,f,d),a.beginPath(),a.rect(l,h,f,d),a.clip(),i&&(a.lineWidth=4,a.strokeStyle="rgba(".concat(255*Math.random(),", ").concat(255*Math.random(),", ").concat(255*Math.random(),", 1)"),a.strokeRect(l,h,f,d)),c=n.searchDirtyObjects(u)}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(zt.tag,(function(e){n.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering?n.renderQueue.push(e):e.isVisible()&&!e.isCulled()&&n.renderDisplayObject(e,t)}))}},{key:"clearRect",value:function(t,e,n,r,o){t.clearRect(e,n,r,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,n,r,o))}},{key:"flush",value: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}}},{key:"renderDisplayObject",value:function(t,n){for(var r=this,o=this.contextService.getContext(),i=this.restoreStack[this.restoreStack.length-1];i&&t.parentNode!==i;)o.restore(),this.restoreStack.pop(),i=this.restoreStack[this.restoreStack.length-1];var a=this.styleRendererFactory(t.nodeName),c=!1;if(this.enableBatch&&a){var u=a.hash(t.attributes);this.batchedStyleHash&&u!==this.batchedStyleHash&&this.flush(o,n),this.batchedStyleHash||(this.batchedStyleHash=u,this.batchedDisplayObject=t,c=!0)}o.save(),this.applyTransform(o,t.getLocalTransform());var s=t.style.clipPath;if(s){o.save(),this.applyTransform(o,s.getLocalTransform());var l=this.pathGeneratorFactory(s.nodeName);l&&this.useAnchor(o,s,(function(){o.beginPath(),l(o,s.parsedStyle),o.closePath()})),o.restore(),o.clip()}this.enableBatch||(o.save(),this.applyAttributesToContext(o,t,n)),this.useAnchor(o,t,(function(){var n=r.pathGeneratorFactory(t.nodeName);n&&(!c&&r.enableBatch||o.beginPath(),n(o,t.parsedStyle),r.enableBatch||t.nodeName===e.Shape.LINE||t.nodeName===e.Shape.PATH||t.nodeName===e.Shape.POLYLINE||o.closePath()),a&&!r.enableBatch&&a.render(o,t.parsedStyle,t)})),this.enableBatch||o.restore(),t.renderable.dirty=!1,this.restoreStack.push(t)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),o=Math.floor(e[1]);return{x:r,y:o,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-o}}},{key:"mergeDirtyAABBs",value: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}},{key:"searchDirtyObjects",value:function(t){var e=this,n=rt(t.getMin(),2),r=n[0],o=n[1],i=rt(t.getMax(),2);return this.rBush.search({minX:r,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))}},{key:"saveDirtyAABB",value: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)}},{key:"applyTransform",value:function(t,n){var r=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}(st(),n),o=rt(r,2),i=o[0],a=o[1],c=rt(ut(st(),n),2),u=c[0],s=c[1],l=function(t,e){var n=new ct(3);ut(n,e);var r=1/n[0],o=1/n[1],i=1/n[2],a=e[0]*r,c=e[1]*o,u=e[2]*i,s=e[4]*r,l=e[5]*o,h=e[6]*i,f=e[8]*r,d=e[9]*o,v=e[10]*i,p=a+l+v,y=0;return p>0?(t[3]=.25*(y=2*Math.sqrt(p+1)),t[0]=(h-d)/y,t[1]=(f-u)/y,t[2]=(c-s)/y):a>l&&a>v?(t[3]=(h-d)/(y=2*Math.sqrt(1+a-l-v)),t[0]=.25*y,t[1]=(c+s)/y,t[2]=(f+u)/y):l>v?(t[3]=(f-u)/(y=2*Math.sqrt(1+l-a-v)),t[0]=(c+s)/y,t[1]=.25*y,t[2]=(h+d)/y):(t[3]=(c-s)/(y=2*Math.sqrt(1+v-a-l)),t[0]=(f+u)/y,t[1]=(h+d)/y,t[2]=.25*y),t}(vt(),n),h=rt(e.getEuler(st(),l),3),f=e.fromRotationTranslationScale(h[0]||h[2],i,a,u,s);t.transform(f[0],f[1],f[3],f[4],f[6],f[7])}},{key:"getColor",value:function(t,n,r,o){var i;if(t instanceof e.CSSGradientValue){if(t.type===e.GradientPatternType.LinearGradient||t.type===e.GradientPatternType.RadialGradient){var a=n.getGeometryBounds(),c=a&&2*a.halfExtents[0]||0,u=a&&2*a.halfExtents[1]||0;i=this.gradientPool.getOrCreateGradient($($({type:t.type},t.value),{},{width:c,height:u}),r)}else if(t.type===e.GradientPatternType.Pattern){var s=this.imagePool.getPatternSync(t.value);s?i=s:this.imagePool.createPattern(t.value,r).then((function(){n.renderable.dirty=!0,o.dirtify()}))}}else i=""+t;return i}},{key:"applyAttributesToContext",value:function(t,n,r){var o=n.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,d=o.shadowOffsetX,v=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,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,t.shadowBlur=f&&f.value||0,t.shadowOffsetX=d&&d.value||0,t.shadowOffsetY=v&&v.value||0)}},{key:"useAnchor",value:function(t,e,n){var r=e.getGeometryBounds();if(r){var o=r.halfExtents,i=(e.parsedStyle||{}).anchor;t.translate(-(i&&i[0].value||0)*o[0]*2,-(i&&i[1].value||0)*o[1]*2),n()}else n()}},{key:"safeMergeAABB",value:function(){for(var t=new e.AABB,n=arguments.length,r=Array(n),o=0;n>o;o++)r[o]=arguments[o];return r.forEach((function(e){t.add(e)})),t}}]),t}(),Vt.tag="CanvasRenderer",zt=Vt);h([n.inject(e.CanvasConfig),f("design:type",Object)],te.prototype,"canvasConfig",void 0),h([n.inject(e.DefaultCamera),f("design:type",e.Camera)],te.prototype,"camera",void 0),h([n.inject(e.ContextService),f("design:type",Object)],te.prototype,"contextService",void 0),h([n.inject(e.RenderingContext),f("design:type",Object)],te.prototype,"renderingContext",void 0),h([n.inject(Lt),f("design:type",Lt)],te.prototype,"imagePool",void 0),h([n.inject(St),f("design:type",St)],te.prototype,"gradientPool",void 0),h([n.inject(Ot),f("design:type",Function)],te.prototype,"pathGeneratorFactory",void 0),h([n.inject(Mt),f("design:type",Function)],te.prototype,"styleRendererFactory",void 0),h([n.inject(e.DisplayObjectPool),f("design:type",e.DisplayObjectPool)],te.prototype,"displayObjectPool",void 0),h([n.inject(Zt),f("design:type",M)],te.prototype,"rBush",void 0),te=zt=h([n.singleton({contrib:e.RenderingPluginContribution})],te);var ee=(Jt=function(){function t(){V(this,t),this.imagePool=void 0,this.renderingContext=void 0}return Q(t,[{key:"apply",value:function(t){var n=this,r=function(r){var o=r.target;if(o.nodeName===e.Shape.IMAGE){var i=o.attributes.img;e.isString(i)&&n.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))}},o=function(r){var o=r.target,i=r.newValue;o.nodeName===e.Shape.IMAGE&&"img"===r.attrName&&e.isString(i)&&n.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(Kt.tag,q(U().mark((function t(){return U().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,o);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(Kt.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))}}]),t}(),Jt.tag="LoadImage",Kt=Jt);h([n.inject(Lt),f("design:type",Lt)],ee.prototype,"imagePool",void 0),h([n.inject(e.RenderingContext),f("design:type",Object)],ee.prototype,"renderingContext",void 0),ee=Kt=h([n.singleton({contrib:e.RenderingPluginContribution})],ee),n.GlobalContainer.register({token:{token:Ct,named:e.Shape.CIRCLE},useValue:function(t,e){var n=e.r;t.arc(n.value,n.value,n.value,0,2*Math.PI,!1)}}),n.GlobalContainer.register({token:{token:Ct,named:e.Shape.ELLIPSE},useValue:function(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 o=n>r?n:r,i=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI)}}}),n.GlobalContainer.register({token:{token:Ct,named:e.Shape.RECT},useValue:function(t,e){var n=e.radius,r=e.width.value,o=e.height.value;if(n&&n.some((function(t){return 0!==t.value}))){var i=rt(n.map((function(t){return t.value})),4),a=i[0],c=i[1],u=i[2],s=i[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,o-u),0!==u&&t.arc(r-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,r,o)}}),n.GlobalContainer.register({token:{token:Ct,named:e.Shape.LINE},useValue:function(t,e){var n=e.x2,r=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(n.value-i,r.value-c)}}),n.GlobalContainer.register({token:{token:Ct,named:e.Shape.POLYLINE},useValue:function(t,e){var n=e.defX,r=void 0===n?0:n,o=e.defY,i=void 0===o?0:o,a=e.points.points,c=a.length,u=a[c-1][0]-r,s=a[c-1][1]-i;t.moveTo(a[0][0]-r,a[0][1]-i);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-r,h[1]-i)}t.lineTo(u,s)}}),n.GlobalContainer.register({token:{token:Ct,named:e.Shape.POLYGON},useValue:function(t,e){var n=e.defX,r=void 0===n?0:n,o=e.defY,i=void 0===o?0:o,a=e.points.points,c=a.length,u=a[c-1][0]-r,s=a[c-1][1]-i;t.moveTo(a[0][0]-r,a[0][1]-i);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-r,h[1]-i)}t.lineTo(u,s)}}),n.GlobalContainer.register({token:{token:Ct,named:e.Shape.PATH},useValue:function(t,e){var n=e.defX,r=void 0===n?0:n,o=e.defY,i=void 0===o?0:o,a=e.path,c=a.zCommandIndexes,u=ot(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]-r,l[2]-i);break;case"C":t.bezierCurveTo(l[1]-r,l[2]-i,l[3]-r,l[4]-i,l[5]-r,l[6]-i);break;case"Z":t.closePath()}}}}),n.GlobalContainer.register({token:Ot,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Ct,n)&&(e[n]=t.container.getNamed(Ct,n)),e[n]}}});var ne=n.Module((function(t){var n;t(Lt),t({token:Zt,useValue:new M}),t(Ht),t($t),t(Xt),t(Dt),t(Ft),t(Ut),t(Wt),t(qt),t(Qt);var r=(J(n={},e.Shape.CIRCLE,Tt),J(n,e.Shape.ELLIPSE,jt),J(n,e.Shape.RECT,At),J(n,e.Shape.IMAGE,Gt),J(n,e.Shape.TEXT,It),J(n,e.Shape.LINE,Nt),J(n,e.Shape.POLYLINE,Rt),J(n,e.Shape.POLYGON,_t),J(n,e.Shape.PATH,Bt),n);t({token:Mt,useFactory:function(t){var e={};return function(n){var o=r[n];return o&&!e[n]&&t.container.isBound(o)&&(e[n]=t.container.get(o)),e[n]}}}),t(St),t(te),t(ee)})),re=function(){function t(){V(this,t),this.name="canvas-renderer"}return Q(t,[{key:"init",value:function(t){t.load(ne,!0)}},{key:"destroy",value:function(t){t.unload(ne)}}]),t}(),oe=Object.freeze({__proto__:null,get CircleRenderer(){return Ht},CircleRendererContribution:Tt,get EllipseRenderer(){return $t},EllipseRendererContribution:jt,get ImageRenderer(){return Dt},ImageRendererContribution:Gt,get LineRenderer(){return Ut},LineRendererContribution:Nt,PathGenerator:Ct,PathGeneratorFactory:Ot,get PathRenderer(){return Qt},PathRendererContribution:Bt,Plugin:re,get PolygonRenderer(){return qt},PolygonRendererContribution:_t,get PolylineRenderer(){return Wt},PolylineRendererContribution:Rt,RBushNode:Pt,RBushRoot:Zt,get RectRenderer(){return Xt},RectRendererContribution:At,StyleRendererFactory:Mt,get TextRenderer(){return Ft},TextRendererContribution:It,RBush:M});function ie(){
5
+ w=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 m(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}},m(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()}))},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=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 x(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 E="undefined"!=typeof Float32Array?Float32Array:Array;function b(){var t=new E(9);return E!=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 L(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 P(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 S(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 k(){var t=new E(16);return E!=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 C(){var t=new E(3);return E!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function O(t,e,r){var n=new E(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 N;N=C();function T(t,e){var r=new E(2);return r[0]=t,r[1]=e,r}function j(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 E(2),E!=Float32Array&&(t[0]=0,t[1]=0),t)}();var M,A,_=r.Syringe.defineToken("PointInPathPicker"),F=(M=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,S,N,T,j,M,A,_,F,G,I,R,B=t.pointInPathPickerFactory(r.nodeName);if(B){var D=(i=k(),(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]))+(S=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*S-w*j-b*P)*R,i[7]=(p*j-g*S+m*P)*R,i[8]=(h*G-f*_+d*M)*R,i[9]=(u*_-c*G-l*M)*R,i[10]=(w*T-x*S+b*L)*R,i[11]=(y*S-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}(C(),O(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(A.tag,function(){var t,r=(t=w().mark((function t(r){var n,o,i,a,c,u,s,l,h,f,v,d,p;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.topmost,i=O((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=k(),g=p,m=v.getLocalTransform(),w=void 0,x=void 0,E=void 0,b=void 0,L=void 0,P=void 0,S=void 0,C=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],S=g[6],C=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*S+B*j+D*F,y[3]=I*b+R*C+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*S+B*j+D*F,y[7]=I*b+R*C+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*S+B*j+D*F,y[11]=I*b+R*C+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*S+B*j+D*F,y[15]=I*b+R*C+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,S,C,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){x(i,n,o,a,c,"next",t)}function c(t){x(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}())},t}(),M.tag="CanvasPicker",A=M);function G(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function I(t,e){return.001>Math.abs(t-e)}function R(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 B(t){return(t+2*Math.PI)%(2*Math.PI)}g([r.inject(e.DisplayObjectPool),m("design:type",e.DisplayObjectPool)],F.prototype,"displayObjectPool",void 0),g([r.inject(e.CanvasConfig),m("design:type",Object)],F.prototype,"canvasConfig",void 0),g([r.inject(e.OffscreenCanvasCreator),m("design:type",e.OffscreenCanvasCreator)],F.prototype,"offscreenCanvas",void 0),g([r.inject(e.RBushRoot),m("design:type",e.RBush)],F.prototype,"rBush",void 0),g([r.inject(a),m("design:type",Function)],F.prototype,"pathGeneratorFactory",void 0),g([r.inject(_),m("design:type",Function)],F.prototype,"pointInPathPickerFactory",void 0),F=A=g([r.singleton({contrib:e.RenderingPluginContribution})],F);var D=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},Y=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 $(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=G(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=G(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=G(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 W(t,e,r,n){var o=1-n;return o*o*t+2*n*o*e+n*n*r}function H(t,e,r){var n=t+r-2*e;if(I(n,0))return[.5];var o=(t-e)/n;return o>1||0>o?[]:[o]}function U(t,e,r,n){return 2*(1-n)*(e-t)+2*n*(r-e)}function X(t,e,r,n,o,i,a){var c=W(t,r,o,a),u=W(e,n,i,a),s=D(t,e,r,n,a),l=D(r,n,o,i,a);return[[t,e,s.x,s.y,c,u],[c,u,l.x,l.y,o,i]]}function q(t,e,r,n,o,i,a){if(0===a)return(G(t,e,r,n)+G(r,n,o,i)+G(t,e,o,i))/2;var c=X(t,e,r,n,o,i,.5),u=c[0],s=c[1];return u.push(a-1),s.push(a-1),q.apply(void 0,u)+q.apply(void 0,s)}var V={box:function(t,e,r,n,o,i){var a=H(t,r,o)[0],c=H(e,n,i)[0],u=[t,o],s=[e,i];return void 0!==a&&u.push(W(t,r,o,a)),void 0!==c&&s.push(W(e,n,i,c)),R(u,s)},length:function(t,e,r,n,o,i){return q(t,e,r,n,o,i,3)},nearestPoint:function(t,e,r,n,o,i,a,c){return $([t,r,o],[e,n,i],a,c,W)},pointDistance:function(t,e,r,n,o,i,a,c){var u=this.nearestPoint(t,e,r,n,o,i,a,c);return G(u.x,u.y,a,c)},interpolationAt:W,pointAt:function(t,e,r,n,o,i,a){return{x:W(t,r,o,a),y:W(e,n,i,a)}},divide:function(t,e,r,n,o,i,a){return X(t,e,r,n,o,i,a)},tangentAngle:function(t,e,r,n,o,i,a){var c=U(t,r,o,a),u=U(e,n,i,a);return B(Math.atan2(u,c))}};function z(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 Q(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 K(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(I(c,0))I(u,0)||0>(o=-s/u)||o>1||l.push(o);else{var h=u*u-4*c*s;I(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 J(t,e,r,n,o,i,a,c,u){var s=z(t,r,o,a,u),l=z(e,n,i,c,u),h=D(t,e,r,n,u),f=D(r,n,o,i,u),v=D(o,i,a,c,u),d=D(h.x,h.y,f.x,f.y,u),p=D(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 Z(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+=G(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=J(t,e,r,n,o,i,a,c,.5),l=[].concat(s[0],[u-1]),h=[].concat(s[1],[u-1]);return Z.apply(void 0,l)+Z.apply(void 0,h)}var tt={extrema:K,box:function(t,e,r,n,o,i,a,c){for(var u=[t,a],s=[e,c],l=K(t,r,o,a),h=K(e,n,i,c),f=0;l.length>f;f++)u.push(z(t,r,o,a,l[f]));for(var v=0;h.length>v;v++)s.push(z(e,n,i,c,h[v]));return R(u,s)},length:function(t,e,r,n,o,i,a,c){return Z(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,u,s,l){return $([t,r,o,a],[e,n,i,c],u,s,z,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 G(h.x,h.y,u,s)},interpolationAt:z,pointAt:function(t,e,r,n,o,i,a,c,u){return{x:z(t,r,o,a,u),y:z(e,n,i,c,u)}},divide:function(t,e,r,n,o,i,a,c,u){return J(t,e,r,n,o,i,a,c,u)},tangentAngle:function(t,e,r,n,o,i,a,c,u){var s=Q(t,r,o,a,u),l=Q(e,n,i,c,u);return B(Math.atan2(l,s))}};function et(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function rt(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function nt(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 et(s.x,s.y,a,c)<=i/2}function ot(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)&&Y(t,e,r,n,i,a)<=o/2}function it(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(ot(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(ot(c[0],c[1],u[0],u[1],e,r,n))return!0}return!1}function at(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function ct(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 ut(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(ct(a,c,[e,r]))return!0;at(a[1]-r)>0!=at(c[1]-r)>0&&0>at(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function st(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=ut(t[o],e,r))break}return n}function lt(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=et(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 ht(t,e,r,n){return t/(r*r)+e/(n*n)}function ft(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>=ht(d,p,h+v,f+v):s?1>=ht(d,p,h,f):!!l&&(ht(d,p,h-v,f-v)>=1&&1>=ht(d,p,h+v,f+v))}function vt(t,e){var r=t.parsedStyle,n=r.defX,o=r.defY;return ot(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 dt(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)&&it(r.points.points,o.value+r.increasedLineWidthForHitTesting.value,e.x+(void 0===i?0:i),e.y+(void 0===a?0:a),!1)}function pt(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||rt(y.x-l,y.y-l,y.width+e,y.height+e,r,n)){switch(f.command){case"L":case"Z":s=ot(p[0],p[1],v[0],v[1],e,r,n);break;case"Q":s=e/2>=V.pointDistance(p[0],p[1],d[1],d[2],d[3],d[4],r,n);break;case"C":s=e/2>=tt.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,E=g.endAngle,k=g.xRotation,C=m>w?m:w,O=m>w?1:m/w,N=m>w?w/m:1,M=(u=[-g.cx,-g.cy],(c=b())[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);L(M,P(b(),-k),M),L(M,S(b(),[1/O,1/N]),M);var A=T(r,n);s=nt(0,0,C,x,E,e,(A=j(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):st(p,e.x+c,e.y+s)||st(d,e.x+c,e.y+s)),g}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 ot(t+u,e,t+r-s,e,i,a,c)||ot(t+r,e+s,t+r,e+n-l,i,a,c)||ot(t+r-l,e+n,t+h,e+n,i,a,c)||ot(t,e+n-h,t,e+u,i,a,c)||nt(t+r-s,e+s,s,1.5*Math.PI,2*Math.PI,i,a,c)||nt(t+r-l,e+n-l,l,0,.5*Math.PI,i,a,c)||nt(t+h,e+n-h,h,.5*Math.PI,Math.PI,i,a,c)||nt(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?rt(0-L,0-L,w+L,x+L,r.x,r.y):d?rt(0,0,w,x,r.x,r.y):!!p&&function(t,e,r,n,o,i,a){var c=o/2;return rt(t-c,e-c,r,o,i,a)||rt(t+r-c,e-c,o,n,i,a)||rt(t+c,e+n-c,r,o,i,a)||rt(t-c,e+c,o,n,i,a)}(0,0,w,x,E,r.x,r.y)}function gt(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=it(i.points,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+c,e.y+s,!0)),v||!f&&!h||(v=ut(i.points,e.x+c,e.y+s)),v}var mt,wt,xt=r.Module((function(t){t({token:_,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?lt:t===e.Shape.ELLIPSE?ft:t===e.Shape.RECT?yt:t===e.Shape.LINE?vt:t===e.Shape.POLYLINE?dt:t===e.Shape.POLYGON?gt:t===e.Shape.PATH?pt:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(F)})),Et=function(){function t(){this.name="canvas-picker"}var e=t.prototype;return e.init=function(t){t.load(xt,!0)},e.destroy=function(t){t.unload(xt)},t}(),bt=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 Lt(){
6
6
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
7
- ie=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,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new P(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return L()}for(n.method=o,n.arg=i;;){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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function f(){}function d(){}function v(){}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=v.prototype=f.prototype=Object.create(p);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function o(i,a,c,u){var s=l(t[i],t,a);if("throw"!==s.type){var h=s.arg,f=h.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,c,u)}),(function(t){o("throw",t,c,u)})):e.resolve(f).then((function(t){h.value=t,c(h)}),(function(t){return o("throw",t,c,u)}))}u(s.arg)}var i;this._invoke=function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}}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 o=r.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 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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,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:L}}function L(){return{value:void 0,done:!0}}return d.prototype=v,u(m,"constructor",v),u(v,"constructor",d),d.displayName=u(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,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(x.prototype),u(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new x(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(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 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,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(k),!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 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 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 n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(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 o=r.arg;k(n)}return o}}throw 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),h}},t}function ae(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function ce(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ue(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function se(t,e,n){return e&&ue(t.prototype,e),n&&ue(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function le(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return he(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return he(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}var fe="undefined"!=typeof Float32Array?Float32Array:Array;function de(){var t=new fe(9);return fe!=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 ve(t,e,n){var r=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=n[0],d=n[1],v=n[2],p=n[3],y=n[4],g=n[5],m=n[6],b=n[7],x=n[8];return t[0]=f*r+d*a+v*s,t[1]=f*o+d*c+v*l,t[2]=f*i+d*u+v*h,t[3]=p*r+y*a+g*s,t[4]=p*o+y*c+g*l,t[5]=p*i+y*u+g*h,t[6]=m*r+b*a+x*s,t[7]=m*o+b*c+x*l,t[8]=m*i+b*u+x*h,t}function pe(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 ye(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 ge(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 me(){var t=new fe(16);return fe!=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 be(t,e,n){var r=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=e[9],d=e[10],v=e[11],p=e[12],y=e[13],g=e[14],m=e[15],b=n[0],x=n[1],w=n[2],E=n[3];return t[0]=b*r+x*c+w*h+E*p,t[1]=b*o+x*u+w*f+E*y,t[2]=b*i+x*s+w*d+E*g,t[3]=b*a+x*l+w*v+E*m,t[4]=(b=n[4])*r+(x=n[5])*c+(w=n[6])*h+(E=n[7])*p,t[5]=b*o+x*u+w*f+E*y,t[6]=b*i+x*s+w*d+E*g,t[7]=b*a+x*l+w*v+E*m,t[8]=(b=n[8])*r+(x=n[9])*c+(w=n[10])*h+(E=n[11])*p,t[9]=b*o+x*u+w*f+E*y,t[10]=b*i+x*s+w*d+E*g,t[11]=b*a+x*l+w*v+E*m,t[12]=(b=n[12])*r+(x=n[13])*c+(w=n[14])*h+(E=n[15])*p,t[13]=b*o+x*u+w*f+E*y,t[14]=b*i+x*s+w*d+E*g,t[15]=b*a+x*l+w*v+E*m,t}function xe(){var t=new fe(3);return fe!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function we(t,e,n){var r=new fe(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=xe()}();function Ee(t,e){var n=new fe(2);return n[0]=t,n[1]=e,n}function ke(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[3]*o+n[6],t[1]=n[1]*r+n[4]*o+n[7],t}!function(){var t=function(){var t=new fe(2);return fe!=Float32Array&&(t[0]=0,t[1]=0),t}()}();var Pe,Se,Le=n.Syringe.defineToken("PointInPathPicker"),Oe=(Pe=function(){function t(){var n=this;ce(this,t),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(t,r,o){var i=n.pointInPathPickerFactory(t.nodeName);if(i){var a=function(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=e[4],c=e[5],u=e[6],s=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,b=n*u-o*a,x=n*s-i*a,w=r*u-o*c,E=r*s-i*c,k=o*s-i*u,P=l*p-h*v,S=l*y-f*v,L=l*g-d*v,O=h*y-f*p,C=h*g-d*p,M=f*g-d*y,T=m*M-b*C+x*O+w*L-E*S+k*P;return T?(t[0]=(c*M-u*C+s*O)*(T=1/T),t[1]=(o*C-r*M-i*O)*T,t[2]=(p*k-y*E+g*w)*T,t[3]=(f*E-h*k-d*w)*T,t[4]=(u*L-a*M-s*S)*T,t[5]=(n*M-o*L+i*S)*T,t[6]=(y*x-v*k-g*b)*T,t[7]=(l*k-f*x+d*b)*T,t[8]=(a*C-c*L+s*P)*T,t[9]=(r*L-n*C-i*P)*T,t[10]=(v*E-p*x+g*m)*T,t[11]=(h*x-l*E-d*m)*T,t[12]=(c*S-a*O-u*P)*T,t[13]=(n*O-r*S+o*P)*T,t[14]=(p*b-v*w-y*m)*T,t[15]=(l*w-h*b+f*m)*T,t):null}(me(),o),c=function(t,e,n){var r=e[0],o=e[1],i=e[2],a=n[3]*r+n[7]*o+n[11]*i+n[15];return t[0]=(n[0]*r+n[4]*o+n[8]*i+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*o+n[9]*i+n[13])/a,t[2]=(n[2]*r+n[6]*o+n[10]*i+n[14])/a,t}(xe(),we(r[0],r[1],0),a),u=t.getGeometryBounds().halfExtents,s=t.parsedStyle.anchor;if(c[0]+=(s&&s[0].value||0)*u[0]*2,c[1]+=(s&&s[1].value||0)*u[1]*2,i(t,new e.Point(c[0],c[1]),n.isPointInPath))return!0}return!1},this.isPointInPath=function(t,e){var r=n.offscreenCanvas.getOrCreateContext(n.canvasConfig.offscreenCanvas),o=n.pathGeneratorFactory(t.nodeName);return o&&o(r,t.parsedStyle),r.isPointInPath(e.x,e.y)}}return se(t,[{key:"apply",value:function(t){var e=this;t.hooks.pick.tapPromise(Se.tag,function(){var t,n=(t=ie().mark((function t(n){var r,o,i,a,c,u,s,l,h,f,d,v,p;return ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.topmost,i=we((o=n.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 n=e.displayObjectPool.getByEntity(t.id);if(n.isVisible()&&!n.isCulled()&&n.isInteractive()){if(n.parentNode&&-1===c.indexOf(n.parentNode.entity))return;u.push(n)}})),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(v=(d=(f=h[l]).parsedStyle.clipPath)||f,p=f.getWorldTransform(),d&&(p=be(me(),p,d.getLocalTransform())),!e.isHit(v,i,p)){t.next=22;break}if(!r){t.next=21;break}return n.picked=[f],t.abrupt("return",n);case 21:s.push(f);case 22:l++,t.next=9;break;case 25:return n.picked=s,t.abrupt("return",n);case 27:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){ae(i,r,o,a,c,"next",t)}function c(t){ae(i,r,o,a,c,"throw",t)}a(void 0)}))});return function(t){return n.apply(this,arguments)}}())}}]),t}(),Pe.tag="CanvasPicker",Se=Pe);function Ce(t){return function(t){if(Array.isArray(t))return Me(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Me(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Me(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Me(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function Te(t,e,n,r){var o=t-n,i=e-r;return Math.sqrt(o*o+i*i)}function je(t,e){return.001>Math.abs(t-e)}function Ae(t,e){var n=Math.min.apply(Math,Ce(t)),r=Math.min.apply(Math,Ce(e));return{x:n,y:r,width:Math.max.apply(Math,Ce(t))-n,height:Math.max.apply(Math,Ce(e))-r}}function Ne(t){return(t+2*Math.PI)%(2*Math.PI)}h([n.inject(e.DisplayObjectPool),f("design:type",e.DisplayObjectPool)],Oe.prototype,"displayObjectPool",void 0),h([n.inject(e.CanvasConfig),f("design:type",Object)],Oe.prototype,"canvasConfig",void 0),h([n.inject(e.OffscreenCanvasCreator),f("design:type",e.OffscreenCanvasCreator)],Oe.prototype,"offscreenCanvas",void 0),h([n.inject(Zt),f("design:type",M)],Oe.prototype,"rBush",void 0),h([n.inject(Ot),f("design:type",Function)],Oe.prototype,"pathGeneratorFactory",void 0),h([n.inject(Le),f("design:type",Function)],Oe.prototype,"pointInPathPickerFactory",void 0),Oe=Se=h([n.singleton({contrib:e.RenderingPluginContribution})],Oe);var Re=function(t,e,n,r,o){return{x:(1-o)*t+o*n,y:(1-o)*e+o*r}},_e=function(t,e,n,r,o,i){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((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],o=n*n+r*r;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 Be(t,e,n,r,o,i){var a=-1,c=1/0,u=[n,r],s=20;i&&i>200&&(s=i/10);for(var l=1/s,h=l/10,f=0;s>=f;f++){var d=f*l,v=[o.apply(void 0,Ce(t.concat([d]))),o.apply(void 0,Ce(e.concat([d])))],p=Te(u[0],u[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,b=a+h,x=[o.apply(void 0,Ce(t.concat([m]))),o.apply(void 0,Ce(e.concat([m])))],w=Te(u[0],u[1],x[0],x[1]);if(m>=0&&c>w)a=m,c=w;else{var E=[o.apply(void 0,Ce(t.concat([b]))),o.apply(void 0,Ce(e.concat([b])))],k=Te(u[0],u[1],E[0],E[1]);1>=b&&c>k?(a=b,c=k):h*=.5}}return{x:o.apply(void 0,Ce(t.concat([a]))),y:o.apply(void 0,Ce(e.concat([a])))}}function Ie(t,e,n,r){var o=1-r;return o*o*t+2*r*o*e+r*r*n}function Ge(t,e,n){var r=t+n-2*e;if(je(r,0))return[.5];var o=(t-e)/r;return o>1||0>o?[]:[o]}function De(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function Fe(t,e,n,r,o,i,a){var c=Ie(t,n,o,a),u=Ie(e,r,i,a),s=Re(t,e,n,r,a),l=Re(n,r,o,i,a);return[[t,e,s.x,s.y,c,u],[c,u,l.x,l.y,o,i]]}function Ye(t,e,n,r,o,i,a){if(0===a)return(Te(t,e,n,r)+Te(n,r,o,i)+Te(t,e,o,i))/2;var c=Fe(t,e,n,r,o,i,.5),u=c[0],s=c[1];return u.push(a-1),s.push(a-1),Ye.apply(void 0,Ce(u))+Ye.apply(void 0,Ce(s))}var Xe={box:function(t,e,n,r,o,i){var a=Ge(t,n,o)[0],c=Ge(e,r,i)[0],u=[t,o],s=[e,i];return void 0!==a&&u.push(Ie(t,n,o,a)),void 0!==c&&s.push(Ie(e,r,i,c)),Ae(u,s)},length:function(t,e,n,r,o,i){return Ye(t,e,n,r,o,i,3)},nearestPoint:function(t,e,n,r,o,i,a,c){return Be([t,n,o],[e,r,i],a,c,Ie)},pointDistance:function(t,e,n,r,o,i,a,c){var u=this.nearestPoint(t,e,n,r,o,i,a,c);return Te(u.x,u.y,a,c)},interpolationAt:Ie,pointAt:function(t,e,n,r,o,i,a){return{x:Ie(t,n,o,a),y:Ie(e,r,i,a)}},divide:function(t,e,n,r,o,i,a){return Fe(t,e,n,r,o,i,a)},tangentAngle:function(t,e,n,r,o,i,a){var c=De(t,n,o,a),u=De(e,r,i,a);return Ne(Math.atan2(u,c))}};function He(t,e,n,r,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*n*o*o*i+r*o*o*o}function $e(t,e,n,r,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(n-e)+o*o*(r-n))}function Ue(t,e,n,r){var o,i,a,c=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,s=3*e-3*t,l=[];if(je(c,0))je(u,0)||0>(o=-s/u)||o>1||l.push(o);else{var h=u*u-4*c*s;je(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 We(t,e,n,r,o,i,a,c,u){var s=He(t,n,o,a,u),l=He(e,r,i,c,u),h=Re(t,e,n,r,u),f=Re(n,r,o,i,u),d=Re(o,i,a,c,u),v=Re(h.x,h.y,f.x,f.y,u),p=Re(f.x,f.y,d.x,d.y,u);return[[t,e,h.x,h.y,v.x,v.y,s,l],[s,l,p.x,p.y,d.x,d.y,a,c]]}function qe(t,e,n,r,o,i,a,c,u){if(0===u)return function(t,e){for(var n=0,r=t.length,o=0;r>o;o++)n+=Te(t[o],e[o],t[(o+1)%r],e[(o+1)%r]);return n/2}([t,n,o,a],[e,r,i,c]);var s=We(t,e,n,r,o,i,a,c,.5),l=[].concat(Ce(s[0]),[u-1]),h=[].concat(Ce(s[1]),[u-1]);return qe.apply(void 0,Ce(l))+qe.apply(void 0,Ce(h))}var Ve={extrema:Ue,box:function(t,e,n,r,o,i,a,c){for(var u=[t,a],s=[e,c],l=Ue(t,n,o,a),h=Ue(e,r,i,c),f=0;l.length>f;f++)u.push(He(t,n,o,a,l[f]));for(var d=0;h.length>d;d++)s.push(He(e,r,i,c,h[d]));return Ae(u,s)},length:function(t,e,n,r,o,i,a,c){return qe(t,e,n,r,o,i,a,c,3)},nearestPoint:function(t,e,n,r,o,i,a,c,u,s,l){return Be([t,n,o,a],[e,r,i,c],u,s,He,l)},pointDistance:function(t,e,n,r,o,i,a,c,u,s,l){var h=this.nearestPoint(t,e,n,r,o,i,a,c,u,s,l);return Te(h.x,h.y,u,s)},interpolationAt:He,pointAt:function(t,e,n,r,o,i,a,c,u){return{x:He(t,n,o,a,u),y:He(e,r,i,c,u)}},divide:function(t,e,n,r,o,i,a,c,u){return We(t,e,n,r,o,i,a,c,u)},tangentAngle:function(t,e,n,r,o,i,a,c,u){var s=$e(t,n,o,a,u),l=$e(e,r,i,c,u);return Ne(Math.atan2(l,s))}};function ze(t,e,n,r){var o=t-n,i=e-r;return Math.sqrt(o*o+i*i)}function Qe(t,e,n,r,o,i){return!(t>o||o>t+n||e>i||i>e+r)}function Je(t,e,n,r,o,i,a,c){var u=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(r>u||u>o)return!1;var s={x:t+n*Math.cos(u),y:e+n*Math.sin(u)};return ze(s.x,s.y,a,c)<=i/2}function Ke(t,e,n,r,o,i,a){var c=o/2;return!(Math.min(t,n)-c>i||i>Math.max(t,n)+c||Math.min(e,r)-c>a||a>Math.max(e,r)+c)&&_e(t,e,n,r,i,a)<=o/2}function Ze(t,e,n,r,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(Ke(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(o){var c=t[0],u=t[i-1];if(Ke(c[0],c[1],u[0],u[1],e,n,r))return!0}return!1}function tn(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function en(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 nn(t,e,n){var r=!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(en(a,c,[e,n]))return!0;tn(a[1]-n)>0!=tn(c[1]-n)>0&&0>tn(e-(n-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(r=!r)}return r}function rn(t,e,n){for(var r=!1,o=0;t.length>o;o++){if(r=nn(t[o],e,n))break}return r}function on(t,e){var n=t.parsedStyle,r=n.fill,o=n.stroke,i=n.lineWidth,a=n.clipPathTargets,c=n.r.value,u=(((null==i?void 0:i.value)||0)+n.increasedLineWidthForHitTesting.value)/2,s=ze(c,c,e.x,e.y),l=r&&!r.isNone,h=o&&!o.isNone;return l&&h||!!(null==a?void 0:a.length)?c+u>=s:l?c>=s:!!h&&(s>=c-u&&c+u>=s)}function an(t,e,n,r){return t/(n*n)+e/(r*r)}function cn(t,e){var n=e.x,r=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,d=(((null==c?void 0:c.value)||0)+o.increasedLineWidthForHitTesting.value)/2,v=(n-h)*(n-h),p=(r-f)*(r-f);return s&&l||!!(null==u?void 0:u.length)?1>=an(v,p,h+d,f+d):s?1>=an(v,p,h,f):!!l&&(an(v,p,h-d,f-d)>=1&&1>=an(v,p,h+d,f+d))}function un(t,e){var n=t.parsedStyle,r=n.defX,o=n.defY;return Ke(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===o?0:o))}function sn(t,e){var n=t.parsedStyle,r=n.stroke,o=n.lineWidth,i=n.defX,a=n.defY,c=n.clipPathTargets;return!((!r||r.isNone)&&!(null==c?void 0:c.length)||!o)&&Ze(n.points.points,o.value+n.increasedLineWidthForHitTesting.value,e.x+(void 0===i?0:i),e.y+(void 0===a?0:a),!1)}function ln(t,e,n){var r=t.parsedStyle,o=r.stroke,i=r.fill,a=r.defX,c=void 0===a?0:a,u=r.defY,s=void 0===u?0:u,l=r.clipPathTargets,h=r.path,f=i&&!i.isNone,d=h.hasArc,v=h.polylines,p=h.polygons,y=!!(null==l?void 0:l.length),g=!1;return(o&&!o.isNone||y)&&(g=function(t,e,n,r,o,i,a){for(var c=!1,u=e/2,s=0;t.length>s;s++){var l=t[s],h=l.currentPoint,f=l.params,d=l.prePoint,v=l.box;if(!v||Qe(v.x-u,v.y-u,v.width+e,v.height+e,n,r)){switch(l.command){case"L":case"Z":c=Ke(d[0],d[1],h[0],h[1],e,n,r);break;case"Q":c=e/2>=Xe.pointDistance(d[0],d[1],f[1],f[2],f[3],f[4],n,r);break;case"C":c=e/2>=Ve.pointDistance(d[0],d[1],f[1],f[2],f[3],f[4],f[5],f[6],n,r,o);break;case"A":var p=l.arcParams,y=p.cx,g=p.cy,m=p.rx,b=p.ry,x=p.startAngle,w=p.endAngle,E=p.xRotation,k=m>b?m:b,P=m>b?1:m/b,S=m>b?b/m:1,L=pe(de(),[-y,-g]);ve(L,ye(de(),-E),L),ve(L,ge(de(),[1/P,1/S]),L);var O=Ee(n,r);c=Je(0,0,k,x,w,e,(O=ke(O,O,L))[0],O[1])}if(c)break}}return c}(h.segments,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+c,e.y+s,h.totalLength)),g||!f&&!y||(g=d?n(t,e):rn(p,e.x+c,e.y+s)||rn(v,e.x+c,e.y+s)),g}function hn(t,n,r){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,d=!!(null==f?void 0:f.length),v=a&&!a.isNone,p=c&&!c.isNone,y=i&&i.some((function(t){return 0!==t.value})),g=l.unit,m=h.unit,b=0,x=0;g!==e.UnitType.kNumber&&g!==e.UnitType.kPixels||(b=l.value),m!==e.UnitType.kNumber&&m!==e.UnitType.kPixels||(x=h.value);var w=u.value+s.value;if(y){var E=!1;return(p||d)&&(E=function(t,e,n,r,o,i,a,c){var u=le(o,4),s=u[0],l=u[1],h=u[2],f=u[3];return Ke(t+s,e,t+n-l,e,i,a,c)||Ke(t+n,e+l,t+n,e+r-h,i,a,c)||Ke(t+n-h,e+r,t+f,e+r,i,a,c)||Ke(t,e+r-f,t,e+s,i,a,c)||Je(t+n-l,e+l,l,1.5*Math.PI,2*Math.PI,i,a,c)||Je(t+n-h,e+r-h,h,0,.5*Math.PI,i,a,c)||Je(t+f,e+r-f,f,.5*Math.PI,Math.PI,i,a,c)||Je(t+s,e+s,s,Math.PI,1.5*Math.PI,i,a,c)}(0,0,b,x,i.map((function(t){return t.value})),w,n.x,n.y)),E||!v&&!d||(E=r(t,n)),E}var k=w/2;return v&&p||d?Qe(0-k,0-k,b+k,x+k,n.x,n.y):v?Qe(0,0,b,x,n.x,n.y):!!p&&function(t,e,n,r,o,i,a){var c=o/2;return Qe(t-c,e-c,n,o,i,a)||Qe(t+n-c,e-c,o,r,i,a)||Qe(t+c,e+r-c,n,o,i,a)||Qe(t-c,e+c,o,r,i,a)}(0,0,b,x,w,n.x,n.y)}function fn(t,e){var n=t.parsedStyle,r=n.stroke,o=n.fill,i=n.points,a=n.defX,c=void 0===a?0:a,u=n.defY,s=void 0===u?0:u,l=n.clipPathTargets,h=!!(null==l?void 0:l.length),f=o&&!o.isNone,d=!1;return(r&&!r.isNone||h)&&(d=Ze(i.points,n.lineWidth.value+n.increasedLineWidthForHitTesting.value,e.x+c,e.y+s,!0)),d||!f&&!h||(d=nn(i.points,e.x+c,e.y+s)),d}var dn,vn,pn=n.Module((function(t){t({token:Le,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?on:t===e.Shape.ELLIPSE?cn:t===e.Shape.RECT?hn:t===e.Shape.LINE?un:t===e.Shape.POLYLINE?sn:t===e.Shape.POLYGON?fn:t===e.Shape.PATH?ln:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(Oe)})),yn=function(){function t(){ce(this,t),this.name="canvas-picker"}return se(t,[{key:"init",value:function(t){t.load(pn,!0)}},{key:"destroy",value:function(t){t.unload(pn)}}]),t}(),gn=Object.freeze({__proto__:null,Plugin:yn});function mn(){
7
+ Lt=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 Pt(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 St(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Pt(i,n,o,a,c,"next",t)}function c(t){Pt(i,n,o,a,c,"throw",t)}a(void 0)}))}}g([r.inject(e.CanvasConfig),m("design:type",Object)],bt.prototype,"canvasConfig",void 0),bt=g([r.singleton()],bt);var kt=(mt=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(wt.tag,St(Lt().mark((function t(){return Lt().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(wt.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},t}(),mt.tag="LoadImage",wt=mt);g([r.inject(bt),m("design:type",bt)],kt.prototype,"imagePool",void 0),g([r.inject(e.RenderingContext),m("design:type",Object)],kt.prototype,"renderingContext",void 0),kt=wt=g([r.singleton({contrib:e.RenderingPluginContribution})],kt);var Ct=r.Module((function(t){t(bt),t(kt)})),Ot=function(){function t(){this.name="image-loader"}var e=t.prototype;return e.init=function(t){t.load(Ct,!0)},e.destroy=function(t){t.unload(Ct)},t}();function Nt(){
8
8
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
9
- mn=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,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new P(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return L()}for(n.method=o,n.arg=i;;){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 u=l(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function f(){}function d(){}function v(){}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=v.prototype=f.prototype=Object.create(p);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function o(i,a,c,u){var s=l(t[i],t,a);if("throw"!==s.type){var h=s.arg,f=h.value;return f&&"object"==r(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,c,u)}),(function(t){o("throw",t,c,u)})):e.resolve(f).then((function(t){h.value=t,c(h)}),(function(t){return o("throw",t,c,u)}))}u(s.arg)}var i;this._invoke=function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}}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 o=r.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 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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,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:L}}function L(){return{value:void 0,done:!0}}return d.prototype=v,u(m,"constructor",v),u(v,"constructor",d),d.displayName=u(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,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(x.prototype),u(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new x(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(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 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,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(k),!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 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 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 n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(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 o=r.arg;k(n)}return o}}throw 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),h}},t}function bn(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function xn(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){bn(i,r,o,a,c,"next",t)}function c(t){bn(i,r,o,a,c,"throw",t)}a(void 0)}))}}function wn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function En(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function kn(t,e,n){return e&&En(t.prototype,e),n&&En(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Pn=(dn=function(){function t(){wn(this,t),this.contextService=void 0,this.renderingContext=void 0,this.$camera=void 0}return kn(t,[{key:"apply",value:function(t){var n=this,r=function(t){var r=t.target;if(r.nodeName===e.Shape.HTML){var o=n.getOrCreateEl(r),i=r.ownerDocument.documentElement.attributes;Object.keys(i).forEach((function(t){o.style[t]=i[t]})),Object.keys(r.attributes).forEach((function(t){n.updateAttribute(t,r)}))}},o=function(t){var r=t.target;if(r.nodeName===e.Shape.HTML){var o=n.getId(r),i=n.contextService.getDomElement().parentNode;if(i){var a=i.querySelector("#"+o);a&&i.removeChild(a)}}},i=function(t){var r=t.target;r.nodeName===e.Shape.HTML&&n.updateAttribute(t.attrName,r)};t.hooks.init.tapPromise(vn.tag,xn(mn().mark((function t(){return mn().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,o),n.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,i);case 3:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(vn.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),n.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,i)}))}},{key:"getId",value:function(t){return t.id||"g-html-"+t.entity}},{key:"getOrCreateEl",value:function(t){var e=this.getId(t),n=this.contextService.getDomElement().parentNode;if(n){var r=n.querySelector("#"+e);if(!r){r=document.createElement("div"),t.parsedStyle.$el=r,r.id=e,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),n.appendChild(r),r.style.position="absolute",r.style.left="0",r.style.top="0",r.style["will-change"]="transform";var o=t.getWorldTransform();r.style.transform="matrix(".concat([o[0],o[1],o[4],o[5],o[12],o[13]].join(","),")")}return r}return null}},{key:"updateAttribute",value:function(t,n){var r=this.getOrCreateEl(n);switch(t){case"innerHTML":var o=n.parsedStyle.innerHTML;e.isString(o)?r.innerHTML=o:(r.innerHTML="",r.appendChild(o));break;case"modelMatrix":case"transformOrigin":var i=n.parsedStyle.transformOrigin;r.style["transform-origin"]="".concat(i[0].value," ").concat(i[1].value);var a=n.getWorldTransform();r.style.transform="matrix(".concat([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;break;case"height":var u=n.computedStyleMap().get("height");r.style.height=""+u;break;case"zIndex":r.style["z-index"]="".concat(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="".concat(n.parsedStyle.opacity.value);break;case"fill":var s=n.parsedStyle.fill,l="";if(s instanceof e.CSSRGB)l=""+s;else if(s instanceof e.CSSGradientValue&&s.type===e.GradientPatternType.LinearGradient){var h=s.value.steps.map((function(t){return"".concat(t[1]," ").concat(100*Number(t[0]),"%")})).join(",");l="linear-gradient(to right, ".concat(h,");")}r.style.background=l;break;case"stroke":r.style["border-color"]=""+n.parsedStyle.stroke,r.style["border-style"]="solid";break;case"lineWidth":r.style["border-width"]="".concat(n.parsedStyle.lineWidth.value||0,"px");break;case"lineDash":r.style["border-style"]="dashed";break;case"filter":r.style.filter=n.parsedStyle.filter}}}]),t}(),dn.tag="HTMLRendering",vn=dn);h([n.inject(e.ContextService),f("design:type",Object)],Pn.prototype,"contextService",void 0),h([n.inject(e.RenderingContext),f("design:type",Object)],Pn.prototype,"renderingContext",void 0),Pn=vn=h([n.singleton({contrib:e.RenderingPluginContribution})],Pn);var Sn=n.Module((function(t){t(Pn)})),Ln=function(){function t(){wn(this,t),this.name="html-renderer"}return kn(t,[{key:"init",value:function(t){t.load(Sn,!0)}},{key:"destroy",value:function(t){t.unload(Sn)}}]),t}(),On=Object.freeze({__proto__:null,Plugin:Ln}),Cn=function(){function t(){o(this,t),this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}return a(t,[{key:"init",value:function(){var t=this.canvasConfig,n=t.container,r=t.canvas,o=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 i=document.createElement("canvas");this.$container.appendChild(i),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=i}this.context=this.$canvas.getContext("2d");var a=o||e.isBrowser&&window.devicePixelRatio||1;this.dpr=a=1>a?1:Math.ceil(a),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value: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)}}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}}]),t}();h([n.inject(e.CanvasConfig),f("design:type",Object)],Cn.prototype,"canvasConfig",void 0),Cn=h([n.singleton({token:e.ContextService})],Cn);var Mn=n.Module((function(t){t(Cn)})),Tn=function(){function t(){o(this,t),this.name="canvas-context-register"}return a(t,[{key:"init",value:function(t){t.load(Mn,!0)}},{key:"destroy",value:function(t){t.unload(Mn)}}]),t}(),jn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(n,t);var e=l(n);function n(t){var r;return o(this,n),(r=e.call(this,t)).registerPlugin(new Tn),r.registerPlugin(new re),r.registerPlugin(new k),r.registerPlugin(new yn),r.registerPlugin(new Ln),r}return a(n)}(e.AbstractRenderer);t.CanvasPicker=gn,t.CanvasRenderer=oe,t.DomInteraction=P,t.HTMLRenderer=On,t.Renderer=jn,Object.defineProperty(t,"__esModule",{value:!0})}));
9
+ Nt=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 Tt(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 jt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Tt(i,n,o,a,c,"next",t)}function c(t){Tt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Mt(){return Mt=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},Mt.apply(this,arguments)}function At(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,_t(t,e)}function _t(t,e){return _t=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_t(t,e)}var Ft="undefined"!=typeof Float32Array?Float32Array:Array;function Gt(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 It(){var t=new Ft(3);return Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Rt(t,e,r){var n=new Ft(3);return n[0]=t,n[1]=e,n[2]=r,n}function Bt(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 Dt=function(t){return Math.hypot(t[0],t[1],t[2])};!function(){var t=It()}();!function(){var t,e=(t=new Ft(4),Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Yt(){var t=new Ft(4);return Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function $t(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 Wt,Ht,Ut,Xt,qt,Vt,zt,Qt=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},Kt=(Wt=It(),Ht=Rt(1,0,0),Ut=Rt(0,1,0),Xt=Yt(),qt=Yt(),Vt=new Ft(9),Ft!=Float32Array&&(Vt[1]=0,Vt[2]=0,Vt[3]=0,Vt[5]=0,Vt[6]=0,Vt[7]=0),Vt[0]=1,Vt[4]=1,Vt[8]=1,zt=Vt,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}());Kt=g([r.singleton()],Kt);var Jt=r.Syringe.defineToken("StyleRendererFactory"),Zt=r.Syringe.defineToken("CircleRenderer",{multiple:!1}),te=r.Syringe.defineToken("EllipseRenderer",{multiple:!1}),ee=r.Syringe.defineToken("RectRenderer",{multiple:!1}),re=r.Syringe.defineToken("LineRenderer",{multiple:!1}),ne=r.Syringe.defineToken("PolylineRenderer",{multiple:!1}),oe=r.Syringe.defineToken("PolygonRenderer",{multiple:!1}),ie=r.Syringe.defineToken("PathRenderer",{multiple:!1}),ae=r.Syringe.defineToken("TextRenderer",{multiple:!1}),ce=r.Syringe.defineToken("ImageRenderer",{multiple:!1}),ue=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}();g([r.inject(bt),m("design:type",bt)],ue.prototype,"imagePool",void 0),ue=g([r.singleton({token:ce})],ue);var se=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}();se=g([r.singleton({token:ae})],se);var le=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}(),he=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(le=g([r.singleton()],le));he=g([r.singleton({token:ee})],he);var fe=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(le);fe=g([r.singleton({token:Zt})],fe);var ve=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(le);ve=g([r.singleton({token:te})],ve);var de=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(le);de=g([r.singleton({token:re})],de);var pe=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(le);pe=g([r.singleton({token:ne})],pe);var ye=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(le);ye=g([r.singleton({token:oe})],ye);var ge,me,we=function(t){function e(){return t.apply(this,arguments)||this}return At(e,t),e}(le);we=g([r.singleton({token:ie})],we);var xe=(ge=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=It(),this.tmpMat4=function(){var t=new Ft(16);return Ft!=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(me.tag,jt(Nt().mark((function t(){var i,a,c,u;return Nt().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(me.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,o)})),t.hooks.beginFrame.tap(me.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(me.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(Rt(r,n,0),Rt(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(me.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}(It(),r),o=n[0],i=n[1],a=Gt(It(),r),c=a[0],u=a[1],s=function(t,e){var r=new Ft(3);Gt(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}(Yt(),r),l=e.getEuler(It(),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(Mt({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}(),ge.tag="CanvasRenderer",me=ge);g([r.inject(e.CanvasConfig),m("design:type",Object)],xe.prototype,"canvasConfig",void 0),g([r.inject(e.DefaultCamera),m("design:type",e.Camera)],xe.prototype,"camera",void 0),g([r.inject(e.ContextService),m("design:type",Object)],xe.prototype,"contextService",void 0),g([r.inject(e.RenderingContext),m("design:type",Object)],xe.prototype,"renderingContext",void 0),g([r.inject(bt),m("design:type",bt)],xe.prototype,"imagePool",void 0),g([r.inject(Kt),m("design:type",Kt)],xe.prototype,"gradientPool",void 0),g([r.inject(a),m("design:type",Function)],xe.prototype,"pathGeneratorFactory",void 0),g([r.inject(Jt),m("design:type",Function)],xe.prototype,"styleRendererFactory",void 0),g([r.inject(e.DisplayObjectPool),m("design:type",e.DisplayObjectPool)],xe.prototype,"displayObjectPool",void 0),g([r.inject(e.RBushRoot),m("design:type",Function)],xe.prototype,"rBush",void 0),xe=me=g([r.singleton({contrib:e.RenderingPluginContribution})],xe);var Ee,be,Le=r.Module((function(t){var r;t(fe),t(ve),t(he),t(ue),t(se),t(de),t(pe),t(ye),t(we);var n=((r={})[e.Shape.CIRCLE]=Zt,r[e.Shape.ELLIPSE]=te,r[e.Shape.RECT]=ee,r[e.Shape.IMAGE]=ce,r[e.Shape.TEXT]=ae,r[e.Shape.LINE]=re,r[e.Shape.POLYLINE]=ne,r[e.Shape.POLYGON]=oe,r[e.Shape.PATH]=ie,r);t({token:Jt,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(Kt),t(xe)})),Pe=function(){function t(){this.name="canvas-renderer"}var e=t.prototype;return e.init=function(t){t.load(Le,!0)},e.destroy=function(t){t.unload(Le)},t}();function Se(){
10
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
11
+ Se=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 ke(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 Ce(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ke(i,n,o,a,c,"next",t)}function c(t){ke(i,n,o,a,c,"throw",t)}a(void 0)}))}}var Oe=(Ee=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(be.tag,Ce(Se().mark((function t(){var n;return Se().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(be.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}(),Ee.tag="DOMInteraction",be=Ee);g([r.inject(e.ContextService),m("design:type",Object)],Oe.prototype,"contextService",void 0),g([r.inject(e.RenderingContext),m("design:type",Object)],Oe.prototype,"renderingContext",void 0),Oe=be=g([r.singleton({contrib:e.RenderingPluginContribution})],Oe);var Ne,Te,je=r.Module((function(t){t(Oe)})),Me=function(){function t(){this.name="dom-interaction"}var e=t.prototype;return e.init=function(t){t.load(je,!0)},e.destroy=function(t){t.unload(je)},t}();function Ae(){
12
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
13
+ Ae=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 _e(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 Fe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){_e(i,n,o,a,c,"next",t)}function c(t){_e(i,n,o,a,c,"throw",t)}a(void 0)}))}}var Ge=(Ne=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(Te.tag,Fe(Ae().mark((function t(){return Ae().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(Te.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}(),Ne.tag="HTMLRendering",Te=Ne);g([r.inject(e.ContextService),m("design:type",Object)],Ge.prototype,"contextService",void 0),g([r.inject(e.RenderingContext),m("design:type",Object)],Ge.prototype,"renderingContext",void 0),g([r.inject(e.CanvasConfig),m("design:type",Object)],Ge.prototype,"canvasConfig",void 0),Ge=Te=g([r.singleton({contrib:e.RenderingPluginContribution})],Ge);var Ie=r.Module((function(t){t(Ge)})),Re=function(){function t(){this.name="html-renderer"}var e=t.prototype;return e.init=function(t){t.load(Ie,!0)},e.destroy=function(t){t.unload(Ie)},t}(),Be=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var r=t.prototype;return r.init=function(){var t,r=(t=n().mark((function t(){var r,o,i,a,c,u;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(r=this.canvasConfig).container,a=r.devicePixelRatio,(i=r.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(n,i){var a=t.apply(e,r);function c(t){o(a,n,i,c,u,"next",t)}function u(t){o(a,n,i,c,u,"throw",t)}c(void 0)}))});return function(){return r.apply(this,arguments)}}(),r.getContext=function(){return this.context},r.getDomElement=function(){return this.$canvas},r.getDPR=function(){return this.dpr},r.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},r.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},r.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)}},r.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t}();g([r.inject(e.CanvasConfig),m("design:type",Object)],Be.prototype,"canvasConfig",void 0),Be=g([r.singleton({token:e.ContextService})],Be);var De=r.Module((function(t){t(Be)})),Ye=function(){function t(){this.name="canvas-context-register"}var e=t.prototype;return e.init=function(t){t.load(De,!0)},e.destroy=function(t){t.unload(De)},t}();t.Renderer=function(t){var e,r;function n(e){var r;return(r=t.call(this,e)||this).registerPlugin(new Ye),r.registerPlugin(new Ot),r.registerPlugin(new y),r.registerPlugin(new Pe),r.registerPlugin(new Me),r.registerPlugin(new Et),r.registerPlugin(new Re),r}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,i(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.6",
3
+ "version": "1.1.8-alpha.1",
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.6",
33
- "@antv/g-plugin-canvas-renderer": "^1.1.6",
34
- "@antv/g-plugin-dom-interaction": "^1.1.6",
35
- "@antv/g-plugin-html-renderer": "^1.1.6",
33
+ "@antv/g-plugin-canvas-path-generator": "^0.0.1-alpha.0",
34
+ "@antv/g-plugin-canvas-picker": "^1.1.8-alpha.0",
35
+ "@antv/g-plugin-canvas-renderer": "^1.1.8-alpha.0",
36
+ "@antv/g-plugin-dom-interaction": "^1.1.8-alpha.0",
37
+ "@antv/g-plugin-html-renderer": "^1.1.8-alpha.0",
38
+ "@antv/g-plugin-image-loader": "^0.0.1-alpha.0",
36
39
  "tslib": "^2.3.1"
37
40
  },
38
41
  "devDependencies": {
@@ -46,5 +49,5 @@
46
49
  "publishConfig": {
47
50
  "access": "public"
48
51
  },
49
- "gitHead": "ee946c7c12c90946c37926b34ee5165bf0c35f25"
52
+ "gitHead": "146914975865332da4087793e215221d7cfcb568"
50
53
  }