var SourceEmbedsLoader=function(b){"use strict";function Ht(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jt=typeof global=="object"&&global&&global.Object===Object&&global;const W=Jt;var Yt=typeof self=="object"&&self&&self.Object===Object&&self,qt=W||Yt||Function("return this")();const w=qt;var Xt=w.Symbol;const O=Xt;var k=Object.prototype,Vt=k.hasOwnProperty,Zt=k.toString,$=O?O.toStringTag:void 0;function Qt(t){var e=Vt.call(t,$),r=t[$];try{t[$]=void 0;var n=!0}catch{}var o=Zt.call(t);return n&&(e?t[$]=r:delete t[$]),o}var Wt=Object.prototype,kt=Wt.toString;function te(t){return kt.call(t)}var ee="[object Null]",re="[object Undefined]",tt=O?O.toStringTag:void 0;function P(t){return t==null?t===void 0?re:ee:tt&&tt in Object(t)?Qt(t):te(t)}function T(t){return t!=null&&typeof t=="object"}var ne="[object Symbol]";function z(t){return typeof t=="symbol"||T(t)&&P(t)==ne}function oe(t,e){for(var r=-1,n=t==null?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var ie=Array.isArray;const E=ie;var ae=1/0,et=O?O.prototype:void 0,rt=et?et.toString:void 0;function nt(t){if(typeof t=="string")return t;if(E(t))return oe(t,nt)+"";if(z(t))return rt?rt.call(t):"";var e=t+"";return e=="0"&&1/t==-ae?"-0":e}function m(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function ot(t){return t}var ce="[object AsyncFunction]",se="[object Function]",ue="[object GeneratorFunction]",fe="[object Proxy]";function B(t){if(!m(t))return!1;var e=P(t);return e==se||e==ue||e==ce||e==fe}var le=w["__core-js_shared__"];const K=le;var it=function(){var t=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function de(t){return!!it&&it in t}var pe=Function.prototype,ge=pe.toString;function he(t){if(t!=null){try{return ge.call(t)}catch{}try{return t+""}catch{}}return""}var be=/[\\^$.*+?()[\]{}|]/g,ye=/^\[object .+?Constructor\]$/,me=Function.prototype,_e=Object.prototype,ve=me.toString,Se=_e.hasOwnProperty,we=RegExp("^"+ve.call(Se).replace(be,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Oe(t){if(!m(t)||de(t))return!1;var e=B(t)?we:ye;return e.test(he(t))}function Te(t,e){return t==null?void 0:t[e]}function G(t,e){var r=Te(t,e);return Oe(r)?r:void 0}var at=Object.create,Ee=function(){function t(){}return function(e){if(!m(e))return{};if(at)return at(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const je=Ee;function $e(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Pe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Ae=800,Ce=16,Ue=Date.now;function Ie(t){var e=0,r=0;return function(){var n=Ue(),o=Ce-(n-r);if(r=n,o>0){if(++e>=Ae)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Le(t){return function(){return t}}var Fe=function(){try{var t=G(Object,"defineProperty");return t({},"",{}),t}catch{}}();const F=Fe;var Re=F?function(t,e){return F(t,"toString",{configurable:!0,enumerable:!1,value:Le(e),writable:!0})}:ot,Ne=Ie(Re);const xe=Ne;var Me=9007199254740991,De=/^(?:0|[1-9]\d*)$/;function H(t,e){var r=typeof t;return e=e??Me,!!e&&(r=="number"||r!="symbol"&&De.test(t))&&t>-1&&t%1==0&&t<e}function J(t,e,r){e=="__proto__"&&F?F(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function R(t,e){return t===e||t!==t&&e!==e}var ze=Object.prototype,Be=ze.hasOwnProperty;function ct(t,e,r){var n=t[e];(!(Be.call(t,e)&&R(n,r))||r===void 0&&!(e in t))&&J(t,e,r)}function Ke(t,e,r,n){var o=!r;r||(r={});for(var a=-1,u=e.length;++a<u;){var i=e[a],c=n?n(r[i],t[i],i,r,t):void 0;c===void 0&&(c=t[i]),o?J(r,i,c):ct(r,i,c)}return r}var st=Math.max;function Ge(t,e,r){return e=st(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=st(n.length-e,0),u=Array(a);++o<a;)u[o]=n[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=n[o];return i[e]=r(u),$e(t,this,i)}}function He(t,e){return xe(Ge(t,e,ot),t+"")}var Je=9007199254740991;function ut(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Je}function Y(t){return t!=null&&ut(t.length)&&!B(t)}function Ye(t,e,r){if(!m(r))return!1;var n=typeof e;return(n=="number"?Y(r)&&H(e,r.length):n=="string"&&e in r)?R(r[e],t):!1}function qe(t){return He(function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,u=o>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,u&&Ye(r[0],r[1],u)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var i=r[n];i&&t(e,i,n,a)}return e})}var Xe=Object.prototype;function ft(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Xe;return t===r}function Ve(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Ze="[object Arguments]";function lt(t){return T(t)&&P(t)==Ze}var dt=Object.prototype,Qe=dt.hasOwnProperty,We=dt.propertyIsEnumerable,ke=lt(function(){return arguments}())?lt:function(t){return T(t)&&Qe.call(t,"callee")&&!We.call(t,"callee")};const q=ke;function tr(){return!1}var pt=typeof b=="object"&&b&&!b.nodeType&&b,gt=pt&&typeof module=="object"&&module&&!module.nodeType&&module,er=gt&&gt.exports===pt,ht=er?w.Buffer:void 0,rr=ht?ht.isBuffer:void 0,nr=rr||tr;const bt=nr;var or="[object Arguments]",ir="[object Array]",ar="[object Boolean]",cr="[object Date]",sr="[object Error]",ur="[object Function]",fr="[object Map]",lr="[object Number]",dr="[object Object]",pr="[object RegExp]",gr="[object Set]",hr="[object String]",br="[object WeakMap]",yr="[object ArrayBuffer]",mr="[object DataView]",_r="[object Float32Array]",vr="[object Float64Array]",Sr="[object Int8Array]",wr="[object Int16Array]",Or="[object Int32Array]",Tr="[object Uint8Array]",Er="[object Uint8ClampedArray]",jr="[object Uint16Array]",$r="[object Uint32Array]",p={};p[_r]=p[vr]=p[Sr]=p[wr]=p[Or]=p[Tr]=p[Er]=p[jr]=p[$r]=!0,p[or]=p[ir]=p[yr]=p[ar]=p[mr]=p[cr]=p[sr]=p[ur]=p[fr]=p[lr]=p[dr]=p[pr]=p[gr]=p[hr]=p[br]=!1;function Pr(t){return T(t)&&ut(t.length)&&!!p[P(t)]}function Ar(t){return function(e){return t(e)}}var yt=typeof b=="object"&&b&&!b.nodeType&&b,A=yt&&typeof module=="object"&&module&&!module.nodeType&&module,Cr=A&&A.exports===yt,X=Cr&&W.process,Ur=function(){try{var t=A&&A.require&&A.require("util").types;return t||X&&X.binding&&X.binding("util")}catch{}}();const mt=Ur;var _t=mt&&mt.isTypedArray,Ir=_t?Ar(_t):Pr;const vt=Ir;var Lr=Object.prototype,Fr=Lr.hasOwnProperty;function Rr(t,e){var r=E(t),n=!r&&q(t),o=!r&&!n&&bt(t),a=!r&&!n&&!o&&vt(t),u=r||n||o||a,i=u?Ve(t.length,String):[],c=i.length;for(var l in t)(e||Fr.call(t,l))&&!(u&&(l=="length"||o&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||H(l,c)))&&i.push(l);return i}function Nr(t,e){return function(r){return t(e(r))}}function xr(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Mr=Object.prototype,Dr=Mr.hasOwnProperty;function zr(t){if(!m(t))return xr(t);var e=ft(t),r=[];for(var n in t)n=="constructor"&&(e||!Dr.call(t,n))||r.push(n);return r}function St(t){return Y(t)?Rr(t,!0):zr(t)}var Br=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kr=/^\w*$/;function Gr(t,e){if(E(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||z(t)?!0:Kr.test(t)||!Br.test(t)||e!=null&&t in Object(e)}var Hr=G(Object,"create");const C=Hr;function Jr(){this.__data__=C?C(null):{},this.size=0}function Yr(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var qr="__lodash_hash_undefined__",Xr=Object.prototype,Vr=Xr.hasOwnProperty;function Zr(t){var e=this.__data__;if(C){var r=e[t];return r===qr?void 0:r}return Vr.call(e,t)?e[t]:void 0}var Qr=Object.prototype,Wr=Qr.hasOwnProperty;function kr(t){var e=this.__data__;return C?e[t]!==void 0:Wr.call(e,t)}var tn="__lodash_hash_undefined__";function en(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=C&&e===void 0?tn:e,this}function S(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}S.prototype.clear=Jr,S.prototype.delete=Yr,S.prototype.get=Zr,S.prototype.has=kr,S.prototype.set=en;function rn(){this.__data__=[],this.size=0}function N(t,e){for(var r=t.length;r--;)if(R(t[r][0],e))return r;return-1}var nn=Array.prototype,on=nn.splice;function an(t){var e=this.__data__,r=N(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():on.call(e,r,1),--this.size,!0}function cn(t){var e=this.__data__,r=N(e,t);return r<0?void 0:e[r][1]}function sn(t){return N(this.__data__,t)>-1}function un(t,e){var r=this.__data__,n=N(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function _(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_.prototype.clear=rn,_.prototype.delete=an,_.prototype.get=cn,_.prototype.has=sn,_.prototype.set=un;var fn=G(w,"Map");const wt=fn;function ln(){this.size=0,this.__data__={hash:new S,map:new(wt||_),string:new S}}function dn(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function x(t,e){var r=t.__data__;return dn(e)?r[typeof e=="string"?"string":"hash"]:r.map}function pn(t){var e=x(this,t).delete(t);return this.size-=e?1:0,e}function gn(t){return x(this,t).get(t)}function hn(t){return x(this,t).has(t)}function bn(t,e){var r=x(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function v(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}v.prototype.clear=ln,v.prototype.delete=pn,v.prototype.get=gn,v.prototype.has=hn,v.prototype.set=bn;var yn="Expected a function";function V(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(yn);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var u=t.apply(this,n);return r.cache=a.set(o,u)||a,u};return r.cache=new(V.Cache||v),r}V.Cache=v;var mn=500;function _n(t){var e=V(t,function(n){return r.size===mn&&r.clear(),n}),r=e.cache;return e}var vn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sn=/\\(\\)?/g,wn=_n(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(vn,function(r,n,o,a){e.push(o?a.replace(Sn,"$1"):n||r)}),e});const On=wn;function Tn(t){return t==null?"":nt(t)}function En(t,e){return E(t)?t:Gr(t,e)?[t]:On(Tn(t))}var jn=1/0;function $n(t){if(typeof t=="string"||z(t))return t;var e=t+"";return e=="0"&&1/t==-jn?"-0":e}var Pn=Nr(Object.getPrototypeOf,Object);const Ot=Pn;var An="[object Object]",Cn=Function.prototype,Un=Object.prototype,Tt=Cn.toString,In=Un.hasOwnProperty,Ln=Tt.call(Object);function Fn(t){if(!T(t)||P(t)!=An)return!1;var e=Ot(t);if(e===null)return!0;var r=In.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Tt.call(r)==Ln}function Rn(){this.__data__=new _,this.size=0}function Nn(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function xn(t){return this.__data__.get(t)}function Mn(t){return this.__data__.has(t)}var Dn=200;function zn(t,e){var r=this.__data__;if(r instanceof _){var n=r.__data__;if(!wt||n.length<Dn-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new v(n)}return r.set(t,e),this.size=r.size,this}function j(t){var e=this.__data__=new _(t);this.size=e.size}j.prototype.clear=Rn,j.prototype.delete=Nn,j.prototype.get=xn,j.prototype.has=Mn,j.prototype.set=zn;var Et=typeof b=="object"&&b&&!b.nodeType&&b,jt=Et&&typeof module=="object"&&module&&!module.nodeType&&module,Bn=jt&&jt.exports===Et,$t=Bn?w.Buffer:void 0,Pt=$t?$t.allocUnsafe:void 0;function Kn(t,e){if(e)return t.slice();var r=t.length,n=Pt?Pt(r):new t.constructor(r);return t.copy(n),n}var Gn=w.Uint8Array;const At=Gn;function Hn(t){var e=new t.constructor(t.byteLength);return new At(e).set(new At(t)),e}function Jn(t,e){var r=e?Hn(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Yn(t){return typeof t.constructor=="function"&&!ft(t)?je(Ot(t)):{}}function qn(t){return function(e,r,n){for(var o=-1,a=Object(e),u=n(e),i=u.length;i--;){var c=u[t?i:++o];if(r(a[c],c,a)===!1)break}return e}}var Xn=qn();const Vn=Xn;function Z(t,e,r){(r!==void 0&&!R(t[e],r)||r===void 0&&!(e in t))&&J(t,e,r)}function Zn(t){return T(t)&&Y(t)}function Q(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Qn(t){return Ke(t,St(t))}function Wn(t,e,r,n,o,a,u){var i=Q(t,r),c=Q(e,r),l=u.get(c);if(l){Z(t,r,l);return}var s=a?a(i,c,r+"",t,e,u):void 0,f=s===void 0;if(f){var d=E(c),g=!d&&bt(c),h=!d&&!g&&vt(c);s=c,d||g||h?E(i)?s=i:Zn(i)?s=Pe(i):g?(f=!1,s=Kn(c,!0)):h?(f=!1,s=Jn(c,!0)):s=[]:Fn(c)||q(c)?(s=i,q(i)?s=Qn(i):(!m(i)||B(i))&&(s=Yn(c))):f=!1}f&&(u.set(c,s),o(s,c,n,a,u),u.delete(c)),Z(t,r,s)}function Ct(t,e,r,n,o){t!==e&&Vn(e,function(a,u){if(o||(o=new j),m(a))Wn(t,e,u,r,Ct,n,o);else{var i=n?n(Q(t,u),a,u+"",t,e,o):void 0;i===void 0&&(i=a),Z(t,u,i)}},St)}var kn=qe(function(t,e,r){Ct(t,e,r)});const U=kn;function to(t,e,r,n){if(!m(t))return t;e=En(e,t);for(var o=-1,a=e.length,u=a-1,i=t;i!=null&&++o<a;){var c=$n(e[o]),l=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=u){var s=i[c];l=n?n(s,c,i):void 0,l===void 0&&(l=m(s)?s:H(e[o+1])?[]:{})}ct(i,c,l),i=i[c]}return t}function Ut(t,e,r){return t==null?t:to(t,e,r)}const M="[sd-embedder]",eo=console.debug.bind(window.console,M),ro=console.warn.bind(window.console,M),no=console.error.bind(window.console,M),oo=console.error.bind(window.console,M),y={debug:eo,warn:ro,error:no,log:oo,child(t){const e={};return Object.entries(this).forEach(([r,n])=>{typeof n=="function"&&(e[r]=n.bind(n,`[${t}]`))}),e}},It="StgbEE5LEe6j2Uu38haiJw",io="^_sdembed_",ao="1",co="https://cdn.sourcesync.io/embed/",so="embed.min.js",uo="source-embeds-settings",Lt="prod",Ft={prod:{content:"https://content.sourcesync.io",experience:"https://experience.sourcesync.io",api:"https://api.sourcesync.io"},dev:{content:"https://content-dev.sourcesync.io",experience:"https://experience-dev.sourcesync.io",api:"https://api-dev.sourcesync.io"},stg:{content:"https://content-stg.sourcesync.io",experience:"https://experience-stg.sourcesync.io",api:"https://api-stg.sourcesync.io"}};function fo(t){return t==null?Lt:Ft[t]!=null?t:Lt}function lo(t,e){const r=fo(e);return Ft[r][t]}async function Rt(t){y.debug("Fetching from service",t);const e=lo(t.service,t.env),r=new URL(e);r.pathname=t.path;for(const[a,u]of Object.entries(t.query??{}))u!=null&&r.searchParams.append(a,u);const n=await fetch(r,t.requestInit);if(!n.ok){if(n.status===404)return;throw new Error(`Fetch from service failed: ${n.status} ${n.statusText}`)}return await n.json()}async function po(t){const{url:e="",globalName:r="",reuseGlobal:n=!1,resolveGlobal:o=!0,defer:a=!0,retryDelay:u=100,maxTries:i=10}=t;let c=i;const l=window;return n&&l[r]!=null?l[r]:await new Promise((s,f)=>{const d=document.createElement("script");d.defer=a,d.src=e,d.addEventListener("error",h=>{f(h.error)}),d.addEventListener("load",g),document.body.appendChild(d);function g(){if(o&&l[r]==null){if(c>0)return c-=1,setTimeout(g,u);f(new Error("loadScript: could not resolve globalName"));return}s(l[r])}})}function Nt(t){return t==="true"?!0:t==="false"?!1:t}function go(t){if(t!=null)return t instanceof RegExp?t:new RegExp(t)}function xt(t,e,r){const n=new URL(t),o=n.searchParams,a={},u=go(r);o.forEach((l,s)=>{const f=ho(s,u);f!=null&&Ut(a,f,Nt(l))});const i=bo(n.pathname);return i!=null&&i.c&&Ut(a,"config",Nt(i.c)),y.debug("Loaded settings from URL",a),e==null?a:U({},e,a)}function ho(t,e){return e==null?t:e.test(t)?t.replace(e,""):null}function bo(t){if(!t)return;const[e,r]=t.split("/").filter(Boolean);return{[e]:r}}function yo(t){const e=new URL(window.location.toString());if(!e.searchParams.has(It))return t;const r=e.searchParams.get(It)||null;return y.debug("Loading settings from page URL"),xt(e,t,r??io)}function mo(){return _o()??vo()??So()}function _o(){try{return document.currentScript&&document.currentScript.src||new URL("embed-loader.min.js",document.baseURI).href}catch{return}}function vo(){if(document.currentScript!=null&&document.currentScript instanceof HTMLScriptElement)return document.currentScript.src}function So(){const t=window.document.getElementsByTagName("script");return t[t.length-1].src}function Mt(t){const e=mo();return y.debug("Loading settings from script URL"),xt(e,t)}function wo(t){if(t.byJsonElement==null)return t;y.debug("Loading settings from JSON element: "+t.byJsonElement);const e=document.querySelector(`script[type="application/json"], ${t.byJsonElement}`);if(e==null)throw new Error("No script element found: "+t.byJsonElement);const r=e.textContent;if(r==null)throw new Error("No JSON found in script element: "+t.byJsonElement);return U({},t,JSON.parse(r))}function Oo(t){if(t.byLocalStorage==null||t.byLocalStorage===!1)return t;let e=uo;typeof t.byLocalStorage=="string"&&(e=t.byLocalStorage),y.debug("Loading settings from localStorage with key:",e);const r=window.localStorage.getItem(e);if(r==null)return t;const n=JSON.parse(r);return y.debug("Loaded settings from localStorage",n),U({},t,n)}async function To(t){const r=new URL(window.location.toString()).hostname;y.debug("Loading settings from domain: ",r);const n=await Rt({service:"content",path:`/embed/by-domain/${r}`,env:t==null?void 0:t.env});return y.debug("Loaded settings from domain: ",n),U({},t,n)}async function Eo(t){let e;const r=(t==null?void 0:t.configId)??(t==null?void 0:t.config);return r!=null&&(e=await Rt({service:"content",path:`/embed/by-id/${r}`,env:t==null?void 0:t.env}),y.debug("Loaded settings from config: ",e)),U({},t,e)}async function jo(t){return t=Mt(t),t=await To(t),t=await Eo(t),t=wo(t),t=yo(t),t=Oo(t),t}var $o=I;I.flatten=I,I.unflatten=Bt;function Dt(t){return t&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function zt(t){return t}function I(t,e){e=e||{};const r=e.delimiter||".",n=e.maxDepth,o=e.transformKey||zt,a={};function u(i,c,l){l=l||1,Object.keys(i).forEach(function(s){const f=i[s],d=e.safe&&Array.isArray(f),g=Object.prototype.toString.call(f),h=Dt(f),D=g==="[object Object]"||g==="[object Array]",L=c?c+r+o(s):o(s);if(!d&&!h&&D&&Object.keys(f).length&&(!e.maxDepth||l<n))return u(f,L,l+1);a[L]=f})}return u(t),a}function Bt(t,e){e=e||{};const r=e.delimiter||".",n=e.overwrite||!1,o=e.transformKey||zt,a={};if(Dt(t)||Object.prototype.toString.call(t)!=="[object Object]")return t;function i(s){const f=Number(s);return isNaN(f)||s.indexOf(".")!==-1||e.object?s:f}function c(s,f,d){return Object.keys(d).reduce(function(g,h){return g[s+r+h]=d[h],g},f)}function l(s){const f=Object.prototype.toString.call(s),d=f==="[object Array]",g=f==="[object Object]";if(s){if(d)return!s.length;if(g)return!Object.keys(s).length}else return!0}return t=Object.keys(t).reduce(function(s,f){const d=Object.prototype.toString.call(t[f]);return!(d==="[object Object]"||d==="[object Array]")||l(t[f])?(s[f]=t[f],s):c(f,s,I(t[f],e))},{}),Object.keys(t).forEach(function(s){const f=s.split(r).map(o);let d=i(f.shift()),g=i(f[0]),h=a;for(;g!==void 0;){if(d==="__proto__")return;const D=Object.prototype.toString.call(h[d]),L=D==="[object Object]"||D==="[object Array]";if(!n&&!L&&typeof h[d]<"u")return;(n&&!L||!n&&h[d]==null)&&(h[d]=typeof g=="number"&&!e.object?[]:{}),h=h[d],f.length>0&&(d=i(f.shift()),g=i(f[0]))}h[d]=Bt(t[s],e)}),a}const Po=Ht($o);async function Ao(t){const e=Co(t),r=t.globalName;return await po({url:e.toString(),globalName:r,reuseGlobal:!0,resolveGlobal:!0})}function Co(t){const{version:e=ao,baseUrl:r=co,file:n=so,settings:o}=t,a=new URL(`${r}${e}/${n}`);if(o==null)return a;const u=Po(o);return Object.entries(u).forEach(([i,c])=>{a.searchParams.set(i,c)}),a}const Uo="1",Kt=y.child("loader");async function Gt(t={}){t=Mt(t),Kt.debug("loading settings");const e=await jo(t);return e.global="SourceEmbedV"+(e.version??Uo).replace(/\./gi,""),Kt.debug("using settings:",e),await Ao({version:e.version,settings:e,globalName:e.global})}const Io=Gt();return b.load=Gt,b.ready=Io,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b}({});
//# sourceMappingURL=embed-loader.min.js.map
