// 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: '64ecf90a656dfbc9fff3a015', merchantName: 'Hail Center', originUrl: origin_url, sentry: 'https://ec0b927b3ee742b1ac32f546edbe3cad@app.getsentry.com/20033', widgetSettings: {"hipaa_enabled":false,"auto_response":{"enabled":true,"text":"Hi there! Thank you for reaching out to Hail Center. We’ll respond to your message as soon as possible."},"intro":{"enabled":false,"text":"Hi there! Send us a message if you want to know more about our service."},"message_form":{"name_optional":false,"text":"Messages us and someone will be in contact with you within 24hrs. \n\nAverage response time: 5 minutes","title":"How can we help?","cta_text":"Send"},"mobile":{"call_cta_enabled":true,"text":"Call or Text us! \nWelcome to Hail Center! Whether you prefer to call or text, we're here to assist you with all of your auto restore and protect needs. Our team is ready to provide you with information, answer your questions, and schedule appointments.","title":"Don't want to wait?"},"style":{"primary_color":"#1471c7"},"call_phone_number":{"national_format":"(833) 691-4801","value":"+18336914801"},"chatbot":{"auto_load":true,"enabled":false,"name":"SparkAI","intro":{"enabled":false,"text":"Have a question? Ask our chatbot, SparkAI"}},"confirmation":{"text":"Someone will be with you shortly!","title":"Message Received!"},"phone_number":{"national_format":"(833) 691-4801","value":"+18336914801"},"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 );