@scopetickets/checkout 0.4.2 → 0.6.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.
@@ -0,0 +1,291 @@
1
+ /**
2
+ * WHAT A CHARGE WAS MADE WITH — every way of paying the frames and the sheets take, in
3
+ * the frames' spelling. Held on the watch the charge arms, because by the time anyone
4
+ * reads the order the thing that knew — a frame's status, a sheet opening — has moved
5
+ * on, and a renderer's own record of the choice can land a render behind the charge.
6
+ */
7
+ declare type ChargeMethod = 'card' | 'revolut_pay' | 'apple_pay' | 'google_pay';
8
+
9
+ /** Bumped only by a rename or a removal — see the analytics guide's versioning. */
10
+ declare const CHECKOUT_EVENT_SCHEMA = 1;
11
+
12
+ /** One thing that happened, and where. The public shape a host's `onEvent` is handed. */
13
+ declare type CheckoutEvent = CheckoutEventBody & {
14
+ readonly context: EventContext;
15
+ };
16
+
17
+ declare type CheckoutEventBody = {
18
+ readonly name: 'view_item';
19
+ readonly items: readonly EventItem[];
20
+ } | {
21
+ readonly name: 'set_party';
22
+ readonly party_size: number;
23
+ readonly user_type_count: number;
24
+ } | {
25
+ readonly name: 'select_date';
26
+ readonly date: string;
27
+ readonly days_ahead?: number;
28
+ } | {
29
+ readonly name: 'select_time';
30
+ readonly time: string;
31
+ } | ({
32
+ readonly name: 'add_to_cart';
33
+ } & Priced) | ({
34
+ readonly name: 'remove_from_cart';
35
+ } & Priced) | {
36
+ readonly name: 'availability_refused';
37
+ readonly notice_key: NoticeId;
38
+ } | ({
39
+ readonly name: 'begin_checkout';
40
+ } & Priced) | {
41
+ readonly name: 'login';
42
+ readonly method: 'passkey' | 'password';
43
+ } | {
44
+ readonly name: 'checkout_as_guest';
45
+ } | {
46
+ readonly name: 'sign_up';
47
+ readonly method: 'email';
48
+ } | ({
49
+ readonly name: 'add_payment_info';
50
+ readonly payment_type?: PaymentType;
51
+ } & Priced) | ({
52
+ readonly name: 'purchase';
53
+ readonly transaction_id: string;
54
+ } & Priced) | {
55
+ readonly name: 'payment_failed';
56
+ readonly attempt: number;
57
+ } | {
58
+ readonly name: 'payment_unconfirmed';
59
+ readonly attempt: number;
60
+ } | {
61
+ readonly name: 'hold_expired';
62
+ } | {
63
+ readonly name: 'checkout_abandoned';
64
+ readonly step: PurchaseStepId;
65
+ };
66
+
67
+ declare type CheckoutEventName = CheckoutEventBody['name'];
68
+
69
+ /** Anything with GTM's `push` — the plain array before GTM loads, or GTM's own after. */
70
+ export declare type DataLayer = {
71
+ readonly push: (...entries: DataLayerEntry[]) => unknown;
72
+ };
73
+
74
+ /**
75
+ * THE CHECKOUT'S EVENTS, AS A `dataLayer` PUSH — for a host whose tags live in a tag
76
+ * manager.
77
+ *
78
+ * Two functions and nothing else. This loads no script, reads no consent and chooses no
79
+ * analytics property: `onEvent` hands the host each `CheckoutEvent`, and what the host's
80
+ * container does with it is the host's to decide. A host wiring GTM writes one line:
81
+ *
82
+ * <ScopeTicketsCheckout onEvent={(event) => pushToDataLayer(event)} … />
83
+ *
84
+ * WHY AN ENTRY POINT AND NOT A LINE IN `index.ts`: a host that sends events somewhere
85
+ * else should not carry the mapping, and one that only wants the mapping should not carry
86
+ * the widget.
87
+ *
88
+ * ── THE SHAPE ───────────────────────────────────────────────────────────────
89
+ *
90
+ * GA4's own ecommerce events arrive as GA4 expects them: `{ ecommerce: null }` first, so
91
+ * the previous event's items do not merge into this one's, then `{ event, ecommerce }`.
92
+ * Everything that is Scope's — the context, and the whole payload of every other event —
93
+ * sits under `scope`, so nothing collides with a key of the host's own.
94
+ *
95
+ * `scope` IS CLEARED THE SAME WAY, BEFORE EVERY PUSH. GTM merges each push into one
96
+ * running data model, so `scope.party_size`, the date and the time from the steps before
97
+ * stayed in it through every later event, and a container mapping `scope.*` read a party
98
+ * from three events ago as this one's. So each event is preceded by `{ scope: null }`, or
99
+ * `{ ecommerce: null, scope: null }` as one entry where there is an ecommerce object too.
100
+ */
101
+
102
+ export declare type DataLayerEcommerce = {
103
+ readonly currency?: string;
104
+ readonly value?: number;
105
+ readonly items: readonly EventItem[];
106
+ readonly coupon?: string;
107
+ readonly transaction_id?: string;
108
+ readonly payment_type?: string;
109
+ };
110
+
111
+ /** One object pushed. The clearing push is `{ scope: null }`, with `ecommerce: null` where GA4's. */
112
+ export declare type DataLayerEntry = {
113
+ readonly scope: null;
114
+ } | {
115
+ readonly ecommerce: null;
116
+ readonly scope: null;
117
+ } | {
118
+ readonly event: CheckoutEventName;
119
+ readonly ecommerce?: DataLayerEcommerce;
120
+ readonly scope: Readonly<Record<string, unknown>>;
121
+ };
122
+
123
+ /** The cart's three shares, major units — `value` is the organisation's. */
124
+ declare type EventAmounts = {
125
+ readonly total: number;
126
+ readonly organisation: number;
127
+ readonly broker: number;
128
+ };
129
+
130
+ /** What every event carries, nested under `scope` in a `dataLayer`. */
131
+ declare type EventContext = {
132
+ readonly schema_version: typeof CHECKOUT_EVENT_SCHEMA;
133
+ /** Unique per event — the dedupe key a pixel and its server twin share. */
134
+ readonly event_id: string;
135
+ /** Unique per mount — stitches before the cart to after it, and two widgets apart. */
136
+ readonly mount_id: string;
137
+ /** The notices' join key, minted per cart, so present from the cart onward only. */
138
+ readonly checkout_session_id?: string;
139
+ readonly integration: 'widget';
140
+ readonly platform: 'web' | 'native';
141
+ readonly sdk_version: string;
142
+ /** The app's public `AppKey`. Never the Bearer — see `applicationKeyFrom`. */
143
+ readonly application_key?: string;
144
+ /** The run, where there is one. Never an event's key. */
145
+ readonly series_key?: string;
146
+ readonly series_name?: string;
147
+ /** The occurrence: chosen once a day is answered, or the one-off event from the start. */
148
+ readonly event_key?: string;
149
+ readonly inventory_filter: 'all' | 'named';
150
+ /** Comma-joined and sorted, and absent rather than past GA's limit. */
151
+ readonly inventory_keys?: string;
152
+ readonly currency?: string;
153
+ /** From the cart onward, and only where the currency is known. */
154
+ readonly amounts?: EventAmounts;
155
+ };
156
+
157
+ /** One line of what is bought, aggregated by ticket × user type. */
158
+ declare type EventItem = {
159
+ /** The ticket's key — never its name, which is not stable. */
160
+ readonly item_id: string;
161
+ readonly item_name?: string;
162
+ /** The user type the heads were bought for. */
163
+ readonly item_variant?: string;
164
+ /** The run the ticket belongs to. */
165
+ readonly item_category?: string;
166
+ /** Per head, the organisation's share, in major units. Absent where the currency is. */
167
+ readonly price?: number;
168
+ readonly quantity: number;
169
+ };
170
+
171
+ declare type NoticeId =
172
+ /**
173
+ * FEWER TICKETS THAN WERE ASKED FOR ARE HELD. The platform fills what it can — see
174
+ * `AllowPartialFulfillment` — so this is a smaller order the buyer already owns, which
175
+ * is why it leads with taking it rather than with changing it.
176
+ */
177
+ 'ORDER_PART_FILLED'
178
+ /**
179
+ * NOT ONE OF THEM COULD BE HELD, for a party of more than one. The flag fills what it
180
+ * can, and where it can fill NOTHING the platform refuses outright — so this is the
181
+ * bottom of the same range as `ORDER_PART_FILLED` and not a different kind of event.
182
+ */
183
+ | 'ORDER_NOT_ENOUGH'
184
+ /** The same refusal met by a buyer on their own, where there is no party to speak of. */
185
+ | 'ORDER_SOLD_OUT'
186
+ /** The order could not be opened at all: no cart, and nothing to check out. */
187
+ | 'ORDER_NOT_OPENED'
188
+ /**
189
+ * THE ORDER CANNOT BE PLACED AS ASKED — more heads than the tickets sell in one order, fewer
190
+ * than they need, or a session that is not on sale. Core refuses it before a cart is asked
191
+ * for (`orderAskFor`), so nothing is held and nothing charged; what is left is to change it.
192
+ */
193
+ | 'ORDER_TOO_LARGE' | 'ORDER_TOO_SMALL' | 'TIME_NOT_ON_SALE'
194
+ /**
195
+ * THE RUN OR THE DAY COULD NOT BE READ. One id for both, because they read the same to a
196
+ * buyer — the thing they came to buy is not on screen — and the difference between them
197
+ * is a fact about which call to make again, which the retry already knows.
198
+ */
199
+ | 'EVENT_NOT_LOADED'
200
+ /** The event's questionnaire could not be read. */
201
+ | 'QUESTIONS_NOT_LOADED'
202
+ /** The platform refused the answers. Only raised before a charge. */
203
+ | 'ANSWERS_NOT_SAVED'
204
+ /**
205
+ * The verification code could not be SENT. Distinct from a code that was refused, which
206
+ * is the buyer mistyping and is answered by the boxes themselves — validation, not a
207
+ * failure of ours.
208
+ */
209
+ | 'ACCOUNT_CODE_NOT_SENT'
210
+ /** Everything was answered and `POST /api/Users` would not take it. */
211
+ | 'ACCOUNT_NOT_CREATED'
212
+ /**
213
+ * The buyer rated their purchase and the rating did not reach us. THE ONLY NOTICE HERE
214
+ * ABOUT SOMETHING THE BUYER DOES NOT NEED — the order is placed either way, and a
215
+ * rating is a courtesy they have already paid. It is raised anyway because the
216
+ * alternative is a press that silently did nothing: they chose four stars, pressed
217
+ * Continue, and nothing on the platform has heard of it.
218
+ */
219
+ | 'FEEDBACK_NOT_SENT'
220
+ /**
221
+ * The device signed something and the platform would not take it — or the challenge in
222
+ * front of it never arrived. NOT a buyer who waved the prompt away, which is a normal
223
+ * thing to do and raises nothing; see `usePasskeySignIn`, which draws that line.
224
+ */
225
+ | 'SIGN_IN_NOT_COMPLETED'
226
+ /**
227
+ * The password door could not be reached — the call did not go, or did not come back.
228
+ * NOT a password the platform refused, which is the buyer typing and is answered by the
229
+ * card itself.
230
+ */
231
+ | 'SIGN_IN_UNREACHABLE'
232
+ /**
233
+ * THE BOOKING WOULD NOT LOAD. The money moved, the tickets exist, and the one request
234
+ * that says who they are for did not come back — so the buyer is looking at a card that
235
+ * cannot list anything. NOT a cart that never became a transaction, which is an answer
236
+ * and gets a card of its own rather than a failure.
237
+ */
238
+ | 'BOOKING_NOT_LOADED'
239
+ /**
240
+ * THE PLATFORM WOULD NOT TAKE THE TICKETHOLDER. A refusal, not a failure to reach — the
241
+ * details went and came back declined, which is a WARNING because the system worked and
242
+ * something about the answer needs adjusting.
243
+ */
244
+ | 'TICKETHOLDER_REFUSED'
245
+ /**
246
+ * The ticketholder's details never reached the platform. The ticket is unchanged and the
247
+ * buyer is still holding what they typed, so this is the one of the two that is a fault.
248
+ */
249
+ | 'TICKETHOLDER_NOT_SAVED'
250
+ /** The merchant settles through a provider no sheet here can open. Nothing broke. */
251
+ | 'PAYMENT_UNAVAILABLE'
252
+ /** The sheet could not be opened: no order minted, or it would not take its key. */
253
+ | 'PAYMENT_NOT_STARTED'
254
+ /**
255
+ * THE PLATFORM WAS ASKED FOR A WHOLE ESCROW WINDOW AND NEVER SAID. The one notice here
256
+ * that cannot tell the buyer what happened, because nothing knows — see
257
+ * `PaymentOutcome.UNANSWERED`. It is a FAILURE and not a WARNING: nothing worked, and
258
+ * there is no adjustment the buyer can make that would help.
259
+ */
260
+ | 'PAYMENT_UNCONFIRMED';
261
+
262
+ /** What the charge was made with — the order's own record of it, see `ChargeMethod`. */
263
+ declare type PaymentType = ChargeMethod;
264
+
265
+ /** What an ecommerce event carries of the cart. `value` goes where `currency` goes. */
266
+ declare type Priced = {
267
+ readonly value?: number;
268
+ readonly currency?: string;
269
+ readonly items: readonly EventItem[];
270
+ /** Only a code the platform ACCEPTED — the organiser's words, not the buyer's. */
271
+ readonly coupon?: string;
272
+ };
273
+
274
+ /** In the flow's own order, so the union reads as the sequence it names. */
275
+ declare type PurchaseStepId = 'PARTY' | 'DATE' | 'TIME' | 'SIGN_IN' | 'NAME' | 'EMAIL' | 'PHONE' | 'DETAILS' | 'REVIEW' | 'PAYMENT' | 'PROMO' | 'ABANDON' | 'PROCESSING' | 'PAYMENT_FAILED' | 'PAYMENT_SUCCESS' | 'FEEDBACK' | 'CREATE_ACCOUNT' | 'CONFIRM_EMAIL' | 'VERIFY_EMAIL' | 'PASSWORD' | 'PROFILE_PHOTO' | 'ACCOUNT_CREATING' | 'ACCOUNT_CREATED' | 'PASSKEY' | 'FOLLOW';
276
+
277
+ /**
278
+ * PUSH ONE EVENT onto the page's `dataLayer`, or the one given. The page's is created if
279
+ * it is not there yet, exactly as GTM's own snippet does, so a push that arrives before
280
+ * the container has loaded is waiting for it. Off a page — rendered on a server — there is
281
+ * nowhere to push, and nothing happens.
282
+ */
283
+ export declare function pushToDataLayer(event: CheckoutEvent, dataLayer?: DataLayer): void;
284
+
285
+ /**
286
+ * WHAT ONE EVENT PUSHES, in order. A switch over every event, so one added to the union
287
+ * cannot reach a `dataLayer` without somebody deciding whether it is GA4's ecommerce.
288
+ */
289
+ export declare function toDataLayer(event: CheckoutEvent): readonly DataLayerEntry[];
290
+
291
+ export { }
@@ -0,0 +1,65 @@
1
+ // src/analytics.ts
2
+ function toDataLayer(event) {
3
+ const { context } = event;
4
+ const ecommerce = (shape) => [
5
+ { ecommerce: null, scope: null },
6
+ { event: event.name, ecommerce: shape, scope: context }
7
+ ];
8
+ switch (event.name) {
9
+ case "view_item":
10
+ return ecommerce({ items: event.items });
11
+ case "add_to_cart":
12
+ case "remove_from_cart":
13
+ case "begin_checkout":
14
+ return ecommerce(priced(event));
15
+ case "add_payment_info":
16
+ return ecommerce({
17
+ ...priced(event),
18
+ ...event.payment_type === void 0 ? {} : { payment_type: event.payment_type }
19
+ });
20
+ case "purchase":
21
+ return ecommerce({ ...priced(event), transaction_id: event.transaction_id });
22
+ case "set_party":
23
+ case "select_date":
24
+ case "select_time":
25
+ case "availability_refused":
26
+ case "login":
27
+ case "checkout_as_guest":
28
+ case "sign_up":
29
+ case "payment_failed":
30
+ case "payment_unconfirmed":
31
+ case "hold_expired":
32
+ case "checkout_abandoned": {
33
+ const { name, context: _, ...own } = event;
34
+ return [{ scope: null }, { event: name, scope: { ...context, ...own } }];
35
+ }
36
+ default: {
37
+ const exhaustive = event;
38
+ return exhaustive;
39
+ }
40
+ }
41
+ }
42
+ function priced(event) {
43
+ return {
44
+ ...event.currency === void 0 ? {} : { currency: event.currency },
45
+ ...event.value === void 0 ? {} : { value: event.value },
46
+ items: event.items,
47
+ ...event.coupon === void 0 ? {} : { coupon: event.coupon }
48
+ };
49
+ }
50
+ function pushToDataLayer(event, dataLayer) {
51
+ const layer = dataLayer ?? pageDataLayer();
52
+ if (layer === null) return;
53
+ for (const entry of toDataLayer(event)) layer.push(entry);
54
+ }
55
+ function pageDataLayer() {
56
+ if (typeof window === "undefined") return null;
57
+ const page = window;
58
+ page.dataLayer ??= [];
59
+ return page.dataLayer;
60
+ }
61
+ export {
62
+ pushToDataLayer,
63
+ toDataLayer
64
+ };
65
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/analytics.ts"],"sourcesContent":["/**\n * THE CHECKOUT'S EVENTS, AS A `dataLayer` PUSH — for a host whose tags live in a tag\n * manager.\n *\n * Two functions and nothing else. This loads no script, reads no consent and chooses no\n * analytics property: `onEvent` hands the host each `CheckoutEvent`, and what the host's\n * container does with it is the host's to decide. A host wiring GTM writes one line:\n *\n * <ScopeTicketsCheckout onEvent={(event) => pushToDataLayer(event)} … />\n *\n * WHY AN ENTRY POINT AND NOT A LINE IN `index.ts`: a host that sends events somewhere\n * else should not carry the mapping, and one that only wants the mapping should not carry\n * the widget.\n *\n * ── THE SHAPE ───────────────────────────────────────────────────────────────\n *\n * GA4's own ecommerce events arrive as GA4 expects them: `{ ecommerce: null }` first, so\n * the previous event's items do not merge into this one's, then `{ event, ecommerce }`.\n * Everything that is Scope's — the context, and the whole payload of every other event —\n * sits under `scope`, so nothing collides with a key of the host's own.\n *\n * `scope` IS CLEARED THE SAME WAY, BEFORE EVERY PUSH. GTM merges each push into one\n * running data model, so `scope.party_size`, the date and the time from the steps before\n * stayed in it through every later event, and a container mapping `scope.*` read a party\n * from three events ago as this one's. So each event is preceded by `{ scope: null }`, or\n * `{ ecommerce: null, scope: null }` as one entry where there is an ecommerce object too.\n */\n\nimport type {\n CheckoutEvent,\n CheckoutEventName,\n EventItem,\n Priced,\n} from '@scopetickets/checkout-core/machine/checkout-events';\n\nexport type DataLayerEcommerce = {\n readonly currency?: string;\n readonly value?: number;\n readonly items: readonly EventItem[];\n readonly coupon?: string;\n readonly transaction_id?: string;\n readonly payment_type?: string;\n};\n\n/** One object pushed. The clearing push is `{ scope: null }`, with `ecommerce: null` where GA4's. */\nexport type DataLayerEntry =\n | { readonly scope: null }\n | { readonly ecommerce: null; readonly scope: null }\n | {\n readonly event: CheckoutEventName;\n readonly ecommerce?: DataLayerEcommerce;\n readonly scope: Readonly<Record<string, unknown>>;\n };\n\n/** Anything with GTM's `push` — the plain array before GTM loads, or GTM's own after. */\nexport type DataLayer = { readonly push: (...entries: DataLayerEntry[]) => unknown };\n\n/**\n * WHAT ONE EVENT PUSHES, in order. A switch over every event, so one added to the union\n * cannot reach a `dataLayer` without somebody deciding whether it is GA4's ecommerce.\n */\nexport function toDataLayer(event: CheckoutEvent): readonly DataLayerEntry[] {\n const { context } = event;\n const ecommerce = (shape: DataLayerEcommerce): readonly DataLayerEntry[] => [\n { ecommerce: null, scope: null },\n { event: event.name, ecommerce: shape, scope: context },\n ];\n switch (event.name) {\n case 'view_item':\n return ecommerce({ items: event.items });\n case 'add_to_cart':\n case 'remove_from_cart':\n case 'begin_checkout':\n return ecommerce(priced(event));\n case 'add_payment_info':\n return ecommerce({\n ...priced(event),\n ...(event.payment_type === undefined ? {} : { payment_type: event.payment_type }),\n });\n case 'purchase':\n return ecommerce({ ...priced(event), transaction_id: event.transaction_id });\n case 'set_party':\n case 'select_date':\n case 'select_time':\n case 'availability_refused':\n case 'login':\n case 'checkout_as_guest':\n case 'sign_up':\n case 'payment_failed':\n case 'payment_unconfirmed':\n case 'hold_expired':\n case 'checkout_abandoned': {\n const { name, context: _, ...own } = event;\n return [{ scope: null }, { event: name, scope: { ...context, ...own } }];\n }\n default: {\n const exhaustive: never = event;\n return exhaustive;\n }\n }\n}\n\n/** The cart as GA4's ecommerce object carries it — `value` only beside its `currency`. */\nfunction priced(event: Priced): DataLayerEcommerce {\n return {\n ...(event.currency === undefined ? {} : { currency: event.currency }),\n ...(event.value === undefined ? {} : { value: event.value }),\n items: event.items,\n ...(event.coupon === undefined ? {} : { coupon: event.coupon }),\n };\n}\n\n/**\n * PUSH ONE EVENT onto the page's `dataLayer`, or the one given. The page's is created if\n * it is not there yet, exactly as GTM's own snippet does, so a push that arrives before\n * the container has loaded is waiting for it. Off a page — rendered on a server — there is\n * nowhere to push, and nothing happens.\n */\nexport function pushToDataLayer(event: CheckoutEvent, dataLayer?: DataLayer): void {\n const layer = dataLayer ?? pageDataLayer();\n if (layer === null) return;\n for (const entry of toDataLayer(event)) layer.push(entry);\n}\n\nfunction pageDataLayer(): DataLayer | null {\n if (typeof window === 'undefined') return null;\n const page = window as unknown as { dataLayer?: DataLayer };\n page.dataLayer ??= [] as DataLayerEntry[];\n return page.dataLayer;\n}\n"],"mappings":";AA6DO,SAAS,YAAY,OAAiD;AAC3E,QAAM,EAAE,QAAQ,IAAI;AACpB,QAAM,YAAY,CAAC,UAAyD;AAAA,IAC1E,EAAE,WAAW,MAAM,OAAO,KAAK;AAAA,IAC/B,EAAE,OAAO,MAAM,MAAM,WAAW,OAAO,OAAO,QAAQ;AAAA,EACxD;AACA,UAAQ,MAAM,MAAM;AAAA,IAClB,KAAK;AACH,aAAO,UAAU,EAAE,OAAO,MAAM,MAAM,CAAC;AAAA,IACzC,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,UAAU,OAAO,KAAK,CAAC;AAAA,IAChC,KAAK;AACH,aAAO,UAAU;AAAA,QACf,GAAG,OAAO,KAAK;AAAA,QACf,GAAI,MAAM,iBAAiB,SAAY,CAAC,IAAI,EAAE,cAAc,MAAM,aAAa;AAAA,MACjF,CAAC;AAAA,IACH,KAAK;AACH,aAAO,UAAU,EAAE,GAAG,OAAO,KAAK,GAAG,gBAAgB,MAAM,eAAe,CAAC;AAAA,IAC7E,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK,sBAAsB;AACzB,YAAM,EAAE,MAAM,SAAS,GAAG,GAAG,IAAI,IAAI;AACrC,aAAO,CAAC,EAAE,OAAO,KAAK,GAAG,EAAE,OAAO,MAAM,OAAO,EAAE,GAAG,SAAS,GAAG,IAAI,EAAE,CAAC;AAAA,IACzE;AAAA,IACA,SAAS;AACP,YAAM,aAAoB;AAC1B,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAGA,SAAS,OAAO,OAAmC;AACjD,SAAO;AAAA,IACL,GAAI,MAAM,aAAa,SAAY,CAAC,IAAI,EAAE,UAAU,MAAM,SAAS;AAAA,IACnE,GAAI,MAAM,UAAU,SAAY,CAAC,IAAI,EAAE,OAAO,MAAM,MAAM;AAAA,IAC1D,OAAO,MAAM;AAAA,IACb,GAAI,MAAM,WAAW,SAAY,CAAC,IAAI,EAAE,QAAQ,MAAM,OAAO;AAAA,EAC/D;AACF;AAQO,SAAS,gBAAgB,OAAsB,WAA6B;AACjF,QAAM,QAAQ,aAAa,cAAc;AACzC,MAAI,UAAU,KAAM;AACpB,aAAW,SAAS,YAAY,KAAK,EAAG,OAAM,KAAK,KAAK;AAC1D;AAEA,SAAS,gBAAkC;AACzC,MAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,QAAM,OAAO;AACb,OAAK,cAAc,CAAC;AACpB,SAAO,KAAK;AACd;","names":[]}