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