@fluid-app/portal-sdk 0.1.244 → 0.1.246

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 (115) hide show
  1. package/dist/{AppDownloadScreen-DQR40F0y.mjs → AppDownloadScreen-DPnbWP5G.mjs} +1 -1
  2. package/dist/{AppDownloadScreen-DQR40F0y.mjs.map → AppDownloadScreen-DPnbWP5G.mjs.map} +1 -1
  3. package/dist/{AppDownloadScreen-BXnl23_d.cjs → AppDownloadScreen-Og_iMsw5.cjs} +1 -1
  4. package/dist/{AppDownloadScreen-BXnl23_d.cjs.map → AppDownloadScreen-Og_iMsw5.cjs.map} +1 -1
  5. package/dist/{AppNavigationContext-C1-hd9Rw.cjs → AppNavigationContext-BDs1cOuG.cjs} +1 -1
  6. package/dist/{AppNavigationContext-C1-hd9Rw.cjs.map → AppNavigationContext-BDs1cOuG.cjs.map} +1 -1
  7. package/dist/{AppNavigationContext-Dvc0yoZF.mjs → AppNavigationContext-DNod9mf6.mjs} +1 -1
  8. package/dist/{AppNavigationContext-Dvc0yoZF.mjs.map → AppNavigationContext-DNod9mf6.mjs.map} +1 -1
  9. package/dist/{ContactsScreen-Cj0_VI0d.cjs → ContactsScreen-CZ2hrMqf.cjs} +6 -6
  10. package/dist/{ContactsScreen-Cj0_VI0d.cjs.map → ContactsScreen-CZ2hrMqf.cjs.map} +1 -1
  11. package/dist/{ContactsScreen-CMBERzKU.mjs → ContactsScreen-DuhDzRtI.mjs} +6 -6
  12. package/dist/{ContactsScreen-CMBERzKU.mjs.map → ContactsScreen-DuhDzRtI.mjs.map} +1 -1
  13. package/dist/{ContactsScreen-CH_P8WxC.cjs → ContactsScreen-Dv1SJNBo.cjs} +5 -5
  14. package/dist/{InfiniteScrollSentinel-DeIL8UkW.cjs → InfiniteScrollSentinel-BaPx1tjC.cjs} +1 -1
  15. package/dist/{InfiniteScrollSentinel-DeIL8UkW.cjs.map → InfiniteScrollSentinel-BaPx1tjC.cjs.map} +1 -1
  16. package/dist/{InfiniteScrollSentinel-B_clNL9Y.mjs → InfiniteScrollSentinel-D0XRJi51.mjs} +1 -1
  17. package/dist/{InfiniteScrollSentinel-B_clNL9Y.mjs.map → InfiniteScrollSentinel-D0XRJi51.mjs.map} +1 -1
  18. package/dist/{MessagingScreen-KYx6DSMx.cjs → MessagingScreen-BwI0RShj.cjs} +3 -3
  19. package/dist/{MessagingScreen-vb5P-7jP.mjs → MessagingScreen-DiSZ7fyd.mjs} +3 -3
  20. package/dist/{MessagingScreen-vb5P-7jP.mjs.map → MessagingScreen-DiSZ7fyd.mjs.map} +1 -1
  21. package/dist/{MessagingScreen-CCbgNRp1.cjs → MessagingScreen-WCeHWGlX.cjs} +5 -5
  22. package/dist/{MessagingScreen-CCbgNRp1.cjs.map → MessagingScreen-WCeHWGlX.cjs.map} +1 -1
  23. package/dist/{MySiteScreen-B_16cPgD.cjs → MySiteScreen-Bdd7a6Hy.cjs} +3 -2
  24. package/dist/MySiteScreen-CK84vXa9.mjs +301 -0
  25. package/dist/MySiteScreen-CK84vXa9.mjs.map +1 -0
  26. package/dist/MySiteScreen-zfajm9da.cjs +309 -0
  27. package/dist/MySiteScreen-zfajm9da.cjs.map +1 -0
  28. package/dist/{OrdersScreen-CQGCZLYf.cjs → OrdersScreen-BLs1xTv7.cjs} +4 -4
  29. package/dist/{OrdersScreen-BxaJw-Kq.cjs → OrdersScreen-BbS7Alby.cjs} +3 -3
  30. package/dist/{OrdersScreen-BxaJw-Kq.cjs.map → OrdersScreen-BbS7Alby.cjs.map} +1 -1
  31. package/dist/{OrdersScreen-CPKRShbP.mjs → OrdersScreen-b-ZC4_NI.mjs} +3 -3
  32. package/dist/{OrdersScreen-CPKRShbP.mjs.map → OrdersScreen-b-ZC4_NI.mjs.map} +1 -1
  33. package/dist/{PortalProductsApiProvider-BIZg_c4Y.mjs → PortalProductsApiProvider-BFdHFvog.mjs} +1 -1
  34. package/dist/{PortalProductsApiProvider-BIZg_c4Y.mjs.map → PortalProductsApiProvider-BFdHFvog.mjs.map} +1 -1
  35. package/dist/{PortalProductsApiProvider-DL8nl7To.cjs → PortalProductsApiProvider-CkS7OIGt.cjs} +1 -1
  36. package/dist/{PortalProductsApiProvider-DL8nl7To.cjs.map → PortalProductsApiProvider-CkS7OIGt.cjs.map} +1 -1
  37. package/dist/{ProfileScreen-BT0iys-q.cjs → ProfileScreen-BfvdQa0q.cjs} +114 -33
  38. package/dist/ProfileScreen-BfvdQa0q.cjs.map +1 -0
  39. package/dist/{ProfileScreen-CZAIUM2a.mjs → ProfileScreen-CRLf8oDe.mjs} +116 -35
  40. package/dist/ProfileScreen-CRLf8oDe.mjs.map +1 -0
  41. package/dist/{ProfileScreen-CKcdtroU.cjs → ProfileScreen-Za3ZIWPO.cjs} +4 -2
  42. package/dist/{SearchSort-CeJqRK2c.cjs → SearchSort-BP2ktxyN.cjs} +1 -1
  43. package/dist/{SearchSort-CeJqRK2c.cjs.map → SearchSort-BP2ktxyN.cjs.map} +1 -1
  44. package/dist/{SearchSort-CFHU38Er.mjs → SearchSort-CokMCrhy.mjs} +1 -1
  45. package/dist/{SearchSort-CFHU38Er.mjs.map → SearchSort-CokMCrhy.mjs.map} +1 -1
  46. package/dist/{ShareablesScreen-sieWBlAl.mjs → ShareablesScreen-BZZ-RT71.mjs} +8 -8
  47. package/dist/{ShareablesScreen-sieWBlAl.mjs.map → ShareablesScreen-BZZ-RT71.mjs.map} +1 -1
  48. package/dist/{ShareablesScreen-A69L0Nok.cjs → ShareablesScreen-BxOKbuuU.cjs} +20 -20
  49. package/dist/{ShareablesScreen-A69L0Nok.cjs.map → ShareablesScreen-BxOKbuuU.cjs.map} +1 -1
  50. package/dist/{ShareablesScreen-BUYG-mjj.cjs → ShareablesScreen-CsDxLODp.cjs} +7 -7
  51. package/dist/{ShopScreen-sLUTgIcQ.mjs → ShopScreen-BG1pxd2D.mjs} +4 -4
  52. package/dist/{ShopScreen-sLUTgIcQ.mjs.map → ShopScreen-BG1pxd2D.mjs.map} +1 -1
  53. package/dist/{ShopScreen-DVpCo-OV.cjs → ShopScreen-BigHJ5wE.cjs} +3 -3
  54. package/dist/{ShopScreen-Dm85_rMp.cjs → ShopScreen-S6rBaoWM.cjs} +4 -4
  55. package/dist/{ShopScreen-Dm85_rMp.cjs.map → ShopScreen-S6rBaoWM.cjs.map} +1 -1
  56. package/dist/{SubscriptionsScreen-DrDSwMXS.cjs → SubscriptionsScreen-B88_dLfE.cjs} +9 -9
  57. package/dist/{SubscriptionsScreen-DrDSwMXS.cjs.map → SubscriptionsScreen-B88_dLfE.cjs.map} +1 -1
  58. package/dist/{SubscriptionsScreen-CXM2zmF7.mjs → SubscriptionsScreen-DK9-h3Cz.mjs} +8 -8
  59. package/dist/{SubscriptionsScreen-CXM2zmF7.mjs.map → SubscriptionsScreen-DK9-h3Cz.mjs.map} +1 -1
  60. package/dist/{SubscriptionsScreen-t5wtDGfB.cjs → SubscriptionsScreen-dhnfYn4L.cjs} +5 -5
  61. package/dist/{UpgradeScreen-DUvg-WZv.cjs → UpgradeScreen-Bl9lb32K.cjs} +1 -1
  62. package/dist/{UpgradeScreen-DAKe_hiv.cjs → UpgradeScreen-C-hFDAR2.cjs} +1 -1
  63. package/dist/{UpgradeScreen-DAKe_hiv.cjs.map → UpgradeScreen-C-hFDAR2.cjs.map} +1 -1
  64. package/dist/{UpgradeScreen-DnGnWVTf.mjs → UpgradeScreen-X6j0_625.mjs} +1 -1
  65. package/dist/{UpgradeScreen-DnGnWVTf.mjs.map → UpgradeScreen-X6j0_625.mjs.map} +1 -1
  66. package/dist/{MySiteScreen-CUyJteDm.cjs → components-BKADyCYp.cjs} +42 -466
  67. package/dist/components-BKADyCYp.cjs.map +1 -0
  68. package/dist/{MySiteScreen-CN0ZDBgy.mjs → components-CjgEvBYG.mjs} +6 -470
  69. package/dist/components-CjgEvBYG.mjs.map +1 -0
  70. package/dist/{dist-PbA1vxAz.mjs → dist-BstXVe25.mjs} +1 -1
  71. package/dist/{dist-PbA1vxAz.mjs.map → dist-BstXVe25.mjs.map} +1 -1
  72. package/dist/{dist-o2cjwzIa.mjs → dist-CTLDCXCc.mjs} +2 -2
  73. package/dist/{dist-o2cjwzIa.mjs.map → dist-CTLDCXCc.mjs.map} +1 -1
  74. package/dist/{dist-BQZkLGL6.cjs → dist-DJAHGHHi.cjs} +1 -19
  75. package/dist/{dist-BQZkLGL6.cjs.map → dist-DJAHGHHi.cjs.map} +1 -1
  76. package/dist/{dist-DbRTQ2QF.cjs → dist-D_3_ZuC5.cjs} +1 -1
  77. package/dist/{dist-DbRTQ2QF.cjs.map → dist-D_3_ZuC5.cjs.map} +1 -1
  78. package/dist/{dist-myuZC8sf.cjs → dist-vhBaFZ9L.cjs} +2 -2
  79. package/dist/{dist-myuZC8sf.cjs.map → dist-vhBaFZ9L.cjs.map} +1 -1
  80. package/dist/{es-UfEBhcZD.cjs → es-B5heQ57j.cjs} +1 -1
  81. package/dist/{es-UfEBhcZD.cjs.map → es-B5heQ57j.cjs.map} +1 -1
  82. package/dist/{fluid-pay-api-adapter-eNT8m0xB.mjs → fluid-pay-api-adapter-CJ7-I8k-.mjs} +673 -381
  83. package/dist/fluid-pay-api-adapter-CJ7-I8k-.mjs.map +1 -0
  84. package/dist/{fluid-pay-api-adapter-BszgrFL6.cjs → fluid-pay-api-adapter-D63KLi5c.cjs} +700 -378
  85. package/dist/fluid-pay-api-adapter-D63KLi5c.cjs.map +1 -0
  86. package/dist/{format-CytB2M00.cjs → format-CLUjV1oR.cjs} +1 -1
  87. package/dist/{format-CytB2M00.cjs.map → format-CLUjV1oR.cjs.map} +1 -1
  88. package/dist/index.cjs +123 -172
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts.map +1 -1
  91. package/dist/index.d.mts.map +1 -1
  92. package/dist/index.mjs +122 -171
  93. package/dist/index.mjs.map +1 -1
  94. package/dist/{order-status-badge-DHyaK6mU.cjs → order-status-badge-BKvLeVsM.cjs} +3 -3
  95. package/dist/{order-status-badge-DHyaK6mU.cjs.map → order-status-badge-BKvLeVsM.cjs.map} +1 -1
  96. package/dist/{order-status-badge-Dmo8lLnt.mjs → order-status-badge-xuJ732eH.mjs} +3 -3
  97. package/dist/{order-status-badge-Dmo8lLnt.mjs.map → order-status-badge-xuJ732eH.mjs.map} +1 -1
  98. package/dist/{query-keys-oQKvV4jp.mjs → query-keys-8SVs82aF.mjs} +1 -1
  99. package/dist/{query-keys-elu0svUd.cjs.map → query-keys-8SVs82aF.mjs.map} +1 -1
  100. package/dist/{query-keys-elu0svUd.cjs → query-keys-e9EEoWxN.cjs} +1 -1
  101. package/dist/{query-keys-oQKvV4jp.mjs.map → query-keys-e9EEoWxN.cjs.map} +1 -1
  102. package/dist/{sortable.esm-C8G00cCP.mjs → sortable.esm-C8riJ_zv.mjs} +2 -14
  103. package/dist/{sortable.esm-C8G00cCP.mjs.map → sortable.esm-C8riJ_zv.mjs.map} +1 -1
  104. package/dist/{use-account-C1X-VLY-.cjs → use-account-D6Z9hkDX.cjs} +2 -2
  105. package/dist/{use-account-C1X-VLY-.cjs.map → use-account-D6Z9hkDX.cjs.map} +1 -1
  106. package/dist/{use-account-C76sphlu.mjs → use-account-DsTz5BlS.mjs} +2 -2
  107. package/dist/{use-account-C76sphlu.mjs.map → use-account-DsTz5BlS.mjs.map} +1 -1
  108. package/package.json +18 -17
  109. package/styles/packages.css +1 -0
  110. package/dist/MySiteScreen-CN0ZDBgy.mjs.map +0 -1
  111. package/dist/MySiteScreen-CUyJteDm.cjs.map +0 -1
  112. package/dist/ProfileScreen-BT0iys-q.cjs.map +0 -1
  113. package/dist/ProfileScreen-CZAIUM2a.mjs.map +0 -1
  114. package/dist/fluid-pay-api-adapter-BszgrFL6.cjs.map +0 -1
  115. package/dist/fluid-pay-api-adapter-eNT8m0xB.mjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -46,27 +46,28 @@ const require_VideoWidget = require("./VideoWidget-CDcV0J5W.cjs");
46
46
  const require_ScreenHeaderContext = require("./ScreenHeaderContext-oIu5Bvhs.cjs");
47
47
  const require_use_store = require("./use-store-D2S1FywW.cjs");
48
48
  const require_CustomersScreen = require("./CustomersScreen-DW3BuhBs.cjs");
49
- const require_AppNavigationContext = require("./AppNavigationContext-C1-hd9Rw.cjs");
50
- const require_use_account = require("./use-account-C1X-VLY-.cjs");
51
- const require_MessagingScreen = require("./MessagingScreen-CCbgNRp1.cjs");
52
- require("./fluid-pay-api-adapter-BszgrFL6.cjs");
53
- const require_ProfileScreen = require("./ProfileScreen-BT0iys-q.cjs");
54
- const require_SubscriptionsScreen = require("./SubscriptionsScreen-DrDSwMXS.cjs");
55
- require("./dist-DbRTQ2QF.cjs");
56
- require("./es-UfEBhcZD.cjs");
57
- const require_ContactsScreen = require("./ContactsScreen-Cj0_VI0d.cjs");
58
- require("./SearchSort-CeJqRK2c.cjs");
59
- require("./InfiniteScrollSentinel-DeIL8UkW.cjs");
60
- require("./dist-myuZC8sf.cjs");
61
- require("./order-status-badge-DHyaK6mU.cjs");
62
- const require_OrdersScreen = require("./OrdersScreen-BxaJw-Kq.cjs");
63
- require("./dist-BQZkLGL6.cjs");
64
- const require_MySiteScreen = require("./MySiteScreen-CUyJteDm.cjs");
65
- const require_ShareablesScreen = require("./ShareablesScreen-A69L0Nok.cjs");
66
- require("./PortalProductsApiProvider-DL8nl7To.cjs");
67
- const require_ShopScreen = require("./ShopScreen-Dm85_rMp.cjs");
68
- require("./UpgradeScreen-DAKe_hiv.cjs");
69
- require("./AppDownloadScreen-BXnl23_d.cjs");
49
+ const require_use_account = require("./use-account-D6Z9hkDX.cjs");
50
+ const require_AppNavigationContext = require("./AppNavigationContext-BDs1cOuG.cjs");
51
+ const require_MessagingScreen = require("./MessagingScreen-WCeHWGlX.cjs");
52
+ require("./fluid-pay-api-adapter-D63KLi5c.cjs");
53
+ require("./dist-DJAHGHHi.cjs");
54
+ require("./components-BKADyCYp.cjs");
55
+ const require_ProfileScreen = require("./ProfileScreen-BfvdQa0q.cjs");
56
+ const require_SubscriptionsScreen = require("./SubscriptionsScreen-B88_dLfE.cjs");
57
+ require("./dist-D_3_ZuC5.cjs");
58
+ require("./es-B5heQ57j.cjs");
59
+ const require_ContactsScreen = require("./ContactsScreen-CZ2hrMqf.cjs");
60
+ require("./SearchSort-BP2ktxyN.cjs");
61
+ require("./InfiniteScrollSentinel-BaPx1tjC.cjs");
62
+ require("./dist-vhBaFZ9L.cjs");
63
+ require("./order-status-badge-BKvLeVsM.cjs");
64
+ const require_OrdersScreen = require("./OrdersScreen-BbS7Alby.cjs");
65
+ const require_MySiteScreen = require("./MySiteScreen-zfajm9da.cjs");
66
+ const require_ShareablesScreen = require("./ShareablesScreen-BxOKbuuU.cjs");
67
+ require("./PortalProductsApiProvider-CkS7OIGt.cjs");
68
+ const require_ShopScreen = require("./ShopScreen-S6rBaoWM.cjs");
69
+ require("./UpgradeScreen-C-hFDAR2.cjs");
70
+ require("./AppDownloadScreen-Og_iMsw5.cjs");
70
71
  let react = require("react");
71
72
  react = require_chunk.__toESM(react);
72
73
  let _tanstack_react_query = require("@tanstack/react-query");
@@ -1169,7 +1170,7 @@ function ScreenHeader({ title }) {
1169
1170
  }
1170
1171
  //#endregion
1171
1172
  //#region ../react/src/components/RepIcon.tsx
1172
- const ICON_MAP$1 = {
1173
+ const ICON_MAP = {
1173
1174
  "address-card": lucide_react.ContactRound,
1174
1175
  "arrows-repeat": lucide_react.Repeat,
1175
1176
  bell: lucide_react.Bell,
@@ -1205,7 +1206,7 @@ const ICON_MAP$1 = {
1205
1206
  users: lucide_react.Users
1206
1207
  };
1207
1208
  function RepIcon({ name, className }) {
1208
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ICON_MAP$1[name] ?? lucide_react.File, { className });
1209
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ICON_MAP[name] ?? lucide_react.File, { className });
1209
1210
  }
1210
1211
  //#endregion
1211
1212
  //#region ../core/src/navigation/navigation-storage.ts
@@ -1866,18 +1867,67 @@ function SdkCompanySwitcher() {
1866
1867
  });
1867
1868
  }
1868
1869
  //#endregion
1869
- //#region ../core/src/navigation/account-manage.ts
1870
- const ACCOUNT_MANAGE_SLUGS = [
1871
- "profile",
1872
- "orders",
1873
- "subscriptions"
1874
- ];
1875
- /** Account manage tabs with labels derived from SYSTEM_NAVIGATION_ITEMS. */
1876
- const ACCOUNT_MANAGE_TABS = ACCOUNT_MANAGE_SLUGS.map((slug) => ({
1877
- key: slug,
1878
- label: SYSTEM_NAVIGATION_ITEMS[slug].label,
1879
- slug
1880
- }));
1870
+ //#region ../core/src/navigation/slug-utils.ts
1871
+ /**
1872
+ * Extract all slugs from a navigation tree, sorted by segment count descending.
1873
+ * Longest slugs first enables greedy prefix matching (e.g. "share/playlists"
1874
+ * is checked before "share").
1875
+ */
1876
+ function collectNavSlugs(items) {
1877
+ const slugs = [];
1878
+ for (const item of items) {
1879
+ if (item.slug) slugs.push(normalizeSlug(item.slug));
1880
+ for (const child of item.children ?? []) if (child.slug) slugs.push(normalizeSlug(child.slug));
1881
+ }
1882
+ return [...slugs].sort((a, b) => b.split("/").length - a.split("/").length);
1883
+ }
1884
+ /**
1885
+ * Find the longest registered nav slug that is a prefix of `fullSlug`.
1886
+ * Uses segment-boundary checking to prevent "shop" from matching "shopping".
1887
+ */
1888
+ function matchSlugPrefix(fullSlug, navSlugs) {
1889
+ const normalized = normalizeSlug(fullSlug);
1890
+ if (!normalized) return void 0;
1891
+ for (const navSlug of navSlugs) {
1892
+ if (normalized === navSlug) return {
1893
+ matchedSlug: navSlug,
1894
+ rest: ""
1895
+ };
1896
+ if (normalized.startsWith(navSlug + "/")) return {
1897
+ matchedSlug: navSlug,
1898
+ rest: normalized.slice(navSlug.length + 1)
1899
+ };
1900
+ }
1901
+ }
1902
+ /**
1903
+ * Extract the slug portion from a full pathname by stripping the basePath prefix.
1904
+ * Returns an empty string when the pathname equals the basePath exactly.
1905
+ *
1906
+ * Examples:
1907
+ * extractSlugFromPathname("/contacts/123", "/") → "contacts/123"
1908
+ * extractSlugFromPathname("/portal/contacts", "/portal") → "contacts"
1909
+ * extractSlugFromPathname("/portal", "/portal") → ""
1910
+ * extractSlugFromPathname("/", "/") → ""
1911
+ */
1912
+ function extractSlugFromPathname(pathname, basePath) {
1913
+ if (basePath === "/") return pathname.replace(/^\//, "");
1914
+ if (pathname.startsWith(basePath)) return pathname.slice(basePath.length).replace(/^\//, "");
1915
+ return pathname.replace(/^\//, "");
1916
+ }
1917
+ /**
1918
+ * Generate a URL-safe slug from a human-readable name. Mirrors the admin
1919
+ * builder's `generateSlugFromName` so a navigation item authored as
1920
+ * `slugifyName(screen.name)` can be matched back to the screen at runtime
1921
+ * even when the screen's own `slug` is opaque (e.g. `screen-{uuid}`).
1922
+ */
1923
+ function slugifyName(name) {
1924
+ return name.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
1925
+ }
1926
+ function isSlugInSection(item, currentSlug, navSlugs) {
1927
+ const baseSlug = matchSlugPrefix(currentSlug, navSlugs)?.matchedSlug ?? normalizeSlug(currentSlug);
1928
+ if (normalizeSlug(item.slug) === baseSlug) return true;
1929
+ return item.children?.some((child) => normalizeSlug(child.slug) === baseSlug) ?? false;
1930
+ }
1881
1931
  //#endregion
1882
1932
  //#region src/shell/go-back-or-home.ts
1883
1933
  /**
@@ -2025,66 +2075,18 @@ function BuilderScreenViewImpl({ screen, className }) {
2025
2075
  }
2026
2076
  const BuilderScreenView = (0, react.memo)(BuilderScreenViewImpl);
2027
2077
  //#endregion
2028
- //#region src/account/account-management-layout.tsx
2029
- const ICON_MAP = {
2030
- profile: lucide_react.User,
2031
- orders: lucide_react.PackageOpen,
2032
- subscriptions: lucide_react.Repeat
2033
- };
2034
- const NAV_ITEMS = ACCOUNT_MANAGE_TABS.map((tab) => ({
2035
- ...tab,
2036
- icon: ICON_MAP[tab.key]
2037
- }));
2038
- function getActiveTab(slug) {
2039
- const root = slug.split("/")[0];
2040
- if (root === "orders") return "orders";
2041
- if (root === "subscriptions") return "subscriptions";
2042
- return "profile";
2043
- }
2044
- function AccountManageLayout({ children }) {
2045
- const { currentSlug, navigate } = require_AppNavigationContext.useAppNavigation();
2046
- const activeTab = getActiveTab(currentSlug);
2047
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2048
- className: "flex flex-col md:flex-row",
2049
- children: [
2050
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
2051
- className: "flex gap-1 overflow-x-auto border-b px-4 py-2 md:hidden",
2052
- children: NAV_ITEMS.map(({ key, slug, label, icon: Icon }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
2053
- type: "button",
2054
- onClick: () => navigate(slug),
2055
- className: `flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium whitespace-nowrap ${activeTab === key ? "bg-sidebar-primary text-sidebar-primary-foreground" : "hover:bg-sidebar-primary hover:text-sidebar-primary-foreground"}`,
2056
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { className: "h-4 w-4" }), label]
2057
- }, key))
2058
- }),
2059
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("nav", {
2060
- className: "hidden w-48 shrink-0 flex-col gap-1 p-4 md:flex",
2061
- children: NAV_ITEMS.map(({ key, slug, label, icon: Icon }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
2062
- type: "button",
2063
- onClick: () => navigate(slug),
2064
- className: `flex items-center gap-2 rounded-md px-3 py-2 text-left text-sm font-medium ${activeTab === key ? "bg-sidebar-primary text-sidebar-primary-foreground" : "hover:bg-sidebar-primary hover:text-sidebar-primary-foreground"}`,
2065
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { className: "h-4 w-4" }), label]
2066
- }, key))
2067
- }),
2068
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2069
- className: "min-w-0 flex-1",
2070
- children
2071
- })
2072
- ]
2073
- });
2074
- }
2075
- //#endregion
2076
2078
  //#region src/shell/system-screen-map.ts
2077
- const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-CKcdtroU.cjs")).then((m) => ({ default: m.ProfileScreen })));
2078
- const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-CQGCZLYf.cjs")).then((m) => ({ default: m.OrdersScreen })));
2079
- const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-t5wtDGfB.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
2080
- const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-KYx6DSMx.cjs")).then((m) => ({ default: m.MessagingScreen })));
2081
- const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-CH_P8WxC.cjs")).then((m) => ({ default: m.ContactsScreen })));
2082
- const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-DVpCo-OV.cjs")).then((m) => ({ default: m.ShopScreen })));
2079
+ const ProfileScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ProfileScreen-Za3ZIWPO.cjs")).then((m) => ({ default: m.ProfileScreen })));
2080
+ const OrdersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./OrdersScreen-BLs1xTv7.cjs")).then((m) => ({ default: m.OrdersScreen })));
2081
+ const SubscriptionsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./SubscriptionsScreen-dhnfYn4L.cjs")).then((m) => ({ default: m.SubscriptionsScreen })));
2082
+ const MessagingScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MessagingScreen-BwI0RShj.cjs")).then((m) => ({ default: m.MessagingScreen })));
2083
+ const ContactsScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ContactsScreen-Dv1SJNBo.cjs")).then((m) => ({ default: m.ContactsScreen })));
2084
+ const ShopScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShopScreen-BigHJ5wE.cjs")).then((m) => ({ default: m.ShopScreen })));
2083
2085
  const CustomersScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./CustomersScreen-DW3BuhBs.cjs")).then((n) => n.CustomersScreen_exports).then((m) => ({ default: m.CustomersScreen })));
2084
- const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-BUYG-mjj.cjs")).then((m) => ({ default: m.ShareablesScreen })));
2085
- const MySiteScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MySiteScreen-B_16cPgD.cjs")).then((m) => ({ default: m.MySiteScreen })));
2086
- const UpgradeScreen = (0, react.lazy)(() => Promise.resolve().then(() => require("./UpgradeScreen-DUvg-WZv.cjs")).then((m) => ({ default: m.UpgradeScreen })));
2087
- const AppDownloadScreen = (0, react.lazy)(() => Promise.resolve().then(() => require("./AppDownloadScreen-BXnl23_d.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => ({ default: m.AppDownloadScreen })));
2086
+ const ShareablesScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./ShareablesScreen-CsDxLODp.cjs")).then((m) => ({ default: m.ShareablesScreen })));
2087
+ const MySiteScreen$1 = (0, react.lazy)(() => Promise.resolve().then(() => require("./MySiteScreen-Bdd7a6Hy.cjs")).then((m) => ({ default: m.MySiteScreen })));
2088
+ const UpgradeScreen = (0, react.lazy)(() => Promise.resolve().then(() => require("./UpgradeScreen-Bl9lb32K.cjs")).then((m) => ({ default: m.UpgradeScreen })));
2089
+ const AppDownloadScreen = (0, react.lazy)(() => Promise.resolve().then(() => require("./AppDownloadScreen-Og_iMsw5.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => ({ default: m.AppDownloadScreen })));
2088
2090
  const SYSTEM_SLUG_SCREEN_MAP = {
2089
2091
  profile: ProfileScreen$1,
2090
2092
  account: ProfileScreen$1,
@@ -2124,7 +2126,6 @@ function findScreenByPrefix(slug) {
2124
2126
  }
2125
2127
  //#endregion
2126
2128
  //#region src/shell/PageRouter.tsx
2127
- const ACCOUNT_SLUGS = new Set([...ACCOUNT_MANAGE_SLUGS, "account"]);
2128
2129
  /**
2129
2130
  * Returns true if any nav slug resolves to the given system screen component.
2130
2131
  * Lets detail routes (e.g. `share/product/:id`) render when their listing
@@ -2143,7 +2144,14 @@ function PageRouter({ currentSlug, currentNavItem, customPages, screens, baseSlu
2143
2144
  }, [screens]);
2144
2145
  const screenBySlug = (0, react.useMemo)(() => {
2145
2146
  if (!screens || screens.length === 0) return void 0;
2146
- return new Map(screens.filter((s) => s.slug).map((s) => [s.slug, s]));
2147
+ const map = /* @__PURE__ */ new Map();
2148
+ for (const s of screens) if (s.slug) map.set(s.slug, s);
2149
+ for (const s of screens) {
2150
+ if (!s.name) continue;
2151
+ const nameSlug = slugifyName(s.name);
2152
+ if (nameSlug && !map.has(nameSlug)) map.set(nameSlug, s);
2153
+ }
2154
+ return map;
2147
2155
  }, [screens]);
2148
2156
  const builderScreen = (0, react.useMemo)(() => {
2149
2157
  if (currentNavItem?.screen_id && screenById) {
@@ -2173,75 +2181,18 @@ function PageRouter({ currentSlug, currentNavItem, customPages, screens, baseSlu
2173
2181
  }
2174
2182
  const SystemScreen = SYSTEM_SLUG_SCREEN_MAP[baseSlug] ?? findScreenByPrefix(currentSlug);
2175
2183
  const systemScreenInNav = navSlugs === void 0 || SystemScreen !== void 0 && (ALWAYS_AVAILABLE_SYSTEM_SCREENS.has(SystemScreen) || isSystemScreenCoveredByNav(SystemScreen, navSlugs));
2176
- if (SystemScreen && systemScreenInNav) {
2177
- const content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
2178
- fallback: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2179
- className: "flex h-full items-center justify-center",
2180
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "border-primary h-8 w-8 animate-spin rounded-full border-2 border-t-transparent" })
2181
- }),
2182
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SystemScreen, {})
2183
- });
2184
- if (ACCOUNT_SLUGS.has(baseSlug)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccountManageLayout, { children: content });
2185
- return content;
2186
- }
2184
+ if (SystemScreen && systemScreenInNav) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
2185
+ fallback: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2186
+ className: "flex h-full items-center justify-center",
2187
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "border-primary h-8 w-8 animate-spin rounded-full border-2 border-t-transparent" })
2188
+ }),
2189
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SystemScreen, {})
2190
+ });
2187
2191
  if (isSystemNavigationItem(baseSlug)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CustomersScreen.CoreScreenPlaceholder, { name: currentNavItem?.label ?? baseSlug });
2188
2192
  if (builderScreen) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BuilderScreenView, { screen: builderScreen });
2189
2193
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScreenNotFound, { name: currentNavItem?.label ?? currentSlug });
2190
2194
  }
2191
2195
  //#endregion
2192
- //#region ../core/src/navigation/slug-utils.ts
2193
- /**
2194
- * Extract all slugs from a navigation tree, sorted by segment count descending.
2195
- * Longest slugs first enables greedy prefix matching (e.g. "share/playlists"
2196
- * is checked before "share").
2197
- */
2198
- function collectNavSlugs(items) {
2199
- const slugs = [];
2200
- for (const item of items) {
2201
- if (item.slug) slugs.push(normalizeSlug(item.slug));
2202
- for (const child of item.children ?? []) if (child.slug) slugs.push(normalizeSlug(child.slug));
2203
- }
2204
- return [...slugs].sort((a, b) => b.split("/").length - a.split("/").length);
2205
- }
2206
- /**
2207
- * Find the longest registered nav slug that is a prefix of `fullSlug`.
2208
- * Uses segment-boundary checking to prevent "shop" from matching "shopping".
2209
- */
2210
- function matchSlugPrefix(fullSlug, navSlugs) {
2211
- const normalized = normalizeSlug(fullSlug);
2212
- if (!normalized) return void 0;
2213
- for (const navSlug of navSlugs) {
2214
- if (normalized === navSlug) return {
2215
- matchedSlug: navSlug,
2216
- rest: ""
2217
- };
2218
- if (normalized.startsWith(navSlug + "/")) return {
2219
- matchedSlug: navSlug,
2220
- rest: normalized.slice(navSlug.length + 1)
2221
- };
2222
- }
2223
- }
2224
- /**
2225
- * Extract the slug portion from a full pathname by stripping the basePath prefix.
2226
- * Returns an empty string when the pathname equals the basePath exactly.
2227
- *
2228
- * Examples:
2229
- * extractSlugFromPathname("/contacts/123", "/") → "contacts/123"
2230
- * extractSlugFromPathname("/portal/contacts", "/portal") → "contacts"
2231
- * extractSlugFromPathname("/portal", "/portal") → ""
2232
- * extractSlugFromPathname("/", "/") → ""
2233
- */
2234
- function extractSlugFromPathname(pathname, basePath) {
2235
- if (basePath === "/") return pathname.replace(/^\//, "");
2236
- if (pathname.startsWith(basePath)) return pathname.slice(basePath.length).replace(/^\//, "");
2237
- return pathname.replace(/^\//, "");
2238
- }
2239
- function isSlugInSection(item, currentSlug, navSlugs) {
2240
- const baseSlug = matchSlugPrefix(currentSlug, navSlugs)?.matchedSlug ?? normalizeSlug(currentSlug);
2241
- if (normalizeSlug(item.slug) === baseSlug) return true;
2242
- return item.children?.some((child) => normalizeSlug(child.slug) === baseSlug) ?? false;
2243
- }
2244
- //#endregion
2245
2196
  //#region src/shell/AppShellErrorBoundary.tsx
2246
2197
  var AppShellErrorBoundary = class extends react.Component {
2247
2198
  state = { error: null };
@@ -2495,7 +2446,7 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
2495
2446
  const navSlugs = (0, react.useMemo)(() => collectNavSlugs(filteredNavItems), [filteredNavItems]);
2496
2447
  const allNavSlugs = (0, react.useMemo)(() => {
2497
2448
  const mobileSlugs = collectNavSlugs(filteredMobileNavItems);
2498
- return Array.from(new Set([...navSlugs, ...mobileSlugs]));
2449
+ return Array.from(new Set([...navSlugs, ...mobileSlugs])).sort((a, b) => b.split("/").length - a.split("/").length);
2499
2450
  }, [navSlugs, filteredMobileNavItems]);
2500
2451
  const [themeMode, setThemeMode] = (0, react.useState)(getInitialThemeMode);
2501
2452
  const handleThemeModeChange = (0, react.useCallback)((mode) => {
@@ -2601,11 +2552,11 @@ function AppShell({ appData: appDataProp, navigation: navigationProp, customPage
2601
2552
  if (typeof orderToken === "string" && orderToken) handleNavigate(`orders/${orderToken}`);
2602
2553
  }, [handleNavigate]);
2603
2554
  const resolvedSidebarFooter = (0, react.useMemo)(() => sidebarFooter !== void 0 ? sidebarFooter : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SdkLogoutButton, { onLogout: logout }), [sidebarFooter, logout]);
2604
- const slugMatch = (0, react.useMemo)(() => matchSlugPrefix(activeSlug, navSlugs), [activeSlug, navSlugs]);
2555
+ const slugMatch = (0, react.useMemo)(() => matchSlugPrefix(activeSlug, allNavSlugs), [activeSlug, allNavSlugs]);
2605
2556
  const baseSlug = slugMatch?.matchedSlug ?? normalizeSlug(activeSlug);
2606
2557
  const restParams = slugMatch?.rest ?? "";
2607
2558
  const mobileSecondLevelTabs = findCurrentSection(filteredMobileNavItems, baseSlug)?.children ?? [];
2608
- const currentNavItem = findNavItem(filteredNavItems, baseSlug);
2559
+ const currentNavItem = findNavItem(filteredNavItems, baseSlug) ?? findNavItem(filteredMobileNavItems, baseSlug);
2609
2560
  const screenTitle = currentNavItem?.label || screens?.find((s) => s.id === currentNavItem?.screen_id)?.name || void 0;
2610
2561
  const content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppShellErrorBoundary, { children: typeof children === "function" ? children({
2611
2562
  currentSlug: activeSlug,
@@ -3777,17 +3728,17 @@ zod.z.object({
3777
3728
  //#endregion
3778
3729
  //#region src/screens/index.ts
3779
3730
  const screenPropertySchemas = {
3780
- ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-CKcdtroU.cjs")).then((m) => m.profileScreenPropertySchema),
3781
- MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-KYx6DSMx.cjs")).then((m) => m.messagingScreenPropertySchema),
3782
- ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-CH_P8WxC.cjs")).then((m) => m.contactsScreenPropertySchema),
3783
- OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-CQGCZLYf.cjs")).then((m) => m.ordersScreenPropertySchema),
3784
- SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-t5wtDGfB.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
3731
+ ProfileScreen: () => Promise.resolve().then(() => require("./ProfileScreen-Za3ZIWPO.cjs")).then((m) => m.profileScreenPropertySchema),
3732
+ MessagingScreen: () => Promise.resolve().then(() => require("./MessagingScreen-BwI0RShj.cjs")).then((m) => m.messagingScreenPropertySchema),
3733
+ ContactsScreen: () => Promise.resolve().then(() => require("./ContactsScreen-Dv1SJNBo.cjs")).then((m) => m.contactsScreenPropertySchema),
3734
+ OrdersScreen: () => Promise.resolve().then(() => require("./OrdersScreen-BLs1xTv7.cjs")).then((m) => m.ordersScreenPropertySchema),
3735
+ SubscriptionsScreen: () => Promise.resolve().then(() => require("./SubscriptionsScreen-dhnfYn4L.cjs")).then((m) => m.subscriptionsScreenPropertySchema),
3785
3736
  CustomersScreen: () => Promise.resolve().then(() => require("./CustomersScreen-DW3BuhBs.cjs")).then((n) => n.CustomersScreen_exports).then((m) => m.customersScreenPropertySchema),
3786
- MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-B_16cPgD.cjs")).then((m) => m.mySiteScreenPropertySchema),
3787
- ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-BUYG-mjj.cjs")).then((m) => m.shareablesScreenPropertySchema),
3788
- ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-DVpCo-OV.cjs")).then((m) => m.shopScreenPropertySchema),
3789
- UpgradeScreen: () => Promise.resolve().then(() => require("./UpgradeScreen-DUvg-WZv.cjs")).then((m) => m.upgradeScreenPropertySchema),
3790
- AppDownloadScreen: () => Promise.resolve().then(() => require("./AppDownloadScreen-BXnl23_d.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => m.appDownloadScreenPropertySchema)
3737
+ MySiteScreen: () => Promise.resolve().then(() => require("./MySiteScreen-Bdd7a6Hy.cjs")).then((m) => m.mySiteScreenPropertySchema),
3738
+ ShareablesScreen: () => Promise.resolve().then(() => require("./ShareablesScreen-CsDxLODp.cjs")).then((m) => m.shareablesScreenPropertySchema),
3739
+ ShopScreen: () => Promise.resolve().then(() => require("./ShopScreen-BigHJ5wE.cjs")).then((m) => m.shopScreenPropertySchema),
3740
+ UpgradeScreen: () => Promise.resolve().then(() => require("./UpgradeScreen-Bl9lb32K.cjs")).then((m) => m.upgradeScreenPropertySchema),
3741
+ AppDownloadScreen: () => Promise.resolve().then(() => require("./AppDownloadScreen-Og_iMsw5.cjs")).then((n) => n.AppDownloadScreen_exports).then((m) => m.appDownloadScreenPropertySchema)
3791
3742
  };
3792
3743
  /**
3793
3744
  * Core page template IDs