@shopkit/builder 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +302 -0
- package/dist/hooks/index.d.mts +35 -0
- package/dist/hooks/index.d.ts +35 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.mjs +2 -0
- package/dist/index.d.mts +1338 -0
- package/dist/index.d.ts +1338 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
# @shopkit/builder
|
|
2
|
+
|
|
3
|
+
Configuration-driven page builder for creating dynamic storefronts with widgets and layouts.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Configuration-Driven**: Define pages with JSON configuration (PageConfig)
|
|
8
|
+
- **Widget System**: Modular, reusable widget components
|
|
9
|
+
- **Data Sources**: Automatic data fetching from commerce backends
|
|
10
|
+
- **Responsive Design**: Built-in breakpoint system for responsive layouts
|
|
11
|
+
- **Theme Integration**: Seamless integration with `@shopkit/core` theme system
|
|
12
|
+
- **SSR Support**: Full server-side rendering compatibility with Next.js
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @shopkit/builder
|
|
18
|
+
# or
|
|
19
|
+
bun add @shopkit/builder
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Peer Dependencies
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install react react-dom next
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { createPageBuilder, WidgetRegistry, DATA_SOURCE_TYPES } from '@shopkit/builder';
|
|
32
|
+
|
|
33
|
+
// 1. Create widget registry
|
|
34
|
+
const widgetRegistry = new WidgetRegistry();
|
|
35
|
+
widgetRegistry.register('hero', HeroWidget);
|
|
36
|
+
widgetRegistry.register('product-grid', ProductGridWidget);
|
|
37
|
+
|
|
38
|
+
// 2. Create page builder
|
|
39
|
+
const pageBuilder = createPageBuilder({
|
|
40
|
+
widgets: widgetRegistry,
|
|
41
|
+
commerceClient: myShopifyClient,
|
|
42
|
+
themeLoader: myThemeLoader,
|
|
43
|
+
templateLoader: myTemplateLoader,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// 3. Render a page
|
|
47
|
+
const content = await pageBuilder.renderPage({
|
|
48
|
+
merchantName: 'my-store',
|
|
49
|
+
routeContext: { templateName: 'home', path: '/' },
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Core Concepts
|
|
54
|
+
|
|
55
|
+
### PageConfig
|
|
56
|
+
|
|
57
|
+
The central configuration object that defines a page's structure:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import type { PageConfig, SectionConfig, WidgetConfig } from '@shopkit/builder';
|
|
61
|
+
|
|
62
|
+
const homePageConfig: PageConfig = {
|
|
63
|
+
id: 'home',
|
|
64
|
+
name: 'Home Page',
|
|
65
|
+
dataSources: {
|
|
66
|
+
featuredProducts: {
|
|
67
|
+
type: DATA_SOURCE_TYPES.PRODUCTS,
|
|
68
|
+
params: { first: 8 },
|
|
69
|
+
required: true,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
sections: [
|
|
73
|
+
{
|
|
74
|
+
id: 'hero-section',
|
|
75
|
+
name: 'Hero',
|
|
76
|
+
settings: { layout: 'full', padding: { top: '0', bottom: '0' } },
|
|
77
|
+
widgets: [
|
|
78
|
+
{
|
|
79
|
+
id: 'hero-1',
|
|
80
|
+
type: 'hero',
|
|
81
|
+
settings: {
|
|
82
|
+
title: 'Welcome to Our Store',
|
|
83
|
+
subtitle: 'Discover amazing products',
|
|
84
|
+
ctaText: 'Shop Now',
|
|
85
|
+
ctaLink: '/collections/all',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'products-section',
|
|
92
|
+
name: 'Featured Products',
|
|
93
|
+
settings: { layout: 'page' },
|
|
94
|
+
widgets: [
|
|
95
|
+
{
|
|
96
|
+
id: 'products-1',
|
|
97
|
+
type: 'product-grid',
|
|
98
|
+
dataSourceKey: 'featuredProducts',
|
|
99
|
+
settings: { columns: 4 },
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
};
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Data Source Types
|
|
108
|
+
|
|
109
|
+
Built-in data source types for fetching commerce data:
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { DATA_SOURCE_TYPES } from '@shopkit/builder';
|
|
113
|
+
|
|
114
|
+
// Available types:
|
|
115
|
+
DATA_SOURCE_TYPES.PRODUCT // Single product by handle/ID
|
|
116
|
+
DATA_SOURCE_TYPES.PRODUCTS // Multiple products with pagination
|
|
117
|
+
DATA_SOURCE_TYPES.PRODUCTS_BY_HANDLES // Products by specific handles
|
|
118
|
+
DATA_SOURCE_TYPES.COLLECTION // Single collection
|
|
119
|
+
DATA_SOURCE_TYPES.COLLECTIONS // Multiple collections
|
|
120
|
+
DATA_SOURCE_TYPES.COLLECTION_PAGE_WITH_FILTERS // Collection with faceted filters
|
|
121
|
+
DATA_SOURCE_TYPES.PRODUCT_RECOMMENDATIONS // Product recommendations
|
|
122
|
+
DATA_SOURCE_TYPES.STATIC // Static data (no fetching)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Widget Registry
|
|
126
|
+
|
|
127
|
+
Register widgets for use in page configurations:
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import { WidgetRegistry } from '@shopkit/builder';
|
|
131
|
+
|
|
132
|
+
const registry = new WidgetRegistry();
|
|
133
|
+
|
|
134
|
+
// Register a widget
|
|
135
|
+
registry.register('product-card', ProductCardWidget);
|
|
136
|
+
|
|
137
|
+
// Check if widget exists
|
|
138
|
+
registry.has('product-card'); // true
|
|
139
|
+
|
|
140
|
+
// Get a widget
|
|
141
|
+
const Widget = registry.get('product-card');
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Interfaces
|
|
145
|
+
|
|
146
|
+
The builder uses dependency injection. Implement these interfaces for your commerce platform:
|
|
147
|
+
|
|
148
|
+
### ICommerceClient
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import type { ICommerceClient } from '@shopkit/builder';
|
|
152
|
+
|
|
153
|
+
const shopifyClient: ICommerceClient = {
|
|
154
|
+
getProduct: async (handle) => { /* ... */ },
|
|
155
|
+
getProducts: async (params) => { /* ... */ },
|
|
156
|
+
getCollection: async (handle) => { /* ... */ },
|
|
157
|
+
getCollections: async (params) => { /* ... */ },
|
|
158
|
+
// ...
|
|
159
|
+
};
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### IThemeLoader
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
import type { IThemeLoader } from '@shopkit/builder';
|
|
166
|
+
|
|
167
|
+
const themeLoader: IThemeLoader = {
|
|
168
|
+
loadTheme: async (merchantName, role) => { /* ... */ },
|
|
169
|
+
};
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### ITemplateLoader
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
import type { ITemplateLoader } from '@shopkit/builder';
|
|
176
|
+
|
|
177
|
+
const templateLoader: ITemplateLoader = {
|
|
178
|
+
loadTemplate: async (merchantName, templateName) => { /* ... */ },
|
|
179
|
+
listTemplates: async (merchantName) => { /* ... */ },
|
|
180
|
+
};
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Presets
|
|
184
|
+
|
|
185
|
+
Use presets for common configurations:
|
|
186
|
+
|
|
187
|
+
### File System Preset
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
import { createFileSystemPageBuilder } from '@shopkit/builder';
|
|
191
|
+
|
|
192
|
+
const pageBuilder = await createFileSystemPageBuilder({
|
|
193
|
+
basePath: './src/themes',
|
|
194
|
+
widgets: myWidgetRegistry,
|
|
195
|
+
commerceClient: myCommerceClient,
|
|
196
|
+
});
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Subpath Exports
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
// Main exports
|
|
203
|
+
import { createPageBuilder, PageConfig, WidgetRegistry } from '@shopkit/builder';
|
|
204
|
+
|
|
205
|
+
// React hooks
|
|
206
|
+
import { usePageBuilder } from '@shopkit/builder/hooks';
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Type Reference
|
|
210
|
+
|
|
211
|
+
### PageConfig
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
interface PageConfig {
|
|
215
|
+
id: string;
|
|
216
|
+
name: string;
|
|
217
|
+
dataSources?: Record<string, DataSourceConfig>;
|
|
218
|
+
sections: SectionConfig[];
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### SectionConfig
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
interface SectionConfig {
|
|
226
|
+
id: string;
|
|
227
|
+
name: string;
|
|
228
|
+
settings: SectionSettings;
|
|
229
|
+
widgets: WidgetConfig[];
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### WidgetConfig
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
interface WidgetConfig {
|
|
237
|
+
id: string;
|
|
238
|
+
type: string;
|
|
239
|
+
settings: Record<string, unknown>;
|
|
240
|
+
dataSourceKey?: string;
|
|
241
|
+
responsive?: WidgetResponsiveConfig;
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### DataSourceConfig
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
interface DataSourceConfig {
|
|
249
|
+
type: DataSourceType | string;
|
|
250
|
+
params: Record<string, any>;
|
|
251
|
+
required: boolean;
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Layout Options
|
|
256
|
+
|
|
257
|
+
Built-in layout constants:
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
import {
|
|
261
|
+
SECTION_TYPES,
|
|
262
|
+
SECTION_LAYOUT_OPTIONS,
|
|
263
|
+
SECTION_ALIGNMENT_OPTIONS,
|
|
264
|
+
ASPECT_RATIO_OPTIONS,
|
|
265
|
+
TEXT_ALIGNMENT_OPTIONS,
|
|
266
|
+
CARD_STYLE_OPTIONS,
|
|
267
|
+
} from '@shopkit/builder';
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Responsive Breakpoints
|
|
271
|
+
|
|
272
|
+
Default breakpoints for responsive design:
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
import { DEFAULT_BREAKPOINTS } from '@shopkit/builder';
|
|
276
|
+
|
|
277
|
+
// { sm: 640, md: 768, lg: 1024, xl: 1280, '2xl': 1536 }
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Integration with @shopkit/core
|
|
281
|
+
|
|
282
|
+
The builder integrates seamlessly with the theme system:
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
import { createPageBuilder } from '@shopkit/builder';
|
|
286
|
+
import { createThemeRegistry } from '@shopkit/core/theme';
|
|
287
|
+
|
|
288
|
+
const themeRegistry = createThemeRegistry({
|
|
289
|
+
basePath: './src/themes',
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
const pageBuilder = createPageBuilder({
|
|
293
|
+
widgets: widgetRegistry,
|
|
294
|
+
commerceClient: shopifyClient,
|
|
295
|
+
themeLoader: themeRegistry,
|
|
296
|
+
templateLoader: templateLoader,
|
|
297
|
+
});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## License
|
|
301
|
+
|
|
302
|
+
MIT
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Breakpoint configuration for responsive design
|
|
3
|
+
*/
|
|
4
|
+
interface BreakpointConfig {
|
|
5
|
+
mobile: {
|
|
6
|
+
max: number;
|
|
7
|
+
};
|
|
8
|
+
tablet: {
|
|
9
|
+
min: number;
|
|
10
|
+
max: number;
|
|
11
|
+
};
|
|
12
|
+
desktop: {
|
|
13
|
+
min: number;
|
|
14
|
+
max: number;
|
|
15
|
+
};
|
|
16
|
+
wide: {
|
|
17
|
+
min: number;
|
|
18
|
+
};
|
|
19
|
+
custom?: Record<string, {
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface UseBreakpointsReturn {
|
|
26
|
+
currentBreakpoint: string;
|
|
27
|
+
isMobile: boolean;
|
|
28
|
+
isTablet: boolean;
|
|
29
|
+
isDesktop: boolean;
|
|
30
|
+
isWide: boolean;
|
|
31
|
+
matches: (breakpoint: string) => boolean;
|
|
32
|
+
}
|
|
33
|
+
declare function useBreakpoints(customBreakpoints?: BreakpointConfig): UseBreakpointsReturn;
|
|
34
|
+
|
|
35
|
+
export { useBreakpoints };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Breakpoint configuration for responsive design
|
|
3
|
+
*/
|
|
4
|
+
interface BreakpointConfig {
|
|
5
|
+
mobile: {
|
|
6
|
+
max: number;
|
|
7
|
+
};
|
|
8
|
+
tablet: {
|
|
9
|
+
min: number;
|
|
10
|
+
max: number;
|
|
11
|
+
};
|
|
12
|
+
desktop: {
|
|
13
|
+
min: number;
|
|
14
|
+
max: number;
|
|
15
|
+
};
|
|
16
|
+
wide: {
|
|
17
|
+
min: number;
|
|
18
|
+
};
|
|
19
|
+
custom?: Record<string, {
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface UseBreakpointsReturn {
|
|
26
|
+
currentBreakpoint: string;
|
|
27
|
+
isMobile: boolean;
|
|
28
|
+
isTablet: boolean;
|
|
29
|
+
isDesktop: boolean;
|
|
30
|
+
isWide: boolean;
|
|
31
|
+
matches: (breakpoint: string) => boolean;
|
|
32
|
+
}
|
|
33
|
+
declare function useBreakpoints(customBreakpoints?: BreakpointConfig): UseBreakpointsReturn;
|
|
34
|
+
|
|
35
|
+
export { useBreakpoints };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';const _0x1b4f62=_0x374e;function _0x4fbb(){const _0x511121=['CMvTB3zLrxzLBNrmAxn0zw5LCG','zgv0zwn0q3vYCMvUDejYzwfRCg9PBNq','nZi5m1Pjv055DW','Bvrmu2y','BwvKAwfrDwvYEuXPC3rLBMvYCW','ywrK','kg1PBI13Awr0AdOG','Aw5UzxjxAwr0Aa','C2v0','zgvZDhjVEq','mte0nJG4nuPlExHqAa','Bwf4','DgfIBgv0','BwDctxm','yNjLywTWB2LUDhm','y2XLyxi','Bw9IAwXL','mty4mte1A2vNBe1u','BwLU','z2v0q3vYCMvUDejYzwfRCg9PBNq','zM9YrwfJAa','Bwf0y2HnzwrPyq','z2v0qNjLywTWB2LUDenVBMzPzW','Bwf0y2HLCW','y2HHBMDL','kg1HEc13Awr0AdOG','CMvHy3q','ChGP','yM91BMriyw5KBgvY','zw50CMLLCW','C3vIC2nYAwjL','rKf0A2O','BM90Awz5tgLZDgvUzxjZ','zgvZA3rVCa','mtq2nhzzy0TcrW','qvHyCfm','z2v0qNjLywTWB2LUDhm','ywrKrxzLBNrmAxn0zw5LCG','yNDMsvm','BgLZDgvUzxjZ','odaYnty0meTXwgHHtq','DxnLqNjLywTWB2LUDhm','qNvpu3u','A2v5CW','qxvhEMu','z2v0','zgvSzxrL','otm2mtyWohfQB3LIBq','y3vYCMvUDejYzwfRCg9PBNq','ChvZAa','z2v0twvKAwfrDwvYEq','AM9PBG','EvDRyNO','mJmZnJC4nM1dq0fJDG','zurXs2K','DxnLrwzMzwn0','D2LKzq','D3rbu3a','ode3nZmYmMHzy0XkvG','y3vZDg9T'];_0x4fbb=function(){return _0x511121;};return _0x4fbb();}(function(_0x57281a,_0x1ad2bf){const _0x432d8c=_0x374e,_0x526d15=_0x57281a();while(!![]){try{const _0x27420b=-parseInt(_0x432d8c(0xdf))/0x1+-parseInt(_0x432d8c(0xc7))/0x2+-parseInt(_0x432d8c(0xd0))/0x3*(-parseInt(_0x432d8c(0xf0))/0x4)+-parseInt(_0x432d8c(0xd8))/0x5+parseInt(_0x432d8c(0xcc))/0x6+-parseInt(_0x432d8c(0xf6))/0x7+parseInt(_0x432d8c(0xc1))/0x8;if(_0x27420b===_0x1ad2bf)break;else _0x526d15['push'](_0x526d15['shift']());}catch(_0x464220){_0x526d15['push'](_0x526d15['shift']());}}}(_0x4fbb,0xad71d));function _0x374e(_0xec7d14,_0x23dae8){_0xec7d14=_0xec7d14-0xbb;const _0x4fbbd4=_0x4fbb();let _0x374ea6=_0x4fbbd4[_0xec7d14];if(_0x374e['hYrkTv']===undefined){var _0xdcdf0f=function(_0x27a052){const _0x377938='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3f4ded='',_0x55dacf='';for(let _0x262633=0x0,_0xcee231,_0x2feb71,_0x24a1fb=0x0;_0x2feb71=_0x27a052['charAt'](_0x24a1fb++);~_0x2feb71&&(_0xcee231=_0x262633%0x4?_0xcee231*0x40+_0x2feb71:_0x2feb71,_0x262633++%0x4)?_0x3f4ded+=String['fromCharCode'](0xff&_0xcee231>>(-0x2*_0x262633&0x6)):0x0){_0x2feb71=_0x377938['indexOf'](_0x2feb71);}for(let _0x1b42ab=0x0,_0x2008ae=_0x3f4ded['length'];_0x1b42ab<_0x2008ae;_0x1b42ab++){_0x55dacf+='%'+('00'+_0x3f4ded['charCodeAt'](_0x1b42ab)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x55dacf);};_0x374e['vAYtLO']=_0xdcdf0f,_0x374e['vSmTEF']={},_0x374e['hYrkTv']=!![];}const _0x29d8fd=_0x4fbbd4[0x0],_0x5b452d=_0xec7d14+_0x29d8fd,_0x276b65=_0x374e['vSmTEF'][_0x5b452d];return!_0x276b65?(_0x374ea6=_0x374e['vAYtLO'](_0x374ea6),_0x374e['vSmTEF'][_0x5b452d]=_0x374ea6):_0x374ea6=_0x276b65,_0x374ea6;}var react=require(_0x1b4f62(0xe8)),a={'mobile':{'max':0x2ff},'tablet':{'min':0x300,'max':0x3ff},'desktop':{'min':0x400,'max':0x780},'wide':{'min':0x781}},s=class{constructor(_0x553c16=a){const _0x567693=_0x1b4f62,_0x1d4214={'AuGze':_0x567693(0xef),'wtASp':function(_0x2a8061,_0x388e8d){return _0x2a8061<_0x388e8d;}};this['mediaQueryListeners']=new Map(),this[_0x567693(0xc2)]=_0x1d4214[_0x567693(0xbe)],this[_0x567693(0xf5)]=new Set(),this[_0x567693(0xea)]=null,(this[_0x567693(0xdc)]=_0x553c16,_0x1d4214[_0x567693(0xcb)](typeof window,'u')&&(this['setupMediaQueryListeners'](),this[_0x567693(0xcf)]()));}['getCurrentBreakpoint'](){return this['currentBreakpoint'];}[_0x1b4f62(0xf2)](){return this['breakpoints'];}['getMediaQuery'](_0xadc755){const _0x1b9277=_0x1b4f62,_0x39f5ce={'FAtkj':function(_0x4907d0,_0x356bf4){return _0x4907d0!==_0x356bf4;},'eDqKi':'\x20and\x20'};let _0x2808d2=this[_0x1b9277(0xe4)](_0xadc755);if(!_0x2808d2)return'';let _0xf9ef4=[];return _0x2808d2[_0x1b9277(0xe0)]!==void 0x0&&_0xf9ef4[_0x1b9277(0xc3)](_0x1b9277(0xd4)+_0x2808d2[_0x1b9277(0xe0)]+_0x1b9277(0xe9)),_0x39f5ce[_0x1b9277(0xed)](_0x2808d2['max'],void 0x0)&&_0xf9ef4[_0x1b9277(0xc3)](_0x1b9277(0xe7)+_0x2808d2[_0x1b9277(0xd9)]+'px)'),_0xf9ef4[_0x1b9277(0xc5)](_0x39f5ce[_0x1b9277(0xc8)]);}[_0x1b4f62(0xe4)](_0x12f460){const _0x15f64c=_0x1b4f62,_0x14b193={'BuOSu':function(_0x36e785,_0x2bd577){return _0x36e785 in _0x2bd577;}};return _0x12f460 in this[_0x15f64c(0xdc)]?this[_0x15f64c(0xdc)][_0x12f460]:this[_0x15f64c(0xdc)]['custom']&&_0x14b193[_0x15f64c(0xbc)](_0x12f460,this[_0x15f64c(0xdc)][_0x15f64c(0xcd)])?this['breakpoints'][_0x15f64c(0xcd)][_0x12f460]:null;}['setupMediaQueryListeners'](){const _0x1ff876=_0x1b4f62,_0x5be629={'AXXpS':'change'};this[_0x1ff876(0xea)]=()=>this[_0x1ff876(0xcf)](),Object['keys'](this['breakpoints'])[_0x1ff876(0xe2)](_0x1ee46a=>{const _0x2e07ef=_0x1ff876;if(_0x1ee46a===_0x2e07ef(0xcd))return;let _0x4167d1=this[_0x2e07ef(0xc4)](_0x1ee46a);if(_0x4167d1){let _0x329a65=window[_0x2e07ef(0xe3)](_0x4167d1);this[_0x2e07ef(0xd2)][_0x2e07ef(0xd6)](_0x1ee46a,_0x329a65),_0x329a65[_0x2e07ef(0xf3)](_0x5be629[_0x2e07ef(0xf1)],this['boundHandler']);}}),this['breakpoints'][_0x1ff876(0xcd)]&&Object[_0x1ff876(0xbd)](this[_0x1ff876(0xdc)][_0x1ff876(0xcd)])['forEach'](_0x285a87=>{const _0x3928a4=_0x1ff876;let _0x4b7c94=this[_0x3928a4(0xc4)](_0x285a87);if(_0x4b7c94){let _0x13a70c=window[_0x3928a4(0xe3)](_0x4b7c94);this[_0x3928a4(0xd2)][_0x3928a4(0xd6)](_0x285a87,_0x13a70c),_0x13a70c[_0x3928a4(0xf3)](_0x5be629['AXXpS'],this[_0x3928a4(0xea)]);}});}['detectCurrentBreakpoint'](){const _0x40374d=_0x1b4f62,_0x4b0bbd={'bwfIS':function(_0x283d95,_0x20aedb){return _0x283d95<=_0x20aedb;},'ucNfl':function(_0x36e5aa,_0x8c7fcc){return _0x36e5aa>=_0x8c7fcc;},'NMxTI':_0x40374d(0xef),'xWpdl':function(_0x26280c,_0x4244a9){return _0x26280c!==_0x4244a9;}};let _0x21b4df=window[_0x40374d(0xd5)],_0x304e81='desktop';if(_0x21b4df<=this[_0x40374d(0xdc)][_0x40374d(0xde)][_0x40374d(0xd9)]?_0x304e81=_0x40374d(0xde):_0x21b4df>=this[_0x40374d(0xdc)]['tablet'][_0x40374d(0xe0)]&&_0x4b0bbd[_0x40374d(0xf4)](_0x21b4df,this[_0x40374d(0xdc)][_0x40374d(0xda)][_0x40374d(0xd9)])?_0x304e81=_0x40374d(0xda):_0x4b0bbd['ucNfl'](_0x21b4df,this['breakpoints'][_0x40374d(0xef)][_0x40374d(0xe0)])&&_0x4b0bbd[_0x40374d(0xf4)](_0x21b4df,this['breakpoints'][_0x40374d(0xef)][_0x40374d(0xd9)])?_0x304e81=_0x4b0bbd['NMxTI']:_0x21b4df>=this[_0x40374d(0xdc)][_0x40374d(0xca)][_0x40374d(0xe0)]&&(_0x304e81=_0x40374d(0xca)),this[_0x40374d(0xdc)][_0x40374d(0xcd)]){for(let [_0x3b4cee,_0x5c30ed]of Object[_0x40374d(0xeb)](this[_0x40374d(0xdc)]['custom']))if((_0x5c30ed[_0x40374d(0xe0)]===void 0x0||_0x4b0bbd['ucNfl'](_0x21b4df,_0x5c30ed[_0x40374d(0xe0)]))&&(_0x5c30ed['max']===void 0x0||_0x4b0bbd[_0x40374d(0xf4)](_0x21b4df,_0x5c30ed[_0x40374d(0xd9)]))){_0x304e81=_0x3b4cee;break;}}_0x4b0bbd['xWpdl'](_0x304e81,this[_0x40374d(0xc2)])&&(this[_0x40374d(0xc2)]=_0x304e81,this[_0x40374d(0xee)]());}['subscribe'](_0x491675){const _0x5b2908=_0x1b4f62;return this[_0x5b2908(0xf5)][_0x5b2908(0xd3)](_0x491675),()=>this[_0x5b2908(0xf5)][_0x5b2908(0xc0)](_0x491675);}[_0x1b4f62(0xee)](){const _0x44b5e5=_0x1b4f62;this[_0x44b5e5(0xf5)][_0x44b5e5(0xe2)](_0x535a90=>_0x535a90(this['currentBreakpoint']));}[_0x1b4f62(0xe5)](_0x31d268){const _0x4fbcde=_0x1b4f62;let _0x216ef4=this[_0x4fbcde(0xd2)][_0x4fbcde(0xbf)](_0x31d268);return _0x216ef4?_0x216ef4[_0x4fbcde(0xe5)]:![];}[_0x1b4f62(0xd7)](){const _0x337831=_0x1b4f62;this[_0x337831(0xea)]&&(this[_0x337831(0xd2)][_0x337831(0xe2)](_0x19a995=>{const _0x1a5a8f=_0x337831;_0x19a995[_0x1a5a8f(0xce)](_0x1a5a8f(0xe6),this[_0x1a5a8f(0xea)]);}),this['boundHandler']=null),this[_0x337831(0xd2)][_0x337831(0xdd)](),this['listeners'][_0x337831(0xdd)]();}},o=null;function d(_0x4d495d){return o||(o=new s(_0x4d495d)),o;}function b(_0x4082c6){const _0x59eed1=_0x1b4f62,_0x51facc={'mTLSf':function(_0x407728,_0x4159b4){return _0x407728(_0x4159b4);},'yWkbz':_0x59eed1(0xef),'kJsbM':function(_0x35c007,_0x156622){return _0x35c007===_0x156622;},'axFLT':'mobile','mgBMs':function(_0x1128ef,_0x1229bb){return _0x1128ef===_0x1229bb;}};let [_0x21cb8a,_0x40e407]=react['useState'](_0x51facc['yWkbz']),_0x20057b=d(_0x4082c6);return react[_0x59eed1(0xc9)](()=>(_0x40e407(_0x20057b[_0x59eed1(0xe1)]()),_0x20057b[_0x59eed1(0xec)](_0x3cccc2=>{const _0x7ede7f=_0x59eed1;_0x51facc[_0x7ede7f(0xd1)](_0x40e407,_0x3cccc2);})),[_0x4082c6]),{'currentBreakpoint':_0x21cb8a,'isMobile':_0x51facc['kJsbM'](_0x21cb8a,_0x51facc['axFLT']),'isTablet':_0x21cb8a===_0x59eed1(0xda),'isDesktop':_0x51facc['kJsbM'](_0x21cb8a,_0x51facc[_0x59eed1(0xc6)]),'isWide':_0x51facc[_0x59eed1(0xdb)](_0x21cb8a,_0x59eed1(0xca)),'matches':_0x34490f=>_0x20057b[_0x59eed1(0xe5)](_0x34490f)};}exports[_0x1b4f62(0xbb)]=b;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function _0x549f(_0x5e9dfd,_0x309d53){_0x5e9dfd=_0x5e9dfd-0x15c;const _0x566546=_0x5665();let _0x549ffc=_0x566546[_0x5e9dfd];if(_0x549f['ONweyY']===undefined){var _0xde5325=function(_0x40161c){const _0x37354b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3e89aa='',_0x3f0e6f='';for(let _0x1c33cc=0x0,_0x4d62cb,_0x270acb,_0x374750=0x0;_0x270acb=_0x40161c['charAt'](_0x374750++);~_0x270acb&&(_0x4d62cb=_0x1c33cc%0x4?_0x4d62cb*0x40+_0x270acb:_0x270acb,_0x1c33cc++%0x4)?_0x3e89aa+=String['fromCharCode'](0xff&_0x4d62cb>>(-0x2*_0x1c33cc&0x6)):0x0){_0x270acb=_0x37354b['indexOf'](_0x270acb);}for(let _0x391cea=0x0,_0xb6fda7=_0x3e89aa['length'];_0x391cea<_0xb6fda7;_0x391cea++){_0x3f0e6f+='%'+('00'+_0x3e89aa['charCodeAt'](_0x391cea)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3f0e6f);};_0x549f['VOSyKn']=_0xde5325,_0x549f['TpgwTE']={},_0x549f['ONweyY']=!![];}const _0x2b5e2e=_0x566546[0x0],_0x4dc64b=_0x5e9dfd+_0x2b5e2e,_0x2e4247=_0x549f['TpgwTE'][_0x4dc64b];return!_0x2e4247?(_0x549ffc=_0x549f['VOSyKn'](_0x549ffc),_0x549f['TpgwTE'][_0x4dc64b]=_0x549ffc):_0x549ffc=_0x2e4247,_0x549ffc;}const _0x19f7fe=_0x549f;(function(_0x3c1745,_0x181ec5){const _0x301405=_0x549f,_0x1f286f=_0x3c1745();while(!![]){try{const _0x1a61fc=parseInt(_0x301405(0x168))/0x1*(parseInt(_0x301405(0x195))/0x2)+-parseInt(_0x301405(0x184))/0x3*(-parseInt(_0x301405(0x186))/0x4)+parseInt(_0x301405(0x18b))/0x5*(parseInt(_0x301405(0x15c))/0x6)+-parseInt(_0x301405(0x174))/0x7*(-parseInt(_0x301405(0x183))/0x8)+-parseInt(_0x301405(0x165))/0x9*(parseInt(_0x301405(0x161))/0xa)+-parseInt(_0x301405(0x15f))/0xb*(-parseInt(_0x301405(0x196))/0xc)+-parseInt(_0x301405(0x192))/0xd*(parseInt(_0x301405(0x18d))/0xe);if(_0x1a61fc===_0x181ec5)break;else _0x1f286f['push'](_0x1f286f['shift']());}catch(_0x384a38){_0x1f286f['push'](_0x1f286f['shift']());}}}(_0x5665,0x82b56));import{useState,useEffect}from'react';var a={'mobile':{'max':0x2ff},'tablet':{'min':0x300,'max':0x3ff},'desktop':{'min':0x400,'max':0x780},'wide':{'min':0x781}},s=class{constructor(_0x260e3d=a){const _0x12c1a9=_0x549f,_0x24a5f1={'jqCTW':'desktop','wovWo':function(_0x1add0b,_0x252388){return _0x1add0b<_0x252388;}};this[_0x12c1a9(0x185)]=new Map(),this[_0x12c1a9(0x187)]=_0x24a5f1[_0x12c1a9(0x18f)],this[_0x12c1a9(0x17a)]=new Set(),this[_0x12c1a9(0x181)]=null,(this['breakpoints']=_0x260e3d,_0x24a5f1[_0x12c1a9(0x189)](typeof window,'u')&&(this[_0x12c1a9(0x179)](),this['detectCurrentBreakpoint']()));}[_0x19f7fe(0x170)](){const _0x5c7980=_0x19f7fe;return this[_0x5c7980(0x187)];}[_0x19f7fe(0x18e)](){const _0x274960=_0x19f7fe;return this[_0x274960(0x166)];}['getMediaQuery'](_0x43b4b8){const _0x3b0f5f=_0x19f7fe,_0x162996={'ZVksc':function(_0x570e26,_0x2708ae){return _0x570e26!==_0x2708ae;}};let _0x10112c=this[_0x3b0f5f(0x17f)](_0x43b4b8);if(!_0x10112c)return'';let _0x559354=[];return _0x162996['ZVksc'](_0x10112c[_0x3b0f5f(0x188)],void 0x0)&&_0x559354['push'](_0x3b0f5f(0x167)+_0x10112c['min']+'px)'),_0x10112c['max']!==void 0x0&&_0x559354[_0x3b0f5f(0x162)](_0x3b0f5f(0x19a)+_0x10112c[_0x3b0f5f(0x163)]+'px)'),_0x559354[_0x3b0f5f(0x15e)]('\x20and\x20');}['getBreakpointConfig'](_0x39bdbc){const _0x138d87=_0x19f7fe,_0x12526c={'zZnkY':function(_0x16864d,_0x516c0d){return _0x16864d in _0x516c0d;}};return _0x39bdbc in this[_0x138d87(0x166)]?this[_0x138d87(0x166)][_0x39bdbc]:this[_0x138d87(0x166)][_0x138d87(0x173)]&&_0x12526c[_0x138d87(0x190)](_0x39bdbc,this[_0x138d87(0x166)][_0x138d87(0x173)])?this[_0x138d87(0x166)]['custom'][_0x39bdbc]:null;}[_0x19f7fe(0x179)](){const _0x491c98=_0x19f7fe,_0x346712={'JuQTU':function(_0x59bd01,_0x42594c){return _0x59bd01===_0x42594c;},'YCfhJ':_0x491c98(0x173),'GrrZe':_0x491c98(0x197)};this['boundHandler']=()=>this[_0x491c98(0x17e)](),Object['keys'](this['breakpoints'])['forEach'](_0x41733e=>{const _0x276dd6=_0x491c98;if(_0x346712[_0x276dd6(0x172)](_0x41733e,_0x346712[_0x276dd6(0x17b)]))return;let _0x4ce7c7=this[_0x276dd6(0x17c)](_0x41733e);if(_0x4ce7c7){let _0xeb2e62=window[_0x276dd6(0x194)](_0x4ce7c7);this[_0x276dd6(0x185)][_0x276dd6(0x16c)](_0x41733e,_0xeb2e62),_0xeb2e62[_0x276dd6(0x17d)](_0x346712[_0x276dd6(0x175)],this[_0x276dd6(0x181)]);}}),this[_0x491c98(0x166)][_0x491c98(0x173)]&&Object[_0x491c98(0x160)](this[_0x491c98(0x166)][_0x491c98(0x173)])['forEach'](_0x3bad11=>{const _0x59137e=_0x491c98;let _0x2c0992=this[_0x59137e(0x17c)](_0x3bad11);if(_0x2c0992){let _0x9dfbf3=window[_0x59137e(0x194)](_0x2c0992);this[_0x59137e(0x185)][_0x59137e(0x16c)](_0x3bad11,_0x9dfbf3),_0x9dfbf3[_0x59137e(0x17d)](_0x346712['GrrZe'],this['boundHandler']);}});}[_0x19f7fe(0x17e)](){const _0x2f6515=_0x19f7fe,_0x40c2e0={'gBfuZ':'desktop','iivbS':_0x2f6515(0x191),'XFngh':function(_0x5d66ad,_0x544e38){return _0x5d66ad>=_0x544e38;},'OVlRy':function(_0xc53a35,_0x462381){return _0xc53a35<=_0x462381;},'GCWtV':function(_0x4b9d34,_0x5402ff){return _0x4b9d34<=_0x5402ff;},'GtuYc':'wide','tJuwn':function(_0x26592c,_0x11d3aa){return _0x26592c===_0x11d3aa;},'rFDrd':function(_0x30ed97,_0x56b082){return _0x30ed97===_0x56b082;},'QtXFD':function(_0x5cb28e,_0x335058){return _0x5cb28e!==_0x335058;}};let _0xb354e=window['innerWidth'],_0x5134cf=_0x40c2e0[_0x2f6515(0x18c)];if(_0xb354e<=this['breakpoints'][_0x2f6515(0x191)][_0x2f6515(0x163)]?_0x5134cf=_0x40c2e0['iivbS']:_0x40c2e0[_0x2f6515(0x16e)](_0xb354e,this[_0x2f6515(0x166)]['tablet'][_0x2f6515(0x188)])&&_0x40c2e0[_0x2f6515(0x16d)](_0xb354e,this[_0x2f6515(0x166)][_0x2f6515(0x169)][_0x2f6515(0x163)])?_0x5134cf=_0x2f6515(0x169):_0xb354e>=this[_0x2f6515(0x166)][_0x2f6515(0x199)]['min']&&_0x40c2e0['GCWtV'](_0xb354e,this[_0x2f6515(0x166)][_0x2f6515(0x199)][_0x2f6515(0x163)])?_0x5134cf=_0x2f6515(0x199):_0x40c2e0[_0x2f6515(0x16e)](_0xb354e,this[_0x2f6515(0x166)][_0x2f6515(0x178)][_0x2f6515(0x188)])&&(_0x5134cf=_0x40c2e0[_0x2f6515(0x16b)]),this[_0x2f6515(0x166)][_0x2f6515(0x173)]){for(let [_0x369ae0,_0x320849]of Object[_0x2f6515(0x182)](this[_0x2f6515(0x166)]['custom']))if((_0x40c2e0['tJuwn'](_0x320849[_0x2f6515(0x188)],void 0x0)||_0x40c2e0['XFngh'](_0xb354e,_0x320849['min']))&&(_0x40c2e0['rFDrd'](_0x320849['max'],void 0x0)||_0x40c2e0[_0x2f6515(0x16d)](_0xb354e,_0x320849['max']))){_0x5134cf=_0x369ae0;break;}}_0x40c2e0['QtXFD'](_0x5134cf,this[_0x2f6515(0x187)])&&(this[_0x2f6515(0x187)]=_0x5134cf,this[_0x2f6515(0x198)]());}[_0x19f7fe(0x180)](_0x1d3981){const _0x18163e=_0x19f7fe;return this[_0x18163e(0x17a)]['add'](_0x1d3981),()=>this[_0x18163e(0x17a)][_0x18163e(0x164)](_0x1d3981);}[_0x19f7fe(0x198)](){const _0x5094e7=_0x19f7fe;this[_0x5094e7(0x17a)]['forEach'](_0x312559=>_0x312559(this[_0x5094e7(0x187)]));}[_0x19f7fe(0x16a)](_0xc5147){const _0x191d59=_0x19f7fe;let _0xe2f383=this['mediaQueryListeners'][_0x191d59(0x177)](_0xc5147);return _0xe2f383?_0xe2f383['matches']:![];}['destroy'](){const _0x30f9fe=_0x19f7fe,_0x5afb2c={'KxQJU':'change'};this[_0x30f9fe(0x181)]&&(this[_0x30f9fe(0x185)][_0x30f9fe(0x176)](_0x2382ed=>{const _0xb7e7f0=_0x30f9fe;_0x2382ed[_0xb7e7f0(0x15d)](_0x5afb2c['KxQJU'],this['boundHandler']);}),this['boundHandler']=null),this[_0x30f9fe(0x185)][_0x30f9fe(0x18a)](),this[_0x30f9fe(0x17a)]['clear']();}},o=null;function d(_0x5351a7){return o||(o=new s(_0x5351a7)),o;}function b(_0x5d77a1){const _0x8584f5=_0x19f7fe,_0x58f0b8={'UkEBP':function(_0x368240,_0xffada6){return _0x368240(_0xffada6);},'aWzZV':_0x8584f5(0x199),'ByIMp':function(_0x3ac2b8,_0x3971eb){return _0x3ac2b8===_0x3971eb;},'NkKRF':_0x8584f5(0x191),'femKy':_0x8584f5(0x169),'ZukYH':function(_0x406e31,_0x28d721){return _0x406e31===_0x28d721;}};let [_0x68750c,_0x391f54]=_0x58f0b8[_0x8584f5(0x193)](useState,_0x58f0b8[_0x8584f5(0x171)]),_0x5e8090=d(_0x5d77a1);return useEffect(()=>(_0x391f54(_0x5e8090[_0x8584f5(0x170)]()),_0x5e8090[_0x8584f5(0x180)](_0x52e272=>{const _0x2c8f19=_0x8584f5;_0x58f0b8[_0x2c8f19(0x193)](_0x391f54,_0x52e272);})),[_0x5d77a1]),{'currentBreakpoint':_0x68750c,'isMobile':_0x58f0b8['ByIMp'](_0x68750c,_0x58f0b8['NkKRF']),'isTablet':_0x58f0b8[_0x8584f5(0x19b)](_0x68750c,_0x58f0b8[_0x8584f5(0x16f)]),'isDesktop':_0x68750c===_0x58f0b8['aWzZV'],'isWide':_0x58f0b8['ZukYH'](_0x68750c,_0x8584f5(0x178)),'matches':_0x58e74a=>_0x5e8090[_0x8584f5(0x16a)](_0x58e74a)};}function _0x5665(){const _0x4da32d=['oeHqrwDkAG','m3DWyLLUtW','BwvKAwfrDwvYEuXPC3rLBMvYCW','ndeXnJyXmM5IEhrjAG','y3vYCMvUDejYzwfRCg9PBNq','BwLU','D292v28','y2XLyxi','mJbey1nIquq','z0jMDvO','mtrAALLSyxO','z2v0qNjLywTWB2LUDhm','ANfdvfC','ELPUA1K','Bw9IAwXL','mJC3mtq2odDAEvvpEfC','vwTfqLa','Bwf0y2HnzwrPyq','mtGYntCYwu1hvxfI','mtjWuKfrAu4','y2HHBMDL','BM90Awz5tgLZDgvUzxjZ','zgvZA3rVCa','kg1HEc13Awr0AdOG','qNLjtxa','mteWodq0rMjbvffQ','CMvTB3zLrxzLBNrmAxn0zw5LCG','AM9PBG','nZy1mda0ovLXAK1pwq','A2v5CW','nZCWnJuWDuTOqLji','ChvZAa','Bwf4','zgvSzxrL','mte3DNjLEMnL','yNjLywTWB2LUDhm','kg1PBI13Awr0AdOG','mtbfBuTqA2O','DgfIBgv0','Bwf0y2HLCW','r3r1wwm','C2v0','t1zSuNK','wezUz2G','zMvTs3K','z2v0q3vYCMvUDejYzwfRCg9PBNq','yvD6wLy','sNvrvfu','y3vZDg9T','nJCWndmWnMPqD3vluW','r3jYwMu','zM9YrwfJAa','z2v0','D2LKzq','C2v0DxbnzwrPyvf1zxj5tgLZDgvUzxjZ','BgLZDgvUzxjZ','wunMAeO','z2v0twvKAwfrDwvYEq','ywrKrxzLBNrmAxn0zw5LCG','zgv0zwn0q3vYCMvUDejYzwfRCg9PBNq','z2v0qNjLywTWB2LUDenVBMzPzW','C3vIC2nYAwjL','yM91BMriyw5KBgvY','zw50CMLLCW'];_0x5665=function(){return _0x4da32d;};return _0x5665();}export{b as useBreakpoints};
|