1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/module-loader-helpers.js","chunks/index.js","chunks/icons.js","chunks/helpers.js","chunks/tslib.es6.js","chunks/graphql-types.js","chunks/action-types.js","chunks/x-mark-icon.js"])))=>i.map(i=>d[i]); 2import{a4 as O,r as _,a5 as S,a6 as D,a7 as U,a8 as B,_ as z,f as k,h as N,N as R,a9 as W}from"./module-loader-helpers.js";import{s as x}from"./action-types.js";import{g as q,s as H}from"./config-cache.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"df45a2833fe3e405be3bbf425ef6572b7793eda7"}}catch{}})();try{(function(){var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="82dca60a-a6c1-4f61-8bd7-6b74d3bfe03a",t._sentryDebugIdIdentifier="sentry-dbid-82dca60a-a6c1-4f61-8bd7-6b74d3bfe03a")})()}catch{}(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t._sentryModuleMetadata=t._sentryModuleMetadata||{},t._sentryModuleMetadata[new t.Error().stack]=(function(e){for(var a=1;a<arguments.length;a++){var o=arguments[a];if(o!=null)for(var r in o)o.hasOwnProperty(r)&&(e[r]=o[r])}return e})({},t._sentryModuleMetadata[new t.Error().stack],{"_sentryBundlerPluginAppKey:nutshell-peanut":!0})}catch{}})();const E=t=>{const{instanceId:e,loadedModules:a}=t,o=O(Number(e));document.body.appendChild(o),_(a,S)},F=t=>{const{chatConfig:e,isPreview:a,chatAgentsOnline:o,shouldInitWithEngagementBar:r,excludedModules:l,isChatAlreadyLoaded:s,currentPath:h}=t;if(!e||!(e.chatEnabled||a)||!(o||e.offlineFormEnabled||r)||l.includes("chat")||s)return!1;if(h&&e.disabledPaths&&e.disabledPaths.length>0){const g=i=>{const u=i.split("?")[0].split("#")[0].trim();try{return new URL(u).pathname}catch{try{return new URL("http://"+u).pathname}catch{return"/"}}},p=i=>i==="/"?"/":i.replace(/\/$/,""),b=p(g(h));if(e.disabledPaths.some(i=>{const u=p(g(i.trim()));return b===u||b.startsWith(u+"/")}))return!1}return!0},Q=async t=>{const{instanceId:e,siteId:a,target:o,excludedModules:r,loadedModules:l}=t;let s=e;_(l,W);const h=D(r),m=U(),I=m.hostname,g=encodeURIComponent(m.href),p=(document.querySelector(`#nutshell-boot-${e}`)||document.querySelector(`#nutshell-boot-${a}`))?.getAttribute("previewType"),b=p==="preview-onboarding",C=p==="preview-test",i=b||C,w=await(async()=>{const d=e||a||"";if(!i&&d){const n=q("boot_config",d);if(n){const c=n.config&&n.config.instanceId;return c&&!s&&(s=String(c)),n}}try{const n=e?`https://app.nutshell.com/boot/config/${e}?origin=${h}&domain=${I}&pageUrl=${g}`:`https://app.nutshell.com/boot/config-by-site-id?siteId=${a}&origin=${h}&domain=${I}&pageUrl=${g}`,c=await fetch(n);if(!c.ok)throw new Error(`HTTP error! status: ${c.status}`);const f=await c.json();try{const y=f&&f.config&&f.config.instanceId;y&&!s&&(s=String(y))}catch{}return!i&&d&&H("boot_config",d,f),f}catch(n){if(k(n))return;N({instanceId:s||e||a||"",peanutType:R,errorDescription:"Error fetching boot config",exception:n instanceof Error?n:new Error(String(n))})}})();if(w){const{chatConfig:d,chatbotConfig:n,actionsConfig:c,pusherConfig:f,chatAgentsOnline:y,defaultNudges:v}=w.config,T=l.includes(B),P=x(d?.appearanceChatVariant||"chat",d?.actionBarShownActions||[]),A=typeof window<"u"?window.location.href:void 0;if(F({chatConfig:d,isPreview:i,chatAgentsOnline:y,shouldInitWithEngagementBar:P,excludedModules:r,isChatAlreadyLoaded:T,currentPath:A})){const{initializeChat:M}=await z(async()=>{const{initializeChat:L}=await import("./chat-boot-initializer.js").then($=>$.c);return{initializeChat:L}},__vite__mapDeps([0,1,2,3,4,5,6,7]));await M({chatConfig:d,target:o,instanceId:s||e||"",pusherConfig:f,chatbotConfig:n,actionsConfig:c,isPreview:i,isOnboarding:b,isTest:C,loadedModules:l,defaultNudges:v,chatAgentsOnline:y})}}!r.includes("analytics")&&!i&&("requestIdleCallback"in window?requestIdleCallback(()=>{E({instanceId:s||e||"",loadedModules:l})}):setTimeout(()=>{E({instanceId:s||e||"",loadedModules:l})},100))};export{Q as initializeBoot}; 3//# sourceMappingURL=boot-initializer.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.