// 1. Create the container var qc_container = document.createElement( 'div' ); qc_container.id = 'qc-container'; document.body.appendChild( qc_container ); var widget_script = ''; var origin_url = window.document.location.origin; // 2. Create a iframe to load the react App var qc_iframe = document.createElement( 'iframe' ); qc_iframe.id = 'qc-frame'; // position: fixed; remove a white space which was added at the bottom of the page qc_iframe.style.position = 'fixed'; // Cannot use display: none; otherwise the autogrow textarea will not work qc_iframe.style.visibility = 'hidden'; document.body.appendChild( qc_iframe ); qc_iframe.contentWindow.document.write( '' + widget_script + '' ); qc_iframe.contentWindow.document.close(); qc_iframe.contentWindow.context = { baseUrl: 'https://onelocal.com', environment: 'production', merchantId: '62e00915a3c2fa2494eebebd', merchantName: 'Unthink Inc.', originUrl: origin_url, sentry: 'https://ec0b927b3ee742b1ac32f546edbe3cad@app.getsentry.com/20033', widgetSettings: {"hipaa_enabled":false,"auto_response":{"enabled":true,"text":"Hey! Thanks for contacting Unthink Inc. Please text us a photo and description of your tattoo, so we can better assess next steps and we'll get back to you as soon as possible. Thank you.\nYou can also click here to book an appointment: https://unthinkinc.janeapp.com/ "},"confirmation":{"text":"We will follow up with you shortly by text.","title":"Thanks for your message"},"intro":{"enabled":true,"text":"Hi there! Send us a message if you have any questions."},"message_form":{"name_optional":false,"text":"Send us a message and we will get back to you shortly by text.","title":"Message Us","cta_text":"Send"},"mobile":{"call_cta_enabled":true,"title":"Contact Unthink Inc.","text":"How would you like to contact us?"},"default_assignee":{"id":"62e155ab0c176ee890008792","ref":"employees"},"style":{"primary_color":"#1f7337"},"chatbot":{"enabled":false,"auto_load":true,"name":"SparkAI","intro":{"enabled":false,"text":"Have a question? Ask our chatbot, SparkAI"}},"phone_number":{"national_format":"(833) 868-4465","value":"+18338684465"},"call_phone_number":{"national_format":"(416) 458-3739","value":"+14164583739"},"locations":[],"location_selection":{"title":"Location Selection","text":"Select the location which you would like to contact","skip_text":"Skip"}} }; window.addEventListener( "message", ( event ) => { if( event.origin.indexOf( origin_url ) === -1 || ! event.data?.event_name ) { return; } if( typeof gtag !== "undefined" ) { gtag( "event", event.data.event_name, { name: event.data.event_name } ); } }, false );