@arcgis/codemod 6.0.0-next.30 → 6.0.0-next.32

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.
@@ -1,602 +1,761 @@
1
- var ee = (s, e) => (e = Symbol[s]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + s), te = (s) => {
2
- throw TypeError(s);
1
+ var ne = (n, e) => (e = Symbol[n]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + n), se = (n) => {
2
+ throw TypeError(n);
3
3
  };
4
- var ne = (s, e, t) => {
4
+ var ie = (n, e, t) => {
5
5
  if (e != null) {
6
- typeof e != "object" && typeof e != "function" && te("Object expected");
7
- var n, o;
8
- t && (n = e[ee("asyncDispose")]), n === void 0 && (n = e[ee("dispose")], t && (o = n)), typeof n != "function" && te("Object not disposable"), o && (n = function() {
6
+ typeof e != "object" && typeof e != "function" && se("Object expected");
7
+ var s, i;
8
+ t && (s = e[ne("asyncDispose")]), s === void 0 && (s = e[ne("dispose")], t && (i = s)), typeof s != "function" && se("Object not disposable"), i && (s = function() {
9
9
  try {
10
- o.call(this);
11
- } catch (r) {
12
- return Promise.reject(r);
10
+ i.call(this);
11
+ } catch (c) {
12
+ return Promise.reject(c);
13
13
  }
14
- }), s.push([t, n, e]);
15
- } else t && s.push([t]);
14
+ }), n.push([t, s, e]);
15
+ } else t && n.push([t]);
16
16
  return e;
17
- }, se = (s, e, t) => {
18
- var n = typeof SuppressedError == "function" ? SuppressedError : function(i, d, l, c) {
19
- return c = Error(l), c.name = "SuppressedError", c.error = i, c.suppressed = d, c;
20
- }, o = (i) => e = t ? new n(i, e, "An error was suppressed during disposal") : (t = !0, i), r = (i) => {
21
- for (; i = s.pop(); )
17
+ }, re = (n, e, t) => {
18
+ var s = typeof SuppressedError == "function" ? SuppressedError : function(r, p, l, a) {
19
+ return a = Error(l), a.name = "SuppressedError", a.error = r, a.suppressed = p, a;
20
+ }, i = (r) => e = t ? new s(r, e, "An error was suppressed during disposal") : (t = !0, r), c = (r) => {
21
+ for (; r = n.pop(); )
22
22
  try {
23
- var d = i[1] && i[1].call(i[2]);
24
- if (i[0]) return Promise.resolve(d).then(r, (l) => (o(l), r()));
23
+ var p = r[1] && r[1].call(r[2]);
24
+ if (r[0]) return Promise.resolve(p).then(c, (l) => (i(l), c()));
25
25
  } catch (l) {
26
- o(l);
26
+ i(l);
27
27
  }
28
28
  if (t) throw e;
29
29
  };
30
- return r();
30
+ return c();
31
31
  };
32
- import { c as be } from "./useProjectInstance.js";
33
- import { d as V, r as ke, i as Ae, a as Pe, b as De } from "./cli.js";
34
- import { f as I } from "./log.js";
35
- import { path as $, toPosixPathSeparators as $e } from "@arcgis/node-toolkit/path";
36
- import { log as R } from "@arcgis/toolkit/log";
37
- import { forEachWithConcurrency as me } from "@arcgis/toolkit/promise";
38
- import a from "typescript";
39
- import { s as Ce, g as J, a as Ee, c as Le, p as Te } from "./artifact.js";
40
- import { loadCodeowners as ue } from "@arcgis/node-toolkit/codeowners";
41
- import { c as ie, s as U, g as Oe, a as oe, l as Fe, b as ge, d as fe, e as Ie, f as Me, h as Je } from "./componentAudit.js";
42
- import { g as je, a as K, c as he, b as Re, d as ze, e as B, f as ae, h as Ue } from "./classification.js";
43
- import { styleText as q } from "node:util";
44
- import { f as ve } from "./format.js";
45
- import { realpath as j, readFile as z } from "node:fs/promises";
46
- import L from "semver";
47
- import { asyncFindPath as ye } from "@arcgis/node-toolkit/file";
48
- import { asyncRetrievePackageJson as We } from "@arcgis/node-toolkit/packageJson";
49
- import { LineCounter as Ve, parseDocument as Be, isMap as Ke, isScalar as re } from "yaml";
50
- function qe(s, e, t) {
32
+ import { c as De } from "./useProjectInstance.js";
33
+ import { d as z, r as Ee, s as oe, i as Le, a as Te, b as Oe } from "./cli.js";
34
+ import { f as R } from "./log.js";
35
+ import { path as P, toPosixPathSeparators as Fe } from "@arcgis/node-toolkit/path";
36
+ import { forEachWithConcurrency as ve } from "@arcgis/toolkit/promise";
37
+ import o from "typescript";
38
+ import { g as ye, s as Ie, a as M, b as We, c as B, d as xe, e as Me, f as je, h as Re, i as we, p as Je, j as V, k as ae, l as Ue } from "./classification.js";
39
+ import { loadCodeowners as Se } from "@arcgis/node-toolkit/codeowners";
40
+ import { s as ze, c as ce, g as Ve, l as Ge, a as ke, b as qe, d as Be, e as Ke } from "./componentAudit.js";
41
+ import { styleText as K } from "node:util";
42
+ import { f as Ne } from "./format.js";
43
+ import { realpath as j, readFile as J } from "node:fs/promises";
44
+ import O from "semver";
45
+ import { asyncFindPath as G } from "@arcgis/node-toolkit/file";
46
+ import { asyncRetrievePackageJson as He } from "@arcgis/node-toolkit/packageJson";
47
+ import { log as q } from "@arcgis/toolkit/log";
48
+ import { LineCounter as Qe, parseDocument as _e, isMap as Xe, isScalar as le } from "yaml";
49
+ function Ye(n, e, t) {
51
50
  if (e === "json") {
52
51
  if (t !== void 0) {
53
52
  process.stdout.write(`${JSON.stringify(t, void 0, 2)}
54
53
  `);
55
54
  return;
56
55
  }
57
- const n = J();
58
- process.stdout.write(`${Xe(s, ue(), n)}
56
+ const s = M();
57
+ process.stdout.write(`${st(n, Se(), s)}
59
58
  `);
60
59
  return;
61
60
  }
62
61
  if (e === "md") {
63
62
  process.stdout.write(
64
- `${t === void 0 ? Ye(s) : ve(t)}
63
+ `${t === void 0 ? it(n) : Ne(t)}
65
64
  `
66
65
  );
67
66
  return;
68
67
  }
69
- process.stdout.write(`${He(s)}
68
+ process.stdout.write(`${Ze(n)}
70
69
  `);
71
70
  }
72
- function He(s) {
73
- const e = xe(s), t = e.reduce((o, r) => o + r.count, 0), n = [ce("Deprecation summary", t)];
74
- for (const { categoryName: o, count: r, packages: i } of e) {
75
- n.push(`${V[o].label} (${r})`);
76
- for (const { displayName: d, count: l } of i)
77
- n.push(` ${le(d)} (${l})`);
71
+ function Ze(n) {
72
+ const e = be(n), t = e.reduce((i, c) => i + c.count, 0), s = [pe("Deprecation summary", t)];
73
+ for (const { categoryName: i, count: c, packages: r } of e) {
74
+ s.push(`${z[i].label} (${c})`);
75
+ for (const { displayName: p, count: l } of r)
76
+ s.push(` ${de(p)} (${l})`);
78
77
  }
79
- n.push("", "", ce("Deprecation details", t));
80
- for (const { categoryName: o, count: r, packages: i } of e) {
81
- const d = V[o];
82
- n.push("", `${d.label} (${r})`), "description" in d && n.push(` ${d.description}`);
83
- for (const { displayName: l, count: c, apis: f } of i) {
84
- n.push("", ` ${le(l)} (${c})`);
85
- for (const { name: g, reasons: p, items: m } of f) {
86
- const y = m[0].usage, h = Re({ name: g, memberOf: y.memberOf, kind: y.kind });
87
- n.push(` ${Qe(h)}${ze(y.kind)} (${m.length})`);
88
- for (const v of p)
89
- n.push(Ge(v, 6));
90
- for (const { sourceFileName: v, usage: w } of _e(m))
91
- n.push(` ${I(v)}:${w.line}:${w.column}`);
78
+ s.push("", "", pe("Deprecation details", t));
79
+ for (const { categoryName: i, count: c, packages: r } of e) {
80
+ const p = z[i];
81
+ s.push("", `${p.label} (${c})`), "description" in p && s.push(` ${p.description}`);
82
+ for (const { displayName: l, count: a, apis: m } of r) {
83
+ s.push("", ` ${de(l)} (${a})`);
84
+ for (const { name: g, reasons: y, items: v } of m) {
85
+ const d = v[0].usage, u = je({ name: g, memberOf: d.memberOf, kind: d.kind });
86
+ s.push(` ${et(u)}${Re(d.kind)} (${v.length})`);
87
+ for (const x of y)
88
+ s.push(tt(x, 6));
89
+ for (const { sourceFileName: x, usage: w } of nt(v))
90
+ s.push(` ${R(x)}:${w.line}:${w.column}`);
92
91
  }
93
92
  }
94
93
  }
95
- return n.join(`
94
+ return s.join(`
96
95
  `);
97
96
  }
98
- function xe(s) {
99
- const e = [...s].flatMap(
100
- ([t, n]) => n.map((o) => ({ ...o, packageName: t }))
97
+ function be(n) {
98
+ const e = [...n].flatMap(
99
+ ([t, s]) => s.map((i) => ({ ...i, packageName: t }))
101
100
  );
102
- return je(e, ({ packageName: t, usage: n }) => ({
101
+ return We(e, ({ packageName: t, usage: s }) => ({
103
102
  package: t,
104
- name: n.name,
105
- kind: n.kind,
106
- category: n.category,
107
- memberOf: n.memberOf,
108
- module: n.module ?? K(n.originFileNames, t),
109
- deprecated: n.reason ?? !0
103
+ name: s.name,
104
+ kind: s.kind,
105
+ category: s.category,
106
+ memberOf: s.memberOf,
107
+ module: s.module ?? B(s.originFileNames, t),
108
+ deprecated: s.reason ?? !0
110
109
  }));
111
110
  }
112
- function ce(s, e) {
113
- return q(["bold", "yellow"], `${s} (${e})`);
111
+ function pe(n, e) {
112
+ return K(["bold", "yellow"], `${n} (${e})`);
114
113
  }
115
- function le(s) {
116
- return q("blue", s);
114
+ function de(n) {
115
+ return K("blue", n);
117
116
  }
118
- function Qe(s) {
119
- return q(["bold", "white"], s);
117
+ function et(n) {
118
+ return K(["bold", "white"], n);
120
119
  }
121
- function Ge(s, e) {
120
+ function tt(n, e) {
122
121
  const t = " ".repeat(e);
123
- return s.split(/\r?\n/u).map((n) => `${t}${n}`).join(`
122
+ return n.split(/\r?\n/u).map((s) => `${t}${s}`).join(`
124
123
  `);
125
124
  }
126
- function _e(s) {
127
- return s.toSorted(
125
+ function nt(n) {
126
+ return n.toSorted(
128
127
  (e, t) => e.sourceFileName.localeCompare(t.sourceFileName) || e.usage.line - t.usage.line || e.usage.column - t.usage.column
129
128
  );
130
129
  }
131
- function Xe(s, e, t = J()) {
132
- return JSON.stringify(H(s, e, t), void 0, 2);
130
+ function st(n, e, t = M()) {
131
+ return JSON.stringify(H(n, e, t), void 0, 2);
133
132
  }
134
- function Ye(s, e = J()) {
135
- return ve(H(s, void 0, e));
133
+ function it(n, e = M()) {
134
+ return Ne(H(n, void 0, e));
136
135
  }
137
- function H(s, e, t, n) {
138
- const o = xe(s);
136
+ function H(n, e, t, s, i = []) {
137
+ const c = be(n), r = ye(process.cwd(), t.repositoryRoot);
139
138
  return {
140
139
  auditKind: "usages",
141
140
  repository: t.repository,
142
141
  ref: t.ref,
143
142
  branch: t.branch,
144
- scannerVersion: Ce,
143
+ scannerVersion: Ie,
145
144
  scanDate: Date.now(),
146
- ...n === void 0 ? {} : { complete: n },
145
+ ...s === void 0 ? {} : { complete: s },
146
+ ...r === "" ? {} : { cwd: r },
147
+ ...i.length === 0 ? {} : { excludedPaths: i },
147
148
  summary: {
148
- total: o.reduce((i, { count: d }) => i + d, 0),
149
- categories: o.map(({ categoryName: i, count: d, packages: l }) => ({
150
- category: i,
151
- label: V[i].label,
152
- count: d,
153
- packages: l.map(({ packageName: c, displayName: f, count: g }) => ({
154
- package: c,
155
- ...f === c ? {} : { displayName: f },
156
- count: g
149
+ total: c.reduce((l, { count: a }) => l + a, 0),
150
+ categories: c.map(({ categoryName: l, count: a, packages: m }) => ({
151
+ category: l,
152
+ label: z[l].label,
153
+ count: a,
154
+ packages: m.map(({ packageName: g, displayName: y, count: v }) => ({
155
+ package: g,
156
+ ...y === g ? {} : { displayName: y },
157
+ count: v
157
158
  }))
158
159
  }))
159
160
  },
160
- findings: Ze(s, e, t)
161
+ findings: rt(n, e, t)
161
162
  };
162
163
  }
163
- function Ze(s, e, t) {
164
- return [...s].flatMap(
165
- ([n, o]) => o.map((r) => {
166
- const i = r.usage.module ?? K(r.usage.originFileNames, n), d = {
167
- package: n,
168
- name: r.usage.name,
169
- category: r.usage.category,
170
- memberOf: r.usage.memberOf,
171
- module: i,
172
- deprecated: r.usage.reason ?? !0
164
+ function rt(n, e, t) {
165
+ return [...n].flatMap(
166
+ ([s, i]) => i.map((c) => {
167
+ const r = c.usage.module ?? B(c.usage.originFileNames, s), p = {
168
+ package: s,
169
+ name: c.usage.name,
170
+ category: c.usage.category,
171
+ memberOf: c.usage.memberOf,
172
+ module: r,
173
+ deprecated: c.usage.reason ?? !0
173
174
  };
174
175
  return {
175
- ...d,
176
- category: he(d),
177
- kind: r.usage.kind,
178
- memberOf: r.usage.memberOf,
179
- file: Ee(r.sourceFileName, t.repositoryRoot),
180
- line: r.usage.line,
181
- column: r.usage.column,
182
- codeowners: e?.getOwners(r.sourceFileName) ?? []
176
+ ...p,
177
+ category: xe(p),
178
+ kind: c.usage.kind,
179
+ memberOf: c.usage.memberOf,
180
+ file: ye(c.sourceFileName, t.repositoryRoot),
181
+ line: c.usage.line,
182
+ column: c.usage.column,
183
+ codeowners: e?.getOwners(c.sourceFileName) ?? []
183
184
  };
184
185
  })
185
- ).sort(Le);
186
+ ).sort(Me);
186
187
  }
187
- function pe(s, e, t) {
188
- const n = $.extname(s.fileName).slice(1).toLowerCase();
189
- if (!e.hasDeprecatedApis && t === void 0 && n !== "html")
190
- return [];
191
- const o = "getLineAndCharacterOfPosition" in s ? (p) => s.getLineAndCharacterOfPosition(p) : nt(s.text), r = /* @__PURE__ */ new Map(), i = /\bdefine\s*(?:\.\s*amd\b|\[\s*(?:"amd"|'amd')\s*\])/u.test(s.text);
192
- for (const p of s.text.matchAll(/(?<![-\w\u0080-\uFFFF])--[-\w\u0080-\uFFFF]+/gu)) {
193
- const m = e.cssVariables.get(p[0]);
194
- m !== void 0 && d(m, p.index, p[0].length);
188
+ function ot(n, e, t) {
189
+ return { scanNode: s, scanCss: i, scanHtmlAttributes: c };
190
+ function s(p, l, a) {
191
+ if (!o.isStringLiteralLike(p))
192
+ return;
193
+ const m = p.getStart(l) + 1, g = l.text.slice(m, p.end - 1);
194
+ /(?:^|,)\s*(["']?)CalciteWebCoreIcons\1\s*(?=,|$)/iu.test(g) && me(g, a + m, r), U(g, a + m, r), i(g, a + m);
195
195
  }
196
- if (n === "html") {
197
- const p = /* @__PURE__ */ new Map();
198
- if (ot({
199
- contents: s.text,
200
- scanElement: (m, y, h) => {
201
- c(
202
- m,
203
- y,
204
- h.map(({ name: v, start: w }) => ({ name: v, start: w }))
205
- );
196
+ function i(p, l, a = !1) {
197
+ const m = a ? /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\/\/[^\r\n]*/gu : /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'/gu, g = p.replace(
198
+ m,
199
+ (v) => v.startsWith("/") ? v.replace(/[^\r\n]/gu, " ") : v
200
+ ), y = g.replace(m, (v) => v.replace(/[^\r\n]/gu, " "));
201
+ U(y, l, r);
202
+ for (const v of y.matchAll(
203
+ /(?:^|[;{}\r\n])\s*(?:font(?:-family)?|--[-\w]+|\$[-\w]+)\s*:([^;{}]*?)(?=;|\}|$|[\r\n][\t ]*[-\w$]+\s*:)/giu
204
+ )) {
205
+ const d = v.index + v[0].length - v[1].length;
206
+ me(g.slice(d, d + v[1].length), l + d, r);
207
+ }
208
+ }
209
+ function c(p) {
210
+ for (const { name: l, value: a, valueStart: m } of p)
211
+ a !== void 0 && (l === "class" ? U(a, m, r) : l === "style" && i(a, m));
212
+ }
213
+ function r(p, l) {
214
+ const { line: a, character: m } = e(p);
215
+ t({
216
+ packageName: "@arcgis/core",
217
+ sourceFileName: n,
218
+ usage: {
219
+ name: "CalciteWebCoreIcons",
220
+ module: "symbols/Font",
221
+ reason: "The Esri Icon Font is deprecated. Use supported fonts or symbols for map graphics and labels, and Calcite UI Icons for UI icons. See https://developers.arcgis.com/javascript/latest/esri-icon-font/",
222
+ originFileNames: [],
223
+ start: p,
224
+ length: l,
225
+ line: a + 1,
226
+ column: m + 1
227
+ }
228
+ });
229
+ }
230
+ }
231
+ function me(n, e, t) {
232
+ for (const s of n.matchAll(/"[^"\r\n]*"|'[^'\r\n]*'|[-\w]+/gu)) {
233
+ const i = s[0].startsWith('"') || s[0].startsWith("'"), c = i ? s[0].slice(1, -1) : s[0];
234
+ c.toLowerCase() === "calcitewebcoreicons" && t(e + s.index + (i ? 1 : 0), c.length);
235
+ }
236
+ }
237
+ function U(n, e, t) {
238
+ for (const s of n.matchAll(/(?<![-\w])esri-icon-[a-z][\w-]*/gu))
239
+ s[0] !== "esri-icon-font-fallback-text" && t(e + s.index, s[0].length);
240
+ }
241
+ function at(n, e, t) {
242
+ return { scanNode: s };
243
+ function s(i, c, r, p) {
244
+ if (r === void 0 || !o.isCallExpression(i) || i.arguments.some(o.isSpreadElement) || !ct(i.expression, r))
245
+ return;
246
+ const l = i.arguments[0];
247
+ if (l === void 0 || !o.isStringLiteralLike(l))
248
+ return;
249
+ const a = i.arguments[1], m = ge(a, "strategy");
250
+ if (m !== "missing" && m !== "unknown" && o.isStringLiteralLike(m) && m.text === "local" && y(
251
+ "strategy",
252
+ m,
253
+ 'The workers.open() strategy "local" is deprecated since 5.2. Use "distributed" or "dedicated" to run the module in a worker instead of on the main thread.'
254
+ ), lt.has(l.text))
255
+ return;
256
+ const g = ge(a, "isESM");
257
+ if (g === "missing" || g !== "unknown" && g.kind === o.SyntaxKind.FalseKeyword) {
258
+ const v = i.expression;
259
+ y(
260
+ "isESM",
261
+ o.isPropertyAccessExpression(v) ? v.name : v,
262
+ "Loading custom workers with isESM: false (the default) is deprecated since 5.2. Author the worker as an ES module and pass isESM: true. See https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open"
263
+ );
264
+ }
265
+ function y(v, d, u) {
266
+ const x = p + d.getStart(c), { line: w, character: f } = e(x);
267
+ t({
268
+ packageName: "@arcgis/core",
269
+ sourceFileName: n,
270
+ usage: {
271
+ name: `open.${v}`,
272
+ kind: "function",
273
+ module: "core/workers",
274
+ reason: u,
275
+ originFileNames: [],
276
+ start: x,
277
+ length: d.getWidth(c),
278
+ line: w + 1,
279
+ column: f + 1
280
+ }
281
+ });
282
+ }
283
+ }
284
+ }
285
+ function ct(n, e) {
286
+ const t = o.isPropertyAccessExpression(n) && n.name.text === "open", s = t ? n.expression : n;
287
+ if (!o.isIdentifier(s))
288
+ return !1;
289
+ const i = e.getSymbolAtLocation(s)?.declarations?.[0];
290
+ return i === void 0 ? !1 : t ? o.isNamespaceImport(i) && !i.parent.isTypeOnly && ue(i.parent.parent.moduleSpecifier) : o.isImportSpecifier(i) && !i.isTypeOnly && !i.parent.parent.isTypeOnly && (i.propertyName ?? i.name).text === "open" && ue(i.parent.parent.parent.moduleSpecifier);
291
+ }
292
+ function ue(n) {
293
+ return o.isStringLiteralLike(n) && /^(?:@arcgis\/core|esri)\/core\/workers(?:\.js)?$/u.test(n.text);
294
+ }
295
+ function ge(n, e) {
296
+ if (n === void 0)
297
+ return "missing";
298
+ if (!o.isObjectLiteralExpression(n) || n.properties.some(
299
+ (t) => !o.isPropertyAssignment(t) || o.isComputedPropertyName(t.name)
300
+ ))
301
+ return "unknown";
302
+ for (const t of n.properties.toReversed())
303
+ if (o.isPropertyAssignment(t) && !o.isComputedPropertyName(t.name) && t.name.text === e)
304
+ return t.initializer;
305
+ return "missing";
306
+ }
307
+ const lt = /* @__PURE__ */ new Set([
308
+ "CSVSourceWorker",
309
+ "EdgeProcessingWorker",
310
+ "ElevationSamplerWorker",
311
+ "FeaturePipelineWorker",
312
+ "FeatureServiceSnappingSourceWorker",
313
+ "FlowWorker",
314
+ "GaussianSplatSortWorker",
315
+ "GeospatialPDFLayerWorker",
316
+ "GeometryWorker",
317
+ "GeoJSONSourceWorker",
318
+ "GeoJSONVectorTileSourceWorker",
319
+ "GlyphWorker",
320
+ "IntegratedMesh3DTilesLayerWorker",
321
+ "LercWorker",
322
+ "Lyr3DWorker",
323
+ "MemorySourceWorker",
324
+ "PBFDecoderWorker",
325
+ "PanoramicMeshWorker",
326
+ "ParquetSourceWorker",
327
+ "PointCloudWorker",
328
+ "RasterWorker",
329
+ "SceneLayerSnappingSourceWorker",
330
+ "SceneLayerWorker",
331
+ "TextureCompressionWorker",
332
+ "WFSSourceWorker",
333
+ "WorkerTileHandler",
334
+ "arcadeGeometryOperatorsWorker",
335
+ "statsWorker",
336
+ "ImageMeasurementWorker"
337
+ ]);
338
+ function fe(n, e, t) {
339
+ const s = P.extname(n.fileName).slice(1).toLowerCase(), i = "getLineAndCharacterOfPosition" in n ? (d) => n.getLineAndCharacterOfPosition(d) : mt(n.text), c = /* @__PURE__ */ new Map(), r = ot(n.fileName, i, (d) => {
340
+ c.set(`iconFont:${d.usage.start}`, d);
341
+ }), p = at(n.fileName, i, (d) => {
342
+ c.set(`workers:${d.usage.name}:${d.usage.start}`, d);
343
+ }), l = /\bdefine\s*(?:\.\s*amd\b|\[\s*(?:"amd"|'amd')\s*\])/u.test(n.text);
344
+ for (const d of n.text.matchAll(/(?<![-\w\u0080-\uFFFF])--[-\w\u0080-\uFFFF]+/gu)) {
345
+ const u = e.cssVariables.get(d[0]);
346
+ u !== void 0 && a(u, d.index, d[0].length);
347
+ }
348
+ if (s === "html") {
349
+ const d = /* @__PURE__ */ new Map();
350
+ if (ft({
351
+ contents: n.text,
352
+ scanElement: (u, x, w) => {
353
+ g(
354
+ u,
355
+ x,
356
+ w.map(({ name: f, start: k }) => ({ name: f, start: k }))
357
+ ), r.scanHtmlAttributes(w);
206
358
  },
207
- scanStyle: (m, y) => de(m, y, f),
208
- scanScript: (m, y, h) => {
209
- const v = h.find(({ name: N }) => N === "type")?.value?.trim().toLowerCase() ?? "";
210
- if (h.some(({ name: N }) => N === "src") || ![
359
+ scanStyle: (u, x) => {
360
+ he(u, x, y), r.scanCss(u, x);
361
+ },
362
+ scanScript: (u, x, w) => {
363
+ const f = w.find(({ name: N }) => N === "type")?.value?.trim().toLowerCase() ?? "";
364
+ if (w.some(({ name: N }) => N === "src") || ![
211
365
  "",
212
366
  "module",
213
367
  "text/javascript",
214
368
  "application/javascript",
215
369
  "text/ecmascript",
216
370
  "application/ecmascript"
217
- ].includes(v.split(";")[0]))
371
+ ].includes(f.split(";")[0]))
218
372
  return;
219
- const w = `${s.fileName}.script-${p.size}.js`;
220
- p.set(w, {
221
- source: a.createSourceFile(
222
- w,
223
- v === "module" ? `${m}
224
- export {};` : m,
225
- a.ScriptTarget.Latest,
373
+ const k = `${n.fileName}.script-${d.size}.js`;
374
+ d.set(k, {
375
+ source: o.createSourceFile(
376
+ k,
377
+ f === "module" ? `${u}
378
+ export {};` : u,
379
+ o.ScriptTarget.Latest,
226
380
  !0,
227
- a.ScriptKind.JS
381
+ o.ScriptKind.JS
228
382
  ),
229
- offset: y
383
+ offset: x
230
384
  });
231
385
  }
232
- }), p.size > 0) {
233
- const m = {
386
+ }), d.size > 0) {
387
+ const u = {
234
388
  allowJs: !0,
235
389
  noLib: !0,
236
390
  noResolve: !0,
237
391
  types: [],
238
- target: a.ScriptTarget.Latest
239
- }, h = a.createProgram([...p.keys()], m, {
240
- ...a.createCompilerHost(m),
241
- getSourceFile: (v) => p.get(v)?.source
392
+ target: o.ScriptTarget.Latest
393
+ }, w = o.createProgram([...d.keys()], u, {
394
+ ...o.createCompilerHost(u),
395
+ getSourceFile: (f) => d.get(f)?.source
242
396
  }).getTypeChecker();
243
- for (const { source: v, offset: w } of p.values())
244
- g({ node: v, jsxSourceFile: v, typeChecker: h, offset: w });
397
+ for (const { source: f, offset: k } of d.values())
398
+ v({ node: f, jsxSourceFile: f, typeChecker: w, offset: k });
245
399
  }
246
- } else n === "css" || n === "scss" || n === "sass" ? de(s.text, 0, f, n !== "css") : "kind" in s && g({ node: s, jsxSourceFile: s, typeChecker: t });
247
- return [...r.values()].sort((p, m) => p.usage.start - m.usage.start);
248
- function d(p, m, y) {
249
- const { line: h, character: v } = o(m);
250
- r.set(JSON.stringify([p.package, p.kind, p.memberOf, p.name, m]), {
251
- packageName: p.package,
252
- sourceFileName: s.fileName,
400
+ } else s === "css" || s === "scss" || s === "sass" ? (he(n.text, 0, y, s !== "css"), r.scanCss(n.text, 0, s !== "css")) : "kind" in n && v({ node: n, jsxSourceFile: n, typeChecker: t });
401
+ return [...c.values()].sort((d, u) => d.usage.start - u.usage.start);
402
+ function a(d, u, x) {
403
+ const { line: w, character: f } = i(u);
404
+ c.set(JSON.stringify([d.package, d.kind, d.memberOf, d.name, u]), {
405
+ packageName: d.package,
406
+ sourceFileName: n.fileName,
253
407
  usage: {
254
- name: p.name,
255
- kind: p.kind,
256
- memberOf: p.kind === "css-property" ? void 0 : p.memberOf,
257
- module: p.module,
258
- reason: p.reason,
259
- originFileNames: [p.sourceFileName],
260
- start: m,
261
- length: y,
262
- line: h + 1,
263
- column: v + 1
408
+ name: d.name,
409
+ kind: d.kind,
410
+ memberOf: d.kind === "css-property" ? void 0 : d.memberOf,
411
+ module: d.module,
412
+ reason: d.reason,
413
+ originFileNames: [d.sourceFileName],
414
+ start: u,
415
+ length: x,
416
+ line: w + 1,
417
+ column: f + 1
264
418
  }
265
419
  });
266
420
  }
267
- function l(p, m, y) {
268
- const h = e.components.get(p);
269
- if (h?.length === 1)
270
- return h[0].definitions.find((v) => et({ entry: v, tag: p, kind: m, name: y }));
421
+ function m(d, u, x) {
422
+ const w = e.components.get(d);
423
+ if (w?.length === 1)
424
+ return w[0].definitions.find((f) => pt({ entry: f, tag: d, kind: u, name: x }));
271
425
  }
272
- function c(p, m, y) {
273
- const h = l(p, "element", p);
274
- h !== void 0 && d(h, m, p.length);
275
- for (const v of y) {
276
- const w = l(p, "attribute", v.name);
277
- w !== void 0 && d(w, v.start, v.name.length);
426
+ function g(d, u, x) {
427
+ const w = m(d, "element", d);
428
+ w !== void 0 && a(w, u, d.length);
429
+ for (const f of x) {
430
+ const k = m(d, "attribute", f.name);
431
+ k !== void 0 && a(k, f.start, f.name.length);
278
432
  }
279
433
  }
280
- function f(p, m, y, h) {
281
- const v = l(p, m, y);
282
- v !== void 0 && d(v, h, y.length);
434
+ function y(d, u, x, w) {
435
+ const f = m(d, u, x);
436
+ f !== void 0 && a(f, w, x.length);
283
437
  }
284
- function g({
285
- node: p,
286
- jsxSourceFile: m,
287
- typeChecker: y,
288
- offset: h = 0
438
+ function v({
439
+ node: d,
440
+ jsxSourceFile: u,
441
+ typeChecker: x,
442
+ offset: w = 0
289
443
  }) {
290
- const v = tt({ node: p, checker: y });
291
- if (v !== void 0 && (v.text !== "define" || !i)) {
292
- const w = h + v.getStart(m), { line: N, character: b } = o(w);
293
- r.set(`amd:${w}`, {
444
+ r.scanNode(d, u, w), p.scanNode(d, u, x, w);
445
+ const f = dt({ node: d, checker: x });
446
+ if (f !== void 0 && (f.text !== "define" || !l)) {
447
+ const k = w + f.getStart(u), { line: N, character: A } = i(k);
448
+ c.set(`amd:${k}`, {
294
449
  packageName: "@arcgis/core",
295
- sourceFileName: s.fileName,
450
+ sourceFileName: n.fileName,
296
451
  usage: {
297
- name: v.text,
452
+ name: f.text,
298
453
  kind: "function",
299
454
  module: "amd",
300
455
  reason: "require/define is deprecated. Use $arcgis.import() or ESM instead. See https://developers.arcgis.com/javascript/latest/get-started/",
301
456
  originFileNames: [],
302
- start: w,
303
- length: v.getWidth(m),
457
+ start: k,
458
+ length: f.getWidth(u),
304
459
  line: N + 1,
305
- column: b + 1
460
+ column: A + 1
306
461
  }
307
462
  });
308
463
  }
309
- if (a.isJsxOpeningElement(p) || a.isJsxSelfClosingElement(p)) {
310
- const w = p.tagName.getText(m), N = p.attributes.properties.filter(a.isJsxAttribute);
311
- if (c(
312
- w,
313
- p.tagName.getStart(m),
314
- N.map((b) => ({
315
- name: b.name.getText(m),
316
- start: b.name.getStart(m)
464
+ if (o.isJsxOpeningElement(d) || o.isJsxSelfClosingElement(d)) {
465
+ const k = d.tagName.getText(u), N = d.attributes.properties.filter(o.isJsxAttribute);
466
+ if (g(
467
+ k,
468
+ d.tagName.getStart(u),
469
+ N.map((A) => ({
470
+ name: A.name.getText(u),
471
+ start: A.name.getStart(u)
317
472
  }))
318
- ), /^[a-z][\w-]*$/u.test(w)) {
319
- const b = N.find((A) => A.name.getText(m) === "slot"), k = b?.initializer, u = k !== void 0 && a.isJsxExpression(k) ? k.expression : k, x = b === void 0 ? -1 : p.attributes.properties.indexOf(b), S = p.attributes.properties.slice(x + 1).some(a.isJsxSpreadAttribute);
320
- if (u !== void 0 && (a.isStringLiteral(u) || a.isNoSubstitutionTemplateLiteral(u)) && !S) {
321
- const A = st(a.isJsxOpeningElement(p) ? p.parent : p, y), C = A === void 0 ? void 0 : l(A, "slot", u.text);
322
- C !== void 0 && d(C, u.getStart(m) + 1, u.getWidth(m) - 2);
473
+ ), ze(d, u, e, a), /^[a-z][\w-]*$/u.test(k)) {
474
+ const A = N.find(($) => $.name.getText(u) === "slot"), h = A?.initializer, S = h !== void 0 && o.isJsxExpression(h) ? h.expression : h, b = A === void 0 ? -1 : d.attributes.properties.indexOf(A), L = d.attributes.properties.slice(b + 1).some(o.isJsxSpreadAttribute);
475
+ if (S !== void 0 && (o.isStringLiteral(S) || o.isNoSubstitutionTemplateLiteral(S)) && !L) {
476
+ const $ = ut(o.isJsxOpeningElement(d) ? d.parent : d, x), T = $ === void 0 ? void 0 : m($, "slot", S.text);
477
+ T !== void 0 && a(T, S.getStart(u) + 1, S.getWidth(u) - 2);
323
478
  }
324
479
  }
325
480
  }
326
- a.forEachChild(p, (w) => g({ node: w, jsxSourceFile: m, typeChecker: y, offset: h }));
481
+ o.forEachChild(d, (k) => v({ node: k, jsxSourceFile: u, typeChecker: x, offset: w }));
327
482
  }
328
483
  }
329
- function et({
330
- entry: s,
484
+ function pt({
485
+ entry: n,
331
486
  tag: e,
332
487
  kind: t,
333
- name: n
488
+ name: s
334
489
  }) {
335
- const o = s.attribute;
336
- if (t === "attribute" && o !== void 0) {
337
- const r = o.tagName === e, i = o.name === n;
338
- return r && i;
490
+ const i = n.attribute;
491
+ if (t === "attribute" && i !== void 0) {
492
+ const c = i.tagName === e, r = i.name === s;
493
+ return c && r;
339
494
  }
340
- return s.kind !== t || s.name !== n ? !1 : t === "element" ? !0 : s.memberOf === e;
495
+ return n.kind !== t || n.name !== s ? !1 : t === "element" ? !0 : n.memberOf === e;
341
496
  }
342
- function tt({
343
- node: s,
497
+ function dt({
498
+ node: n,
344
499
  checker: e
345
500
  }) {
346
- if (e === void 0 || !a.isCallExpression(s))
501
+ if (e === void 0 || !o.isCallExpression(n))
347
502
  return;
348
- const t = s.expression;
349
- let n, o;
350
- if (a.isIdentifier(t))
351
- n = t, o = t;
352
- else if (a.isPropertyAccessExpression(t) && a.isIdentifier(t.name) && a.isIdentifier(t.expression) && ["window", "opener", "globalThis"].includes(t.expression.text))
353
- n = t.name, o = t.expression;
503
+ const t = n.expression;
504
+ let s, i;
505
+ if (o.isIdentifier(t))
506
+ s = t, i = t;
507
+ else if (o.isPropertyAccessExpression(t) && o.isIdentifier(t.name) && o.isIdentifier(t.expression) && ["window", "opener", "globalThis"].includes(t.expression.text))
508
+ s = t.name, i = t.expression;
354
509
  else
355
510
  return;
356
- if (n.text !== "define" && n.text !== "require")
511
+ if (s.text !== "define" && s.text !== "require")
357
512
  return;
358
- if (n.text === "require") {
359
- const i = s.arguments[0];
360
- if (!(i !== void 0 && a.isArrayLiteralExpression(i)) && s.getSourceFile().fileName.toLowerCase().endsWith(".cjs") || i !== void 0 && a.isStringLiteralLike(i) && !i.text.startsWith("esri/"))
513
+ if (s.text === "require") {
514
+ const r = n.arguments[0];
515
+ if (!(r !== void 0 && o.isArrayLiteralExpression(r)) && n.getSourceFile().fileName.toLowerCase().endsWith(".cjs") || r !== void 0 && o.isStringLiteralLike(r) && !r.text.startsWith("esri/"))
361
516
  return;
362
517
  }
363
- return (e.getSymbolAtLocation(o)?.declarations ?? []).every(
364
- (i) => a.isPropertyAccessExpression(t) && i.getSourceFile().isDeclarationFile
365
- ) ? n : void 0;
518
+ return (e.getSymbolAtLocation(i)?.declarations ?? []).every(
519
+ (r) => o.isPropertyAccessExpression(t) && r.getSourceFile().isDeclarationFile
520
+ ) ? s : void 0;
366
521
  }
367
- function nt(s) {
522
+ function mt(n) {
368
523
  const e = [
369
524
  0,
370
- ...Array.from(s.matchAll(/\r\n|[\r\n\u2028\u2029]/gu), (t) => t.index + t[0].length)
525
+ ...Array.from(n.matchAll(/\r\n|[\r\n\u2028\u2029]/gu), (t) => t.index + t[0].length)
371
526
  ];
372
527
  return (t) => {
373
- let n = 0, o = e.length;
374
- for (; n + 1 < o; ) {
375
- const r = Math.floor((n + o) / 2);
376
- e[r] <= t ? n = r : o = r;
528
+ let s = 0, i = e.length;
529
+ for (; s + 1 < i; ) {
530
+ const c = Math.floor((s + i) / 2);
531
+ e[c] <= t ? s = c : i = c;
377
532
  }
378
- return { line: n, character: t - e[n] };
533
+ return { line: s, character: t - e[s] };
379
534
  };
380
535
  }
381
- function st(s, e) {
382
- let t = s;
383
- for (let n = t.parent; n !== void 0; t = n, n = n.parent) {
384
- if (a.isJsxElement(n))
385
- return n.openingElement.tagName.getText();
386
- if (!(a.isJsxFragment(n) || a.isJsxExpression(n) || a.isParenthesizedExpression(n)) && !(a.isConditionalExpression(n) && t !== n.condition) && !(a.isBinaryExpression(n) && (n.operatorToken.kind === a.SyntaxKind.AmpersandAmpersandToken && t === n.right || n.operatorToken.kind === a.SyntaxKind.BarBarToken || n.operatorToken.kind === a.SyntaxKind.QuestionQuestionToken))) {
387
- if (a.isReturnStatement(n)) {
388
- const o = a.findAncestor(n, a.isFunctionLike);
389
- if (o === void 0 || !a.isArrowFunction(o) && !a.isFunctionExpression(o))
536
+ function ut(n, e) {
537
+ let t = n;
538
+ for (let s = t.parent; s !== void 0; t = s, s = s.parent) {
539
+ if (o.isJsxElement(s))
540
+ return s.openingElement.tagName.getText();
541
+ if (!(o.isJsxFragment(s) || o.isJsxExpression(s) || o.isParenthesizedExpression(s)) && !(o.isConditionalExpression(s) && t !== s.condition) && !(o.isBinaryExpression(s) && (s.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken && t === s.right || s.operatorToken.kind === o.SyntaxKind.BarBarToken || s.operatorToken.kind === o.SyntaxKind.QuestionQuestionToken))) {
542
+ if (o.isReturnStatement(s)) {
543
+ const i = o.findAncestor(s, o.isFunctionLike);
544
+ if (i === void 0 || !o.isArrowFunction(i) && !o.isFunctionExpression(i))
390
545
  return;
391
- t = o.body, n = o;
546
+ t = i.body, s = i;
392
547
  }
393
- if ((a.isArrowFunction(n) || a.isFunctionExpression(n)) && t === n.body) {
394
- const o = n.parent;
395
- if (!a.isCallExpression(o) || o.arguments[0] !== n || !a.isPropertyAccessExpression(o.expression) || o.expression.name.text !== "map")
548
+ if ((o.isArrowFunction(s) || o.isFunctionExpression(s)) && t === s.body) {
549
+ const i = s.parent;
550
+ if (!o.isCallExpression(i) || i.arguments[0] !== s || !o.isPropertyAccessExpression(i.expression) || i.expression.name.text !== "map")
396
551
  return;
397
- const r = o.expression.expression, i = e?.getTypeAtLocation(r);
398
- if (!a.isArrayLiteralExpression(r) && (i === void 0 || !e.isArrayType(i) && !e.isTupleType(i)))
552
+ const c = i.expression.expression, r = e?.getTypeAtLocation(c);
553
+ if (!o.isArrayLiteralExpression(c) && (r === void 0 || !e.isArrayType(r) && !e.isTupleType(r)))
399
554
  return;
400
- t = n, n = o;
555
+ t = s, s = i;
401
556
  continue;
402
557
  }
403
558
  return;
404
559
  }
405
560
  }
406
561
  }
407
- function de(s, e, t, n = !1) {
408
- const o = n ? /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\/\/[^\r\n]*/gu : /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'/gu, r = s.replace(o, (c) => c.replace(/[^\r\n]/gu, " ")), i = [];
409
- let d = 0, l = 0;
410
- for (const c of r.matchAll(/[{};]/gu)) {
411
- const f = c.index;
562
+ function he(n, e, t, s = !1) {
563
+ const i = s ? /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\/\/[^\r\n]*/gu : /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'/gu, c = n.replace(i, (a) => a.replace(/[^\r\n]/gu, " ")), r = [];
564
+ let p = 0, l = 0;
565
+ for (const a of c.matchAll(/[{};]/gu)) {
566
+ const m = a.index;
412
567
  if (l > 0) {
413
- l += c[0] === "{" ? 1 : c[0] === "}" ? -1 : 0, d = f + 1;
568
+ l += a[0] === "{" ? 1 : a[0] === "}" ? -1 : 0, p = m + 1;
414
569
  continue;
415
570
  }
416
- if (c[0] === "}")
417
- i.pop();
418
- else if (c[0] === "{") {
419
- const g = r.slice(d, f), p = i.at(-1) ?? [];
571
+ if (a[0] === "}")
572
+ r.pop();
573
+ else if (a[0] === "{") {
574
+ const g = c.slice(p, m), y = r.at(-1) ?? [];
420
575
  if (/^\s*--[\w-]+\s*:/u.test(g))
421
576
  l = 1;
422
577
  else if (g.trimStart().startsWith("@"))
423
- i.push(p);
578
+ r.push(y);
424
579
  else {
425
- const y = g.split(",").map((h) => h.trim()).flatMap(
426
- (h) => p.length === 0 ? [h] : p.map(
427
- (v) => h.includes("&") ? h.replaceAll("&", v) : `${v} ${h}`
580
+ const d = g.split(",").map((u) => u.trim()).flatMap(
581
+ (u) => y.length === 0 ? [u] : y.map(
582
+ (x) => u.includes("&") ? u.replaceAll("&", x) : `${x} ${u}`
428
583
  )
429
584
  );
430
- for (const h of g.matchAll(/::part\(\s*([\w\s-]+?)\s*\)|:state\(\s*([\w-]+)\s*\)/gu)) {
431
- const v = g.lastIndexOf(",", h.index) + 1, w = g.slice(v, h.index), b = (p.length === 0 ? [w] : p.map(
585
+ for (const u of g.matchAll(/::part\(\s*([\w\s-]+?)\s*\)|:state\(\s*([\w-]+)\s*\)/gu)) {
586
+ const x = g.lastIndexOf(",", u.index) + 1, w = g.slice(x, u.index), k = (y.length === 0 ? [w] : y.map(
432
587
  (S) => w.includes("&") ? w.replaceAll("&", S) : `${S} ${w}`
433
- )).map(it);
434
- if (b.includes(void 0) || new Set(b).size !== 1)
588
+ )).map(gt);
589
+ if (k.includes(void 0) || new Set(k).size !== 1)
435
590
  continue;
436
- const k = h[1] === void 0 ? "css-state" : "css-part", u = h[1] ?? h[2], x = h.index + h[0].indexOf(u);
437
- for (const S of u.matchAll(/[\w-]+/gu))
438
- t(b[0], k, S[0], e + d + x + S.index);
591
+ const N = u[1] === void 0 ? "css-state" : "css-part", A = u[1] ?? u[2], h = u.index + u[0].indexOf(A);
592
+ for (const S of A.matchAll(/[\w-]+/gu))
593
+ t(k[0], N, S[0], e + p + h + S.index);
439
594
  }
440
- i.push(y);
595
+ r.push(d);
441
596
  }
442
597
  }
443
- d = f + 1;
598
+ p = m + 1;
444
599
  }
445
600
  }
446
- function it(s) {
447
- const e = s.replace(/:state\([\w-]+\)/gu, "").trimStart();
601
+ function gt(n) {
602
+ const e = n.replace(/:state\([\w-]+\)/gu, "").trimStart();
448
603
  return /(?:^|[\s>+~])([a-z][\w-]*)(?:[.#:][\w-]+|\[[^\]]*\])*$/iu.exec(e)?.[1]?.toLowerCase();
449
604
  }
450
- function ot({
451
- contents: s,
605
+ function ft({
606
+ contents: n,
452
607
  scanElement: e,
453
608
  scanStyle: t,
454
- scanScript: n
609
+ scanScript: s
455
610
  }) {
456
- const o = /<!--[\s\S]*?(?:-->|$)|<![^>]*>|<\/?([a-z][\w:-]*)\b((?:"[^"]*"|'[^']*'|[^'">])*)>/giu;
457
- for (let r = o.exec(s); r !== null; r = o.exec(s)) {
458
- if (r[1] === void 0 || r[0].startsWith("</"))
611
+ const i = /<!--[\s\S]*?(?:-->|$)|<![^>]*>|<\/?([a-z][\w:-]*)\b((?:"[^"]*"|'[^']*'|[^'">])*)>/giu;
612
+ for (let c = i.exec(n); c !== null; c = i.exec(n)) {
613
+ if (c[1] === void 0 || c[0].startsWith("</"))
459
614
  continue;
460
- const i = r[1].toLowerCase(), d = r.index + 1 + r[1].length, l = [...r[2].matchAll(/([^\s"'<>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gu)].map(
461
- (c) => ({
462
- name: c[1].toLowerCase(),
463
- start: d + c.index,
464
- value: c[2] ?? c[3] ?? c[4]
465
- })
615
+ const r = c[1].toLowerCase(), p = c.index + 1 + c[1].length, l = [...c[2].matchAll(/([^\s"'<>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gu)].map(
616
+ (a) => {
617
+ const m = a[2] ?? a[3] ?? a[4], g = a[2] !== void 0 || a[3] !== void 0;
618
+ return {
619
+ name: a[1].toLowerCase(),
620
+ start: p + a.index,
621
+ value: m,
622
+ valueStart: p + a.index + a[0].length - (m?.length ?? 0) - (g ? 1 : 0)
623
+ };
624
+ }
466
625
  );
467
- if (e(i, r.index + 1, l), i === "plaintext")
626
+ if (e(r, c.index + 1, l), r === "plaintext")
468
627
  break;
469
- if (["script", "style", "textarea", "title", "xmp", "iframe", "noembed", "noframes"].includes(i)) {
470
- const c = new RegExp(`</${i}\\s*>`, "giu");
471
- c.lastIndex = o.lastIndex;
472
- const f = c.exec(s);
473
- i === "style" ? t(s.slice(o.lastIndex, f?.index ?? s.length), o.lastIndex) : i === "script" && n?.(s.slice(o.lastIndex, f?.index ?? s.length), o.lastIndex, l), o.lastIndex = f === null ? s.length : c.lastIndex;
628
+ if (["script", "style", "textarea", "title", "xmp", "iframe", "noembed", "noframes"].includes(r)) {
629
+ const a = new RegExp(`</${r}\\s*>`, "giu");
630
+ a.lastIndex = i.lastIndex;
631
+ const m = a.exec(n);
632
+ r === "style" ? t(n.slice(i.lastIndex, m?.index ?? n.length), i.lastIndex) : r === "script" && s?.(n.slice(i.lastIndex, m?.index ?? n.length), i.lastIndex, l), i.lastIndex = m === null ? n.length : a.lastIndex;
474
633
  }
475
634
  }
476
635
  }
477
- const at = /[:/@\\]|^\.{1,2}$|\.(?:tgz|tar(?:\.gz)?)$/iu;
478
- async function rt(s, e, t) {
479
- const n = JSON.parse('["@arcgis/ai-components","@arcgis/api-extractor","@arcgis/arcade-parser","@arcgis/arcade-languageservice","@arcgis/charts-components","@arcgis/codemod","@arcgis/coding-components","@arcgis/common-components","@arcgis/core","@arcgis/lumina-toolkit","@arcgis/create","@arcgis/eslint-config","@arcgis/languages-api-utils","@arcgis/languages-sdk-spec","@arcgis/lumina","@arcgis/lumina-compiler","@arcgis/map-components","@arcgis/node-toolkit","@arcgis/portal-components","@arcgis/toolkit"]'), o = new Set(n), r = /* @__PURE__ */ new Set([...n, "@esri/calcite-components"]), i = [...new Map(s.map((g) => [g.filePath, g])).values()], d = new Set(
636
+ const ht = /[:/@\\]|^\.{1,2}$|\.(?:tgz|tar(?:\.gz)?)$/iu;
637
+ async function vt(n, e, t) {
638
+ const s = JSON.parse('["@arcgis/ai-components","@arcgis/api-extractor","@arcgis/arcade-parser","@arcgis/arcade-languageservice","@arcgis/charts-components","@arcgis/codemod","@arcgis/coding-components","@arcgis/common-components","@arcgis/core","@arcgis/lumina-toolkit","@arcgis/create","@arcgis/eslint-config","@arcgis/languages-api-utils","@arcgis/languages-sdk-spec","@arcgis/lumina","@arcgis/lumina-compiler","@arcgis/map-components","@arcgis/node-toolkit","@arcgis/portal-components","@arcgis/toolkit"]'), i = new Set(s), c = /* @__PURE__ */ new Set([...s, "@esri/calcite-components"]), r = [...new Map(n.map((g) => [g.filePath, g])).values()], p = new Set(
480
639
  (await Promise.all(
481
- i.map(async ({ filePath: g, contents: p }) => {
482
- const m = [await j(g)], y = p.publishConfig?.directory;
483
- if (typeof y == "string") {
484
- const h = $.resolve($.dirname(g), y, "package.json");
485
- a.sys.fileExists(h) && m.push(await j(h));
640
+ r.map(async ({ filePath: g, contents: y }) => {
641
+ const v = [await j(g)], d = y.publishConfig?.directory;
642
+ if (typeof d == "string") {
643
+ const u = P.resolve(P.dirname(g), d, "package.json");
644
+ o.sys.fileExists(u) && v.push(await j(u));
486
645
  }
487
- return m;
646
+ return v;
488
647
  })
489
648
  )).flat()
490
- ), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), f = [];
491
- await me(i, 4, async (g) => {
492
- let p;
493
- const m = [], y = {
649
+ ), l = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), m = [];
650
+ await ve(r, 4, async (g) => {
651
+ let y;
652
+ const v = [], d = {
494
653
  ...g.contents.peerDependencies,
495
654
  ...g.contents.optionalDependencies,
496
655
  ...g.contents.devDependencies,
497
656
  ...g.contents.dependencies
498
657
  };
499
- for (const [N, b] of Object.entries(y)) {
500
- const k = b.replace(/^npm:/u, "");
501
- if (!r.has(N) || !b.startsWith("catalog:") && at.test(k))
658
+ for (const [f, k] of Object.entries(d)) {
659
+ const N = k.replace(/^npm:/u, "");
660
+ if (!c.has(f) || !k.startsWith("catalog:") && ht.test(N))
502
661
  continue;
503
- const u = await ye(
504
- $.join("node_modules", N, "package.json"),
505
- $.dirname(g.filePath)
662
+ const A = await G(
663
+ P.join("node_modules", f, "package.json"),
664
+ P.dirname(g.filePath)
506
665
  );
507
- if (u === void 0) {
508
- (e === void 0 || N === e) && f.push(`${N} (${g.contents.name ?? g.filePath})`);
666
+ if (A === void 0) {
667
+ (e === void 0 || f === e) && m.push(`${f} (${g.contents.name ?? g.filePath})`);
509
668
  continue;
510
669
  }
511
- if (d.has(await j(u)))
670
+ if (p.has(await j(A)))
512
671
  continue;
513
- const x = await We($.dirname(u));
514
- !x.name || !x.version || !r.has(x.name) || m.push({ declared: b, location: u, name: x.name, version: x.version });
672
+ const h = await He(P.dirname(A));
673
+ !h.name || !h.version || !c.has(h.name) || v.push({ declared: k, location: A, name: h.name, version: h.version });
515
674
  }
516
- const h = Map.groupBy(
517
- m.filter(({ name: N }) => o.has(N)),
518
- ({ version: N }) => N
519
- ), v = L.maxSatisfying([...h.keys()], "*", {
675
+ const u = Map.groupBy(
676
+ v.filter(({ name: f }) => i.has(f)),
677
+ ({ version: f }) => f
678
+ ), x = O.maxSatisfying([...u.keys()], "*", {
520
679
  includePrerelease: !0
521
- }), w = [...h].sort(([N], [b]) => N.localeCompare(b)).map(
522
- ([N, b]) => `${N}: ${b.map(({ name: k }) => `\`${k}\``).sort().join(", ")}`
680
+ }), w = [...u].sort(([f], [k]) => f.localeCompare(k)).map(
681
+ ([f, k]) => `${f}: ${k.map(({ name: N }) => `\`${N}\``).sort().join(", ")}`
523
682
  ).join("; ");
524
- for (const { declared: N, location: b, name: k, version: u } of m) {
525
- if (e !== void 0 && k !== e)
683
+ for (const { declared: f, location: k, name: N, version: A } of v) {
684
+ if (e !== void 0 && N !== e)
526
685
  continue;
527
- let x = l.get(k);
528
- x === void 0 && (x = lt(k), l.set(k, x));
529
- const S = await x;
686
+ let h = l.get(N);
687
+ h === void 0 && (h = xt(N), l.set(N, h));
688
+ const S = await h;
530
689
  S === void 0 && t?.();
531
- const A = S === void 0 ? void 0 : dt(u, S), C = [];
532
- A !== void 0 && C.push({
690
+ const b = S === void 0 ? void 0 : St(A, S), L = [];
691
+ b !== void 0 && L.push({
533
692
  category: "outdatedDependencies",
534
- targetVersion: A.expected,
535
- reason: `Update to ${A.expected} (declared ${N}). ${A.reason}`
536
- }), o.has(k) && v !== null && L.lt(u, v) && C.push({
693
+ targetVersion: b.expected,
694
+ reason: `Update to ${b.expected} (declared ${f}). ${b.reason}`
695
+ }), i.has(N) && x !== null && O.lt(A, x) && L.push({
537
696
  category: "mismatchedDependencies",
538
- targetVersion: v,
697
+ targetVersion: x,
539
698
  reason: `Web GIS SDK packages within the same package.json must use the same exact version (found ${w}).`
540
699
  });
541
- for (const { category: E, targetVersion: T, reason: P } of C) {
542
- let D;
543
- if (E === "outdatedDependencies" && N.startsWith("catalog:"))
700
+ for (const { category: $, targetVersion: T, reason: F } of L) {
701
+ let C;
702
+ if ($ === "outdatedDependencies" && f.startsWith("catalog:"))
544
703
  try {
545
- D = await ct(g.filePath, k, N);
546
- } catch (O) {
547
- t?.(), R(
704
+ C = await yt(g.filePath, N, f);
705
+ } catch (D) {
706
+ t?.(), q(
548
707
  "warn",
549
- I(g.filePath),
550
- `Unable to locate dependency catalog: ${String(O)}`
708
+ R(g.filePath),
709
+ `Unable to locate dependency catalog: ${String(D)}`
551
710
  );
552
711
  }
553
- D === void 0 && (p ??= a.parseJsonText(g.filePath, await z(g.filePath, "utf8")));
554
- const F = c.get(k) ?? [];
555
- D !== void 0 && F.some(
556
- (O) => O.sourceFileName === D.sourceFileName && O.usage.start === D.location.start && O.usage.category === E
557
- ) || (F.push({
558
- sourceFileName: D?.sourceFileName ?? g.filePath,
712
+ C === void 0 && (y ??= o.parseJsonText(g.filePath, await J(g.filePath, "utf8")));
713
+ const E = a.get(N) ?? [];
714
+ C !== void 0 && E.some(
715
+ (D) => D.sourceFileName === C.sourceFileName && D.usage.start === C.location.start && D.usage.category === $
716
+ ) || (E.push({
717
+ sourceFileName: C?.sourceFileName ?? g.filePath,
559
718
  usage: {
560
- name: `${u} => ${T}`,
561
- category: E,
562
- module: D === void 0 ? "package.json" : "pnpm-workspace.yaml",
563
- originFileNames: [b],
564
- reason: P,
565
- ...D?.location ?? pt(p, k, N)
719
+ name: `${A} => ${T}`,
720
+ category: $,
721
+ module: C === void 0 ? "package.json" : P.basename(C.sourceFileName),
722
+ originFileNames: [k],
723
+ reason: F,
724
+ ...C?.location ?? wt(y, N, f)
566
725
  }
567
- }), c.set(k, F));
726
+ }), a.set(N, E));
568
727
  }
569
728
  }
570
729
  });
571
- for (const g of c.values())
730
+ for (const g of a.values())
572
731
  g.sort(
573
- (p, m) => p.sourceFileName.localeCompare(m.sourceFileName) || p.usage.start - m.usage.start
732
+ (y, v) => y.sourceFileName.localeCompare(v.sourceFileName) || y.usage.start - v.usage.start
574
733
  );
575
- return f.length > 0 && (t?.(), f.sort(), R(
734
+ return m.length > 0 && (t?.(), m.sort(), q(
576
735
  "warn",
577
736
  "dependency-versions",
578
- `Failed to find installed locations for ${f.length} dependencies: ${f.slice(0, 15).join(", ")}${f.length > 15 ? `, and ${f.length - 15} more` : ""}.`
579
- )), c;
737
+ `Failed to find installed locations for ${m.length} dependencies: ${m.slice(0, 15).join(", ")}${m.length > 15 ? `, and ${m.length - 15} more` : ""}.`
738
+ )), a;
580
739
  }
581
- async function ct(s, e, t) {
582
- const n = await ye("pnpm-workspace.yaml", $.dirname(s));
583
- if (n === void 0)
584
- throw new Error(`Missing pnpm-workspace.yaml for ${t}`);
585
- const o = await j(n), r = new Ve(), i = Be(await z(o, "utf8"), { lineCounter: r });
586
- if (i.errors.length > 0)
587
- throw i.errors[0];
588
- const d = t.slice(8), l = i.getIn(
589
- d === "" || d === "default" ? ["catalog"] : ["catalogs", d],
740
+ async function yt(n, e, t) {
741
+ const s = await G("pnpm-workspace.yaml", P.dirname(n)) ?? await G(".yarnrc.yml", P.dirname(n));
742
+ if (s === void 0)
743
+ throw new Error(`Missing pnpm-workspace.yaml or .yarnrc.yml for ${t}`);
744
+ const i = await j(s), c = new Qe(), r = _e(await J(i, "utf8"), { lineCounter: c });
745
+ if (r.errors.length > 0)
746
+ throw r.errors[0];
747
+ const p = t.slice(8), l = r.getIn(
748
+ p === "" || p === "default" ? ["catalog"] : ["catalogs", p],
590
749
  !0
591
- ), c = Ke(l) ? l.items.find(({ key: y }) => re(y) && y.value === e)?.key : void 0;
592
- if (!re(c) || c.range === void 0)
593
- throw new Error(`Missing ${e} in ${t} in ${o}`);
594
- const [f, g] = c.range, { line: p, col: m } = r.linePos(f);
595
- return { sourceFileName: o, location: { start: f, length: g - f, line: p, column: m } };
750
+ ), a = Xe(l) ? l.items.find(({ key: d }) => le(d) && d.value === e)?.key : void 0;
751
+ if (!le(a) || a.range === void 0)
752
+ throw new Error(`Missing ${e} in ${t} in ${i}`);
753
+ const [m, g] = a.range, { line: y, col: v } = c.linePos(m);
754
+ return { sourceFileName: i, location: { start: m, length: g - m, line: y, column: v } };
596
755
  }
597
- async function lt(s) {
756
+ async function xt(n) {
598
757
  try {
599
- const e = await fetch(`https://registry.npmjs.org/-/package/${encodeURIComponent(s)}/dist-tags`, {
758
+ const e = await fetch(`https://registry.npmjs.org/-/package/${encodeURIComponent(n)}/dist-tags`, {
600
759
  signal: AbortSignal.timeout(5e3),
601
760
  redirect: "error"
602
761
  });
@@ -605,40 +764,40 @@ async function lt(s) {
605
764
  const t = await e.json();
606
765
  if (typeof t != "object" || t === null || Array.isArray(t))
607
766
  throw new Error("Invalid registry dist-tags response");
608
- const n = {};
609
- for (const [o, r] of Object.entries(t))
610
- ["latest", "rc", "next"].includes(o) && typeof r == "string" && L.valid(r) !== null && (n[o] = r);
611
- if (Object.keys(n).length === 0)
767
+ const s = {};
768
+ for (const [i, c] of Object.entries(t))
769
+ ["latest", "rc", "next"].includes(i) && typeof c == "string" && O.valid(c) !== null && (s[i] = c);
770
+ if (Object.keys(s).length === 0)
612
771
  throw new Error("Registry returned no supported release tags");
613
- return n;
772
+ return s;
614
773
  } catch (e) {
615
- R("warn", s, `Dependency freshness unavailable: ${String(e)}`);
774
+ q("warn", n, `Dependency freshness unavailable: ${String(e)}`);
616
775
  return;
617
776
  }
618
777
  }
619
- function pt(s, e, t) {
620
- const n = a.forEachChild(s, d), o = n.getStart(s), { line: r, character: i } = s.getLineAndCharacterOfPosition(o);
621
- return { start: o, length: n.getWidth(s), line: r + 1, column: i + 1 };
622
- function d(l) {
623
- return a.isPropertyAssignment(l) && a.isStringLiteral(l.name) && ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"].includes(l.name.text) && a.isObjectLiteralExpression(l.initializer) ? l.initializer.properties.find(
624
- (c) => a.isPropertyAssignment(c) && a.isStringLiteral(c.name) && c.name.text === e && a.isStringLiteral(c.initializer) && c.initializer.text === t
625
- )?.name : a.forEachChild(l, d);
778
+ function wt(n, e, t) {
779
+ const s = o.forEachChild(n, p), i = s.getStart(n), { line: c, character: r } = n.getLineAndCharacterOfPosition(i);
780
+ return { start: i, length: s.getWidth(n), line: c + 1, column: r + 1 };
781
+ function p(l) {
782
+ return o.isPropertyAssignment(l) && o.isStringLiteral(l.name) && ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"].includes(l.name.text) && o.isObjectLiteralExpression(l.initializer) ? l.initializer.properties.find(
783
+ (a) => o.isPropertyAssignment(a) && o.isStringLiteral(a.name) && a.name.text === e && o.isStringLiteral(a.initializer) && a.initializer.text === t
784
+ )?.name : o.forEachChild(l, p);
626
785
  }
627
786
  }
628
- function dt(s, e) {
629
- const t = L.parse(s), n = L.parse(e.latest ?? "");
787
+ function St(n, e) {
788
+ const t = O.parse(n), s = O.parse(e.latest ?? "");
630
789
  if (t === null)
631
790
  return;
632
791
  if (
633
792
  // Permit packages without latest dist-tag
634
- n !== null && // Permit installed to be newer than latest
635
- L.lt(t, n) && // Require using stable over prerelease
793
+ s !== null && // Permit installed to be newer than latest
794
+ O.lt(t, s) && // Require using stable over prerelease
636
795
  (t.prerelease.length > 0 || // Forbid major being behind stable
637
- t.major !== n.major || // Forbid minor being behind stable
638
- t.minor !== n.minor)
796
+ t.major !== s.major || // Forbid minor being behind stable
797
+ t.minor !== s.minor)
639
798
  )
640
799
  return {
641
- expected: n.version,
800
+ expected: s.version,
642
801
  reason: "A newer stable release is available. Prerelease versions are deprecated."
643
802
  };
644
803
  if (
@@ -647,83 +806,87 @@ function dt(s, e) {
647
806
  t.prerelease[0] !== "next"
648
807
  )
649
808
  return;
650
- const o = t.prerelease[1];
651
- if (typeof o != "number")
809
+ const i = t.prerelease[1];
810
+ if (typeof i != "number")
652
811
  return;
653
- const i = [e.next, e.rc].flatMap((d) => {
654
- const l = L.parse(d ?? "");
812
+ const r = [e.next, e.rc].flatMap((p) => {
813
+ const l = O.parse(p ?? "");
655
814
  return l !== null && // Support packages without latest dist-tag
656
- (n === null || // Ignore rc dist-tag if it is behind latest
657
- L.gt(l, n)) && // Require same major.minor.patch for -next version comparison
815
+ (s === null || // Ignore rc dist-tag if it is behind latest
816
+ O.gt(l, s)) && // Require same major.minor.patch for -next version comparison
658
817
  l.major === t.major && l.minor === t.minor && l.patch === t.patch && // Require next.N format for comparison
659
818
  l.prerelease.length === 2 && l.prerelease[0] === "next" && typeof l.prerelease[1] == "number" ? [l] : [];
660
- }).sort(L.rcompare).at(0);
661
- if (i !== void 0 && Number(i.prerelease[1]) - o >= 30)
819
+ }).sort(O.rcompare).at(0);
820
+ if (r !== void 0 && Number(r.prerelease[1]) - i >= 30)
662
821
  return {
663
- expected: i.version,
822
+ expected: r.version,
664
823
  reason: "Installed -next is significantly behind the most recent -next build."
665
824
  };
666
825
  }
667
- const mt = /* @__PURE__ */ new Set(["none", "amd", "umd", "system", "systemjs", "node", "node10", "legacy"]), ut = /* @__PURE__ */ new Set(["node", "node10", "classic"]);
668
- async function gt(s) {
826
+ const kt = /* @__PURE__ */ new Set(["none", "amd", "umd", "system", "systemjs", "node", "node10", "legacy"]), Nt = /* @__PURE__ */ new Set(["node", "node10", "classic"]);
827
+ async function bt(n) {
669
828
  const e = "es2024", t = [];
670
- for (const n of [...new Set(s)].sort()) {
671
- const o = a.parseJsonText(n, await z(n, "utf8"));
672
- t.push(...ft(o, e));
829
+ for (const s of [...new Set(n)].sort()) {
830
+ const i = o.parseJsonText(s, await J(s, "utf8"));
831
+ t.push(...At(i, e));
673
832
  }
674
833
  return t;
675
834
  }
676
- function ft(s, e) {
677
- const t = s.statements[0];
678
- if (t === void 0 || !a.isExpressionStatement(t) || !a.isObjectLiteralExpression(t.expression))
835
+ function At(n, e) {
836
+ const t = n.statements[0];
837
+ if (t === void 0 || !o.isExpressionStatement(t) || !o.isObjectLiteralExpression(t.expression))
679
838
  return [];
680
- const n = t.expression.properties.find(
681
- (i) => a.isPropertyAssignment(i) && a.isStringLiteral(i.name) && i.name.text === "compilerOptions"
839
+ const s = t.expression.properties.find(
840
+ (r) => o.isPropertyAssignment(r) && o.isStringLiteral(r.name) && r.name.text === "compilerOptions"
682
841
  );
683
- if (n === void 0 || !a.isObjectLiteralExpression(n.initializer))
842
+ if (s === void 0 || !o.isObjectLiteralExpression(s.initializer))
684
843
  return [];
685
- const o = a.convertCompilerOptionsFromJson({ target: e }, ".").options.target, r = [];
686
- for (const i of n.initializer.properties) {
687
- if (!a.isPropertyAssignment(i) || !a.isStringLiteral(i.name))
844
+ const i = o.convertCompilerOptionsFromJson({ target: e }, ".").options.target, c = [];
845
+ for (const r of s.initializer.properties) {
846
+ if (!o.isPropertyAssignment(r) || !o.isStringLiteral(r.name))
688
847
  continue;
689
- const d = i.name.text, l = a.isStringLiteral(i.initializer) ? i.initializer.text.toLowerCase() : void 0;
690
- let c;
691
- if (d === "module" && l !== void 0 && mt.has(l))
692
- c = `The ${l} module setting is legacy or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
693
- else if (d === "moduleResolution" && l !== void 0 && ut.has(l))
694
- c = `The ${l} module resolution setting is deprecated or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
695
- else if (d === "target" && l !== void 0) {
696
- const m = a.convertCompilerOptionsFromJson({ target: l }, ".").options.target;
697
- m !== void 0 && m < o && (c = `Targets below ${e} are older than Maps SDK's for JavaScript supported targets. See https://next.gha.afd.arcgis.com/javascript/latest/system-requirements/.`);
698
- } else d === "ignoreDeprecations" && (c = "Address deprecations that were suppressed by ignoreDeprecations.");
699
- if (c === void 0)
848
+ const p = r.name.text, l = o.isStringLiteral(r.initializer) ? r.initializer.text.toLowerCase() : void 0;
849
+ let a;
850
+ if (p === "module" && l !== void 0 && kt.has(l))
851
+ a = `The ${l} module setting is legacy or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
852
+ else if (p === "moduleResolution" && l !== void 0 && Nt.has(l))
853
+ a = `The ${l} module resolution setting is deprecated or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
854
+ else if (p === "target" && l !== void 0) {
855
+ const v = o.convertCompilerOptionsFromJson({ target: l }, ".").options.target;
856
+ v !== void 0 && v < i && (a = `Targets below ${e} are older than Maps SDK's for JavaScript supported targets. See https://next.gha.afd.arcgis.com/javascript/latest/system-requirements/.`);
857
+ } else p === "ignoreDeprecations" && (a = "Address deprecations that were suppressed by ignoreDeprecations.");
858
+ if (a === void 0)
700
859
  continue;
701
- const f = i.name.getStart(s), { line: g, character: p } = s.getLineAndCharacterOfPosition(f);
702
- r.push({
703
- sourceFileName: s.fileName,
860
+ const m = r.name.getStart(n), { line: g, character: y } = n.getLineAndCharacterOfPosition(m);
861
+ c.push({
862
+ sourceFileName: n.fileName,
704
863
  usage: {
705
- name: `compilerOptions.${d}${l === void 0 ? "" : `: ${l}`}`,
864
+ name: `compilerOptions.${p}${l === void 0 ? "" : `: ${l}`}`,
706
865
  category: "outdatedTypeScriptConfig",
707
866
  module: "tsconfig.json",
708
867
  originFileNames: [],
709
- reason: c,
710
- start: f,
711
- length: i.name.getWidth(s),
868
+ reason: a,
869
+ start: m,
870
+ length: r.name.getWidth(n),
712
871
  line: g + 1,
713
- column: p + 1
872
+ column: y + 1
714
873
  }
715
874
  });
716
875
  }
717
- return r;
876
+ return c;
718
877
  }
719
- async function Kt(s, e) {
720
- if (e.reportingUrl && (s || e.esriOnly || e.category || e.packageName))
721
- throw new Error("Reporting requires a complete, unfiltered repository scan.");
722
- const t = e.outputFormat === "json" || e.reportingUrl ? process.cwd() === J().repositoryRoot : !1;
878
+ async function tn(n, e) {
879
+ if (e.reportingUrl && (n || e.esriOnly || e.category || e.packageName))
880
+ throw new Error(
881
+ "Reporting requires complete, unfiltered repository scan. The only supported filter is the --exclude flag."
882
+ );
883
+ const t = e.outputFormat === "json" || e.reportingUrl ? process.cwd() === M().repositoryRoot : !1;
723
884
  if (e.reportingUrl && !t)
724
- throw new Error("Reporting requires scanning from the Git repository root.");
725
- let n = !s && !e.esriOnly && !e.category && !e.packageName;
726
- (e.outputFormat === "json" || e.reportingUrl) && (n &&= t), await ke(
885
+ throw new Error(
886
+ "Reporting requires scanning from the Git repository root. If some folders must be excluded, use the --exclude flag."
887
+ );
888
+ let s = !n && !e.esriOnly && !e.category && !e.packageName && !e.exclude?.length;
889
+ (e.outputFormat === "json" || e.reportingUrl) && (s &&= t), await Ee(
727
890
  {
728
891
  meta: {
729
892
  needsTypeInformation: !0,
@@ -731,340 +894,341 @@ async function Kt(s, e) {
731
894
  includeComponentFiles: !0,
732
895
  includeTsConfigFiles: !0
733
896
  },
734
- async run(o) {
735
- await ht(o, e, n, s);
897
+ async run(i) {
898
+ await Pt(i, e, s, n);
736
899
  }
737
900
  },
738
901
  "deprecations audit-usages",
739
- s
902
+ n
740
903
  );
741
904
  }
742
- async function ht(s, e, t, n) {
743
- const o = /* @__PURE__ */ new Map(), r = Ie("warn", () => {
905
+ async function Pt(n, e, t, s) {
906
+ const i = /* @__PURE__ */ new Map(), c = we(e.exclude ?? []), r = qe("warn", () => {
744
907
  t = !1;
745
- }), i = /* @__PURE__ */ new Map(), d = ie([]), l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), f = [
908
+ }), p = /* @__PURE__ */ new Map(), l = ce([]), a = /* @__PURE__ */ new Set(), m = [
746
909
  ...new Map(
747
- s.flatMap(({ packageJson: u }) => {
748
- const x = u === void 0 ? void 0 : $.dirname(u.filePath), S = u?.contents.name;
749
- return x !== void 0 && S !== void 0 && M(x, process.cwd()) ? [[x, { root: x, name: S }]] : [];
910
+ n.flatMap(({ packageJson: h }) => {
911
+ const S = h === void 0 ? void 0 : P.dirname(h.filePath), b = h?.contents.name;
912
+ return S !== void 0 && b !== void 0 && W(S, process.cwd()) ? [[S, { root: S, name: b }]] : [];
750
913
  })
751
914
  ).values()
752
- ].toSorted((u, x) => x.root.length - u.root.length);
753
- for (const u of s) {
754
- var w = [];
915
+ ].toSorted((h, S) => S.root.length - h.root.length);
916
+ for (const h of n) {
917
+ var f = [];
755
918
  try {
756
- if (U(u.packageJson?.contents.name)) {
757
- const P = u.packageJson?.filePath;
758
- P !== void 0 && !c.has(P) && (c.add(P), R(
759
- "warn",
760
- I(P),
761
- `Skipping excluded package \`${u.packageJson?.contents.name ?? u.cwd}\`.`
762
- ));
763
- continue;
764
- }
765
- if (u.filePaths.length === 0)
919
+ const S = h.filePaths.filter((E) => c(E) && !oe(E));
920
+ if (S.length === 0)
766
921
  continue;
767
- const x = Oe(u.packageJson);
768
- const S = await h(u.packageJson, x.packages);
769
- const A = u.packageJson === void 0 ? void 0 : $.dirname(u.packageJson.filePath);
770
- const C = ne(w, u.filePaths.some(Ae) ? be(u, !1, {
771
- paths: { ...u.typeScriptConfig?.compilerOptions.paths, ...x.paths }
922
+ const b = Ve(h.packageJson);
923
+ const L = await x(h.packageJson, b.packages);
924
+ const $ = h.packageJson === void 0 ? void 0 : P.dirname(h.packageJson.filePath);
925
+ const T = ie(f, S.some(Le) ? De(h, !1, {
926
+ paths: { ...h.typeScriptConfig?.compilerOptions.paths, ...b.paths }
772
927
  }) : void 0);
773
- const E = C?.tsMorph.getLanguageService().compilerObject;
774
- const T = E?.getProgram()?.getTypeChecker();
775
- for (const P of C?.getCodemodFiles() ?? []) {
776
- const D = P.compilerNode;
777
- if (!oe(D.fileName)) {
778
- if (E !== void 0 && T !== void 0) {
779
- const F = yt(
928
+ const F = T?.tsMorph.getLanguageService().compilerObject;
929
+ const C = F?.getProgram()?.getTypeChecker();
930
+ for (const E of T?.getCodemodFiles() ?? []) {
931
+ const D = E.compilerNode;
932
+ if (!(!c(D.fileName) || oe(D.fileName))) {
933
+ if (F !== void 0 && C !== void 0) {
934
+ const $e = $t(
780
935
  D,
781
- E,
782
- T,
783
- A,
936
+ F,
937
+ C,
938
+ $,
784
939
  e.esriOnly
785
940
  );
786
- for (const O of F) {
787
- const Y = At(O.originFileNames, f, A), Z = o.get(Y) ?? [];
788
- Z.push({ sourceFileName: D.fileName, usage: O }), o.set(Y, Z);
941
+ for (const Z of $e) {
942
+ const ee = Wt(Z.originFileNames, m, $), te = i.get(ee) ?? [];
943
+ te.push({ sourceFileName: D.fileName, usage: Z }), i.set(ee, te);
789
944
  }
790
945
  }
791
- v(pe(D, S, T)), l.add(D.fileName);
946
+ w(fe(D, L, C)), a.add(D.fileName);
792
947
  }
793
948
  }
794
- await me(u.filePaths, 8, async (P) => {
795
- const D = P.toLowerCase().endsWith(".html");
796
- if (l.has(P) || oe(P) || !S.hasDeprecatedApis && !D)
949
+ await ve(S, 8, async (E) => {
950
+ if (a.has(E))
797
951
  return;
798
- const F = await z(P, "utf8");
799
- v(pe({ fileName: P, text: F }, S)), l.add(P);
952
+ const D = await J(E, "utf8");
953
+ w(fe({ fileName: E, text: D }, L)), a.add(E);
800
954
  });
801
- } catch (N) {
802
- var b = N, k = !0;
955
+ } catch (k) {
956
+ var N = k, A = !0;
803
957
  } finally {
804
- se(w, b, k);
958
+ re(f, N, A);
805
959
  }
806
960
  }
807
- const g = await rt(
808
- s.flatMap(
809
- ({ packageJson: u }) => u === void 0 || U(u.contents.name) ? [] : [u]
810
- ),
961
+ const g = await vt(
962
+ n.flatMap(({ packageJson: h }) => h === void 0 ? [] : [h]),
811
963
  e.packageName,
812
964
  () => {
813
965
  t = !1;
814
966
  }
815
967
  );
816
- for (const [u, x] of g)
817
- o.set(u, [...o.get(u) ?? [], ...x]);
968
+ for (const [h, S] of g)
969
+ i.set(h, [...i.get(h) ?? [], ...S]);
818
970
  if (!e.esriOnly && (e.packageName === void 0 || e.packageName === "typescript") && (e.category === void 0 || e.category === "outdatedTypeScriptConfig")) {
819
- const u = s.flatMap(
820
- ({ typeScriptConfig: S, packageJson: A }) => S !== void 0 && !U(A?.contents.name) && M(S.filePath, process.cwd()) && (n === void 0 || n === S.filePath) ? [S.filePath] : []
821
- ), x = await gt(u);
822
- x.length > 0 && o.set("typescript", [...o.get("typescript") ?? [], ...x]);
971
+ const h = n.flatMap(
972
+ ({ typeScriptConfig: b }) => b !== void 0 && W(b.filePath, process.cwd()) && c(b.filePath) && (s === void 0 || s === b.filePath) ? [b.filePath] : []
973
+ ), S = await bt(h);
974
+ S.length > 0 && i.set("typescript", [...i.get("typescript") ?? [], ...S]);
823
975
  }
824
- const p = vt(o, e), m = e.reportingUrl || e.outputFormat === "json" ? H(p, ue(), J(), t) : void 0;
825
- qe(p, e.outputFormat, m);
826
- const y = [...p.values()].flat();
827
- Te(
976
+ const y = e.reportingUrl || e.outputFormat === "json" ? M() : void 0, v = Ct(i, e), d = y !== void 0 && (e.reportingUrl || e.outputFormat === "json") ? H(v, Se(), y, t, e.exclude) : void 0;
977
+ Ye(v, e.outputFormat, d);
978
+ const u = [...v.values()].flat();
979
+ Je(
828
980
  "usages",
829
- y.length,
830
- new Set(y.map(({ sourceFileName: u }) => u)).size,
831
- p.size
832
- ), e.reportingUrl && m !== void 0 && await Pe(m, e.reportingUrl);
833
- async function h(u, x) {
834
- if (u === void 0)
835
- return d;
836
- let S = i.get(u.filePath);
837
- return S === void 0 && (S = ie(
838
- await Fe(u, r, e.esriOnly, x)
839
- ), i.set(u.filePath, S)), S;
981
+ u.length,
982
+ new Set(u.map(({ sourceFileName: h }) => h)).size,
983
+ v.size
984
+ ), e.reportingUrl && d !== void 0 && await Te(d, e.reportingUrl);
985
+ async function x(h, S) {
986
+ if (h === void 0)
987
+ return l;
988
+ let b = p.get(h.filePath);
989
+ return b === void 0 && (b = ce(
990
+ await Ge(h, r, e.esriOnly, S)
991
+ ), p.set(h.filePath, b)), b;
840
992
  }
841
- function v(u) {
842
- for (const { packageName: x, sourceFileName: S, usage: A } of u) {
843
- if (ge(A.name, A.reason))
844
- continue;
845
- const C = o.get(x) ?? [], E = C.findIndex(
846
- (P) => P.sourceFileName === S && P.usage.start === A.start && P.usage.length === A.length
847
- ), T = { sourceFileName: S, usage: A };
848
- E === -1 ? C.push(T) : C[E] = T, o.set(x, C);
993
+ function w(h) {
994
+ for (const { packageName: S, sourceFileName: b, usage: L } of h) {
995
+ const $ = i.get(S) ?? [], T = $.findIndex(
996
+ (C) => C.sourceFileName === b && C.usage.start === L.start && C.usage.length === L.length
997
+ ), F = { sourceFileName: b, usage: L };
998
+ T === -1 ? $.push(F) : $[T] = F, i.set(S, $);
849
999
  }
850
1000
  }
851
1001
  }
852
- function vt(s, e) {
853
- const t = /* @__PURE__ */ new Map();
854
- for (const [n, o] of s) {
855
- if (e.packageName !== void 0 && n !== e.packageName)
1002
+ function Ct(n, e, t) {
1003
+ const s = we(e.exclude ?? [], t), i = /* @__PURE__ */ new Map();
1004
+ for (const [c, r] of n) {
1005
+ if (e.packageName !== void 0 && c !== e.packageName)
856
1006
  continue;
857
- const r = o.filter(
858
- ({ usage: i }) => e.category === void 0 || he({
859
- package: n,
860
- name: i.name,
861
- category: i.category,
862
- memberOf: i.memberOf,
863
- module: i.module ?? K(i.originFileNames, n),
864
- deprecated: i.reason ?? !0
865
- }) === e.category
1007
+ const p = r.filter(
1008
+ ({ usage: l, sourceFileName: a }) => s(a) && (e.category === void 0 || xe({
1009
+ package: c,
1010
+ name: l.name,
1011
+ category: l.category,
1012
+ memberOf: l.memberOf,
1013
+ module: l.module ?? B(l.originFileNames, c),
1014
+ deprecated: l.reason ?? !0
1015
+ }) === e.category)
866
1016
  );
867
- r.length > 0 && t.set(n, r);
1017
+ p.length > 0 && i.set(c, p);
868
1018
  }
869
- return t;
1019
+ return i;
870
1020
  }
871
- function yt(s, e, t, n, o = !1) {
872
- const r = /* @__PURE__ */ new Map();
873
- for (const i of e.getSuggestionDiagnostics(s.fileName)) {
874
- if (i.reportsDeprecated === void 0)
1021
+ function $t(n, e, t, s, i = !1) {
1022
+ const c = /* @__PURE__ */ new Map();
1023
+ for (const r of e.getSuggestionDiagnostics(n.fileName)) {
1024
+ if (r.reportsDeprecated === void 0)
875
1025
  continue;
876
- const d = we(s, i.start, i.start + i.length);
1026
+ const p = Ae(n, r.start, r.start + r.length);
877
1027
  if (
878
1028
  // Don't report for imports, only for usages
879
- a.findAncestor(d, a.isImportDeclaration) !== void 0 || // Don't report closing JSX - only for opening
880
- a.findAncestor(d, a.isJsxClosingElement) !== void 0
1029
+ o.findAncestor(p, o.isImportDeclaration) !== void 0 || // Don't report closing JSX - only for opening
1030
+ o.findAncestor(p, o.isJsxClosingElement) !== void 0
881
1031
  )
882
1032
  continue;
883
- const l = St(d, t), c = l.reason === void 0 ? [] : Q(l.symbol), f = c.length > 0 ? void 0 : e.getDefinitionAtPosition(s.fileName, i.start), g = c.length > 0 ? c : [...new Set(f?.map(({ fileName: p }) => p))];
884
- _(g, o, n) && G(r, s, {
885
- start: i.start,
886
- length: i.length,
887
- ...Nt(d, l, t, e, f?.[0]),
1033
+ const l = Tt(p, t), a = l.reason === void 0 ? [] : Q(l.symbol), m = a.length > 0 ? void 0 : e.getDefinitionAtPosition(n.fileName, r.start), g = a.length > 0 ? a : [...new Set(m?.map(({ fileName: y }) => y))];
1034
+ X(g, i, s) && _(c, n, {
1035
+ start: r.start,
1036
+ length: r.length,
1037
+ ...Ot(p, l, t, e, m?.[0]),
888
1038
  originFileNames: g,
889
- reason: kt(e, s.fileName, i.start) ?? l.reason
1039
+ reason: It(e, n.fileName, r.start) ?? l.reason
890
1040
  });
891
1041
  }
892
- return xt(s, t, r, n, o), [...r.values()].toSorted((i, d) => i.start - d.start);
1042
+ return Dt(n, t, c, s, i), [...c.values()].toSorted((r, p) => r.start - p.start);
893
1043
  }
894
- function xt(s, e, t, n, o) {
895
- function r(i) {
896
- a.isNewExpression(i) && wt(i, e, t, n, o);
897
- let d, l;
898
- if (a.isJsxAttribute(i) && a.isIdentifier(i.name)) {
899
- const c = i.parent.parent;
900
- (a.isJsxOpeningElement(c) || a.isJsxSelfClosingElement(c)) && (l = e.getContextualType(c.tagName)?.getProperty(i.name.text), d = i.name);
901
- } else if ((a.isPropertyAssignment(i) || a.isShorthandPropertyAssignment(i) || a.isMethodDeclaration(i)) && a.isObjectLiteralExpression(i.parent)) {
902
- const c = a.isComputedPropertyName(i.name) ? W(i.name.expression, e) : i.name.text, f = e.getContextualType(i.parent);
903
- l = c === void 0 || f === void 0 ? void 0 : e.getNonNullableType(f).getProperty(c), d = i.name;
904
- } else if (a.isPropertyAccessExpression(i))
905
- l = e.getSymbolAtLocation(i.name), d = i.name;
906
- else if (a.isElementAccessExpression(i)) {
907
- const c = W(i.argumentExpression, e);
908
- l = c === void 0 ? void 0 : e.getTypeAtLocation(i.expression).getProperty(c), d = i.argumentExpression;
909
- } else if (a.isBindingElement(i) && a.isObjectBindingPattern(i.parent) && i.dotDotDotToken === void 0) {
910
- const c = i.propertyName ?? (a.isIdentifier(i.name) ? i.name : void 0), f = c === void 0 ? void 0 : a.isComputedPropertyName(c) ? W(c.expression, e) : c.text;
911
- l = f === void 0 ? void 0 : e.getTypeAtLocation(i.parent).getProperty(f), d = c;
1044
+ function Dt(n, e, t, s, i) {
1045
+ function c(r) {
1046
+ o.isNewExpression(r) && Et(r, e, t, s, i);
1047
+ let p, l;
1048
+ if (o.isCallExpression(r))
1049
+ l = Lt(r, e), p = r.arguments[0];
1050
+ else if (o.isJsxAttribute(r) && o.isIdentifier(r.name)) {
1051
+ const a = r.parent.parent;
1052
+ (o.isJsxOpeningElement(a) || o.isJsxSelfClosingElement(a)) && (l = e.getContextualType(a.tagName)?.getProperty(r.name.text), p = r.name);
1053
+ } else if ((o.isPropertyAssignment(r) || o.isShorthandPropertyAssignment(r) || o.isMethodDeclaration(r)) && o.isObjectLiteralExpression(r.parent)) {
1054
+ const a = o.isComputedPropertyName(r.name) ? I(r.name.expression, e) : r.name.text, m = e.getContextualType(r.parent);
1055
+ l = a === void 0 || m === void 0 ? void 0 : e.getNonNullableType(m).getProperty(a), p = r.name;
1056
+ } else if (o.isPropertyAccessExpression(r))
1057
+ l = e.getSymbolAtLocation(r.name), p = r.name;
1058
+ else if (o.isElementAccessExpression(r)) {
1059
+ const a = I(r.argumentExpression, e);
1060
+ l = a === void 0 ? void 0 : e.getTypeAtLocation(r.expression).getProperty(a), p = r.argumentExpression;
1061
+ } else if (o.isBindingElement(r) && o.isObjectBindingPattern(r.parent) && r.dotDotDotToken === void 0) {
1062
+ const a = r.propertyName ?? (o.isIdentifier(r.name) ? r.name : void 0), m = a === void 0 ? void 0 : o.isComputedPropertyName(a) ? I(a.expression, e) : a.text;
1063
+ l = m === void 0 ? void 0 : e.getTypeAtLocation(r.parent).getProperty(m), p = a;
912
1064
  }
913
- if ((a.isPropertyAccessExpression(i) || a.isElementAccessExpression(i) || a.isBindingElement(i)) && !l?.declarations?.some(
914
- (c) => a.isGetAccessorDeclaration(c) || a.isSetAccessorDeclaration(c)
915
- ) && (l = void 0), l !== void 0 && d !== void 0) {
916
- const c = Ne(l, e), f = Q(l);
917
- c !== void 0 && _(f, o, n) && G(t, s, {
918
- start: d.getStart(s),
919
- length: d.getWidth(s),
1065
+ if ((o.isPropertyAccessExpression(r) || o.isElementAccessExpression(r) || o.isBindingElement(r)) && !l?.declarations?.some(
1066
+ (a) => o.isGetAccessorDeclaration(a) || o.isSetAccessorDeclaration(a)
1067
+ ) && (l = void 0), l !== void 0 && p !== void 0) {
1068
+ const a = Ce(l, e), m = Q(l);
1069
+ a !== void 0 && X(m, i, s) && _(t, n, {
1070
+ start: p.getStart(n),
1071
+ length: p.getWidth(n),
920
1072
  name: l.getName(),
921
- ...B(l.declarations?.[0]),
922
- originFileNames: f,
923
- reason: c
1073
+ ...V(l.declarations?.[0]),
1074
+ originFileNames: m,
1075
+ reason: a
924
1076
  });
925
1077
  }
926
- a.forEachChild(i, r);
1078
+ o.forEachChild(r, c);
927
1079
  }
928
- r(s);
1080
+ c(n);
929
1081
  }
930
- function wt(s, e, t, n, o) {
931
- const r = e.getTypeAtLocation(s).getSymbol(), i = r?.declarations?.[0], d = i !== void 0 && (a.isClassDeclaration(i) || a.isInterfaceDeclaration(i)) ? i.name?.text : void 0, l = d === void 0 ? void 0 : Ue.get(d);
932
- if (l === void 0 || d === void 0)
1082
+ function Et(n, e, t, s, i) {
1083
+ const c = e.getTypeAtLocation(n).getSymbol(), r = c?.declarations?.[0], p = r !== void 0 && (o.isClassDeclaration(r) || o.isInterfaceDeclaration(r)) ? r.name?.text : void 0, l = p === void 0 ? void 0 : Ue.get(p);
1084
+ if (l === void 0 || p === void 0)
933
1085
  return;
934
- const c = Q(r);
935
- if (!c.some(
936
- (p) => (X(p) ?? fe($.dirname(p), "")) === "@arcgis/core"
937
- ) || !_(c, o, n))
1086
+ const a = Q(c);
1087
+ if (!a.some(
1088
+ (y) => (Y(y) ?? ke(P.dirname(y), "")) === "@arcgis/core"
1089
+ ) || !X(a, i, s))
938
1090
  return;
939
- const f = a.isPropertyAccessExpression(s.expression) ? s.expression.name : s.expression, g = s.getSourceFile();
940
- G(t, g, {
941
- start: f.getStart(g),
942
- length: f.getWidth(g),
943
- name: d,
1091
+ const m = o.isPropertyAccessExpression(n.expression) ? n.expression.name : n.expression, g = n.getSourceFile();
1092
+ _(t, g, {
1093
+ start: m.getStart(g),
1094
+ length: m.getWidth(g),
1095
+ name: p,
944
1096
  kind: "class",
945
1097
  category: "coreViews",
946
- originFileNames: c,
947
- reason: `Direct construction with new ${d}() is discouraged. Use \`<${l}>\` instead. In 6.0, directly constructed views will no longer include .ui; use component slots for UI.`
1098
+ originFileNames: a,
1099
+ reason: `Direct construction with new ${p}() is discouraged. Use \`<${l}>\` instead. In 6.0, directly constructed views will no longer include .ui; use component slots for UI.`
948
1100
  });
949
1101
  }
950
- function W(s, e) {
951
- const t = e.getTypeAtLocation(s);
1102
+ function Lt(n, e) {
1103
+ const t = n.expression;
1104
+ if (!o.isPropertyAccessExpression(t) && !o.isElementAccessExpression(t) || n.arguments[0] === void 0)
1105
+ return;
1106
+ const s = o.isPropertyAccessExpression(t) ? t.name.text : I(t.argumentExpression, e);
1107
+ if (s !== "addEventListener" && s !== "removeEventListener")
1108
+ return;
1109
+ const i = I(n.arguments[0], e);
1110
+ if (i === void 0)
1111
+ return;
1112
+ const c = e.getNonNullableType(e.getTypeAtLocation(t.expression)), r = c.getProperty("@eventTypes");
1113
+ if (!(r === void 0 || e.getTypeOfSymbolAtLocation(r, n).getProperty(i) === void 0))
1114
+ return c.getProperty(i);
1115
+ }
1116
+ function I(n, e) {
1117
+ const t = e.getTypeAtLocation(n);
952
1118
  return t.isStringLiteral() || t.isNumberLiteral() ? String(t.value) : void 0;
953
1119
  }
954
- function St(s, e) {
955
- let t = e.getSymbolAtLocation(s);
956
- for (; t !== void 0 && (t.flags & a.SymbolFlags.Alias) !== 0; ) {
957
- const n = Ne(t, e);
958
- if (n !== void 0)
959
- return { symbol: t, reason: n };
1120
+ function Tt(n, e) {
1121
+ let t = e.getSymbolAtLocation(n);
1122
+ for (; t !== void 0 && (t.flags & o.SymbolFlags.Alias) !== 0; ) {
1123
+ const s = Ce(t, e);
1124
+ if (s !== void 0)
1125
+ return { symbol: t, reason: s };
960
1126
  t = t.declarations === void 0 ? void 0 : e.getImmediateAliasedSymbol(t);
961
1127
  }
962
1128
  return { symbol: t, reason: void 0 };
963
1129
  }
964
- function Q(s) {
965
- return [...new Set(s?.declarations?.map((e) => e.getSourceFile().fileName))];
1130
+ function Q(n) {
1131
+ return [...new Set(n?.declarations?.map((e) => e.getSourceFile().fileName))];
966
1132
  }
967
- function Nt(s, e, t, n, o) {
1133
+ function Ot(n, e, t, s, i) {
968
1134
  if (e.reason !== void 0)
969
1135
  return {
970
1136
  name: ae(e.symbol.declarations?.[0], e.symbol.getName()),
971
- ...B(e.symbol.declarations?.[0])
1137
+ ...V(e.symbol.declarations?.[0])
972
1138
  };
973
- const r = o === void 0 ? void 0 : n.getProgram()?.getSourceFile(o.fileName), i = o === void 0 || r === void 0 ? void 0 : we(
974
- r,
975
- o.textSpan.start,
976
- o.textSpan.start + o.textSpan.length
977
- ), d = (i === void 0 ? void 0 : t.getSymbolAtLocation(i)?.declarations?.[0]) ?? e.symbol?.declarations?.[0], l = o?.name;
1139
+ const c = i === void 0 ? void 0 : s.getProgram()?.getSourceFile(i.fileName), r = i === void 0 || c === void 0 ? void 0 : Ae(
1140
+ c,
1141
+ i.textSpan.start,
1142
+ i.textSpan.start + i.textSpan.length
1143
+ ), p = (r === void 0 ? void 0 : t.getSymbolAtLocation(r)?.declarations?.[0]) ?? e.symbol?.declarations?.[0], l = i?.name;
978
1144
  return {
979
- name: l === void 0 ? bt(s) : ae(d, l),
980
- ...B(d)
1145
+ name: l === void 0 ? Ft(n) : ae(p, l),
1146
+ ...V(p)
981
1147
  };
982
1148
  }
983
- function M(s, e) {
984
- const t = $.relative(e, s);
985
- return t !== "" && !t.startsWith("../") && !$.isAbsolute(t) && t !== "node_modules" && !t.startsWith("node_modules/");
1149
+ function W(n, e) {
1150
+ const t = P.relative(e, n);
1151
+ return t !== "" && !t.startsWith("../") && !P.isAbsolute(t) && t !== "node_modules" && !t.startsWith("node_modules/");
986
1152
  }
987
- function we(s, e, t) {
988
- let n = s;
1153
+ function Ae(n, e, t) {
1154
+ let s = n;
989
1155
  for (; ; ) {
990
- let o;
991
- if (a.forEachChild(n, (r) => {
992
- o === void 0 && r.getStart(s) <= e && r.getEnd() >= t && (o = r);
993
- }), o === void 0)
994
- return n;
995
- n = o;
1156
+ let i;
1157
+ if (o.forEachChild(s, (c) => {
1158
+ i === void 0 && c.getStart(n) <= e && c.getEnd() >= t && (i = c);
1159
+ }), i === void 0)
1160
+ return s;
1161
+ s = i;
996
1162
  }
997
1163
  }
998
- function bt(s) {
999
- return a.isIdentifier(s) || a.isPrivateIdentifier(s) || a.isStringLiteralLike(s) || a.isNumericLiteral(s) ? s.text : s.getText();
1164
+ function Ft(n) {
1165
+ return o.isIdentifier(n) || o.isPrivateIdentifier(n) || o.isStringLiteralLike(n) || o.isNumericLiteral(n) ? n.text : n.getText();
1000
1166
  }
1001
- function Se(s) {
1002
- const e = s?.find(({ name: t }) => t === "deprecated");
1003
- return e === void 0 ? void 0 : Je(e.text) ?? "";
1167
+ function Pe(n) {
1168
+ const e = n?.find(({ name: t }) => t === "deprecated");
1169
+ return e === void 0 ? void 0 : Ke(e.text) ?? "";
1004
1170
  }
1005
- function kt(s, e, t) {
1171
+ function It(n, e, t) {
1006
1172
  try {
1007
- return Se(s.getQuickInfoAtPosition(e, t)?.tags);
1173
+ return Pe(n.getQuickInfoAtPosition(e, t)?.tags);
1008
1174
  } catch {
1009
1175
  return;
1010
1176
  }
1011
1177
  }
1012
- function Ne(s, e) {
1178
+ function Ce(n, e) {
1013
1179
  try {
1014
- const t = Se(s?.getJsDocTags(e));
1180
+ const t = Pe(n?.getJsDocTags(e));
1015
1181
  if (t !== void 0)
1016
1182
  return t;
1017
- const n = s?.declarations?.filter((o) => a.isGetAccessorDeclaration(o) || a.isSetAccessorDeclaration(o)).map((o) => a.getJSDocDeprecatedTag(o)).find((o) => o !== void 0);
1018
- return n === void 0 ? void 0 : n.comment === void 0 ? "" : Me(n.comment);
1183
+ const s = n?.declarations?.filter((i) => o.isGetAccessorDeclaration(i) || o.isSetAccessorDeclaration(i)).map((i) => o.getJSDocDeprecatedTag(i)).find((i) => i !== void 0);
1184
+ return s === void 0 ? void 0 : s.comment === void 0 ? "" : Be(s.comment);
1019
1185
  } catch {
1020
1186
  return;
1021
1187
  }
1022
1188
  }
1023
- function G(s, e, t) {
1024
- if (ge(t.name, t.reason))
1025
- return;
1026
- const { line: n, character: o } = e.getLineAndCharacterOfPosition(t.start);
1027
- s.set(`${t.start}:${t.length}`, {
1189
+ function _(n, e, t) {
1190
+ const { line: s, character: i } = e.getLineAndCharacterOfPosition(t.start);
1191
+ n.set(`${t.start}:${t.length}`, {
1028
1192
  ...t,
1029
- line: n + 1,
1030
- column: o + 1
1193
+ line: s + 1,
1194
+ column: i + 1
1031
1195
  });
1032
1196
  }
1033
- function _(s, e, t) {
1034
- return s.some((n) => t !== void 0 && M(n, t)) ? !1 : !e || s.some((n) => {
1035
- const o = X(n);
1036
- return o === void 0 ? t === void 0 || !M(n, t) : De(o);
1197
+ function X(n, e, t) {
1198
+ return n.some((s) => t !== void 0 && W(s, t)) ? !1 : !e || n.some((s) => {
1199
+ const i = Y(s);
1200
+ return i === void 0 ? t === void 0 || !W(s, t) : Oe(i);
1037
1201
  });
1038
1202
  }
1039
- function X(s) {
1040
- const e = $e(s), t = "/node_modules/", n = e.lastIndexOf(t);
1041
- if (n === -1)
1203
+ function Y(n) {
1204
+ const e = Fe(n), t = "/node_modules/", s = e.lastIndexOf(t);
1205
+ if (s === -1)
1042
1206
  return;
1043
- const [o, r] = e.slice(n + t.length).split("/");
1044
- return o.startsWith("@") ? `${o}/${r}` : o;
1207
+ const [i, c] = e.slice(s + t.length).split("/");
1208
+ return i.startsWith("@") ? `${i}/${c}` : i;
1045
1209
  }
1046
- function At(s, e = [], t) {
1047
- const n = s[0];
1048
- if (n === void 0)
1210
+ function Wt(n, e = [], t) {
1211
+ const s = n[0];
1212
+ if (s === void 0)
1049
1213
  return "unknown package";
1050
- const o = X(n);
1051
- if (o !== void 0)
1052
- return o;
1053
- const r = e.find(({ root: g }) => M(n, g));
1054
- if (r !== void 0)
1055
- return r.name;
1056
- const i = $.dirname(I(n)), d = fe($.dirname(n), i);
1057
- if (d !== i)
1058
- return d;
1059
- if (t === void 0)
1214
+ const i = Y(s);
1215
+ if (i !== void 0)
1060
1216
  return i;
1061
- const c = $.relative(t, n).split("/"), f = c.findIndex((g) => g !== "..");
1062
- return f < 1 ? $.dirname(I(n)) : c.slice(0, f * 2).join("/");
1217
+ const c = e.find(({ root: g }) => W(s, g));
1218
+ if (c !== void 0)
1219
+ return c.name;
1220
+ const r = P.dirname(R(s)), p = ke(P.dirname(s), r);
1221
+ if (p !== r)
1222
+ return p;
1223
+ if (t === void 0)
1224
+ return r;
1225
+ const a = P.relative(t, s).split("/"), m = a.findIndex((g) => g !== "..");
1226
+ return m < 1 ? P.dirname(R(s)) : a.slice(0, m * 2).join("/");
1063
1227
  }
1064
1228
  export {
1065
- Kt as auditDeprecatedUsages,
1066
- yt as collectDeprecatedApiUsages,
1067
- At as getDeprecationOriginLabel,
1068
- X as getNodeModulesPackageName,
1069
- _ as shouldIncludeDeprecation
1229
+ tn as auditDeprecatedUsages,
1230
+ $t as collectDeprecatedApiUsages,
1231
+ Wt as getDeprecationOriginLabel,
1232
+ Y as getNodeModulesPackageName,
1233
+ X as shouldIncludeDeprecation
1070
1234
  };