(()=>{"use strict";var e={8102:e=>{e.exports=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}},2264:(e,t,i)=>{const s=i(8102),n=new Map;function r(e,t){t={caseSensitive:!1,...t};const i=e+JSON.stringify(t);if(n.has(i))return n.get(i);const r="!"===e[0];r&&(e=e.slice(1)),e=s(e).replace(/\\\*/g,"[\\s\\S]*");const a=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return a.negated=r,n.set(i,a),a}e.exports=(e,t,i)=>{if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError(`Expected two arrays, got ${typeof e} ${typeof t}`);if(0===t.length)return e;const s="!"===t[0][0];t=t.map((e=>r(e,i)));const n=[];for(const i of e){let e=s;for(const s of t)s.test(i)&&(e=!s.negated);e&&n.push(i)}return n},e.exports.isMatch=(e,t,i)=>{const s=Array.isArray(e)?e:[e],n=Array.isArray(t)?t:[t];return s.some((e=>n.every((t=>{const s=r(t,i),n=s.test(e);return s.negated?!n:n}))))}},5385:function(e,t,i){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AggEvent=void 0;const n=i(3208),r=s(i(1537));class a{constructor(e,t){this.queue=[],this.timerHandle=0,this.currentLocation=null,this.flush=()=>{if(clearTimeout(this.timerHandle),0===this.queue.length)return;const e=function(e){const t=e=>{const t=e.event;return(0,n.isWidgetLifecycleEvent)(e)&&("widgetLoad"===t||"missedLoad"===t)},i=e;return e.filter(((e,s)=>!t(e)||s===i.findIndex((i=>t(i)&&i.type===e.type&&i.item_id===e.item_id))))}(this.queue),t={organization_id:this.organization_id,sid:r.default.getId()||"",events:e,url:this.currentLocation||""};this.queue=[],this.currentLocation=null,this.api.sendBeacon("/agg-event",t)},this.send=e=>{const t=window.location.href;this.currentLocation||(this.currentLocation=t),this.queue.push({...e,url:this.currentLocation!==t?t:void 0}),clearTimeout(this.timerHandle),this.queue.length>=a.maxQueueLength?this.flush():this.timerHandle=setTimeout(this.flush,a.sendDelay)},this.api=e,this.organization_id=t,window.addEventListener("visibilitychange",this.flush),window.addEventListener("pagehide",this.flush)}}t.AggEvent=a,a.maxQueueLength=10,a.sendDelay=1e3},9563:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e){this.apiDomain=e}request(e,t,i,s){const n=new XMLHttpRequest;"/"===t.charAt(0)&&(t=`${this.apiDomain}${t}`),n.open(e,t),"GET"===e||"HEAD"===e?n.send():(n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.send(JSON.stringify(i))),n.onload=function(){if(200!=n.status)s({status:n.status,message:n.statusText});else{const t="HEAD"!==e?JSON.parse(n.response):{};s(null,t)}},n.onerror=function(){s({status:n.status,message:n.statusText})}}get(e,t){return this.request("GET",e,void 0,t)}post(e,t,i){return this.request("POST",e,t,i)}head(e,t){return this.request("HEAD",e,{},t)}sendBeacon(e,t){const i=this.apiDomain+e;navigator.sendBeacon?navigator.sendBeacon(i,new Blob([JSON.stringify(t)])):this.post(i,t,(()=>{}))}}},7201:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkConversionPath=void 0;const s=i(2264);t.checkConversionPath=e=>(0,s.isMatch)(window.location.pathname,e)||(0,s.isMatch)(`${window.location.protocol}//${window.location.hostname}${window.location.pathname}`,e)},3734:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const s=i(7201),n=i(8980);class r{constructor(e){this.listener=()=>(0,n.tmary)("conversion",{id:e.id}),this.setupConversion(e)}setupConversion(e){const{querySelector:t,event:i,pathname:n}=e;if((!n||(0,s.checkConversionPath)(n))&&t){document.querySelectorAll(t).forEach((e=>{-1===r.handledElements.indexOf(e)&&(e.addEventListener(i,this.listener),r.handledElements.push(e))}))}}}t.default=r,r.handledElements=[]},4657:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDOMChangeHandler=t.addPageloadHandler=t.resetHandlers=void 0;let i=[],s=[],n=!1,r=null;t.resetHandlers=()=>{i=[],s=[],n=!1,r=null};t.addPageloadHandler=e=>{i.push(e),n||d()};t.addDOMChangeHandler=e=>{s.push(e),n||d()};const a=()=>{r!==window.location.href&&(r=window.location.href,i.forEach((e=>e())))},o=()=>{const e=document.querySelector("body");e&&new MutationObserver((e=>{e.some((e=>e.addedNodes.length>0))&&(a(),s.forEach((e=>e())))})).observe(e,{childList:!0,subtree:!0})},d=()=>{window.addEventListener("hashchange",a),window.addEventListener("popstate",a),window.history.pushState=new Proxy(window.history.pushState,{apply:(e,t,i)=>(setTimeout(a,1),e.apply(t,i))}),o(),n=!0}},6410:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHiddenFields=t.getLandingFields=void 0;const i=["utm_campaign","utm_content","utm_medium","utm_source","utm_term"];t.getLandingFields=e=>e.split("&").map((e=>e.split("="))).filter((e=>i.includes(e[0])&&2===e.length)).map((e=>e.map((e=>decodeURIComponent(e))))).reduce(((e,[t,i])=>({...e,[t]:i})),{});t.getHiddenFields=e=>({referrer:e.referrer||"",hostname:e.location.hostname,landingPage:e.location.pathname,...(0,t.getLandingFields)(e.location.search?.slice(1)||"")})},1537:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const s=i(6410),n=(e=6)=>{try{let t="";return window.crypto.getRandomValues(new Uint8Array(e)).forEach((e=>{t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-".charAt(e>>2)})),t}catch(e){return Math.random().toString()}},r=e=>({id:n(),updatedAt:(new Date).getTime(),hiddenFields:(0,s.getHiddenFields)(e),experiments:{},conversions:[],hasInteraction:[],hasWidgetLoad:[]});class a{constructor(e=document){this.getHiddenFields=()=>({...this.session.hiddenFields,location:window.location.pathname}),this.testAndSet=(e,t)=>!!this.session[e].includes(t)||(this.session[e].push(t),this.writeSession(),!1),this.getWidgetInteractionHistory=()=>{const e={hasWidgetLoad:"widgetLoad",hasInteraction:"interaction"},t=Object.keys(e).map((e=>this.session[e])).flat();return Object.fromEntries(t.map((t=>[t,Array.from(new Set(Object.entries(e).filter((([e])=>this.session[e].includes(t))).map((([,e])=>e))))])))};const t=this.loadSession(),i=r(e);(e=>!(e&&e.updatedAt&&e.id)||(new Date).getTime()-e.updatedAt>36e5)(t)?this.session=i:this.session={...i,...t,updatedAt:(new Date).getTime()},this.writeSession()}loadSession(){try{const e=localStorage.getItem("tmary");if(!e)return null;return JSON.parse(e)}catch(e){return null}}writeSession(){try{localStorage.setItem("tmary",JSON.stringify(this.session))}catch(e){}}clear(){this.session=r(document),this.writeSession()}getId(){return this.session.id}}t.Session=a,t.default=new a},8980:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tmary=void 0;var s=i(9686);Object.defineProperty(t,"tmary",{enumerable:!0,get:function(){return s.tmary}})},5214:function(e,t,i){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=s(i(9563)),r=i(7201),a=s(i(3734)),o=i(4657),d=s(i(1537)),h=i(8980),l=s(i(1970)),c=s(i(1734)),u=s(i(400));t.default=class{constructor(e,t){this.pageLoadConversions=[],this.pageLoadConversionsProcessed=!1,this.updateApp=e=>{e&&(e.frontendConversions&&(this.setupFrontendConversions(e.frontendConversions),(0,o.addDOMChangeHandler)((()=>this.setupFrontendConversions(e.frontendConversions)))),this.pageLoadConversions=e.pageLoadConversions||[],this.tag.setIsFirstInit(e.isFirstInit),this.tag.setIsHeadScriptInit(e.isFirstHeadScriptInit),e.popup&&(this.popup=new c.default(e.popup)),e.widget&&(this.widget=new u.default(this.tag,null,e.widget)),e.experiment&&(this.experiment=new l.default(this.tag,e.experiment)))},this.api=new n.default("https://embed.trustmary.io"),this.appId=e,this.tag=t,this.loadingPromise=new Promise(((e,t)=>{this.loadApp((t=>{this.updateApp(t),(0,o.addPageloadHandler)((()=>{this.widget&&this.widget.destroy(),this.experiment&&this.experiment.destroy(),this.loadApp((e=>this.updateApp(e))),(0,h.tmary)("pageview")})),e()}),t)}))}loadApp(e,t){const i=Object.keys(d.default.session.experiments).map((e=>`${e}-variantId=${d.default.session.experiments[e].variantId}`)),s=window;s.hasTrustmaryPopupFromTag&&i.push(`hasPopupFromTag=${s.hasTrustmaryPopupFromTag.toString()}`);const n=i.join("&");this.api.get(`/app/${this.appId}?${(()=>{const e={locale:navigator.language,timezoneOffset:(new Date).getTimezoneOffset(),href:window.location.href};return Object.keys(e).map((t=>`${t}=${encodeURIComponent(e[t])}`)).join("&")})()}${n.length?`&${n}`:""}`,((i,s)=>{i?(console.log(i),t&&t(i)):e(s)}))}setupFrontendConversions(e){e.forEach((e=>{new a.default(e)}))}setupPageLoadConversions(){this.pageLoadConversionsProcessed||(this.pageLoadConversionsProcessed=!0,this.pageLoadConversions.forEach((e=>{this.processPageLoadConversion(e),(0,o.addPageloadHandler)((()=>this.processPageLoadConversion(e)))})))}processPageLoadConversion({id:e,pathname:t}){(0,r.checkConversionPath)(t)&&(0,h.tmary)("conversion",{id:e})}}},1970:function(e,t,i){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i(126),r=s(i(400));t.default=class{constructor(e,t){this.destroy=()=>{this.widget?.destroy()},this.experimentData=t,this.tag=e,this.loadExperiment()}loadExperiment(){if(this.experimentData){const e=n.ExperimentManager.getExperimentManagerInstance(this.tag);e.addExperiment(this.experimentData.id,(t=>{if(!t||!this.experimentData)return;e.getWidgetId(this.experimentData.id)&&(this.widget=new r.default(this.tag,null,t))}),this.experimentData)}}}},7047:function(e,t,i){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=s(i(9384));class r extends n.default{processElement(e){return!(!e||!e.dataset.trustmaryForm)&&(this.surveyId=e.dataset.trustmaryForm,!0)}render(){this.frame=this.doc.createElement("iframe"),this.frame.onload=()=>this.handleFrameLoad(),this.frame.id=`trustmary-form-${this.id}`,this.frame.style.cssText="display: block;width: 1px; min-width: 100%;height: 0;border:none;",this.frame.scrolling="no",this.frame.allow="camera;microphone;",this.frame.src=`https://trustmary.com/form/${this.surveyId}${this.query}`,this.frame.allowtransparency=!0,this.el.appendChild(this.frame),this.addMessageListener()}}t.default=r},1130:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const s=i(9871);t.default=class{constructor(e,t,i){this.postMessage=(e,t={})=>{this.frame.contentWindow?.postMessage({frameId:this.id,type:e,attr:t},"*")},null!=t&&(this.id=`embed-${e}`,this.el=this.parseEl(t),this.embedId=t.dataset.trustmaryEmbed,this.doc=t.ownerDocument,this.frameLoaded=!1,this.attributes=(0,s.parseElementAttributes)(t),this.handleFrameMessage=this.handleFrameMessage.bind(this),this.siteStyles="string"==typeof i?i.trim():"",this.renderFrame())}parseEl(e){if("A"===e.tagName){const t=e.ownerDocument.createElement("div");t.classList.add("trustmary-embed-root");const i=e;return i.parentNode?.insertBefore(t,i),i.target="_blank",i.style.cssText="\n display: block;\n text-decoration: none;\n text-indent: -5000em;\n background: url('https://d2nce6johdc51d.cloudfront.net/img/tm-badge.svg') no-repeat center center rgba(0,0,0,0.3);\n border-radius: 2px;\n border: none;\n width: 88px;\n height: 25px;\n margin: 20px auto;\n padding: 0;\n position: static;\n ",t}return e.classList.add("trustmary-embed-root"),e}renderFrame(){this.frame=this.doc.createElement("iframe"),this.frame.onload=()=>this.handleFrameLoad(),this.frame.id=`trustmary-embed-frame-${this.id}`,this.frame.style.cssText="display: block;width: 1px; min-width: 100%;height: 0;border:none;max-height: none;background: transparent;",this.frame.src="proxy.php?url=about:blank",this.frame.scrolling="no",this.el.appendChild(this.frame),this.frame.contentWindow?.document.open(),this.frame.contentWindow?.document.write(this.getFrameContents()),this.frame.contentWindow?.document.close()}getFrameContents(){return`\n\n\n \n