fashionable 0.2.0 → 0.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/dist/calc/index.d.mts +1 -1
- package/dist/calc/index.mjs +1 -1
- package/dist/data/index.d.mts +2 -208
- package/dist/data/index.mjs +73 -54
- package/dist/data/index.mjs.map +1 -1
- package/dist/declaration/index.d.mts +1 -1
- package/dist/declaration/index.mjs +9 -28
- package/dist/declaration/index.mjs.map +1 -1
- package/dist/fontFace/index.d.mts +1 -1
- package/dist/property/index.d.mts +1 -1
- package/dist/property/index.mjs +1 -1
- package/dist/property/index.mjs.map +1 -1
- package/dist/query/index.d.mts +1 -1
- package/dist/query/index.mjs +137 -3
- package/dist/query/index.mjs.map +1 -1
- package/dist/rule/index.d.mts +1 -1
- package/dist/rule/index.mjs +45 -33
- package/dist/rule/index.mjs.map +1 -1
- package/dist/selector/index.d.mts +1 -1
- package/dist/selector/index.mjs +117 -21
- package/dist/selector/index.mjs.map +1 -1
- package/dist/shared/{calc-Cih4o2r7.mjs → calc-Uwbxd7CS.mjs} +233 -165
- package/dist/shared/calc-Uwbxd7CS.mjs.map +1 -0
- package/dist/shared/{color.internal-Dts5ycTm.mjs → color.internal-CxjlaRqR.mjs} +48 -13
- package/dist/shared/color.internal-CxjlaRqR.mjs.map +1 -0
- package/dist/shared/declaration-CqRm38oZ.d.mts +264 -0
- package/dist/shared/declaration.internal-bHzvbanA.mjs +121 -0
- package/dist/shared/declaration.internal-bHzvbanA.mjs.map +1 -0
- package/dist/shared/{fontFaceRule-C7nYgH6X.d.mts → fontFaceRule-BOgUM4PF.d.mts} +3 -3
- package/dist/shared/index-D-hVWDgZ.d.mts +2289 -0
- package/dist/shared/mediaQuery-VDIAHnM1.d.mts +333 -0
- package/dist/shared/{mediaQuery.internal-B6iuMd75.mjs → mediaQuery.internal-CKTmLVxL.mjs} +70 -6
- package/dist/shared/mediaQuery.internal-CKTmLVxL.mjs.map +1 -0
- package/dist/shared/{mediaRule-BDB4WCYy.d.mts → mediaRule-2K7Ggwe4.d.mts} +169 -105
- package/dist/shared/{propertyRule-BbkFh9b9.d.mts → propertyRule-B9ii0mv4.d.mts} +56 -21
- package/dist/shared/{propertyRule.internal-Bc_HrfcL.mjs → propertyRule.internal-ncYCWUar.mjs} +31 -4
- package/dist/shared/propertyRule.internal-ncYCWUar.mjs.map +1 -0
- package/dist/shared/{ruleSet.internal-DodzVMUU.mjs → ruleSet.internal-Cj4yIYFI.mjs} +31 -18
- package/dist/shared/ruleSet.internal-Cj4yIYFI.mjs.map +1 -0
- package/dist/shared/selector-BkxnzX_6.d.mts +615 -0
- package/dist/shared/{selector.internal-ESe9s0IH.mjs → selector.internal-B3iu_RpX.mjs} +144 -30
- package/dist/shared/selector.internal-B3iu_RpX.mjs.map +1 -0
- package/dist/shared/{utils-BKm298I-.d.mts → utils-DpN6qr94.d.mts} +4 -4
- package/dist/shared/var.internal-DSxAzEFN.mjs +119 -0
- package/dist/shared/var.internal-DSxAzEFN.mjs.map +1 -0
- package/dist/stylesheet/index.d.mts +93 -60
- package/dist/stylesheet/index.mjs +111 -35
- package/dist/stylesheet/index.mjs.map +1 -1
- package/dist/utils.d.mts +1 -1
- package/dist/utils.mjs.map +1 -1
- package/dist/var/index.d.mts +2 -0
- package/dist/var/index.mjs +177 -0
- package/dist/var/index.mjs.map +1 -0
- package/package.json +8 -2
- package/dist/shared/calc-Cih4o2r7.mjs.map +0 -1
- package/dist/shared/color-BvNJ2YqL.d.mts +0 -590
- package/dist/shared/color.internal-Dts5ycTm.mjs.map +0 -1
- package/dist/shared/declaration-1DlO_ltT.d.mts +0 -166
- package/dist/shared/declaration.internal-wLB4ssxC.mjs +0 -73
- package/dist/shared/declaration.internal-wLB4ssxC.mjs.map +0 -1
- package/dist/shared/index-BvtwY4FQ.d.mts +0 -841
- package/dist/shared/mediaQuery-BYR1z-iD.d.mts +0 -145
- package/dist/shared/mediaQuery.internal-B6iuMd75.mjs.map +0 -1
- package/dist/shared/propertyRule.internal-Bc_HrfcL.mjs.map +0 -1
- package/dist/shared/ruleSet.internal-DodzVMUU.mjs.map +0 -1
- package/dist/shared/selector-HZY-W6l6.d.mts +0 -346
- package/dist/shared/selector.internal-ESe9s0IH.mjs.map +0 -1
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { t as Pipeable } from "./utils-DpN6qr94.mjs";
|
|
2
|
+
//#region src/query/mediaQuery.internal.d.ts
|
|
3
|
+
declare const MediaQueryTypeId: unique symbol;
|
|
4
|
+
type MediaQueryTypeId = typeof MediaQueryTypeId;
|
|
5
|
+
/**
|
|
6
|
+
* Phantom key holding a `MediaQuery`'s `Features` parameter. The runtime
|
|
7
|
+
* never stores a value here — known features are type-level brands, so a
|
|
8
|
+
* query is identical at runtime whatever its type knows (the curvy trait
|
|
9
|
+
* pattern, as `ColorSpace` uses for polar-ness).
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
declare const MediaQueryFeatures: unique symbol;
|
|
14
|
+
type MediaQueryFeatures = typeof MediaQueryFeatures;
|
|
15
|
+
declare namespace mediaQuery_d_exports {
|
|
16
|
+
export { MaxWidth, MediaQuery, MinWidth, PrefersColorScheme, RenderOptions, and, equals, getMaxWidth, getMinWidth, getPrefersColorScheme, hasMaxWidth, hasMinWidth, hasPrefersColorScheme, isMediaQuery, maxWidth, minWidth, prefersColorScheme, render };
|
|
17
|
+
}
|
|
18
|
+
declare const MinWidthId: unique symbol;
|
|
19
|
+
declare const MaxWidthId: unique symbol;
|
|
20
|
+
declare const PrefersColorSchemeId: unique symbol;
|
|
21
|
+
/**
|
|
22
|
+
* A media query: a canonically ordered, deduplicated and-set of media
|
|
23
|
+
* features.
|
|
24
|
+
*
|
|
25
|
+
* Feature constructors (`minWidth`, `maxWidth`, `prefersColorScheme`)
|
|
26
|
+
* return one-feature queries; `and` merges. Conjunction is commutative
|
|
27
|
+
* and idempotent, so construction sorts features canonically and drops
|
|
28
|
+
* exact duplicates — structurally equal queries compare equal however
|
|
29
|
+
* they were built. The canonical order is stable public API: `min-width`
|
|
30
|
+
* features first (ascending by threshold), then `max-width` (ascending),
|
|
31
|
+
* then `prefers-color-scheme` (schemes alphabetically). Distinct features
|
|
32
|
+
* always all render, even when one subsumes another (`minWidth(768)` and
|
|
33
|
+
* `minWidth(1024)`): simplification changes no meaning but is not this
|
|
34
|
+
* type's job.
|
|
35
|
+
*
|
|
36
|
+
* `Features` records, as intersected type-level brands, which feature
|
|
37
|
+
* kinds are known to be present. It defaults to `unknown` — no claims.
|
|
38
|
+
* Constructors brand their result (`minWidth` returns
|
|
39
|
+
* `MediaQuery<MinWidth>`), `and` keeps both sides' brands, the `has*`
|
|
40
|
+
* guards recover a brand from a plain query at runtime, and the `get*`
|
|
41
|
+
* accessors key their return type on it to drop `undefined`. Brands are
|
|
42
|
+
* type-level only: a query is identical at runtime whatever its type
|
|
43
|
+
* knows.
|
|
44
|
+
*
|
|
45
|
+
* `or` and `not` become new node kinds when a consumer needs them.
|
|
46
|
+
*
|
|
47
|
+
* @since 0.1.0
|
|
48
|
+
*/
|
|
49
|
+
interface MediaQuery<out Features = unknown> extends Pipeable {
|
|
50
|
+
readonly [MediaQueryTypeId]: MediaQueryTypeId;
|
|
51
|
+
readonly [MediaQueryFeatures]?: Features;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The brand of a query known to carry a `min-width` feature. `minWidth`
|
|
55
|
+
* stamps it, `and` keeps it through conjunction, `hasMinWidth` recovers
|
|
56
|
+
* it at runtime, and `getMinWidth` returns a guaranteed `number` where it
|
|
57
|
+
* is present. Composes by intersection with the other feature brands.
|
|
58
|
+
*
|
|
59
|
+
* @since 0.3.0
|
|
60
|
+
*/
|
|
61
|
+
type MinWidth = {
|
|
62
|
+
readonly [MinWidthId]: 'minWidth';
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The brand of a query known to carry a `max-width` feature. `maxWidth`
|
|
66
|
+
* stamps it, `and` keeps it through conjunction, `hasMaxWidth` recovers
|
|
67
|
+
* it at runtime, and `getMaxWidth` returns a guaranteed `number` where it
|
|
68
|
+
* is present. Composes by intersection with the other feature brands.
|
|
69
|
+
*
|
|
70
|
+
* @since 0.3.0
|
|
71
|
+
*/
|
|
72
|
+
type MaxWidth = {
|
|
73
|
+
readonly [MaxWidthId]: 'maxWidth';
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The brand of a query known to carry a `prefers-color-scheme` feature.
|
|
77
|
+
* `prefersColorScheme` stamps it, `and` keeps it through conjunction,
|
|
78
|
+
* `hasPrefersColorScheme` recovers it at runtime, and
|
|
79
|
+
* `getPrefersColorScheme` returns a guaranteed scheme where it is
|
|
80
|
+
* present. Composes by intersection with the other feature brands.
|
|
81
|
+
*
|
|
82
|
+
* @since 0.3.0
|
|
83
|
+
*/
|
|
84
|
+
type PrefersColorScheme = {
|
|
85
|
+
readonly [PrefersColorSchemeId]: 'prefersColorScheme';
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Options for `render` — and the base of the library's render-options
|
|
89
|
+
* family: every other module's `RenderOptions` extends this interface
|
|
90
|
+
* (directly or through `Declaration.RenderOptions` and
|
|
91
|
+
* `RuleSet.RenderOptions`), so an options object built for a bigger
|
|
92
|
+
* renderer is accepted by every smaller one. A key means the same thing
|
|
93
|
+
* wherever it appears; renderers ignore inherited keys that don't apply
|
|
94
|
+
* to them.
|
|
95
|
+
*
|
|
96
|
+
* @since 0.1.0
|
|
97
|
+
*/
|
|
98
|
+
interface RenderOptions {
|
|
99
|
+
/**
|
|
100
|
+
* The width-feature spelling: classic prefix syntax
|
|
101
|
+
* (`(min-width: 768px)`, the default) or modern range syntax
|
|
102
|
+
* (`(width >= 768px)`). Text only — the model is semantic and the two
|
|
103
|
+
* spellings mean the same thing.
|
|
104
|
+
*/
|
|
105
|
+
readonly mediaSyntax?: 'prefix' | 'range';
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Checks if a value is a `MediaQuery`.
|
|
109
|
+
*
|
|
110
|
+
* True only for values built by this module's constructors, which carry
|
|
111
|
+
* the brand.
|
|
112
|
+
*
|
|
113
|
+
* @param u - The value to check.
|
|
114
|
+
* @returns `true` if the value is a `MediaQuery`, `false` otherwise.
|
|
115
|
+
* @since 0.1.0
|
|
116
|
+
*/
|
|
117
|
+
declare const isMediaQuery: (u: unknown) => u is MediaQuery;
|
|
118
|
+
/**
|
|
119
|
+
* Creates a viewport-width lower bound.
|
|
120
|
+
*
|
|
121
|
+
* The result carries the `MinWidth` brand, so `getMinWidth` returns a
|
|
122
|
+
* bare `number` on it and on any conjunction built from it.
|
|
123
|
+
*
|
|
124
|
+
* @param px - The threshold in CSS pixels. Must be a non-negative finite number.
|
|
125
|
+
* @returns A one-feature `MediaQuery`, branded `MinWidth`.
|
|
126
|
+
* @throws `Error` when `px` is negative or not finite.
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* MediaQuery.render(MediaQuery.minWidth(768)) // '(min-width: 768px)'
|
|
130
|
+
* MediaQuery.render(MediaQuery.minWidth(768), { mediaSyntax: 'range' }) // '(width >= 768px)'
|
|
131
|
+
* ```
|
|
132
|
+
* @since 0.1.0
|
|
133
|
+
*/
|
|
134
|
+
declare const minWidth: (px: number) => MediaQuery<MinWidth>;
|
|
135
|
+
/**
|
|
136
|
+
* Creates a viewport-width upper bound.
|
|
137
|
+
*
|
|
138
|
+
* The result carries the `MaxWidth` brand, so `getMaxWidth` returns a
|
|
139
|
+
* bare `number` on it and on any conjunction built from it.
|
|
140
|
+
*
|
|
141
|
+
* @param px - The threshold in CSS pixels. Must be a non-negative finite number.
|
|
142
|
+
* @returns A one-feature `MediaQuery`, branded `MaxWidth`.
|
|
143
|
+
* @throws `Error` when `px` is negative or not finite.
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* MediaQuery.render(MediaQuery.maxWidth(1024)) // '(max-width: 1024px)'
|
|
147
|
+
* MediaQuery.render(MediaQuery.maxWidth(1024), { mediaSyntax: 'range' }) // '(width <= 1024px)'
|
|
148
|
+
* ```
|
|
149
|
+
* @since 0.3.0
|
|
150
|
+
*/
|
|
151
|
+
declare const maxWidth: (px: number) => MediaQuery<MaxWidth>;
|
|
152
|
+
/**
|
|
153
|
+
* Creates a `prefers-color-scheme` condition.
|
|
154
|
+
*
|
|
155
|
+
* The result carries the `PrefersColorScheme` brand, so
|
|
156
|
+
* `getPrefersColorScheme` returns a guaranteed scheme on it and on any
|
|
157
|
+
* conjunction built from it.
|
|
158
|
+
*
|
|
159
|
+
* @param scheme - The scheme to match, `'dark'` or `'light'`.
|
|
160
|
+
* @returns A one-feature `MediaQuery`, branded `PrefersColorScheme`.
|
|
161
|
+
* @since 0.1.0
|
|
162
|
+
*/
|
|
163
|
+
declare const prefersColorScheme: (scheme: 'dark' | 'light') => MediaQuery<PrefersColorScheme>;
|
|
164
|
+
declare const and: {
|
|
165
|
+
/**
|
|
166
|
+
* Returns a function that conjoins `that` with its argument.
|
|
167
|
+
*
|
|
168
|
+
* @param that - The query to merge in.
|
|
169
|
+
* @returns A function producing the conjunction.
|
|
170
|
+
* @since 0.1.0
|
|
171
|
+
*/
|
|
172
|
+
<B>(that: MediaQuery<B>): <A>(self: MediaQuery<A>) => MediaQuery<A & B>;
|
|
173
|
+
/**
|
|
174
|
+
* Conjoins two queries: the result matches where both match. Features
|
|
175
|
+
* re-sort into canonical order and exact duplicates collapse, so `and`
|
|
176
|
+
* is commutative and idempotent.
|
|
177
|
+
*
|
|
178
|
+
* Known features intersect: the result keeps every brand either side
|
|
179
|
+
* carries, so a `MinWidth` query stays `MinWidth` through conjunction.
|
|
180
|
+
*
|
|
181
|
+
* @param self - The first query.
|
|
182
|
+
* @param that - The second query.
|
|
183
|
+
* @returns The conjunction, branded with both sides' known features.
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts
|
|
186
|
+
* MediaQuery.minWidth(1280).pipe(
|
|
187
|
+
* MediaQuery.and(MediaQuery.prefersColorScheme('dark')),
|
|
188
|
+
* MediaQuery.render,
|
|
189
|
+
* ) // '(min-width: 1280px) and (prefers-color-scheme: dark)'
|
|
190
|
+
* ```
|
|
191
|
+
* @since 0.1.0
|
|
192
|
+
*/
|
|
193
|
+
<A, B>(self: MediaQuery<A>, that: MediaQuery<B>): MediaQuery<A & B>;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Gets the query's `min-width` threshold.
|
|
197
|
+
*
|
|
198
|
+
* The return type keys on the `MinWidth` brand. Where the type proves a
|
|
199
|
+
* `min-width` feature is present — `minWidth`'s result, any conjunction
|
|
200
|
+
* keeping its brand, or a query narrowed by `hasMinWidth` — the result is
|
|
201
|
+
* a bare `number`. On any other query it is `number | undefined`.
|
|
202
|
+
*
|
|
203
|
+
* When several `min-width` features stack, the largest threshold is
|
|
204
|
+
* returned — the conjunction's effective lower bound, since every
|
|
205
|
+
* feature must hold.
|
|
206
|
+
*
|
|
207
|
+
* @param query - The query to read.
|
|
208
|
+
* @returns The largest `min-width` threshold in CSS pixels, or `undefined` when an unbranded query carries no `min-width` feature.
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* MediaQuery.getMinWidth(MediaQuery.minWidth(768)) // 768
|
|
212
|
+
* MediaQuery.getMinWidth(MediaQuery.prefersColorScheme('dark')) // undefined
|
|
213
|
+
* MediaQuery.minWidth(768).pipe(
|
|
214
|
+
* MediaQuery.and(MediaQuery.minWidth(1024)),
|
|
215
|
+
* MediaQuery.getMinWidth,
|
|
216
|
+
* ) // 1024
|
|
217
|
+
* ```
|
|
218
|
+
* @since 0.3.0
|
|
219
|
+
*/
|
|
220
|
+
declare const getMinWidth: <T>(query: MediaQuery<T>) => T extends MinWidth ? number : number | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Gets the query's `max-width` threshold.
|
|
223
|
+
*
|
|
224
|
+
* The return type keys on the `MaxWidth` brand. Where the type proves a
|
|
225
|
+
* `max-width` feature is present — `maxWidth`'s result, any conjunction
|
|
226
|
+
* keeping its brand, or a query narrowed by `hasMaxWidth` — the result is
|
|
227
|
+
* a bare `number`. On any other query it is `number | undefined`.
|
|
228
|
+
*
|
|
229
|
+
* When several `max-width` features stack, the smallest threshold is
|
|
230
|
+
* returned — the conjunction's effective upper bound, since every
|
|
231
|
+
* feature must hold.
|
|
232
|
+
*
|
|
233
|
+
* @param query - The query to read.
|
|
234
|
+
* @returns The smallest `max-width` threshold in CSS pixels, or `undefined` when an unbranded query carries no `max-width` feature.
|
|
235
|
+
* @example
|
|
236
|
+
* ```ts
|
|
237
|
+
* MediaQuery.getMaxWidth(MediaQuery.maxWidth(1024)) // 1024
|
|
238
|
+
* MediaQuery.getMaxWidth(MediaQuery.minWidth(768)) // undefined
|
|
239
|
+
* ```
|
|
240
|
+
* @since 0.3.0
|
|
241
|
+
*/
|
|
242
|
+
declare const getMaxWidth: <T>(query: MediaQuery<T>) => T extends MaxWidth ? number : number | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Gets the query's `prefers-color-scheme` value.
|
|
245
|
+
*
|
|
246
|
+
* The return type keys on the `PrefersColorScheme` brand. Where the type
|
|
247
|
+
* proves the feature is present, the result is a bare `'dark' | 'light'`.
|
|
248
|
+
* On any other query it may also be `undefined`.
|
|
249
|
+
*
|
|
250
|
+
* A query holding both schemes matches nothing; the accessor then
|
|
251
|
+
* returns `'dark'`, the alphabetically first in canonical order.
|
|
252
|
+
*
|
|
253
|
+
* @param query - The query to read.
|
|
254
|
+
* @returns The required scheme, or `undefined` when an unbranded query carries no `prefers-color-scheme` feature.
|
|
255
|
+
* @example
|
|
256
|
+
* ```ts
|
|
257
|
+
* MediaQuery.getPrefersColorScheme(MediaQuery.prefersColorScheme('dark')) // 'dark'
|
|
258
|
+
* MediaQuery.getPrefersColorScheme(MediaQuery.minWidth(768)) // undefined
|
|
259
|
+
* ```
|
|
260
|
+
* @since 0.3.0
|
|
261
|
+
*/
|
|
262
|
+
declare const getPrefersColorScheme: <T>(query: MediaQuery<T>) => T extends PrefersColorScheme ? 'dark' | 'light' : 'dark' | 'light' | undefined;
|
|
263
|
+
/**
|
|
264
|
+
* Checks if the query carries a `min-width` feature, narrowing its type
|
|
265
|
+
* to `MediaQuery<MinWidth>` so `getMinWidth` returns a bare `number`.
|
|
266
|
+
*
|
|
267
|
+
* @param query - The query to check.
|
|
268
|
+
* @returns `true` if a `min-width` feature is present, `false` otherwise.
|
|
269
|
+
* @example
|
|
270
|
+
* ```ts
|
|
271
|
+
* declare const query: MediaQuery.MediaQuery
|
|
272
|
+
* if (MediaQuery.hasMinWidth(query)) {
|
|
273
|
+
* MediaQuery.getMinWidth(query) // number, not number | undefined
|
|
274
|
+
* }
|
|
275
|
+
* ```
|
|
276
|
+
* @since 0.3.0
|
|
277
|
+
*/
|
|
278
|
+
declare const hasMinWidth: (query: MediaQuery) => query is MediaQuery<MinWidth>;
|
|
279
|
+
/**
|
|
280
|
+
* Checks if the query carries a `max-width` feature, narrowing its type
|
|
281
|
+
* to `MediaQuery<MaxWidth>` so `getMaxWidth` returns a bare `number`.
|
|
282
|
+
*
|
|
283
|
+
* @param query - The query to check.
|
|
284
|
+
* @returns `true` if a `max-width` feature is present, `false` otherwise.
|
|
285
|
+
* @since 0.3.0
|
|
286
|
+
*/
|
|
287
|
+
declare const hasMaxWidth: (query: MediaQuery) => query is MediaQuery<MaxWidth>;
|
|
288
|
+
/**
|
|
289
|
+
* Checks if the query carries a `prefers-color-scheme` feature, narrowing
|
|
290
|
+
* its type to `MediaQuery<PrefersColorScheme>` so `getPrefersColorScheme`
|
|
291
|
+
* returns a guaranteed scheme.
|
|
292
|
+
*
|
|
293
|
+
* @param query - The query to check.
|
|
294
|
+
* @returns `true` if a `prefers-color-scheme` feature is present, `false` otherwise.
|
|
295
|
+
* @since 0.3.0
|
|
296
|
+
*/
|
|
297
|
+
declare const hasPrefersColorScheme: (query: MediaQuery) => query is MediaQuery<PrefersColorScheme>;
|
|
298
|
+
/**
|
|
299
|
+
* Renders the query as CSS text: features in canonical order —
|
|
300
|
+
* `min-width` ascending, then `prefers-color-scheme` — joined with
|
|
301
|
+
* ` and `. The `mediaSyntax` option picks the width-feature spelling
|
|
302
|
+
* (default `'prefix'`).
|
|
303
|
+
*
|
|
304
|
+
* @param query - The query to render.
|
|
305
|
+
* @param options - Optional syntax selection.
|
|
306
|
+
* @returns Deterministic CSS text, without the `@media ` prefix.
|
|
307
|
+
* @since 0.1.0
|
|
308
|
+
*/
|
|
309
|
+
declare const render: (query: MediaQuery, options?: RenderOptions) => string;
|
|
310
|
+
declare const equals: {
|
|
311
|
+
/**
|
|
312
|
+
* Returns a function that checks structural equality against `that`.
|
|
313
|
+
*
|
|
314
|
+
* @param that - The query to compare against.
|
|
315
|
+
* @returns A function testing its argument for structural equality with `that`.
|
|
316
|
+
* @since 0.1.0
|
|
317
|
+
*/
|
|
318
|
+
(that: MediaQuery): (self: MediaQuery) => boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Structural equality over canonically ordered features: two queries
|
|
321
|
+
* built from the same conditions compare equal regardless of
|
|
322
|
+
* construction order.
|
|
323
|
+
*
|
|
324
|
+
* @param self - The first query.
|
|
325
|
+
* @param that - The second query.
|
|
326
|
+
* @returns `true` if the queries are structurally equal.
|
|
327
|
+
* @since 0.1.0
|
|
328
|
+
*/
|
|
329
|
+
(self: MediaQuery, that: MediaQuery): boolean;
|
|
330
|
+
};
|
|
331
|
+
//#endregion
|
|
332
|
+
export { RenderOptions as n, mediaQuery_d_exports as r, MediaQuery as t };
|
|
333
|
+
//# sourceMappingURL=mediaQuery-VDIAHnM1.d.mts.map
|
|
@@ -6,25 +6,26 @@ const MediaQueryTypeId = Symbol.for("fashionable/query/mediaQuery");
|
|
|
6
6
|
const featureRank = (feature) => {
|
|
7
7
|
switch (feature._tag) {
|
|
8
8
|
case "MinWidth": return 0;
|
|
9
|
-
case "
|
|
9
|
+
case "MaxWidth": return 1;
|
|
10
|
+
case "PrefersColorScheme": return 2;
|
|
10
11
|
}
|
|
11
12
|
};
|
|
12
13
|
const compareFeatures = (a, b) => {
|
|
13
14
|
const rank = featureRank(a) - featureRank(b);
|
|
14
15
|
if (rank !== 0) return rank;
|
|
15
|
-
if (a._tag === "MinWidth") return a.px - b.px;
|
|
16
|
+
if (a._tag === "MinWidth" || a._tag === "MaxWidth") return a.px - b.px;
|
|
16
17
|
const x = a.scheme;
|
|
17
18
|
const y = b.scheme;
|
|
18
19
|
return x < y ? -1 : x > y ? 1 : 0;
|
|
19
20
|
};
|
|
20
21
|
const featureEquals = (a, b) => {
|
|
21
22
|
if (a._tag !== b._tag) return false;
|
|
22
|
-
if (a._tag === "MinWidth") return a.px === b.px;
|
|
23
|
+
if (a._tag === "MinWidth" || a._tag === "MaxWidth") return a.px === b.px;
|
|
23
24
|
return a.scheme === b.scheme;
|
|
24
25
|
};
|
|
25
26
|
const featureHash = (feature) => {
|
|
26
27
|
const h = hashString(feature._tag);
|
|
27
|
-
if (feature._tag === "MinWidth") return combine(h, hashNumber(feature.px));
|
|
28
|
+
if (feature._tag === "MinWidth" || feature._tag === "MaxWidth") return combine(h, hashNumber(feature.px));
|
|
28
29
|
return combine(h, hashString(feature.scheme));
|
|
29
30
|
};
|
|
30
31
|
const renderFeature = (feature, syntax) => {
|
|
@@ -33,6 +34,10 @@ const renderFeature = (feature, syntax) => {
|
|
|
33
34
|
const px = formatDecimals(feature.px, 5);
|
|
34
35
|
return syntax === "prefix" ? `(min-width: ${px}px)` : `(width >= ${px}px)`;
|
|
35
36
|
}
|
|
37
|
+
case "MaxWidth": {
|
|
38
|
+
const px = formatDecimals(feature.px, 5);
|
|
39
|
+
return syntax === "prefix" ? `(max-width: ${px}px)` : `(width <= ${px}px)`;
|
|
40
|
+
}
|
|
36
41
|
case "PrefersColorScheme": return `(prefers-color-scheme: ${feature.scheme})`;
|
|
37
42
|
}
|
|
38
43
|
};
|
|
@@ -84,6 +89,14 @@ const minWidth = (px) => {
|
|
|
84
89
|
}]);
|
|
85
90
|
};
|
|
86
91
|
/** @internal */
|
|
92
|
+
const maxWidth = (px) => {
|
|
93
|
+
invariant(Number.isFinite(px) && px >= 0, `max-width threshold must be a non-negative finite number of pixels, got ${px}`);
|
|
94
|
+
return new MediaQueryImpl([{
|
|
95
|
+
_tag: "MaxWidth",
|
|
96
|
+
px
|
|
97
|
+
}]);
|
|
98
|
+
};
|
|
99
|
+
/** @internal */
|
|
87
100
|
const prefersColorScheme = (scheme) => new MediaQueryImpl([{
|
|
88
101
|
_tag: "PrefersColorScheme",
|
|
89
102
|
scheme
|
|
@@ -91,10 +104,61 @@ const prefersColorScheme = (scheme) => new MediaQueryImpl([{
|
|
|
91
104
|
/** @internal */
|
|
92
105
|
const and = dual(2, (self, that) => new MediaQueryImpl(canonicalize([...featuresOf(self), ...featuresOf(that)])));
|
|
93
106
|
/** @internal */
|
|
107
|
+
function getMinWidth(query) {
|
|
108
|
+
return featuresOf(query).findLast((feature) => feature._tag === "MinWidth")?.px;
|
|
109
|
+
}
|
|
110
|
+
/** @internal */
|
|
111
|
+
function getMaxWidth(query) {
|
|
112
|
+
return featuresOf(query).find((feature) => feature._tag === "MaxWidth")?.px;
|
|
113
|
+
}
|
|
114
|
+
/** @internal */
|
|
115
|
+
function getPrefersColorScheme(query) {
|
|
116
|
+
return featuresOf(query).find((feature) => feature._tag === "PrefersColorScheme")?.scheme;
|
|
117
|
+
}
|
|
118
|
+
/** @internal */
|
|
119
|
+
const hasMinWidth = (query) => featuresOf(query).some((feature) => feature._tag === "MinWidth");
|
|
120
|
+
/** @internal */
|
|
121
|
+
const hasMaxWidth = (query) => featuresOf(query).some((feature) => feature._tag === "MaxWidth");
|
|
122
|
+
/** @internal */
|
|
123
|
+
const hasPrefersColorScheme = (query) => featuresOf(query).some((feature) => feature._tag === "PrefersColorScheme");
|
|
124
|
+
const EMPTY_FEATURES = [];
|
|
125
|
+
const optionalFeaturesOf = (query) => query === void 0 ? EMPTY_FEATURES : featuresOf(query);
|
|
126
|
+
const featureImplies = (source, target) => {
|
|
127
|
+
switch (target._tag) {
|
|
128
|
+
case "MinWidth": return source._tag === "MinWidth" && source.px >= target.px;
|
|
129
|
+
case "MaxWidth": return source._tag === "MaxWidth" && source.px <= target.px;
|
|
130
|
+
case "PrefersColorScheme": return source._tag === "PrefersColorScheme" && source.scheme === target.scheme;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
/** @internal */
|
|
134
|
+
const implies = (self, that) => {
|
|
135
|
+
const source = optionalFeaturesOf(self);
|
|
136
|
+
return optionalFeaturesOf(that).every((target) => source.some((feature) => featureImplies(feature, target)));
|
|
137
|
+
};
|
|
138
|
+
/** @internal */
|
|
139
|
+
const coSatisfiable = (self, that) => {
|
|
140
|
+
let lower = 0;
|
|
141
|
+
let upper = Number.POSITIVE_INFINITY;
|
|
142
|
+
let scheme;
|
|
143
|
+
for (const feature of [...optionalFeaturesOf(self), ...optionalFeaturesOf(that)]) switch (feature._tag) {
|
|
144
|
+
case "MinWidth":
|
|
145
|
+
lower = Math.max(lower, feature.px);
|
|
146
|
+
break;
|
|
147
|
+
case "MaxWidth":
|
|
148
|
+
upper = Math.min(upper, feature.px);
|
|
149
|
+
break;
|
|
150
|
+
case "PrefersColorScheme":
|
|
151
|
+
if (scheme !== void 0 && scheme !== feature.scheme) return false;
|
|
152
|
+
scheme = feature.scheme;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
return lower <= upper;
|
|
156
|
+
};
|
|
157
|
+
/** @internal */
|
|
94
158
|
const render = (query, options) => renderImpl(query, options?.mediaSyntax ?? "prefix");
|
|
95
159
|
/** @internal */
|
|
96
160
|
const equals = dual(2, (self, that) => equals$1(self, that));
|
|
97
161
|
//#endregion
|
|
98
|
-
export {
|
|
162
|
+
export { getMinWidth as a, hasMinWidth as c, isMediaQuery as d, maxWidth as f, render as h, getMaxWidth as i, hasPrefersColorScheme as l, prefersColorScheme as m, coSatisfiable as n, getPrefersColorScheme as o, minWidth as p, equals as r, hasMaxWidth as s, and as t, implies as u };
|
|
99
163
|
|
|
100
|
-
//# sourceMappingURL=mediaQuery.internal-
|
|
164
|
+
//# sourceMappingURL=mediaQuery.internal-CKTmLVxL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaQuery.internal-CKTmLVxL.mjs","names":["Equal.hashString","Equal.combine","Equal.hashNumber","Equal.EqualTypeId","Equal.HashTypeId","#hash","Equal.equals"],"sources":["../../src/query/mediaQuery.internal.ts"],"sourcesContent":["import * as Equal from '#internal/equal'\nimport { formatDecimals } from '#internal/format'\nimport { dual, invariant, Pipeable } from '#util'\nimport type {\n MaxWidth,\n MediaQuery,\n MinWidth,\n PrefersColorScheme,\n RenderOptions,\n} from './mediaQuery.ts'\n\nexport const MediaQueryTypeId = Symbol.for('fashionable/query/mediaQuery')\nexport type MediaQueryTypeId = typeof MediaQueryTypeId\n\n/**\n * Phantom key holding a `MediaQuery`'s `Features` parameter. The runtime\n * never stores a value here — known features are type-level brands, so a\n * query is identical at runtime whatever its type knows (the curvy trait\n * pattern, as `ColorSpace` uses for polar-ness).\n *\n * @internal\n */\nexport const MediaQueryFeatures: unique symbol = Symbol.for('fashionable/query/mediaQuery/features')\nexport type MediaQueryFeatures = typeof MediaQueryFeatures\n\n// ---------------------------------------------------------------------------\n// feature ADT\n// ---------------------------------------------------------------------------\n\n/** @internal */\nexport type MediaFeature =\n | { readonly _tag: 'MinWidth'; readonly px: number }\n | { readonly _tag: 'MaxWidth'; readonly px: number }\n | { readonly _tag: 'PrefersColorScheme'; readonly scheme: 'dark' | 'light' }\n\n// Feature kinds order by definition rank, then within kind: widths\n// ascending by threshold, scheme values alphabetically. Conjunction is\n// commutative and idempotent, so the model sorts and dedups at\n// construction; equal queries compare equal however they were built.\n// max-width slots beside min-width — a new kind reshuffles no existing\n// output, so it takes the rank that reads best, not the end of the ladder.\nconst featureRank = (feature: MediaFeature): number => {\n switch (feature._tag) {\n case 'MinWidth':\n return 0\n case 'MaxWidth':\n return 1\n case 'PrefersColorScheme':\n return 2\n }\n}\n\nconst compareFeatures = (a: MediaFeature, b: MediaFeature): number => {\n const rank = featureRank(a) - featureRank(b)\n if (rank !== 0) {\n return rank\n }\n if (a._tag === 'MinWidth' || a._tag === 'MaxWidth') {\n return a.px - (b as typeof a).px\n }\n const x = (a as Extract<MediaFeature, { _tag: 'PrefersColorScheme' }>).scheme\n const y = (b as Extract<MediaFeature, { _tag: 'PrefersColorScheme' }>).scheme\n return x < y ? -1 : x > y ? 1 : 0\n}\n\nconst featureEquals = (a: MediaFeature, b: MediaFeature): boolean => {\n if (a._tag !== b._tag) {\n return false\n }\n if (a._tag === 'MinWidth' || a._tag === 'MaxWidth') {\n return a.px === (b as typeof a).px\n }\n return a.scheme === (b as typeof a).scheme\n}\n\nconst featureHash = (feature: MediaFeature): number => {\n const h = Equal.hashString(feature._tag)\n if (feature._tag === 'MinWidth' || feature._tag === 'MaxWidth') {\n return Equal.combine(h, Equal.hashNumber(feature.px))\n }\n return Equal.combine(h, Equal.hashString(feature.scheme))\n}\n\nconst renderFeature = (feature: MediaFeature, syntax: 'prefix' | 'range'): string => {\n switch (feature._tag) {\n case 'MinWidth': {\n const px = formatDecimals(feature.px, 5)\n return syntax === 'prefix' ? `(min-width: ${px}px)` : `(width >= ${px}px)`\n }\n case 'MaxWidth': {\n const px = formatDecimals(feature.px, 5)\n return syntax === 'prefix' ? `(max-width: ${px}px)` : `(width <= ${px}px)`\n }\n case 'PrefersColorScheme':\n return `(prefers-color-scheme: ${feature.scheme})`\n }\n}\n\nconst canonicalize = (features: ReadonlyArray<MediaFeature>): ReadonlyArray<MediaFeature> => {\n const sorted = [...features].toSorted(compareFeatures)\n const deduped: Array<MediaFeature> = []\n for (const feature of sorted) {\n const last = deduped[deduped.length - 1]\n if (last === undefined || !featureEquals(last, feature)) {\n deduped.push(feature)\n }\n }\n return deduped\n}\n\n// ---------------------------------------------------------------------------\n// the value\n// ---------------------------------------------------------------------------\n\nclass MediaQueryImpl extends Pipeable implements MediaQuery, Equal.Equal {\n readonly [MediaQueryTypeId]: MediaQueryTypeId = MediaQueryTypeId\n\n readonly features: ReadonlyArray<MediaFeature>\n #hash: number | undefined\n\n constructor(features: ReadonlyArray<MediaFeature>) {\n super()\n this.features = features\n }\n\n [Equal.EqualTypeId](that: unknown): boolean {\n return (\n isMediaQuery(that) &&\n this.features.length === featuresOf(that).length &&\n this.features.every((feature, index) =>\n featureEquals(feature, featuresOf(that)[index] as MediaFeature),\n )\n )\n }\n\n [Equal.HashTypeId](): number {\n if (this.#hash === undefined) {\n let h = Equal.hashString('fashionable/query/mediaQuery')\n for (const feature of this.features) {\n h = Equal.combine(h, featureHash(feature))\n }\n this.#hash = h\n }\n return this.#hash\n }\n\n get [Symbol.toStringTag]() {\n return `MediaQuery(${renderImpl(this, 'prefix')})`\n }\n\n get [Symbol.for('nodejs.util.inspect.custom')]() {\n return this[Symbol.toStringTag]\n }\n}\n\n/** @internal */\nexport const isMediaQuery = (u: unknown): u is MediaQuery =>\n typeof u === 'object' && u !== null && MediaQueryTypeId in u\n\nconst featuresOf = (query: MediaQuery): ReadonlyArray<MediaFeature> =>\n (query as MediaQueryImpl).features\n\nconst renderImpl = (query: MediaQuery, syntax: 'prefix' | 'range'): string =>\n featuresOf(query)\n .map((feature) => renderFeature(feature, syntax))\n .join(' and ')\n\n// ---------------------------------------------------------------------------\n// constructors, combinators, projections\n// ---------------------------------------------------------------------------\n\n/** @internal */\nexport const minWidth = (px: number): MediaQuery<MinWidth> => {\n invariant(\n Number.isFinite(px) && px >= 0,\n `min-width threshold must be a non-negative finite number of pixels, got ${px}`,\n )\n return new MediaQueryImpl([{ _tag: 'MinWidth', px }])\n}\n\n/** @internal */\nexport const maxWidth = (px: number): MediaQuery<MaxWidth> => {\n invariant(\n Number.isFinite(px) && px >= 0,\n `max-width threshold must be a non-negative finite number of pixels, got ${px}`,\n )\n return new MediaQueryImpl([{ _tag: 'MaxWidth', px }])\n}\n\n/** @internal */\nexport const prefersColorScheme = (scheme: 'dark' | 'light'): MediaQuery<PrefersColorScheme> =>\n new MediaQueryImpl([{ _tag: 'PrefersColorScheme', scheme }])\n\n// `MediaQuery<never>` is the bottom of the covariant trait parameter, so\n// the erased implementation assigns to every public trait instantiation\n// (the same move as `Color<never>` under `mix`).\n/** @internal */\nexport const and = dual<\n (that: MediaQuery) => (self: MediaQuery) => MediaQuery<never>,\n (self: MediaQuery, that: MediaQuery) => MediaQuery<never>\n>(\n 2,\n (self: MediaQuery, that: MediaQuery): MediaQuery<never> =>\n new MediaQueryImpl(canonicalize([...featuresOf(self), ...featuresOf(that)])),\n)\n\n// Accessors are single generic signatures, not two-overload sets: an\n// overloaded function contributes only its last signature to inference\n// when passed higher-order (a pipe tail), which would erase the brand\n// guarantee exactly where it earns its keep. The conditional return\n// survives both positions.\n/** @internal */\nexport function getMinWidth<T>(\n query: MediaQuery<T>,\n): T extends MinWidth ? number : number | undefined\n/** @internal */\nexport function getMinWidth(query: MediaQuery): number | undefined {\n // Min-widths sort ascending in canonical order, so the last one is the\n // conjunction's effective lower bound (every feature must hold).\n return featuresOf(query).findLast((feature) => feature._tag === 'MinWidth')?.px\n}\n\n/** @internal */\nexport function getMaxWidth<T>(\n query: MediaQuery<T>,\n): T extends MaxWidth ? number : number | undefined\n/** @internal */\nexport function getMaxWidth(query: MediaQuery): number | undefined {\n // Max-widths sort ascending in canonical order, so the first one is the\n // conjunction's effective upper bound (every feature must hold).\n return featuresOf(query).find((feature) => feature._tag === 'MaxWidth')?.px\n}\n\n/** @internal */\nexport function getPrefersColorScheme<T>(\n query: MediaQuery<T>,\n): T extends PrefersColorScheme ? 'dark' | 'light' : 'dark' | 'light' | undefined\n/** @internal */\nexport function getPrefersColorScheme(query: MediaQuery): 'dark' | 'light' | undefined {\n return featuresOf(query).find((feature) => feature._tag === 'PrefersColorScheme')?.scheme\n}\n\n/** @internal */\nexport const hasMinWidth = (query: MediaQuery): query is MediaQuery<MinWidth> =>\n featuresOf(query).some((feature) => feature._tag === 'MinWidth')\n\n/** @internal */\nexport const hasMaxWidth = (query: MediaQuery): query is MediaQuery<MaxWidth> =>\n featuresOf(query).some((feature) => feature._tag === 'MaxWidth')\n\n/** @internal */\nexport const hasPrefersColorScheme = (query: MediaQuery): query is MediaQuery<PrefersColorScheme> =>\n featuresOf(query).some((feature) => feature._tag === 'PrefersColorScheme')\n\n// ---------------------------------------------------------------------------\n// query relations\n// ---------------------------------------------------------------------------\n\n// Conjunction reasoning for the shadow-safe strict coalesce check\n// (stylesheet.internal.ts). Both relations treat `undefined` as the empty\n// conjunction: a bare declaration applies in every state. They read the\n// canonical and-set part-wise rather than through the accessors — the\n// accessors report effective bounds, which cannot see a degenerate\n// `dark and light` query, and a setter that never applies must not count\n// as re-establishing a value.\n\nconst EMPTY_FEATURES: ReadonlyArray<MediaFeature> = []\n\nconst optionalFeaturesOf = (query: MediaQuery | undefined): ReadonlyArray<MediaFeature> =>\n query === undefined ? EMPTY_FEATURES : featuresOf(query)\n\nconst featureImplies = (source: MediaFeature, target: MediaFeature): boolean => {\n switch (target._tag) {\n case 'MinWidth':\n return source._tag === 'MinWidth' && source.px >= target.px\n case 'MaxWidth':\n return source._tag === 'MaxWidth' && source.px <= target.px\n case 'PrefersColorScheme':\n return source._tag === 'PrefersColorScheme' && source.scheme === target.scheme\n }\n}\n\n// `self` implies `that` when `that` holds in every state where `self`\n// holds: every part of `that` is implied by some part of `self` — a\n// larger min-width, a smaller max-width, the same scheme.\n/** @internal */\nexport const implies = (self: MediaQuery | undefined, that: MediaQuery | undefined): boolean => {\n const source = optionalFeaturesOf(self)\n return optionalFeaturesOf(that).every((target) =>\n source.some((feature) => featureImplies(feature, target)),\n )\n}\n\n// The conjunction of both queries is satisfiable in some state: no\n// conflicting scheme values, and a non-empty width interval — the largest\n// min-width at most the smallest max-width, both bounds inclusive. Either\n// side's internal contradiction (dark and light, an empty interval) makes\n// the pair unsatisfiable, as it must.\n/** @internal */\nexport const coSatisfiable = (\n self: MediaQuery | undefined,\n that: MediaQuery | undefined,\n): boolean => {\n let lower = 0\n let upper = Number.POSITIVE_INFINITY\n let scheme: 'dark' | 'light' | undefined\n for (const feature of [...optionalFeaturesOf(self), ...optionalFeaturesOf(that)]) {\n switch (feature._tag) {\n case 'MinWidth':\n lower = Math.max(lower, feature.px)\n break\n case 'MaxWidth':\n upper = Math.min(upper, feature.px)\n break\n case 'PrefersColorScheme':\n if (scheme !== undefined && scheme !== feature.scheme) {\n return false\n }\n scheme = feature.scheme\n break\n }\n }\n return lower <= upper\n}\n\n/** @internal */\nexport const render = (query: MediaQuery, options?: RenderOptions): string =>\n renderImpl(query, options?.mediaSyntax ?? 'prefix')\n\n/** @internal */\nexport const equals = dual<\n (that: MediaQuery) => (self: MediaQuery) => boolean,\n (self: MediaQuery, that: MediaQuery) => boolean\n>(2, (self: MediaQuery, that: MediaQuery): boolean => Equal.equals(self, that))\n"],"mappings":";;;;AAWA,MAAa,mBAAmB,OAAO,IAAI,8BAA8B;AA8BzE,MAAM,eAAe,YAAkC;CACrD,QAAQ,QAAQ,MAAhB;EACE,KAAK,YACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,sBACH,OAAO;CACX;AACF;AAEA,MAAM,mBAAmB,GAAiB,MAA4B;CACpE,MAAM,OAAO,YAAY,CAAC,IAAI,YAAY,CAAC;CAC3C,IAAI,SAAS,GACX,OAAO;CAET,IAAI,EAAE,SAAS,cAAc,EAAE,SAAS,YACtC,OAAO,EAAE,KAAM,EAAe;CAEhC,MAAM,IAAK,EAA4D;CACvE,MAAM,IAAK,EAA4D;CACvE,OAAO,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI;AAClC;AAEA,MAAM,iBAAiB,GAAiB,MAA6B;CACnE,IAAI,EAAE,SAAS,EAAE,MACf,OAAO;CAET,IAAI,EAAE,SAAS,cAAc,EAAE,SAAS,YACtC,OAAO,EAAE,OAAQ,EAAe;CAElC,OAAO,EAAE,WAAY,EAAe;AACtC;AAEA,MAAM,eAAe,YA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