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