@simpleapps-com/augur-web 2.4.0 → 2026.11.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/EXPORTS.md +18 -189
- package/README.md +18 -364
- package/dist/accordion.cjs.map +1 -1
- package/dist/accordion.d.ts +4 -5
- package/dist/accordion.d.ts.map +1 -0
- package/dist/add-to-cart-button.cjs.map +1 -1
- package/dist/add-to-cart-button.d.ts +5 -8
- package/dist/add-to-cart-button.d.ts.map +1 -0
- package/dist/breadcrumb.cjs.map +1 -1
- package/dist/breadcrumb.d.ts +5 -7
- package/dist/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumbs.cjs.map +1 -1
- package/dist/breadcrumbs.d.ts +4 -4
- package/dist/breadcrumbs.d.ts.map +1 -0
- package/dist/button.cjs.map +1 -1
- package/dist/button.d.ts +7 -9
- package/dist/button.d.ts.map +1 -0
- package/dist/card.cjs.map +1 -1
- package/dist/card.d.ts +3 -4
- package/dist/card.d.ts.map +1 -0
- package/dist/checkbox.cjs.map +1 -1
- package/dist/checkbox.d.ts +3 -4
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/chunk-32XB3REY.cjs.map +1 -1
- package/dist/chunk-5VMEEKZ5.cjs.map +1 -1
- package/dist/chunk-5ZITWMV4.cjs.map +1 -1
- package/dist/chunk-76RSVRGB.cjs.map +1 -1
- package/dist/chunk-7EXXNELX.cjs.map +1 -1
- package/dist/chunk-BXMTQGKV.cjs.map +1 -1
- package/dist/{chunk-DCXYO3RB.js → chunk-C6K7FZNX.js} +7 -3
- package/dist/chunk-C6K7FZNX.js.map +1 -0
- package/dist/{chunk-AE4GLYJE.cjs → chunk-DMWSWL4B.cjs} +7 -3
- package/dist/chunk-DMWSWL4B.cjs.map +1 -0
- package/dist/chunk-GSR6SMQ2.cjs.map +1 -1
- package/dist/chunk-IO77MGHW.js +220 -0
- package/dist/chunk-IO77MGHW.js.map +1 -0
- package/dist/chunk-JXW4XE2P.cjs.map +1 -1
- package/dist/{chunk-OJ5G4BLS.js → chunk-KVHOMD4T.js} +15 -18
- package/dist/chunk-KVHOMD4T.js.map +1 -0
- package/dist/chunk-MAENILZP.cjs.map +1 -1
- package/dist/chunk-NEY26NNF.cjs.map +1 -1
- package/dist/chunk-QKWXJM4Q.cjs +220 -0
- package/dist/chunk-QKWXJM4Q.cjs.map +1 -0
- package/dist/chunk-T52J3SHP.cjs.map +1 -1
- package/dist/{chunk-I5NVZORX.cjs → chunk-TFP5RICB.cjs} +15 -18
- package/dist/chunk-TFP5RICB.cjs.map +1 -0
- package/dist/chunk-UFL6PVLI.cjs.map +1 -1
- package/dist/chunk-VL6L4GDA.cjs.map +1 -1
- package/dist/chunk-WJUDOEVB.cjs.map +1 -1
- package/dist/chunk-XGKBDPGD.cjs.map +1 -1
- package/dist/chunk-Z57QBVUC.cjs.map +1 -1
- package/dist/command.cjs +1 -0
- package/dist/command.cjs.map +1 -1
- package/dist/command.d.ts +13 -15
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +1 -0
- package/dist/command.js.map +1 -1
- package/dist/confirm-dialog.cjs.map +1 -1
- package/dist/confirm-dialog.d.ts +4 -6
- package/dist/confirm-dialog.d.ts.map +1 -0
- package/dist/data-table.cjs +35 -23
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.d.ts +9 -11
- package/dist/data-table.d.ts.map +1 -0
- package/dist/data-table.js +34 -22
- package/dist/data-table.js.map +1 -1
- package/dist/detail-panel.cjs.map +1 -1
- package/dist/detail-panel.d.ts +6 -8
- package/dist/detail-panel.d.ts.map +1 -0
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.d.ts +6 -8
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dropdown-menu.cjs.map +1 -1
- package/dist/dropdown-menu.d.ts +5 -7
- package/dist/dropdown-menu.d.ts.map +1 -0
- package/dist/financing-widget.cjs +1 -3
- package/dist/financing-widget.cjs.map +1 -1
- package/dist/financing-widget.d.ts +5 -6
- package/dist/financing-widget.d.ts.map +1 -0
- package/dist/financing-widget.js +1 -3
- package/dist/financing-widget.js.map +1 -1
- package/dist/form-field.cjs.map +1 -1
- package/dist/form-field.d.ts +4 -5
- package/dist/form-field.d.ts.map +1 -0
- package/dist/form-input.cjs.map +1 -1
- package/dist/form-input.d.ts +4 -5
- package/dist/form-input.d.ts.map +1 -0
- package/dist/form-select.cjs.map +1 -1
- package/dist/form-select.d.ts +4 -5
- package/dist/form-select.d.ts.map +1 -0
- package/dist/form-textarea.cjs.map +1 -1
- package/dist/form-textarea.d.ts +4 -5
- package/dist/form-textarea.d.ts.map +1 -0
- package/dist/gtm.cjs +3 -2
- package/dist/gtm.cjs.map +1 -1
- package/dist/gtm.d.ts +12 -15
- package/dist/gtm.d.ts.map +1 -0
- package/dist/gtm.js +2 -1
- package/dist/input.cjs.map +1 -1
- package/dist/input.d.ts +4 -5
- package/dist/input.d.ts.map +1 -0
- package/dist/label.cjs.map +1 -1
- package/dist/label.d.ts +5 -7
- package/dist/label.d.ts.map +1 -0
- package/dist/list-view.cjs.map +1 -1
- package/dist/list-view.d.ts +5 -7
- package/dist/list-view.d.ts.map +1 -0
- package/dist/mdx-components.cjs +5 -2
- package/dist/mdx-components.cjs.map +1 -1
- package/dist/mdx-components.d.ts +11 -6
- package/dist/mdx-components.d.ts.map +1 -0
- package/dist/mdx-components.js +5 -2
- package/dist/mdx-components.js.map +1 -1
- package/dist/navigation-menu.cjs.map +1 -1
- package/dist/navigation-menu.d.ts +5 -7
- package/dist/navigation-menu.d.ts.map +1 -0
- package/dist/pagination.cjs +3 -2
- package/dist/pagination.cjs.map +1 -1
- package/dist/pagination.d.ts +10 -14
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +2 -1
- package/dist/payment-modal.cjs +20 -19
- package/dist/payment-modal.cjs.map +1 -1
- package/dist/payment-modal.d.ts +5 -7
- package/dist/payment-modal.d.ts.map +1 -0
- package/dist/payment-modal.js +19 -18
- package/dist/payment-modal.js.map +1 -1
- package/dist/popover.cjs.map +1 -1
- package/dist/popover.d.ts +4 -5
- package/dist/popover.d.ts.map +1 -0
- package/dist/price-format.cjs.map +1 -1
- package/dist/price-format.d.ts +4 -5
- package/dist/price-format.d.ts.map +1 -0
- package/dist/price.cjs +4 -1
- package/dist/price.cjs.map +1 -1
- package/dist/price.d.ts +8 -22
- package/dist/price.d.ts.map +1 -0
- package/dist/price.js +4 -1
- package/dist/price.js.map +1 -1
- package/dist/provider.cjs +4 -2
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.d.ts +7 -10
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +3 -1
- package/dist/provider.js.map +1 -1
- package/dist/quantity-input.cjs +27 -40
- package/dist/quantity-input.cjs.map +1 -1
- package/dist/quantity-input.d.ts +4 -5
- package/dist/quantity-input.d.ts.map +1 -0
- package/dist/quantity-input.js +27 -40
- package/dist/quantity-input.js.map +1 -1
- package/dist/radio-group.cjs.map +1 -1
- package/dist/radio-group.d.ts +3 -4
- package/dist/radio-group.d.ts.map +1 -0
- package/dist/resource-tabs.cjs +1 -0
- package/dist/resource-tabs.cjs.map +1 -1
- package/dist/resource-tabs.d.ts +6 -8
- package/dist/resource-tabs.d.ts.map +1 -0
- package/dist/resource-tabs.js +1 -0
- package/dist/resource-tabs.js.map +1 -1
- package/dist/rules.d.ts +210 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/select.cjs.map +1 -1
- package/dist/select.d.ts +4 -5
- package/dist/select.d.ts.map +1 -0
- package/dist/separator.cjs.map +1 -1
- package/dist/separator.d.ts +3 -4
- package/dist/separator.d.ts.map +1 -0
- package/dist/session-replay.cjs +4 -2
- package/dist/session-replay.cjs.map +1 -1
- package/dist/session-replay.d.ts +4 -5
- package/dist/session-replay.d.ts.map +1 -0
- package/dist/session-replay.js +4 -2
- package/dist/session-replay.js.map +1 -1
- package/dist/skeleton.cjs.map +1 -1
- package/dist/skeleton.d.ts +2 -4
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/spinner.cjs.map +1 -1
- package/dist/spinner.d.ts +2 -4
- package/dist/spinner.d.ts.map +1 -0
- package/dist/stock-label.cjs +14 -12
- package/dist/stock-label.cjs.map +1 -1
- package/dist/stock-label.d.ts +7 -7
- package/dist/stock-label.d.ts.map +1 -0
- package/dist/stock-label.js +14 -12
- package/dist/stock-label.js.map +1 -1
- package/dist/table.cjs.map +1 -1
- package/dist/table.d.ts +3 -4
- package/dist/table.d.ts.map +1 -0
- package/dist/tabs.cjs.map +1 -1
- package/dist/tabs.d.ts +4 -5
- package/dist/tabs.d.ts.map +1 -0
- package/dist/textarea.cjs.map +1 -1
- package/dist/textarea.d.ts +4 -5
- package/dist/textarea.d.ts.map +1 -0
- package/llms.txt +23 -38
- package/package.json +26 -17
- package/dist/accordion.d.cts +0 -9
- package/dist/add-to-cart-button.d.cts +0 -14
- package/dist/breadcrumb.d.cts +0 -22
- package/dist/breadcrumbs.d.cts +0 -31
- package/dist/button.d.cts +0 -27
- package/dist/card.d.cts +0 -10
- package/dist/checkbox.d.cts +0 -6
- package/dist/chunk-AE4GLYJE.cjs.map +0 -1
- package/dist/chunk-DCXYO3RB.js.map +0 -1
- package/dist/chunk-I5NVZORX.cjs.map +0 -1
- package/dist/chunk-OJ5G4BLS.js.map +0 -1
- package/dist/command.d.cts +0 -87
- package/dist/confirm-dialog.d.cts +0 -35
- package/dist/data-table.d.cts +0 -55
- package/dist/detail-panel.d.cts +0 -59
- package/dist/dialog.d.cts +0 -22
- package/dist/dropdown-menu.d.cts +0 -30
- package/dist/financing-widget.d.cts +0 -45
- package/dist/form-field.d.cts +0 -14
- package/dist/form-input.d.cts +0 -19
- package/dist/form-select.d.cts +0 -34
- package/dist/form-textarea.d.cts +0 -12
- package/dist/gtm.d.cts +0 -69
- package/dist/input.d.cts +0 -6
- package/dist/label.d.cts +0 -8
- package/dist/list-view.d.cts +0 -18
- package/dist/mdx-components.d.cts +0 -20
- package/dist/navigation-menu.d.cts +0 -15
- package/dist/pagination.d.cts +0 -50
- package/dist/payment-modal.d.cts +0 -30
- package/dist/popover.d.cts +0 -9
- package/dist/price-format.d.cts +0 -21
- package/dist/price.d.cts +0 -90
- package/dist/provider.d.cts +0 -47
- package/dist/quantity-input.d.cts +0 -33
- package/dist/radio-group.d.cts +0 -7
- package/dist/resource-tabs.d.cts +0 -33
- package/dist/select.d.cts +0 -15
- package/dist/separator.d.cts +0 -6
- package/dist/session-replay.d.cts +0 -44
- package/dist/skeleton.d.cts +0 -5
- package/dist/spinner.d.cts +0 -10
- package/dist/stock-label.d.cts +0 -47
- package/dist/table.d.cts +0 -12
- package/dist/tabs.d.cts +0 -9
- package/dist/textarea.d.cts +0 -6
package/dist/rules.d.ts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/** One entry of a pagination bar: a page number or an ellipsis. */
|
|
2
|
+
export type PageEntry = {
|
|
3
|
+
kind: "page";
|
|
4
|
+
n: number;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "ellipsis";
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Pages i + 1 … total, in order.
|
|
10
|
+
*
|
|
11
|
+
* @ensures exactly the model's Range1
|
|
12
|
+
*/
|
|
13
|
+
export declare function pageRangeFrom(total: number, i: number): PageEntry[];
|
|
14
|
+
/**
|
|
15
|
+
* getPageNumbers: none for no pages; all of them up to 5; else the first, the last, and a window
|
|
16
|
+
* around the (clamped) current page with ellipses.
|
|
17
|
+
*
|
|
18
|
+
* @ensures exactly the model's PageNumbers
|
|
19
|
+
*/
|
|
20
|
+
export declare function pageNumbersOf(current: number, total: number): PageEntry[];
|
|
21
|
+
/**
|
|
22
|
+
* The current page clamped to [1, total] (`Math.max(1, Math.min(current, total))`).
|
|
23
|
+
*
|
|
24
|
+
* @ensures result = 1 below 1, total above it, else current
|
|
25
|
+
*/
|
|
26
|
+
export declare function clampPage(current: number, total: number): number;
|
|
27
|
+
/**
|
|
28
|
+
* ListPagination's first page: at or before page 1 (on the unclamped page).
|
|
29
|
+
*
|
|
30
|
+
* @ensures exactly the model's IsFirstPage
|
|
31
|
+
*/
|
|
32
|
+
export declare function isFirstPage(page: number): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* ListPagination's last page: at or past the total (on the unclamped page).
|
|
35
|
+
*
|
|
36
|
+
* @ensures exactly the model's IsLastPage
|
|
37
|
+
*/
|
|
38
|
+
export declare function isLastPage(page: number, totalPages: number): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The Prev link's target: page 1 on the first page, else the one before.
|
|
41
|
+
*
|
|
42
|
+
* @ensures exactly the model's PrevTarget
|
|
43
|
+
*/
|
|
44
|
+
export declare function prevTarget(page: number): number;
|
|
45
|
+
/**
|
|
46
|
+
* The Next link's target: the last page on it, else the one after.
|
|
47
|
+
*
|
|
48
|
+
* @ensures exactly the model's NextTarget
|
|
49
|
+
*/
|
|
50
|
+
export declare function nextTarget(page: number, totalPages: number): number;
|
|
51
|
+
/**
|
|
52
|
+
* commit's clamp: at least min, then at most max when there is one (max wins if max < min).
|
|
53
|
+
*
|
|
54
|
+
* @ensures exactly the model's Clamp
|
|
55
|
+
*/
|
|
56
|
+
export declare function clampQuantity(value: number, min: number, max: number | undefined): number;
|
|
57
|
+
/**
|
|
58
|
+
* The decrease stepper: one step down, not below min (`Math.max(value - step, min)`).
|
|
59
|
+
*
|
|
60
|
+
* @ensures exactly the model's StepDown
|
|
61
|
+
*/
|
|
62
|
+
export declare function stepDown(value: number, step: number, min: number): number;
|
|
63
|
+
/**
|
|
64
|
+
* The increase stepper: one step up, not above max when there is one.
|
|
65
|
+
*
|
|
66
|
+
* @ensures exactly the model's StepUp
|
|
67
|
+
*/
|
|
68
|
+
export declare function stepUp(value: number, step: number, max: number | undefined): number;
|
|
69
|
+
/**
|
|
70
|
+
* The decrease button is off when the input is, or the value is already at the minimum.
|
|
71
|
+
*
|
|
72
|
+
* @ensures exactly the model's MinDisabled
|
|
73
|
+
*/
|
|
74
|
+
export declare function decreaseDisabled(disabled: boolean, value: number, min: number): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The increase button is off when the input is, or the value is already at the maximum.
|
|
77
|
+
*
|
|
78
|
+
* @ensures exactly the model's MaxDisabled
|
|
79
|
+
*/
|
|
80
|
+
export declare function increaseDisabled(disabled: boolean, value: number, max: number | undefined): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The quantity input's digit test, JS's `key >= "0" && key <= "9"` (string order): a first code
|
|
83
|
+
* unit 0–8 with anything after it, or exactly "9".
|
|
84
|
+
*
|
|
85
|
+
* @ensures exactly the model's KeyAllowed digit clause
|
|
86
|
+
*/
|
|
87
|
+
export declare function digitKey(key: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The editing and navigation keys the input always lets through.
|
|
90
|
+
*
|
|
91
|
+
* @ensures result ⟺ key ∈ {Backspace, Delete, ArrowLeft, ArrowRight, Tab, Enter}
|
|
92
|
+
*/
|
|
93
|
+
export declare function editingKey(key: string): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* A keypress is allowed: an editing key, one "." when decimals are allowed, or a digit.
|
|
96
|
+
*
|
|
97
|
+
* @ensures exactly the model's KeyAllowed
|
|
98
|
+
*/
|
|
99
|
+
export declare function keyAllowed(key: string, decimals: number, hasDot: boolean): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* handleChange from index `i`: digits only, plus the first "." when decimals are allowed.
|
|
102
|
+
*
|
|
103
|
+
* @ensures exactly the model's CleanQtyFrom
|
|
104
|
+
*/
|
|
105
|
+
export declare function cleanQtyFrom(raw: string, allowDot: boolean, seenDot: boolean, i: number): string;
|
|
106
|
+
/** What a stock label shows. */
|
|
107
|
+
export type StockView = "loading" | "out-of-stock" | "low-stock" | "in-stock";
|
|
108
|
+
/**
|
|
109
|
+
* Loading first; out of stock overrides low stock.
|
|
110
|
+
*
|
|
111
|
+
* @ensures exactly the model's StockViewOf
|
|
112
|
+
*/
|
|
113
|
+
export declare function stockViewOf(loading: boolean, isInStock: boolean, isLowStock: boolean): StockView;
|
|
114
|
+
/**
|
|
115
|
+
* The quantity shows only when given and the item is in stock (low or not).
|
|
116
|
+
*
|
|
117
|
+
* @ensures exactly the model's ShowStockQuantity
|
|
118
|
+
*/
|
|
119
|
+
export declare function showStockQuantity(view: StockView, hasQuantity: boolean): boolean;
|
|
120
|
+
/** What a price shows. */
|
|
121
|
+
export type PriceView = "skeleton" | "zero-label" | "amount";
|
|
122
|
+
/**
|
|
123
|
+
* Loading first; a 0 value with no original price shows the zero label ("Call for Price").
|
|
124
|
+
*
|
|
125
|
+
* @ensures exactly the model's PriceViewOf
|
|
126
|
+
*/
|
|
127
|
+
export declare function priceViewOf(loading: boolean, valueIsZero: boolean, hasOriginal: boolean): PriceView;
|
|
128
|
+
/**
|
|
129
|
+
* A CSV field needs quotes iff it holds a comma, a quote or a line feed (a carriage return alone
|
|
130
|
+
* does not).
|
|
131
|
+
*
|
|
132
|
+
* @ensures exactly the model's NeedsQuotes
|
|
133
|
+
*/
|
|
134
|
+
export declare function needsQuotes(s: string): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* A CSV field: quoted, with quotes doubled, when it needs quotes; else as is.
|
|
137
|
+
*
|
|
138
|
+
* @ensures exactly the model's CsvField
|
|
139
|
+
*/
|
|
140
|
+
export declare function csvField(s: string): string;
|
|
141
|
+
/** A column's sort direction. */
|
|
142
|
+
export type SortDir = "asc" | "desc" | "unsorted";
|
|
143
|
+
/**
|
|
144
|
+
* aria-sort: only on a sortable column, naming its direction. A string, not a literal union:
|
|
145
|
+
* lsc names a `"none"` literal `None`, which clashes with Option's (models/LSC-GAPS.md).
|
|
146
|
+
*
|
|
147
|
+
* @ensures exactly the model's AriaSort
|
|
148
|
+
*/
|
|
149
|
+
export declare function ariaSortOf(sortable: boolean, dir: SortDir): string | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* A column's cell alignment class from its meta's `align` ("left" when it has none); any other
|
|
152
|
+
* value has none.
|
|
153
|
+
*
|
|
154
|
+
* @ensures exactly the model's AlignClass
|
|
155
|
+
*/
|
|
156
|
+
export declare function alignClass(align: string): string;
|
|
157
|
+
/** What the table body shows. */
|
|
158
|
+
export type BodyView = "loading" | "empty" | "rows";
|
|
159
|
+
/**
|
|
160
|
+
* Loading first, then the empty message for no rows.
|
|
161
|
+
*
|
|
162
|
+
* @ensures exactly the model's BodyViewOf
|
|
163
|
+
*/
|
|
164
|
+
export declare function bodyViewOf(loading: boolean, rowCount: number): BodyView;
|
|
165
|
+
/** When GTM loads. */
|
|
166
|
+
export type LoadTiming = "idle" | "next-tick" | "now";
|
|
167
|
+
/**
|
|
168
|
+
* GTM loads at idle for lazyOnload when the browser has requestIdleCallback, on the next tick for
|
|
169
|
+
* afterInteractive, else at once.
|
|
170
|
+
*
|
|
171
|
+
* @ensures exactly the model's GtmTiming
|
|
172
|
+
*/
|
|
173
|
+
export declare function gtmTiming(strategy: string, hasIdleCallback: boolean): LoadTiming;
|
|
174
|
+
/**
|
|
175
|
+
* Session replay is injected unless disabled or already there, and, under a rate below 1, only
|
|
176
|
+
* when the draw is at or under it.
|
|
177
|
+
*
|
|
178
|
+
* @ensures exactly the model's ReplaySampled
|
|
179
|
+
*/
|
|
180
|
+
export declare function replaySampled(disabled: boolean, injected: boolean, rate: number, draw: number): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* A "?" or "&" at `k`, "Bin=" right after it, and a value character (not "&") after that: what
|
|
183
|
+
* `[?&]Bin=[^&]` matches there.
|
|
184
|
+
*
|
|
185
|
+
* @ensures result ⟺ s[k] ∈ {?, &} ∧ s[k+1 ..] starts with "Bin=" ∧ s[k+5] is a char ≠ "&"
|
|
186
|
+
*/
|
|
187
|
+
export declare function binMarkAt(s: string, k: number): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* The first "?Bin=" or "&Bin=" from index `i` with a value after it, or −1 (the regex skips a
|
|
190
|
+
* mark with an empty value and keeps searching).
|
|
191
|
+
*
|
|
192
|
+
* @ensures result is the first k ≥ i with k + 6 ≤ |s| where `binMarkAt(s, k)`, else −1 —
|
|
193
|
+
* exactly the model's BinAt
|
|
194
|
+
*/
|
|
195
|
+
export declare function binAt(s: string, i: number): number;
|
|
196
|
+
/**
|
|
197
|
+
* extractBin from a message string (`/[?&]Bin=([^&]+)/`): the first mark's value up to the next
|
|
198
|
+
* "&" (never empty), or undefined.
|
|
199
|
+
*
|
|
200
|
+
* @ensures exactly the model's BinFromString
|
|
201
|
+
*/
|
|
202
|
+
export declare function binFromString(s: string): string | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* The text after a "?Bin=" mark at `k`, or "" when no mark fits there (`binAt` never gives
|
|
205
|
+
* such a k; the guard keeps the slice in range for the proof).
|
|
206
|
+
*
|
|
207
|
+
* @ensures result = s[k + 5 ..] when 0 ≤ k ∧ k + 5 ≤ |s|, else ""
|
|
208
|
+
*/
|
|
209
|
+
export declare function afterBinMark(s: string, k: number): string;
|
|
210
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAQA,mEAAmE;AACnE,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CASnE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAwCzE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQhE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIjD;A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AO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAOvE;AAED,sBAAsB;AACtB,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,KAAK,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,GAAG,UAAU,CAOhF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAMT;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAQvD;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAYlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO3D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzD"}
|
package/dist/select.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/select.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6jBAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/select.cjs"}
|
package/dist/select.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as SelectPrimitive from
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
3
|
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
5
4
|
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
5
|
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -11,5 +10,5 @@ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitiv
|
|
|
11
10
|
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
11
|
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
12
|
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
14
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/select.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,QAAA,MAAM,MAAM,uCAAuB,CAAC;AACpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAC1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,oKAiBjB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAWxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAW1B,CAAC;AAGH,QAAA,MAAM,aAAa,8JA6BjB,CAAC;AAGH,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAmBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAC"}
|
package/dist/separator.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/separator.cjs","../src/separator.tsx"],"names":[],"mappings":"AAAA,uWAAY;AACZ,YAAY;AACZ;AACA;ACAA,2EAAuB;AACvB,8HAAoC;AACpC,sDAAmB;AAMjB,+CAAA;AAJF,IAAM,UAAA,EAAkB,KAAA,CAAA,UAAA,CAGtB,CAAC,EAAE,SAAA,EAAW,YAAA,EAAc,YAAA,EAAc,WAAA,EAAa,IAAA,EAAM,GAAG,MAAM,CAAA,EAAG,GAAA,EAAA,mBACzE,6BAAA;AAAA,EAAoB,kBAAA,CAAA,IAAA;AAAA,EAAnB;AAAA,IACC,GAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA,EAAW,qBAAA;AAAA,MACT,oBAAA;AAAA,MACA,YAAA,IAAgB,aAAA,EAAe,iBAAA,EAAmB,gBAAA;AAAA,MAClD;AAAA,IACF,CAAA;AAAA,IACC,GAAG;AAAA,EAAA;AACN,CACD,CAAA;AACD,SAAA,CAAU,YAAA,EAAiC,kBAAA,CAAA,IAAA,CAAK,WAAA;ADAhD;AACE;AACF,8BAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/separator.cjs","sourcesContent":[null,"/** Styled wrapper around @radix-ui/react-separator. See https://www.radix-ui.com/primitives/docs/components/separator */\n\"use client\";\n\nimport * as React from \"react\";\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\n\nconst Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className,\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n"]}
|
package/dist/separator.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as SeparatorPrimitive from
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
3
|
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
-
|
|
6
4
|
export { Separator };
|
|
5
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../src/separator.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAGhE,QAAA,MAAM,SAAS,6JAeb,CAAC;AAGH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/session-replay.cjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
|
+
|
|
5
|
+
var _chunkQKWXJM4Qcjs = require('./chunk-QKWXJM4Q.cjs');
|
|
6
|
+
|
|
4
7
|
// src/session-replay.tsx
|
|
5
8
|
var _react = require('react');
|
|
6
9
|
function injectMouseflow(siteId) {
|
|
@@ -41,8 +44,7 @@ function SessionReplayScript({
|
|
|
41
44
|
}) {
|
|
42
45
|
const injectedRef = _react.useRef.call(void 0, false);
|
|
43
46
|
_react.useEffect.call(void 0, () => {
|
|
44
|
-
if (disabled
|
|
45
|
-
if (sampleRate < 1 && Math.random() > sampleRate) return;
|
|
47
|
+
if (!_chunkQKWXJM4Qcjs.replaySampled.call(void 0, disabled, injectedRef.current, sampleRate, Math.random())) return;
|
|
46
48
|
injectedRef.current = true;
|
|
47
49
|
const inject = injectors[provider];
|
|
48
50
|
if (typeof requestIdleCallback === "function") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/session-replay.cjs","../src/session-replay.tsx"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACA;ACJA,8BAAkC;AAsClC,SAAS,eAAA,CAAgB,MAAA,EAAsB;AAC7C,EAAA,GAAA,CAAI,OAAO,SAAA,IAAa,WAAA,EAAa,MAAA;AACrC,EAAA,GAAA,CAAI,QAAA,CAAS,cAAA,CAAe,kBAAkB,CAAA,EAAG,MAAA;AAEjD,EAAA,MAAA,CAAO,KAAA,EAAO,MAAA,CAAO,KAAA,GAAQ,CAAC,CAAA;AAE9B,EAAA,MAAM,OAAA,EAAS,QAAA,CAAS,aAAA,CAAc,QAAQ,CAAA;AAC9C,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A,EACzE,SAAA,EAAW,eAAA;AAAA,EACX,MAAA,EAAQ;AACV,CAAA;AAyBO,SAAS,mBAAA,CAAoB;AAAA,EAClC,QAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA,EAAa,CAAA;AAAA,EACb,SAAA,EAAW;AACb,CAAA,EAA6B;AAC3B,EAAA,MAAM,YAAA,EAAc,2BAAA,KAAY,CAAA;AAEhC,EAAA,8BAAA,CAAU,EAAA,GAAM;AACd,IAAA,GAAA,CAAI,CAAC,6CAAA,QAAc,EAAU,WAAA,CAAY,OAAA,EAAS,UAAA,EAAY,IAAA,CAAK,MAAA,CAAO,CAAC,CAAA,EAAG,MAAA;AAE9E,IAAA,WAAA,CAAY,QAAA,EAAU,IAAA;AAEtB,IAAA,MAAM,OAAA,EAAS,SAAA,CAAU,QAAQ,CAAA;AAGjC,IAAA,GAAA,CAAI,OAAO,oBAAA,IAAwB,UAAA,EAAY;AAC7C,MAAA,mBAAA,CAAoB,CAAA,EAAA,GAAM,MAAA,CAAO,MAAM,CAAC,CAAA;AAAA,IAC1C,EAAA,KAAO;AACL,MAAA,UAAA,CAAW,CAAA,EAAA,GAAM,MAAA,CAAO,MAAM,CAAA,EAAG,CAAC,CAAA;AAAA,IACpC;AAAA,EACF,CAAA,EAAG,CAAC,QAAA,EAAU,MAAA,EAAQ,UAAA,EAAY,QAAQ,CAAC,CAAA;AAE3C,EAAA,OAAO,IAAA;AACT;ADtEA;AACE;AACF,kDAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/session-replay.cjs","sourcesContent":[null,"\"use client\";\n\nimport { useEffect, useRef } from \"react\";\nimport { replaySampled } from \"./rules\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** Supported session replay providers. */\nexport type SessionReplayProvider = \"mouseflow\" | \"hotjar\";\n\nexport interface SessionReplayScriptProps {\n /** Session replay provider. */\n provider: SessionReplayProvider;\n /** Project/site ID from the provider. */\n siteId: string;\n /** Sampling rate (0-1). 1 = all sessions, 0.5 = 50%. Default: 1. */\n sampleRate?: number;\n /** Disable in development. Default: false. */\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Globals\n// ---------------------------------------------------------------------------\n\ndeclare global {\n interface Window {\n _mfq?: unknown[];\n hj?: (...args: unknown[]) => void;\n _hjSettings?: { hjid: string; hjsv: number };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Script injectors\n// ---------------------------------------------------------------------------\n\n// The injectors run from an idle callback or timer, by which time the page may have gone.\nfunction injectMouseflow(siteId: string): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(\"mouseflow-script\")) return;\n\n window._mfq = window._mfq || [];\n\n const script = document.createElement(\"script\");\n script.id = \"mouseflow-script\";\n script.src = `https://cdn.mouseflow.com/projects/${encodeURIComponent(siteId)}.js`;\n script.async = true;\n script.defer = true;\n document.head.appendChild(script);\n}\n\nfunction injectHotjar(siteId: string): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(\"hotjar-script\")) return;\n\n window._hjSettings = { hjid: siteId, hjsv: 6 };\n window.hj =\n window.hj ||\n function hjQueue(...args: unknown[]) {\n (window.hj as unknown as { q: unknown[] }).q =\n (window.hj as unknown as { q: unknown[] }).q || [];\n (window.hj as unknown as { q: unknown[] }).q.push(args);\n };\n\n const script = document.createElement(\"script\");\n script.id = \"hotjar-script\";\n script.src = `https://static.hotjar.com/c/hotjar-${encodeURIComponent(siteId)}.js?sv=6`;\n script.async = true;\n script.defer = true;\n document.head.appendChild(script);\n}\n\nconst injectors: Record<SessionReplayProvider, (siteId: string) => void> = {\n mouseflow: injectMouseflow,\n hotjar: injectHotjar,\n};\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\n/**\n * Loads a session replay script with `lazyOnload` behavior.\n * Renders nothing — this is a side-effect-only leaf component.\n *\n * Session replay tools require main thread DOM access (MutationObserver)\n * and cannot run in web workers.\n *\n * @example\n * ```tsx\n * // In layout.tsx\n * <SessionReplayScript provider=\"mouseflow\" siteId=\"88d79cd5-...\" />\n *\n * // With 50% sampling\n * <SessionReplayScript provider=\"mouseflow\" siteId=\"...\" sampleRate={0.5} />\n *\n * // Disabled in dev\n * <SessionReplayScript provider=\"hotjar\" siteId=\"...\" disabled={isDev} />\n * ```\n */\nexport function SessionReplayScript({\n provider,\n siteId,\n sampleRate = 1,\n disabled = false,\n}: SessionReplayScriptProps) {\n const injectedRef = useRef(false);\n\n useEffect(() => {\n if (!replaySampled(disabled, injectedRef.current, sampleRate, Math.random())) return;\n\n injectedRef.current = true;\n\n const inject = injectors[provider];\n\n // Load during idle time (lazyOnload behavior)\n if (typeof requestIdleCallback === \"function\") {\n requestIdleCallback(() => inject(siteId));\n } else {\n setTimeout(() => inject(siteId), 0);\n }\n }, [provider, siteId, sampleRate, disabled]);\n\n return null;\n}\n"]}
|
package/dist/session-replay.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Supported session replay providers. */
|
|
2
|
-
type SessionReplayProvider = "mouseflow" | "hotjar";
|
|
3
|
-
interface SessionReplayScriptProps {
|
|
2
|
+
export type SessionReplayProvider = "mouseflow" | "hotjar";
|
|
3
|
+
export interface SessionReplayScriptProps {
|
|
4
4
|
/** Session replay provider. */
|
|
5
5
|
provider: SessionReplayProvider;
|
|
6
6
|
/** Project/site ID from the provider. */
|
|
@@ -39,6 +39,5 @@ declare global {
|
|
|
39
39
|
* <SessionReplayScript provider="hotjar" siteId="..." disabled={isDev} />
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
declare function SessionReplayScript({ provider, siteId, sampleRate, disabled, }: SessionReplayScriptProps): null;
|
|
43
|
-
|
|
44
|
-
export { type SessionReplayProvider, SessionReplayScript, type SessionReplayScriptProps };
|
|
42
|
+
export declare function SessionReplayScript({ provider, siteId, sampleRate, disabled, }: SessionReplayScriptProps): null;
|
|
43
|
+
//# sourceMappingURL=session-replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-replay.d.ts","sourceRoot":"","sources":["../src/session-replay.tsx"],"names":[],"mappings":"AASA,0CAA0C;AAC1C,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE3D,MAAM,WAAW,wBAAwB;IACvC,+BAA+B;IAC/B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;QACjB,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;QAClC,WAAW,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9C;CACF;AAmDD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,MAAM,EACN,UAAc,EACd,QAAgB,GACjB,EAAE,wBAAwB,QAmB1B"}
|
package/dist/session-replay.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
|
+
import {
|
|
4
|
+
replaySampled
|
|
5
|
+
} from "./chunk-IO77MGHW.js";
|
|
3
6
|
|
|
4
7
|
// src/session-replay.tsx
|
|
5
8
|
import { useEffect, useRef } from "react";
|
|
@@ -41,8 +44,7 @@ function SessionReplayScript({
|
|
|
41
44
|
}) {
|
|
42
45
|
const injectedRef = useRef(false);
|
|
43
46
|
useEffect(() => {
|
|
44
|
-
if (disabled
|
|
45
|
-
if (sampleRate < 1 && Math.random() > sampleRate) return;
|
|
47
|
+
if (!replaySampled(disabled, injectedRef.current, sampleRate, Math.random())) return;
|
|
46
48
|
injectedRef.current = true;
|
|
47
49
|
const inject = injectors[provider];
|
|
48
50
|
if (typeof requestIdleCallback === "function") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/session-replay.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** Supported session replay providers. */\nexport type SessionReplayProvider = \"mouseflow\" | \"hotjar\";\n\nexport interface SessionReplayScriptProps {\n /** Session replay provider. */\n provider: SessionReplayProvider;\n /** Project/site ID from the provider. */\n siteId: string;\n /** Sampling rate (0-1). 1 = all sessions, 0.5 = 50%. Default: 1. */\n sampleRate?: number;\n /** Disable in development. Default: false. */\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Globals\n// ---------------------------------------------------------------------------\n\ndeclare global {\n interface Window {\n _mfq?: unknown[];\n hj?: (...args: unknown[]) => void;\n _hjSettings?: { hjid: string; hjsv: number };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Script injectors\n// ---------------------------------------------------------------------------\n\nfunction injectMouseflow(siteId: string): void {\n
|
|
1
|
+
{"version":3,"sources":["../src/session-replay.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef } from \"react\";\nimport { replaySampled } from \"./rules\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** Supported session replay providers. */\nexport type SessionReplayProvider = \"mouseflow\" | \"hotjar\";\n\nexport interface SessionReplayScriptProps {\n /** Session replay provider. */\n provider: SessionReplayProvider;\n /** Project/site ID from the provider. */\n siteId: string;\n /** Sampling rate (0-1). 1 = all sessions, 0.5 = 50%. Default: 1. */\n sampleRate?: number;\n /** Disable in development. Default: false. */\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Globals\n// ---------------------------------------------------------------------------\n\ndeclare global {\n interface Window {\n _mfq?: unknown[];\n hj?: (...args: unknown[]) => void;\n _hjSettings?: { hjid: string; hjsv: number };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Script injectors\n// ---------------------------------------------------------------------------\n\n// The injectors run from an idle callback or timer, by which time the page may have gone.\nfunction injectMouseflow(siteId: string): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(\"mouseflow-script\")) return;\n\n window._mfq = window._mfq || [];\n\n const script = document.createElement(\"script\");\n script.id = \"mouseflow-script\";\n script.src = `https://cdn.mouseflow.com/projects/${encodeURIComponent(siteId)}.js`;\n script.async = true;\n script.defer = true;\n document.head.appendChild(script);\n}\n\nfunction injectHotjar(siteId: string): void {\n if (typeof document === \"undefined\") return;\n if (document.getElementById(\"hotjar-script\")) return;\n\n window._hjSettings = { hjid: siteId, hjsv: 6 };\n window.hj =\n window.hj ||\n function hjQueue(...args: unknown[]) {\n (window.hj as unknown as { q: unknown[] }).q =\n (window.hj as unknown as { q: unknown[] }).q || [];\n (window.hj as unknown as { q: unknown[] }).q.push(args);\n };\n\n const script = document.createElement(\"script\");\n script.id = \"hotjar-script\";\n script.src = `https://static.hotjar.com/c/hotjar-${encodeURIComponent(siteId)}.js?sv=6`;\n script.async = true;\n script.defer = true;\n document.head.appendChild(script);\n}\n\nconst injectors: Record<SessionReplayProvider, (siteId: string) => void> = {\n mouseflow: injectMouseflow,\n hotjar: injectHotjar,\n};\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\n/**\n * Loads a session replay script with `lazyOnload` behavior.\n * Renders nothing — this is a side-effect-only leaf component.\n *\n * Session replay tools require main thread DOM access (MutationObserver)\n * and cannot run in web workers.\n *\n * @example\n * ```tsx\n * // In layout.tsx\n * <SessionReplayScript provider=\"mouseflow\" siteId=\"88d79cd5-...\" />\n *\n * // With 50% sampling\n * <SessionReplayScript provider=\"mouseflow\" siteId=\"...\" sampleRate={0.5} />\n *\n * // Disabled in dev\n * <SessionReplayScript provider=\"hotjar\" siteId=\"...\" disabled={isDev} />\n * ```\n */\nexport function SessionReplayScript({\n provider,\n siteId,\n sampleRate = 1,\n disabled = false,\n}: SessionReplayScriptProps) {\n const injectedRef = useRef(false);\n\n useEffect(() => {\n if (!replaySampled(disabled, injectedRef.current, sampleRate, Math.random())) return;\n\n injectedRef.current = true;\n\n const inject = injectors[provider];\n\n // Load during idle time (lazyOnload behavior)\n if (typeof requestIdleCallback === \"function\") {\n requestIdleCallback(() => inject(siteId));\n } else {\n setTimeout(() => inject(siteId), 0);\n }\n }, [provider, siteId, sampleRate, disabled]);\n\n return null;\n}\n"],"mappings":";;;;;;;AAEA,SAAS,WAAW,cAAc;AAsClC,SAAS,gBAAgB,QAAsB;AAC7C,MAAI,OAAO,aAAa,YAAa;AACrC,MAAI,SAAS,eAAe,kBAAkB,EAAG;AAEjD,SAAO,OAAO,OAAO,QAAQ,CAAC;AAE9B,QAAM,SAAS,SAAS,cAAc,QAAQ;AAC9C,SAAO,KAAK;AACZ,SAAO,MAAM,sCAAsC,mBAAmB,MAAM,CAAC;AAC7E,SAAO,QAAQ;AACf,SAAO,QAAQ;AACf,WAAS,KAAK,YAAY,MAAM;AAClC;AAEA,SAAS,aAAa,QAAsB;AAC1C,MAAI,OAAO,aAAa,YAAa;AACrC,MAAI,SAAS,eAAe,eAAe,EAAG;AAE9C,SAAO,cAAc,EAAE,MAAM,QAAQ,MAAM,EAAE;AAC7C,SAAO,KACL,OAAO,MACP,SAAS,WAAW,MAAiB;AACnC,IAAC,OAAO,GAAmC,IACxC,OAAO,GAAmC,KAAK,CAAC;AACnD,IAAC,OAAO,GAAmC,EAAE,KAAK,IAAI;AAAA,EACxD;AAEF,QAAM,SAAS,SAAS,cAAc,QAAQ;AAC9C,SAAO,KAAK;AACZ,SAAO,MAAM,sCAAsC,mBAAmB,MAAM,CAAC;AAC7E,SAAO,QAAQ;AACf,SAAO,QAAQ;AACf,WAAS,KAAK,YAAY,MAAM;AAClC;AAEA,IAAM,YAAqE;AAAA,EACzE,WAAW;AAAA,EACX,QAAQ;AACV;AAyBO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,WAAW;AACb,GAA6B;AAC3B,QAAM,cAAc,OAAO,KAAK;AAEhC,YAAU,MAAM;AACd,QAAI,CAAC,cAAc,UAAU,YAAY,SAAS,YAAY,KAAK,OAAO,CAAC,EAAG;AAE9E,gBAAY,UAAU;AAEtB,UAAM,SAAS,UAAU,QAAQ;AAGjC,QAAI,OAAO,wBAAwB,YAAY;AAC7C,0BAAoB,MAAM,OAAO,MAAM,CAAC;AAAA,IAC1C,OAAO;AACL,iBAAW,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA,IACpC;AAAA,EACF,GAAG,CAAC,UAAU,QAAQ,YAAY,QAAQ,CAAC;AAE3C,SAAO;AACT;","names":[]}
|
package/dist/skeleton.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/skeleton.cjs","../src/skeleton.tsx"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACDA,sDAAmB;AAGV,+CAAA;AADT,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,MAAM,CAAA,EAAyC;AAC/E,EAAA,uBAAO,6BAAA,KAAC,EAAA,EAAI,SAAA,EAAW,qBAAA,mCAAG,EAAqC,SAAS,CAAA,EAAI,GAAG,MAAA,CAAO,CAAA;AACxF;ADGA;AACE;AACF,4BAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/skeleton.cjs","sourcesContent":[null,"/** Animated placeholder for loading states. */\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\n\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"bg-muted animate-pulse rounded-md\", className)} {...props} />;\n}\n\nexport { Skeleton };\n"]}
|
package/dist/skeleton.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
4
|
-
|
|
1
|
+
declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
5
2
|
export { Skeleton };
|
|
3
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../src/skeleton.tsx"],"names":[],"mappings":"AAGA,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,+BAE9E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/spinner.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/spinner.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,4CAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/spinner.cjs"}
|
package/dist/spinner.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
1
|
interface SpinnerProps {
|
|
4
2
|
className?: string;
|
|
5
3
|
size?: "sm" | "md" | "lg";
|
|
6
4
|
}
|
|
7
5
|
/** Animated SVG loading spinner. Sizes: `sm` (12px), `md` (16px), `lg` (24px). */
|
|
8
|
-
declare const Spinner: ({ className, size }: SpinnerProps) =>
|
|
9
|
-
|
|
6
|
+
declare const Spinner: ({ className, size }: SpinnerProps) => import("react").JSX.Element;
|
|
10
7
|
export { Spinner };
|
|
8
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../src/spinner.tsx"],"names":[],"mappings":"AAEA,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAQD,kFAAkF;AAClF,QAAA,MAAM,OAAO,GAAI,qBAA4B,YAAY,gCAgBxD,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/stock-label.cjs
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkQKWXJM4Qcjs = require('./chunk-QKWXJM4Q.cjs');
|
|
7
|
+
|
|
4
8
|
// src/stock-label.tsx
|
|
5
9
|
var _web = require('@simpleapps-com/augur-utils/web');
|
|
6
10
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -54,26 +58,24 @@ function createStockLabel(config = {}) {
|
|
|
54
58
|
classNames: instanceClassNames
|
|
55
59
|
} = props;
|
|
56
60
|
const slots = mergeClassNames(instanceClassNames);
|
|
57
|
-
|
|
61
|
+
const view = _chunkQKWXJM4Qcjs.stockViewOf.call(void 0, false, isInStock, isLowStock);
|
|
62
|
+
if (view === "out-of-stock") {
|
|
58
63
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _web.cn.call(void 0, "text-red-600", slots.outOfStock, className), children: outOfStockLabel });
|
|
59
64
|
}
|
|
60
|
-
|
|
65
|
+
const quantity = _chunkQKWXJM4Qcjs.showStockQuantity.call(void 0, view, displayQuantity != null) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _web.cn.call(void 0, "ml-1", slots.quantity), children: [
|
|
66
|
+
"(",
|
|
67
|
+
displayQuantity,
|
|
68
|
+
")"
|
|
69
|
+
] });
|
|
70
|
+
if (view === "low-stock") {
|
|
61
71
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _web.cn.call(void 0, "text-orange-500", slots.lowStock, className), children: [
|
|
62
72
|
lowStockLabel,
|
|
63
|
-
|
|
64
|
-
"(",
|
|
65
|
-
displayQuantity,
|
|
66
|
-
")"
|
|
67
|
-
] })
|
|
73
|
+
quantity
|
|
68
74
|
] });
|
|
69
75
|
}
|
|
70
76
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _web.cn.call(void 0, "text-green-600", slots.inStock, className), children: [
|
|
71
77
|
inStockLabel,
|
|
72
|
-
|
|
73
|
-
"(",
|
|
74
|
-
displayQuantity,
|
|
75
|
-
")"
|
|
76
|
-
] })
|
|
78
|
+
quantity
|
|
77
79
|
] });
|
|
78
80
|
}
|
|
79
81
|
StockLabel.displayName = "StockLabel";
|
package/dist/stock-label.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/stock-label.cjs","../src/stock-label.tsx"],"names":["slots"],"mappings":"AAAA,ylBAAY;AACZ,YAAY;AACZ;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACLA,sDAAmB;AA4FX,+CAAA;AApCR,IAAM,SAAA,EAAW;AAAA,EACf,YAAA,EAAc,UAAA;AAAA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AA,EAAA,CACH,CAAA;AAAA,EAEJ;AAEA,EAAA,UAAA,CAAW,YAAA,EAAc,YAAA;AAEzB,EAAA,OAAO,EAAE,WAAW,CAAA;AACtB;AD/DA;AACE;AACF,4CAAC","file":"/Users/stuartjackson/Projects/simpleapps/atlas/repo/packages/augur-web/dist/stock-label.cjs","sourcesContent":[null,"\"use client\";\n\nimport { cn } from \"@simpleapps-com/augur-utils/web\";\nimport { showStockQuantity, stockViewOf } from \"./rules\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface StockLabelClassNames {\n /** In-stock text. */\n inStock?: string;\n /** Low-stock text. */\n lowStock?: string;\n /** Out-of-stock text. */\n outOfStock?: string;\n /** The loading skeleton. */\n skeleton?: string;\n /** The quantity parenthetical. */\n quantity?: string;\n}\n\nexport interface StockLabelConfig {\n /** Label for in-stock state. Default: `\"In stock\"`. */\n inStockLabel?: string;\n /** Label for low-stock state. Default: `\"Low stock\"`. */\n lowStockLabel?: string;\n /** Label for out-of-stock state. Default: `\"Out of stock\"`. */\n outOfStockLabel?: string;\n /** Default class names for sub-elements. */\n classNames?: StockLabelClassNames;\n}\n\ntype StockLabelPropsBase = {\n /** Whether the item is in stock. */\n isInStock: boolean;\n /** Whether the item has low stock. */\n isLowStock?: boolean;\n /** Quantity to display in parentheses (shown only when in stock or low stock). */\n displayQuantity?: number | null;\n /** Additional class names for the root element. */\n className?: string;\n /** Class names for sub-elements, merged with factory defaults. */\n classNames?: StockLabelClassNames;\n};\n\nexport type StockLabelProps =\n | (StockLabelPropsBase & { loading?: false })\n | { loading: true; className?: string; classNames?: StockLabelClassNames };\n\nexport interface CreateStockLabelResult {\n StockLabel: React.FC<StockLabelProps>;\n}\n\n// ---------------------------------------------------------------------------\n// Factory\n// ---------------------------------------------------------------------------\n\nconst defaults = {\n inStockLabel: \"In stock\",\n lowStockLabel: \"Low stock\",\n outOfStockLabel: \"Out of stock\",\n} as const;\n\nexport function createStockLabel(config: StockLabelConfig = {}): CreateStockLabelResult {\n const {\n inStockLabel,\n lowStockLabel,\n outOfStockLabel,\n classNames: factoryClassNames,\n } = { ...defaults, ...config };\n\n const slotKeys: (keyof StockLabelClassNames)[] = [\n \"inStock\",\n \"lowStock\",\n \"outOfStock\",\n \"skeleton\",\n \"quantity\",\n ];\n\n function mergeClassNames(instance?: StockLabelClassNames): StockLabelClassNames {\n if (!factoryClassNames && !instance) return {};\n const result: StockLabelClassNames = {};\n for (const key of slotKeys) {\n const merged = cn(factoryClassNames?.[key], instance?.[key]);\n if (merged) result[key] = merged;\n }\n return result;\n }\n\n function StockLabel(props: StockLabelProps) {\n if (\"loading\" in props && props.loading) {\n const slots = mergeClassNames(props.classNames);\n return (\n <span\n className={cn(\n \"bg-muted inline-block h-4 w-16 animate-pulse rounded\",\n slots.skeleton,\n props.className,\n )}\n />\n );\n }\n\n const {\n isInStock,\n isLowStock = false,\n displayQuantity,\n className,\n classNames: instanceClassNames,\n } = props as StockLabelPropsBase;\n\n const slots = mergeClassNames(instanceClassNames);\n // The loading skeleton is rendered above, so the view here is never \"loading\".\n const view = stockViewOf(false, isInStock, isLowStock);\n\n if (view === \"out-of-stock\") {\n return (\n <span className={cn(\"text-red-600\", slots.outOfStock, className)}>{outOfStockLabel}</span>\n );\n }\n\n const quantity = showStockQuantity(view, displayQuantity != null) && (\n <span className={cn(\"ml-1\", slots.quantity)}>({displayQuantity})</span>\n );\n\n if (view === \"low-stock\") {\n return (\n <span className={cn(\"text-orange-500\", slots.lowStock, className)}>\n {lowStockLabel}\n {quantity}\n </span>\n );\n }\n\n return (\n <span className={cn(\"text-green-600\", slots.inStock, className)}>\n {inStockLabel}\n {quantity}\n </span>\n );\n }\n\n StockLabel.displayName = \"StockLabel\";\n\n return { StockLabel };\n}\n"]}
|
package/dist/stock-label.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface StockLabelClassNames {
|
|
1
|
+
export interface StockLabelClassNames {
|
|
2
2
|
/** In-stock text. */
|
|
3
3
|
inStock?: string;
|
|
4
4
|
/** Low-stock text. */
|
|
@@ -10,7 +10,7 @@ interface StockLabelClassNames {
|
|
|
10
10
|
/** The quantity parenthetical. */
|
|
11
11
|
quantity?: string;
|
|
12
12
|
}
|
|
13
|
-
interface StockLabelConfig {
|
|
13
|
+
export interface StockLabelConfig {
|
|
14
14
|
/** Label for in-stock state. Default: `"In stock"`. */
|
|
15
15
|
inStockLabel?: string;
|
|
16
16
|
/** Label for low-stock state. Default: `"Low stock"`. */
|
|
@@ -32,16 +32,16 @@ type StockLabelPropsBase = {
|
|
|
32
32
|
/** Class names for sub-elements, merged with factory defaults. */
|
|
33
33
|
classNames?: StockLabelClassNames;
|
|
34
34
|
};
|
|
35
|
-
type StockLabelProps = (StockLabelPropsBase & {
|
|
35
|
+
export type StockLabelProps = (StockLabelPropsBase & {
|
|
36
36
|
loading?: false;
|
|
37
37
|
}) | {
|
|
38
38
|
loading: true;
|
|
39
39
|
className?: string;
|
|
40
40
|
classNames?: StockLabelClassNames;
|
|
41
41
|
};
|
|
42
|
-
interface CreateStockLabelResult {
|
|
42
|
+
export interface CreateStockLabelResult {
|
|
43
43
|
StockLabel: React.FC<StockLabelProps>;
|
|
44
44
|
}
|
|
45
|
-
declare function createStockLabel(config?: StockLabelConfig): CreateStockLabelResult;
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
export declare function createStockLabel(config?: StockLabelConfig): CreateStockLabelResult;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=stock-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stock-label.d.ts","sourceRoot":"","sources":["../src/stock-label.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,oBAAoB;IACnC,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CA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