@antv/g-canvas 1.1.8 → 1.2.0
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 +217 -171
- package/dist/index.umd.min.js +6 -6
- package/package.json +8 -8
package/dist/index.umd.js
CHANGED
|
@@ -528,39 +528,44 @@
|
|
|
528
528
|
});
|
|
529
529
|
|
|
530
530
|
if (!hasRadius) {
|
|
531
|
+
// Canvas support negative width/height of rect
|
|
531
532
|
context.rect(0, 0, w, h);
|
|
532
533
|
} else {
|
|
534
|
+
var signX = width.value > 0 ? 1 : -1;
|
|
535
|
+
var signY = height.value > 0 ? 1 : -1;
|
|
536
|
+
var sweepFlag = signX + signY === 0;
|
|
537
|
+
|
|
533
538
|
var _radius$map = radius.map(function (r) {
|
|
534
|
-
return g.clamp(r.value, 0, Math.min(w / 2, h / 2));
|
|
539
|
+
return g.clamp(r.value, 0, Math.min(Math.abs(w) / 2, Math.abs(h) / 2));
|
|
535
540
|
}),
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
541
|
+
tlr = _radius$map[0],
|
|
542
|
+
trr = _radius$map[1],
|
|
543
|
+
brr = _radius$map[2],
|
|
544
|
+
blr = _radius$map[3];
|
|
540
545
|
|
|
541
|
-
context.moveTo(
|
|
542
|
-
context.lineTo(w -
|
|
546
|
+
context.moveTo(signX * tlr, 0);
|
|
547
|
+
context.lineTo(w - signX * trr, 0);
|
|
543
548
|
|
|
544
|
-
if (
|
|
545
|
-
context.arc(w -
|
|
549
|
+
if (trr !== 0) {
|
|
550
|
+
context.arc(w - signX * trr, signY * trr, trr, -signY * Math.PI / 2, signX > 0 ? 0 : Math.PI, sweepFlag);
|
|
546
551
|
}
|
|
547
552
|
|
|
548
|
-
context.lineTo(w, h -
|
|
553
|
+
context.lineTo(w, h - signY * brr);
|
|
549
554
|
|
|
550
|
-
if (
|
|
551
|
-
context.arc(w -
|
|
555
|
+
if (brr !== 0) {
|
|
556
|
+
context.arc(w - signX * brr, h - signY * brr, brr, signX > 0 ? 0 : Math.PI, signY > 0 ? Math.PI / 2 : 1.5 * Math.PI, sweepFlag);
|
|
552
557
|
}
|
|
553
558
|
|
|
554
|
-
context.lineTo(
|
|
559
|
+
context.lineTo(signX * blr, h);
|
|
555
560
|
|
|
556
|
-
if (
|
|
557
|
-
context.arc(
|
|
561
|
+
if (blr !== 0) {
|
|
562
|
+
context.arc(signX * blr, h - signY * blr, blr, signY > 0 ? Math.PI / 2 : -Math.PI / 2, signX > 0 ? Math.PI : 0, sweepFlag);
|
|
558
563
|
}
|
|
559
564
|
|
|
560
|
-
context.lineTo(0,
|
|
565
|
+
context.lineTo(0, signY * tlr);
|
|
561
566
|
|
|
562
|
-
if (
|
|
563
|
-
context.arc(
|
|
567
|
+
if (tlr !== 0) {
|
|
568
|
+
context.arc(signX * tlr, signY * tlr, tlr, signX > 0 ? Math.PI : 0, signY > 0 ? Math.PI * 1.5 : Math.PI / 2, sweepFlag);
|
|
564
569
|
}
|
|
565
570
|
}
|
|
566
571
|
}
|
|
@@ -2738,7 +2743,7 @@
|
|
|
2738
2743
|
|
|
2739
2744
|
if (hasStroke || isClipPath) {
|
|
2740
2745
|
isHit = inRectWithRadius(0, 0, width, height, radius.map(function (r) {
|
|
2741
|
-
return g.clamp(r.value, 0, Math.min(width / 2, height / 2));
|
|
2746
|
+
return g.clamp(r.value, 0, Math.min(Math.abs(width) / 2, Math.abs(height) / 2));
|
|
2742
2747
|
}), lineWidthForHitTesting, position.x, position.y);
|
|
2743
2748
|
} // 仅填充时带有圆角的矩形直接通过图形拾取
|
|
2744
2749
|
// 以后可以改成纯数学的近似拾取,将圆弧切割成多边形
|
|
@@ -2821,13 +2826,22 @@
|
|
|
2821
2826
|
var ImagePool = /*#__PURE__*/function () {
|
|
2822
2827
|
function ImagePool() {
|
|
2823
2828
|
this.imageCache = {};
|
|
2829
|
+
this.gradientCache = {};
|
|
2824
2830
|
this.patternCache = {};
|
|
2825
2831
|
this.canvasConfig = void 0;
|
|
2826
2832
|
}
|
|
2827
2833
|
|
|
2828
2834
|
var _proto = ImagePool.prototype;
|
|
2829
2835
|
|
|
2830
|
-
_proto.getImageSync = function getImageSync(src) {
|
|
2836
|
+
_proto.getImageSync = function getImageSync(src, callback) {
|
|
2837
|
+
if (!this.imageCache[src]) {
|
|
2838
|
+
this.getOrCreateImage(src).then(function () {
|
|
2839
|
+
if (callback) {
|
|
2840
|
+
callback();
|
|
2841
|
+
}
|
|
2842
|
+
});
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2831
2845
|
return this.imageCache[src];
|
|
2832
2846
|
};
|
|
2833
2847
|
|
|
@@ -2865,35 +2879,104 @@
|
|
|
2865
2879
|
});
|
|
2866
2880
|
};
|
|
2867
2881
|
|
|
2868
|
-
_proto.
|
|
2882
|
+
_proto.getOrCreatePatternSync = function getOrCreatePatternSync(pattern, context, callback) {
|
|
2869
2883
|
var patternKey = this.generatePatternKey(pattern);
|
|
2870
2884
|
|
|
2871
|
-
if (this.patternCache[patternKey]) {
|
|
2885
|
+
if (patternKey && this.patternCache[patternKey]) {
|
|
2872
2886
|
return this.patternCache[patternKey];
|
|
2873
2887
|
}
|
|
2888
|
+
|
|
2889
|
+
var image = pattern.image,
|
|
2890
|
+
repetition = pattern.repetition;
|
|
2891
|
+
var src; // Image URL
|
|
2892
|
+
|
|
2893
|
+
if (g.isString(image)) {
|
|
2894
|
+
src = this.getImageSync(image, callback);
|
|
2895
|
+
} else {
|
|
2896
|
+
src = image;
|
|
2897
|
+
} // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createPattern
|
|
2898
|
+
|
|
2899
|
+
|
|
2900
|
+
var canvasPattern = src && context.createPattern(src, repetition);
|
|
2901
|
+
|
|
2902
|
+
if (patternKey && canvasPattern) {
|
|
2903
|
+
this.patternCache[patternKey] = canvasPattern;
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
return canvasPattern;
|
|
2874
2907
|
};
|
|
2875
2908
|
|
|
2876
|
-
_proto.
|
|
2877
|
-
var
|
|
2909
|
+
_proto.getOrCreateGradient = function getOrCreateGradient(params, context) {
|
|
2910
|
+
var key = this.generateGradientKey(params); // @ts-ignore
|
|
2878
2911
|
|
|
2879
|
-
|
|
2880
|
-
|
|
2912
|
+
var type = params.type,
|
|
2913
|
+
steps = params.steps,
|
|
2914
|
+
width = params.width,
|
|
2915
|
+
height = params.height,
|
|
2916
|
+
angle = params.angle,
|
|
2917
|
+
cx = params.cx,
|
|
2918
|
+
cy = params.cy;
|
|
2881
2919
|
|
|
2920
|
+
if (this.gradientCache[key]) {
|
|
2921
|
+
return this.gradientCache[key];
|
|
2922
|
+
}
|
|
2882
2923
|
|
|
2883
|
-
|
|
2924
|
+
var gradient = null;
|
|
2884
2925
|
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2926
|
+
if (type === g.GradientType.LinearGradient) {
|
|
2927
|
+
var _computeLinearGradien = g.computeLinearGradient(width, height, angle),
|
|
2928
|
+
x1 = _computeLinearGradien.x1,
|
|
2929
|
+
y1 = _computeLinearGradien.y1,
|
|
2930
|
+
x2 = _computeLinearGradien.x2,
|
|
2931
|
+
y2 = _computeLinearGradien.y2; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createLinearGradient
|
|
2888
2932
|
|
|
2889
|
-
|
|
2890
|
-
|
|
2933
|
+
|
|
2934
|
+
gradient = context.createLinearGradient(x1, y1, x2, y2);
|
|
2935
|
+
} else if (type === g.GradientType.RadialGradient) {
|
|
2936
|
+
var _computeRadialGradien = g.computeRadialGradient(width, height, cx, cy),
|
|
2937
|
+
x = _computeRadialGradien.x,
|
|
2938
|
+
y = _computeRadialGradien.y,
|
|
2939
|
+
r = _computeRadialGradien.r; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createRadialGradient
|
|
2940
|
+
|
|
2941
|
+
|
|
2942
|
+
gradient = context.createRadialGradient(x, y, 0, x, y, r);
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
if (gradient) {
|
|
2946
|
+
steps.forEach(function (_ref) {
|
|
2947
|
+
var _gradient;
|
|
2948
|
+
|
|
2949
|
+
var offset = _ref[0],
|
|
2950
|
+
color = _ref[1];
|
|
2951
|
+
(_gradient = gradient) === null || _gradient === void 0 ? void 0 : _gradient.addColorStop(offset, color);
|
|
2952
|
+
});
|
|
2953
|
+
this.gradientCache[key] = gradient;
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
return this.gradientCache[key];
|
|
2957
|
+
};
|
|
2958
|
+
|
|
2959
|
+
_proto.generateGradientKey = function generateGradientKey(params) {
|
|
2960
|
+
// @ts-ignore
|
|
2961
|
+
var type = params.type,
|
|
2962
|
+
width = params.width,
|
|
2963
|
+
height = params.height,
|
|
2964
|
+
steps = params.steps,
|
|
2965
|
+
angle = params.angle,
|
|
2966
|
+
cx = params.cx,
|
|
2967
|
+
cy = params.cy;
|
|
2968
|
+
return "gradient-" + type + "-" + (angle || 0) + "-" + (cx || 0) + "-" + (cy || 0) + "-" + width + "-" + height + "-" + steps.map(function (step) {
|
|
2969
|
+
return step.join('');
|
|
2970
|
+
}).join('-');
|
|
2891
2971
|
};
|
|
2892
2972
|
|
|
2893
2973
|
_proto.generatePatternKey = function generatePatternKey(pattern) {
|
|
2894
|
-
var
|
|
2895
|
-
repetition = pattern.repetition;
|
|
2896
|
-
|
|
2974
|
+
var image = pattern.image,
|
|
2975
|
+
repetition = pattern.repetition; // only generate cache for Image
|
|
2976
|
+
|
|
2977
|
+
if (g.isString(image)) {
|
|
2978
|
+
return "pattern-" + image + "-" + repetition;
|
|
2979
|
+
}
|
|
2897
2980
|
};
|
|
2898
2981
|
|
|
2899
2982
|
return ImagePool;
|
|
@@ -3312,7 +3395,7 @@
|
|
|
3312
3395
|
var img = attributes.img;
|
|
3313
3396
|
|
|
3314
3397
|
if (g.isString(img)) {
|
|
3315
|
-
_this.imagePool.
|
|
3398
|
+
_this.imagePool.getImageSync(img, function () {
|
|
3316
3399
|
// set dirty rectangle flag
|
|
3317
3400
|
object.renderable.dirty = true;
|
|
3318
3401
|
renderingService.dirtify();
|
|
@@ -4515,73 +4598,6 @@
|
|
|
4515
4598
|
};
|
|
4516
4599
|
}();
|
|
4517
4600
|
|
|
4518
|
-
var GradientPool = /*#__PURE__*/function () {
|
|
4519
|
-
function GradientPool() {
|
|
4520
|
-
this.gradientCache = {};
|
|
4521
|
-
}
|
|
4522
|
-
|
|
4523
|
-
var _proto = GradientPool.prototype;
|
|
4524
|
-
|
|
4525
|
-
_proto.getOrCreateGradient = function getOrCreateGradient(params, context) {
|
|
4526
|
-
var key = this.generateCacheKey(params);
|
|
4527
|
-
var type = params.type,
|
|
4528
|
-
x0 = params.x0,
|
|
4529
|
-
y0 = params.y0,
|
|
4530
|
-
x1 = params.x1,
|
|
4531
|
-
y1 = params.y1,
|
|
4532
|
-
steps = params.steps,
|
|
4533
|
-
width = params.width,
|
|
4534
|
-
height = params.height;
|
|
4535
|
-
|
|
4536
|
-
if (this.gradientCache[key]) {
|
|
4537
|
-
return this.gradientCache[key];
|
|
4538
|
-
}
|
|
4539
|
-
|
|
4540
|
-
var gradient = null;
|
|
4541
|
-
|
|
4542
|
-
if (type === g.GradientPatternType.LinearGradient) {
|
|
4543
|
-
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createLinearGradient
|
|
4544
|
-
gradient = context.createLinearGradient(x0 * width, y0 * height, x1 * width, y1 * height);
|
|
4545
|
-
} else if (type === g.GradientPatternType.RadialGradient) {
|
|
4546
|
-
var r = Math.sqrt(width * width + height * height) / 2; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createRadialGradient
|
|
4547
|
-
|
|
4548
|
-
gradient = context.createRadialGradient(x0 * width, y0 * height, 0, x1 * width, y1 * height, params.r1 * r);
|
|
4549
|
-
}
|
|
4550
|
-
|
|
4551
|
-
if (gradient) {
|
|
4552
|
-
steps.forEach(function (_ref) {
|
|
4553
|
-
var _gradient;
|
|
4554
|
-
|
|
4555
|
-
var offset = _ref[0],
|
|
4556
|
-
color = _ref[1];
|
|
4557
|
-
(_gradient = gradient) === null || _gradient === void 0 ? void 0 : _gradient.addColorStop(Number(offset), color);
|
|
4558
|
-
});
|
|
4559
|
-
this.gradientCache[key] = gradient;
|
|
4560
|
-
}
|
|
4561
|
-
|
|
4562
|
-
return this.gradientCache[key];
|
|
4563
|
-
};
|
|
4564
|
-
|
|
4565
|
-
_proto.generateCacheKey = function generateCacheKey(params) {
|
|
4566
|
-
// @ts-ignore
|
|
4567
|
-
var type = params.type,
|
|
4568
|
-
x0 = params.x0,
|
|
4569
|
-
y0 = params.y0,
|
|
4570
|
-
x1 = params.x1,
|
|
4571
|
-
y1 = params.y1,
|
|
4572
|
-
r1 = params.r1,
|
|
4573
|
-
steps = params.steps,
|
|
4574
|
-
width = params.width,
|
|
4575
|
-
height = params.height;
|
|
4576
|
-
return "gradient-" + type + "-" + x0 + "-" + y0 + "-" + x1 + "-" + y1 + "-" + (r1 || 0) + "-" + width + "-" + height + "-" + steps.map(function (step) {
|
|
4577
|
-
return step.join('');
|
|
4578
|
-
}).join('-');
|
|
4579
|
-
};
|
|
4580
|
-
|
|
4581
|
-
return GradientPool;
|
|
4582
|
-
}();
|
|
4583
|
-
|
|
4584
|
-
GradientPool = __decorate([g.singleton()], GradientPool);
|
|
4585
4601
|
var StyleRendererFactory = g.Syringe.defineToken('StyleRendererFactory');
|
|
4586
4602
|
var CircleRendererContribution = g.Syringe.defineToken('CircleRenderer', {
|
|
4587
4603
|
multiple: false
|
|
@@ -4811,11 +4827,13 @@
|
|
|
4811
4827
|
})], TextRenderer);
|
|
4812
4828
|
|
|
4813
4829
|
var DefaultRenderer = /*#__PURE__*/function () {
|
|
4814
|
-
function DefaultRenderer() {
|
|
4830
|
+
function DefaultRenderer() {
|
|
4831
|
+
this.imagePool = void 0;
|
|
4832
|
+
}
|
|
4815
4833
|
|
|
4816
4834
|
var _proto = DefaultRenderer.prototype;
|
|
4817
4835
|
|
|
4818
|
-
_proto.render = function render(context, parsedStyle) {
|
|
4836
|
+
_proto.render = function render(context, parsedStyle, object, renderingService) {
|
|
4819
4837
|
var fill = parsedStyle.fill,
|
|
4820
4838
|
opacity = parsedStyle.opacity,
|
|
4821
4839
|
fillOpacity = parsedStyle.fillOpacity,
|
|
@@ -4834,10 +4852,10 @@
|
|
|
4834
4852
|
if (hasFill) {
|
|
4835
4853
|
if (!g.isNil(fillOpacity) && fillOpacity.value !== 1) {
|
|
4836
4854
|
context.globalAlpha = fillOpacity.value;
|
|
4837
|
-
|
|
4855
|
+
this.fill(context, object, fill, renderingService);
|
|
4838
4856
|
context.globalAlpha = opacity.value;
|
|
4839
4857
|
} else {
|
|
4840
|
-
|
|
4858
|
+
this.fill(context, object, fill, renderingService);
|
|
4841
4859
|
}
|
|
4842
4860
|
}
|
|
4843
4861
|
|
|
@@ -4893,7 +4911,7 @@
|
|
|
4893
4911
|
var drawStroke = hasFill && !isFillTransparent;
|
|
4894
4912
|
|
|
4895
4913
|
if (drawStroke) {
|
|
4896
|
-
|
|
4914
|
+
this.stroke(context, object, stroke, renderingService);
|
|
4897
4915
|
} // restore shadow blur
|
|
4898
4916
|
|
|
4899
4917
|
|
|
@@ -4908,15 +4926,78 @@
|
|
|
4908
4926
|
}
|
|
4909
4927
|
|
|
4910
4928
|
if (!drawStroke) {
|
|
4911
|
-
|
|
4929
|
+
this.stroke(context, object, stroke, renderingService);
|
|
4912
4930
|
}
|
|
4913
4931
|
}
|
|
4914
4932
|
}
|
|
4915
4933
|
};
|
|
4916
4934
|
|
|
4935
|
+
_proto.fill = function fill(context, object, _fill, renderingService) {
|
|
4936
|
+
var _this = this;
|
|
4937
|
+
|
|
4938
|
+
if (Array.isArray(_fill)) {
|
|
4939
|
+
_fill.forEach(function (gradient) {
|
|
4940
|
+
context.fillStyle = _this.getColor(gradient, object, context);
|
|
4941
|
+
context.fill();
|
|
4942
|
+
});
|
|
4943
|
+
} else {
|
|
4944
|
+
if (g.isPattern(_fill)) {
|
|
4945
|
+
context.fillStyle = this.getPattern(_fill, object, context, renderingService);
|
|
4946
|
+
}
|
|
4947
|
+
|
|
4948
|
+
context.fill();
|
|
4949
|
+
}
|
|
4950
|
+
};
|
|
4951
|
+
|
|
4952
|
+
_proto.stroke = function stroke(context, object, _stroke, renderingService) {
|
|
4953
|
+
var _this2 = this;
|
|
4954
|
+
|
|
4955
|
+
if (Array.isArray(_stroke)) {
|
|
4956
|
+
_stroke.forEach(function (gradient) {
|
|
4957
|
+
context.strokeStyle = _this2.getColor(gradient, object, context);
|
|
4958
|
+
context.stroke();
|
|
4959
|
+
});
|
|
4960
|
+
} else {
|
|
4961
|
+
if (g.isPattern(_stroke)) {
|
|
4962
|
+
context.strokeStyle = this.getPattern(_stroke, object, context, renderingService);
|
|
4963
|
+
}
|
|
4964
|
+
|
|
4965
|
+
context.stroke();
|
|
4966
|
+
}
|
|
4967
|
+
};
|
|
4968
|
+
|
|
4969
|
+
_proto.getPattern = function getPattern(pattern, object, context, renderingService) {
|
|
4970
|
+
var canvasPattern = this.imagePool.getOrCreatePatternSync(pattern, context, function () {
|
|
4971
|
+
// set dirty rectangle flag
|
|
4972
|
+
object.renderable.dirty = true;
|
|
4973
|
+
renderingService.dirtify();
|
|
4974
|
+
});
|
|
4975
|
+
return canvasPattern;
|
|
4976
|
+
};
|
|
4977
|
+
|
|
4978
|
+
_proto.getColor = function getColor(parsedColor, object, context) {
|
|
4979
|
+
var color;
|
|
4980
|
+
|
|
4981
|
+
if (parsedColor.type === g.GradientType.LinearGradient || parsedColor.type === g.GradientType.RadialGradient) {
|
|
4982
|
+
var bounds = object.getGeometryBounds();
|
|
4983
|
+
var width = bounds && bounds.halfExtents[0] * 2 || 1;
|
|
4984
|
+
var height = bounds && bounds.halfExtents[1] * 2 || 1;
|
|
4985
|
+
color = this.imagePool.getOrCreateGradient(_extends({
|
|
4986
|
+
type: parsedColor.type
|
|
4987
|
+
}, parsedColor.value, {
|
|
4988
|
+
width: width,
|
|
4989
|
+
height: height
|
|
4990
|
+
}), context);
|
|
4991
|
+
}
|
|
4992
|
+
|
|
4993
|
+
return color;
|
|
4994
|
+
};
|
|
4995
|
+
|
|
4917
4996
|
return DefaultRenderer;
|
|
4918
4997
|
}();
|
|
4919
4998
|
|
|
4999
|
+
__decorate([g.inject(ImagePool), __metadata("design:type", ImagePool)], DefaultRenderer.prototype, "imagePool", void 0);
|
|
5000
|
+
|
|
4920
5001
|
DefaultRenderer = __decorate([g.singleton()], DefaultRenderer);
|
|
4921
5002
|
|
|
4922
5003
|
var RectRenderer = /*#__PURE__*/function (_DefaultRenderer) {
|
|
@@ -5032,8 +5113,6 @@
|
|
|
5032
5113
|
this.camera = void 0;
|
|
5033
5114
|
this.contextService = void 0;
|
|
5034
5115
|
this.renderingContext = void 0;
|
|
5035
|
-
this.imagePool = void 0;
|
|
5036
|
-
this.gradientPool = void 0;
|
|
5037
5116
|
this.pathGeneratorFactory = void 0;
|
|
5038
5117
|
this.pathGeneratorFactoryCache = {};
|
|
5039
5118
|
this.styleRendererFactory = void 0;
|
|
@@ -5281,7 +5360,7 @@
|
|
|
5281
5360
|
|
|
5282
5361
|
context.save(); // apply attributes to context
|
|
5283
5362
|
|
|
5284
|
-
this.applyAttributesToContext(context, object
|
|
5363
|
+
this.applyAttributesToContext(context, object); // apply anchor in local space
|
|
5285
5364
|
|
|
5286
5365
|
this.useAnchor(context, object); // generate path in local space
|
|
5287
5366
|
|
|
@@ -5302,7 +5381,7 @@
|
|
|
5302
5381
|
|
|
5303
5382
|
|
|
5304
5383
|
if (styleRenderer) {
|
|
5305
|
-
styleRenderer.render(context, object.parsedStyle, object);
|
|
5384
|
+
styleRenderer.render(context, object.parsedStyle, object, renderingService);
|
|
5306
5385
|
} // restore applied attributes, eg. shadowBlur shadowColor...
|
|
5307
5386
|
|
|
5308
5387
|
|
|
@@ -5422,44 +5501,7 @@
|
|
|
5422
5501
|
context.transform(rts[0], rts[1], rts[3], rts[4], rts[6], rts[7]);
|
|
5423
5502
|
};
|
|
5424
5503
|
|
|
5425
|
-
_proto.
|
|
5426
|
-
var color;
|
|
5427
|
-
|
|
5428
|
-
if (parsedColor instanceof g.CSSGradientValue) {
|
|
5429
|
-
if (parsedColor.type === g.GradientPatternType.LinearGradient || parsedColor.type === g.GradientPatternType.RadialGradient) {
|
|
5430
|
-
var bounds = object.getGeometryBounds();
|
|
5431
|
-
var width = bounds && bounds.halfExtents[0] * 2 || 0;
|
|
5432
|
-
var height = bounds && bounds.halfExtents[1] * 2 || 0;
|
|
5433
|
-
color = this.gradientPool.getOrCreateGradient(_extends({
|
|
5434
|
-
type: parsedColor.type
|
|
5435
|
-
}, parsedColor.value, {
|
|
5436
|
-
width: width,
|
|
5437
|
-
height: height
|
|
5438
|
-
}), context);
|
|
5439
|
-
} else if (parsedColor.type === g.GradientPatternType.Pattern) {
|
|
5440
|
-
var pattern = this.imagePool.getPatternSync(parsedColor.value);
|
|
5441
|
-
|
|
5442
|
-
if (pattern) {
|
|
5443
|
-
color = pattern;
|
|
5444
|
-
} else {
|
|
5445
|
-
this.imagePool.createPattern(parsedColor.value, context).then(function () {
|
|
5446
|
-
// set dirty rectangle flag
|
|
5447
|
-
object.renderable.dirty = true;
|
|
5448
|
-
renderingService.dirtify();
|
|
5449
|
-
});
|
|
5450
|
-
}
|
|
5451
|
-
}
|
|
5452
|
-
} else {
|
|
5453
|
-
// use instead of buildCSSText
|
|
5454
|
-
// constant, eg. rgba(255,255,255,1)
|
|
5455
|
-
// color = parsedColor.toString();
|
|
5456
|
-
color = object.attributes[name];
|
|
5457
|
-
}
|
|
5458
|
-
|
|
5459
|
-
return color;
|
|
5460
|
-
};
|
|
5461
|
-
|
|
5462
|
-
_proto.applyAttributesToContext = function applyAttributesToContext(context, object, renderingService) {
|
|
5504
|
+
_proto.applyAttributesToContext = function applyAttributesToContext(context, object) {
|
|
5463
5505
|
var _object$parsedStyle = object.parsedStyle,
|
|
5464
5506
|
stroke = _object$parsedStyle.stroke,
|
|
5465
5507
|
fill = _object$parsedStyle.fill,
|
|
@@ -5487,12 +5529,12 @@
|
|
|
5487
5529
|
context.globalAlpha *= opacity.value;
|
|
5488
5530
|
}
|
|
5489
5531
|
|
|
5490
|
-
if (!g.isNil(stroke) && !stroke.isNone) {
|
|
5491
|
-
context.strokeStyle =
|
|
5532
|
+
if (!g.isNil(stroke) && !Array.isArray(stroke) && !stroke.isNone) {
|
|
5533
|
+
context.strokeStyle = object.attributes.stroke;
|
|
5492
5534
|
}
|
|
5493
5535
|
|
|
5494
|
-
if (!g.isNil(fill) && !fill.isNone) {
|
|
5495
|
-
context.fillStyle =
|
|
5536
|
+
if (!g.isNil(fill) && !Array.isArray(fill) && !fill.isNone) {
|
|
5537
|
+
context.fillStyle = object.attributes.fill;
|
|
5496
5538
|
}
|
|
5497
5539
|
|
|
5498
5540
|
if (!g.isNil(filter)) {
|
|
@@ -5550,10 +5592,6 @@
|
|
|
5550
5592
|
|
|
5551
5593
|
__decorate([g.inject(g.RenderingContext), __metadata("design:type", Object)], CanvasRendererPlugin.prototype, "renderingContext", void 0);
|
|
5552
5594
|
|
|
5553
|
-
__decorate([g.inject(ImagePool), __metadata("design:type", ImagePool)], CanvasRendererPlugin.prototype, "imagePool", void 0);
|
|
5554
|
-
|
|
5555
|
-
__decorate([g.inject(GradientPool), __metadata("design:type", GradientPool)], CanvasRendererPlugin.prototype, "gradientPool", void 0);
|
|
5556
|
-
|
|
5557
5595
|
__decorate([g.inject(PathGeneratorFactory), __metadata("design:type", Function)], CanvasRendererPlugin.prototype, "pathGeneratorFactory", void 0);
|
|
5558
5596
|
|
|
5559
5597
|
__decorate([g.inject(StyleRendererFactory), __metadata("design:type", Function)], CanvasRendererPlugin.prototype, "styleRendererFactory", void 0);
|
|
@@ -5592,7 +5630,6 @@
|
|
|
5592
5630
|
};
|
|
5593
5631
|
}
|
|
5594
5632
|
});
|
|
5595
|
-
register(GradientPool);
|
|
5596
5633
|
register(CanvasRendererPlugin);
|
|
5597
5634
|
});
|
|
5598
5635
|
|
|
@@ -6787,24 +6824,33 @@
|
|
|
6787
6824
|
var color = '';
|
|
6788
6825
|
|
|
6789
6826
|
if (fill instanceof g.CSSRGB) {
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
// ['0', '#ffffff'],
|
|
6795
|
-
return cur[1] + " " + Number(cur[0]) * 100 + "%";
|
|
6796
|
-
}).join(','); // @see https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient()
|
|
6797
|
-
|
|
6798
|
-
color = "linear-gradient(to right, " + steps + ");";
|
|
6827
|
+
if (fill.isNone) {
|
|
6828
|
+
color = 'transparent';
|
|
6829
|
+
} else {
|
|
6830
|
+
color = object.getAttribute('fill');
|
|
6799
6831
|
}
|
|
6800
|
-
}
|
|
6832
|
+
} else if (Array.isArray(fill)) {
|
|
6833
|
+
color = object.getAttribute('fill');
|
|
6834
|
+
} else if (g.isPattern(fill)) ;
|
|
6801
6835
|
|
|
6802
6836
|
$el.style.background = color;
|
|
6803
6837
|
break;
|
|
6804
6838
|
|
|
6805
6839
|
case 'stroke':
|
|
6806
6840
|
var stroke = object.parsedStyle.stroke;
|
|
6807
|
-
|
|
6841
|
+
var borderColor = '';
|
|
6842
|
+
|
|
6843
|
+
if (stroke instanceof g.CSSRGB) {
|
|
6844
|
+
if (stroke.isNone) {
|
|
6845
|
+
borderColor = 'transparent';
|
|
6846
|
+
} else {
|
|
6847
|
+
borderColor = object.getAttribute('stroke');
|
|
6848
|
+
}
|
|
6849
|
+
} else if (Array.isArray(stroke)) {
|
|
6850
|
+
borderColor = object.getAttribute('stroke');
|
|
6851
|
+
} else if (g.isPattern(stroke)) ;
|
|
6852
|
+
|
|
6853
|
+
$el.style['border-color'] = borderColor;
|
|
6808
6854
|
$el.style['border-style'] = 'solid';
|
|
6809
6855
|
break;
|
|
6810
6856
|
|
package/dist/index.umd.min.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g")):"function"==typeof define&&define.amd?define(["exports","@antv/g"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.Canvas2D={}),t.window.G)}(this,(function(t,e){"use strict";function r(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3
|
-
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return
|
|
3
|
+
r=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=Object.create((e&&e.prototype instanceof f?e:f).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function f(){}function v(){}function d(){}var p={};u(p,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(C([])));g&&g!==e&&n.call(g,i)&&(p=g);var m=d.prototype=f.prototype=Object.create(p);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,h=s.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(h).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function b(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,b(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function 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 P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return v.prototype=d,u(m,"constructor",d),u(d,"constructor",v),v.displayName=u(d,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(x.prototype),u(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),u(m,c,"Generator"),u(m,i,(function(){return this})),u(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=C,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(this.prev>=i.tryLoc){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return r(i.catchLoc,!0);if(i.finallyLoc>this.prev)return r(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(this.prev>=o.tryLoc&&n.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}var i=e.Syringe.defineToken("PathGeneratorFactory"),a=e.Syringe.defineToken("PathGenerator");function c(t,e){var r=e.r;t.arc(r.value,r.value,r.value,0,2*Math.PI,!1)}function u(t,e){var r=e.rx.value,n=e.ry.value;if(t.ellipse)t.ellipse(r,n,r,n,0,0,2*Math.PI,!1);else{var o=r>n?r:n,i=r>n?1:r/n,a=r>n?n/r:1;t.save(),t.scale(i,a),t.arc(0,0,o,0,2*Math.PI)}}function s(t,e){var r=e.x2,n=e.y2,o=e.defX,i=void 0===o?0:o,a=e.defY,c=void 0===a?0:a;t.moveTo(e.x1.value-i,e.y1.value-c),t.lineTo(r.value-i,n.value-c)}function l(t,e){var r=e.defX,n=void 0===r?0:r,o=e.defY,i=void 0===o?0:o,a=e.path,c=a.zCommandIndexes,u=[].concat(a.curve);c.forEach((function(t,e){u.splice(t+e,1,["Z"])}));for(var s=0;u.length>s;s++){var l=u[s];switch(l[0]){case"M":t.moveTo(l[1]-n,l[2]-i);break;case"C":t.bezierCurveTo(l[1]-n,l[2]-i,l[3]-n,l[4]-i,l[5]-n,l[6]-i);break;case"Z":t.closePath()}}}function h(t,e){var r=e.defX,n=void 0===r?0:r,o=e.defY,i=void 0===o?0:o,a=e.points.points,c=a.length,u=a[c-1][0]-n,s=a[c-1][1]-i;t.moveTo(a[0][0]-n,a[0][1]-i);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-n,h[1]-i)}t.lineTo(u,s)}function f(t,e){var r=e.defX,n=void 0===r?0:r,o=e.defY,i=void 0===o?0:o,a=e.points.points,c=a.length,u=a[c-1][0]-n,s=a[c-1][1]-i;t.moveTo(a[0][0]-n,a[0][1]-i);for(var l=0;c-1>l;l++){var h=a[l];t.lineTo(h[0]-n,h[1]-i)}t.lineTo(u,s)}function v(t,r){var n=r.radius,o=r.width,i=r.height,a=o.value,c=i.value;if(n&&n.some((function(t){return 0!==t.value}))){var u=o.value>0?1:-1,s=i.value>0?1:-1,l=u+s===0,h=n.map((function(t){return e.clamp(t.value,0,Math.min(Math.abs(a)/2,Math.abs(c)/2))})),f=h[0],v=h[1],d=h[2],p=h[3];t.moveTo(u*f,0),t.lineTo(a-u*v,0),0!==v&&t.arc(a-u*v,s*v,v,-s*Math.PI/2,u>0?0:Math.PI,l),t.lineTo(a,c-s*d),0!==d&&t.arc(a-u*d,c-s*d,d,u>0?0:Math.PI,s>0?Math.PI/2:1.5*Math.PI,l),t.lineTo(u*p,c),0!==p&&t.arc(u*p,c-s*p,p,s>0?Math.PI/2:-Math.PI/2,u>0?Math.PI:0,l),t.lineTo(0,s*f),0!==f&&t.arc(u*f,s*f,f,u>0?Math.PI:0,s>0?1.5*Math.PI:Math.PI/2,l)}else t.rect(0,0,a,c)}var d=e.Module((function(t){t({token:{token:a,named:e.Shape.CIRCLE},useValue:c}),t({token:{token:a,named:e.Shape.ELLIPSE},useValue:u}),t({token:{token:a,named:e.Shape.RECT},useValue:v}),t({token:{token:a,named:e.Shape.LINE},useValue:s}),t({token:{token:a,named:e.Shape.POLYLINE},useValue:f}),t({token:{token:a,named:e.Shape.POLYGON},useValue:h}),t({token:{token:a,named:e.Shape.PATH},useValue:l}),t({token:i,useFactory:function(t){return function(e){return t.container.isBoundNamed(a,e)?t.container.getNamed(a,e):null}}})})),p=function(){function t(){this.name="canvas-path-generator"}var e=t.prototype;return e.init=function(t){t.load(d,!0)},e.destroy=function(t){t.unload(d)},t}(),y=Object.freeze({__proto__:null,PathGenerator:a,PathGeneratorFactory:i,Plugin:p});function g(t,e,r,n){var o,i=arguments.length,a=3>i?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(a=(3>i?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function m(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function w(){
|
|
4
4
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
5
|
-
w=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(C([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(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,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 n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(x.prototype),c(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=C,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function x(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var b="undefined"!=typeof Float32Array?Float32Array:Array;function E(){var t=new b(9);return b!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function L(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],c=e[4],u=e[5],s=e[6],l=e[7],h=e[8],f=r[0],v=r[1],d=r[2],p=r[3],y=r[4],g=r[5],m=r[6],w=r[7],x=r[8];return t[0]=f*n+v*a+d*s,t[1]=f*o+v*c+d*l,t[2]=f*i+v*u+d*h,t[3]=p*n+y*a+g*s,t[4]=p*o+y*c+g*l,t[5]=p*i+y*u+g*h,t[6]=m*n+w*a+x*s,t[7]=m*o+w*c+x*l,t[8]=m*i+w*u+x*h,t}function P(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function C(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function S(){var t=new b(16);return b!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function k(){var t=new b(3);return b!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function O(t,e,r){var n=new b(3);return n[0]=t,n[1]=e,n[2]=r,n}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var T;T=k();function N(t,e){var r=new b(2);return r[0]=t,r[1]=e,r}function j(t,e,r){var n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}!function(){var t,e=(t=new b(2),b!=Float32Array&&(t[0]=0,t[1]=0),t)}();var M,_,A=e.Syringe.defineToken("PointInPathPicker"),R=(M=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.pointInPathPickerFactory=void 0,this.isHit=function(r,n,o){var i,a,c,u,s,l,h,f,v,d,p,y,g,m,w,x,b,E,L,P,C,T,N,j,M,_,A,R,G,F,I,B=t.pointInPathPickerFactory(r.nodeName);if(B){var D=(i=S(),(I=(L=(c=(a=o)[0])*(f=a[5])-(u=a[1])*(h=a[4]))*(F=(g=a[10])*(E=a[15])-(m=a[11])*(b=a[14]))-(P=c*(v=a[6])-(s=a[2])*h)*(G=(y=a[9])*E-m*(x=a[13]))+(C=c*(d=a[7])-(l=a[3])*h)*(R=y*b-g*x)+(T=u*v-s*f)*(A=(p=a[8])*E-m*(w=a[12]))-(N=u*d-l*f)*(_=p*b-g*w)+(j=s*d-l*v)*(M=p*x-y*w))?(i[0]=(f*F-v*G+d*R)*(I=1/I),i[1]=(s*G-u*F-l*R)*I,i[2]=(x*j-b*N+E*T)*I,i[3]=(g*N-y*j-m*T)*I,i[4]=(v*A-h*F-d*_)*I,i[5]=(c*F-s*A+l*_)*I,i[6]=(b*C-w*j-E*P)*I,i[7]=(p*j-g*C+m*P)*I,i[8]=(h*G-f*A+d*M)*I,i[9]=(u*A-c*G-l*M)*I,i[10]=(w*N-x*C+E*L)*I,i[11]=(y*C-p*N-m*L)*I,i[12]=(f*_-h*R-v*M)*I,i[13]=(c*R-u*_+s*M)*I,i[14]=(x*P-w*T-b*L)*I,i[15]=(p*T-y*P+g*L)*I,i):null),Y=function(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}(k(),O(n[0],n[1],0),D),$=r.getGeometryBounds().halfExtents,H=r.parsedStyle.anchor;if(Y[0]+=(H&&H[0].value||0)*$[0]*2,Y[1]+=(H&&H[1].value||0)*$[1]*2,B(r,new e.Point(Y[0],Y[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,r){var n=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas);void 0===t.pathGeneratorFactoryCache[e.nodeName]&&(t.pathGeneratorFactoryCache[e.nodeName]=t.pathGeneratorFactory(e.nodeName));var o=t.pathGeneratorFactoryCache[e.nodeName];return o&&o(n,e.parsedStyle),n.isPointInPath(r.x,r.y)}}return t.prototype.apply=function(t){var e=this;t.hooks.pick.tapPromise(_.tag,function(){var t,r=(t=w().mark((function t(r){var n,o,i,a,c,u,s,l,h,f,v,d,p;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.topmost,i=O((o=r.position).x,o.y,0),a=e.rBush.search({minX:i[0],minY:i[1],maxX:i[0],maxY:i[1]}),c=a.map((function(t){return t.id})),u=[],a.forEach((function(t){var r=e.displayObjectPool.getByEntity(t.id);if(r.isVisible()&&!r.isCulled()&&r.isInteractive()){if(r.parentNode&&-1===c.indexOf(r.parentNode.entity))return;u.push(r)}})),u.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),s=[],l=0,h=u;case 9:if(l>=h.length){t.next=25;break}if(d=(v=(f=h[l]).parsedStyle.clipPath)||f,p=f.getWorldTransform(),v&&(y=S(),g=p,m=v.getLocalTransform(),w=void 0,x=void 0,b=void 0,E=void 0,L=void 0,P=void 0,C=void 0,k=void 0,T=void 0,N=void 0,j=void 0,M=void 0,_=void 0,A=void 0,R=void 0,G=void 0,F=void 0,I=void 0,B=void 0,D=void 0,x=g[1],b=g[2],E=g[3],P=g[5],C=g[6],k=g[7],N=g[9],j=g[10],M=g[11],A=g[13],R=g[14],G=g[15],y[0]=(F=m[0])*(w=g[0])+(I=m[1])*(L=g[4])+(B=m[2])*(T=g[8])+(D=m[3])*(_=g[12]),y[1]=F*x+I*P+B*N+D*A,y[2]=F*b+I*C+B*j+D*R,y[3]=F*E+I*k+B*M+D*G,y[4]=(F=m[4])*w+(I=m[5])*L+(B=m[6])*T+(D=m[7])*_,y[5]=F*x+I*P+B*N+D*A,y[6]=F*b+I*C+B*j+D*R,y[7]=F*E+I*k+B*M+D*G,y[8]=(F=m[8])*w+(I=m[9])*L+(B=m[10])*T+(D=m[11])*_,y[9]=F*x+I*P+B*N+D*A,y[10]=F*b+I*C+B*j+D*R,y[11]=F*E+I*k+B*M+D*G,y[12]=(F=m[12])*w+(I=m[13])*L+(B=m[14])*T+(D=m[15])*_,y[13]=F*x+I*P+B*N+D*A,y[14]=F*b+I*C+B*j+D*R,y[15]=F*E+I*k+B*M+D*G,p=y),!e.isHit(d,i,p)){t.next=22;break}if(!n){t.next=21;break}return r.picked=[f],t.abrupt("return",r);case 21:s.push(f);case 22:l++,t.next=9;break;case 25:return r.picked=s,t.abrupt("return",r);case 27:case"end":return t.stop()}var y,g,m,w,x,b,E,L,P,C,k,T,N,j,M,_,A,R,G,F,I,B,D}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){x(i,n,o,a,c,"next",t)}function c(t){x(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}())},t}(),M.tag="CanvasPicker",_=M);function G(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function F(t,e){return.001>Math.abs(t-e)}function I(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}function B(t){return(t+2*Math.PI)%(2*Math.PI)}g([e.inject(e.DisplayObjectPool),m("design:type",e.DisplayObjectPool)],R.prototype,"displayObjectPool",void 0),g([e.inject(e.CanvasConfig),m("design:type",Object)],R.prototype,"canvasConfig",void 0),g([e.inject(e.OffscreenCanvasCreator),m("design:type",e.OffscreenCanvasCreator)],R.prototype,"offscreenCanvas",void 0),g([e.inject(e.RBushRoot),m("design:type",e.RBush)],R.prototype,"rBush",void 0),g([e.inject(i),m("design:type",Function)],R.prototype,"pathGeneratorFactory",void 0),g([e.inject(A),m("design:type",Function)],R.prototype,"pointInPathPickerFactory",void 0),R=_=g([e.singleton({contrib:e.RenderingPluginContribution})],R);var D=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},Y=function(t,e,r,n,o,i){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([o-t,i-e],c))};function $(t,e,r,n,o,i){var a=-1,c=1/0,u=[r,n],s=20;i&&i>200&&(s=i/10);for(var l=1/s,h=l/10,f=0;s>=f;f++){var v=f*l,d=[o.apply(void 0,t.concat([v])),o.apply(void 0,e.concat([v]))],p=G(u[0],u[1],d[0],d[1]);c>p&&(a=v,c=p)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&1e-4<=h;g++){var m=a-h,w=a+h,x=[o.apply(void 0,t.concat([m])),o.apply(void 0,e.concat([m]))],b=G(u[0],u[1],x[0],x[1]);if(m>=0&&c>b)a=m,c=b;else{var E=[o.apply(void 0,t.concat([w])),o.apply(void 0,e.concat([w]))],L=G(u[0],u[1],E[0],E[1]);1>=w&&c>L?(a=w,c=L):h*=.5}}return{x:o.apply(void 0,t.concat([a])),y:o.apply(void 0,e.concat([a]))}}function H(t,e,r,n){var o=1-n;return o*o*t+2*n*o*e+n*n*r}function W(t,e,r){var n=t+r-2*e;if(F(n,0))return[.5];var o=(t-e)/n;return o>1||0>o?[]:[o]}function U(t,e,r,n){return 2*(1-n)*(e-t)+2*n*(r-e)}function X(t,e,r,n,o,i,a){var c=H(t,r,o,a),u=H(e,n,i,a),s=D(t,e,r,n,a),l=D(r,n,o,i,a);return[[t,e,s.x,s.y,c,u],[c,u,l.x,l.y,o,i]]}function q(t,e,r,n,o,i,a){if(0===a)return(G(t,e,r,n)+G(r,n,o,i)+G(t,e,o,i))/2;var c=X(t,e,r,n,o,i,.5),u=c[0],s=c[1];return u.push(a-1),s.push(a-1),q.apply(void 0,u)+q.apply(void 0,s)}var V={box:function(t,e,r,n,o,i){var a=W(t,r,o)[0],c=W(e,n,i)[0],u=[t,o],s=[e,i];return void 0!==a&&u.push(H(t,r,o,a)),void 0!==c&&s.push(H(e,n,i,c)),I(u,s)},length:function(t,e,r,n,o,i){return q(t,e,r,n,o,i,3)},nearestPoint:function(t,e,r,n,o,i,a,c){return $([t,r,o],[e,n,i],a,c,H)},pointDistance:function(t,e,r,n,o,i,a,c){var u=this.nearestPoint(t,e,r,n,o,i,a,c);return G(u.x,u.y,a,c)},interpolationAt:H,pointAt:function(t,e,r,n,o,i,a){return{x:H(t,r,o,a),y:H(e,n,i,a)}},divide:function(t,e,r,n,o,i,a){return X(t,e,r,n,o,i,a)},tangentAngle:function(t,e,r,n,o,i,a){var c=U(t,r,o,a),u=U(e,n,i,a);return B(Math.atan2(u,c))}};function z(t,e,r,n,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*r*o*o*i+n*o*o*o}function Q(t,e,r,n,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(r-e)+o*o*(n-r))}function K(t,e,r,n){var o,i,a,c=-3*t+9*e-9*r+3*n,u=6*t-12*e+6*r,s=3*e-3*t,l=[];if(F(c,0))F(u,0)||0>(o=-s/u)||o>1||l.push(o);else{var h=u*u-4*c*s;F(h,0)?l.push(-u/(2*c)):h>0&&(i=(-u-(a=Math.sqrt(h)))/(2*c),0>(o=(-u+a)/(2*c))||o>1||l.push(o),0>i||i>1||l.push(i))}return l}function J(t,e,r,n,o,i,a,c,u){var s=z(t,r,o,a,u),l=z(e,n,i,c,u),h=D(t,e,r,n,u),f=D(r,n,o,i,u),v=D(o,i,a,c,u),d=D(h.x,h.y,f.x,f.y,u),p=D(f.x,f.y,v.x,v.y,u);return[[t,e,h.x,h.y,d.x,d.y,s,l],[s,l,p.x,p.y,v.x,v.y,a,c]]}function Z(t,e,r,n,o,i,a,c,u){if(0===u)return function(t,e){for(var r=0,n=t.length,o=0;n>o;o++)r+=G(t[o],e[o],t[(o+1)%n],e[(o+1)%n]);return r/2}([t,r,o,a],[e,n,i,c]);var s=J(t,e,r,n,o,i,a,c,.5),l=[].concat(s[0],[u-1]),h=[].concat(s[1],[u-1]);return Z.apply(void 0,l)+Z.apply(void 0,h)}var tt={extrema:K,box:function(t,e,r,n,o,i,a,c){for(var u=[t,a],s=[e,c],l=K(t,r,o,a),h=K(e,n,i,c),f=0;l.length>f;f++)u.push(z(t,r,o,a,l[f]));for(var v=0;h.length>v;v++)s.push(z(e,n,i,c,h[v]));return I(u,s)},length:function(t,e,r,n,o,i,a,c){return Z(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,u,s,l){return $([t,r,o,a],[e,n,i,c],u,s,z,l)},pointDistance:function(t,e,r,n,o,i,a,c,u,s,l){var h=this.nearestPoint(t,e,r,n,o,i,a,c,u,s,l);return G(h.x,h.y,u,s)},interpolationAt:z,pointAt:function(t,e,r,n,o,i,a,c,u){return{x:z(t,r,o,a,u),y:z(e,n,i,c,u)}},divide:function(t,e,r,n,o,i,a,c,u){return J(t,e,r,n,o,i,a,c,u)},tangentAngle:function(t,e,r,n,o,i,a,c,u){var s=Q(t,r,o,a,u),l=Q(e,n,i,c,u);return B(Math.atan2(l,s))}};function et(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function rt(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function nt(t,e,r,n,o,i,a,c){var u=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(n>u||u>o)return!1;var s={x:t+r*Math.cos(u),y:e+r*Math.sin(u)};return et(s.x,s.y,a,c)<=i/2}function ot(t,e,r,n,o,i,a){var c=Math.min(t,r),u=Math.max(t,r),s=Math.min(e,n),l=Math.max(e,n),h=o/2;return!(c-h>i||i>u+h||s-h>a||a>l+h)&&Y(t,e,r,n,i,a)<=o/2}function it(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(ot(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(o){var c=t[0],u=t[i-1];if(ot(c[0],c[1],u[0],u[1],e,r,n))return!0}return!1}function at(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function ct(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function ut(t,e,r){var n=!1,o=t.length;if(2>=o)return!1;for(var i=0;o>i;i++){var a=t[i],c=t[(i+1)%o];if(ct(a,c,[e,r]))return!0;at(a[1]-r)>0!=at(c[1]-r)>0&&0>at(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function st(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=ut(t[o],e,r))break}return n}function lt(t,e){var r=t.parsedStyle,n=r.fill,o=r.stroke,i=r.lineWidth,a=r.increasedLineWidthForHitTesting,c=r.clipPathTargets,u=r.r.value,s=((i&&i.value||0)+(a&&a.value||0))/2,l=et(u,u,e.x,e.y),h=n&&!n.isNone,f=o&&!o.isNone;return h&&f||!!(null==c?void 0:c.length)?u+s>=l:h?u>=l:!!f&&(l>=u-s&&u+s>=l)}function ht(t,e,r,n){return t/(r*r)+e/(n*n)}function ft(t,e){var r=e.x,n=e.y,o=t.parsedStyle,i=o.fill,a=o.stroke,c=o.lineWidth,u=o.clipPathTargets,s=i&&!i.isNone,l=a&&!a.isNone,h=o.rx.value,f=o.ry.value,v=(((null==c?void 0:c.value)||0)+o.increasedLineWidthForHitTesting.value)/2,d=(r-h)*(r-h),p=(n-f)*(n-f);return s&&l||!!(null==u?void 0:u.length)?1>=ht(d,p,h+v,f+v):s?1>=ht(d,p,h,f):!!l&&(ht(d,p,h-v,f-v)>=1&&1>=ht(d,p,h+v,f+v))}function vt(t,e){var r=t.parsedStyle,n=r.defX,o=r.defY;return ot(r.x1.value,r.y1.value,r.x2.value,r.y2.value,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+(void 0===n?0:n),e.y+(void 0===o?0:o))}function dt(t,e,r){var n=t.parsedStyle,o=n.stroke,i=n.fill,a=n.defX,c=void 0===a?0:a,u=n.defY,s=void 0===u?0:u,l=n.clipPathTargets,h=n.path,f=i&&!i.isNone,v=h.hasArc,d=h.polylines,p=h.polygons,y=!!(null==l?void 0:l.length),g=!1;return(o&&!o.isNone||y)&&(g=function(t,e,r,n,o,i,a){for(var c,u,s=!1,l=e/2,h=0;t.length>h;h++){var f=t[h],v=f.currentPoint,d=f.params,p=f.prePoint,y=f.box;if(!y||rt(y.x-l,y.y-l,y.width+e,y.height+e,r,n)){switch(f.command){case"L":case"Z":s=ot(p[0],p[1],v[0],v[1],e,r,n);break;case"Q":s=e/2>=V.pointDistance(p[0],p[1],d[1],d[2],d[3],d[4],r,n);break;case"C":s=e/2>=tt.pointDistance(p[0],p[1],d[1],d[2],d[3],d[4],d[5],d[6],r,n,o);break;case"A":var g=f.arcParams,m=g.rx,w=g.ry,x=g.startAngle,b=g.endAngle,S=g.xRotation,k=m>w?m:w,O=m>w?1:m/w,T=m>w?w/m:1,M=(u=[-g.cx,-g.cy],(c=E())[0]=1,c[1]=0,c[2]=0,c[3]=0,c[4]=1,c[5]=0,c[6]=u[0],c[7]=u[1],c[8]=1,c);L(M,P(E(),-S),M),L(M,C(E(),[1/O,1/T]),M);var _=N(r,n);s=nt(0,0,k,x,b,e,(_=j(_,_,M))[0],_[1])}if(s)break}}return s}(h.segments,n.lineWidth.value+n.increasedLineWidthForHitTesting.value,e.x+c,e.y+s,h.totalLength)),g||!f&&!y||(g=v?r(t,e):st(p,e.x+c,e.y+s)||st(d,e.x+c,e.y+s)),g}function pt(t,e){var r=t.parsedStyle,n=r.stroke,o=r.fill,i=r.points,a=r.defX,c=void 0===a?0:a,u=r.defY,s=void 0===u?0:u,l=r.clipPathTargets,h=!!(null==l?void 0:l.length),f=o&&!o.isNone,v=!1;return(n&&!n.isNone||h)&&(v=it(i.points,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+c,e.y+s,!0)),v||!f&&!h||(v=ut(i.points,e.x+c,e.y+s)),v}function yt(t,e){var r=t.parsedStyle,n=r.stroke,o=r.lineWidth,i=r.defX,a=r.defY,c=r.clipPathTargets;return!((!n||n.isNone)&&!(null==c?void 0:c.length)||!o)&&it(r.points.points,o.value+r.increasedLineWidthForHitTesting.value,e.x+(void 0===i?0:i),e.y+(void 0===a?0:a),!1)}function gt(t,r,n){var o=t.parsedStyle,i=o.radius,a=o.fill,c=o.stroke,u=o.lineWidth,s=o.increasedLineWidthForHitTesting,l=o.width,h=o.height,f=o.clipPathTargets,v=!!(null==f?void 0:f.length),d=a&&!a.isNone,p=c&&!c.isNone,y=i&&i.some((function(t){return 0!==t.value})),g=l.unit,m=h.unit,w=0,x=0;g!==e.UnitType.kNumber&&g!==e.UnitType.kPixels||(w=l.value),m!==e.UnitType.kNumber&&m!==e.UnitType.kPixels||(x=h.value);var b=u.value+s.value;if(y){var E=!1;return(p||v)&&(E=function(t,e,r,n,o,i,a,c){var u=o[0],s=o[1],l=o[2],h=o[3];return ot(t+u,e,t+r-s,e,i,a,c)||ot(t+r,e+s,t+r,e+n-l,i,a,c)||ot(t+r-l,e+n,t+h,e+n,i,a,c)||ot(t,e+n-h,t,e+u,i,a,c)||nt(t+r-s,e+s,s,1.5*Math.PI,2*Math.PI,i,a,c)||nt(t+r-l,e+n-l,l,0,.5*Math.PI,i,a,c)||nt(t+h,e+n-h,h,.5*Math.PI,Math.PI,i,a,c)||nt(t+u,e+u,u,Math.PI,1.5*Math.PI,i,a,c)}(0,0,w,x,i.map((function(t){return e.clamp(t.value,0,Math.min(w/2,x/2))})),b,r.x,r.y)),E||!d&&!v||(E=n(t,r)),E}var L=b/2;return d&&p||v?rt(0-L,0-L,w+L,x+L,r.x,r.y):d?rt(0,0,w,x,r.x,r.y):!!p&&function(t,e,r,n,o,i,a){var c=o/2;return rt(t-c,e-c,r,o,i,a)||rt(t+r-c,e-c,o,n,i,a)||rt(t+c,e+n-c,r,o,i,a)||rt(t-c,e+c,o,n,i,a)}(0,0,w,x,b,r.x,r.y)}var mt,wt,xt=e.Module((function(t){t({token:A,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?lt:t===e.Shape.ELLIPSE?ft:t===e.Shape.RECT?gt:t===e.Shape.LINE?vt:t===e.Shape.POLYLINE?yt:t===e.Shape.POLYGON?pt:t===e.Shape.PATH?dt:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(R)})),bt=function(){function t(){this.name="canvas-picker"}var e=t.prototype;return e.init=function(t){t.load(xt,!0)},e.destroy=function(t){t.unload(xt)},t}(),Et=Object.freeze({__proto__:null,Plugin:bt}),Lt=function(){function t(){this.imageCache={},this.patternCache={},this.canvasConfig=void 0}var r=t.prototype;return r.getImageSync=function(t){return this.imageCache[t]},r.getOrCreateImage=function(t){var r=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(o,i){var a;n?a=n(t):e.isBrowser&&(a=new window.Image),a&&(a.onload=function(){o(a)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=t,r.imageCache[t]=a)}))},r.getPatternSync=function(t){var e=this.generatePatternKey(t);if(this.patternCache[e])return this.patternCache[e]},r.createPattern=function(t,e){var r=this;return this.getOrCreateImage(t.src).then((function(n){var o=r.generatePatternKey(t),i=e.createPattern(n,t.repetition);return i&&(r.patternCache[o]=i),r.patternCache[o]}))},r.generatePatternKey=function(t){return"pattern-"+t.src+"-"+t.repetition},t}();function Pt(){
|
|
5
|
+
w=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new P(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=b(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(C([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function b(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,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 n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(x.prototype),c(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=C,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},t}function x(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var b="undefined"!=typeof Float32Array?Float32Array:Array;function E(){var t=new b(9);return b!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function L(t,e,r){var n=e[0],o=e[1],i=e[2],a=e[3],c=e[4],u=e[5],s=e[6],l=e[7],h=e[8],f=r[0],v=r[1],d=r[2],p=r[3],y=r[4],g=r[5],m=r[6],w=r[7],x=r[8];return t[0]=f*n+v*a+d*s,t[1]=f*o+v*c+d*l,t[2]=f*i+v*u+d*h,t[3]=p*n+y*a+g*s,t[4]=p*o+y*c+g*l,t[5]=p*i+y*u+g*h,t[6]=m*n+w*a+x*s,t[7]=m*o+w*c+x*l,t[8]=m*i+w*u+x*h,t}function P(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function C(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function k(){var t=new b(16);return b!=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 S(){var t=new b(3);return b!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function O(t,e,r){var n=new b(3);return n[0]=t,n[1]=e,n[2]=r,n}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var T;T=S();function N(t,e){var r=new b(2);return r[0]=t,r[1]=e,r}function j(t,e,r){var n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}!function(){var t,e=(t=new b(2),b!=Float32Array&&(t[0]=0,t[1]=0),t)}();var M,A,_=e.Syringe.defineToken("PointInPathPicker"),R=(M=function(){function t(){var t=this;this.displayObjectPool=void 0,this.canvasConfig=void 0,this.offscreenCanvas=void 0,this.rBush=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.pointInPathPickerFactory=void 0,this.isHit=function(r,n,o){var i,a,c,u,s,l,h,f,v,d,p,y,g,m,w,x,b,E,L,P,C,T,N,j,M,A,_,R,G,F,I,B=t.pointInPathPickerFactory(r.nodeName);if(B){var D=(i=k(),(I=(L=(c=(a=o)[0])*(f=a[5])-(u=a[1])*(h=a[4]))*(F=(g=a[10])*(E=a[15])-(m=a[11])*(b=a[14]))-(P=c*(v=a[6])-(s=a[2])*h)*(G=(y=a[9])*E-m*(x=a[13]))+(C=c*(d=a[7])-(l=a[3])*h)*(R=y*b-g*x)+(T=u*v-s*f)*(_=(p=a[8])*E-m*(w=a[12]))-(N=u*d-l*f)*(A=p*b-g*w)+(j=s*d-l*v)*(M=p*x-y*w))?(i[0]=(f*F-v*G+d*R)*(I=1/I),i[1]=(s*G-u*F-l*R)*I,i[2]=(x*j-b*N+E*T)*I,i[3]=(g*N-y*j-m*T)*I,i[4]=(v*_-h*F-d*A)*I,i[5]=(c*F-s*_+l*A)*I,i[6]=(b*C-w*j-E*P)*I,i[7]=(p*j-g*C+m*P)*I,i[8]=(h*G-f*_+d*M)*I,i[9]=(u*_-c*G-l*M)*I,i[10]=(w*N-x*C+E*L)*I,i[11]=(y*C-p*N-m*L)*I,i[12]=(f*A-h*R-v*M)*I,i[13]=(c*R-u*A+s*M)*I,i[14]=(x*P-w*T-b*L)*I,i[15]=(p*T-y*P+g*L)*I,i):null),Y=function(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return t[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/(a=a||1),t[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,t[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,t}(S(),O(n[0],n[1],0),D),$=r.getGeometryBounds().halfExtents,H=r.parsedStyle.anchor;if(Y[0]+=(H&&H[0].value||0)*$[0]*2,Y[1]+=(H&&H[1].value||0)*$[1]*2,B(r,new e.Point(Y[0],Y[1]),t.isPointInPath))return!0}return!1},this.isPointInPath=function(e,r){var n=t.offscreenCanvas.getOrCreateContext(t.canvasConfig.offscreenCanvas);void 0===t.pathGeneratorFactoryCache[e.nodeName]&&(t.pathGeneratorFactoryCache[e.nodeName]=t.pathGeneratorFactory(e.nodeName));var o=t.pathGeneratorFactoryCache[e.nodeName];return o&&o(n,e.parsedStyle),n.isPointInPath(r.x,r.y)}}return t.prototype.apply=function(t){var e=this;t.hooks.pick.tapPromise(A.tag,function(){var t,r=(t=w().mark((function t(r){var n,o,i,a,c,u,s,l,h,f,v,d,p;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.topmost,i=O((o=r.position).x,o.y,0),a=e.rBush.search({minX:i[0],minY:i[1],maxX:i[0],maxY:i[1]}),c=a.map((function(t){return t.id})),u=[],a.forEach((function(t){var r=e.displayObjectPool.getByEntity(t.id);if(r.isVisible()&&!r.isCulled()&&r.isInteractive()){if(r.parentNode&&-1===c.indexOf(r.parentNode.entity))return;u.push(r)}})),u.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),s=[],l=0,h=u;case 9:if(l>=h.length){t.next=25;break}if(d=(v=(f=h[l]).parsedStyle.clipPath)||f,p=f.getWorldTransform(),v&&(y=k(),g=p,m=v.getLocalTransform(),w=void 0,x=void 0,b=void 0,E=void 0,L=void 0,P=void 0,C=void 0,S=void 0,T=void 0,N=void 0,j=void 0,M=void 0,A=void 0,_=void 0,R=void 0,G=void 0,F=void 0,I=void 0,B=void 0,D=void 0,x=g[1],b=g[2],E=g[3],P=g[5],C=g[6],S=g[7],N=g[9],j=g[10],M=g[11],_=g[13],R=g[14],G=g[15],y[0]=(F=m[0])*(w=g[0])+(I=m[1])*(L=g[4])+(B=m[2])*(T=g[8])+(D=m[3])*(A=g[12]),y[1]=F*x+I*P+B*N+D*_,y[2]=F*b+I*C+B*j+D*R,y[3]=F*E+I*S+B*M+D*G,y[4]=(F=m[4])*w+(I=m[5])*L+(B=m[6])*T+(D=m[7])*A,y[5]=F*x+I*P+B*N+D*_,y[6]=F*b+I*C+B*j+D*R,y[7]=F*E+I*S+B*M+D*G,y[8]=(F=m[8])*w+(I=m[9])*L+(B=m[10])*T+(D=m[11])*A,y[9]=F*x+I*P+B*N+D*_,y[10]=F*b+I*C+B*j+D*R,y[11]=F*E+I*S+B*M+D*G,y[12]=(F=m[12])*w+(I=m[13])*L+(B=m[14])*T+(D=m[15])*A,y[13]=F*x+I*P+B*N+D*_,y[14]=F*b+I*C+B*j+D*R,y[15]=F*E+I*S+B*M+D*G,p=y),!e.isHit(d,i,p)){t.next=22;break}if(!n){t.next=21;break}return r.picked=[f],t.abrupt("return",r);case 21:s.push(f);case 22:l++,t.next=9;break;case 25:return r.picked=s,t.abrupt("return",r);case 27:case"end":return t.stop()}var y,g,m,w,x,b,E,L,P,C,S,T,N,j,M,A,_,R,G,F,I,B,D}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){x(i,n,o,a,c,"next",t)}function c(t){x(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}())},t}(),M.tag="CanvasPicker",A=M);function G(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function F(t,e){return.001>Math.abs(t-e)}function I(t,e){var r=Math.min.apply(Math,t),n=Math.min.apply(Math,e);return{x:r,y:n,width:Math.max.apply(Math,t)-r,height:Math.max.apply(Math,e)-n}}function B(t){return(t+2*Math.PI)%(2*Math.PI)}g([e.inject(e.DisplayObjectPool),m("design:type",e.DisplayObjectPool)],R.prototype,"displayObjectPool",void 0),g([e.inject(e.CanvasConfig),m("design:type",Object)],R.prototype,"canvasConfig",void 0),g([e.inject(e.OffscreenCanvasCreator),m("design:type",e.OffscreenCanvasCreator)],R.prototype,"offscreenCanvas",void 0),g([e.inject(e.RBushRoot),m("design:type",e.RBush)],R.prototype,"rBush",void 0),g([e.inject(i),m("design:type",Function)],R.prototype,"pathGeneratorFactory",void 0),g([e.inject(_),m("design:type",Function)],R.prototype,"pointInPathPickerFactory",void 0),R=A=g([e.singleton({contrib:e.RenderingPluginContribution})],R);var D=function(t,e,r,n,o){return{x:(1-o)*t+o*r,y:(1-o)*e+o*n}},Y=function(t,e,r,n,o,i){var a=[r-t,n-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((o-t)*(o-t)+(i-e)*(i-e));var c=[-a[1],a[0]];return function(t,e){var r=e[0],n=e[1],o=r*r+n*n;o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o}(c,c),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([o-t,i-e],c))};function $(t,e,r,n,o,i){var a=-1,c=1/0,u=[r,n],s=20;i&&i>200&&(s=i/10);for(var l=1/s,h=l/10,f=0;s>=f;f++){var v=f*l,d=[o.apply(void 0,t.concat([v])),o.apply(void 0,e.concat([v]))],p=G(u[0],u[1],d[0],d[1]);c>p&&(a=v,c=p)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var y=t.length;return{x:t[y-1],y:e[y-1]}}c=1/0;for(var g=0;32>g&&1e-4<=h;g++){var m=a-h,w=a+h,x=[o.apply(void 0,t.concat([m])),o.apply(void 0,e.concat([m]))],b=G(u[0],u[1],x[0],x[1]);if(m>=0&&c>b)a=m,c=b;else{var E=[o.apply(void 0,t.concat([w])),o.apply(void 0,e.concat([w]))],L=G(u[0],u[1],E[0],E[1]);1>=w&&c>L?(a=w,c=L):h*=.5}}return{x:o.apply(void 0,t.concat([a])),y:o.apply(void 0,e.concat([a]))}}function H(t,e,r,n){var o=1-n;return o*o*t+2*n*o*e+n*n*r}function W(t,e,r){var n=t+r-2*e;if(F(n,0))return[.5];var o=(t-e)/n;return o>1||0>o?[]:[o]}function U(t,e,r,n){return 2*(1-n)*(e-t)+2*n*(r-e)}function X(t,e,r,n,o,i,a){var c=H(t,r,o,a),u=H(e,n,i,a),s=D(t,e,r,n,a),l=D(r,n,o,i,a);return[[t,e,s.x,s.y,c,u],[c,u,l.x,l.y,o,i]]}function q(t,e,r,n,o,i,a){if(0===a)return(G(t,e,r,n)+G(r,n,o,i)+G(t,e,o,i))/2;var c=X(t,e,r,n,o,i,.5),u=c[0],s=c[1];return u.push(a-1),s.push(a-1),q.apply(void 0,u)+q.apply(void 0,s)}var z={box:function(t,e,r,n,o,i){var a=W(t,r,o)[0],c=W(e,n,i)[0],u=[t,o],s=[e,i];return void 0!==a&&u.push(H(t,r,o,a)),void 0!==c&&s.push(H(e,n,i,c)),I(u,s)},length:function(t,e,r,n,o,i){return q(t,e,r,n,o,i,3)},nearestPoint:function(t,e,r,n,o,i,a,c){return $([t,r,o],[e,n,i],a,c,H)},pointDistance:function(t,e,r,n,o,i,a,c){var u=this.nearestPoint(t,e,r,n,o,i,a,c);return G(u.x,u.y,a,c)},interpolationAt:H,pointAt:function(t,e,r,n,o,i,a){return{x:H(t,r,o,a),y:H(e,n,i,a)}},divide:function(t,e,r,n,o,i,a){return X(t,e,r,n,o,i,a)},tangentAngle:function(t,e,r,n,o,i,a){var c=U(t,r,o,a),u=U(e,n,i,a);return B(Math.atan2(u,c))}};function V(t,e,r,n,o){var i=1-o;return i*i*i*t+3*e*o*i*i+3*r*o*o*i+n*o*o*o}function Q(t,e,r,n,o){var i=1-o;return 3*(i*i*(e-t)+2*i*o*(r-e)+o*o*(n-r))}function J(t,e,r,n){var o,i,a,c=-3*t+9*e-9*r+3*n,u=6*t-12*e+6*r,s=3*e-3*t,l=[];if(F(c,0))F(u,0)||0>(o=-s/u)||o>1||l.push(o);else{var h=u*u-4*c*s;F(h,0)?l.push(-u/(2*c)):h>0&&(i=(-u-(a=Math.sqrt(h)))/(2*c),0>(o=(-u+a)/(2*c))||o>1||l.push(o),0>i||i>1||l.push(i))}return l}function K(t,e,r,n,o,i,a,c,u){var s=V(t,r,o,a,u),l=V(e,n,i,c,u),h=D(t,e,r,n,u),f=D(r,n,o,i,u),v=D(o,i,a,c,u),d=D(h.x,h.y,f.x,f.y,u),p=D(f.x,f.y,v.x,v.y,u);return[[t,e,h.x,h.y,d.x,d.y,s,l],[s,l,p.x,p.y,v.x,v.y,a,c]]}function Z(t,e,r,n,o,i,a,c,u){if(0===u)return function(t,e){for(var r=0,n=t.length,o=0;n>o;o++)r+=G(t[o],e[o],t[(o+1)%n],e[(o+1)%n]);return r/2}([t,r,o,a],[e,n,i,c]);var s=K(t,e,r,n,o,i,a,c,.5),l=[].concat(s[0],[u-1]),h=[].concat(s[1],[u-1]);return Z.apply(void 0,l)+Z.apply(void 0,h)}var tt={extrema:J,box:function(t,e,r,n,o,i,a,c){for(var u=[t,a],s=[e,c],l=J(t,r,o,a),h=J(e,n,i,c),f=0;l.length>f;f++)u.push(V(t,r,o,a,l[f]));for(var v=0;h.length>v;v++)s.push(V(e,n,i,c,h[v]));return I(u,s)},length:function(t,e,r,n,o,i,a,c){return Z(t,e,r,n,o,i,a,c,3)},nearestPoint:function(t,e,r,n,o,i,a,c,u,s,l){return $([t,r,o,a],[e,n,i,c],u,s,V,l)},pointDistance:function(t,e,r,n,o,i,a,c,u,s,l){var h=this.nearestPoint(t,e,r,n,o,i,a,c,u,s,l);return G(h.x,h.y,u,s)},interpolationAt:V,pointAt:function(t,e,r,n,o,i,a,c,u){return{x:V(t,r,o,a,u),y:V(e,n,i,c,u)}},divide:function(t,e,r,n,o,i,a,c,u){return K(t,e,r,n,o,i,a,c,u)},tangentAngle:function(t,e,r,n,o,i,a,c,u){var s=Q(t,r,o,a,u),l=Q(e,n,i,c,u);return B(Math.atan2(l,s))}};function et(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)}function rt(t,e,r,n,o,i){return!(t>o||o>t+r||e>i||i>e+n)}function nt(t,e,r,n,o,i,a,c){var u=(Math.atan2(c-e,a-t)+2*Math.PI)%(2*Math.PI);if(n>u||u>o)return!1;var s={x:t+r*Math.cos(u),y:e+r*Math.sin(u)};return et(s.x,s.y,a,c)<=i/2}function ot(t,e,r,n,o,i,a){var c=Math.min(t,r),u=Math.max(t,r),s=Math.min(e,n),l=Math.max(e,n),h=o/2;return!(c-h>i||i>u+h||s-h>a||a>l+h)&&Y(t,e,r,n,i,a)<=o/2}function it(t,e,r,n,o){var i=t.length;if(2>i)return!1;for(var a=0;i-1>a;a++){if(ot(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,r,n))return!0}if(o){var c=t[0],u=t[i-1];if(ot(c[0],c[1],u[0],u[1],e,r,n))return!0}return!1}function at(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function ct(t,e,r){return!((r[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(r[1]-t[1])||Math.min(t[0],e[0])>r[0]||r[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>r[1]||r[1]>Math.max(t[1],e[1]))}function ut(t,e,r){var n=!1,o=t.length;if(2>=o)return!1;for(var i=0;o>i;i++){var a=t[i],c=t[(i+1)%o];if(ct(a,c,[e,r]))return!0;at(a[1]-r)>0!=at(c[1]-r)>0&&0>at(e-(r-a[1])*(a[0]-c[0])/(a[1]-c[1])-a[0])&&(n=!n)}return n}function st(t,e,r){for(var n=!1,o=0;t.length>o;o++){if(n=ut(t[o],e,r))break}return n}function lt(t,e){var r=t.parsedStyle,n=r.fill,o=r.stroke,i=r.lineWidth,a=r.increasedLineWidthForHitTesting,c=r.clipPathTargets,u=r.r.value,s=((i&&i.value||0)+(a&&a.value||0))/2,l=et(u,u,e.x,e.y),h=n&&!n.isNone,f=o&&!o.isNone;return h&&f||!!(null==c?void 0:c.length)?u+s>=l:h?u>=l:!!f&&(l>=u-s&&u+s>=l)}function ht(t,e,r,n){return t/(r*r)+e/(n*n)}function ft(t,e){var r=e.x,n=e.y,o=t.parsedStyle,i=o.fill,a=o.stroke,c=o.lineWidth,u=o.clipPathTargets,s=i&&!i.isNone,l=a&&!a.isNone,h=o.rx.value,f=o.ry.value,v=(((null==c?void 0:c.value)||0)+o.increasedLineWidthForHitTesting.value)/2,d=(r-h)*(r-h),p=(n-f)*(n-f);return s&&l||!!(null==u?void 0:u.length)?1>=ht(d,p,h+v,f+v):s?1>=ht(d,p,h,f):!!l&&(ht(d,p,h-v,f-v)>=1&&1>=ht(d,p,h+v,f+v))}function vt(t,e){var r=t.parsedStyle,n=r.defX,o=r.defY;return ot(r.x1.value,r.y1.value,r.x2.value,r.y2.value,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+(void 0===n?0:n),e.y+(void 0===o?0:o))}function dt(t,e,r){var n=t.parsedStyle,o=n.stroke,i=n.fill,a=n.defX,c=void 0===a?0:a,u=n.defY,s=void 0===u?0:u,l=n.clipPathTargets,h=n.path,f=i&&!i.isNone,v=h.hasArc,d=h.polylines,p=h.polygons,y=!!(null==l?void 0:l.length),g=!1;return(o&&!o.isNone||y)&&(g=function(t,e,r,n,o,i,a){for(var c,u,s=!1,l=e/2,h=0;t.length>h;h++){var f=t[h],v=f.currentPoint,d=f.params,p=f.prePoint,y=f.box;if(!y||rt(y.x-l,y.y-l,y.width+e,y.height+e,r,n)){switch(f.command){case"L":case"Z":s=ot(p[0],p[1],v[0],v[1],e,r,n);break;case"Q":s=e/2>=z.pointDistance(p[0],p[1],d[1],d[2],d[3],d[4],r,n);break;case"C":s=e/2>=tt.pointDistance(p[0],p[1],d[1],d[2],d[3],d[4],d[5],d[6],r,n,o);break;case"A":var g=f.arcParams,m=g.rx,w=g.ry,x=g.startAngle,b=g.endAngle,k=g.xRotation,S=m>w?m:w,O=m>w?1:m/w,T=m>w?w/m:1,M=(u=[-g.cx,-g.cy],(c=E())[0]=1,c[1]=0,c[2]=0,c[3]=0,c[4]=1,c[5]=0,c[6]=u[0],c[7]=u[1],c[8]=1,c);L(M,P(E(),-k),M),L(M,C(E(),[1/O,1/T]),M);var A=N(r,n);s=nt(0,0,S,x,b,e,(A=j(A,A,M))[0],A[1])}if(s)break}}return s}(h.segments,n.lineWidth.value+n.increasedLineWidthForHitTesting.value,e.x+c,e.y+s,h.totalLength)),g||!f&&!y||(g=v?r(t,e):st(p,e.x+c,e.y+s)||st(d,e.x+c,e.y+s)),g}function pt(t,e){var r=t.parsedStyle,n=r.stroke,o=r.fill,i=r.points,a=r.defX,c=void 0===a?0:a,u=r.defY,s=void 0===u?0:u,l=r.clipPathTargets,h=!!(null==l?void 0:l.length),f=o&&!o.isNone,v=!1;return(n&&!n.isNone||h)&&(v=it(i.points,r.lineWidth.value+r.increasedLineWidthForHitTesting.value,e.x+c,e.y+s,!0)),v||!f&&!h||(v=ut(i.points,e.x+c,e.y+s)),v}function yt(t,e){var r=t.parsedStyle,n=r.stroke,o=r.lineWidth,i=r.defX,a=r.defY,c=r.clipPathTargets;return!((!n||n.isNone)&&!(null==c?void 0:c.length)||!o)&&it(r.points.points,o.value+r.increasedLineWidthForHitTesting.value,e.x+(void 0===i?0:i),e.y+(void 0===a?0:a),!1)}function gt(t,r,n){var o=t.parsedStyle,i=o.radius,a=o.fill,c=o.stroke,u=o.lineWidth,s=o.increasedLineWidthForHitTesting,l=o.width,h=o.height,f=o.clipPathTargets,v=!!(null==f?void 0:f.length),d=a&&!a.isNone,p=c&&!c.isNone,y=i&&i.some((function(t){return 0!==t.value})),g=l.unit,m=h.unit,w=0,x=0;g!==e.UnitType.kNumber&&g!==e.UnitType.kPixels||(w=l.value),m!==e.UnitType.kNumber&&m!==e.UnitType.kPixels||(x=h.value);var b=u.value+s.value;if(y){var E=!1;return(p||v)&&(E=function(t,e,r,n,o,i,a,c){var u=o[0],s=o[1],l=o[2],h=o[3];return ot(t+u,e,t+r-s,e,i,a,c)||ot(t+r,e+s,t+r,e+n-l,i,a,c)||ot(t+r-l,e+n,t+h,e+n,i,a,c)||ot(t,e+n-h,t,e+u,i,a,c)||nt(t+r-s,e+s,s,1.5*Math.PI,2*Math.PI,i,a,c)||nt(t+r-l,e+n-l,l,0,.5*Math.PI,i,a,c)||nt(t+h,e+n-h,h,.5*Math.PI,Math.PI,i,a,c)||nt(t+u,e+u,u,Math.PI,1.5*Math.PI,i,a,c)}(0,0,w,x,i.map((function(t){return e.clamp(t.value,0,Math.min(Math.abs(w)/2,Math.abs(x)/2))})),b,r.x,r.y)),E||!d&&!v||(E=n(t,r)),E}var L=b/2;return d&&p||v?rt(0-L,0-L,w+L,x+L,r.x,r.y):d?rt(0,0,w,x,r.x,r.y):!!p&&function(t,e,r,n,o,i,a){var c=o/2;return rt(t-c,e-c,r,o,i,a)||rt(t+r-c,e-c,o,n,i,a)||rt(t+c,e+n-c,r,o,i,a)||rt(t-c,e+c,o,n,i,a)}(0,0,w,x,b,r.x,r.y)}var mt,wt,xt=e.Module((function(t){t({token:_,useFactory:function(t){return function(t){return t===e.Shape.CIRCLE?lt:t===e.Shape.ELLIPSE?ft:t===e.Shape.RECT?gt:t===e.Shape.LINE?vt:t===e.Shape.POLYLINE?yt:t===e.Shape.POLYGON?pt:t===e.Shape.PATH?dt:t===e.Shape.IMAGE||t===e.Shape.TEXT?function(){return!0}:null}}}),t(R)})),bt=function(){function t(){this.name="canvas-picker"}var e=t.prototype;return e.init=function(t){t.load(xt,!0)},e.destroy=function(t){t.unload(xt)},t}(),Et=Object.freeze({__proto__:null,Plugin:bt}),Lt=function(){function t(){this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=void 0}var r=t.prototype;return r.getImageSync=function(t,e){return this.imageCache[t]||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,r,n){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var i,a=t.image,c=t.repetition,u=(i=e.isString(a)?this.getImageSync(a,n):a)&&r.createPattern(i,c);return o&&u&&(this.patternCache[o]=u),u},r.getOrCreateGradient=function(t,r){var n=this.generateGradientKey(t),o=t.type,i=t.steps,a=t.width,c=t.height,u=t.cx,s=t.cy;if(this.gradientCache[n])return this.gradientCache[n];var l=null;if(o===e.GradientType.LinearGradient){var h=e.computeLinearGradient(a,c,t.angle);l=r.createLinearGradient(h.x1,h.y1,h.x2,h.y2)}else if(o===e.GradientType.RadialGradient){var f=e.computeRadialGradient(a,c,u,s),v=f.x,d=f.y;l=r.createRadialGradient(v,d,0,v,d,f.r)}return l&&(i.forEach((function(t){var e;null===(e=l)||void 0===e||e.addColorStop(t[0],t[1])})),this.gradientCache[n]=l),this.gradientCache[n]},r.generateGradientKey=function(t){return"gradient-"+t.type+"-"+(t.angle||0)+"-"+(t.cx||0)+"-"+(t.cy||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return t.join("")})).join("-")},r.generatePatternKey=function(t){var r=t.image,n=t.repetition;if(e.isString(r))return"pattern-"+r+"-"+n},t}();function Pt(){
|
|
6
6
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
7
|
-
Pt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function 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:C}}function C(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(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"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;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),l}},t}function Ct(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function
|
|
7
|
+
Pt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function 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:C}}function C(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(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"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;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),l}},t}function Ct(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function kt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ct(i,n,o,a,c,"next",t)}function c(t){Ct(i,n,o,a,c,"throw",t)}a(void 0)}))}}g([e.inject(e.CanvasConfig),m("design:type",Object)],Lt.prototype,"canvasConfig",void 0),Lt=g([e.singleton()],Lt);var St=(mt=function(){function t(){this.imagePool=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var r=this,n=function(n){var o=n.target;if(o.nodeName===e.Shape.IMAGE){var i=o.attributes.img;e.isString(i)&&r.imagePool.getImageSync(i,(function(){o.renderable.dirty=!0,t.dirtify()}))}},o=function(n){var o=n.target,i=n.newValue;o.nodeName===e.Shape.IMAGE&&"img"===n.attrName&&e.isString(i)&&r.imagePool.getOrCreateImage(i).then((function(){o.renderable.dirty=!0,t.dirtify()}))};t.hooks.init.tapPromise(wt.tag,kt(Pt().mark((function t(){return Pt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,o);case 2:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(wt.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,o)}))},t}(),mt.tag="LoadImage",wt=mt);g([e.inject(Lt),m("design:type",Lt)],St.prototype,"imagePool",void 0),g([e.inject(e.RenderingContext),m("design:type",Object)],St.prototype,"renderingContext",void 0),St=wt=g([e.singleton({contrib:e.RenderingPluginContribution})],St);var Ot=e.Module((function(t){t(Lt),t(St)})),Tt=function(){function t(){this.name="image-loader"}var e=t.prototype;return e.init=function(t){t.load(Ot,!0)},e.destroy=function(t){t.unload(Ot)},t}(),Nt=Object.freeze({__proto__:null,get ImagePool(){return Lt},Plugin:Tt});function jt(){
|
|
8
8
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
9
|
-
jt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function 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:C}}function C(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(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"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;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),l}},t}function Mt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _t(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Mt(i,n,o,a,c,"next",t)}function c(t){Mt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function At(){return At=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},At.apply(this,arguments)}function Rt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Gt(t,e)}function Gt(t,e){return Gt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Gt(t,e)}var Ft="undefined"!=typeof Float32Array?Float32Array:Array;function It(t,e){var r=e[4],n=e[5],o=e[6],i=e[8],a=e[9],c=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(r,n,o),t[2]=Math.hypot(i,a,c),t}function Bt(){var t=new Ft(3);return Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Dt(t,e,r){var n=new Ft(3);return n[0]=t,n[1]=e,n[2]=r,n}function Yt(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[0],c=r[1],u=r[2];return t[0]=o*u-i*c,t[1]=i*a-n*u,t[2]=n*c-o*a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var $t=function(t){return Math.hypot(t[0],t[1],t[2])};!function(){var t=Bt()}();!function(){var t,e=(t=new Ft(4),Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Ht(){var t=new Ft(4);return Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Wt(t,e,r,n){var o,i,a,c,u,s=e[0],l=e[1],h=e[2],f=e[3],v=r[0],d=r[1],p=r[2],y=r[3];return 0>(i=s*v+l*d+h*p+f*y)&&(i=-i,v=-v,d=-d,p=-p,y=-y),1-i>1e-6?(o=Math.acos(i),a=Math.sin(o),c=Math.sin((1-n)*o)/a,u=Math.sin(n*o)/a):(c=1-n,u=n),t[0]=c*s+u*v,t[1]=c*l+u*d,t[2]=c*h+u*p,t[3]=c*f+u*y,t}var Ut,Xt,qt,Vt,zt,Qt,Kt,Jt=function(t,e){var r=e[0],n=e[1],o=e[2],i=e[3],a=r*r+n*n+o*o+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=o*a,t[3]=i*a,t},Zt=(Ut=Bt(),Xt=Dt(1,0,0),qt=Dt(0,1,0),Vt=Ht(),zt=Ht(),Qt=new Ft(9),Ft!=Float32Array&&(Qt[1]=0,Qt[2]=0,Qt[3]=0,Qt[5]=0,Qt[6]=0,Qt[7]=0),Qt[0]=1,Qt[4]=1,Qt[8]=1,Kt=Qt,function(){function t(){this.gradientCache={}}var r=t.prototype;return r.getOrCreateGradient=function(t,r){var n=this.generateCacheKey(t),o=t.type,i=t.x0,a=t.y0,c=t.x1,u=t.y1,s=t.steps,l=t.width,h=t.height;if(this.gradientCache[n])return this.gradientCache[n];var f=null;if(o===e.GradientPatternType.LinearGradient)f=r.createLinearGradient(i*l,a*h,c*l,u*h);else if(o===e.GradientPatternType.RadialGradient){var v=Math.sqrt(l*l+h*h)/2;f=r.createRadialGradient(i*l,a*h,0,c*l,u*h,t.r1*v)}return f&&(s.forEach((function(t){var e,r=t[1];null===(e=f)||void 0===e||e.addColorStop(Number(t[0]),r)})),this.gradientCache[n]=f),this.gradientCache[n]},r.generateCacheKey=function(t){return"gradient-"+t.type+"-"+t.x0+"-"+t.y0+"-"+t.x1+"-"+t.y1+"-"+(t.r1||0)+"-"+t.width+"-"+t.height+"-"+t.steps.map((function(t){return t.join("")})).join("-")},t}());Zt=g([e.singleton()],Zt);var te=e.Syringe.defineToken("StyleRendererFactory"),ee=e.Syringe.defineToken("CircleRenderer",{multiple:!1}),re=e.Syringe.defineToken("EllipseRenderer",{multiple:!1}),ne=e.Syringe.defineToken("RectRenderer",{multiple:!1}),oe=e.Syringe.defineToken("LineRenderer",{multiple:!1}),ie=e.Syringe.defineToken("PolylineRenderer",{multiple:!1}),ae=e.Syringe.defineToken("PolygonRenderer",{multiple:!1}),ce=e.Syringe.defineToken("PathRenderer",{multiple:!1}),ue=e.Syringe.defineToken("TextRenderer",{multiple:!1}),se=e.Syringe.defineToken("ImageRenderer",{multiple:!1}),le=function(){function t(){this.imagePool=void 0}return t.prototype.render=function(t,r){var n,o=r.img,i=r.width.value,a=r.height.value;if(e.isString(o)?n=this.imagePool.getImageSync(o):(i||(i=o.width),a||(a=o.height),n=o),n)try{t.drawImage(n,0,0,i,a)}catch(t){}},t}();g([e.inject(Lt),m("design:type",Lt)],le.prototype,"imagePool",void 0),le=g([e.singleton({token:se})],le);var he=function(){function t(){}var r=t.prototype;return r.render=function(t,r,n){var o=r.lineWidth,i=r.textAlign,a=r.textBaseline,c=r.lineJoin,u=r.miterLimit,s=void 0===u?0:u,l=r.letterSpacing,h=void 0===l?0:l,f=r.stroke,v=r.fill,d=r.fillOpacity,p=r.strokeOpacity,y=r.opacity,g=r.metrics,m=r.dx,w=r.dy,x=g.lines,b=g.height,E=g.lineHeight,L=g.lineMetrics;t.font=g.font,t.lineWidth=o.value,t.textAlign=i.value,t.textBaseline=a.value,t.lineJoin=c.value,t.miterLimit=s;var P=0;"middle"===a.value?P=-b/2-E/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?P=-b:"top"!==a.value&&"hanging"!==a.value||(P=-E);var C=0;m&&m.unit===e.UnitType.kPixels&&(C+=m.value),w&&w.unit===e.UnitType.kPixels&&(P+=w.value);for(var S=0;x.length>S;S++){var k=o.value/2+C;P+=E,!e.isNil(f)&&!f.isNone&&o&&o.value&&this.drawLetterSpacing(t,x[S],L[S],i.value,k,P,h,d.value,p.value,y.value,!0),e.isNil(v)||this.drawLetterSpacing(t,x[S],L[S],i.value,k,P,h,d.value,p.value,y.value)}},r.drawLetterSpacing=function(t,e,r,n,o,i,a,c,u,s,l){if(void 0===l&&(l=!1),0!==a){var h=t.textAlign;t.textAlign="left";var f=o;"center"===n?f=o-r.width/2:"right"!==n&&"end"!==n||(f=o-r.width);for(var v=Array.from(e),d=t.measureText(e).width,p=0,y=0;v.length>y;++y){var g=v[y];l?this.strokeText(t,g,f,i,u):this.fillText(t,g,f,i,c,s),f+=d-(p=t.measureText(e.substring(y+1)).width)+a,d=p}t.textAlign=h}else l?this.strokeText(t,e,o,i,u):this.fillText(t,e,o,i,c,s)},r.fillText=function(t,r,n,o,i,a){var c,u=!e.isNil(i)&&1!==i;u&&(c=t.globalAlpha,t.globalAlpha=i*a),t.fillText(r,n,o),u&&(t.globalAlpha=c)},r.strokeText=function(t,r,n,o,i){var a,c=!e.isNil(i)&&1!==i;c&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(r,n,o),c&&(t.globalAlpha=a)},t}();he=g([e.singleton({token:ue})],he);var fe=function(){function t(){}return t.prototype.render=function(t,r){var n=r.fill,o=r.opacity,i=r.fillOpacity,a=r.stroke,c=r.strokeOpacity,u=r.lineWidth,s=r.lineCap,l=r.lineJoin,h=r.shadowColor,f=r.filter,v=r.miterLimit,d=!e.isNil(n)&&!n.isNone,p=!e.isNil(a)&&!a.isNone,y=0===n.alpha;if(d&&(e.isNil(i)||1===i.value?t.fill():(t.globalAlpha=i.value,t.fill(),t.globalAlpha=o.value)),p&&u&&u.value>0){var g,m,w;!e.isNil(c)&&1!==c.value&&(t.globalAlpha=c.value),t.lineWidth=u.value,e.isNil(v)||(t.miterLimit=v),e.isNil(s)||(t.lineCap=s.value),e.isNil(l)||(t.lineJoin=l.value);var x=!e.isNil(h),b=!e.isNil(f);x&&(m=t.shadowColor,e.isNil(g=t.shadowBlur)||(t.shadowColor="transparent",t.shadowBlur=0)),b&&!e.isNil(w=t.filter)&&w.indexOf("drop-shadow")>-1&&(t.filter=w.replace(/drop-shadow\([^)]*\)/,"").trim()||"none");var E=d&&!y;E&&t.stroke(),x&&(t.shadowColor=m,t.shadowBlur=g),b&&(t.filter=w),E||t.stroke()}},t}(),ve=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(fe=g([e.singleton()],fe));ve=g([e.singleton({token:ne})],ve);var de=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(fe);de=g([e.singleton({token:ee})],de);var pe=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(fe);pe=g([e.singleton({token:re})],pe);var ye=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(fe);ye=g([e.singleton({token:oe})],ye);var ge=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(fe);ge=g([e.singleton({token:ie})],ge);var me=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(fe);me=g([e.singleton({token:ae})],me);var we,xe,be=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(fe);be=g([e.singleton({token:ce})],be);var Ee=(we=function(){function t(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.imagePool=void 0,this.gradientPool=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.styleRendererFactory=void 0,this.styleRendererFactoryCache={},this.displayObjectPool=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.tmpVec3=Bt(),this.tmpMat4=function(){var t=new Ft(16);return Ft!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}()}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},o=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(xe.tag,_t(jt().mark((function t(){var i,a,c,u;return jt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.CULLED,o),a=(i=r.canvasConfig).width,c=i.height,u=r.contextService.getContext(),r.clearRect(u,0,0,a,c);case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(xe.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,o)})),t.hooks.beginFrame.tap(xe.tag,(function(){var t=r.contextService.getContext(),e=r.canvasConfig,n=e.width,o=e.height;r.clearFullScreen=r.shouldClearFullScreen(),t&&(t.save(),r.clearFullScreen&&r.clearRect(t,0,0,n,o),r.applyTransform(t,r.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(xe.tag,(function(){var n=r.contextService.getContext();if(r.clearFullScreen);else{var o=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(r.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(Dt(r,n,0),Dt(o,i,0)),a}))));if(r.removedRBushNodeAABBs=[],e.AABB.isEmpty(o))return void(r.renderQueue=[]);var i=r.convertAABB2Rect(o),a=i.x,c=i.y,u=i.width,s=i.height;r.clearRect(n,a,c,u,s),n.beginPath(),n.rect(a,c,u,s),n.clip(),r.searchDirtyObjects(o).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t)})),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(t){n.restore()})),r.restoreStack=[],r.clearFullScreen=!1,n.restore()})),t.hooks.render.tap(xe.tag,(function(e){r.clearFullScreen?e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t):r.renderQueue.push(e)}))},r.clearRect=function(t,e,r,n,o){t.clearRect(e,r,n,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,r,n,o))},r.renderDisplayObject=function(t,r){for(var n=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)n.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var i=t.nodeName;void 0===this.styleRendererFactoryCache[i]&&(this.styleRendererFactoryCache[i]=this.styleRendererFactory(i));var a=this.styleRendererFactoryCache[i];n.save(),this.applyTransform(n,t.getLocalTransform());var c=t.style.clipPath;if(c){n.save(),this.applyTransform(n,c.getLocalTransform()),void 0===this.pathGeneratorFactoryCache[c.nodeName]&&(this.pathGeneratorFactoryCache[c.nodeName]=this.pathGeneratorFactory(c.nodeName));var u=this.pathGeneratorFactoryCache[c.nodeName];u&&(this.useAnchor(n,c),n.beginPath(),u(n,c.parsedStyle),n.closePath()),n.restore(),n.clip()}n.save(),this.applyAttributesToContext(n,t,r),this.useAnchor(n,t),void 0===this.pathGeneratorFactoryCache[t.nodeName]&&(this.pathGeneratorFactoryCache[t.nodeName]=this.pathGeneratorFactory(t.nodeName));var s=this.pathGeneratorFactoryCache[t.nodeName];s&&(n.beginPath(),s(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),a&&a.render(n,t.parsedStyle,t),n.restore(),t.renderable.dirty=!1,this.restoreStack.push(t)},r.shouldClearFullScreen=function(){return!this.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering||this.renderingContext.renderReasons.has(e.RenderReason.CAMERA_CHANGED)},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),o=Math.floor(e[1]);return{x:n,y:o,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-o}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],o=r[1],i=t.getMax();return this.rBush.search({minX:n,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyTransform=function(t,r){var n=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}(Bt(),r),o=n[0],i=n[1],a=It(Bt(),r),c=a[0],u=a[1],s=function(t,e){var r=new Ft(3);It(r,e);var n=1/r[0],o=1/r[1],i=1/r[2],a=e[0]*n,c=e[1]*o,u=e[2]*i,s=e[4]*n,l=e[5]*o,h=e[6]*i,f=e[8]*n,v=e[9]*o,d=e[10]*i,p=a+l+d,y=0;return p>0?(y=2*Math.sqrt(p+1),t[3]=.25*y,t[0]=(h-v)/y,t[1]=(f-u)/y,t[2]=(c-s)/y):a>l&&a>d?(y=2*Math.sqrt(1+a-l-d),t[3]=(h-v)/y,t[0]=.25*y,t[1]=(c+s)/y,t[2]=(f+u)/y):l>d?(y=2*Math.sqrt(1+l-a-d),t[3]=(f-u)/y,t[0]=(c+s)/y,t[1]=.25*y,t[2]=(h+v)/y):(y=2*Math.sqrt(1+d-a-l),t[3]=(c-s)/y,t[0]=(f+u)/y,t[1]=(h+v)/y,t[2]=.25*y),t}(Ht(),r),l=e.getEuler(Bt(),s),h=e.fromRotationTranslationScale(l[0]||l[2],o,i,c,u);t.transform(h[0],h[1],h[3],h[4],h[6],h[7])},r.getColor=function(t,r,n,o,i){var a;if(t instanceof e.CSSGradientValue){if(t.type===e.GradientPatternType.LinearGradient||t.type===e.GradientPatternType.RadialGradient){var c=n.getGeometryBounds();a=this.gradientPool.getOrCreateGradient(At({type:t.type},t.value,{width:c&&2*c.halfExtents[0]||0,height:c&&2*c.halfExtents[1]||0}),o)}else if(t.type===e.GradientPatternType.Pattern){var u=this.imagePool.getPatternSync(t.value);u?a=u:this.imagePool.createPattern(t.value,o).then((function(){n.renderable.dirty=!0,i.dirtify()}))}}else a=n.attributes[r];return a},r.applyAttributesToContext=function(t,r,n){var o=r.parsedStyle,i=o.stroke,a=o.fill,c=o.opacity,u=o.lineDash,s=o.lineDashOffset,l=o.filter,h=o.shadowColor,f=o.shadowBlur,v=o.shadowOffsetX,d=o.shadowOffsetY;u&&Array.isArray(u)&&t.setLineDash(u.map((function(t){return t.value}))),e.isNil(s)||(t.lineDashOffset=s.value),e.isNil(c)||(t.globalAlpha*=c.value),e.isNil(i)||i.isNone||(t.strokeStyle=this.getColor(i,"stroke",r,t,n)),e.isNil(a)||a.isNone||(t.fillStyle=this.getColor(a,"fill",r,t,n)),e.isNil(l)||(t.filter=r.style.filter),e.isNil(h)||(t.shadowColor=h.toString(),t.shadowBlur=f&&f.value||0,t.shadowOffsetX=v&&v.value||0,t.shadowOffsetY=d&&d.value||0)},r.useAnchor=function(t,e){var r=(e.parsedStyle||{}).anchor;if(r&&(0!==r[0].value||0!==r[1].value)){var n=e.getGeometryBounds();if(n){var o=n.halfExtents;t.translate(-r[0].value*o[0]*2,-r[1].value*o[1]*2)}}},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return n.forEach((function(e){t.add(e)})),t},t}(),we.tag="CanvasRenderer",xe=we);g([e.inject(e.CanvasConfig),m("design:type",Object)],Ee.prototype,"canvasConfig",void 0),g([e.inject(e.DefaultCamera),m("design:type",e.Camera)],Ee.prototype,"camera",void 0),g([e.inject(e.ContextService),m("design:type",Object)],Ee.prototype,"contextService",void 0),g([e.inject(e.RenderingContext),m("design:type",Object)],Ee.prototype,"renderingContext",void 0),g([e.inject(Lt),m("design:type",Lt)],Ee.prototype,"imagePool",void 0),g([e.inject(Zt),m("design:type",Zt)],Ee.prototype,"gradientPool",void 0),g([e.inject(i),m("design:type",Function)],Ee.prototype,"pathGeneratorFactory",void 0),g([e.inject(te),m("design:type",Function)],Ee.prototype,"styleRendererFactory",void 0),g([e.inject(e.DisplayObjectPool),m("design:type",e.DisplayObjectPool)],Ee.prototype,"displayObjectPool",void 0),g([e.inject(e.RBushRoot),m("design:type",e.RBush)],Ee.prototype,"rBush",void 0),Ee=xe=g([e.singleton({contrib:e.RenderingPluginContribution})],Ee);var Le,Pe,Ce=e.Module((function(t){var r;t(de),t(pe),t(ve),t(le),t(he),t(ye),t(ge),t(me),t(be);var n=((r={})[e.Shape.CIRCLE]=ee,r[e.Shape.ELLIPSE]=re,r[e.Shape.RECT]=ne,r[e.Shape.IMAGE]=se,r[e.Shape.TEXT]=ue,r[e.Shape.LINE]=oe,r[e.Shape.POLYLINE]=ie,r[e.Shape.POLYGON]=ae,r[e.Shape.PATH]=ce,r);t({token:te,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(Zt),t(Ee)})),Se=function(){function t(){this.name="canvas-renderer"}var e=t.prototype;return e.init=function(t){t.load(Ce,!0)},e.destroy=function(t){t.unload(Ce)},t}(),ke=Object.freeze({__proto__:null,get CircleRenderer(){return de},CircleRendererContribution:ee,get EllipseRenderer(){return pe},EllipseRendererContribution:re,get ImageRenderer(){return le},ImageRendererContribution:se,get LineRenderer(){return ye},LineRendererContribution:oe,get PathRenderer(){return be},PathRendererContribution:ce,Plugin:Se,get PolygonRenderer(){return me},PolygonRendererContribution:ae,get PolylineRenderer(){return ge},PolylineRendererContribution:ie,get RectRenderer(){return ve},RectRendererContribution:ne,StyleRendererFactory:te,get TextRenderer(){return he},TextRendererContribution:ue});function Oe(){
|
|
9
|
+
jt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function 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:C}}function C(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(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"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;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),l}},t}function Mt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function At(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Mt(i,n,o,a,c,"next",t)}function c(t){Mt(i,n,o,a,c,"throw",t)}a(void 0)}))}}function _t(){return _t=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},_t.apply(this,arguments)}function Rt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Gt(t,e)}function Gt(t,e){return Gt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Gt(t,e)}var Ft="undefined"!=typeof Float32Array?Float32Array:Array;function It(t,e){var r=e[4],n=e[5],o=e[6],i=e[8],a=e[9],c=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(r,n,o),t[2]=Math.hypot(i,a,c),t}function Bt(){var t=new Ft(3);return Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Dt(t,e,r){var n=new Ft(3);return n[0]=t,n[1]=e,n[2]=r,n}function Yt(t,e,r){var n=e[0],o=e[1],i=e[2],a=r[0],c=r[1],u=r[2];return t[0]=o*u-i*c,t[1]=i*a-n*u,t[2]=n*c-o*a,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var $t=function(t){return Math.hypot(t[0],t[1],t[2])};!function(){var t=Bt()}();!function(){var t,e=(t=new Ft(4),Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Ht(){var t=new Ft(4);return Ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Wt(t,e,r,n){var o,i,a,c,u,s=e[0],l=e[1],h=e[2],f=e[3],v=r[0],d=r[1],p=r[2],y=r[3];return 0>(i=s*v+l*d+h*p+f*y)&&(i=-i,v=-v,d=-d,p=-p,y=-y),1-i>1e-6?(o=Math.acos(i),a=Math.sin(o),c=Math.sin((1-n)*o)/a,u=Math.sin(n*o)/a):(c=1-n,u=n),t[0]=c*s+u*v,t[1]=c*l+u*d,t[2]=c*h+u*p,t[3]=c*f+u*y,t}var Ut,Xt,qt,zt,Vt,Qt,Jt,Kt=function(t,e){var r=e[0],n=e[1],o=e[2],i=e[3],a=r*r+n*n+o*o+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=o*a,t[3]=i*a,t},Zt=(Ut=Bt(),Xt=Dt(1,0,0),qt=Dt(0,1,0),zt=Ht(),Vt=Ht(),Qt=new Ft(9),Ft!=Float32Array&&(Qt[1]=0,Qt[2]=0,Qt[3]=0,Qt[5]=0,Qt[6]=0,Qt[7]=0),Qt[0]=1,Qt[4]=1,Qt[8]=1,Jt=Qt,e.Syringe.defineToken("StyleRendererFactory")),te=e.Syringe.defineToken("CircleRenderer",{multiple:!1}),ee=e.Syringe.defineToken("EllipseRenderer",{multiple:!1}),re=e.Syringe.defineToken("RectRenderer",{multiple:!1}),ne=e.Syringe.defineToken("LineRenderer",{multiple:!1}),oe=e.Syringe.defineToken("PolylineRenderer",{multiple:!1}),ie=e.Syringe.defineToken("PolygonRenderer",{multiple:!1}),ae=e.Syringe.defineToken("PathRenderer",{multiple:!1}),ce=e.Syringe.defineToken("TextRenderer",{multiple:!1}),ue=e.Syringe.defineToken("ImageRenderer",{multiple:!1}),se=function(){function t(){this.imagePool=void 0}return t.prototype.render=function(t,r){var n,o=r.img,i=r.width.value,a=r.height.value;if(e.isString(o)?n=this.imagePool.getImageSync(o):(i||(i=o.width),a||(a=o.height),n=o),n)try{t.drawImage(n,0,0,i,a)}catch(t){}},t}();g([e.inject(Lt),m("design:type",Lt)],se.prototype,"imagePool",void 0),se=g([e.singleton({token:ue})],se);var le=function(){function t(){}var r=t.prototype;return r.render=function(t,r,n){var o=r.lineWidth,i=r.textAlign,a=r.textBaseline,c=r.lineJoin,u=r.miterLimit,s=void 0===u?0:u,l=r.letterSpacing,h=void 0===l?0:l,f=r.stroke,v=r.fill,d=r.fillOpacity,p=r.strokeOpacity,y=r.opacity,g=r.metrics,m=r.dx,w=r.dy,x=g.lines,b=g.height,E=g.lineHeight,L=g.lineMetrics;t.font=g.font,t.lineWidth=o.value,t.textAlign=i.value,t.textBaseline=a.value,t.lineJoin=c.value,t.miterLimit=s;var P=0;"middle"===a.value?P=-b/2-E/2:"bottom"===a.value||"alphabetic"===a.value||"ideographic"===a.value?P=-b:"top"!==a.value&&"hanging"!==a.value||(P=-E);var C=0;m&&m.unit===e.UnitType.kPixels&&(C+=m.value),w&&w.unit===e.UnitType.kPixels&&(P+=w.value);for(var k=0;x.length>k;k++){var S=o.value/2+C;P+=E,!e.isNil(f)&&!f.isNone&&o&&o.value&&this.drawLetterSpacing(t,x[k],L[k],i.value,S,P,h,d.value,p.value,y.value,!0),e.isNil(v)||this.drawLetterSpacing(t,x[k],L[k],i.value,S,P,h,d.value,p.value,y.value)}},r.drawLetterSpacing=function(t,e,r,n,o,i,a,c,u,s,l){if(void 0===l&&(l=!1),0!==a){var h=t.textAlign;t.textAlign="left";var f=o;"center"===n?f=o-r.width/2:"right"!==n&&"end"!==n||(f=o-r.width);for(var v=Array.from(e),d=t.measureText(e).width,p=0,y=0;v.length>y;++y){var g=v[y];l?this.strokeText(t,g,f,i,u):this.fillText(t,g,f,i,c,s),f+=d-(p=t.measureText(e.substring(y+1)).width)+a,d=p}t.textAlign=h}else l?this.strokeText(t,e,o,i,u):this.fillText(t,e,o,i,c,s)},r.fillText=function(t,r,n,o,i,a){var c,u=!e.isNil(i)&&1!==i;u&&(c=t.globalAlpha,t.globalAlpha=i*a),t.fillText(r,n,o),u&&(t.globalAlpha=c)},r.strokeText=function(t,r,n,o,i){var a,c=!e.isNil(i)&&1!==i;c&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(r,n,o),c&&(t.globalAlpha=a)},t}();le=g([e.singleton({token:ce})],le);var he=function(){function t(){this.imagePool=void 0}var r=t.prototype;return r.render=function(t,r,n,o){var i=r.fill,a=r.opacity,c=r.fillOpacity,u=r.stroke,s=r.strokeOpacity,l=r.lineWidth,h=r.lineCap,f=r.lineJoin,v=r.shadowColor,d=r.filter,p=r.miterLimit,y=!e.isNil(i)&&!i.isNone,g=!e.isNil(u)&&!u.isNone,m=0===i.alpha;if(y&&(e.isNil(c)||1===c.value?this.fill(t,n,i,o):(t.globalAlpha=c.value,this.fill(t,n,i,o),t.globalAlpha=a.value)),g&&l&&l.value>0){var w,x,b;!e.isNil(s)&&1!==s.value&&(t.globalAlpha=s.value),t.lineWidth=l.value,e.isNil(p)||(t.miterLimit=p),e.isNil(h)||(t.lineCap=h.value),e.isNil(f)||(t.lineJoin=f.value);var E=!e.isNil(v),L=!e.isNil(d);E&&(x=t.shadowColor,e.isNil(w=t.shadowBlur)||(t.shadowColor="transparent",t.shadowBlur=0)),L&&!e.isNil(b=t.filter)&&b.indexOf("drop-shadow")>-1&&(t.filter=b.replace(/drop-shadow\([^)]*\)/,"").trim()||"none");var P=y&&!m;P&&this.stroke(t,n,u,o),E&&(t.shadowColor=x,t.shadowBlur=w),L&&(t.filter=b),P||this.stroke(t,n,u,o)}},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(_t({type:t.type},t.value,{width:i&&2*i.halfExtents[0]||1,height:i&&2*i.halfExtents[1]||1}),n)}return o},t}();g([e.inject(Lt),m("design:type",Lt)],he.prototype,"imagePool",void 0);var fe=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(he=g([e.singleton()],he));fe=g([e.singleton({token:re})],fe);var ve=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(he);ve=g([e.singleton({token:te})],ve);var de=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(he);de=g([e.singleton({token:ee})],de);var pe=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(he);pe=g([e.singleton({token:ne})],pe);var ye=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(he);ye=g([e.singleton({token:oe})],ye);var ge=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(he);ge=g([e.singleton({token:ie})],ge);var me,we,xe=function(t){function e(){return t.apply(this,arguments)||this}return Rt(e,t),e}(he);xe=g([e.singleton({token:ae})],xe);var be=(me=function(){function t(){this.canvasConfig=void 0,this.camera=void 0,this.contextService=void 0,this.renderingContext=void 0,this.pathGeneratorFactory=void 0,this.pathGeneratorFactoryCache={},this.styleRendererFactory=void 0,this.styleRendererFactoryCache={},this.displayObjectPool=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.tmpVec3=Bt(),this.tmpMat4=function(){var t=new Ft(16);return Ft!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}()}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},o=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};t.hooks.init.tapPromise(we.tag,At(jt().mark((function t(){var i,a,c,u;return jt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.CULLED,o),a=(i=r.canvasConfig).width,c=i.height,u=r.contextService.getContext(),r.clearRect(u,0,0,a,c);case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(we.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.CULLED,o)})),t.hooks.beginFrame.tap(we.tag,(function(){var t=r.contextService.getContext(),e=r.canvasConfig,n=e.width,o=e.height;r.clearFullScreen=r.shouldClearFullScreen(),t&&(t.save(),r.clearFullScreen&&r.clearRect(t,0,0,n,o),r.applyTransform(t,r.camera.getOrthoMatrix()))})),t.hooks.endFrame.tap(we.tag,(function(){var n=r.contextService.getContext();if(r.clearFullScreen);else{var o=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat(r.removedRBushNodeAABBs.map((function(t){var r=t.minX,n=t.minY,o=t.maxX,i=t.maxY,a=new e.AABB;return a.setMinMax(Dt(r,n,0),Dt(o,i,0)),a}))));if(r.removedRBushNodeAABBs=[],e.AABB.isEmpty(o))return void(r.renderQueue=[]);var i=r.convertAABB2Rect(o),a=i.x,c=i.y,u=i.width,s=i.height;r.clearRect(n,a,c,u,s),n.beginPath(),n.rect(a,c,u,s),n.clip(),r.searchDirtyObjects(o).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t)})),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(t){n.restore()})),r.restoreStack=[],r.clearFullScreen=!1,n.restore()})),t.hooks.render.tap(we.tag,(function(e){r.clearFullScreen?e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t):r.renderQueue.push(e)}))},r.clearRect=function(t,e,r,n,o){t.clearRect(e,r,n,o);var i=this.canvasConfig.background;i&&(t.fillStyle=i,t.fillRect(e,r,n,o))},r.renderDisplayObject=function(t,r){for(var n=this.contextService.getContext(),o=this.restoreStack[this.restoreStack.length-1];o&&t.parentNode!==o;)n.restore(),this.restoreStack.pop(),o=this.restoreStack[this.restoreStack.length-1];var i=t.nodeName;void 0===this.styleRendererFactoryCache[i]&&(this.styleRendererFactoryCache[i]=this.styleRendererFactory(i));var a=this.styleRendererFactoryCache[i];n.save(),this.applyTransform(n,t.getLocalTransform());var c=t.style.clipPath;if(c){n.save(),this.applyTransform(n,c.getLocalTransform()),void 0===this.pathGeneratorFactoryCache[c.nodeName]&&(this.pathGeneratorFactoryCache[c.nodeName]=this.pathGeneratorFactory(c.nodeName));var u=this.pathGeneratorFactoryCache[c.nodeName];u&&(this.useAnchor(n,c),n.beginPath(),u(n,c.parsedStyle),n.closePath()),n.restore(),n.clip()}n.save(),this.applyAttributesToContext(n,t),this.useAnchor(n,t),void 0===this.pathGeneratorFactoryCache[t.nodeName]&&(this.pathGeneratorFactoryCache[t.nodeName]=this.pathGeneratorFactory(t.nodeName));var s=this.pathGeneratorFactoryCache[t.nodeName];s&&(n.beginPath(),s(n,t.parsedStyle),t.nodeName!==e.Shape.LINE&&t.nodeName!==e.Shape.PATH&&t.nodeName!==e.Shape.POLYLINE&&n.closePath()),a&&a.render(n,t.parsedStyle,t,r),n.restore(),t.renderable.dirty=!1,this.restoreStack.push(t)},r.shouldClearFullScreen=function(){return!this.canvasConfig.renderer.getConfig().enableDirtyRectangleRendering||this.renderingContext.renderReasons.has(e.RenderReason.CAMERA_CHANGED)},r.convertAABB2Rect=function(t){var e=t.getMin(),r=t.getMax(),n=Math.floor(e[0]),o=Math.floor(e[1]);return{x:n,y:o,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-o}},r.mergeDirtyAABBs=function(t){var r=new e.AABB;return t.forEach((function(t){var e=t.getRenderBounds();r.add(e);var n=t.renderable.dirtyRenderBounds;n&&r.add(n)})),r},r.searchDirtyObjects=function(t){var e=this,r=t.getMin(),n=r[0],o=r[1],i=t.getMax();return this.rBush.search({minX:n,minY:o,maxX:i[0],maxY:i[1]}).map((function(t){return e.displayObjectPool.getByEntity(t.id)}))},r.saveDirtyAABB=function(t){var r=t.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new e.AABB);var n=t.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)},r.applyTransform=function(t,r){var n=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}(Bt(),r),o=n[0],i=n[1],a=It(Bt(),r),c=a[0],u=a[1],s=function(t,e){var r=new Ft(3);It(r,e);var n=1/r[0],o=1/r[1],i=1/r[2],a=e[0]*n,c=e[1]*o,u=e[2]*i,s=e[4]*n,l=e[5]*o,h=e[6]*i,f=e[8]*n,v=e[9]*o,d=e[10]*i,p=a+l+d,y=0;return p>0?(y=2*Math.sqrt(p+1),t[3]=.25*y,t[0]=(h-v)/y,t[1]=(f-u)/y,t[2]=(c-s)/y):a>l&&a>d?(y=2*Math.sqrt(1+a-l-d),t[3]=(h-v)/y,t[0]=.25*y,t[1]=(c+s)/y,t[2]=(f+u)/y):l>d?(y=2*Math.sqrt(1+l-a-d),t[3]=(f-u)/y,t[0]=(c+s)/y,t[1]=.25*y,t[2]=(h+v)/y):(y=2*Math.sqrt(1+d-a-l),t[3]=(c-s)/y,t[0]=(f+u)/y,t[1]=(h+v)/y,t[2]=.25*y),t}(Ht(),r),l=e.getEuler(Bt(),s),h=e.fromRotationTranslationScale(l[0]||l[2],o,i,c,u);t.transform(h[0],h[1],h[3],h[4],h[6],h[7])},r.applyAttributesToContext=function(t,r){var n=r.parsedStyle,o=n.stroke,i=n.fill,a=n.opacity,c=n.lineDash,u=n.lineDashOffset,s=n.filter,l=n.shadowColor,h=n.shadowBlur,f=n.shadowOffsetX,v=n.shadowOffsetY;c&&Array.isArray(c)&&t.setLineDash(c.map((function(t){return t.value}))),e.isNil(u)||(t.lineDashOffset=u.value),e.isNil(a)||(t.globalAlpha*=a.value),e.isNil(o)||Array.isArray(o)||o.isNone||(t.strokeStyle=r.attributes.stroke),e.isNil(i)||Array.isArray(i)||i.isNone||(t.fillStyle=r.attributes.fill),e.isNil(s)||(t.filter=r.style.filter),e.isNil(l)||(t.shadowColor=l.toString(),t.shadowBlur=h&&h.value||0,t.shadowOffsetX=f&&f.value||0,t.shadowOffsetY=v&&v.value||0)},r.useAnchor=function(t,e){var r=(e.parsedStyle||{}).anchor;if(r&&(0!==r[0].value||0!==r[1].value)){var n=e.getGeometryBounds();if(n){var o=n.halfExtents;t.translate(-r[0].value*o[0]*2,-r[1].value*o[1]*2)}}},r.safeMergeAABB=function(){for(var t=new e.AABB,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return n.forEach((function(e){t.add(e)})),t},t}(),me.tag="CanvasRenderer",we=me);g([e.inject(e.CanvasConfig),m("design:type",Object)],be.prototype,"canvasConfig",void 0),g([e.inject(e.DefaultCamera),m("design:type",e.Camera)],be.prototype,"camera",void 0),g([e.inject(e.ContextService),m("design:type",Object)],be.prototype,"contextService",void 0),g([e.inject(e.RenderingContext),m("design:type",Object)],be.prototype,"renderingContext",void 0),g([e.inject(i),m("design:type",Function)],be.prototype,"pathGeneratorFactory",void 0),g([e.inject(Zt),m("design:type",Function)],be.prototype,"styleRendererFactory",void 0),g([e.inject(e.DisplayObjectPool),m("design:type",e.DisplayObjectPool)],be.prototype,"displayObjectPool",void 0),g([e.inject(e.RBushRoot),m("design:type",e.RBush)],be.prototype,"rBush",void 0),be=we=g([e.singleton({contrib:e.RenderingPluginContribution})],be);var Ee,Le,Pe=e.Module((function(t){var r;t(ve),t(de),t(fe),t(se),t(le),t(pe),t(ye),t(ge),t(xe);var n=((r={})[e.Shape.CIRCLE]=te,r[e.Shape.ELLIPSE]=ee,r[e.Shape.RECT]=re,r[e.Shape.IMAGE]=ue,r[e.Shape.TEXT]=ce,r[e.Shape.LINE]=ne,r[e.Shape.POLYLINE]=oe,r[e.Shape.POLYGON]=ie,r[e.Shape.PATH]=ae,r);t({token:Zt,useFactory:function(t){return function(e){var r=n[e];return r&&t.container.isBound(r)?t.container.get(r):null}}}),t(be)})),Ce=function(){function t(){this.name="canvas-renderer"}var e=t.prototype;return e.init=function(t){t.load(Pe,!0)},e.destroy=function(t){t.unload(Pe)},t}(),ke=Object.freeze({__proto__:null,get CircleRenderer(){return ve},CircleRendererContribution:te,get EllipseRenderer(){return de},EllipseRendererContribution:ee,get ImageRenderer(){return se},ImageRendererContribution:ue,get LineRenderer(){return pe},LineRendererContribution:ne,get PathRenderer(){return xe},PathRendererContribution:ae,Plugin:Ce,get PolygonRenderer(){return ge},PolygonRendererContribution:ie,get PolylineRenderer(){return ye},PolylineRendererContribution:oe,get RectRenderer(){return fe},RectRendererContribution:re,StyleRendererFactory:Zt,get TextRenderer(){return le},TextRendererContribution:ce});function Se(){
|
|
10
10
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
11
|
-
|
|
11
|
+
Se=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function 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:C}}function C(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(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"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;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),l}},t}function Oe(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Te(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Oe(i,n,o,a,c,"next",t)}function c(t){Oe(i,n,o,a,c,"throw",t)}a(void 0)}))}}var Ne=(Ee=function(){function t(){this.contextService=void 0,this.renderingContext=void 0}return t.prototype.apply=function(t){var e=this,r=this.renderingContext.root.ownerDocument.defaultView,n=function(e){t.hooks.pointerMove.call(e)},o=function(e){t.hooks.pointerUp.call(e)},i=function(e){t.hooks.pointerDown.call(e)},a=function(e){t.hooks.pointerOver.call(e)},c=function(e){t.hooks.pointerOut.call(e)},u=function(e){t.hooks.pointerCancel.call(e)},s=function(e){t.hooks.pointerWheel.call(e)},l=function(t){globalThis.document.addEventListener("pointermove",n,!0),t.addEventListener("pointerdown",i,!0),t.addEventListener("pointerleave",c,!0),t.addEventListener("pointerover",a,!0),globalThis.addEventListener("pointerup",o,!0)},h=function(t){t.addEventListener("touchstart",i,!0),t.addEventListener("touchend",o,!0),t.addEventListener("touchmove",n,!0),t.addEventListener("touchcancel",u,!0)},f=function(t){globalThis.document.addEventListener("mousemove",n,!0),t.addEventListener("mousedown",i,!0),t.addEventListener("mouseout",c,!0),t.addEventListener("mouseover",a,!0),globalThis.addEventListener("mouseup",o,!0)};t.hooks.init.tapPromise(Le.tag,Te(Se().mark((function t(){var n;return Se().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.contextService.getDomElement(),globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):r.supportsPointerEvents&&(n.style.touchAction="none"),r.supportsPointerEvents?l(n):f(n),r.supportsTouchEvents&&h(n),n.addEventListener("wheel",s,{passive:!0,capture:!0});case 5:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(Le.tag,(function(){var t=e.contextService.getDomElement();r.supportsPointerEvents?function(t){globalThis.document.removeEventListener("pointermove",n,!0),t.removeEventListener("pointerdown",i,!0),t.removeEventListener("pointerleave",c,!0),t.removeEventListener("pointerover",a,!0),globalThis.removeEventListener("pointerup",o,!0)}(t):function(t){globalThis.document.removeEventListener("mousemove",n,!0),t.removeEventListener("mousedown",i,!0),t.removeEventListener("mouseout",c,!0),t.removeEventListener("mouseover",a,!0),globalThis.removeEventListener("mouseup",o,!0)}(t),r.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",i,!0),t.removeEventListener("touchend",o,!0),t.removeEventListener("touchmove",n,!0)}(t),t.removeEventListener("wheel",s,!0)}))},t}(),Ee.tag="DOMInteraction",Le=Ee);g([e.inject(e.ContextService),m("design:type",Object)],Ne.prototype,"contextService",void 0),g([e.inject(e.RenderingContext),m("design:type",Object)],Ne.prototype,"renderingContext",void 0),Ne=Le=g([e.singleton({contrib:e.RenderingPluginContribution})],Ne);var je,Me,Ae=e.Module((function(t){t(Ne)})),_e=function(){function t(){this.name="dom-interaction"}var e=t.prototype;return e.init=function(t){t.load(Ae,!0)},e.destroy=function(t){t.unload(Ae)},t}(),Re=Object.freeze({__proto__:null,Plugin:_e});function Ge(){
|
|
12
12
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
13
|
-
Fe=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function 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:C}}function C(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(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"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;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),l}},t}function Ie(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Be(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ie(i,n,o,a,c,"next",t)}function c(t){Ie(i,n,o,a,c,"throw",t)}a(void 0)}))}}var De=(Me=function(){function t(){this.contextService=void 0,this.renderingContext=void 0,this.canvasConfig=void 0,this.$camera=void 0}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getOrCreateEl(n),i=n.ownerDocument.documentElement.attributes;Object.keys(i).forEach((function(t){o.style[t]=i[t]})),Object.keys(n.attributes).forEach((function(t){r.updateAttribute(t,n)}))}},o=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getId(n),i=r.contextService.getDomElement().parentNode;if(i){var a=i.querySelector("#"+o);a&&i.removeChild(a)}}},i=function(t){var n=t.target;n.nodeName===e.Shape.HTML&&r.updateAttribute(t.attrName,n)};t.hooks.init.tapPromise(_e.tag,Be(Fe().mark((function t(){return Fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,i);case 3:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(_e.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,i)}))},r.getId=function(t){return t.id||"g-html-"+t.entity},r.getOrCreateEl=function(t){var e=this.canvasConfig.document,r=this.getId(t),n=this.contextService.getDomElement().parentNode;if(n){var o=n.querySelector("#"+r);if(!o){o=(e||document).createElement("div"),t.parsedStyle.$el=o,o.id=r,t.name&&o.setAttribute("name",t.name),t.className&&(o.className=t.className),n.appendChild(o),o.style.position="absolute",o.style.left="0",o.style.top="0",o.style["will-change"]="transform";var i=t.getWorldTransform();o.style.transform="matrix("+[i[0],i[1],i[4],i[5],i[12],i[13]].join(",")+")"}return o}return null},r.updateAttribute=function(t,r){var n=this.getOrCreateEl(r);switch(t){case"innerHTML":var o=r.parsedStyle.innerHTML;e.isString(o)?n.innerHTML=o:(n.innerHTML="",n.appendChild(o));break;case"modelMatrix":case"transformOrigin":var i=r.parsedStyle.transformOrigin;n.style["transform-origin"]=i[0].value+" "+i[1].value;var a=r.getWorldTransform();n.style.transform="matrix("+[a[0],a[1],a[4],a[5],a[12],a[13]].join(",")+")";break;case"width":var c=r.computedStyleMap().get("width");n.style.width=c.toString();break;case"height":var u=r.computedStyleMap().get("height");n.style.height=u.toString();break;case"zIndex":n.style["z-index"]=""+r.parsedStyle.zIndex.value;break;case"visibility":n.style.visibility=r.parsedStyle.visibility.value;break;case"pointerEvents":n.style.pointerEvents=r.parsedStyle.pointerEvents.value;break;case"opacity":n.style.opacity=""+r.parsedStyle.opacity.value;break;case"fill":var s=r.parsedStyle.fill,l="";if(s instanceof e.CSSRGB)l=s.toString();else if(s instanceof e.CSSGradientValue){if(s.type===e.GradientPatternType.LinearGradient)l="linear-gradient(to right, "+s.value.steps.map((function(t){return t[1]+" "+100*Number(t[0])+"%"})).join(",")+");"}n.style.background=l;break;case"stroke":n.style["border-color"]=r.parsedStyle.stroke.toString(),n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]=(r.parsedStyle.lineWidth.value||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=r.parsedStyle.filter}},t}(),Me.tag="HTMLRendering",_e=Me);g([e.inject(e.ContextService),m("design:type",Object)],De.prototype,"contextService",void 0),g([e.inject(e.RenderingContext),m("design:type",Object)],De.prototype,"renderingContext",void 0),g([e.inject(e.CanvasConfig),m("design:type",Object)],De.prototype,"canvasConfig",void 0),De=_e=g([e.singleton({contrib:e.RenderingPluginContribution})],De);var Ye=e.Module((function(t){t(De)})),$e=function(){function t(){this.name="html-renderer"}var e=t.prototype;return e.init=function(t){t.load(Ye,!0)},e.destroy=function(t){t.unload(Ye)},t}(),He=Object.freeze({__proto__:null,Plugin:$e}),We=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var o=t.prototype;return o.init=function(){var t,o=(t=r().mark((function t(){var n,o,i,a,c,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(n=this.canvasConfig).container,a=n.devicePixelRatio,(i=n.canvas)?(this.$canvas=i,o&&i.parentElement!==o&&o.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container):o&&(this.$container=e.isString(o)?document.getElementById(o):o,this.$container&&(c=document.createElement("canvas"),this.$container.appendChild(c),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=c)),this.context=this.$canvas.getContext("2d"),u=1>(u=a||e.isBrowser&&window.devicePixelRatio||1)?1:Math.ceil(u),this.dpr=u,this.resize(this.canvasConfig.width,this.canvasConfig.height);case 7:case"end":return t.stop()}}),t,this)})),function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(){return o.apply(this,arguments)}}(),o.getContext=function(){return this.context},o.getDomElement=function(){return this.$canvas},o.getDPR=function(){return this.dpr},o.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},o.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},o.resize=function(t,r){if(this.$canvas){this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*r,e.setDOMSize(this.$canvas,t,r);var n=this.getDPR();this.context.scale(n,n)}},o.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t}();g([e.inject(e.CanvasConfig),m("design:type",Object)],We.prototype,"canvasConfig",void 0),We=g([e.singleton({token:e.ContextService})],We);var Ue=e.Module((function(t){t(We)})),Xe=function(){function t(){this.name="canvas-context-register"}var e=t.prototype;return e.init=function(t){t.load(Ue,!0)},e.destroy=function(t){t.unload(Ue)},t}(),qe=function(t){var e,r;function n(e){var r;return(r=t.call(this,e)||this).registerPlugin(new Xe),r.registerPlugin(new Tt),r.registerPlugin(new p),r.registerPlugin(new Se),r.registerPlugin(new Re),r.registerPlugin(new bt),r.registerPlugin(new $e),r}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,o(e,r),n}(e.AbstractRenderer);t.CanvasPathGenerator=y,t.CanvasPicker=Et,t.CanvasRenderer=ke,t.DomInteraction=Ge,t.HTMLRenderer=He,t.ImageLoader=Nt,t.Renderer=qe,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
13
|
+
Ge=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new L(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=x(a,r);if(c){if(c===l)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=s(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,i),o}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function v(){}var d={};c(d,o,(function(){return this}));var p=Object.getPrototypeOf,y=p&&p(p(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=v.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,l;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function 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:C}}function C(){return{value:void 0,done:!0}}return f.prototype=v,c(g,"constructor",v),c(v,"constructor",f),f.displayName=c(v,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(w.prototype),c(w.prototype,i,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),c(g,a,"Generator"),c(g,o,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(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"),u=r.call(i,"finallyLoc");if(c&&u){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(this.prev>=o.tryLoc&&r.call(o,"finallyLoc")&&o.finallyLoc>this.prev){var i=o;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;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),l}},t}function Fe(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Ie(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Fe(i,n,o,a,c,"next",t)}function c(t){Fe(i,n,o,a,c,"throw",t)}a(void 0)}))}}var Be=(je=function(){function t(){this.contextService=void 0,this.renderingContext=void 0,this.canvasConfig=void 0,this.$camera=void 0}var r=t.prototype;return r.apply=function(t){var r=this,n=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getOrCreateEl(n),i=n.ownerDocument.documentElement.attributes;Object.keys(i).forEach((function(t){o.style[t]=i[t]})),Object.keys(n.attributes).forEach((function(t){r.updateAttribute(t,n)}))}},o=function(t){var n=t.target;if(n.nodeName===e.Shape.HTML){var o=r.getId(n),i=r.contextService.getDomElement().parentNode;if(i){var a=i.querySelector("#"+o);a&&i.removeChild(a)}}},i=function(t){var n=t.target;n.nodeName===e.Shape.HTML&&r.updateAttribute(t.attrName,n)};t.hooks.init.tapPromise(Me.tag,Ie(Ge().mark((function t(){return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,i);case 3:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(Me.tag,(function(){r.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,n),r.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,o),r.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,i)}))},r.getId=function(t){return t.id||"g-html-"+t.entity},r.getOrCreateEl=function(t){var e=this.canvasConfig.document,r=this.getId(t),n=this.contextService.getDomElement().parentNode;if(n){var o=n.querySelector("#"+r);if(!o){o=(e||document).createElement("div"),t.parsedStyle.$el=o,o.id=r,t.name&&o.setAttribute("name",t.name),t.className&&(o.className=t.className),n.appendChild(o),o.style.position="absolute",o.style.left="0",o.style.top="0",o.style["will-change"]="transform";var i=t.getWorldTransform();o.style.transform="matrix("+[i[0],i[1],i[4],i[5],i[12],i[13]].join(",")+")"}return o}return null},r.updateAttribute=function(t,r){var n=this.getOrCreateEl(r);switch(t){case"innerHTML":var o=r.parsedStyle.innerHTML;e.isString(o)?n.innerHTML=o:(n.innerHTML="",n.appendChild(o));break;case"modelMatrix":case"transformOrigin":var i=r.parsedStyle.transformOrigin;n.style["transform-origin"]=i[0].value+" "+i[1].value;var a=r.getWorldTransform();n.style.transform="matrix("+[a[0],a[1],a[4],a[5],a[12],a[13]].join(",")+")";break;case"width":var c=r.computedStyleMap().get("width");n.style.width=c.toString();break;case"height":var u=r.computedStyleMap().get("height");n.style.height=u.toString();break;case"zIndex":n.style["z-index"]=""+r.parsedStyle.zIndex.value;break;case"visibility":n.style.visibility=r.parsedStyle.visibility.value;break;case"pointerEvents":n.style.pointerEvents=r.parsedStyle.pointerEvents.value;break;case"opacity":n.style.opacity=""+r.parsedStyle.opacity.value;break;case"fill":var s=r.parsedStyle.fill,l="";s instanceof e.CSSRGB?l=s.isNone?"transparent":r.getAttribute("fill"):Array.isArray(s)?l=r.getAttribute("fill"):e.isPattern(s),n.style.background=l;break;case"stroke":var h=r.parsedStyle.stroke,f="";h instanceof e.CSSRGB?f=h.isNone?"transparent":r.getAttribute("stroke"):Array.isArray(h)?f=r.getAttribute("stroke"):e.isPattern(h),n.style["border-color"]=f,n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]=(r.parsedStyle.lineWidth.value||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=r.parsedStyle.filter}},t}(),je.tag="HTMLRendering",Me=je);g([e.inject(e.ContextService),m("design:type",Object)],Be.prototype,"contextService",void 0),g([e.inject(e.RenderingContext),m("design:type",Object)],Be.prototype,"renderingContext",void 0),g([e.inject(e.CanvasConfig),m("design:type",Object)],Be.prototype,"canvasConfig",void 0),Be=Me=g([e.singleton({contrib:e.RenderingPluginContribution})],Be);var De=e.Module((function(t){t(Be)})),Ye=function(){function t(){this.name="html-renderer"}var e=t.prototype;return e.init=function(t){t.load(De,!0)},e.destroy=function(t){t.unload(De)},t}(),$e=Object.freeze({__proto__:null,Plugin:Ye}),He=function(){function t(){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0}var o=t.prototype;return o.init=function(){var t,o=(t=r().mark((function t(){var n,o,i,a,c,u;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(n=this.canvasConfig).container,a=n.devicePixelRatio,(i=n.canvas)?(this.$canvas=i,o&&i.parentElement!==o&&o.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container):o&&(this.$container=e.isString(o)?document.getElementById(o):o,this.$container&&(c=document.createElement("canvas"),this.$container.appendChild(c),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=c)),this.context=this.$canvas.getContext("2d"),u=1>(u=a||e.isBrowser&&window.devicePixelRatio||1)?1:Math.ceil(u),this.dpr=u,this.resize(this.canvasConfig.width,this.canvasConfig.height);case 7:case"end":return t.stop()}}),t,this)})),function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(){return o.apply(this,arguments)}}(),o.getContext=function(){return this.context},o.getDomElement=function(){return this.$canvas},o.getDPR=function(){return this.dpr},o.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},o.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},o.resize=function(t,r){if(this.$canvas){this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*r,e.setDOMSize(this.$canvas,t,r);var n=this.getDPR();this.context.scale(n,n)}},o.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t}();g([e.inject(e.CanvasConfig),m("design:type",Object)],He.prototype,"canvasConfig",void 0),He=g([e.singleton({token:e.ContextService})],He);var We=e.Module((function(t){t(He)})),Ue=function(){function t(){this.name="canvas-context-register"}var e=t.prototype;return e.init=function(t){t.load(We,!0)},e.destroy=function(t){t.unload(We)},t}(),Xe=function(t){var e,r;function n(e){var r;return(r=t.call(this,e)||this).registerPlugin(new Ue),r.registerPlugin(new Tt),r.registerPlugin(new p),r.registerPlugin(new Ce),r.registerPlugin(new _e),r.registerPlugin(new bt),r.registerPlugin(new Ye),r}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,o(e,r),n}(e.AbstractRenderer);t.CanvasPathGenerator=y,t.CanvasPicker=Et,t.CanvasRenderer=ke,t.DomInteraction=Re,t.HTMLRenderer=$e,t.ImageLoader=Nt,t.Renderer=Xe,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.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A renderer implemented by Canvas 2D API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antv",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@antv/g-plugin-canvas-path-generator": "^0.0
|
|
34
|
-
"@antv/g-plugin-canvas-picker": "^1.
|
|
35
|
-
"@antv/g-plugin-canvas-renderer": "^1.
|
|
36
|
-
"@antv/g-plugin-dom-interaction": "^1.
|
|
37
|
-
"@antv/g-plugin-html-renderer": "^1.
|
|
38
|
-
"@antv/g-plugin-image-loader": "^0.
|
|
33
|
+
"@antv/g-plugin-canvas-path-generator": "^0.1.0",
|
|
34
|
+
"@antv/g-plugin-canvas-picker": "^1.2.0",
|
|
35
|
+
"@antv/g-plugin-canvas-renderer": "^1.2.0",
|
|
36
|
+
"@antv/g-plugin-dom-interaction": "^1.2.0",
|
|
37
|
+
"@antv/g-plugin-html-renderer": "^1.2.0",
|
|
38
|
+
"@antv/g-plugin-image-loader": "^0.1.0",
|
|
39
39
|
"tslib": "^2.3.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "bf0d57ef10d56f48d6258906281b9edb34bffb48"
|
|
52
52
|
}
|