@nok-integration/storefront-react 0.29.2 → 0.29.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -23,15 +23,15 @@ declare type AddCartItemRequest = z.infer<typeof AddCartItemRequest>;
23
23
 
24
24
  /** The `error` member — a machine `code`, a human `message`, and optional `details`. */
25
25
  declare const ApiErrorBody: z.ZodObject<{
26
- code: z.ZodEnum<["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]>;
26
+ code: z.ZodEnum<["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "vip_hero_missing", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]>;
27
27
  message: z.ZodString;
28
28
  details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
29
29
  }, "strip", z.ZodTypeAny, {
30
- code: "invalid_request" | "unauthorized" | "out_of_stock" | "cart_locked" | "sku_not_found" | "category_not_found" | "amount_mismatch" | "duplicate_order" | "order_not_found" | "order_not_cancellable" | "cart_not_found" | "support_ticket_not_found" | "vip_invite_not_found" | "vip_cart_conflict" | "vip_invite_mismatch" | "size_chart_not_found" | "forbidden" | "invalid_transition" | "rate_limited" | "server_error";
30
+ code: "invalid_request" | "unauthorized" | "out_of_stock" | "cart_locked" | "sku_not_found" | "category_not_found" | "amount_mismatch" | "duplicate_order" | "order_not_found" | "order_not_cancellable" | "cart_not_found" | "support_ticket_not_found" | "vip_invite_not_found" | "vip_cart_conflict" | "vip_invite_mismatch" | "vip_hero_missing" | "size_chart_not_found" | "forbidden" | "invalid_transition" | "rate_limited" | "server_error";
31
31
  message: string;
32
32
  details?: Record<string, unknown> | undefined;
33
33
  }, {
34
- code: "invalid_request" | "unauthorized" | "out_of_stock" | "cart_locked" | "sku_not_found" | "category_not_found" | "amount_mismatch" | "duplicate_order" | "order_not_found" | "order_not_cancellable" | "cart_not_found" | "support_ticket_not_found" | "vip_invite_not_found" | "vip_cart_conflict" | "vip_invite_mismatch" | "size_chart_not_found" | "forbidden" | "invalid_transition" | "rate_limited" | "server_error";
34
+ code: "invalid_request" | "unauthorized" | "out_of_stock" | "cart_locked" | "sku_not_found" | "category_not_found" | "amount_mismatch" | "duplicate_order" | "order_not_found" | "order_not_cancellable" | "cart_not_found" | "support_ticket_not_found" | "vip_invite_not_found" | "vip_cart_conflict" | "vip_invite_mismatch" | "vip_hero_missing" | "size_chart_not_found" | "forbidden" | "invalid_transition" | "rate_limited" | "server_error";
35
35
  message: string;
36
36
  details?: Record<string, unknown> | undefined;
37
37
  }>;
@@ -3760,7 +3760,7 @@ export declare interface EmptyStateProps {
3760
3760
  * | rate_limited | 429 | too many requests |
3761
3761
  * | server_error | 500 | unexpected error (safe to retry idempotent) |
3762
3762
  */
3763
- declare const ErrorCode: z.ZodEnum<["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]>;
3763
+ declare const ErrorCode: z.ZodEnum<["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "vip_hero_missing", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]>;
3764
3764
 
3765
3765
  declare type ErrorCode = z.infer<typeof ErrorCode>;
3766
3766
 
@@ -3783,7 +3783,7 @@ declare type ErrorCode = z.infer<typeof ErrorCode>;
3783
3783
  * | rate_limited | 429 | too many requests |
3784
3784
  * | server_error | 500 | unexpected error (safe to retry idempotent) |
3785
3785
  */
3786
- declare const ErrorCode_2: z.ZodEnum<["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]>;
3786
+ declare const ErrorCode_2: z.ZodEnum<["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "vip_hero_missing", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]>;
3787
3787
 
3788
3788
  declare type ErrorCode_2 = z.infer<typeof ErrorCode_2>;
3789
3789
 
@@ -7225,7 +7225,7 @@ declare const VipInviteView: z.ZodDiscriminatedUnion<"state", [z.ZodObject<{
7225
7225
 
7226
7226
  declare type VipInviteView = z.infer<typeof VipInviteView>;
7227
7227
 
7228
- export declare function VipLandingView({ token, onUnavailable }: VipLandingViewProps): JSX.Element;
7228
+ export declare function VipLandingView({ token, onUnavailable, screen }: VipLandingViewProps): JSX.Element;
7229
7229
 
7230
7230
  export declare interface VipLandingViewProps {
7231
7231
  /**
@@ -7235,6 +7235,11 @@ export declare interface VipLandingViewProps {
7235
7235
  token: string;
7236
7236
  /** Replaces the built-in screen for an invite that cannot be claimed. */
7237
7237
  onUnavailable?: (state: VipInviteUnavailableState) => ReactNode;
7238
+ /**
7239
+ * Which screen of the invite this URL is. `hero` is `/vip/<token>`, `product` is
7240
+ * `/vip/<token>/product`. Defaults to `hero`.
7241
+ */
7242
+ screen?: 'hero' | 'product';
7238
7243
  }
7239
7244
 
7240
7245
  /** "Why shop with us" reassurance tiles. */
package/dist/index.mjs CHANGED
@@ -4993,7 +4993,7 @@ function requireErrors$1() {
4993
4993
  });
4994
4994
  exports.ErrorResponse = exports.ApiErrorBody = exports.ERROR_CODE_STATUS = exports.ErrorCode = void 0;
4995
4995
  const zod_1 = requireZod();
4996
- exports.ErrorCode = zod_1.z.enum(["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]);
4996
+ exports.ErrorCode = zod_1.z.enum(["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "vip_hero_missing", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]);
4997
4997
  exports.ERROR_CODE_STATUS = {
4998
4998
  invalid_request: 400,
4999
4999
  unauthorized: 401,
@@ -5010,6 +5010,7 @@ function requireErrors$1() {
5010
5010
  vip_invite_not_found: 404,
5011
5011
  vip_cart_conflict: 409,
5012
5012
  vip_invite_mismatch: 409,
5013
+ vip_hero_missing: 422,
5013
5014
  size_chart_not_found: 404,
5014
5015
  forbidden: 403,
5015
5016
  invalid_transition: 409,
@@ -11033,18 +11034,18 @@ function StickyCtaBar({ children, info: info2, variant = "floating", className }
11033
11034
  })]
11034
11035
  });
11035
11036
  }
11036
- const surface = "_surface_ws4so_15";
11037
- const screen = "_screen_ws4so_20";
11038
- const body$4 = "_body_ws4so_12";
11039
- const items = "_items_ws4so_34";
11040
- const sectionHeader = "_sectionHeader_ws4so_40";
11041
- const sectionTitle = "_sectionTitle_ws4so_46";
11042
- const count = "_count_ws4so_67";
11043
- const lines = "_lines_ws4so_91";
11044
- const footer = "_footer_ws4so_101";
11045
- const empty = "_empty_ws4so_105";
11046
- const cta$4 = "_cta_ws4so_145";
11047
- const ctaError = "_ctaError_ws4so_153";
11037
+ const surface = "_surface_o6bcy_15";
11038
+ const screen = "_screen_o6bcy_20";
11039
+ const body$4 = "_body_o6bcy_12";
11040
+ const items = "_items_o6bcy_34";
11041
+ const sectionHeader = "_sectionHeader_o6bcy_40";
11042
+ const sectionTitle = "_sectionTitle_o6bcy_46";
11043
+ const count = "_count_o6bcy_67";
11044
+ const lines = "_lines_o6bcy_91";
11045
+ const footer = "_footer_o6bcy_101";
11046
+ const empty = "_empty_o6bcy_105";
11047
+ const cta$4 = "_cta_o6bcy_146";
11048
+ const ctaError = "_ctaError_o6bcy_154";
11048
11049
  const styles$o = {
11049
11050
  surface,
11050
11051
  screen,
@@ -14142,7 +14143,7 @@ function requireErrors() {
14142
14143
  });
14143
14144
  exports.ErrorResponse = exports.ApiErrorBody = exports.ERROR_CODE_STATUS = exports.ErrorCode = void 0;
14144
14145
  const zod_1 = requireZod();
14145
- exports.ErrorCode = zod_1.z.enum(["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]);
14146
+ exports.ErrorCode = zod_1.z.enum(["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "vip_hero_missing", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]);
14146
14147
  exports.ERROR_CODE_STATUS = {
14147
14148
  invalid_request: 400,
14148
14149
  unauthorized: 401,
@@ -14159,6 +14160,7 @@ function requireErrors() {
14159
14160
  vip_invite_not_found: 404,
14160
14161
  vip_cart_conflict: 409,
14161
14162
  vip_invite_mismatch: 409,
14163
+ vip_hero_missing: 422,
14162
14164
  size_chart_not_found: 404,
14163
14165
  forbidden: 403,
14164
14166
  invalid_transition: 409,
@@ -14902,7 +14904,7 @@ function locatorOf(segment) {
14902
14904
  return null;
14903
14905
  }
14904
14906
  const INVALID_LINK = /* @__PURE__ */ new Set(["invalid_request", "vip_invite_not_found", "vip_invite_mismatch"]);
14905
- function VipLandingView({ token, onUnavailable }) {
14907
+ function VipLandingView({ token, onUnavailable, screen: screen2 = "hero" }) {
14906
14908
  const t = useT();
14907
14909
  const { api, emit } = useShop();
14908
14910
  const locator = locatorOf(token);
@@ -14982,18 +14984,43 @@ function VipLandingView({ token, onUnavailable }) {
14982
14984
  }
14983
14985
  return jsx(ActiveLanding, {
14984
14986
  token,
14985
- invite
14987
+ invite,
14988
+ screen: screen2
14986
14989
  });
14987
14990
  }
14988
- function ActiveLanding({ token, invite }) {
14991
+ function plainFirstLine(description2) {
14992
+ if (!description2) return null;
14993
+ const line2 = description2.replace(/<[^>]*>/g, " ").split(/\n+/).map((l) => l.replace(/\s+/g, " ").trim()).find((l) => l.length > 0);
14994
+ if (!line2) return null;
14995
+ const sentence = /^.*?[.!?](?=\s|$)/.exec(line2);
14996
+ return sentence ? sentence[0] : line2;
14997
+ }
14998
+ function heroFromProduct(product, ctaLabel) {
14999
+ const image2 = product.media[0] ?? null;
15000
+ return {
15001
+ image: image2,
15002
+ desktop_image: image2,
15003
+ headline: product.title,
15004
+ body: plainFirstLine(product.description),
15005
+ cta_label: ctaLabel
15006
+ };
15007
+ }
15008
+ function ActiveLanding({ token, invite, screen: screen2 }) {
14989
15009
  const t = useT();
14990
15010
  const toast2 = useToast();
14991
15011
  const { api, emit } = useShop();
14992
- const product = useInPlaceScreen("vipProduct");
15012
+ const navigate = useNavigate();
14993
15013
  const sku = invite.items[0]?.product_sku ?? "";
14994
15014
  const loaded = useProduct(sku, {
14995
15015
  showRecommendations: false
14996
15016
  });
15017
+ const productPath = `/vip/${token}/product`;
15018
+ const heroPath = `/vip/${token}`;
15019
+ const go = useCallback((to) => {
15020
+ if (navigate) navigate(to);
15021
+ else window.location.assign(to);
15022
+ }, [navigate]);
15023
+ const fallback = useMemo(() => loaded.product ? heroFromProduct(loaded.product, t("See more")) : null, [loaded.product, t]);
14997
15024
  const claim = useCallback(async (variantSku) => {
14998
15025
  try {
14999
15026
  const current2 = await api.cart.get().catch(() => null);
@@ -15036,23 +15063,21 @@ function ActiveLanding({ token, invite }) {
15036
15063
  toast2.show(t(treatmentFor(code).body), "critical");
15037
15064
  }
15038
15065
  }, [api, emit, invite.invite_ref, t, toast2, token]);
15039
- if (invite.hero && product.value === null) {
15040
- return jsx(VipHero, {
15041
- hero: invite.hero,
15042
- onContinue: () => product.open("1")
15066
+ if (screen2 === "hero") {
15067
+ const hero2 = invite.hero ?? fallback;
15068
+ if (hero2) return jsx(VipHero, {
15069
+ hero: hero2,
15070
+ onContinue: () => go(productPath)
15043
15071
  });
15044
- }
15045
- if (loaded.product) {
15072
+ } else if (loaded.product) {
15046
15073
  return jsx(ProductDetail, {
15047
15074
  product: loaded.product,
15048
15075
  inventory: loaded.inventory,
15049
15076
  claim,
15050
- ...invite.hero ? {
15051
- breadcrumb: jsx(VipBreadcrumb, {
15052
- title: loaded.product.title,
15053
- onHome: product.close
15054
- })
15055
- } : {}
15077
+ breadcrumb: jsx(VipBreadcrumb, {
15078
+ title: loaded.product.title,
15079
+ onHome: () => go(heroPath)
15080
+ })
15056
15081
  }, loaded.product.sku);
15057
15082
  }
15058
15083
  if (loaded.loading) return jsx(ScreenSkeleton, {
@@ -15066,40 +15091,40 @@ function ActiveLanding({ token, invite }) {
15066
15091
  })
15067
15092
  });
15068
15093
  }
15069
- const showcase = "_showcase_sml7n_14";
15070
- const panel = "_panel_sml7n_40";
15071
- const image = "_image_sml7n_93";
15072
- const desktopArt = "_desktopArt_sml7n_98";
15073
- const hero = "_hero_sml7n_137";
15074
- const heroContent = "_heroContent_sml7n_228";
15075
- const heroText = "_heroText_sml7n_252";
15076
- const logo = "_logo_sml7n_261";
15077
- const heroTitle = "_heroTitle_sml7n_281";
15078
- const heroSub = "_heroSub_sml7n_305";
15079
- const swipe = "_swipe_sml7n_324";
15080
- const swipeLabel = "_swipeLabel_sml7n_331";
15081
- const chevron$1 = "_chevron_sml7n_337";
15082
- const overlay$1 = "_overlay_sml7n_11";
15083
- const copy = "_copy_sml7n_374";
15084
- const title$2 = "_title_sml7n_386";
15085
- const subtitle$1 = "_subtitle_sml7n_395";
15086
- const cta = "_cta_sml7n_403";
15087
- const mosaic = "_mosaic_sml7n_447";
15088
- const info = "_info_sml7n_459";
15089
- const art = "_art_sml7n_463";
15090
- const band = "_band_sml7n_468";
15091
- const bandTitle = "_bandTitle_sml7n_477";
15092
- const products = "_products_sml7n_489";
15093
- const wideOnly = "_wideOnly_sml7n_509";
15094
- const phoneOnly = "_phoneOnly_sml7n_535";
15095
- const phoneArt = "_phoneArt_sml7n_536";
15096
- const desktopFocal = "_desktopFocal_sml7n_545";
15097
- const diptych = "_diptych_sml7n_736";
15098
- const tile = "_tile_sml7n_741";
15099
- const tileCopy = "_tileCopy_sml7n_755";
15100
- const tileText = "_tileText_sml7n_768";
15101
- const tileTitle = "_tileTitle_sml7n_775";
15102
- const tileSubtitle = "_tileSubtitle_sml7n_782";
15094
+ const showcase = "_showcase_px8r_14";
15095
+ const panel = "_panel_px8r_40";
15096
+ const image = "_image_px8r_93";
15097
+ const desktopArt = "_desktopArt_px8r_98";
15098
+ const hero = "_hero_px8r_137";
15099
+ const heroContent = "_heroContent_px8r_228";
15100
+ const heroText = "_heroText_px8r_252";
15101
+ const logo = "_logo_px8r_261";
15102
+ const heroTitle = "_heroTitle_px8r_281";
15103
+ const heroSub = "_heroSub_px8r_305";
15104
+ const swipe = "_swipe_px8r_324";
15105
+ const swipeLabel = "_swipeLabel_px8r_331";
15106
+ const chevron$1 = "_chevron_px8r_337";
15107
+ const overlay$1 = "_overlay_px8r_11";
15108
+ const copy = "_copy_px8r_374";
15109
+ const title$2 = "_title_px8r_386";
15110
+ const subtitle$1 = "_subtitle_px8r_395";
15111
+ const cta = "_cta_px8r_403";
15112
+ const mosaic = "_mosaic_px8r_447";
15113
+ const info = "_info_px8r_459";
15114
+ const art = "_art_px8r_463";
15115
+ const band = "_band_px8r_468";
15116
+ const bandTitle = "_bandTitle_px8r_477";
15117
+ const products = "_products_px8r_489";
15118
+ const wideOnly = "_wideOnly_px8r_509";
15119
+ const phoneOnly = "_phoneOnly_px8r_535";
15120
+ const phoneArt = "_phoneArt_px8r_536";
15121
+ const desktopFocal = "_desktopFocal_px8r_545";
15122
+ const diptych = "_diptych_px8r_740";
15123
+ const tile = "_tile_px8r_745";
15124
+ const tileCopy = "_tileCopy_px8r_759";
15125
+ const tileText = "_tileText_px8r_772";
15126
+ const tileTitle = "_tileTitle_px8r_779";
15127
+ const tileSubtitle = "_tileSubtitle_px8r_786";
15103
15128
  const styles$3 = {
15104
15129
  showcase,
15105
15130
  panel,
@@ -15146,12 +15171,6 @@ function useDocumentSnap(ref, enabled = true) {
15146
15171
  const previousType = root2.style.scrollSnapType;
15147
15172
  const previousPadding = root2.style.scrollPaddingTop;
15148
15173
  root2.style.scrollPaddingTop = "0px";
15149
- const desktop = typeof window.matchMedia === "function" ? window.matchMedia("(min-width: 1200px)") : null;
15150
- const pad = () => {
15151
- root2.style.scrollPaddingTop = desktop?.matches ? "calc(var(--shop-chrome-top, 0px) + var(--shop-nav-height, 64px))" : "0px";
15152
- };
15153
- pad();
15154
- desktop?.addEventListener?.("change", pad);
15155
15174
  let snapping = false;
15156
15175
  let awaitingTouch = false;
15157
15176
  const layoutOf = () => {
@@ -15265,7 +15284,6 @@ function useDocumentSnap(ref, enabled = true) {
15265
15284
  passive: true
15266
15285
  });
15267
15286
  return () => {
15268
- desktop?.removeEventListener?.("change", pad);
15269
15287
  document.removeEventListener("scroll", note2, {
15270
15288
  capture: true
15271
15289
  });
@@ -15915,19 +15933,19 @@ function ShopBar({ onBack, onMenu, title: title2, showCart, floating: floating2
15915
15933
  })]
15916
15934
  });
15917
15935
  }
15918
- const overlay = "_overlay_1aeep_5";
15919
- const scrim = "_scrim_1aeep_21";
15920
- const sheet = "_sheet_1aeep_31";
15921
- const header = "_header_1aeep_80";
15922
- const close = "_close_1aeep_86";
15923
- const list$1 = "_list_1aeep_105";
15924
- const row = "_row_1aeep_120";
15925
- const icon = "_icon_1aeep_149";
15926
- const text = "_text_1aeep_157";
15927
- const title = "_title_1aeep_165";
15928
- const subtitle = "_subtitle_1aeep_172";
15929
- const chevron = "_chevron_1aeep_178";
15930
- const dropdown = "_dropdown_1aeep_187";
15936
+ const overlay = "_overlay_y4mxb_5";
15937
+ const scrim = "_scrim_y4mxb_21";
15938
+ const sheet = "_sheet_y4mxb_31";
15939
+ const header = "_header_y4mxb_80";
15940
+ const close = "_close_y4mxb_86";
15941
+ const list$1 = "_list_y4mxb_105";
15942
+ const row = "_row_y4mxb_120";
15943
+ const icon = "_icon_y4mxb_149";
15944
+ const text = "_text_y4mxb_157";
15945
+ const title = "_title_y4mxb_165";
15946
+ const subtitle = "_subtitle_y4mxb_172";
15947
+ const chevron = "_chevron_y4mxb_178";
15948
+ const dropdown = "_dropdown_y4mxb_187";
15931
15949
  const styles$1 = {
15932
15950
  overlay,
15933
15951
  scrim,
@@ -16137,6 +16155,7 @@ function ShopMenuSheet({ open, onClose, onManageOrders, onHelp, closeLabel, labe
16137
16155
  }), jsx("ul", {
16138
16156
  className: styles$1.list,
16139
16157
  children: rows.map((row2) => jsx("li", {
16158
+ "data-row": row2.key,
16140
16159
  children: jsxs("button", {
16141
16160
  type: "button",
16142
16161
  className: styles$1.row,
@@ -4993,7 +4993,7 @@ function requireErrors$1() {
4993
4993
  });
4994
4994
  exports.ErrorResponse = exports.ApiErrorBody = exports.ERROR_CODE_STATUS = exports.ErrorCode = void 0;
4995
4995
  const zod_1 = requireZod();
4996
- exports.ErrorCode = zod_1.z.enum(["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]);
4996
+ exports.ErrorCode = zod_1.z.enum(["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "vip_hero_missing", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]);
4997
4997
  exports.ERROR_CODE_STATUS = {
4998
4998
  invalid_request: 400,
4999
4999
  unauthorized: 401,
@@ -5010,6 +5010,7 @@ function requireErrors$1() {
5010
5010
  vip_invite_not_found: 404,
5011
5011
  vip_cart_conflict: 409,
5012
5012
  vip_invite_mismatch: 409,
5013
+ vip_hero_missing: 422,
5013
5014
  size_chart_not_found: 404,
5014
5015
  forbidden: 403,
5015
5016
  invalid_transition: 409,
@@ -11033,18 +11034,18 @@ function StickyCtaBar({ children, info: info2, variant = "floating", className }
11033
11034
  })]
11034
11035
  });
11035
11036
  }
11036
- const surface = "_surface_ws4so_15";
11037
- const screen = "_screen_ws4so_20";
11038
- const body$4 = "_body_ws4so_12";
11039
- const items = "_items_ws4so_34";
11040
- const sectionHeader = "_sectionHeader_ws4so_40";
11041
- const sectionTitle = "_sectionTitle_ws4so_46";
11042
- const count = "_count_ws4so_67";
11043
- const lines = "_lines_ws4so_91";
11044
- const footer = "_footer_ws4so_101";
11045
- const empty = "_empty_ws4so_105";
11046
- const cta$4 = "_cta_ws4so_145";
11047
- const ctaError = "_ctaError_ws4so_153";
11037
+ const surface = "_surface_o6bcy_15";
11038
+ const screen = "_screen_o6bcy_20";
11039
+ const body$4 = "_body_o6bcy_12";
11040
+ const items = "_items_o6bcy_34";
11041
+ const sectionHeader = "_sectionHeader_o6bcy_40";
11042
+ const sectionTitle = "_sectionTitle_o6bcy_46";
11043
+ const count = "_count_o6bcy_67";
11044
+ const lines = "_lines_o6bcy_91";
11045
+ const footer = "_footer_o6bcy_101";
11046
+ const empty = "_empty_o6bcy_105";
11047
+ const cta$4 = "_cta_o6bcy_146";
11048
+ const ctaError = "_ctaError_o6bcy_154";
11048
11049
  const styles$o = {
11049
11050
  surface,
11050
11051
  screen,
@@ -14142,7 +14143,7 @@ function requireErrors() {
14142
14143
  });
14143
14144
  exports.ErrorResponse = exports.ApiErrorBody = exports.ERROR_CODE_STATUS = exports.ErrorCode = void 0;
14144
14145
  const zod_1 = requireZod();
14145
- exports.ErrorCode = zod_1.z.enum(["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]);
14146
+ exports.ErrorCode = zod_1.z.enum(["invalid_request", "unauthorized", "out_of_stock", "cart_locked", "sku_not_found", "category_not_found", "amount_mismatch", "duplicate_order", "order_not_found", "order_not_cancellable", "cart_not_found", "support_ticket_not_found", "vip_invite_not_found", "vip_cart_conflict", "vip_invite_mismatch", "vip_hero_missing", "size_chart_not_found", "forbidden", "invalid_transition", "rate_limited", "server_error"]);
14146
14147
  exports.ERROR_CODE_STATUS = {
14147
14148
  invalid_request: 400,
14148
14149
  unauthorized: 401,
@@ -14159,6 +14160,7 @@ function requireErrors() {
14159
14160
  vip_invite_not_found: 404,
14160
14161
  vip_cart_conflict: 409,
14161
14162
  vip_invite_mismatch: 409,
14163
+ vip_hero_missing: 422,
14162
14164
  size_chart_not_found: 404,
14163
14165
  forbidden: 403,
14164
14166
  invalid_transition: 409,
@@ -14902,7 +14904,7 @@ function locatorOf(segment) {
14902
14904
  return null;
14903
14905
  }
14904
14906
  const INVALID_LINK = /* @__PURE__ */ new Set(["invalid_request", "vip_invite_not_found", "vip_invite_mismatch"]);
14905
- function VipLandingView({ token, onUnavailable }) {
14907
+ function VipLandingView({ token, onUnavailable, screen: screen2 = "hero" }) {
14906
14908
  const t = useT();
14907
14909
  const { api, emit } = useShop();
14908
14910
  const locator = locatorOf(token);
@@ -14982,18 +14984,43 @@ function VipLandingView({ token, onUnavailable }) {
14982
14984
  }
14983
14985
  return jsx(ActiveLanding, {
14984
14986
  token,
14985
- invite
14987
+ invite,
14988
+ screen: screen2
14986
14989
  });
14987
14990
  }
14988
- function ActiveLanding({ token, invite }) {
14991
+ function plainFirstLine(description2) {
14992
+ if (!description2) return null;
14993
+ const line2 = description2.replace(/<[^>]*>/g, " ").split(/\n+/).map((l) => l.replace(/\s+/g, " ").trim()).find((l) => l.length > 0);
14994
+ if (!line2) return null;
14995
+ const sentence = /^.*?[.!?](?=\s|$)/.exec(line2);
14996
+ return sentence ? sentence[0] : line2;
14997
+ }
14998
+ function heroFromProduct(product, ctaLabel) {
14999
+ const image2 = product.media[0] ?? null;
15000
+ return {
15001
+ image: image2,
15002
+ desktop_image: image2,
15003
+ headline: product.title,
15004
+ body: plainFirstLine(product.description),
15005
+ cta_label: ctaLabel
15006
+ };
15007
+ }
15008
+ function ActiveLanding({ token, invite, screen: screen2 }) {
14989
15009
  const t = useT();
14990
15010
  const toast2 = useToast();
14991
15011
  const { api, emit } = useShop();
14992
- const product = useInPlaceScreen("vipProduct");
15012
+ const navigate = useNavigate();
14993
15013
  const sku = invite.items[0]?.product_sku ?? "";
14994
15014
  const loaded = useProduct(sku, {
14995
15015
  showRecommendations: false
14996
15016
  });
15017
+ const productPath = `/vip/${token}/product`;
15018
+ const heroPath = `/vip/${token}`;
15019
+ const go = useCallback((to) => {
15020
+ if (navigate) navigate(to);
15021
+ else window.location.assign(to);
15022
+ }, [navigate]);
15023
+ const fallback = useMemo(() => loaded.product ? heroFromProduct(loaded.product, t("See more")) : null, [loaded.product, t]);
14997
15024
  const claim = useCallback(async (variantSku) => {
14998
15025
  try {
14999
15026
  const current2 = await api.cart.get().catch(() => null);
@@ -15036,23 +15063,21 @@ function ActiveLanding({ token, invite }) {
15036
15063
  toast2.show(t(treatmentFor(code).body), "critical");
15037
15064
  }
15038
15065
  }, [api, emit, invite.invite_ref, t, toast2, token]);
15039
- if (invite.hero && product.value === null) {
15040
- return jsx(VipHero, {
15041
- hero: invite.hero,
15042
- onContinue: () => product.open("1")
15066
+ if (screen2 === "hero") {
15067
+ const hero2 = invite.hero ?? fallback;
15068
+ if (hero2) return jsx(VipHero, {
15069
+ hero: hero2,
15070
+ onContinue: () => go(productPath)
15043
15071
  });
15044
- }
15045
- if (loaded.product) {
15072
+ } else if (loaded.product) {
15046
15073
  return jsx(ProductDetail, {
15047
15074
  product: loaded.product,
15048
15075
  inventory: loaded.inventory,
15049
15076
  claim,
15050
- ...invite.hero ? {
15051
- breadcrumb: jsx(VipBreadcrumb, {
15052
- title: loaded.product.title,
15053
- onHome: product.close
15054
- })
15055
- } : {}
15077
+ breadcrumb: jsx(VipBreadcrumb, {
15078
+ title: loaded.product.title,
15079
+ onHome: () => go(heroPath)
15080
+ })
15056
15081
  }, loaded.product.sku);
15057
15082
  }
15058
15083
  if (loaded.loading) return jsx(ScreenSkeleton, {
@@ -15066,40 +15091,40 @@ function ActiveLanding({ token, invite }) {
15066
15091
  })
15067
15092
  });
15068
15093
  }
15069
- const showcase = "_showcase_sml7n_14";
15070
- const panel = "_panel_sml7n_40";
15071
- const image = "_image_sml7n_93";
15072
- const desktopArt = "_desktopArt_sml7n_98";
15073
- const hero = "_hero_sml7n_137";
15074
- const heroContent = "_heroContent_sml7n_228";
15075
- const heroText = "_heroText_sml7n_252";
15076
- const logo = "_logo_sml7n_261";
15077
- const heroTitle = "_heroTitle_sml7n_281";
15078
- const heroSub = "_heroSub_sml7n_305";
15079
- const swipe = "_swipe_sml7n_324";
15080
- const swipeLabel = "_swipeLabel_sml7n_331";
15081
- const chevron$1 = "_chevron_sml7n_337";
15082
- const overlay$1 = "_overlay_sml7n_11";
15083
- const copy = "_copy_sml7n_374";
15084
- const title$2 = "_title_sml7n_386";
15085
- const subtitle$1 = "_subtitle_sml7n_395";
15086
- const cta = "_cta_sml7n_403";
15087
- const mosaic = "_mosaic_sml7n_447";
15088
- const info = "_info_sml7n_459";
15089
- const art = "_art_sml7n_463";
15090
- const band = "_band_sml7n_468";
15091
- const bandTitle = "_bandTitle_sml7n_477";
15092
- const products = "_products_sml7n_489";
15093
- const wideOnly = "_wideOnly_sml7n_509";
15094
- const phoneOnly = "_phoneOnly_sml7n_535";
15095
- const phoneArt = "_phoneArt_sml7n_536";
15096
- const desktopFocal = "_desktopFocal_sml7n_545";
15097
- const diptych = "_diptych_sml7n_736";
15098
- const tile = "_tile_sml7n_741";
15099
- const tileCopy = "_tileCopy_sml7n_755";
15100
- const tileText = "_tileText_sml7n_768";
15101
- const tileTitle = "_tileTitle_sml7n_775";
15102
- const tileSubtitle = "_tileSubtitle_sml7n_782";
15094
+ const showcase = "_showcase_px8r_14";
15095
+ const panel = "_panel_px8r_40";
15096
+ const image = "_image_px8r_93";
15097
+ const desktopArt = "_desktopArt_px8r_98";
15098
+ const hero = "_hero_px8r_137";
15099
+ const heroContent = "_heroContent_px8r_228";
15100
+ const heroText = "_heroText_px8r_252";
15101
+ const logo = "_logo_px8r_261";
15102
+ const heroTitle = "_heroTitle_px8r_281";
15103
+ const heroSub = "_heroSub_px8r_305";
15104
+ const swipe = "_swipe_px8r_324";
15105
+ const swipeLabel = "_swipeLabel_px8r_331";
15106
+ const chevron$1 = "_chevron_px8r_337";
15107
+ const overlay$1 = "_overlay_px8r_11";
15108
+ const copy = "_copy_px8r_374";
15109
+ const title$2 = "_title_px8r_386";
15110
+ const subtitle$1 = "_subtitle_px8r_395";
15111
+ const cta = "_cta_px8r_403";
15112
+ const mosaic = "_mosaic_px8r_447";
15113
+ const info = "_info_px8r_459";
15114
+ const art = "_art_px8r_463";
15115
+ const band = "_band_px8r_468";
15116
+ const bandTitle = "_bandTitle_px8r_477";
15117
+ const products = "_products_px8r_489";
15118
+ const wideOnly = "_wideOnly_px8r_509";
15119
+ const phoneOnly = "_phoneOnly_px8r_535";
15120
+ const phoneArt = "_phoneArt_px8r_536";
15121
+ const desktopFocal = "_desktopFocal_px8r_545";
15122
+ const diptych = "_diptych_px8r_740";
15123
+ const tile = "_tile_px8r_745";
15124
+ const tileCopy = "_tileCopy_px8r_759";
15125
+ const tileText = "_tileText_px8r_772";
15126
+ const tileTitle = "_tileTitle_px8r_779";
15127
+ const tileSubtitle = "_tileSubtitle_px8r_786";
15103
15128
  const styles$3 = {
15104
15129
  showcase,
15105
15130
  panel,
@@ -15146,12 +15171,6 @@ function useDocumentSnap(ref, enabled = true) {
15146
15171
  const previousType = root2.style.scrollSnapType;
15147
15172
  const previousPadding = root2.style.scrollPaddingTop;
15148
15173
  root2.style.scrollPaddingTop = "0px";
15149
- const desktop = typeof window.matchMedia === "function" ? window.matchMedia("(min-width: 1200px)") : null;
15150
- const pad = () => {
15151
- root2.style.scrollPaddingTop = desktop?.matches ? "calc(var(--shop-chrome-top, 0px) + var(--shop-nav-height, 64px))" : "0px";
15152
- };
15153
- pad();
15154
- desktop?.addEventListener?.("change", pad);
15155
15174
  let snapping = false;
15156
15175
  let awaitingTouch = false;
15157
15176
  const layoutOf = () => {
@@ -15265,7 +15284,6 @@ function useDocumentSnap(ref, enabled = true) {
15265
15284
  passive: true
15266
15285
  });
15267
15286
  return () => {
15268
- desktop?.removeEventListener?.("change", pad);
15269
15287
  document.removeEventListener("scroll", note2, {
15270
15288
  capture: true
15271
15289
  });
@@ -15915,19 +15933,19 @@ function ShopBar({ onBack, onMenu, title: title2, showCart, floating: floating2
15915
15933
  })]
15916
15934
  });
15917
15935
  }
15918
- const overlay = "_overlay_1aeep_5";
15919
- const scrim = "_scrim_1aeep_21";
15920
- const sheet = "_sheet_1aeep_31";
15921
- const header = "_header_1aeep_80";
15922
- const close = "_close_1aeep_86";
15923
- const list$1 = "_list_1aeep_105";
15924
- const row = "_row_1aeep_120";
15925
- const icon = "_icon_1aeep_149";
15926
- const text = "_text_1aeep_157";
15927
- const title = "_title_1aeep_165";
15928
- const subtitle = "_subtitle_1aeep_172";
15929
- const chevron = "_chevron_1aeep_178";
15930
- const dropdown = "_dropdown_1aeep_187";
15936
+ const overlay = "_overlay_y4mxb_5";
15937
+ const scrim = "_scrim_y4mxb_21";
15938
+ const sheet = "_sheet_y4mxb_31";
15939
+ const header = "_header_y4mxb_80";
15940
+ const close = "_close_y4mxb_86";
15941
+ const list$1 = "_list_y4mxb_105";
15942
+ const row = "_row_y4mxb_120";
15943
+ const icon = "_icon_y4mxb_149";
15944
+ const text = "_text_y4mxb_157";
15945
+ const title = "_title_y4mxb_165";
15946
+ const subtitle = "_subtitle_y4mxb_172";
15947
+ const chevron = "_chevron_y4mxb_178";
15948
+ const dropdown = "_dropdown_y4mxb_187";
15931
15949
  const styles$1 = {
15932
15950
  overlay,
15933
15951
  scrim,
@@ -16137,6 +16155,7 @@ function ShopMenuSheet({ open, onClose, onManageOrders, onHelp, closeLabel, labe
16137
16155
  }), jsx("ul", {
16138
16156
  className: styles$1.list,
16139
16157
  children: rows.map((row2) => jsx("li", {
16158
+ "data-row": row2.key,
16140
16159
  children: jsxs("button", {
16141
16160
  type: "button",
16142
16161
  className: styles$1.row,