{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/07ZexqdljjE6n274a1vk/lHHHfWlf5IAGkPmxX09c/Q8_Form.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function Q8_Form(props){const{apikey,ctabtn,origincta,destinationcta,css,language,scroll,id}=props;// We can't really do anything without a key\nif(!apikey){return /*#__PURE__*/_jsx(\"div\",{children:\"Please set a form key\"});}// We use the Framer node id for a stable id\nconst elementId=`q8form_${id}`;// We use a script loader in a useEffect\nReact.useEffect(()=>{const container=document.getElementById(elementId);const stylesheetUrls=[\"https://admin.quot8.com/assets/embed_theme_modern.css\",\"https://admin.quot8.com/assets/embed.css\"];// Loop through each stylesheet URL and create <link> elements\nstylesheetUrls.forEach(url=>{// Create a <link> element for the CSS file\nconst linkElement=document.createElement(\"link\");linkElement.rel=\"stylesheet\";linkElement.type=\"text/css\";linkElement.href=url;// Append the <link> element to the <head> tag\ndocument.head.appendChild(linkElement);});// Add the library script and set up the load handler\nconst script=document.createElement(\"script\");script.src=\"https://admin.quot8.com/assets/embed.js\";script.async=true;script.dataset.q8form=apikey;script.dataset.theme=\"modern\";script.dataset.color=\"#5934FF\";script.dataset.title=\"\";if(language){script.dataset.q8lang=language;}script.dataset.redirect=\"true\";if(scroll){script.dataset.scroll=\"true\";}script.onload=()=>{if(typeof window.q8SetReferer===\"function\"){if(document.cookie.length>0){var match=document.cookie.match(new RegExp(\"(^| )landing_url=([^;]+)\"));if(match){var landingUrl=match[2];window.q8SetReferer(landingUrl);}}}};// Change button text\nif(ctabtn){const observer1=new MutationObserver(mutations=>{if(Array.from(document.querySelectorAll(\".q8form__field.q8form__field--heading h3\")).find(el=>el.textContent===\"Select countries\")){Array.from(document.querySelectorAll(\".q8form__field.q8form__field--heading h3\")).find(el=>el.textContent===\"Select countries\").closest(\".q8form__field.q8form__field--heading\").remove();}var originSelect=document.getElementById(\"origin-country\");if(origincta&&originSelect){var originFirstOption=originSelect.options[0];if(originFirstOption&&originFirstOption.getAttribute(\"value\")===null&&originFirstOption.textContent!==origincta){var _document_querySelector;(_document_querySelector=document.querySelector(`label[for=\"origin-country\"]`))===null||_document_querySelector===void 0?void 0:_document_querySelector.remove();originFirstOption.textContent=origincta;}}var destinationSelect=document.getElementById(\"destination-country\");if(destinationcta&&destinationSelect){var destinationFirstOption=destinationSelect.options[0];if(destinationFirstOption&&destinationFirstOption.getAttribute(\"value\")===null&&destinationFirstOption.textContent!==destinationcta){var _document_querySelector1;(_document_querySelector1=document.querySelector(`label[for=\"destination-country\"]`))===null||_document_querySelector1===void 0?void 0:_document_querySelector1.remove();destinationFirstOption.textContent=destinationcta;}}if(document.querySelector(\".q8form__step--0 .q8form__button--next\")){document.querySelector(\".q8form__step--0 .q8form__button--next\").textContent=ctabtn;// document.querySelector(\n//     \".q8form__step--0 .q8form__button--next\"\n// ).style.background =\n//     \"linear-gradient(155deg, #fff 0%, #5934FF 35%, #5934FF 55%, #22201f 100%)\"\nobserver1.disconnect();}});observer1.observe(container,{attributes:false,characterData:false,childList:true,subtree:true,attributeOldValue:false,characterDataOldValue:false});}container.innerHTML=\"\";container.appendChild(script);if(css){const style=document.createElement(\"style\");style.type=\"text/css\";if(style.styleSheet){// This is required for IE8 and below.\nstyle.styleSheet.cssText=css;}else{style.appendChild(document.createTextNode(css));}container.appendChild(style);}return()=>{stylesheetUrls.forEach(url=>{const linkElement=document.querySelector(`link[href=\"${url}\"]`);if(linkElement){document.head.removeChild(linkElement);}});container.removeChild(script);script.remove();container.remove();if(ctabtn&&typeof observer!==\"undefined\"){observer.disconnect();}if(typeof window.q8loaded!==\"undefined\"){window.q8loaded=[];}};},[apikey,ctabtn,id]);return /*#__PURE__*/_jsx(\"div\",{initial:false,style:style,id:elementId});}const style={width:\"100%\",height:\"100%\",minHeight:\"50\",fontSize:\"16px\"};// Add a form id field in the properties panel\naddPropertyControls(Q8_Form,{apikey:{title:\"API key\",type:ControlType.String,placeholder:\"API key\"},ctabtn:{title:\"CTA Text\",type:ControlType.String},origincta:{title:\"Origin country selector text\",type:ControlType.String},destinationcta:{title:\"Destination country selector text\",type:ControlType.String},css:{title:\"Custom CSS style\",type:ControlType.String,displayTextArea:true},language:{title:\"Form language\",type:ControlType.String,displayTextArea:true,defaultValue:\"en\"},scroll:{title:\"Auto scroll to step\",type:ControlType.Boolean,defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Q8_Form\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Q8_Form.map"],
  "mappings": "yGAGkB,SAARA,EAAyBC,EAAM,CAAC,GAAK,CAAC,OAAAC,EAAO,OAAAC,EAAO,UAAAC,EAAU,eAAAC,EAAe,IAAAC,EAAI,SAAAC,EAAS,OAAAC,EAAO,GAAAC,CAAE,EAAER,EAC/G,GAAG,CAACC,EAAQ,OAAoBQ,EAAK,MAAM,CAAC,SAAS,uBAAuB,CAAC,EAC7E,IAAMC,EAAU,UAAUF,IAC1B,OAAMG,EAAU,IAAI,CAAC,IAAMC,EAAU,SAAS,eAAeF,CAAS,EAAQG,EAAe,CAAC,wDAAwD,0CAA0C,EAChMA,EAAe,QAAQC,GAAK,CAC5B,IAAMC,EAAY,SAAS,cAAc,MAAM,EAAEA,EAAY,IAAI,aAAaA,EAAY,KAAK,WAAWA,EAAY,KAAKD,EAC3H,SAAS,KAAK,YAAYC,CAAW,CAAE,CAAC,EACxC,IAAMC,EAAO,SAAS,cAAc,QAAQ,EAC5C,GAD8CA,EAAO,IAAI,0CAA0CA,EAAO,MAAM,GAAKA,EAAO,QAAQ,OAAOf,EAAOe,EAAO,QAAQ,MAAM,SAASA,EA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C,MAAM,mBAAmB,KAAKA,EAAY,OAAO,gBAAgB,EAAI,EAAE,SAAS,CAAC,MAAM,gBAAgB,KAAKA,EAAY,OAAO,gBAAgB,GAAK,aAAa,IAAI,EAAE,OAAO,CAAC,MAAM,sBAAsB,KAAKA,EAAY,QAAQ,aAAa,EAAK,CAAC,CAAC",
  "names": ["Q8_Form", "props", "apikey", "ctabtn", "origincta", "destinationcta", "css", "language", "scroll", "id", "p", "elementId", "ue", "container", "stylesheetUrls", "url", "linkElement", "script", "window", "match", "landingUrl", "observer1", "mutations", "el", "originSelect", "originFirstOption", "_document_querySelector", "destinationSelect", "destinationFirstOption", "_document_querySelector1", "style", "addPropertyControls", "ControlType"]
}
