@ryuzaki13/react-foundation-lib 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/error-report/breadcrumbs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAcrD,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,QAkBzG;AAED,wBAAgB,yBAAyB,4BAExC;AAED,wBAAgB,2BAA2B,SAE1C;AA6GD;;GAEG;AACH,wBAAgB,oCAAoC,eAyBnD"}
1
+ {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/error-report/breadcrumbs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAcrD,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,QAkBzG;AAED,wBAAgB,yBAAyB,4BAExC;AAED,wBAAgB,2BAA2B,SAE1C;AAiID;;GAEG;AACH,wBAAgB,oCAAoC,eAyBnD"}
@@ -133,8 +133,7 @@ var pe = 20, me = 120, he = [
133
133
  "input",
134
134
  "select",
135
135
  "textarea",
136
- "[role]",
137
- "[data-error-report-target]"
136
+ "[role]"
138
137
  ].join(","), ge = /^[a-z0-9][a-z0-9._:/-]*$/i, v = [];
139
138
  function _e() {
140
139
  return (/* @__PURE__ */ new Date()).toISOString();
@@ -166,48 +165,52 @@ function xe(e) {
166
165
  let t = be(e.getAttribute("data-error-report-target"));
167
166
  return t && ge.test(t) ? t : void 0;
168
167
  }
169
- function Se(e, t) {
168
+ function b(e, t) {
170
169
  let n = be(e.getAttribute(t));
171
170
  return n && ge.test(n) ? n : void 0;
172
171
  }
173
- function Ce(e) {
172
+ function Se(e) {
173
+ let t = xe(e);
174
174
  return {
175
- role: Se(e, "role"),
176
- type: Se(e, "type"),
177
- errorReportTarget: xe(e)
175
+ role: b(e, "role"),
176
+ type: b(e, "type"),
177
+ errorReportTarget: t,
178
+ dataUi: t ? void 0 : b(e, "data-ui"),
179
+ dataAction: t ? void 0 : b(e, "data-action")
178
180
  };
179
181
  }
180
- function we(e) {
182
+ function x(e) {
181
183
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\#.[\]>~+:]/g, "\\$&");
182
184
  }
183
- function b(e) {
184
- let t = Ce(e), n = [e.tagName.toLowerCase()];
185
- return t.role && n.push(`[role="${t.role}"]`), t.type && n.push(`[type="${t.type}"]`), t.errorReportTarget && n.push(`[data-error-report-target="${we(t.errorReportTarget)}"]`), n.join("");
185
+ function Ce(e) {
186
+ let t = Se(e), n = [e.tagName.toLowerCase()];
187
+ return t.role && n.push(`[role="${t.role}"]`), t.type && n.push(`[type="${t.type}"]`), t.errorReportTarget ? n.push(`[data-error-report-target="${x(t.errorReportTarget)}"]`) : (t.dataUi && n.push(`[data-ui="${x(t.dataUi)}"]`), t.dataAction && n.push(`[data-action="${x(t.dataAction)}"]`)), n.join("");
186
188
  }
187
- function Te(e) {
188
- let t = Ce(e);
189
+ function we(e) {
190
+ let t = Se(e);
189
191
  return {
190
192
  tag: e.tagName.toLowerCase(),
191
- selector: b(e),
193
+ selector: Ce(e),
192
194
  ...t
193
195
  };
194
196
  }
195
- function Ee(e) {
197
+ function Te(e) {
196
198
  return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0 && (!Array.isArray(e) || e.length > 0)));
197
199
  }
198
- function De(e) {
200
+ function S(e) {
199
201
  let t = [], n = e;
200
202
  for (; n && n !== document.documentElement && t.length < pe && (t.push(n), n !== document.body);) n = n.parentElement;
201
203
  return t;
202
204
  }
203
- function Oe(e) {
204
- return e.closest(he) ?? e;
205
+ function Ee(e) {
206
+ let t = S(e);
207
+ return t.find((e) => xe(e)) || (t.find((e) => e.matches(he) || b(e, "data-action") !== void 0 || b(e, "data-ui") !== void 0) ?? e);
205
208
  }
206
- function ke(e) {
207
- if (e instanceof Element) return De(Oe(e)).map((e) => b(e)).join(" > ");
209
+ function De(e) {
210
+ if (e instanceof Element) return S(Ee(e)).map((e) => Ce(e)).join(" > ");
208
211
  }
209
- function Ae(e) {
210
- let t = e.target instanceof Element ? e.target : void 0, n = t ? Oe(t) : void 0, r = n ? De(n).map((e) => Ee(Te(e))) : [];
212
+ function Oe(e) {
213
+ let t = e.target instanceof Element ? e.target : void 0, n = t ? Ee(t) : void 0, r = n ? S(n).map((e) => Te(we(e))) : [];
211
214
  return _({
212
215
  button: e.button,
213
216
  ctrlKey: e.ctrlKey,
@@ -215,20 +218,20 @@ function Ae(e) {
215
218
  altKey: e.altKey,
216
219
  clientX: e.clientX,
217
220
  clientY: e.clientY,
218
- target: n ? Ee(Te(n)) : void 0,
221
+ target: n ? Te(we(n)) : void 0,
219
222
  chain: r
220
223
  }, {
221
224
  scope: "breadcrumb-detail",
222
225
  source: "click"
223
226
  });
224
227
  }
225
- function je() {
228
+ function ke() {
226
229
  if (typeof window > "u") return () => void 0;
227
230
  let e = (e) => {
228
231
  y({
229
232
  type: "click",
230
- target: ke(e.target),
231
- detail: Ae(e)
233
+ target: De(e.target),
234
+ detail: Oe(e)
232
235
  });
233
236
  }, t = () => {
234
237
  y({
@@ -245,33 +248,33 @@ function je() {
245
248
  }
246
249
  //#endregion
247
250
  //#region src/error-report/payload.ts
248
- var Me = 1, x = 262144, S = 65536, Ne = 32768, Pe = 256, Fe = 128, Ie = 2048;
249
- function Le(e) {
251
+ var Ae = 1, C = 262144, w = 65536, je = 32768, Me = 256, Ne = 128, Pe = 2048;
252
+ function Fe(e) {
250
253
  return new TextEncoder().encode(JSON.stringify(e)).byteLength;
251
254
  }
252
- function Re(e) {
253
- return d(e.split(/[?#]/, 1)[0] ?? e, Ie);
255
+ function Ie(e) {
256
+ return d(e.split(/[?#]/, 1)[0] ?? e, Pe);
254
257
  }
255
- function C(e, t, n, r = "characters") {
258
+ function T(e, t, n, r = "characters") {
256
259
  let i = g(r === "bytes" ? p(e, n) : d(e, n), t, n);
257
260
  if (typeof i == "string") return r === "bytes" ? p(i, n) : d(i, n);
258
261
  }
259
- function w(e, t) {
262
+ function E(e, t) {
260
263
  return {
261
264
  name: d(e.name, 256),
262
- message: C(e.message, {
265
+ message: T(e.message, {
263
266
  scope: "error-message",
264
267
  source: t
265
268
  }, 4096) ?? "[REDACTED]",
266
269
  code: e.code ? d(e.code, 128) : void 0,
267
- stackTrace: e.stackTrace ? C(e.stackTrace, {
270
+ stackTrace: e.stackTrace ? T(e.stackTrace, {
268
271
  scope: "stack-trace",
269
272
  source: t
270
- }, S, "bytes") : void 0,
273
+ }, w, "bytes") : void 0,
271
274
  httpStatus: e.httpStatus
272
275
  };
273
276
  }
274
- function ze(e) {
277
+ function Le(e) {
275
278
  return {
276
279
  ...e,
277
280
  queryHash: d(e.queryHash, 512),
@@ -287,18 +290,18 @@ function ze(e) {
287
290
  scope: "query-data-shape",
288
291
  source: e.queryHash
289
292
  }) : void 0,
290
- error: e.error ? w(e.error, e.queryHash) : void 0
293
+ error: e.error ? E(e.error, e.queryHash) : void 0
291
294
  };
292
295
  }
293
- function Be(e) {
296
+ function Re(e) {
294
297
  return {
295
298
  ...e,
296
299
  mutationKey: e.mutationKey ? g(e.mutationKey, { scope: "mutation-key" }) : void 0,
297
300
  meta: _(e.meta, { scope: "mutation-meta" }),
298
- error: e.error ? w(e.error, "mutation") : void 0
301
+ error: e.error ? E(e.error, "mutation") : void 0
299
302
  };
300
303
  }
301
- function Ve(e) {
304
+ function ze(e) {
302
305
  return {
303
306
  ...e,
304
307
  buster: e.buster ? d(e.buster, 512) : void 0,
@@ -307,21 +310,21 @@ function Ve(e) {
307
310
  scope: "persisted-query-key",
308
311
  source: e.queryHash
309
312
  }) : void 0,
310
- error: e.error ? w(e.error, e.queryHash) : void 0
313
+ error: e.error ? E(e.error, e.queryHash) : void 0
311
314
  };
312
315
  }
313
- function T(e) {
314
- return Le(e);
316
+ function D(e) {
317
+ return Fe(e);
315
318
  }
316
- function He(e) {
319
+ function Be(e) {
317
320
  return {
318
321
  ...e,
319
322
  reportId: d(e.reportId, 128),
320
323
  sessionId: d(e.sessionId, 128),
321
324
  createdUtc: d(e.createdUtc, 64),
322
- application: d(e.application, Fe),
323
- source: d(e.source, Pe),
324
- error: w(e.error, e.source),
325
+ application: d(e.application, Ne),
326
+ source: d(e.source, Me),
327
+ error: E(e.error, e.source),
325
328
  environment: {
326
329
  ...e.environment,
327
330
  buildId: e.environment.buildId ? d(e.environment.buildId, 128) : void 0
@@ -332,20 +335,20 @@ function He(e) {
332
335
  timeZone: e.client.timeZone ? d(e.client.timeZone, 128) : void 0
333
336
  } : void 0,
334
337
  location: e.location ? {
335
- pathname: Re(e.location.pathname),
336
- origin: e.location.origin ? d(e.location.origin.split(/[?#]/, 1)[0] ?? e.location.origin, Ie) : void 0
338
+ pathname: Ie(e.location.pathname),
339
+ origin: e.location.origin ? d(e.location.origin.split(/[?#]/, 1)[0] ?? e.location.origin, Pe) : void 0
337
340
  } : void 0,
338
- react: e.react?.componentStack ? { componentStack: C(e.react.componentStack, {
341
+ react: e.react?.componentStack ? { componentStack: T(e.react.componentStack, {
339
342
  scope: "stack-trace",
340
343
  source: "react-component-stack"
341
- }, Ne, "bytes") } : void 0,
342
- query: e.query ? ze(e.query) : void 0,
343
- mutation: e.mutation ? Be(e.mutation) : void 0,
344
+ }, je, "bytes") } : void 0,
345
+ query: e.query ? Le(e.query) : void 0,
346
+ mutation: e.mutation ? Re(e.mutation) : void 0,
344
347
  queryClient: e.queryClient ? {
345
- queries: e.queryClient.queries.slice(-40).map(ze),
346
- mutations: e.queryClient.mutations.slice(-40).map(Be)
348
+ queries: e.queryClient.queries.slice(-40).map(Le),
349
+ mutations: e.queryClient.mutations.slice(-40).map(Re)
347
350
  } : void 0,
348
- persistedQueries: e.persistedQueries?.slice(-40).map(Ve),
351
+ persistedQueries: e.persistedQueries?.slice(-40).map(ze),
349
352
  breadcrumbs: e.breadcrumbs.slice(-80).map((e) => ({
350
353
  ...e,
351
354
  utc: d(e.utc, 64),
@@ -364,19 +367,19 @@ function He(e) {
364
367
  })
365
368
  };
366
369
  }
367
- function Ue(e) {
368
- let t = He(e), n = T(t);
370
+ function Ve(e) {
371
+ let t = Be(e), n = D(t);
369
372
  if (n <= 262144) return t;
370
373
  let r = [], i = {
371
374
  ...t,
372
375
  truncation: {
373
376
  reason: "payload-size",
374
- limitBytes: x,
377
+ limitBytes: C,
375
378
  originalBytes: n,
376
379
  droppedSections: r
377
380
  }
378
381
  }, a = (e, t, n) => {
379
- !t(i) || T(i) <= 262144 || (r.push(e), i = n(i));
382
+ !t(i) || D(i) <= 262144 || (r.push(e), i = n(i));
380
383
  };
381
384
  return a("queryClient", (e) => e.queryClient !== void 0, (e) => ({
382
385
  ...e,
@@ -430,15 +433,15 @@ function Ue(e) {
430
433
  }
431
434
  //#endregion
432
435
  //#region src/error-report/errorInfo.ts
433
- var We = "Неизвестная ошибка";
434
- function E(e) {
435
- return t(e) ? d(e) : We;
436
+ var He = "Неизвестная ошибка";
437
+ function O(e) {
438
+ return t(e) ? d(e) : He;
436
439
  }
437
- function D(e) {
440
+ function Ue(e) {
438
441
  let t = e.status ?? e.statusCode ?? e.httpStatus;
439
442
  return typeof t == "number" && Number.isFinite(t) ? t : void 0;
440
443
  }
441
- function Ge(e) {
444
+ function We(e) {
442
445
  if (!e || typeof e != "object") return null;
443
446
  let n = e.appError;
444
447
  if (!n || typeof n != "object") return null;
@@ -447,40 +450,40 @@ function Ge(e) {
447
450
  name: "AppError",
448
451
  message: d(i),
449
452
  code: t(r.code) ? d(String(r.code), 128) : void 0,
450
- httpStatus: D(r)
453
+ httpStatus: Ue(r)
451
454
  } : null;
452
455
  }
453
- function O(e) {
454
- let t = Ge(e);
456
+ function k(e) {
457
+ let t = We(e);
455
458
  if (t) return t;
456
459
  if (e instanceof Error) return {
457
460
  name: d(e.name || "Error", 256),
458
- message: E(e.message),
459
- stackTrace: e.stack ? p(e.stack, S) : void 0
461
+ message: O(e.message),
462
+ stackTrace: e.stack ? p(e.stack, w) : void 0
460
463
  };
461
464
  if (e && typeof e == "object") {
462
465
  let t = e;
463
466
  return {
464
467
  name: d(typeof t.name == "string" ? t.name : "Error", 256),
465
- message: E(typeof t.message == "string" ? t.message : String(e)),
466
- stackTrace: typeof t.stack == "string" ? p(t.stack, S) : void 0,
467
- httpStatus: D(t)
468
+ message: O(typeof t.message == "string" ? t.message : String(e)),
469
+ stackTrace: typeof t.stack == "string" ? p(t.stack, w) : void 0,
470
+ httpStatus: Ue(t)
468
471
  };
469
472
  }
470
473
  return {
471
474
  name: "Error",
472
- message: E(typeof e == "string" ? e : String(e ?? We))
475
+ message: O(typeof e == "string" ? e : String(e ?? He))
473
476
  };
474
477
  }
475
478
  //#endregion
476
479
  //#region src/error-report/diagnostics.ts
477
- function Ke(e, t, n) {
480
+ function Ge(e, t, n) {
478
481
  return _(e, {
479
482
  scope: t,
480
483
  source: n
481
484
  });
482
485
  }
483
- function k(e) {
486
+ function A(e) {
484
487
  let t = g(e.queryKey, { scope: "query-key" }) ?? { type: "redacted" }, i = r(n(t));
485
488
  return {
486
489
  queryHash: i,
@@ -492,31 +495,31 @@ function k(e) {
492
495
  failureCount: e.state.fetchFailureCount,
493
496
  isInvalidated: e.state.isInvalidated,
494
497
  observersCount: e.getObserversCount(),
495
- meta: Ke(e.meta, "query-meta", i),
498
+ meta: Ge(e.meta, "query-meta", i),
496
499
  dataShape: g(h(e.state.data), {
497
500
  scope: "query-data-shape",
498
501
  source: i
499
502
  }),
500
- error: e.state.error ? O(e.state.error) : void 0
503
+ error: e.state.error ? k(e.state.error) : void 0
501
504
  };
502
505
  }
503
- function A(e) {
506
+ function j(e) {
504
507
  return {
505
508
  mutationKey: e.options.mutationKey ? g(e.options.mutationKey, { scope: "mutation-key" }) : void 0,
506
509
  status: e.state.status,
507
510
  failureCount: e.state.failureCount,
508
511
  submittedAt: e.state.submittedAt,
509
- meta: Ke(e.meta, "mutation-meta"),
510
- error: e.state.error ? O(e.state.error) : void 0
512
+ meta: Ge(e.meta, "mutation-meta"),
513
+ error: e.state.error ? k(e.state.error) : void 0
511
514
  };
512
515
  }
513
- function j(e) {
516
+ function M(e) {
514
517
  return {
515
- queries: e.getQueryCache().getAll().slice(-40).map(k),
516
- mutations: e.getMutationCache().getAll().slice(-40).map(A)
518
+ queries: e.getQueryCache().getAll().slice(-40).map(A),
519
+ mutations: e.getMutationCache().getAll().slice(-40).map(j)
517
520
  };
518
521
  }
519
- function qe(e) {
522
+ function Ke(e) {
520
523
  let t = e.state, i = g(e.queryKey, { scope: "persisted-query-key" }), a = i ? r(n(i)) : void 0;
521
524
  return {
522
525
  buster: e.buster ? d(e.buster, 512) : void 0,
@@ -527,31 +530,31 @@ function qe(e) {
527
530
  dataUpdatedAt: t.dataUpdatedAt,
528
531
  errorUpdatedAt: t.errorUpdatedAt,
529
532
  failureCount: t.fetchFailureCount,
530
- error: t.error ? O(t.error) : void 0
533
+ error: t.error ? k(t.error) : void 0
531
534
  };
532
535
  }
533
- async function M() {
536
+ async function N() {
534
537
  let e = o();
535
538
  if (!e?.entries) return [];
536
539
  try {
537
- return (await e.entries()).slice(-40).map(([, e]) => qe(e));
540
+ return (await e.entries()).slice(-40).map(([, e]) => Ke(e));
538
541
  } catch {
539
542
  return [];
540
543
  }
541
544
  }
542
545
  //#endregion
543
546
  //#region src/error-report/environment.ts
544
- function Je(e = {}) {
547
+ function qe(e = {}) {
545
548
  let t = e.isDev ?? __DEV__;
546
549
  return typeof window < "u" && !t;
547
550
  }
548
- function Ye() {
551
+ function Je() {
549
552
  return {
550
553
  mode: __DEV__ ? "development" : "production",
551
554
  buildId: typeof __APP_BUILD_ID__ == "string" ? __APP_BUILD_ID__ : void 0
552
555
  };
553
556
  }
554
- function Xe() {
557
+ function Ye() {
555
558
  if (!(typeof window > "u")) return {
556
559
  userAgent: window.navigator.userAgent,
557
560
  language: window.navigator.language,
@@ -560,20 +563,20 @@ function Xe() {
560
563
  }
561
564
  //#endregion
562
565
  //#region src/error-report/schema.ts
563
- var N = c.lazy(() => c.union([
566
+ var P = c.lazy(() => c.union([
564
567
  c.string().max(4096),
565
568
  c.number().finite(),
566
569
  c.boolean(),
567
570
  c.null(),
568
- c.array(N).max(20),
569
- c.record(c.string(), N).refine((e) => Object.keys(e).length <= 40)
570
- ])), P = c.record(c.string(), N).refine((e) => Object.keys(e).length <= 40), F = c.object({
571
+ c.array(P).max(20),
572
+ c.record(c.string(), P).refine((e) => Object.keys(e).length <= 40)
573
+ ])), F = c.record(c.string(), P).refine((e) => Object.keys(e).length <= 40), I = c.object({
571
574
  name: c.string().min(1).max(256),
572
575
  message: c.string().min(1).max(4096),
573
576
  code: c.string().max(128).optional(),
574
577
  stackTrace: c.string().refine((e) => f(e) <= 65536).optional(),
575
578
  httpStatus: c.number().finite().optional()
576
- }).strict(), Ze = c.object({
579
+ }).strict(), Xe = c.object({
577
580
  utc: c.string().min(1).max(64),
578
581
  type: c.enum([
579
582
  "route",
@@ -587,10 +590,10 @@ var N = c.lazy(() => c.union([
587
590
  appId: c.string().max(128).optional(),
588
591
  viewId: c.string().max(128).optional(),
589
592
  target: c.string().max(2048).optional(),
590
- detail: P.optional()
591
- }).strict(), Qe = c.object({
593
+ detail: F.optional()
594
+ }).strict(), Ze = c.object({
592
595
  queryHash: c.string().max(512),
593
- queryKey: N,
596
+ queryKey: P,
594
597
  status: c.string().max(64).optional(),
595
598
  fetchStatus: c.string().max(64).optional(),
596
599
  dataUpdatedAt: c.number().finite().optional(),
@@ -598,27 +601,27 @@ var N = c.lazy(() => c.union([
598
601
  failureCount: c.number().finite().optional(),
599
602
  isInvalidated: c.boolean().optional(),
600
603
  observersCount: c.number().finite().optional(),
601
- meta: P.optional(),
602
- dataShape: N.optional(),
603
- error: F.optional()
604
- }).strict(), $e = c.object({
605
- mutationKey: N.optional(),
604
+ meta: F.optional(),
605
+ dataShape: P.optional(),
606
+ error: I.optional()
607
+ }).strict(), Qe = c.object({
608
+ mutationKey: P.optional(),
606
609
  status: c.string().max(64).optional(),
607
610
  failureCount: c.number().finite().optional(),
608
611
  submittedAt: c.number().finite().optional(),
609
- meta: P.optional(),
610
- error: F.optional()
611
- }).strict(), et = c.object({
612
+ meta: F.optional(),
613
+ error: I.optional()
614
+ }).strict(), $e = c.object({
612
615
  buster: c.string().max(512).optional(),
613
616
  queryHash: c.string().max(512).optional(),
614
- queryKey: N.optional(),
617
+ queryKey: P.optional(),
615
618
  status: c.string().max(64).optional(),
616
619
  fetchStatus: c.string().max(64).optional(),
617
620
  dataUpdatedAt: c.number().finite().optional(),
618
621
  errorUpdatedAt: c.number().finite().optional(),
619
622
  failureCount: c.number().finite().optional(),
620
- error: F.optional()
621
- }).strict(), tt = c.object({
623
+ error: I.optional()
624
+ }).strict(), et = c.object({
622
625
  payloadVersion: c.literal(1),
623
626
  application: c.string().min(1).max(128),
624
627
  reportId: c.string().uuid(),
@@ -631,7 +634,7 @@ var N = c.lazy(() => c.union([
631
634
  "react"
632
635
  ]),
633
636
  source: c.string().min(1).max(256),
634
- error: F,
637
+ error: I,
635
638
  environment: c.object({
636
639
  mode: c.enum(["development", "production"]),
637
640
  buildId: c.string().max(128).optional()
@@ -651,22 +654,22 @@ var N = c.lazy(() => c.union([
651
654
  devicePixelRatio: c.number().finite().optional()
652
655
  }).strict().optional(),
653
656
  react: c.object({ componentStack: c.string().refine((e) => f(e) <= 32768).optional() }).strict().optional(),
654
- query: Qe.optional(),
655
- mutation: $e.optional(),
657
+ query: Ze.optional(),
658
+ mutation: Qe.optional(),
656
659
  queryClient: c.object({
657
- queries: c.array(Qe).max(40),
658
- mutations: c.array($e).max(40)
660
+ queries: c.array(Ze).max(40),
661
+ mutations: c.array(Qe).max(40)
659
662
  }).strict().optional(),
660
- persistedQueries: c.array(et).max(40).optional(),
661
- breadcrumbs: c.array(Ze).max(80),
662
- context: P.optional(),
663
+ persistedQueries: c.array($e).max(40).optional(),
664
+ breadcrumbs: c.array(Xe).max(80),
665
+ context: F.optional(),
663
666
  truncation: c.object({
664
667
  reason: c.literal("payload-size"),
665
- limitBytes: c.literal(x),
668
+ limitBytes: c.literal(C),
666
669
  originalBytes: c.number().int().positive(),
667
670
  droppedSections: c.array(c.string().max(128)).max(32)
668
671
  }).strict().optional()
669
- }).strict().refine((e) => T(e) <= x), nt = c.object({
672
+ }).strict().refine((e) => D(e) <= C), tt = c.object({
670
673
  reportId: c.string().uuid(),
671
674
  sessionId: c.string().uuid(),
672
675
  createdUtc: c.string().min(1).max(64),
@@ -684,14 +687,14 @@ var N = c.lazy(() => c.union([
684
687
  ]),
685
688
  sentUtc: c.string().min(1).max(64).optional(),
686
689
  failedReason: c.string().max(4096).optional(),
687
- payload: tt
690
+ payload: et
688
691
  }).strict().superRefine((e, t) => {
689
692
  (e.reportId !== e.payload.reportId || e.sessionId !== e.payload.sessionId || e.createdUtc !== e.payload.createdUtc || e.category !== e.payload.category) && t.addIssue({
690
693
  code: "custom",
691
694
  message: "Draft identity должна совпадать с payload identity."
692
695
  });
693
696
  });
694
- function I(e, t) {
697
+ function nt(e, t) {
695
698
  try {
696
699
  return new TextEncoder().encode(JSON.stringify(e)).byteLength <= t;
697
700
  } catch {
@@ -699,16 +702,16 @@ function I(e, t) {
699
702
  }
700
703
  }
701
704
  function L(e) {
702
- if (I(e, 262144)) try {
703
- let t = tt.safeParse(e);
705
+ if (nt(e, 262144)) try {
706
+ let t = et.safeParse(e);
704
707
  return t.success ? t.data : void 0;
705
708
  } catch {
706
709
  return;
707
710
  }
708
711
  }
709
712
  function R(e) {
710
- if (I(e, 278528)) try {
711
- let t = nt.safeParse(e);
713
+ if (nt(e, 278528)) try {
714
+ let t = tt.safeParse(e);
712
715
  return t.success ? t.data : void 0;
713
716
  } catch {
714
717
  return;
@@ -779,8 +782,8 @@ function mt() {
779
782
  return z;
780
783
  }
781
784
  function B(e) {
782
- if (!Je()) return;
783
- let t = i(), n = s(at), r = ot(), a = Ue({
785
+ if (!qe()) return;
786
+ let t = i(), n = s(at), r = ot(), a = Ve({
784
787
  payloadVersion: 1,
785
788
  application: __APP_ID__,
786
789
  reportId: t,
@@ -789,8 +792,8 @@ function B(e) {
789
792
  category: e.category,
790
793
  source: d(e.source, 256),
791
794
  error: e.error,
792
- environment: Ye(),
793
- client: Xe(),
795
+ environment: Je(),
796
+ client: Ye(),
794
797
  location: lt(),
795
798
  viewport: ut(),
796
799
  react: e.react,
@@ -911,12 +914,12 @@ async function Nt(e, t, n, r) {
911
914
  source: i
912
915
  })
913
916
  });
914
- let [a, o] = await Promise.all([M(), Promise.resolve(j(n))]);
917
+ let [a, o] = await Promise.all([N(), Promise.resolve(M(n))]);
915
918
  return B({
916
919
  category: "query",
917
920
  source: i,
918
- error: r?.errorInfo ?? O(e),
919
- query: k(t),
921
+ error: r?.errorInfo ?? k(e),
922
+ query: A(t),
920
923
  queryClient: o,
921
924
  persistedQueries: a,
922
925
  context: _(r?.detail, {
@@ -938,12 +941,12 @@ async function Pt(e, t, n, r = {}) {
938
941
  source: i
939
942
  })
940
943
  });
941
- let [a, o] = await Promise.all([M(), Promise.resolve(j(n))]);
944
+ let [a, o] = await Promise.all([N(), Promise.resolve(M(n))]);
942
945
  return B({
943
946
  category: "mutation",
944
947
  source: i,
945
- error: r.errorInfo ?? O(e),
946
- mutation: A(t),
948
+ error: r.errorInfo ?? k(e),
949
+ mutation: j(t),
947
950
  queryClient: o,
948
951
  persistedQueries: a,
949
952
  context: _(r.detail, {
@@ -953,7 +956,7 @@ async function Pt(e, t, n, r = {}) {
953
956
  });
954
957
  }
955
958
  function Ft(e, t = {}, n) {
956
- let r = t.category ?? "runtime", i = t.source ?? t.category ?? "runtime", a = t.errorInfo ?? O(e), o = _(t.detail, {
959
+ let r = t.category ?? "runtime", i = t.source ?? t.category ?? "runtime", a = t.errorInfo ?? k(e), o = _(t.detail, {
957
960
  scope: "context",
958
961
  source: i
959
962
  }), s = async () => {
@@ -968,7 +971,7 @@ function Ft(e, t = {}, n) {
968
971
  source: i
969
972
  })
970
973
  });
971
- let [e, s] = n ? await Promise.all([M(), Promise.resolve(j(n))]) : [void 0, void 0];
974
+ let [e, s] = n ? await Promise.all([N(), Promise.resolve(M(n))]) : [void 0, void 0];
972
975
  return B({
973
976
  category: r,
974
977
  source: i,
@@ -1233,6 +1236,6 @@ async function Yt(e, t = {}) {
1233
1236
  } catch {}
1234
1237
  }
1235
1238
  //#endregion
1236
- export { x as ERROR_REPORT_PAYLOAD_MAX_BYTES, Me as ERROR_REPORT_PAYLOAD_VERSION, zt as ERROR_REPORT_QUEUE_LEASE_MS, Lt as ERROR_REPORT_QUEUE_MAX_ITEMS, Rt as ERROR_REPORT_QUEUE_TTL_MS, It as ERROR_REPORT_QUEUE_VERSION, S as ERROR_REPORT_STACK_TRACE_MAX_BYTES, y as addErrorReportBreadcrumb, B as captureErrorReportDraft, Pt as captureMutationErrorReport, Nt as captureQueryErrorReport, Ft as captureRuntimeErrorReport, ye as clearErrorReportBreadcrumbs, A as collectMutationDiagnostics, M as collectPersistedQueryDiagnostics, j as collectQueryClientDiagnostics, k as collectQueryDiagnostics, h as createDataShape, de as createDiagnosticValue, O as createErrorInfo, qt as createErrorReportQueue, ve as getErrorReportBreadcrumbs, Xe as getErrorReportClientEnvironment, ft as getErrorReportDraft, mt as getErrorReportDrafts, Ye as getErrorReportEnvironment, T as getErrorReportPayloadSize, f as getUtf8TextSize, je as installErrorReportBrowserBreadcrumbs, Je as isErrorReportingEnabled, jt as isTransportErrorReportScheduled, Ue as limitErrorReportPayload, J as normalizeErrorReportQueueRecords, R as parseErrorReportDraft, rt as parseErrorReportDrafts, L as parseErrorReportPayload, Wt as parseErrorReportQueueRecord, Yt as reportRuntimeError, Mt as reportTransportError, _ as sanitizeDetail, d as sanitizeDiagnosticText, p as sanitizeDiagnosticTextBytes, g as sanitizeErrorReportValue, Jt as setErrorReportRuntimeErrorReporter, fe as setErrorReportSanitizer, At as setErrorReportTransportErrorReporter, G as suppressTransportErrorReport, pt as updateErrorReportDraft };
1239
+ export { C as ERROR_REPORT_PAYLOAD_MAX_BYTES, Ae as ERROR_REPORT_PAYLOAD_VERSION, zt as ERROR_REPORT_QUEUE_LEASE_MS, Lt as ERROR_REPORT_QUEUE_MAX_ITEMS, Rt as ERROR_REPORT_QUEUE_TTL_MS, It as ERROR_REPORT_QUEUE_VERSION, w as ERROR_REPORT_STACK_TRACE_MAX_BYTES, y as addErrorReportBreadcrumb, B as captureErrorReportDraft, Pt as captureMutationErrorReport, Nt as captureQueryErrorReport, Ft as captureRuntimeErrorReport, ye as clearErrorReportBreadcrumbs, j as collectMutationDiagnostics, N as collectPersistedQueryDiagnostics, M as collectQueryClientDiagnostics, A as collectQueryDiagnostics, h as createDataShape, de as createDiagnosticValue, k as createErrorInfo, qt as createErrorReportQueue, ve as getErrorReportBreadcrumbs, Ye as getErrorReportClientEnvironment, ft as getErrorReportDraft, mt as getErrorReportDrafts, Je as getErrorReportEnvironment, D as getErrorReportPayloadSize, f as getUtf8TextSize, ke as installErrorReportBrowserBreadcrumbs, qe as isErrorReportingEnabled, jt as isTransportErrorReportScheduled, Ve as limitErrorReportPayload, J as normalizeErrorReportQueueRecords, R as parseErrorReportDraft, rt as parseErrorReportDrafts, L as parseErrorReportPayload, Wt as parseErrorReportQueueRecord, Yt as reportRuntimeError, Mt as reportTransportError, _ as sanitizeDetail, d as sanitizeDiagnosticText, p as sanitizeDiagnosticTextBytes, g as sanitizeErrorReportValue, Jt as setErrorReportRuntimeErrorReporter, fe as setErrorReportSanitizer, At as setErrorReportTransportErrorReporter, G as suppressTransportErrorReport, pt as updateErrorReportDraft };
1237
1240
 
1238
1241
  //# sourceMappingURL=index.js.map