{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/6M0Bp7D5zqfUIuwL6SYg/AFl2O3mtqHCzXXjKgqPg/VariablePricingCalculator.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{AnimatePresence}from\"framer-motion\";const defaultActiveService=\"Framer Website\";const submitPageLink=\"cost-calculator-3/submit\";const reEstimatePageLink=\"/\";const currencySymbol=\"$\";const useStore=createStore({selectedCategory:\"Popular Services\",selectedCategoryIconName:\"Star\",activeService:defaultActiveService,activeServiceBasePrice:100,activeServicePrice:100,selectedModifiers:{// complexity: \"Low\",\n// urgency: \"Low\",\n// projectScope: \"Small\",\n// design: \"Include\",\nPlatform:\"Desktop\",Usage:\"Information\",Complexity:\"LessThan5\",Admins:\"LessThan2\",Integration:\"NoIntegration\",Design:\"Simple\",Users:\"LessThan100\"}});const modifiers={Users:{LessThan100:0,Under1000:0,MoreThan1000:0},Design:{Simple:0,SimpleWithSound:1e3,Designer:2e3},Integration:{NoIntegration:0,IntraOrganization:2643,InterOrganization:5287},Admins:{LessThan2:2643,Between4To6:6609,MoreThan6:9225},Complexity:{LessThan5:5287,Between5To10:10575,MoreThan10:15862},Usage:{Information:1760,Administration:2643,Process:3525,DigitalProduct:3525},Platform:{Desktop:1760,Mobile:2530,Both:3525},complexity:{Low:5,Medium:10,High:3.525},urgency:{Low:1,High:1.2},projectScope:{Small:1,Medium:1.3,Large:1.6},design:{Supplied:1,Include:1.5},devices:{Mobile:1,Desktop:1.5}};function calculateIndicativePrice(selectedModifiers,basePrice,ignoredModifiers=\"\"){const ignoredModifiersList=ignoredModifiers.split(\",\").map(mod=>mod.trim());let indicativePrice=basePrice;Object.keys(selectedModifiers).forEach(key=>{if(!ignoredModifiersList.includes(key)&&modifiers[key]){const modifierValue=selectedModifiers[key];indicativePrice+=modifiers[key][modifierValue];}});return indicativePrice;}export function withService(Component){return props=>{const[store,setStore]=useStore();const{title,basePrice,categories,ignoredModifiers=\"\",...restProps}=props;const indicativePrice=calculateIndicativePrice(store.selectedModifiers,basePrice,ignoredModifiers);const categoryList=categories.split(\",\").map(cat=>cat.trim());const selectedCategory=store.selectedCategory;const isVisible=categoryList.includes(selectedCategory);const handleSetActiveService=()=>{setStore(prevStore=>{const isActiveService=prevStore.activeService===title;return{...prevStore,activeService:isActiveService?\"\":title,activeServicePrice:isActiveService?0:indicativePrice,activeServiceBasePrice:basePrice};});};const isActiveService=store.activeService===title;const modifiedProps={title,...restProps,price:indicativePrice,variant:isActiveService?\"Open\":\"Closed\"};return /*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:isVisible&&/*#__PURE__*/_jsx(Component,{...modifiedProps,initial:{opacity:0,y:20},animate:{opacity:1,y:0},onClick:handleSetActiveService})});};}export function withSelectModifier(Component){return props=>{const[store,setStore]=useStore();const{modifierName,modifierValue,basePrice}=props;const handleToggleActive=()=>{setStore(prevStore=>{const newStore={...prevStore,selectedModifiers:{...prevStore.selectedModifiers}};if(!newStore.selectedModifiers[modifierName]||newStore.selectedModifiers[modifierName]!==modifierValue){newStore.selectedModifiers[modifierName]=modifierValue;}// Recalculate the indicative price based on the updated modifiers\nconst newIndicativePrice=calculateIndicativePrice(newStore.selectedModifiers,prevStore.activeServiceBasePrice);// Update activeServicePrice if the active service matches\nif(prevStore.activeService){newStore.activeServicePrice=newIndicativePrice;}return newStore;});};const isActive=store.selectedModifiers&&store.selectedModifiers[modifierName]===modifierValue;return /*#__PURE__*/_jsx(Component,{...props,variant:isActive?\"Active\":\"Inactive\",onClick:handleToggleActive});};}export function withSelectCategory(Component){return props=>{const[store,setStore]=useStore();const{category,iconName}=props;const handleCategorySelect=()=>{setStore(prevStore=>({...prevStore,selectedCategory:category,selectedCategoryIconName:iconName}));};const isActive=store.selectedCategory===category;return!isActive&&/*#__PURE__*/_jsx(Component,{...props,onClick:handleCategorySelect});};}export function withActiveCategory(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,title:store.selectedCategory,iconName:store.selectedCategoryIconName});};}export function withButtonLink(Component){return props=>{const[store]=useStore();const handleButtonClick=e=>{e.stopPropagation()// Prevent the click event from propagating to the parent elements\n;const activeService=store.activeService;const activeServicePrice=store.activeServicePrice;// Extract selected modifiers\nconst modifiers=store.selectedModifiers;const modifierParams=Object.entries(modifiers).map(([key,value])=>`${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join(\"&\");// Create the URL with the additional modifiers\nconst url=`${submitPageLink}?service=${encodeURIComponent(activeService)}&price=${encodeURIComponent(activeServicePrice)}&${modifierParams}`;document.location=url;};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleButtonClick});};}export function withReEstimateLink(Component){return props=>{const[store]=useStore();const handleButtonClick=e=>{e.stopPropagation()// Prevent the click event from propagating to the parent elements\n;const url=`${reEstimatePageLink}`;document.location=url;};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleButtonClick});};}export function withSelectService(Component){return props=>{const[store,setStore]=useStore();const[value,setValue]=useState(store.activeService||\"\");useEffect(()=>{const params=new URLSearchParams(window.location.search);const service=params.get(\"service\");if(service){setValue(service);setStore(prevStore=>({...prevStore,activeService:service}));}},[setStore]);const handleChange=event=>{const newValue=event.target.value;setValue(newValue);setStore(prevStore=>({...prevStore,activeService:newValue}));};return /*#__PURE__*/_jsx(Component,{...props,onChange:handleChange,defaultValue:value});};}export function withEstimatedPrice(Component){return props=>{const[store,setStore]=useStore();const[estimatedPrice,setEstimatedPrice]=useState(0);const getPriceFromURL=()=>{const params=new URLSearchParams(window.location.search);const price=parseFloat(params.get(\"price\"))||0;setEstimatedPrice(price);setStore(prevStore=>({...prevStore}));};useEffect(()=>{getPriceFromURL();},[]);return /*#__PURE__*/_jsx(Component,{...props,text:estimatedPrice.toFixed(0)});};}export function withSubmitEstimatedPrice(Component){return props=>{const[store,setStore]=useStore();const[value,setValue]=useState(0);useEffect(()=>{const params=new URLSearchParams(window.location.search);const price=parseFloat(params.get(\"price\"))||0;if(price){setValue(price);}else if(!price||price===0){setValue(0);}},[]);return /*#__PURE__*/_jsx(Component,{...props,value:`${currencySymbol}${value.toFixed(0)}`});};}function getDataFromURL(){const params=new URLSearchParams(window.location.search);const service=params.get(\"service\")||\"\";const price=parseFloat(params.get(\"price\"))||0;return{service,price};}export function withShowEstimatedPrice(Component){return props=>{const[store,setStore]=useStore();const[initialService,setInitialService]=useState(\"\");useEffect(()=>{const{service}=getDataFromURL();setInitialService(service);setStore(prevStore=>({...prevStore}));},[setStore]);const isVisible=store.activeService===initialService;if(isVisible){return /*#__PURE__*/_jsx(Component,{...props});}return null;};}export function withHideEstimateMessage(Component){return props=>{const[store,setStore]=useStore();const[initialService,setInitialService]=useState(\"\");useEffect(()=>{const{service}=getDataFromURL();setInitialService(service);setStore(prevStore=>({...prevStore}));},[setStore]);const isHidden=store.activeService===initialService;if(!isHidden){return /*#__PURE__*/_jsx(Component,{...props});}return null;};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSubmitEstimatedPrice\":{\"type\":\"reactHoc\",\"name\":\"withSubmitEstimatedPrice\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHideEstimateMessage\":{\"type\":\"reactHoc\",\"name\":\"withHideEstimateMessage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShowEstimatedPrice\":{\"type\":\"reactHoc\",\"name\":\"withShowEstimatedPrice\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectCategory\":{\"type\":\"reactHoc\",\"name\":\"withSelectCategory\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withActiveCategory\":{\"type\":\"reactHoc\",\"name\":\"withActiveCategory\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withService\":{\"type\":\"reactHoc\",\"name\":\"withService\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withEstimatedPrice\":{\"type\":\"reactHoc\",\"name\":\"withEstimatedPrice\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withButtonLink\":{\"type\":\"reactHoc\",\"name\":\"withButtonLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withReEstimateLink\":{\"type\":\"reactHoc\",\"name\":\"withReEstimateLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectService\":{\"type\":\"reactHoc\",\"name\":\"withSelectService\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSelectModifier\":{\"type\":\"reactHoc\",\"name\":\"withSelectModifier\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VariablePricingCalculator.map"],
  "mappings": "kLAAiM,IAAMA,EAAqB,iBAA8F,IAAMC,EAAe,IAAUC,EAASC,EAAY,CAAC,iBAAiB,mBAAmB,yBAAyB,OAAO,cAAcC,EAAqB,uBAAuB,IAAI,mBAAmB,IAAI,kBAAkB,CAI1hB,SAAS,UAAU,MAAM,cAAc,WAAW,YAAY,OAAO,YAAY,YAAY,gBAAgB,OAAO,SAAS,MAAM,aAAa,CAAC,CAAC,EAAQC,EAAU,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,gBAAgB,IAAI,SAAS,GAAG,EAAE,YAAY,CAAC,cAAc,EAAE,kBAAkB,KAAK,kBAAkB,IAAI,EAAE,OAAO,CAAC,UAAU,KAAK,YAAY,KAAK,UAAU,IAAI,EAAE,WAAW,CAAC,UAAU,KAAK,aAAa,MAAM,WAAW,KAAK,EAAE,MAAM,CAAC,YAAY,KAAK,eAAe,KAAK,QAAQ,KAAK,eAAe,IAAI,EAAE,SAAS,CAAC,QAAQ,KAAK,OAAO,KAAK,KAAK,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,IAAI,MAAM,GAAG,EAAE,O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,CAACkB,EAAeC,CAAiB,EAAEhB,EAAS,EAAE,EAAqL,OAAnLM,EAAU,IAAI,CAAC,GAAK,CAAC,QAAAO,CAAO,EAAED,EAAe,EAAEI,EAAkBH,CAAO,EAAEjB,EAASS,IAAY,CAAC,GAAGA,CAAS,EAAE,CAAE,EAAE,CAACT,CAAQ,CAAC,EAAkBD,EAAM,gBAAgBoB,EAAiDR,EAAKd,EAAU,CAAC,GAAGC,CAAK,CAAC,EAAU,IAAK,CAAE",
  "names": ["defaultActiveService", "currencySymbol", "useStore", "createStore", "defaultActiveService", "modifiers", "calculateIndicativePrice", "selectedModifiers", "basePrice", "ignoredModifiers", "ignoredModifiersList", "mod", "indicativePrice", "key", "modifierValue", "withService", "Component", "props", "store", "setStore", "title", "categories", "restProps", "categoryList", "cat", "selectedCategory", "isVisible", "handleSetActiveService", "prevStore", "isActiveService", "modifiedProps", "p", "AnimatePresence", "withSelectModifier", "modifierName", "handleToggleActive", "newStore", "newIndicativePrice", "isActive", "withSelectCategory", "category", "iconName", "handleCategorySelect", "withEstimatedPrice", "Component", "props", "store", "setStore", "useStore", "estimatedPrice", "setEstimatedPrice", "ye", "getPriceFromURL", "params", "window", "price", "prevStore", "ue", "p", "withSubmitEstimatedPrice", "value", "setValue", "currencySymbol", "getDataFromURL", "service", "withShowEstimatedPrice", "initialService", "setInitialService"]
}
