123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- // node_modules/@arcgis/core/symbols/cim/utils.js
- function t(t2) {
- return typeof t2 == "function";
- }
- function e(e2, r2, n2, o2) {
- return t(e2) ? e2(r2, n2, o2) : e2;
- }
- function r(t2) {
- return [t2.r, t2.g, t2.b, t2.a];
- }
- function n(t2, e2, r2) {
- const n2 = " /-,\n", a2 = (t3) => {
- let e3 = t3.length;
- for (; e3--; )
- if (!n2.includes(t3.charAt(e3)))
- return false;
- return true;
- }, i2 = [];
- let c2 = 0, l2 = -1;
- do {
- if (l2 = e2.indexOf("[", c2), l2 >= c2) {
- if (l2 > c2) {
- const t3 = e2.substr(c2, l2 - c2);
- i2.push([t3, null, a2(t3)]);
- }
- if (c2 = l2 + 1, l2 = e2.indexOf("]", c2), l2 >= c2) {
- if (l2 > c2) {
- const r3 = t2[e2.substr(c2, l2 - c2)];
- r3 && i2.push([null, r3, false]);
- }
- c2 = l2 + 1;
- }
- }
- } while (l2 !== -1);
- if (c2 < e2.length - 1) {
- const t3 = e2.substr(c2);
- i2.push([t3, null, a2(t3)]);
- }
- return (t3) => {
- let e3 = "", n3 = null;
- for (const r3 of i2) {
- const [o2, a3, i3] = r3;
- if (o2)
- i3 ? n3 = o2 : (n3 && (e3 += n3, n3 = null), e3 += o2);
- else {
- const r4 = t3.attributes[a3];
- r4 && (n3 && (e3 += n3, n3 = null), e3 += r4);
- }
- }
- return o(e3, r2);
- };
- }
- function o(t2, e2) {
- switch (typeof t2 != "string" && (t2 = String(t2)), e2) {
- case "LowerCase":
- return t2.toLowerCase();
- case "Allcaps":
- return t2.toUpperCase();
- default:
- return t2;
- }
- }
- function a(t2, e2, r2, n2, o2, a2, i2 = true) {
- const c2 = e2 / o2, l2 = r2 / a2, u2 = Math.ceil(c2 / 2), s2 = Math.ceil(l2 / 2);
- for (let f2 = 0; f2 < a2; f2++)
- for (let r3 = 0; r3 < o2; r3++) {
- const M2 = 4 * (r3 + (i2 ? a2 - f2 - 1 : f2) * o2);
- let p2 = 0, C2 = 0, y = 0, I = 0, h = 0, k = 0, m = 0;
- const d = (f2 + 0.5) * l2;
- for (let n3 = Math.floor(f2 * l2); n3 < (f2 + 1) * l2; n3++) {
- const o3 = Math.abs(d - (n3 + 0.5)) / s2, a3 = (r3 + 0.5) * c2, i3 = o3 * o3;
- for (let l3 = Math.floor(r3 * c2); l3 < (r3 + 1) * c2; l3++) {
- let r4 = Math.abs(a3 - (l3 + 0.5)) / u2;
- const o4 = Math.sqrt(i3 + r4 * r4);
- o4 >= -1 && o4 <= 1 && (p2 = 2 * o4 * o4 * o4 - 3 * o4 * o4 + 1, p2 > 0 && (r4 = 4 * (l3 + n3 * e2), m += p2 * t2[r4 + 3], y += p2, t2[r4 + 3] < 255 && (p2 = p2 * t2[r4 + 3] / 250), I += p2 * t2[r4], h += p2 * t2[r4 + 1], k += p2 * t2[r4 + 2], C2 += p2));
- }
- }
- n2[M2] = I / C2, n2[M2 + 1] = h / C2, n2[M2 + 2] = k / C2, n2[M2 + 3] = m / y;
- }
- }
- function i(t2) {
- return t2 ? { r: t2[0], g: t2[1], b: t2[2], a: t2[3] / 255 } : { r: 0, g: 0, b: 0, a: 0 };
- }
- function c(t2) {
- return t2.data?.symbol;
- }
- function l(t2) {
- return t2.type === "CIMVectorMarker" || t2.type === "CIMPictureMarker" || t2.type === "CIMBarChartMarker" || t2.type === "CIMCharacterMarker" || t2.type === "CIMPieChartMarker" || t2.type === "CIMStackedBarChartMarker";
- }
- function u(t2) {
- return t2.type === "CIMGradientStroke" || t2.type === "CIMPictureStroke" || t2.type === "CIMSolidStroke";
- }
- function s(t2) {
- return t2.type === "CIMGradientFill" || t2.type === "CIMHatchFill" || t2.type === "CIMPictureFill" || t2.type === "CIMSolidFill" || t2.type === "CIMWaterFill";
- }
- function f(t2) {
- return t2.type === "CIMMarkerPlacementAlongLineRandomSize" || t2.type === "CIMMarkerPlacementAlongLineSameSize" || t2.type === "CIMMarkerPlacementAlongLineVariableSize" || t2.type === "CIMMarkerPlacementAtExtremities" || t2.type === "CIMMarkerPlacementAtMeasuredUnits" || t2.type === "CIMMarkerPlacementAtRatioPositions" || t2.type === "CIMMarkerPlacementOnLine" || t2.type === "CIMMarkerPlacementOnVertices";
- }
- var M = (t2) => isNaN(t2) || !t2 ? 0 : t2;
- var p = (t2) => {
- if (!t2)
- return false;
- for (const e2 of t2)
- switch (e2.type) {
- case "CIMGeometricEffectBuffer":
- case "CIMGeometricEffectOffset":
- return true;
- }
- return false;
- };
- function C() {
- return import("./geometryEngineJSON-XXKTYTFH.js");
- }
- export {
- e,
- r,
- n,
- o,
- a,
- i,
- c,
- l,
- u,
- s,
- f,
- M,
- p,
- C
- };
- //# sourceMappingURL=chunk-TRK7CKWP.js.map
|