{"version":3,"file":"Subscriptions_utils.B2f659Xp.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/KV16nQZJzK2PakIJS3ds/mMwI0Z7Bn85AP14ADxu9/Shared_images.js","https:/framerusercontent.com/modules/0cFx6PDS8kp3yxNfnoIw/3wFcPS10LYSFljb1q710/Framer_utils.js","https:/framerusercontent.com/modules/rf7AA1DfRPDSrhfmrmpj/dKau7FhYy42WCs2fsPCY/Live_pricing_config.js","https:/framerusercontent.com/modules/CyNT4Zo4FfF9Gv96WuEJ/on07B49iJPW4gAkICFRL/Live_pricing_cache.js","https:/framerusercontent.com/modules/Nrs4jz2AAEOfEZRQEQij/7Ao2SBt1Ssf683HHXgzl/Shared_styles.js","https:/framerusercontent.com/modules/cmJdj1YCmFSsS6n95OKk/9t9XeEHurZ6w5fbXeCsJ/Shared_tag_props.js","https:/framerusercontent.com/modules/gNrx5shePoNxbUKTvliC/HLQJlFFZMsPSLpGIiDtr/Currency_symbols.js","https:/framerusercontent.com/modules/mHaK3bedwyJwyNxfaowX/hWKLWGrPdtcuWvTxZqnK/Shared_currency_props.js","https:/framerusercontent.com/modules/br9bXgadWgfJaD0swwuT/jUc9YNpAtX8KUoSpiBD2/Shared_text_decoration_props.js","https:/framerusercontent.com/modules/N0h2Mv73o8xtz2My1yiB/RR9fj2DVzBXn0Wwu7ijL/Loading_skeleton.js","https:/framerusercontent.com/modules/G9UZNzEc4NZQrMJzPvWx/mIDGZDuYkLeEfvCEqoly/Shared_props.js","https:/framerusercontent.com/modules/3QrZAq5uElJQ8m88NKWY/5xJkuuHwMm3iKqkoNzBk/Subscriptions_utils.js"],"sourcesContent":["export const SHARED_IMAGES={defaultProductImage:\"https://framerusercontent.com/images/sFKjyv5OwGE92YZ3xS9WwreFGQ.webp\",defaultProductBundleImage1:\"https://framerusercontent.com/images/snSeXEa7LUq2PApQHiAp0AEK9A.webp\",defaultProductBundleImage2:\"https://framerusercontent.com/images/Bg1fLvrV6AtLNlbTE9c15oMxaE.webp\"};\nexport const __FramerMetadata__ = {\"exports\":{\"SHARED_IMAGES\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shared_images.map","import{RenderTarget}from\"framer\";import{useEffect,useState}from\"react\";export function isOnFramerCanvasFn(){return RenderTarget.hasRestrictions();}export function isBrowserFn(){return typeof window!==\"undefined\";}export function useIsInFramerPreview(){const[isInFramerPreview,setIsInFramerPreview]=useState(false);useEffect(()=>{if(typeof window==\"undefined\")return;const currrentUrl=window.location.href;const isInFramerPreview=currrentUrl.includes(\"framercanvas.com\");setIsInFramerPreview(isInFramerPreview);},[]);return isInFramerPreview;}\nexport const __FramerMetadata__ = {\"exports\":{\"isBrowserFn\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isOnFramerCanvasFn\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIsInFramerPreview\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Framer_utils.map","export const LIVE_PRICING_CONFIG={CACHE_TTL_MINUTES:10,DEFAULT_CURRENCY:\"USD\",MAX_PRODUCTS_PER_QUERY:250,ENABLE_LIVE_PRICING:true};\nexport const __FramerMetadata__ = {\"exports\":{\"LIVE_PRICING_CONFIG\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Live_pricing_config.map","import{LIVE_PRICING_CONFIG}from\"https://framerusercontent.com/modules/rf7AA1DfRPDSrhfmrmpj/dKau7FhYy42WCs2fsPCY/Live_pricing_config.js\";const CACHE_KEY=\"frameship_live_pricing_cache\";/**\n * Get live pricing data from localStorage cache\n */export function getLivePricingFromCache(){try{const cached=localStorage.getItem(CACHE_KEY);if(!cached)return null;const parsed=JSON.parse(cached);return parsed;}catch(error){console.error(\"Error reading live pricing cache:\",error);return null;}}/**\n * Save live pricing data to localStorage cache\n */export function saveLivePricingToCache(data,market){try{const cacheData={data,timestamp:Date.now(),market,defaultCurrency:LIVE_PRICING_CONFIG.DEFAULT_CURRENCY};localStorage.setItem(CACHE_KEY,JSON.stringify(cacheData));}catch(error){console.error(\"Error saving live pricing cache:\",error);}}/**\n * Check if cache is still valid (not expired)\n */export function isCacheValid(cache,ttlMinutes=LIVE_PRICING_CONFIG.CACHE_TTL_MINUTES){if(!cache)return false;const ageMinutes=(Date.now()-cache.timestamp)/1e3/60;return ageMinutes<ttlMinutes;}/**\n * Determine if live pricing should be fetched\n * Fetch if:\n * 1. No cache exists\n * 2. Cache expired (> TTL)\n * 3. Market changed (different country code)\n */export function shouldFetchLivePricing(currentMarket){const cache=getLivePricingFromCache();// No cache exists - need to fetch\nif(!cache){return true;}// Cache expired - need to fetch\nif(!isCacheValid(cache)){return true;}// Market changed - need to fetch\nif(currentMarket&&cache.market!==currentMarket){return true;}return false;}/**\n * Clear live pricing cache\n */export function clearLivePricingCache(){try{localStorage.removeItem(CACHE_KEY);}catch(error){console.error(\"Error clearing live pricing cache:\",error);}}\nexport const __FramerMetadata__ = {\"exports\":{\"LivePricingCacheData\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"clearLivePricingCache\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getLivePricingFromCache\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isCacheValid\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"saveLivePricingToCache\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"shouldFetchLivePricing\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Live_pricing_cache.map","export const Colors={Primary:{color:\"#000000\",placeholderColor:\"rgba(0, 0, 0, 0.5)\",fill:{color:\"#F3F3F3\",colorA:\"#999999\",colorB:\"#F3F3F3\"},hover:{fill:{color:\"#E6E6E6\",colorA:\"#8C8C8C\",colorB:\"#E6E6E6\"}}},Accent:{color:\"#FFFFFF\",fill:{color:\"#111111\",colorA:\"#5E5E5E\",colorB:\"#111111\"},hover:{fill:{color:\"#1F1F1F\",colorA:\"#6B6B6B\",colorB:\"#1F1F1F\"}}}};export const SHARED_COLORS={background:\"#F3F3F3\",backgroundHover:\"#E6E6E6\",backgroundMuted:\"#D9D9D9\",foreground:\"#111111\",foregroundHover:\"#2A2A2A\",foregroundMuted:\"#757575\",primary:\"#40D41A\"};export const SHARED_STYLES={borderRadius:\"10px\",buttonPadding:\"8px 16px 8px 16px\"};\nexport const __FramerMetadata__ = {\"exports\":{\"Colors\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SHARED_STYLES\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SHARED_COLORS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shared_styles.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{ControlType}from\"framer\";export function renderWithTag(tag,content,style){const finalStyle={...style,margin:0,padding:0,whiteSpace:\"nowrap\"};switch(tag){case\"p\":return /*#__PURE__*/_jsx(\"p\",{style:finalStyle,children:content});case\"span\":return /*#__PURE__*/_jsx(\"span\",{style:finalStyle,children:content});case\"h1\":return /*#__PURE__*/_jsx(\"h1\",{style:finalStyle,children:content});case\"h2\":return /*#__PURE__*/_jsx(\"h2\",{style:finalStyle,children:content});case\"h3\":return /*#__PURE__*/_jsx(\"h3\",{style:finalStyle,children:content});case\"h4\":return /*#__PURE__*/_jsx(\"h4\",{style:finalStyle,children:content});case\"h5\":return /*#__PURE__*/_jsx(\"h5\",{style:finalStyle,children:content});case\"h6\":return /*#__PURE__*/_jsx(\"h6\",{style:finalStyle,children:content});}}export const TagPropertyControls={tag:{type:ControlType.Enum,options:[\"p\",\"span\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],defaultValue:\"p\"}};\nexport const __FramerMetadata__ = {\"exports\":{\"renderWithTag\":{\"type\":\"reactComponent\",\"name\":\"renderWithTag\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"TagPropertyControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TagPropertyControlsProps\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TagType\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shared_tag_props.map","export const CURRENCY_SYMBOLS={AED:\"د.إ\",AFN:\"؋\",ALL:\"L\",AMD:\"֏\",ANG:\"ƒ\",AOA:\"Kz\",ARS:\"$\",AUD:\"$\",AWG:\"ƒ\",AZN:\"₼\",BAM:\"KM\",BBD:\"$\",BDT:\"৳\",BGN:\"лв\",BHD:\".د.ب\",BIF:\"FBu\",BMD:\"$\",BND:\"$\",BOB:\"$b\",BOV:\"BOV\",BRL:\"R$\",BSD:\"$\",BTC:\"₿\",BTN:\"Nu.\",BWP:\"P\",BYN:\"Br\",BYR:\"Br\",BZD:\"BZ$\",CAD:\"$\",CDF:\"FC\",CHE:\"CHE\",CHF:\"CHF\",CHW:\"CHW\",CLF:\"CLF\",CLP:\"$\",CNH:\"\\xa5\",CNY:\"\\xa5\",COP:\"$\",COU:\"COU\",CRC:\"₡\",CUC:\"$\",CUP:\"₱\",CVE:\"$\",CZK:\"Kč\",DJF:\"Fdj\",DKK:\"kr\",DOP:\"RD$\",DZD:\"دج\",EEK:\"kr\",EGP:\"\\xa3\",ERN:\"Nfk\",ETB:\"Br\",ETH:\"Ξ\",EUR:\"€\",FJD:\"$\",FKP:\"\\xa3\",GBP:\"\\xa3\",GEL:\"₾\",GGP:\"\\xa3\",GHC:\"₵\",GHS:\"GH₵\",GIP:\"\\xa3\",GMD:\"D\",GNF:\"FG\",GTQ:\"Q\",GYD:\"$\",HKD:\"$\",HNL:\"L\",HRK:\"kn\",HTG:\"G\",HUF:\"Ft\",IDR:\"Rp\",ILS:\"₪\",IMP:\"\\xa3\",INR:\"₹\",IQD:\"ع.د\",IRR:\"﷼\",ISK:\"kr\",JEP:\"\\xa3\",JMD:\"J$\",JOD:\"JD\",JPY:\"\\xa5\",KES:\"KSh\",KGS:\"лв\",KHR:\"៛\",KMF:\"CF\",KPW:\"₩\",KRW:\"₩\",KWD:\"KD\",KYD:\"$\",KZT:\"₸\",LAK:\"₭\",LBP:\"\\xa3\",LKR:\"₨\",LRD:\"$\",LSL:\"M\",LTC:\"Ł\",LTL:\"Lt\",LVL:\"Ls\",LYD:\"LD\",MAD:\"MAD\",MDL:\"lei\",MGA:\"Ar\",MKD:\"ден\",MMK:\"K\",MNT:\"₮\",MOP:\"MOP$\",MRO:\"UM\",MRU:\"UM\",MUR:\"₨\",MVR:\"Rf\",MWK:\"MK\",MXN:\"$\",MXV:\"MXV\",MYR:\"RM\",MZN:\"MT\",NAD:\"$\",NGN:\"₦\",NIO:\"C$\",NOK:\"kr\",NPR:\"₨\",NZD:\"$\",OMR:\"﷼\",PAB:\"B/.\",PEN:\"S/.\",PGK:\"K\",PHP:\"₱\",PKR:\"₨\",PLN:\"zł\",PYG:\"Gs\",QAR:\"﷼\",RMB:\"￥\",RON:\"lei\",RSD:\"Дин.\",RUB:\"₽\",RWF:\"R₣\",SAR:\"﷼\",SBD:\"$\",SCR:\"₨\",SDG:\"ج.س.\",SEK:\"kr\",SGD:\"S$\",SHP:\"\\xa3\",SLL:\"Le\",SOS:\"S\",SRD:\"$\",SSP:\"\\xa3\",STD:\"Db\",STN:\"Db\",SVC:\"$\",SYP:\"\\xa3\",SZL:\"E\",THB:\"฿\",TJS:\"SM\",TMT:\"T\",TND:\"د.ت\",TOP:\"T$\",TRL:\"₤\",TRY:\"₺\",TTD:\"TT$\",TVD:\"$\",TWD:\"NT$\",TZS:\"TSh\",UAH:\"₴\",UGX:\"USh\",USD:\"$\",UYI:\"UYI\",UYU:\"$U\",UYW:\"UYW\",UZS:\"лв\",VEF:\"Bs\",VES:\"Bs.S\",VND:\"₫\",VUV:\"VT\",WST:\"WS$\",XAF:\"FCFA\",XBT:\"Ƀ\",XCD:\"$\",XOF:\"CFA\",XPF:\"₣\",XSU:\"Sucre\",XUA:\"XUA\",YER:\"﷼\",ZAR:\"R\",ZMW:\"ZK\",ZWD:\"Z$\",ZWL:\"$\"};/**\n * Get currency symbol by currency code\n * @param currencyCode - ISO 4217 currency code (e.g., \"USD\", \"EUR\", \"GBP\")\n * @returns Currency symbol or the currency code if not found\n */export const getCurrencySymbol=currencyCode=>{return CURRENCY_SYMBOLS[currencyCode]||currencyCode;};\nexport const __FramerMetadata__ = {\"exports\":{\"getCurrencySymbol\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CURRENCY_SYMBOLS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Currency_symbols.map","import{ControlType}from\"framer\";import{CURRENCY_SYMBOLS}from\"https://framerusercontent.com/modules/gNrx5shePoNxbUKTvliC/HLQJlFFZMsPSLpGIiDtr/Currency_symbols.js\";export function formatCurrency({amount,currencyCode,options}){amount=amount||0;const showDecimals=options.decimals==\"auto\"?amount%1!==0:options.decimals==\"always\";const decimals=showDecimals?2:0;let formattedAmount=\"\";if(options.formatted&&typeof Intl!==\"undefined\"){const locale=options.locale||(typeof navigator!==\"undefined\"?navigator.language:\"en-us\");const formatter=new Intl.NumberFormat(locale,{minimumFractionDigits:decimals,maximumFractionDigits:decimals});formattedAmount=formatter.format(amount);}else{formattedAmount=amount.toFixed(decimals);}if(!currencyCode||currencyCode===\"XXX\"){return formattedAmount;}const symbol=CURRENCY_SYMBOLS[currencyCode];if(options.style===\"code\"){return options.location===\"before\"?`${currencyCode} ${formattedAmount}`:`${formattedAmount} ${currencyCode}`;}else{return options.location===\"before\"?`${symbol}${formattedAmount}`:`${formattedAmount}${symbol}`;}}export const CurrencyFormatControls={currencyFormat:{type:ControlType.Object,title:\"Format\",controls:{style:{type:ControlType.Enum,defaultValue:\"symbol\",options:[\"symbol\",\"code\"],optionTitles:[\"Symbol ($)\",\"Code (USD)\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},location:{type:ControlType.Enum,defaultValue:\"before\",options:[\"before\",\"after\"],optionTitles:[\"Before\",\"After\"],displaySegmentedControl:true},decimals:{type:ControlType.Enum,defaultValue:\"auto\",options:[\"auto\",\"always\",\"never\"],optionTitles:[\"Auto\",\"Show (10.00)\",\"Hide (10)\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},formatted:{type:ControlType.Boolean,defaultValue:true},locale:{type:ControlType.String,defaultValue:\"\",placeholder:`Auto (${typeof navigator!==\"undefined\"?navigator.language:\"\"})`,description:\"Formatting examples:\\n*1,000* | *1.000* | *1 000*\",hidden:props=>!props.formatted}},hidden:props=>props.type!==\"subtotal\"}};\nexport const __FramerMetadata__ = {\"exports\":{\"formatCurrency\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CurrencyFormatControlsProps\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CurrencyFormatControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shared_currency_props.map","import{ControlType}from\"framer\";export const TextDecorationControls={decoration:{type:ControlType.Enum,title:\"Decoration\",options:[\"none\",\"underline\",\"line-through\"],optionTitles:[\"None\",\"Underline\",\"Strikethrough\"],defaultValue:\"none\"}};\nexport const __FramerMetadata__ = {\"exports\":{\"TextDecorationControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TextDecorationControlsProps\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TextDecoration\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shared_text_decoration_props.map","import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{SHARED_COLORS}from\"https://framerusercontent.com/modules/Nrs4jz2AAEOfEZRQEQij/7Ao2SBt1Ssf683HHXgzl/Shared_styles.js\";import{withCSS}from\"framer\";export const pulseKeyframes=`\n  @keyframes pulse {\n    0%, 100% {\n      opacity: 1;\n    }\n    50% {\n      opacity: 0.5;\n    }\n  }\n`;function LoadingSkeletonWithoutCss({style}){return /*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"16px\",backgroundColor:SHARED_COLORS.backgroundMuted,borderRadius:\"10px\",animation:\"pulse 1.5s ease-in-out infinite\",...style}})});}const LoadingSkeleton=withCSS(LoadingSkeletonWithoutCss,[pulseKeyframes],\"\");export default LoadingSkeleton;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoadingSkeleton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"pulseKeyframes\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Loading_skeleton.map","import{ControlType}from\"framer\";export const SHOPIFY_DATA_DESCRIPTION=\"Connect this to a *Shopify Data* variable from CMS.\";export const VARIANT_IMAGE_MAPPING_DESCRIPTION=\"Connect this to a *Variant Image Mapping* variable from CMS.\";export const VARIANT_OPTIONS_DESCRIPTION=\"Connect this to a *Variant Options* variable from CMS.\";export const BUNDLE_PRODUCTS_DATA_DESCRIPTION=\"Connect this to a *Bundle Products Data* variable from CMS.\";export const SECTION_PADDING_DESCRIPTION=\"Use this instead of gap on parent layer to avoid unnecessary spacing when the component is hidden.\";export const MARGIN_DESCRIPTION=\"Use margin instead of gap on parent layer to avoid unnecessary spacing when the component is hidden.\";export const SUPPORT_CONTROL={needHelp:{type:ControlType.Object,title:\"Need help?\",buttonTitle:\"Get Support\",icon:\"interaction\",controls:{info:{type:ControlType.Enum,defaultValue:\"info\",options:[\"info\"],optionTitles:[\"Support 🛟\"],displaySegmentedControl:true,title:\"Get Support\",description:\"We're here to help! The best place to get support is to visit our documentation to find your answers. We're also available on live chat.\\n\\n[Visit Frameship docs](https://insertframe.io/docs/frameship)\"}}}};export const SECTION_PADDING_CONTROL={padding:{// @ts-expect-error - Padding is not a valid control type in this Framer npm version\ntype:ControlType.Padding,title:\"Padding\",defaultValue:\"0px\",description:SECTION_PADDING_DESCRIPTION}};\nexport const __FramerMetadata__ = {\"exports\":{\"SECTION_PADDING_CONTROL\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SHOPIFY_DATA_DESCRIPTION\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"MARGIN_DESCRIPTION\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SUPPORT_CONTROL\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"VARIANT_IMAGE_MAPPING_DESCRIPTION\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SectionPadding\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"VARIANT_OPTIONS_DESCRIPTION\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SECTION_PADDING_DESCRIPTION\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"BUNDLE_PRODUCTS_DATA_DESCRIPTION\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shared_props.map","/**\n * Calculates the adjusted price for a variant based on selling plan price adjustments\n * @param basePrice - The base price of the variant\n * @param sellingPlan - The selling plan with price adjustments\n * @returns The adjusted price data, or null if no adjustments apply\n */export function calculateSellingPlanPrice(basePrice,sellingPlan){if(!sellingPlan?.priceAdjustments?.length){return null;}const adjustment=sellingPlan.priceAdjustments[0]?.adjustmentValue;if(!adjustment){return null;}const baseAmount=Number(basePrice.amount);// Case 1: Fixed price override\nif(\"price\"in adjustment){return{amount:adjustment.price.amount,currencyCode:adjustment.price.currencyCode||basePrice.currencyCode};}// Case 2: Percentage adjustment (e.g., -10 means 10% discount)\nif(\"adjustmentPercentage\"in adjustment){const percentage=adjustment.adjustmentPercentage;const adjustedAmount=baseAmount*(1-percentage/100);return{amount:adjustedAmount.toFixed(2),currencyCode:basePrice.currencyCode};}// Case 3: Fixed amount adjustment\nif(\"adjustmentAmount\"in adjustment){const adjustmentAmount=Number(adjustment.adjustmentAmount.amount);const adjustedAmount=baseAmount-adjustmentAmount;return{amount:adjustedAmount.toFixed(2),currencyCode:adjustment.adjustmentAmount.currencyCode||basePrice.currencyCode};}return null;}/**\n * Converts delivery frequency string to shorthand format\n * Examples:\n * - \"monthly\" → \"m\"\n * - \"month\" → \"m\"\n * - \"2 months\" → \"2m\"\n * - \"weekly\" → \"w\"\n * - \"3 weeks\" → \"3w\"\n * - \"daily\" → \"d\"\n * - \"yearly\" → \"y\"\n * - \"1 year\" → \"1y\"\n */export function formatDeliveryFrequencyShorthand(frequency){const normalized=frequency.toLowerCase().trim();// Extract number if present (e.g., \"2 months\" → \"2\")\nconst numberMatch=normalized.match(/^(\\d+)\\s*/);const number=numberMatch?numberMatch[1]:\"\";// Remove number and normalize the remaining text\nconst text=normalized.replace(/^\\d+\\s*/,\"\").trim();// Map time units to shorthand\nconst unitMap={day:\"d\",days:\"d\",daily:\"d\",week:\"w\",weeks:\"w\",weekly:\"w\",month:\"m\",months:\"m\",monthly:\"m\",year:\"y\",years:\"y\",yearly:\"y\"};const shorthand=unitMap[text]||text;// Return formatted: number + shorthand (e.g., \"2m\" or just \"m\")\nreturn number?`${number}${shorthand}`:shorthand;}\nexport const __FramerMetadata__ = {\"exports\":{\"formatDeliveryFrequencyShorthand\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"calculateSellingPlanPrice\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Subscriptions_utils.map"],"mappings":"qOAAa,EAAc,CAAC,oBAAoB,uEAAuE,2BAA2B,uEAAuE,2BAA2B,sEAAsE,KCAnP,SAAgB,GAAoB,CAAC,OAAO,EAAa,gBAAgB,CAAE,CAAC,SAAgB,GAAa,CAAC,OAAc,IAAS,MAAY,CAAC,SAAgB,GAAsB,CAAC,GAAK,CAAC,EAAkB,GAAsBA,EAAS,EAAK,EAA4M,OAA1M,MAAc,CAAC,GAAU,IAAQ,OAAY,OAA8C,IAAM,EAA3B,EAAO,SAAS,KAAyC,SAAS,kBAAkB,EAAE,EAAqB,CAAiB,CAAE,EAAE,CAAC,CAAC,EAAS,CAAkB,qBAA7f,IAAsC,iBCAzD,EAAoB,CAAC,kBAAkB,GAAG,iBAAiB,MAAM,uBAAuB,IAAI,oBAAoB,EAAI,KCE9H,SAAgB,GAAyB,CAAC,GAAG,CAAC,IAAM,EAAO,aAAa,QAAQ,CAAS,EAAyD,OAAnD,EAAgC,KAAK,MAAM,CAAoB,EAAjD,IAAmD,OAAO,EAAM,CAA0D,OAAzD,QAAQ,MAAM,oCAAoC,CAAK,EAAS,IAAK,CAAC,CAEpP,SAAgB,EAAuB,EAAK,EAAO,CAAC,GAAG,CAAC,IAAM,EAAU,CAAC,OAAK,UAAU,KAAK,IAAI,EAAE,SAAO,gBAAgB,EAAoB,gBAAgB,EAAE,aAAa,QAAQ,EAAU,KAAK,UAAU,CAAS,CAAC,CAAE,OAAO,EAAM,CA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