{"version":3,"file":"Button.BeF5ByaR.mjs","names":["useMemo"],"sources":["https:/asset.29cm.co.kr/contents/framer/components/systems/Button/Button.utils.js","https:/asset.29cm.co.kr/contents/framer/components/systems/Button/Button.js","https:/framerusercontent.com/modules/StvG2c1V7uA5IIqUxIaE/vbcf7LFrQUhWMAfEAWy2/Button.js"],"sourcesContent":["import { getAnchorTarget } from \"../../../utils/getAnchorTarget.js\";\nconst resolveFramerButtonUrl = ({\n  url,\n  urlType,\n  isWebview\n}) => {\n  switch (urlType) {\n    case \"onelink\":\n      return url;\n    case \"outlink\":\n      return isWebview && url ? `app29cm://outlink/${url}` : url;\n    default:\n      return isWebview && url ? `app29cm://web/${url}` : url;\n  }\n};\nconst reshapeProps = (props) => {\n  const {\n    url,\n    onTap,\n    prefixIcon,\n    postfixIcon,\n    fillIcon,\n    ...rest\n  } = props;\n  const disabled = rest.variant === \"disabled\";\n  return {\n    as: url ? \"a\" : \"button\",\n    href: url,\n    target: url ? getAnchorTarget(url) : \"_self\",\n    disabled,\n    onClick: onTap,\n    ...toPropsWithIcon(fillIcon, prefixIcon, postfixIcon),\n    ...rest\n  };\n};\nconst toPropsWithIcon = (fill, prefixIcon, postfixIcon) => {\n  if (!postfixIcon) {\n    return {\n      prefixIcon: toIconOptions(fill, prefixIcon)\n    };\n  }\n  return {\n    postfixIcon: toIconOptions(fill, postfixIcon)\n  };\n};\nconst toIconOptions = (fill, icon) => {\n  if (icon && typeof icon === \"string\") {\n    return {\n      type: icon,\n      fill\n    };\n  }\n  return void 0;\n};\nconst isValidUrl = (url) => {\n  if (!url) {\n    return true;\n  }\n  return url.startsWith(\"https://\");\n};\nexport {\n  isValidUrl,\n  reshapeProps,\n  resolveFramerButtonUrl\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport { useMemo } from \"react\";\nimport { ButtonVariant, ButtonTheme, ButtonSize } from \"../../@shared/Button/Button.types.js\";\nimport { useDeviceInfo } from \"../../../hooks/useDeviceInfo.js\";\nimport { isCanvas } from \"../../../utils/framer/isCanvas.js\";\nimport { Button as Default } from \"../../@shared/Button/Button.js\";\nimport { PREFIX_ICON_OPTIONS, POSTFIX_ICON_OPTIONS } from \"./Button.constants.js\";\nimport { resolveFramerButtonUrl, reshapeProps, isValidUrl } from \"./Button.utils.js\";\nconst urlWarningStyle = {\n  marginTop: 4,\n  color: \"#dc2626\",\n  fontSize: 11,\n  fontWeight: 500\n};\nconst FramerButton = (props) => {\n  const {\n    isWebview\n  } = useDeviceInfo();\n  const url = useMemo(() => resolveFramerButtonUrl({\n    url: props.url,\n    urlType: props.urlType,\n    isWebview\n  }), [props.url, props.urlType, isWebview]);\n  const {\n    text,\n    ...rest\n  } = reshapeProps({\n    ...props,\n    url\n  });\n  const showUrlWarning = isCanvas() && !isValidUrl(props.url);\n  if (showUrlWarning) {\n    return /* @__PURE__ */ jsxs(\"div\", { style: {\n      display: \"inline-block\",\n      width: rest.fill ? \"100%\" : \"auto\"\n    }, children: [\n      /* @__PURE__ */ jsx(Default, { ...rest, children: text }),\n      /* @__PURE__ */ jsx(\"div\", { style: urlWarningStyle, children: \"⚠️ URL은 https://로 시작해야 합니다\" })\n    ] });\n  }\n  return /* @__PURE__ */ jsx(Default, { ...rest, children: text });\n};\naddPropertyControls(FramerButton, {\n  variant: {\n    type: ControlType.Enum,\n    title: \"변형\",\n    options: [ButtonVariant.PRIMARY, ButtonVariant.SECONDARY, ButtonVariant.TERTIARY, ButtonVariant.CUSTOM, ButtonVariant.DISABLED],\n    optionTitles: [\"primary\", \"secondary\", \"tertiary\", \"custom\", \"disabled\"]\n  },\n  theme: {\n    type: ControlType.Enum,\n    title: \"테마\",\n    options: [ButtonTheme.LIGHT, ButtonTheme.DARK],\n    optionTitles: [\"light\", \"dark\"],\n    defaultValue: ButtonTheme.LIGHT,\n    displaySegmentedControl: true\n  },\n  backgroundColor: {\n    hidden: ({\n      variant\n    }) => variant !== ButtonVariant.CUSTOM,\n    type: ControlType.Color,\n    title: \"배경 색상\",\n    optional: true\n  },\n  color: {\n    hidden: ({\n      variant\n    }) => variant !== ButtonVariant.CUSTOM,\n    type: ControlType.Color,\n    title: \"텍스트 색상\",\n    optional: true\n  },\n  size: {\n    type: ControlType.Enum,\n    title: \"크기\",\n    options: [ButtonSize.LARGE, ButtonSize.MEDIUM, ButtonSize.SMALL, ButtonSize.X_SMALL],\n    optionTitles: [\"large\", \"medium\", \"small\", \"xSmall\"],\n    defaultValue: ButtonSize.MEDIUM\n  },\n  fill: {\n    type: ControlType.Boolean,\n    title: \"반응형 너비\",\n    defaultValue: false\n  },\n  text: {\n    type: ControlType.String,\n    title: \"텍스트\",\n    defaultValue: \"텍스트\"\n  },\n  prefixIcon: {\n    hidden: ({\n      postfixIcon\n    }) => Boolean(postfixIcon),\n    type: ControlType.Enum,\n    title: \"좌측 아이콘\",\n    options: [void 0, ...PREFIX_ICON_OPTIONS],\n    optionTitles: [\"선택 안 함\", ...PREFIX_ICON_OPTIONS]\n  },\n  postfixIcon: {\n    hidden: ({\n      prefixIcon\n    }) => Boolean(prefixIcon),\n    type: ControlType.Enum,\n    title: \"우측 아이콘\",\n    options: [void 0, ...POSTFIX_ICON_OPTIONS],\n    optionTitles: [\"선택 안 함\", ...POSTFIX_ICON_OPTIONS]\n  },\n  fillIcon: {\n    type: ControlType.Boolean,\n    title: \"아이콘 채우기\",\n    defaultValue: false\n  },\n  url: {\n    hidden: ({\n      variant\n    }) => variant === ButtonVariant.DISABLED,\n    type: ControlType.Link,\n    title: \"URL\",\n    description: \"https://로 시작하는 전체 URL을 입력해주세요.\"\n  },\n  urlType: {\n    type: ControlType.Enum,\n    title: \"URL 타입\",\n    options: [\"default\", \"onelink\", \"outlink\"],\n    optionTitles: [\"기본\", \"OneLink\", \"OutLink\"],\n    defaultValue: \"default\",\n    description: \"기본: 앱 웹뷰 이동. OneLink: deeplink 변환 없이 URL 그대로 사용. OutLink: 외부 브라우저로 열기.\"\n  },\n  onTap: {\n    hidden: ({\n      variant\n    }) => variant === ButtonVariant.DISABLED,\n    type: ControlType.EventHandler\n  }\n});\nexport {\n  FramerButton\n};\n","import{FramerButton}from\"https://asset.29cm.co.kr/contents/framer/components/systems/Button/Button.js\";FramerButton.displayName=\"Button\";/**\n * @framerDisableUnlink\n */export default FramerButton;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FramerButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Button.map"],"mappings":"sWAAmE,EAC7D,GAA0B,CAC9B,MACA,UACA,eACI,CACJ,OAAQ,EAAR,CACE,IAAK,UACH,OAAO,EACT,IAAK,UACH,OAAO,GAAa,EAAM,qBAAqB,IAAQ,EACzD,QACE,OAAO,GAAa,EAAM,iBAAiB,IAAQ,CACvD,CACF,EACM,EAAgB,GAAU,CAC9B,GAAM,CACJ,MACA,QACA,aACA,cACA,WACA,GAAG,GACD,EACE,EAAW,EAAK,UAAY,WAClC,MAAO,CACL,GAAI,EAAM,IAAM,SAChB,KAAM,EACN,OAAQ,EAAM,EAAgB,CAAG,EAAI,QACrC,WACA,QAAS,EACT,GAAG,EAAgB,EAAU,EAAY,CAAW,EACpD,GAAG,CACL,CACF,EACM,GAAmB,EAAM,EAAY,IACpC,EAKE,CACL,YAAa,EAAc,EAAM,CAAW,CAC9C,EANS,CACL,WAAY,EAAc,EAAM,CAAU,CAC5C,EAME,GAAiB,EAAM,IAAS,CACpC,GAAI,GAAQ,OAAO,GAAS,SAC1B,MAAO,CACL,KAAM,EACN,MACF,CAGJ,EACM,EAAc,GAClB,CAAK,GAGE,EAAI,WAAW,UAAU,qBC1DW,IACY,IAC1B,IAC8D,IAC9B,IACH,IACM,IACe,IACG,EAC9E,EAAkB,CACtB,UAAW,EACX,MAAO,UACP,SAAU,GACV,WAAY,GACd,EACM,EAAgB,GAAU,CAC9B,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