@antv/g-canvas 1.9.7 → 1.9.9

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 CHANGED
@@ -4287,6 +4287,7 @@
4287
4287
 
4288
4288
  _proto.render = function render(context, parsedStyle, object, renderingService) {
4289
4289
  var fill = parsedStyle.fill,
4290
+ fillRule = parsedStyle.fillRule,
4290
4291
  opacity = parsedStyle.opacity,
4291
4292
  fillOpacity = parsedStyle.fillOpacity,
4292
4293
  stroke = parsedStyle.stroke,
@@ -4315,7 +4316,7 @@
4315
4316
  setShadowAndFilter(object, context, hasShadow);
4316
4317
  }
4317
4318
 
4318
- this.fill(context, object, fill, renderingService);
4319
+ this.fill(context, object, fill, fillRule, renderingService);
4319
4320
 
4320
4321
  if (!shouldDrawShadowWithStroke) {
4321
4322
  this.clearShadowAndFilter(context, hasFilter, hasShadow);
@@ -4372,20 +4373,20 @@
4372
4373
  }
4373
4374
  };
4374
4375
 
4375
- _proto.fill = function fill(context, object, _fill, renderingService) {
4376
+ _proto.fill = function fill(context, object, _fill, fillRule, renderingService) {
4376
4377
  var _this = this;
4377
4378
 
4378
4379
  if (Array.isArray(_fill)) {
4379
4380
  _fill.forEach(function (gradient) {
4380
4381
  context.fillStyle = _this.getColor(gradient, object, context);
4381
- context.fill();
4382
+ context.fill(fillRule);
4382
4383
  });
4383
4384
  } else {
4384
4385
  if (gLite.isPattern(_fill)) {
4385
4386
  context.fillStyle = this.getPattern(_fill, object, context, renderingService);
4386
4387
  }
4387
4388
 
4388
- context.fill();
4389
+ context.fill(fillRule);
4389
4390
  }
4390
4391
  };
4391
4392
 
@@ -6,7 +6,7 @@ S=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="functio
6
6
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
7
7
  Et=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function d(){}var p={};c(p,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(P([])));y&&y!==e&&r.call(y,o)&&(p=y);var g=d.prototype=l.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){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(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function Lt(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function Pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Lt(i,n,o,a,c,"next",t)}function c(t){Lt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Ot(t,e){return Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ot(t,e)}var St,Ct,kt=function(){function t(t){this.canvasConfig=void 0,this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=t}var r=t.prototype;return r.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then((function(){e&&e()})),this.imageCache[t]},r.getOrCreateImage=function(t){var r=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(o,i){var a;n?a=n(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){o(a)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=t,r.imageCache[t]=a)}))},r.getOrCreatePatternSync=function(t,e,r){var n=this.generatePatternKey(t);if(n&&this.patternCache[n])return this.patternCache[n];var o,i=t.image,a=t.repetition,c=(o=l(i)?this.getImageSync(i,r):i)&&e.createPattern(o,a);return n&&c&&(this.patternCache[n]=c),c},r.getOrCreateGradient=function(t,r){var n=this.generateGradientKey(t),o=t.type,i=t.steps,a=t.width,c=t.height,s=t.cx,u=t.cy,h=t.size;if(this.gradientCache[n])return this.gradientCache[n];var l=null;if(o===e.GradientType.LinearGradient){var f=e.computeLinearGradient(a,c,t.angle);l=r.createLinearGradient(f.x1,f.y1,f.x2,f.y2)}else if(o===e.GradientType.RadialGradient){var d=e.computeRadialGradient(a,c,s,u,h),p=d.x,v=d.y;l=r.createRadialGradient(p,v,0,p,v,d.r)}return l&&(i.forEach((function(t){var r,n=t.offset;n.unit===e.UnitType.kPercentage&&(null===(r=l)||void 0===r||r.addColorStop(n.value/100,t.color.toString()))})),this.gradientCache[n]=l),this.gradientCache[n]},r.generateGradientKey=function(t){var e=t.width,r=t.height,n=t.steps,o=t.angle,i=t.cx,a=t.cy,c=t.size;return"gradient-"+t.type+"-"+((null==o?void 0:o.toString())||0)+"-"+((null==i?void 0:i.toString())||0)+"-"+((null==a?void 0:a.toString())||0)+"-"+((null==c?void 0:c.toString())||0)+"-"+e+"-"+r+"-"+n.map((function(t){return""+t.offset+t.color})).join("-")},r.generatePatternKey=function(t){var e=t.image,r=t.repetition;if(l(e))return"pattern-"+e+"-"+r},t}();kt=c([e.singleton(),s(0,e.inject(e.CanvasConfig))],kt);var Mt=(St=function(){function t(t,e){this.imagePool=void 0,this.renderingContext=void 0,this.imagePool=t,this.renderingContext=e}return t.prototype.apply=function(t){var r=this,n=function(n){var o=n.target;if(o.nodeName===e.Shape.IMAGE){var i=o.attributes.img;l(i)&&r.imagePool.getImageSync(i,(function(){o.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var o=n.target,i=n.newValue;o.nodeName===e.Shape.IMAGE&&"img"===n.attrName&&l(i)&&r.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(Ct.tag,Pt(Et().mark((function t(){return Et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,o);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(Ct.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},t}(),St.tag="LoadImage",Ct=St);Mt=Ct=c([e.singleton({contrib:e.RenderingPluginContribution}),s(0,e.inject(kt)),s(1,e.inject(e.RenderingContext))],Mt);var Tt=e.Module((function(t){t(kt),t(Mt)})),At=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="image-loader",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,Ot(e,r);var o=n.prototype;return o.init=function(){this.container.load(Tt,!0)},o.destroy=function(){this.container.unload(Tt)},n}(e.AbstractRendererPlugin),jt=Object.freeze({__proto__:null,get ImagePool(){return kt},Plugin:At});function _t(){
8
8
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
9
- _t=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function d(){}var p={};c(p,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(P([])));y&&y!==e&&r.call(y,o)&&(p=y);var g=d.prototype=l.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){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(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function Nt(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function Rt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Nt(i,n,o,a,c,"next",t)}function c(t){Nt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function It(){return It=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},It.apply(this,arguments)}function Gt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ft(t,e)}function Ft(t,e){return Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ft(t,e)}var Bt="undefined"!=typeof Float32Array?Float32Array:Array;function Dt(){var t=new Bt(16);return Bt!=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 Yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Wt(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],c=e[4],s=e[5],u=e[6],h=e[7],l=e[8],f=e[9],d=e[10],p=e[11],v=e[12],y=e[13],g=e[14],m=e[15],w=r[0],x=r[1],b=r[2],E=r[3];return t[0]=w*n+x*c+b*l+E*v,t[1]=w*o+x*s+b*f+E*y,t[2]=w*i+x*u+b*d+E*g,t[3]=w*a+x*h+b*p+E*m,t[4]=(w=r[4])*n+(x=r[5])*c+(b=r[6])*l+(E=r[7])*v,t[5]=w*o+x*s+b*f+E*y,t[6]=w*i+x*u+b*d+E*g,t[7]=w*a+x*h+b*p+E*m,t[8]=(w=r[8])*n+(x=r[9])*c+(b=r[10])*l+(E=r[11])*v,t[9]=w*o+x*s+b*f+E*y,t[10]=w*i+x*u+b*d+E*g,t[11]=w*a+x*h+b*p+E*m,t[12]=(w=r[12])*n+(x=r[13])*c+(b=r[14])*l+(E=r[15])*v,t[13]=w*o+x*s+b*f+E*y,t[14]=w*i+x*u+b*d+E*g,t[15]=w*a+x*h+b*p+E*m,t}function $t(t,e,r){var n,o,i,a,c,s,u,h,l,f,d,p,v=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(o=e[1],i=e[2],a=e[3],c=e[4],s=e[5],u=e[6],h=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n=e[0],t[1]=o,t[2]=i,t[3]=a,t[4]=c,t[5]=s,t[6]=u,t[7]=h,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*v+c*y+l*g+e[12],t[13]=o*v+s*y+f*g+e[13],t[14]=i*v+u*y+d*g+e[14],t[15]=a*v+h*y+p*g+e[15]),t}function Ht(){var t=new Bt(3);return Bt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ut(t,e,r){var n=new Bt(3);return n[0]=t,n[1]=e,n[2]=r,n}function zt(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}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=Ht()}();var Xt=e.Syringe.defineToken(""),Vt=e.Syringe.defineToken("",{multiple:!1}),qt=e.Syringe.defineToken("",{multiple:!1}),Qt=e.Syringe.defineToken("",{multiple:!1}),Zt=e.Syringe.defineToken("",{multiple:!1}),Jt=e.Syringe.defineToken("",{multiple:!1}),Kt=e.Syringe.defineToken("",{multiple:!1}),te=e.Syringe.defineToken("",{multiple:!1}),ee=e.Syringe.defineToken("",{multiple:!1}),re=e.Syringe.defineToken("",{multiple:!1}),ne=function(){function t(t){this.imagePool=void 0,this.imagePool=t}var r=t.prototype;return r.render=function(t,r,n,o){var i=r.fill,a=r.opacity,c=r.fillOpacity,s=r.stroke,u=r.strokeOpacity,l=r.lineWidth,f=r.lineCap,d=r.lineJoin,p=r.shadowType,v=r.shadowColor,y=r.shadowBlur,g=r.filter,m=r.miterLimit,w=!h(i)&&!i.isNone,x=!h(s)&&!s.isNone&&l>0,b=0===i.alpha,E=!(!g||!g.length),L=!h(v)&&y>0,P=n.nodeName,O="inner"===p,S=x&&L&&(P===e.Shape.PATH||P===e.Shape.LINE||P===e.Shape.POLYLINE||b||O);w&&(t.globalAlpha=a*c,S||oe(n,t,L),this.fill(t,n,i,o),S||this.clearShadowAndFilter(t,E,L)),x&&(t.globalAlpha=a*u,t.lineWidth=l,h(m)||(t.miterLimit=m),h(f)||(t.lineCap=f),h(d)||(t.lineJoin=d),S&&(O&&(t.globalCompositeOperation="source-atop"),oe(n,t,!0),O&&(this.stroke(t,n,s,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,E,!0))),this.stroke(t,n,s,o))},r.clearShadowAndFilter=function(t,e,r){if(r&&(t.shadowColor="transparent",t.shadowBlur=0),e){var n=t.filter;!h(n)&&n.indexOf("drop-shadow")>-1&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},r.fill=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.fillStyle=i.getColor(e,r,t),t.fill()})):(e.isPattern(n)&&(t.fillStyle=this.getPattern(n,r,t,o)),t.fill())},r.stroke=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.strokeStyle=i.getColor(e,r,t),t.stroke()})):(e.isPattern(n)&&(t.strokeStyle=this.getPattern(n,r,t,o)),t.stroke())},r.getPattern=function(t,e,r,n){return this.imagePool.getOrCreatePatternSync(t,r,(function(){e.renderable.dirty=!0,n.dirtify()}))},r.getColor=function(t,r,n){var o;if(t.type===e.GradientType.LinearGradient||t.type===e.GradientType.RadialGradient){var i=r.getGeometryBounds();o=this.imagePool.getOrCreateGradient(It({type:t.type},t.value,{width:i&&2*i.halfExtents[0]||1,height:i&&2*i.halfExtents[1]||1}),n)}return o},t}();function oe(t,e,r){var n=t.parsedStyle,o=n.filter,i=n.shadowColor,a=n.shadowBlur,c=n.shadowOffsetX,s=n.shadowOffsetY;o&&o.length&&(e.filter=t.style.filter),r&&(e.shadowColor=i.toString(),e.shadowBlur=a||0,e.shadowOffsetX=c||0,e.shadowOffsetY=s||0)}ne=c([e.singleton(),s(0,e.inject(kt))],ne);var ie=function(){function t(t){this.imagePool=void 0,this.imagePool=t}return t.prototype.render=function(t,e,r){var n,o=e.img,i=e.shadowColor,a=e.shadowBlur,c=e.width,s=e.height;if(l(o)?n=this.imagePool.getImageSync(o):(c||(c=o.width),s||(s=o.height),n=o),n){oe(r,t,!h(i)&&a>0);try{t.drawImage(n,0,0,c,s)}catch(t){}}},t}();ie=c([e.singleton({token:re}),s(0,e.inject(kt))],ie);var ae=function(){function t(){}var e=t.prototype;return e.render=function(t,e,r){var n=e.lineWidth,o=e.textAlign,i=e.textBaseline,a=e.lineJoin,c=e.miterLimit,s=e.letterSpacing,u=e.stroke,l=e.fill,f=e.fillOpacity,d=e.strokeOpacity,p=e.opacity,v=e.metrics,y=e.dx,g=e.dy,m=e.shadowColor,w=e.shadowBlur,x=v.lines,b=v.height,E=v.lineHeight,L=v.lineMetrics;t.font=v.font,t.lineWidth=n,t.textAlign=o,t.textBaseline=i,t.lineJoin=a,h(c)||(t.miterLimit=c);var P=0;"middle"===i?P=-b/2-E/2:"bottom"===i||"alphabetic"===i||"ideographic"===i?P=-b:"top"!==i&&"hanging"!==i||(P=-E);var O=y||0;P+=g||0,oe(r,t,!h(m)&&w>0);for(var S=0;x.length>S;S++){var C=n/2+O;P+=E,h(u)||u.isNone||!n||this.drawLetterSpacing(t,x[S],L[S],o,C,P,s,f,d,p,!0),h(l)||this.drawLetterSpacing(t,x[S],L[S],o,C,P,s,f,d,p)}},e.drawLetterSpacing=function(t,e,r,n,o,i,a,c,s,u,h){if(void 0===h&&(h=!1),0!==a){var l=t.textAlign;t.textAlign="left";var f=o;"center"===n?f=o-r.width/2:"right"!==n&&"end"!==n||(f=o-r.width);for(var d=Array.from(e),p=t.measureText(e).width,v=0,y=0;d.length>y;++y){var g=d[y];h?this.strokeText(t,g,f,i,s):this.fillText(t,g,f,i,c,u),f+=p-(v=t.measureText(e.substring(y+1)).width)+a,p=v}t.textAlign=l}else h?this.strokeText(t,e,o,i,s):this.fillText(t,e,o,i,c,u)},e.fillText=function(t,e,r,n,o,i){var a,c=!h(o)&&1!==o;c&&(a=t.globalAlpha,t.globalAlpha=o*i),t.fillText(e,r,n),c&&(t.globalAlpha=a)},e.strokeText=function(t,e,r,n,o){var i,a=!h(o)&&1!==o;a&&(i=t.globalAlpha,t.globalAlpha=o),t.strokeText(e,r,n),a&&(t.globalAlpha=i)},t}();ae=c([e.singleton({token:ee})],ae);var ce=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);ce=c([e.singleton({token:Qt})],ce);var se=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);se=c([e.singleton({token:Vt})],se);var ue=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);ue=c([e.singleton({token:qt})],ue);var he=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);he=c([e.singleton({token:Zt})],he);var le=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);le=c([e.singleton({token:Jt})],le);var fe=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);fe=c([e.singleton({token:Kt})],fe);var de=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);de=c([e.singleton({token:te})],de);var pe,ve,ye=e.Syringe.defineToken(""),ge=(pe=function(){function t(t,e,r,n,o,i,a,c,s){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.pathGeneratorFactory=void 0,this.styleRendererFactory=void 0,this.displayObjectPool=void 0,this.canvasRendererPluginOptions=void 0,this.rBush=void 0,this.pathGeneratorFactoryCache={},this.styleRendererFactoryCache={},this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Dt(),this.dprMatrix=Dt(),this.tmpMat4=Dt(),this.vec3a=Ht(),this.vec3b=Ht(),this.vec3c=Ht(),this.vec3d=Ht(),this.canvasConfig=t,this.camera=e,this.contextService=r,this.renderingContext=n,this.pathGeneratorFactory=o,this.styleRendererFactory=i,this.displayObjectPool=a,this.canvasRendererPluginOptions=c,this.rBush=s}var r=t.prototype;return r.apply=function(t){var r=this,n=this.renderingContext.root.ownerDocument.defaultView,o=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},i=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(ve.tag,Rt(_t().mark((function t(){var n,a,c,s,u;return _t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.CULLED,i),n=r.contextService.getDPR(),c=(a=r.canvasConfig).width,s=a.height,u=r.contextService.getContext(),r.clearRect(u,0,0,c*n,s*n);case 6:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(ve.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,i)})),t.hooks.beginFrame.tap(ve.tag,(function(){var e=r.contextService.getContext(),n=r.contextService.getDPR(),o=r.canvasConfig,i=o.width,a=o.height,c=r.canvasRendererPluginOptions,s=c.dirtyObjectNumThreshold,u=c.dirtyObjectRatioThreshold,h=t.getStats(),l=h.rendered,f=l/h.total;r.clearFullScreen=t.disableDirtyRectangleRendering()||l>s&&f>u,e&&(e.resetTransform(),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n))}));var a=function e(n){n.isVisible()&&!n.isCulled()&&(r.renderDisplayObject(n,t),r.saveDirtyAABB(n)),(n.sortable.sorted||n.childNodes).forEach((function(t){e(t)}))};t.hooks.endFrame.tap(ve.tag,(function(){var o=r.contextService.getContext(),i=r.contextService.getDPR();if(function(t,e){t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(r.dprMatrix,Ut(i,i,1)),Wt(r.vpMatrix,r.dprMatrix,r.camera.getOrthoMatrix()),r.clearFullScreen)a(r.renderingContext.root);else{var c=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(r.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(Ut(r,n,0),Ut(o,i,0)),a}))));if(r.removedRBushNodeAABBs=[],e.AABB.isEmpty(c))return void(r.renderQueue=[]);var s=r.convertAABB2Rect(c),u=s.x,h=s.y,l=s.width,f=s.height,d=zt(r.vec3a,Ut(u,h,0),r.vpMatrix),p=zt(r.vec3b,Ut(u+l,h,0),r.vpMatrix),v=zt(r.vec3c,Ut(u,h+f,0),r.vpMatrix),y=zt(r.vec3d,Ut(u+l,h+f,0),r.vpMatrix),g=Math.min(d[0],p[0],y[0],v[0]),m=Math.min(d[1],p[1],y[1],v[1]),w=Math.max(d[0],p[0],y[0],v[0]),x=Math.max(d[1],p[1],y[1],v[1]),b=Math.floor(g),E=Math.floor(m),L=Math.ceil(w-g),P=Math.ceil(x-m);o.save(),r.clearRect(o,b,E,L,P),o.beginPath(),o.rect(b,E,L,P),o.clip(),o.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),r.canvasConfig.renderer.getConfig().enableDirtyRectangleRenderingDebug&&n.dispatchEvent(new e.CustomEvent(e.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:{x:b,y:E,width:L,height:P}})),r.searchDirtyObjects(c).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t)})),o.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){o.restore()})),r.restoreStack=[]})),t.hooks.render.tap(ve.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},r.clearRect=function(t,e,r,n,o){t.clearRect(e,r,n,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,r,n,o))},r.renderDisplayObject=function(t,r){var n=this.contextService.getContext(),o=t.nodeName,i=this.restoreStack[this.restoreStack.length-1];!i||t.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINS||(n.restore(),this.restoreStack.pop()),void 0===this.styleRendererFactoryCache[o]&&(this.styleRendererFactoryCache[o]=this.styleRendererFactory(o));var a=this.styleRendererFactoryCache[o];void 0===this.pathGeneratorFactoryCache[o]&&(this.pathGeneratorFactoryCache[o]=this.pathGeneratorFactory(o));var c=this.pathGeneratorFactoryCache[o],s=t.parsedStyle.clipPath;if(s){this.applyWorldTransform(n,s,t.getWorldTransform()),void 0===this.pathGeneratorFactoryCache[s.nodeName]&&(this.pathGeneratorFactoryCache[s.nodeName]=this.pathGeneratorFactory(s.nodeName));var u=this.pathGeneratorFactoryCache[s.nodeName];u&&(n.save(),this.restoreStack.push(t),n.beginPath(),u(n,s.parsedStyle),n.closePath(),n.clip())}a&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),c&&(n.beginPath(),c(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),a&&(a.render(n,t.parsedStyle,t,r),n.restore()),t.renderable.dirty=!1},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),o=Math.floor(e[1]);return{x:n,y:o,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-o}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],o=r[1],i=t.getMax();return this.rBush.search({minX:n,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyAttributesToContext=function(t,e){var r=e.parsedStyle,n=r.stroke,o=r.fill,i=r.opacity,a=r.lineDash,c=r.lineDashOffset;a&&t.setLineDash(a),h(c)||(t.lineDashOffset=c),h(i)||(t.globalAlpha*=i),h(n)||Array.isArray(n)||n.isNone||(t.strokeStyle=e.attributes.stroke),h(o)||Array.isArray(o)||o.isNone||(t.fillStyle=e.attributes.fill)},r.applyWorldTransform=function(t,e,r){var n=0,o=0,i=(e.parsedStyle||{}).anchor,a=i&&i[0]||0,c=i&&i[1]||0;if(0!==a||0!==c){var s=e.getGeometryBounds();n=-a*(s&&2*s.halfExtents[0]||0),o=-c*(s&&2*s.halfExtents[1]||0)}r?(Yt(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=n,this.vec3a[1]=o,this.vec3a[2]=0,$t(this.tmpMat4,this.tmpMat4,this.vec3a),Wt(this.tmpMat4,r,this.tmpMat4),Wt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(Yt(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=n,this.vec3a[1]=o,this.vec3a[2]=0,$t(this.tmpMat4,this.tmpMat4,this.vec3a),Wt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return n.forEach((function(e){t.add(e)})),t},t}(),pe.tag="CanvasRenderer",ve=pe);ge=ve=c([e.singleton({contrib:e.RenderingPluginContribution}),s(0,e.inject(e.CanvasConfig)),s(1,e.inject(e.DefaultCamera)),s(2,e.inject(e.ContextService)),s(3,e.inject(e.RenderingContext)),s(4,e.inject(p)),s(5,e.inject(Xt)),s(6,e.inject(e.DisplayObjectPool)),s(7,e.inject(ye)),s(8,e.inject(e.RBushRoot))],ge);var me,we,xe=e.Module((function(t){var r;t(se),t(ue),t(ce),t(ie),t(ae),t(he),t(le),t(fe),t(de);var n=((r={})[e.Shape.CIRCLE]=Vt,r[e.Shape.ELLIPSE]=qt,r[e.Shape.RECT]=Qt,r[e.Shape.IMAGE]=re,r[e.Shape.TEXT]=ee,r[e.Shape.LINE]=Zt,r[e.Shape.POLYLINE]=Jt,r[e.Shape.POLYGON]=Kt,r[e.Shape.PATH]=te,r);t({token:Xt,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(ge)})),be=function(t){function e(e){var r;return void 0===e&&(e={}),(r=t.call(this)||this).options=void 0,r.name="canvas-renderer",r.options=e,r}Gt(e,t);var r=e.prototype;return r.init=function(){this.container.register(ye,{useValue:It({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options)}),this.container.load(xe,!0)},r.destroy=function(){this.container.unload(xe),this.container.remove(ye)},e}(e.AbstractRendererPlugin),Ee=Object.freeze({__proto__:null,get CircleRenderer(){return se},CircleRendererContribution:Vt,get EllipseRenderer(){return ue},EllipseRendererContribution:qt,get ImageRenderer(){return ie},ImageRendererContribution:re,get LineRenderer(){return he},LineRendererContribution:Zt,get PathRenderer(){return de},PathRendererContribution:te,Plugin:be,get PolygonRenderer(){return fe},PolygonRendererContribution:Kt,get PolylineRenderer(){return le},PolylineRendererContribution:Jt,get RectRenderer(){return ce},RectRendererContribution:Qt,StyleRendererFactory:Xt,get TextRenderer(){return ae},TextRendererContribution:ee});function Le(){
9
+ _t=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function d(){}var p={};c(p,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(P([])));y&&y!==e&&r.call(y,o)&&(p=y);var g=d.prototype=l.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){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(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function Nt(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function Rt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Nt(i,n,o,a,c,"next",t)}function c(t){Nt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function It(){return It=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},It.apply(this,arguments)}function Gt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ft(t,e)}function Ft(t,e){return Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ft(t,e)}var Bt="undefined"!=typeof Float32Array?Float32Array:Array;function Dt(){var t=new Bt(16);return Bt!=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 Yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Wt(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],c=e[4],s=e[5],u=e[6],h=e[7],l=e[8],f=e[9],d=e[10],p=e[11],v=e[12],y=e[13],g=e[14],m=e[15],w=r[0],x=r[1],b=r[2],E=r[3];return t[0]=w*n+x*c+b*l+E*v,t[1]=w*o+x*s+b*f+E*y,t[2]=w*i+x*u+b*d+E*g,t[3]=w*a+x*h+b*p+E*m,t[4]=(w=r[4])*n+(x=r[5])*c+(b=r[6])*l+(E=r[7])*v,t[5]=w*o+x*s+b*f+E*y,t[6]=w*i+x*u+b*d+E*g,t[7]=w*a+x*h+b*p+E*m,t[8]=(w=r[8])*n+(x=r[9])*c+(b=r[10])*l+(E=r[11])*v,t[9]=w*o+x*s+b*f+E*y,t[10]=w*i+x*u+b*d+E*g,t[11]=w*a+x*h+b*p+E*m,t[12]=(w=r[12])*n+(x=r[13])*c+(b=r[14])*l+(E=r[15])*v,t[13]=w*o+x*s+b*f+E*y,t[14]=w*i+x*u+b*d+E*g,t[15]=w*a+x*h+b*p+E*m,t}function $t(t,e,r){var n,o,i,a,c,s,u,h,l,f,d,p,v=r[0],y=r[1],g=r[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(o=e[1],i=e[2],a=e[3],c=e[4],s=e[5],u=e[6],h=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=n=e[0],t[1]=o,t[2]=i,t[3]=a,t[4]=c,t[5]=s,t[6]=u,t[7]=h,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=n*v+c*y+l*g+e[12],t[13]=o*v+s*y+f*g+e[13],t[14]=i*v+u*y+d*g+e[14],t[15]=a*v+h*y+p*g+e[15]),t}function Ht(){var t=new Bt(3);return Bt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ut(t,e,r){var n=new Bt(3);return n[0]=t,n[1]=e,n[2]=r,n}function zt(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}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=Ht()}();var Xt=e.Syringe.defineToken(""),Vt=e.Syringe.defineToken("",{multiple:!1}),qt=e.Syringe.defineToken("",{multiple:!1}),Qt=e.Syringe.defineToken("",{multiple:!1}),Zt=e.Syringe.defineToken("",{multiple:!1}),Jt=e.Syringe.defineToken("",{multiple:!1}),Kt=e.Syringe.defineToken("",{multiple:!1}),te=e.Syringe.defineToken("",{multiple:!1}),ee=e.Syringe.defineToken("",{multiple:!1}),re=e.Syringe.defineToken("",{multiple:!1}),ne=function(){function t(t){this.imagePool=void 0,this.imagePool=t}var r=t.prototype;return r.render=function(t,r,n,o){var i=r.fill,a=r.fillRule,c=r.opacity,s=r.fillOpacity,u=r.stroke,l=r.strokeOpacity,f=r.lineWidth,d=r.lineCap,p=r.lineJoin,v=r.shadowType,y=r.shadowColor,g=r.shadowBlur,m=r.filter,w=r.miterLimit,x=!h(i)&&!i.isNone,b=!h(u)&&!u.isNone&&f>0,E=0===i.alpha,L=!(!m||!m.length),P=!h(y)&&g>0,O=n.nodeName,S="inner"===v,C=b&&P&&(O===e.Shape.PATH||O===e.Shape.LINE||O===e.Shape.POLYLINE||E||S);x&&(t.globalAlpha=c*s,C||oe(n,t,P),this.fill(t,n,i,a,o),C||this.clearShadowAndFilter(t,L,P)),b&&(t.globalAlpha=c*l,t.lineWidth=f,h(w)||(t.miterLimit=w),h(d)||(t.lineCap=d),h(p)||(t.lineJoin=p),C&&(S&&(t.globalCompositeOperation="source-atop"),oe(n,t,!0),S&&(this.stroke(t,n,u,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,L,!0))),this.stroke(t,n,u,o))},r.clearShadowAndFilter=function(t,e,r){if(r&&(t.shadowColor="transparent",t.shadowBlur=0),e){var n=t.filter;!h(n)&&n.indexOf("drop-shadow")>-1&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},r.fill=function(t,r,n,o,i){var a=this;Array.isArray(n)?n.forEach((function(e){t.fillStyle=a.getColor(e,r,t),t.fill(o)})):(e.isPattern(n)&&(t.fillStyle=this.getPattern(n,r,t,i)),t.fill(o))},r.stroke=function(t,r,n,o){var i=this;Array.isArray(n)?n.forEach((function(e){t.strokeStyle=i.getColor(e,r,t),t.stroke()})):(e.isPattern(n)&&(t.strokeStyle=this.getPattern(n,r,t,o)),t.stroke())},r.getPattern=function(t,e,r,n){return this.imagePool.getOrCreatePatternSync(t,r,(function(){e.renderable.dirty=!0,n.dirtify()}))},r.getColor=function(t,r,n){var o;if(t.type===e.GradientType.LinearGradient||t.type===e.GradientType.RadialGradient){var i=r.getGeometryBounds();o=this.imagePool.getOrCreateGradient(It({type:t.type},t.value,{width:i&&2*i.halfExtents[0]||1,height:i&&2*i.halfExtents[1]||1}),n)}return o},t}();function oe(t,e,r){var n=t.parsedStyle,o=n.filter,i=n.shadowColor,a=n.shadowBlur,c=n.shadowOffsetX,s=n.shadowOffsetY;o&&o.length&&(e.filter=t.style.filter),r&&(e.shadowColor=i.toString(),e.shadowBlur=a||0,e.shadowOffsetX=c||0,e.shadowOffsetY=s||0)}ne=c([e.singleton(),s(0,e.inject(kt))],ne);var ie=function(){function t(t){this.imagePool=void 0,this.imagePool=t}return t.prototype.render=function(t,e,r){var n,o=e.img,i=e.shadowColor,a=e.shadowBlur,c=e.width,s=e.height;if(l(o)?n=this.imagePool.getImageSync(o):(c||(c=o.width),s||(s=o.height),n=o),n){oe(r,t,!h(i)&&a>0);try{t.drawImage(n,0,0,c,s)}catch(t){}}},t}();ie=c([e.singleton({token:re}),s(0,e.inject(kt))],ie);var ae=function(){function t(){}var e=t.prototype;return e.render=function(t,e,r){var n=e.lineWidth,o=e.textAlign,i=e.textBaseline,a=e.lineJoin,c=e.miterLimit,s=e.letterSpacing,u=e.stroke,l=e.fill,f=e.fillOpacity,d=e.strokeOpacity,p=e.opacity,v=e.metrics,y=e.dx,g=e.dy,m=e.shadowColor,w=e.shadowBlur,x=v.lines,b=v.height,E=v.lineHeight,L=v.lineMetrics;t.font=v.font,t.lineWidth=n,t.textAlign=o,t.textBaseline=i,t.lineJoin=a,h(c)||(t.miterLimit=c);var P=0;"middle"===i?P=-b/2-E/2:"bottom"===i||"alphabetic"===i||"ideographic"===i?P=-b:"top"!==i&&"hanging"!==i||(P=-E);var O=y||0;P+=g||0,oe(r,t,!h(m)&&w>0);for(var S=0;x.length>S;S++){var C=n/2+O;P+=E,h(u)||u.isNone||!n||this.drawLetterSpacing(t,x[S],L[S],o,C,P,s,f,d,p,!0),h(l)||this.drawLetterSpacing(t,x[S],L[S],o,C,P,s,f,d,p)}},e.drawLetterSpacing=function(t,e,r,n,o,i,a,c,s,u,h){if(void 0===h&&(h=!1),0!==a){var l=t.textAlign;t.textAlign="left";var f=o;"center"===n?f=o-r.width/2:"right"!==n&&"end"!==n||(f=o-r.width);for(var d=Array.from(e),p=t.measureText(e).width,v=0,y=0;d.length>y;++y){var g=d[y];h?this.strokeText(t,g,f,i,s):this.fillText(t,g,f,i,c,u),f+=p-(v=t.measureText(e.substring(y+1)).width)+a,p=v}t.textAlign=l}else h?this.strokeText(t,e,o,i,s):this.fillText(t,e,o,i,c,u)},e.fillText=function(t,e,r,n,o,i){var a,c=!h(o)&&1!==o;c&&(a=t.globalAlpha,t.globalAlpha=o*i),t.fillText(e,r,n),c&&(t.globalAlpha=a)},e.strokeText=function(t,e,r,n,o){var i,a=!h(o)&&1!==o;a&&(i=t.globalAlpha,t.globalAlpha=o),t.strokeText(e,r,n),a&&(t.globalAlpha=i)},t}();ae=c([e.singleton({token:ee})],ae);var ce=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);ce=c([e.singleton({token:Qt})],ce);var se=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);se=c([e.singleton({token:Vt})],se);var ue=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);ue=c([e.singleton({token:qt})],ue);var he=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);he=c([e.singleton({token:Zt})],he);var le=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);le=c([e.singleton({token:Jt})],le);var fe=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);fe=c([e.singleton({token:Kt})],fe);var de=function(t){function e(){return t.apply(this,arguments)||this}return Gt(e,t),e}(ne);de=c([e.singleton({token:te})],de);var pe,ve,ye=e.Syringe.defineToken(""),ge=(pe=function(){function t(t,e,r,n,o,i,a,c,s){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.pathGeneratorFactory=void 0,this.styleRendererFactory=void 0,this.displayObjectPool=void 0,this.canvasRendererPluginOptions=void 0,this.rBush=void 0,this.pathGeneratorFactoryCache={},this.styleRendererFactoryCache={},this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Dt(),this.dprMatrix=Dt(),this.tmpMat4=Dt(),this.vec3a=Ht(),this.vec3b=Ht(),this.vec3c=Ht(),this.vec3d=Ht(),this.canvasConfig=t,this.camera=e,this.contextService=r,this.renderingContext=n,this.pathGeneratorFactory=o,this.styleRendererFactory=i,this.displayObjectPool=a,this.canvasRendererPluginOptions=c,this.rBush=s}var r=t.prototype;return r.apply=function(t){var r=this,n=this.renderingContext.root.ownerDocument.defaultView,o=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},i=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(ve.tag,Rt(_t().mark((function t(){var n,a,c,s,u;return _t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.CULLED,i),n=r.contextService.getDPR(),c=(a=r.canvasConfig).width,s=a.height,u=r.contextService.getContext(),r.clearRect(u,0,0,c*n,s*n);case 6:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(ve.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,i)})),t.hooks.beginFrame.tap(ve.tag,(function(){var e=r.contextService.getContext(),n=r.contextService.getDPR(),o=r.canvasConfig,i=o.width,a=o.height,c=r.canvasRendererPluginOptions,s=c.dirtyObjectNumThreshold,u=c.dirtyObjectRatioThreshold,h=t.getStats(),l=h.rendered,f=l/h.total;r.clearFullScreen=t.disableDirtyRectangleRendering()||l>s&&f>u,e&&(e.resetTransform(),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n))}));var a=function e(n){n.isVisible()&&!n.isCulled()&&(r.renderDisplayObject(n,t),r.saveDirtyAABB(n)),(n.sortable.sorted||n.childNodes).forEach((function(t){e(t)}))};t.hooks.endFrame.tap(ve.tag,(function(){var o=r.contextService.getContext(),i=r.contextService.getDPR();if(function(t,e){t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(r.dprMatrix,Ut(i,i,1)),Wt(r.vpMatrix,r.dprMatrix,r.camera.getOrthoMatrix()),r.clearFullScreen)a(r.renderingContext.root);else{var c=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(r.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(Ut(r,n,0),Ut(o,i,0)),a}))));if(r.removedRBushNodeAABBs=[],e.AABB.isEmpty(c))return void(r.renderQueue=[]);var s=r.convertAABB2Rect(c),u=s.x,h=s.y,l=s.width,f=s.height,d=zt(r.vec3a,Ut(u,h,0),r.vpMatrix),p=zt(r.vec3b,Ut(u+l,h,0),r.vpMatrix),v=zt(r.vec3c,Ut(u,h+f,0),r.vpMatrix),y=zt(r.vec3d,Ut(u+l,h+f,0),r.vpMatrix),g=Math.min(d[0],p[0],y[0],v[0]),m=Math.min(d[1],p[1],y[1],v[1]),w=Math.max(d[0],p[0],y[0],v[0]),x=Math.max(d[1],p[1],y[1],v[1]),b=Math.floor(g),E=Math.floor(m),L=Math.ceil(w-g),P=Math.ceil(x-m);o.save(),r.clearRect(o,b,E,L,P),o.beginPath(),o.rect(b,E,L,P),o.clip(),o.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),r.canvasConfig.renderer.getConfig().enableDirtyRectangleRenderingDebug&&n.dispatchEvent(new e.CustomEvent(e.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:{x:b,y:E,width:L,height:P}})),r.searchDirtyObjects(c).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t)})),o.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){o.restore()})),r.restoreStack=[]})),t.hooks.render.tap(ve.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},r.clearRect=function(t,e,r,n,o){t.clearRect(e,r,n,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,r,n,o))},r.renderDisplayObject=function(t,r){var n=this.contextService.getContext(),o=t.nodeName,i=this.restoreStack[this.restoreStack.length-1];!i||t.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINS||(n.restore(),this.restoreStack.pop()),void 0===this.styleRendererFactoryCache[o]&&(this.styleRendererFactoryCache[o]=this.styleRendererFactory(o));var a=this.styleRendererFactoryCache[o];void 0===this.pathGeneratorFactoryCache[o]&&(this.pathGeneratorFactoryCache[o]=this.pathGeneratorFactory(o));var c=this.pathGeneratorFactoryCache[o],s=t.parsedStyle.clipPath;if(s){this.applyWorldTransform(n,s,t.getWorldTransform()),void 0===this.pathGeneratorFactoryCache[s.nodeName]&&(this.pathGeneratorFactoryCache[s.nodeName]=this.pathGeneratorFactory(s.nodeName));var u=this.pathGeneratorFactoryCache[s.nodeName];u&&(n.save(),this.restoreStack.push(t),n.beginPath(),u(n,s.parsedStyle),n.closePath(),n.clip())}a&&(this.applyWorldTransform(n,t),n.save(),this.applyAttributesToContext(n,t)),c&&(n.beginPath(),c(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),a&&(a.render(n,t.parsedStyle,t,r),n.restore()),t.renderable.dirty=!1},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),o=Math.floor(e[1]);return{x:n,y:o,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-o}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],o=r[1],i=t.getMax();return this.rBush.search({minX:n,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyAttributesToContext=function(t,e){var r=e.parsedStyle,n=r.stroke,o=r.fill,i=r.opacity,a=r.lineDash,c=r.lineDashOffset;a&&t.setLineDash(a),h(c)||(t.lineDashOffset=c),h(i)||(t.globalAlpha*=i),h(n)||Array.isArray(n)||n.isNone||(t.strokeStyle=e.attributes.stroke),h(o)||Array.isArray(o)||o.isNone||(t.fillStyle=e.attributes.fill)},r.applyWorldTransform=function(t,e,r){var n=0,o=0,i=(e.parsedStyle||{}).anchor,a=i&&i[0]||0,c=i&&i[1]||0;if(0!==a||0!==c){var s=e.getGeometryBounds();n=-a*(s&&2*s.halfExtents[0]||0),o=-c*(s&&2*s.halfExtents[1]||0)}r?(Yt(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=n,this.vec3a[1]=o,this.vec3a[2]=0,$t(this.tmpMat4,this.tmpMat4,this.vec3a),Wt(this.tmpMat4,r,this.tmpMat4),Wt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(Yt(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=n,this.vec3a[1]=o,this.vec3a[2]=0,$t(this.tmpMat4,this.tmpMat4,this.vec3a),Wt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return n.forEach((function(e){t.add(e)})),t},t}(),pe.tag="CanvasRenderer",ve=pe);ge=ve=c([e.singleton({contrib:e.RenderingPluginContribution}),s(0,e.inject(e.CanvasConfig)),s(1,e.inject(e.DefaultCamera)),s(2,e.inject(e.ContextService)),s(3,e.inject(e.RenderingContext)),s(4,e.inject(p)),s(5,e.inject(Xt)),s(6,e.inject(e.DisplayObjectPool)),s(7,e.inject(ye)),s(8,e.inject(e.RBushRoot))],ge);var me,we,xe=e.Module((function(t){var r;t(se),t(ue),t(ce),t(ie),t(ae),t(he),t(le),t(fe),t(de);var n=((r={})[e.Shape.CIRCLE]=Vt,r[e.Shape.ELLIPSE]=qt,r[e.Shape.RECT]=Qt,r[e.Shape.IMAGE]=re,r[e.Shape.TEXT]=ee,r[e.Shape.LINE]=Zt,r[e.Shape.POLYLINE]=Jt,r[e.Shape.POLYGON]=Kt,r[e.Shape.PATH]=te,r);t({token:Xt,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(ge)})),be=function(t){function e(e){var r;return void 0===e&&(e={}),(r=t.call(this)||this).options=void 0,r.name="canvas-renderer",r.options=e,r}Gt(e,t);var r=e.prototype;return r.init=function(){this.container.register(ye,{useValue:It({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options)}),this.container.load(xe,!0)},r.destroy=function(){this.container.unload(xe),this.container.remove(ye)},e}(e.AbstractRendererPlugin),Ee=Object.freeze({__proto__:null,get CircleRenderer(){return se},CircleRendererContribution:Vt,get EllipseRenderer(){return ue},EllipseRendererContribution:qt,get ImageRenderer(){return ie},ImageRendererContribution:re,get LineRenderer(){return he},LineRendererContribution:Zt,get PathRenderer(){return de},PathRendererContribution:te,Plugin:be,get PolygonRenderer(){return fe},PolygonRendererContribution:Kt,get PolylineRenderer(){return le},PolylineRendererContribution:Jt,get RectRenderer(){return ce},RectRendererContribution:Qt,StyleRendererFactory:Xt,get TextRenderer(){return ae},TextRendererContribution:ee});function Le(){
10
10
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
11
11
  Le=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof l?e:l).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=u(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}(t,r,i),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function l(){}function f(){}function d(){}var p={};c(p,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(P([])));y&&y!==e&&r.call(y,o)&&(p=y);var g=d.prototype=l.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var h=s.arg,l=h.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){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(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function Pe(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,o)}function Oe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Pe(i,n,o,a,c,"next",t)}function c(t){Pe(i,n,o,a,c,"throw",t)}a(void 0)}))}}function Se(t,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Se(t,e)}var Ce=(me=function(){function t(t,e){this.contextService=void 0,this.renderingContext=void 0,this.contextService=t,this.renderingContext=e}return t.prototype.apply=function(t){var e=this,r=this.renderingContext.root.ownerDocument.defaultView,n=function(e){t.hooks.pointerMove.call(e)},o=function(e){t.hooks.pointerUp.call(e)},i=function(e){t.hooks.pointerDown.call(e)},a=function(e){t.hooks.pointerOver.call(e)},c=function(e){t.hooks.pointerOut.call(e)},s=function(e){t.hooks.pointerCancel.call(e)},u=function(e){t.hooks.pointerWheel.call(e)},h=function(t){globalThis.document.addEventListener("pointermove",n,!0),t.addEventListener("pointerdown",i,!0),t.addEventListener("pointerleave",c,!0),t.addEventListener("pointerover",a,!0),globalThis.addEventListener("pointerup",o,!0)},l=function(t){t.addEventListener("touchstart",i,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",n,!0),t.addEventListener("touchcancel",s,!0)},f=function(t){globalThis.document.addEventListener("mousemove",n,!0),t.addEventListener("mousedown",i,!0),t.addEventListener("mouseout",c,!0),t.addEventListener("mouseover",a,!0),globalThis.addEventListener("mouseup",o,!0)};t.hooks.init.tapPromise(we.tag,Oe(Le().mark((function t(){var n;return Le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.contextService.getDomElement(),globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):r.supportsPointerEvents&&(n.style.touchAction="none"),r.supportsPointerEvents?h(n):f(n),r.supportsTouchEvents&&l(n),n.addEventListener("wheel",u,{passive:!0,capture:!0});case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(we.tag,(function(){var t=e.contextService.getDomElement();globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):r.supportsPointerEvents&&(t.style.touchAction=""),r.supportsPointerEvents?function(t){globalThis.document.removeEventListener("pointermove",n,!0),t.removeEventListener("pointerdown",i,!0),t.removeEventListener("pointerleave",c,!0),t.removeEventListener("pointerover",a,!0),globalThis.removeEventListener("pointerup",o,!0)}(t):function(t){globalThis.document.removeEventListener("mousemove",n,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",c,!0),t.removeEventListener("mouseover",a,!0),globalThis.removeEventListener("mouseup",o,!0)}(t),r.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",n,!0),t.removeEventListener("touchcancel",s,!0)}(t),t.removeEventListener("wheel",u,!0)}))},t}(),me.tag="DOMInteraction",we=me);Ce=we=c([e.singleton({contrib:e.RenderingPluginContribution}),s(0,e.inject(e.ContextService)),s(1,e.inject(e.RenderingContext))],Ce);var ke,Me,Te=e.Module((function(t){t(Ce)})),Ae=function(t){var e,r;function n(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).name="dom-interaction",e}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,Se(e,r);var o=n.prototype;return o.init=function(){this.container.load(Te,!0)},o.destroy=function(){this.container.unload(Te)},n}(e.AbstractRendererPlugin),je=Object.freeze({__proto__:null,Plugin:Ae});function _e(){
12
12
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g-canvas",
3
- "version": "1.9.7",
3
+ "version": "1.9.9",
4
4
  "description": "A renderer implemented by Canvas 2D API",
5
5
  "keywords": [
6
6
  "antv",
@@ -29,12 +29,12 @@
29
29
  "README.md"
30
30
  ],
31
31
  "dependencies": {
32
- "@antv/g-plugin-canvas-path-generator": "^1.1.19",
33
- "@antv/g-plugin-canvas-picker": "^1.8.16",
34
- "@antv/g-plugin-canvas-renderer": "^1.7.22",
35
- "@antv/g-plugin-dom-interaction": "^1.7.19",
36
- "@antv/g-plugin-html-renderer": "^1.7.19",
37
- "@antv/g-plugin-image-loader": "^1.1.20",
32
+ "@antv/g-plugin-canvas-path-generator": "^1.1.21",
33
+ "@antv/g-plugin-canvas-picker": "^1.8.18",
34
+ "@antv/g-plugin-canvas-renderer": "^1.7.24",
35
+ "@antv/g-plugin-dom-interaction": "^1.7.21",
36
+ "@antv/g-plugin-html-renderer": "^1.7.21",
37
+ "@antv/g-plugin-image-loader": "^1.1.22",
38
38
  "@antv/util": "^3.2.4",
39
39
  "tslib": "^2.3.1"
40
40
  },
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "635b292339f6f545b604576cfc42e8e9061c1a41"
51
+ "gitHead": "f544c40d7f0c7ef712e81bd5311fc70530dc43e7"
52
52
  }