@fragmentsx/fragments-client 0.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.
Files changed (46) hide show
  1. package/README.md +45 -0
  2. package/dist/$area/index.d.ts +69 -0
  3. package/dist/$area/index.d.ts.map +1 -0
  4. package/dist/$area/index.test.d.ts +12 -0
  5. package/dist/$area/index.test.d.ts.map +1 -0
  6. package/dist/$cssChunks/index.d.ts +27 -0
  7. package/dist/$cssChunks/index.d.ts.map +1 -0
  8. package/dist/$cssChunks/index.test.d.ts +2 -0
  9. package/dist/$cssChunks/index.test.d.ts.map +1 -0
  10. package/dist/$fragments/index.d.ts +113 -0
  11. package/dist/$fragments/index.d.ts.map +1 -0
  12. package/dist/$fragments/index.test.d.ts +7 -0
  13. package/dist/$fragments/index.test.d.ts.map +1 -0
  14. package/dist/createFragmentsClient.d.ts +36 -0
  15. package/dist/createFragmentsClient.d.ts.map +1 -0
  16. package/dist/createFragmentsClient.test.d.ts +13 -0
  17. package/dist/createFragmentsClient.test.d.ts.map +1 -0
  18. package/dist/errors/index.d.ts +38 -0
  19. package/dist/errors/index.d.ts.map +1 -0
  20. package/dist/errors/index.test.d.ts +2 -0
  21. package/dist/errors/index.test.d.ts.map +1 -0
  22. package/dist/fetch/__tests__/beacon.test.d.ts +16 -0
  23. package/dist/fetch/__tests__/beacon.test.d.ts.map +1 -0
  24. package/dist/fetch/beacon.d.ts +22 -0
  25. package/dist/fetch/beacon.d.ts.map +1 -0
  26. package/dist/fetch/index.d.ts +3 -0
  27. package/dist/fetch/index.d.ts.map +1 -0
  28. package/dist/fetch/restFetcher.d.ts +48 -0
  29. package/dist/fetch/restFetcher.d.ts.map +1 -0
  30. package/dist/index.cjs.js +1 -0
  31. package/dist/index.d.ts +20 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.es.js +1767 -0
  34. package/dist/metrics/__tests__/globalMetrics.test.d.ts +16 -0
  35. package/dist/metrics/__tests__/globalMetrics.test.d.ts.map +1 -0
  36. package/dist/metrics/globalMetrics.d.ts +18 -0
  37. package/dist/metrics/globalMetrics.d.ts.map +1 -0
  38. package/dist/metrics/trackAdPixel.d.ts +31 -0
  39. package/dist/metrics/trackAdPixel.d.ts.map +1 -0
  40. package/dist/types.d.ts +109 -0
  41. package/dist/types.d.ts.map +1 -0
  42. package/dist/utils/createConstants.d.ts +10 -0
  43. package/dist/utils/createConstants.d.ts.map +1 -0
  44. package/dist/utils/isBrowser.d.ts +11 -0
  45. package/dist/utils/isBrowser.d.ts.map +1 -0
  46. package/package.json +46 -0
@@ -0,0 +1,1767 @@
1
+ import { createState as Je } from "@graph-state/core";
2
+ import { allowTypes as Ke } from "@graph-state/checkers";
3
+ class W extends Error {
4
+ constructor(r, t, a, u) {
5
+ super(t), this.code = r, this.details = a, this.status = u, this.name = "FragmentsAreaError", Object.setPrototypeOf(this, W.prototype);
6
+ }
7
+ }
8
+ class be extends Error {
9
+ constructor(r, t) {
10
+ super(
11
+ `Manifest apiVersion mismatch: expected ${r}, received ${t}`
12
+ ), this.expected = r, this.received = t, this.name = "FragmentsApiVersionError", Object.setPrototypeOf(this, be.prototype);
13
+ }
14
+ }
15
+ class q extends Error {
16
+ constructor(r, t, a) {
17
+ super(`Failed to load fragment ${r} from ${t}`), this.fragmentId = r, this.moduleUrl = t, this.cause = a, this.name = "FragmentsLoadError", Object.setPrototypeOf(this, q.prototype);
18
+ }
19
+ }
20
+ const j = (...e) => e.reduce((r, t) => (r[t] = t, r), {}), C = j(
21
+ "Fragment",
22
+ "FragmentInstance",
23
+ "Instance",
24
+ "Collection",
25
+ "ArrayItem",
26
+ "Breakpoint",
27
+ "Frame",
28
+ "Image",
29
+ "Text",
30
+ "SolidPaintStyle",
31
+ "CssLink",
32
+ "Variable",
33
+ "ComputedValue",
34
+ "TransformValue",
35
+ "StopColor",
36
+ "LinearGradient",
37
+ "CssChunk",
38
+ "Border",
39
+ "Paint",
40
+ "Link",
41
+ "Interaction",
42
+ "Classname",
43
+ "GoalEvent",
44
+ "MutateEvent",
45
+ "TextHighlight",
46
+ "TextStyleMark",
47
+ "ImagePaint"
48
+ ), H = j("auto", "fill"), re = j("None", "Solid", "Dashed", "Dotted"), Ue = j("_blank", "none"), ne = j(
49
+ "None",
50
+ "Solid",
51
+ "LinearGradient",
52
+ "RadialGradient",
53
+ "ConicGradient",
54
+ "Image"
55
+ ), ae = j("Auto", "Contain", "Cover"), Ye = j(
56
+ "Min",
57
+ "Center",
58
+ "Max",
59
+ "Stretch",
60
+ "Scale"
61
+ ), le = j("absolute", "relative"), D = j("Fixed", "Hug", "Fill", "Relative"), ie = j("none", "flex"), se = j("vertical", "horizontal"), oe = j("start", "center", "end"), ce = j(
62
+ "start",
63
+ "center",
64
+ "end",
65
+ "space-between",
66
+ "space-around"
67
+ ), Ee = j(
68
+ "none",
69
+ "uppercase",
70
+ "lowercase",
71
+ "capitalize"
72
+ ), X = j(
73
+ "none",
74
+ "underline",
75
+ "line-through"
76
+ ), Qe = j("loop", "appear", "hover", "tap"), Ze = j(
77
+ "fade",
78
+ "slide",
79
+ "bounce",
80
+ "wiggle",
81
+ "increase"
82
+ ), g = j(
83
+ "Event",
84
+ "String",
85
+ "Link",
86
+ "Boolean",
87
+ "Array",
88
+ "Color",
89
+ "ComponentInstance",
90
+ "Date",
91
+ "Enum",
92
+ "Number",
93
+ "Image",
94
+ "Object",
95
+ "Goal"
96
+ ), ue = j(
97
+ "normal",
98
+ "nowrap",
99
+ "pre",
100
+ "pre-wrap",
101
+ "pre-line",
102
+ "break-spaces"
103
+ ), fe = j("visible", "hidden", "scroll"), et = j(
104
+ "convert",
105
+ "exists",
106
+ "equals",
107
+ "startWith",
108
+ "endWith",
109
+ "contains",
110
+ "dateBefore",
111
+ "dateAfter",
112
+ "dateBetween",
113
+ "feature",
114
+ "notFeature",
115
+ "gt",
116
+ // Greater than
117
+ "gte",
118
+ // Greater than or equals
119
+ "lt",
120
+ // Less than
121
+ "lte",
122
+ // Less than or equals,
123
+ "convertFromBoolean",
124
+ "negative"
125
+ ), tt = j("canvas", "document"), rt = j("viewport", "parent", "fixed"), Oe = j("click", "mouseover", "appear"), pe = j(
126
+ "goal",
127
+ "mutate",
128
+ "callback",
129
+ "tracker"
130
+ ), nt = j(
131
+ "AreaScope",
132
+ "InstanceScope",
133
+ "FragmentScope",
134
+ "CollectionScope",
135
+ "CollectionItemScope"
136
+ ), at = j("Global", "Fragment"), Ce = 3, lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
137
+ __proto__: null,
138
+ MAX_SCHEMA_DEPTH: Ce,
139
+ borderType: re,
140
+ constrain: Ye,
141
+ createConstants: j,
142
+ cssChunkScopeTypes: at,
143
+ effectName: Ze,
144
+ effectType: Qe,
145
+ eventMode: pe,
146
+ fragmentGrowingMode: H,
147
+ imagePaintScaleModes: ae,
148
+ interactions: Oe,
149
+ layerAlign: oe,
150
+ layerDirection: se,
151
+ layerDistribute: ce,
152
+ layerMode: ie,
153
+ linkTarget: Ue,
154
+ nodes: C,
155
+ overflow: fe,
156
+ paintMode: ne,
157
+ positionType: le,
158
+ renderMode: rt,
159
+ renderTarget: tt,
160
+ scopeTypes: nt,
161
+ sizing: D,
162
+ textDecorations: X,
163
+ textTransform: Ee,
164
+ variableTransforms: et,
165
+ variableType: g,
166
+ whiteSpace: ue
167
+ }, Symbol.toStringTag, { value: "Module" }));
168
+ // @__NO_SIDE_EFFECTS__
169
+ function it(e) {
170
+ return {
171
+ lang: (e == null ? void 0 : e.lang) ?? void 0,
172
+ message: e == null ? void 0 : e.message,
173
+ abortEarly: (e == null ? void 0 : e.abortEarly) ?? void 0,
174
+ abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? void 0
175
+ };
176
+ }
177
+ // @__NO_SIDE_EFFECTS__
178
+ function st(e, r) {
179
+ var t;
180
+ return (t = void 0) == null ? void 0 : t.get(r);
181
+ }
182
+ // @__NO_SIDE_EFFECTS__
183
+ function L(e) {
184
+ var r, t;
185
+ const a = typeof e;
186
+ return a === "string" ? `"${e}"` : a === "number" || a === "bigint" || a === "boolean" ? `${e}` : a === "object" || a === "function" ? (e && ((t = (r = Object.getPrototypeOf(e)) == null ? void 0 : r.constructor) == null ? void 0 : t.name)) ?? "null" : a;
187
+ }
188
+ function w(e, r, t, a, u) {
189
+ const c = u && "input" in u ? u.input : t.value, o = (u == null ? void 0 : u.expected) ?? e.expects ?? null, i = (u == null ? void 0 : u.received) ?? /* @__PURE__ */ L(c), f = {
190
+ kind: e.kind,
191
+ type: e.type,
192
+ input: c,
193
+ expected: o,
194
+ received: i,
195
+ message: `Invalid ${r}: ${o ? `Expected ${o} but r` : "R"}eceived ${i}`,
196
+ requirement: e.requirement,
197
+ path: u == null ? void 0 : u.path,
198
+ issues: u == null ? void 0 : u.issues,
199
+ lang: a.lang,
200
+ abortEarly: a.abortEarly,
201
+ abortPipeEarly: a.abortPipeEarly
202
+ }, m = e.kind === "schema", p = (u == null ? void 0 : u.message) ?? e.message ?? /* @__PURE__ */ st(e.reference, f.lang) ?? (m ? (f.lang, void 0) : null) ?? a.message ?? (f.lang, void 0);
203
+ p !== void 0 && (f.message = typeof p == "function" ? (
204
+ // @ts-expect-error
205
+ p(f)
206
+ ) : p), m && (t.typed = !1), t.issues ? t.issues.push(f) : t.issues = [f];
207
+ }
208
+ // @__NO_SIDE_EFFECTS__
209
+ function I(e) {
210
+ return {
211
+ version: 1,
212
+ vendor: "valibot",
213
+ validate(r) {
214
+ return e["~run"]({ value: r }, /* @__PURE__ */ it());
215
+ }
216
+ };
217
+ }
218
+ // @__NO_SIDE_EFFECTS__
219
+ function Te(e, r) {
220
+ return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
221
+ }
222
+ // @__NO_SIDE_EFFECTS__
223
+ function J(e, r) {
224
+ const t = [...new Set(e)];
225
+ return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
226
+ }
227
+ // @__NO_SIDE_EFFECTS__
228
+ function we(e, r) {
229
+ return {
230
+ kind: "validation",
231
+ type: "check",
232
+ reference: we,
233
+ async: !1,
234
+ expects: null,
235
+ requirement: e,
236
+ message: r,
237
+ "~run"(t, a) {
238
+ return t.typed && !this.requirement(t.value) && w(this, "input", t, a), t;
239
+ }
240
+ };
241
+ }
242
+ // @__NO_SIDE_EFFECTS__
243
+ function he(e, r) {
244
+ return {
245
+ kind: "validation",
246
+ type: "max_value",
247
+ reference: he,
248
+ async: !1,
249
+ expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ L(e)}`,
250
+ requirement: e,
251
+ message: r,
252
+ "~run"(t, a) {
253
+ return t.typed && !(t.value <= this.requirement) && w(this, "value", t, a, {
254
+ received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ L(t.value)
255
+ }), t;
256
+ }
257
+ };
258
+ }
259
+ // @__NO_SIDE_EFFECTS__
260
+ function Ie(e) {
261
+ return {
262
+ kind: "metadata",
263
+ type: "metadata",
264
+ reference: Ie,
265
+ metadata: e
266
+ };
267
+ }
268
+ // @__NO_SIDE_EFFECTS__
269
+ function B(e, r) {
270
+ return {
271
+ kind: "validation",
272
+ type: "min_value",
273
+ reference: B,
274
+ async: !1,
275
+ expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ L(e)}`,
276
+ requirement: e,
277
+ message: r,
278
+ "~run"(t, a) {
279
+ return t.typed && !(t.value >= this.requirement) && w(this, "value", t, a, {
280
+ received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ L(t.value)
281
+ }), t;
282
+ }
283
+ };
284
+ }
285
+ // @__NO_SIDE_EFFECTS__
286
+ function Pe(e) {
287
+ return {
288
+ kind: "transformation",
289
+ type: "transform",
290
+ reference: Pe,
291
+ async: !1,
292
+ operation: e,
293
+ "~run"(r) {
294
+ return r.value = this.operation(r.value), r;
295
+ }
296
+ };
297
+ }
298
+ // @__NO_SIDE_EFFECTS__
299
+ function Ae(e, r, t) {
300
+ return typeof e.fallback == "function" ? (
301
+ // @ts-expect-error
302
+ e.fallback(r, t)
303
+ ) : (
304
+ // @ts-expect-error
305
+ e.fallback
306
+ );
307
+ }
308
+ // @__NO_SIDE_EFFECTS__
309
+ function K(e, r, t) {
310
+ return typeof e.default == "function" ? (
311
+ // @ts-expect-error
312
+ e.default(r, t)
313
+ ) : (
314
+ // @ts-expect-error
315
+ e.default
316
+ );
317
+ }
318
+ // @__NO_SIDE_EFFECTS__
319
+ function ye() {
320
+ return {
321
+ kind: "schema",
322
+ type: "any",
323
+ reference: ye,
324
+ expects: "any",
325
+ async: !1,
326
+ get "~standard"() {
327
+ return /* @__PURE__ */ I(this);
328
+ },
329
+ "~run"(e) {
330
+ return e.typed = !0, e;
331
+ }
332
+ };
333
+ }
334
+ // @__NO_SIDE_EFFECTS__
335
+ function M(e, r) {
336
+ return {
337
+ kind: "schema",
338
+ type: "array",
339
+ reference: M,
340
+ expects: "Array",
341
+ async: !1,
342
+ item: e,
343
+ message: r,
344
+ get "~standard"() {
345
+ return /* @__PURE__ */ I(this);
346
+ },
347
+ "~run"(t, a) {
348
+ var u;
349
+ const c = t.value;
350
+ if (Array.isArray(c)) {
351
+ t.typed = !0, t.value = [];
352
+ for (let o = 0; o < c.length; o++) {
353
+ const i = c[o], f = this.item["~run"]({ value: i }, a);
354
+ if (f.issues) {
355
+ const m = {
356
+ type: "array",
357
+ origin: "value",
358
+ input: c,
359
+ key: o,
360
+ value: i
361
+ };
362
+ for (const p of f.issues)
363
+ p.path ? p.path.unshift(m) : p.path = [m], (u = t.issues) == null || u.push(p);
364
+ if (t.issues || (t.issues = f.issues), a.abortEarly) {
365
+ t.typed = !1;
366
+ break;
367
+ }
368
+ }
369
+ f.typed || (t.typed = !1), t.value.push(f.value);
370
+ }
371
+ } else
372
+ w(this, "type", t, a);
373
+ return t;
374
+ }
375
+ };
376
+ }
377
+ // @__NO_SIDE_EFFECTS__
378
+ function v(e) {
379
+ return {
380
+ kind: "schema",
381
+ type: "boolean",
382
+ reference: v,
383
+ expects: "boolean",
384
+ async: !1,
385
+ message: e,
386
+ get "~standard"() {
387
+ return /* @__PURE__ */ I(this);
388
+ },
389
+ "~run"(r, t) {
390
+ return typeof r.value == "boolean" ? r.typed = !0 : w(this, "type", r, t), r;
391
+ }
392
+ };
393
+ }
394
+ // @__NO_SIDE_EFFECTS__
395
+ function R(e, r) {
396
+ const t = [];
397
+ for (const a in e)
398
+ (`${+a}` !== a || typeof e[a] != "string" || !Object.is(e[e[a]], +a)) && t.push(e[a]);
399
+ return {
400
+ kind: "schema",
401
+ type: "enum",
402
+ reference: R,
403
+ expects: /* @__PURE__ */ J(t.map(L), "|"),
404
+ async: !1,
405
+ enum: e,
406
+ options: t,
407
+ message: r,
408
+ get "~standard"() {
409
+ return /* @__PURE__ */ I(this);
410
+ },
411
+ "~run"(a, u) {
412
+ return this.options.includes(a.value) ? a.typed = !0 : w(this, "type", a, u), a;
413
+ }
414
+ };
415
+ }
416
+ // @__NO_SIDE_EFFECTS__
417
+ function U(e) {
418
+ return {
419
+ kind: "schema",
420
+ type: "lazy",
421
+ reference: U,
422
+ expects: "unknown",
423
+ async: !1,
424
+ getter: e,
425
+ get "~standard"() {
426
+ return /* @__PURE__ */ I(this);
427
+ },
428
+ "~run"(r, t) {
429
+ return this.getter(r.value)["~run"](r, t);
430
+ }
431
+ };
432
+ }
433
+ // @__NO_SIDE_EFFECTS__
434
+ function P(e, r) {
435
+ return {
436
+ kind: "schema",
437
+ type: "literal",
438
+ reference: P,
439
+ expects: /* @__PURE__ */ L(e),
440
+ async: !1,
441
+ literal: e,
442
+ message: r,
443
+ get "~standard"() {
444
+ return /* @__PURE__ */ I(this);
445
+ },
446
+ "~run"(t, a) {
447
+ return t.value === this.literal ? t.typed = !0 : w(this, "type", t, a), t;
448
+ }
449
+ };
450
+ }
451
+ // @__NO_SIDE_EFFECTS__
452
+ function de(e, r) {
453
+ return {
454
+ kind: "schema",
455
+ type: "loose_object",
456
+ reference: de,
457
+ expects: "Object",
458
+ async: !1,
459
+ entries: e,
460
+ message: r,
461
+ get "~standard"() {
462
+ return /* @__PURE__ */ I(this);
463
+ },
464
+ "~run"(t, a) {
465
+ var u;
466
+ const c = t.value;
467
+ if (c && typeof c == "object") {
468
+ t.typed = !0, t.value = {};
469
+ for (const o in this.entries) {
470
+ const i = this.entries[o];
471
+ if (o in c || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && // @ts-expect-error
472
+ i.default !== void 0) {
473
+ const f = o in c ? (
474
+ // @ts-expect-error
475
+ c[o]
476
+ ) : /* @__PURE__ */ K(i), m = i["~run"]({ value: f }, a);
477
+ if (m.issues) {
478
+ const p = {
479
+ type: "object",
480
+ origin: "value",
481
+ input: c,
482
+ key: o,
483
+ value: f
484
+ };
485
+ for (const b of m.issues)
486
+ b.path ? b.path.unshift(p) : b.path = [p], (u = t.issues) == null || u.push(b);
487
+ if (t.issues || (t.issues = m.issues), a.abortEarly) {
488
+ t.typed = !1;
489
+ break;
490
+ }
491
+ }
492
+ m.typed || (t.typed = !1), t.value[o] = m.value;
493
+ } else if (i.fallback !== void 0)
494
+ t.value[o] = /* @__PURE__ */ Ae(i);
495
+ else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (w(this, "key", t, a, {
496
+ input: void 0,
497
+ expected: `"${o}"`,
498
+ path: [
499
+ {
500
+ type: "object",
501
+ origin: "key",
502
+ input: c,
503
+ key: o,
504
+ // @ts-expect-error
505
+ value: c[o]
506
+ }
507
+ ]
508
+ }), a.abortEarly))
509
+ break;
510
+ }
511
+ if (!t.issues || !a.abortEarly)
512
+ for (const o in c)
513
+ /* @__PURE__ */ Te(c, o) && !(o in this.entries) && (t.value[o] = c[o]);
514
+ } else
515
+ w(this, "type", t, a);
516
+ return t;
517
+ }
518
+ };
519
+ }
520
+ // @__NO_SIDE_EFFECTS__
521
+ function Fe(e) {
522
+ return {
523
+ kind: "schema",
524
+ type: "never",
525
+ reference: Fe,
526
+ expects: "never",
527
+ async: !1,
528
+ message: e,
529
+ get "~standard"() {
530
+ return /* @__PURE__ */ I(this);
531
+ },
532
+ "~run"(r, t) {
533
+ return w(this, "type", r, t), r;
534
+ }
535
+ };
536
+ }
537
+ // @__NO_SIDE_EFFECTS__
538
+ function S(e, r) {
539
+ return {
540
+ kind: "schema",
541
+ type: "nullable",
542
+ reference: S,
543
+ expects: `(${e.expects} | null)`,
544
+ async: !1,
545
+ wrapped: e,
546
+ default: r,
547
+ get "~standard"() {
548
+ return /* @__PURE__ */ I(this);
549
+ },
550
+ "~run"(t, a) {
551
+ return t.value === null && (this.default !== void 0 && (t.value = /* @__PURE__ */ K(this, t, a)), t.value === null) ? (t.typed = !0, t) : this.wrapped["~run"](t, a);
552
+ }
553
+ };
554
+ }
555
+ // @__NO_SIDE_EFFECTS__
556
+ function y(e) {
557
+ return {
558
+ kind: "schema",
559
+ type: "number",
560
+ reference: y,
561
+ expects: "number",
562
+ async: !1,
563
+ message: e,
564
+ get "~standard"() {
565
+ return /* @__PURE__ */ I(this);
566
+ },
567
+ "~run"(r, t) {
568
+ return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : w(this, "type", r, t), r;
569
+ }
570
+ };
571
+ }
572
+ // @__NO_SIDE_EFFECTS__
573
+ function h(e, r) {
574
+ return {
575
+ kind: "schema",
576
+ type: "object",
577
+ reference: h,
578
+ expects: "Object",
579
+ async: !1,
580
+ entries: e,
581
+ message: r,
582
+ get "~standard"() {
583
+ return /* @__PURE__ */ I(this);
584
+ },
585
+ "~run"(t, a) {
586
+ var u;
587
+ const c = t.value;
588
+ if (c && typeof c == "object") {
589
+ t.typed = !0, t.value = {};
590
+ for (const o in this.entries) {
591
+ const i = this.entries[o];
592
+ if (o in c || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && // @ts-expect-error
593
+ i.default !== void 0) {
594
+ const f = o in c ? (
595
+ // @ts-expect-error
596
+ c[o]
597
+ ) : /* @__PURE__ */ K(i), m = i["~run"]({ value: f }, a);
598
+ if (m.issues) {
599
+ const p = {
600
+ type: "object",
601
+ origin: "value",
602
+ input: c,
603
+ key: o,
604
+ value: f
605
+ };
606
+ for (const b of m.issues)
607
+ b.path ? b.path.unshift(p) : b.path = [p], (u = t.issues) == null || u.push(b);
608
+ if (t.issues || (t.issues = m.issues), a.abortEarly) {
609
+ t.typed = !1;
610
+ break;
611
+ }
612
+ }
613
+ m.typed || (t.typed = !1), t.value[o] = m.value;
614
+ } else if (i.fallback !== void 0)
615
+ t.value[o] = /* @__PURE__ */ Ae(i);
616
+ else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (w(this, "key", t, a, {
617
+ input: void 0,
618
+ expected: `"${o}"`,
619
+ path: [
620
+ {
621
+ type: "object",
622
+ origin: "key",
623
+ input: c,
624
+ key: o,
625
+ // @ts-expect-error
626
+ value: c[o]
627
+ }
628
+ ]
629
+ }), a.abortEarly))
630
+ break;
631
+ }
632
+ } else
633
+ w(this, "type", t, a);
634
+ return t;
635
+ }
636
+ };
637
+ }
638
+ // @__NO_SIDE_EFFECTS__
639
+ function s(e, r) {
640
+ return {
641
+ kind: "schema",
642
+ type: "optional",
643
+ reference: s,
644
+ expects: `(${e.expects} | undefined)`,
645
+ async: !1,
646
+ wrapped: e,
647
+ default: r,
648
+ get "~standard"() {
649
+ return /* @__PURE__ */ I(this);
650
+ },
651
+ "~run"(t, a) {
652
+ return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ K(this, t, a)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, a);
653
+ }
654
+ };
655
+ }
656
+ // @__NO_SIDE_EFFECTS__
657
+ function T(e, r) {
658
+ return {
659
+ kind: "schema",
660
+ type: "picklist",
661
+ reference: T,
662
+ expects: /* @__PURE__ */ J(e.map(L), "|"),
663
+ async: !1,
664
+ options: e,
665
+ message: r,
666
+ get "~standard"() {
667
+ return /* @__PURE__ */ I(this);
668
+ },
669
+ "~run"(t, a) {
670
+ return this.options.includes(t.value) ? t.typed = !0 : w(this, "type", t, a), t;
671
+ }
672
+ };
673
+ }
674
+ // @__NO_SIDE_EFFECTS__
675
+ function z(e, r, t) {
676
+ return {
677
+ kind: "schema",
678
+ type: "record",
679
+ reference: z,
680
+ expects: "Object",
681
+ async: !1,
682
+ key: e,
683
+ value: r,
684
+ message: t,
685
+ get "~standard"() {
686
+ return /* @__PURE__ */ I(this);
687
+ },
688
+ "~run"(a, u) {
689
+ var c, o;
690
+ const i = a.value;
691
+ if (i && typeof i == "object") {
692
+ a.typed = !0, a.value = {};
693
+ for (const f in i)
694
+ if (/* @__PURE__ */ Te(i, f)) {
695
+ const m = i[f], p = this.key["~run"]({ value: f }, u);
696
+ if (p.issues) {
697
+ const d = {
698
+ type: "object",
699
+ origin: "key",
700
+ input: i,
701
+ key: f,
702
+ value: m
703
+ };
704
+ for (const k of p.issues)
705
+ k.path = [d], (c = a.issues) == null || c.push(k);
706
+ if (a.issues || (a.issues = p.issues), u.abortEarly) {
707
+ a.typed = !1;
708
+ break;
709
+ }
710
+ }
711
+ const b = this.value["~run"](
712
+ { value: m },
713
+ u
714
+ );
715
+ if (b.issues) {
716
+ const d = {
717
+ type: "object",
718
+ origin: "value",
719
+ input: i,
720
+ key: f,
721
+ value: m
722
+ };
723
+ for (const k of b.issues)
724
+ k.path ? k.path.unshift(d) : k.path = [d], (o = a.issues) == null || o.push(k);
725
+ if (a.issues || (a.issues = b.issues), u.abortEarly) {
726
+ a.typed = !1;
727
+ break;
728
+ }
729
+ }
730
+ (!p.typed || !b.typed) && (a.typed = !1), p.typed && (a.value[p.value] = b.value);
731
+ }
732
+ } else
733
+ w(this, "type", a, u);
734
+ return a;
735
+ }
736
+ };
737
+ }
738
+ // @__NO_SIDE_EFFECTS__
739
+ function l(e) {
740
+ return {
741
+ kind: "schema",
742
+ type: "string",
743
+ reference: l,
744
+ expects: "string",
745
+ async: !1,
746
+ message: e,
747
+ get "~standard"() {
748
+ return /* @__PURE__ */ I(this);
749
+ },
750
+ "~run"(r, t) {
751
+ return typeof r.value == "string" ? r.typed = !0 : w(this, "type", r, t), r;
752
+ }
753
+ };
754
+ }
755
+ // @__NO_SIDE_EFFECTS__
756
+ function Se(e) {
757
+ let r;
758
+ if (e)
759
+ for (const t of e)
760
+ r ? r.push(...t.issues) : r = t.issues;
761
+ return r;
762
+ }
763
+ // @__NO_SIDE_EFFECTS__
764
+ function $(e, r) {
765
+ return {
766
+ kind: "schema",
767
+ type: "union",
768
+ reference: $,
769
+ expects: /* @__PURE__ */ J(
770
+ e.map((t) => t.expects),
771
+ "|"
772
+ ),
773
+ async: !1,
774
+ options: e,
775
+ message: r,
776
+ get "~standard"() {
777
+ return /* @__PURE__ */ I(this);
778
+ },
779
+ "~run"(t, a) {
780
+ let u, c, o;
781
+ for (const i of this.options) {
782
+ const f = i["~run"]({ value: t.value }, a);
783
+ if (f.typed)
784
+ if (f.issues)
785
+ c ? c.push(f) : c = [f];
786
+ else {
787
+ u = f;
788
+ break;
789
+ }
790
+ else
791
+ o ? o.push(f) : o = [f];
792
+ }
793
+ if (u)
794
+ return u;
795
+ if (c) {
796
+ if (c.length === 1)
797
+ return c[0];
798
+ w(this, "type", t, a, {
799
+ issues: /* @__PURE__ */ Se(c)
800
+ }), t.typed = !0;
801
+ } else {
802
+ if ((o == null ? void 0 : o.length) === 1)
803
+ return o[0];
804
+ w(this, "type", t, a, {
805
+ issues: /* @__PURE__ */ Se(o)
806
+ });
807
+ }
808
+ return t;
809
+ }
810
+ };
811
+ }
812
+ // @__NO_SIDE_EFFECTS__
813
+ function Y() {
814
+ return {
815
+ kind: "schema",
816
+ type: "unknown",
817
+ reference: Y,
818
+ expects: "unknown",
819
+ async: !1,
820
+ get "~standard"() {
821
+ return /* @__PURE__ */ I(this);
822
+ },
823
+ "~run"(e) {
824
+ return e.typed = !0, e;
825
+ }
826
+ };
827
+ }
828
+ // @__NO_SIDE_EFFECTS__
829
+ function Me(e, r, t) {
830
+ return {
831
+ kind: "schema",
832
+ type: "variant",
833
+ reference: Me,
834
+ expects: "Object",
835
+ async: !1,
836
+ key: e,
837
+ options: r,
838
+ message: t,
839
+ get "~standard"() {
840
+ return /* @__PURE__ */ I(this);
841
+ },
842
+ "~run"(a, u) {
843
+ const c = a.value;
844
+ if (c && typeof c == "object") {
845
+ let o, i = 0, f = this.key, m = [];
846
+ const p = (b, d) => {
847
+ for (const k of b.options) {
848
+ if (k.type === "variant")
849
+ p(k, new Set(d).add(k.key));
850
+ else {
851
+ let E = !0, F = 0;
852
+ for (const x of d) {
853
+ const G = k.entries[x];
854
+ if (x in c ? G["~run"](
855
+ // @ts-expect-error
856
+ { typed: !1, value: c[x] },
857
+ u
858
+ ).issues : G.type !== "exact_optional" && G.type !== "optional" && G.type !== "nullish") {
859
+ E = !1, f !== x && (i < F || i === F && x in c && !(f in c)) && (i = F, f = x, m = []), f === x && m.push(
860
+ k.entries[x].expects
861
+ );
862
+ break;
863
+ }
864
+ F++;
865
+ }
866
+ if (E) {
867
+ const x = k["~run"]({ value: c }, u);
868
+ (!o || !o.typed && x.typed) && (o = x);
869
+ }
870
+ }
871
+ if (o && !o.issues)
872
+ break;
873
+ }
874
+ };
875
+ if (p(this, /* @__PURE__ */ new Set([this.key])), o)
876
+ return o;
877
+ w(this, "type", a, u, {
878
+ // @ts-expect-error
879
+ input: c[f],
880
+ expected: /* @__PURE__ */ J(m, "|"),
881
+ path: [
882
+ {
883
+ type: "object",
884
+ origin: "value",
885
+ input: c,
886
+ key: f,
887
+ // @ts-expect-error
888
+ value: c[f]
889
+ }
890
+ ]
891
+ });
892
+ } else
893
+ w(this, "type", a, u);
894
+ return a;
895
+ }
896
+ };
897
+ }
898
+ // @__NO_SIDE_EFFECTS__
899
+ function _(...e) {
900
+ return {
901
+ ...e[0],
902
+ pipe: e,
903
+ get "~standard"() {
904
+ return /* @__PURE__ */ I(this);
905
+ },
906
+ "~run"(r, t) {
907
+ for (const a of e)
908
+ if (a.kind !== "metadata") {
909
+ if (r.issues && (a.kind === "schema" || a.kind === "transformation")) {
910
+ r.typed = !1;
911
+ break;
912
+ }
913
+ (!r.issues || !t.abortEarly && !t.abortPipeEarly) && (r = a["~run"](r, t));
914
+ }
915
+ return r;
916
+ }
917
+ };
918
+ }
919
+ const _e = /* @__PURE__ */ we((e) => e.split(":").length === 2), me = (e) => {
920
+ const r = (t) => typeof t == "number" ? `${t}px` : t;
921
+ return n(/* @__PURE__ */ $([/* @__PURE__ */ y(), /* @__PURE__ */ l()]), {
922
+ ...e,
923
+ fallback: e == null ? void 0 : e.fallback,
924
+ transform: r
925
+ });
926
+ }, O = /* @__PURE__ */ _(/* @__PURE__ */ l(), _e), n = (e, r) => {
927
+ const t = (r == null ? void 0 : r.overridable) ?? !0, a = (r == null ? void 0 : r.variable) ?? !1, u = [e];
928
+ return a && u.push(/* @__PURE__ */ _(/* @__PURE__ */ l(), _e)), t && u.push(/* @__PURE__ */ ye()), /* @__PURE__ */ _(
929
+ /* @__PURE__ */ s(/* @__PURE__ */ $(u)),
930
+ /* @__PURE__ */ Pe((r == null ? void 0 : r.transform) ?? ((c) => c)),
931
+ /* @__PURE__ */ Ie(r ?? {})
932
+ );
933
+ }, ve = /* @__PURE__ */ h({
934
+ children: n(/* @__PURE__ */ M(/* @__PURE__ */ l()), {
935
+ fallback: [],
936
+ overridable: !1
937
+ })
938
+ }), A = /* @__PURE__ */ h({
939
+ _id: /* @__PURE__ */ $([/* @__PURE__ */ l(), /* @__PURE__ */ y()]),
940
+ _type: /* @__PURE__ */ T(Object.keys(C))
941
+ }), V = /* @__PURE__ */ h({
942
+ overrides: n(/* @__PURE__ */ M(/* @__PURE__ */ l()), { overridable: !1 }),
943
+ overrideFrom: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 })
944
+ }), Q = /* @__PURE__ */ h({
945
+ position: n(/* @__PURE__ */ R(Object.keys(le)), {
946
+ fallback: le.absolute
947
+ }),
948
+ top: n(/* @__PURE__ */ S(/* @__PURE__ */ y()), {
949
+ fallback: null,
950
+ transform: (e) => typeof e == "number" ? Math.ceil(e) : e
951
+ }),
952
+ left: n(/* @__PURE__ */ S(/* @__PURE__ */ y()), {
953
+ fallback: null,
954
+ transform: (e) => typeof e == "number" ? Math.ceil(e) : e
955
+ }),
956
+ right: n(/* @__PURE__ */ S(/* @__PURE__ */ y()), {
957
+ fallback: null,
958
+ transform: (e) => typeof e == "number" ? Math.ceil(e) : e
959
+ }),
960
+ bottom: n(/* @__PURE__ */ S(/* @__PURE__ */ y()), {
961
+ fallback: null,
962
+ transform: (e) => typeof e == "number" ? Math.ceil(e) : e
963
+ }),
964
+ centerAnchorX: n(/* @__PURE__ */ y(), {
965
+ fallback: 0.5
966
+ }),
967
+ centerAnchorY: n(/* @__PURE__ */ y(), {
968
+ fallback: 0.5
969
+ })
970
+ }), Z = /* @__PURE__ */ h({
971
+ opacity: n(/* @__PURE__ */ _(/* @__PURE__ */ y(), /* @__PURE__ */ B(0), /* @__PURE__ */ he(1)), {
972
+ fallback: 1,
973
+ variable: !0
974
+ }),
975
+ visible: n(/* @__PURE__ */ v(), { fallback: !0, variable: !0 }),
976
+ rotate: n(/* @__PURE__ */ y(), { fallback: null }),
977
+ zIndex: n(/* @__PURE__ */ y(), { fallback: null }),
978
+ classnames: n(/* @__PURE__ */ M(O), { fallback: [] })
979
+ }), ee = /* @__PURE__ */ h({
980
+ widthType: n(/* @__PURE__ */ T(Object.keys(D)), {
981
+ fallback: D.Fixed
982
+ }),
983
+ heightType: n(/* @__PURE__ */ T(Object.keys(D)), {
984
+ fallback: D.Fixed
985
+ }),
986
+ width: n(/* @__PURE__ */ _(/* @__PURE__ */ y(), /* @__PURE__ */ B(0)), {
987
+ fallback: 0,
988
+ transform: Math.ceil
989
+ }),
990
+ height: n(/* @__PURE__ */ _(/* @__PURE__ */ y(), /* @__PURE__ */ B(0)), {
991
+ fallback: 0,
992
+ transform: Math.ceil
993
+ }),
994
+ aspectRatio: n(/* @__PURE__ */ y(), { fallback: -1 }),
995
+ minWidth: n(/* @__PURE__ */ S(/* @__PURE__ */ _(/* @__PURE__ */ y(), /* @__PURE__ */ B(-1))), {
996
+ fallback: -1,
997
+ transform: Math.ceil
998
+ }),
999
+ minWidthType: n(/* @__PURE__ */ T(Object.keys(D)), {
1000
+ fallback: D.Fixed
1001
+ }),
1002
+ maxWidth: n(/* @__PURE__ */ S(/* @__PURE__ */ _(/* @__PURE__ */ y(), /* @__PURE__ */ B(-1))), {
1003
+ fallback: -1,
1004
+ transform: Math.ceil
1005
+ }),
1006
+ maxWidthType: n(/* @__PURE__ */ T(Object.keys(D)), {
1007
+ fallback: D.Fixed
1008
+ }),
1009
+ minHeight: n(/* @__PURE__ */ S(/* @__PURE__ */ _(/* @__PURE__ */ y(), /* @__PURE__ */ B(-1))), {
1010
+ fallback: -1,
1011
+ transform: Math.ceil
1012
+ }),
1013
+ minHeightType: n(/* @__PURE__ */ T(Object.keys(D)), {
1014
+ fallback: D.Fixed
1015
+ }),
1016
+ maxHeight: n(/* @__PURE__ */ S(/* @__PURE__ */ _(/* @__PURE__ */ y(), /* @__PURE__ */ B(-1))), {
1017
+ fallback: -1,
1018
+ transform: Math.ceil
1019
+ }),
1020
+ maxHeightType: n(/* @__PURE__ */ T(Object.keys(D)), {
1021
+ fallback: D.Fixed
1022
+ })
1023
+ }), $e = /* @__PURE__ */ h({
1024
+ layerMode: n(/* @__PURE__ */ T(Object.keys(ie)), {
1025
+ fallback: ie.none
1026
+ }),
1027
+ layerAlign: n(/* @__PURE__ */ T(Object.keys(oe)), {
1028
+ fallback: oe.start
1029
+ }),
1030
+ layerDirection: n(/* @__PURE__ */ T(Object.keys(se)), {
1031
+ fallback: se.horizontal
1032
+ }),
1033
+ layerDistribute: n(/* @__PURE__ */ T(Object.keys(ce)), {
1034
+ fallback: ce.start
1035
+ }),
1036
+ layerWrap: n(/* @__PURE__ */ v(), { fallback: !1 }),
1037
+ layerGap: n(/* @__PURE__ */ _(/* @__PURE__ */ y(), /* @__PURE__ */ B(0)), { fallback: 0 }),
1038
+ // px-хелпер: число → "Npx", строка-шорткат дословно; был голый v.string() без transform
1039
+ padding: me({ fallback: "0px" })
1040
+ }), ot = n(/* @__PURE__ */ T(Object.keys(fe)), {
1041
+ fallback: fe.hidden
1042
+ }), ct = me({ fallback: "0px" }), te = /* @__PURE__ */ h({
1043
+ interactions: n(/* @__PURE__ */ M(O), { fallback: [] })
1044
+ }), ke = /* @__PURE__ */ h({
1045
+ cssOverride: n(/* @__PURE__ */ l(), { fallback: "" })
1046
+ }), ut = /* @__PURE__ */ _(
1047
+ /* @__PURE__ */ h({
1048
+ name: n(/* @__PURE__ */ l(), { fallback: "Frame", overridable: !1 }),
1049
+ isBreakpoint: n(/* @__PURE__ */ v(), {
1050
+ fallback: !1,
1051
+ overridable: !1
1052
+ }),
1053
+ isPrimary: n(/* @__PURE__ */ v(), { fallback: !1, overridable: !1 }),
1054
+ border: n(O),
1055
+ paint: n(O),
1056
+ link: n(O),
1057
+ ...ve.entries,
1058
+ ...A.entries,
1059
+ ...V.entries,
1060
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1061
+ ...Q.entries,
1062
+ ...Z.entries,
1063
+ ...ee.entries,
1064
+ ...$e.entries,
1065
+ ...te.entries,
1066
+ ...ke.entries,
1067
+ overflow: ot,
1068
+ borderRadius: ct
1069
+ })
1070
+ ), ft = /* @__PURE__ */ h({
1071
+ type: /* @__PURE__ */ P("text"),
1072
+ text: /* @__PURE__ */ l(),
1073
+ marks: /* @__PURE__ */ s(/* @__PURE__ */ M(/* @__PURE__ */ h({ rangeKey: /* @__PURE__ */ l() })))
1074
+ }), pt = /* @__PURE__ */ h({
1075
+ type: /* @__PURE__ */ P("mention"),
1076
+ ref: /* @__PURE__ */ l(),
1077
+ fallback: /* @__PURE__ */ s(/* @__PURE__ */ l())
1078
+ }), bt = /* @__PURE__ */ h({
1079
+ type: /* @__PURE__ */ P("hardBreak")
1080
+ }), ht = /* @__PURE__ */ $([
1081
+ ft,
1082
+ pt,
1083
+ bt
1084
+ ]), yt = /* @__PURE__ */ h({
1085
+ type: /* @__PURE__ */ P("paragraph"),
1086
+ content: /* @__PURE__ */ M(ht)
1087
+ }), dt = /* @__PURE__ */ h({
1088
+ type: /* @__PURE__ */ P("doc"),
1089
+ content: /* @__PURE__ */ M(yt)
1090
+ }), mt = /* @__PURE__ */ h({
1091
+ name: n(/* @__PURE__ */ l(), { fallback: "Text", overridable: !1 }),
1092
+ content: n(/* @__PURE__ */ l(), {
1093
+ fallback: ""
1094
+ }),
1095
+ doc: n(dt, { fallback: { type: "doc", content: [] } }),
1096
+ styleRanges: n(/* @__PURE__ */ M(O), { fallback: [] }),
1097
+ whiteSpace: n(/* @__PURE__ */ R(Object.keys(ue)), {
1098
+ fallback: ue.pre
1099
+ }),
1100
+ textAlign: n(/* @__PURE__ */ l(), { fallback: "left" }),
1101
+ // baseTypography — дефолт всего текста-узла (D-06), все поля variable:true
1102
+ fontSize: n(/* @__PURE__ */ y(), { fallback: null, variable: !0 }),
1103
+ fontWeight: n(/* @__PURE__ */ $([/* @__PURE__ */ l(), /* @__PURE__ */ y()]), { fallback: null, variable: !0 }),
1104
+ fontFamily: n(/* @__PURE__ */ l(), { fallback: null, variable: !0 }),
1105
+ color: n(/* @__PURE__ */ l(), { fallback: null, variable: !0 }),
1106
+ lineHeight: n(/* @__PURE__ */ y(), { fallback: null, variable: !0 }),
1107
+ letterSpacing: n(/* @__PURE__ */ y(), { fallback: null, variable: !0 }),
1108
+ textDecoration: n(/* @__PURE__ */ T(Object.keys(X)), { fallback: null }),
1109
+ textTransform: n(/* @__PURE__ */ T(Object.keys(Ee)), { fallback: null }),
1110
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1111
+ link: n(O),
1112
+ highlight: n(O),
1113
+ contentBinding: n(O),
1114
+ ...A.entries,
1115
+ ...V.entries,
1116
+ ...ke.entries,
1117
+ ...Q.entries,
1118
+ ...Z.entries,
1119
+ ...ee.entries,
1120
+ ...te.entries
1121
+ }), vt = /* @__PURE__ */ h({
1122
+ name: n(/* @__PURE__ */ l(), { fallback: "Fragment", overridable: !1 }),
1123
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1124
+ horizontalGrow: n(/* @__PURE__ */ R(Object.keys(H)), {
1125
+ fallback: H.fill,
1126
+ overridable: !1
1127
+ }),
1128
+ verticalGrow: n(/* @__PURE__ */ R(Object.keys(H)), {
1129
+ fallback: H.auto,
1130
+ overridable: !1
1131
+ }),
1132
+ properties: n(/* @__PURE__ */ M(/* @__PURE__ */ l()), {
1133
+ fallback: [],
1134
+ overridable: !1
1135
+ }),
1136
+ /**
1137
+ * propsObject — ссылка на единственный ObjectVariable = публичный интерфейс фрагмента (D-A1/PO1).
1138
+ * Хранит linkValidator-ключ ObjectVariable ('Variable:id') или null если props-объект не назначен.
1139
+ * Геттер fragment.props читает это поле и возвращает хэндл ObjectVariable.
1140
+ * Назначение через Fragment.definePropsObject() (план 01, D-A1).
1141
+ */
1142
+ propsObject: n(/* @__PURE__ */ S(O), {
1143
+ fallback: null,
1144
+ overridable: !1
1145
+ }),
1146
+ cssChunks: n(/* @__PURE__ */ M(O), {
1147
+ fallback: [],
1148
+ overridable: !1
1149
+ }),
1150
+ ...A.entries,
1151
+ ...ve.entries
1152
+ }), kt = /* @__PURE__ */ h({
1153
+ name: n(/* @__PURE__ */ l(), { fallback: "Instance", overridable: !1 }),
1154
+ fragment: n(/* @__PURE__ */ y()),
1155
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1156
+ /**
1157
+ * props — единый объектный биндинг (D-B1), резолвится один раз в контексте владельца.
1158
+ *
1159
+ * Принимает два варианта:
1160
+ * - linkValidator-строка ('Variable:id'): биндинг на ObjectVariable из контекста владельца (A).
1161
+ * Граничный резолв (план 02) раскроет эту ссылку в plain-объект, раскладывая значения
1162
+ * по именам полей props-объекта ребёнка (name-matching, D-B2).
1163
+ * - Inline-объект значений: ключи = имена полей props-объекта ребёнка (B), НЕ Variable:id.
1164
+ * Публичная адресация PO2/PO4 — name-matching на границе выполняется в плане 02.
1165
+ *
1166
+ * fallback: {} — нет props = пустой объект (props-объект B не получает внешних значений).
1167
+ */
1168
+ props: n(
1169
+ /* @__PURE__ */ $([
1170
+ O,
1171
+ /* @__PURE__ */ z(
1172
+ /* @__PURE__ */ l(),
1173
+ /* @__PURE__ */ $([
1174
+ /* @__PURE__ */ l(),
1175
+ /* @__PURE__ */ y(),
1176
+ /* @__PURE__ */ v(),
1177
+ // Для goals-значений (code+name объект)
1178
+ /* @__PURE__ */ h({
1179
+ code: /* @__PURE__ */ l(),
1180
+ name: /* @__PURE__ */ l()
1181
+ })
1182
+ ])
1183
+ )
1184
+ ]),
1185
+ {
1186
+ fallback: {}
1187
+ }
1188
+ ),
1189
+ link: n(O),
1190
+ ...A.entries,
1191
+ ...V.entries,
1192
+ ...Q.entries,
1193
+ ...ee.entries,
1194
+ ...Z.entries,
1195
+ ...te.entries
1196
+ }), gt = /* @__PURE__ */ _(
1197
+ /* @__PURE__ */ h({
1198
+ name: n(/* @__PURE__ */ l(), {
1199
+ fallback: "Collection",
1200
+ overridable: !1
1201
+ }),
1202
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1203
+ source: n(O, {}),
1204
+ border: n(O),
1205
+ paint: n(O),
1206
+ link: n(O),
1207
+ ...ve.entries,
1208
+ ...A.entries,
1209
+ ...V.entries,
1210
+ ...Q.entries,
1211
+ ...Z.entries,
1212
+ ...ee.entries,
1213
+ ...$e.entries,
1214
+ ...te.entries,
1215
+ ...ke.entries
1216
+ })
1217
+ ), St = /* @__PURE__ */ h({
1218
+ ...V.entries,
1219
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1220
+ position: n(/* @__PURE__ */ _(/* @__PURE__ */ y(), /* @__PURE__ */ he(1), /* @__PURE__ */ B(0)), {
1221
+ fallback: 0
1222
+ }),
1223
+ value: n(/* @__PURE__ */ l(), { fallback: "#000", variable: !0 }),
1224
+ ...A.entries
1225
+ }), xt = /* @__PURE__ */ h({
1226
+ ...V.entries,
1227
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1228
+ angle: n(/* @__PURE__ */ y(), {
1229
+ fallback: 0
1230
+ }),
1231
+ stops: n(/* @__PURE__ */ M(O), { fallback: [] }),
1232
+ ...A.entries
1233
+ }), jt = /* @__PURE__ */ h({
1234
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1235
+ chunkId: n(/* @__PURE__ */ y()),
1236
+ // content: layerField(v.string(), {
1237
+ // fallback: "",
1238
+ // }),
1239
+ // scope: layerField(v.picklist(Object.keys(definition.cssChunkScopeTypes)), {
1240
+ // fallback: definition.cssChunkScopeTypes.Fragment,
1241
+ // }),
1242
+ enabled: n(/* @__PURE__ */ v(), {
1243
+ fallback: !0,
1244
+ variable: !0
1245
+ }),
1246
+ ...A.entries
1247
+ }), Et = /* @__PURE__ */ h({
1248
+ ...V.entries,
1249
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1250
+ type: n(/* @__PURE__ */ T(Object.keys(re)), {
1251
+ fallback: re.None
1252
+ }),
1253
+ // px-хелпер: число → "Npx", строка дословно; ad-hoc inline-transform удалён
1254
+ width: me({ fallback: "1px" }),
1255
+ paint: n(O),
1256
+ ...A.entries
1257
+ }), Ot = /* @__PURE__ */ h({
1258
+ ...V.entries,
1259
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1260
+ type: n(/* @__PURE__ */ T(Object.keys(ne)), {
1261
+ fallback: ne.None
1262
+ }),
1263
+ solid: n(/* @__PURE__ */ l(), { fallback: "#fff" }),
1264
+ linearGradient: n(O),
1265
+ image: n(O),
1266
+ ...A.entries
1267
+ }), Ct = /* @__PURE__ */ h({
1268
+ ...A.entries,
1269
+ ...V.entries,
1270
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1271
+ src: n(/* @__PURE__ */ l()),
1272
+ scale: n(/* @__PURE__ */ T(Object.keys(ae)), {
1273
+ fallback: ae.Auto
1274
+ })
1275
+ }), Tt = /* @__PURE__ */ h({
1276
+ ...V.entries,
1277
+ ...A.entries,
1278
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1279
+ href: n(/* @__PURE__ */ l(), { fallback: null }),
1280
+ isNewTab: n(/* @__PURE__ */ v(), {
1281
+ fallback: !0
1282
+ })
1283
+ }), wt = /* @__PURE__ */ h({
1284
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1285
+ ...A.entries,
1286
+ on: /* @__PURE__ */ R(Object.keys(Oe)),
1287
+ event: n(O)
1288
+ }), It = /* @__PURE__ */ h({
1289
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1290
+ value: n(/* @__PURE__ */ l(), { fallback: "" }),
1291
+ enabled: n(/* @__PURE__ */ v(), {
1292
+ fallback: !0,
1293
+ variable: !0
1294
+ }),
1295
+ ...A.entries
1296
+ }), Pt = /* @__PURE__ */ h({
1297
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1298
+ goalId: n(/* @__PURE__ */ y(), { overridable: !1 }),
1299
+ ...A.entries
1300
+ }), At = /* @__PURE__ */ h({
1301
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1302
+ target: n(O),
1303
+ value: n(/* @__PURE__ */ ye()),
1304
+ ...A.entries
1305
+ }), Ft = /* @__PURE__ */ h({
1306
+ color: n(/* @__PURE__ */ l(), { fallback: null }),
1307
+ lineHeight: n(/* @__PURE__ */ y(), { fallback: null }),
1308
+ fontSize: n(/* @__PURE__ */ y(), { fallback: null }),
1309
+ fontWeight: n(/* @__PURE__ */ $([/* @__PURE__ */ l(), /* @__PURE__ */ y()]), { fallback: 400 }),
1310
+ fontFamily: n(/* @__PURE__ */ l(), { fallback: null }),
1311
+ textDecoration: n(/* @__PURE__ */ T(Object.keys(X)), {
1312
+ fallback: null
1313
+ }),
1314
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1315
+ ...A.entries
1316
+ }), Mt = /* @__PURE__ */ h({
1317
+ ...V.entries,
1318
+ parent: n(/* @__PURE__ */ S(/* @__PURE__ */ l()), { overridable: !1 }),
1319
+ color: n(/* @__PURE__ */ l(), { fallback: null, variable: !0 }),
1320
+ fontSize: n(/* @__PURE__ */ y(), { fallback: null, variable: !0 }),
1321
+ fontWeight: n(/* @__PURE__ */ $([/* @__PURE__ */ l(), /* @__PURE__ */ y()]), { fallback: 400, variable: !0 }),
1322
+ fontFamily: n(/* @__PURE__ */ l(), { fallback: null, variable: !0 }),
1323
+ lineHeight: n(/* @__PURE__ */ y(), { fallback: null, variable: !0 }),
1324
+ letterSpacing: n(/* @__PURE__ */ y(), { fallback: null, variable: !0 }),
1325
+ textDecoration: n(/* @__PURE__ */ T(Object.keys(X)), { fallback: null, variable: !0 }),
1326
+ ...A.entries
1327
+ }), De = /* @__PURE__ */ h({
1328
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "Number"),
1329
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Number), g.Number),
1330
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ y(), 0),
1331
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1332
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0),
1333
+ min: /* @__PURE__ */ s(/* @__PURE__ */ y(), 1),
1334
+ max: /* @__PURE__ */ s(/* @__PURE__ */ y(), 100),
1335
+ step: /* @__PURE__ */ s(/* @__PURE__ */ y(), 1),
1336
+ displayStepper: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0)
1337
+ }), Ve = /* @__PURE__ */ h({
1338
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "Boolean"),
1339
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Boolean), g.Boolean),
1340
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1341
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1342
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0)
1343
+ }), Ge = /* @__PURE__ */ h({
1344
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "String"),
1345
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.String), g.String),
1346
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ l(), ""),
1347
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1348
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0),
1349
+ placeholder: /* @__PURE__ */ s(/* @__PURE__ */ l(), ""),
1350
+ isTextarea: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1351
+ isRich: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1)
1352
+ }), Be = /* @__PURE__ */ h({
1353
+ // Прежний fallback именно "String" — перенесён дословно (D-71-01), не исправлен.
1354
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "String"),
1355
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Color), g.Color),
1356
+ // TODO Add color validator
1357
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ l(), "#000"),
1358
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1359
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0)
1360
+ }), _t = /* @__PURE__ */ h({
1361
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "Event"),
1362
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Event), g.Event),
1363
+ mode: /* @__PURE__ */ s(/* @__PURE__ */ T(Object.keys(pe)), pe.callback),
1364
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ Y(), null),
1365
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1366
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0)
1367
+ }), Ne = /* @__PURE__ */ h({
1368
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "Link"),
1369
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Link), g.Link),
1370
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ l(), ""),
1371
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1372
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0)
1373
+ }), Le = /* @__PURE__ */ h({
1374
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "Option"),
1375
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Enum), g.Enum),
1376
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ l(), ""),
1377
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1378
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0),
1379
+ cases: /* @__PURE__ */ s(
1380
+ /* @__PURE__ */ M(
1381
+ /* @__PURE__ */ h({
1382
+ id: /* @__PURE__ */ l(),
1383
+ name: /* @__PURE__ */ l()
1384
+ })
1385
+ ),
1386
+ []
1387
+ )
1388
+ }), Re = /* @__PURE__ */ h({
1389
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "Image"),
1390
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Image), g.Image),
1391
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ S(/* @__PURE__ */ l()), null),
1392
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1393
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0)
1394
+ });
1395
+ function He(e) {
1396
+ return /* @__PURE__ */ h({
1397
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "Object"),
1398
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Object), g.Object),
1399
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ z(/* @__PURE__ */ l(), /* @__PURE__ */ Y()), {}),
1400
+ fields: /* @__PURE__ */ s(
1401
+ /* @__PURE__ */ z(/* @__PURE__ */ l(), /* @__PURE__ */ U(() => qe(e + 1))),
1402
+ {}
1403
+ ),
1404
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1405
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0)
1406
+ });
1407
+ }
1408
+ function We(e) {
1409
+ return /* @__PURE__ */ h({
1410
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "Collection"),
1411
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Array), g.Array),
1412
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ M(/* @__PURE__ */ Y()), []),
1413
+ definition: /* @__PURE__ */ s(
1414
+ /* @__PURE__ */ S(/* @__PURE__ */ U(() => qe(e + 1))),
1415
+ null
1416
+ ),
1417
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1418
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0)
1419
+ });
1420
+ }
1421
+ function qe(e) {
1422
+ return e > Ce ? /* @__PURE__ */ Fe() : /* @__PURE__ */ Me("type", [
1423
+ Ge,
1424
+ De,
1425
+ Ve,
1426
+ Be,
1427
+ Le,
1428
+ Ne,
1429
+ Re,
1430
+ He(e),
1431
+ We(e)
1432
+ ]);
1433
+ }
1434
+ const $t = He(0), Dt = We(0), Vt = /* @__PURE__ */ h({
1435
+ name: /* @__PURE__ */ s(/* @__PURE__ */ l(), "Goal"),
1436
+ type: /* @__PURE__ */ s(/* @__PURE__ */ P(g.Goal), g.Goal),
1437
+ defaultValue: /* @__PURE__ */ s(/* @__PURE__ */ S(/* @__PURE__ */ y()), null),
1438
+ required: /* @__PURE__ */ s(/* @__PURE__ */ v(), !1),
1439
+ editable: /* @__PURE__ */ s(/* @__PURE__ */ v(), !0)
1440
+ });
1441
+ g.Number + "", g.Boolean + "", g.String + "", g.Color + "", g.Event + "", g.Link + "", g.Enum + "", g.Object + "", g.Image + "", g.Array + "", g.Goal + "";
1442
+ C.Frame + "", C.Text + "", C.Fragment + "", C.Instance + "", C.Collection + "", C.StopColor + "", C.LinearGradient + "", C.CssChunk + "", C.Border + "", C.Paint + "", C.ImagePaint + "", C.Link + "", C.Interaction + "", C.Classname + "", C.GoalEvent + "", C.MutateEvent + "", C.TextHighlight + "", C.TextStyleMark + "";
1443
+ const ze = /* @__PURE__ */ U(
1444
+ () => /* @__PURE__ */ de({
1445
+ _type: /* @__PURE__ */ l(),
1446
+ _id: /* @__PURE__ */ $([/* @__PURE__ */ l(), /* @__PURE__ */ y()]),
1447
+ // children — массив либо ссылок (LinkKey-строк), либо вложенных узлов того же shape.
1448
+ // Production fixture bk_card использует встроенные nested-объекты, но существующий
1449
+ // ChildrenSchema (`packages/definition/src/schemas/ChildrenSchema.ts`) разрешает массив
1450
+ // строк — оба варианта проходят validation на Phase 1.
1451
+ children: /* @__PURE__ */ s(/* @__PURE__ */ M(/* @__PURE__ */ $([/* @__PURE__ */ l(), ze])))
1452
+ })
1453
+ );
1454
+ C.Fragment;
1455
+ const Xe = (...e) => e.reduce((r, t) => (r[t] = t, r), {}), Gt = {
1456
+ "Content-Type": "application/json"
1457
+ }, Bt = (e, r = {}, t = {}) => {
1458
+ const { timeout: a } = t, u = /* @__PURE__ */ new Map();
1459
+ return { get: (i, f = {}) => {
1460
+ const m = `${e}${i}`;
1461
+ if (u.has(m))
1462
+ return u.get(m);
1463
+ const p = f.timeout ?? a, b = p != null ? AbortSignal.timeout(p) : void 0, d = typeof r == "function" ? r() : r, k = fetch(m, {
1464
+ method: "GET",
1465
+ headers: {
1466
+ ...Gt,
1467
+ ...d
1468
+ },
1469
+ signal: b
1470
+ }).then(async (E) => {
1471
+ if (!E.ok) {
1472
+ let x = {};
1473
+ try {
1474
+ x = await E.json();
1475
+ } catch {
1476
+ x = { error: { code: "UNKNOWN", message: E.statusText } };
1477
+ }
1478
+ return { ok: !1, errorBody: x, status: E.status };
1479
+ }
1480
+ let F;
1481
+ try {
1482
+ F = await E.json();
1483
+ } catch {
1484
+ F = null;
1485
+ }
1486
+ return { ok: !0, data: F, status: E.status };
1487
+ }).finally(() => {
1488
+ u.delete(m);
1489
+ });
1490
+ return u.set(m, k), k;
1491
+ }, getAbsolute: (i) => {
1492
+ fetch(i, {
1493
+ method: "GET",
1494
+ mode: "no-cors",
1495
+ credentials: "omit",
1496
+ keepalive: !0
1497
+ }).catch((f) => {
1498
+ console.error(f);
1499
+ });
1500
+ } };
1501
+ }, Nt = (e) => ({
1502
+ sendBeacon: (t, a) => {
1503
+ if (!t || typeof navigator > "u" || typeof (navigator == null ? void 0 : navigator.sendBeacon) != "function")
1504
+ return !1;
1505
+ try {
1506
+ return navigator.sendBeacon.bind(navigator)(t, a);
1507
+ } catch (u) {
1508
+ return console.error(u), !1;
1509
+ }
1510
+ }
1511
+ }), Lt = (e) => {
1512
+ var f, m, p, b;
1513
+ const r = (f = e == null ? void 0 : e.env) == null ? void 0 : f.backendEndpoint, t = (m = e == null ? void 0 : e.env) == null ? void 0 : m.apiToken, a = (p = e == null ? void 0 : e.env) == null ? void 0 : p.referer;
1514
+ if (!r) return;
1515
+ const u = () => {
1516
+ var E, F, x;
1517
+ const d = (E = e == null ? void 0 : e.env) == null ? void 0 : E.filterOverrides, k = {};
1518
+ return t && (k["X-Api-Key"] = t), a && (k.Referer = a), d != null && d.deviceType && (k["X-Filter-Device-Type"] = d.deviceType), d != null && d.osType && (k["X-Filter-OS-Type"] = d.osType), d != null && d.page && (k["X-Filter-Page"] = d.page), (F = d == null ? void 0 : d.geo) != null && F.code ? k["X-Filter-Geo"] = d.geo.code : d != null && d.ip && (k["X-Filter-IP"] = d.ip), (x = e == null ? void 0 : e.env) != null && x.debug && (k["X-Debug"] = "true"), k;
1519
+ }, c = (b = e == null ? void 0 : e.env) == null ? void 0 : b.timeout, o = Bt(r, u, { timeout: c }), i = Nt();
1520
+ e.$fetch = {
1521
+ get: o.get,
1522
+ sendBeacon: i.sendBeacon,
1523
+ getAbsolute: o.getAbsolute
1524
+ };
1525
+ }, Rt = typeof window < "u", xe = /* @__PURE__ */ new Set(), Ht = (e) => {
1526
+ try {
1527
+ const r = new Image();
1528
+ r.referrerPolicy = "no-referrer";
1529
+ const t = () => {
1530
+ r.removeEventListener("load", t), r.removeEventListener("error", t), xe.delete(r);
1531
+ };
1532
+ r.addEventListener("load", t, { once: !0 }), r.addEventListener("error", t, { once: !0 }), xe.add(r), r.src = e;
1533
+ } catch {
1534
+ }
1535
+ }, Wt = (e, r) => {
1536
+ if (typeof r != "function")
1537
+ return !1;
1538
+ try {
1539
+ return r(e), !0;
1540
+ } catch {
1541
+ return !1;
1542
+ }
1543
+ }, qt = (e) => {
1544
+ if (typeof navigator > "u" || typeof navigator.sendBeacon != "function")
1545
+ return !1;
1546
+ try {
1547
+ return navigator.sendBeacon(e);
1548
+ } catch {
1549
+ return !1;
1550
+ }
1551
+ }, zt = (e, r, t) => {
1552
+ if (!Rt)
1553
+ return;
1554
+ const a = e == null ? void 0 : e.trim();
1555
+ if (a) {
1556
+ if (typeof r == "function")
1557
+ try {
1558
+ if (r(a) === !0)
1559
+ return;
1560
+ } catch {
1561
+ }
1562
+ qt(a) || Wt(a, t) || Ht(a);
1563
+ }
1564
+ }, je = Xe(
1565
+ "INIT_SESSION",
1566
+ "RELEASE_SESSION",
1567
+ "REACH_PROJECT_GOAL"
1568
+ ), Xt = (e) => {
1569
+ const r = (u, c) => {
1570
+ var i;
1571
+ if (u !== je.REACH_PROJECT_GOAL || !c) return;
1572
+ const o = new URLSearchParams({
1573
+ goal_id: String(c.goalId),
1574
+ variant_id: String(c.variantId),
1575
+ area_id: String(c.areaId),
1576
+ campaign_id: String(c.campaignId)
1577
+ });
1578
+ (i = e.$fetch) == null || i.get(`/api/metric/goal?${o}`).catch(() => {
1579
+ });
1580
+ }, t = (u) => {
1581
+ r(je.REACH_PROJECT_GOAL, u);
1582
+ }, a = (u) => {
1583
+ var o, i;
1584
+ const c = ((o = e.$fetch) == null ? void 0 : o.getAbsolute) != null ? (f) => e.$fetch.getAbsolute(f) : void 0;
1585
+ zt(u, (i = e == null ? void 0 : e.$fetch) == null ? void 0 : i.sendBeacon, c);
1586
+ };
1587
+ e.$metrics = {
1588
+ reachGoal: t,
1589
+ trackAdPixel: a
1590
+ };
1591
+ }, Jt = (e) => {
1592
+ const r = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = (i, f) => {
1593
+ if (r.has(i))
1594
+ return Promise.resolve(r.get(i));
1595
+ if (t.has(i))
1596
+ return t.get(i);
1597
+ a.delete(i);
1598
+ const m = `/api/area/${i}/compiled`, p = (async () => {
1599
+ var E, F, x, G, ge;
1600
+ const b = await e.$fetch.get(m);
1601
+ if (!b.ok) {
1602
+ const N = b.errorBody;
1603
+ throw new W(
1604
+ ((E = N == null ? void 0 : N.error) == null ? void 0 : E.code) ?? "UNKNOWN",
1605
+ ((F = N == null ? void 0 : N.error) == null ? void 0 : F.message) ?? String(b.status),
1606
+ (x = N == null ? void 0 : N.error) == null ? void 0 : x.details,
1607
+ b.status
1608
+ );
1609
+ }
1610
+ const d = b.data;
1611
+ if (d.apiVersion !== 1)
1612
+ throw new be(1, d.apiVersion);
1613
+ (G = e.$fragments) == null || G.populate(d.fragments ?? {}), (ge = e.$cssChunks) == null || ge.populate(d.cssChunks ?? {});
1614
+ const k = {
1615
+ rootFragmentId: d.rootFragmentId,
1616
+ props: d.props ?? {},
1617
+ projectProperties: d.projectProperties ?? {},
1618
+ globalCssUrl: d.globalCssUrl ?? null
1619
+ };
1620
+ return r.set(i, k), k;
1621
+ })();
1622
+ return t.set(i, p), p.catch((b) => {
1623
+ a.set(i, b);
1624
+ }).finally(() => {
1625
+ t.delete(i);
1626
+ }), p;
1627
+ }, c = (i) => {
1628
+ if (r.has(i))
1629
+ return r.get(i);
1630
+ throw t.has(i) ? t.get(i) : a.has(i) ? a.get(i) : new W(
1631
+ "AREA_NOT_RESOLVED",
1632
+ `Area ${i} not resolved — call $area.resolve(code) before read()`
1633
+ );
1634
+ }, o = (i) => r.has(i) || a.has(i);
1635
+ e.$area = {
1636
+ resolve: u,
1637
+ read: c,
1638
+ has: o
1639
+ };
1640
+ };
1641
+ function Kt(e) {
1642
+ const r = (e == null ? void 0 : e.importer) ?? ((t) => import(
1643
+ /* @vite-ignore */
1644
+ t
1645
+ ));
1646
+ return (t) => {
1647
+ const a = /* @__PURE__ */ new Map(), u = (p) => a.has(p), c = (p) => {
1648
+ var b;
1649
+ return (b = a.get(p)) == null ? void 0 : b.ref;
1650
+ }, o = (p) => {
1651
+ var b;
1652
+ return (b = a.get(p)) == null ? void 0 : b.schema;
1653
+ }, i = (p) => {
1654
+ var b;
1655
+ return (b = a.get(p)) == null ? void 0 : b.scopeClass;
1656
+ }, f = (p) => {
1657
+ const b = a.get(p);
1658
+ if (b === void 0)
1659
+ throw new q(
1660
+ p,
1661
+ "",
1662
+ new Error(`Fragment ${p} not populated — call populate() before read()`)
1663
+ );
1664
+ if (b.status === "pending")
1665
+ throw b.promise;
1666
+ if (b.status === "error")
1667
+ throw b.error;
1668
+ return b.component;
1669
+ }, m = (p) => {
1670
+ Object.entries(p).forEach(([b, d]) => {
1671
+ const k = Number(b);
1672
+ if (a.has(k)) return;
1673
+ const E = {
1674
+ status: "pending",
1675
+ // Placeholder — перезапишем ниже
1676
+ promise: Promise.resolve(),
1677
+ ref: d
1678
+ }, F = r(d.moduleUrl).then(
1679
+ (x) => (E.status = "success", E.component = x.default, E.schema = x.schema, E.scopeClass = typeof x.scopeClass == "string" ? x.scopeClass : void 0, x.default),
1680
+ (x) => {
1681
+ const G = new q(k, d.moduleUrl, x);
1682
+ throw E.status = "error", E.error = G, G;
1683
+ }
1684
+ );
1685
+ E.promise = F, a.set(k, E), F.catch(() => {
1686
+ });
1687
+ });
1688
+ };
1689
+ t.$fragments = {
1690
+ has: u,
1691
+ read: f,
1692
+ populate: m,
1693
+ getRef: c,
1694
+ getSchema: o,
1695
+ getScopeClass: i
1696
+ };
1697
+ };
1698
+ }
1699
+ const Ut = Kt();
1700
+ function Yt(e) {
1701
+ return (r) => {
1702
+ const t = /* @__PURE__ */ new Map();
1703
+ r.$cssChunks = {
1704
+ has: (a) => t.has(a),
1705
+ populate: (a) => {
1706
+ for (const [u, c] of Object.entries(a)) {
1707
+ const o = Number(u);
1708
+ if (t.has(o)) continue;
1709
+ const i = e.inject(c.cssUrl, `chunk:${o}`);
1710
+ t.set(o, { ref: c, cleanup: i });
1711
+ }
1712
+ }
1713
+ };
1714
+ };
1715
+ }
1716
+ const Qt = Xe("GlobalManager"), tr = (e) => {
1717
+ const r = () => () => {
1718
+ };
1719
+ return Je({
1720
+ _type: "GlobalManager",
1721
+ initialState: {},
1722
+ skip: [
1723
+ Ke([
1724
+ ...Object.keys(lt.nodes),
1725
+ ...Object.keys(Qt)
1726
+ ])
1727
+ ],
1728
+ plugins: [
1729
+ // env-setup block — аналогично legacy fragmentsClient.ts
1730
+ (t) => {
1731
+ t.env = {
1732
+ backendEndpoint: (e == null ? void 0 : e.backendEndpoint) ?? "https://client-api.fragmentsx.com",
1733
+ apiToken: e == null ? void 0 : e.apiToken,
1734
+ referer: e == null ? void 0 : e.referer,
1735
+ timeout: e == null ? void 0 : e.timeout
1736
+ };
1737
+ },
1738
+ // $project setup — аналогично legacy
1739
+ (t) => {
1740
+ (e == null ? void 0 : e.projectId) != null && (t.$project = { projectId: e.projectId });
1741
+ },
1742
+ // User-provided plugins (escape hatch / DI)
1743
+ ...(e == null ? void 0 : e.plugins) ?? [],
1744
+ // HTTP layer — canonical buildHeaders + get() + sendBeacon()
1745
+ // ВАЖНО: fetchPlugin ДО globalMetricsPlugin и areaPlugin (оба зависят от state.$fetch)
1746
+ Lt,
1747
+ // Analytics namespace
1748
+ Xt,
1749
+ // Compiled-specific plugins (без JIT plugins — Req #1)
1750
+ Jt,
1751
+ Ut,
1752
+ // BLOCKER-4: inject parameter wired через factory
1753
+ Yt({ inject: (e == null ? void 0 : e.inject) ?? r })
1754
+ ]
1755
+ });
1756
+ };
1757
+ export {
1758
+ be as FragmentsApiVersionError,
1759
+ W as FragmentsAreaError,
1760
+ q as FragmentsLoadError,
1761
+ Jt as areaPlugin,
1762
+ Yt as createCssChunksCachePlugin,
1763
+ Kt as createFragmentsCachePlugin,
1764
+ tr as createFragmentsClient,
1765
+ Ut as fragmentsCachePlugin,
1766
+ Xt as globalMetricsPlugin
1767
+ };