@anker-in/headless-ui 1.3.41 → 1.3.43

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 (65) hide show
  1. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  2. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +2 -2
  3. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +3 -1
  4. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  5. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  6. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.d.ts +9 -1
  7. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js +1 -1
  8. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js.map +3 -3
  9. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  11. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  12. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  13. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  14. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  15. package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.d.ts +7 -0
  16. package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.js +2 -0
  17. package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.js.map +7 -0
  18. package/dist/cjs/biz-components/NotifyMeDialog/index.d.ts +2 -0
  19. package/dist/cjs/biz-components/NotifyMeDialog/index.js +2 -0
  20. package/dist/cjs/biz-components/NotifyMeDialog/index.js.map +7 -0
  21. package/dist/cjs/biz-components/NotifyMeDialog/types.d.ts +111 -0
  22. package/dist/cjs/biz-components/NotifyMeDialog/types.js +2 -0
  23. package/dist/cjs/biz-components/NotifyMeDialog/types.js.map +7 -0
  24. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  25. package/dist/cjs/biz-components/ProductNav/ProductNav.js.map +3 -3
  26. package/dist/cjs/biz-components/ProductNav/types.d.ts +3 -1
  27. package/dist/cjs/biz-components/ProductNav/types.js.map +1 -1
  28. package/dist/cjs/biz-components/index.d.ts +2 -0
  29. package/dist/cjs/biz-components/index.js +1 -1
  30. package/dist/cjs/biz-components/index.js.map +3 -3
  31. package/dist/cjs/components/tabs.js +1 -1
  32. package/dist/cjs/components/tabs.js.map +2 -2
  33. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  34. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +2 -2
  35. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +3 -1
  36. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  37. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  38. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.d.ts +9 -1
  39. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js +1 -1
  40. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js.map +3 -3
  41. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  42. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  43. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  44. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  45. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  46. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  47. package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.d.ts +7 -0
  48. package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.js +2 -0
  49. package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.js.map +7 -0
  50. package/dist/esm/biz-components/NotifyMeDialog/index.d.ts +2 -0
  51. package/dist/esm/biz-components/NotifyMeDialog/index.js +2 -0
  52. package/dist/esm/biz-components/NotifyMeDialog/index.js.map +7 -0
  53. package/dist/esm/biz-components/NotifyMeDialog/types.d.ts +111 -0
  54. package/dist/esm/biz-components/NotifyMeDialog/types.js +1 -0
  55. package/dist/esm/biz-components/NotifyMeDialog/types.js.map +7 -0
  56. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  57. package/dist/esm/biz-components/ProductNav/ProductNav.js.map +3 -3
  58. package/dist/esm/biz-components/ProductNav/types.d.ts +3 -1
  59. package/dist/esm/biz-components/index.d.ts +2 -0
  60. package/dist/esm/biz-components/index.js +1 -1
  61. package/dist/esm/biz-components/index.js.map +3 -3
  62. package/dist/esm/components/tabs.js +1 -1
  63. package/dist/esm/components/tabs.js.map +2 -2
  64. package/package.json +1 -1
  65. package/style.css +33 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/NotifyMeDialog/NotifyMeDialog.tsx"],
4
+ "sourcesContent": ["'use client'\n\nimport { useCallback, useEffect, useState } from 'react'\nimport {\n Button,\n Text,\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n Input,\n Checkbox,\n Heading,\n} from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport type { NotifyMeDialogProps } from './types.js'\nimport * as React from 'react'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { gaTrack } from '../../shared/track.js'\n\nconst componentType = 'copy'\nconst componentName = 'NotifyMeDialog'\n\ntype EmailState = 'idle' | 'error-empty' | 'error-format'\ntype SubmitState = 'idle' | 'loading' | 'success' | 'error-submit'\n\nconst EMAIL_REGEX = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n\nconst NotifyMeDialog = ({\n open,\n onOpenChange,\n copy,\n classNames,\n checkboxes = [],\n subscriptionMeta,\n onSubmit,\n}: NotifyMeDialogProps) => {\n const {\n title,\n subTitle,\n emailLabel = 'Email address',\n emailPlaceholder = 'your@email.com',\n submitBtnText = 'Notify Me',\n errorEmpty,\n errorInvalidEmail,\n errorCheckboxRequired,\n errorSubmit = 'Something went wrong. Please try again.',\n errorSubmitDetail,\n successTitle,\n successDesc,\n successBtnText,\n } = copy\n\n const notifyMeDialogRef = React.useRef<HTMLDivElement>(null)\n const { trackingData } = useAiuiContext()\n useExposure(notifyMeDialogRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subTitle,\n })\n\n const [email, setEmail] = useState('')\n const [checkedStates, setCheckedStates] = useState<boolean[]>(() => checkboxes.map(() => false))\n const [emailState, setEmailState] = useState<EmailState>('idle')\n const [checkboxErrors, setCheckboxErrors] = useState<boolean[]>(() => checkboxes.map(() => false))\n const [submitState, setSubmitState] = useState<SubmitState>('idle')\n const [errorCode, setErrorCode] = useState<string | null>(null)\n\n // \u6839\u636E\u9519\u8BEF\u7801\u5339\u914D\u5BF9\u5E94\u6587\u6848\uFF0C\u672A\u5339\u914D\u5230\u5219\u56DE\u9000\u5230 errorSubmit\n const resolvedErrorMessage = errorCode\n ? (errorSubmitDetail?.find(d => d.code === errorCode)?.message ?? errorSubmit)\n : errorSubmit\n\n // \u662F\u5426\u53EF\u4EE5\u70B9\u51FB\u63D0\u4EA4\uFF08loading/success \u65F6\u7981\u7528\uFF09\n const canSubmit = submitState !== 'loading' && submitState !== 'success'\n\n // checkbox \u72B6\u6001\u53D8\u5316\n const updateCheckedState = useCallback(\n (index: number) => {\n // checkbox \u70B9\u51FB\u57CB\u70B9\n const cb = checkboxes[index]\n if (cb) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: trackingData.pageGroup || 'Home Page',\n component_type: componentType,\n component_name: componentName,\n button_name: cb.label,\n component_title: title,\n component_description: subTitle || '',\n },\n })\n }\n\n setCheckedStates(prev => {\n const next = [...prev]\n next[index] = !next[index]\n return next\n })\n // \u6E05\u9664\u5F53\u524D checkbox \u7684\u9519\u8BEF\u72B6\u6001\n setCheckboxErrors(prev => {\n const next = [...prev]\n next[index] = false\n return next\n })\n // \u6E05\u9664\u90AE\u7BB1\u9519\u8BEF\u548C\u63D0\u4EA4\u9519\u8BEF\n if (emailState !== 'idle') setEmailState('idle')\n if (submitState === 'error-submit') {\n setSubmitState('idle')\n setErrorCode(null)\n }\n },\n [emailState, submitState]\n )\n\n // \u90AE\u7BB1\u8F93\u5165\u53D8\u5316\n const handleEmailChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n setEmail(e.target.value)\n if (emailState !== 'idle') setEmailState('idle')\n setCheckboxErrors(prev => (prev.some(Boolean) ? prev.map(() => false) : prev))\n if (submitState === 'error-submit') {\n setSubmitState('idle')\n setErrorCode(null)\n }\n },\n [emailState, submitState]\n )\n\n /**\n * \u5BA2\u6237\u7AEF onSubmit \u8C03\u7528\u793A\u4F8B\n *\n * \u63A5\u53E3\u5931\u8D25\u65F6\u9700 throw { code } \u4EE5\u4FBF\u7EC4\u4EF6\u6309 errorSubmitDetail \u5339\u914D\u5BF9\u5E94\u63D0\u793A\u6587\u6848\uFF0C\n * code \u4E3A number \u7C7B\u578B\u65F6\u7EC4\u4EF6\u4F1A\u81EA\u52A8\u8F6C\u4E3A string \u8FDB\u884C\u5339\u914D\u3002\n *\n * @example\n * const handleNotifyMeSubmit = useCallback(\n * async (params) => {\n * const { email, checkedItems, meta } = params\n * const res = await fetch('/api/multipass/shopifyservices/product_arrival_notices', {\n * method: 'POST',\n * headers: {\n * 'Content-Type': 'application/json',\n * 'current-language': locale,\n * },\n * body: JSON.stringify({\n * email,\n * locale,\n * sku: variant.sku,\n * shop: shop.primaryDomain?.host,\n * }),\n * })\n * if (res.ok) {\n * if (checkedItems?.some?.((item) => item.checked && item.checkbox_id === 'subscribe')) {\n * subscribe({ email, dealsType: 'outStockNotify_subscribe_emails' })\n * }\n * } else {\n * throw { code: res.status }\n * }\n * },\n * [locale, variant.sku, shop.primaryDomain?.host, subscribe],\n * )\n */\n // \u70B9\u51FB\u63D0\u4EA4\n const handleSubmit = useCallback(async () => {\n // \u70B9\u51FB\u63D0\u4EA4\u57CB\u70B9\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: trackingData.pageGroup || 'Home Page',\n component_type: componentType,\n component_name: componentName,\n button_name: submitBtnText,\n component_title: title,\n component_description: subTitle || '',\n },\n })\n\n let hasError = false\n\n // \u6821\u9A8C\u90AE\u7BB1\u975E\u7A7A\n if (!email.trim()) {\n setEmailState('error-empty')\n hasError = true\n } else if (!EMAIL_REGEX.test(email.trim())) {\n setEmailState('error-format')\n hasError = true\n } else {\n setEmailState('idle')\n }\n\n // \u6821\u9A8C required checkbox\n const newCheckboxErrors = checkboxes.map((cb, i) => {\n if (cb.label && cb.required && !checkedStates[i]) {\n hasError = true\n return true\n }\n return false\n })\n setCheckboxErrors(newCheckboxErrors)\n\n if (hasError) return\n\n setSubmitState('loading')\n try {\n const checkedItems = checkboxes\n .map((cb, i) =>\n cb.checkbox_id !== undefined ? { checkbox_id: cb.checkbox_id!, checked: checkedStates[i] } : null\n )\n .filter((item): item is { checkbox_id: string; checked: boolean } => item !== null)\n await onSubmit({ email: email.trim(), checkedItems, meta: subscriptionMeta })\n setSubmitState('success')\n } catch (err: unknown) {\n const code =\n err && typeof err === 'object' && 'code' in err ? String((err as Record<string, unknown>).code) : null\n setErrorCode(code)\n setSubmitState('error-submit')\n }\n }, [email, checkboxes, checkedStates, subscriptionMeta, onSubmit])\n\n // error-submit 3s \u540E\u81EA\u52A8\u6D88\u5931\n useEffect(() => {\n if (submitState !== 'error-submit') return\n const timer = setTimeout(() => {\n setSubmitState('idle')\n setErrorCode(null)\n }, 3000)\n return () => clearTimeout(timer)\n }, [submitState])\n\n // \u5173\u95ED\u5F39\u7A97\u65F6\u91CD\u7F6E\n const handleOpenChange = useCallback(\n (isOpen: boolean) => {\n if (!isOpen) {\n setEmail('')\n setCheckedStates(checkboxes.map(() => false))\n setEmailState('idle')\n setCheckboxErrors(checkboxes.map(() => false))\n setSubmitState('idle')\n setErrorCode(null)\n }\n onOpenChange(isOpen)\n },\n [checkboxes, onOpenChange]\n )\n\n const hasCheckboxes = checkboxes.some(cb => cb.label)\n\n return (\n <Dialog open={open} onOpenChange={handleOpenChange}>\n <DialogContent\n ref={notifyMeDialogRef}\n aria-describedby=\"notify-me-content\"\n className={cn(\n 'laptop:max-w-[480px] laptop:[&_.dialog-close-icon]:size-6 laptop:gap-8 rounded-box laptop:p-8 max-h-[90vh] w-[calc(100%-32px)] gap-6 overflow-y-auto bg-white p-6 [&_.dialog-close-icon]:size-5',\n classNames?.root\n )}\n >\n {submitState !== 'success' && (\n <DialogHeader className={cn(classNames?.header)}>\n <DialogTitle>\n <Heading as=\"h2\" size={2} className={cn('text-info-primary text-center font-bold', classNames?.title)}>\n {title}\n </Heading>\n </DialogTitle>\n {subTitle && (\n <DialogDescription asChild>\n <Text\n as=\"p\"\n className={cn('text-info-primary laptop:text-base mt-1 text-center text-sm', classNames?.subTitle)}\n >\n {subTitle}\n </Text>\n </DialogDescription>\n )}\n </DialogHeader>\n )}\n\n {submitState === 'success' ? (\n <div className={cn('flex flex-col items-center text-center', classNames?.successText)}>\n {/* \u6210\u529F\u56FE\u6807 */}\n <div className=\"flex size-20 items-center justify-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"80\" height=\"80\" viewBox=\"0 0 80 80\" fill=\"none\">\n <circle cx=\"40\" cy=\"40\" r=\"35\" fill=\"#30D158\" />\n <path\n d=\"M23.3333 38.3333L36.6666 50L56.6666 30\"\n stroke=\"white\"\n strokeWidth=\"6.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n <div className=\"mt-4\">\n {/* \u6807\u9898 */}\n <Heading as=\"h3\" size={2} className=\"text-info-primary font-bold\">\n {successTitle}\n </Heading>\n {/* \u526F\u6587\u6848 */}\n {successDesc && (\n <Text as=\"p\" className=\"text-info-primary laptop:text-base mt-1 text-sm\">\n {successDesc}\n </Text>\n )}\n </div>\n {/* \u786E\u8BA4\u6309\u94AE */}\n {successBtnText && (\n <Button\n variant=\"primary\"\n size=\"lg\"\n onClick={() => onOpenChange(false)}\n className=\"laptop:mt-8 mt-6 w-full\"\n >\n {successBtnText}\n </Button>\n )}\n </div>\n ) : (\n <div className=\"flex flex-col gap-4\">\n {/* \u90AE\u7BB1\u8F93\u5165\u6846 */}\n <div className={classNames?.emailInput}>\n <Text\n as=\"label\"\n htmlFor=\"notify-me-email\"\n className=\"text-info-primary laptop:text-base mb-2 block text-sm\"\n >\n {emailLabel}\n </Text>\n <Input\n id=\"notify-me-email\"\n type=\"email\"\n placeholder={emailPlaceholder}\n value={email}\n onChange={handleEmailChange}\n disabled={submitState === 'loading'}\n className={cn(\n 'placeholder:text-info-tertiary text-info-primary laptop:h-[54px] laptop:text-base laptop:p-4 border-lines-1 h-[44px] w-full bg-white p-3 text-sm font-bold placeholder:font-bold focus-visible:!outline-none',\n emailState !== 'idle' && 'border-error-0'\n )}\n />\n {emailState === 'error-empty' && (\n <Text as=\"p\" className=\"text-error-0 laptop:text-base mt-2 text-sm\">\n {errorEmpty}\n </Text>\n )}\n {emailState === 'error-format' && (\n <Text as=\"p\" className=\"text-error-0 laptop:text-base mt-2 text-sm\">\n {errorInvalidEmail}\n </Text>\n )}\n </div>\n\n {/* Checkboxes \u5217\u8868 */}\n {hasCheckboxes && (\n <div className={cn('laptop:gap-4 flex flex-col gap-2', classNames?.checkboxes)}>\n {checkboxes.map((cb, i) => {\n if (!cb.label) return null\n return (\n <div key={i}>\n <label\n className={cn(\n 'text-info-tertiary flex cursor-pointer items-start gap-2',\n classNames?.checkboxItem\n )}\n >\n <Checkbox\n checked={checkedStates[i]}\n onCheckedChange={() => updateCheckedState(i)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`''#''#${cb.label}`}\n data-headless-nav-position={`''#1`}\n disabled={submitState === 'loading'}\n className=\"border-info-secondary data-[state=checked]:bg-info-secondary mt-0.5 shrink-0\"\n />\n <Text\n as=\"span\"\n className=\"text-info-tertiary laptop:text-base [&_a]:text-brand-0 text-sm leading-snug [&_a]:underline\"\n html={cb.label}\n />\n </label>\n {checkboxErrors[i] && (\n <Text as=\"p\" className=\"text-error-0 laptop:text-base mt-2 text-sm\">\n {errorCheckboxRequired}\n </Text>\n )}\n </div>\n )\n })}\n </div>\n )}\n\n {/* \u63D0\u4EA4\u6309\u94AE */}\n <Button\n variant=\"primary\"\n size=\"lg\"\n loading={submitState === 'loading'}\n disabled={!canSubmit}\n onClick={handleSubmit}\n className={cn('w-full', classNames?.submitBtn)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`''#''#${submitBtnText}`}\n data-headless-nav-position={`''#1`}\n >\n {submitBtnText}\n </Button>\n\n {/* \u63D0\u4EA4\u9519\u8BEF\uFF08\u5F39\u7A97\u6700\u5E95\u90E8\uFF09 */}\n {submitState === 'error-submit' && (\n <Text as=\"p\" className={cn('text-error-0 laptop:text-base text-sm', classNames?.errorText)}>\n {resolvedErrorMessage}\n </Text>\n )}\n </div>\n )}\n </DialogContent>\n </Dialog>\n )\n}\n\nNotifyMeDialog.displayName = 'NotifyMeDialog'\n\nexport default NotifyMeDialog\nexport type { NotifyMeDialogProps }\n"],
5
+ "mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAyQU,IAAAI,EAAA,6BAvQVC,EAAiD,iBACjDC,EAWO,qCACPC,EAAmB,kCAEnBC,GAAuB,qBACvBC,EAA4B,sCAC5BC,EAA+B,oCAC/BC,EAAwB,iCAExB,MAAMC,EAAgB,OAChBC,EAAgB,iBAKhBC,GAAc,6BAEdC,E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H,GAEJ,EAGC0C,OACC,OAAC,OAAI,aAAW,MAAG,mCAAoCpD,GAAY,UAAU,EAC1E,SAAAC,EAAW,IAAI,CAACmC,EAAIS,IACdT,EAAG,SAEN,QAAC,OACC,qBAAC,SACC,aAAW,MACT,2DACApC,GAAY,YACd,EAEA,oBAAC,YACC,QAASqB,EAAcwB,CAAC,EACxB,gBAAiB,IAAMX,EAAmBW,CAAC,EAC3C,0BAAyB,GAAGpD,CAAa,IAAIC,CAAa,GAC1D,kCAAiC,SAAS0C,EAAG,KAAK,GAClD,6BAA4B,OAC5B,SAAUT,IAAgB,UAC1B,UAAU,+EACZ,KACA,OAAC,QACC,GAAG,OACH,UAAU,8FACV,KAAMS,EAAG,MACX,GACF,EACCX,EAAeoB,CAAC,MACf,OAAC,QAAK,GAAG,IAAI,UAAU,6CACpB,SAAAlC,EACH,IAzBMkC,CA2BV,EA7BoB,IA+BvB,EACH,KAIF,OAAC,UACC,QAAQ,UACR,KAAK,KACL,QAASlB,IAAgB,UACzB,SAAU,CAACM,EACX,QAASQ,GACT,aAAW,MAAG,SAAUzC,GAAY,SAAS,EAC7C,0BAAyB,GAAGP,CAAa,IAAIC,CAAa,GAC1D,kCAAiC,SAASc,CAAa,GACvD,6BAA4B,OAE3B,SAAAA,EACH,EAGCmB,IAAgB,mBACf,OAAC,QAAK,GAAG,IAAI,aAAW,MAAG,wCAAyC3B,GAAY,SAAS,EACtF,SAAA+B,EACH,GAEJ,GAEJ,EACF,CAEJ,EAEAnC,EAAe,YAAc,iBAE7B,IAAOb,GAAQa",
6
+ "names": ["NotifyMeDialog_exports", "__export", "NotifyMeDialog_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_helpers", "React", "import_useExposure", "import_AiuiProvider", "import_track", "componentType", "componentName", "EMAIL_REGEX", "NotifyMeDialog", "open", "onOpenChange", "copy", "classNames", "checkboxes", "subscriptionMeta", "onSubmit", "title", "subTitle", "emailLabel", "emailPlaceholder", "submitBtnText", "errorEmpty", "errorInvalidEmail", "errorCheckboxRequired", "errorSubmit", "errorSubmitDetail", "successTitle", "successDesc", "successBtnText", "notifyMeDialogRef", "trackingData", "email", "setEmail", "checkedStates", "setCheckedStates", "emailState", "setEmailState", "checkboxErrors", "setCheckboxErrors", "submitState", "setSubmitState", "errorCode", "setErrorCode", "resolvedErrorMessage", "d", "canSubmit", "updateCheckedState", "index", "cb", "prev", "next", "handleEmailChange", "e", "handleSubmit", "hasError", "newCheckboxErrors", "checkedItems", "i", "item", "err", "code", "timer", "handleOpenChange", "isOpen", "hasCheckboxes"]
7
+ }
@@ -0,0 +1,2 @@
1
+ export { default as NotifyMeDialog } from './NotifyMeDialog.js';
2
+ export type { NotifyMeDialogProps, NotifyMeDialogCopy, NotifyMeDialogSemanticName, CheckboxConfig, ErrorDetail, SubscribeFormData, SubscriptionMeta, } from './types.js';
@@ -0,0 +1,2 @@
1
+ "use strict";var y=Object.create;var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var m=(o,e)=>{for(var i in e)a(o,i,{get:e[i],enumerable:!0})},f=(o,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of s(e))!g.call(o,t)&&t!==i&&a(o,t,{get:()=>e[t],enumerable:!(r=l(e,t))||r.enumerable});return o};var M=(o,e,i)=>(i=o!=null?y(D(o)):{},f(e||!o||!o.__esModule?a(i,"default",{value:o,enumerable:!0}):i,o)),N=o=>f(a({},"__esModule",{value:!0}),o);var b={};m(b,{NotifyMeDialog:()=>p.default});module.exports=N(b);var p=M(require("./NotifyMeDialog.js"));
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/NotifyMeDialog/index.tsx"],
4
+ "sourcesContent": ["export { default as NotifyMeDialog } from './NotifyMeDialog.js'\nexport type {\n NotifyMeDialogProps,\n NotifyMeDialogCopy,\n NotifyMeDialogSemanticName,\n CheckboxConfig,\n ErrorDetail,\n SubscribeFormData,\n SubscriptionMeta,\n} from './types.js'\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+CAAAE,EAAAF,GAAA,IAAAG,EAA0C",
6
+ "names": ["NotifyMeDialog_exports", "__export", "__toCommonJS", "import_NotifyMeDialog"]
7
+ }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * CheckboxConfig - 勾选框配置
3
+ *
4
+ * 每项独立控制展示与提交限制,顺序按数组顺序渲染。
5
+ * label 有值时展示该项,无值时跳过不渲染。
6
+ */
7
+ export interface CheckboxConfig {
8
+ /** checkbox 名称标识,用于提交时识别选中了哪些项 */
9
+ checkbox_id: string;
10
+ /** checkbox 旁展示的文案;为空或不传则不渲染该 checkbox */
11
+ label: string;
12
+ /** 是否必须勾选才能提交;true 时未勾选则按钮 disabled;默认 false */
13
+ required?: boolean;
14
+ }
15
+ /**
16
+ * SubscriptionMeta - 订阅元数据
17
+ *
18
+ * 区分 OOS 到货通知和活动订阅两种模式,确保提交时携带正确的业务参数。
19
+ */
20
+ export type SubscriptionMeta = {
21
+ /** 固定值,标识 OOS 到货通知 */
22
+ mode: 'oos';
23
+ } | {
24
+ /** 固定值,标识活动订阅 */
25
+ mode: 'activity';
26
+ /** 活动标识,由业务层从 activeNotifyInfo 配置中读取 */
27
+ dealsType: string;
28
+ };
29
+ /**
30
+ * ErrorDetail - 按错误码映射错误提示
31
+ *
32
+ * 支持消费方根据接口返回的错误码配置不同的提示文案。
33
+ * code 匹配时显示对应 message;未匹配到则回退到 errorSubmit。
34
+ */
35
+ export interface ErrorDetail {
36
+ /** 错误码,如 "422"、"500" */
37
+ code: string;
38
+ /** 该错误码对应的提示文案 */
39
+ message: string;
40
+ }
41
+ /**
42
+ * NotifyMeDialogCopy - 文案配置
43
+ *
44
+ * 将弹窗内所有可配置文案集中到一个对象中,
45
+ * 方便从 CMS / 多语言配置层一次性传入。
46
+ */
47
+ export interface NotifyMeDialogCopy {
48
+ /** 弹窗主标题,如 "Email me when available" */
49
+ title: string;
50
+ /** 弹窗副标题;为空时不渲染 */
51
+ subTitle?: string;
52
+ /** 邮箱输入框占位文案 */
53
+ emailPlaceholder?: string;
54
+ /** 提交按钮文案 */
55
+ submitBtnText?: string;
56
+ /** 邮箱输入框标签文案,默认 "Email address" */
57
+ emailLabel?: string;
58
+ /** 邮箱输入框为空时的错误提示 */
59
+ errorEmpty: string;
60
+ /** 邮箱格式不合法时的错误提示 */
61
+ errorInvalidEmail: string;
62
+ /** 必选 checkbox 未勾选时的提示文案 */
63
+ errorCheckboxRequired: string;
64
+ /** 接口调用失败时的默认错误提示,当 errorSubmitDetail 中未匹配到对应 code 时使用 */
65
+ errorSubmit?: string;
66
+ /** 按错误码映射的错误提示,code 匹配到时显示对应 message;未传入或不匹配时回退到 errorSubmit */
67
+ errorSubmitDetail?: ErrorDetail[];
68
+ /** 提交成功后的主标题 */
69
+ successTitle: string;
70
+ /** 提交成功后的副文案;为空时不渲染 */
71
+ successDesc?: string;
72
+ /** 提交成功后的按钮文案;为空时不渲染按钮 */
73
+ successBtnText?: string;
74
+ }
75
+ /**
76
+ * NotifyMeDialogSemanticName - 组件语义化区域名
77
+ *
78
+ * 用于 classNames prop,按语义区域自定义样式。
79
+ * 未传入的 key 使用组件默认样式。
80
+ */
81
+ export type NotifyMeDialogSemanticName = 'root' | 'header' | 'title' | 'subTitle' | 'emailInput' | 'checkboxes' | 'checkboxItem' | 'submitBtn' | 'errorText' | 'successText';
82
+ /**
83
+ * SubscribeFormData - 提交时暴露的完整表单数据
84
+ */
85
+ export interface SubscribeFormData {
86
+ /** 用户输入的邮箱 */
87
+ email: string;
88
+ /** 各 checkbox 的状态列表,仅包含配置了 name 的项 */
89
+ checkedItems: {
90
+ checkbox_id: string;
91
+ checked: boolean;
92
+ }[];
93
+ /** 订阅元数据 */
94
+ meta: SubscriptionMeta;
95
+ }
96
+ export interface NotifyMeDialogProps {
97
+ /** 是否打开弹窗 */
98
+ open: boolean;
99
+ /** 关闭弹窗回调 */
100
+ onOpenChange: (open: boolean) => void;
101
+ /** 文案配置 */
102
+ copy: NotifyMeDialogCopy;
103
+ /** 各区域自定义样式 */
104
+ classNames?: Partial<Record<NotifyMeDialogSemanticName, string>>;
105
+ /** 勾选框列表,支持配置多个;每项 label 有值时展示,无值时跳过 */
106
+ checkboxes?: CheckboxConfig[];
107
+ /** 订阅元数据,区分 OOS / 活动两种模式 */
108
+ subscriptionMeta: SubscriptionMeta;
109
+ /** 提交回调,接收完整表单数据,业务层决定调哪个接口 */
110
+ onSubmit: (data: SubscribeFormData) => Promise<void>;
111
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(t,e,s,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of n(e))!c.call(t,i)&&i!==s&&o(t,i,{get:()=>e[i],enumerable:!(r=a(e,i))||r.enumerable});return t};var b=t=>l(o({},"__esModule",{value:!0}),t);var g={};module.exports=b(g);
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/NotifyMeDialog/types.ts"],
4
+ "sourcesContent": ["/**\n * CheckboxConfig - \u52FE\u9009\u6846\u914D\u7F6E\n *\n * \u6BCF\u9879\u72EC\u7ACB\u63A7\u5236\u5C55\u793A\u4E0E\u63D0\u4EA4\u9650\u5236\uFF0C\u987A\u5E8F\u6309\u6570\u7EC4\u987A\u5E8F\u6E32\u67D3\u3002\n * label \u6709\u503C\u65F6\u5C55\u793A\u8BE5\u9879\uFF0C\u65E0\u503C\u65F6\u8DF3\u8FC7\u4E0D\u6E32\u67D3\u3002\n */\nexport interface CheckboxConfig {\n /** checkbox \u540D\u79F0\u6807\u8BC6\uFF0C\u7528\u4E8E\u63D0\u4EA4\u65F6\u8BC6\u522B\u9009\u4E2D\u4E86\u54EA\u4E9B\u9879 */\n checkbox_id: string\n /** checkbox \u65C1\u5C55\u793A\u7684\u6587\u6848\uFF1B\u4E3A\u7A7A\u6216\u4E0D\u4F20\u5219\u4E0D\u6E32\u67D3\u8BE5 checkbox */\n label: string\n /** \u662F\u5426\u5FC5\u987B\u52FE\u9009\u624D\u80FD\u63D0\u4EA4\uFF1Btrue \u65F6\u672A\u52FE\u9009\u5219\u6309\u94AE disabled\uFF1B\u9ED8\u8BA4 false */\n required?: boolean\n}\n\n/**\n * SubscriptionMeta - \u8BA2\u9605\u5143\u6570\u636E\n *\n * \u533A\u5206 OOS \u5230\u8D27\u901A\u77E5\u548C\u6D3B\u52A8\u8BA2\u9605\u4E24\u79CD\u6A21\u5F0F\uFF0C\u786E\u4FDD\u63D0\u4EA4\u65F6\u643A\u5E26\u6B63\u786E\u7684\u4E1A\u52A1\u53C2\u6570\u3002\n */\nexport type SubscriptionMeta =\n | {\n /** \u56FA\u5B9A\u503C\uFF0C\u6807\u8BC6 OOS \u5230\u8D27\u901A\u77E5 */\n mode: 'oos'\n }\n | {\n /** \u56FA\u5B9A\u503C\uFF0C\u6807\u8BC6\u6D3B\u52A8\u8BA2\u9605 */\n mode: 'activity'\n /** \u6D3B\u52A8\u6807\u8BC6\uFF0C\u7531\u4E1A\u52A1\u5C42\u4ECE activeNotifyInfo \u914D\u7F6E\u4E2D\u8BFB\u53D6 */\n dealsType: string\n }\n\n/**\n * ErrorDetail - \u6309\u9519\u8BEF\u7801\u6620\u5C04\u9519\u8BEF\u63D0\u793A\n *\n * \u652F\u6301\u6D88\u8D39\u65B9\u6839\u636E\u63A5\u53E3\u8FD4\u56DE\u7684\u9519\u8BEF\u7801\u914D\u7F6E\u4E0D\u540C\u7684\u63D0\u793A\u6587\u6848\u3002\n * code \u5339\u914D\u65F6\u663E\u793A\u5BF9\u5E94 message\uFF1B\u672A\u5339\u914D\u5230\u5219\u56DE\u9000\u5230 errorSubmit\u3002\n */\nexport interface ErrorDetail {\n /** \u9519\u8BEF\u7801\uFF0C\u5982 \"422\"\u3001\"500\" */\n code: string\n /** \u8BE5\u9519\u8BEF\u7801\u5BF9\u5E94\u7684\u63D0\u793A\u6587\u6848 */\n message: string\n}\n\n/**\n * NotifyMeDialogCopy - \u6587\u6848\u914D\u7F6E\n *\n * \u5C06\u5F39\u7A97\u5185\u6240\u6709\u53EF\u914D\u7F6E\u6587\u6848\u96C6\u4E2D\u5230\u4E00\u4E2A\u5BF9\u8C61\u4E2D\uFF0C\n * \u65B9\u4FBF\u4ECE CMS / \u591A\u8BED\u8A00\u914D\u7F6E\u5C42\u4E00\u6B21\u6027\u4F20\u5165\u3002\n */\nexport interface NotifyMeDialogCopy {\n /** \u5F39\u7A97\u4E3B\u6807\u9898\uFF0C\u5982 \"Email me when available\" */\n title: string\n /** \u5F39\u7A97\u526F\u6807\u9898\uFF1B\u4E3A\u7A7A\u65F6\u4E0D\u6E32\u67D3 */\n subTitle?: string\n /** \u90AE\u7BB1\u8F93\u5165\u6846\u5360\u4F4D\u6587\u6848 */\n emailPlaceholder?: string\n /** \u63D0\u4EA4\u6309\u94AE\u6587\u6848 */\n submitBtnText?: string\n /** \u90AE\u7BB1\u8F93\u5165\u6846\u6807\u7B7E\u6587\u6848\uFF0C\u9ED8\u8BA4 \"Email address\" */\n emailLabel?: string\n /** \u90AE\u7BB1\u8F93\u5165\u6846\u4E3A\u7A7A\u65F6\u7684\u9519\u8BEF\u63D0\u793A */\n errorEmpty: string\n /** \u90AE\u7BB1\u683C\u5F0F\u4E0D\u5408\u6CD5\u65F6\u7684\u9519\u8BEF\u63D0\u793A */\n errorInvalidEmail: string\n /** \u5FC5\u9009 checkbox \u672A\u52FE\u9009\u65F6\u7684\u63D0\u793A\u6587\u6848 */\n errorCheckboxRequired: string\n /** \u63A5\u53E3\u8C03\u7528\u5931\u8D25\u65F6\u7684\u9ED8\u8BA4\u9519\u8BEF\u63D0\u793A\uFF0C\u5F53 errorSubmitDetail \u4E2D\u672A\u5339\u914D\u5230\u5BF9\u5E94 code \u65F6\u4F7F\u7528 */\n errorSubmit?: string\n /** \u6309\u9519\u8BEF\u7801\u6620\u5C04\u7684\u9519\u8BEF\u63D0\u793A\uFF0Ccode \u5339\u914D\u5230\u65F6\u663E\u793A\u5BF9\u5E94 message\uFF1B\u672A\u4F20\u5165\u6216\u4E0D\u5339\u914D\u65F6\u56DE\u9000\u5230 errorSubmit */\n errorSubmitDetail?: ErrorDetail[]\n /** \u63D0\u4EA4\u6210\u529F\u540E\u7684\u4E3B\u6807\u9898 */\n successTitle: string\n /** \u63D0\u4EA4\u6210\u529F\u540E\u7684\u526F\u6587\u6848\uFF1B\u4E3A\u7A7A\u65F6\u4E0D\u6E32\u67D3 */\n successDesc?: string\n /** \u63D0\u4EA4\u6210\u529F\u540E\u7684\u6309\u94AE\u6587\u6848\uFF1B\u4E3A\u7A7A\u65F6\u4E0D\u6E32\u67D3\u6309\u94AE */\n successBtnText?: string\n}\n\n/**\n * NotifyMeDialogSemanticName - \u7EC4\u4EF6\u8BED\u4E49\u5316\u533A\u57DF\u540D\n *\n * \u7528\u4E8E classNames prop\uFF0C\u6309\u8BED\u4E49\u533A\u57DF\u81EA\u5B9A\u4E49\u6837\u5F0F\u3002\n * \u672A\u4F20\u5165\u7684 key \u4F7F\u7528\u7EC4\u4EF6\u9ED8\u8BA4\u6837\u5F0F\u3002\n */\nexport type NotifyMeDialogSemanticName =\n | 'root'\n | 'header'\n | 'title'\n | 'subTitle'\n | 'emailInput'\n | 'checkboxes'\n | 'checkboxItem'\n | 'submitBtn'\n | 'errorText'\n | 'successText'\n\n/**\n * SubscribeFormData - \u63D0\u4EA4\u65F6\u66B4\u9732\u7684\u5B8C\u6574\u8868\u5355\u6570\u636E\n */\nexport interface SubscribeFormData {\n /** \u7528\u6237\u8F93\u5165\u7684\u90AE\u7BB1 */\n email: string\n /** \u5404 checkbox \u7684\u72B6\u6001\u5217\u8868\uFF0C\u4EC5\u5305\u542B\u914D\u7F6E\u4E86 name \u7684\u9879 */\n checkedItems: { checkbox_id: string; checked: boolean }[]\n /** \u8BA2\u9605\u5143\u6570\u636E */\n meta: SubscriptionMeta\n}\n\nexport interface NotifyMeDialogProps {\n /** \u662F\u5426\u6253\u5F00\u5F39\u7A97 */\n open: boolean\n /** \u5173\u95ED\u5F39\u7A97\u56DE\u8C03 */\n onOpenChange: (open: boolean) => void\n /** \u6587\u6848\u914D\u7F6E */\n copy: NotifyMeDialogCopy\n /** \u5404\u533A\u57DF\u81EA\u5B9A\u4E49\u6837\u5F0F */\n classNames?: Partial<Record<NotifyMeDialogSemanticName, string>>\n /** \u52FE\u9009\u6846\u5217\u8868\uFF0C\u652F\u6301\u914D\u7F6E\u591A\u4E2A\uFF1B\u6BCF\u9879 label \u6709\u503C\u65F6\u5C55\u793A\uFF0C\u65E0\u503C\u65F6\u8DF3\u8FC7 */\n checkboxes?: CheckboxConfig[]\n /** \u8BA2\u9605\u5143\u6570\u636E\uFF0C\u533A\u5206 OOS / \u6D3B\u52A8\u4E24\u79CD\u6A21\u5F0F */\n subscriptionMeta: SubscriptionMeta\n /** \u63D0\u4EA4\u56DE\u8C03\uFF0C\u63A5\u6536\u5B8C\u6574\u8868\u5355\u6570\u636E\uFF0C\u4E1A\u52A1\u5C42\u51B3\u5B9A\u8C03\u54EA\u4E2A\u63A5\u53E3 */\n onSubmit: (data: SubscribeFormData) => Promise<void>\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["types_exports", "__toCommonJS"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var F=Object.create;var N=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var $=(r,l)=>{for(var p in l)N(r,p,{get:l[p],enumerable:!0})},M=(r,l,p,x)=>{if(l&&typeof l=="object"||typeof l=="function")for(let c of I(l))!_.call(r,c)&&c!==p&&N(r,c,{get:()=>l[c],enumerable:!(x=G(l,c))||x.enumerable});return r};var q=(r,l,p)=>(p=r!=null?F(V(r)):{},M(l||!r||!r.__esModule?N(p,"default",{value:r,enumerable:!0}):p,r)),O=r=>M(N({},"__esModule",{value:!0}),r);var U={};$(U,{default:()=>Q});module.exports=O(U);var t=require("react/jsx-runtime"),n=require("react"),E=require("../../helpers/utils.js"),H=require("../../shared/Styles.js"),m=require("../../components/index.js"),A=require("../../hooks/useExposure.js"),S=q(require("@radix-ui/react-popover"));const W="navigation",J="product_nav",K=r=>(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:(0,t.jsx)("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),D=(0,n.forwardRef)(({className:r="",data:l,id:p,onAnchorClick:x,scrollOffsetExtra:c=0},B)=>{const{tabLinks:k=[],anchorList:i=[],textLink:d,buyBtn:f,theme:z="light"}=l||{},[j,b]=(0,n.useState)(""),g=(0,n.useRef)(null),y=(0,n.useRef)(!1),h=(0,n.useRef)(""),w=(0,n.useRef)(null),P=(0,n.useRef)(new Map);(0,n.useImperativeHandle)(B,()=>g.current),(0,A.useExposure)(g,{componentType:W,componentName:J});const T=(0,n.useCallback)(()=>{if(i.length===0)return;const e=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const o=new Map;i.forEach(a=>{const s=document.getElementById(a.id);if(s){const u=s.getBoundingClientRect();o.set(a.id,u.top+window.scrollY)}}),P.current=o,window.scrollTo({top:e,behavior:"instant"})})},[i]);(0,n.useEffect)(()=>{if(i.length===0)return;const e=setTimeout(T,100);return()=>clearTimeout(e)},[i,T]),(0,n.useEffect)(()=>{if(i.length===0)return;let e=null;const o=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(T,150)});return o.observe(document.body),()=>{o.disconnect(),e&&clearTimeout(e)}},[i,T]),(0,n.useEffect)(()=>{if(i.length===0)return;const e=()=>{if(y.current){w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{y.current=!1,h.current&&(b(h.current),h.current="")},100);return}const a=g.current?.offsetHeight||0,s=window.scrollY+a+c+10;let u="";const R=P.current;for(let v=i.length-1;v>=0;v--){const C=i[v],L=R.get(C.id);if(L!==void 0&&s>=L){u=C.id;break}}if(!u&&i.length>0){const v=R.get(i[0].id);v!==void 0&&s<v&&(u="")}b(u)},o=setTimeout(()=>{e()},200);return window.addEventListener("scroll",e,{passive:!0}),()=>{clearTimeout(o),window.removeEventListener("scroll",e),w.current&&clearTimeout(w.current)}},[i,c]),(0,n.useEffect)(()=>{const e=document.querySelectorAll(".header"),o=[];return e.forEach(a=>{const s=a;o.push({element:s,originalPosition:s.style.position||getComputedStyle(s).position}),s.style.position="relative"}),()=>{o.forEach(({element:a,originalPosition:s})=>{a.style.position=s==="static"?"":s})}},[]);const Y=(e,o)=>{e.preventDefault();const a=P.current.get(o);if(a===void 0){console.warn(`Cached position for "${o}" not found`);return}b(o),h.current=o,y.current=!0;const s=g.current?.offsetHeight||0,u=a-s-c;window.scrollTo({top:u,behavior:"smooth"}),window.history.pushState(null,"",`#${o}`)};return(0,t.jsxs)("div",{id:p,ref:g,className:(0,E.cn)("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":z==="dark"},r),children:[(0,t.jsxs)("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[(0,t.jsxs)("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[(0,t.jsxs)("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[k.map((e,o)=>(0,t.jsxs)("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[(0,t.jsx)("a",{href:e.link,className:(0,E.cn)("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":o!==0,"hidden desktop:block":o===1}),children:(0,t.jsx)("span",{children:e.label})}),o!==k.length-1&&(0,t.jsx)("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},e.link||o)),k.length>1&&(0,t.jsxs)(S.Root,{children:[(0,t.jsx)(S.Trigger,{asChild:!0,children:(0,t.jsx)("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:(0,t.jsx)(K,{className:"text-[#1D1D1F]"})})}),(0,t.jsx)(S.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:k.slice(1).map(e=>(0,t.jsx)("a",{href:e.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:(0,t.jsx)("span",{children:e.label})},e.link))})]})]}),(0,t.jsxs)("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[d?.link&&(0,t.jsx)("a",{href:d.link,target:d.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:(0,t.jsx)(m.Text,{size:2,className:"text-nowrap",children:d.text})}),f?.link&&(0,t.jsx)(m.Button,{as:"a",href:f.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:f.text})]})]}),(0,t.jsx)("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:i.map((e,o)=>(0,t.jsxs)("a",{href:`#${e.id}`,className:"product-nav-anchor-link",onClick:a=>{x?(a.preventDefault(),b(e.id),h.current=e.id,y.current=!0,x(e,o)):Y(a,e.id)},children:[(0,t.jsx)(m.Text,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),(0,t.jsx)("div",{className:(0,E.cn)("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":j===e.id})})]},e.id))})]}),(0,t.jsxs)("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[d?.link&&(0,t.jsx)("a",{href:d.link,target:d.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer text-black",children:(0,t.jsx)(m.Text,{size:2,className:"text-nowrap",children:d.text})}),f?.link&&(0,t.jsx)(m.Button,{as:"a",href:f.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:f.text})]})]})});D.displayName="ProductNav";var Q=(0,H.withLayout)(D);
1
+ "use strict";"use client";var G=Object.create;var E=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var O=(n,l)=>{for(var c in l)E(n,c,{get:l[c],enumerable:!0})},M=(n,l,c,h)=>{if(l&&typeof l=="object"||typeof l=="function")for(let p of _(l))!q.call(n,p)&&p!==c&&E(n,p,{get:()=>l[p],enumerable:!(h=V(l,p))||h.enumerable});return n};var W=(n,l,c)=>(c=n!=null?G($(n)):{},M(l||!n||!n.__esModule?E(c,"default",{value:n,enumerable:!0}):c,n)),J=n=>M(E({},"__esModule",{value:!0}),n);var Z={};O(Z,{default:()=>X});module.exports=J(Z);var e=require("react/jsx-runtime"),r=require("react"),S=require("../../helpers/utils.js"),H=require("../../shared/Styles.js"),m=require("../../components/index.js"),I=require("../../hooks/useExposure.js"),A=W(require("@radix-ui/react-popover"));const K="navigation",Q="product_nav",P=n=>n.anchorId??n.id??"",U=n=>(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:(0,e.jsx)("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),D=(0,r.forwardRef)(({className:n="",data:l,id:c,onAnchorClick:h,scrollOffsetExtra:p=0},B)=>{const{tabLinks:k=[],anchorList:a=[],textLink:u,buyBtn:f,theme:z="light"}=l||{},[j,b]=(0,r.useState)(""),x=(0,r.useRef)(null),y=(0,r.useRef)(!1),g=(0,r.useRef)(""),w=(0,r.useRef)(null),R=(0,r.useRef)(new Map);(0,r.useImperativeHandle)(B,()=>x.current),(0,I.useExposure)(x,{componentType:K,componentName:Q});const T=(0,r.useCallback)(()=>{if(a.length===0)return;const t=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const o=new Map;a.forEach(i=>{const s=P(i),d=document.getElementById(s);if(d){const N=d.getBoundingClientRect();o.set(s,N.top+window.scrollY)}}),R.current=o,window.scrollTo({top:t,behavior:"instant"})})},[a]);(0,r.useEffect)(()=>{if(a.length===0)return;const t=setTimeout(T,100);return()=>clearTimeout(t)},[a,T]),(0,r.useEffect)(()=>{if(a.length===0)return;let t=null;const o=new ResizeObserver(()=>{t&&clearTimeout(t),t=setTimeout(T,150)});return o.observe(document.body),()=>{o.disconnect(),t&&clearTimeout(t)}},[a,T]),(0,r.useEffect)(()=>{if(a.length===0)return;const t=()=>{if(y.current){w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{y.current=!1,g.current&&(b(g.current),g.current="")},100);return}const i=x.current?.offsetHeight||0,s=window.scrollY+i+p+10;let d="";const N=R.current;for(let v=a.length-1;v>=0;v--){const F=a[v],C=P(F),L=N.get(C);if(L!==void 0&&s>=L){d=C;break}}if(!d&&a.length>0){const v=N.get(P(a[0]));v!==void 0&&s<v&&(d="")}b(d)},o=setTimeout(()=>{t()},200);return window.addEventListener("scroll",t,{passive:!0}),()=>{clearTimeout(o),window.removeEventListener("scroll",t),w.current&&clearTimeout(w.current)}},[a,p]),(0,r.useEffect)(()=>{const t=document.querySelectorAll(".header"),o=[];return t.forEach(i=>{const s=i;o.push({element:s,originalPosition:s.style.position||getComputedStyle(s).position}),s.style.position="relative"}),()=>{o.forEach(({element:i,originalPosition:s})=>{i.style.position=s==="static"?"":s})}},[]);const Y=(t,o)=>{t.preventDefault();const i=R.current.get(o);if(i===void 0){console.warn(`Cached position for "${o}" not found`);return}b(o),g.current=o,y.current=!0;const s=x.current?.offsetHeight||0,d=i-s-p;window.scrollTo({top:d,behavior:"smooth"}),window.history.pushState(null,"",`#${o}`)};return(0,e.jsxs)("div",{id:c,ref:x,className:(0,S.cn)("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":z==="dark"},n),children:[(0,e.jsxs)("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[(0,e.jsxs)("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[(0,e.jsxs)("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[k.map((t,o)=>(0,e.jsxs)("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[(0,e.jsx)("a",{href:t.link,className:(0,S.cn)("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":o!==0,"hidden desktop:block":o===1}),children:(0,e.jsx)("span",{children:t.label})}),o!==k.length-1&&(0,e.jsx)("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},t.link||o)),k.length>1&&(0,e.jsxs)(A.Root,{children:[(0,e.jsx)(A.Trigger,{asChild:!0,children:(0,e.jsx)("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:(0,e.jsx)(U,{className:"text-[#1D1D1F]"})})}),(0,e.jsx)(A.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:k.slice(1).map(t=>(0,e.jsx)("a",{href:t.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:(0,e.jsx)("span",{children:t.label})},t.link))})]})]}),(0,e.jsxs)("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[u?.link&&(0,e.jsx)("a",{href:u.link,target:u.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:(0,e.jsx)(m.Text,{size:2,className:"text-nowrap",children:u.text})}),f?.link&&(0,e.jsx)(m.Button,{as:"a",href:f.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:f.text})]})]}),(0,e.jsx)("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:a.map((t,o)=>{const i=P(t);return(0,e.jsxs)("a",{href:`#${i}`,className:"product-nav-anchor-link",onClick:s=>{h?(s.preventDefault(),b(i),g.current=i,y.current=!0,h(t,o)):Y(s,i)},children:[(0,e.jsx)(m.Text,{size:2,className:"product-nav-anchor-text text-nowrap",children:t.label}),(0,e.jsx)("div",{className:(0,S.cn)("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":j===i})})]},i)})})]}),(0,e.jsxs)("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[u?.link&&(0,e.jsx)("a",{href:u.link,target:u.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer text-black",children:(0,e.jsx)(m.Text,{size:2,className:"text-nowrap",children:u.text})}),f?.link&&(0,e.jsx)(m.Button,{as:"a",href:f.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:f.text})]})]})});D.displayName="ProductNav";var X=(0,H.withLayout)(D);
2
2
  //# sourceMappingURL=ProductNav.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ProductNav/ProductNav.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useState, useEffect, useCallback, forwardRef, useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Button, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductNavProps } from './types.js'\nimport * as Popover from '@radix-ui/react-popover'\n\nconst componentType = 'navigation'\nconst componentName = 'product_nav'\n\nconst ChevronDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M5 7.5L10 12.5L15 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nconst ProductNav = forwardRef<HTMLDivElement, ProductNavProps>(\n ({ className = '', data, id, onAnchorClick, scrollOffsetExtra = 0 }, ref) => {\n const { tabLinks = [], anchorList = [], textLink, buyBtn, theme = 'light' } = data || {}\n const [activeAnchorId, setActiveAnchorId] = useState('')\n const innerRef = useRef<HTMLDivElement>(null)\n const isScrollingRef = useRef(false) // \u6807\u8BB0\u662F\u5426\u6B63\u5728\u7A0B\u5E8F\u5316\u6EDA\u52A8\u4E2D\n const targetAnchorIdRef = useRef<string>('') // \u8BB0\u5F55\u70B9\u51FB\u76EE\u6807\u951A\u70B9\n const scrollEndTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null) // \u6EDA\u52A8\u7ED3\u675F\u68C0\u6D4B\u5B9A\u65F6\u5668\n const anchorPositionsRef = useRef<Map<string, number>>(new Map()) // \u7F13\u5B58\u951A\u70B9\u539F\u59CB\u4F4D\u7F6E\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n // \u7F13\u5B58\u6240\u6709\u951A\u70B9\u7684\u7EDD\u5BF9\u4F4D\u7F6E\uFF08\u6EDA\u52A8\u5230\u9876\u90E8\u540E\u8BA1\u7B97\uFF0C\u907F\u514D sticky \u5F71\u54CD\uFF09\n const updateAnchorPositions = useCallback(() => {\n if (anchorList.length === 0) return\n\n const originalScrollY = window.scrollY\n window.scrollTo({ top: 0, behavior: 'instant' as ScrollBehavior })\n\n requestAnimationFrame(() => {\n const positions = new Map<string, number>()\n anchorList.forEach(anchor => {\n const element = document.getElementById(anchor.id)\n if (element) {\n const rect = element.getBoundingClientRect()\n positions.set(anchor.id, rect.top + window.scrollY)\n }\n })\n anchorPositionsRef.current = positions\n\n window.scrollTo({ top: originalScrollY, behavior: 'instant' as ScrollBehavior })\n })\n }, [anchorList])\n\n // \u521D\u59CB\u5316\u65F6\u7F13\u5B58\u6240\u6709\u951A\u70B9\u7684\u539F\u59CB\u4F4D\u7F6E\n useEffect(() => {\n if (anchorList.length === 0) return\n\n // \u9875\u9762\u52A0\u8F7D\u540E\u5EF6\u8FDF\u8BA1\u7B97\uFF0C\u786E\u4FDD\u5E03\u5C40\u5B8C\u6210\n const timer = setTimeout(updateAnchorPositions, 100)\n\n return () => clearTimeout(timer)\n }, [anchorList, updateAnchorPositions])\n\n // \u76D1\u542C body \u9AD8\u5EA6\u53D8\u5316\uFF0C\u9AD8\u5EA6\u6539\u53D8\u65F6\u91CD\u65B0\u8BA1\u7B97\u951A\u70B9\u4F4D\u7F6E\n useEffect(() => {\n if (anchorList.length === 0) return\n\n let resizeTimer: ReturnType<typeof setTimeout> | null = null\n\n const observer = new ResizeObserver(() => {\n // debounce\uFF0C\u907F\u514D\u9AD8\u9891\u89E6\u53D1\n if (resizeTimer) clearTimeout(resizeTimer)\n resizeTimer = setTimeout(updateAnchorPositions, 150)\n })\n\n observer.observe(document.body)\n\n return () => {\n observer.disconnect()\n if (resizeTimer) clearTimeout(resizeTimer)\n }\n }, [anchorList, updateAnchorPositions])\n\n // \u6EDA\u52A8\u76D1\u542C\uFF1A\u68C0\u6D4B\u5F53\u524D\u6EDA\u52A8\u4F4D\u7F6E\u5BF9\u5E94\u7684\u951A\u70B9\n useEffect(() => {\n if (anchorList.length === 0) return\n\n const handleScroll = () => {\n // \u5982\u679C\u6B63\u5728\u7A0B\u5E8F\u5316\u6EDA\u52A8\u4E2D\uFF0C\u4F7F\u7528 debounce \u68C0\u6D4B\u6EDA\u52A8\u7ED3\u675F\n if (isScrollingRef.current) {\n // \u6E05\u9664\u4E4B\u524D\u7684\u5B9A\u65F6\u5668\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n }\n // \u8BBE\u7F6E\u65B0\u7684\u5B9A\u65F6\u5668\uFF0C100ms \u6CA1\u6709\u65B0\u6EDA\u52A8\u4E8B\u4EF6\u5219\u8BA4\u4E3A\u6EDA\u52A8\u7ED3\u675F\n scrollEndTimerRef.current = setTimeout(() => {\n isScrollingRef.current = false\n // \u6EDA\u52A8\u7ED3\u675F\u540E\uFF0C\u786E\u4FDD\u9AD8\u4EAE\u505C\u7559\u5728\u76EE\u6807\u951A\u70B9\n if (targetAnchorIdRef.current) {\n setActiveAnchorId(targetAnchorIdRef.current)\n targetAnchorIdRef.current = ''\n }\n }, 100)\n return\n }\n\n const navHeight = innerRef.current?.offsetHeight || 0\n const scrollPosition = window.scrollY + navHeight + scrollOffsetExtra + 10 // 10px \u7F13\u51B2\n\n let currentAnchorId = ''\n\n // \u4F7F\u7528\u7F13\u5B58\u7684\u951A\u70B9\u4F4D\u7F6E\n const positions = anchorPositionsRef.current\n\n // \u904D\u5386\u6240\u6709\u951A\u70B9\uFF0C\u627E\u5230\u5F53\u524D\u6EDA\u52A8\u4F4D\u7F6E\u5BF9\u5E94\u7684\u951A\u70B9\n for (let i = anchorList.length - 1; i >= 0; i--) {\n const anchor = anchorList[i]\n const elementTop = positions.get(anchor.id)\n if (elementTop !== undefined && scrollPosition >= elementTop) {\n currentAnchorId = anchor.id\n break\n }\n }\n\n // \u5982\u679C\u6CA1\u6709\u627E\u5230\u4E14\u7F13\u5B58\u4E2D\u6709\u7B2C\u4E00\u4E2A\u951A\u70B9\u7684\u4F4D\u7F6E\n if (!currentAnchorId && anchorList.length > 0) {\n const firstElementTop = positions.get(anchorList[0].id)\n if (firstElementTop !== undefined && scrollPosition < firstElementTop) {\n currentAnchorId = ''\n }\n }\n\n setActiveAnchorId(currentAnchorId)\n }\n\n // \u5EF6\u8FDF\u521D\u59CB\u5316\uFF0C\u7B49\u5F85\u4F4D\u7F6E\u7F13\u5B58\u5B8C\u6210\n const timer = setTimeout(() => {\n handleScroll()\n }, 200)\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n return () => {\n clearTimeout(timer)\n window.removeEventListener('scroll', handleScroll)\n // \u6E05\u7406\u5B9A\u65F6\u5668\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n }\n }\n }, [anchorList, scrollOffsetExtra])\n\n // \u8BBE\u7F6E\u9875\u9762\u4E2Dheader\u5143\u7D20\u7684position\u4E3Arelative\n useEffect(() => {\n const headerElements = document.querySelectorAll('.header')\n const originalStyles: { element: HTMLElement; originalPosition: string }[] = []\n\n headerElements.forEach(element => {\n const htmlElement = element as HTMLElement\n // \u4FDD\u5B58\u539F\u59CB\u6837\u5F0F\n originalStyles.push({\n element: htmlElement,\n originalPosition: htmlElement.style.position || getComputedStyle(htmlElement).position,\n })\n // \u8BBE\u7F6E\u4E3Arelative\n htmlElement.style.position = 'relative'\n })\n\n // \u6E05\u7406\u51FD\u6570\uFF1A\u6062\u590D\u539F\u59CB\u6837\u5F0F\n return () => {\n originalStyles.forEach(({ element, originalPosition }) => {\n element.style.position = originalPosition === 'static' ? '' : originalPosition\n })\n }\n }, [])\n\n // \u5904\u7406\u951A\u70B9\u70B9\u51FB\u6EDA\u52A8\n const handleAnchorClick = (e: React.MouseEvent, anchorId: string) => {\n e.preventDefault()\n\n // \u4F7F\u7528\u7F13\u5B58\u7684\u4F4D\u7F6E\n const elementAbsoluteTop = anchorPositionsRef.current.get(anchorId)\n if (elementAbsoluteTop === undefined) {\n console.warn(`Cached position for \"${anchorId}\" not found`)\n return\n }\n\n // \u7ACB\u5373\u66F4\u65B0\u9AD8\u4EAE\u72B6\u6001\uFF0C\u907F\u514D\u6EDA\u52A8\u8FC7\u7A0B\u4E2D\u95EA\u70C1\n setActiveAnchorId(anchorId)\n\n // \u8BB0\u5F55\u76EE\u6807\u951A\u70B9\uFF0C\u7528\u4E8E\u6EDA\u52A8\u7ED3\u675F\u540E\u786E\u4FDD\u9AD8\u4EAE\u6B63\u786E\n targetAnchorIdRef.current = anchorId\n\n // \u6807\u8BB0\u6B63\u5728\u7A0B\u5E8F\u5316\u6EDA\u52A8\uFF0C\u6682\u505C\u6EDA\u52A8\u76D1\u542C\n isScrollingRef.current = true\n\n // \u83B7\u53D6\u5BFC\u822A\u680F\u9AD8\u5EA6\n const navHeight = innerRef.current?.offsetHeight || 0\n\n // \u76EE\u6807\u6EDA\u52A8\u4F4D\u7F6E = \u7F13\u5B58\u7684\u5143\u7D20\u7EDD\u5BF9\u4F4D\u7F6E - \u5BFC\u822A\u680F\u9AD8\u5EA6 - \u989D\u5916\u504F\u79FB\n const targetPosition = elementAbsoluteTop - navHeight - scrollOffsetExtra\n\n // \u5E73\u6ED1\u6EDA\u52A8\u5230\u76EE\u6807\u4F4D\u7F6E\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n\n // \u66F4\u65B0 URL hash\uFF08\u4E0D\u89E6\u53D1\u9875\u9762\u8DF3\u8F6C\uFF09\n window.history.pushState(null, '', `#${anchorId}`)\n\n // \u6CE8\u610F\uFF1A\u6EDA\u52A8\u7ED3\u675F\u68C0\u6D4B\u7531 handleScroll \u4E2D\u7684 debounce \u903B\u8F91\u5904\u7406\n // \u4E0D\u518D\u4F7F\u7528\u56FA\u5B9A 800ms \u8D85\u65F6\uFF0C\u800C\u662F\u68C0\u6D4B\u5B9E\u9645\u6EDA\u52A8\u7ED3\u675F\n }\n\n return (\n <div\n id={id}\n ref={innerRef}\n className={cn(\n 'product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <div className=\"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start\">\n {/* Tab Links Section */}\n <div className=\"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]\">\n <div className=\"product-nav-tabs flex flex-row items-center gap-[8px]\">\n {tabLinks.map((tabLink, index) => {\n return (\n <div key={tabLink.link || index} className=\"product-nav-tab-item flex items-center gap-[8px]\">\n <a\n href={tabLink.link}\n className={cn(\n 'product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]',\n {\n 'text-[#6D6D6F]': index !== 0,\n 'hidden desktop:block': index === 1,\n }\n )}\n // onClick={() => onShowSpecs?.(false)}\n >\n <span>{tabLink.label}</span>\n </a>\n {index !== tabLinks.length - 1 && (\n <div className=\"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]\" />\n )}\n </div>\n )\n })}\n\n {/* Mobile Dropdown */}\n {tabLinks.length > 1 && (\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n className=\"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block\"\n aria-label=\"More products\"\n >\n <ChevronDownIcon className=\"text-[#1D1D1F]\" />\n </button>\n </Popover.Trigger>\n <Popover.Content\n className=\"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]\"\n style={{\n boxShadow: '0px 4px 8px 0px rgba(0,0,0,0.12)',\n }}\n side=\"bottom\"\n align=\"end\"\n alignOffset={10}\n sideOffset={10}\n >\n {tabLinks.slice(1).map(tabLink => (\n <a\n key={tabLink.link}\n href={tabLink.link}\n className=\"product-nav-dropdown-link hover:text-brand-color text-nowrap\"\n >\n <span>{tabLink.label}</span>\n </a>\n ))}\n </Popover.Content>\n </Popover.Root>\n )}\n </div>\n\n {/* Mobile Actions */}\n <div className=\"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* Anchor Navigation */}\n <div className=\"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {anchorList.map((anchor, index) => (\n <a\n key={anchor.id}\n href={`#${anchor.id}`}\n className=\"product-nav-anchor-link\"\n onClick={e => {\n // \u5982\u679C\u63D0\u4F9B\u4E86\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6,\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\u5E76\u963B\u6B62\u9ED8\u8BA4\u884C\u4E3A\n if (onAnchorClick) {\n e.preventDefault()\n // \u6807\u8BB0\u7A0B\u5E8F\u5316\u6EDA\u52A8\uFF0C\u907F\u514D\u6EDA\u52A8\u8FC7\u7A0B\u4E2D\u9AD8\u4EAE\u95EA\u70C1\n setActiveAnchorId(anchor.id)\n targetAnchorIdRef.current = anchor.id\n isScrollingRef.current = true\n onAnchorClick(anchor, index)\n } else {\n // \u4F7F\u7528\u9ED8\u8BA4\u7684\u951A\u70B9\u6EDA\u52A8\u884C\u4E3A\uFF0C\u5E26\u504F\u79FB\u91CF\n handleAnchorClick(e, anchor.id)\n }\n }}\n >\n <Text size={2} className=\"product-nav-anchor-text text-nowrap\">\n {anchor.label}\n </Text>\n <div\n className={cn(\n 'product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent',\n {\n '!bg-brand-0': activeAnchorId === anchor.id,\n }\n )}\n />\n </a>\n ))}\n </div>\n </div>\n\n {/* Desktop Actions */}\n <div className=\"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer text-black hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer text-black\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n )\n }\n)\n\nProductNav.displayName = 'ProductNav'\n\nexport default withLayout(ProductNav)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAA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AlC,GAAU,SACT,OAAC,KACC,KAAMA,EAAS,KACf,OAAQA,EAAS,QAAU,QAC3B,UAAU,8DAEV,mBAAC,QAAK,KAAM,EAAG,UAAU,cACtB,SAAAA,EAAS,KACZ,EACF,EAEDC,GAAQ,SACP,OAAC,UAAO,GAAG,IAAI,KAAMA,EAAO,KAAM,KAAK,KAAK,UAAU,qCACnD,SAAAA,EAAO,KACV,GAEJ,GACF,KAGA,OAAC,OAAI,UAAU,4LACZ,SAAAF,EAAW,IAAI,CAACc,EAAQsB,OACvB,QAAC,KAEC,KAAM,IAAItB,EAAO,EAAE,GACnB,UAAU,0BACV,QAASuB,GAAK,CAERzC,GACFyC,EAAE,eAAe,EAEjBhC,EAAkBS,EAAO,EAAE,EAC3BN,EAAkB,QAAUM,EAAO,GACnCP,EAAe,QAAU,GACzBX,EAAckB,EAAQsB,CAAK,GAG3BL,EAAkBM,EAAGvB,EAAO,EAAE,CAElC,EAEA,oBAAC,QAAK,KAAM,EAAG,UAAU,sCACtB,SAAAA,EAAO,MACV,KACA,OAAC,OACC,aAAW,MACT,sHACA,CACE,cAAeV,IAAmBU,EAAO,EAC3C,CACF,EACF,IA5BKA,EAAO,EA6Bd,CACD,EACH,GACF,KAGA,QAAC,OAAI,UAAU,8GAUZ,UAAAb,GAAU,SACT,OAAC,KACC,KAAMA,EAAS,KACf,OAAQA,EAAS,QAAU,QAC3B,UAAU,yEAEV,mBAAC,QAAK,KAAM,EAAG,UAAU,cACtB,SAAAA,EAAS,KACZ,EACF,EAEDC,GAAQ,SACP,OAAC,UAAO,GAAG,IAAI,KAAMA,EAAO,KAAM,KAAK,KAAK,UAAU,qCACnD,SAAAA,EAAO,KACV,GAEJ,GACF,CAEJ,CACF,EAEAV,EAAW,YAAc,aAEzB,IAAOb,KAAQ,cAAWa,CAAU",
6
- "names": ["ProductNav_exports", "__export", "ProductNav_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_components", "import_useExposure", "Popover", "componentType", "componentName", "ChevronDownIcon", "props", "ProductNav", "className", "data", "id", "onAnchorClick", "scrollOffsetExtra", "ref", "tabLinks", "anchorList", "textLink", "buyBtn", "theme", "activeAnchorId", "setActiveAnchorId", "innerRef", "isScrollingRef", "targetAnchorIdRef", "scrollEndTimerRef", "anchorPositionsRef", "updateAnchorPositions", "originalScrollY", "positions", "anchor", "element", "rect", "timer", "resizeTimer", "observer", "handleScroll", "navHeight", "scrollPosition", "currentAnchorId", "i", "elementTop", "firstElementTop", "headerElements", "originalStyles", "htmlElement", "originalPosition", "handleAnchorClick", "anchorId", "elementAbsoluteTop", "targetPosition", "tabLink", "index", "e"]
4
+ "sourcesContent": ["'use client'\nimport { useState, useEffect, useCallback, forwardRef, useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Button, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductNavProps } from './types.js'\nimport type { AnchorItem } from './types.js'\nimport * as Popover from '@radix-ui/react-popover'\n\nconst componentType = 'navigation'\nconst componentName = 'product_nav'\n\n// \u517C\u5BB9\u65E7\u6570\u636E\u7684 id \u5B57\u6BB5\u4E0E\u65B0\u6570\u636E\u7684 anchorId \u5B57\u6BB5\uFF08\u8BE6\u89C1 AnchorItem \u7C7B\u578B\u5B9A\u4E49\uFF09\nconst getAnchorId = (anchor: AnchorItem) => anchor.anchorId ?? anchor.id ?? ''\n\nconst ChevronDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M5 7.5L10 12.5L15 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nconst ProductNav = forwardRef<HTMLDivElement, ProductNavProps>(\n ({ className = '', data, id, onAnchorClick, scrollOffsetExtra = 0 }, ref) => {\n const { tabLinks = [], anchorList = [], textLink, buyBtn, theme = 'light' } = data || {}\n const [activeAnchorId, setActiveAnchorId] = useState('')\n const innerRef = useRef<HTMLDivElement>(null)\n const isScrollingRef = useRef(false) // \u6807\u8BB0\u662F\u5426\u6B63\u5728\u7A0B\u5E8F\u5316\u6EDA\u52A8\u4E2D\n const targetAnchorIdRef = useRef<string>('') // \u8BB0\u5F55\u70B9\u51FB\u76EE\u6807\u951A\u70B9\n const scrollEndTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null) // \u6EDA\u52A8\u7ED3\u675F\u68C0\u6D4B\u5B9A\u65F6\u5668\n const anchorPositionsRef = useRef<Map<string, number>>(new Map()) // \u7F13\u5B58\u951A\u70B9\u539F\u59CB\u4F4D\u7F6E\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n // \u7F13\u5B58\u6240\u6709\u951A\u70B9\u7684\u7EDD\u5BF9\u4F4D\u7F6E\uFF08\u6EDA\u52A8\u5230\u9876\u90E8\u540E\u8BA1\u7B97\uFF0C\u907F\u514D sticky \u5F71\u54CD\uFF09\n const updateAnchorPositions = useCallback(() => {\n if (anchorList.length === 0) return\n\n const originalScrollY = window.scrollY\n window.scrollTo({ top: 0, behavior: 'instant' as ScrollBehavior })\n\n requestAnimationFrame(() => {\n const positions = new Map<string, number>()\n anchorList.forEach(anchor => {\n const anchorId = getAnchorId(anchor)\n const element = document.getElementById(anchorId)\n if (element) {\n const rect = element.getBoundingClientRect()\n positions.set(anchorId, rect.top + window.scrollY)\n }\n })\n anchorPositionsRef.current = positions\n\n window.scrollTo({ top: originalScrollY, behavior: 'instant' as ScrollBehavior })\n })\n }, [anchorList])\n\n // \u521D\u59CB\u5316\u65F6\u7F13\u5B58\u6240\u6709\u951A\u70B9\u7684\u539F\u59CB\u4F4D\u7F6E\n useEffect(() => {\n if (anchorList.length === 0) return\n\n // \u9875\u9762\u52A0\u8F7D\u540E\u5EF6\u8FDF\u8BA1\u7B97\uFF0C\u786E\u4FDD\u5E03\u5C40\u5B8C\u6210\n const timer = setTimeout(updateAnchorPositions, 100)\n\n return () => clearTimeout(timer)\n }, [anchorList, updateAnchorPositions])\n\n // \u76D1\u542C body \u9AD8\u5EA6\u53D8\u5316\uFF0C\u9AD8\u5EA6\u6539\u53D8\u65F6\u91CD\u65B0\u8BA1\u7B97\u951A\u70B9\u4F4D\u7F6E\n useEffect(() => {\n if (anchorList.length === 0) return\n\n let resizeTimer: ReturnType<typeof setTimeout> | null = null\n\n const observer = new ResizeObserver(() => {\n // debounce\uFF0C\u907F\u514D\u9AD8\u9891\u89E6\u53D1\n if (resizeTimer) clearTimeout(resizeTimer)\n resizeTimer = setTimeout(updateAnchorPositions, 150)\n })\n\n observer.observe(document.body)\n\n return () => {\n observer.disconnect()\n if (resizeTimer) clearTimeout(resizeTimer)\n }\n }, [anchorList, updateAnchorPositions])\n\n // \u6EDA\u52A8\u76D1\u542C\uFF1A\u68C0\u6D4B\u5F53\u524D\u6EDA\u52A8\u4F4D\u7F6E\u5BF9\u5E94\u7684\u951A\u70B9\n useEffect(() => {\n if (anchorList.length === 0) return\n\n const handleScroll = () => {\n // \u5982\u679C\u6B63\u5728\u7A0B\u5E8F\u5316\u6EDA\u52A8\u4E2D\uFF0C\u4F7F\u7528 debounce \u68C0\u6D4B\u6EDA\u52A8\u7ED3\u675F\n if (isScrollingRef.current) {\n // \u6E05\u9664\u4E4B\u524D\u7684\u5B9A\u65F6\u5668\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n }\n // \u8BBE\u7F6E\u65B0\u7684\u5B9A\u65F6\u5668\uFF0C100ms \u6CA1\u6709\u65B0\u6EDA\u52A8\u4E8B\u4EF6\u5219\u8BA4\u4E3A\u6EDA\u52A8\u7ED3\u675F\n scrollEndTimerRef.current = setTimeout(() => {\n isScrollingRef.current = false\n // \u6EDA\u52A8\u7ED3\u675F\u540E\uFF0C\u786E\u4FDD\u9AD8\u4EAE\u505C\u7559\u5728\u76EE\u6807\u951A\u70B9\n if (targetAnchorIdRef.current) {\n setActiveAnchorId(targetAnchorIdRef.current)\n targetAnchorIdRef.current = ''\n }\n }, 100)\n return\n }\n\n const navHeight = innerRef.current?.offsetHeight || 0\n const scrollPosition = window.scrollY + navHeight + scrollOffsetExtra + 10 // 10px \u7F13\u51B2\n\n let currentAnchorId = ''\n\n // \u4F7F\u7528\u7F13\u5B58\u7684\u951A\u70B9\u4F4D\u7F6E\n const positions = anchorPositionsRef.current\n\n // \u904D\u5386\u6240\u6709\u951A\u70B9\uFF0C\u627E\u5230\u5F53\u524D\u6EDA\u52A8\u4F4D\u7F6E\u5BF9\u5E94\u7684\u951A\u70B9\n for (let i = anchorList.length - 1; i >= 0; i--) {\n const anchor = anchorList[i]\n const anchorId = getAnchorId(anchor)\n const elementTop = positions.get(anchorId)\n if (elementTop !== undefined && scrollPosition >= elementTop) {\n currentAnchorId = anchorId\n break\n }\n }\n\n // \u5982\u679C\u6CA1\u6709\u627E\u5230\u4E14\u7F13\u5B58\u4E2D\u6709\u7B2C\u4E00\u4E2A\u951A\u70B9\u7684\u4F4D\u7F6E\n if (!currentAnchorId && anchorList.length > 0) {\n const firstElementTop = positions.get(getAnchorId(anchorList[0]))\n if (firstElementTop !== undefined && scrollPosition < firstElementTop) {\n currentAnchorId = ''\n }\n }\n\n setActiveAnchorId(currentAnchorId)\n }\n\n // \u5EF6\u8FDF\u521D\u59CB\u5316\uFF0C\u7B49\u5F85\u4F4D\u7F6E\u7F13\u5B58\u5B8C\u6210\n const timer = setTimeout(() => {\n handleScroll()\n }, 200)\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n return () => {\n clearTimeout(timer)\n window.removeEventListener('scroll', handleScroll)\n // \u6E05\u7406\u5B9A\u65F6\u5668\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n }\n }\n }, [anchorList, scrollOffsetExtra])\n\n // \u8BBE\u7F6E\u9875\u9762\u4E2Dheader\u5143\u7D20\u7684position\u4E3Arelative\n useEffect(() => {\n const headerElements = document.querySelectorAll('.header')\n const originalStyles: { element: HTMLElement; originalPosition: string }[] = []\n\n headerElements.forEach(element => {\n const htmlElement = element as HTMLElement\n // \u4FDD\u5B58\u539F\u59CB\u6837\u5F0F\n originalStyles.push({\n element: htmlElement,\n originalPosition: htmlElement.style.position || getComputedStyle(htmlElement).position,\n })\n // \u8BBE\u7F6E\u4E3Arelative\n htmlElement.style.position = 'relative'\n })\n\n // \u6E05\u7406\u51FD\u6570\uFF1A\u6062\u590D\u539F\u59CB\u6837\u5F0F\n return () => {\n originalStyles.forEach(({ element, originalPosition }) => {\n element.style.position = originalPosition === 'static' ? '' : originalPosition\n })\n }\n }, [])\n\n // \u5904\u7406\u951A\u70B9\u70B9\u51FB\u6EDA\u52A8\n const handleAnchorClick = (e: React.MouseEvent, anchorId: string) => {\n e.preventDefault()\n\n // \u4F7F\u7528\u7F13\u5B58\u7684\u4F4D\u7F6E\n const elementAbsoluteTop = anchorPositionsRef.current.get(anchorId)\n if (elementAbsoluteTop === undefined) {\n console.warn(`Cached position for \"${anchorId}\" not found`)\n return\n }\n\n // \u7ACB\u5373\u66F4\u65B0\u9AD8\u4EAE\u72B6\u6001\uFF0C\u907F\u514D\u6EDA\u52A8\u8FC7\u7A0B\u4E2D\u95EA\u70C1\n setActiveAnchorId(anchorId)\n\n // \u8BB0\u5F55\u76EE\u6807\u951A\u70B9\uFF0C\u7528\u4E8E\u6EDA\u52A8\u7ED3\u675F\u540E\u786E\u4FDD\u9AD8\u4EAE\u6B63\u786E\n targetAnchorIdRef.current = anchorId\n\n // \u6807\u8BB0\u6B63\u5728\u7A0B\u5E8F\u5316\u6EDA\u52A8\uFF0C\u6682\u505C\u6EDA\u52A8\u76D1\u542C\n isScrollingRef.current = true\n\n // \u83B7\u53D6\u5BFC\u822A\u680F\u9AD8\u5EA6\n const navHeight = innerRef.current?.offsetHeight || 0\n\n // \u76EE\u6807\u6EDA\u52A8\u4F4D\u7F6E = \u7F13\u5B58\u7684\u5143\u7D20\u7EDD\u5BF9\u4F4D\u7F6E - \u5BFC\u822A\u680F\u9AD8\u5EA6 - \u989D\u5916\u504F\u79FB\n const targetPosition = elementAbsoluteTop - navHeight - scrollOffsetExtra\n\n // \u5E73\u6ED1\u6EDA\u52A8\u5230\u76EE\u6807\u4F4D\u7F6E\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n\n // \u66F4\u65B0 URL hash\uFF08\u4E0D\u89E6\u53D1\u9875\u9762\u8DF3\u8F6C\uFF09\n window.history.pushState(null, '', `#${anchorId}`)\n\n // \u6CE8\u610F\uFF1A\u6EDA\u52A8\u7ED3\u675F\u68C0\u6D4B\u7531 handleScroll \u4E2D\u7684 debounce \u903B\u8F91\u5904\u7406\n // \u4E0D\u518D\u4F7F\u7528\u56FA\u5B9A 800ms \u8D85\u65F6\uFF0C\u800C\u662F\u68C0\u6D4B\u5B9E\u9645\u6EDA\u52A8\u7ED3\u675F\n }\n\n return (\n <div\n id={id}\n ref={innerRef}\n className={cn(\n 'product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <div className=\"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start\">\n {/* Tab Links Section */}\n <div className=\"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]\">\n <div className=\"product-nav-tabs flex flex-row items-center gap-[8px]\">\n {tabLinks.map((tabLink, index) => {\n return (\n <div key={tabLink.link || index} className=\"product-nav-tab-item flex items-center gap-[8px]\">\n <a\n href={tabLink.link}\n className={cn(\n 'product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]',\n {\n 'text-[#6D6D6F]': index !== 0,\n 'hidden desktop:block': index === 1,\n }\n )}\n // onClick={() => onShowSpecs?.(false)}\n >\n <span>{tabLink.label}</span>\n </a>\n {index !== tabLinks.length - 1 && (\n <div className=\"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]\" />\n )}\n </div>\n )\n })}\n\n {/* Mobile Dropdown */}\n {tabLinks.length > 1 && (\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n className=\"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block\"\n aria-label=\"More products\"\n >\n <ChevronDownIcon className=\"text-[#1D1D1F]\" />\n </button>\n </Popover.Trigger>\n <Popover.Content\n className=\"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]\"\n style={{\n boxShadow: '0px 4px 8px 0px rgba(0,0,0,0.12)',\n }}\n side=\"bottom\"\n align=\"end\"\n alignOffset={10}\n sideOffset={10}\n >\n {tabLinks.slice(1).map(tabLink => (\n <a\n key={tabLink.link}\n href={tabLink.link}\n className=\"product-nav-dropdown-link hover:text-brand-color text-nowrap\"\n >\n <span>{tabLink.label}</span>\n </a>\n ))}\n </Popover.Content>\n </Popover.Root>\n )}\n </div>\n\n {/* Mobile Actions */}\n <div className=\"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* Anchor Navigation */}\n <div className=\"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {anchorList.map((anchor, index) => {\n const anchorId = getAnchorId(anchor)\n return (\n <a\n key={anchorId}\n href={`#${anchorId}`}\n className=\"product-nav-anchor-link\"\n onClick={e => {\n // \u5982\u679C\u63D0\u4F9B\u4E86\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6,\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\u5E76\u963B\u6B62\u9ED8\u8BA4\u884C\u4E3A\n if (onAnchorClick) {\n e.preventDefault()\n // \u6807\u8BB0\u7A0B\u5E8F\u5316\u6EDA\u52A8\uFF0C\u907F\u514D\u6EDA\u52A8\u8FC7\u7A0B\u4E2D\u9AD8\u4EAE\u95EA\u70C1\n setActiveAnchorId(anchorId)\n targetAnchorIdRef.current = anchorId\n isScrollingRef.current = true\n onAnchorClick(anchor, index)\n } else {\n // \u4F7F\u7528\u9ED8\u8BA4\u7684\u951A\u70B9\u6EDA\u52A8\u884C\u4E3A\uFF0C\u5E26\u504F\u79FB\u91CF\n handleAnchorClick(e, anchorId)\n }\n }}\n >\n <Text size={2} className=\"product-nav-anchor-text text-nowrap\">\n {anchor.label}\n </Text>\n <div\n className={cn(\n 'product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent',\n {\n '!bg-brand-0': activeAnchorId === anchorId,\n }\n )}\n />\n </a>\n )\n })}\n </div>\n </div>\n\n {/* Desktop Actions */}\n <div className=\"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer text-black hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer text-black\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n )\n }\n)\n\nProductNav.displayName = 'ProductNav'\n\nexport default withLayout(ProductNav)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmBM,IAAAI,EAAA,6BAlBNC,EAA0F,iBAC1FC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA6B,qCAC7BC,EAA4B,sCAG5BC,EAAyB,sCAEzB,MAAMC,EAAgB,aAChBC,EAAgB,cAGhBC,EAAeC,GAAuBA,EAAO,UAAYA,EAAO,IAAM,GAEtEC,EAAmBC,MAErB,OAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGA,EACjG,mBAAC,QACC,EAAE,wBACF,OAAO,eACP,YAAY,UACZ,cAAc,QACd,eAAe,QACjB,EACF,EAIEC,KAAa,cACjB,CAAC,CAAE,UAAAC,EAAY,GAAI,KAAAC,EAAM,GAAAC,EAAI,cAAAC,EAAe,kBAAAC,EAAoB,CAAE,EAAGC,IAAQ,CAC3E,KAAM,CAAE,SAAAC,EAAW,CAAC,EAAG,WAAAC,EAAa,CAAC,EAAG,SAAAC,EAAU,OAAAC,EAAQ,MAAAC,EAAQ,OAAQ,EAAIT,GAAQ,CAAC,EACjF,CAACU,EAAgBC,CAAiB,KAAI,YAAS,EAAE,EACjDC,KAAW,UAAuB,IAAI,EACtCC,KAAiB,UAAO,EAAK,EAC7BC,KAAoB,UAAe,EAAE,EACrCC,KAAoB,UAA6C,IAAI,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EACF,IA5BKA,CA6BP,CAEJ,CAAC,EACH,GACF,KAGA,QAAC,OAAI,UAAU,8GAUZ,UAAAb,GAAU,SACT,OAAC,KACC,KAAMA,EAAS,KACf,OAAQA,EAAS,QAAU,QAC3B,UAAU,yEAEV,mBAAC,QAAK,KAAM,EAAG,UAAU,cACtB,SAAAA,EAAS,KACZ,EACF,EAEDC,GAAQ,SACP,OAAC,UAAO,GAAG,IAAI,KAAMA,EAAO,KAAM,KAAK,KAAK,UAAU,qCACnD,SAAAA,EAAO,KACV,GAEJ,GACF,CAEJ,CACF,EAEAV,EAAW,YAAc,aAEzB,IAAOf,KAAQ,cAAWe,CAAU",
6
+ "names": ["ProductNav_exports", "__export", "ProductNav_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_components", "import_useExposure", "Popover", "componentType", "componentName", "getAnchorId", "anchor", "ChevronDownIcon", "props", "ProductNav", "className", "data", "id", "onAnchorClick", "scrollOffsetExtra", "ref", "tabLinks", "anchorList", "textLink", "buyBtn", "theme", "activeAnchorId", "setActiveAnchorId", "innerRef", "isScrollingRef", "targetAnchorIdRef", "scrollEndTimerRef", "anchorPositionsRef", "updateAnchorPositions", "originalScrollY", "positions", "anchorId", "element", "rect", "timer", "resizeTimer", "observer", "handleScroll", "navHeight", "scrollPosition", "currentAnchorId", "i", "elementTop", "firstElementTop", "headerElements", "originalStyles", "htmlElement", "originalPosition", "handleAnchorClick", "e", "elementAbsoluteTop", "targetPosition", "tabLink", "index"]
7
7
  }
@@ -4,7 +4,9 @@ export interface TabLink {
4
4
  label: string;
5
5
  }
6
6
  export interface AnchorItem {
7
- id: string;
7
+ /** @deprecated 使用 anchorId 代替,保留仅用于兼容旧数据 */
8
+ id?: string;
9
+ anchorId?: string;
8
10
  label: string;
9
11
  }
10
12
  export interface BuyButton {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ProductNav/types.ts"],
4
- "sourcesContent": ["import type { ComponentCommonProps, Theme } from '../../types/props.js'\n\nexport interface TabLink {\n link: string\n label: string\n}\n\nexport interface AnchorItem {\n id: string\n label: string\n}\n\nexport interface BuyButton {\n link: string\n text: string\n}\n\nexport interface TextLink {\n /** \u94FE\u63A5\u5730\u5740 */\n link: string\n /** \u94FE\u63A5\u6587\u5B57 */\n text: string\n /** \u6253\u5F00\u65B9\u5F0F\uFF0C\u9ED8\u8BA4\u4E3A\u5F53\u524D\u7A97\u53E3 */\n target?: '_self' | '_blank'\n}\n\nexport interface ProductNavProps extends ComponentCommonProps {\n data: {\n /** \u4EA7\u54C1\u9875\u7B7E\u94FE\u63A5 */\n tabLinks?: TabLink[]\n /** \u951A\u70B9\u5BFC\u822A\u5217\u8868 */\n anchorList?: AnchorItem[]\n /** \u6587\u5B57\u94FE\u63A5\uFF0C\u663E\u793A\u5728\u8D2D\u4E70\u6309\u94AE\u5DE6\u8FB9 */\n textLink?: TextLink\n /** \u8D2D\u4E70\u6309\u94AE */\n buyBtn?: BuyButton\n /** \u4E3B\u9898\uFF0C\u9ED8\u8BA4 light */\n theme?: Theme\n }\n /** \u951A\u70B9\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u5C06\u5FFD\u7565\u9ED8\u8BA4\u7684\u951A\u70B9\u8DF3\u8F6C\u884C\u4E3A */\n onAnchorClick?: (item: AnchorItem, index: number) => void\n /** \u951A\u70B9\u6EDA\u52A8\u989D\u5916\u504F\u79FB\u91CF\uFF08\u50CF\u7D20\uFF09\uFF0C\u4F1A\u5728\u5BFC\u822A\u680F\u9AD8\u5EA6\u57FA\u7840\u4E0A\u989D\u5916\u504F\u79FB\uFF0C\u9ED8\u8BA4\u4E3A 0 */\n scrollOffsetExtra?: number\n}\n"],
4
+ "sourcesContent": ["import type { ComponentCommonProps, Theme } from '../../types/props.js'\n\nexport interface TabLink {\n link: string\n label: string\n}\n\nexport interface AnchorItem {\n /** @deprecated \u4F7F\u7528 anchorId \u4EE3\u66FF\uFF0C\u4FDD\u7559\u4EC5\u7528\u4E8E\u517C\u5BB9\u65E7\u6570\u636E */\n id?: string\n anchorId?: string\n label: string\n}\n\nexport interface BuyButton {\n link: string\n text: string\n}\n\nexport interface TextLink {\n /** \u94FE\u63A5\u5730\u5740 */\n link: string\n /** \u94FE\u63A5\u6587\u5B57 */\n text: string\n /** \u6253\u5F00\u65B9\u5F0F\uFF0C\u9ED8\u8BA4\u4E3A\u5F53\u524D\u7A97\u53E3 */\n target?: '_self' | '_blank'\n}\n\nexport interface ProductNavProps extends ComponentCommonProps {\n data: {\n /** \u4EA7\u54C1\u9875\u7B7E\u94FE\u63A5 */\n tabLinks?: TabLink[]\n /** \u951A\u70B9\u5BFC\u822A\u5217\u8868 */\n anchorList?: AnchorItem[]\n /** \u6587\u5B57\u94FE\u63A5\uFF0C\u663E\u793A\u5728\u8D2D\u4E70\u6309\u94AE\u5DE6\u8FB9 */\n textLink?: TextLink\n /** \u8D2D\u4E70\u6309\u94AE */\n buyBtn?: BuyButton\n /** \u4E3B\u9898\uFF0C\u9ED8\u8BA4 light */\n theme?: Theme\n }\n /** \u951A\u70B9\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u5C06\u5FFD\u7565\u9ED8\u8BA4\u7684\u951A\u70B9\u8DF3\u8F6C\u884C\u4E3A */\n onAnchorClick?: (item: AnchorItem, index: number) => void\n /** \u951A\u70B9\u6EDA\u52A8\u989D\u5916\u504F\u79FB\u91CF\uFF08\u50CF\u7D20\uFF09\uFF0C\u4F1A\u5728\u5BFC\u822A\u680F\u9AD8\u5EA6\u57FA\u7840\u4E0A\u989D\u5916\u504F\u79FB\uFF0C\u9ED8\u8BA4\u4E3A 0 */\n scrollOffsetExtra?: number\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -66,6 +66,8 @@ export { default as BenefitsTab } from './Listing/components/ProductCard/Product
66
66
  export { default as PaidShipping } from './Listing/components/PaidShipping/index.js';
67
67
  export { default as CartActionButtons } from './Listing/components/CartActionButtons/index.js';
68
68
  export type { CartActionButtonsProps } from './Listing/components/CartActionButtons/index.js';
69
+ export { NotifyMeDialog } from './NotifyMeDialog/index.js';
70
+ export type { NotifyMeDialogProps, CheckboxConfig, SubscriptionMeta } from './NotifyMeDialog/types.js';
69
71
  export { default as ProductServiceBenefits } from './Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js';
70
72
  export type { ProductServiceBenefitsProps, ServiceBenefitItem, } from './Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js';
71
73
  export { default as ProductPaidShipping } from './Listing/components/ProductCard/ProductPaidShipping/index.js';
@@ -1,2 +1,2 @@
1
- "use strict";var lt=Object.create;var p=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var xt=Object.getPrototypeOf,yt=Object.prototype.hasOwnProperty;var ht=(t,r)=>{for(var o in r)p(t,o,{get:r[o],enumerable:!0})},n=(t,r,o,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of nt(r))!yt.call(t,i)&&i!==o&&p(t,i,{get:()=>r[i],enumerable:!(m=mt(r,i))||m.enumerable});return t};var e=(t,r,o)=>(o=t!=null?lt(xt(t)):{},n(r||!t||!t.__esModule?p(o,"default",{value:t,enumerable:!0}):o,t)),St=t=>n(p({},"__esModule",{value:!0}),t);var Ct={};ht(Ct,{AccordionCards:()=>b.default,ActiveShelf:()=>Je.default,ActivityMechanism:()=>S.default,ActivitySchedule:()=>x.default,AiuiProvider:()=>H.default,AnchorNavigation:()=>Ke.default,AplusDesc:()=>Ce.default,BenefitsTab:()=>me.default,BizProductProvider:()=>f.default,BrandCardLink:()=>Te.default,BrandEquity:()=>P.default,BuyOneGetOneShelf:()=>Ye.default,CartActionButtons:()=>xe.default,Category:()=>I.default,CreativeModule:()=>U.default,CreditsProductCard:()=>d.CreditsProductCard,CreditsShelf:()=>d.default,DownLoad:()=>ve.default,Evaluate:()=>T.default,EventSchedule:()=>ze.default,Faq:()=>V.default,FeatureCards:()=>Ae.default,FeatureShowcase:()=>Oe.default,FeaturedBlogPosts:()=>Ge.default,Features:()=>Pe.default,FootCharger:()=>Be.default,FooterNavigation:()=>q.default,GiftBox:()=>ge.default,GiftShelf:()=>y.default,GiftTierShelf:()=>h.default,Graphic:()=>D.default,GraphicAttractionBlock:()=>E.default,GraphicMore:()=>Se.default,GraphicOverlay:()=>Y.default,HeaderNavigation:()=>W.default,HeroBanner:()=>j.default,IPC_SEARCH_PAGE:()=>s.IPC_SEARCH_PAGE,IPRedirect:()=>gt,ImageOverlayShelf:()=>et.default,ImageTextFeature:()=>Fe.default,ImageTextOverlay:()=>tt.default,ImageWithText:()=>Le.default,Ksp:()=>De.default,Marquee:()=>L.default,MarqueeImageContent:()=>a.MarqueeImageContent,MarqueeItem:()=>a.MarqueeItem,MarqueeReview:()=>k.default,MarqueeTextContent:()=>a.MarqueeTextContent,MediaEndorsement:()=>Ze.default,MediaPlayerBase:()=>F.default,MediaPlayerMulti:()=>G.default,MediaPlayerSticky:()=>A.default,MediaSceneSwitcher:()=>qe.default,MediaSceneSwitcherV2:()=>Ne.default,MediaShelf:()=>Qe.default,MediaTextOverlay:()=>$e.default,MemberEquity:()=>C.default,MiniCart:()=>rt.default,MiniCartCircleProgress:()=>ot.default,MiniCartDialog:()=>l.default,MiniCartDialogComponent:()=>l.MiniCartDialog,ModalCoupon:()=>dt.default,ModalRegisterSubscribe:()=>st.default,ModalSmsSubscribe:()=>ct.default,ModalSubscribeConfirm:()=>ft.default,ModalVerify:()=>ut.default,MultiLayoutGraphicBlock:()=>O.default,PAYLOAD_COMPONENT_MAP:()=>Pt,PaidShipping:()=>ne.default,ProductActions:()=>Z.default,ProductBanner:()=>fe.default,ProductBenefits:()=>te.default,ProductBenefitsTabs:()=>ee.default,ProductBundle:()=>pe.default,ProductCard:()=>$.default,ProductCompare:()=>be.default,ProductCoupon:()=>se.default,ProductDetail:()=>ue.default,ProductExchangePurchase:()=>ae.default,ProductFreeGift:()=>oe.default,ProductGallery:()=>ce.default,ProductGridBox:()=>de.default,ProductHero:()=>Ee.default,ProductHighlight:()=>re.default,ProductLottery:()=>je.default,ProductNav:()=>He.default,ProductOptions:()=>ie.default,ProductPaidShipping:()=>he.default,ProductServiceBenefits:()=>ye.default,ProductSummary:()=>le.default,PromotionalBar:()=>_e.default,PurchaseBar:()=>X.default,SceneProductCard:()=>c.SceneProductCard,SceneShelf:()=>c.default,SceneShelfV2:()=>u.default,SceneShelfV2ProductCard:()=>u.SceneShelfV2ProductCard,SceneShelfV3:()=>Xe.default,SearchPage:()=>N.default,SearchPageTabType:()=>s.SearchPageTabType,SecondaryBanner:()=>Ue.default,SelectStore:()=>Me.default,ShelfDisplay:()=>B.default,Slogan:()=>g.default,Spacer:()=>v.default,Specs:()=>J.default,SpecsComparison:()=>We.default,SwiperBox:()=>_.default,TabGroup:()=>Q.default,TabWithImage:()=>Ve.default,Tabs:()=>K.default,TabsWithMedia:()=>we.default,ThreeDCarousel:()=>Re.default,Title:()=>M.default,VideoFeature:()=>ke.default,VideoModal:()=>z.VideoModal,WebPushPopup:()=>at.default,WheelLottery:()=>Ie.default,WhyChoose:()=>w.default,useAiuiContext:()=>pt.useAiuiContext,useBizProductContext:()=>f.useBizProductContext,useEmarsysWebPush:()=>it.useEmarsysWebPush,withLayout:()=>R.withLayout});module.exports=St(Ct);var x=e(require("./ActivitySchedule/index.js")),y=e(require("./GiftShelf/index.js")),h=e(require("./GiftTierShelf/index.js")),S=e(require("./ActivityMechanism/index.js")),P=e(require("./BrandEquity/index.js")),C=e(require("./MemberEquity/index.js")),g=e(require("./Slogan/index.js")),M=e(require("./Title/index.js")),v=e(require("./Spacer/index.js")),B=e(require("./ShelfDisplay/index.js")),T=e(require("./Evaluate/index.js")),I=e(require("./Category/index.js")),j=e(require("./HeroBanner/index.js")),b=e(require("./AccordionCards/index.js")),D=e(require("./Graphic/index.js")),F=e(require("./MediaPlayerBase/index.js")),A=e(require("./MediaPlayerSticky/index.js")),G=e(require("./MediaPlayerMulti/index.js")),L=e(require("./Marquee/index.js")),k=e(require("./MarqueeReview/index.js")),w=e(require("./WhyChoose/index.js")),V=e(require("./Faq/index.js")),a=require("./Marquee/index.js"),O=e(require("./MultiLayoutGraphicBlock/index.js")),E=e(require("./GraphicAttractionBlock/index.js")),W=e(require("./HeaderNavigation/index.js")),q=e(require("./FooterNavigation/index.js")),N=e(require("./SearchPage/index.js")),s=require("./SearchPage/types.js"),R=require("../shared/Styles.js"),H=e(require("./AiuiProvider/index.js")),K=e(require("./Tabs/index.js")),_=e(require("./SwiperBox/index.js")),z=require("./VideoModal/index.js"),U=e(require("./CreativeModule/index.js")),Y=e(require("./GraphicOverlay/index.js")),J=e(require("./Specs/index.js")),Q=e(require("./TabsGroup/index.js")),f=e(require("./Listing/BizProductProvider.js")),X=e(require("./Listing/components/PurchaseBar/index.js")),Z=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),$=e(require("./Listing/components/ProductCard/index.js")),ee=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),te=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js")),re=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),oe=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),ae=e(require("./Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js")),ie=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),pe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),se=e(require("./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js")),fe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js")),de=e(require("./Listing/components/ProductCard/ProductGridBox.js")),ce=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),ue=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),le=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),me=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab.js")),ne=e(require("./Listing/components/PaidShipping/index.js")),xe=e(require("./Listing/components/CartActionButtons/index.js")),ye=e(require("./Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js")),he=e(require("./Listing/components/ProductCard/ProductPaidShipping/index.js")),Se=e(require("./GraphicMore/index.js")),Pe=e(require("./Features/index.js")),Ce=e(require("./AplusDesc/index.js")),ge=e(require("./GiftBox/index.js")),Me=e(require("./SelectStore/index.js")),ve=e(require("./DownLoad/index.js")),Be=e(require("./FootCharger/index.js")),Te=e(require("./BrandCardLink/index.js")),gt=e(require("./IPRedirect/index.js")),Ie=e(require("./WheelLottery/index.js")),je=e(require("./ProductLottery/index.js")),be=e(require("./ProductCompare/index.js")),De=e(require("./Ksp/index.js")),Fe=e(require("./ImageTextFeature/index.js")),Ae=e(require("./FeatureCards/index.js")),Ge=e(require("./FeaturedBlogPosts/index.js")),Le=e(require("./ImageWithText/index.js")),ke=e(require("./VideoFeature/index.js")),we=e(require("./TabsWithMedia/index.js")),Ve=e(require("./TabWithImage/index.js")),Oe=e(require("./FeatureShowcase/index.js")),Ee=e(require("./ProductHero/index.js")),We=e(require("./SpecsComparison/index.js")),qe=e(require("./MediaSceneSwitcher/index.js")),Ne=e(require("./MediaSceneSwitcherV2/index.js")),Re=e(require("./ThreeDCarousel/index.js")),He=e(require("./ProductNav/index.js")),Ke=e(require("./AnchorNavigation/index.js")),_e=e(require("./PromotionalBar/index.js")),ze=e(require("./EventSchedule/index.js")),Ue=e(require("./SecondaryBanner/index.js")),Ye=e(require("./BuyOneGetOneShelf/index.js")),Je=e(require("./ActiveShelf/index.js")),Qe=e(require("./MediaShelf/index.js")),d=e(require("./CreditsShelf/index.js")),c=e(require("./SceneShelf/index.js")),u=e(require("./SceneShelfV2/index.js")),Xe=e(require("./SceneShelfV3/index.js")),Ze=e(require("./MediaEndorsement/index.js")),$e=e(require("./MediaTextOverlay/index.js")),et=e(require("./ImageOverlayShelf/index.js")),tt=e(require("./ImageTextOverlay/index.js")),rt=e(require("./MiniCart/index.js")),ot=e(require("./MiniCart/CircleProgress.js")),l=e(require("./MiniCart/MiniCartDialog.js")),at=e(require("./WebPushPopup/index.js")),it=require("../hooks/useEmarsysWebPush.js"),pt=require("./AiuiProvider/index.js"),st=e(require("./ModalRegisterSubscribe/index.js")),ft=e(require("./ModalSubscribeConfirm/index.js")),dt=e(require("./ModalCoupon/index.js")),ct=e(require("./ModalSmsSubscribe/index.js")),ut=e(require("./ModalVerify/index.js"));const Pt={"ipc-accordioncards":"AccordionCards","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-giftshelf":"GiftShelf","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose","ipc-product-nav":"ProductNav","ipc-brand-card-link":"BrandCardLink","ipc-ipredirect":"IPRedirect",ksp:"Ksp","ipc-secondary-banner":"SecondaryBanner","ipc-media-endorsement":"MediaEndorsement","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-featured-blog-posts":"FeaturedBlogPosts","ipc-media-text-overlay":"MediaTextOverlay",ProductCompare:"ProductCompare"};
1
+ "use strict";var mt=Object.create;var p=Object.defineProperty;var nt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var yt=Object.getPrototypeOf,ht=Object.prototype.hasOwnProperty;var St=(t,r)=>{for(var o in r)p(t,o,{get:r[o],enumerable:!0})},n=(t,r,o,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of xt(r))!ht.call(t,i)&&i!==o&&p(t,i,{get:()=>r[i],enumerable:!(m=nt(r,i))||m.enumerable});return t};var e=(t,r,o)=>(o=t!=null?mt(yt(t)):{},n(r||!t||!t.__esModule?p(o,"default",{value:t,enumerable:!0}):o,t)),Pt=t=>n(p({},"__esModule",{value:!0}),t);var gt={};St(gt,{AccordionCards:()=>j.default,ActiveShelf:()=>Qe.default,ActivityMechanism:()=>S.default,ActivitySchedule:()=>x.default,AiuiProvider:()=>H.default,AnchorNavigation:()=>_e.default,AplusDesc:()=>ge.default,BenefitsTab:()=>me.default,BizProductProvider:()=>f.default,BrandCardLink:()=>Ie.default,BrandEquity:()=>P.default,BuyOneGetOneShelf:()=>Je.default,CartActionButtons:()=>xe.default,Category:()=>I.default,CreativeModule:()=>U.default,CreditsProductCard:()=>d.CreditsProductCard,CreditsShelf:()=>d.default,DownLoad:()=>Be.default,Evaluate:()=>T.default,EventSchedule:()=>Ue.default,Faq:()=>V.default,FeatureCards:()=>Ge.default,FeatureShowcase:()=>Ee.default,FeaturedBlogPosts:()=>ke.default,Features:()=>Ce.default,FootCharger:()=>Te.default,FooterNavigation:()=>N.default,GiftBox:()=>Me.default,GiftShelf:()=>y.default,GiftTierShelf:()=>h.default,Graphic:()=>D.default,GraphicAttractionBlock:()=>E.default,GraphicMore:()=>Pe.default,GraphicOverlay:()=>Y.default,HeaderNavigation:()=>W.default,HeroBanner:()=>b.default,IPC_SEARCH_PAGE:()=>s.IPC_SEARCH_PAGE,IPRedirect:()=>Mt,ImageOverlayShelf:()=>tt.default,ImageTextFeature:()=>Ae.default,ImageTextOverlay:()=>rt.default,ImageWithText:()=>Le.default,Ksp:()=>Fe.default,Marquee:()=>k.default,MarqueeImageContent:()=>a.MarqueeImageContent,MarqueeItem:()=>a.MarqueeItem,MarqueeReview:()=>L.default,MarqueeTextContent:()=>a.MarqueeTextContent,MediaEndorsement:()=>$e.default,MediaPlayerBase:()=>F.default,MediaPlayerMulti:()=>G.default,MediaPlayerSticky:()=>A.default,MediaSceneSwitcher:()=>qe.default,MediaSceneSwitcherV2:()=>Re.default,MediaShelf:()=>Xe.default,MediaTextOverlay:()=>et.default,MemberEquity:()=>C.default,MiniCart:()=>ot.default,MiniCartCircleProgress:()=>at.default,MiniCartDialog:()=>l.default,MiniCartDialogComponent:()=>l.MiniCartDialog,ModalCoupon:()=>ct.default,ModalRegisterSubscribe:()=>ft.default,ModalSmsSubscribe:()=>ut.default,ModalSubscribeConfirm:()=>dt.default,ModalVerify:()=>lt.default,MultiLayoutGraphicBlock:()=>O.default,NotifyMeDialog:()=>ye.NotifyMeDialog,PAYLOAD_COMPONENT_MAP:()=>Ct,PaidShipping:()=>ne.default,ProductActions:()=>Z.default,ProductBanner:()=>fe.default,ProductBenefits:()=>te.default,ProductBenefitsTabs:()=>ee.default,ProductBundle:()=>pe.default,ProductCard:()=>$.default,ProductCompare:()=>De.default,ProductCoupon:()=>se.default,ProductDetail:()=>ue.default,ProductExchangePurchase:()=>ae.default,ProductFreeGift:()=>oe.default,ProductGallery:()=>ce.default,ProductGridBox:()=>de.default,ProductHero:()=>We.default,ProductHighlight:()=>re.default,ProductLottery:()=>je.default,ProductNav:()=>Ke.default,ProductOptions:()=>ie.default,ProductPaidShipping:()=>Se.default,ProductServiceBenefits:()=>he.default,ProductSummary:()=>le.default,PromotionalBar:()=>ze.default,PurchaseBar:()=>X.default,SceneProductCard:()=>c.SceneProductCard,SceneShelf:()=>c.default,SceneShelfV2:()=>u.default,SceneShelfV2ProductCard:()=>u.SceneShelfV2ProductCard,SceneShelfV3:()=>Ze.default,SearchPage:()=>q.default,SearchPageTabType:()=>s.SearchPageTabType,SecondaryBanner:()=>Ye.default,SelectStore:()=>ve.default,ShelfDisplay:()=>B.default,Slogan:()=>g.default,Spacer:()=>v.default,Specs:()=>J.default,SpecsComparison:()=>Ne.default,SwiperBox:()=>_.default,TabGroup:()=>Q.default,TabWithImage:()=>Oe.default,Tabs:()=>K.default,TabsWithMedia:()=>Ve.default,ThreeDCarousel:()=>He.default,Title:()=>M.default,VideoFeature:()=>we.default,VideoModal:()=>z.VideoModal,WebPushPopup:()=>it.default,WheelLottery:()=>be.default,WhyChoose:()=>w.default,useAiuiContext:()=>st.useAiuiContext,useBizProductContext:()=>f.useBizProductContext,useEmarsysWebPush:()=>pt.useEmarsysWebPush,withLayout:()=>R.withLayout});module.exports=Pt(gt);var x=e(require("./ActivitySchedule/index.js")),y=e(require("./GiftShelf/index.js")),h=e(require("./GiftTierShelf/index.js")),S=e(require("./ActivityMechanism/index.js")),P=e(require("./BrandEquity/index.js")),C=e(require("./MemberEquity/index.js")),g=e(require("./Slogan/index.js")),M=e(require("./Title/index.js")),v=e(require("./Spacer/index.js")),B=e(require("./ShelfDisplay/index.js")),T=e(require("./Evaluate/index.js")),I=e(require("./Category/index.js")),b=e(require("./HeroBanner/index.js")),j=e(require("./AccordionCards/index.js")),D=e(require("./Graphic/index.js")),F=e(require("./MediaPlayerBase/index.js")),A=e(require("./MediaPlayerSticky/index.js")),G=e(require("./MediaPlayerMulti/index.js")),k=e(require("./Marquee/index.js")),L=e(require("./MarqueeReview/index.js")),w=e(require("./WhyChoose/index.js")),V=e(require("./Faq/index.js")),a=require("./Marquee/index.js"),O=e(require("./MultiLayoutGraphicBlock/index.js")),E=e(require("./GraphicAttractionBlock/index.js")),W=e(require("./HeaderNavigation/index.js")),N=e(require("./FooterNavigation/index.js")),q=e(require("./SearchPage/index.js")),s=require("./SearchPage/types.js"),R=require("../shared/Styles.js"),H=e(require("./AiuiProvider/index.js")),K=e(require("./Tabs/index.js")),_=e(require("./SwiperBox/index.js")),z=require("./VideoModal/index.js"),U=e(require("./CreativeModule/index.js")),Y=e(require("./GraphicOverlay/index.js")),J=e(require("./Specs/index.js")),Q=e(require("./TabsGroup/index.js")),f=e(require("./Listing/BizProductProvider.js")),X=e(require("./Listing/components/PurchaseBar/index.js")),Z=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),$=e(require("./Listing/components/ProductCard/index.js")),ee=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),te=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js")),re=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),oe=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),ae=e(require("./Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js")),ie=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),pe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),se=e(require("./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js")),fe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js")),de=e(require("./Listing/components/ProductCard/ProductGridBox.js")),ce=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),ue=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),le=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),me=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab.js")),ne=e(require("./Listing/components/PaidShipping/index.js")),xe=e(require("./Listing/components/CartActionButtons/index.js")),ye=require("./NotifyMeDialog/index.js"),he=e(require("./Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js")),Se=e(require("./Listing/components/ProductCard/ProductPaidShipping/index.js")),Pe=e(require("./GraphicMore/index.js")),Ce=e(require("./Features/index.js")),ge=e(require("./AplusDesc/index.js")),Me=e(require("./GiftBox/index.js")),ve=e(require("./SelectStore/index.js")),Be=e(require("./DownLoad/index.js")),Te=e(require("./FootCharger/index.js")),Ie=e(require("./BrandCardLink/index.js")),Mt=e(require("./IPRedirect/index.js")),be=e(require("./WheelLottery/index.js")),je=e(require("./ProductLottery/index.js")),De=e(require("./ProductCompare/index.js")),Fe=e(require("./Ksp/index.js")),Ae=e(require("./ImageTextFeature/index.js")),Ge=e(require("./FeatureCards/index.js")),ke=e(require("./FeaturedBlogPosts/index.js")),Le=e(require("./ImageWithText/index.js")),we=e(require("./VideoFeature/index.js")),Ve=e(require("./TabsWithMedia/index.js")),Oe=e(require("./TabWithImage/index.js")),Ee=e(require("./FeatureShowcase/index.js")),We=e(require("./ProductHero/index.js")),Ne=e(require("./SpecsComparison/index.js")),qe=e(require("./MediaSceneSwitcher/index.js")),Re=e(require("./MediaSceneSwitcherV2/index.js")),He=e(require("./ThreeDCarousel/index.js")),Ke=e(require("./ProductNav/index.js")),_e=e(require("./AnchorNavigation/index.js")),ze=e(require("./PromotionalBar/index.js")),Ue=e(require("./EventSchedule/index.js")),Ye=e(require("./SecondaryBanner/index.js")),Je=e(require("./BuyOneGetOneShelf/index.js")),Qe=e(require("./ActiveShelf/index.js")),Xe=e(require("./MediaShelf/index.js")),d=e(require("./CreditsShelf/index.js")),c=e(require("./SceneShelf/index.js")),u=e(require("./SceneShelfV2/index.js")),Ze=e(require("./SceneShelfV3/index.js")),$e=e(require("./MediaEndorsement/index.js")),et=e(require("./MediaTextOverlay/index.js")),tt=e(require("./ImageOverlayShelf/index.js")),rt=e(require("./ImageTextOverlay/index.js")),ot=e(require("./MiniCart/index.js")),at=e(require("./MiniCart/CircleProgress.js")),l=e(require("./MiniCart/MiniCartDialog.js")),it=e(require("./WebPushPopup/index.js")),pt=require("../hooks/useEmarsysWebPush.js"),st=require("./AiuiProvider/index.js"),ft=e(require("./ModalRegisterSubscribe/index.js")),dt=e(require("./ModalSubscribeConfirm/index.js")),ct=e(require("./ModalCoupon/index.js")),ut=e(require("./ModalSmsSubscribe/index.js")),lt=e(require("./ModalVerify/index.js"));const Ct={"ipc-accordioncards":"AccordionCards","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-giftshelf":"GiftShelf","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose","ipc-product-nav":"ProductNav","ipc-brand-card-link":"BrandCardLink","ipc-ipredirect":"IPRedirect",ksp:"Ksp","ipc-secondary-banner":"SecondaryBanner","ipc-media-endorsement":"MediaEndorsement","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-featured-blog-posts":"FeaturedBlogPosts","ipc-media-text-overlay":"MediaTextOverlay",ProductCompare:"ProductCompare"};
2
2
  //# sourceMappingURL=index.js.map