@sesamy/sesamy-js 1.116.0 → 1.117.0

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.
@@ -21,7 +21,9 @@
21
21
  export interface BootstrapOptions {
22
22
  /**
23
23
  * Your Sesamy client id. When provided, the bundle URL defaults to
24
- * `https://scripts.sesamy.com/s/{clientId}/sesamy-js/{version}`. Either
24
+ * `https://scripts.sesamy.com/s/{clientId}/sesamy-js/{version}.js` (the
25
+ * `.js` suffix selects the IIFE build — the bootstrap injects a classic
26
+ * `<script>`, which cannot parse the ESM served at the bare URL). Either
25
27
  * `clientId` or an explicit `src` is required.
26
28
  */
27
29
  clientId?: string;
@@ -1 +1 @@
1
- var sesamyBootstrap=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){let t=e.namespace||`sesamy`,n=e.fallbackSrc,r=e.environment===`dev`?`scripts.sesamy.dev`:`scripts.sesamy.com`,i=e.src||`https://`+r+`/s/`+e.clientId+`/sesamy-js/`+(e.version||`stable`),a=window;if(!e.skipAuthPrefetch&&!a.__sesamyBoot){let t=null;try{let e=sessionStorage.getItem(`sesamy:userinfo`);if(e){let n=JSON.parse(e),r=n._cachedAt;r&&Date.now()-r<=36e5&&(t=n)}}catch{}t?a.__sesamyBoot=Promise.resolve(t):(`; `+document.cookie).indexOf(`; sesamy_is_authenticated=true`)>=0&&(a.__sesamyBoot=fetch((e.apiBaseUrl||``)+`/auth/userinfo`,{credentials:`include`,headers:{Accept:`application/json`}}).then(e=>e.ok?e.json():null).catch(()=>null))}let o=!1,s=()=>{if(o||!n||a[t])return;o=!0;let e=document.createElement(`script`);e.src=n,e.async=!0,document.head.appendChild(e)},c=document.createElement(`script`);c.src=i,c.async=!0,c.onerror=s,document.head.appendChild(c),n&&setTimeout(s,e.fallbackTimeoutMs||3e3)}function n(e){return`(`+t.toString()+`)(`+JSON.stringify(e)+`);`}if(typeof window<`u`){window.sesamyBootstrap=t;try{let e=document.getElementById(`sesamy-js`),n=e&&e.textContent?JSON.parse(e.textContent):null;n&&n.clientId&&t({clientId:n.clientId})}catch{}}return e.renderBootstrapScript=n,e.sesamyBootstrap=t,e})({});
1
+ var sesamyBootstrap=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e){let t=e.namespace||`sesamy`,n=e.fallbackSrc,r=e.environment===`dev`?`scripts.sesamy.dev`:`scripts.sesamy.com`,i=e.src||`https://`+r+`/s/`+e.clientId+`/sesamy-js/`+(e.version||`stable`)+`.js`,a=window;if(!e.skipAuthPrefetch&&!a.__sesamyBoot){let t=null;try{let e=sessionStorage.getItem(`sesamy:userinfo`);if(e){let n=JSON.parse(e),r=n._cachedAt;r&&Date.now()-r<=36e5&&(t=n)}}catch{}t?a.__sesamyBoot=Promise.resolve(t):(`; `+document.cookie).indexOf(`; sesamy_is_authenticated=true`)>=0&&(a.__sesamyBoot=fetch((e.apiBaseUrl||``)+`/auth/userinfo`,{credentials:`include`,headers:{Accept:`application/json`}}).then(e=>e.ok?e.json():null).catch(()=>null))}let o=!1,s=()=>{if(o||!n||a[t])return;o=!0;let e=document.createElement(`script`);e.src=n,e.async=!0,document.head.appendChild(e)},c=document.createElement(`script`);c.src=i,c.async=!0,c.onerror=s,document.head.appendChild(c),n&&setTimeout(s,e.fallbackTimeoutMs||3e3)}function n(e){return`(`+t.toString()+`)(`+JSON.stringify(e)+`);`}if(typeof window<`u`){window.sesamyBootstrap=t;try{let e=document.getElementById(`sesamy-js`),n=e&&e.textContent?JSON.parse(e.textContent):null;n&&n.clientId&&t({clientId:n.clientId})}catch{}}return e.renderBootstrapScript=n,e.sesamyBootstrap=t,e})({});
@@ -1,6 +1,6 @@
1
1
  //#region src/bootstrap.ts
2
2
  function e(e) {
3
- let t = e.namespace || "sesamy", n = e.fallbackSrc, r = e.environment === "dev" ? "scripts.sesamy.dev" : "scripts.sesamy.com", i = e.src || "https://" + r + "/s/" + e.clientId + "/sesamy-js/" + (e.version || "stable"), a = window;
3
+ let t = e.namespace || "sesamy", n = e.fallbackSrc, r = e.environment === "dev" ? "scripts.sesamy.dev" : "scripts.sesamy.com", i = e.src || "https://" + r + "/s/" + e.clientId + "/sesamy-js/" + (e.version || "stable") + ".js", a = window;
4
4
  if (!e.skipAuthPrefetch && !a.__sesamyBoot) {
5
5
  let t = null;
6
6
  try {