@brainfish-ai/widgets-initiator 1.13.0 → 1.13.3

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/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(function(){try{var e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="33855e45-5b53-4ae5-baa0-8338003b01cf",e._sentryDebugIdIdentifier="sentry-dbid-33855e45-5b53-4ae5-baa0-8338003b01cf")}catch(a){}})(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./web.cjs.js");exports.BrainfishAnalytics=t.BrainfishAnalytics,exports.default=t.default;
1
+ "use strict";!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f53e3bea-f8ba-4179-9d06-864e150e6376",e._sentryDebugIdIdentifier="sentry-dbid-f53e3bea-f8ba-4179-9d06-864e150e6376")}catch(s){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./web.cjs.js");exports.BrainfishAnalytics=e.BrainfishAnalytics,exports.default=e.default;
2
2
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.js CHANGED
@@ -1,13 +1,14 @@
1
- import { BrainfishAnalytics as t, default as r } from "./web.js";
2
- (function() {
1
+ ;
2
+ !function() {
3
3
  try {
4
- var e = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}, a = new e.Error().stack;
5
- a && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[a] = "7e7431ab-4824-42cc-8d1a-477faa64f6a0", e._sentryDebugIdIdentifier = "sentry-dbid-7e7431ab-4824-42cc-8d1a-477faa64f6a0");
6
- } catch (d) {
4
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "efb954f1-f1b0-4cc2-aaa7-5ac38d08dd34", e._sentryDebugIdIdentifier = "sentry-dbid-efb954f1-f1b0-4cc2-aaa7-5ac38d08dd34");
6
+ } catch (e2) {
7
7
  }
8
- })();
8
+ }();
9
+ import { BrainfishAnalytics, default as default2 } from "./web.js";
9
10
  export {
10
- t as BrainfishAnalytics,
11
- r as default
11
+ BrainfishAnalytics,
12
+ default2 as default
12
13
  };
13
14
  //# sourceMappingURL=index.js.map
@@ -2,4 +2,4 @@ import type { Brainfish } from './types/brainfish';
2
2
  import { BrainfishQueue } from './utils/brainfishQueue';
3
3
  declare const Brainfish: BrainfishQueue;
4
4
  export default Brainfish;
5
- export declare const BrainfishAnalytics: (method: string, ...args: any[]) => void;
5
+ export declare const BrainfishAnalytics: (...args: Parameters<typeof window.BrainfishAnalytics>) => void;
package/dist/web.cjs.js CHANGED
@@ -1,170 +1,2 @@
1
- "use strict";var Fe=Object.defineProperty,He=Object.defineProperties;var $e=Object.getOwnPropertyDescriptors;var me=Object.getOwnPropertySymbols;var Re=Object.prototype.hasOwnProperty,Ke=Object.prototype.propertyIsEnumerable;var L=(a,t,n)=>t in a?Fe(a,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[t]=n,F=(a,t)=>{for(var n in t||(t={}))Re.call(t,n)&&L(a,n,t[n]);if(me)for(var n of me(t))Ke.call(t,n)&&L(a,n,t[n]);return a},H=(a,t)=>He(a,$e(t));var A=(a,t,n)=>L(a,typeof t!="symbol"?t+"":t,n);var b=(a,t,n)=>new Promise((o,i)=>{var r=l=>{try{s(n.next(l))}catch(d){i(d)}},e=l=>{try{s(n.throw(l))}catch(d){i(d)}},s=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,e);s((n=n.apply(a,t)).next())});(function(){try{var a=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="2b98cff1-55f1-4560-a894-5d0b026284c8",a._sentryDebugIdIdentifier="sentry-dbid-2b98cff1-55f1-4560-a894-5d0b026284c8")}catch(n){}})(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class I extends Error{}function ze(a){let t=a.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(n){return decodeURIComponent(atob(n).replace(/(.)/g,(o,i)=>{let r=i.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(n){return atob(t)}}var E,z;I.prototype.name="InvalidTokenError",(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{}).SENTRY_RELEASE={id:"bd134520d7a38ae7e47e800f76bcadc8b4d42a81"},function(a){a.Sidebar="sidebar",a.Searchbar="searchbar",a.Popup="popup"}(E||(E={})),E.Sidebar,E.Searchbar,E.Popup;class le extends Error{constructor(n,o){super(n,o);A(this,"cause");this.name="BrainfishWidgetError",this.cause=o==null?void 0:o.cause,Error.captureStackTrace&&Error.captureStackTrace(this,le),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+`
2
- Caused by: `+this.cause.stack)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:this.cause}}}(function(a){a.LINK="link",a.CALLBACK="callback",a.EMAIL="email",a.PHONE="phone"})(z||(z={}));const x=(a,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(e){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,s,l)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const d=s.toJSON();fetch(`${e||"https://app.brainfi.sh"}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":l},body:JSON.stringify({error:`WebWidgetVersion: 1.13.0. ${s.message}`,stack:s.stack,cause:{message:d.message,stack:d.stack,cause:d.cause}})})})(a,new le(i,{cause:r}),o)},Ne=a=>b(exports,null,function*(){let{widgetKey:t,apiHost:n}=a;return function(o,i,r){return b(this,null,function*(){let e,s=0;for(;s<3;)try{const l=yield fetch(`${o}${i}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":r}});if(!l.ok)throw new Error(`API call failed with status: ${l.status}`);const d=yield l.json();if(!d)throw new Error("Error loading config: empty response");return d}catch(l){if(e=l,s++,s>=3)throw x(o,l,"Error fetching config",r),e;yield new Promise(d=>setTimeout(d,500))}})}(n,"/api/searchWidgets.getConfigByKey",t)}),Se=()=>{if(typeof window=="undefined")return;const a=window.navigator.userAgent;if(!(a.match(/iPad/i)||a.match(/iPhone/i)))return!1;const t=a.match(/OS (\d+)_/i);return t&&parseInt(t[1],10)<=14},qe=a=>{let{config:t,apiKey:n,apiHost:o}=a;const i=t.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(r=>{i[r]&&(i[r]=i[r].map(e=>e.type===z.CALLBACK&&e.value?H(F({},e),{value:new Function(`return ${e.value}`)()}):e))}),H(F({},t),{settings:i,apiHost:o,widgetMode:t.widgetType,apiKey:n})},ue=a=>(a==null?void 0:a.apiHost)||"https://app.brainfi.sh",$=Se(),De=a=>b(exports,null,function*(){let{apiHost:t,widgetKey:n,version:o}=a;try{const i=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${o}/dist/web.js`,r=$?i.replace("web.js","web.umd.js"):i;return{widget:yield(s=>b(exports,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((l,d)=>{const u=document.createElement("script");u.id="brainfish-widget",u.src=s,u.type=$?"text/javascript":"module",u.async=!0,u.crossOrigin="anonymous",u.onload=()=>{setTimeout(()=>{const f=window.Brainfish;f?l(f):d(new Error("Failed to load Brainfish module"))},200)},u.onerror=f=>{const c=f,h={message:`Failed to load script: ${s}`,type:c.type,fileName:c.filename,lineNumber:c.lineno,columnNumber:c.colno,error:c.error?c.error.toString():"Unknown error"};d(new Error(JSON.stringify(h)))},$||document.head.appendChild(u)})}))(r)}}catch(i){x(t,i,i.message,n)}}),be=new Set,Ue=(a,t)=>b(exports,null,function*(){const n=ue(a.overrides);try{if(be.has(a.widgetKey))return;const o=yield De({apiHost:n,widgetKey:a.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=qe({config:t,apiKey:a.widgetKey,apiHost:n});return a.overrides&&t.settings&&Object.entries(a.overrides).forEach(e=>{let[s,l]=e;t.settings&&s in t.settings&&(t.settings[s]=function(){let d=arguments.length>1?arguments[1]:void 0;const u=new Map((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(f=>[f.label,f]));return d.forEach(f=>u.set(f.label,f)),Array.from(u.values())}(t.settings[s],l))}),function(e,s){s.widgetType===E.Searchbar||s.widgetType==="Search"?e.SearchWidget.initStandard(s):e.HelpWidget.initPopup(s)}(i,r),be.add(a.widgetKey),i}}catch(o){x(n,o,o.message,a.widgetKey)}});let ve=!1;const Je=function(o,i,r){return b(this,arguments,function*(a,t,n){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",s=arguments.length>4&&arguments[4]!==void 0&&arguments[4],l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],d=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0;if(t||x(n,new Error("Access key is required"),"Access key is required",a),!ve)try{const f=(()=>{if(typeof window=="undefined"||typeof navigator=="undefined")return!1;const c=navigator,h=window,g=(c.doNotTrack||h.doNotTrack||c.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(g)})();window.BrainfishAnalytics("init",{apiUrl:e,accessKey:t,trackScreenViews:!0,trackAttributes:!f,trackOutgoingLinks:!f,enableRecording:!f&&s,recordingBlocklist:l,_allowLocalhostRecording:d,_allowScreenRecording:u}),ve=!0,yield((c,h)=>b(this,null,function*(){if(document.getElementById("brainfish-analytics"))return window.BrainfishAnalytics;const g=document.createElement("script");g.id="brainfish-analytics",g.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",g.type="module",g.async=!0,g.crossOrigin="anonymous",g.onerror=()=>{x(c,new Error(`Failed to load script: ${g.src}`),`Failed to load script: ${g.src}`,h)},document.head.appendChild(g)}))(n,a)}catch(f){x(n,f,"Failed to initialize BrainfishAnalytics",a)}})};function _(a,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=document.createElement(a);return o.className=t,Object.entries(n).forEach(i=>{let[r,e]=i;o.setAttribute(r,e)}),o}const j="bf-iframe-container",P="bf-trigger-button";class w{static get isWidgetOpen(){return this.isOpen}static initialize(t){var n,o;let{button:i,icon:r,isButtonHidden:e}=t;this.button=i||null,this.icon=r||null,this.isButtonHidden=e||!1,i&&i.addEventListener("click",()=>this.toggleIframeVisibility()),(n=window.Brainfish)!==null&&n!==void 0&&n.HelpWidget&&(window.Brainfish.HelpWidget.close=()=>this.closeWidget(),window.Brainfish.HelpWidget.open=()=>this.openWidget()),(o=window.Brainfish)!==null&&o!==void 0&&o.Widgets&&(window.Brainfish.Widgets.open=()=>this.openWidget(),window.Brainfish.Widgets.close=()=>this.closeWidget())}static toggleIframeVisibility(){this.isOpen=!this.isOpen,this.isOpen?this.openWidget():this.closeWidget()}static openWidget(){var t;this.isOpen=!0;const n=document.querySelector(".bf-iframe-container"),o=n==null?void 0:n.querySelector("iframe");if(n==null||n.classList.add("open"),n==null||n.setAttribute("aria-hidden","false"),o==null||(t=o.contentWindow)===null||t===void 0||t.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.button&&this.icon){const i=this.icon.querySelector(".fish-icon"),r=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),i.classList.remove("visible"),r.classList.add("visible"),document.body.clientWidth<=576&&this.hideTriggerButton()}window.dispatchEvent(new Event("onBrainfishWidgetOpen")),window.BrainfishAnalytics("track","Open Widget")}static closeWidget(){this.isOpen=!1;const t=document.querySelector(".bf-iframe-container");if(t==null||t.classList.remove("open"),t==null||t.setAttribute("aria-hidden","true"),this.button&&this.icon){this.button.setAttribute("aria-expanded","false");const n=this.icon.querySelector(".fish-icon"),o=this.icon.querySelector(".close-icon");n.classList.add("visible"),o.classList.remove("visible"),document.body.clientWidth<=576&&this.showTriggerButton()}window.dispatchEvent(new Event("onBrainfishWidgetClose")),window.BrainfishAnalytics("track","Close Widget")}static showTriggerButton(){var t;(t=this.button)===null||t===void 0||t.classList.remove("hidden")}static hideTriggerButton(){var t;(t=this.button)===null||t===void 0||t.classList.add("hidden")}}A(w,"isOpen",!1),A(w,"button",null),A(w,"icon",null),A(w,"isButtonHidden",!1);function Ye(a){let{widgetHost:t,apiHost:n,widgetKey:o,signal:i}=a;window.addEventListener("message",r=>{if(r.origin!==t)return;const{type:e}=r.data;if(e==="TOGGLE_WIDGET_SIZE"&&function(){const s=document.querySelector(`.${j}`);s.classList.contains("expanded")?s.classList.remove("expanded"):s.classList.add("expanded")}(),e==="TRACK_EVENT"){if(!window.BrainfishAnalytics)return;const{eventName:s,data:l}=r.data;window.BrainfishAnalytics("track",s,l)}if(e==="CLOSE_WIDGET"&&(window.BrainfishAnalytics("track","Close Widget"),w.toggleIframeVisibility()),e==="NEXT_BEST_ACTION_CLICKED"){const{action:s,searchQueryId:l,query:d,answer:u}=r.data,f={action:s,searchQueryId:l};if(!["function","callback"].includes(s.type))return void console.error("Invalid action type",s);if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[s.id])return void window.__bfCallbacks[s.id](d,u,f);const c=`${n}/api/searchWidgets.callback.codeblocks?apiKey=${o}&codeblockId=${s.id}`,h=document.createElement("script");h.src=c,document.head.appendChild(h),h.onload=()=>{window.__bfCallbacks[s.id](d,u,f),setTimeout(()=>{document.head.removeChild(h)},300)}}},{signal:i})}function ce(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var N={exports:{}},q={exports:{}},D={exports:{}};(function(a,t){function n(i){return Math.round(255*i)}function o(i,r,e){return n(i)+","+n(r)+","+n(e)}t.__esModule=!0,t.default=void 0,t.default=function(i,r,e,s){if(s===void 0&&(s=o),r===0)return s(e,e,e);var l=(i%360+360)%360/60,d=(1-Math.abs(2*e-1))*r,u=d*(1-Math.abs(l%2-1)),f=0,c=0,h=0;l>=0&&l<1?(f=d,c=u):l>=1&&l<2?(f=u,c=d):l>=2&&l<3?(c=d,h=u):l>=3&&l<4?(c=u,h=d):l>=4&&l<5?(f=u,h=d):l>=5&&l<6&&(f=d,h=u);var g=e-d/2;return s(f+g,c+g,h+g)},a.exports=t.default})(D,D.exports);var fe=D.exports,U={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0;var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};t.default=function(o){if(typeof o!="string")return o;var i=o.toLowerCase();return n[i]?"#"+n[i]:o},a.exports=t.default})(U,U.exports);var Ge=U.exports,J={exports:{}};(function(a,t){function n(l){var d=typeof Map=="function"?new Map:void 0;return n=function(u){if(u===null||!function(c){try{return Function.toString.call(c).indexOf("[native code]")!==-1}catch(h){return typeof c=="function"}}(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(d!==void 0){if(d.has(u))return d.get(u);d.set(u,f)}function f(){return function(c,h,g){if(o())return Reflect.construct.apply(null,arguments);var p=[null];p.push.apply(p,h);var m=new(c.bind.apply(c,p));return g&&i(m,g.prototype),m}(u,arguments,r(this).constructor)}return f.prototype=Object.create(u.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),i(f,u)},n(l)}function o(){try{var l=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(d){}return(o=function(){return!!l})()}function i(l,d){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,f){return u.__proto__=f,u},i(l,d)}function r(l){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},r(l)}t.__esModule=!0,t.default=void 0;var e={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).
3
-
4
- `,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).
5
-
6
- `,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.
7
-
8
- `,4:`Couldn't generate valid rgb string from %s, it returned %s.
9
-
10
- `,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.
11
-
12
- `,6:`Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).
13
-
14
- `,7:`Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).
15
-
16
- `,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.
17
-
18
- `,9:`Please provide a number of steps to the modularScale helper.
19
-
20
- `,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
21
-
22
- `,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"
23
-
24
- `,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.
25
-
26
- `,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.
27
-
28
- `,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.
29
-
30
- `,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.
31
-
32
- `,16:`You must provide a template to this method.
33
-
34
- `,17:`You passed an unsupported selector state to this method.
35
-
36
- `,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.
37
-
38
- `,19:`fromSize and toSize must be provided as stringified numbers with the same units.
39
-
40
- `,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
41
-
42
- `,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.
43
-
44
- `,24:`fontFace expects either the path to the font file(s) or a name of a local copy.
45
-
46
- `,25:`fontFace expects localFonts to be an array.
47
-
48
- `,26:`fontFace expects fileFormats to be an array.
49
-
50
- `,27:`radialGradient requries at least 2 color-stops to properly render.
51
-
52
- `,28:`Please supply a filename to retinaImage() as the first argument.
53
-
54
- `,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
55
-
56
- `,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation
57
-
58
- `,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
59
- To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')
60
-
61
- `,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation
62
-
63
- `,34:`borderRadius expects a radius value as a string or number as the second argument.
64
-
65
- `,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
66
-
67
- `,36:`Property must be a string value.
68
-
69
- `,37:`Syntax Error at %s.
70
-
71
- `,38:`Formula contains a function that needs parentheses at %s.
72
-
73
- `,39:`Formula is missing closing parenthesis at %s.
74
-
75
- `,40:`Formula has too many closing parentheses at %s.
76
-
77
- `,41:`All values in a formula must have the same unit or be unitless.
78
-
79
- `,42:`Please provide a number of steps to the modularScale helper.
80
-
81
- `,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
82
-
83
- `,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.
84
-
85
- `,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.
86
-
87
- `,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.
88
-
89
- `,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.
90
-
91
- `,48:`fromSize and toSize must be provided as stringified numbers with the same units.
92
-
93
- `,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
94
-
95
- `,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.
96
-
97
- `,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.
98
-
99
- `,52:`fontFace expects either the path to the font file(s) or a name of a local copy.
100
-
101
- `,53:`fontFace expects localFonts to be an array.
102
-
103
- `,54:`fontFace expects fileFormats to be an array.
104
-
105
- `,55:`fontFace expects a name of a font-family.
106
-
107
- `,56:`linearGradient requries at least 2 color-stops to properly render.
108
-
109
- `,57:`radialGradient requries at least 2 color-stops to properly render.
110
-
111
- `,58:`Please supply a filename to retinaImage() as the first argument.
112
-
113
- `,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
114
-
115
- `,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.
116
-
117
- `,62:`borderRadius expects a radius value as a string or number as the second argument.
118
-
119
- `,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
120
-
121
- `,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.
122
-
123
- `,65:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').
124
-
125
- `,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.
126
-
127
- `,67:`You must provide a template to this method.
128
-
129
- `,68:`You passed an unsupported selector state to this method.
130
-
131
- `,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.
132
-
133
- `,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.
134
-
135
- `,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.
136
-
137
- `,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.
138
-
139
- `,73:`Please provide a valid CSS variable.
140
-
141
- `,74:`CSS variable not found and no default was provided.
142
-
143
- `,75:`important requires a valid style object, got a %s instead.
144
-
145
- `,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.
146
-
147
- `,77:`remToPx expects a value in "rem" but you provided it in "%s".
148
-
149
- `,78:`base must be set in "px" or "%" but you set it in "%s".
150
- `};function s(){for(var l=arguments.length,d=new Array(l),u=0;u<l;u++)d[u]=arguments[u];var f,c=d[0],h=[];for(f=1;f<d.length;f+=1)h.push(d[f]);return h.forEach(function(g){c=c.replace(/%[a-z]/,g)}),c}t.default=function(l){var d,u;function f(c){var h;if(process.env.NODE_ENV==="production")h=l.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+c+" for more information.")||this;else{for(var g=arguments.length,p=new Array(g>1?g-1:0),m=1;m<g;m++)p[m-1]=arguments[m];h=l.call(this,s.apply(void 0,[e[c]].concat(p)))||this}return function(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}(h)}return u=l,(d=f).prototype=Object.create(u.prototype),d.prototype.constructor=d,i(d,u),f}(n(Error)),a.exports=t.default})(J,J.exports);var B=J.exports;(function(a,t){t.__esModule=!0,t.default=function(g){if(typeof g!="string")throw new i.default(3);var p=(0,o.default)(g);if(p.match(e))return{red:parseInt(""+p[1]+p[2],16),green:parseInt(""+p[3]+p[4],16),blue:parseInt(""+p[5]+p[6],16)};if(p.match(s)){var m=parseFloat((parseInt(""+p[7]+p[8],16)/255).toFixed(2));return{red:parseInt(""+p[1]+p[2],16),green:parseInt(""+p[3]+p[4],16),blue:parseInt(""+p[5]+p[6],16),alpha:m}}if(p.match(l))return{red:parseInt(""+p[1]+p[1],16),green:parseInt(""+p[2]+p[2],16),blue:parseInt(""+p[3]+p[3],16)};if(p.match(d)){var v=parseFloat((parseInt(""+p[4]+p[4],16)/255).toFixed(2));return{red:parseInt(""+p[1]+p[1],16),green:parseInt(""+p[2]+p[2],16),blue:parseInt(""+p[3]+p[3],16),alpha:v}}var y=u.exec(p);if(y)return{red:parseInt(""+y[1],10),green:parseInt(""+y[2],10),blue:parseInt(""+y[3],10)};var S=f.exec(p.substring(0,50));if(S)return{red:parseInt(""+S[1],10),green:parseInt(""+S[2],10),blue:parseInt(""+S[3],10),alpha:parseFloat(""+S[4])>1?parseFloat(""+S[4])/100:parseFloat(""+S[4])};var O=c.exec(p);if(O){var Te=parseInt(""+O[1],10),We=parseInt(""+O[2],10)/100,Me=parseInt(""+O[3],10)/100,ge="rgb("+(0,n.default)(Te,We,Me)+")",T=u.exec(ge);if(!T)throw new i.default(4,p,ge);return{red:parseInt(""+T[1],10),green:parseInt(""+T[2],10),blue:parseInt(""+T[3],10)}}var k=h.exec(p.substring(0,50));if(k){var je=parseInt(""+k[1],10),Pe=parseInt(""+k[2],10)/100,Le=parseInt(""+k[3],10)/100,he="rgb("+(0,n.default)(je,Pe,Le)+")",W=u.exec(he);if(!W)throw new i.default(4,p,he);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+k[4])>1?parseFloat(""+k[4])/100:parseFloat(""+k[4])}}throw new i.default(5)};var n=r(fe),o=r(Ge),i=r(B);function r(g){return g&&g.__esModule?g:{default:g}}var e=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,l=/^#[a-fA-F0-9]{3}$/,d=/^#[a-fA-F0-9]{4}$/,u=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,f=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,c=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,h=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;a.exports=t.default})(q,q.exports);var pe=q.exports;(function(a,t){t.__esModule=!0,t.default=function(i){if(i==="transparent")return 0;var r=(0,o.default)(i),e=Object.keys(r).map(function(u){var f=r[u]/255;return f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4)}),s=e[0],l=e[1],d=e[2];return parseFloat((.2126*s+.7152*l+.0722*d).toFixed(3))};var n,o=(n=pe)&&n.__esModule?n:{default:n};a.exports=t.default})(N,N.exports);const Ve=ce(N.exports);var Y={exports:{}},G={exports:{}};(function(a,t){function n(o,i,r){return function(){var e=r.concat(Array.prototype.slice.call(arguments));return e.length>=i?o.apply(this,e):n(o,i,e)}}t.__esModule=!0,t.default=function(o){return n(o,o.length,[])},a.exports=t.default})(G,G.exports);var ke=G.exports,V={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n,o,i){return Math.max(n,Math.min(o,i))},a.exports=t.default})(V,V.exports);var _e=V.exports,Z={exports:{}},Q={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n){var o,i=n.red/255,r=n.green/255,e=n.blue/255,s=Math.max(i,r,e),l=Math.min(i,r,e),d=(s+l)/2;if(s===l)return n.alpha!==void 0?{hue:0,saturation:0,lightness:d,alpha:n.alpha}:{hue:0,saturation:0,lightness:d};var u=s-l,f=d>.5?u/(2-s-l):u/(s+l);switch(s){case i:o=(r-e)/u+(r<e?6:0);break;case r:o=(e-i)/u+2;break;default:o=(i-r)/u+4}return o*=60,n.alpha!==void 0?{hue:o,saturation:f,lightness:d,alpha:n.alpha}:{hue:o,saturation:f,lightness:d}},a.exports=t.default})(Q,Q.exports);var Ze=Q.exports;(function(a,t){t.__esModule=!0,t.default=function(r){return(0,o.default)((0,n.default)(r))};var n=i(pe),o=i(Ze);function i(r){return r&&r.__esModule?r:{default:r}}a.exports=t.default})(Z,Z.exports);var Ce=Z.exports,X={exports:{}},ee={exports:{}},te={exports:{}},ne={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n){return n.length===7&&n[1]===n[2]&&n[3]===n[4]&&n[5]===n[6]?"#"+n[1]+n[3]+n[5]:n},a.exports=t.default})(ne,ne.exports);var Ee=ne.exports,re={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n){var o=n.toString(16);return o.length===1?"0"+o:o},a.exports=t.default})(re,re.exports);var Ae=re.exports;(function(a,t){t.__esModule=!0,t.default=void 0;var n=r(fe),o=r(Ee),i=r(Ae);function r(l){return l&&l.__esModule?l:{default:l}}function e(l){return(0,i.default)(Math.round(255*l))}function s(l,d,u){return(0,o.default)("#"+e(l)+e(d)+e(u))}t.default=function(l,d,u){return(0,n.default)(l,d,u,s)},a.exports=t.default})(te,te.exports);var Be=te.exports;(function(a,t){t.__esModule=!0,t.default=function(r,e,s){if(typeof r=="number"&&typeof e=="number"&&typeof s=="number")return(0,n.default)(r,e,s);if(typeof r=="object"&&e===void 0&&s===void 0)return(0,n.default)(r.hue,r.saturation,r.lightness);throw new o.default(1)};var n=i(Be),o=i(B);function i(r){return r&&r.__esModule?r:{default:r}}a.exports=t.default})(ee,ee.exports);var Qe=ee.exports,ae={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,s,l,d){if(typeof e=="number"&&typeof s=="number"&&typeof l=="number"&&typeof d=="number")return d>=1?(0,n.default)(e,s,l):"rgba("+(0,o.default)(e,s,l)+","+d+")";if(typeof e=="object"&&s===void 0&&l===void 0&&d===void 0)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,o.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new i.default(2)};var n=r(Be),o=r(fe),i=r(B);function r(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(ae,ae.exports);var Xe=ae.exports,ie={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,s,l){if(typeof e=="number"&&typeof s=="number"&&typeof l=="number")return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(s)+(0,o.default)(l));if(typeof e=="object"&&s===void 0&&l===void 0)return(0,n.default)("#"+(0,o.default)(e.red)+(0,o.default)(e.green)+(0,o.default)(e.blue));throw new i.default(6)};var n=r(Ee),o=r(Ae),i=r(B);function r(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(ie,ie.exports);var Ie=ie.exports,oe={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,s,l,d){if(typeof e=="string"&&typeof s=="number"){var u=(0,n.default)(e);return"rgba("+u.red+","+u.green+","+u.blue+","+s+")"}if(typeof e=="number"&&typeof s=="number"&&typeof l=="number"&&typeof d=="number")return d>=1?(0,o.default)(e,s,l):"rgba("+e+","+s+","+l+","+d+")";if(typeof e=="object"&&s===void 0&&l===void 0&&d===void 0)return e.alpha>=1?(0,o.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new i.default(7)};var n=r(pe),o=r(Ie),i=r(B);function r(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(oe,oe.exports);var et=oe.exports;(function(a,t){t.__esModule=!0,t.default=function(c){if(typeof c!="object")throw new e.default(8);if(d(c))return(0,r.default)(c);if(l(c))return(0,i.default)(c);if(f(c))return(0,o.default)(c);if(u(c))return(0,n.default)(c);throw new e.default(8)};var n=s(Qe),o=s(Xe),i=s(Ie),r=s(et),e=s(B);function s(c){return c&&c.__esModule?c:{default:c}}var l=function(c){return typeof c.red=="number"&&typeof c.green=="number"&&typeof c.blue=="number"&&(typeof c.alpha!="number"||c.alpha===void 0)},d=function(c){return typeof c.red=="number"&&typeof c.green=="number"&&typeof c.blue=="number"&&typeof c.alpha=="number"},u=function(c){return typeof c.hue=="number"&&typeof c.saturation=="number"&&typeof c.lightness=="number"&&(typeof c.alpha!="number"||c.alpha===void 0)},f=function(c){return typeof c.hue=="number"&&typeof c.saturation=="number"&&typeof c.lightness=="number"&&typeof c.alpha=="number"};a.exports=t.default})(X,X.exports);var Oe=X.exports;(function(a,t){t.__esModule=!0,t.default=void 0;var n=e(ke),o=e(_e),i=e(Ce),r=e(Oe);function e(d){return d&&d.__esModule?d:{default:d}}function s(){return s=Object.assign?Object.assign.bind():function(d){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(d[c]=f[c])}return d},s.apply(this,arguments)}var l=(0,n.default)(function(d,u){if(u==="transparent")return u;var f=(0,i.default)(u);return(0,r.default)(s({},f,{lightness:(0,o.default)(0,1,f.lightness-parseFloat(d))}))});t.default=l,a.exports=t.default})(Y,Y.exports);const tt=ce(Y.exports);var se={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0;var n=e(ke),o=e(_e),i=e(Ce),r=e(Oe);function e(d){return d&&d.__esModule?d:{default:d}}function s(){return s=Object.assign?Object.assign.bind():function(d){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var c in f)Object.prototype.hasOwnProperty.call(f,c)&&(d[c]=f[c])}return d},s.apply(this,arguments)}var l=(0,n.default)(function(d,u){if(u==="transparent")return u;var f=(0,i.default)(u);return(0,r.default)(s({},f,{lightness:(0,o.default)(0,1,f.lightness+parseFloat(d))}))});t.default=l,a.exports=t.default})(se,se.exports);const nt=ce(se.exports);function rt(a){if(!document.querySelector("style[data-widget-styles]")){var t,n;(function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#000",i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"FFF";const r=document.createElement("style");r.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const e=Ve(o)>.5;r.textContent=`
151
- .bf-trigger-button{position:fixed;bottom:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;box-shadow:0 1px 6px #0000000f,0 2px 32px #00000029;transition:transform 167ms cubic-bezier(.33,0,0,1);box-sizing:content-box;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon .fish-icon{display:none}.trigger-button-icon .fish-icon.visible{display:block}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0)}.bf-iframe-container{display:none;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:100vh;border:none;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out}.bf-iframe-container.open{display:block;opacity:1;transform:translateY(0);pointer-events:auto;top:0;left:0}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #D4D4D4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.iframe-loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:10}.spinner{width:24px;height:24px;border:2px solid rgba(0,0,0,.1);border-radius:50%;border-top-color:#3498db;animation:spin 1s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-error{width:24px;height:24px;position:relative;display:flex;align-items:center;justify-content:center}.loading-error:before,.loading-error:after{content:"";position:absolute;width:16px;height:2px;background-color:#e74c3c;border-radius:2px}.loading-error:before{transform:rotate(45deg)}.loading-error:after{transform:rotate(-45deg)}
152
- .${P} { background: ${o}; }
153
- .${P}:hover {
154
- background: ${e?tt(.05,o):nt(.05,o)};
155
- }
156
- .trigger-button-icon { color: ${i}; }
157
- `,document.head.appendChild(r)})((a==null||(t=a.theme)===null||t===void 0?void 0:t.inputButtonBgColor)||"#007bff",(a==null||(n=a.theme)===null||n===void 0?void 0:n.textBaseColor)||"#ffffff")}}function at(a,t){const n=()=>{(o=>{var i;(i=a.contentWindow)===null||i===void 0||i.postMessage({type:"UPDATE_BODY_CLASS",isDarkMode:o},"*")})(document.body.classList.contains("dark"))};n(),(()=>{const o=new MutationObserver(n);o.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t.addEventListener("abort",()=>o.disconnect())})()}function it(a,t){let n;const o=()=>{(r=>{var e;const s={type:"UPDATE_BODY_CLASS",isMobile:r};(e=a.contentWindow)===null||e===void 0||e.postMessage(s,"*"),r&&(w.isWidgetOpen?w.hideTriggerButton():w.showTriggerButton())})(document.body.clientWidth<=576)},i=()=>{n&&clearTimeout(n),n=window.setTimeout(o,300)};o(),(()=>{const r=new ResizeObserver(i);r.observe(document.body),t.addEventListener("abort",()=>r.disconnect())})()}function R(a){const t=new TextEncoder().encode(a);if(typeof window!="undefined"&&typeof window.btoa=="function"){const n=Array.from(t,o=>String.fromCharCode(o)).join("");return btoa(n)}if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64");throw new Error("[utils.base64Encode]: Unsupported environment")}const ye=new Set;function ot(a,t,n){let{isButtonHidden:o,triggerButtonIcon:i}=n;const r=document.createDocumentFragment();if(o)w.initialize({isButtonHidden:o});else{const{button:l,icon:d}=function(u,f){const c=_("button",P,{id:`trigger-button-${u}`,"aria-controls":j,"aria-expanded":"false","data-name":P}),h=_("div","trigger-button-icon",{"aria-hidden":"true"});return h.innerHTML=f?`
158
- <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
159
- <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>
160
- </svg>
161
- <img src="${f}" class="fish-icon visible" alt="Trigger button icon" height="32" width="32" aria-hidden="true" aria-label="help button icon" />
162
- `:`
163
- <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
164
- <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>
165
- </svg>
166
- <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">
167
- <path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>
168
- </svg>
169
- `,c.setAttribute("aria-label","Open Brainfish widget"),c.appendChild(h),{button:c,icon:h}}(a,i);r.appendChild(l),w.initialize({button:l,icon:d})}const{iframeContainer:e,iframe:s}=function(l){const d=_("div",j,{id:j,"aria-live":"polite","aria-hidden":"true"}),u=_("div","iframe-loading-indicator"),f=_("div","spinner");u.setAttribute("aria-label","Loading content"),u.setAttribute("role","status"),u.appendChild(f),d.appendChild(u);const c=_("iframe","trigger-iframe",{src:l,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{u.style.display="none",c.style.opacity="1"}),c.addEventListener("error",h=>{console.error("Error loading iframe:",h),u.innerHTML="";const g=_("div","loading-error");u.appendChild(g),u.setAttribute("aria-label","Failed to load content")}),d.appendChild(c),{iframeContainer:d,iframe:c}}(t);return r.appendChild(e),{fragment:r,iframe:s}}const st=(a,t)=>{var n;const o=ue(a.overrides),i=((r=a.overrides)==null?void 0:r.widgetHost)||"https://agent.brainfi.sh";var r;const{theme:e,settings:s}=t,l=R(JSON.stringify((n=a.overrides)===null||n===void 0?void 0:n.redirectRules)),d=`${i}/?widgetKey=${a.widgetKey}#${new URLSearchParams({theme:R(JSON.stringify(e)),settings:R(JSON.stringify(s)),redirectRules:l}).toString()}`,u=s==null?void 0:s.hideTriggerButton,f=s==null?void 0:s.triggerButtonIcon;try{if(c=a.widgetKey,ye.has(c)||function(y){return!!document.getElementById(`trigger-button-${y}`)}(a.widgetKey))return;rt(t);const{fragment:h,iframe:g}=ot(a.widgetKey,d,{isButtonHidden:u||!1,triggerButtonIcon:f||""}),p=new AbortController,{signal:m}=p;g.onload=()=>{setTimeout(()=>{at(g,m),Ye({widgetHost:i,apiHost:o,widgetKey:a.widgetKey,signal:m}),it(g,m)},0)},document.body.appendChild(h),ye.add(a.widgetKey);const v=()=>{p.abort(),window.removeEventListener("beforeunload",v)};return void window.addEventListener("beforeunload",v)}catch(h){(function(g,p,m){x(g,p,p.message,m)})(o,h,a.widgetKey)}var c};var de=(a=>(a.FRESHCHAT="freshchat",a.INTERCOM="intercom",a.ZENDESK="zendesk",a.HELPSCOUT="helpscout",a))(de||{});const dt=a=>b(exports,null,function*(){if(a.widgetType===E.Popup){const t=window.fcWidget?de.FRESHCHAT:null;t&&t===de.FRESHCHAT&&(yield b(exports,null,function*(){window.fcWidget||(yield new Promise(n=>setTimeout(n,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),we="brainfish-nudges",xe=Se(),lt=(a,t)=>b(exports,null,function*(){try{yield((n,o)=>b(exports,null,function*(){if(document.getElementById(we))return;const i=document.createElement("script");i.id=we,i.src=`https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.${xe?"umd":"es"}.js`,i.type=xe?"text/javascript":"module",i.async=!0,i.crossOrigin="anonymous",i.onerror=()=>{x(n,new Error(`Failed to load script: ${i.src}`),`Failed to load script: ${i.src}`,o)},document.head.appendChild(i)}))(a,t)}catch(n){x(a,n,"Failed to initialize Nudge widget",t)}});let M=null;const C=typeof window!="undefined"&&window.Brainfish?window.Brainfish:(M||(M=function(){let a=[],t=null;function n(i,r){if(t){const e=i.split(".");let s=t;for(let d=0;d<e.length-1;d++)s=s[e[d]];const l=s[e[e.length-1]];if(typeof l=="function")return l.apply(s,r)}else a.push([i,r])}return{Widgets:{init:function(){for(var i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return n("Widgets.init",r)},identify:function(){for(var i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return n("Widgets.identify",r)},setSignedAttributes:function(){for(var i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return n("Widgets.setSignedAttributes",r)},open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),isReady:!1},SearchWidget:{initStandard:function(){for(var i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return n("SearchWidget.initStandard",r)}},HelpWidget:{initPopup:function(){for(var i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return n("HelpWidget.initPopup",r)},close:function(){for(var i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return n("HelpWidget.close",r)},open:function(){for(var i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return n("HelpWidget.open",r)},toggle:function(){for(var i=arguments.length,r=new Array(i),e=0;e<i;e++)r[e]=arguments[e];return n("HelpWidget.toggle",r)}},_setRealBrainfish:function(i){for(t=i;a.length>0;){const[r,e]=a.shift();n(r,e)}}}}(),typeof window!="undefined"&&(window.Brainfish=M)),M);let K=null;C.Widgets.isReady=!1,C.Widgets.identify=a=>{window.BrainfishAnalytics("identify",a)},C.Widgets.setSignedAttributes=a=>{try{(function(n,o){if(typeof n!="string")throw new I("Invalid token specified: must be a string");o||(o={});const i=o.header===!0?0:1,r=n.split(".")[i];if(typeof r!="string")throw new I(`Invalid token specified: missing part #${i+1}`);let e;try{e=ze(r)}catch(s){throw new I(`Invalid token specified: invalid base64 for part #${i+1} (${s.message})`)}try{return JSON.parse(e)}catch(s){throw new I(`Invalid token specified: invalid json for part #${i+1} (${s.message})`)}})(a)}catch(n){return void console.error("[Brainfish] Invalid JWT provided to setSignedAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SIGNED_ATTRIBUTES",jwt:a},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},C.Widgets.init=a=>b(exports,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(){for(var r=arguments.length,e=new Array(r),s=0;s<r;s++)e[s]=arguments[s];(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=ue(a.overrides),n=((o=a.overrides)==null?void 0:o.analyticsApiHost)||"";var o;let i;if(a.config)i=JSON.parse((r=>{if(typeof window!="undefined"&&typeof window.atob=="function"){const e=atob(r),s=e.length,l=new Uint8Array(s);for(let d=0;d<s;d++)l[d]=e.charCodeAt(d);return new TextDecoder().decode(l)}if(typeof Buffer!="undefined")return Buffer.from(r,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")})(a.config));else{const{config:r}=yield Ne({widgetKey:a.widgetKey,apiHost:t});i=r}K||(K=function(r,e,s,l){return b(this,null,function*(){var d,u,f,c,h,g;const p=((d=r.overrides)===null||d===void 0?void 0:d.enableRecording)||(e==null||(u=e.settings)===null||u===void 0?void 0:u.enableRecording)||!1,m=((f=r.overrides)===null||f===void 0?void 0:f.version)||(e==null?void 0:e.version),v=[];m!=null&&m.startsWith("2.")?st(r,e):v.push(Ue(r,e)),v.push(Je(r.widgetKey,e.trackingToken||"",s,l,p,(e==null||(c=e.settings)===null||c===void 0?void 0:c.recordingBlocklist)||[],e==null||(h=e.settings)===null||h===void 0?void 0:h._allowLocalhostRecording,e==null||(g=e.settings)===null||g===void 0?void 0:g._allowScreenRecording)),v.push(lt(s,r.widgetKey));const[y]=yield Promise.allSettled(v);y&&y.status==="fulfilled"&&y.value&&C._setRealBrainfish(y.value)})}(a,i,t,n)),yield K,yield dt(i),C.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))});exports.BrainfishAnalytics=function(){typeof window!="undefined"&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...arguments)},exports.default=C;
1
+ "use strict";var e,t,n,r,i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,u=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&u(e,n,t[n]);if(s)for(var n of s(t))d.call(t,n)&&u(e,n,t[n]);return e},f=(e,t)=>o(e,a(t)),p=(e,t,n)=>u(e,"symbol"!=typeof t?t+"":t,n),g=(e,t,n)=>new Promise((r,i)=>{var o=e=>{try{s(n.next(e))}catch(t){i(t)}},a=e=>{try{s(n.throw(e))}catch(t){i(t)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())});!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="76ef3bde-19bb-40c3-9a2d-8b3b9be2e244",e._sentryDebugIdIdentifier="sentry-dbid-76ef3bde-19bb-40c3-9a2d-8b3b9be2e244")}catch(n){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class h extends Error{}function b(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(n){return atob(t)}}h.prototype.name="InvalidTokenError",("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"06dbf75fbc795d0ab939f089be07de1c0e11ea76"},(t=e||(e={})).Sidebar="sidebar",t.Searchbar="searchbar",t.Popup="popup",e.Sidebar,e.Searchbar,e.Popup;class m extends Error{constructor(e,t){super(e,t),p(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,m),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+"\nCaused by: "+this.cause.stack)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:this.cause}}}(r=n||(n={})).LINK="link",r.CALLBACK="callback",r.EMAIL="email",r.PHONE="phone";const y=(e,t,n,r)=>{let i=n,o={};if(t instanceof Error)try{o=JSON.parse(t.message),i+=` - ${o.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const r=t.toJSON();fetch(`${e||"https://app.brainfi.sh"}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify({error:`WebWidgetVersion: 1.13.3. ${t.message}`,stack:t.stack,cause:{message:r.message,stack:r.stack,cause:r.cause}})})})(e,new m(i,{cause:o}),r)};const v=e=>g(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return g(this,null,function*(){let r,i=0;for(;i<3;)try{const r=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!r.ok)throw new Error(`API call failed with status: ${r.status}`);const i=yield r.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(o){if(r=o,i++,i>=3)throw y(e,o,"Error fetching config",n),r;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),w=({config:e,apiKey:t,apiHost:r})=>{const i=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{i[e]&&(i[e]=i[e].map(e=>e.type===n.CALLBACK&&e.value?f(c({},e),{value:new Function(`return ${e.value}`)()}):e))}),f(c({},e),{settings:i,apiHost:r,widgetMode:e.widgetType,apiKey:t})},x=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",S=e=>g(null,[e],function*({apiHost:e,widgetKey:t,version:n}){try{const e=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${n}/dist/web.js`,t=yield(e=>g(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const r=document.createElement("script");r.id="brainfish-widget",r.src=e,r.type="module",r.async=!0,r.crossOrigin="anonymous",r.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},r.onerror=t=>{const r=t,i={message:`Failed to load script: ${e}`,type:r.type,fileName:r.filename,lineNumber:r.lineno,columnNumber:r.colno,error:r.error?r.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(r)})}))(e);return{widget:t}}catch(r){y(e,r,r.message,t)}});const k=new Set,_=(t,n)=>g(null,null,function*(){const r=x(t.overrides);try{if(k.has(t.widgetKey))return;const i=yield S({apiHost:r,widgetKey:t.widgetKey,version:n.version||"latest"});if(i){const{widget:o}=i,a=w({config:n,apiKey:t.widgetKey,apiHost:r});return t.overrides&&n.settings&&Object.entries(t.overrides).forEach(([e,t])=>{n.settings&&e in n.settings&&(n.settings[e]=((e=[],t)=>{const n=new Map(e.map(e=>[e.label,e]));return t.forEach(e=>n.set(e.label,e)),Array.from(n.values())})(n.settings[e],t))}),function(t,n){n.widgetType===e.Searchbar||"Search"===n.widgetType?t.SearchWidget.initStandard(n):t.HelpWidget.initPopup(n)}(o,a),k.add(t.widgetKey),o}}catch(i){y(r,i,i.message,t.widgetKey)}});let E=!1;const C=(e,t,n,...r)=>g(null,[e,t,n,...r],function*(e,t,n,r="",i=!1,o=[],a,s){if(t||y(n,new Error("Access key is required"),"Access key is required",e),!E)try{const l=(()=>{if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator,t=window,n=(e.doNotTrack||t.doNotTrack||e.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(n)})();window.BrainfishAnalytics("init",{apiUrl:r,accessKey:t,trackScreenViews:!0,trackAttributes:!l,trackOutgoingLinks:!l,enableRecording:!l&&i,recordingBlocklist:o,_allowLocalhostRecording:a,_allowScreenRecording:s}),E=!0,yield((e,t)=>g(null,null,function*(){if(document.getElementById("brainfish-analytics"))return window.BrainfishAnalytics;const n=document.createElement("script");n.id="brainfish-analytics",n.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",n.type="module",n.async=!0,n.crossOrigin="anonymous",n.onerror=()=>{y(e,new Error(`Failed to load script: ${n.src}`),`Failed to load script: ${n.src}`,t)},document.head.appendChild(n)}))(n,e)}catch(l){y(n,l,"Failed to initialize BrainfishAnalytics",e)}});function B(e,t,n={}){const r=document.createElement(e);return r.className=t,Object.entries(n).forEach(([e,t])=>{r.setAttribute(e,t)}),r}const O="bf-iframe-container",I="bf-trigger-button";class A{static get isWidgetOpen(){return this.isOpen}static initialize({button:e,icon:t,isButtonHidden:n}){var r,i;this.button=e||null,this.icon=t||null,this.isButtonHidden=n||!1,e&&e.addEventListener("click",()=>this.toggleIframeVisibility()),(null==(r=window.Brainfish)?void 0:r.HelpWidget)&&(window.Brainfish.HelpWidget.close=()=>this.closeWidget(),window.Brainfish.HelpWidget.open=()=>this.openWidget()),(null==(i=window.Brainfish)?void 0:i.Widgets)&&(window.Brainfish.Widgets.open=()=>this.openWidget(),window.Brainfish.Widgets.close=()=>this.closeWidget())}static toggleIframeVisibility(){this.isOpen=!this.isOpen,this.isOpen?this.openWidget():this.closeWidget()}static openWidget(){var e;this.isOpen=!0;const t=document.querySelector(".bf-iframe-container"),n=null==t?void 0:t.querySelector("iframe");if(null==t||t.classList.add("open"),null==t||t.setAttribute("aria-hidden","false"),null==(e=null==n?void 0:n.contentWindow)||e.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.button&&this.icon){const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),e.classList.remove("visible"),t.classList.add("visible"),document.body.clientWidth<=576&&this.hideTriggerButton()}window.dispatchEvent(new Event("onBrainfishWidgetOpen")),window.BrainfishAnalytics("track","Open Widget")}static closeWidget(){this.isOpen=!1;const e=document.querySelector(".bf-iframe-container");if(null==e||e.classList.remove("open"),null==e||e.setAttribute("aria-hidden","true"),this.button&&this.icon){this.button.setAttribute("aria-expanded","false");const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");e.classList.add("visible"),t.classList.remove("visible"),document.body.clientWidth<=576&&this.showTriggerButton()}window.dispatchEvent(new Event("onBrainfishWidgetClose")),window.BrainfishAnalytics("track","Close Widget")}static showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}static hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}}function T({widgetHost:e,apiHost:t,widgetKey:n,signal:r}){window.addEventListener("message",r=>{if(r.origin!==e)return;const{type:i}=r.data;if("TOGGLE_WIDGET_SIZE"===i&&function(){const e=document.querySelector(`.${O}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"TRACK_EVENT"===i){if(!window.BrainfishAnalytics)return;const{eventName:e,data:t}=r.data;window.BrainfishAnalytics("track",e,t)}if("CLOSE_WIDGET"===i&&(window.BrainfishAnalytics("track","Close Widget"),A.toggleIframeVisibility()),"NEXT_BEST_ACTION_CLICKED"===i){const{action:e,searchQueryId:i,query:o,answer:a}=r.data,s={action:e,searchQueryId:i};if(!["function","callback"].includes(e.type))return void console.error("Invalid action type",e);if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](o,a,s);const l=`${t}/api/searchWidgets.callback.codeblocks?apiKey=${n}&codeblockId=${e.id}`,d=document.createElement("script");d.src=l,document.head.appendChild(d),d.onload=()=>{window.__bfCallbacks[e.id](o,a,s),setTimeout(()=>{document.head.removeChild(d)},300)}}},{signal:r})}p(A,"isOpen",!1),p(A,"button",null),p(A,"icon",null),p(A,"isButtonHidden",!1);function W(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P,j={exports:{}},M={exports:{}},L={exports:{}};function F(){return P||(P=1,function(e,t){function n(e){return Math.round(255*e)}function r(e,t,r){return n(e)+","+n(t)+","+n(r)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=r),0===t)return i(n,n,n);var o=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(o%2-1)),l=0,d=0,u=0;o>=0&&o<1?(l=a,d=s):o>=1&&o<2?(l=s,d=a):o>=2&&o<3?(d=a,u=s):o>=3&&o<4?(d=s,u=a):o>=4&&o<5?(l=s,u=a):o>=5&&o<6&&(l=a,u=s);var c=n-a/2;return i(l+c,d+c,u+c)},e.exports=t.default}(L,L.exports)),L.exports}var H,$={exports:{}};function R(){return H||(H=1,function(e,t){t.__esModule=!0,t.default=void 0;var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};t.default=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return n[t]?"#"+n[t]:e},e.exports=t.default}($,$.exports)),$.exports}var K,z,N,q={exports:{}};function D(){return K||(K=1,function(e,t){function n(e){var t="function"==typeof Map?new Map:void 0;return n=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(r())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var a=new(e.bind.apply(e,o));return n&&i(a,n.prototype),a}(e,arguments,o(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(r=function(){return!!e})()}function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}t.__esModule=!0,t.default=void 0;var a={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0],o=[];for(r=1;r<t.length;r+=1)o.push(t[r]);return o.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=function(e){var t,n;function r(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n=e.call(this,s.apply(void 0,[a[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),r}(n(Error)),e.exports=t.default}(q,q.exports)),q.exports}function U(){return z||(z=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,r.default)(e);if(t.match(a))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(s)){var o=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:o}}if(t.match(l))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(d)){var g=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:g}}var h=u.exec(t);if(h)return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10)};var b=c.exec(t.substring(0,50));if(b)return{red:parseInt(""+b[1],10),green:parseInt(""+b[2],10),blue:parseInt(""+b[3],10),alpha:parseFloat(""+b[4])>1?parseFloat(""+b[4])/100:parseFloat(""+b[4])};var m=f.exec(t);if(m){var y=parseInt(""+m[1],10),v=parseInt(""+m[2],10)/100,w=parseInt(""+m[3],10)/100,x="rgb("+(0,n.default)(y,v,w)+")",S=u.exec(x);if(!S)throw new i.default(4,t,x);return{red:parseInt(""+S[1],10),green:parseInt(""+S[2],10),blue:parseInt(""+S[3],10)}}var k=p.exec(t.substring(0,50));if(k){var _=parseInt(""+k[1],10),E=parseInt(""+k[2],10)/100,C=parseInt(""+k[3],10)/100,B="rgb("+(0,n.default)(_,E,C)+")",O=u.exec(B);if(!O)throw new i.default(4,t,B);return{red:parseInt(""+O[1],10),green:parseInt(""+O[2],10),blue:parseInt(""+O[3],10),alpha:parseFloat(""+k[4])>1?parseFloat(""+k[4])/100:parseFloat(""+k[4])}}throw new i.default(5)};var n=o(F()),r=o(R()),i=o(D());function o(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,l=/^#[a-fA-F0-9]{3}$/,d=/^#[a-fA-F0-9]{4}$/,u=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,c=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,f=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,p=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;e.exports=t.default}(M,M.exports)),M.exports}function J(){return N||(N=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,r.default)(e),n=Object.keys(t).map(function(e){var n=t[e]/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}),i=n[0],o=n[1],a=n[2];return parseFloat((.2126*i+.7152*o+.0722*a).toFixed(3))};var n,r=(n=U())&&n.__esModule?n:{default:n};e.exports=t.default}(j,j.exports)),j.exports}const Y=W(J());var G,V={exports:{}},Z={exports:{}};function Q(){return G||(G=1,function(e,t){function n(e,t,r){return function(){var i=r.concat(Array.prototype.slice.call(arguments));return i.length>=t?e.apply(this,i):n(e,t,i)}}t.__esModule=!0,t.default=function(e){return n(e,e.length,[])},e.exports=t.default}(Z,Z.exports)),Z.exports}var X,ee={exports:{}};function te(){return X||(X=1,e=ee,(t=ee.exports).__esModule=!0,t.default=void 0,t.default=function(e,t,n){return Math.max(e,Math.min(t,n))},e.exports=t.default),ee.exports;var e,t}var ne,re,ie={exports:{}},oe={exports:{}};function ae(){return ne||(ne=1,e=oe,(t=oe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,o=Math.max(n,r,i),a=Math.min(n,r,i),s=(o+a)/2;if(o===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var l=o-a,d=s>.5?l/(2-o-a):l/(o+a);switch(o){case n:t=(r-i)/l+(r<i?6:0);break;case r:t=(i-n)/l+2;break;default:t=(n-r)/l+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:d,lightness:s,alpha:e.alpha}:{hue:t,saturation:d,lightness:s}},e.exports=t.default),oe.exports;var e,t}function se(){return re||(re=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,r.default)((0,n.default)(e))};var n=i(U()),r=i(ae());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ie,ie.exports)),ie.exports}var le,de={exports:{}},ue={exports:{}},ce={exports:{}},fe={exports:{}};function pe(){return le||(le=1,function(e,t){t.__esModule=!0,t.default=void 0;t.default=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e},e.exports=t.default}(fe,fe.exports)),fe.exports}var ge,he,be,me={exports:{}};function ye(){return ge||(ge=1,e=me,(t=me.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.exports=t.default),me.exports;var e,t}function ve(){return he||(he=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=o(F()),r=o(pe()),i=o(ye());function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,i.default)(Math.round(255*e))}function s(e,t,n){return(0,r.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,r){return(0,n.default)(e,t,r,s)},e.exports=t.default}(ce,ce.exports)),ce.exports}function we(){return be||(be=1,function(e,t){t.__esModule=!0,t.default=function(e,t,i){if("number"==typeof e&&"number"==typeof t&&"number"==typeof i)return(0,n.default)(e,t,i);if("object"==typeof e&&void 0===t&&void 0===i)return(0,n.default)(e.hue,e.saturation,e.lightness);throw new r.default(1)};var n=i(ve()),r=i(D());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ue,ue.exports)),ue.exports}var xe,Se={exports:{}};function ke(){return xe||(xe=1,function(e,t){t.__esModule=!0,t.default=function(e,t,o,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof o&&"number"==typeof a)return a>=1?(0,n.default)(e,t,o):"rgba("+(0,r.default)(e,t,o)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===o&&void 0===a)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,r.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new i.default(2)};var n=o(ve()),r=o(F()),i=o(D());function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Se,Se.exports)),Se.exports}var _e,Ee={exports:{}};function Ce(){return _e||(_e=1,function(e,t){t.__esModule=!0,t.default=function(e,t,o){if("number"==typeof e&&"number"==typeof t&&"number"==typeof o)return(0,n.default)("#"+(0,r.default)(e)+(0,r.default)(t)+(0,r.default)(o));if("object"==typeof e&&void 0===t&&void 0===o)return(0,n.default)("#"+(0,r.default)(e.red)+(0,r.default)(e.green)+(0,r.default)(e.blue));throw new i.default(6)};var n=o(pe()),r=o(ye()),i=o(D());function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ee,Ee.exports)),Ee.exports}var Be,Oe,Ie,Ae={exports:{}};function Te(){return Be||(Be=1,function(e,t){t.__esModule=!0,t.default=function(e,t,o,a){if("string"==typeof e&&"number"==typeof t){var s=(0,n.default)(e);return"rgba("+s.red+","+s.green+","+s.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof o&&"number"==typeof a)return a>=1?(0,r.default)(e,t,o):"rgba("+e+","+t+","+o+","+a+")";if("object"==typeof e&&void 0===t&&void 0===o&&void 0===a)return e.alpha>=1?(0,r.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new i.default(7)};var n=o(U()),r=o(Ce()),i=o(D());function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ae,Ae.exports)),Ae.exports}function We(){return Oe||(Oe=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(d(e))return(0,o.default)(e);if(l(e))return(0,i.default)(e);if(c(e))return(0,r.default)(e);if(u(e))return(0,n.default)(e);throw new a.default(8)};var n=s(we()),r=s(ke()),i=s(Ce()),o=s(Te()),a=s(D());function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},d=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},c=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(de,de.exports)),de.exports}function Pe(){return Ie||(Ie=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Q()),r=a(te()),i=a(se()),o=a(We());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}var l=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,o.default)(s({},n,{lightness:(0,r.default)(0,1,n.lightness-parseFloat(e))}))});t.default=l,e.exports=t.default}(V,V.exports)),V.exports}const je=W(Pe());var Me,Le={exports:{}};function Fe(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Q()),r=a(te()),i=a(se()),o=a(We());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}var l=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,o.default)(s({},n,{lightness:(0,r.default)(0,1,n.lightness+parseFloat(e))}))});t.default=l,e.exports=t.default}(Le,Le.exports)),Le.exports}const He=W(Fe());function $e(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const r=Y(e)>.5;n.textContent=`\n .bf-trigger-button{position:fixed;bottom:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;box-shadow:0 1px 6px #0000000f,0 2px 32px #00000029;transition:transform 167ms cubic-bezier(.33,0,0,1);box-sizing:content-box;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon .fish-icon{display:none}.trigger-button-icon .fish-icon.visible{display:block}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0)}.bf-iframe-container{display:none;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:100vh;border:none;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out}.bf-iframe-container.open{display:block;opacity:1;transform:translateY(0);pointer-events:auto;top:0;left:0}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #D4D4D4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.iframe-loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:10}.spinner{width:24px;height:24px;border:2px solid rgba(0,0,0,.1);border-radius:50%;border-top-color:#3498db;animation:spin 1s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-error{width:24px;height:24px;position:relative;display:flex;align-items:center;justify-content:center}.loading-error:before,.loading-error:after{content:"";position:absolute;width:16px;height:2px;background-color:#e74c3c;border-radius:2px}.loading-error:before{transform:rotate(45deg)}.loading-error:after{transform:rotate(-45deg)}\n .${I} { background: ${e}; }\n .${I}:hover {\n background: ${r?je(.05,e):He(.05,e)};\n }\n .trigger-button-icon { color: ${t}; }\n `,document.head.appendChild(n)}((null==(t=null==e?void 0:e.theme)?void 0:t.inputButtonBgColor)||"#007bff",(null==(n=null==e?void 0:e.theme)?void 0:n.textBaseColor)||"#ffffff")}}function Re(e,t){const n=()=>{(t=>{var n;null==(n=e.contentWindow)||n.postMessage({type:"UPDATE_BODY_CLASS",isDarkMode:t},"*")})(document.body.classList.contains("dark"))};n(),(()=>{const e=new MutationObserver(n);e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t.addEventListener("abort",()=>e.disconnect())})()}function Ke(e,t){let n;const r=()=>{(t=>{var n;const r={type:"UPDATE_BODY_CLASS",isMobile:t};null==(n=e.contentWindow)||n.postMessage(r,"*"),t&&(A.isWidgetOpen?A.hideTriggerButton():A.showTriggerButton())})(document.body.clientWidth<=576)},i=()=>{n&&clearTimeout(n),n=window.setTimeout(r,300)};r(),(()=>{const e=new ResizeObserver(i);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}function ze(e){const t=(new TextEncoder).encode(e);if("undefined"!=typeof window&&"function"==typeof window.btoa){const e=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(e)}if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");throw new Error("[utils.base64Encode]: Unsupported environment")}const Ne=new Set;function qe(e,t,{isButtonHidden:n,triggerButtonIcon:r}){const i=document.createDocumentFragment();if(n)A.initialize({isButtonHidden:n});else{const{button:t,icon:n}=function(e,t){const n=B("button",I,{id:`trigger-button-${e}`,"aria-controls":O,"aria-expanded":"false","data-name":I}),r=B("div","trigger-button-icon",{"aria-hidden":"true"});return r.innerHTML=t?`\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <img src="${t}" class="fish-icon visible" alt="Trigger button icon" height="32" width="32" aria-hidden="true" aria-label="help button icon" />\n `:'\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>\n </svg>\n ',n.setAttribute("aria-label","Open Brainfish widget"),n.appendChild(r),{button:n,icon:r}}(e,r);i.appendChild(t),A.initialize({button:t,icon:n})}const{iframeContainer:o,iframe:a}=function(e){const t=B("div",O,{id:O,"aria-live":"polite","aria-hidden":"true"}),n=B("div","iframe-loading-indicator"),r=B("div","spinner");n.setAttribute("aria-label","Loading content"),n.setAttribute("role","status"),n.appendChild(r),t.appendChild(n);const i=B("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return i.style.opacity="0",i.addEventListener("load",()=>{n.style.display="none",i.style.opacity="1"}),i.addEventListener("error",e=>{console.error("Error loading iframe:",e),n.innerHTML="";const t=B("div","loading-error");n.appendChild(t),n.setAttribute("aria-label","Failed to load content")}),t.appendChild(i),{iframeContainer:t,iframe:i}}(t);return i.appendChild(o),{fragment:i,iframe:a}}const De=(e,t)=>{var n;const r=x(e.overrides),i=(null==(o=e.overrides)?void 0:o.widgetHost)||"https://agent.brainfi.sh";var o;const{theme:a,settings:s}=t,l=ze(JSON.stringify(null==(n=e.overrides)?void 0:n.redirectRules)),d=`${i}/?widgetKey=${e.widgetKey}#${new URLSearchParams({theme:ze(JSON.stringify(a)),settings:ze(JSON.stringify(s)),redirectRules:l}).toString()}`,u=null==s?void 0:s.hideTriggerButton,c=null==s?void 0:s.triggerButtonIcon;try{if(f=e.widgetKey,Ne.has(f))return;if(function(e){return!!document.getElementById(`trigger-button-${e}`)}(e.widgetKey))return;$e(t);const{fragment:n,iframe:o}=qe(e.widgetKey,d,{isButtonHidden:u||!1,triggerButtonIcon:c||""}),a=new AbortController,{signal:s}=a;o.onload=()=>{setTimeout(()=>{Re(o,s),T({widgetHost:i,apiHost:r,widgetKey:e.widgetKey,signal:s}),Ke(o,s)},0)},document.body.appendChild(n),Ne.add(e.widgetKey);const l=()=>{a.abort(),window.removeEventListener("beforeunload",l)};return void window.addEventListener("beforeunload",l)}catch(p){!function(e,t,n){y(e,t,t.message,n)}(r,p,e.widgetKey)}var f};var Ue=(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(Ue||{});const Je=t=>g(null,null,function*(){if(t.widgetType===e.Popup){const e=window.fcWidget?Ue.FRESHCHAT:null;e&&e===Ue.FRESHCHAT&&(yield g(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Ye="brainfish-nudges",Ge=(e,t)=>g(null,null,function*(){try{yield((e,t)=>g(null,null,function*(){if(document.getElementById(Ye))return;const n=document.createElement("script");n.id=Ye,n.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.js",n.type="module",n.async=!0,n.crossOrigin="anonymous",n.onerror=()=>{y(e,new Error(`Failed to load script: ${n.src}`),`Failed to load script: ${n.src}`,t)},document.head.appendChild(n)}))(e,t)}catch(n){y(e,n,"Failed to initialize Nudge widget",t)}});let Ve=null;const Ze="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(Ve||(Ve=function(){let e=[],t=null;function n(n,r){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const o=i[e[e.length-1]];if("function"==typeof o)return o.apply(i,r)}else e.push([n,r])}return{Widgets:{init:(...e)=>n("Widgets.init",e),identify:(...e)=>n("Widgets.identify",e),setSignedAttributes:(...e)=>n("Widgets.setSignedAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),isReady:!1},SearchWidget:{initStandard:(...e)=>n("SearchWidget.initStandard",e)},HelpWidget:{initPopup:(...e)=>n("HelpWidget.initPopup",e),close:(...e)=>n("HelpWidget.close",e),open:(...e)=>n("HelpWidget.open",e),toggle:(...e)=>n("HelpWidget.toggle",e)},_setRealBrainfish:function(r){for(t=r;e.length>0;){const[t,r]=e.shift();n(t,r)}}}}(),"undefined"!=typeof window&&(window.Brainfish=Ve)),Ve);let Qe=null;Ze.Widgets.isReady=!1,Ze.Widgets.identify=e=>{window.BrainfishAnalytics("identify",e)},Ze.Widgets.setSignedAttributes=e=>{try{!function(e,t){if("string"!=typeof e)throw new h("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new h(`Invalid token specified: missing part #${n+1}`);let i;try{i=b(r)}catch(o){throw new h(`Invalid token specified: invalid base64 for part #${n+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new h(`Invalid token specified: invalid json for part #${n+1} (${o.message})`)}}(e)}catch(n){return void console.error("[Brainfish] Invalid JWT provided to setSignedAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SIGNED_ATTRIBUTES",jwt:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},Ze.Widgets.init=e=>g(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=x(e.overrides),n=(null==(r=e.overrides)?void 0:r.analyticsApiHost)||"";var r;let i;if(e.config)i=JSON.parse((e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return(new TextDecoder).decode(r)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")})(e.config));else{const{config:n}=yield v({widgetKey:e.widgetKey,apiHost:t});i=n}Qe||(Qe=function(e,t,n,r){return g(this,null,function*(){var i,o,a,s,l,d;const u=(null==(i=e.overrides)?void 0:i.enableRecording)||(null==(o=null==t?void 0:t.settings)?void 0:o.enableRecording)||!1,c=(null==(a=e.overrides)?void 0:a.version)||(null==t?void 0:t.version),f=[];(null==c?void 0:c.startsWith("2."))?De(e,t):f.push(_(e,t)),f.push(C(e.widgetKey,t.trackingToken||"",n,r,u,(null==(s=null==t?void 0:t.settings)?void 0:s.recordingBlocklist)||[],null==(l=null==t?void 0:t.settings)?void 0:l._allowLocalhostRecording,null==(d=null==t?void 0:t.settings)?void 0:d._allowScreenRecording)),f.push(Ge(n,e.widgetKey));const[p]=yield Promise.allSettled(f);p&&"fulfilled"===p.status&&p.value&&Ze._setRealBrainfish(p.value)})}(e,i,t,n)),yield Qe,yield Je(i),Ze.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))});exports.BrainfishAnalytics=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)},exports.default=Ze;
170
2
  //# sourceMappingURL=web.cjs.js.map