{"version":3,"file":"VolunteerForm.BboWNHi5.mjs","names":["useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/WKTcBhoZhq1wYanahjeR/HEzd4jVDmhrTJlWESsPA/VolunteerForm.js"],"sourcesContent":["\"use client\";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";// Framer property controls (types provided by Framer at runtime)\n// @ts-ignore - Framer provides these types at runtime\nimport{addPropertyControls,ControlType}from\"framer\";const TYPEFORM_SCRIPT_URL=\"https://embed.typeform.com/next/embed.js\";/**\n * Extracts the Typeform slug from a URL, slug, or live embed ID.\n * - \"https://form.typeform.com/to/MYwCHfZU\" → \"MYwCHfZU\"\n * - \"MYwCHfZU\" → \"MYwCHfZU\"\n * - \"01KGHTT4H3D441SDC1MNEP3RM7\" (26+ chars) → treated as live ID, returns null\n */function parseTypeformInput(input){const trimmed=input.trim();const urlMatch=trimmed.match(/typeform\\.com\\/to\\/([A-Za-z0-9]+)/);if(urlMatch)return{type:\"widget\",slug:urlMatch[1]};if(trimmed.length>=24&&/^[a-f0-9-]+$/i.test(trimmed))return{type:\"live\",id:trimmed};return{type:\"widget\",slug:trimmed};}export default function VolunteerApplyFormSection({typeformId=\"MYwCHfZU\",paddingTop=80,paddingBottom=64,embedMinHeight=800,backgroundColor=\"#000000\"}){const embedRef=useRef(null);const parsed=typeformId?parseTypeformInput(typeformId):null;// Load Typeform embed script once (works in Framer and Next.js)\nuseEffect(()=>{if(!parsed)return;const existing=document.querySelector(`script[src=\"${TYPEFORM_SCRIPT_URL}\"]`);if(existing)return;const script=document.createElement(\"script\");script.src=TYPEFORM_SCRIPT_URL;script.async=true;document.body.appendChild(script);},[typeformId]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n        .volunteer-apply-form-section {\n          width: 100%;\n          position: relative;\n        }\n        .volunteer-apply-form-section__embed {\n          width: 100%;\n          border: none;\n        }\n        .volunteer-apply-form-section__embed iframe {\n          width: 100%;\n          height: 100%;\n          min-height: inherit;\n          border: none;\n        }\n      `}),/*#__PURE__*/_jsx(\"section\",{className:\"volunteer-apply-form-section\",style:{paddingTop:`${paddingTop}px`,paddingBottom:`${paddingBottom}px`,backgroundColor},children:/*#__PURE__*/_jsx(\"div\",{ref:embedRef,className:\"volunteer-apply-form-section__embed\",...parsed?.type===\"live\"?{\"data-tf-live\":parsed.id}:parsed?.type===\"widget\"?{\"data-tf-widget\":parsed.slug}:{},style:{minHeight:`${embedMinHeight}px`}})})]});}// Property controls for Framer\naddPropertyControls(VolunteerApplyFormSection,{typeformId:{type:ControlType.String,title:\"Typeform ID\",description:\"Paste a URL (form.typeform.com/to/xxx), slug (xxx), or live embed ID\",defaultValue:\"MYwCHfZU\"},paddingTop:{type:ControlType.Number,title:\"Padding top\",unit:\"px\",min:0,max:400,step:4,defaultValue:80},paddingBottom:{type:ControlType.Number,title:\"Padding bottom\",unit:\"px\",min:0,max:400,step:4,defaultValue:64},embedMinHeight:{type:ControlType.Number,title:\"Form height\",unit:\"px\",min:400,max:2e3,step:50,defaultValue:800},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VolunteerApplyFormSection\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"VolunteerApplyFormSectionProps\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VolunteerForm.map"],"mappings":"+LAOG,SAAS,EAAmB,EAAM,CAAC,IAAM,EAAQ,EAAM,MAAM,CAAO,EAAS,EAAQ,MAAM,oCAAoC,CAAwI,OAApI,EAAe,CAAC,KAAK,SAAS,KAAK,EAAS,GAAG,CAAI,EAAQ,QAAQ,IAAI,gBAAgB,KAAK,EAAQ,CAAO,CAAC,KAAK,OAAO,GAAG,E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