{"version":3,"file":"SharedFormCode.CC1BzPPr.mjs","names":[],"sources":["https:/framerusercontent.com/modules/MVzz2HKOSVPXKxZqPZdW/HsOcpLUwvhj8kPmjxpc7/SharedFormCode.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{ControlType}from\"framer\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";export const useFormStore=createStore({});export const SUPABASE_KEY=\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1ocndkdnNpdHJ6Y3pybmV1YXhnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDkxNjgyNzgsImV4cCI6MjAyNDc0NDI3OH0.4Pyysu1vMhnd1k1hbOSZ2lcx7hr1iH6MgX7fyTScYmU\";export function FormIcon(props){var _icon_image;const{icon,style}=props;if(!icon){return null;}return[/*#__PURE__*/_jsx(\"div\",{className:\"form-icon\",style:{width:icon.size,height:icon.size,opacity:icon.opacity,color:icon.color||props.fontColor,backgroundImage:icon.type==\"image\"&&`url(${(_icon_image=icon.image)===null||_icon_image===void 0?void 0:_icon_image.src})`,backgroundSize:\"cover\",backgroundPosition:\"center\",pointerEvents:\"none\",...style},dangerouslySetInnerHTML:icon.type==\"svg\"?{__html:icon.svg.replace(/width=\"(\\d+)\"/,`width=\"${icon.size}\"`).replace(/height=\"(\\d+)\"/,`width=\"${icon.size}\"`)}:undefined}),(icon===null||icon===void 0?void 0:icon.type)==\"svg\"&&/*#__PURE__*/_jsx(\"style\",{children:`.form-icon svg { display: block; }`})];}export const iconPropertyControls={type:ControlType.Object,optional:true,controls:{position:{type:ControlType.Enum,defaultValue:\"left\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],displaySegmentedControl:true},gap:{type:ControlType.Number,defaultValue:12,min:0,step:1},type:{type:ControlType.Enum,defaultValue:\"svg\",options:[\"svg\",\"image\"],optionTitles:[\"SVG\",\"Image\"],displaySegmentedControl:true},svg:{type:ControlType.String,placeholder:\"<svg></svg>\",displayTextArea:true,title:\"SVG\",hidden:props=>props.type!=\"svg\"},image:{type:ControlType.ResponsiveImage,hidden:props=>props.type!=\"image\"},color:{type:ControlType.Color,optional:true,hidden:props=>props.type!=\"svg\"},size:{type:ControlType.Number,defaultValue:24,min:1,step:1},opacity:{type:ControlType.Number,defaultValue:1,min:0,max:1,step:.01}}};export const shadowPropertyControls={type:ControlType.Object,optional:true,controls:{color:{type:ControlType.Color,defaultValue:\"rgba(0, 0, 0, 0.25)\"},x:{type:ControlType.Number,defaultValue:0,displayStepper:true},y:{type:ControlType.Number,defaultValue:2,displayStepper:true},blur:{type:ControlType.Number,defaultValue:4,min:0,displayStepper:true},spread:{type:ControlType.Number,defaultValue:0,displayStepper:true}}};class FramerFormsSDK{fetchPresignedURL(file){var _file_name;return fetch(`https://api.framerforms.com/s3/signed-url`,{method:\"POST\",body:JSON.stringify({file_name:(_file_name=file.name)===null||_file_name===void 0?void 0:_file_name.replace(/\\s+/g,\"-\")}),headers:{\"Content-Type\":\"application/json\"}}).then(async response=>{const responseBody=await response.json();if(response.status>200){throw new Error(responseBody.errorMessage);}return responseBody;});}postToPresignedURL(file,presignedUrl){return new Promise((resolve,reject)=>{fetch(presignedUrl,{method:\"PUT\",body:file}).then(()=>resolve({fileLocation:removeURLParameters(presignedUrl)})).catch(reject);});}uploadFile(file){return new Promise((resolve,reject)=>{this.fetchPresignedURL(file).then(({presignedUrl})=>this.postToPresignedURL(file,presignedUrl)).then(resolve).catch(reject);});}}const framerFormsSDK=new FramerFormsSDK;export{framerFormsSDK};function removeURLParameters(urlString){const url=new URL(urlString);url.search=\"\";return url.toString();}\nexport const __FramerMetadata__ = {\"exports\":{\"framerFormsSDK\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"iconPropertyControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"shadowPropertyControls\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"FormIcon\":{\"type\":\"reactComponent\",\"name\":\"FormIcon\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"useFormStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SUPABASE_KEY\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SharedFormCode.map"],"mappings":"wMAAua,SAAgB,EAAS,EAAM,CAAiB,GAAK,CAAC,OAAK,SAAO,EAA6B,OAAnB,EAAyB,CAAc,EAAK,MAAM,CAAC,UAAU,YAAY,MAAM,CAAC,MAAM,EAAK,KAAK,OAAO,EAAK,KAAK,QAAQ,EAAK,QAAQ,MAAM,EAAK,OAAO,EAAM,UAAU,gBAAgB,EAAK,MAAM,SAAS,OAAoB,EAAK,OAAuD,IAAI,GAAG,eAAe,QAAQ,mBAAmB,SAAS,cAAc,OAAO,GAAG,EAAM,CAAC,wBAAwB,EAAK,MAAM,MAAM,CAAC,OAAO,EAAK,IAAI,QAAQ,gBAAgB,UAAU,EAAK,KAAK,GAAG,CAAC,QAAQ,iBAAiB,UAAU,EAAK,KAAK,GAAG,CAAC,CAAC,IAAA,GAAU,CAAC,CAAE,GAAuC,MAAO,OAAoB,EAAK,QAAQ,CAAC,SAAS,qCAAqC,CAAC,CAAC,CAAjpB,KAAivF,SAAS,EAAoB,EAAU,CAAC,IAAM,EAAI,IAAI,IAAI,EAAU,CAAe,MAAd,GAAI,OAAO,GAAU,EAAI,UAAU,4BAA9yG,IAAgC,IAAqE,CAAa,EAAa,EAAY,EAAE,CAAC,CAAc,EAAa,mNAA48B,EAAqB,CAAC,KAAK,EAAY,OAAO,SAAS,GAAK,SAAS,CAAC,SAAS,CAAC,KAAK,EAAY,KAAK,aAAa,OAAO,QAAQ,CAAC,OAAO,QAAQ,CAAC,aAAa,CAAC,OAAO,QAAQ,CAAC,wBAAwB,GAAK,CAAC,IAA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