// 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: '5c40c3be75d98a0083edd0f9', merchantName: 'The Unique Centre', originUrl: origin_url, sentry: 'https://ec0b927b3ee742b1ac32f546edbe3cad@app.getsentry.com/20033', widgetSettings: {"hipaa_enabled":false,"confirmation":{"text":"You will be able to submit your photos for the quote shortly!","title":"Thanks for your message"},"intro":{"enabled":false,"text":"Text us!"},"message_form":{"name_optional":false,"text":"Send us a message to let us know more about your vehicle. We will send a follow-up message and you can attach photos as well!","title":"Free Quote","cta_text":"Send"},"mobile":{"call_cta_enabled":true,"title":"Contact The Unique Centre","text":"How would you like to contact us?"},"style":{"primary_color":"#dc1932"},"auto_response":{"enabled":true,"text":"Thank you for reaching out to The Unique Centre – home to CARSTAR & LINE-X. We can’t wait to help you!\n\nOur team is a bit busy today. If you have not heard back from us at the time of receiving this message, please call us at the shop, 306-668-2100 we will assist you with your vehicle needs as quickly as we can! \n\nThanks again,\nThe Unique Centre Team"},"default_assignee":{"type":"unassigned"},"chatbot":{"auto_load":true,"enabled":false,"name":"SparkAI","intro":{"enabled":false,"text":"Have a question? Ask our chatbot, SparkAI"}},"phone_number":{"national_format":"(306) 985-9028","value":"+13069859028"},"call_phone_number":{"national_format":"(306) 668-2100","value":"+13066682100"},"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 );