@blocklet/list 0.14.7 → 0.14.9

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.
Files changed (2) hide show
  1. package/lib/index.es.js +939 -763
  2. package/package.json +8 -6
package/lib/index.es.js CHANGED
@@ -1,56 +1,79 @@
1
- import { jsx as t, jsxs as f, Fragment as M } from "react/jsx-runtime";
2
- import { styled as E, useTheme as fe } from "@arcblock/ux/lib/Theme";
3
- import { Box as v, Autocomplete as Qe, TextField as Xe, OutlinedInput as Ke, InputAdornment as ae, Button as J, useTheme as ge, useMediaQuery as O, Drawer as Ye, CircularProgress as Z, MenuList as Je, SvgIcon as Ze, Popper as et, Grow as tt, Paper as rt, ClickAwayListener as ot, MenuItem as nt, Stack as z, FormControlLabel as ye, Checkbox as xe, Typography as L, Link as lt, Grid as se, Chip as it, createTheme as at, ThemeProvider as st } from "@mui/material";
4
- import ct from "lodash/merge";
5
- import { ErrorFallback as ee } from "@arcblock/ux/lib/ErrorBoundary";
6
- import { ErrorBoundary as dt } from "react-error-boundary";
7
- import ut from "@iconify-icons/tabler/compass";
8
- import { Icon as be } from "@iconify/react";
9
- import we from "@mui/icons-material/Close";
10
- import { createContext as ke, useState as F, useMemo as D, useContext as ve, useCallback as X, useEffect as N, useRef as K, forwardRef as pt, memo as ht } from "react";
11
- import { createAxios as Ce } from "@blocklet/js-sdk";
12
- import mt from "lodash/omitBy";
13
- import ft from "lodash/orderBy";
14
- import { useRequest as U, useDebounceFn as Se, useInfiniteScroll as gt, useReactive as yt } from "ahooks";
1
+ import { jsx as t, jsxs as f, Fragment as N } from "react/jsx-runtime";
2
+ import { styled as q, useTheme as de } from "@arcblock/ux/lib/Theme";
3
+ import Ge from "@mui/material/styles/createTheme";
4
+ import Ke from "@mui/material/styles/ThemeProvider";
5
+ import Xe from "lodash/merge";
6
+ import { ErrorFallback as ue } from "@arcblock/ux/lib/ErrorBoundary";
7
+ import w from "@mui/material/Box";
8
+ import T from "@mui/material/Stack";
9
+ import { ErrorBoundary as Qe } from "react-error-boundary";
10
+ import Ye from "@iconify-icons/tabler/compass";
11
+ import { Icon as Be } from "@iconify/react";
12
+ import he from "@mui/icons-material/Close";
13
+ import x from "@mui/material/Typography";
14
+ import { createContext as Re, useState as L, useMemo as $, useContext as Pe, useCallback as ae, useEffect as j, forwardRef as Ze, useRef as ce, memo as Je } from "react";
15
+ import { createAxios as Te } from "@blocklet/js-sdk";
16
+ import et from "lodash/orderBy";
17
+ import { useRequest as Z, useDebounceFn as Ae, useInfiniteScroll as tt, useReactive as rt } from "ahooks";
18
+ import re from "lodash/omitBy";
15
19
  import "color";
16
20
  import "lodash/cloneDeep";
17
- import { parseURL as xt, parseQuery as bt, parseFilename as wt, stringifyParsedURL as kt, withQuery as Pe, joinURL as ce } from "ufo";
18
- import de from "flat";
19
- import Be from "@arcblock/ux/lib/Avatar";
20
- import Y from "@mui/icons-material/Search";
21
- import vt from "@mui/material/CircularProgress";
22
- import { useHotkeys as Ct } from "react-hotkeys-hook";
23
- import w from "prop-types";
24
- import St from "@mui/icons-material/Check";
25
- import Pt from "@mui/icons-material/KeyboardArrowDown";
26
- import Bt from "lodash/isEmpty";
27
- import Te from "@mui/material/Box";
28
- import Tt from "@arcblock/ux/lib/Img";
29
- import Rt from "@iconify-icons/tabler/cloud-download";
30
- import It from "@mui/icons-material/ChevronLeft";
31
- import Lt from "@mui/icons-material/ChevronRight";
32
- import At from "react-image-gallery";
21
+ import { parseURL as ot, parseQuery as nt, parseFilename as lt, stringifyParsedURL as it, withQuery as pe, joinURL as ye } from "ufo";
22
+ import xe from "flat";
23
+ import J from "@mui/material/Button";
24
+ import st from "@mui/material/styles/useTheme";
25
+ import W from "@mui/material/useMediaQuery";
26
+ import at from "@mui/material/Drawer";
27
+ import Fe from "@mui/material/Checkbox";
28
+ import Le from "@mui/material/FormControlLabel";
29
+ import ct from "@mui/icons-material/Check";
30
+ import dt from "@mui/icons-material/KeyboardArrowDown";
31
+ import ut from "@mui/material/ClickAwayListener";
32
+ import ht from "@mui/material/Grow";
33
+ import Oe from "@mui/material/MenuItem";
34
+ import ze from "@mui/material/MenuList";
35
+ import pt from "@mui/material/Paper";
36
+ import mt from "@mui/material/Popper";
37
+ import ft from "@mui/material/SvgIcon";
38
+ import gt from "lodash/isEmpty";
39
+ import ee from "@mui/material/CircularProgress";
40
+ import _e from "@arcblock/ux/lib/Avatar";
41
+ import yt from "@iconify-icons/tabler/cloud-download";
42
+ import xt from "@mui/icons-material/ChevronLeft";
43
+ import wt from "@mui/icons-material/ChevronRight";
44
+ import bt from "react-image-gallery";
45
+ import kt from "@arcblock/ux/lib/Img";
46
+ import vt from "@mui/material/Skeleton";
33
47
  import "react-image-gallery/styles/css/image-gallery.css";
34
- import zt from "@arcblock/ux/lib/Empty";
35
- import _t from "react-infinite-scroll-hook";
36
- import Re from "@mui/material/Typography";
48
+ import we from "@mui/material/Grid";
49
+ import Ct from "react-infinite-scroll-hook";
50
+ import St from "@mui/material/Chip";
51
+ import Y from "@mui/icons-material/Search";
52
+ import It from "@mui/icons-material/Verified";
53
+ import Bt from "@mui/material/Autocomplete";
54
+ import Rt from "@mui/material/Dialog";
55
+ import Ee from "@mui/material/OutlinedInput";
56
+ import Pt from "@mui/material/TextField";
57
+ import { useHotkeys as Tt } from "react-hotkeys-hook";
58
+ import be from "@mui/material/InputAdornment";
59
+ import At from "@arcblock/ux/lib/Empty";
37
60
  import Ft from "json-stable-stringify";
38
- import Et from "@mui/icons-material/Menu";
39
- const Ie = ke({
61
+ import Lt from "@mui/icons-material/Menu";
62
+ const Me = Re({
40
63
  open: !1,
41
64
  toggleOpen: (e) => {
42
65
  }
43
66
  });
44
67
  function Ot({ children: e }) {
45
- const [r, o] = F(!1), l = (a) => {
46
- o(a ?? !a);
47
- }, n = D(() => ({ open: r, toggleOpen: l }), [r]);
48
- return /* @__PURE__ */ t(Ie.Provider, { value: n, children: e });
68
+ const [r, o] = L(!1), n = (s) => {
69
+ o(s ?? !s);
70
+ }, i = $(() => ({ open: r, toggleOpen: n }), [r]);
71
+ return /* @__PURE__ */ t(Me.Provider, { value: i, children: e });
49
72
  }
50
- function te() {
51
- return ve(Ie);
73
+ function me() {
74
+ return Pe(Me);
52
75
  }
53
- const I = {
76
+ const P = {
54
77
  nameAsc: "title",
55
78
  nameDesc: "title",
56
79
  popularity: "stats.downloads",
@@ -64,13 +87,59 @@ const I = {
64
87
  explorePath: "/api/blocklets/explore",
65
88
  exploreDidsPath: "/api/blocklets/dids",
66
89
  cacheSize: 100
67
- }, Dt = (e) => U(
90
+ }, zt = (e) => Z(
68
91
  async () => {
69
- const { data: r } = await e.get(I.categoriesPath);
92
+ const { data: r } = await e.get(P.categoriesPath);
70
93
  return Array.isArray(r) ? r : [];
71
94
  },
72
95
  { manual: !0 }
73
- ), Le = (e) => [
96
+ );
97
+ function _t(e, r) {
98
+ const o = { sortBy: "popularity", sortDirection: "desc", ...e }, {
99
+ onFilterChange: n,
100
+ onSearchSelect: i = (l) => {
101
+ r.onFilterChange({ ...o, keyword: l.title });
102
+ },
103
+ emptyCategory: s
104
+ } = r;
105
+ !o.category && !s && (o.category = "All");
106
+ const c = (l) => {
107
+ const p = { ...o, ...l };
108
+ n(re(p, (d) => d === "" || d === void 0));
109
+ };
110
+ return {
111
+ filters: e,
112
+ cleanFilter: (l) => {
113
+ const p = l ? re(o, (d, g) => l.includes(g)) : {};
114
+ n(re(p, (d) => d === "" || d === void 0));
115
+ },
116
+ handleSort: (l, p) => {
117
+ c({ sortBy: l, sortDirection: p || l === "nameAsc" ? "asc" : "desc" });
118
+ },
119
+ handleKeyword: (l) => {
120
+ c({ category: void 0, keyword: l || void 0 });
121
+ },
122
+ handlePrice: (l) => {
123
+ c({ price: l === e.price ? void 0 : l });
124
+ },
125
+ handleCategory: (l) => {
126
+ c({ category: l === e.category ? "" : l });
127
+ },
128
+ handleDeveloper: (l) => {
129
+ c({ owner: l || void 0 });
130
+ },
131
+ handlePage: (l) => {
132
+ c({ currentPage: l });
133
+ },
134
+ handleSwitchShowResources: (l) => {
135
+ c({ showResources: l });
136
+ },
137
+ handleSearchSelect: (l) => {
138
+ i(l);
139
+ }
140
+ };
141
+ }
142
+ const Et = (e, r, o) => e && r || !o, Ne = (e) => [
74
143
  {
75
144
  name: e("sort.popularity"),
76
145
  value: "popularity"
@@ -83,25 +152,25 @@ const I = {
83
152
  // name: t('sort.rating'),
84
153
  // value: 'rating',
85
154
  // },
86
- ], Ae = (e, r, o) => {
87
- var g, h;
88
- const l = xt(e), n = bt(l.search);
89
- if ((g = wt(e, { strict: !0 })) == null ? void 0 : g.endsWith(".gif"))
90
- return n.imageFilter ? kt({ ...l, search: "" }) : e;
91
- if (n.imageFilter)
155
+ ], De = (e, r, o) => {
156
+ var d, g;
157
+ const n = ot(e), i = nt(n.search);
158
+ if ((d = lt(e, { strict: !0 })) == null ? void 0 : d.endsWith(".gif"))
159
+ return i.imageFilter ? it({ ...n, search: "" }) : e;
160
+ if (i.imageFilter)
92
161
  return e;
93
- const d = o || ((h = window.blocklet) == null ? void 0 : h.version), { w: u, h: i } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
94
- return Pe(e, {
95
- ...u || i ? { imageFilter: "resize", w: u, h: i } : {},
96
- v: d
162
+ const c = o || ((g = window.blocklet) == null ? void 0 : g.version), { w: l, h: p } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
163
+ return pe(e, {
164
+ ...l || p ? { imageFilter: "resize", w: l, h: p } : {},
165
+ v: c
97
166
  });
98
167
  }, Mt = (e) => [
99
168
  { name: e("blocklet.free"), value: "free" },
100
169
  { name: e("blocklet.payment"), value: "payment" }
101
- ], Nt = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), $t = (e, r) => (
170
+ ], Nt = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), Dt = (e, r) => (
102
171
  // eslint-disable-next-line no-prototype-builtins
103
- e == null ? void 0 : e.replace(/{(\w*)}/g, (o, l) => r.hasOwnProperty(l) ? r[l] : "")
104
- ), Wt = () => window.innerWidth <= 600, jt = {
172
+ e == null ? void 0 : e.replace(/{(\w*)}/g, (o, n) => r.hasOwnProperty(n) ? r[n] : "")
173
+ ), Wt = () => window.innerWidth <= 600, $t = {
105
174
  common: {
106
175
  title: "Blocklet Store",
107
176
  searchStore: "Search Blocklet",
@@ -134,7 +203,7 @@ const I = {
134
203
  helperText: "Please select a category"
135
204
  },
136
205
  blocklet: {
137
- noResults: "No Blocklets",
206
+ noResults: "Not found Blocklet",
138
207
  free: "Free",
139
208
  search: 'Results for "{keyword}"',
140
209
  resultCount: "{count} Blocklets",
@@ -150,7 +219,7 @@ const I = {
150
219
  autocomplete: {
151
220
  expandResult: 'View all search results for "{name}"'
152
221
  }
153
- }, qt = {
222
+ }, jt = {
154
223
  common: {
155
224
  title: "Blocklet 商店",
156
225
  searchStore: "搜索 Blocklet",
@@ -183,7 +252,7 @@ const I = {
183
252
  helperText: "请选择分类"
184
253
  },
185
254
  blocklet: {
186
- noResults: "暂无应用",
255
+ noResults: "未搜索到 Blocklet",
187
256
  free: "免费",
188
257
  search: '搜索 "{keyword}" 的结果',
189
258
  resultCount: "{count} 个 Blocklet",
@@ -199,16 +268,16 @@ const I = {
199
268
  autocomplete: {
200
269
  expandResult: "查看 “{name}” 的所有搜索结果"
201
270
  }
202
- }, Q = {
203
- en: de(jt),
204
- zh: de(qt)
205
- }, ze = (e, r) => {
271
+ }, oe = {
272
+ en: xe($t),
273
+ zh: xe(jt)
274
+ }, We = (e, r) => {
206
275
  const o = {};
207
276
  return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
208
277
  }, Ut = (e) => (r, o) => {
209
- const l = Q[e] ? Q[e][r] : Q.en[r];
210
- return $t(l, o) || r;
211
- }, _e = {
278
+ const n = oe[e] ? oe[e][r] : oe.en[r];
279
+ return Dt(n, o) || r;
280
+ }, $e = {
212
281
  errors: {
213
282
  fetchCategoriesError: null
214
283
  },
@@ -221,7 +290,6 @@ const I = {
221
290
  storeVersion: "",
222
291
  minItemWidth: 350,
223
292
  serverVersion: "",
224
- filters: {},
225
293
  layout: {},
226
294
  selectedCategory: void 0,
227
295
  categoryList: [],
@@ -234,320 +302,126 @@ const I = {
234
302
  showResourcesSwitch: !1,
235
303
  showCategory: !1,
236
304
  tagFilters: [],
305
+ developerName: "",
237
306
  onFilterChange: () => {
238
307
  },
239
- handleSort: () => {
240
- },
241
- cleanFilter: () => {
242
- },
243
- handleKeyword: () => {
244
- },
245
- handlePrice: () => {
246
- },
247
- handleCategory: () => {
248
- },
249
- handleDeveloper: () => {
250
- },
251
- handlePage: () => {
252
- },
253
- developerName: "",
254
308
  updateDeveloperName: () => {
255
309
  },
256
- handleSwitchShowResources: () => {
257
- },
258
310
  getCategoryLocale: () => null,
259
- handleSearchSelect: () => {
260
- }
261
- }, Fe = ke(_e), { Provider: Vt, Consumer: Yr } = Fe;
262
- function Ht(e) {
263
- const {
264
- locale: r = "zh",
265
- filters: o = {},
266
- serverVersion: l = "",
267
- onFilterChange: n = () => {
311
+ search: {
312
+ filters: {},
313
+ cleanFilter: () => {
268
314
  },
269
- onSearchSelect: a = ({ detailUrl: p }) => {
270
- window.location.href = p;
315
+ handleSort: () => {
271
316
  },
272
- minItemWidth: d = 350,
273
- queryFilter: u = !0,
274
- layout: i = {},
275
- wrapChildren: g = (p) => p,
276
- extraFilter: h = (p) => p,
277
- baseSearch: m = !1,
278
- fetchCategoryDelay: C = 0,
279
- showResourcesSwitch: R = !1,
280
- showCategory: A = !0,
281
- tagFilters: c = [],
282
- children: k,
283
- storeVersion: x,
284
- endpoint: B,
285
- blockletRender: s
286
- } = e, y = ze(l, x), T = D(() => Ce({ baseURL: B, headers: y }), [B]), P = { sortBy: "popularity", sortDirection: "desc", ...o };
287
- !P.category && !i.showExplore && (P.category = "All");
288
- const [Ne, $e] = F(""), We = P.category, {
289
- data: H = [],
290
- error: je,
291
- loading: qe,
292
- run: le
293
- } = Dt(T), G = D(() => {
294
- const p = ft(H, [(_) => _.name], ["asc"]), b = p.findIndex((_) => _.name === "All" || _.locales.en === "All");
295
- return b > -1 ? [{ ...p[b], _id: "All" }, ...p.slice(0, b), ...p.slice(b + 1)] : p;
296
- }, [H]), ie = X(Ut(r), [r]), Ue = D(() => Nt(G, r), [G, r]), Ve = Mt(ie), He = {
297
- errors: { fetchCategoriesError: je },
298
- loadings: {
299
- fetchCategoriesLoading: qe
317
+ handleKeyword: () => {
300
318
  },
301
- extraFilter: h,
302
- endpoint: B,
303
- queryFilter: u,
304
- layout: {
305
- showExplore: i.showExplore ?? !1,
306
- showCategory: i.showCategory ?? !0,
307
- showTitle: i.showTitle ?? !0,
308
- showSearch: i.showSearch ?? !0
319
+ handlePrice: () => {
309
320
  },
310
- minItemWidth: d,
311
- wrapChildren: g,
312
- t: ie,
313
- storeVersion: x,
314
- serverVersion: l,
315
- filters: P,
316
- selectedCategory: We,
317
- categoryList: G,
318
- blockletRender: s,
319
- locale: r,
320
- categoryOptions: Ue,
321
- priceOptions: Ve,
322
- storeApi: T,
323
- baseSearch: m,
324
- showResourcesSwitch: R,
325
- showCategory: A,
326
- tagFilters: c,
327
- onFilterChange: n,
328
- cleanFilter: (p) => {
329
- const b = p ? mt(P, (_, Ge) => p == null ? void 0 : p.includes(Ge)) : {};
330
- n(b);
321
+ handleCategory: () => {
331
322
  },
332
- handleSort: (p) => {
333
- const b = { ...P, sortBy: p, sortDirection: p === "nameAsc" ? "asc" : "desc" };
334
- n(b);
323
+ handleDeveloper: () => {
335
324
  },
336
- handleKeyword: (p) => {
337
- const b = { ...P, category: void 0, keyword: p || void 0 };
338
- n(b);
325
+ handleSwitchShowResources: () => {
339
326
  },
340
- handlePrice: (p) => {
341
- const b = { ...P, price: p === P.price ? void 0 : p };
342
- n(b);
327
+ handleSearchSelect: () => {
343
328
  },
344
- handleCategory: (p) => {
345
- const b = p === "all" || p === P.category ? "" : p, _ = { ...P, category: b };
346
- n(_);
329
+ handlePage: () => {
330
+ }
331
+ }
332
+ }, je = Re($e), { Provider: Vt, Consumer: Co } = je;
333
+ function Ht(e) {
334
+ const {
335
+ locale: r = "zh",
336
+ filters: o = {},
337
+ serverVersion: n = "",
338
+ onFilterChange: i = () => {
347
339
  },
348
- handleDeveloper: (p) => {
349
- const b = { ...P, owner: p || void 0 };
350
- n(b);
340
+ minItemWidth: s = 350,
341
+ queryFilter: c = !0,
342
+ layout: l = {},
343
+ wrapChildren: p = (R) => R,
344
+ extraFilter: d = (R) => R,
345
+ baseSearch: g = !1,
346
+ fetchCategoryDelay: h = 0,
347
+ showResourcesSwitch: m = !1,
348
+ showCategory: k = !0,
349
+ tagFilters: C = [],
350
+ children: S,
351
+ storeVersion: B,
352
+ onSearchSelect: u = () => {
351
353
  },
352
- handlePage: (p) => {
353
- const b = { ...P, currentPage: p };
354
- n(b);
354
+ endpoint: v,
355
+ blockletRender: y
356
+ } = e, A = We(n, B), F = $(() => Te({ baseURL: v, headers: A }), [v]), O = _t(o, { onFilterChange: i, emptyCategory: !l.showExplore, onSearchSelect: u }), [_, U] = L(""), {
357
+ data: V = [],
358
+ error: te,
359
+ loading: G,
360
+ run: K
361
+ } = zt(F), D = $(() => {
362
+ const R = et(V, [(M) => M.name], ["asc"]), z = R.findIndex((M) => M.name === "All" || M.locales.en === "All");
363
+ return z > -1 ? [{ ...R[z], _id: "All" }, ...R.slice(0, z), ...R.slice(z + 1)] : R;
364
+ }, [V]), H = ae(Ut(r), [r]), a = $(() => Nt(D, r), [D, r]), b = Mt(H), E = {
365
+ search: O,
366
+ errors: { fetchCategoriesError: te },
367
+ loadings: {
368
+ fetchCategoriesLoading: G
355
369
  },
356
- handleSwitchShowResources: () => {
357
- const p = { ...P };
358
- n(p);
370
+ extraFilter: d,
371
+ endpoint: v,
372
+ queryFilter: c,
373
+ layout: {
374
+ showExplore: l.showExplore ?? !1,
375
+ showCategory: l.showCategory ?? !0,
376
+ showTitle: l.showTitle ?? !0,
377
+ showSearch: l.showSearch ?? !0
359
378
  },
360
- getCategoryLocale: (p) => {
361
- if (!p)
379
+ minItemWidth: s,
380
+ wrapChildren: p,
381
+ t: H,
382
+ storeVersion: B,
383
+ serverVersion: n,
384
+ selectedCategory: O.filters.category || (l.showExplore ? "" : "All"),
385
+ categoryList: D,
386
+ blockletRender: y,
387
+ locale: r,
388
+ categoryOptions: a,
389
+ priceOptions: b,
390
+ storeApi: F,
391
+ baseSearch: g,
392
+ showResourcesSwitch: m,
393
+ showCategory: k,
394
+ tagFilters: C,
395
+ onFilterChange: i,
396
+ getCategoryLocale: (R) => {
397
+ if (!R)
362
398
  return null;
363
- const b = H.find((_) => _._id === p);
364
- return b ? b.locales[r] || b.locales.en : null;
399
+ const z = V.find((M) => M._id === R || M.locales.en === "All");
400
+ return z ? z.locales[r] || z.locales.en : null;
365
401
  },
366
402
  get developerName() {
367
- return Ne;
403
+ return _;
368
404
  },
369
- updateDeveloperName: $e,
370
- handleSearchSelect: a
405
+ updateDeveloperName: U
371
406
  };
372
- return N(() => {
373
- setTimeout(le, C || 0);
374
- }, [B, le, C]), /* @__PURE__ */ t(Vt, { value: He, children: k });
407
+ return j(() => {
408
+ setTimeout(K, h || 0);
409
+ }, [v, K, h]), /* @__PURE__ */ t(Vt, { value: E, children: S });
375
410
  }
376
- function S() {
377
- const e = ve(Fe);
378
- return e || _e;
379
- }
380
- const ue = "__FREE_TEXT__";
381
- function Gt() {
382
- const e = K(null), r = K(!1), [o, l] = F(!1), [n, a] = F(""), { storeApi: d, filters: u, endpoint: i, handleKeyword: g, t: h, handleSearchSelect: m } = S(), C = async (s) => {
383
- const { data: y } = await d.get(I.blockletsPath, { params: s });
384
- return y.dataList || [];
385
- }, { loading: R, data: A, run: c } = U(
386
- (s) => s ? C({
387
- sortBy: I.nameDesc,
388
- page: 1,
389
- pageSize: 10,
390
- keyword: s
391
- }) : Promise.resolve([]),
392
- {
393
- manual: !0
394
- }
395
- );
396
- N(() => {
397
- c(u.keyword), a(u.keyword || "");
398
- }, [u.keyword, c]), Ct(
399
- "ctrl + k, command + k",
400
- (s) => {
401
- var y, T;
402
- return s.stopPropagation(), s.preventDefault(), (T = (y = e.current) == null ? void 0 : y.querySelector("input")) == null || T.focus(), !1;
403
- },
404
- { enableOnTags: ["INPUT"] }
405
- );
406
- const k = Se((s) => c(s), { wait: 300 }), x = { name: ue, title: n, did: "" };
407
- return /* @__PURE__ */ t(v, { overflow: "hidden", children: /* @__PURE__ */ t(
408
- Qe,
409
- {
410
- ref: e,
411
- open: !!n && o,
412
- size: "small",
413
- onOpen: () => {
414
- l(!0);
415
- },
416
- onClose: (s, y) => {
417
- l(!1), y === "selectOption" && !r.current && g(n);
418
- },
419
- options: n ? [x, ...A || []] : [],
420
- renderOption: (s, y) => /* @__PURE__ */ f(v, { component: "li", ...s, gap: 1, children: [
421
- B(y),
422
- y.title
423
- ] }),
424
- value: x,
425
- onChange: (s, y) => {
426
- y != null && y.did && (r.current = !0, m({
427
- blocklet: y,
428
- detailUrl: ce(i, "blocklets", y.did),
429
- storeUrl: i
430
- }));
431
- },
432
- inputValue: n,
433
- onInputChange: (s, y, T) => {
434
- a(y), r.current = !1, k.run(y), T === "clear" && g("");
435
- },
436
- isOptionEqualToValue: (s, y) => s.name === y.name,
437
- getOptionLabel: (s) => s.title,
438
- getOptionKey: (s) => s.name,
439
- noOptionsText: h("blocklet.noResults"),
440
- loading: R,
441
- autoHighlight: !0,
442
- forcePopupIcon: !1,
443
- slotProps: { paper: { sx: { mt: 0.5, minWidth: "100%", width: "fit-content" } } },
444
- sx: {
445
- bgcolor: "#F9FAFB",
446
- borderRadius: "8px",
447
- overflow: "hidden",
448
- ".MuiAutocomplete-clearIndicator": { visibility: n ? "visible" : "hidden" },
449
- ".MuiOutlinedInput-notchedOutline": {
450
- borderRadius: "8px",
451
- borderColor: "transparent"
452
- },
453
- "&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline": {
454
- borderColor: "divider"
455
- }
456
- },
457
- renderInput: (s) => /* @__PURE__ */ t(
458
- Xe,
459
- {
460
- ...s,
461
- InputProps: {
462
- ...s.InputProps,
463
- autoFocus: !0,
464
- placeholder: h("common.searchStore"),
465
- className: "bl-autocomplete-input",
466
- value: n,
467
- startAdornment: /* @__PURE__ */ t(v, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: R ? /* @__PURE__ */ t(vt, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(Y, { sx: { fontSize: 16 } }) })
468
- }
469
- }
470
- ),
471
- filterOptions: (s) => s
472
- }
473
- ) });
474
- function B(s) {
475
- if (s.name === ue)
476
- return /* @__PURE__ */ t(v, { width: 20, display: "flex", justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ t(Y, { sx: { fontSize: 16 } }) });
477
- let y = "";
478
- return s.logo && (y = ce(i, "assets", s.did, Ae(s.logo, 20, s.version))), /* @__PURE__ */ t(Be, { src: y, size: 20 });
479
- }
480
- }
481
- function re({ placeholder: e, ...r }) {
482
- const { filters: o, handleKeyword: l } = S(), [n, a] = F(o.keyword || ""), d = Se(l, { wait: 300 }), u = (g) => {
483
- const { value: h } = g.target;
484
- a(h), d.run(h);
485
- }, i = () => {
486
- a(""), l();
487
- };
488
- return N(() => {
489
- a(o.keyword || "");
490
- }, [o.keyword]), /* @__PURE__ */ t(
491
- Qt,
492
- {
493
- inputProps: {
494
- "data-cy": "search-blocklet"
495
- },
496
- startAdornment: /* @__PURE__ */ t(ae, { position: "start", children: /* @__PURE__ */ t(Xt, {}) }),
497
- onChange: u,
498
- placeholder: e,
499
- value: n,
500
- title: e,
501
- "data-cy": "search",
502
- endAdornment: n && /* @__PURE__ */ t(ae, { position: "end", children: /* @__PURE__ */ t(Kt, { "data-cy": "search-delete", onClick: i }) }),
503
- ...r
504
- }
505
- );
411
+ function I() {
412
+ const e = Pe(je);
413
+ return e || $e;
506
414
  }
507
- re.propTypes = {
508
- placeholder: w.string
509
- };
510
- re.defaultProps = {
511
- placeholder: "Type to search..."
512
- };
513
- const Qt = E(Ke)`
514
- background-color: ${(e) => e.theme.palette.grey[50]};
515
- font-size: 14px;
516
- border-radius: 6px;
517
- width: 100%;
518
- .MuiInputBase-input {
519
- padding: 8px 0 8px 10px;
520
- }
521
- .MuiOutlinedInput-notchedOutline {
522
- border: none;
523
- }
524
- .Mui-focused {
525
- background-color: #f6f6f6;
526
- .MuiInputBase-input::placeholder {
527
- color: transparent;
528
- }
529
- }
530
- `, Xt = E(Y)`
531
- color: ${(e) => e.theme.palette.grey[500]};
532
- font-size: 28px;
533
- @media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
534
- font-size: 24px;
535
- }
536
- `, Kt = E(we)`
537
- color: ${(e) => e.theme.palette.grey[500]};
538
- font-size: 16px;
539
- cursor: pointer;
540
- `;
541
- function Ee({
415
+ function Ue({
542
416
  children: e,
543
417
  onClick: r,
544
418
  size: o = 32,
545
- ...l
419
+ ...n
546
420
  }) {
547
421
  return /* @__PURE__ */ t(
548
422
  J,
549
423
  {
550
- ...l,
424
+ ...n,
551
425
  onClick: r,
552
426
  variant: "outlined",
553
427
  sx: [
@@ -562,130 +436,103 @@ function Ee({
562
436
  borderRadius: 2,
563
437
  color: "text.secondary"
564
438
  },
565
- ...Array.isArray(l.sx) ? l.sx : [l.sx]
439
+ ...Array.isArray(n.sx) ? n.sx : [n.sx]
566
440
  ],
567
441
  children: e
568
442
  }
569
443
  );
570
444
  }
571
- function W(e, r) {
445
+ function X(e, r) {
572
446
  return e === void 0 ? r : e;
573
447
  }
574
- function oe({
448
+ function fe({
575
449
  xs: e,
576
450
  sm: r,
577
451
  md: o,
578
- lg: l,
579
- xl: n,
580
- exact: a
452
+ lg: n,
453
+ xl: i,
454
+ exact: s
581
455
  }) {
582
- const d = ge(), u = O(d.breakpoints.down("sm")), i = O(d.breakpoints.between("sm", "md")), g = O(d.breakpoints.between("md", "lg")), h = O(d.breakpoints.between("lg", "xl"));
583
- if (a)
584
- return u ? e || null : i ? r || null : g ? o || null : h ? l || null : n || null;
585
- let m = e;
586
- return u || (m = W(r, m), i) || (m = W(o, m), g) || (m = W(l, m), h) ? m : W(n, m);
456
+ const c = st(), l = W(c.breakpoints.down("sm")), p = W(c.breakpoints.between("sm", "md")), d = W(c.breakpoints.between("md", "lg")), g = W(c.breakpoints.between("lg", "xl"));
457
+ if (s)
458
+ return l ? e || null : p ? r || null : d ? o || null : g ? n || null : i || null;
459
+ let h = e;
460
+ return l || (h = X(r, h), p) || (h = X(o, h), d) || (h = X(n, h), g) ? h : X(i, h);
587
461
  }
588
- function Yt({ children: e }) {
589
- const { open: r, toggleOpen: o } = te();
462
+ function qt({ children: e }) {
463
+ const { open: r, toggleOpen: o } = me();
590
464
  return /* @__PURE__ */ t(
591
- oe,
465
+ fe,
592
466
  {
593
- xs: /* @__PURE__ */ t(Ye, { open: r, onClose: () => o(!1), children: e }),
594
- md: /* @__PURE__ */ t(v, { children: e })
467
+ xs: /* @__PURE__ */ t(at, { open: r, onClose: () => o(!1), children: e }),
468
+ md: /* @__PURE__ */ t(w, { children: e })
595
469
  }
596
470
  );
597
471
  }
598
- const Jt = E(J)`
599
- border-radius: 4px;
600
- `, ne = pt(({ children: e, rounded: r, loading: o, disabled: l, ...n }, a) => /* @__PURE__ */ t(
601
- Jt,
472
+ const Gt = Ze(({ loading: e, disabled: r, ...o }, n) => /* @__PURE__ */ t(
473
+ J,
602
474
  {
603
- ref: a,
475
+ ref: n,
604
476
  disableElevation: !0,
605
- disabled: l || o,
606
- ...n,
607
- startIcon: o && /* @__PURE__ */ t(Z, { size: "1em" }),
608
- children: e
477
+ disabled: r || e,
478
+ ...o,
479
+ sx: [{ borderRadius: "4px" }, ...Array.isArray(o.sx) ? o.sx : [o.sx]],
480
+ startIcon: e && /* @__PURE__ */ t(ee, { size: "1em" })
609
481
  }
610
482
  ));
611
- ne.propTypes = {
612
- children: w.any,
613
- rounded: w.bool,
614
- loading: w.bool,
615
- disabled: w.bool
616
- };
617
- ne.defaultProps = {
618
- children: null,
619
- rounded: !1,
620
- loading: !1,
621
- disabled: !1
622
- };
623
- function V({ title: e, value: r, icon: o, prepend: l, options: n, onChange: a, itemRender: d, ...u }) {
624
- const i = K(null), g = fe(), [h, m] = F(!1), [C, R] = F(r !== null ? r : ""), A = O(g.breakpoints.down("sm"));
625
- N(() => {
626
- R(r !== null ? r : "");
627
- }, [r]);
628
- const c = X(() => {
629
- m(!1);
630
- }, []), k = X(() => {
631
- m(!0);
483
+ function Ve({ value: e, options: r, onChange: o, placeholder: n, ...i }) {
484
+ var B;
485
+ const s = ce(null), c = de(), [l, p] = L(!1), [d, g] = L(e !== null ? e : ""), h = W(c.breakpoints.down("sm"));
486
+ j(() => {
487
+ g(e !== null ? e : "");
488
+ }, [e]);
489
+ const m = ae(() => {
490
+ p(!1);
491
+ }, []), k = ae(() => {
492
+ p(!0);
632
493
  }, []);
633
- function x(s) {
634
- R(s.value), a(s.value), A && c();
494
+ function C(u) {
495
+ g(u.value), o(u.value), h && m();
635
496
  }
636
- function B(s) {
637
- return s === C;
497
+ function S(u) {
498
+ return u === d;
638
499
  }
639
- return /* @__PURE__ */ f(M, { children: [
500
+ return /* @__PURE__ */ f(N, { children: [
640
501
  /* @__PURE__ */ f(
641
- Zt,
502
+ Kt,
642
503
  {
643
- ref: i,
504
+ ref: s,
644
505
  onClick: k,
645
506
  variant: "outlined",
646
507
  size: "small",
647
- className: ["my-select__selector", Bt(C) ? "" : "my-select__selector--active"].join(" "),
648
- sx: { minWidth: "auto" },
649
- ...u,
508
+ className: ["my-select__selector", gt(d) ? "" : "my-select__selector--active"].join(" "),
509
+ sx: { minWidth: "auto", color: "text.primary" },
510
+ ...i,
650
511
  children: [
651
- /* @__PURE__ */ t("div", { className: "my-select__icon", children: o }),
652
- e,
653
- /* @__PURE__ */ t(Ze, { className: "my-select__arrowdown", component: Pt, fontSize: "small" })
512
+ ((B = r.find((u) => u.value === d)) == null ? void 0 : B.name) || n,
513
+ /* @__PURE__ */ t(ft, { className: "my-select__arrowdown", component: dt, fontSize: "small" })
654
514
  ]
655
515
  }
656
516
  ),
657
- /* @__PURE__ */ t(et, { open: h, anchorEl: i.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: s, placement: y }) => /* @__PURE__ */ t(tt, { ...s, sx: { transformOrigin: y === "bottom" ? "center top" : "center bottom" }, children: /* @__PURE__ */ t(rt, { children: /* @__PURE__ */ t(ot, { onClickAway: c, children: /* @__PURE__ */ f(er, { autoFocusItem: h, onMouseEnter: k, onMouseLeave: c, children: [
658
- l,
659
- n.map((T) => d ? d(T) : /* @__PURE__ */ f(nt, { onClick: () => x(T), children: [
660
- /* @__PURE__ */ t(
661
- St,
662
- {
663
- sx: { mr: 1, fontSize: 16, visibility: B(T.value) ? "visible" : "hidden" }
664
- }
665
- ),
666
- T.name
667
- ] }, T.value))
668
- ] }) }) }) }) })
517
+ /* @__PURE__ */ t(mt, { open: l, anchorEl: s.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: u, placement: v }) => /* @__PURE__ */ t(
518
+ ht,
519
+ {
520
+ ...u,
521
+ style: { transformOrigin: v === "bottom" ? "center top" : "center bottom" },
522
+ children: /* @__PURE__ */ t(pt, { children: /* @__PURE__ */ t(ut, { onClickAway: m, children: /* @__PURE__ */ t(Xt, { autoFocusItem: l, onMouseEnter: k, onMouseLeave: m, children: r.map((y) => /* @__PURE__ */ f(Oe, { onClick: () => C(y), children: [
523
+ /* @__PURE__ */ t(
524
+ ct,
525
+ {
526
+ sx: { mr: 1, fontSize: 16, visibility: S(y.value) ? "visible" : "hidden" }
527
+ }
528
+ ),
529
+ y.name
530
+ ] }, y.value)) }) }) })
531
+ }
532
+ ) })
669
533
  ] });
670
534
  }
671
- V.propTypes = {
672
- options: w.array.isRequired,
673
- value: w.oneOfType([w.string, w.number, w.array]),
674
- onChange: w.func,
675
- itemRender: w.func,
676
- title: w.string.isRequired,
677
- icon: w.any,
678
- prepend: w.any
679
- };
680
- V.defaultProps = {
681
- value: null,
682
- icon: null,
683
- prepend: null,
684
- itemRender: null,
685
- onChange: () => {
686
- }
687
- };
688
- const Zt = E(ne)`
535
+ const Kt = q(Gt)`
689
536
  border: 1px solid #f0f0f0;
690
537
  padding: 6px 8px 6px 12px;
691
538
  font-weight: ${(e) => e.theme.typography.fontWeightRegular};
@@ -699,9 +546,6 @@ const Zt = E(ne)`
699
546
  &.my-select__selector--active {
700
547
  &,
701
548
  .my-select__arrowdown,
702
- .my-select__icon svg {
703
- color: ${(e) => e.theme.palette.primary.main};
704
- }
705
549
  }
706
550
  .my-select__arrowdown {
707
551
  color: #999;
@@ -716,7 +560,7 @@ const Zt = E(ne)`
716
560
  margin-right: 3px;
717
561
  }
718
562
  }
719
- `, er = E(Je)`
563
+ `, Xt = q(ze)`
720
564
  .my-select__option__icon {
721
565
  color: transparent;
722
566
  font-size: 14px;
@@ -733,11 +577,10 @@ const Zt = E(ne)`
733
577
  }
734
578
  }
735
579
  `;
736
- function Oe() {
737
- var d;
738
- const { filters: e, handleSort: r, handlePrice: o, t: l } = S(), n = Le(l), a = ((d = n.find((u) => u.value === e.sortBy)) == null ? void 0 : d.name) || l("sort.sort");
580
+ function He() {
581
+ const { search: e, t: r } = I(), { filters: o, handleSort: n, handlePrice: i } = e, s = Ne(r);
739
582
  return /* @__PURE__ */ f(
740
- z,
583
+ T,
741
584
  {
742
585
  direction: { xs: "row", md: "column" },
743
586
  alignItems: { xs: "center", md: "flex-start" },
@@ -746,46 +589,45 @@ function Oe() {
746
589
  justifyContent: "space-between",
747
590
  children: [
748
591
  /* @__PURE__ */ t(
749
- ye,
592
+ Le,
750
593
  {
751
594
  control: /* @__PURE__ */ t(
752
- xe,
595
+ Fe,
753
596
  {
754
- checked: e.price === "free",
597
+ checked: o.price === "free",
755
598
  size: "small",
756
599
  sx: { "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
757
- onChange: (u) => o(u.target.checked ? "free" : "")
600
+ onChange: (c) => i(c.target.checked ? "free" : "")
758
601
  }
759
602
  ),
760
- label: l("blocklet.free")
603
+ label: r("blocklet.free")
761
604
  }
762
605
  ),
763
606
  /* @__PURE__ */ t(
764
- V,
607
+ Ve,
765
608
  {
766
- value: e.sortBy,
767
- options: n,
768
- title: a,
769
- onChange: r,
770
- icon: null,
771
- prepend: null,
772
- itemRender: null
609
+ value: o.sortBy || s[0].value,
610
+ options: s,
611
+ onChange: (c) => n(c),
612
+ placeholder: r("sort.sort")
773
613
  }
774
614
  )
775
615
  ]
776
616
  }
777
617
  );
778
618
  }
779
- function tr() {
780
- const { selectedCategory: e, handleCategory: r, t: o, categoryOptions: l, filters: n, cleanFilter: a, loadings: d, layout: u, baseSearch: i } = S(), { toggleOpen: g } = te();
781
- return N(() => {
619
+ function Qt() {
620
+ const { selectedCategory: e, search: r, t: o, categoryOptions: n, loadings: i, layout: s, baseSearch: c } = I(), { filters: l, handleCategory: p, cleanFilter: d } = r, { toggleOpen: g } = me();
621
+ j(() => {
782
622
  g(!1);
783
- }, [n.category, n.owner, n.keyword, n.sortBy, n.sortDirection, n.resourceType]), u.showCategory ? /* @__PURE__ */ f(Yt, { children: [
623
+ }, [Object.values(l).join("")]);
624
+ const h = Et(c, s.showSearch, l.keyword);
625
+ return s.showCategory ? /* @__PURE__ */ f(qt, { children: [
784
626
  /* @__PURE__ */ t(
785
- oe,
627
+ fe,
786
628
  {
787
629
  xs: /* @__PURE__ */ f(
788
- z,
630
+ T,
789
631
  {
790
632
  direction: "row",
791
633
  justifyContent: "space-between",
@@ -796,113 +638,117 @@ function tr() {
796
638
  borderBottom: 1,
797
639
  borderColor: "divider",
798
640
  children: [
799
- /* @__PURE__ */ t(Ee, { onClick: () => g(!1), children: /* @__PURE__ */ t(we, {}) }),
800
- /* @__PURE__ */ t(L, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: o("common.category") })
641
+ /* @__PURE__ */ t(Ue, { onClick: () => g(!1), children: /* @__PURE__ */ t(he, {}) }),
642
+ /* @__PURE__ */ t(x, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: o("common.category") })
801
643
  ]
802
644
  }
803
645
  ),
804
646
  md: null
805
647
  }
806
648
  ),
807
- /* @__PURE__ */ f(
808
- z,
649
+ /* @__PURE__ */ t(
650
+ T,
809
651
  {
810
- visibility: d.fetchCategoriesLoading ? "hidden" : "visible",
652
+ visibility: i.fetchCategoriesLoading ? "hidden" : "visible",
811
653
  width: { xs: 268, md: 200 },
812
654
  boxSizing: "content-box",
813
655
  p: { xs: 2, md: 0 },
814
656
  pr: { md: 6 },
815
- children: [
816
- u.showSearch ? /* @__PURE__ */ t(v, { className: "filter-bar", mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: i ? /* @__PURE__ */ t(re, { className: "bl-search-container", placeholder: o("common.searchStore"), sx: { pl: 1.5 } }) : /* @__PURE__ */ t(Gt, {}) }) : null,
817
- n.keyword ? /* @__PURE__ */ t(Oe, {}) : /* @__PURE__ */ f(M, { children: [
818
- u.showExplore && /* @__PURE__ */ f(v, { display: "flex", alignItems: "center", gap: 1, mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
819
- /* @__PURE__ */ t(be, { icon: ut }),
820
- /* @__PURE__ */ t(
821
- L,
822
- {
823
- variant: "body1",
824
- color: e ? "text.lighter" : "text.primary",
825
- fontWeight: e ? void 0 : "fontWeightMedium",
826
- sx: { cursor: "pointer" },
827
- onClick: () => {
828
- g(!1), a();
829
- },
830
- children: o("explore.title")
831
- }
832
- )
833
- ] }),
834
- !!l.length && /* @__PURE__ */ t(z, { gap: 2, children: l.map((h) => /* @__PURE__ */ t(
835
- L,
657
+ children: h ? /* @__PURE__ */ f(N, { children: [
658
+ s.showExplore && /* @__PURE__ */ f(w, { display: "flex", alignItems: "center", gap: 1, mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
659
+ /* @__PURE__ */ t(Be, { icon: Ye }),
660
+ /* @__PURE__ */ t(
661
+ x,
836
662
  {
837
663
  variant: "body1",
838
- title: h.name,
664
+ color: e ? "text.lighter" : "text.primary",
665
+ fontWeight: e ? void 0 : "fontWeightMedium",
839
666
  sx: { cursor: "pointer" },
840
- "data-cy": "filter",
841
- color: e === h.value ? "text.primary" : "text.lighter",
842
- textTransform: "capitalize",
843
667
  onClick: () => {
844
- e === h.value ? a() : r(h.value), g(!1);
668
+ g(!1), d();
845
669
  },
846
- children: h.name
670
+ children: o("explore.title")
671
+ }
672
+ )
673
+ ] }),
674
+ !!n.length && /* @__PURE__ */ t(T, { gap: 2, children: n.map((m) => /* @__PURE__ */ t(
675
+ x,
676
+ {
677
+ variant: "body1",
678
+ title: m.name,
679
+ sx: { cursor: "pointer" },
680
+ "data-cy": "filter",
681
+ color: e === m.value ? "text.primary" : "text.lighter",
682
+ textTransform: "capitalize",
683
+ onClick: () => {
684
+ e === m.value ? d() : p(m.value), g(!1);
847
685
  },
848
- h.value
849
- )) })
850
- ] })
851
- ]
686
+ children: m.name
687
+ },
688
+ m.value
689
+ )) })
690
+ ] }) : /* @__PURE__ */ t(He, {})
852
691
  }
853
692
  )
854
693
  ] }) : null;
855
694
  }
856
- function De() {
857
- const { endpoint: e, serverVersion: r, storeVersion: o } = S(), l = ze(r, o), n = D(() => Ce({
695
+ function ge() {
696
+ const { endpoint: e, serverVersion: r, storeVersion: o } = I(), n = We(r, o), i = $(() => Te({
858
697
  baseURL: e,
859
- headers: l
698
+ headers: n
860
699
  }), [e]);
861
700
  return {
862
- get: async (a) => {
863
- const { data: d } = await n.get(a);
864
- return d;
701
+ get: async (s) => {
702
+ const { data: c } = await i.get(s);
703
+ return c;
865
704
  },
866
- post: async (a, d) => {
867
- const { data: u } = await n.post(a, d);
868
- return u;
705
+ post: async (s, c) => {
706
+ const { data: l } = await i.post(s, c);
707
+ return l;
869
708
  }
870
709
  };
871
710
  }
872
- const Me = ht(function(r) {
873
- return /* @__PURE__ */ t(Te, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(Z, {}) });
711
+ const qe = Je(function(r) {
712
+ return /* @__PURE__ */ t(w, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(ee, {}) });
874
713
  });
875
- function pe({
714
+ function Yt({ showSkeleton: e, ...r }) {
715
+ return e ? /* @__PURE__ */ t(vt, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(kt, { ...r });
716
+ }
717
+ function ke({
876
718
  icon: e,
877
719
  children: r,
878
720
  maxWidth: o = 100,
879
- title: l
721
+ title: n
880
722
  }) {
881
- return (r === 0 || r) && /* @__PURE__ */ f(z, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
723
+ return (r === 0 || r) && /* @__PURE__ */ f(T, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
882
724
  e,
883
725
  /* @__PURE__ */ t(
884
- L,
726
+ x,
885
727
  {
886
728
  flex: 1,
887
729
  variant: "body2",
888
730
  sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
889
- title: l || (typeof r == "string" ? r : void 0),
731
+ title: n || (typeof r == "string" ? r : void 0),
890
732
  children: r
891
733
  }
892
734
  )
893
735
  ] });
894
736
  }
895
- const he = 292;
896
- function rr() {
897
- var R, A;
898
- const { t: e } = S(), { get: r } = De(), o = ge(), l = O(o.breakpoints.down("md")), n = ((A = (R = window.blocklet) == null ? void 0 : R.preferences) == null ? void 0 : A.homeBanner) || [], { data: a = [], error: d } = U(async () => {
899
- const c = await r(
900
- Pe(I.blockletsPath, { didList: n.map((k) => k.did).join(",") })
737
+ const ve = 292;
738
+ function Zt() {
739
+ var S, B;
740
+ const { t: e, search: r } = I(), { get: o } = ge(), n = de(), i = W(n.breakpoints.down("md")), s = ((B = (S = window.blocklet) == null ? void 0 : S.preferences) == null ? void 0 : B.homeBanner) || [], {
741
+ data: c = [],
742
+ error: l,
743
+ loading: p
744
+ } = Z(async () => {
745
+ const u = await o(
746
+ pe(P.blockletsPath, { didList: s.map((v) => v.did).join(",") })
901
747
  );
902
- return c != null && c.dataList ? n.map((k) => c.dataList.find((x) => x.did === k.did)) : [];
748
+ return u != null && u.dataList ? s.map((v) => u.dataList.find((y) => y.did === v.did)) : [];
903
749
  });
904
- d && console.error("Get Banner Blocklets error:", d);
905
- const u = {
750
+ l && console.error("Get Banner Blocklets error:", l);
751
+ const d = {
906
752
  position: "absolute",
907
753
  top: "50%",
908
754
  transform: "translateY(-50%)",
@@ -910,40 +756,40 @@ function rr() {
910
756
  cursor: "pointer",
911
757
  color: "text.lighter"
912
758
  };
913
- return !d && n.length > 0 ? /* @__PURE__ */ f(M, { children: [
914
- /* @__PURE__ */ t(L, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
759
+ return !l && s.length > 0 ? /* @__PURE__ */ f(N, { children: [
760
+ /* @__PURE__ */ t(x, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
915
761
  /* @__PURE__ */ t(
916
- v,
762
+ w,
917
763
  {
918
- height: { xs: "auto", md: he },
764
+ height: { xs: "auto", md: ve },
919
765
  position: "relative",
920
766
  border: 1,
921
767
  borderColor: "divider",
922
768
  borderRadius: 3,
923
769
  overflow: "hidden",
924
770
  children: /* @__PURE__ */ t(
925
- At,
771
+ bt,
926
772
  {
927
773
  showNav: !0,
928
774
  autoPlay: !0,
929
- slideDuration: 1e3,
775
+ slideDuration: i ? 500 : 1e3,
930
776
  slideInterval: 5e3,
931
777
  showPlayButton: !1,
932
778
  showIndex: !1,
933
779
  showBullets: !1,
934
780
  showThumbnails: !1,
935
781
  showFullscreenButton: !1,
936
- renderLeftNav: (c) => /* @__PURE__ */ t(v, { onClick: c, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(It, { sx: { ...u, left: 5 } }) }),
937
- renderRightNav: (c) => /* @__PURE__ */ t(v, { onClick: c, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Lt, { sx: { ...u, right: 5 } }) }),
938
- items: n.map((c, k) => ({
939
- original: c.did,
782
+ renderLeftNav: (u) => /* @__PURE__ */ t(w, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(xt, { sx: { ...d, left: 5 } }) }),
783
+ renderRightNav: (u) => /* @__PURE__ */ t(w, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(wt, { sx: { ...d, right: 5 } }) }),
784
+ items: s.map((u, v) => ({
785
+ original: u.did,
940
786
  renderItem: () => {
941
- var y;
942
- const x = a[k] || {}, B = c.cover || nr(c.did, (y = x.screenshots) == null ? void 0 : y[0]), s = Ae(B, { h: 400, w: 700 });
787
+ var O;
788
+ const y = c[v] || {}, A = u.cover || er(u.did, (O = y.screenshots) == null ? void 0 : O[0]), F = De(A, { h: 400, w: 700 });
943
789
  return /* @__PURE__ */ f(
944
- z,
790
+ T,
945
791
  {
946
- height: { xs: "auto", md: he },
792
+ height: { xs: "auto", md: ve },
947
793
  sx: {
948
794
  "&::before": {
949
795
  content: '""',
@@ -952,9 +798,10 @@ function rr() {
952
798
  left: 0,
953
799
  right: 0,
954
800
  bottom: 0,
955
- backgroundImage: `url("${s}")`,
801
+ cursor: "pointer",
802
+ backgroundImage: `url("${F}")`,
956
803
  backgroundSize: "cover",
957
- filter: "blur(8px)",
804
+ filter: "blur(50px)",
958
805
  opacity: 0.15,
959
806
  zIndex: 0
960
807
  }
@@ -964,16 +811,17 @@ function rr() {
964
811
  justifyContent: "center",
965
812
  alignItems: { xs: "flex-start", md: "center" },
966
813
  p: { xs: 2, md: 5 },
814
+ onClick: () => r.handleSearchSelect(y),
967
815
  gap: { xs: 2, md: 5 },
968
816
  children: [
969
- i(s),
970
- /* @__PURE__ */ f(z, { flex: 1, height: "100%", gap: 3, children: [
971
- /* @__PURE__ */ f(v, { flex: 1, children: [
972
- g(c.name || x.title || c.name),
973
- h(c.desc || x.description)
817
+ g(F),
818
+ /* @__PURE__ */ f(T, { flex: 1, height: "100%", gap: 3, children: [
819
+ /* @__PURE__ */ f(w, { flex: 1, children: [
820
+ h(u.name || y.title || u.name),
821
+ m(u.desc || y.description)
974
822
  ] }),
975
- x.did && m(x, c.baseNum),
976
- C(c.link, c.did)
823
+ y.did && k(y, u.baseNum),
824
+ C(y)
977
825
  ] })
978
826
  ]
979
827
  }
@@ -985,15 +833,25 @@ function rr() {
985
833
  }
986
834
  )
987
835
  ] }) : null;
988
- function i(c) {
989
- return /* @__PURE__ */ t(v, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", position: "relative", children: /* @__PURE__ */ t(Tt, { src: c, alt: "", width: l ? void 0 : 338, height: 210, style: { objectFit: "cover" } }) });
836
+ function g(u) {
837
+ return /* @__PURE__ */ t(w, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", position: "relative", children: /* @__PURE__ */ t(
838
+ Yt,
839
+ {
840
+ showSkeleton: p,
841
+ src: u,
842
+ alt: "",
843
+ width: i ? void 0 : 338,
844
+ height: 210,
845
+ style: { objectFit: "cover" }
846
+ }
847
+ ) });
990
848
  }
991
- function g(c) {
992
- return /* @__PURE__ */ t(L, { variant: "h2", width: "100%", children: c });
849
+ function h(u) {
850
+ return /* @__PURE__ */ t(x, { variant: "h2", width: "100%", children: u });
993
851
  }
994
- function h(c) {
852
+ function m(u) {
995
853
  return /* @__PURE__ */ t(
996
- L,
854
+ x,
997
855
  {
998
856
  variant: "body2",
999
857
  color: "text.secondary",
@@ -1011,109 +869,394 @@ function rr() {
1011
869
  overflow: "hidden",
1012
870
  WebkitBoxOrient: "vertical"
1013
871
  },
1014
- children: c
872
+ children: u
1015
873
  }
1016
874
  );
1017
875
  }
1018
- function m(c, k = 0) {
1019
- const { did: x, owner: B, stats: s } = c;
1020
- return /* @__PURE__ */ f(v, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
1021
- /* @__PURE__ */ t(pe, { icon: /* @__PURE__ */ t(Be, { src: B.avatar, did: x, size: 20, variant: "circle" }), children: B.fullName }),
1022
- /* @__PURE__ */ t(pe, { icon: /* @__PURE__ */ t(be, { icon: Rt }), title: `${s.downloads + k}`, children: or(s.downloads + k) })
876
+ function k(u, v = 0) {
877
+ const { did: y, owner: A, stats: F } = u;
878
+ return /* @__PURE__ */ f(w, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
879
+ /* @__PURE__ */ t(ke, { icon: /* @__PURE__ */ t(_e, { src: A.avatar, did: y, size: 20, variant: "circle" }), children: A.fullName }),
880
+ /* @__PURE__ */ t(ke, { icon: /* @__PURE__ */ t(Be, { icon: yt }), title: `${F.downloads + v}`, children: Jt(F.downloads + v) })
1023
881
  ] });
1024
882
  }
1025
- function C(c, k) {
1026
- return /* @__PURE__ */ t(lt, { href: c || `/blocklets/${k}`, align: "left", width: 100, children: /* @__PURE__ */ t(
883
+ function C(u) {
884
+ return /* @__PURE__ */ t(
1027
885
  J,
1028
886
  {
1029
887
  variant: "outlined",
1030
888
  size: "small",
1031
- fullWidth: !0,
889
+ onClick: () => r.handleSearchSelect(u),
1032
890
  sx: {
891
+ width: "fit-content",
892
+ textTransform: "none",
1033
893
  bgcolor: "white",
894
+ borderRadius: "8px",
1034
895
  borderColor: "divider",
1035
896
  "&:hover": { borderColor: "divider" }
1036
897
  },
1037
898
  children: e("explore.viewDetail")
1038
899
  }
1039
- ) });
900
+ );
1040
901
  }
1041
902
  }
1042
- const or = (e) => Number.isNaN(e) ? 0 : e < 1e3 ? e : e < 1e6 ? `${(e / 1e3).toFixed(1)}k` : e < 1e9 ? `${(e / 1e6).toFixed(1)}m` : `${(e / 1e9).toFixed(1)}b`, nr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
1043
- function lr({ title: e, blocklets: r }) {
1044
- const { blockletRender: o, serverVersion: l } = S();
1045
- return /* @__PURE__ */ f(v, { mt: 3, children: [
1046
- /* @__PURE__ */ t(L, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
1047
- /* @__PURE__ */ t(se, { container: !0, spacing: 2, children: r.map((n) => /* @__PURE__ */ t(se, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": n.did, children: /* @__PURE__ */ t(v, { padding: "1px", children: o({ blocklet: n, blocklets: r, serverVersion: l }) }) }, n.did)) })
903
+ const Jt = (e) => Number.isNaN(e) ? 0 : e < 1e3 ? e : e < 1e6 ? `${(e / 1e3).toFixed(1)}k` : e < 1e9 ? `${(e / 1e6).toFixed(1)}m` : `${(e / 1e9).toFixed(1)}b`, er = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
904
+ function tr({ title: e, blocklets: r }) {
905
+ const { blockletRender: o, serverVersion: n } = I();
906
+ return /* @__PURE__ */ f(w, { mt: 3, children: [
907
+ /* @__PURE__ */ t(x, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
908
+ /* @__PURE__ */ t(we, { container: !0, spacing: 2, children: r.map((i) => /* @__PURE__ */ t(we, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": i.did, children: /* @__PURE__ */ t(w, { padding: "1px", children: o({ blocklet: i, blocklets: r, serverVersion: n }) }) }, i.did)) })
1048
909
  ] });
1049
910
  }
1050
- function ir() {
1051
- const { get: e } = De(), { t: r } = S(), {
911
+ function rr() {
912
+ const { get: e } = ge(), { t: r } = I(), {
1052
913
  data: o = [],
1053
- error: l,
1054
- loading: n
1055
- } = U(async () => {
1056
- const a = await e(I.explorePath);
1057
- return Array.isArray(a) ? a : [];
914
+ error: n,
915
+ loading: i
916
+ } = Z(async () => {
917
+ const s = await e(P.explorePath);
918
+ return Array.isArray(s) ? s : [];
1058
919
  });
1059
- return l ? /* @__PURE__ */ t(ee, { error: new Error(`Failed to fetch blocklets from ${I.explorePath}`) }) : n ? /* @__PURE__ */ t(Me, { mt: 15 }) : /* @__PURE__ */ f(M, { children: [
1060
- /* @__PURE__ */ t(rr, {}),
920
+ return n ? /* @__PURE__ */ t(ue, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : i ? /* @__PURE__ */ t(qe, { mt: 15 }) : /* @__PURE__ */ f(N, { children: [
921
+ /* @__PURE__ */ t(Zt, {}),
1061
922
  o.map(
1062
- (a) => a.blocklets.length > 0 ? /* @__PURE__ */ t(lr, { title: r(`explore.${a.type}`), blocklets: a.blocklets }, a.type) : null
923
+ (s) => s.blocklets.length > 0 ? /* @__PURE__ */ t(tr, { title: r(`explore.${s.type}`), blocklets: s.blocklets }, s.type) : null
924
+ )
925
+ ] });
926
+ }
927
+ const ne = "__FREE_TEXT__", Ce = "__NO_RESULT__", le = 40;
928
+ function or({
929
+ endpoint: e,
930
+ t: r,
931
+ locale: o,
932
+ filters: n,
933
+ handleKeyword: i,
934
+ handleSearchSelect: s,
935
+ ...c
936
+ }) {
937
+ const l = ce(null), p = ce(!1), [d, g] = L(!1), [h, m] = L(""), [k, C] = L(!1), S = ge(), [B, u] = L(!1), v = async (a) => {
938
+ u(!0);
939
+ const b = await S.get(ye(e, pe(P.blockletsPath, a)));
940
+ return u(!1), b.dataList || [];
941
+ }, { data: y, run: A } = Z(
942
+ (a) => a ? v({
943
+ sortBy: P.nameDesc,
944
+ page: 1,
945
+ pageSize: 10,
946
+ keyword: a
947
+ }) : Promise.resolve([]),
948
+ {
949
+ manual: !0
950
+ }
951
+ );
952
+ j(() => {
953
+ u(!0), A(n.keyword), m(n.keyword || "");
954
+ }, [n.keyword, A]), Tt(
955
+ "ctrl + k, command + k",
956
+ (a) => {
957
+ var b, E;
958
+ return a.stopPropagation(), a.preventDefault(), (E = (b = l.current) == null ? void 0 : b.querySelector("input")) == null || E.focus(), !1;
959
+ },
960
+ { enableOnTags: ["INPUT"] }
961
+ );
962
+ const F = Ae((a) => A(a), { wait: 300 }), O = { name: ne, title: h, did: "" };
963
+ let _ = [];
964
+ return h && (B ? _ = [O] : y != null && y.length ? _ = [O, ...y] : _ = [{ name: Ce, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ f(N, { children: [
965
+ /* @__PURE__ */ f(Rt, { fullScreen: !0, open: k, sx: { display: { md: "none" } }, children: [
966
+ /* @__PURE__ */ f(w, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
967
+ /* @__PURE__ */ t(
968
+ Ee,
969
+ {
970
+ fullWidth: !0,
971
+ sx: {
972
+ bgcolor: "#F9FAFB",
973
+ px: 1,
974
+ py: 0.5,
975
+ ".MuiInputBase-input": { p: 1 },
976
+ ".MuiOutlinedInput-notchedOutline": {
977
+ borderRadius: "8px",
978
+ borderColor: "transparent"
979
+ },
980
+ "&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline": {
981
+ borderColor: "divider",
982
+ borderWidth: "1px"
983
+ }
984
+ },
985
+ autoFocus: !0,
986
+ placeholder: r("common.searchStore"),
987
+ className: "bl-autocomplete-input",
988
+ value: h,
989
+ onChange: (a) => U(a.target.value),
990
+ startAdornment: D(k),
991
+ endAdornment: H()
992
+ }
993
+ ),
994
+ /* @__PURE__ */ t(
995
+ J,
996
+ {
997
+ variant: "outlined",
998
+ onClick: () => {
999
+ C(!1), m(n.keyword || "");
1000
+ },
1001
+ children: r("common.cancel")
1002
+ }
1003
+ )
1004
+ ] }),
1005
+ /* @__PURE__ */ t(ze, { sx: { p: 0.5 }, children: _.map((a) => G(a)) })
1006
+ ] }),
1007
+ /* @__PURE__ */ t(
1008
+ Y,
1009
+ {
1010
+ sx: { display: { sx: "block", md: "none" }, fontSize: 28, color: "text.lighter" },
1011
+ onClick: () => C(!0)
1012
+ }
1013
+ ),
1014
+ /* @__PURE__ */ t(
1015
+ Bt,
1016
+ {
1017
+ ref: l,
1018
+ open: !!h && d,
1019
+ size: "small",
1020
+ onOpen: () => g(!0),
1021
+ onClose: (a, b) => {
1022
+ g(!1), b === "selectOption" && !p.current && i(h);
1023
+ },
1024
+ disableClearable: !0,
1025
+ inputValue: h,
1026
+ onInputChange: (a, b) => U(b),
1027
+ isOptionEqualToValue: (a, b) => a.name === b.name,
1028
+ getOptionLabel: (a) => a.title,
1029
+ getOptionKey: (a) => a.name,
1030
+ noOptionsText: r("blocklet.noResults"),
1031
+ autoHighlight: !0,
1032
+ forcePopupIcon: !1,
1033
+ slotProps: {
1034
+ paper: {
1035
+ sx: {
1036
+ mt: 0.5,
1037
+ minWidth: "100%",
1038
+ width: "fit-content",
1039
+ "& > ul": { p: 0.5 }
1040
+ }
1041
+ }
1042
+ },
1043
+ renderInput: (a) => /* @__PURE__ */ t(
1044
+ Pt,
1045
+ {
1046
+ ...a,
1047
+ InputProps: {
1048
+ ...a.InputProps,
1049
+ autoFocus: !0,
1050
+ placeholder: r("common.searchStore"),
1051
+ className: "bl-autocomplete-input",
1052
+ value: h,
1053
+ startAdornment: D(d),
1054
+ endAdornment: H()
1055
+ }
1056
+ }
1057
+ ),
1058
+ filterOptions: (a) => a,
1059
+ ...c,
1060
+ options: _,
1061
+ renderOption: (a, b) => G(b),
1062
+ value: O,
1063
+ sx: [
1064
+ {
1065
+ bgcolor: "#F9FAFB",
1066
+ borderRadius: "8px",
1067
+ overflow: "hidden",
1068
+ ".MuiOutlinedInput-notchedOutline": {
1069
+ borderRadius: "8px",
1070
+ borderColor: "transparent"
1071
+ },
1072
+ "&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline": {
1073
+ borderColor: "divider",
1074
+ borderWidth: "1px"
1075
+ }
1076
+ },
1077
+ ...Array.isArray(c.sx) ? c.sx : [c.sx]
1078
+ ]
1079
+ }
1063
1080
  )
1064
1081
  ] });
1082
+ function U(a) {
1083
+ u(!0), m(a), p.current = !1, F.run(a);
1084
+ }
1085
+ function V() {
1086
+ C(!1), m(""), U(""), i("");
1087
+ }
1088
+ function te(a) {
1089
+ a != null && a.did ? (C(!1), p.current = !0, m(""), s(a)) : a.name === ne && (C(!1), i(h));
1090
+ }
1091
+ function G(a) {
1092
+ var b, E;
1093
+ return /* @__PURE__ */ f(
1094
+ Oe,
1095
+ {
1096
+ sx: { display: "flex", alignItems: "center", gap: 1, p: 1.5, borderRadius: "8px" },
1097
+ onClick: () => te(a),
1098
+ children: [
1099
+ K(a),
1100
+ /* @__PURE__ */ f(x, { variant: "body1", children: [
1101
+ /* @__PURE__ */ f(x, { fontWeight: "fontWeightMedium", display: "flex", alignItems: "center", gap: 1, children: [
1102
+ a.title,
1103
+ " ",
1104
+ /* @__PURE__ */ t(It, { sx: { color: "#D97706", fontSize: 16, display: "none" } })
1105
+ ] }),
1106
+ /* @__PURE__ */ t(x, { sx: { color: "text.lighter" }, fontSize: "13px", children: ((E = (b = a.category) == null ? void 0 : b.locales) == null ? void 0 : E[o || "en"]) || "" })
1107
+ ] })
1108
+ ]
1109
+ },
1110
+ a.did
1111
+ );
1112
+ }
1113
+ function K(a) {
1114
+ if ([ne, Ce].includes(a.name))
1115
+ return /* @__PURE__ */ t(
1116
+ w,
1117
+ {
1118
+ width: le,
1119
+ p: "6px",
1120
+ display: "flex",
1121
+ justifyContent: "center",
1122
+ alignItems: "center",
1123
+ color: "text.lighter",
1124
+ bgcolor: "#F1F3F5",
1125
+ borderRadius: "8px",
1126
+ children: /* @__PURE__ */ t(Y, { sx: { fontSize: 28 } })
1127
+ }
1128
+ );
1129
+ let b = "";
1130
+ return a.logo && (b = ye(e, "assets", a.did, De(a.logo, le, a.version))), /* @__PURE__ */ t(_e, { src: b, size: le, style: { borderRadius: "8px", overflow: "hidden" } });
1131
+ }
1132
+ function D(a = !0) {
1133
+ return /* @__PURE__ */ t(w, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: a && h && B ? /* @__PURE__ */ t(ee, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(Y, { sx: { fontSize: 16, cursor: "default" } }) });
1134
+ }
1135
+ function H() {
1136
+ return h ? /* @__PURE__ */ t(w, { sx: { display: "flex", alignItems: "center", color: "text.lighter" }, children: /* @__PURE__ */ t(he, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => V() }) }) : null;
1137
+ }
1138
+ }
1139
+ function nr({ placeholder: e = "Type to search...", ...r }) {
1140
+ const { search: o } = I(), { filters: n, handleKeyword: i } = o, [s, c] = L(n.keyword || ""), l = Ae(i, { wait: 300 }), p = (g) => {
1141
+ const { value: h } = g.target;
1142
+ c(h), l.run(h);
1143
+ }, d = () => {
1144
+ c(""), i("");
1145
+ };
1146
+ return j(() => {
1147
+ c(n.keyword || "");
1148
+ }, [n.keyword]), /* @__PURE__ */ t(
1149
+ lr,
1150
+ {
1151
+ inputProps: {
1152
+ "data-cy": "search-blocklet"
1153
+ },
1154
+ startAdornment: /* @__PURE__ */ t(be, { position: "start", children: /* @__PURE__ */ t(ir, {}) }),
1155
+ onChange: p,
1156
+ placeholder: e,
1157
+ value: s,
1158
+ title: e,
1159
+ "data-cy": "search",
1160
+ endAdornment: s && /* @__PURE__ */ t(be, { position: "end", children: /* @__PURE__ */ t(sr, { "data-cy": "search-delete", onClick: d }) }),
1161
+ ...r
1162
+ }
1163
+ );
1065
1164
  }
1165
+ const lr = q(Ee)`
1166
+ background-color: ${(e) => e.theme.palette.grey[50]};
1167
+ font-size: 14px;
1168
+ border-radius: 6px;
1169
+ width: 100%;
1170
+ .MuiInputBase-input {
1171
+ padding: 8px 0 8px 10px;
1172
+ }
1173
+ .MuiOutlinedInput-notchedOutline {
1174
+ border: none;
1175
+ }
1176
+ .Mui-focused {
1177
+ background-color: #f6f6f6;
1178
+ .MuiInputBase-input::placeholder {
1179
+ color: transparent;
1180
+ }
1181
+ }
1182
+ `, ir = q(Y)`
1183
+ color: ${(e) => e.theme.palette.grey[500]};
1184
+ font-size: 28px;
1185
+ @media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
1186
+ font-size: 24px;
1187
+ }
1188
+ `, sr = q(he)`
1189
+ color: ${(e) => e.theme.palette.grey[500]};
1190
+ font-size: 16px;
1191
+ cursor: pointer;
1192
+ `;
1066
1193
  function ar() {
1067
- var g;
1068
- const { filters: e, handleSort: r, handlePrice: o, t: l, getCategoryLocale: n, developerName: a, handleDeveloper: d } = S(), u = Le(l), i = ((g = u.find((h) => h.value === e.sortBy)) == null ? void 0 : g.name) || l("sort.sort");
1194
+ const { search: e, t: r, endpoint: o, locale: n, getCategoryLocale: i, developerName: s, showResourcesSwitch: c, layout: l, baseSearch: p } = I(), { filters: d, handleSort: g, handlePrice: h, handleDeveloper: m, handleSwitchShowResources: k } = e, C = Ne(r);
1069
1195
  return /* @__PURE__ */ f(
1070
- z,
1196
+ T,
1071
1197
  {
1198
+ className: "filter-bar",
1072
1199
  direction: { xs: "column", md: "row" },
1073
1200
  alignItems: { xs: "flex-start", md: "center" },
1074
1201
  justifyContent: "space-between",
1202
+ gap: 2,
1075
1203
  spacing: { xs: 1, md: 0 },
1076
1204
  pt: { xs: 2, md: 0 },
1077
1205
  px: 0,
1078
1206
  pb: 3,
1079
1207
  children: [
1080
- /* @__PURE__ */ t(L, { variant: "h2", textTransform: "capitalize", children: n(e.category) }),
1208
+ /* @__PURE__ */ t(x, { variant: "h2", textTransform: "capitalize", children: i(d.category) }),
1081
1209
  /* @__PURE__ */ f(
1082
- z,
1210
+ T,
1083
1211
  {
1212
+ flex: 1,
1084
1213
  direction: "row",
1085
1214
  alignItems: "center",
1086
- width: { xs: "100%", md: "auto" },
1087
- justifyContent: "space-between",
1215
+ width: "100%",
1216
+ justifyContent: { xs: "space-between", md: "flex-end" },
1088
1217
  gap: 2,
1089
1218
  children: [
1090
- e.owner && a && /* @__PURE__ */ t(it, { label: a, size: "small", onDelete: () => d("") }),
1219
+ l.showSearch ? /* @__PURE__ */ t(w, { flex: 1, children: p ? /* @__PURE__ */ t(nr, {}) : /* @__PURE__ */ t(
1220
+ or,
1221
+ {
1222
+ locale: n,
1223
+ endpoint: o,
1224
+ sx: {
1225
+ display: { md: "block", xs: "none" },
1226
+ flex: 1,
1227
+ mr: 1,
1228
+ width: "350px"
1229
+ },
1230
+ t: r,
1231
+ filters: e.filters,
1232
+ handleKeyword: e.handleKeyword,
1233
+ handleSearchSelect: e.handleSearchSelect
1234
+ }
1235
+ ) }) : null,
1236
+ d.owner && s && /* @__PURE__ */ t(St, { label: s, size: "small", onDelete: () => m("") }),
1237
+ c ? /* @__PURE__ */ t(
1238
+ Se,
1239
+ {
1240
+ checked: d.showResources === "true",
1241
+ onChange: (S) => k(S ? "true" : ""),
1242
+ label: r("common.showResources")
1243
+ }
1244
+ ) : null,
1091
1245
  /* @__PURE__ */ t(
1092
- ye,
1246
+ Se,
1093
1247
  {
1094
- sx: { m: 0 },
1095
- control: /* @__PURE__ */ t(
1096
- xe,
1097
- {
1098
- checked: e.price === "free",
1099
- size: "small",
1100
- sx: { p: 0, pr: 1, "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
1101
- onChange: (h) => o(h.target.checked ? "free" : "")
1102
- }
1103
- ),
1104
- label: l("blocklet.free")
1248
+ checked: d.price === "free",
1249
+ onChange: (S) => h(S ? "free" : ""),
1250
+ label: r("blocklet.free")
1105
1251
  }
1106
1252
  ),
1107
1253
  /* @__PURE__ */ t(
1108
- V,
1254
+ Ve,
1109
1255
  {
1110
- value: e.sortBy,
1111
- options: u,
1112
- title: i,
1113
- onChange: r,
1114
- icon: null,
1115
- prepend: null,
1116
- itemRender: null
1256
+ value: d.sortBy || C[0].value,
1257
+ options: C,
1258
+ placeholder: r("sort.sort"),
1259
+ onChange: (S) => g(S)
1117
1260
  }
1118
1261
  )
1119
1262
  ]
@@ -1123,179 +1266,209 @@ function ar() {
1123
1266
  }
1124
1267
  );
1125
1268
  }
1126
- function me() {
1127
- const { t: e } = S();
1128
- return /* @__PURE__ */ t(Re, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
1269
+ function Se({
1270
+ checked: e,
1271
+ onChange: r,
1272
+ label: o
1273
+ }) {
1274
+ return /* @__PURE__ */ t(
1275
+ Le,
1276
+ {
1277
+ sx: { m: 0 },
1278
+ control: /* @__PURE__ */ t(
1279
+ Fe,
1280
+ {
1281
+ checked: e,
1282
+ size: "small",
1283
+ sx: { p: 0, pr: 1, "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
1284
+ onChange: (n) => r(n.target.checked)
1285
+ }
1286
+ ),
1287
+ label: o
1288
+ }
1289
+ );
1129
1290
  }
1130
- function $({ filterTip: e, keywordTip: r }) {
1131
- const { t: o, locale: l } = S(), n = () => l === "zh" ? "" : " , ";
1132
- return /* @__PURE__ */ f(Te, { className: "tips", children: [
1133
- /* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
1134
- e && /* @__PURE__ */ t("span", { children: o("blocklet.filterTip") }),
1135
- e && r && n(),
1136
- r && /* @__PURE__ */ t("span", { children: o("blocklet.keywordTip") })
1291
+ function Q({ children: e }) {
1292
+ return /* @__PURE__ */ f(w, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.lighter", children: [
1293
+ /* @__PURE__ */ t(At, {}),
1294
+ e
1137
1295
  ] });
1138
1296
  }
1139
- $.propTypes = {
1140
- filterTip: w.bool,
1141
- keywordTip: w.bool
1142
- };
1143
- $.defaultProps = {
1144
- filterTip: !1,
1145
- keywordTip: !1
1146
- };
1147
- function q({ primaryStart: e, primaryEnd: r, filter: o }) {
1148
- return /* @__PURE__ */ f(Re, { variant: "subtitle2", children: [
1149
- /* @__PURE__ */ t("span", { children: e }),
1150
- /* @__PURE__ */ f("span", { className: "primary", children: [
1151
- " ",
1152
- o,
1153
- " "
1154
- ] }),
1155
- /* @__PURE__ */ f("span", { children: [
1297
+ function Ie() {
1298
+ const { t: e } = I();
1299
+ return /* @__PURE__ */ t(x, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
1300
+ }
1301
+ function ie({ filterTip: e, keywordTip: r }) {
1302
+ const { t: o, locale: n } = I(), i = () => n === "zh" ? "、" : " , ";
1303
+ return /* @__PURE__ */ f(w, { mt: 1, display: "flex", children: [
1304
+ /* @__PURE__ */ t(x, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
1305
+ e && /* @__PURE__ */ t(x, { children: o("blocklet.filterTip") }),
1306
+ e && r && i(),
1307
+ r && /* @__PURE__ */ t(x, { children: o("blocklet.keywordTip") })
1308
+ ] });
1309
+ }
1310
+ function se({
1311
+ primaryStart: e,
1312
+ primaryEnd: r,
1313
+ filter: o
1314
+ }) {
1315
+ return /* @__PURE__ */ f(x, { variant: "subtitle2", display: "flex", gap: 0.5, mx: 0.5, children: [
1316
+ /* @__PURE__ */ t(x, { children: e }),
1317
+ /* @__PURE__ */ t(x, { color: "primary", children: o }),
1318
+ /* @__PURE__ */ f(x, { children: [
1156
1319
  r,
1157
1320
  " "
1158
1321
  ] })
1159
1322
  ] });
1160
1323
  }
1161
- q.propTypes = {
1162
- primaryStart: w.string.isRequired,
1163
- primaryEnd: w.string.isRequired,
1164
- filter: w.string.isRequired
1165
- };
1166
- const sr = (e, r, o, l) => gt(
1167
- async (n) => {
1168
- n || (o.currentPage = o.defaultCurrentPage);
1169
- const { currentPage: a, pageSize: d } = o, u = {
1324
+ function cr() {
1325
+ const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = I(), { filters: i } = r, s = !!n || !!i.price;
1326
+ if (i.keyword && s)
1327
+ return /* @__PURE__ */ f(Q, { children: [
1328
+ /* @__PURE__ */ t(
1329
+ se,
1330
+ {
1331
+ primaryStart: e("blocklet.noBlockletPart1"),
1332
+ primaryEnd: e("blocklet.noBlockletPart2"),
1333
+ filter: i.keyword
1334
+ }
1335
+ ),
1336
+ /* @__PURE__ */ t(ie, { keywordTip: !0, filterTip: !0 })
1337
+ ] });
1338
+ if (i.keyword)
1339
+ return /* @__PURE__ */ f(Q, { children: [
1340
+ /* @__PURE__ */ t(
1341
+ se,
1342
+ {
1343
+ primaryStart: e("blocklet.noBlockletPart1"),
1344
+ primaryEnd: e("blocklet.noBlockletPart2"),
1345
+ filter: i.keyword
1346
+ }
1347
+ ),
1348
+ /* @__PURE__ */ t(ie, { keywordTip: !0 })
1349
+ ] });
1350
+ if (s) {
1351
+ const c = o(n);
1352
+ return /* @__PURE__ */ f(Q, { children: [
1353
+ c ? /* @__PURE__ */ t(
1354
+ se,
1355
+ {
1356
+ primaryStart: e("blocklet.noCategoryResults1"),
1357
+ primaryEnd: e("blocklet.noCategoryResults2"),
1358
+ filter: c
1359
+ }
1360
+ ) : /* @__PURE__ */ t(Ie, {}),
1361
+ /* @__PURE__ */ t(ie, { filterTip: !0 })
1362
+ ] });
1363
+ }
1364
+ return /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Ie, {}) });
1365
+ }
1366
+ const dr = (e, r, o, n) => tt(
1367
+ async (i) => {
1368
+ i || (o.currentPage = o.defaultCurrentPage);
1369
+ const { currentPage: s, pageSize: c } = o, l = {
1170
1370
  ...r,
1171
1371
  category: r.category === "All" ? "" : r.category,
1172
- sortBy: I[r.sortBy],
1173
- page: a,
1174
- pageSize: d
1372
+ sortBy: P[r.sortBy],
1373
+ page: s,
1374
+ pageSize: c
1175
1375
  };
1176
- l(null);
1177
- const { data: i = {} } = await e.get(I.blockletsPath, { params: u });
1178
- return o.currentPage++, { page: a, pageSize: d, list: (i == null ? void 0 : i.dataList) || [], total: (i == null ? void 0 : i.total) || 0 };
1376
+ n(null);
1377
+ const { data: p = {} } = await e.get(P.blockletsPath, { params: l });
1378
+ return o.currentPage++, { page: s, pageSize: c, list: (p == null ? void 0 : p.dataList) || [], total: (p == null ? void 0 : p.total) || 0 };
1179
1379
  },
1180
1380
  {
1181
- isNoMore: (n) => n ? n.page * n.pageSize >= n.total : !1,
1381
+ isNoMore: (i) => i ? i.page * i.pageSize >= i.total : !1,
1182
1382
  reloadDeps: [e, Ft(r)],
1183
- onError: l
1383
+ onError: n
1184
1384
  }
1185
1385
  );
1186
- function cr() {
1386
+ function ur() {
1187
1387
  var h;
1188
- const { storeApi: e, filters: r, extraFilter: o, errors: l, updateDeveloperName: n } = S(), a = yt({
1189
- currentPage: I.currentPage,
1190
- pageSize: Wt() ? I.mobilePageSize : I.pageSize,
1191
- defaultCurrentPage: I.defaultCurrentPage
1192
- }), [d, u] = F(null), i = sr(e, r, a, u), g = D(
1388
+ const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: i } = I(), { filters: s } = r, c = rt({
1389
+ currentPage: P.currentPage,
1390
+ pageSize: Wt() ? P.mobilePageSize : P.pageSize,
1391
+ defaultCurrentPage: P.defaultCurrentPage
1392
+ }), [l, p] = L(null), d = dr(e, s, c, p), g = $(
1193
1393
  () => {
1194
- var m, C;
1195
- return o ? o(((m = i.data) == null ? void 0 : m.list) || []) : ((C = i.data) == null ? void 0 : C.list) || [];
1394
+ var m, k;
1395
+ return o ? o(((m = d.data) == null ? void 0 : m.list) || []) : ((k = d.data) == null ? void 0 : k.list) || [];
1196
1396
  },
1197
- [i.data, o]
1397
+ [d.data, o]
1198
1398
  );
1199
- return N(() => {
1200
- const m = g.find((C) => C.owner.did === r.owner);
1201
- n((m == null ? void 0 : m.owner.fullName) || (m == null ? void 0 : m.author.name) || "");
1202
- }, [r.owner, g, n]), {
1399
+ return j(() => {
1400
+ const m = g.find((k) => k.owner.did === s.owner);
1401
+ i((m == null ? void 0 : m.owner.fullName) || (m == null ? void 0 : m.author.name) || "");
1402
+ }, [s.owner, g, i]), {
1203
1403
  blocklets: g,
1204
- fetchBlockletsError: d,
1205
- loadMore: i.loadMore,
1206
- hasNextPage: !i.noMore,
1207
- total: (h = i.data) == null ? void 0 : h.total,
1404
+ fetchBlockletsError: l,
1405
+ loadMore: d.loadMore,
1406
+ hasNextPage: !d.noMore,
1407
+ total: (h = d.data) == null ? void 0 : h.total,
1208
1408
  loadings: {
1209
- fetchBlockletsLoading: i.loading,
1210
- loadingMore: i.loadingMore
1409
+ fetchBlockletsLoading: d.loading,
1410
+ loadingMore: d.loadingMore
1211
1411
  },
1212
1412
  errors: {
1213
- ...l,
1214
- fetchBlockletsError: d
1413
+ ...n,
1414
+ fetchBlockletsError: l
1215
1415
  }
1216
1416
  };
1217
1417
  }
1218
- function dr() {
1219
- const { t: e, filters: r, endpoint: o, blockletRender: l, serverVersion: n, minItemWidth: a, selectedCategory: d, getCategoryLocale: u } = S(), { blocklets: i, errors: g, loadMore: h, loadings: m, hasNextPage: C, total: R } = cr(), A = !!d || !!r.price, [c] = _t({
1418
+ function hr() {
1419
+ const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: i, minItemWidth: s, layout: c, baseSearch: l } = I(), { filters: p } = r, { blocklets: d, errors: g, loadMore: h, loadings: m, hasNextPage: k, total: C } = ur(), [S] = Ct({
1220
1420
  loading: m.fetchBlockletsLoading || m.loadingMore,
1221
- hasNextPage: C,
1421
+ hasNextPage: k,
1222
1422
  onLoadMore: h
1223
1423
  });
1224
1424
  if (g.fetchBlockletsError) {
1225
- const x = new Error(`Failed to fetch blocklets from ${o}: ${g.fetchBlockletsError.message}`);
1226
- return /* @__PURE__ */ t(ee, { error: x });
1425
+ const y = new Error(`Failed to fetch blocklets from ${o}: ${g.fetchBlockletsError.message}`);
1426
+ return /* @__PURE__ */ t(ue, { error: y });
1227
1427
  }
1228
- if (m.fetchBlockletsLoading)
1229
- return /* @__PURE__ */ t(Me, { mt: 15 });
1230
- if (r.keyword && A && i.length === 0)
1231
- return /* @__PURE__ */ f(j, { children: [
1232
- /* @__PURE__ */ t(
1233
- q,
1234
- {
1235
- primaryStart: e("blocklet.noBlockletPart1"),
1236
- primaryEnd: e("blocklet.noBlockletPart2"),
1237
- filter: r.keyword
1238
- }
1239
- ),
1240
- /* @__PURE__ */ t($, { keywordTip: !0, filterTip: !0 })
1241
- ] });
1242
- if (r.keyword && i.length === 0)
1243
- return /* @__PURE__ */ f(j, { children: [
1244
- /* @__PURE__ */ t(
1245
- q,
1246
- {
1247
- primaryStart: e("blocklet.noBlockletPart1"),
1248
- primaryEnd: e("blocklet.noBlockletPart2"),
1249
- filter: r.keyword
1250
- }
1251
- ),
1252
- /* @__PURE__ */ t($, { keywordTip: !0 })
1253
- ] });
1254
- if (A && i.length === 0) {
1255
- const x = u(d);
1256
- return /* @__PURE__ */ f(j, { children: [
1257
- x ? /* @__PURE__ */ t(
1258
- q,
1259
- {
1260
- primaryStart: e("blocklet.noCategoryResults1"),
1261
- primaryEnd: e("blocklet.noCategoryResults2"),
1262
- filter: x
1263
- }
1264
- ) : /* @__PURE__ */ t(me, {}),
1265
- /* @__PURE__ */ t($, { filterTip: !0 })
1266
- ] });
1267
- }
1268
- if (i.length === 0)
1269
- return /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(me, {}) });
1270
- return /* @__PURE__ */ f(M, { children: [
1271
- r.keyword ? /* @__PURE__ */ f(M, { children: [
1272
- /* @__PURE__ */ t(oe, { xs: /* @__PURE__ */ t(Oe, {}), md: null }),
1273
- k()
1274
- ] }) : /* @__PURE__ */ t(ar, {}),
1275
- /* @__PURE__ */ t(v, { display: "grid", gridTemplateColumns: `repeat(auto-fill, minmax(${a}px, 1fr))`, p: "2px", gap: 2, children: i.map((x) => /* @__PURE__ */ t(v, { "data-blocklet-did": x.did, sx: { minWidth: a }, children: l({ blocklet: x, blocklets: i, serverVersion: n }) }, x.did)) }),
1276
- C && /* @__PURE__ */ t(v, { height: 60, display: "flex", justifyContent: "center", py: 2, ref: c, children: /* @__PURE__ */ t(Z, {}) })
1428
+ const B = l && c.showSearch || !p.keyword;
1429
+ return /* @__PURE__ */ f(N, { children: [
1430
+ B ? /* @__PURE__ */ t(ar, {}) : /* @__PURE__ */ f(N, { children: [
1431
+ /* @__PURE__ */ t(fe, { xs: /* @__PURE__ */ t(He, {}), md: null }),
1432
+ v()
1433
+ ] }),
1434
+ u(),
1435
+ !m.fetchBlockletsLoading && k && /* @__PURE__ */ t(w, { height: 60, display: "flex", justifyContent: "center", py: 2, ref: S, children: /* @__PURE__ */ t(ee, {}) })
1277
1436
  ] });
1278
- function k() {
1279
- return /* @__PURE__ */ f(z, { direction: "row", alignItems: "center", justifyContent: "space-between", mb: 2, mt: { xs: 2, md: 0 }, children: [
1280
- /* @__PURE__ */ t(L, { variant: "h3", children: e("blocklet.search", { keyword: r.keyword }) }),
1281
- /* @__PURE__ */ t(L, { variant: "body1", color: "text.lighter", fontSize: 13, children: e("blocklet.resultCount", { count: R }) })
1282
- ] });
1283
- }
1284
- }
1285
- const j = E(zt)`
1286
- text-align: center;
1287
- margin-top: 100px;
1288
- .primary {
1289
- color: ${(e) => e.theme.palette.primary.main};
1437
+ function u() {
1438
+ return m.fetchBlockletsLoading ? /* @__PURE__ */ t(qe, { mt: 15 }) : d.length ? /* @__PURE__ */ t(
1439
+ w,
1440
+ {
1441
+ className: "blocklet-list",
1442
+ display: "grid",
1443
+ gridTemplateColumns: `repeat(auto-fill, minmax(${s}px, 1fr))`,
1444
+ p: "2px",
1445
+ gap: 2,
1446
+ children: d.map((y) => /* @__PURE__ */ t(w, { "data-blocklet-did": y.did, sx: { minWidth: s }, children: n({ blocklet: y, blocklets: d, serverVersion: i }) }, y.did))
1447
+ }
1448
+ ) : /* @__PURE__ */ t(cr, {});
1290
1449
  }
1291
- .tips {
1292
- margin-top: ${(e) => e.theme.spacing(1)};
1450
+ function v() {
1451
+ return /* @__PURE__ */ f(
1452
+ T,
1453
+ {
1454
+ direction: "row",
1455
+ className: "search-result-title",
1456
+ alignItems: "center",
1457
+ justifyContent: "space-between",
1458
+ mb: 2,
1459
+ mt: { xs: 2, md: 0 },
1460
+ children: [
1461
+ /* @__PURE__ */ t(x, { variant: "h3", children: e("blocklet.search", { keyword: p.keyword }) }),
1462
+ /* @__PURE__ */ t(x, { variant: "body1", color: "text.lighter", fontSize: 13, children: e("blocklet.resultCount", { count: C }) })
1463
+ ]
1464
+ }
1465
+ );
1293
1466
  }
1294
- `;
1295
- function ur() {
1296
- const { t: e } = S(), { toggleOpen: r } = te();
1467
+ }
1468
+ function pr() {
1469
+ const { t: e, selectedCategory: r, getCategoryLocale: o } = I(), { toggleOpen: n } = me();
1297
1470
  return /* @__PURE__ */ f(
1298
- L,
1471
+ x,
1299
1472
  {
1300
1473
  variant: "body1",
1301
1474
  display: { xs: "flex", md: "none" },
@@ -1304,25 +1477,25 @@ function ur() {
1304
1477
  py: 2,
1305
1478
  fontWeight: "fontWeightMedium",
1306
1479
  children: [
1307
- /* @__PURE__ */ t(Ee, { onClick: () => r(!0), children: /* @__PURE__ */ t(Et, {}) }),
1308
- e("common.category")
1480
+ /* @__PURE__ */ t(Ue, { onClick: () => n(!0), children: /* @__PURE__ */ t(Lt, {}) }),
1481
+ o(r) || e("common.category")
1309
1482
  ]
1310
1483
  }
1311
1484
  );
1312
1485
  }
1313
- function pr() {
1314
- const { blockletList: e, filters: r } = S(), o = r.category || r.keyword || r.price;
1315
- return /* @__PURE__ */ t(Ot, { children: /* @__PURE__ */ f(dt, { FallbackComponent: ee, children: [
1316
- /* @__PURE__ */ t(ur, {}),
1317
- /* @__PURE__ */ f(v, { display: "flex", height: "100%", className: "list-container", pt: { xs: 0, md: 5 }, children: [
1318
- /* @__PURE__ */ t(tr, {}),
1319
- /* @__PURE__ */ t(z, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: o ? /* @__PURE__ */ t(dr, { blocklets: e }) : /* @__PURE__ */ t(ir, {}) })
1486
+ function mr() {
1487
+ const { search: e, layout: r } = I(), { filters: o } = e, n = o.category || o.keyword || o.price;
1488
+ return /* @__PURE__ */ t(Ot, { children: /* @__PURE__ */ f(Qe, { FallbackComponent: ue, children: [
1489
+ /* @__PURE__ */ t(pr, {}),
1490
+ /* @__PURE__ */ f(w, { display: "flex", height: "100%", className: "list-container", pt: { xs: 0, md: 5 }, children: [
1491
+ /* @__PURE__ */ t(Qt, {}),
1492
+ /* @__PURE__ */ t(T, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: r.showExplore && !n ? /* @__PURE__ */ t(rr, {}) : /* @__PURE__ */ t(hr, {}) })
1320
1493
  ] })
1321
1494
  ] }) });
1322
1495
  }
1323
- function Jr(e) {
1324
- const r = fe(), o = at(
1325
- ct({
1496
+ function So(e) {
1497
+ const r = de(), o = Ge(
1498
+ Xe({
1326
1499
  ...r,
1327
1500
  typography: {
1328
1501
  h1: {
@@ -1350,8 +1523,11 @@ function Jr(e) {
1350
1523
  }
1351
1524
  })
1352
1525
  );
1353
- return /* @__PURE__ */ t(st, { theme: o, children: /* @__PURE__ */ t(Ht, { ...e, children: /* @__PURE__ */ t(pr, {}) }) });
1526
+ return /* @__PURE__ */ t(Ke, { theme: o, children: /* @__PURE__ */ t(Ht, { ...e, children: /* @__PURE__ */ t(mr, {}) }) });
1354
1527
  }
1355
1528
  export {
1356
- Jr as default
1529
+ or as Autocomplete,
1530
+ Yt as Image,
1531
+ So as default,
1532
+ _t as useSearch
1357
1533
  };