@skeletonizer/utils 2.2.5 → 2.4.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.
- package/README.md +35 -0
- package/dist/src/components/skeleton.abstract.component.d.ts.map +1 -1
- package/dist/src/components/skeleton.adapter.component.d.ts.map +1 -1
- package/dist/src/constants/enum.constants.d.ts +1 -0
- package/dist/src/constants/enum.constants.d.ts.map +1 -1
- package/dist/src/directives/skeleton.directive.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/models/schema-item.model.d.ts +22 -0
- package/dist/src/models/schema-item.model.d.ts.map +1 -1
- package/dist/src/models/schema-item.model.types.d.ts +4 -0
- package/dist/src/models/schema-item.model.types.d.ts.map +1 -0
- package/dist/src/models/schema.model.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +3 -3
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/spec/transformer.types.spec-d.d.ts +11 -0
- package/dist/src/types/spec/transformer.types.spec-d.d.ts.map +1 -1
- package/dist/src/types/transformer.types.d.ts +6 -1
- package/dist/src/types/transformer.types.d.ts.map +1 -1
- package/dist/utils.mjs +241 -699
- package/dist/utils.umd.js +2 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -63,6 +63,11 @@ It can be chained on a number value - in that case, it turns the integer into a
|
|
|
63
63
|
Turns the string or number value of the `SchemaItem` instance into a currency string of the provided locale and currency.
|
|
64
64
|
This can be used in combination with the `number` method to simulate prices in different currencies - eg. `new SchemaItem().number(10, 100).currency({ locale: 'en-US', currency: 'USD' })`.
|
|
65
65
|
|
|
66
|
+
### `currencyCode(lowercase?: boolean)`
|
|
67
|
+
Generates a random ISO 4217 currency code from a set of 10 common currencies (`USD`, `EUR`, `GBP`, `JPY`, `CNY`, `AUD`, `CAD`, `CHF`, `SEK`, `NZD`).
|
|
68
|
+
By default returns an uppercase code. Pass `true` for a lowercase code — eg. `new SchemaItem().currencyCode(true)` returns `'usd'`, `'eur'`, etc.
|
|
69
|
+
Return types are typed as literal unions, so TypeScript will narrow the result accordingly.
|
|
70
|
+
|
|
66
71
|
### `multiply(multiplier: number)`
|
|
67
72
|
Multiplies the current value of the `SchemaItem` instance by the `multiplier` parameter.
|
|
68
73
|
This can be used for chaining the `SchemaItem().foo()` methods if `foo` returns a number - ie `new SchemaItem().number(10, 100).multiply(5)`.
|
|
@@ -75,6 +80,21 @@ This can be used eg. for simulating dates of birth, dates of creation, etc.
|
|
|
75
80
|
Generates a random time of day, using the formatting specified by the `config` parameter.
|
|
76
81
|
It can be chained to the `date` method should you wish to further restrict available times (eg. by providing a min and max date to the `date` method that are on the same day within the desired time range).
|
|
77
82
|
|
|
83
|
+
### `format(formatStr: string)`
|
|
84
|
+
Formats a date value using a simplified format string (similar to `date-fns`).
|
|
85
|
+
If the value is already a `Date`, it is used directly; otherwise a random date is generated first.
|
|
86
|
+
Can be chained with the `date` method to control the date range — eg. `new SchemaItem().date({ isFuture: true }).format('yyyy-MM-dd')`.
|
|
87
|
+
|
|
88
|
+
Supported format tokens:
|
|
89
|
+
- `yyyy` — 4-digit year (eg. `2026`)
|
|
90
|
+
- `yy` — 2-digit year (eg. `26`)
|
|
91
|
+
- `MM` — zero-padded month (`01`–`12`)
|
|
92
|
+
- `dd` — zero-padded day (`01`–`31`)
|
|
93
|
+
- `HH` — zero-padded 24-hour hour (`00`–`23`)
|
|
94
|
+
- `hh` — zero-padded 12-hour hour (`01`–`12`)
|
|
95
|
+
- `mm` — zero-padded minutes (`00`–`59`)
|
|
96
|
+
- `ss` — zero-padded seconds (`00`–`59`)
|
|
97
|
+
|
|
78
98
|
### `uuid()`
|
|
79
99
|
Increments a global `uuid` variable and sets the current value of the `SchemaItem` instance to this new value.
|
|
80
100
|
This can be used eg. for simulating user ids, etc.
|
|
@@ -86,6 +106,11 @@ This can be used eg. for simulating whether a user is active, whether a product
|
|
|
86
106
|
### `symbol(val: string | number = 0)`
|
|
87
107
|
Creates a new unique symbol with the provided `val` as the description.
|
|
88
108
|
|
|
109
|
+
### `stringify()`
|
|
110
|
+
Converts the current value (number, boolean, or symbol) to its string representation.
|
|
111
|
+
This can be used eg. for converting a generated number or boolean to a string for display — ie. `new SchemaItem().number(1, 100).stringify()`.
|
|
112
|
+
For converting dates to strings, use the `format` method instead.
|
|
113
|
+
|
|
89
114
|
### `randomItem(items: R[])`
|
|
90
115
|
Sets the current value of the `SchemaItem` instance to a random item provided in the `items` parameter.
|
|
91
116
|
|
|
@@ -103,6 +128,16 @@ This can be used eg. for providing a specific (general) placeholder image that y
|
|
|
103
128
|
It can also be used for providing any specific class instances that you might be using in your app (eg. `moment` for dates, which may be used in the view, a specific `enum` value, a `UserModel` etc).
|
|
104
129
|
It allows you to provide your own (randomly generated) data, with type safety, for usage in skeleton config schema (eg. you could use it in conjunction with more realistic first names generated by `faker` or similar packages).
|
|
105
130
|
|
|
131
|
+
### `countryCode(config?: { iso?: 'iso2' | 'iso3'; lowercase?: boolean })`
|
|
132
|
+
Generates a random ISO 3166-1 country code from a set of 10 common countries (`US`, `GB`, `DE`, `FR`, `JP`, `CN`, `AU`, `CA`, `CH`, `SE`).
|
|
133
|
+
By default, returns an uppercase alpha-2 code (eg. `US`, `DE`). Use `{ iso: 'iso3' }` for alpha-3 codes (eg. `USA`, `DEU`) and `{ lowercase: true }` for lowercase output.
|
|
134
|
+
Return types are typed as literal unions depending on `iso` and `lowercase` options, so TypeScript will narrow the result accordingly.
|
|
135
|
+
This can be used eg. for simulating country selectors, locale-based displays, etc.
|
|
136
|
+
|
|
137
|
+
### `email()`
|
|
138
|
+
Generates a random email address composed of a lowercase lorem ipsum word, a random number, and one of 5 common domains (`gmail.com`, `outlook.com`, `yahoo.com`, `example.com`, `mail.com`).
|
|
139
|
+
This can be used eg. for simulating user email fields, contact forms, etc.
|
|
140
|
+
|
|
106
141
|
## TSchemaConfig
|
|
107
142
|
The `TSchemaConfig` type is the configuration object type being used to define the skeleton structure. It is used by all adapters in some shape or form.
|
|
108
143
|
The general shape is:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.abstract.component.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton.abstract.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"skeleton.abstract.component.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton.abstract.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,8BAAsB,yBAAyB,CAAC,CAAC,SAAS,MAAM;IAC9D,SAAgB,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACjD,SAAgB,YAAY,EAAE,OAAO,CAAC;IAM/B,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;CAGtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.adapter.component.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton.adapter.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"skeleton.adapter.component.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton.adapter.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,qBAAa,wBAAwB,CAAC,CAAC,SAAS,MAAM;IAC7C,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAQ;IACvC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAM;IAGlC,WAAW,IAAI,IAAI;CAM3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.constants.d.ts","sourceRoot":"","sources":["../../../src/constants/enum.constants.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,cAAc,oBAAoB;CACnC;AAED,oBAAY,2BAA2B;IACrC,YAAY,4BAA4B;IACxC,cAAc,4BAA4B;CAC3C"}
|
|
1
|
+
{"version":3,"file":"enum.constants.d.ts","sourceRoot":"","sources":["../../../src/constants/enum.constants.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,cAAc,oBAAoB;CACnC;AAED,oBAAY,2BAA2B;IACrC,YAAY,4BAA4B;IACxC,cAAc,4BAA4B;CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.directive.d.ts","sourceRoot":"","sources":["../../../src/directives/skeleton.directive.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"skeleton.directive.d.ts","sourceRoot":"","sources":["../../../src/directives/skeleton.directive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,qBAAa,iBAAiB;IAC5B,gBAAuB,QAAQ,EAAE,MAAM,CAAuB;WAEhD,4BAA4B,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,EAAE,wBAAwB,GAAG,IAAI;IA4F/G,OAAO,CAAC,MAAM,CAAC,yBAAyB;IASxC,OAAO,CAAC,MAAM,CAAC,SAAS;IAIxB,OAAO,CAAC,MAAM,CAAC,QAAQ;CACxB"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,mBAAmB,SAAS,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TSchemaCountryCodeIso2, TSchemaCountryCodeIso3, TSchemaCurrencyCode } from './schema-item.model.types';
|
|
1
2
|
type TSchemaInstance<T> = InstanceType<typeof SchemaItem<T>>;
|
|
2
3
|
export declare class SchemaItem<T = never> {
|
|
3
4
|
#private;
|
|
@@ -18,6 +19,27 @@ export declare class SchemaItem<T = never> {
|
|
|
18
19
|
max: Date;
|
|
19
20
|
min: Date;
|
|
20
21
|
}>): TSchemaInstance<Date>;
|
|
22
|
+
stringify(this: TSchemaInstance<number | boolean | symbol>): TSchemaInstance<string>;
|
|
23
|
+
format(this: TSchemaInstance<Date | undefined>, formatStr: string): TSchemaInstance<string>;
|
|
24
|
+
currencyCode(this: TSchemaInstance<string | undefined>, lowercase: true): TSchemaInstance<Lowercase<TSchemaCurrencyCode>>;
|
|
25
|
+
currencyCode(this: TSchemaInstance<string | undefined>, lowercase?: false): TSchemaInstance<TSchemaCurrencyCode>;
|
|
26
|
+
countryCode(this: TSchemaInstance<string | undefined>, config: {
|
|
27
|
+
iso: 'iso3';
|
|
28
|
+
lowercase: true;
|
|
29
|
+
}): TSchemaInstance<Lowercase<TSchemaCountryCodeIso3>>;
|
|
30
|
+
countryCode(this: TSchemaInstance<string | undefined>, config: {
|
|
31
|
+
iso: 'iso3';
|
|
32
|
+
lowercase?: false;
|
|
33
|
+
}): TSchemaInstance<TSchemaCountryCodeIso3>;
|
|
34
|
+
countryCode(this: TSchemaInstance<string | undefined>, config: {
|
|
35
|
+
iso?: 'iso2';
|
|
36
|
+
lowercase: true;
|
|
37
|
+
}): TSchemaInstance<Lowercase<TSchemaCountryCodeIso2>>;
|
|
38
|
+
countryCode(this: TSchemaInstance<string | undefined>, config?: {
|
|
39
|
+
iso?: 'iso2';
|
|
40
|
+
lowercase?: false;
|
|
41
|
+
}): TSchemaInstance<TSchemaCountryCodeIso2>;
|
|
42
|
+
email(this: TSchemaInstance<string | undefined>): TSchemaInstance<string>;
|
|
21
43
|
timeOfDay(this: TSchemaInstance<Date | undefined>, config?: Partial<{
|
|
22
44
|
use12HourFormat: boolean;
|
|
23
45
|
showSeconds: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-item.model.d.ts","sourceRoot":"","sources":["../../../src/models/schema-item.model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-item.model.d.ts","sourceRoot":"","sources":["../../../src/models/schema-item.model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhH,KAAK,eAAe,CAAC,CAAC,IAAI,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7D,qBAAa,UAAU,CAAC,CAAC,GAAG,KAAK;;IAC/B,IAAW,KAAK,IAAI,CAAC,CAEpB;IAIM,KAAK,CAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;IAexF,UAAU,CAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;IAsB7F,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,SAAS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 = 'USA' | 'GBR' | 'DEU' | 'FRA' | 'JPN' | 'CHN' | 'AUS' | 'CAN' | 'CHE' | 'SWE';
|
|
4
|
+
//# sourceMappingURL=schema-item.model.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-item.model.types.d.ts","sourceRoot":"","sources":["../../../src/models/schema-item.model.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAChH,MAAM,MAAM,sBAAsB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACzG,MAAM,MAAM,sBAAsB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.model.d.ts","sourceRoot":"","sources":["../../../src/models/schema.model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.model.d.ts","sourceRoot":"","sources":["../../../src/models/schema.model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAIrE,qBAAa,MAAM,CAAC,CAAC,SAAS,MAAM;aAWhB,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAVhD,SAAgB,IAAI,EAAE,MAAM,CAAe;IAC3C,SAAgB,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAEjD,IAAW,KAAK,IAAI,CAAC,CAEpB;IAED,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAI;gBAGN,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAMhD,OAAO,CAAC,MAAM,CAAC,YAAY;CAiB5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './color-schema.types';
|
|
2
|
-
export * from './schema.types';
|
|
3
|
-
export * from './transformer.types';
|
|
1
|
+
export type * from './color-schema.types';
|
|
2
|
+
export type * from './schema.types';
|
|
3
|
+
export type * from './transformer.types';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,qBAAqB,CAAC"}
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
interface ICustomLeaf {
|
|
2
|
+
custom: boolean;
|
|
3
|
+
nested: {
|
|
4
|
+
deep: string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
declare module '../transformer.types' {
|
|
8
|
+
interface ISchemaLeafTypes {
|
|
9
|
+
customLeaf: ICustomLeaf;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
1
12
|
export {};
|
|
2
13
|
//# sourceMappingURL=transformer.types.spec-d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.types.spec-d.d.ts","sourceRoot":"","sources":["../../../../src/types/spec/transformer.types.spec-d.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"transformer.types.spec-d.d.ts","sourceRoot":"","sources":["../../../../src/types/spec/transformer.types.spec-d.ts"],"names":[],"mappings":"AAKA,UAAU,WAAW;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1B;AAED,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,gBAAgB;QACxB,UAAU,EAAE,WAAW,CAAC;KACzB;CACF"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { SchemaItem } from '../models';
|
|
2
|
-
export
|
|
2
|
+
export interface ISchemaLeafTypes {
|
|
3
|
+
date: Date;
|
|
4
|
+
}
|
|
5
|
+
type TSchemaLeaf = ISchemaLeafTypes[keyof ISchemaLeafTypes];
|
|
6
|
+
export type TSchemaTransformer<T> = T extends Array<infer Element> ? Array<TSchemaTransformer<Element>> : T extends boolean ? SchemaItem<boolean> : T extends TSchemaLeaf ? SchemaItem<T> : T extends object ? {
|
|
3
7
|
[K in keyof T]: TSchemaTransformer<T[K]>;
|
|
4
8
|
} : SchemaItem<T>;
|
|
9
|
+
export {};
|
|
5
10
|
//# sourceMappingURL=transformer.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.types.d.ts","sourceRoot":"","sources":["../../../src/types/transformer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAC9B,CAAC,SAAS,KAAK,CAAC,MAAM,OAAO,CAAC,GAC1B,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAClC,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"transformer.types.d.ts","sourceRoot":"","sources":["../../../src/types/transformer.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,KAAK,WAAW,GAAG,gBAAgB,CAAC,MAAM,gBAAgB,CAAC,CAAC;AAE5D,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAC9B,CAAC,SAAS,KAAK,CAAC,MAAM,OAAO,CAAC,GAC1B,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAClC,CAAC,SAAS,OAAO,GACf,UAAU,CAAC,OAAO,CAAC,GACnB,CAAC,SAAS,WAAW,GACnB,UAAU,CAAC,CAAC,CAAC,GACb,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC5C,UAAU,CAAC,CAAC,CAAC,CAAC"}
|