{"version":3,"file":"FcCartButtonCheckout.ByQ393oZ.mjs","names":["ShopXCartSubtotal"],"sources":["https:/framerusercontent.com/modules/dHdopeVlFXwlq3op8SrG/4CcqLuc07F0LkVAnmdWk/FcCartSubtotal.js","https:/framerusercontent.com/modules/j8kiseIA8ycQSdexTzLd/XqjPirdEscOPIDWK1xZf/FcCartButtonCheckout.js"],"sourcesContent":["/*\n * Framer Commerce\n * Confidential and Proprietary - All Rights Reserved\n * Unauthorized use, reproduction, distribution, or disclosure of this\n * source code or any related information is strictly prohibited.\n *\n * This software is the exclusive property of Framer Commerce (\"Company\").\n * It is considered highly confidential and proprietary information.\n *\n * Any use, copying, modification, distribution, or sharing of this software,\n * in whole or in part, without the express written permission of the Company\n * is strictly prohibited and may result in legal action.\n *\n * DISCLAIMER: This software does not provide any express or\n * implied warranties, including, but not limited to, the implied warranties\n * of merchantability and fitness for a particular purpose. In no event shall\n * Framer Commerce be liable for any direct, indirect, incidental, special,\n * exemplary, or consequential damages (including, but not limited to, procurement\n * of substitute goods or services; loss of use, data, or profits; or business\n * interruption) however caused and on any theory of liability, whether in\n * contract, strict liability, or tort (including negligence or otherwise)\n * arising in any way out of the use of this software, even if advised of\n * the possibility of such damage.\n *\n * Any unauthorized possession, use, copying, distribution, or dissemination\n * of this software will be considered a breach of confidentiality and may\n * result in legal action.\n *\n * For inquiries, contact:\n * Framer Commerce\n * Email: hello@framercommerce.com\n *\n * © 2023 Framer Commerce. All Rights Reserved.\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useMemo,useState}from\"react\";// Internal\nimport ShopXCartSubtotal from\"https://framer.com/m/shopX-cartSubtotal-pv7y.js\";// Framer\nimport{addPropertyControls,ControlType}from\"framer\";// MISC\nimport{get}from\"lodash-es\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerDisableUnlink\n */export default function FcCartSubtotal(props){const[checkout,setCheckout]=useState({});useEffect(()=>{// Grab checkout details if already exists\nif(get(window,\"shopXtools.checkout\")){setCheckout(get(window,\"shopXtools.checkout\"));}function handleCheckoutChange(e){if(e.detail){setCheckout(e.detail);}}document.addEventListener(\"checkout__changed\",handleCheckoutChange);return()=>{document.removeEventListener(\"checkout__changed\",handleCheckoutChange);};},[]);const _hideDecimalsIfNotNecessary=get(window,\"shopXtools.configs.prices.hideDecimalsIfNotNecessary\");const _subTotal=get(checkout,\"totalPriceV2.amount\");const _subTotalToShow=parseFloat(_subTotal).toLocaleString(\"en-US\",{minimumFractionDigits:_hideDecimalsIfNotNecessary?0:2,maximumFractionDigits:_hideDecimalsIfNotNecessary?2:2});const _currencyCode=get(checkout,\"totalPriceV2.currencyCode\")||\"USD\";const _currencySymbol=get(window,`__currencyMap.${_currencyCode}`)||\"$\";const showMockValues=_subTotal===undefined&&(get(window,\"location.origin\")||\"\").endsWith(\"framercanvas.com\");const text=useMemo(()=>{if(showMockValues){return`$0${props.showCurrency?\" USD\":\"\"}`;}const _currencySymbolConfig=get(window,\"shopXtools.configs.prices.currencySymbol\");if(_currencySymbolConfig===\"hide\"){return`${_subTotalToShow}${props.showCurrency?` ${_currencyCode}`:\"\"}`;}else if(_currencySymbolConfig===\"right\"){return`${_subTotalToShow}${_currencySymbol}${props.showCurrency?` ${_currencyCode}`:\"\"}`;}return`${_currencySymbol}${_subTotalToShow}${props.showCurrency?` ${_currencyCode}`:\"\"}`;},[props.showCurrency,showMockValues,_subTotalToShow,_currencyCode,_currencySymbol]);return /*#__PURE__*/_jsx(ShopXCartSubtotal,{...props,text:/*#__PURE__*/_jsx(\"p\",{style:{...props.font,color:props.color},children:text}),style:{width:\"100%\"}});}FcCartSubtotal.defaultProps={};addPropertyControls(FcCartSubtotal,{showCurrency:{title:\"Currency\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\"},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\"},color:{type:ControlType.Color,defaultValue:\"#000\",title:\"Color\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FcCartSubtotal\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FcCartSubtotal.map","/*\n * Framer Commerce\n * Confidential and Proprietary - All Rights Reserved\n * Unauthorized use, reproduction, distribution, or disclosure of this\n * source code or any related information is strictly prohibited.\n *\n * This software is the exclusive property of Framer Commerce (\"Company\").\n * It is considered highly confidential and proprietary information.\n *\n * Any use, copying, modification, distribution, or sharing of this software,\n * in whole or in part, without the express written permission of the Company\n * is strictly prohibited and may result in legal action.\n *\n * DISCLAIMER: This software does not provide any express or\n * implied warranties, including, but not limited to, the implied warranties\n * of merchantability and fitness for a particular purpose. In no event shall\n * Framer Commerce be liable for any direct, indirect, incidental, special,\n * exemplary, or consequential damages (including, but not limited to, procurement\n * of substitute goods or services; loss of use, data, or profits; or business\n * interruption) however caused and on any theory of liability, whether in\n * contract, strict liability, or tort (including negligence or otherwise)\n * arising in any way out of the use of this software, even if advised of\n * the possibility of such damage.\n *\n * Any unauthorized possession, use, copying, distribution, or dissemination\n * of this software will be considered a breach of confidentiality and may\n * result in legal action.\n *\n * For inquiries, contact:\n * Framer Commerce\n * Email: hello@framercommerce.com\n *\n * © 2023 Framer Commerce. All Rights Reserved.\n */ import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";// MISC\nimport{get}from\"lodash-es\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerDisableUnlink\n */ export default function FcCartButtonCheckout(props){const[checkout,setCheckout]=useState({});useEffect(()=>{// Grab checkout details if already exists\nif(get(window,\"shopXtools.checkout\")){setCheckout(get(window,\"shopXtools.checkout\"));}function handleCheckoutChange(e){if(e.detail){setCheckout(e.detail);}}document.addEventListener(\"checkout__changed\",handleCheckoutChange);return()=>{document.removeEventListener(\"checkout__changed\",handleCheckoutChange);};},[]);return /*#__PURE__*/ _jsx(\"a\",{style:{display:\"block\",width:\"100%\",height:\"100%\"},href:checkout&&(get(checkout,\"lineItems.edges\")||[]).length!==0?get(checkout,\"webUrl\"):undefined});};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FcCartButtonCheckout\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FcCartButtonCheckout.map"],"mappings":"ycAyCG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,EAAS,EAAY,CAAC,EAAS,CAAE,EAAC,CAAC,EAAU,IAAI,CACxG,AAAG,EAAI,EAAO,sBAAsB,EAAE,EAAY,EAAI,EAAO,sBAAsB,CAAC,CAAE,SAAS,EAAqB,EAAE,CAAC,AAAG,EAAE,QAAQ,EAAY,EAAE,OAAO,AAAG,CAAoE,gBAA3D,iBAAiB,oBAAoB,EAAqB,CAAO,IAAI,CAAC,SAAS,oBAAoB,oBAAoB,EAAqB,AAAE,CAAE,EAAC,CAAE,EAAC,CAAC,IAAM,EAA4B,EAAI,EAAO,uDAAuD,CAAO,EAAU,EAAI,EAAS,sBAAsB,CAAO,EAAgB,WAAW,EAAU,CAAC,eAAe,QAAQ,CAAC,sBAAsB,EAA4B,EAAE,EAAE,sBAAkD,CAAI,EAAC,CAAO,EAAc,EAAI,EAAS,4BAA4B,EAAE,MAAY,EAAgB,EAAI,GAAQ,gBAAgB,IAAgB,EAAE,IAAU,EAAe,QAAA,IAAuB,CAAC,EAAI,EAAO,kBAAkB,EAAE,IAAI,SAAS,mBAAmB,CAAO,EAAK,EAAQ,IAAI,CAAC,GAAG,EAAgB,OAAO,IAAI,EAAM,aAAa,OAAO,KAAM,IAAM,EAAsB,EAAI,EAAO,2CAA2C,CAA+O,OAA3O,IAAwB,UAAiB,IAAkB,EAAM,cAAc,GAAG,IAAgB,KA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