@sungen/driver-ui 3.2.34 → 3.3.0-alpha.2
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.
- package/dist/app-profile-presets.d.ts +12 -0
- package/dist/app-profile-presets.d.ts.map +1 -0
- package/dist/app-profile-presets.js +85 -0
- package/dist/app-profile-presets.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -0
- package/dist/patterns/assertion-patterns.d.ts +13 -0
- package/dist/patterns/assertion-patterns.d.ts.map +1 -0
- package/dist/patterns/assertion-patterns.js +903 -0
- package/dist/patterns/assertion-patterns.js.map +1 -0
- package/dist/patterns/capture-patterns.d.ts +21 -0
- package/dist/patterns/capture-patterns.d.ts.map +1 -0
- package/dist/patterns/capture-patterns.js +174 -0
- package/dist/patterns/capture-patterns.js.map +1 -0
- package/dist/patterns/focus-patterns.d.ts +22 -0
- package/dist/patterns/focus-patterns.d.ts.map +1 -0
- package/dist/patterns/focus-patterns.js +79 -0
- package/dist/patterns/focus-patterns.js.map +1 -0
- package/dist/patterns/form-patterns.d.ts +6 -0
- package/dist/patterns/form-patterns.d.ts.map +1 -0
- package/dist/patterns/form-patterns.js +239 -0
- package/dist/patterns/form-patterns.js.map +1 -0
- package/dist/patterns/interaction-patterns.d.ts +20 -0
- package/dist/patterns/interaction-patterns.d.ts.map +1 -0
- package/dist/patterns/interaction-patterns.js +633 -0
- package/dist/patterns/interaction-patterns.js.map +1 -0
- package/dist/patterns/keyboard-patterns.d.ts +7 -0
- package/dist/patterns/keyboard-patterns.d.ts.map +1 -0
- package/dist/patterns/keyboard-patterns.js +57 -0
- package/dist/patterns/keyboard-patterns.js.map +1 -0
- package/dist/patterns/navigation-patterns.d.ts +6 -0
- package/dist/patterns/navigation-patterns.d.ts.map +1 -0
- package/dist/patterns/navigation-patterns.js +185 -0
- package/dist/patterns/navigation-patterns.js.map +1 -0
- package/dist/patterns/scope-patterns.d.ts +7 -0
- package/dist/patterns/scope-patterns.d.ts.map +1 -0
- package/dist/patterns/scope-patterns.js +36 -0
- package/dist/patterns/scope-patterns.js.map +1 -0
- package/dist/patterns/scroll-patterns.d.ts +7 -0
- package/dist/patterns/scroll-patterns.d.ts.map +1 -0
- package/dist/patterns/scroll-patterns.js +25 -0
- package/dist/patterns/scroll-patterns.js.map +1 -0
- package/dist/patterns/setup-patterns.d.ts +6 -0
- package/dist/patterns/setup-patterns.d.ts.map +1 -0
- package/dist/patterns/setup-patterns.js +75 -0
- package/dist/patterns/setup-patterns.js.map +1 -0
- package/dist/patterns/storage-patterns.d.ts +26 -0
- package/dist/patterns/storage-patterns.d.ts.map +1 -0
- package/dist/patterns/storage-patterns.js +142 -0
- package/dist/patterns/storage-patterns.js.map +1 -0
- package/dist/patterns/table-pagination-patterns.d.ts +42 -0
- package/dist/patterns/table-pagination-patterns.d.ts.map +1 -0
- package/dist/patterns/table-pagination-patterns.js +93 -0
- package/dist/patterns/table-pagination-patterns.js.map +1 -0
- package/dist/patterns/table-patterns.d.ts +19 -0
- package/dist/patterns/table-patterns.d.ts.map +1 -0
- package/dist/patterns/table-patterns.js +594 -0
- package/dist/patterns/table-patterns.js.map +1 -0
- package/dist/trace-identity/aria-snapshot-head.d.ts +23 -0
- package/dist/trace-identity/aria-snapshot-head.d.ts.map +1 -0
- package/dist/trace-identity/aria-snapshot-head.js +26 -0
- package/dist/trace-identity/aria-snapshot-head.js.map +1 -0
- package/dist/trace-identity/playwright-identity-resolver.d.ts +10 -0
- package/dist/trace-identity/playwright-identity-resolver.d.ts.map +1 -0
- package/dist/trace-identity/playwright-identity-resolver.js +130 -0
- package/dist/trace-identity/playwright-identity-resolver.js.map +1 -0
- package/dist/trace-identity/trace-run-record-reporter.d.ts +41 -0
- package/dist/trace-identity/trace-run-record-reporter.d.ts.map +1 -0
- package/dist/trace-identity/trace-run-record-reporter.js +113 -0
- package/dist/trace-identity/trace-run-record-reporter.js.map +1 -0
- package/dist/utils/column-header.d.ts +37 -0
- package/dist/utils/column-header.d.ts.map +1 -0
- package/dist/utils/column-header.js +46 -0
- package/dist/utils/column-header.js.map +1 -0
- package/dist/utils/row-index.d.ts +18 -0
- package/dist/utils/row-index.d.ts.map +1 -0
- package/dist/utils/row-index.js +39 -0
- package/dist/utils/row-index.js.map +1 -0
- package/dist/utils/url-path-regex.d.ts +45 -0
- package/dist/utils/url-path-regex.d.ts.map +1 -0
- package/dist/utils/url-path-regex.js +68 -0
- package/dist/utils/url-path-regex.js.map +1 -0
- package/package.json +7 -3
- package/src/index.ts +10 -1
- package/src/trace-identity/aria-snapshot-head.ts +33 -0
- package/src/trace-identity/playwright-identity-resolver.ts +123 -0
- package/src/trace-identity/trace-run-record-reporter.ts +105 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formPatterns = void 0;
|
|
4
|
+
const sungen_1 = require("@sun-asterisk/sungen");
|
|
5
|
+
/**
|
|
6
|
+
* Form action patterns: fill, type, select, check, uncheck
|
|
7
|
+
*/
|
|
8
|
+
exports.formPatterns = [
|
|
9
|
+
{
|
|
10
|
+
name: 'upload-file',
|
|
11
|
+
platforms: ['web'],
|
|
12
|
+
platformAlternative: 'the file picker is a separate app on mobile - push the file with the driver and drive that picker app-specifically, or tag the scenario @manual:M10',
|
|
13
|
+
matcher: (step) => (step.text.includes('fill') || step.text.includes('fills')) &&
|
|
14
|
+
step.elementType === 'uploader' &&
|
|
15
|
+
!!step.selectorRef &&
|
|
16
|
+
!!(step.dataRef || step.value),
|
|
17
|
+
resolver: (step, context) => {
|
|
18
|
+
const resolved = context.selectorResolver.resolveSelector(step.selectorRef, undefined, step.elementType, step.nth);
|
|
19
|
+
let fileName;
|
|
20
|
+
if (step.dataRef) {
|
|
21
|
+
fileName = context.dataResolver.resolveData(step.dataRef, context.featureName);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
fileName = step.value;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
templateName: 'upload-action',
|
|
28
|
+
data: { ...resolved, selectorRef: step.selectorRef, fileName },
|
|
29
|
+
comment: `Upload file ${fileName} via ${step.selectorRef}`,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
priority: 12,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'fill-input',
|
|
36
|
+
matcher: (step) => (step.text.includes('fills') || step.text.includes('fill') || step.text.includes('inputs') || step.text.includes('input')) && !!step.selectorRef && !!(step.dataRef || step.value),
|
|
37
|
+
resolver: (step, context) => {
|
|
38
|
+
const resolved = context.selectorResolver.resolveSelector(step.selectorRef, undefined, step.elementType, step.nth);
|
|
39
|
+
let value;
|
|
40
|
+
if (step.dataRef) {
|
|
41
|
+
value = context.dataResolver.resolveData(step.dataRef, context.featureName);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
value = step.value;
|
|
45
|
+
}
|
|
46
|
+
// Widget recipe hook: per-element `variant:` wins; else, for a date-picker element,
|
|
47
|
+
// the profile's `widgets.datepicker` (custom datepickers — readonly inputs that need
|
|
48
|
+
// open-panel choreography). Resolves to a recipe with a `fill` intent.
|
|
49
|
+
const isDatePicker = /date-?picker|calendar/.test(String(step.elementType || ''));
|
|
50
|
+
const fillVariant = resolved.variant || (isDatePicker ? context.appProfile?.widgetVariants?.['datepicker'] : undefined);
|
|
51
|
+
const fillRecipe = fillVariant ? context.appProfile?.recipes?.[fillVariant]?.['fill'] : undefined;
|
|
52
|
+
if (fillRecipe) {
|
|
53
|
+
try {
|
|
54
|
+
const steps = (0, sungen_1.expandRecipe)(fillRecipe, {
|
|
55
|
+
triggerCode: context.renderLocator(resolved),
|
|
56
|
+
value,
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
templateName: 'recipe-sequence',
|
|
60
|
+
data: { steps },
|
|
61
|
+
comment: `Fill ${step.selectorRef} with ${step.dataRef || step.value} (${fillVariant} recipe)`,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// malformed recipe → generic fill below
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// A date-picker on MOBILE with no recipe configured: refuse rather than type into it.
|
|
69
|
+
// The generic fill is `click → clearValue → setValue`, which is right for a text field and
|
|
70
|
+
// wrong for a native picker — Android opens a spinner/calendar DIALOG, so setValue lands on
|
|
71
|
+
// the trigger, selects nothing, and reports success. The step then reads as "the date was
|
|
72
|
+
// chosen" while nothing was. The recipe hook above is the supported answer (an app profile
|
|
73
|
+
// declaring `widgets.datepicker`); without one there is no honest compilation, so this
|
|
74
|
+
// follows the upload-step precedent and fails loud with the two ways forward.
|
|
75
|
+
if (isDatePicker && context.platform === 'mobile') {
|
|
76
|
+
return {
|
|
77
|
+
templateName: 'date-picker-unsupported',
|
|
78
|
+
data: {
|
|
79
|
+
reason:
|
|
80
|
+
// No double quotes in this text: it is rendered INTO a double-quoted JS string literal,
|
|
81
|
+
// where a stray quote would break the generated file rather than the step.
|
|
82
|
+
`date-picker step for [${step.selectorRef}] cannot be compiled on the appium adapter: `
|
|
83
|
+
+ `a native picker is a dialog, so the generic fill would type into the trigger and select `
|
|
84
|
+
+ `nothing while reporting success. Declare the picker choreography in qa/app.yaml `
|
|
85
|
+
+ `(widgets.datepicker, a recipe with a fill intent), or tag this scenario @manual.`,
|
|
86
|
+
},
|
|
87
|
+
comment: `date-picker not compilable on mobile without a recipe — see qa/app.yaml widgets.datepicker`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
// Rich-text editors fill with pressSequentially, not .fill(). Two ways in: the selector
|
|
91
|
+
// entry (`contenteditable: true`, which the resolver translates into `inputMethod`, #712 —
|
|
92
|
+
// or `inputMethod` written out), and the Gherkin `editor` element type, which is a property
|
|
93
|
+
// of the STEP and so is read separately.
|
|
94
|
+
//
|
|
95
|
+
// The note that used to sit here said live-scan auto-detected this. Nothing in any package
|
|
96
|
+
// writes `inputMethod` — that was the same false-consumer claim #712 was filed over, and it
|
|
97
|
+
// mattered: with `contenteditable:` dead and no auto-detection, an author who hit a
|
|
98
|
+
// rich-text field had no working field to reach for at all.
|
|
99
|
+
const isEditor = resolved.inputMethod === 'pressSequentially' || step.elementType === 'editor';
|
|
100
|
+
const templateName = isEditor ? 'fill-editor-action' : 'fill-action';
|
|
101
|
+
return {
|
|
102
|
+
templateName,
|
|
103
|
+
data: { ...resolved, selectorRef: step.selectorRef, fillValue: value },
|
|
104
|
+
comment: isEditor
|
|
105
|
+
? `Fill rich text editor ${step.selectorRef} with ${step.dataRef || step.value}`
|
|
106
|
+
: `Fill ${step.selectorRef} with ${step.dataRef || step.value}`,
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
priority: 10,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'check-checkbox',
|
|
113
|
+
// `\bchecks?\b` rather than `includes('checks')`: "unchecks" CONTAINS "checks", and this
|
|
114
|
+
// pattern is declared before uncheck-checkbox at the same priority 8 — so the substring test
|
|
115
|
+
// made every `unchecks [X]` step compile to a CHECK, turning the control ON and even labelling
|
|
116
|
+
// the comment "Check". A word boundary cannot match inside "unchecks" (both neighbours are word
|
|
117
|
+
// characters), so it separates the two verbs on its own.
|
|
118
|
+
matcher: (step) => /\bchecks?\b/.test(step.text) && !!step.selectorRef,
|
|
119
|
+
resolver: (step, context) => {
|
|
120
|
+
const resolved = context.selectorResolver.resolveSelector(step.selectorRef, undefined, step.elementType, step.nth);
|
|
121
|
+
return {
|
|
122
|
+
templateName: 'check-action',
|
|
123
|
+
data: { ...resolved, selectorRef: step.selectorRef },
|
|
124
|
+
comment: `Check ${step.selectorRef}`,
|
|
125
|
+
};
|
|
126
|
+
},
|
|
127
|
+
priority: 8,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'uncheck-checkbox',
|
|
131
|
+
// One regex covers both forms: `\buncheck\b` alone cannot match "unchecks" (the trailing "s"
|
|
132
|
+
// is a word character, so there is no boundary after "k") — which is why the substring test
|
|
133
|
+
// was here in the first place.
|
|
134
|
+
matcher: (step) => /\bunchecks?\b/.test(step.text) && !!step.selectorRef,
|
|
135
|
+
resolver: (step, context) => {
|
|
136
|
+
const resolved = context.selectorResolver.resolveSelector(step.selectorRef, undefined, step.elementType, step.nth);
|
|
137
|
+
return {
|
|
138
|
+
templateName: 'uncheck-action',
|
|
139
|
+
data: { ...resolved, selectorRef: step.selectorRef },
|
|
140
|
+
comment: `Uncheck ${step.selectorRef}`,
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
priority: 8,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'select-dropdown',
|
|
147
|
+
matcher: (step) => (step.text.includes('selects') || step.text.match(/\bselect\b/)) &&
|
|
148
|
+
!!step.selectorRef &&
|
|
149
|
+
!!(step.dataRef || step.value),
|
|
150
|
+
resolver: (step, context) => {
|
|
151
|
+
const resolved = context.selectorResolver.resolveSelector(step.selectorRef, undefined, step.elementType, step.nth);
|
|
152
|
+
let value;
|
|
153
|
+
if (step.dataRef) {
|
|
154
|
+
value = context.dataResolver.resolveData(step.dataRef, context.featureName);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
value = step.value;
|
|
158
|
+
}
|
|
159
|
+
const isRadio = resolved.role === 'radio' || step.text.includes('radio');
|
|
160
|
+
const isCheckbox = resolved.role === 'checkbox' || step.text.includes('checkbox');
|
|
161
|
+
let templateName;
|
|
162
|
+
let data;
|
|
163
|
+
if (isRadio) {
|
|
164
|
+
templateName = 'radio-select-action';
|
|
165
|
+
data = { ...resolved, selectorRef: step.selectorRef, selectValue: value };
|
|
166
|
+
}
|
|
167
|
+
else if (isCheckbox) {
|
|
168
|
+
templateName = 'check-action';
|
|
169
|
+
data = { ...resolved, selectorRef: step.selectorRef };
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
const nativeSelectRoles = ['combobox', 'listbox', 'select'];
|
|
173
|
+
// A native <select> is detected by its ARIA role, or by an explicit `variant: native`
|
|
174
|
+
// on the selector entry (lets a CSS/#id-located select opt into .selectOption()).
|
|
175
|
+
const isNativeSelect = nativeSelectRoles.includes(resolved.role) || resolved.variant === 'native';
|
|
176
|
+
// Widget variant resolution (spec §3): per-element `variant:` wins over the app
|
|
177
|
+
// profile's `widgets.select`. A matching recipe's `select` intent expands to
|
|
178
|
+
// Playwright lines at compile time; native/unknown variants keep the legacy fork.
|
|
179
|
+
const variantName = resolved.variant || context.appProfile?.widgetVariants?.['select'];
|
|
180
|
+
const recipeSteps = variantName && variantName !== 'native'
|
|
181
|
+
? context.appProfile?.recipes?.[variantName]?.['select']
|
|
182
|
+
: undefined;
|
|
183
|
+
if (recipeSteps) {
|
|
184
|
+
try {
|
|
185
|
+
const steps = (0, sungen_1.expandRecipe)(recipeSteps, {
|
|
186
|
+
triggerCode: context.renderLocator(resolved),
|
|
187
|
+
value,
|
|
188
|
+
});
|
|
189
|
+
return {
|
|
190
|
+
templateName: 'recipe-sequence',
|
|
191
|
+
data: { steps },
|
|
192
|
+
comment: `Select ${step.dataRef || step.value} in ${step.selectorRef} (${variantName} recipe)`,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
// malformed recipe → generic fallback below
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (isNativeSelect) {
|
|
200
|
+
templateName = 'select-action';
|
|
201
|
+
// Role alone cannot prove a native <select>: `combobox` is also the role of a
|
|
202
|
+
// `<button role="combobox">` trigger (Radix/shadcn, MUI, Headless UI), where
|
|
203
|
+
// .selectOption() throws "Element is not a <select> element". Probe the tag at
|
|
204
|
+
// runtime unless the entry pins `variant: native`. A recipe (above) still wins.
|
|
205
|
+
data = {
|
|
206
|
+
...resolved,
|
|
207
|
+
selectorRef: step.selectorRef,
|
|
208
|
+
selectValue: value,
|
|
209
|
+
probeNative: resolved.variant !== 'native',
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
templateName = 'click-select-action';
|
|
214
|
+
data = { ...resolved, selectorRef: step.selectorRef, selectValue: value };
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
templateName,
|
|
219
|
+
data,
|
|
220
|
+
comment: `Select ${step.dataRef || step.value} in ${step.selectorRef}`,
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
priority: 8,
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'clear-input',
|
|
227
|
+
matcher: (step) => (step.text.includes('clears') || step.text.match(/\bclear\b/)) && !!step.selectorRef,
|
|
228
|
+
resolver: (step, context) => {
|
|
229
|
+
const resolved = context.selectorResolver.resolveSelector(step.selectorRef, undefined, step.elementType, step.nth);
|
|
230
|
+
return {
|
|
231
|
+
templateName: 'clear-action',
|
|
232
|
+
data: { ...resolved, selectorRef: step.selectorRef },
|
|
233
|
+
comment: `Clear ${step.selectorRef}`,
|
|
234
|
+
};
|
|
235
|
+
},
|
|
236
|
+
priority: 7,
|
|
237
|
+
},
|
|
238
|
+
];
|
|
239
|
+
//# sourceMappingURL=form-patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-patterns.js","sourceRoot":"","sources":["../../src/patterns/form-patterns.ts"],"names":[],"mappings":";;;AACA,iDAAmF;AAEnF;;GAEG;AACU,QAAA,YAAY,GAAkB;IACzC;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,CAAC,KAAK,CAAC;QAClB,mBAAmB,EACjB,qJAAqJ;QACvJ,OAAO,EAAE,CAAC,IAAgB,EAAE,EAAE,CAC5B,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC3D,IAAI,CAAC,WAAW,KAAK,UAAU;YAC/B,CAAC,CAAC,IAAI,CAA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SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YACpH,OAAO;gBACL,YAAY,EAAE,cAAc;gBAC5B,IAAI,EAAE,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;gBACpD,OAAO,EAAE,SAAS,IAAI,CAAC,WAAW,EAAE;aACrC,CAAC;QACJ,CAAC;QACD,QAAQ,EAAE,CAAC;KACZ;CACF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StepPattern } from '@sun-asterisk/sungen';
|
|
2
|
+
/** A parsed click position: each axis is `px` or `%` of the element's padding box (ratio precomputed). */
|
|
3
|
+
export interface ClickPosition {
|
|
4
|
+
x: number;
|
|
5
|
+
xUnit: 'px' | '%';
|
|
6
|
+
xRatio: number;
|
|
7
|
+
y: number;
|
|
8
|
+
yUnit: 'px' | '%';
|
|
9
|
+
yRatio: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parse the `at position "<preset>"` / `at offset x=<n>px|%, y=<n>px|%` suffix. Strict on purpose:
|
|
13
|
+
* anything the grammar does not accept is an error the compiler reports — a position that is half
|
|
14
|
+
* understood would click somewhere the author did not ask for.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseClickPosition(text: string): ClickPosition | {
|
|
17
|
+
error: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const interactionPatterns: StepPattern[];
|
|
20
|
+
//# sourceMappingURL=interaction-patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-patterns.d.ts","sourceRoot":"","sources":["../../src/patterns/interaction-patterns.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAyCnD,0GAA0G;AAC1G,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,IAAI,GAAG,GAAG,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAC7C,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,IAAI,GAAG,GAAG,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;CAC9C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CA2BlF;AAED,eAAO,MAAM,mBAAmB,EAAE,WAAW,EAimB5C,CAAC"}
|