@blocklet/list 0.13.40 → 0.14.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.
Files changed (2) hide show
  1. package/lib/index.es.js +365 -362
  2. package/package.json +3 -3
package/lib/index.es.js CHANGED
@@ -1,56 +1,56 @@
1
1
  import { jsx as t, jsxs as m, Fragment as F } from "react/jsx-runtime";
2
- import { styled as D, useTheme as be } from "@arcblock/ux/lib/Theme";
3
- import { Global as xe, css as we } from "@emotion/react";
2
+ import { styled as D, useTheme as xe } from "@arcblock/ux/lib/Theme";
3
+ import { Global as we, css as ke } from "@emotion/react";
4
4
  import { ErrorFallback as Z } from "@arcblock/ux/lib/ErrorBoundary";
5
- import { Button as ee, useTheme as Qe, useMediaQuery as N, Drawer as Xe, Box as S, CircularProgress as te, MenuList as Ye, SvgIcon as Je, Popper as Ke, Grow as Ze, Paper as et, ClickAwayListener as tt, MenuItem as rt, Stack as T, FormControlLabel as ke, Checkbox as ve, Typography as I, Link as ot, Grid as pe, OutlinedInput as nt, InputAdornment as me } from "@mui/material";
6
- import { ErrorBoundary as lt } from "react-error-boundary";
7
- import at from "@iconify-icons/tabler/compass";
8
- import { Icon as Ce } from "@iconify/react";
9
- import Se from "@mui/icons-material/Close";
10
- import { createContext as Be, useState as q, useMemo as E, useContext as Re, useCallback as K, useEffect as j, forwardRef as it, useRef as U, memo as st, createElement as ct, Fragment as dt } from "react";
11
- import Pe from "axios";
12
- import ut from "lodash/orderBy";
5
+ import { Button as ee, useTheme as Xe, useMediaQuery as N, Drawer as Ye, Box as S, CircularProgress as te, MenuList as Je, SvgIcon as Ke, Popper as Ze, Grow as et, Paper as tt, ClickAwayListener as rt, MenuItem as ot, Stack as I, FormControlLabel as ve, Checkbox as Ce, Typography as L, Link as nt, Grid as me, OutlinedInput as lt, InputAdornment as he } from "@mui/material";
6
+ import { ErrorBoundary as at } from "react-error-boundary";
7
+ import it from "@iconify-icons/tabler/compass";
8
+ import { Icon as Se } from "@iconify/react";
9
+ import Be from "@mui/icons-material/Close";
10
+ import { createContext as Re, useState as q, useMemo as E, useContext as Pe, useCallback as K, useEffect as j, forwardRef as st, useRef as U, memo as ct, createElement as dt, Fragment as ut } from "react";
11
+ import Te from "axios";
12
+ import pt from "lodash/orderBy";
13
13
  import i from "prop-types";
14
- import { useInfiniteScroll as pt, useRequest as re, useReactive as mt, useDebounceFn as ht } from "ahooks";
15
- import ft from "lodash/omitBy";
16
- import gt from "json-stable-stringify";
14
+ import { useInfiniteScroll as mt, useRequest as re, useReactive as ht, useDebounceFn as ft } from "ahooks";
15
+ import gt from "lodash/omitBy";
16
+ import yt from "json-stable-stringify";
17
17
  import "lodash/cloneDeep";
18
- import yt from "color";
19
- import he from "flat";
20
- import bt from "@mui/icons-material/KeyboardArrowDown";
21
- import xt from "lodash/isEmpty";
22
- import Te from "@mui/material/Box";
23
- import wt from "@arcblock/ux/lib/Avatar";
24
- import kt from "@iconify-icons/tabler/cloud-download";
25
- import vt from "@mui/icons-material/ChevronLeft";
26
- import Ct from "@mui/icons-material/ChevronRight";
27
- import St from "react-image-gallery";
18
+ import bt from "color";
19
+ import fe from "flat";
20
+ import xt from "@mui/icons-material/KeyboardArrowDown";
21
+ import wt from "lodash/isEmpty";
22
+ import Ie from "@mui/material/Box";
23
+ import kt from "@arcblock/ux/lib/Avatar";
24
+ import vt from "@iconify-icons/tabler/cloud-download";
25
+ import Ct from "@mui/icons-material/ChevronLeft";
26
+ import St from "@mui/icons-material/ChevronRight";
27
+ import Bt from "react-image-gallery";
28
28
  import "react-image-gallery/styles/css/image-gallery.css";
29
- import Bt from "@arcblock/ux/lib/Empty";
30
- import Rt from "react-infinite-scroll-hook";
31
- import Ie from "@mui/material/Typography";
32
- import Pt from "@mui/icons-material/Menu";
33
- import { createRoot as Tt } from "react-dom/client";
34
- import { autocomplete as It } from "@algolia/autocomplete-js";
35
- import { useHotkeys as Lt } from "react-hotkeys-hook";
29
+ import Rt from "@arcblock/ux/lib/Empty";
30
+ import Pt from "react-infinite-scroll-hook";
31
+ import Le from "@mui/material/Typography";
32
+ import Tt from "@mui/icons-material/Menu";
33
+ import { createRoot as It } from "react-dom/client";
34
+ import { autocomplete as Lt } from "@algolia/autocomplete-js";
35
+ import { useHotkeys as $t } from "react-hotkeys-hook";
36
36
  import { joinURL as zt } from "ufo";
37
- import $t from "@mui/icons-material/Search";
37
+ import _t from "@mui/icons-material/Search";
38
38
  import "@algolia/autocomplete-theme-classic/dist/theme.css";
39
- const Le = Be({
39
+ const $e = Re({
40
40
  open: !1,
41
41
  toggleOpen: (e) => {
42
42
  }
43
43
  });
44
- function _t({ children: e }) {
45
- const [r, o] = q(!1), n = (l) => {
46
- o(l ?? !l);
47
- }, a = E(() => ({ open: r, toggleOpen: n }), [r]);
48
- return /* @__PURE__ */ t(Le.Provider, { value: a, children: e });
44
+ function At({ children: e }) {
45
+ const [o, r] = q(!1), n = (l) => {
46
+ r(l ?? !l);
47
+ }, a = E(() => ({ open: o, toggleOpen: n }), [o]);
48
+ return /* @__PURE__ */ t($e.Provider, { value: a, children: e });
49
49
  }
50
50
  function oe() {
51
- return Re(Le);
51
+ return Pe($e);
52
52
  }
53
- const P = {
53
+ const T = {
54
54
  nameAsc: "title",
55
55
  nameDesc: "title",
56
56
  popularity: "stats.downloads",
@@ -64,29 +64,29 @@ const P = {
64
64
  explorePath: "/api/blocklets/explore",
65
65
  exploreDidsPath: "/api/blocklets/dids",
66
66
  cacheSize: 100
67
- }, At = (e, r, o, n) => pt(
67
+ }, Ft = (e, o, r, n) => mt(
68
68
  async (a) => {
69
- a || (o.currentPage = o.defaultCurrentPage);
70
- const { currentPage: l, pageSize: c } = o, d = {
71
- ...r,
72
- category: r.category === "All" ? "" : r.category,
73
- sortBy: P[r.sortBy],
69
+ a || (r.currentPage = r.defaultCurrentPage);
70
+ const { currentPage: l, pageSize: d } = r, u = {
71
+ ...o,
72
+ category: o.category === "All" ? "" : o.category,
73
+ sortBy: T[o.sortBy],
74
74
  page: l,
75
- pageSize: c
75
+ pageSize: d
76
76
  };
77
77
  n(null);
78
- const { data: s = {} } = await e.get(P.blockletsPath, { params: d });
79
- return o.currentPage++, { page: l, pageSize: c, list: (s == null ? void 0 : s.dataList) || [], total: (s == null ? void 0 : s.total) || 0 };
78
+ const { data: s = {} } = await e.get(T.blockletsPath, { params: u });
79
+ return r.currentPage++, { page: l, pageSize: d, list: (s == null ? void 0 : s.dataList) || [], total: (s == null ? void 0 : s.total) || 0 };
80
80
  },
81
81
  {
82
82
  isNoMore: (a) => a ? a.page * a.pageSize >= a.total : !1,
83
- reloadDeps: [e, gt(r)],
83
+ reloadDeps: [e, yt(o)],
84
84
  onError: n
85
85
  }
86
- ), Ft = (e) => re(
86
+ ), Dt = (e) => re(
87
87
  async () => {
88
- const { data: r } = await e.get(P.categoriesPath);
89
- return Array.isArray(r) ? r : [];
88
+ const { data: o } = await e.get(T.categoriesPath);
89
+ return Array.isArray(o) ? o : [];
90
90
  },
91
91
  { manual: !0 }
92
92
  ), ze = {
@@ -113,7 +113,7 @@ const P = {
113
113
  showResourcesSwitch: i.bool,
114
114
  showCategory: i.bool,
115
115
  tagFilters: i.array
116
- }, $e = {
116
+ }, _e = {
117
117
  locale: "zh",
118
118
  filters: {},
119
119
  serverVersion: "",
@@ -129,7 +129,7 @@ const P = {
129
129
  showResourcesSwitch: !1,
130
130
  showCategory: !0,
131
131
  tagFilters: []
132
- }, _e = (e) => [
132
+ }, Ae = (e) => [
133
133
  {
134
134
  name: e("sort.popularity"),
135
135
  value: "popularity"
@@ -142,22 +142,22 @@ const P = {
142
142
  // name: t('sort.rating'),
143
143
  // value: 'rating',
144
144
  // },
145
- ], Dt = (e) => [
145
+ ], Et = (e) => [
146
146
  { name: e("blocklet.free"), value: "free" },
147
147
  { name: e("blocklet.payment"), value: "payment" }
148
- ], Et = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), Mt = (e, r) => (
148
+ ], Mt = (e = [], o = "en") => e.map((r) => ({ name: r.locales[o] || r.locales.en, value: r._id })), Nt = (e, o) => (
149
149
  // eslint-disable-next-line no-prototype-builtins
150
- e == null ? void 0 : e.replace(/{(\w*)}/g, (o, n) => r.hasOwnProperty(n) ? r[n] : "")
151
- ), Nt = () => window.innerWidth <= 600, Ot = (e) => yt(e).rgb().object();
152
- function qt(e, r) {
153
- let o;
150
+ e == null ? void 0 : e.replace(/{(\w*)}/g, (r, n) => o.hasOwnProperty(n) ? o[n] : "")
151
+ ), Ot = () => window.innerWidth <= 600, qt = (e) => bt(e).rgb().object();
152
+ function jt(e, o) {
153
+ let r;
154
154
  return function(...a) {
155
- return o && clearTimeout(o), new Promise((l) => {
156
- o = setTimeout(() => l(e(...a)), r);
155
+ return r && clearTimeout(r), new Promise((l) => {
156
+ r = setTimeout(() => l(e(...a)), o);
157
157
  });
158
158
  };
159
159
  }
160
- const jt = qt((e) => Promise.resolve(e), 300), Vt = {
160
+ const Vt = jt((e) => Promise.resolve(e), 300), Wt = {
161
161
  common: {
162
162
  title: "Blocklet Store",
163
163
  searchStore: "Search Blocklet",
@@ -205,7 +205,7 @@ const jt = qt((e) => Promise.resolve(e), 300), Vt = {
205
205
  autocomplete: {
206
206
  expandResult: 'View all search results for "{name}"'
207
207
  }
208
- }, Wt = {
208
+ }, Ut = {
209
209
  common: {
210
210
  title: "Blocklet 商店",
211
211
  searchStore: "搜索 Blocklet",
@@ -254,15 +254,15 @@ const jt = qt((e) => Promise.resolve(e), 300), Vt = {
254
254
  expandResult: "查看 “{name}” 的所有搜索结果"
255
255
  }
256
256
  }, J = {
257
- en: he(Vt),
258
- zh: he(Wt)
259
- }, Ae = (e, r) => {
260
- const o = {};
261
- return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
262
- }, Ut = (e) => (r, o) => {
263
- const n = J[e] ? J[e][r] : J.en[r];
264
- return Mt(n, o) || r;
265
- }, Fe = {
257
+ en: fe(Wt),
258
+ zh: fe(Ut)
259
+ }, Fe = (e, o) => {
260
+ const r = {};
261
+ return e && (r["x-blocklet-server-version"] = e), o && (r["x-blocklet-store-version"] = o), r;
262
+ }, Ht = (e) => (o, r) => {
263
+ const n = J[e] ? J[e][o] : J.en[o];
264
+ return Nt(n, r) || o;
265
+ }, De = {
266
266
  errors: {
267
267
  fetchBlockletsError: null,
268
268
  fetchCategoriesError: null
@@ -281,6 +281,7 @@ const jt = qt((e) => Promise.resolve(e), 300), Vt = {
281
281
  filters: {},
282
282
  selectedCategory: void 0,
283
283
  categoryList: [],
284
+ total: 0,
284
285
  blockletRender: () => null,
285
286
  locale: "en",
286
287
  categoryOptions: [],
@@ -315,49 +316,51 @@ const jt = qt((e) => Promise.resolve(e), 300), Vt = {
315
316
  developerName: "",
316
317
  handleSearchSelect: () => {
317
318
  }
318
- }, De = Be(Fe), { Provider: Ht, Consumer: Hr } = De;
319
+ }, Ee = Re(De), { Provider: Gt, Consumer: Qr } = Ee;
319
320
  function ne({
320
321
  filters: e,
321
- children: r,
322
- endpoint: o,
322
+ children: o,
323
+ endpoint: r,
323
324
  locale: n,
324
325
  blockletRender: a,
325
326
  onFilterChange: l,
326
- onSearchSelect: c,
327
- extraFilter: d,
327
+ onSearchSelect: d,
328
+ extraFilter: u,
328
329
  wrapChildren: s,
329
330
  baseSearch: v,
330
331
  serverVersion: f,
331
332
  storeVersion: y,
332
- fetchCategoryDelay: u,
333
+ fetchCategoryDelay: c,
333
334
  showResourcesSwitch: w,
334
335
  showCategory: k,
335
336
  tagFilters: x
336
337
  }) {
337
- const $ = Ae(f, y), b = E(() => Pe.create({ baseURL: o, headers: $ }), [o]), h = { sortBy: "popularity", sortDirection: "desc", ...e }, C = h.category, _ = mt({
338
- currentPage: P.currentPage,
339
- pageSize: Nt() ? P.mobilePageSize : P.pageSize,
340
- defaultCurrentPage: P.defaultCurrentPage
341
- }), [A, z] = q(null), L = At(b, h, _, z), {
338
+ var ue;
339
+ const z = Fe(f, y), b = E(() => Te.create({ baseURL: r, headers: z }), [r]), h = { sortBy: "popularity", sortDirection: "desc", ...e }, C = h.category, _ = ht({
340
+ currentPage: T.currentPage,
341
+ pageSize: Ot() ? T.mobilePageSize : T.pageSize,
342
+ defaultCurrentPage: T.defaultCurrentPage
343
+ }), [A, $] = q(null), R = Ft(b, h, _, $), {
342
344
  data: X = [],
343
- error: Ve,
344
- loading: We,
345
+ error: We,
346
+ loading: Ue,
345
347
  run: se
346
- } = Ft(b), Y = E(() => {
347
- const p = ut(X, [(R) => R.name], ["asc"]), g = p.findIndex((R) => R.name === "All" || R.locales.en === "All");
348
+ } = Dt(b), Y = E(() => {
349
+ const p = pt(X, [(P) => P.name], ["asc"]), g = p.findIndex((P) => P.name === "All" || P.locales.en === "All");
348
350
  return g > -1 ? [{ ...p[g], _id: "All" }, ...p.slice(0, g), ...p.slice(g + 1)] : p;
349
351
  }, [X]), ce = E(() => {
350
352
  var p;
351
- return d(((p = L.data) == null ? void 0 : p.list) || []);
352
- }, [L.data, d]), de = K(Ut(n), [n]), Ue = E(() => Et(Y, n), [Y, n]), He = Dt(de), Ge = {
353
- errors: { fetchBlockletsError: A, fetchCategoriesError: Ve },
353
+ return u(((p = R.data) == null ? void 0 : p.list) || []);
354
+ }, [R.data, u]), de = K(Ht(n), [n]), He = E(() => Mt(Y, n), [Y, n]), Ge = Et(de), Qe = {
355
+ errors: { fetchBlockletsError: A, fetchCategoriesError: We },
354
356
  loadings: {
355
- fetchBlockletsLoading: L.loading,
356
- fetchCategoriesLoading: We,
357
- loadingMore: L.loadingMore
357
+ fetchBlockletsLoading: R.loading,
358
+ fetchCategoriesLoading: Ue,
359
+ loadingMore: R.loadingMore
358
360
  },
359
- endpoint: o,
361
+ endpoint: r,
360
362
  blockletList: ce,
363
+ total: ((ue = R.data) == null ? void 0 : ue.total) || 0,
361
364
  wrapChildren: s,
362
365
  t: de,
363
366
  storeVersion: y,
@@ -367,17 +370,17 @@ function ne({
367
370
  categoryList: Y,
368
371
  blockletRender: a,
369
372
  locale: n,
370
- categoryOptions: Ue,
371
- priceOptions: He,
373
+ categoryOptions: He,
374
+ priceOptions: Ge,
372
375
  storeApi: b,
373
376
  baseSearch: v,
374
377
  showResourcesSwitch: w,
375
378
  showCategory: k,
376
379
  tagFilters: x,
377
- hasNextPage: !L.noMore,
380
+ hasNextPage: !R.noMore,
378
381
  onFilterChange: l,
379
382
  cleanFilter: (p) => {
380
- const g = p ? ft(h, (R, M) => p == null ? void 0 : p.includes(M)) : {};
383
+ const g = p ? gt(h, (P, M) => p == null ? void 0 : p.includes(M)) : {};
381
384
  l(g);
382
385
  },
383
386
  handleSort: (p) => {
@@ -393,8 +396,8 @@ function ne({
393
396
  l(g);
394
397
  },
395
398
  handleCategory: (p) => {
396
- const g = p === "all" || p === h.category ? "" : p, R = { ...h, category: g };
397
- l(R);
399
+ const g = p === "all" || p === h.category ? "" : p, P = { ...h, category: g };
400
+ l(P);
398
401
  },
399
402
  handleDeveloper: (p) => {
400
403
  const g = { ...h, owner: p || void 0 };
@@ -408,48 +411,48 @@ function ne({
408
411
  const p = { ...h };
409
412
  l(p);
410
413
  },
411
- loadMore: L.loadMore,
414
+ loadMore: R.loadMore,
412
415
  getCategoryLocale: (p) => {
413
416
  if (!p)
414
417
  return null;
415
- const g = X.find((R) => R._id === p);
418
+ const g = X.find((P) => P._id === p);
416
419
  return g ? g.locales[n] || g.locales.en : null;
417
420
  },
418
421
  get developerName() {
419
- var g, R;
420
- return ((R = (g = ce.find((M) => {
421
- var ue;
422
- return ((ue = M == null ? void 0 : M.owner) == null ? void 0 : ue.did) === h.owner;
423
- })) == null ? void 0 : g.owner) == null ? void 0 : R.name) || "";
422
+ var g, P;
423
+ return ((P = (g = ce.find((M) => {
424
+ var pe;
425
+ return ((pe = M == null ? void 0 : M.owner) == null ? void 0 : pe.did) === h.owner;
426
+ })) == null ? void 0 : g.owner) == null ? void 0 : P.name) || "";
424
427
  },
425
- handleSearchSelect: c
428
+ handleSearchSelect: d
426
429
  };
427
430
  return j(() => {
428
- setTimeout(se, u || 0);
429
- }, [o, se, u]), /* @__PURE__ */ t(Ht, { value: Ge, children: r });
431
+ setTimeout(se, c || 0);
432
+ }, [r, se, c]), /* @__PURE__ */ t(Gt, { value: Qe, children: o });
430
433
  }
431
434
  ne.propTypes = {
432
435
  ...ze,
433
436
  children: i.any.isRequired
434
437
  };
435
- ne.defaultProps = $e;
438
+ ne.defaultProps = _e;
436
439
  function B() {
437
- const e = Re(De);
438
- return e || Fe;
440
+ const e = Pe(Ee);
441
+ return e || De;
439
442
  }
440
- function Ee({
443
+ function Me({
441
444
  children: e,
442
- onClick: r,
443
- size: o = 32
445
+ onClick: o,
446
+ size: r = 32
444
447
  }) {
445
448
  return /* @__PURE__ */ t(
446
449
  ee,
447
450
  {
448
- onClick: r,
451
+ onClick: o,
449
452
  variant: "outlined",
450
453
  sx: {
451
- minWidth: o,
452
- height: o,
454
+ minWidth: r,
455
+ height: r,
453
456
  p: 0,
454
457
  borderColor: "divider",
455
458
  "&:hover": {
@@ -462,43 +465,43 @@ function Ee({
462
465
  }
463
466
  );
464
467
  }
465
- function V(e, r) {
466
- return e === void 0 ? r : e;
468
+ function V(e, o) {
469
+ return e === void 0 ? o : e;
467
470
  }
468
471
  function G({
469
472
  xs: e,
470
- sm: r,
471
- md: o,
473
+ sm: o,
474
+ md: r,
472
475
  lg: n,
473
476
  xl: a,
474
477
  exact: l
475
478
  }) {
476
- const c = Qe(), d = N(c.breakpoints.down("sm")), s = N(c.breakpoints.between("sm", "md")), v = N(c.breakpoints.between("md", "lg")), f = N(c.breakpoints.between("lg", "xl"));
479
+ const d = Xe(), u = N(d.breakpoints.down("sm")), s = N(d.breakpoints.between("sm", "md")), v = N(d.breakpoints.between("md", "lg")), f = N(d.breakpoints.between("lg", "xl"));
477
480
  if (l)
478
- return d ? e || null : s ? r || null : v ? o || null : f ? n || null : a || null;
481
+ return u ? e || null : s ? o || null : v ? r || null : f ? n || null : a || null;
479
482
  let y = e;
480
- return d || (y = V(r, y), s) || (y = V(o, y), v) || (y = V(n, y), f) ? y : V(a, y);
483
+ return u || (y = V(o, y), s) || (y = V(r, y), v) || (y = V(n, y), f) ? y : V(a, y);
481
484
  }
482
- function Gt({ children: e }) {
483
- const { open: r, toggleOpen: o } = oe();
485
+ function Qt({ children: e }) {
486
+ const { open: o, toggleOpen: r } = oe();
484
487
  return /* @__PURE__ */ t(
485
488
  G,
486
489
  {
487
- xs: /* @__PURE__ */ t(Xe, { open: r, onClose: () => o(!1), children: e }),
490
+ xs: /* @__PURE__ */ t(Ye, { open: o, onClose: () => r(!1), children: e }),
488
491
  md: /* @__PURE__ */ t(S, { children: e })
489
492
  }
490
493
  );
491
494
  }
492
- const Qt = D(ee)`
495
+ const Xt = D(ee)`
493
496
  border-radius: 4px;
494
- `, le = it(({ children: e, rounded: r, loading: o, disabled: n, ...a }, l) => /* @__PURE__ */ t(
495
- Qt,
497
+ `, le = st(({ children: e, rounded: o, loading: r, disabled: n, ...a }, l) => /* @__PURE__ */ t(
498
+ Xt,
496
499
  {
497
500
  ref: l,
498
501
  disableElevation: !0,
499
- disabled: n || o,
502
+ disabled: n || r,
500
503
  ...a,
501
- startIcon: o && /* @__PURE__ */ t(te, { size: "1em" }),
504
+ startIcon: r && /* @__PURE__ */ t(te, { size: "1em" }),
502
505
  children: e
503
506
  }
504
507
  ));
@@ -514,44 +517,44 @@ le.defaultProps = {
514
517
  loading: !1,
515
518
  disabled: !1
516
519
  };
517
- function Q({ title: e, value: r, icon: o, prepend: n, options: a, onChange: l, itemRender: c, ...d }) {
518
- const s = U(null), v = be(), [f, y] = q(!1), [u, w] = q(r !== null ? r : ""), k = N(v.breakpoints.down("sm"));
520
+ function Q({ title: e, value: o, icon: r, prepend: n, options: a, onChange: l, itemRender: d, ...u }) {
521
+ const s = U(null), v = xe(), [f, y] = q(!1), [c, w] = q(o !== null ? o : ""), k = N(v.breakpoints.down("sm"));
519
522
  j(() => {
520
- w(r !== null ? r : "");
521
- }, [r]);
523
+ w(o !== null ? o : "");
524
+ }, [o]);
522
525
  const x = K(() => {
523
526
  y(!1);
524
- }, []), $ = K(() => {
527
+ }, []), z = K(() => {
525
528
  y(!0);
526
529
  }, []);
527
530
  function b(C) {
528
531
  w(C.value), l(C.value), k && x();
529
532
  }
530
533
  function h(C) {
531
- return C === u;
534
+ return C === c;
532
535
  }
533
536
  return /* @__PURE__ */ m(F, { children: [
534
537
  /* @__PURE__ */ m(
535
- Xt,
538
+ Yt,
536
539
  {
537
540
  ref: s,
538
- onClick: $,
541
+ onClick: z,
539
542
  variant: "outlined",
540
543
  size: "small",
541
- className: ["my-select__selector", xt(u) ? "" : "my-select__selector--active"].join(" "),
544
+ className: ["my-select__selector", wt(c) ? "" : "my-select__selector--active"].join(" "),
542
545
  sx: { minWidth: "auto" },
543
- ...d,
546
+ ...u,
544
547
  children: [
545
- /* @__PURE__ */ t("div", { className: "my-select__icon", children: o }),
548
+ /* @__PURE__ */ t("div", { className: "my-select__icon", children: r }),
546
549
  e,
547
- /* @__PURE__ */ t(Je, { className: "my-select__arrowdown", component: bt, fontSize: "small" })
550
+ /* @__PURE__ */ t(Ke, { className: "my-select__arrowdown", component: xt, fontSize: "small" })
548
551
  ]
549
552
  }
550
553
  ),
551
- /* @__PURE__ */ t(Ke, { open: f, anchorEl: s.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: C, placement: _ }) => /* @__PURE__ */ t(Ze, { ...C, sx: { transformOrigin: _ === "bottom" ? "center top" : "center bottom" }, children: /* @__PURE__ */ t(et, { children: /* @__PURE__ */ t(tt, { onClickAway: x, children: /* @__PURE__ */ m(Yt, { autoFocusItem: f, onMouseEnter: $, onMouseLeave: x, children: [
554
+ /* @__PURE__ */ t(Ze, { open: f, anchorEl: s.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: C, placement: _ }) => /* @__PURE__ */ t(et, { ...C, sx: { transformOrigin: _ === "bottom" ? "center top" : "center bottom" }, children: /* @__PURE__ */ t(tt, { children: /* @__PURE__ */ t(rt, { onClickAway: x, children: /* @__PURE__ */ m(Jt, { autoFocusItem: f, onMouseEnter: z, onMouseLeave: x, children: [
552
555
  n,
553
- a.map((A) => c ? c(A) : /* @__PURE__ */ t(
554
- rt,
556
+ a.map((A) => d ? d(A) : /* @__PURE__ */ t(
557
+ ot,
555
558
  {
556
559
  onClick: () => b(A),
557
560
  className: [
@@ -582,7 +585,7 @@ Q.defaultProps = {
582
585
  onChange: () => {
583
586
  }
584
587
  };
585
- const Xt = D(le)`
588
+ const Yt = D(le)`
586
589
  border: 1px solid #f0f0f0;
587
590
  padding: 6px 8px 6px 12px;
588
591
  font-weight: ${(e) => e.theme.typography.fontWeightRegular};
@@ -613,7 +616,7 @@ const Xt = D(le)`
613
616
  margin-right: 3px;
614
617
  }
615
618
  }
616
- `, Yt = D(Ye)`
619
+ `, Jt = D(Je)`
617
620
  .my-select__option__icon {
618
621
  color: transparent;
619
622
  font-size: 14px;
@@ -630,11 +633,11 @@ const Xt = D(le)`
630
633
  }
631
634
  }
632
635
  `;
633
- function Me() {
634
- var c;
635
- const { filters: e, handleSort: r, handlePrice: o, t: n } = B(), a = _e(n), l = ((c = a.find((d) => d.value === e.sortBy)) == null ? void 0 : c.name) || n("sort.sort");
636
+ function Ne() {
637
+ var d;
638
+ const { filters: e, handleSort: o, handlePrice: r, t: n } = B(), a = Ae(n), l = ((d = a.find((u) => u.value === e.sortBy)) == null ? void 0 : d.name) || n("sort.sort");
636
639
  return /* @__PURE__ */ m(
637
- T,
640
+ I,
638
641
  {
639
642
  direction: { xs: "row", md: "column" },
640
643
  alignItems: { xs: "center", md: "flex-start" },
@@ -643,15 +646,15 @@ function Me() {
643
646
  justifyContent: "space-between",
644
647
  children: [
645
648
  /* @__PURE__ */ t(
646
- ke,
649
+ ve,
647
650
  {
648
651
  control: /* @__PURE__ */ t(
649
- ve,
652
+ Ce,
650
653
  {
651
654
  checked: e.price === "free",
652
655
  size: "small",
653
656
  sx: { "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
654
- onChange: (d) => o(d.target.checked ? "free" : "")
657
+ onChange: (u) => r(u.target.checked ? "free" : "")
655
658
  }
656
659
  ),
657
660
  label: n("blocklet.free")
@@ -663,7 +666,7 @@ function Me() {
663
666
  value: e.sortBy,
664
667
  options: a,
665
668
  title: l,
666
- onChange: r,
669
+ onChange: o,
667
670
  icon: null,
668
671
  prepend: null,
669
672
  itemRender: null
@@ -673,14 +676,14 @@ function Me() {
673
676
  }
674
677
  );
675
678
  }
676
- function Jt() {
677
- const { selectedCategory: e, handleCategory: r, t: o, categoryOptions: n, filters: a, cleanFilter: l, loadings: c } = B(), { toggleOpen: d } = oe();
678
- return /* @__PURE__ */ m(Gt, { children: [
679
+ function Kt() {
680
+ const { selectedCategory: e, handleCategory: o, t: r, categoryOptions: n, filters: a, cleanFilter: l, loadings: d } = B(), { toggleOpen: u } = oe();
681
+ return /* @__PURE__ */ m(Qt, { children: [
679
682
  /* @__PURE__ */ t(
680
683
  G,
681
684
  {
682
685
  xs: /* @__PURE__ */ m(
683
- T,
686
+ I,
684
687
  {
685
688
  direction: "row",
686
689
  justifyContent: "space-between",
@@ -691,8 +694,8 @@ function Jt() {
691
694
  borderBottom: 1,
692
695
  borderColor: "divider",
693
696
  children: [
694
- /* @__PURE__ */ t(Ee, { onClick: () => d(!1), children: /* @__PURE__ */ t(Se, {}) }),
695
- /* @__PURE__ */ t(I, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: "Categories" })
697
+ /* @__PURE__ */ t(Me, { onClick: () => u(!1), children: /* @__PURE__ */ t(Be, {}) }),
698
+ /* @__PURE__ */ t(L, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: "Categories" })
696
699
  ]
697
700
  }
698
701
  ),
@@ -700,32 +703,32 @@ function Jt() {
700
703
  }
701
704
  ),
702
705
  /* @__PURE__ */ t(
703
- T,
706
+ I,
704
707
  {
705
- visibility: c.fetchCategoriesLoading ? "hidden" : "visible",
708
+ visibility: d.fetchCategoriesLoading ? "hidden" : "visible",
706
709
  width: { xs: 268, md: 200 },
707
710
  boxSizing: "content-box",
708
711
  p: { xs: 2, md: 0 },
709
712
  pr: { md: 6 },
710
- children: a.keyword ? /* @__PURE__ */ t(Me, {}) : /* @__PURE__ */ m(F, { children: [
713
+ children: a.keyword ? /* @__PURE__ */ t(Ne, {}) : /* @__PURE__ */ m(F, { children: [
711
714
  /* @__PURE__ */ m(S, { display: "flex", alignItems: "center", gap: 1, children: [
712
- /* @__PURE__ */ t(Ce, { icon: at }),
715
+ /* @__PURE__ */ t(Se, { icon: it }),
713
716
  /* @__PURE__ */ t(
714
- I,
717
+ L,
715
718
  {
716
719
  variant: "body1",
717
720
  color: e ? "text.lighter" : "text.primary",
718
721
  fontWeight: e ? void 0 : "fontWeightMedium",
719
722
  sx: { cursor: "pointer" },
720
723
  onClick: () => {
721
- d(!1), l();
724
+ u(!1), l();
722
725
  },
723
- children: o("explore.title")
726
+ children: r("explore.title")
724
727
  }
725
728
  )
726
729
  ] }),
727
- !!n.length && /* @__PURE__ */ t(T, { pt: 3, mt: 3, borderTop: 1, borderColor: "divider", gap: 2, children: n.map((s) => /* @__PURE__ */ t(
728
- I,
730
+ !!n.length && /* @__PURE__ */ t(I, { pt: 3, mt: 3, borderTop: 1, borderColor: "divider", gap: 2, children: n.map((s) => /* @__PURE__ */ t(
731
+ L,
729
732
  {
730
733
  variant: "body1",
731
734
  title: s.name,
@@ -734,7 +737,7 @@ function Jt() {
734
737
  color: e === s.value ? "text.primary" : "text.lighter",
735
738
  textTransform: "capitalize",
736
739
  onClick: () => {
737
- e === s.value ? l() : r(s.value), d(!1);
740
+ e === s.value ? l() : o(s.value), u(!1);
738
741
  },
739
742
  children: s.name
740
743
  },
@@ -745,51 +748,51 @@ function Jt() {
745
748
  )
746
749
  ] });
747
750
  }
748
- function Ne() {
749
- const { endpoint: e, serverVersion: r, storeVersion: o } = B(), n = Ae(r, o), a = E(() => Pe.create({
751
+ function Oe() {
752
+ const { endpoint: e, serverVersion: o, storeVersion: r } = B(), n = Fe(o, r), a = E(() => Te.create({
750
753
  baseURL: e,
751
754
  headers: n
752
755
  }), [e]);
753
756
  return {
754
757
  get: async (l) => {
755
- const { data: c } = await a.get(l);
756
- return c;
757
- },
758
- post: async (l, c) => {
759
- const { data: d } = await a.post(l, c);
758
+ const { data: d } = await a.get(l);
760
759
  return d;
760
+ },
761
+ post: async (l, d) => {
762
+ const { data: u } = await a.post(l, d);
763
+ return u;
761
764
  }
762
765
  };
763
766
  }
764
- const Oe = st(function(r) {
765
- return /* @__PURE__ */ t(Te, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(te, {}) });
767
+ const qe = ct(function(o) {
768
+ return /* @__PURE__ */ t(Ie, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...o, children: /* @__PURE__ */ t(te, {}) });
766
769
  });
767
- function fe({
770
+ function ge({
768
771
  icon: e,
769
- children: r,
770
- maxWidth: o = 100,
772
+ children: o,
773
+ maxWidth: r = 100,
771
774
  title: n
772
775
  }) {
773
- return (r === 0 || r) && /* @__PURE__ */ m(T, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
776
+ return (o === 0 || o) && /* @__PURE__ */ m(I, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: r, overflow: "hidden" }, children: [
774
777
  e,
775
778
  /* @__PURE__ */ t(
776
- I,
779
+ L,
777
780
  {
778
781
  flex: 1,
779
782
  variant: "body2",
780
783
  sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
781
- title: n || (typeof r == "string" ? r : void 0),
782
- children: r
784
+ title: n || (typeof o == "string" ? o : void 0),
785
+ children: o
783
786
  }
784
787
  )
785
788
  ] });
786
789
  }
787
- const ge = 292;
788
- function Kt() {
790
+ const ye = 292;
791
+ function Zt() {
789
792
  var f, y;
790
- const { t: e } = B(), { post: r } = Ne(), o = ((y = (f = window.blocklet) == null ? void 0 : f.preferences) == null ? void 0 : y.homeBanner) || [], { data: n = [] } = re(async () => {
791
- const u = await r(P.exploreDidsPath, { didList: o.map((w) => w.did) });
792
- return Array.isArray(u) ? u : [];
793
+ const { t: e } = B(), { post: o } = Oe(), r = ((y = (f = window.blocklet) == null ? void 0 : f.preferences) == null ? void 0 : y.homeBanner) || [], { data: n = [] } = re(async () => {
794
+ const c = await o(T.exploreDidsPath, { didList: r.map((w) => w.did) });
795
+ return Array.isArray(c) ? c : [];
793
796
  }), a = {
794
797
  position: "absolute",
795
798
  top: "50%",
@@ -798,10 +801,10 @@ function Kt() {
798
801
  cursor: "pointer",
799
802
  color: "text.lighter"
800
803
  };
801
- return o.length > 0 ? /* @__PURE__ */ m(F, { children: [
802
- /* @__PURE__ */ t(I, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
803
- /* @__PURE__ */ t(S, { height: { xs: "auto", md: ge }, position: "relative", bgcolor: "#F0F7FF", borderRadius: 3, children: /* @__PURE__ */ t(
804
- St,
804
+ return r.length > 0 ? /* @__PURE__ */ m(F, { children: [
805
+ /* @__PURE__ */ t(L, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
806
+ /* @__PURE__ */ t(S, { height: { xs: "auto", md: ye }, position: "relative", bgcolor: "#F0F7FF", borderRadius: 3, children: /* @__PURE__ */ t(
807
+ Bt,
805
808
  {
806
809
  showNav: !0,
807
810
  autoPlay: !0,
@@ -812,17 +815,17 @@ function Kt() {
812
815
  showBullets: !1,
813
816
  showThumbnails: !1,
814
817
  showFullscreenButton: !1,
815
- renderLeftNav: (u) => /* @__PURE__ */ t(S, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(vt, { sx: { ...a, left: 5 } }) }),
816
- renderRightNav: (u) => /* @__PURE__ */ t(S, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Ct, { sx: { ...a, right: 5 } }) }),
817
- items: o.map((u, w) => ({
818
- original: u.did,
818
+ renderLeftNav: (c) => /* @__PURE__ */ t(S, { onClick: c, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Ct, { sx: { ...a, left: 5 } }) }),
819
+ renderRightNav: (c) => /* @__PURE__ */ t(S, { onClick: c, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(St, { sx: { ...a, right: 5 } }) }),
820
+ items: r.map((c, w) => ({
821
+ original: c.did,
819
822
  renderItem: () => {
820
823
  var x;
821
824
  const k = n[w] || {};
822
825
  return /* @__PURE__ */ m(
823
- T,
826
+ I,
824
827
  {
825
- height: { xs: "auto", md: ge },
828
+ height: { xs: "auto", md: ye },
826
829
  display: "flex",
827
830
  direction: { xs: "column", md: "row" },
828
831
  justifyContent: "center",
@@ -830,14 +833,14 @@ function Kt() {
830
833
  p: { xs: 2, md: 5 },
831
834
  gap: { xs: 2, md: 5 },
832
835
  children: [
833
- l(u.cover || ((x = k.screenshots) == null ? void 0 : x[0])),
834
- /* @__PURE__ */ m(T, { flex: 1, height: "100%", gap: 3, children: [
836
+ l(c.cover || tr(c.did, (x = k.screenshots) == null ? void 0 : x[0])),
837
+ /* @__PURE__ */ m(I, { flex: 1, height: "100%", gap: 3, children: [
835
838
  /* @__PURE__ */ m(S, { flex: 1, children: [
836
- c(u.name || k.title || u.name),
837
- d(u.desc || k.description)
839
+ d(c.name || k.title || c.name),
840
+ u(c.desc || k.description)
838
841
  ] }),
839
- k.did && s(k, u.baseNum),
840
- v(u.link, u.did)
842
+ k.did && s(k, c.baseNum),
843
+ v(c.link, c.did)
841
844
  ] })
842
845
  ]
843
846
  }
@@ -847,15 +850,15 @@ function Kt() {
847
850
  }
848
851
  ) })
849
852
  ] }) : null;
850
- function l(u) {
851
- return /* @__PURE__ */ t(S, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", children: /* @__PURE__ */ t("img", { src: u, alt: "", style: { width: "100%", height: "100%", objectFit: "cover" } }) });
853
+ function l(c) {
854
+ return /* @__PURE__ */ t(S, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", children: /* @__PURE__ */ t("img", { src: c, alt: "", style: { width: "100%", height: "100%", objectFit: "cover" } }) });
852
855
  }
853
- function c(u) {
854
- return /* @__PURE__ */ t(I, { variant: "h2", width: "100%", children: u });
856
+ function d(c) {
857
+ return /* @__PURE__ */ t(L, { variant: "h2", width: "100%", children: c });
855
858
  }
856
- function d(u) {
859
+ function u(c) {
857
860
  return /* @__PURE__ */ t(
858
- I,
861
+ L,
859
862
  {
860
863
  variant: "body2",
861
864
  color: "text.secondary",
@@ -871,19 +874,19 @@ function Kt() {
871
874
  overflow: "hidden",
872
875
  WebkitBoxOrient: "vertical"
873
876
  },
874
- children: u
877
+ children: c
875
878
  }
876
879
  );
877
880
  }
878
- function s(u, w = 0) {
879
- const { did: k, owner: x, stats: $ } = u;
881
+ function s(c, w = 0) {
882
+ const { did: k, owner: x, stats: z } = c;
880
883
  return /* @__PURE__ */ m(S, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
881
- /* @__PURE__ */ t(fe, { icon: /* @__PURE__ */ t(wt, { src: x.avatar, did: k, size: 20, variant: "circle" }), children: x.fullName }),
882
- /* @__PURE__ */ t(fe, { icon: /* @__PURE__ */ t(Ce, { icon: kt }), title: `${$.downloads + w}`, children: Zt($.downloads + w) })
884
+ /* @__PURE__ */ t(ge, { icon: /* @__PURE__ */ t(kt, { src: x.avatar, did: k, size: 20, variant: "circle" }), children: x.fullName }),
885
+ /* @__PURE__ */ t(ge, { icon: /* @__PURE__ */ t(Se, { icon: vt }), title: `${z.downloads + w}`, children: er(z.downloads + w) })
883
886
  ] });
884
887
  }
885
- function v(u, w) {
886
- return /* @__PURE__ */ t(ot, { href: u || `/blocklets/${w}`, align: "left", width: 100, children: /* @__PURE__ */ t(
888
+ function v(c, w) {
889
+ return /* @__PURE__ */ t(nt, { href: c || `/blocklets/${w}`, align: "left", width: 100, children: /* @__PURE__ */ t(
887
890
  ee,
888
891
  {
889
892
  variant: "outlined",
@@ -899,35 +902,35 @@ function Kt() {
899
902
  ) });
900
903
  }
901
904
  }
902
- const Zt = (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`;
903
- function er({ title: e, blocklets: r }) {
904
- const { blockletRender: o, serverVersion: n } = B();
905
+ const er = (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`, tr = (e, o) => e && o ? `/assets/${e}/screenshots/${o}` : "";
906
+ function rr({ title: e, blocklets: o }) {
907
+ const { blockletRender: r, serverVersion: n } = B();
905
908
  return /* @__PURE__ */ m(S, { mt: 3, children: [
906
- /* @__PURE__ */ t(I, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
907
- /* @__PURE__ */ t(pe, { container: !0, spacing: 2, children: r.map((a) => /* @__PURE__ */ t(pe, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": a.did, children: /* @__PURE__ */ t(S, { padding: "1px", children: o({ blocklet: a, blocklets: r, serverVersion: n }) }) }, a.did)) })
909
+ /* @__PURE__ */ t(L, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
910
+ /* @__PURE__ */ t(me, { container: !0, spacing: 2, children: o.map((a) => /* @__PURE__ */ t(me, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": a.did, children: /* @__PURE__ */ t(S, { padding: "1px", children: r({ blocklet: a, blocklets: o, serverVersion: n }) }) }, a.did)) })
908
911
  ] });
909
912
  }
910
- function tr() {
911
- const { get: e } = Ne(), { t: r } = B(), {
912
- data: o = [],
913
+ function or() {
914
+ const { get: e } = Oe(), { t: o } = B(), {
915
+ data: r = [],
913
916
  error: n,
914
917
  loading: a
915
918
  } = re(async () => {
916
- const l = await e(P.explorePath);
919
+ const l = await e(T.explorePath);
917
920
  return Array.isArray(l) ? l : [];
918
921
  });
919
- return n ? /* @__PURE__ */ t(Z, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : a ? /* @__PURE__ */ t(Oe, { mt: 15 }) : /* @__PURE__ */ m(F, { children: [
920
- /* @__PURE__ */ t(Kt, {}),
921
- o.map(
922
- (l) => l.blocklets.length > 0 ? /* @__PURE__ */ t(er, { title: r(`explore.${l.type}`), blocklets: l.blocklets }, l.type) : null
922
+ return n ? /* @__PURE__ */ t(Z, { error: new Error(`Failed to fetch blocklets from ${T.explorePath}`) }) : a ? /* @__PURE__ */ t(qe, { mt: 15 }) : /* @__PURE__ */ m(F, { children: [
923
+ /* @__PURE__ */ t(Zt, {}),
924
+ r.map(
925
+ (l) => l.blocklets.length > 0 ? /* @__PURE__ */ t(rr, { title: o(`explore.${l.type}`), blocklets: l.blocklets }, l.type) : null
923
926
  )
924
927
  ] });
925
928
  }
926
- function rr() {
927
- var d;
928
- const { filters: e, handleSort: r, handlePrice: o, t: n, getCategoryLocale: a } = B(), l = _e(n), c = ((d = l.find((s) => s.value === e.sortBy)) == null ? void 0 : d.name) || n("sort.sort");
929
+ function nr() {
930
+ var u;
931
+ const { filters: e, handleSort: o, handlePrice: r, t: n, getCategoryLocale: a } = B(), l = Ae(n), d = ((u = l.find((s) => s.value === e.sortBy)) == null ? void 0 : u.name) || n("sort.sort");
929
932
  return /* @__PURE__ */ m(
930
- T,
933
+ I,
931
934
  {
932
935
  direction: { xs: "column", md: "row" },
933
936
  alignItems: { xs: "flex-start", md: "center" },
@@ -937,18 +940,18 @@ function rr() {
937
940
  px: 0,
938
941
  pb: 3,
939
942
  children: [
940
- /* @__PURE__ */ t(I, { variant: "h2", textTransform: "capitalize", children: a(e.category) }),
941
- /* @__PURE__ */ m(T, { direction: "row", alignItems: "center", width: { xs: "100%", md: "auto" }, justifyContent: "space-between", children: [
943
+ /* @__PURE__ */ t(L, { variant: "h2", textTransform: "capitalize", children: a(e.category) }),
944
+ /* @__PURE__ */ m(I, { direction: "row", alignItems: "center", width: { xs: "100%", md: "auto" }, justifyContent: "space-between", children: [
942
945
  /* @__PURE__ */ t(
943
- ke,
946
+ ve,
944
947
  {
945
948
  control: /* @__PURE__ */ t(
946
- ve,
949
+ Ce,
947
950
  {
948
951
  checked: e.price === "free",
949
952
  size: "small",
950
953
  sx: { "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
951
- onChange: (s) => o(s.target.checked ? "free" : "")
954
+ onChange: (s) => r(s.target.checked ? "free" : "")
952
955
  }
953
956
  ),
954
957
  label: n("blocklet.free")
@@ -959,8 +962,8 @@ function rr() {
959
962
  {
960
963
  value: e.sortBy,
961
964
  options: l,
962
- title: c,
963
- onChange: r,
965
+ title: d,
966
+ onChange: o,
964
967
  icon: null,
965
968
  prepend: null,
966
969
  itemRender: null
@@ -971,17 +974,17 @@ function rr() {
971
974
  }
972
975
  );
973
976
  }
974
- function ye() {
977
+ function be() {
975
978
  const { t: e } = B();
976
- return /* @__PURE__ */ t(Ie, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
979
+ return /* @__PURE__ */ t(Le, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
977
980
  }
978
- function O({ filterTip: e, keywordTip: r }) {
979
- const { t: o, locale: n } = B(), a = () => n === "zh" ? "、" : " , ";
980
- return /* @__PURE__ */ m(Te, { className: "tips", children: [
981
- /* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
982
- e && /* @__PURE__ */ t("span", { children: o("blocklet.filterTip") }),
983
- e && r && a(),
984
- r && /* @__PURE__ */ t("span", { children: o("blocklet.keywordTip") })
981
+ function O({ filterTip: e, keywordTip: o }) {
982
+ const { t: r, locale: n } = B(), a = () => n === "zh" ? "、" : " , ";
983
+ return /* @__PURE__ */ m(Ie, { className: "tips", children: [
984
+ /* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: r("blocklet.emptyTip") }),
985
+ e && /* @__PURE__ */ t("span", { children: r("blocklet.filterTip") }),
986
+ e && o && a(),
987
+ o && /* @__PURE__ */ t("span", { children: r("blocklet.keywordTip") })
985
988
  ] });
986
989
  }
987
990
  O.propTypes = {
@@ -992,16 +995,16 @@ O.defaultProps = {
992
995
  filterTip: !1,
993
996
  keywordTip: !1
994
997
  };
995
- function H({ primaryStart: e, primaryEnd: r, filter: o }) {
996
- return /* @__PURE__ */ m(Ie, { variant: "subtitle2", children: [
998
+ function H({ primaryStart: e, primaryEnd: o, filter: r }) {
999
+ return /* @__PURE__ */ m(Le, { variant: "subtitle2", children: [
997
1000
  /* @__PURE__ */ t("span", { children: e }),
998
1001
  /* @__PURE__ */ m("span", { className: "primary", children: [
999
1002
  " ",
1000
- o,
1003
+ r,
1001
1004
  " "
1002
1005
  ] }),
1003
1006
  /* @__PURE__ */ m("span", { children: [
1004
- r,
1007
+ o,
1005
1008
  " "
1006
1009
  ] })
1007
1010
  ] });
@@ -1011,20 +1014,20 @@ H.propTypes = {
1011
1014
  primaryEnd: i.string.isRequired,
1012
1015
  filter: i.string.isRequired
1013
1016
  };
1014
- function qe({ blocklets: e, ...r }) {
1017
+ function je({ blocklets: e, ...o }) {
1015
1018
  const {
1016
- blockletRender: o,
1019
+ blockletRender: r,
1017
1020
  errors: n,
1018
1021
  loadings: a,
1019
1022
  selectedCategory: l,
1020
- getCategoryLocale: c,
1021
- filters: d,
1023
+ getCategoryLocale: d,
1024
+ filters: u,
1022
1025
  t: s,
1023
1026
  serverVersion: v,
1024
1027
  hasNextPage: f,
1025
1028
  loadMore: y,
1026
- endpoint: u
1027
- } = B(), w = !!l || !!d.price, [k] = Rt({
1029
+ endpoint: c
1030
+ } = B(), w = !!l || !!u.price, [k] = Pt({
1028
1031
  loading: a.fetchBlockletsLoading || a.loadingMore,
1029
1032
  hasNextPage: f,
1030
1033
  onLoadMore: y
@@ -1033,37 +1036,37 @@ function qe({ blocklets: e, ...r }) {
1033
1036
  return /* @__PURE__ */ t(
1034
1037
  Z,
1035
1038
  {
1036
- error: new Error(`Failed to fetch blocklets from ${u}: ${n.fetchBlockletsError.message}`)
1039
+ error: new Error(`Failed to fetch blocklets from ${c}: ${n.fetchBlockletsError.message}`)
1037
1040
  }
1038
1041
  );
1039
1042
  if (a.fetchBlockletsLoading)
1040
- return /* @__PURE__ */ t(Oe, { mt: 15 });
1041
- if (d.keyword && w && e.length === 0)
1043
+ return /* @__PURE__ */ t(qe, { mt: 15 });
1044
+ if (u.keyword && w && e.length === 0)
1042
1045
  return /* @__PURE__ */ m(W, { children: [
1043
1046
  /* @__PURE__ */ t(
1044
1047
  H,
1045
1048
  {
1046
1049
  primaryStart: s("blocklet.noBlockletPart1"),
1047
1050
  primaryEnd: s("blocklet.noBlockletPart2"),
1048
- filter: d.keyword
1051
+ filter: u.keyword
1049
1052
  }
1050
1053
  ),
1051
1054
  /* @__PURE__ */ t(O, { keywordTip: !0, filterTip: !0 })
1052
1055
  ] });
1053
- if (d.keyword && e.length === 0)
1056
+ if (u.keyword && e.length === 0)
1054
1057
  return /* @__PURE__ */ m(W, { children: [
1055
1058
  /* @__PURE__ */ t(
1056
1059
  H,
1057
1060
  {
1058
1061
  primaryStart: s("blocklet.noBlockletPart1"),
1059
1062
  primaryEnd: s("blocklet.noBlockletPart2"),
1060
- filter: d.keyword
1063
+ filter: u.keyword
1061
1064
  }
1062
1065
  ),
1063
1066
  /* @__PURE__ */ t(O, { keywordTip: !0 })
1064
1067
  ] });
1065
1068
  if (w && e.length === 0) {
1066
- const x = c(l);
1069
+ const x = d(l);
1067
1070
  return /* @__PURE__ */ m(W, { children: [
1068
1071
  x ? /* @__PURE__ */ t(
1069
1072
  H,
@@ -1072,19 +1075,19 @@ function qe({ blocklets: e, ...r }) {
1072
1075
  primaryEnd: s("blocklet.noCategoryResults2"),
1073
1076
  filter: x
1074
1077
  }
1075
- ) : /* @__PURE__ */ t(ye, {}),
1078
+ ) : /* @__PURE__ */ t(be, {}),
1076
1079
  /* @__PURE__ */ t(O, { filterTip: !0 })
1077
1080
  ] });
1078
1081
  }
1079
- return e.length === 0 ? /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(ye, {}) }) : /* @__PURE__ */ m(F, { children: [
1080
- /* @__PURE__ */ t(S, { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, p: "2px", ...r, gap: 2, children: e.map((x) => /* @__PURE__ */ t(S, { "data-blocklet-did": x.did, children: o({ blocklet: x, blocklets: e, serverVersion: v }) }, x.did)) }),
1082
+ return e.length === 0 ? /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(be, {}) }) : /* @__PURE__ */ m(F, { children: [
1083
+ /* @__PURE__ */ t(S, { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, p: "2px", ...o, gap: 2, children: e.map((x) => /* @__PURE__ */ t(S, { "data-blocklet-did": x.did, children: r({ blocklet: x, blocklets: e, serverVersion: v }) }, x.did)) }),
1081
1084
  f && /* @__PURE__ */ t(S, { height: 60, display: "flex", justifyContent: "center", py: 2, ref: k, children: /* @__PURE__ */ t(te, {}) })
1082
1085
  ] });
1083
1086
  }
1084
- qe.propTypes = {
1087
+ je.propTypes = {
1085
1088
  blocklets: i.array.isRequired
1086
1089
  };
1087
- const W = D(Bt)`
1090
+ const W = D(Rt)`
1088
1091
  text-align: center;
1089
1092
  margin-top: 100px;
1090
1093
  .primary {
@@ -1094,38 +1097,38 @@ const W = D(Bt)`
1094
1097
  margin-top: ${(e) => e.theme.spacing(1)};
1095
1098
  }
1096
1099
  `;
1097
- function ae({ onSelect: e, wrapChildren: r }) {
1098
- const o = U(null), n = U(null), a = U(null), { storeApi: l, blockletRender: c, filters: d, endpoint: s, handleKeyword: v, t: f, serverVersion: y } = B(), u = async (b) => {
1099
- const { data: h } = await l.get(P.blockletsPath, { params: b }), C = h.dataList || [];
1100
+ function ae({ onSelect: e, wrapChildren: o }) {
1101
+ const r = U(null), n = U(null), a = U(null), { storeApi: l, blockletRender: d, filters: u, endpoint: s, handleKeyword: v, t: f, serverVersion: y } = B(), c = async (b) => {
1102
+ const { data: h } = await l.get(T.blockletsPath, { params: b }), C = h.dataList || [];
1100
1103
  return C.length > 0 && C.unshift({ type: "more-result", total: h.total || 0 }), C;
1101
1104
  }, w = (b) => {
1102
1105
  v(b.state.query), b.setIsOpen(!1);
1103
1106
  }, k = () => {
1104
- o.current && setTimeout(() => {
1105
- const b = o.current.querySelector("input.bl-autocomplete-input");
1107
+ r.current && setTimeout(() => {
1108
+ const b = r.current.querySelector("input.bl-autocomplete-input");
1106
1109
  b && b.focus();
1107
1110
  });
1108
1111
  }, x = (b) => {
1109
1112
  b.setIsOpen(!1), k();
1110
- }, $ = ({ prevState: b, state: h }) => {
1113
+ }, z = ({ prevState: b, state: h }) => {
1111
1114
  b.query !== h.query && (h.query || (v(), k()));
1112
1115
  };
1113
- return Lt(
1116
+ return $t(
1114
1117
  "ctrl + k, command + k",
1115
1118
  (b) => (b.stopPropagation(), b.preventDefault(), k(), !1),
1116
1119
  { enableOnTags: ["INPUT"] }
1117
1120
  ), j(() => {
1118
1121
  k();
1119
1122
  }, [s]), j(() => {
1120
- if (!o.current)
1123
+ if (!r.current)
1121
1124
  return;
1122
- const b = It({
1123
- container: o.current,
1124
- renderer: { createElement: ct, Fragment: dt, render: () => {
1125
+ const b = Lt({
1126
+ container: r.current,
1127
+ renderer: { createElement: dt, Fragment: ut, render: () => {
1125
1128
  } },
1126
1129
  render({ children: h }, C) {
1127
1130
  var _;
1128
- (!n.current || a.current !== C) && (a.current = C, (_ = n.current) == null || _.unmount(), n.current = Tt(C)), n.current.render(r(h));
1131
+ (!n.current || a.current !== C) && (a.current = C, (_ = n.current) == null || _.unmount(), n.current = It(C)), n.current.render(o(h));
1129
1132
  },
1130
1133
  autoFocus: !0,
1131
1134
  openOnFocus: !1,
@@ -1146,10 +1149,10 @@ function ae({ onSelect: e, wrapChildren: r }) {
1146
1149
  },
1147
1150
  placeholder: f("common.searchStore"),
1148
1151
  initialState: {
1149
- query: d.keyword
1152
+ query: u.keyword
1150
1153
  },
1151
1154
  onStateChange(h) {
1152
- $(h);
1155
+ z(h);
1153
1156
  },
1154
1157
  onSubmit: w,
1155
1158
  onReset(h) {
@@ -1157,32 +1160,32 @@ function ae({ onSelect: e, wrapChildren: r }) {
1157
1160
  },
1158
1161
  getSources({ query: h, state: C, ..._ }) {
1159
1162
  const A = {
1160
- sortBy: P.nameDesc,
1163
+ sortBy: T.nameDesc,
1161
1164
  page: 1,
1162
1165
  pageSize: 10,
1163
1166
  keyword: h
1164
1167
  };
1165
- return jt([
1168
+ return Vt([
1166
1169
  {
1167
1170
  sourceId: "blocklets",
1168
1171
  getItems() {
1169
- return u(A);
1172
+ return c(A);
1170
1173
  },
1171
1174
  // 选中后填充 搜索框中值
1172
- getItemInputValue({ item: z }) {
1173
- return z.type === "more-result" ? h : z.title;
1175
+ getItemInputValue({ item: $ }) {
1176
+ return $.type === "more-result" ? h : $.title;
1174
1177
  },
1175
1178
  // 选中或者点击自动完成列表中的 item 时触发
1176
- onSelect({ event: z, item: L }) {
1177
- return L.type === "more-result" ? (_.setIsOpen(!1), v(h)) : z.type === "keydown" ? v(L.title) : e({
1178
- blocklet: L,
1179
- detailUrl: zt(s, "/blocklets", L.did),
1179
+ onSelect({ event: $, item: R }) {
1180
+ return R.type === "more-result" ? (_.setIsOpen(!1), v(h)) : $.type === "keydown" ? v(R.title) : e({
1181
+ blocklet: R,
1182
+ detailUrl: zt(s, "/blocklets", R.did),
1180
1183
  storeUrl: s
1181
1184
  });
1182
1185
  },
1183
1186
  templates: {
1184
- item({ item: z }) {
1185
- return z.type === "more-result" ? /* @__PURE__ */ t("div", { children: f("autocomplete.expandResult", { name: h, number: z.total.toLocaleString() }) }) : c({ blocklet: z, autocompleteSetters: _, serverVersion: y });
1187
+ item({ item: $ }) {
1188
+ return $.type === "more-result" ? /* @__PURE__ */ t("div", { children: f("autocomplete.expandResult", { name: h, number: $.total.toLocaleString() }) }) : d({ blocklet: $, autocompleteSetters: _, serverVersion: y });
1186
1189
  },
1187
1190
  noResults() {
1188
1191
  return f("blocklet.noResults");
@@ -1195,11 +1198,11 @@ function ae({ onSelect: e, wrapChildren: r }) {
1195
1198
  return () => {
1196
1199
  b.destroy();
1197
1200
  };
1198
- }, [d, c]), /* @__PURE__ */ m(F, { children: [
1201
+ }, [u, d]), /* @__PURE__ */ m(F, { children: [
1199
1202
  /* @__PURE__ */ t(
1200
- xe,
1203
+ we,
1201
1204
  {
1202
- styles: (b) => we`
1205
+ styles: (b) => ke`
1203
1206
  .bl-autocomplete-detached-container {
1204
1207
  .bl-autocomplete-detached-cancel {
1205
1208
  white-space: nowrap;
@@ -1214,7 +1217,7 @@ function ae({ onSelect: e, wrapChildren: r }) {
1214
1217
  `
1215
1218
  }
1216
1219
  ),
1217
- /* @__PURE__ */ t("div", { className: "bl-search-container", ref: o })
1220
+ /* @__PURE__ */ t("div", { className: "bl-search-container", ref: r })
1218
1221
  ] });
1219
1222
  }
1220
1223
  ae.propTypes = {
@@ -1224,29 +1227,29 @@ ae.propTypes = {
1224
1227
  ae.defaultProps = {
1225
1228
  wrapChildren: (e) => e
1226
1229
  };
1227
- function ie({ placeholder: e, ...r }) {
1228
- const { filters: o, handleKeyword: n } = B(), [a, l] = q(o.keyword || ""), c = ht(n, { wait: 300 }), d = (v) => {
1230
+ function ie({ placeholder: e, ...o }) {
1231
+ const { filters: r, handleKeyword: n } = B(), [a, l] = q(r.keyword || ""), d = ft(n, { wait: 300 }), u = (v) => {
1229
1232
  const { value: f } = v.target;
1230
- l(f), c.run(f);
1233
+ l(f), d.run(f);
1231
1234
  }, s = () => {
1232
1235
  l(""), n();
1233
1236
  };
1234
1237
  return j(() => {
1235
- l(o.keyword || "");
1236
- }, [o.keyword]), /* @__PURE__ */ t(
1237
- or,
1238
+ l(r.keyword || "");
1239
+ }, [r.keyword]), /* @__PURE__ */ t(
1240
+ lr,
1238
1241
  {
1239
1242
  inputProps: {
1240
1243
  "data-cy": "search-blocklet"
1241
1244
  },
1242
- startAdornment: /* @__PURE__ */ t(me, { position: "start", children: /* @__PURE__ */ t(nr, {}) }),
1243
- onChange: d,
1245
+ startAdornment: /* @__PURE__ */ t(he, { position: "start", children: /* @__PURE__ */ t(ar, {}) }),
1246
+ onChange: u,
1244
1247
  placeholder: e,
1245
1248
  value: a,
1246
1249
  title: e,
1247
1250
  "data-cy": "search",
1248
- endAdornment: a && /* @__PURE__ */ t(me, { position: "end", children: /* @__PURE__ */ t(lr, { "data-cy": "search-delete", onClick: s }) }),
1249
- ...r
1251
+ endAdornment: a && /* @__PURE__ */ t(he, { position: "end", children: /* @__PURE__ */ t(ir, { "data-cy": "search-delete", onClick: s }) }),
1252
+ ...o
1250
1253
  }
1251
1254
  );
1252
1255
  }
@@ -1256,7 +1259,7 @@ ie.propTypes = {
1256
1259
  ie.defaultProps = {
1257
1260
  placeholder: "Type to search..."
1258
1261
  };
1259
- const or = D(nt)`
1262
+ const lr = D(lt)`
1260
1263
  background-color: ${(e) => e.theme.palette.grey[50]};
1261
1264
  font-size: 14px;
1262
1265
  border-radius: 6px;
@@ -1273,21 +1276,21 @@ const or = D(nt)`
1273
1276
  color: transparent;
1274
1277
  }
1275
1278
  }
1276
- `, nr = D($t)`
1279
+ `, ar = D(_t)`
1277
1280
  color: ${(e) => e.theme.palette.grey[500]};
1278
1281
  font-size: 28px;
1279
1282
  @media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
1280
1283
  font-size: 24px;
1281
1284
  }
1282
- `, lr = D(Se)`
1285
+ `, ir = D(Be)`
1283
1286
  color: ${(e) => e.theme.palette.grey[500]};
1284
1287
  font-size: 16px;
1285
1288
  cursor: pointer;
1286
1289
  `;
1287
- function ar() {
1288
- const { filters: e, handleSearchSelect: r, t: o, wrapChildren: n, baseSearch: a } = B(), { toggleOpen: l } = oe(), c = !!e.keyword;
1290
+ function sr() {
1291
+ const { filters: e, handleSearchSelect: o, t: r, wrapChildren: n, baseSearch: a } = B(), { toggleOpen: l } = oe(), d = !!e.keyword;
1289
1292
  return /* @__PURE__ */ m(
1290
- T,
1293
+ I,
1291
1294
  {
1292
1295
  direction: "row",
1293
1296
  alignItems: "center",
@@ -1301,66 +1304,66 @@ function ar() {
1301
1304
  /* @__PURE__ */ t(
1302
1305
  G,
1303
1306
  {
1304
- xs: !c && /* @__PURE__ */ t(Ee, { onClick: () => l(!0), children: /* @__PURE__ */ t(Pt, {}) }),
1305
- md: /* @__PURE__ */ t(I, { variant: "h1", children: o("common.title") })
1307
+ xs: !d && /* @__PURE__ */ t(Me, { onClick: () => l(!0), children: /* @__PURE__ */ t(Tt, {}) }),
1308
+ md: /* @__PURE__ */ t(L, { variant: "h1", children: r("common.title") })
1306
1309
  }
1307
1310
  ),
1308
1311
  /* @__PURE__ */ t(
1309
1312
  S,
1310
1313
  {
1311
- width: { xs: c ? "100%" : 300, md: 300 },
1314
+ width: { xs: d ? "100%" : 300, md: 300 },
1312
1315
  className: "filter-bar",
1313
1316
  sx: {
1314
1317
  "& .bl-autocomplete-form": { borderRadius: 2 },
1315
1318
  "& .aa-SubmitButton, & .aa-LoadingIndicator": { width: "auto", pl: 1.5, pr: 1 },
1316
1319
  "& .aa-SubmitIcon, & .aa-LoadingIcon": { height: 16, width: 16 }
1317
1320
  },
1318
- children: a ? /* @__PURE__ */ t(ie, { className: "bl-search-container", placeholder: o("common.searchStore"), sx: { pl: 1.5 } }) : /* @__PURE__ */ t(ae, { onSelect: r, wrapChildren: n })
1321
+ children: a ? /* @__PURE__ */ t(ie, { className: "bl-search-container", placeholder: r("common.searchStore"), sx: { pl: 1.5 } }) : /* @__PURE__ */ t(ae, { onSelect: o, wrapChildren: n })
1319
1322
  }
1320
1323
  )
1321
1324
  ]
1322
1325
  }
1323
1326
  );
1324
1327
  }
1325
- function ir() {
1326
- const { blockletList: e, filters: r, t: o } = B(), n = r.category || r.keyword || r.price;
1327
- return /* @__PURE__ */ t(_t, { children: /* @__PURE__ */ m(lt, { FallbackComponent: Z, children: [
1328
- /* @__PURE__ */ t(ar, {}),
1328
+ function cr() {
1329
+ const { blockletList: e, total: o, filters: r, t: n } = B(), a = r.category || r.keyword || r.price;
1330
+ return /* @__PURE__ */ t(At, { children: /* @__PURE__ */ m(at, { FallbackComponent: Z, children: [
1331
+ /* @__PURE__ */ t(sr, {}),
1329
1332
  /* @__PURE__ */ m(S, { display: "flex", height: "100%", children: [
1330
- /* @__PURE__ */ t(Jt, {}),
1331
- /* @__PURE__ */ t(T, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: n ? /* @__PURE__ */ m(F, { children: [
1333
+ /* @__PURE__ */ t(Kt, {}),
1334
+ /* @__PURE__ */ t(I, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: a ? /* @__PURE__ */ m(F, { children: [
1332
1335
  r.keyword ? /* @__PURE__ */ m(F, { children: [
1333
- /* @__PURE__ */ t(G, { xs: /* @__PURE__ */ t(Me, {}), md: null }),
1334
- a()
1335
- ] }) : /* @__PURE__ */ t(rr, {}),
1336
- /* @__PURE__ */ t(qe, { blocklets: e, height: "100%" })
1337
- ] }) : /* @__PURE__ */ t(tr, {}) })
1336
+ /* @__PURE__ */ t(G, { xs: /* @__PURE__ */ t(Ne, {}), md: null }),
1337
+ l()
1338
+ ] }) : /* @__PURE__ */ t(nr, {}),
1339
+ /* @__PURE__ */ t(je, { blocklets: e, height: "100%" })
1340
+ ] }) : /* @__PURE__ */ t(or, {}) })
1338
1341
  ] })
1339
1342
  ] }) });
1340
- function a() {
1341
- return /* @__PURE__ */ m(T, { direction: "row", alignItems: "center", justifyContent: "space-between", mb: 2, mt: { xs: 2, md: 0 }, children: [
1342
- /* @__PURE__ */ t(I, { variant: "h3", children: o("blocklet.search", { keyword: r.keyword }) }),
1343
- /* @__PURE__ */ t(I, { variant: "body1", color: "text.lighter", fontSize: 13, children: o("blocklet.resultCount", { count: e.length }) })
1343
+ function l() {
1344
+ return /* @__PURE__ */ m(I, { direction: "row", alignItems: "center", justifyContent: "space-between", mb: 2, mt: { xs: 2, md: 0 }, children: [
1345
+ /* @__PURE__ */ t(L, { variant: "h3", children: n("blocklet.search", { keyword: r.keyword }) }),
1346
+ /* @__PURE__ */ t(L, { variant: "body1", color: "text.lighter", fontSize: 13, children: n("blocklet.resultCount", { count: o }) })
1344
1347
  ] });
1345
1348
  }
1346
1349
  }
1347
- function je(e) {
1348
- const r = be(), o = Ot(r.palette.primary.main), n = {
1349
- autocomplete: we`
1350
+ function Ve(e) {
1351
+ const o = xe(), r = qt(o.palette.primary.main), n = {
1352
+ autocomplete: ke`
1350
1353
  :root {
1351
- --aa-detached-media-query: (max-width: ${r.breakpoints.values.md}px) !important;
1352
- --aa-detached-modal-media-query: (min-width: ${r.breakpoints.values.md}px) !important;
1353
- --aa-detached-modal-max-width: ${r.breakpoints.values.md}px !important;
1354
- --aa-selected-color-rgb: ${o.r}, ${o.g}, ${o.b} !important;
1355
- --aa-primary-color-rgb: ${o.r}, ${o.g}, ${o.b} !important;
1354
+ --aa-detached-media-query: (max-width: ${o.breakpoints.values.md}px) !important;
1355
+ --aa-detached-modal-media-query: (min-width: ${o.breakpoints.values.md}px) !important;
1356
+ --aa-detached-modal-max-width: ${o.breakpoints.values.md}px !important;
1357
+ --aa-selected-color-rgb: ${r.r}, ${r.g}, ${r.b} !important;
1358
+ --aa-primary-color-rgb: ${r.r}, ${r.g}, ${r.b} !important;
1356
1359
  --aa-input-background-color-rgb: 250, 250, 250 !important;
1357
1360
  }
1358
1361
  .bl-autocomplete-panel {
1359
- z-index: ${r.zIndex.modal};
1362
+ z-index: ${o.zIndex.modal};
1360
1363
  }
1361
1364
  .bl-autocomplete-label {
1362
1365
  .aa-SubmitIcon {
1363
- color: ${r.palette.grey[500]} !important;
1366
+ color: ${o.palette.grey[500]} !important;
1364
1367
  }
1365
1368
  }
1366
1369
  .bl-autocomplete-form {
@@ -1376,21 +1379,21 @@ function je(e) {
1376
1379
  box-shadow: none !important;
1377
1380
  }
1378
1381
  .aa-SubmitIcon {
1379
- color: ${r.palette.grey[500]} !important;
1382
+ color: ${o.palette.grey[500]} !important;
1380
1383
  }
1381
1384
  }
1382
1385
  .aa-Panel .arcblock-blocklet button {
1383
- border: 1px solid rgba(${o.r}, ${o.g}, ${o.b}, 0.5);
1386
+ border: 1px solid rgba(${r.r}, ${r.g}, ${r.b}, 0.5);
1384
1387
  }
1385
1388
  `
1386
1389
  };
1387
1390
  return /* @__PURE__ */ m(ne, { ...e, children: [
1388
- /* @__PURE__ */ t(xe, { styles: n.autocomplete }),
1389
- /* @__PURE__ */ t(ir, {})
1391
+ /* @__PURE__ */ t(we, { styles: n.autocomplete }),
1392
+ /* @__PURE__ */ t(cr, {})
1390
1393
  ] });
1391
1394
  }
1392
- je.propTypes = ze;
1393
- je.defaultProps = $e;
1395
+ Ve.propTypes = ze;
1396
+ Ve.defaultProps = _e;
1394
1397
  export {
1395
- je as default
1398
+ Ve as default
1396
1399
  };