@saasquatch/squatch-js 2.8.3-6 → 2.8.3-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/squatch.cjs.js +5 -5
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +44 -37
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +6 -6
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +2 -2
- package/package.json +1 -1
package/dist/squatch.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ae=Object.defineProperty;var Ie=(o,t,e)=>t in o?Ae(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var l=(o,t,e)=>Ie(o,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let C=null;function _e(o){const e=o.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");C=new RegExp(`^${e}$`)}function We(){C=null}function k(o){const t=(...e)=>{C&&C.test(o)&&console.log(`[${o}]`,...e)};return Object.defineProperty(t,"enabled",{get(){return!!(C&&C.test(o))}}),t}/*! js-cookie v3.0.5 | MIT */function
|
|
1
|
+
"use strict";var Ae=Object.defineProperty;var Ie=(o,t,e)=>t in o?Ae(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var l=(o,t,e)=>Ie(o,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let C=null;function _e(o){const e=o.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*");C=new RegExp(`^${e}$`)}function We(){C=null}function k(o){const t=(...e)=>{C&&C.test(o)&&console.log(`[${o}]`,...e)};return Object.defineProperty(t,"enabled",{get(){return!!(C&&C.test(o))}}),t}/*! js-cookie v3.0.5 | MIT */function M(o){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)o[n]=e[n]}return o}var $e={read:function(o){return o[0]==='"'&&(o=o.slice(1,-1)),o.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(o){return encodeURIComponent(o).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Q(o,t){function e(i,s,r){if(!(typeof document>"u")){r=M({},t,r),typeof r.expires=="number"&&(r.expires=new Date(Date.now()+r.expires*864e5)),r.expires&&(r.expires=r.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var d in r)r[d]&&(a+="; "+d,r[d]!==!0&&(a+="="+r[d].split(";")[0]));return document.cookie=i+"="+o.write(s,i)+a}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],r={},a=0;a<s.length;a++){var d=s[a].split("="),c=d.slice(1).join("=");try{var h=decodeURIComponent(d[0]);if(r[h]=o.read(c,h),i===h)break}catch{}}return i?r[i]:r}}return Object.create({set:e,get:n,remove:function(i,s){e(i,"",M({},s,{expires:-1}))},withAttributes:function(i){return Q(this.converter,M({},this.attributes,i))},withConverter:function(i){return Q(M({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(o)}})}var j=Q($e,{path:"/"});const A="https://app.referralsaasquatch.com",Y="https://fast.ssqt.io/npm",L="squatch",X="impact";function q(o){if(typeof o!="object")throw new Error("config must be an object");const t=window.squatchTenant,e=ee(),n={tenantAlias:(o==null?void 0:o.tenantAlias)||t,domain:(o==null?void 0:o.domain)||(e==null?void 0:e.domain),npmCdn:(o==null?void 0:o.npmCdn)||(e==null?void 0:e.npmCdn),debug:(o==null?void 0:o.debug)||(e==null?void 0:e.debug)};if(typeof n.tenantAlias!="string")throw new Error("tenantAlias not provided");const i=n.tenantAlias,s=typeof n.domain=="string"&&n.domain||A,r=typeof n.debug=="boolean"&&n.debug||!1,a=typeof n.npmCdn=="string"&&n.npmCdn||Y;return{tenantAlias:i,domain:s,debug:r,npmCdn:a}}function I(o){return typeof o=="object"&&!Array.isArray(o)&&o!==null}function Te(o){if(o&&/^[a-z]{2}_(?:[A-Z]{2}|[0-9]{3})$/.test(o))return o}function ue(o){if(!I(o))throw new Error("Widget properties must be an object");if(!(o!=null&&o.user))throw new Error("Required properties missing.");return o}function pe(o){if(!I(o))throw new Error("Widget properties must be an object");return o}function R(){return window.impactToken||window.squatchToken}function ee(){return window.impactConfig||window.squatchConfig}function J(o){console.log("[DEBUG] parseErrorResponse - raw responseText:",o);try{const t=JSON.parse(o);if(console.log("[DEBUG] parseErrorResponse - parsed JSON:",t),t&&typeof t=="object")return console.log("[DEBUG] parseErrorResponse - returning parsed object with apiErrorCode:",t.apiErrorCode),t}catch(t){console.log("[DEBUG] parseErrorResponse - JSON parse failed:",t)}return{message:o}}async function Ue(o,t,e,n){const i=n||R(),s={Accept:"application/json","Content-Type":"application/json",...i?{Authorization:`Bearer ${i}`}:{},"X-SaaSquatch-Referrer":window?window.location.href:""};try{const r=await fetch(o,{method:"POST",body:JSON.stringify({query:t,variables:e}),headers:s});if(!r.ok)throw J(await r.text());return await r.json()}catch(r){throw r}}async function Se(o,t=""){const e={Accept:"application/json","Content-Type":"application/json"},n=t||R();n?(e["X-SaaSquatch-User-Token"]=n,console.log("[DEBUG] doGet - Adding token to headers:",n)):console.log("[DEBUG] doGet - No token found, proceeding without authentication header.");try{const i=await fetch(o,{method:"GET",credentials:"include",headers:e}),s=await i.text();if(!i.ok)throw J(s);return s&&JSON.parse(s)}catch(i){throw i}}async function K(o,t,e){const n={Accept:"application/json","Content-Type":"application/json"},i=e||R();i?(console.log("[DEBUG] doPost - Adding token to headers:",i),n["X-SaaSquatch-User-Token"]=i):console.log("[DEBUG] doPost - No token found, proceeding without authentication header.");try{const s=await fetch(o,{method:"POST",body:t,headers:n}),r=await s.text();if(!s.ok)throw J(r);return r&&JSON.parse(r)}catch(s){throw s}}async function qe(o,t,e){const n={Accept:"application/json","Content-Type":"application/json","X-SaaSquatch-Referrer":window?window.location.href:""},i=e||R();i&&(n["X-SaaSquatch-User-Token"]=i);try{const s=await fetch(o,{headers:n,method:"PUT",credentials:"include",body:t}),r=await s.text();if(!s.ok)throw J(r);return r&&JSON.parse(r)}catch(s){throw s}}const Re=`
|
|
2
2
|
query renderWidget ($user: UserIdInput, $engagementMedium: UserEngagementMedium, $widgetType: WidgetType, $locale: RSLocale) {
|
|
3
3
|
renderWidget(user: $user, engagementMedium: $engagementMedium, widgetType: $widgetType, locale: $locale) {
|
|
4
4
|
template
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
`;class z{constructor(t){l(this,"tenantAlias");l(this,"domain");l(this,"npmCdn");l(this,"referralCookie",this.squatchReferralCookie);const n=q(t);this.tenantAlias=n.tenantAlias,this.domain=n.domain,this.npmCdn=n.npmCdn}upsertUser(t){const n=ue(t),{widgetType:i,engagementMedium:s="POPUP",jwt:r,locale:a,user:d}=n,c=encodeURIComponent(this.tenantAlias),h=d.accountId?encodeURIComponent(d.accountId):null,u=d.id?encodeURIComponent(d.id):null,p=
|
|
15
|
+
`;class z{constructor(t){l(this,"tenantAlias");l(this,"domain");l(this,"npmCdn");l(this,"referralCookie",this.squatchReferralCookie);const n=q(t);this.tenantAlias=n.tenantAlias,this.domain=n.domain,this.npmCdn=n.npmCdn}upsertUser(t){const n=ue(t),{widgetType:i,engagementMedium:s="POPUP",jwt:r,locale:a,user:d}=n,c=encodeURIComponent(this.tenantAlias),h=d.accountId?encodeURIComponent(d.accountId):null,u=d.id?encodeURIComponent(d.id):null,p=Pe({widgetType:i,engagementMedium:s,locale:a}),m=`/api/v1/${c}/widget/account/${h}/user/${u}/upsert${p}`,g=this.domain+m,w=(j||window.Cookies).get("_saasquatch");return w&&(d.cookies=w),qe(g,JSON.stringify(d),r)}render(t){const n=pe(t),{widgetType:i,engagementMedium:s="POPUP",jwt:r,user:a}=n,d=encodeURIComponent(this.tenantAlias),c=a!=null&&a.accountId?encodeURIComponent(a.accountId):null,h=a!=null&&a.id?encodeURIComponent(a.id):null,u=n.locale??Te(navigator.language.replace(/\-/g,"_")),p=`/api/v1/${d}/graphql`,m=this.domain+p;return new Promise(async(g,w)=>{var b;try{const f=await Ue(m,Re,{user:h&&c?{id:h,accountId:c}:null,engagementMedium:s,widgetType:i,locale:u},r);g((b=f==null?void 0:f.data)==null?void 0:b.renderWidget)}catch(f){w(f)}})}async squatchReferralCookie(){const t=encodeURIComponent(this.tenantAlias),e=(j||window.Cookies).get("_saasquatch")||"",n=e?`?cookies=${encodeURIComponent(e)}`:"",i=`${this.domain}/a/${t}/widgets/squatchcookiejson${n}`,s=await Se(i);return Promise.resolve({...s,encodedCookie:e})}}function Pe({widgetType:o,engagementMedium:t,locale:e}){const n=new URLSearchParams;return n.append("engagementMedium",t),o&&n.append("widgetType",o),e&&n.append("locale",e),`?${n.toString()}`}/*!
|
|
16
16
|
* domready (c) Dustin Diaz 2014 - License MIT
|
|
17
17
|
*
|
|
18
|
-
*/function Z(o,t){let e=[],n,i=o,s=i.documentElement.doScroll,r="DOMContentLoaded",a=(s?/^loaded|^c/:/^loaded|^i|^c/).test(i.readyState);return a||i.addEventListener(r,n=()=>{for(i.removeEventListener(r,n),a=!0;n=e.shift();)n()}),a?setTimeout(t,0):e.push(t)}function N({value:o,unit:t}){switch(t){case"px":return`${o}px`;case"%":return`${o}%`;default:return`${o}px`}}class ge{constructor(t){l(this,"domain");var i;const n=
|
|
18
|
+
*/function Z(o,t){let e=[],n,i=o,s=i.documentElement.doScroll,r="DOMContentLoaded",a=(s?/^loaded|^c/:/^loaded|^i|^c/).test(i.readyState);return a||i.addEventListener(r,n=()=>{for(i.removeEventListener(r,n),a=!0;n=e.shift();)n()}),a?setTimeout(t,0):e.push(t)}function N({value:o,unit:t}){switch(t){case"px":return`${o}px`;case"%":return`${o}%`;default:return`${o}px`}}class ge{constructor(t){l(this,"domain");var i;const n=Me(t);this.domain=(n==null?void 0:n.domain)||((i=ee())==null?void 0:i.domain)||A}pushAnalyticsLoadEvent(t){if(!t.externalUserId||!t.externalAccountId)return;const e=encodeURIComponent(t.tenantAlias),n=encodeURIComponent(t.externalAccountId),i=encodeURIComponent(t.externalUserId),s=encodeURIComponent(t.engagementMedium),r=t.programId?`&programId=${encodeURIComponent(t.programId)}`:"",a=`/a/${e}/widgets/analytics/loaded?externalAccountId=${n}&externalUserId=${i}&engagementMedium=${s}${r}`,d=this.domain+a;return K(d,JSON.stringify({}))}pushAnalyticsShareClickedEvent(t){const e=encodeURIComponent(t.tenantAlias),n=encodeURIComponent(t.externalAccountId),i=encodeURIComponent(t.externalUserId),s=encodeURIComponent(t.engagementMedium),r=encodeURIComponent(t.shareMedium),a=`/a/${e}/widgets/analytics/shared?externalAccountId=${n}&externalUserId=${i}&engagementMedium=${s}&shareMedium=${r}`,d=this.domain+a;return K(d,JSON.stringify({}))}}function Me(o){if(!I(o))throw new Error("'options' should be an object");return o}const me=({type:o="verified-access",height:t="500px"})=>{const e="#e0e0e0";return`
|
|
19
19
|
<style>
|
|
20
20
|
* {
|
|
21
21
|
box-sizing: border-box;
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
<p class="errortitle">Error</p>
|
|
307
307
|
</div>
|
|
308
308
|
<div class="errorbody">
|
|
309
|
-
<div class="sadface"><img src="https://
|
|
309
|
+
<div class="sadface"><img src="https://res.cloudinary.com/saasquatch-staging/image/upload/v1774538373/whoops-error-image_km94z1.svg"></div>
|
|
310
310
|
<h4>Our referral program is temporarily unavailable.</h4>
|
|
311
311
|
<p>Please reload the page or check back later.</p>
|
|
312
312
|
<p>If the problem persists please contact our support team.</p>
|
|
@@ -357,5 +357,5 @@
|
|
|
357
357
|
${this._getSkeletonPreloadHTML(i,(_=e==null?void 0:e.color)==null?void 0:_.backgroundColor)}
|
|
358
358
|
${this.content}
|
|
359
359
|
<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
|
|
360
|
-
`),h.close(),W("Popup template loaded into iframe"),await this._setupResizeHandler(s)}async _setupResizeHandler(e){const{contentWindow:n}=e;if(!n)throw new Error("Frame needs a content window");const i=n.document;Z(i,async()=>{i.body.style.overflowY="hidden";let s=!0;new n.ResizeObserver(a=>{for(const d of a){const{top:c,bottom:h}=d.contentRect,u=h+c;u<=0||(s?(s=!1,e.style.height="0",e.height=i.body.scrollHeight+"",e.style.height=""):e.height=u+"",d.target.style="")}}).observe(await this._findInnerContainer(e))})}open(){const e=this.container?this._findElement():document.body,i=(e.shadowRoot||e).querySelector(`#${this.id}`);if(!i)throw new Error("Could not determine container div");i.showModal();const s=this._findFrame();if(!s)throw new Error("Could not find iframe");const{contentWindow:r}=s;if(!r)throw new Error("Squatch.js has an empty iframe");const a=r.document;Z(a,()=>{var c;const d=r.squatch||r.widgetIdent;(c=s.contentDocument)==null||c.dispatchEvent(new CustomEvent("sq:refresh")),this.context.user?(this._loadEvent(d),W("Popup opened")):this._attachLoadEventListener(a,d)})}close(){const e=this._findFrame();e!=null&&e.contentDocument&&this._detachLoadEventListener(e.contentDocument);const n=this.container?this._findElement():document.body,s=(n.shadowRoot||n).querySelector(`#${this.id}`);if(!s)throw new Error("Could not determine container div");s.close(),W("Popup closed")}_clickedOutside({target:e}){}_error(e,n="modal",i=""){return super._error(e,n,i||"body { margin: 0; } .modal { box-shadow: none; border: 0; }")}}const v=k("squatch-js:widgets");class S{constructor(t){l(this,"api");l(this,"tenantAlias");l(this,"domain");l(this,"npmCdn");const e=q(t);this.tenantAlias=e.tenantAlias,this.domain=e.domain,this.npmCdn=e.npmCdn,this.api=new z(e)}async upsertUser(t){const n=ue(t);try{const i=await this.api.upsertUser(n);return{widget:this._renderWidget(i,n,{type:"upsert",user:n.user,engagementMedium:t.engagementMedium,container:t.container,trigger:t.trigger,widgetConfig:{values:{brandingConfig:i==null?void 0:i.brandingConfig}}}),user:i.user}}catch(i){throw console.log("[DEBUG] Widgets.upsertUser catch - err:",i),console.log("[DEBUG] Widgets.upsertUser catch - typeof err:",typeof i),console.log("[DEBUG] Widgets.upsertUser catch - err.apiErrorCode:",i.apiErrorCode),console.log("[DEBUG] Widgets.upsertUser catch - err keys:",Object.keys(i||{})),v(i),i.apiErrorCode&&(console.log("[DEBUG] Widgets.upsertUser - calling _renderErrorWidget"),this._renderErrorWidget(i,t.engagementMedium)),new Error(i)}}async render(t){const n=pe(t);try{const i=await this.api.render(n);return{widget:this._renderWidget(i,n,{type:"passwordless",engagementMedium:n.engagementMedium,container:n.container,trigger:n.trigger,widgetConfig:i==null?void 0:i.widgetConfig}),user:i.user}}catch(i){throw i.apiErrorCode&&this._renderErrorWidget(i,n.engagementMedium),new Error(i)}}async autofill(t){const e=t;if(typeof e=="function"){try{const s=await this.api.squatchReferralCookie();e(s)}catch(s){throw v("Autofill error",s),new Error(s)}return}if(typeof e!="string")throw new Error("Autofill accepts a string or function");let n=document.querySelectorAll(e),i;if(n.length>0)i=n[0];else throw v("Element id/class or function missing"),new Error("Element id/class or function missing");try{const s=await this.api.squatchReferralCookie();i.value=s.codes[0]}catch(s){throw new Error(s)}}_renderWidget(t,e,n){var d;if(v("Rendering Widget..."),!t)throw new Error("Unable to get a response");let i,s=!!e.displayOnLoad;const r=t.jsOptions||{},a={content:t.template,type:e.widgetType||((d=r.widget)==null?void 0:d.defaultWidgetType),api:this.api,domain:this.domain,npmCdn:this.npmCdn,context:n};return r.widgetUrlMappings&&r.widgetUrlMappings.forEach(c=>{var h,u;S._matchesUrl(c.url)&&(c.widgetType!=="CONVERSION_WIDGET"||(u=(h=t.user)==null?void 0:h.referredBy)!=null&&u.code?(s=c.displayOnLoad,v(`Display ${c.widgetType} on ${c.url}`)):v(`Don't display ${c.widgetType} when no referral on widget rule match ${c.url}`))}),r.fuelTankAutofillUrls&&(v("We found a fuel tank autofill!"),r.fuelTankAutofillUrls.forEach(({url:c,formSelector:h})=>{var u,p,m;if(S._matchesUrl(c)&&(v("Fuel Tank URL matches"),(p=(u=t.user)==null?void 0:u.referredBy)!=null&&p.code)){const g=document.querySelector(h);g?g.value=((m=t.user.referredBy.referredReward)==null?void 0:m.fuelTankCode)||"":v(new Error(`Element with id/class ${h} was not found.`))}})),e.engagementMedium==="EMBED"?i=this._renderEmbedWidget(a):(i=this._renderPopupWidget(a),s&&i.open()),i}_renderPopupWidget(t){const e=new U(t,t.context.trigger);return e.load(),e}_renderEmbedWidget(t){const e=new T(t,t.context.container);return e.load(),e}_renderErrorWidget(t,e="POPUP"){const{apiErrorCode:n,rsCode:i,statusCode:s,message:r}=t;v(new Error(`${n} (${i}) ${r}`));const a={content:"error",rsCode:i,apiErrorCode:n,statusCode:s,errorMessage:r,api:this.api,domain:this.domain,npmCdn:this.npmCdn,type:"ERROR_WIDGET",context:{type:"error"}};let d;e==="EMBED"?(d=new T(a),d.load()):e==="POPUP"&&(d=new U(a),d.load())}static _matchesUrl(t){return!!window.location.href.match(new RegExp(t))}}class je{constructor(t){l(this,"tenantAlias");l(this,"domain");const n=q(t);this.tenantAlias=n.tenantAlias,this.domain=n.domain}track(t,e){const n=t,i=e,s=Ne(n),{jwt:r}=Fe(i),a=encodeURIComponent(this.tenantAlias),d=encodeURIComponent(s.userId),c=encodeURIComponent(s.accountId),h=`/api/v1/${a}/open/account/${c}/user/${d}/events`,u=this.domain+h;return K(u,JSON.stringify(s),r)}}function Ne(o){if(!I(o))throw new Error("tracking parameter must be an object");if(!(o!=null&&o.accountId))throw new Error("accountId field is required");if(!(o!=null&&o.events))throw new Error("events field is required");if(!(o!=null&&o.userId))throw new Error("userId field is required");const t=o;if(!Array.isArray(t.events))throw new Error("'events' should be an array");return t}function Fe(o){if(!I(o))throw new Error("'options' should be an object");return o}function He(){var i;const o=window[X]?X:L,t=((i=window["_"+o])==null?void 0:i.ready)||[],e=window.impactOnReady||window.squatchOnReady,n=[...t,e].filter(s=>!!s);setTimeout(()=>{window[L]&&(window[X]=window[L],n.forEach(s=>s()),window[L]._auto(),window["_"+o]=void 0,delete window["_"+o])},0)}const E=k("squatch-js"),de=o=>typeof o=="object"&&!Array.isArray(o),we=(o,t)=>{const e=i=>de(t[i])&&o.hasOwnProperty(i)&&de(o[i]),n=Object.getOwnPropertyNames(t).map(i=>({[i]:e(i)?we(o[i],t[i]):t[i]})).reduce((i,s)=>({...i,...s}),{});return{...o,...n}};function F(o){const t=atob(o.replace(/_/g,"/").replace(/-/g,"+")),e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return new TextDecoder("utf8").decode(e)}function ce(o){const t=new TextEncoder().encode(o),e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Be(){var o,t,e="weird_get_top_level_domain=cookie",n=document.location.hostname.split(".");for(o=n.length-1;o>=0;o--)if(t=n.slice(o).join("."),document.cookie=e+";domain=."+t+";",document.cookie.indexOf(e)>-1)return document.cookie=e.split("=")[0]+"=;domain=."+t+";expires=Thu, 01 Jan 1970 00:00:01 GMT;",t}function Je(){const o=window.location.search,e=new URLSearchParams(o).get("_saasquatch")||"";if(e){let n="",i="",s="";try{n=JSON.parse(F(e))}catch(r){E("Unable to decode params",r);return}try{i=JSON.parse(F(j.get("_saasquatch"))),E("existing cookie",i)}catch(r){E("Unable to retrieve cookie",r)}try{const r=Be();if(E("domain retrieved:",r),i){const a=we(i,n);s=ce(JSON.stringify(a)),E("cookie to store:",a)}else s=ce(JSON.stringify(n)),E("cookie to store:",n);j.set("_saasquatch",s,{expires:365,secure:!1,sameSite:"Lax",domain:r,path:"/"})}catch(r){E("Unable to set cookie",r)}}}const D=k("squatch-js");function Ge(){var u;const o=window.location.search,e=new URLSearchParams(o).get("_saasquatchExtra")||"";if(!e){D("No _saasquatchExtra param");return}const n=q({tenantAlias:"UNKNOWN"});if(!n.domain){D("domain must be provided in config to use _saasquatchExtra");return}let i;try{i=JSON.parse(F(e))}catch{D("Unable to decode _saasquatchExtra config");return}function s(p){return p.replace(/^https?:\/\//,"")}const r=s(n.domain),a=Object.keys((i==null?void 0:i[r])||{})[0],d=(u=i==null?void 0:i[r])==null?void 0:u[a];if(!d){D("_saasquatchExtra did not have an expected structure");return}const{autoPopupWidgetType:c,...h}=d;return{widgetConfig:{widgetType:c,displayOnLoad:!0,...h},squatchConfig:{...n,tenantAlias:a}}}const ze=k("squatch-js:decodeUserJwt");function Ve(o){var t;try{const e=o.split(".")[1];if(e===void 0)return null;const n=F(e);return(t=JSON.parse(n))==null?void 0:t.user}catch(e){return ze(e),null}}const le=k("squatch-js:DeclarativeWidget");class ye extends HTMLElement{constructor(){super();l(this,"config");l(this,"token");l(this,"tenant");l(this,"widgetType");l(this,"locale");l(this,"widgetApi");l(this,"analyticsApi");l(this,"widgetInstance");l(this,"type");l(this,"container");l(this,"element");l(this,"loaded");l(this,"_setWidget",(e,n)=>{var s;const i={api:this.widgetApi,content:e.template,context:{type:n.type,user:n.user,container:this.container||void 0,engagementMedium:this.type,widgetConfig:e.widgetConfig},type:this.widgetType,domain:((s=this.config)==null?void 0:s.domain)||A,npmCdn:Y,container:this};if(this.type==="EMBED")return new T(i);{const r=this.firstChild?null:void 0;return new U(i,r)}});l(this,"setErrorWidget",e=>{var d;const n=e instanceof Error?e.message:e==null?void 0:e.message,i=e instanceof Error||e==null?void 0:e.apiErrorCode,s=e instanceof Error||e==null?void 0:e.rsCode,r=e instanceof Error||e==null?void 0:e.statusCode,a={api:this.widgetApi,content:"error",context:{type:"error",container:this.container||void 0},type:"ERROR_WIDGET",domain:((d=this.config)==null?void 0:d.domain)||A,npmCdn:Y,container:this,apiErrorCode:i,rsCode:s,statusCode:r,errorMessage:n};if(this.type==="EMBED")return new T(a);{const c=this.firstChild?null:void 0;return new U(a,c)}});l(this,"reload",this.renderWidget);l(this,"show",this.open);l(this,"hide",this.close);this.attachShadow({mode:"open"}).innerHTML="<style>:host { display: block; }</style><slot></slot>",this.config=ee(),this.token=R(),this.tenant=window.squatchTenant,this.container=this}_setupApis(e){var n,i;if(!this.tenant)throw new Error("tenantAlias not provided");this.widgetApi=new z({tenantAlias:(e==null?void 0:e.tenantAlias)||this.tenant,domain:(e==null?void 0:e.domain)||((n=this.config)==null?void 0:n.domain)||A}),this.analyticsApi=new ge({domain:(e==null?void 0:e.domain)||((i=this.config)==null?void 0:i.domain)||A})}getWidgetType(e){return e&&(e.includes("websiteReferralWidget")||e.includes("friendWidget"))?"instant-access":"verified-access"}async renderPasswordlessVariant(){return this._setupApis(),le("Rendering as an Instant Access widget"),await this.widgetApi.render({engagementMedium:this.type,widgetType:this.widgetType,locale:this.locale}).then(e=>this._setWidget(e,{type:"passwordless"})).catch(this.setErrorWidget)}async renderUserUpsertVariant(){this._setupApis();const e=Ve(this.token);if(!e)return this.setErrorWidget(Error("No user object in token."));le("Rendering as a Verified widget");try{await this.widgetApi.upsertUser({user:e,locale:this.locale,engagementMedium:this.type,widgetType:this.widgetType,jwt:this.token})}catch(i){return this.setErrorWidget(i)}return await this.widgetApi.render({locale:this.locale,engagementMedium:this.type,widgetType:this.widgetType}).then(i=>this._setWidget(i,{type:"upsert",user:e})).catch(this.setErrorWidget)}async getWidgetInstance(){let e;if(this.widgetType=this.getAttribute("widget")||void 0,this.locale=this.getAttribute("locale")||this.locale,!this.widgetType)throw new Error("No widget has been specified");return this.token?e=await this.renderUserUpsertVariant():e=await this.renderPasswordlessVariant(),this.widgetInstance=e,this.widgetInstance&&this.dispatchEvent(new CustomEvent("sq:widget-loaded")),e}async renderWidget(){await this.getWidgetInstance(),await this.widgetInstance.load()}open(){if(!this.widgetInstance)throw new Error("Widget has not loaded yet");this.widgetInstance.open()}close(){if(!this.widgetInstance)throw new Error("Widget has not loaded yet");this.widgetInstance.close()}static get observedAttributes(){return["widget","locale"]}attributeChangedCallback(e,n,i){if(!(n===i||!this.loaded))switch(e){case"locale":case"widget":this.connectedCallback();break}}async connectedCallback(){this.loaded=!0,this.container=this.getAttribute("container"),this.widgetType=this.getAttribute("widget")||void 0;const e=this.getWidgetType(this.widgetType),{getSkeleton:n}=await Promise.resolve().then(()=>Le),i=n({height:"100%",type:e}),s=document.createElement("div");s.id="loading-skeleton",s.innerHTML=i;const r=this.shadowRoot||this.attachShadow({mode:"open"});if(this.type==="POPUP"){const d=r.getElementById("#squatchModal");d&&(d.innerHTML="",d.appendChild(s))}else r.innerHTML="",r.appendChild(s);await this.renderWidget();const a=r.getElementById("loading-skeleton");a&&a.remove(),this.getAttribute("open")!==null&&this.open()}}class te extends ye{constructor(){super(),this.type="EMBED",this.loaded=!1}}class ne extends ye{constructor(){super(),this.type="POPUP",this.loaded=!1,this.addEventListener("click",t=>{t.stopPropagation(),this.open()})}}class Xe extends te{}class Qe extends ne{}class Ye extends te{}class Ke extends ne{}window.customElements.get("squatch-embed")||window.customElements.define("squatch-embed",Xe);window.customElements.get("impact-embed")||window.customElements.define("impact-embed",Ye);window.customElements.get("squatch-popup")||window.customElements.define("squatch-popup",Qe);window.customElements.get("impact-popup")||window.customElements.define("impact-popup",Ke);function Ze(){console.log("Having trouble using Squatch.js? Go to https://docs.referralsaasquatch.com/developer/ for tutorials, references and error codes.")}const $=k("squatch-js");let H=null,B=null,J=null;function et(){return H||M({}),H}function V(){return B||M({}),B}function tt(){return J||M({}),J}function nt(o){var t;return(t=V())==null?void 0:t.render(o)}function it(){var t;const o=Ge();if(o){const{squatchConfig:e,widgetConfig:n}=o;return M(e),(t=V())==null?void 0:t.render(n)}}function M(o){const e=q(o);e.tenantAlias.match("^test")||e.debug?_e("squatch-js*"):We(),$("initializing ..."),H=new z(e),B=new S(e),J=new je(e),$("Widget API instance",H),$("Widgets instance",B),$("Events API instance",J)}function ot(o){o()}function st(o){V().autofill(o)}function ve(){Je()}typeof document<"u"&&!window.SaaSquatchDoNotAutoDrop&&ve();var he;(he=window.squatch)!=null&&he.init&&$("Squatchjs is being loaded more than once. This may lead to multiple load events being sent, duplicated widgets, and inaccurate analytics.");typeof document<"u"&&He();exports.DeclarativeEmbedWidget=te;exports.DeclarativePopupWidget=ne;exports.EmbedWidget=T;exports.PopupWidget=U;exports.WidgetApi=z;exports.Widgets=S;exports._auto=it;exports.api=et;exports.autofill=st;exports.events=tt;exports.help=Ze;exports.init=M;exports.pushCookie=ve;exports.ready=ot;exports.widget=nt;exports.widgets=V;
|
|
360
|
+
`),h.close(),W("Popup template loaded into iframe"),await this._setupResizeHandler(s)}async _setupResizeHandler(e){const{contentWindow:n}=e;if(!n)throw new Error("Frame needs a content window");const i=n.document;Z(i,async()=>{i.body.style.overflowY="hidden";let s=!0;new n.ResizeObserver(a=>{for(const d of a){const{top:c,bottom:h}=d.contentRect,u=h+c;u<=0||(s?(s=!1,e.style.height="0",e.height=i.body.scrollHeight+"",e.style.height=""):e.height=u+"",d.target.style="")}}).observe(await this._findInnerContainer(e))})}open(){const e=this.container?this._findElement():document.body,i=(e.shadowRoot||e).querySelector(`#${this.id}`);if(!i)throw new Error("Could not determine container div");i.showModal();const s=this._findFrame();if(!s)throw new Error("Could not find iframe");const{contentWindow:r}=s;if(!r)throw new Error("Squatch.js has an empty iframe");const a=r.document;Z(a,()=>{var c;const d=r.squatch||r.widgetIdent;(c=s.contentDocument)==null||c.dispatchEvent(new CustomEvent("sq:refresh")),this.context.user?(this._loadEvent(d),W("Popup opened")):this._attachLoadEventListener(a,d)})}close(){const e=this._findFrame();e!=null&&e.contentDocument&&this._detachLoadEventListener(e.contentDocument);const n=this.container?this._findElement():document.body,s=(n.shadowRoot||n).querySelector(`#${this.id}`);if(!s)throw new Error("Could not determine container div");s.close(),W("Popup closed")}_clickedOutside({target:e}){}_error(e,n="modal",i=""){return super._error(e,n,i||"body { margin: 0; } .modal { box-shadow: none; border: 0; }")}}const v=k("squatch-js:widgets");class S{constructor(t){l(this,"api");l(this,"tenantAlias");l(this,"domain");l(this,"npmCdn");const e=q(t);this.tenantAlias=e.tenantAlias,this.domain=e.domain,this.npmCdn=e.npmCdn,this.api=new z(e)}async upsertUser(t){const n=ue(t);try{const i=await this.api.upsertUser(n);return{widget:this._renderWidget(i,n,{type:"upsert",user:n.user,engagementMedium:t.engagementMedium,container:t.container,trigger:t.trigger,widgetConfig:{values:{brandingConfig:i==null?void 0:i.brandingConfig}}}),user:i.user}}catch(i){throw console.log("[DEBUG] Widgets.upsertUser catch - err:",i),console.log("[DEBUG] Widgets.upsertUser catch - typeof err:",typeof i),console.log("[DEBUG] Widgets.upsertUser catch - err.apiErrorCode:",i.apiErrorCode),console.log("[DEBUG] Widgets.upsertUser catch - err keys:",Object.keys(i||{})),v(i),i.apiErrorCode&&(console.log("[DEBUG] Widgets.upsertUser - calling _renderErrorWidget"),this._renderErrorWidget(i,t.engagementMedium)),new Error(i)}}async render(t){const n=pe(t);try{const i=await this.api.render(n);return{widget:this._renderWidget(i,n,{type:"passwordless",engagementMedium:n.engagementMedium,container:n.container,trigger:n.trigger,widgetConfig:i==null?void 0:i.widgetConfig}),user:i.user}}catch(i){throw i.apiErrorCode&&this._renderErrorWidget(i,n.engagementMedium),new Error(i)}}async autofill(t){const e=t;if(typeof e=="function"){try{const s=await this.api.squatchReferralCookie();e(s)}catch(s){throw v("Autofill error",s),new Error(s)}return}if(typeof e!="string")throw new Error("Autofill accepts a string or function");let n=document.querySelectorAll(e),i;if(n.length>0)i=n[0];else throw v("Element id/class or function missing"),new Error("Element id/class or function missing");try{const s=await this.api.squatchReferralCookie();i.value=s.codes[0]}catch(s){throw new Error(s)}}_renderWidget(t,e,n){var d;if(v("Rendering Widget..."),!t)throw new Error("Unable to get a response");let i,s=!!e.displayOnLoad;const r=t.jsOptions||{},a={content:t.template,type:e.widgetType||((d=r.widget)==null?void 0:d.defaultWidgetType),api:this.api,domain:this.domain,npmCdn:this.npmCdn,context:n};return r.widgetUrlMappings&&r.widgetUrlMappings.forEach(c=>{var h,u;S._matchesUrl(c.url)&&(c.widgetType!=="CONVERSION_WIDGET"||(u=(h=t.user)==null?void 0:h.referredBy)!=null&&u.code?(s=c.displayOnLoad,v(`Display ${c.widgetType} on ${c.url}`)):v(`Don't display ${c.widgetType} when no referral on widget rule match ${c.url}`))}),r.fuelTankAutofillUrls&&(v("We found a fuel tank autofill!"),r.fuelTankAutofillUrls.forEach(({url:c,formSelector:h})=>{var u,p,m;if(S._matchesUrl(c)&&(v("Fuel Tank URL matches"),(p=(u=t.user)==null?void 0:u.referredBy)!=null&&p.code)){const g=document.querySelector(h);g?g.value=((m=t.user.referredBy.referredReward)==null?void 0:m.fuelTankCode)||"":v(new Error(`Element with id/class ${h} was not found.`))}})),e.engagementMedium==="EMBED"?i=this._renderEmbedWidget(a):(i=this._renderPopupWidget(a),s&&i.open()),i}_renderPopupWidget(t){const e=new U(t,t.context.trigger);return e.load(),e}_renderEmbedWidget(t){const e=new T(t,t.context.container);return e.load(),e}_renderErrorWidget(t,e="POPUP"){const{apiErrorCode:n,rsCode:i,statusCode:s,message:r}=t;v(new Error(`${n} (${i}) ${r}`));const a={content:"error",rsCode:i,apiErrorCode:n,statusCode:s,errorMessage:r,api:this.api,domain:this.domain,npmCdn:this.npmCdn,type:"ERROR_WIDGET",context:{type:"error"}};let d;e==="EMBED"?(d=new T(a),d.load()):e==="POPUP"&&(d=new U(a),d.load())}static _matchesUrl(t){return!!window.location.href.match(new RegExp(t))}}class je{constructor(t){l(this,"tenantAlias");l(this,"domain");const n=q(t);this.tenantAlias=n.tenantAlias,this.domain=n.domain}track(t,e){const n=t,i=e,s=Ne(n),{jwt:r}=Fe(i),a=encodeURIComponent(this.tenantAlias),d=encodeURIComponent(s.userId),c=encodeURIComponent(s.accountId),h=`/api/v1/${a}/open/account/${c}/user/${d}/events`,u=this.domain+h;return K(u,JSON.stringify(s),r)}}function Ne(o){if(!I(o))throw new Error("tracking parameter must be an object");if(!(o!=null&&o.accountId))throw new Error("accountId field is required");if(!(o!=null&&o.events))throw new Error("events field is required");if(!(o!=null&&o.userId))throw new Error("userId field is required");const t=o;if(!Array.isArray(t.events))throw new Error("'events' should be an array");return t}function Fe(o){if(!I(o))throw new Error("'options' should be an object");return o}function Be(){var i;const o=window[X]?X:L,t=((i=window["_"+o])==null?void 0:i.ready)||[],e=window.impactOnReady||window.squatchOnReady,n=[...t,e].filter(s=>!!s);setTimeout(()=>{window[L]&&(window[X]=window[L],n.forEach(s=>s()),window[L]._auto(),window["_"+o]=void 0,delete window["_"+o])},0)}const E=k("squatch-js"),de=o=>typeof o=="object"&&!Array.isArray(o),we=(o,t)=>{const e=i=>de(t[i])&&o.hasOwnProperty(i)&&de(o[i]),n=Object.getOwnPropertyNames(t).map(i=>({[i]:e(i)?we(o[i],t[i]):t[i]})).reduce((i,s)=>({...i,...s}),{});return{...o,...n}};function F(o){const t=atob(o.replace(/_/g,"/").replace(/-/g,"+")),e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return new TextDecoder("utf8").decode(e)}function ce(o){const t=new TextEncoder().encode(o),e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function He(){var o,t,e="weird_get_top_level_domain=cookie",n=document.location.hostname.split(".");for(o=n.length-1;o>=0;o--)if(t=n.slice(o).join("."),document.cookie=e+";domain=."+t+";",document.cookie.indexOf(e)>-1)return document.cookie=e.split("=")[0]+"=;domain=."+t+";expires=Thu, 01 Jan 1970 00:00:01 GMT;",t}function Ge(){const o=window.location.search,e=new URLSearchParams(o).get("_saasquatch")||"";if(e){let n="",i="",s="";try{n=JSON.parse(F(e))}catch(r){E("Unable to decode params",r);return}try{i=JSON.parse(F(j.get("_saasquatch"))),E("existing cookie",i)}catch(r){E("Unable to retrieve cookie",r)}try{const r=He();if(E("domain retrieved:",r),i){const a=we(i,n);s=ce(JSON.stringify(a)),E("cookie to store:",a)}else s=ce(JSON.stringify(n)),E("cookie to store:",n);j.set("_saasquatch",s,{expires:365,secure:!1,sameSite:"Lax",domain:r,path:"/"})}catch(r){E("Unable to set cookie",r)}}}const D=k("squatch-js");function Je(){var u;const o=window.location.search,e=new URLSearchParams(o).get("_saasquatchExtra")||"";if(!e){D("No _saasquatchExtra param");return}const n=q({tenantAlias:"UNKNOWN"});if(!n.domain){D("domain must be provided in config to use _saasquatchExtra");return}let i;try{i=JSON.parse(F(e))}catch{D("Unable to decode _saasquatchExtra config");return}function s(p){return p.replace(/^https?:\/\//,"")}const r=s(n.domain),a=Object.keys((i==null?void 0:i[r])||{})[0],d=(u=i==null?void 0:i[r])==null?void 0:u[a];if(!d){D("_saasquatchExtra did not have an expected structure");return}const{autoPopupWidgetType:c,...h}=d;return{widgetConfig:{widgetType:c,displayOnLoad:!0,...h},squatchConfig:{...n,tenantAlias:a}}}const ze=k("squatch-js:decodeUserJwt");function Ve(o){var t;try{const e=o.split(".")[1];if(e===void 0)return null;const n=F(e);return(t=JSON.parse(n))==null?void 0:t.user}catch(e){return ze(e),null}}const le=k("squatch-js:DeclarativeWidget");class ye extends HTMLElement{constructor(){super();l(this,"config");l(this,"token");l(this,"tenant");l(this,"widgetType");l(this,"locale");l(this,"widgetApi");l(this,"analyticsApi");l(this,"widgetInstance");l(this,"type");l(this,"container");l(this,"element");l(this,"loaded");l(this,"_setWidget",(e,n)=>{var s;const i={api:this.widgetApi,content:e.template,context:{type:n.type,user:n.user,container:this.container||void 0,engagementMedium:this.type,widgetConfig:e.widgetConfig},type:this.widgetType,domain:((s=this.config)==null?void 0:s.domain)||A,npmCdn:Y,container:this};if(this.type==="EMBED")return new T(i);{const r=this.firstChild?null:void 0;return new U(i,r)}});l(this,"setErrorWidget",e=>{var d;const n=e instanceof Error?e.message:e==null?void 0:e.message,i=e instanceof Error||e==null?void 0:e.apiErrorCode,s=e instanceof Error||e==null?void 0:e.rsCode,r=e instanceof Error||e==null?void 0:e.statusCode,a={api:this.widgetApi,content:"error",context:{type:"error",container:this.container||void 0},type:"ERROR_WIDGET",domain:((d=this.config)==null?void 0:d.domain)||A,npmCdn:Y,container:this,apiErrorCode:i,rsCode:s,statusCode:r,errorMessage:n};if(this.type==="EMBED")return new T(a);{const c=this.firstChild?null:void 0;return new U(a,c)}});l(this,"reload",this.renderWidget);l(this,"show",this.open);l(this,"hide",this.close);this.attachShadow({mode:"open"}).innerHTML="<style>:host { display: block; }</style><slot></slot>",this.config=ee(),this.token=R(),this.tenant=window.squatchTenant,this.container=this}_setupApis(e){var n,i;if(!this.tenant)throw new Error("tenantAlias not provided");this.widgetApi=new z({tenantAlias:(e==null?void 0:e.tenantAlias)||this.tenant,domain:(e==null?void 0:e.domain)||((n=this.config)==null?void 0:n.domain)||A}),this.analyticsApi=new ge({domain:(e==null?void 0:e.domain)||((i=this.config)==null?void 0:i.domain)||A})}getWidgetType(e){return e&&(e.includes("websiteReferralWidget")||e.includes("friendWidget"))?"instant-access":"verified-access"}async renderPasswordlessVariant(){return this._setupApis(),le("Rendering as an Instant Access widget"),await this.widgetApi.render({engagementMedium:this.type,widgetType:this.widgetType,locale:this.locale}).then(e=>this._setWidget(e,{type:"passwordless"})).catch(this.setErrorWidget)}async renderUserUpsertVariant(){this._setupApis();const e=Ve(this.token);if(!e)return this.setErrorWidget(Error("No user object in token."));le("Rendering as a Verified widget");try{await this.widgetApi.upsertUser({user:e,locale:this.locale,engagementMedium:this.type,widgetType:this.widgetType,jwt:this.token})}catch(i){return this.setErrorWidget(i)}return await this.widgetApi.render({locale:this.locale,engagementMedium:this.type,widgetType:this.widgetType}).then(i=>this._setWidget(i,{type:"upsert",user:e})).catch(this.setErrorWidget)}async getWidgetInstance(){let e;if(this.widgetType=this.getAttribute("widget")||void 0,this.locale=this.getAttribute("locale")||this.locale,!this.widgetType)throw new Error("No widget has been specified");return this.token?e=await this.renderUserUpsertVariant():e=await this.renderPasswordlessVariant(),this.widgetInstance=e,this.widgetInstance&&this.dispatchEvent(new CustomEvent("sq:widget-loaded")),e}async renderWidget(){await this.getWidgetInstance(),await this.widgetInstance.load()}open(){if(!this.widgetInstance)throw new Error("Widget has not loaded yet");this.widgetInstance.open()}close(){if(!this.widgetInstance)throw new Error("Widget has not loaded yet");this.widgetInstance.close()}static get observedAttributes(){return["widget","locale"]}attributeChangedCallback(e,n,i){if(!(n===i||!this.loaded))switch(e){case"locale":case"widget":this.connectedCallback();break}}async connectedCallback(){this.loaded=!0,this.container=this.getAttribute("container"),this.widgetType=this.getAttribute("widget")||void 0;const e=this.getWidgetType(this.widgetType),{getSkeleton:n}=await Promise.resolve().then(()=>Le),i=n({height:"100%",type:e}),s=document.createElement("div");s.id="loading-skeleton",s.innerHTML=i;const r=this.shadowRoot||this.attachShadow({mode:"open"});if(this.type==="POPUP"){const d=r.getElementById("#squatchModal");d&&(d.innerHTML="",d.appendChild(s))}else r.innerHTML="",r.appendChild(s);await this.renderWidget();const a=r.getElementById("loading-skeleton");a&&a.remove(),this.getAttribute("open")!==null&&this.open()}}class te extends ye{constructor(){super(),this.type="EMBED",this.loaded=!1}}class ne extends ye{constructor(){super(),this.type="POPUP",this.loaded=!1,this.addEventListener("click",t=>{t.stopPropagation(),this.open()})}}class Xe extends te{}class Qe extends ne{}class Ye extends te{}class Ke extends ne{}window.customElements.get("squatch-embed")||window.customElements.define("squatch-embed",Xe);window.customElements.get("impact-embed")||window.customElements.define("impact-embed",Ye);window.customElements.get("squatch-popup")||window.customElements.define("squatch-popup",Qe);window.customElements.get("impact-popup")||window.customElements.define("impact-popup",Ke);function Ze(){console.log("Having trouble using Squatch.js? Go to https://docs.referralsaasquatch.com/developer/ for tutorials, references and error codes.")}const $=k("squatch-js");let B=null,H=null,G=null;function et(){return B||P({}),B}function V(){return H||P({}),H}function tt(){return G||P({}),G}function nt(o){var t;return(t=V())==null?void 0:t.render(o)}function it(){var t;const o=Je();if(o){const{squatchConfig:e,widgetConfig:n}=o;return P(e),(t=V())==null?void 0:t.render(n)}}function P(o){const e=q(o);e.tenantAlias.match("^test")||e.debug?_e("squatch-js*"):We(),$("initializing ..."),B=new z(e),H=new S(e),G=new je(e),$("Widget API instance",B),$("Widgets instance",H),$("Events API instance",G)}function ot(o){o()}function st(o){V().autofill(o)}function ve(){Ge()}typeof document<"u"&&!window.SaaSquatchDoNotAutoDrop&&ve();var he;(he=window.squatch)!=null&&he.init&&$("Squatchjs is being loaded more than once. This may lead to multiple load events being sent, duplicated widgets, and inaccurate analytics.");typeof document<"u"&&Be();exports.DeclarativeEmbedWidget=te;exports.DeclarativePopupWidget=ne;exports.EmbedWidget=T;exports.PopupWidget=U;exports.WidgetApi=z;exports.Widgets=S;exports._auto=it;exports.api=et;exports.autofill=st;exports.events=tt;exports.help=Ze;exports.init=P;exports.pushCookie=ve;exports.ready=ot;exports.widget=nt;exports.widgets=V;
|
|
361
361
|
//# sourceMappingURL=squatch.cjs.js.map
|