{"version":3,"file":"Image.BQdE-qs2.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","_e","p","c","init_jsx_runtime","ce","addPropertyControls","init_framer_BisrWwwE","Data","ControlType","useObserveData","createStore","dataStore","state1","setDataStore","newState","storeState","storeSetters","setStoreState","setter","useStore","state","setState","init_createStore","init_store_js__1_0","Image","props","wrapperStyle","borderAndShadow","shadowOptions","borderOptions","imageStyle","radius","shadowStyle","imageSource","image","link","alt","newTab","init_Image"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/4FYXL5lQz9cgJ2BJkaNV/uQoXZ4NvFasfJqYRTeHn/Image.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Responsive Image\n * By Benjamin\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight any\n * @framerDisableUnlink\n *\n */export default function Image(props){const{image,alt,radius,padding,link,newTab,style,borderOptions,shadowOptions}=props;const wrapperStyle={display:\"flex\",placeContent:\"center\",placeItems:\"center\",width:\"100%\",height:\"100%\",padding:padding};const borderAndShadow=(borderOptions,shadowOptions)=>{if(!shadowOptions&&!borderOptions)return undefined;if(shadowOptions&&!borderOptions){return`${shadowOptions.shadowX}px ${shadowOptions.shadowY}px ${shadowOptions.shadowBlur}px ${shadowOptions.shadowColor}`;}if(!shadowOptions&&borderOptions){return`inset 0 0 0 ${borderOptions.borderWidth}px ${borderOptions.borderColor}`;}if(shadowOptions&&borderOptions){return`inset 0 0 0 ${borderOptions.borderWidth}px ${borderOptions.borderColor}, ${shadowOptions.shadowX}px ${shadowOptions.shadowY}px ${shadowOptions.shadowBlur}px ${shadowOptions.shadowColor}`;}};const imageStyle={maxWidth:\"100%\",maxHeight:\"100%\",borderRadius:radius,webkitUserDrag:\"none\",userDrag:\"none\",userSelect:\"none\"};const shadowStyle={position:\"absolute\",inset:0,pointerEvents:\"none\",borderRadius:radius,boxShadow:borderAndShadow(borderOptions,shadowOptions)};const imageSource=(image===null||image===void 0?void 0:image.src)||\"https://framerusercontent.com/images/64n4wnVJKDJspLlFZ6DarCP0M4.jpg\";return link?/*#__PURE__*/_jsxs(\"a\",{href:link,title:alt,target:newTab?\"_blank\":\"_self\",style:wrapperStyle,children:[/*#__PURE__*/_jsx(\"img\",{style:imageStyle,src:imageSource,srcSet:image===null||image===void 0?void 0:image.srcSet,alt:alt}),/*#__PURE__*/_jsx(\"div\",{style:shadowStyle})]}):/*#__PURE__*/_jsxs(\"div\",{style:wrapperStyle,children:[/*#__PURE__*/_jsx(\"img\",{style:imageStyle,src:imageSource,srcSet:image===null||image===void 0?void 0:image.srcSet,alt:alt}),/*#__PURE__*/_jsx(\"div\",{style:shadowStyle})]});}addPropertyControls(Image,{image:{title:\"Image\",type:ControlType.ResponsiveImage},alt:{type:ControlType.String,title:\"Alt\",placeholder:\"Alt Text\"},radius:{title:\"Radius\",type:ControlType.Number,min:0,max:100,step:1,displayStepper:true},padding:{title:\"Padding\",type:ControlType.Number,min:0,max:100,step:1,displayStepper:true},link:{type:ControlType.Link,title:\"Link\"},newTab:{type:ControlType.Boolean,title:\"New Tab\",hidden:props=>!props.link},borderOptions:{type:ControlType.Object,optional:true,title:\"Border\",icon:\"effect\",controls:{borderColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"rgba(0,0,0,0.2)\"},borderWidth:{type:ControlType.Number,title:\"Width\",min:0,displayStepper:true,defaultValue:1}}},shadowOptions:{type:ControlType.Object,title:\"Shadow\",optional:true,icon:\"effect\",controls:{shadowX:{type:ControlType.Number,title:\"X\",min:0,defaultValue:0},shadowY:{type:ControlType.Number,title:\"Y\",min:0,defaultValue:2},shadowBlur:{type:ControlType.Number,title:\"Blur\",min:0,defaultValue:4},shadowColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"rgba(0,0,0,0.2)\"}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Image\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupport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