@opencx/widget 5.0.0-beta.3 → 5.0.0-beta.5

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.
@@ -1 +1 @@
1
- (function(){"use strict";const d=window,i=document.currentScript;function r(){if(!(i!=null&&i.src))return null;try{return new URL("widget.js",i.src).href}catch{return null}}function l(e,t){for(const n of e.queue.splice(0))t(n)}window.openCXWidgetVersion="5.0.0-beta.3";let o=d.__openCXWidgetLoaderState__;const u=window.initOpenScript;if(typeof u=="function"&&(!o||u!==o.stub))o&&l(o,u);else{if(!o){const t=[];o={queue:t,stub:s=>t.push(s),moduleRequested:!1},d.__openCXWidgetLoaderState__=o}const e=o;if(window.initOpenScript!==e.stub&&(window.initOpenScript=e.stub),!e.moduleRequested){const t=r();if(!t)console.error("[opencx] could not resolve the widget module URL from this script tag; the widget will not load");else{e.moduleRequested=!0;const n=document.createElement("script");n.type="module",n.src=t;const s=i==null?void 0:i.nonce;s&&(n.nonce=s),n.onload=()=>{const c=window.initOpenScript;if(c===e.stub||typeof c!="function"){console.error("[opencx] the widget module loaded but did not install initOpenScript; check that",t,"is the widget build published beside script.js");return}l(e,c)},n.onerror=()=>{e.moduleRequested=!1,console.error("[opencx] failed to load the widget module from",t)},(document.head||document.documentElement).append(n)}}}})();
1
+ (function(){"use strict";const d=window,i=document.currentScript;function r(){if(!(i!=null&&i.src))return null;try{return new URL("widget.js",i.src).href}catch{return null}}function l(e,t){for(const n of e.queue.splice(0))t(n)}window.openCXWidgetVersion="5.0.0-beta.5";let o=d.__openCXWidgetLoaderState__;const u=window.initOpenScript;if(typeof u=="function"&&(!o||u!==o.stub))o&&l(o,u);else{if(!o){const t=[];o={queue:t,stub:s=>t.push(s),moduleRequested:!1},d.__openCXWidgetLoaderState__=o}const e=o;if(window.initOpenScript!==e.stub&&(window.initOpenScript=e.stub),!e.moduleRequested){const t=r();if(!t)console.error("[opencx] could not resolve the widget module URL from this script tag; the widget will not load");else{e.moduleRequested=!0;const n=document.createElement("script");n.type="module",n.src=t;const s=i==null?void 0:i.nonce;s&&(n.nonce=s),n.onload=()=>{const c=window.initOpenScript;if(c===e.stub||typeof c!="function"){console.error("[opencx] the widget module loaded but did not install initOpenScript; check that",t,"is the widget build published beside script.js");return}l(e,c)},n.onerror=()=>{e.moduleRequested=!1,console.error("[opencx] failed to load the widget module from",t)},(document.head||document.documentElement).append(n)}}}})();