@carbon/charts 1.11.3 → 1.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/{_baseEach-477c04db.js → _baseEach-326db134.js} +2 -2
  3. package/dist/{_baseEach-477c04db.js.map → _baseEach-326db134.js.map} +1 -1
  4. package/dist/{_baseEach-05847c57.mjs → _baseEach-9b6a12fa.mjs} +2 -2
  5. package/dist/{_baseEach-05847c57.mjs.map → _baseEach-9b6a12fa.mjs.map} +1 -1
  6. package/dist/angle-utils-264ed176.mjs +840 -0
  7. package/dist/angle-utils-264ed176.mjs.map +1 -0
  8. package/dist/angle-utils-ccc0d890.js +3 -0
  9. package/dist/angle-utils-ccc0d890.js.map +1 -0
  10. package/dist/{choropleth-db3ae9eb.js → choropleth-300f112d.js} +15 -15
  11. package/dist/{choropleth-db3ae9eb.js.map → choropleth-300f112d.js.map} +1 -1
  12. package/dist/{choropleth-449cf25e.mjs → choropleth-9123f871.mjs} +1534 -1531
  13. package/dist/{choropleth-449cf25e.mjs.map → choropleth-9123f871.mjs.map} +1 -1
  14. package/dist/color-scale-utils-2cd523be.js +2 -0
  15. package/dist/color-scale-utils-2cd523be.js.map +1 -0
  16. package/dist/color-scale-utils-b9604b2c.mjs +3335 -0
  17. package/dist/color-scale-utils-b9604b2c.mjs.map +1 -0
  18. package/dist/components/index.js +1 -1
  19. package/dist/components/index.mjs +4 -4
  20. package/dist/demo/index.js +10 -10
  21. package/dist/demo/index.js.map +1 -1
  22. package/dist/demo/index.mjs +291 -300
  23. package/dist/demo/index.mjs.map +1 -1
  24. package/dist/demo/utils/package-versions.d.ts +5 -5
  25. package/dist/{index-e425a7b5.mjs → index-4b5d1e49.mjs} +3 -3
  26. package/dist/{index-e425a7b5.mjs.map → index-4b5d1e49.mjs.map} +1 -1
  27. package/dist/index-becfb567.mjs.map +1 -1
  28. package/dist/index-d865d500.js.map +1 -1
  29. package/dist/{index-4203ca23.js → index-eace9da9.js} +2 -2
  30. package/dist/{index-4203ca23.js.map → index-eace9da9.js.map} +1 -1
  31. package/dist/index.js +1 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +38 -38
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/model/index.js +1 -1
  36. package/dist/model/index.js.map +1 -1
  37. package/dist/model/index.mjs +34 -34
  38. package/dist/model/index.mjs.map +1 -1
  39. package/dist/services/index.js +1 -1
  40. package/dist/services/index.mjs +10 -10
  41. package/package.json +17 -19
  42. package/dist/angle-utils-512bc5cd.js +0 -2
  43. package/dist/angle-utils-512bc5cd.js.map +0 -1
  44. package/dist/angle-utils-7255d1d9.mjs +0 -387
  45. package/dist/angle-utils-7255d1d9.mjs.map +0 -1
  46. package/dist/color-scale-utils-222feda6.mjs +0 -3815
  47. package/dist/color-scale-utils-222feda6.mjs.map +0 -1
  48. package/dist/color-scale-utils-79786095.js +0 -3
  49. package/dist/color-scale-utils-79786095.js.map +0 -1
@@ -0,0 +1,840 @@
1
+ import { select as m } from "d3";
2
+ import { a as fe, c as O, r as de, g as $, d as _ } from "./color-scale-utils-b9604b2c.mjs";
3
+ import { _ as P, T as E, o as b } from "./enums-a96ef472.mjs";
4
+ var me = /\s/;
5
+ function ge(t) {
6
+ for (var e = t.length; e-- && me.test(t.charAt(e)); )
7
+ ;
8
+ return e;
9
+ }
10
+ var pe = /^\s+/;
11
+ function ye(t) {
12
+ return t && t.slice(0, ge(t) + 1).replace(pe, "");
13
+ }
14
+ var q = 0 / 0, we = /^[-+]0x[0-9a-f]+$/i, Se = /^0b[01]+$/i, Ee = /^0o[0-7]+$/i, be = parseInt;
15
+ function j(t) {
16
+ if (typeof t == "number")
17
+ return t;
18
+ if (fe(t))
19
+ return q;
20
+ if (O(t)) {
21
+ var e = typeof t.valueOf == "function" ? t.valueOf() : t;
22
+ t = O(e) ? e + "" : e;
23
+ }
24
+ if (typeof t != "string")
25
+ return t === 0 ? t : +t;
26
+ t = ye(t);
27
+ var n = Se.test(t);
28
+ return n || Ee.test(t) ? be(t.slice(2), n ? 2 : 8) : we.test(t) ? q : +t;
29
+ }
30
+ var xe = function() {
31
+ return de.Date.now();
32
+ };
33
+ const M = xe;
34
+ var Re = "Expected a function", Ce = Math.max, Te = Math.min;
35
+ function Ie(t, e, n) {
36
+ var r, i, s, a, c, o, u = 0, f = !1, d = !1, h = !0;
37
+ if (typeof t != "function")
38
+ throw new TypeError(Re);
39
+ e = j(e) || 0, O(n) && (f = !!n.leading, d = "maxWait" in n, s = d ? Ce(j(n.maxWait) || 0, e) : s, h = "trailing" in n ? !!n.trailing : h);
40
+ function w(l) {
41
+ var S = r, C = i;
42
+ return r = i = void 0, u = l, a = t.apply(C, S), a;
43
+ }
44
+ function R(l) {
45
+ return u = l, c = setTimeout(I, e), f ? w(l) : a;
46
+ }
47
+ function T(l) {
48
+ var S = l - o, C = l - u, U = e - S;
49
+ return d ? Te(U, s - C) : U;
50
+ }
51
+ function z(l) {
52
+ var S = l - o, C = l - u;
53
+ return o === void 0 || S >= e || S < 0 || d && C >= s;
54
+ }
55
+ function I() {
56
+ var l = M();
57
+ if (z(l))
58
+ return G(l);
59
+ c = setTimeout(I, T(l));
60
+ }
61
+ function G(l) {
62
+ return c = void 0, h && r ? w(l) : (r = i = void 0, a);
63
+ }
64
+ function ue() {
65
+ c !== void 0 && clearTimeout(c), u = 0, r = o = i = c = void 0;
66
+ }
67
+ function he() {
68
+ return c === void 0 ? a : G(M());
69
+ }
70
+ function F() {
71
+ var l = M(), S = z(l);
72
+ if (r = arguments, i = this, o = l, S) {
73
+ if (c === void 0)
74
+ return R(o);
75
+ if (d)
76
+ return clearTimeout(c), c = setTimeout(I, e), w(o);
77
+ }
78
+ return c === void 0 && (c = setTimeout(I, e)), a;
79
+ }
80
+ return F.cancel = ue, F.flush = he, F;
81
+ }
82
+ function Le(t, e) {
83
+ if (t.match(/^[a-z]+:\/\//i))
84
+ return t;
85
+ if (t.match(/^\/\//))
86
+ return window.location.protocol + t;
87
+ if (t.match(/^[a-z]+:/i))
88
+ return t;
89
+ const n = document.implementation.createHTMLDocument(), r = n.createElement("base"), i = n.createElement("a");
90
+ return n.head.appendChild(r), n.body.appendChild(i), e && (r.href = e), i.href = t, i.href;
91
+ }
92
+ const ve = (() => {
93
+ let t = 0;
94
+ const e = () => (
95
+ // eslint-disable-next-line no-bitwise
96
+ `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4)
97
+ );
98
+ return () => (t += 1, `u${e()}${t}`);
99
+ })();
100
+ function y(t) {
101
+ const e = [];
102
+ for (let n = 0, r = t.length; n < r; n++)
103
+ e.push(t[n]);
104
+ return e;
105
+ }
106
+ function v(t, e) {
107
+ const r = (t.ownerDocument.defaultView || window).getComputedStyle(t).getPropertyValue(e);
108
+ return r ? parseFloat(r.replace("px", "")) : 0;
109
+ }
110
+ function De(t) {
111
+ const e = v(t, "border-left-width"), n = v(t, "border-right-width");
112
+ return t.clientWidth + e + n;
113
+ }
114
+ function Ae(t) {
115
+ const e = v(t, "border-top-width"), n = v(t, "border-bottom-width");
116
+ return t.clientHeight + e + n;
117
+ }
118
+ function ee(t, e = {}) {
119
+ const n = e.width || De(t), r = e.height || Ae(t);
120
+ return { width: n, height: r };
121
+ }
122
+ function Fe() {
123
+ let t, e;
124
+ try {
125
+ e = process;
126
+ } catch {
127
+ }
128
+ const n = e && e.env ? e.env.devicePixelRatio : null;
129
+ return n && (t = parseInt(n, 10), Number.isNaN(t) && (t = 1)), t || window.devicePixelRatio || 1;
130
+ }
131
+ const p = 16384;
132
+ function $e(t) {
133
+ (t.width > p || t.height > p) && (t.width > p && t.height > p ? t.width > t.height ? (t.height *= p / t.width, t.width = p) : (t.width *= p / t.height, t.height = p) : t.width > p ? (t.height *= p / t.width, t.width = p) : (t.width *= p / t.height, t.height = p));
134
+ }
135
+ function D(t) {
136
+ return new Promise((e, n) => {
137
+ const r = new Image();
138
+ r.decode = () => e(r), r.onload = () => e(r), r.onerror = n, r.crossOrigin = "anonymous", r.decoding = "async", r.src = t;
139
+ });
140
+ }
141
+ async function Pe(t) {
142
+ return Promise.resolve().then(() => new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
143
+ }
144
+ async function Me(t, e, n) {
145
+ const r = "http://www.w3.org/2000/svg", i = document.createElementNS(r, "svg"), s = document.createElementNS(r, "foreignObject");
146
+ return i.setAttribute("width", `${e}`), i.setAttribute("height", `${n}`), i.setAttribute("viewBox", `0 0 ${e} ${n}`), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("x", "0"), s.setAttribute("y", "0"), s.setAttribute("externalResourcesRequired", "true"), i.appendChild(s), s.appendChild(t), Pe(i);
147
+ }
148
+ const g = (t, e) => {
149
+ if (t instanceof e)
150
+ return !0;
151
+ const n = Object.getPrototypeOf(t);
152
+ return n === null ? !1 : n.constructor.name === e.name || g(n, e);
153
+ };
154
+ function He(t) {
155
+ const e = t.getPropertyValue("content");
156
+ return `${t.cssText} content: '${e.replace(/'|"/g, "")}';`;
157
+ }
158
+ function Oe(t) {
159
+ return y(t).map((e) => {
160
+ const n = t.getPropertyValue(e), r = t.getPropertyPriority(e);
161
+ return `${e}: ${n}${r ? " !important" : ""};`;
162
+ }).join(" ");
163
+ }
164
+ function Be(t, e, n) {
165
+ const r = `.${t}:${e}`, i = n.cssText ? He(n) : Oe(n);
166
+ return document.createTextNode(`${r}{${i}}`);
167
+ }
168
+ function X(t, e, n) {
169
+ const r = window.getComputedStyle(t, n), i = r.getPropertyValue("content");
170
+ if (i === "" || i === "none")
171
+ return;
172
+ const s = ve();
173
+ try {
174
+ e.className = `${e.className} ${s}`;
175
+ } catch {
176
+ return;
177
+ }
178
+ const a = document.createElement("style");
179
+ a.appendChild(Be(s, n, r)), e.appendChild(a);
180
+ }
181
+ function ke(t, e) {
182
+ X(t, e, ":before"), X(t, e, ":after");
183
+ }
184
+ const J = "application/font-woff", N = "image/jpeg", Ve = {
185
+ woff: J,
186
+ woff2: J,
187
+ ttf: "application/font-truetype",
188
+ eot: "application/vnd.ms-fontobject",
189
+ png: "image/png",
190
+ jpg: N,
191
+ jpeg: N,
192
+ gif: "image/gif",
193
+ tiff: "image/tiff",
194
+ svg: "image/svg+xml",
195
+ webp: "image/webp"
196
+ };
197
+ function We(t) {
198
+ const e = /\.([^./]*?)$/g.exec(t);
199
+ return e ? e[1] : "";
200
+ }
201
+ function V(t) {
202
+ const e = We(t).toLowerCase();
203
+ return Ve[e] || "";
204
+ }
205
+ function ze(t) {
206
+ return t.split(/,/)[1];
207
+ }
208
+ function B(t) {
209
+ return t.search(/^(data:)/) !== -1;
210
+ }
211
+ function te(t, e) {
212
+ return `data:${e};base64,${t}`;
213
+ }
214
+ async function ne(t, e, n) {
215
+ const r = await fetch(t, e);
216
+ if (r.status === 404)
217
+ throw new Error(`Resource "${r.url}" not found`);
218
+ const i = await r.blob();
219
+ return new Promise((s, a) => {
220
+ const c = new FileReader();
221
+ c.onerror = a, c.onloadend = () => {
222
+ try {
223
+ s(n({ res: r, result: c.result }));
224
+ } catch (o) {
225
+ a(o);
226
+ }
227
+ }, c.readAsDataURL(i);
228
+ });
229
+ }
230
+ const H = {};
231
+ function Ge(t, e, n) {
232
+ let r = t.replace(/\?.*/, "");
233
+ return n && (r = t), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), e ? `[${e}]${r}` : r;
234
+ }
235
+ async function W(t, e, n) {
236
+ const r = Ge(t, e, n.includeQueryParams);
237
+ if (H[r] != null)
238
+ return H[r];
239
+ n.cacheBust && (t += (/\?/.test(t) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
240
+ let i;
241
+ try {
242
+ const s = await ne(t, n.fetchRequestInit, ({ res: a, result: c }) => (e || (e = a.headers.get("Content-Type") || ""), ze(c)));
243
+ i = te(s, e);
244
+ } catch (s) {
245
+ i = n.imagePlaceholder || "";
246
+ let a = `Failed to fetch resource: ${t}`;
247
+ s && (a = typeof s == "string" ? s : s.message), a && console.warn(a);
248
+ }
249
+ return H[r] = i, i;
250
+ }
251
+ async function Ue(t) {
252
+ const e = t.toDataURL();
253
+ return e === "data:," ? t.cloneNode(!1) : D(e);
254
+ }
255
+ async function _e(t, e) {
256
+ if (t.currentSrc) {
257
+ const s = document.createElement("canvas"), a = s.getContext("2d");
258
+ s.width = t.clientWidth, s.height = t.clientHeight, a == null || a.drawImage(t, 0, 0, s.width, s.height);
259
+ const c = s.toDataURL();
260
+ return D(c);
261
+ }
262
+ const n = t.poster, r = V(n), i = await W(n, r, e);
263
+ return D(i);
264
+ }
265
+ async function qe(t) {
266
+ var e;
267
+ try {
268
+ if (!((e = t == null ? void 0 : t.contentDocument) === null || e === void 0) && e.body)
269
+ return await A(t.contentDocument.body, {}, !0);
270
+ } catch {
271
+ }
272
+ return t.cloneNode(!1);
273
+ }
274
+ async function je(t, e) {
275
+ return g(t, HTMLCanvasElement) ? Ue(t) : g(t, HTMLVideoElement) ? _e(t, e) : g(t, HTMLIFrameElement) ? qe(t) : t.cloneNode(!1);
276
+ }
277
+ const Xe = (t) => t.tagName != null && t.tagName.toUpperCase() === "SLOT";
278
+ async function Je(t, e, n) {
279
+ var r, i;
280
+ let s = [];
281
+ return Xe(t) && t.assignedNodes ? s = y(t.assignedNodes()) : g(t, HTMLIFrameElement) && (!((r = t.contentDocument) === null || r === void 0) && r.body) ? s = y(t.contentDocument.body.childNodes) : s = y(((i = t.shadowRoot) !== null && i !== void 0 ? i : t).childNodes), s.length === 0 || g(t, HTMLVideoElement) || await s.reduce((a, c) => a.then(() => A(c, n)).then((o) => {
282
+ o && e.appendChild(o);
283
+ }), Promise.resolve()), e;
284
+ }
285
+ function Ne(t, e) {
286
+ const n = e.style;
287
+ if (!n)
288
+ return;
289
+ const r = window.getComputedStyle(t);
290
+ r.cssText ? (n.cssText = r.cssText, n.transformOrigin = r.transformOrigin) : y(r).forEach((i) => {
291
+ let s = r.getPropertyValue(i);
292
+ i === "font-size" && s.endsWith("px") && (s = `${Math.floor(parseFloat(s.substring(0, s.length - 2))) - 0.1}px`), g(t, HTMLIFrameElement) && i === "display" && s === "inline" && (s = "block"), i === "d" && e.getAttribute("d") && (s = `path(${e.getAttribute("d")})`), n.setProperty(i, s, r.getPropertyPriority(i));
293
+ });
294
+ }
295
+ function Qe(t, e) {
296
+ g(t, HTMLTextAreaElement) && (e.innerHTML = t.value), g(t, HTMLInputElement) && e.setAttribute("value", t.value);
297
+ }
298
+ function Ye(t, e) {
299
+ if (g(t, HTMLSelectElement)) {
300
+ const n = e, r = Array.from(n.children).find((i) => t.value === i.getAttribute("value"));
301
+ r && r.setAttribute("selected", "");
302
+ }
303
+ }
304
+ function Ze(t, e) {
305
+ return g(e, Element) && (Ne(t, e), ke(t, e), Qe(t, e), Ye(t, e)), e;
306
+ }
307
+ async function Ke(t, e) {
308
+ const n = t.querySelectorAll ? t.querySelectorAll("use") : [];
309
+ if (n.length === 0)
310
+ return t;
311
+ const r = {};
312
+ for (let s = 0; s < n.length; s++) {
313
+ const c = n[s].getAttribute("xlink:href");
314
+ if (c) {
315
+ const o = t.querySelector(c), u = document.querySelector(c);
316
+ !o && u && !r[c] && (r[c] = await A(u, e, !0));
317
+ }
318
+ }
319
+ const i = Object.values(r);
320
+ if (i.length) {
321
+ const s = "http://www.w3.org/1999/xhtml", a = document.createElementNS(s, "svg");
322
+ a.setAttribute("xmlns", s), a.style.position = "absolute", a.style.width = "0", a.style.height = "0", a.style.overflow = "hidden", a.style.display = "none";
323
+ const c = document.createElementNS(s, "defs");
324
+ a.appendChild(c);
325
+ for (let o = 0; o < i.length; o++)
326
+ c.appendChild(i[o]);
327
+ t.appendChild(a);
328
+ }
329
+ return t;
330
+ }
331
+ async function A(t, e, n) {
332
+ return !n && e.filter && !e.filter(t) ? null : Promise.resolve(t).then((r) => je(r, e)).then((r) => Je(t, r, e)).then((r) => Ze(t, r)).then((r) => Ke(r, e));
333
+ }
334
+ const re = /url\((['"]?)([^'"]+?)\1\)/g, et = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, tt = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
335
+ function nt(t) {
336
+ const e = t.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
337
+ return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`, "g");
338
+ }
339
+ function rt(t) {
340
+ const e = [];
341
+ return t.replace(re, (n, r, i) => (e.push(i), n)), e.filter((n) => !B(n));
342
+ }
343
+ async function it(t, e, n, r, i) {
344
+ try {
345
+ const s = n ? Le(e, n) : e, a = V(e);
346
+ let c;
347
+ if (i) {
348
+ const o = await i(s);
349
+ c = te(o, a);
350
+ } else
351
+ c = await W(s, a, r);
352
+ return t.replace(nt(e), `$1${c}$3`);
353
+ } catch {
354
+ }
355
+ return t;
356
+ }
357
+ function st(t, { preferredFontFormat: e }) {
358
+ return e ? t.replace(tt, (n) => {
359
+ for (; ; ) {
360
+ const [r, , i] = et.exec(n) || [];
361
+ if (!i)
362
+ return "";
363
+ if (i === e)
364
+ return `src: ${r};`;
365
+ }
366
+ }) : t;
367
+ }
368
+ function ie(t) {
369
+ return t.search(re) !== -1;
370
+ }
371
+ async function se(t, e, n) {
372
+ if (!ie(t))
373
+ return t;
374
+ const r = st(t, n);
375
+ return rt(r).reduce((s, a) => s.then((c) => it(c, a, e, n)), Promise.resolve(r));
376
+ }
377
+ async function L(t, e, n) {
378
+ var r;
379
+ const i = (r = e.style) === null || r === void 0 ? void 0 : r.getPropertyValue(t);
380
+ if (i) {
381
+ const s = await se(i, null, n);
382
+ return e.style.setProperty(t, s, e.style.getPropertyPriority(t)), !0;
383
+ }
384
+ return !1;
385
+ }
386
+ async function at(t, e) {
387
+ await L("background", t, e) || await L("background-image", t, e), await L("mask", t, e) || await L("mask-image", t, e);
388
+ }
389
+ async function ct(t, e) {
390
+ const n = g(t, HTMLImageElement);
391
+ if (!(n && !B(t.src)) && !(g(t, SVGImageElement) && !B(t.href.baseVal)))
392
+ return;
393
+ const r = n ? t.src : t.href.baseVal, i = await W(r, V(r), e);
394
+ await new Promise((s, a) => {
395
+ t.onload = s, t.onerror = a;
396
+ const c = t;
397
+ c.decode && (c.decode = s), c.loading === "lazy" && (c.loading = "eager"), n ? (t.srcset = "", t.src = i) : t.href.baseVal = i;
398
+ });
399
+ }
400
+ async function ot(t, e) {
401
+ const r = y(t.childNodes).map((i) => ae(i, e));
402
+ await Promise.all(r).then(() => t);
403
+ }
404
+ async function ae(t, e) {
405
+ g(t, Element) && (await at(t, e), await ct(t, e), await ot(t, e));
406
+ }
407
+ function lt(t, e) {
408
+ const { style: n } = t;
409
+ e.backgroundColor && (n.backgroundColor = e.backgroundColor), e.width && (n.width = `${e.width}px`), e.height && (n.height = `${e.height}px`);
410
+ const r = e.style;
411
+ return r != null && Object.keys(r).forEach((i) => {
412
+ n[i] = r[i];
413
+ }), t;
414
+ }
415
+ const Q = {};
416
+ async function Y(t) {
417
+ let e = Q[t];
418
+ if (e != null)
419
+ return e;
420
+ const r = await (await fetch(t)).text();
421
+ return e = { url: t, cssText: r }, Q[t] = e, e;
422
+ }
423
+ async function Z(t, e) {
424
+ let n = t.cssText;
425
+ const r = /url\(["']?([^"')]+)["']?\)/g, s = (n.match(/url\([^)]+\)/g) || []).map(async (a) => {
426
+ let c = a.replace(r, "$1");
427
+ return c.startsWith("https://") || (c = new URL(c, t.url).href), ne(c, e.fetchRequestInit, ({ result: o }) => (n = n.replace(a, `url(${o})`), [a, o]));
428
+ });
429
+ return Promise.all(s).then(() => n);
430
+ }
431
+ function K(t) {
432
+ if (t == null)
433
+ return [];
434
+ const e = [], n = /(\/\*[\s\S]*?\*\/)/gi;
435
+ let r = t.replace(n, "");
436
+ const i = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
437
+ for (; ; ) {
438
+ const o = i.exec(r);
439
+ if (o === null)
440
+ break;
441
+ e.push(o[0]);
442
+ }
443
+ r = r.replace(i, "");
444
+ const s = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, a = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", c = new RegExp(a, "gi");
445
+ for (; ; ) {
446
+ let o = s.exec(r);
447
+ if (o === null) {
448
+ if (o = c.exec(r), o === null)
449
+ break;
450
+ s.lastIndex = c.lastIndex;
451
+ } else
452
+ c.lastIndex = s.lastIndex;
453
+ e.push(o[0]);
454
+ }
455
+ return e;
456
+ }
457
+ async function ut(t, e) {
458
+ const n = [], r = [];
459
+ return t.forEach((i) => {
460
+ if ("cssRules" in i)
461
+ try {
462
+ y(i.cssRules || []).forEach((s, a) => {
463
+ if (s.type === CSSRule.IMPORT_RULE) {
464
+ let c = a + 1;
465
+ const o = s.href, u = Y(o).then((f) => Z(f, e)).then((f) => K(f).forEach((d) => {
466
+ try {
467
+ i.insertRule(d, d.startsWith("@import") ? c += 1 : i.cssRules.length);
468
+ } catch (h) {
469
+ console.error("Error inserting rule from remote css", {
470
+ rule: d,
471
+ error: h
472
+ });
473
+ }
474
+ })).catch((f) => {
475
+ console.error("Error loading remote css", f.toString());
476
+ });
477
+ r.push(u);
478
+ }
479
+ });
480
+ } catch (s) {
481
+ const a = t.find((c) => c.href == null) || document.styleSheets[0];
482
+ i.href != null && r.push(Y(i.href).then((c) => Z(c, e)).then((c) => K(c).forEach((o) => {
483
+ a.insertRule(o, i.cssRules.length);
484
+ })).catch((c) => {
485
+ console.error("Error loading remote stylesheet", c);
486
+ })), console.error("Error inlining remote css file", s);
487
+ }
488
+ }), Promise.all(r).then(() => (t.forEach((i) => {
489
+ if ("cssRules" in i)
490
+ try {
491
+ y(i.cssRules || []).forEach((s) => {
492
+ n.push(s);
493
+ });
494
+ } catch (s) {
495
+ console.error(`Error while reading CSS rules from ${i.href}`, s);
496
+ }
497
+ }), n));
498
+ }
499
+ function ht(t) {
500
+ return t.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => ie(e.style.getPropertyValue("src")));
501
+ }
502
+ async function ft(t, e) {
503
+ if (t.ownerDocument == null)
504
+ throw new Error("Provided element is not within a Document");
505
+ const n = y(t.ownerDocument.styleSheets), r = await ut(n, e);
506
+ return ht(r);
507
+ }
508
+ async function dt(t, e) {
509
+ const n = await ft(t, e);
510
+ return (await Promise.all(n.map((i) => {
511
+ const s = i.parentStyleSheet ? i.parentStyleSheet.href : null;
512
+ return se(i.cssText, s, e);
513
+ }))).join(`
514
+ `);
515
+ }
516
+ async function mt(t, e) {
517
+ const n = e.fontEmbedCSS != null ? e.fontEmbedCSS : e.skipFonts ? null : await dt(t, e);
518
+ if (n) {
519
+ const r = document.createElement("style"), i = document.createTextNode(n);
520
+ r.appendChild(i), t.firstChild ? t.insertBefore(r, t.firstChild) : t.appendChild(r);
521
+ }
522
+ }
523
+ async function gt(t, e = {}) {
524
+ const { width: n, height: r } = ee(t, e), i = await A(t, e, !0);
525
+ return await mt(i, e), await ae(i, e), lt(i, e), await Me(i, n, r);
526
+ }
527
+ async function ce(t, e = {}) {
528
+ const { width: n, height: r } = ee(t, e), i = await gt(t, e), s = await D(i), a = document.createElement("canvas"), c = a.getContext("2d"), o = e.pixelRatio || Fe(), u = e.canvasWidth || n, f = e.canvasHeight || r;
529
+ return a.width = u * o, a.height = f * o, e.skipAutoScale || $e(a), a.style.width = `${u}`, a.style.height = `${f}`, e.backgroundColor && (c.fillStyle = e.backgroundColor, c.fillRect(0, 0, a.width, a.height)), c.drawImage(s, 0, 0, a.width, a.height), a;
530
+ }
531
+ async function pt(t, e = {}) {
532
+ return (await ce(t, e)).toDataURL();
533
+ }
534
+ async function yt(t, e = {}) {
535
+ return (await ce(t, e)).toDataURL("image/jpeg", e.quality || 1);
536
+ }
537
+ class oe {
538
+ constructor(e, n) {
539
+ this.model = e, this.services = n, this.init();
540
+ }
541
+ init() {
542
+ }
543
+ update() {
544
+ }
545
+ // Used to pass down information to the components
546
+ setModel(e) {
547
+ this.model = e;
548
+ }
549
+ // Used to pass down services to the components
550
+ setServices(e) {
551
+ this.services = e;
552
+ }
553
+ }
554
+ const wt = "DONT_STYLE_ME_css_styles_verifier";
555
+ class k extends oe {
556
+ // initialized in initializeID() called by init()
557
+ constructor(e, n) {
558
+ super(e, n), this.chartID = "";
559
+ }
560
+ static getHTMLElementSize(e) {
561
+ return {
562
+ width: e.clientWidth,
563
+ height: e.clientHeight
564
+ };
565
+ }
566
+ static getSVGElementSize(e, n = {
567
+ useAttrs: !1,
568
+ useClientDimensions: !1,
569
+ useBBox: !1,
570
+ useBoundingRect: !1
571
+ }) {
572
+ e.attr || (e = m(e));
573
+ const r = {
574
+ width: 0,
575
+ height: 0
576
+ }, i = (h) => {
577
+ h && Object.keys(r).forEach((w) => {
578
+ if (h[w]) {
579
+ const R = h[w], T = parseFloat(R);
580
+ R && T > r[w] && ("" + R).indexOf("%") === -1 && (r[w] = T);
581
+ }
582
+ });
583
+ }, s = {
584
+ width: e.attr("width"),
585
+ height: e.attr("height")
586
+ }, a = e.node();
587
+ let c, o, u, f;
588
+ try {
589
+ typeof a.getBBox == "function" && (c = a.getBBox(), o = {
590
+ width: c.width,
591
+ height: c.height
592
+ });
593
+ } catch (h) {
594
+ console.error(h);
595
+ }
596
+ try {
597
+ typeof (a == null ? void 0 : a.getBoundingClientRect) == "function" && (u = a.getBoundingClientRect(), f = {
598
+ width: u.width,
599
+ height: u.height
600
+ });
601
+ } catch (h) {
602
+ console.error(h);
603
+ }
604
+ let d;
605
+ if (a instanceof SVGSVGElement && (d = {
606
+ width: a.clientWidth,
607
+ height: a.clientHeight
608
+ }), n) {
609
+ if (n.useAttrs && (i(s), r.width > 0 && r.height > 0))
610
+ return r;
611
+ if (n.useClientDimensions && (i(d), r.width > 0 && r.height > 0))
612
+ return d;
613
+ if (n.useBBox && (i(o), r.width > 0 && r.height > 0))
614
+ return o;
615
+ if (n.useBoundingRect && (i(f), r.width > 0 && r.height > 0))
616
+ return f;
617
+ }
618
+ try {
619
+ const h = {
620
+ width: $(e.node(), "width", "baseVal", "value"),
621
+ height: $(e.node(), "height", "baseVal", "value")
622
+ };
623
+ i(h);
624
+ } catch {
625
+ i(d), i(o), i(s);
626
+ }
627
+ return r;
628
+ }
629
+ static appendOrSelect(e, n) {
630
+ const r = e.select(`${n}`);
631
+ if (r.empty()) {
632
+ let i = n.split("#"), s, a;
633
+ return i.length === 2 ? (s = i[0], i = i[1].split("."), a = i[0]) : (i = n.split("."), s = i[0]), e.append(s).attr("id", a).attr("class", i.slice(1).join(" "));
634
+ }
635
+ return r;
636
+ }
637
+ init() {
638
+ this.styleHolderElement(), this.initializeID(), this.addMainContainer(), this.model.getOptions().resizable && this.addResizeListener(), this.addHolderListeners(), this.handleFullscreenChange();
639
+ }
640
+ getChartID() {
641
+ return this.chartID;
642
+ }
643
+ generateElementIDString(e) {
644
+ return `chart-${this.chartID}-${e}`;
645
+ }
646
+ initializeID() {
647
+ this.chartID = Math.floor((1 + Math.random()) * 281474976710656).toString(16);
648
+ }
649
+ addMainContainer() {
650
+ const e = this.model.getOptions(), n = $(e, "style", "prefix"), r = m(this.getHolder()).append("div").classed(`${_}--${n}--chart-wrapper`, !0).attr("id", `chart-${this.getChartID()}`).style("height", "100%").style("width", "100%");
651
+ r.append("g").attr("class", wt), this.mainContainer = r.node();
652
+ }
653
+ update() {
654
+ this.styleHolderElement();
655
+ }
656
+ styleHolderElement() {
657
+ const e = this.getHolder(), { width: n, height: r, theme: i } = this.model.getOptions();
658
+ n !== this.width && (e.style.width = n, this.width = n), r !== this.height && (e.style.height = r, this.height = r), m(this.getHolder()).classed(`${_}--chart-holder`, !0).attr("data-carbon-theme", i);
659
+ }
660
+ getHolder() {
661
+ return this.model.get("holder");
662
+ }
663
+ exportToJPG() {
664
+ const e = this, n = this.getHolder(), r = m(n);
665
+ r.classed("filled", !0), yt(this.getMainContainer(), {
666
+ quality: 1,
667
+ // Remove toolbar
668
+ filter: (i) => !(i.classList && i.classList.contains("cds--cc--toolbar"))
669
+ }).then(function(i) {
670
+ var s;
671
+ (s = e.services.files) == null || s.downloadImage(i, "myChart.jpg"), r.classed("filled", !1);
672
+ });
673
+ }
674
+ exportToPNG() {
675
+ const e = this, n = this.getHolder(), r = m(n);
676
+ r.classed("filled", !0), pt(this.getMainContainer(), {
677
+ quality: 1,
678
+ // Remove toolbar
679
+ filter: (i) => !(i.classList && i.classList.contains("cds--cc--toolbar"))
680
+ }).then(function(i) {
681
+ var s;
682
+ (s = e.services.files) == null || s.downloadImage(i, "myChart.png"), r.classed("filled", !1);
683
+ }).catch(function(i) {
684
+ console.error("oops, something went wrong!", i);
685
+ });
686
+ }
687
+ toggleFullscreen() {
688
+ const e = this.getHolder();
689
+ m(e).classed("fullscreen") && (document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement) ? document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen() : e.requestFullscreen ? e.requestFullscreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.msRequestFullscreen && e.msRequestFullscreen();
690
+ }
691
+ handleFullscreenChange() {
692
+ document.addEventListener("fullscreenchange", () => {
693
+ const e = m(this.getHolder()), n = e.classed("fullscreen");
694
+ e.classed("fullscreen", !n);
695
+ });
696
+ }
697
+ setSVGMaxHeight() {
698
+ if (!this.model.getOptions().height) {
699
+ const { height: e } = k.getSVGElementSize(
700
+ m(this.mainContainer),
701
+ {
702
+ useBBox: !0
703
+ }
704
+ ), n = m(this.mainContainer).attr("class"), r = m(this.mainContainer).selectAll(`.${n} > svg`);
705
+ let i = 0;
706
+ r.nodes().forEach(function(s) {
707
+ i += Number(
708
+ k.getSVGElementSize(m(s), {
709
+ useBBox: !0
710
+ }).height
711
+ );
712
+ }), i <= e ? m(this.mainContainer).attr("height", i) : m(this.mainContainer).attr("height", "100%");
713
+ }
714
+ }
715
+ getMainContainer() {
716
+ return this.mainContainer;
717
+ }
718
+ addHolderListeners() {
719
+ const e = this.getHolder();
720
+ e && m(e).on("mouseover", () => {
721
+ var n;
722
+ (n = this.services.events) == null || n.dispatchEvent(P.Chart.MOUSEOVER);
723
+ }).on("mouseout", () => {
724
+ var n;
725
+ (n = this.services.events) == null || n.dispatchEvent(P.Chart.MOUSEOUT);
726
+ });
727
+ }
728
+ addResizeListener() {
729
+ const e = this.getHolder();
730
+ if (!e)
731
+ return;
732
+ let n = e.clientWidth, r = e.clientHeight;
733
+ const i = Ie(() => {
734
+ var a;
735
+ e && (Math.abs(n - e.clientWidth) > 1 || Math.abs(r - e.clientHeight) > 1) && (n = e.clientWidth, r = e.clientHeight, (a = this.services.events) == null || a.dispatchEvent(P.Chart.RESIZE));
736
+ }, 12.5);
737
+ new ResizeObserver(i).observe(e);
738
+ }
739
+ }
740
+ class le extends oe {
741
+ static appendOrUpdateLinearGradient(e) {
742
+ let n = e.svg.select(`defs linearGradient#${e.id}`);
743
+ n.empty() && (n = e.svg.append("defs").append("linearGradient").attr("id", e.id).attr("x1", e.x1).attr("x2", e.x2).attr("y1", e.y1).attr("y2", e.y2)), n.selectAll("stop").remove(), n.selectAll("stop").data(e.stops).enter().append("stop").attr("offset", (r) => r.offset).style("stop-color", (r) => r.color).style("stop-opacity", (r) => r.opacity);
744
+ }
745
+ static getOffsetRatio(e) {
746
+ return (Math.abs(e[1]) * 100 / Math.abs(e[0] - e[1])).toFixed(2) + "%";
747
+ }
748
+ static getStops(e, n) {
749
+ const r = e[0] < 0 && e[1] > 0;
750
+ let i = [
751
+ {
752
+ offset: "0%",
753
+ color: n,
754
+ opacity: "0.6"
755
+ },
756
+ {
757
+ offset: "80%",
758
+ color: n,
759
+ opacity: "0"
760
+ }
761
+ ];
762
+ return r && (i = [
763
+ {
764
+ offset: "0%",
765
+ color: n,
766
+ opacity: "0.6"
767
+ },
768
+ {
769
+ offset: le.getOffsetRatio(e),
770
+ color: n,
771
+ opacity: "0"
772
+ },
773
+ {
774
+ offset: "100%",
775
+ color: n,
776
+ opacity: "0.6"
777
+ }
778
+ ]), i;
779
+ }
780
+ }
781
+ function Ct(t) {
782
+ const e = St(Et(t), 360);
783
+ return x(e, [0, 10]) || x(e, [350, 0]) ? {
784
+ textAnchor: E.START,
785
+ dominantBaseline: b.MIDDLE
786
+ } : x(e, [10, 80]) ? {
787
+ textAnchor: E.START,
788
+ dominantBaseline: b.HANGING
789
+ } : x(e, [80, 100]) ? {
790
+ textAnchor: E.MIDDLE,
791
+ dominantBaseline: b.HANGING
792
+ } : x(e, [100, 170]) ? {
793
+ textAnchor: E.END,
794
+ dominantBaseline: b.HANGING
795
+ } : x(e, [170, 190]) ? {
796
+ textAnchor: E.END,
797
+ dominantBaseline: b.MIDDLE
798
+ } : x(e, [190, 260]) ? {
799
+ textAnchor: E.END,
800
+ dominantBaseline: b.BASELINE
801
+ } : x(e, [260, 280]) ? {
802
+ textAnchor: E.MIDDLE,
803
+ dominantBaseline: b.BASELINE
804
+ } : {
805
+ textAnchor: E.START,
806
+ dominantBaseline: b.BASELINE
807
+ };
808
+ }
809
+ function St(t, e) {
810
+ return (t % e + e) % e;
811
+ }
812
+ function x(t, [e, n]) {
813
+ return t >= e && t <= n;
814
+ }
815
+ function Et(t) {
816
+ return t * (180 / Math.PI);
817
+ }
818
+ function Tt(t) {
819
+ return t * (Math.PI / 180);
820
+ }
821
+ function It(t, e, n = { x: 0, y: 0 }) {
822
+ const r = e * Math.cos(t) + n.x, i = e * Math.sin(t) + n.y;
823
+ return { x: isNaN(r) ? 0 : r, y: isNaN(i) ? 0 : i };
824
+ }
825
+ function Lt(t, e) {
826
+ return e * Math.sin(t - Math.PI / 2);
827
+ }
828
+ export {
829
+ k as D,
830
+ le as G,
831
+ oe as S,
832
+ Lt as a,
833
+ Et as b,
834
+ Ie as c,
835
+ Tt as d,
836
+ It as p,
837
+ Ct as r,
838
+ j as t
839
+ };
840
+ //# sourceMappingURL=angle-utils-264ed176.mjs.map