{"version":3,"file":"RandomDiscountValue.AwQLlRzm.mjs","names":["createContext","withStyle","forwardRef","classNames","useState","useContext","withStyle","forwardRef","classNames","withStyle","forwardRef","classNames","forwardRef","useState"],"sources":["https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Root.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Root.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Content.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Content.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Root.constants.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Item.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/Trigger.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/FoldableList/index.js","https:/asset.29cm.co.kr/contents/framer/components/systems/RandomDiscountValue/RandomDiscountValue.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createContext, forwardRef } from \"react\";\nimport { ComponentName } from \"../../../styles/ComponentName.js\";\nimport { createWithStyle } from \"../../../styles/createWithStyle.js\";\nimport { css } from \"../../../styles/css.js\";\nimport { useFold } from \"./Root.hooks.js\";\nimport { cx } from \"framer\";\nimport { Skeleton } from \"../Skeleton/Skeleton.js\";\nconst {\n  classNames,\n  withStyle\n} = createWithStyle(ComponentName.FoldableListRoot, {\n  container: css`\n    display: flex;\n    flex-direction: column;\n    align-items: flex-start;\n  `\n});\nconst FoldableListContext = createContext(null);\nconst Root = withStyle(forwardRef(({\n  children,\n  className,\n  theme = \"light\",\n  pending = false,\n  ...rest\n}, ref) => {\n  const {\n    isFolded,\n    toggleFold\n  } = useFold();\n  if (pending) {\n    return /* @__PURE__ */ jsx(Skeleton, { style: {\n      ...skeletonStyle,\n      ...skeletonStyleByTheme[theme]\n    } });\n  }\n  return /* @__PURE__ */ jsx(FoldableListContext.Provider, { value: {\n    theme,\n    isFolded,\n    toggleFold\n  }, children: /* @__PURE__ */ jsx(\"div\", { className: cx(className, classNames.container), ref, ...rest, children }) });\n}));\nconst skeletonStyle = {\n  width: 100,\n  height: 20,\n  borderRadius: 4\n};\nconst skeletonStyleByTheme = {\n  light: {\n    backgroundColor: \"#dee2e6\"\n  },\n  dark: {\n    backgroundColor: \"#27272a\"\n  }\n};\nexport {\n  FoldableListContext,\n  Root\n};\n","import { useState, useContext } from \"react\";\nimport { FoldableListContext } from \"./Root.js\";\nconst useFold = () => {\n  const [isFolded, setIsFolded] = useState(true);\n  const toggleFold = () => {\n    setIsFolded((prev) => !prev);\n  };\n  return {\n    isFolded,\n    toggleFold\n  };\n};\nconst useFoldableListContext = () => {\n  const context = useContext(FoldableListContext);\n  if (!context) {\n    throw new Error(\"useFoldableListContext should be used within Root\");\n  }\n  return context;\n};\nexport {\n  useFold,\n  useFoldableListContext\n};\n","import { useAnimationControls } from \"framer-motion\";\nimport { useFoldableListContext } from \"./Root.hooks.js\";\nimport { useEffect } from \"react\";\nconst useFoldControls = () => {\n  const {\n    isFolded\n  } = useFoldableListContext();\n  const controls = useAnimationControls();\n  useEffect(() => {\n    if (isFolded) {\n      controls.start({\n        height: 0\n      });\n    } else {\n      controls.start({\n        height: \"auto\"\n      });\n    }\n  }, [isFolded]);\n  return controls;\n};\nexport {\n  useFoldControls\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from \"react\";\nimport { ComponentName } from \"../../../styles/ComponentName.js\";\nimport { createWithStyle } from \"../../../styles/createWithStyle.js\";\nimport { css } from \"../../../styles/css.js\";\nimport { motion } from \"framer-motion\";\nimport { cx } from \"framer\";\nimport { useFoldControls } from \"./Content.hooks.js\";\nconst {\n  classNames,\n  withStyle\n} = createWithStyle(ComponentName.FoldableListContent, {\n  container: css`\n    display: flex;\n    flex-direction: column;\n    gap: 2px;\n    padding-top: 7px;\n  `\n});\nconst Content = withStyle(forwardRef(({\n  children,\n  className,\n  ...rest\n}, ref) => {\n  const controls = useFoldControls();\n  return /* @__PURE__ */ jsx(motion.div, { ref, initial: {\n    height: 0\n  }, animate: controls, style: {\n    overflow: \"hidden\"\n  }, transition: {\n    type: \"spring\",\n    stiffness: 500,\n    damping: 60,\n    mass: 1\n  }, children: /* @__PURE__ */ jsx(\"div\", { className: cx(className, classNames.container), ...rest, children }) });\n}));\nexport {\n  Content\n};\n","const textStyleByTheme = {\n  light: {\n    color: \"#474747\"\n  },\n  dark: {\n    color: \"#a0a0a0\"\n  }\n};\nexport {\n  textStyleByTheme\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { cx } from \"framer\";\nimport { forwardRef } from \"react\";\nimport { ComponentName } from \"../../../styles/ComponentName.js\";\nimport { createWithStyle } from \"../../../styles/createWithStyle.js\";\nimport { css } from \"../../../styles/css.js\";\nimport { typographyCSS } from \"../../../styles/typography.js\";\nimport { useFoldableListContext } from \"./Root.hooks.js\";\nimport { textStyleByTheme } from \"./Root.constants.js\";\nconst {\n  classNames,\n  withStyle\n} = createWithStyle(ComponentName.FoldableListItem, {\n  \"container\": css`\n    display: flex;\n\n    ${typographyCSS(12, 400)};\n\n    line-height: 1.6em;\n    white-space: pre-wrap;\n    word-break: keep-all;\n  `,\n  \"container::before\": css`\n    content: '•';\n    font-size: 16px;\n    margin-right: 6px;\n  `\n});\nconst Item = withStyle(forwardRef(({\n  children,\n  className,\n  style,\n  ...rest\n}, ref) => {\n  const {\n    theme\n  } = useFoldableListContext();\n  return /* @__PURE__ */ jsx(\"div\", { ref, className: cx(className, classNames.container), style: {\n    ...textStyleByTheme[theme],\n    ...style\n  }, ...rest, children });\n}));\nexport {\n  Item\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { forwardRef } from \"react\";\nimport { ComponentName } from \"../../../styles/ComponentName.js\";\nimport { createWithStyle } from \"../../../styles/createWithStyle.js\";\nimport { css } from \"../../../styles/css.js\";\nimport { typographyCSS } from \"../../../styles/typography.js\";\nimport { Icon } from \"../Icon/Icon.js\";\nimport { cx } from \"framer\";\nimport { useFoldableListContext } from \"./Root.hooks.js\";\nimport \"../../../hooks/stores/content/content.store.js\";\nimport \"../../../utils/event-properties/source.js\";\nimport { isCanvas } from \"../../../utils/framer/isCanvas.js\";\nimport { textStyleByTheme } from \"./Root.constants.js\";\nconst {\n  classNames,\n  withStyle\n} = createWithStyle(ComponentName.FoldableListTrigger, {\n  container: css`\n    display: flex;\n    align-items: center;\n    gap: 4px;\n    cursor: pointer;\n  `,\n  text: typographyCSS(14, 500, 1.6)\n});\nconst Trigger = withStyle(forwardRef(({\n  children,\n  className,\n  textStyle,\n  icons,\n  onClick,\n  ...rest\n}, ref) => {\n  const {\n    theme,\n    isFolded,\n    toggleFold\n  } = useFoldableListContext();\n  const {\n    initial = \"chevronDown\",\n    active = \"chevronUp\",\n    size = 14\n  } = icons ?? {};\n  const handleClick = (e) => {\n    onClick == null ? void 0 : onClick(e);\n    toggleFold();\n  };\n  return /* @__PURE__ */ jsxs(\"div\", { ref, className: cx(className, classNames.container), onClick: handleClick, ...rest, children: [\n    /* @__PURE__ */ jsx(\"div\", { className: classNames.text, style: {\n      ...textStyleByTheme[theme],\n      ...baseTextStyle,\n      ...textStyle\n    }, children }),\n    /* @__PURE__ */ jsx(AnimatePresence, { mode: \"wait\", children: /* @__PURE__ */ jsx(motion.div, { style: {\n      display: \"flex\",\n      alignItems: \"center\",\n      justifyContent: \"center\"\n    }, animate: {\n      opacity: 1\n    }, initial: {\n      opacity: isCanvas() ? 1 : 0\n    }, exit: {\n      opacity: 0\n    }, transition: {\n      duration: 0.2\n    }, children: /* @__PURE__ */ jsx(Icon, { type: isFolded ? initial : active, color: textStyleByTheme[theme].color, size, weight: \"bold\" }) }, isFolded ? \"plus\" : \"minus\") })\n  ] });\n}));\nconst baseTextStyle = {\n  minHeight: 20,\n  display: \"flex\",\n  alignItems: \"center\"\n};\nexport {\n  Trigger\n};\n","import { Content } from \"./Content.js\";\nimport { Item } from \"./Item.js\";\nimport { Root } from \"./Root.js\";\nimport { Trigger } from \"./Trigger.js\";\nconst FoldableList = {\n  Root,\n  Trigger,\n  Content,\n  Item\n};\nexport {\n  FoldableList\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { useState } from \"react\";\nimport { DiscountType } from \"../../../types/models/coupon.js\";\nimport \"../Countdown/Countdown.js\";\nimport \"react-dom\";\nimport \"../Dialog/Dialog.module.css.js\";\nimport \"framer-motion\";\nimport \"../Expandable/Expandable.js\";\nimport \"../FixedScrollProgressBar/FixedScrollProgressBar.js\";\nimport \"../../../hooks/stores/content/content.store.js\";\nimport \"../../../hooks/stores/dialog/dialog.store.js\";\nimport \"../../../hooks/stores/global-layout/global-layout.store.js\";\nimport \"../../../hooks/stores/toast/toast.store.js\";\nimport \"../../../node_modules/@firebase/analytics/dist/esm/index.esm2017.js\";\nimport \"../../../node_modules/firebase/app/dist/esm/index.esm.js\";\nimport \"../../../node_modules/swr/core/dist/index.js\";\nimport \"../../../apis/user-segment/CategoryFirstOrderApiService.js\";\nimport \"../../../config/index.js\";\nimport \"../../../node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js\";\nimport \"../../../node_modules/js-cookie/dist/js.cookie.js\";\nimport \"../../../apis/preuser/PreuserApiService.js\";\nimport \"framer\";\nimport \"../../../node_modules/@29cm/snowplow/dist/esm/core/snowplow.js\";\nimport \"../Products/Products.js\";\nimport \"../../../node_modules/swr/mutation/dist/index.js\";\nimport \"../../@shared/providers/ThemeProvider/ThemeProvider.js\";\nimport \"../../@shared/providers/BreakpointProvider/BreakpointProvider.js\";\nimport \"../../../hooks/stores/bottom-sheet/bottom-sheet.store.js\";\nimport \"../../../containers/DialogContainer/DialogContainer.emitter.js\";\nimport \"../../../utils/redirectLogin.js\";\nimport \"../../../utils/event-properties/source.js\";\nimport \"../../../constants/snowplow/snowplowSchema.js\";\nimport \"../ResponsiveSplitView/ResponsiveSplitView.js\";\nimport \"../ResponsiveSplitViewOverlayButton/ResponsiveSplitViewOverlayButton.js\";\nimport { RollingNumber } from \"../RollingNumber/RollingNumber.js\";\nimport \"../TabBar/TabBar.js\";\nimport \"../TimeProgressBar/TimeProgressBar.js\";\nimport \"../ViewportContainer/ViewportContainer.js\";\nimport \"../TabBarV2/TabBarV2.js\";\nimport \"../TabBarV3/TabBarV3.js\";\nimport { useVisibilityAwareInterval } from \"../../../hooks/useVisibilityAwareInterval.js\";\nconst RandomDiscountValue = ({\n  discountType,\n  discountValues\n}) => {\n  const [index, setIndex] = useState(0);\n  useVisibilityAwareInterval(() => {\n    setIndex((prev) => (prev + 1) % discountValues.length);\n  }, 800);\n  return /* @__PURE__ */ jsxs(\"div\", { style: {\n    display: \"flex\",\n    alignItems: \"center\"\n  }, children: [\n    /* @__PURE__ */ jsx(RollingNumber, { value: discountValues[index] ?? 0 }),\n    discountType === DiscountType.FIXED_RATE ? \"%\" : \"원\"\n  ] });\n};\nexport {\n  RandomDiscountValue\n};\n"],"mappings":"60BAAwC,IACU,IACe,IACI,IACxB,IACH,IACd,KACuB,EAEjD,WAAA,EACA,UAAA,GACE,EAAgB,EAAc,iBAAkB,CAClD,UAAW,CAAG;;;;IAKf,CAAC,CACI,EAAsBA,EAAc,KAAK,CACzC,EAAOC,EAAUC,GAAY,CACjC,WACA,YACA,QAAQ,QACR,UAAU,GACV,GAAG,GACF,IAAQ,CACT,GAAM,CACJ,WACA,cACE,GAAS,CAOb,OANI,EACqB,EAAI,GAAU,CAAE,MAAO,CAC5C,GAAG,EACH,GAAG,EAAqB,GACzB,CAAE,CAAC,CAEiB,EAAI,EAAoB,SAAU,CAAE,MAAO,CAChE,QACA,WACA,aACD,CAAE,SAA0B,EAAI,MAAO,CAAE,UAAW,EAAG,EAAWC,EAAW,UAAU,CAAE,MAAK,GAAG,EAAM,WAAU,CAAC,CAAE,CAAC,EACtH,CAAC,CACG,EAAgB,CACpB,MAAO,IACP,OAAQ,GACR,aAAc,EACf,CACK,EAAuB,CAC3B,MAAO,CACL,gBAAiB,UAClB,CACD,KAAM,CAC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