{"version":3,"file":"OutsetaSignup.CMatpINx.mjs","names":[],"sources":["https:/framerusercontent.com/modules/pBNQGRywH5CyoVNGUNY9/QKgrH1h5YiBiojobyWDN/OutsetaSignup.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect}from\"react\";function getHashFromUrl(){if(typeof window===\"undefined\")return\"\";return new URLSearchParams(window.location.search).get(\"hash\")||\"\";}function getPrimaryUrlFromUrl(){if(typeof window===\"undefined\")return\"\";return new URLSearchParams(window.location.search).get(\"url\")||\"\";}export function OutsetaSignup(props){useEffect(()=>{const hash=getHashFromUrl();const primaryUrl=getPrimaryUrlFromUrl();const registrationDefaults={Subscription:{DiscountCouponSubscriptions:props.discount?[{DiscountCoupon:{UniqueIdentifier:props.discount}}]:[]}};// Set both if available, but allow signup to work with 1 or neither\nif(hash||primaryUrl){registrationDefaults.Account={...registrationDefaults.Account||{},...hash?{DqaAnalyzeHash:hash}:{},...primaryUrl?{DqaPrimaryUrl:primaryUrl}:{}};}const varName=`o_${props.elementId}`;const configScript=document.createElement(\"script\");configScript.type=\"text/javascript\";configScript.text=`\n            var ${varName} = {\n                id: \"Signup - ${props.elementId}\",\n                domain: \"dqa.outseta.com\",\n                load: \"auth\",\n                auth: {\n                    id: \"id_${props.elementId}\",\n                    mode: \"embed\",\n                    widgetMode: \"register\",\n                    skipPlanOptions: ${props.options===\"skip\"},\n                    selector: \"#${props.elementId}\",\n                    planPaymentTerm: \"month\",\n                    ${props.type===\"plan\"?`planUid: \"${props.planUid}\",`:props.type===\"family\"?`planFamilyUid: \"${props.planUid}\",`:\"\"}\n                    registrationDefaults: ${JSON.stringify(registrationDefaults)}\n                }\n            };\n        `;const invokeScript=document.createElement(\"script\");invokeScript.src=\"https://cdn.outseta.com/outseta.min.js\";invokeScript.setAttribute(\"data-options\",varName);document.body.appendChild(configScript);document.body.appendChild(invokeScript);return()=>{document.body.removeChild(configScript);document.body.removeChild(invokeScript);try{window[varName]=undefined;}catch{}};},[]);return /*#__PURE__*/_jsx(\"div\",{id:props.elementId});}OutsetaSignup.defaultProps={type:\"plan\",elementId:\"\",planUid:\"\",options:\"skip\",discount:\"\"};addPropertyControls(OutsetaSignup,{type:{type:ControlType.Enum,title:\"Type\",defaultValue:\"plan\",options:[\"plan\",\"family\"],optionTitles:[\"Plan\",\"Family\"]},elementId:{type:ControlType.String,title:\"Element Id\"},planUid:{type:ControlType.String,title:\"Plan Uid\"},options:{type:ControlType.Enum,title:\"Plan Options\",defaultValue:\"skip\",options:[\"show\",\"skip\"],optionTitles:[\"Show\",\"Skip\"]},discount:{type:ControlType.String,title:\"Discount\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"OutsetaSignup\":{\"type\":\"reactComponent\",\"name\":\"OutsetaSignup\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OutsetaSignup.map"],"mappings":"wLAA4H,SAAS,GAAgB,CAAyC,OAA9B,IAAS,OAAkB,GAAU,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAC,IAAI,OAAO,EAAE,GAAI,SAAS,GAAsB,CAAyC,OAA9B,IAAS,OAAkB,GAAU,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAC,IAAI,MAAM,EAAE,GAAI,SAAgB,EAAc,EAAM,CAiB9C,OAjB+C,MAAc,CAAC,IAAM,EAAK,GAAgB,CAAO,EAAW,GAAsB,CAAO,EAAqB,CAAC,aAAa,CAAC,4BAA4B,EAAM,SAAS,CAAC,CAAC,eAAe,CAAC,iBAAiB,EAAM,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAChpB,GAAM,KAAY,EAAqB,QAAQ,CAAC,GAAG,EAAqB,SAAS,EAAE,CAAC,GAAG,EAAK,CAAC,eAAe,EAAK,CAAC,EAAE,CAAC,GAAG,EAAW,CAAC,cAAc,EAAW,CAAC,EAAE,CAAC,EAAE,IA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