@brainfish-ai/widgets-initiator 1.23.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/initIframeTrigger/utils/popupOpenPosition.d.ts +6 -0
- package/dist/types/initIframeTrigger/utils/popupOpenPosition.test.d.ts +1 -0
- package/dist/types/initIframeTrigger/utils/resolveMountTarget.d.ts +8 -0
- package/dist/types/initIframeTrigger/utils/resolveMountTarget.test.d.ts +1 -0
- package/dist/web.cjs.js +1 -1
- package/dist/web.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const POPUP_OPEN_POSITIONS: readonly ["bottom-left", "bottom-right", "top-left", "top-right"];
|
|
2
|
+
export type PopupOpenPosition = (typeof POPUP_OPEN_POSITIONS)[number];
|
|
3
|
+
export declare function isPopupOpenPosition(value?: string): value is PopupOpenPosition;
|
|
4
|
+
export declare function setDefaultPopupOpenPosition(position?: string): void;
|
|
5
|
+
/** Explicit `open({ position })` wins; otherwise uses the configured default. */
|
|
6
|
+
export declare function resolvePopupOpenPosition(explicit?: string): PopupOpenPosition | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function resolveMountTarget(selector?: string): HTMLElement | null;
|
|
2
|
+
export declare function getPopupMountParent(mountTarget?: string): HTMLElement;
|
|
3
|
+
export declare function getPopupWidgetRoot(widgetKey: string): HTMLElement | null;
|
|
4
|
+
/** True when the popup trigger and/or iframe container exists in the expected mount location. */
|
|
5
|
+
export declare function isPopupWidgetInMountTarget(widgetKey: string, mountTarget?: string): boolean;
|
|
6
|
+
/** Moves popup DOM into the configured mount target when it was appended elsewhere (e.g. Turbo swaps). */
|
|
7
|
+
export declare function relocatePopupWidgetIfNeeded(widgetKey: string, mountTarget?: string): boolean;
|
|
8
|
+
export declare function appendPopupWidgetFragment(fragment: DocumentFragment, mountTarget?: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/web.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&a(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>new Promise((o,i)=>{var r=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?o(e.value):Promise.resolve(e.value).then(r,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]="f7149b48-e38f-433c-ae02-425000419f3f",e._sentryDebugIdIdentifier="sentry-dbid-f7149b48-e38f-433c-ae02-425000419f3f")}catch(n){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var h,g,m,b;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.23.0"},(g=h||(h={})).Sidebar="sidebar",g.Searchbar="searchbar",g.Popup="popup",h.Sidebar,h.Searchbar,h.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),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}}}(b=m||(m={})).LINK="link",b.CALLBACK="callback",b.EMAIL="email",b.PHONE="phone";const w=(e,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const o=t.toJSON(),i=e||"https://app.brainfi.sh",r={error:`WebWidgetVersion: 1.23.0. ${t.message}`,stack:t.stack,cause:{message:o.message,stack:o.stack,cause:o.cause}};fetch(`${i}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(r)})})(e,new y(i,{cause:r}),o)};const v=e=>d(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return d(this,null,function*(){let o,i=0;for(;i<3;)try{const o=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!o.ok)throw new Error(`API call failed with status: ${o.status}`);const i=yield o.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(r){if(o=r,i++,i>=3)throw w(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const o=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{o[e]&&(o[e]=o[e].map(e=>e.type===m.CALLBACK&&e.value?c(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),c(s({},e),{settings:o,apiHost:n,widgetMode:e.widgetType,apiKey:t})},S=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",C=e=>d(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=>d(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const o=document.createElement("script");o.id="brainfish-widget",o.src=e,o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},o.onerror=t=>{const o=t,i={message:`Failed to load script: ${e}`,type:o.type,fileName:o.filename,lineNumber:o.lineno,columnNumber:o.colno,error:o.error?o.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(o)})}))(e);return{widget:t}}catch(o){Math.random()<.05&&w(e,o,o.message,t)}});const k=new Set,E=(e,t)=>d(null,null,function*(){const n=S(e.overrides);try{if(k.has(e.widgetKey))return;const o=yield C({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.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())})(t.settings[e],n))}),function(e,t){t.widgetType===h.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(i,r),k.add(e.widgetKey),i}}catch(o){w(n,o,o.message,e.widgetKey)}}),I=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},L=e=>{try{if(I())return window.localStorage.getItem(e)}catch(t){}return null},W=e=>{try{I()&&window.localStorage.removeItem(e)}catch(t){}};let T=!1;const _=(e,t,n,...o)=>d(null,[e,t,n,...o],function*(e,t,n,o="",i=!1,r){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!T)try{const a=(()=>{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)})(),s="true"===L("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),T=!0,yield((e,t)=>d(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const o=document.createElement("script");o.id="brainfish-analytics",o.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},o.onerror=()=>{Math.random()<.05&&w(e,new Error(`Failed to load script: ${o.src}`),`Failed to load script: ${o.src}`,t),n(void 0)},document.head.appendChild(o)})}))(n,e)}catch(a){w(n,a,"Failed to initialize BrainfishAnalytics",e)}});function M(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 A=e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=t.charCodeAt(e);return(new TextDecoder).decode(o)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")},O="USER_IDENTIFY";let P=null;const R=new Set,B=new Map;let F=!1;function j(e){try{return new URL(e).origin}catch(t){return e}}function N(e){R.add(j(e))}function V(e,t,n){var o;const i=function(e,t){try{return new URL(e.src).origin}catch(n){if(t)return j(t)}return"*"}(e,n);null==(o=e.contentWindow)||o.postMessage({type:O,payload:t},i)}function H(e,t,n){var o;N(t),B.set(e,{widgetHost:t});const i=()=>{P&&V(e,P,t)};e.addEventListener("load",i,(null==n?void 0:n.signal)?{signal:n.signal}:void 0),null==(o=null==n?void 0:n.signal)||o.addEventListener("abort",()=>{B.delete(e)},{once:!0}),e.contentWindow&&i()}function Z(e){var t;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&P&&e.source&&function(e){if(R.has(e))return!0;for(const n of B.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e.origin)&&(!function(e){if(!e)return!1;for(const t of B.keys())if(t.contentWindow===e)return!0;return!1}(e.source)?console.warn("[Brainfish] Rejected REQUEST_USER_IDENTITY from untrusted iframe source:",e.origin):e.source.postMessage({type:O,payload:P},e.origin))}function D(){F||"undefined"==typeof window||(F=!0,window.addEventListener("message",Z))}const G=new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function z(e){D();const t=function(e){const t=e.userId,n="string"==typeof t?t:"number"==typeof t&&Number.isFinite(t)?String(t):"";if(!n)return console.warn("[Brainfish] Widgets.identify requires a non-empty userId (string or finite number)."),null;const o={userId:n};"string"==typeof e.firstName&&(o.firstName=e.firstName),"string"==typeof e.lastName&&(o.lastName=e.lastName),"string"==typeof e.email&&(o.email=e.email),"string"==typeof e.phone&&(o.phone=e.phone),"string"==typeof e.avatar&&(o.avatar=e.avatar);const i={};for(const a of Object.keys(e))G.has(a)||(i[a]=e[a]);const r=e.properties&&"object"==typeof e.properties&&!Array.isArray(e.properties)?e.properties:void 0;return(Object.keys(i).length>0||r)&&(o.properties=s(s({},i),r)),o}(e);return t?(t.phone&&!/^\+[1-9]\d{1,14}$/.test(t.phone)&&console.warn("[Brainfish] phone should be in E.164 format (e.g., +14155552671)."),P=t,function(e){for(const[t,{widgetHost:n}]of B)V(t,e,n)}(t),t):null}function Y(e){if(e.__bfIdentityWrapped)return e;const t=(t,...n)=>{if("identify"===t&&n[0]&&"object"==typeof n[0]&&!Array.isArray(n[0])){const o=z(n[0]);if(o)return e(t,o,...n.slice(1))}return e(t,...n)};return t.__bfIdentityWrapped=!0,e.q&&(t.q=e.q),t}let $=!1;function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,K={exports:{}},U={exports:{}},q={exports:{}};function Q(){return J||(J=1,function(e,t){function n(e){return Math.round(255*e)}function o(e,t,o){return n(e)+","+n(t)+","+n(o)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=o),0===t)return i(n,n,n);var r=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(r%2-1)),c=0,l=0,d=0;r>=0&&r<1?(c=a,l=s):r>=1&&r<2?(c=s,l=a):r>=2&&r<3?(l=a,d=s):r>=3&&r<4?(l=s,d=a):r>=4&&r<5?(c=s,d=a):r>=5&&r<6&&(c=a,d=s);var u=n-a/2;return i(c+u,l+u,d+u)},e.exports=t.default}(q,q.exports)),q.exports}var ee,te={exports:{}};function ne(){return ee||(ee=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}(te,te.exports)),te.exports}var oe,ie,re,ae={exports:{}};function se(){return oe||(oe=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(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&i(a,n.prototype),a}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=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 r(e){return(r=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 o,i=t[0],r=[];for(o=1;o<t.length;o+=1)r.push(t[o]);return r.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=function(e){var t,n;function o(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 o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];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=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),o}(n(Error)),e.exports=t.default}(ae,ae.exports)),ae.exports}function ce(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,o.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 r=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:r}}if(t.match(c))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(l)){var h=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:h}}var g=d.exec(t);if(g)return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};var m=u.exec(t.substring(0,50));if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10),alpha:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])};var b=f.exec(t);if(b){var y=parseInt(""+b[1],10),w=parseInt(""+b[2],10)/100,v=parseInt(""+b[3],10)/100,x="rgb("+(0,n.default)(y,w,v)+")",S=d.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 C=p.exec(t.substring(0,50));if(C){var k=parseInt(""+C[1],10),E=parseInt(""+C[2],10)/100,I=parseInt(""+C[3],10)/100,L="rgb("+(0,n.default)(k,E,I)+")",W=d.exec(L);if(!W)throw new i.default(4,t,L);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(Q()),o=r(ne()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,c=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^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}(U,U.exports)),U.exports}function le(){return re||(re=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,o.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],r=n[1],a=n[2];return parseFloat((.2126*i+.7152*r+.0722*a).toFixed(3))};var n,o=(n=ce())&&n.__esModule?n:{default:n};e.exports=t.default}(K,K.exports)),K.exports}const de=X(le());var ue,fe={exports:{}},pe={exports:{}};function he(){return ue||(ue=1,function(e,t){function n(e,t,o){return function(){var i=o.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}(pe,pe.exports)),pe.exports}var ge,me={exports:{}};function be(){return ge||(ge=1,e=me,(t=me.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),me.exports;var e,t}var ye,we,ve={exports:{}},xe={exports:{}};function Se(){return ye||(ye=1,e=xe,(t=xe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,o=e.green/255,i=e.blue/255,r=Math.max(n,o,i),a=Math.min(n,o,i),s=(r+a)/2;if(r===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=r-a,l=s>.5?c/(2-r-a):c/(r+a);switch(r){case n:t=(o-i)/c+(o<i?6:0);break;case o:t=(i-n)/c+2;break;default:t=(n-o)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),xe.exports;var e,t}function Ce(){return we||(we=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(ce()),o=i(Se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ve,ve.exports)),ve.exports}var ke,Ee={exports:{}},Ie={exports:{}},Le={exports:{}},We={exports:{}};function Te(){return ke||(ke=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}(We,We.exports)),We.exports}var _e,Me,Ae,Oe={exports:{}};function Pe(){return _e||(_e=1,e=Oe,(t=Oe.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),Oe.exports;var e,t}function Re(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(Q()),o=r(Te()),i=r(Pe());function r(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,o.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,o){return(0,n.default)(e,t,o,s)},e.exports=t.default}(Le,Le.exports)),Le.exports}function Be(){return Ae||(Ae=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 o.default(1)};var n=i(Re()),o=i(se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var Fe,je={exports:{}};function Ne(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,n.default)(e,t,r):"rgba("+(0,o.default)(e,t,r)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)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(Re()),o=r(Q()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(je,je.exports)),je.exports}var Ve,He={exports:{}};function Ze(){return Ve||(Ve=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(t)+(0,o.default)(r));if("object"==typeof e&&void 0===t&&void 0===r)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(Te()),o=r(Pe()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(He,He.exports)),He.exports}var De,Ge,ze,Ye={exports:{}};function $e(){return De||(De=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,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 r&&"number"==typeof a)return a>=1?(0,o.default)(e,t,r):"rgba("+e+","+t+","+r+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)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(ce()),o=r(Ze()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ye,Ye.exports)),Ye.exports}function Xe(){return Ge||(Ge=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,r.default)(e);if(c(e))return(0,i.default)(e);if(u(e))return(0,o.default)(e);if(d(e))return(0,n.default)(e);throw new a.default(8)};var n=s(Be()),o=s(Ne()),i=s(Ze()),r=s($e()),a=s(se());function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},d=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(Ee,Ee.exports)),Ee.exports}function Je(){return ze||(ze=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(he()),o=a(be()),i=a(Ce()),r=a(Xe());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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness-parseFloat(e))}))});t.default=c,e.exports=t.default}(fe,fe.exports)),fe.exports}const Ke=X(Je());var Ue,qe={exports:{}};function Qe(){return Ue||(Ue=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(he()),o=a(be()),i=a(Ce()),r=a(Xe());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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness+parseFloat(e))}))});t.default=c,e.exports=t.default}(qe,qe.exports)),qe.exports}const et=X(Qe()),tt="bf-iframe-container",nt="bf-trigger-button",ot="bf-search-bar-iframe-container",it="bf-search-bar-iframe-backdrop";function rt(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 o=de(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;max-width:36px;max-height:36px}.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);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));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,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@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.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.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 .${nt} { background: ${e}; }\n .${nt}:hover {\n background: ${o?Ke(.05,e):et(.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")}}class at{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function st(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const ct="brainfish-search-widget";class lt{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===h.Searchbar?ot:tt}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${it}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,o;const i=document.querySelector(`.${this.containerClass}`),r=null==i?void 0:i.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==r?void 0:r.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==r?void 0:r.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(o=null==r?void 0:r.contentWindow)||o.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==h.Searchbar&&(null==i||i.classList.add("open"),e.position&&(null==i||i.classList.add(`position-${e.position}`),null==i||i.setAttribute("data-current-position",e.position))),null==i||i.setAttribute("aria-hidden","false"),this.widgetType!==h.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=st("div",it);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(ct);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==h.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){const n=document.querySelector(`.${ot}[data-widget-key="${e}"]`);if(n){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(n)}if(document.getElementById(`trigger-button-${e}`))return!0;if("Search"!==t.widgetType){if(document.querySelector(`.${tt}`))return!0}return!1}}class dt{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===h.Popup)}static clear(){this.instances.clear()}}l(dt,"instances",new Map);const ut=({formUrl:e,width:t="500px",height:n="600px"})=>{const o=document.createElement("div");o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("tabindex","-1"),o.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const i=document.createElement("button");i.innerHTML="×",i.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const r=document.createElement("iframe");r.src=e,r.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[i,r],n=document.activeElement,o=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?o<=0?t[t.length-1].focus():t[o-1].focus():o>=t.length-1?t[0].focus():t[o+1].focus()}else"Escape"===e.key&&c()},c=()=>{o.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",i.onclick=c,l.onclick=c,document.addEventListener("keydown",s),o.appendChild(i),o.appendChild(r),document.body.appendChild(l),document.body.appendChild(o),o.focus(),r.onload=()=>{r.setAttribute("tabindex","0"),i.focus()}},ft=e=>`brainfish_conversation_${e}`,pt={save(e,t){if(t){const o=L(ft(e));let i=Date.now();if(o)try{const e=JSON.parse(o);e.conversationId===t&&(i=e.persistedAt)}catch(n){}const r={conversationId:t,persistedAt:i};((e,t)=>{try{I()&&window.localStorage.setItem(e,t)}catch(n){}})(ft(e),JSON.stringify(r))}else W(ft(e))},load(e){const t=L(ft(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(W(ft(e)),null):n.conversationId}catch(n){return W(ft(e)),null}},clear(e){W(ft(e))}};class ht{static getIframeForInstance(e){var t,n;const o=e.widgetType===h.Searchbar?ot:tt,i=e.widgetType===h.Searchbar?`.${o}[data-widget-key="${e.widgetKey}"]`:`.${o}`;return null!=(n=null==(t=document.querySelector(i))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,o;null==(o=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||o.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=ut,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=dt.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=dt.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,o={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(o.newConversation=!0),(null==n?void 0:n.trigger)&&(o.trigger=n.trigger),(null==n?void 0:n.position)&&(o.position=n.position),t.openWidget(o)}}static createNewThread(){const e=dt.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=dt.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=dt.getOpenInstance();if(n||(n=dt.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=c(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(o)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=dt.getOpenInstance();const n=!!t;t||(t=dt.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=dt.getOpenInstance())?e:dt.getClosedPopupInstance();t?(pt.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(ht,"isInitialized",!1);class gt{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case h.Searchbar:n="searchbar_widget";break;case h.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,c(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class mt{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new at(e,t),this.domController=new lt(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new gt(t,e)}static getInstance(e){return dt.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),dt.register(this.widgetKey,this),ht.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=pt.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){dt.unregister(this.widgetKey)}static initialize(e){const t=new mt(e.widgetKey,e.widgetType);return t.initialize(e),t}}function bt({widgetUrl:e,widgetType:t,props:n}){const o=t===h.Searchbar?ot:tt,i=st("div",o,s({id:o,"aria-live":"polite","aria-hidden":t===h.Searchbar?"false":"true"},n||{})),r=st("div","iframe-loading-indicator"),a=st("div","spinner");r.setAttribute("aria-label","Loading content"),r.setAttribute("role","status"),r.appendChild(a),i.appendChild(r);const c=st("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{r.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),r.innerHTML="";const t=st("div","loading-error");r.appendChild(t),r.setAttribute("aria-label","Failed to load content")}),i.appendChild(c),{iframeContainer:i,iframe:c}}function yt(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())})()}const wt=new Map,vt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,xt=(e,t)=>d(null,null,function*(){if(wt.has(e)){const i=wt.get(e);if("function"!=typeof i)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield i(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(o){return{success:!1,reason:vt(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),St=new Map,Ct=new Set;function kt(e,{widgetHost:t,apiHost:n,widgetKey:o,widgetType:i,signal:r,stateManager:a}){window.addEventListener("message",r=>d(null,null,function*(){var s,c;if(r.origin!==t)return;const{type:l,widgetKey:d}=r.data;if(!d||d===o){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${tt}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=r.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{messageId:e,eventName:t,data:n}=r.data;if(e){if(Ct.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);Ct.add(e),setTimeout(()=>Ct.delete(e),5e3)}a.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:i,answer:a,conversation:s}=r.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=St.get(e.id);if(c&&Date.now()-c<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-c}ms ago)`);St.set(e.id,Date.now()),setTimeout(()=>St.delete(e.id),1e3),pt.clear(o);const l={query:i,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](i,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",o),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const r=document.createElement("script");r.src=t.toString(),document.head.appendChild(r),r.onload=()=>{window.__bfCallbacks[e.id](i,a,l),setTimeout(()=>{document.head.removeChild(r)},300)},r.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:o}=r.data,i=yield xt(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=r.data;i!==h.Searchbar&&pt.save(o,e)}if("REQUEST_USER_IDENTITY"===l&&r.source===e.contentWindow&&i===h.Popup){const t=pt.load(o);t&&(null==(c=e.contentWindow)||c.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:r})}function Et(e,t,n){let o;const i=()=>{(t=>{var o;const i={type:"UPDATE_BODY_CLASS",isMobile:t};null==(o=e.contentWindow)||o.postMessage(i,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},r=()=>{o&&clearTimeout(o),o=window.setTimeout(i,300)};i(),(()=>{const e=new ResizeObserver(r);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const It=new Set;function Lt(e,t,{isButtonHidden:n,triggerButtonIcon:o}){const i=document.createDocumentFragment();let r;if(n)r=mt.initialize({isButtonHidden:n,widgetType:h.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=st("button",nt,{id:`trigger-button-${e}`,"aria-controls":tt,"aria-expanded":"false","data-name":nt}),o=st("div","trigger-button-icon",{"aria-hidden":"true"});return o.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" 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(o),{button:n,icon:o}}(e,o);i.appendChild(t),r=mt.initialize({button:t,icon:n,widgetType:h.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=bt({widgetUrl:t,widgetType:h.Popup});return i.appendChild(a),{fragment:i,iframe:s,stateManager:r}}const Wt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i,hideTriggerButton:r})=>{const{settings:a}=e,s=null!=r?r:null==a?void 0:a.hideTriggerButton,c=null==a?void 0:a.triggerButtonIcon;try{if(function(e){return It.has(e)}(i))return;if(function(e){return!!document.getElementById(`trigger-button-${e}`)}(i))return;rt(e);const{fragment:r,iframe:a,stateManager:l}=Lt(i,t,{isButtonHidden:s||!1,triggerButtonIcon:c||""}),d=new AbortController,{signal:u}=d;H(a,o,{signal:u}),a.onload=()=>{setTimeout(()=>{var e;yt(a,u),kt(a,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Popup,signal:u,stateManager:l}),Et(a,u,l);const r=pt.load(i),s=new URL(t).searchParams.has("conversation");r&&!s&&(null==(e=a.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:r},"*"))},0)},document.body?document.body.appendChild(r):(console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(r)},{once:!0})),It.add(i);const f=()=>{d.abort(),window.removeEventListener("beforeunload",f)};return void window.addEventListener("beforeunload",f)}catch(l){!function(e,t,n){w(e,t,t.message,n)}(n,l,i)}},Tt=new Map;const _t=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i})=>{var r,a,s,c;const{settings:l}=e;let d=mt.getInstance(i);null==(r=Tt.get(i))||r.abort();const u=new AbortController;Tt.set(i,u),rt(e);try{const e=document.querySelector(`.${ot}[data-widget-key="${i}"]`),r=document.querySelector(ct);e&&r&&!r.contains(e)&&(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(a=r.parentElement)||a.style.setProperty("width","100%"))),d||(d=mt.initialize({isButtonHidden:!0,widgetType:h.Searchbar,widgetKey:i}));const{signal:l}=u,f=e=>{H(e,o,{signal:l}),yt(e,l),kt(e,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Searchbar,signal:l,stateManager:d}),Et(e,l,d)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(c=t.contentDocument)?void 0:c.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:o}=bt({widgetUrl:t,widgetType:h.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":i}});o.onload=()=>{setTimeout(()=>{f(o)},0)},e.appendChild(n),r?(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(s=r.parentElement)||s.style.setProperty("width","100%"))):document.body.appendChild(e)}const p=()=>{u.abort(),Tt.delete(i),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(f){!function(e,t,n){w(e,t,t.message,n)}(n,f,i)}},Mt=(e,t,n)=>{var a;const c=S(e.overrides),l=(null==(d=e.overrides)?void 0:d.widgetHost)||"https://agent.brainfi.sh";var d;N(l);const u=null==(a=e.overrides)?void 0:a.hideTriggerButton,{theme:f,settings:p}=t,h=e.overrides||{},{theme:g,redirectRules:m,regions:b,customCss:y}=h,w=((e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&r.call(e,a)&&(n[a]=e[a]);return n})(h,["theme","redirectRules","regions","customCss"]),v=s(s({},f),g),x=s(s({},p),w),C=M(JSON.stringify(m)),k={theme:M(JSON.stringify(v)),settings:M(JSON.stringify(x)),redirectRules:C};b&&(k.regions=M(JSON.stringify(b))),y&&(k.customCss=M(y)),n&&(k.fingerprint=M(n));const E=`${l}/?widgetKey=${e.widgetKey}#${new URLSearchParams(k).toString()}`;"Search"===t.widgetType?_t({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey}):Wt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey,hideTriggerButton:u})};var At=(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(At||{});const Ot=e=>d(null,null,function*(){if(e.widgetType===h.Popup){const e=window.fcWidget?At.FRESHCHAT:null;e&&e===At.FRESHCHAT&&(yield d(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Pt="brainfish-nudges",Rt=(e,t)=>d(null,null,function*(){try{yield d(null,null,function*(){if(!document.getElementById(Pt))return new Promise(e=>{const t=document.createElement("script");t.id=Pt,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){w(e,n,"Failed to initialize Nudge widget",t)}});let Bt,Ft,jt,Nt=!1;const Vt=e=>{null==Bt||Bt.abort(),Bt=new AbortController;const{signal:t}=Bt;let n=window.location.pathname;const o=()=>{if(t.aborted)return;const o=window.location.pathname;o!==n&&(n=o,e())};window.addEventListener("popstate",o,{signal:t}),Nt||(Ft=history.pushState,jt=history.replaceState,history.pushState=function(...e){Ft.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){jt.apply(this,e),setTimeout(o,0)},Nt=!0),t.addEventListener("abort",()=>{Nt&&(history.pushState=Ft,history.replaceState=jt,Nt=!1)})};var Ht="5.2.0";function Zt(e,t){return new Promise(n=>setTimeout(n,e,t))}function Dt(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Gt(e){return!!e&&"function"==typeof e.then}function zt(e,t){try{const n=e();Gt(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function Yt(e,t,n=16){return d(this,null,function*(){const o=Array(e.length);let i=Date.now();for(let r=0;r<e.length;++r){o[r]=t(e[r],r);const a=Date.now();a>=i+n&&(i=a,yield Dt())}return o})}function $t(e){return e.then(void 0,()=>{}),e}function Xt(e){return parseInt(e)}function Jt(e){return parseFloat(e)}function Kt(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Ut(e){return e.reduce((e,t)=>e+(t?1:0),0)}function qt(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function Qt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let l=0,d=0,u=0,f=0;f+=r+(65535&t[1]),u+=f>>>16,f&=65535,u+=i+c,d+=u>>>16,u&=65535,d+=o+s,l+=d>>>16,d&=65535,l+=n+a,l&=65535,e[0]=l<<16|d,e[1]=u<<16|f}function en(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,l=65535&t[1];let d=0,u=0,f=0,p=0;p+=r*l,f+=p>>>16,p&=65535,f+=i*l,u+=f>>>16,f&=65535,f+=r*c,u+=f>>>16,f&=65535,u+=o*l,d+=u>>>16,u&=65535,u+=i*c,d+=u>>>16,u&=65535,u+=r*s,d+=u>>>16,u&=65535,d+=n*l+o*c+i*s+r*a,d&=65535,e[0]=d<<16|u,e[1]=f<<16|p}function tn(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function nn(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function on(e,t){e[0]^=t[0],e[1]^=t[1]}const rn=[4283543511,3981806797],an=[3301882366,444984403];function sn(e){const t=[0,e[0]>>>1];on(e,t),en(e,rn),t[1]=e[0]>>>1,on(e,t),en(e,an),t[1]=e[0]>>>1,on(e,t)}const cn=[2277735313,289559509],ln=[1291169091,658871167],dn=[0,5],un=[0,1390208809],fn=[0,944331445];function pn(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e);t=t||0;const o=[0,n.length],i=o[1]%16,r=o[1]-i,a=[0,t],s=[0,t],c=[0,0],l=[0,0];let d;for(d=0;d<r;d+=16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,l[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,l[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,en(c,cn),tn(c,31),en(c,ln),on(a,c),tn(a,27),Qt(a,s),en(a,dn),Qt(a,un),en(l,ln),tn(l,33),en(l,cn),on(s,l),tn(s,31),Qt(s,a),en(s,dn),Qt(s,fn);c[0]=0,c[1]=0,l[0]=0,l[1]=0;const u=[0,0];switch(i){case 15:u[1]=n[d+14],nn(u,48),on(l,u);case 14:u[1]=n[d+13],nn(u,40),on(l,u);case 13:u[1]=n[d+12],nn(u,32),on(l,u);case 12:u[1]=n[d+11],nn(u,24),on(l,u);case 11:u[1]=n[d+10],nn(u,16),on(l,u);case 10:u[1]=n[d+9],nn(u,8),on(l,u);case 9:u[1]=n[d+8],on(l,u),en(l,ln),tn(l,33),en(l,cn),on(s,l);case 8:u[1]=n[d+7],nn(u,56),on(c,u);case 7:u[1]=n[d+6],nn(u,48),on(c,u);case 6:u[1]=n[d+5],nn(u,40),on(c,u);case 5:u[1]=n[d+4],nn(u,32),on(c,u);case 4:u[1]=n[d+3],nn(u,24),on(c,u);case 3:u[1]=n[d+2],nn(u,16),on(c,u);case 2:u[1]=n[d+1],nn(u,8),on(c,u);case 1:u[1]=n[d],on(c,u),en(c,cn),tn(c,31),en(c,ln),on(a,c)}return on(a,o),on(s,o),Qt(a,s),Qt(s,a),sn(a),sn(s),Qt(a,s),Qt(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function hn(e,t,n,o){const i=Object.keys(e).filter(e=>!function(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}(n,e)),r=$t(Yt(i,n=>function(e,t){const n=$t(new Promise(n=>{const o=Date.now();zt(e.bind(null,t),(...e)=>{const t=Date.now()-o;if(!e[0])return n(()=>({error:e[1],duration:t}));const i=e[1];if(function(e){return"function"!=typeof e}(i))return n(()=>({value:i,duration:t}));n(()=>new Promise(e=>{const n=Date.now();zt(i,(...o)=>{const i=t+Date.now()-n;if(!o[0])return e({error:o[1],duration:i});e({value:o[1],duration:i})})}))})}));return function(){return n.then(e=>e())}}(e[n],t),o));return function(){return d(this,null,function*(){const e=yield r,t=yield Yt(e,e=>$t(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function gn(){const e=window,t=navigator;return Ut(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function mn(){const e=window,t=navigator;return Ut(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function bn(){const e=window;return Ut(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function yn(){const e=window,{HTMLElement:t,Document:n}=e;return Ut(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function wn(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function vn(){var e,t;const n=window;return Ut(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function xn(){const{CSS:e}=window;return Ut([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Sn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return Ut([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Cn(){const e=mn(),t=vn(),n=window,o=navigator,i="connection";return e?Ut([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&Ut(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function kn(e){const t=new Error(e);return t.name=e,t}function En(e,t,n=50){return d(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield Zt(n);const s=a.createElement("iframe");try{for((yield new Promise((e,n)=>{let o=!1;const i=()=>{o=!0,e()};s.onload=i,s.onerror=e=>{o=!0,n(e)};const{style:r}=s;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);const c=()=>{var e,t;o||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}));!(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body);)yield Zt(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function In(e){const[t,n]=function(e){var t,n;const o=`Unexpected syntax '${e}'`,i=/^\s*([a-z-]*)(.*)$/i.exec(e),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=(e,t)=>{a[e]=a[e]||[],a[e].push(t)};for(;;){const e=s.exec(i[2]);if(!e)break;const r=e[0];switch(r[0]){case".":c("class",r.slice(1));break;case"#":c("id",r.slice(1));break;case"[":{const e=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(r);if(!e)throw new Error(o);c(e[1],null!==(n=null!==(t=e[4])&&void 0!==t?t:e[5])&&void 0!==n?n:"");break}default:throw new Error(o)}}return[r,a]}(e),o=document.createElement(null!=t?t:"div");for(const i of Object.keys(n)){const e=n[i].join(" ");"style"===i?Ln(o.style,e):o.setAttribute(i,e)}return o}function Ln(e,t){for(const n of t.split(";")){const t=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(t){const[,n,o,,i]=t;e.setProperty(n,o,i||"")}}}const Wn=["monospace","sans-serif","serif"],Tn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function _n(e){return e.toDataURL()}let Mn,An;function On(){return function(){if(void 0!==An)return;const e=()=>{const t=Pn();Rn(t)?An=setTimeout(e,2500):(Mn=t,An=void 0)};e()}(),()=>d(null,null,function*(){let e=Pn();if(Rn(e)){if(Mn)return[...Mn];(function(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null})()&&(yield function(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}(),e=Pn())}return Rn(e)||(Mn=e),e})}function Pn(){const e=screen;return[Kt(Jt(e.availTop),null),Kt(Jt(e.width)-Jt(e.availWidth)-Kt(Jt(e.availLeft),0),null),Kt(Jt(e.height)-Jt(e.availHeight)-Kt(Jt(e.availTop),0),null),Kt(Jt(e.availLeft),null)]}function Rn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Bn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Fn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function jn(e){return matchMedia(`(forced-colors: ${e})`).matches}function Nn(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Vn(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Hn(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Zn(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Dn=Math,Gn=()=>0;const zn="mmMwWLliI0fiflO&1",Yn={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function $n(e){const t=Cn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const Xn=function(){let e=window;for(;;){const n=e.parent;if(!n||n===e)return!1;try{if(n.location.origin!==e.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}e=n}};const Jn=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Kn=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Un=["FRAGMENT_SHADER","VERTEX_SHADER"],qn=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Qn="WEBGL_debug_renderer_info";function eo(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch(o){}if(n)break}return e.webgl={context:n},n}function to(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function no(e){return Object.keys(e.__proto__).filter(oo)}function oo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function io(){return vn()}function ro(){return mn()||bn()}function ao(e){return"function"==typeof e.getParameter}const so={userAgentData:function(){return d(this,null,function*(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:e})=>!function(e){return/not/i.test(e)}(e)).map(({brand:e})=>e),n={brands:t.length>1?t.filter(e=>"Chromium"!==e):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);n.architecture=t.architecture,n.bitness=t.bitness,n.model=t.model,n.platformVersion=t.platformVersion}catch(o){if(!(o instanceof DOMException&&"NotAllowedError"===o.name))throw o;n.highEntropyStatus="not_allowed"}return n})},fonts:function(){return En((e,t)=>d(null,[e,t],function*(e,{document:t}){const n=t.body;n.style.fontSize="48px";const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i={},r={},a=e=>{const n=t.createElement("span"),{style:i}=n;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",o.appendChild(n),n},s=(e,t)=>a(`'${e}',${t}`),c=Wn.map(a),l=(()=>{const e={};for(const t of Tn)e[t]=Wn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Wn.length;d++)i[Wn[d]]=c[d].offsetWidth,r[Wn[d]]=c[d].offsetHeight;return Tn.filter(e=>{return t=l[e],Wn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return d(this,arguments,function*({debug:e}={}){if(!bn()&&!Cn())return;const t=function(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}(),n=Object.keys(t),o=[].concat(...n.map(e=>t[e])),i=yield function(e){return d(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Bn(o);for(let a=0;a<e.length;++a){const t=In(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Bn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield Zt(50);n.body.appendChild(o);try{for(let t=0;t<e.length;++t)i[t].offsetParent||(r[e[t]]=!0)}finally{null===(t=o.parentNode)||void 0===t||t.removeChild(o)}return r})}(o);e&&function(e,t){let n="DOM blockers debug:\n```";for(const o of Object.keys(e)){n+=`\n${o}:`;for(const i of e[o])n+=`\n ${t[i]?"🚫":"➡️"} ${i}`}console.log(`${n}\n\`\`\``)}(t,i);const r=n.filter(e=>{const n=t[e];return Ut(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return En((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",mn()?r.style.zoom=""+1/o.devicePixelRatio:bn()&&(r.style.zoom="reset");const s=i.createElement("div");return s.textContent=[...Array(t/20|0)].map(()=>"word").join(" "),r.appendChild(s),e(i,r,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((e,t,n)=>{const o={},i={};for(const a of Object.keys(Yn)){const[n={},i=zn]=Yn[a],r=e.createElement("span");r.textContent=i,r.style.whiteSpace="nowrap";for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(r.style[e]=t)}o[a]=r,t.append(e.createElement("br"),r)}const r=mn()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return Ut([o&&"try"in o,"caretPositionFromPoint"in t,i&&"onerror"in i.prototype,n.supports("ruby-align","space-around")])>=3}();for(const a of Object.keys(Yn)){const e=o[a].getBoundingClientRect().width;i[a]=r?$n(e*n.devicePixelRatio):e}return i})},audio:function(){return bn()&&Sn()&&wn()||mn()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return Ut(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}()&&function(){const e=window,{URLPattern:t}=e;return Ut(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(bn()&&!yn()&&!function(){const e=window;return Ut(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;const n=4500,o=new t(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;const r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);const[a,s]=function(e){const t=3,n=500,o=500,i=5e3;let r=()=>{};const a=new Promise((a,s)=>{let c=!1,l=0,d=0;e.oncomplete=e=>a(e.renderedBuffer);const u=()=>{setTimeout(()=>s(kn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(Gt(o)&&$t(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(kn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=$t(a.then(e=>function(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n)),e=>{if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return()=>(s(),c)}()},screenFrame:function(){const e=bn()&&Sn()&&wn(),t=vn()&&xn();if(e||t)return()=>Promise.resolve(void 0);const n=On();return()=>d(null,null,function*(){const e=yield n(),t=e=>null===e?null:qt(e,10);return[t(e[0]),t(e[1]),t(e[2]),t(e[3])]})},canvas:function(){return function(e){let t,n,o=!1;const[i,r]=function(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}();!function(e,t){return!(!t||!e.toDataURL)}(i,r)?t=n="unsupported":(o=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(r),e?t=n="skipped":[t,n]=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n=`Cwm fjordbank gly ${String.fromCharCode(55357,56835)}`;t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);const n=_n(e),o=_n(e);if(n!==o)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,o,i]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,i,40,0,2*Math.PI,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);const i=_n(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=bn()&&Sn()&&wn(),t=vn()&&function(){const e=window,t=navigator,{CSS:n}=e;return Ut(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}();return e||t}())},osCpu:function(){return navigator.oscpu},languages:function(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))mn()&&function(){const e=window;return Ut([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Kt(Jt(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(bn()&&Sn()&&wn()))return function(){const e=screen,t=e=>Kt(Xt(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=Kt(Xt(navigator.hardwareConcurrency),void 0);return void 0!==e&&vn()&&xn()?e>=8?8:4:e},timezone:function(){var e;const t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){const e=(new t).resolvedOptions().timeZone;if(e)return e}const n=-function(){const e=(new Date).getFullYear();return Math.max(Jt(new Date(e,0,1).getTimezoneOffset()),Jt(new Date(e,6,1).getTimezoneOffset()))}();return`UTC${n>=0?"+":""}${n}`},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!gn()&&!function(){const e=window,t=navigator;return Ut(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!gn()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){const{platform:e}=navigator;return"MacIntel"===e&&bn()&&!yn()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return Ut(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const o=e[n];if(!o)continue;const i=[];for(let e=0;e<o.length;++e){const t=o[e];i.push({type:t.type,suffixes:t.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:i})}return t},touchSupport:function(){const e=navigator;let t,n=0;void 0!==e.maxTouchPoints?n=Xt(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(o){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&"object"==typeof n&&e.push(t)}return e.sort()},cookiesEnabled:function(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}},colorGamut:function(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e},invertedColors:function(){return!!Fn("inverted")||!Fn("none")&&void 0},forcedColors:function(){return!!jn("active")||!jn("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=100;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}},contrast:function(){return Nn("no-preference")?0:Nn("high")||Nn("more")?1:Nn("low")||Nn("less")?-1:Nn("forced")?10:void 0},reducedMotion:function(){return!!Vn("reduce")||!Vn("no-preference")&&void 0},reducedTransparency:function(){return!!Hn("reduce")||!Hn("no-preference")&&void 0},hdr:function(){return!!Zn("high")||!Zn("standard")&&void 0},math:function(){const e=Dn.acos||Gn,t=Dn.acosh||Gn,n=Dn.asin||Gn,o=Dn.asinh||Gn,i=Dn.atanh||Gn,r=Dn.atan||Gn,a=Dn.sin||Gn,s=Dn.sinh||Gn,c=Dn.cos||Gn,l=Dn.cosh||Gn,d=Dn.tan||Gn,u=Dn.tanh||Gn,f=Dn.exp||Gn,p=Dn.expm1||Gn,h=Dn.log1p||Gn;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,Dn.log(g+Dn.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>Dn.log(e+Dn.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>Dn.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>Dn.exp(e)-1/Dn.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(Dn.exp(e)+1/Dn.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(Dn.exp(2*e)-1)/(Dn.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>Dn.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>Dn.log(1+e))(10),powPI:(e=>Dn.pow(Dn.PI,e))(-100)};var g},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){const{ApplePaySession:e}=window;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(Xn())return-3;try{return e.canMakePayments()?1:0}catch(t){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(t)}},privateClickMeasurement:function(){var e;const t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(Cn()||bn()))return-2;if(!window.AudioContext)return-1;const e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function({cache:e}){var t,n,o,i,r,a;const s=eo(e);if(!s)return-1;if(!ao(s))return-2;const c=io()?null:s.getExtension(Qn);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function({cache:e}){const t=eo(e);if(!t)return-1;if(!ao(t))return-2;const n=t.getSupportedExtensions(),o=t.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(const d of Object.keys(o))r.push(`${d}=${o[d]}`);const l=no(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${Jn.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===Qn&&io()||"WEBGL_polygon_mode"===d&&ro())continue;const e=t.getExtension(d);if(e)for(const n of no(e)){const o=e[n];s.push(`${n}=${o}${Kn.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of Un)for(const e of qn){const n=to(t,d,e);c.push(`${d}.${e}=${n.join(",")}`)}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function co(e){const t=function(e){if(Cn())return.4;if(bn())return!yn()||Sn()&&wn()?.3:.5;const t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return qt(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score".replace(/\$/g,`${n}`)}}function lo(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?s({name:(n=t).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):t;var n,o},2)}function uo(e){return pn(function(e){let t="";for(const n of Object.keys(e).sort()){const o=e[n],i="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${i}`}return t}(e))}function fo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):Zt(Math.min(e,t))}(e,2*e)}function po(e,t){const n=Date.now();return{get(o){return d(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=co(e);return{get visitorId(){return void 0===t&&(t=uo(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:Ht}}(r);return(t||(null==o?void 0:o.debug))&&console.log(`Copy the text below to get the debug data:\n\n\`\`\`\nversion: ${a.version}\nuserAgent: ${navigator.userAgent}\ntimeBetweenLoadAndGet: ${i-n}\nvisitorId: ${a.visitorId}\ncomponents: ${lo(r)}\n\`\`\``),a})}}}var ho={load:function(){return d(this,arguments,function*(e={}){const{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${Ht}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield fo(t);const i=function(e){return hn(so,e,[])}({cache:{},debug:n});return po(i,n)})},hashComponents:uo,componentsToDebugString:lo};D(),function(){if($||"undefined"==typeof window)return;$=!0;const e=window;let t=e.BrainfishAnalytics?Y(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?Y(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=Y(e.BrainfishAnalytics))}}();let go=null;const mo="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(go||(go=function(){const e=[];let t=null;function n(n,o){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const r=i[e[e.length-1]];if("function"==typeof r)return r.apply(i,o)}else e.push([n,o])}return{Widgets:{init:(...e)=>n("Widgets.init",e),setTheme:(...e)=>n("Widgets.setTheme",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:o})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:o}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),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(o){for(t=o;e.length>0;){const[t,o]=e.shift();n(t,o)}}}}(),"undefined"!=typeof window&&(window.Brainfish=go)),go),bo=new Map,yo=new Map;let wo=!1;function vo(e,t,n,o,i){return d(this,null,function*(){var r,a,s,c,l,d,u;const f=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(a=null==t?void 0:t.settings)?void 0:a.enableRecording)||!1,p=(null==(s=e.overrides)?void 0:s.version)||(null==t?void 0:t.version);yo.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(Mt(e,t,i),wo||(wo=!0,Vt(()=>{yo.forEach(({options:e,config:t,fingerprint:n})=>{var o;const i=(null==(o=e.overrides)?void 0:o.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&&Mt(e,t,n)})}))):h.push(E(e,t)),h.push(_(e.widgetKey,t.trackingToken||"",n,o,f,{blocklist:null==(c=null==t?void 0:t.settings)?void 0:c.recordingBlocklist,sampleRate:null==(d=null==(l=null==t?void 0:t.settings)?void 0:l.ambientSettings)?void 0:d.sampleRate,_allowLocalhostRecording:null==(u=null==t?void 0:t.settings)?void 0:u._allowLocalhostRecording})),h.push(Rt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&mo._setRealBrainfish(g.value)})}mo.Widgets.isReady=!1,mo.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):z(e)},mo.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},mo.Widgets.init=e=>d(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=S(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield ho.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(A(e.config));else{const{config:n}=yield v({widgetKey:e.widgetKey,apiHost:t});r=n}let a=bo.get(e.widgetKey);if(a||(a=vo(e,r,t,n,i),bo.set(e.widgetKey,a)),yield a,!lt.isWidgetDOMExisting(e.widgetKey,r)){bo.delete(e.widgetKey);const o=vo(e,r,t,n,i);bo.set(e.widgetKey,o),yield o}yield Ot(r),mo.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),mo.Widgets.setTheme=e=>{var t;const n=document.querySelector("#bf-iframe-container .trigger-iframe");if(n){const o=new URL(n.src),i=new URLSearchParams(o.hash.substring(1)),r=i.get("theme");let a;r&&(a=JSON.parse(A(r)));const c=s(s({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:c},"*");const l=M(JSON.stringify(c));i.set("theme",l),o.hash=`#${i.toString()}`,n.src=o.toString()}},mo.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{wt.set(e,t)})(e,t)};exports.BrainfishAnalytics=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)},exports.default=mo;
|
|
1
|
+
"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&a(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>new Promise((o,i)=>{var r=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?o(e.value):Promise.resolve(e.value).then(r,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]="82ab1a8c-a246-44b1-9682-72f46d8ebb0c",e._sentryDebugIdIdentifier="sentry-dbid-82ab1a8c-a246-44b1-9682-72f46d8ebb0c")}catch(n){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var h,g,m,b;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.24.0"},(g=h||(h={})).Sidebar="sidebar",g.Searchbar="searchbar",g.Popup="popup",h.Sidebar,h.Searchbar,h.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),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}}}(b=m||(m={})).LINK="link",b.CALLBACK="callback",b.EMAIL="email",b.PHONE="phone";const v=(e,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const o=t.toJSON(),i=e||"https://app.brainfi.sh",r={error:`WebWidgetVersion: 1.24.0. ${t.message}`,stack:t.stack,cause:{message:o.message,stack:o.stack,cause:o.cause}};fetch(`${i}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(r)})})(e,new y(i,{cause:r}),o)};const w=e=>d(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return d(this,null,function*(){let o,i=0;for(;i<3;)try{const o=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!o.ok)throw new Error(`API call failed with status: ${o.status}`);const i=yield o.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(r){if(o=r,i++,i>=3)throw v(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const o=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{o[e]&&(o[e]=o[e].map(e=>e.type===m.CALLBACK&&e.value?c(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),c(s({},e),{settings:o,apiHost:n,widgetMode:e.widgetType,apiKey:t})},S=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",C=e=>d(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=>d(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const o=document.createElement("script");o.id="brainfish-widget",o.src=e,o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},o.onerror=t=>{const o=t,i={message:`Failed to load script: ${e}`,type:o.type,fileName:o.filename,lineNumber:o.lineno,columnNumber:o.colno,error:o.error?o.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(o)})}))(e);return{widget:t}}catch(o){Math.random()<.05&&v(e,o,o.message,t)}});const k=new Set,E=(e,t)=>d(null,null,function*(){const n=S(e.overrides);try{if(k.has(e.widgetKey))return;const o=yield C({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.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())})(t.settings[e],n))}),function(e,t){t.widgetType===h.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(i,r),k.add(e.widgetKey),i}}catch(o){v(n,o,o.message,e.widgetKey)}}),I=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},L=e=>{try{if(I())return window.localStorage.getItem(e)}catch(t){}return null},W=e=>{try{I()&&window.localStorage.removeItem(e)}catch(t){}};let T=!1;const _=(e,t,n,...o)=>d(null,[e,t,n,...o],function*(e,t,n,o="",i=!1,r){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!T)try{const a=(()=>{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)})(),s="true"===L("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),T=!0,yield((e,t)=>d(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const o=document.createElement("script");o.id="brainfish-analytics",o.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},o.onerror=()=>{Math.random()<.05&&v(e,new Error(`Failed to load script: ${o.src}`),`Failed to load script: ${o.src}`,t),n(void 0)},document.head.appendChild(o)})}))(n,e)}catch(a){v(n,a,"Failed to initialize BrainfishAnalytics",e)}});function M(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 A=e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=t.charCodeAt(e);return(new TextDecoder).decode(o)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")},O="USER_IDENTIFY";let P=null;const R=new Set,B=new Map;let F=!1;function j(e){try{return new URL(e).origin}catch(t){return e}}function N(e){R.add(j(e))}function V(e,t,n){var o;const i=function(e,t){try{return new URL(e.src).origin}catch(n){if(t)return j(t)}return"*"}(e,n);null==(o=e.contentWindow)||o.postMessage({type:O,payload:t},i)}function H(e,t,n){var o;N(t),B.set(e,{widgetHost:t});const i=()=>{P&&V(e,P,t)};e.addEventListener("load",i,(null==n?void 0:n.signal)?{signal:n.signal}:void 0),null==(o=null==n?void 0:n.signal)||o.addEventListener("abort",()=>{B.delete(e)},{once:!0}),e.contentWindow&&i()}function Z(e){var t;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&P&&e.source&&function(e){if(R.has(e))return!0;for(const n of B.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e.origin)&&(!function(e){if(!e)return!1;for(const t of B.keys())if(t.contentWindow===e)return!0;return!1}(e.source)?console.warn("[Brainfish] Rejected REQUEST_USER_IDENTITY from untrusted iframe source:",e.origin):e.source.postMessage({type:O,payload:P},e.origin))}function D(){F||"undefined"==typeof window||(F=!0,window.addEventListener("message",Z))}const G=new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function z(e){D();const t=function(e){const t=e.userId,n="string"==typeof t?t:"number"==typeof t&&Number.isFinite(t)?String(t):"";if(!n)return console.warn("[Brainfish] Widgets.identify requires a non-empty userId (string or finite number)."),null;const o={userId:n};"string"==typeof e.firstName&&(o.firstName=e.firstName),"string"==typeof e.lastName&&(o.lastName=e.lastName),"string"==typeof e.email&&(o.email=e.email),"string"==typeof e.phone&&(o.phone=e.phone),"string"==typeof e.avatar&&(o.avatar=e.avatar);const i={};for(const a of Object.keys(e))G.has(a)||(i[a]=e[a]);const r=e.properties&&"object"==typeof e.properties&&!Array.isArray(e.properties)?e.properties:void 0;return(Object.keys(i).length>0||r)&&(o.properties=s(s({},i),r)),o}(e);return t?(t.phone&&!/^\+[1-9]\d{1,14}$/.test(t.phone)&&console.warn("[Brainfish] phone should be in E.164 format (e.g., +14155552671)."),P=t,function(e){for(const[t,{widgetHost:n}]of B)V(t,e,n)}(t),t):null}function $(e){if(e.__bfIdentityWrapped)return e;const t=(t,...n)=>{if("identify"===t&&n[0]&&"object"==typeof n[0]&&!Array.isArray(n[0])){const o=z(n[0]);if(o)return e(t,o,...n.slice(1))}return e(t,...n)};return t.__bfIdentityWrapped=!0,e.q&&(t.q=e.q),t}let Y=!1;function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,K={exports:{}},U={exports:{}},q={exports:{}};function Q(){return J||(J=1,function(e,t){function n(e){return Math.round(255*e)}function o(e,t,o){return n(e)+","+n(t)+","+n(o)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=o),0===t)return i(n,n,n);var r=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(r%2-1)),c=0,l=0,d=0;r>=0&&r<1?(c=a,l=s):r>=1&&r<2?(c=s,l=a):r>=2&&r<3?(l=a,d=s):r>=3&&r<4?(l=s,d=a):r>=4&&r<5?(c=s,d=a):r>=5&&r<6&&(c=a,d=s);var u=n-a/2;return i(c+u,l+u,d+u)},e.exports=t.default}(q,q.exports)),q.exports}var ee,te={exports:{}};function ne(){return ee||(ee=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}(te,te.exports)),te.exports}var oe,ie,re,ae={exports:{}};function se(){return oe||(oe=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(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&i(a,n.prototype),a}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=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 r(e){return(r=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 o,i=t[0],r=[];for(o=1;o<t.length;o+=1)r.push(t[o]);return r.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=function(e){var t,n;function o(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 o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];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=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),o}(n(Error)),e.exports=t.default}(ae,ae.exports)),ae.exports}function ce(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,o.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 r=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:r}}if(t.match(c))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(l)){var h=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:h}}var g=d.exec(t);if(g)return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};var m=u.exec(t.substring(0,50));if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10),alpha:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])};var b=f.exec(t);if(b){var y=parseInt(""+b[1],10),v=parseInt(""+b[2],10)/100,w=parseInt(""+b[3],10)/100,x="rgb("+(0,n.default)(y,v,w)+")",S=d.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 C=p.exec(t.substring(0,50));if(C){var k=parseInt(""+C[1],10),E=parseInt(""+C[2],10)/100,I=parseInt(""+C[3],10)/100,L="rgb("+(0,n.default)(k,E,I)+")",W=d.exec(L);if(!W)throw new i.default(4,t,L);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(Q()),o=r(ne()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,c=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^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}(U,U.exports)),U.exports}function le(){return re||(re=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,o.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],r=n[1],a=n[2];return parseFloat((.2126*i+.7152*r+.0722*a).toFixed(3))};var n,o=(n=ce())&&n.__esModule?n:{default:n};e.exports=t.default}(K,K.exports)),K.exports}const de=X(le());var ue,fe={exports:{}},pe={exports:{}};function he(){return ue||(ue=1,function(e,t){function n(e,t,o){return function(){var i=o.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}(pe,pe.exports)),pe.exports}var ge,me={exports:{}};function be(){return ge||(ge=1,e=me,(t=me.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),me.exports;var e,t}var ye,ve,we={exports:{}},xe={exports:{}};function Se(){return ye||(ye=1,e=xe,(t=xe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,o=e.green/255,i=e.blue/255,r=Math.max(n,o,i),a=Math.min(n,o,i),s=(r+a)/2;if(r===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=r-a,l=s>.5?c/(2-r-a):c/(r+a);switch(r){case n:t=(o-i)/c+(o<i?6:0);break;case o:t=(i-n)/c+2;break;default:t=(n-o)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),xe.exports;var e,t}function Ce(){return ve||(ve=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(ce()),o=i(Se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(we,we.exports)),we.exports}var ke,Ee={exports:{}},Ie={exports:{}},Le={exports:{}},We={exports:{}};function Te(){return ke||(ke=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}(We,We.exports)),We.exports}var _e,Me,Ae,Oe={exports:{}};function Pe(){return _e||(_e=1,e=Oe,(t=Oe.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),Oe.exports;var e,t}function Re(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(Q()),o=r(Te()),i=r(Pe());function r(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,o.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,o){return(0,n.default)(e,t,o,s)},e.exports=t.default}(Le,Le.exports)),Le.exports}function Be(){return Ae||(Ae=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 o.default(1)};var n=i(Re()),o=i(se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var Fe,je={exports:{}};function Ne(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,n.default)(e,t,r):"rgba("+(0,o.default)(e,t,r)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)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(Re()),o=r(Q()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(je,je.exports)),je.exports}var Ve,He={exports:{}};function Ze(){return Ve||(Ve=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(t)+(0,o.default)(r));if("object"==typeof e&&void 0===t&&void 0===r)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(Te()),o=r(Pe()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(He,He.exports)),He.exports}var De,Ge,ze,$e={exports:{}};function Ye(){return De||(De=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,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 r&&"number"==typeof a)return a>=1?(0,o.default)(e,t,r):"rgba("+e+","+t+","+r+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)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(ce()),o=r(Ze()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}($e,$e.exports)),$e.exports}function Xe(){return Ge||(Ge=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,r.default)(e);if(c(e))return(0,i.default)(e);if(u(e))return(0,o.default)(e);if(d(e))return(0,n.default)(e);throw new a.default(8)};var n=s(Be()),o=s(Ne()),i=s(Ze()),r=s(Ye()),a=s(se());function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},d=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(Ee,Ee.exports)),Ee.exports}function Je(){return ze||(ze=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(he()),o=a(be()),i=a(Ce()),r=a(Xe());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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness-parseFloat(e))}))});t.default=c,e.exports=t.default}(fe,fe.exports)),fe.exports}const Ke=X(Je());var Ue,qe={exports:{}};function Qe(){return Ue||(Ue=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(he()),o=a(be()),i=a(Ce()),r=a(Xe());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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness+parseFloat(e))}))});t.default=c,e.exports=t.default}(qe,qe.exports)),qe.exports}const et=X(Qe()),tt="bf-iframe-container",nt="bf-trigger-button",ot="bf-search-bar-iframe-container",it="bf-search-bar-iframe-backdrop";function rt(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 o=de(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;max-width:36px;max-height:36px}.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);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));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,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@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.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.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 .${nt} { background: ${e}; }\n .${nt}:hover {\n background: ${o?Ke(.05,e):et(.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")}}class at{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function st(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const ct="brainfish-search-widget";function lt(e){const t=document.querySelector(e);return t instanceof HTMLElement?t:null}function dt(e){const t=null==e?void 0:e.trim();if(!t)return null;const n=lt(t);return n||console.warn(`[Brainfish] mountTarget "${t}" not found or is not a valid element. Falling back to document.body.`),n}function ut(e,t){const n=function(e){const t=document.getElementById(`trigger-button-${e}`);return t||document.querySelector(`.${tt}`)}(e);if(!n)return!1;const o=null==t?void 0:t.trim();if(!o)return!0;const i=lt(o);if(!i)return!1;if(!i.contains(n))return!1;if(document.getElementById(`trigger-button-${e}`)){const e=document.querySelector(`.${tt}`);if(e&&!i.contains(e))return!1}return!0}function ft(e,t){const n=()=>{(function(e){var t;return null!=(t=dt(e))?t:document.body})(t).appendChild(e)};if(!document.body)return console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),void document.addEventListener("DOMContentLoaded",n,{once:!0});n()}const pt=["bottom-left","bottom-right","top-left","top-right"];let ht;function gt(e){return pt.includes(e)}class mt{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===h.Searchbar?ot:tt}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${it}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,o;const i=document.querySelector(`.${this.containerClass}`),r=null==i?void 0:i.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==r?void 0:r.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==r?void 0:r.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(o=null==r?void 0:r.contentWindow)||o.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==h.Searchbar){null==i||i.classList.add("open");const t=gt(a=e.position)?a:ht;t&&(null==i||i.classList.add(`position-${t}`),null==i||i.setAttribute("data-current-position",t))}var a;if(null==i||i.setAttribute("aria-hidden","false"),this.widgetType!==h.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=st("div",it);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(ct);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==h.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){var n;const o=document.querySelector(`.${ot}[data-widget-key="${e}"]`);if(o){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(o)}return"Search"!==t.widgetType&&ut(e,null==(n=t.settings)?void 0:n.mountTarget)}}class bt{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===h.Popup)}static clear(){this.instances.clear()}}l(bt,"instances",new Map);const yt=({formUrl:e,width:t="500px",height:n="600px"})=>{const o=document.createElement("div");o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("tabindex","-1"),o.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const i=document.createElement("button");i.innerHTML="×",i.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const r=document.createElement("iframe");r.src=e,r.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[i,r],n=document.activeElement,o=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?o<=0?t[t.length-1].focus():t[o-1].focus():o>=t.length-1?t[0].focus():t[o+1].focus()}else"Escape"===e.key&&c()},c=()=>{o.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",i.onclick=c,l.onclick=c,document.addEventListener("keydown",s),o.appendChild(i),o.appendChild(r),document.body.appendChild(l),document.body.appendChild(o),o.focus(),r.onload=()=>{r.setAttribute("tabindex","0"),i.focus()}},vt=e=>`brainfish_conversation_${e}`,wt={save(e,t){if(t){const o=L(vt(e));let i=Date.now();if(o)try{const e=JSON.parse(o);e.conversationId===t&&(i=e.persistedAt)}catch(n){}const r={conversationId:t,persistedAt:i};((e,t)=>{try{I()&&window.localStorage.setItem(e,t)}catch(n){}})(vt(e),JSON.stringify(r))}else W(vt(e))},load(e){const t=L(vt(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(W(vt(e)),null):n.conversationId}catch(n){return W(vt(e)),null}},clear(e){W(vt(e))}};class xt{static getIframeForInstance(e){var t,n;const o=e.widgetType===h.Searchbar?ot:tt,i=e.widgetType===h.Searchbar?`.${o}[data-widget-key="${e.widgetKey}"]`:`.${o}`;return null!=(n=null==(t=document.querySelector(i))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,o;null==(o=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||o.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=yt,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=bt.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=bt.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,o={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(o.newConversation=!0),(null==n?void 0:n.trigger)&&(o.trigger=n.trigger),(null==n?void 0:n.position)&&(o.position=n.position),t.openWidget(o)}}static createNewThread(){const e=bt.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=bt.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=bt.getOpenInstance();if(n||(n=bt.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=c(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(o)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=bt.getOpenInstance();const n=!!t;t||(t=bt.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=bt.getOpenInstance())?e:bt.getClosedPopupInstance();t?(wt.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(xt,"isInitialized",!1);class St{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case h.Searchbar:n="searchbar_widget";break;case h.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,c(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class Ct{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new at(e,t),this.domController=new mt(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new St(t,e)}static getInstance(e){return bt.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),bt.register(this.widgetKey,this),xt.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=wt.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){bt.unregister(this.widgetKey)}static initialize(e){const t=new Ct(e.widgetKey,e.widgetType);return t.initialize(e),t}}function kt({widgetUrl:e,widgetType:t,props:n}){const o=t===h.Searchbar?ot:tt,i=st("div",o,s({id:o,"aria-live":"polite","aria-hidden":t===h.Searchbar?"false":"true"},n||{})),r=st("div","iframe-loading-indicator"),a=st("div","spinner");r.setAttribute("aria-label","Loading content"),r.setAttribute("role","status"),r.appendChild(a),i.appendChild(r);const c=st("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{r.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),r.innerHTML="";const t=st("div","loading-error");r.appendChild(t),r.setAttribute("aria-label","Failed to load content")}),i.appendChild(c),{iframeContainer:i,iframe:c}}function Et(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())})()}const It=new Map,Lt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,Wt=(e,t)=>d(null,null,function*(){if(It.has(e)){const i=It.get(e);if("function"!=typeof i)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield i(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(o){return{success:!1,reason:Lt(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),Tt=new Map,_t=new Set;function Mt(e,{widgetHost:t,apiHost:n,widgetKey:o,widgetType:i,signal:r,stateManager:a}){window.addEventListener("message",r=>d(null,null,function*(){var s,c;if(r.origin!==t)return;const{type:l,widgetKey:d}=r.data;if(!d||d===o){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${tt}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=r.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{messageId:e,eventName:t,data:n}=r.data;if(e){if(_t.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);_t.add(e),setTimeout(()=>_t.delete(e),5e3)}a.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:i,answer:a,conversation:s}=r.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=Tt.get(e.id);if(c&&Date.now()-c<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-c}ms ago)`);Tt.set(e.id,Date.now()),setTimeout(()=>Tt.delete(e.id),1e3),wt.clear(o);const l={query:i,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](i,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",o),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const r=document.createElement("script");r.src=t.toString(),document.head.appendChild(r),r.onload=()=>{window.__bfCallbacks[e.id](i,a,l),setTimeout(()=>{document.head.removeChild(r)},300)},r.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:o}=r.data,i=yield Wt(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=r.data;i!==h.Searchbar&&wt.save(o,e)}if("REQUEST_USER_IDENTITY"===l&&r.source===e.contentWindow&&i===h.Popup){const t=wt.load(o);t&&(null==(c=e.contentWindow)||c.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:r})}function At(e,t,n){let o;const i=()=>{(t=>{var o;const i={type:"UPDATE_BODY_CLASS",isMobile:t};null==(o=e.contentWindow)||o.postMessage(i,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},r=()=>{o&&clearTimeout(o),o=window.setTimeout(i,300)};i(),(()=>{const e=new ResizeObserver(r);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const Ot=new Set;function Pt(e,t,{isButtonHidden:n,triggerButtonIcon:o}){const i=document.createDocumentFragment();let r;if(n)r=Ct.initialize({isButtonHidden:n,widgetType:h.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=st("button",nt,{id:`trigger-button-${e}`,"aria-controls":tt,"aria-expanded":"false","data-name":nt}),o=st("div","trigger-button-icon",{"aria-hidden":"true"});return o.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" 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(o),{button:n,icon:o}}(e,o);i.appendChild(t),r=Ct.initialize({button:t,icon:n,widgetType:h.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=kt({widgetUrl:t,widgetType:h.Popup});return i.appendChild(a),{fragment:i,iframe:s,stateManager:r}}const Rt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i,hideTriggerButton:r})=>{const{settings:a}=e,s=null!=r?r:null==a?void 0:a.hideTriggerButton,c=null==a?void 0:a.triggerButtonIcon,l=null==a?void 0:a.mountTarget;try{if(d=null==a?void 0:a.popupPosition,ht=gt(d)?d:void 0,function(e,t){const n=dt(t);if(!n)return!1;const o=document.getElementById(`trigger-button-${e}`),i=document.querySelector(`.${tt}`);if(!o&&!i)return!1;let r=!1;o&&!n.contains(o)&&(n.appendChild(o),r=!0),i&&!n.contains(i)&&(n.appendChild(i),r=!0)}(i,l),ut(i,l))return void Ot.add(i);if(function(e){return Ot.has(e)}(i))return;rt(e);const{fragment:r,iframe:u,stateManager:f}=Pt(i,t,{isButtonHidden:s||!1,triggerButtonIcon:c||""}),p=new AbortController,{signal:g}=p;H(u,o,{signal:g}),u.onload=()=>{setTimeout(()=>{var e;Et(u,g),Mt(u,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Popup,signal:g,stateManager:f}),At(u,g,f);const r=wt.load(i),a=new URL(t).searchParams.has("conversation");r&&!a&&(null==(e=u.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:r},"*"))},0)},ft(r,l),Ot.add(i);const m=()=>{p.abort(),window.removeEventListener("beforeunload",m)};return void window.addEventListener("beforeunload",m)}catch(u){!function(e,t,n){v(e,t,t.message,n)}(n,u,i)}var d},Bt=new Map;const Ft=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i})=>{var r,a,s,c;let l=Ct.getInstance(i);null==(r=Bt.get(i))||r.abort();const d=new AbortController;Bt.set(i,d),rt(e);try{const e=document.querySelector(`.${ot}[data-widget-key="${i}"]`),r=document.querySelector(ct);e&&r&&!r.contains(e)&&(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(a=r.parentElement)||a.style.setProperty("width","100%"))),l||(l=Ct.initialize({isButtonHidden:!0,widgetType:h.Searchbar,widgetKey:i}));const{signal:u}=d,f=e=>{H(e,o,{signal:u}),Et(e,u),Mt(e,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Searchbar,signal:u,stateManager:l}),At(e,u,l)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(c=t.contentDocument)?void 0:c.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:o}=kt({widgetUrl:t,widgetType:h.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":i}});o.onload=()=>{setTimeout(()=>{f(o)},0)},e.appendChild(n),r?(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(s=r.parentElement)||s.style.setProperty("width","100%"))):document.body.appendChild(e)}const p=()=>{d.abort(),Bt.delete(i),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(u){!function(e,t,n){v(e,t,t.message,n)}(n,u,i)}},jt=(e,t,n)=>{var a;const l=S(e.overrides),d=(null==(u=e.overrides)?void 0:u.widgetHost)||"https://agent.brainfi.sh";var u;N(d);const f=null==(a=e.overrides)?void 0:a.hideTriggerButton,{theme:p,settings:h}=t,g=e.overrides||{},{theme:m,redirectRules:b,regions:y,customCss:v}=g,w=((e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&r.call(e,a)&&(n[a]=e[a]);return n})(g,["theme","redirectRules","regions","customCss"]),x=s(s({},p),m),C=s(s({},h),w),k=M(JSON.stringify(b)),E={theme:M(JSON.stringify(x)),settings:M(JSON.stringify(C)),redirectRules:k};y&&(E.regions=M(JSON.stringify(y))),v&&(E.customCss=M(v)),n&&(E.fingerprint=M(n));const I=`${d}/?widgetKey=${e.widgetKey}#${new URLSearchParams(E).toString()}`,L=c(s({},t),{theme:x,settings:C});"Search"===t.widgetType?Ft({config:L,widgetUrl:I,apiHost:l,widgetHost:d,widgetKey:e.widgetKey}):Rt({config:L,widgetUrl:I,apiHost:l,widgetHost:d,widgetKey:e.widgetKey,hideTriggerButton:f})};var Nt=(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(Nt||{});const Vt=e=>d(null,null,function*(){if(e.widgetType===h.Popup){const e=window.fcWidget?Nt.FRESHCHAT:null;e&&e===Nt.FRESHCHAT&&(yield d(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Ht="brainfish-nudges",Zt=(e,t)=>d(null,null,function*(){try{yield d(null,null,function*(){if(!document.getElementById(Ht))return new Promise(e=>{const t=document.createElement("script");t.id=Ht,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){v(e,n,"Failed to initialize Nudge widget",t)}});let Dt,Gt,zt,$t=!1;const Yt=e=>{null==Dt||Dt.abort(),Dt=new AbortController;const{signal:t}=Dt;let n=window.location.pathname;const o=()=>{if(t.aborted)return;const o=window.location.pathname;o!==n&&(n=o,e())};window.addEventListener("popstate",o,{signal:t}),$t||(Gt=history.pushState,zt=history.replaceState,history.pushState=function(...e){Gt.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){zt.apply(this,e),setTimeout(o,0)},$t=!0),t.addEventListener("abort",()=>{$t&&(history.pushState=Gt,history.replaceState=zt,$t=!1)})};var Xt="5.2.0";function Jt(e,t){return new Promise(n=>setTimeout(n,e,t))}function Kt(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Ut(e){return!!e&&"function"==typeof e.then}function qt(e,t){try{const n=e();Ut(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function Qt(e,t,n=16){return d(this,null,function*(){const o=Array(e.length);let i=Date.now();for(let r=0;r<e.length;++r){o[r]=t(e[r],r);const a=Date.now();a>=i+n&&(i=a,yield Kt())}return o})}function en(e){return e.then(void 0,()=>{}),e}function tn(e){return parseInt(e)}function nn(e){return parseFloat(e)}function on(e,t){return"number"==typeof e&&isNaN(e)?t:e}function rn(e){return e.reduce((e,t)=>e+(t?1:0),0)}function an(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function sn(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let l=0,d=0,u=0,f=0;f+=r+(65535&t[1]),u+=f>>>16,f&=65535,u+=i+c,d+=u>>>16,u&=65535,d+=o+s,l+=d>>>16,d&=65535,l+=n+a,l&=65535,e[0]=l<<16|d,e[1]=u<<16|f}function cn(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,l=65535&t[1];let d=0,u=0,f=0,p=0;p+=r*l,f+=p>>>16,p&=65535,f+=i*l,u+=f>>>16,f&=65535,f+=r*c,u+=f>>>16,f&=65535,u+=o*l,d+=u>>>16,u&=65535,u+=i*c,d+=u>>>16,u&=65535,u+=r*s,d+=u>>>16,u&=65535,d+=n*l+o*c+i*s+r*a,d&=65535,e[0]=d<<16|u,e[1]=f<<16|p}function ln(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function dn(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function un(e,t){e[0]^=t[0],e[1]^=t[1]}const fn=[4283543511,3981806797],pn=[3301882366,444984403];function hn(e){const t=[0,e[0]>>>1];un(e,t),cn(e,fn),t[1]=e[0]>>>1,un(e,t),cn(e,pn),t[1]=e[0]>>>1,un(e,t)}const gn=[2277735313,289559509],mn=[1291169091,658871167],bn=[0,5],yn=[0,1390208809],vn=[0,944331445];function wn(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e);t=t||0;const o=[0,n.length],i=o[1]%16,r=o[1]-i,a=[0,t],s=[0,t],c=[0,0],l=[0,0];let d;for(d=0;d<r;d+=16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,l[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,l[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,cn(c,gn),ln(c,31),cn(c,mn),un(a,c),ln(a,27),sn(a,s),cn(a,bn),sn(a,yn),cn(l,mn),ln(l,33),cn(l,gn),un(s,l),ln(s,31),sn(s,a),cn(s,bn),sn(s,vn);c[0]=0,c[1]=0,l[0]=0,l[1]=0;const u=[0,0];switch(i){case 15:u[1]=n[d+14],dn(u,48),un(l,u);case 14:u[1]=n[d+13],dn(u,40),un(l,u);case 13:u[1]=n[d+12],dn(u,32),un(l,u);case 12:u[1]=n[d+11],dn(u,24),un(l,u);case 11:u[1]=n[d+10],dn(u,16),un(l,u);case 10:u[1]=n[d+9],dn(u,8),un(l,u);case 9:u[1]=n[d+8],un(l,u),cn(l,mn),ln(l,33),cn(l,gn),un(s,l);case 8:u[1]=n[d+7],dn(u,56),un(c,u);case 7:u[1]=n[d+6],dn(u,48),un(c,u);case 6:u[1]=n[d+5],dn(u,40),un(c,u);case 5:u[1]=n[d+4],dn(u,32),un(c,u);case 4:u[1]=n[d+3],dn(u,24),un(c,u);case 3:u[1]=n[d+2],dn(u,16),un(c,u);case 2:u[1]=n[d+1],dn(u,8),un(c,u);case 1:u[1]=n[d],un(c,u),cn(c,gn),ln(c,31),cn(c,mn),un(a,c)}return un(a,o),un(s,o),sn(a,s),sn(s,a),hn(a),hn(s),sn(a,s),sn(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function xn(e,t,n,o){const i=Object.keys(e).filter(e=>!function(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}(n,e)),r=en(Qt(i,n=>function(e,t){const n=en(new Promise(n=>{const o=Date.now();qt(e.bind(null,t),(...e)=>{const t=Date.now()-o;if(!e[0])return n(()=>({error:e[1],duration:t}));const i=e[1];if(function(e){return"function"!=typeof e}(i))return n(()=>({value:i,duration:t}));n(()=>new Promise(e=>{const n=Date.now();qt(i,(...o)=>{const i=t+Date.now()-n;if(!o[0])return e({error:o[1],duration:i});e({value:o[1],duration:i})})}))})}));return function(){return n.then(e=>e())}}(e[n],t),o));return function(){return d(this,null,function*(){const e=yield r,t=yield Qt(e,e=>en(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function Sn(){const e=window,t=navigator;return rn(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Cn(){const e=window,t=navigator;return rn(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function kn(){const e=window;return rn(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function En(){const e=window,{HTMLElement:t,Document:n}=e;return rn(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function In(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function Ln(){var e,t;const n=window;return rn(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Wn(){const{CSS:e}=window;return rn([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Tn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return rn([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function _n(){const e=Cn(),t=Ln(),n=window,o=navigator,i="connection";return e?rn([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&rn(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function Mn(e){const t=new Error(e);return t.name=e,t}function An(e,t,n=50){return d(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield Jt(n);const s=a.createElement("iframe");try{for((yield new Promise((e,n)=>{let o=!1;const i=()=>{o=!0,e()};s.onload=i,s.onerror=e=>{o=!0,n(e)};const{style:r}=s;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);const c=()=>{var e,t;o||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}));!(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body);)yield Jt(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function On(e){const[t,n]=function(e){var t,n;const o=`Unexpected syntax '${e}'`,i=/^\s*([a-z-]*)(.*)$/i.exec(e),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=(e,t)=>{a[e]=a[e]||[],a[e].push(t)};for(;;){const e=s.exec(i[2]);if(!e)break;const r=e[0];switch(r[0]){case".":c("class",r.slice(1));break;case"#":c("id",r.slice(1));break;case"[":{const e=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(r);if(!e)throw new Error(o);c(e[1],null!==(n=null!==(t=e[4])&&void 0!==t?t:e[5])&&void 0!==n?n:"");break}default:throw new Error(o)}}return[r,a]}(e),o=document.createElement(null!=t?t:"div");for(const i of Object.keys(n)){const e=n[i].join(" ");"style"===i?Pn(o.style,e):o.setAttribute(i,e)}return o}function Pn(e,t){for(const n of t.split(";")){const t=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(t){const[,n,o,,i]=t;e.setProperty(n,o,i||"")}}}const Rn=["monospace","sans-serif","serif"],Bn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Fn(e){return e.toDataURL()}let jn,Nn;function Vn(){return function(){if(void 0!==Nn)return;const e=()=>{const t=Hn();Zn(t)?Nn=setTimeout(e,2500):(jn=t,Nn=void 0)};e()}(),()=>d(null,null,function*(){let e=Hn();if(Zn(e)){if(jn)return[...jn];(function(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null})()&&(yield function(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}(),e=Hn())}return Zn(e)||(jn=e),e})}function Hn(){const e=screen;return[on(nn(e.availTop),null),on(nn(e.width)-nn(e.availWidth)-on(nn(e.availLeft),0),null),on(nn(e.height)-nn(e.availHeight)-on(nn(e.availTop),0),null),on(nn(e.availLeft),null)]}function Zn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Dn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Gn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function zn(e){return matchMedia(`(forced-colors: ${e})`).matches}function $n(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Yn(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Xn(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Jn(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Kn=Math,Un=()=>0;const qn="mmMwWLliI0fiflO&1",Qn={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function eo(e){const t=_n()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const to=function(){let e=window;for(;;){const n=e.parent;if(!n||n===e)return!1;try{if(n.location.origin!==e.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}e=n}};const no=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),oo=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),io=["FRAGMENT_SHADER","VERTEX_SHADER"],ro=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],ao="WEBGL_debug_renderer_info";function so(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch(o){}if(n)break}return e.webgl={context:n},n}function co(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function lo(e){return Object.keys(e.__proto__).filter(uo)}function uo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function fo(){return Ln()}function po(){return Cn()||kn()}function ho(e){return"function"==typeof e.getParameter}const go={userAgentData:function(){return d(this,null,function*(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:e})=>!function(e){return/not/i.test(e)}(e)).map(({brand:e})=>e),n={brands:t.length>1?t.filter(e=>"Chromium"!==e):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);n.architecture=t.architecture,n.bitness=t.bitness,n.model=t.model,n.platformVersion=t.platformVersion}catch(o){if(!(o instanceof DOMException&&"NotAllowedError"===o.name))throw o;n.highEntropyStatus="not_allowed"}return n})},fonts:function(){return An((e,t)=>d(null,[e,t],function*(e,{document:t}){const n=t.body;n.style.fontSize="48px";const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i={},r={},a=e=>{const n=t.createElement("span"),{style:i}=n;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",o.appendChild(n),n},s=(e,t)=>a(`'${e}',${t}`),c=Rn.map(a),l=(()=>{const e={};for(const t of Bn)e[t]=Rn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Rn.length;d++)i[Rn[d]]=c[d].offsetWidth,r[Rn[d]]=c[d].offsetHeight;return Bn.filter(e=>{return t=l[e],Rn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return d(this,arguments,function*({debug:e}={}){if(!kn()&&!_n())return;const t=function(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}(),n=Object.keys(t),o=[].concat(...n.map(e=>t[e])),i=yield function(e){return d(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Dn(o);for(let a=0;a<e.length;++a){const t=On(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Dn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield Jt(50);n.body.appendChild(o);try{for(let t=0;t<e.length;++t)i[t].offsetParent||(r[e[t]]=!0)}finally{null===(t=o.parentNode)||void 0===t||t.removeChild(o)}return r})}(o);e&&function(e,t){let n="DOM blockers debug:\n```";for(const o of Object.keys(e)){n+=`\n${o}:`;for(const i of e[o])n+=`\n ${t[i]?"🚫":"➡️"} ${i}`}console.log(`${n}\n\`\`\``)}(t,i);const r=n.filter(e=>{const n=t[e];return rn(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return An((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",Cn()?r.style.zoom=""+1/o.devicePixelRatio:kn()&&(r.style.zoom="reset");const s=i.createElement("div");return s.textContent=[...Array(t/20|0)].map(()=>"word").join(" "),r.appendChild(s),e(i,r,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((e,t,n)=>{const o={},i={};for(const a of Object.keys(Qn)){const[n={},i=qn]=Qn[a],r=e.createElement("span");r.textContent=i,r.style.whiteSpace="nowrap";for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(r.style[e]=t)}o[a]=r,t.append(e.createElement("br"),r)}const r=Cn()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return rn([o&&"try"in o,"caretPositionFromPoint"in t,i&&"onerror"in i.prototype,n.supports("ruby-align","space-around")])>=3}();for(const a of Object.keys(Qn)){const e=o[a].getBoundingClientRect().width;i[a]=r?eo(e*n.devicePixelRatio):e}return i})},audio:function(){return kn()&&Tn()&&In()||Cn()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return rn(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}()&&function(){const e=window,{URLPattern:t}=e;return rn(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(kn()&&!En()&&!function(){const e=window;return rn(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;const n=4500,o=new t(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;const r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);const[a,s]=function(e){const t=3,n=500,o=500,i=5e3;let r=()=>{};const a=new Promise((a,s)=>{let c=!1,l=0,d=0;e.oncomplete=e=>a(e.renderedBuffer);const u=()=>{setTimeout(()=>s(Mn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(Ut(o)&&en(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(Mn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=en(a.then(e=>function(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n)),e=>{if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return()=>(s(),c)}()},screenFrame:function(){const e=kn()&&Tn()&&In(),t=Ln()&&Wn();if(e||t)return()=>Promise.resolve(void 0);const n=Vn();return()=>d(null,null,function*(){const e=yield n(),t=e=>null===e?null:an(e,10);return[t(e[0]),t(e[1]),t(e[2]),t(e[3])]})},canvas:function(){return function(e){let t,n,o=!1;const[i,r]=function(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}();!function(e,t){return!(!t||!e.toDataURL)}(i,r)?t=n="unsupported":(o=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(r),e?t=n="skipped":[t,n]=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n=`Cwm fjordbank gly ${String.fromCharCode(55357,56835)}`;t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);const n=Fn(e),o=Fn(e);if(n!==o)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,o,i]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,i,40,0,2*Math.PI,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);const i=Fn(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=kn()&&Tn()&&In(),t=Ln()&&function(){const e=window,t=navigator,{CSS:n}=e;return rn(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}();return e||t}())},osCpu:function(){return navigator.oscpu},languages:function(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))Cn()&&function(){const e=window;return rn([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return on(nn(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(kn()&&Tn()&&In()))return function(){const e=screen,t=e=>on(tn(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=on(tn(navigator.hardwareConcurrency),void 0);return void 0!==e&&Ln()&&Wn()?e>=8?8:4:e},timezone:function(){var e;const t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){const e=(new t).resolvedOptions().timeZone;if(e)return e}const n=-function(){const e=(new Date).getFullYear();return Math.max(nn(new Date(e,0,1).getTimezoneOffset()),nn(new Date(e,6,1).getTimezoneOffset()))}();return`UTC${n>=0?"+":""}${n}`},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!Sn()&&!function(){const e=window,t=navigator;return rn(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Sn()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){const{platform:e}=navigator;return"MacIntel"===e&&kn()&&!En()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return rn(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const o=e[n];if(!o)continue;const i=[];for(let e=0;e<o.length;++e){const t=o[e];i.push({type:t.type,suffixes:t.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:i})}return t},touchSupport:function(){const e=navigator;let t,n=0;void 0!==e.maxTouchPoints?n=tn(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(o){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&"object"==typeof n&&e.push(t)}return e.sort()},cookiesEnabled:function(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}},colorGamut:function(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e},invertedColors:function(){return!!Gn("inverted")||!Gn("none")&&void 0},forcedColors:function(){return!!zn("active")||!zn("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=100;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}},contrast:function(){return $n("no-preference")?0:$n("high")||$n("more")?1:$n("low")||$n("less")?-1:$n("forced")?10:void 0},reducedMotion:function(){return!!Yn("reduce")||!Yn("no-preference")&&void 0},reducedTransparency:function(){return!!Xn("reduce")||!Xn("no-preference")&&void 0},hdr:function(){return!!Jn("high")||!Jn("standard")&&void 0},math:function(){const e=Kn.acos||Un,t=Kn.acosh||Un,n=Kn.asin||Un,o=Kn.asinh||Un,i=Kn.atanh||Un,r=Kn.atan||Un,a=Kn.sin||Un,s=Kn.sinh||Un,c=Kn.cos||Un,l=Kn.cosh||Un,d=Kn.tan||Un,u=Kn.tanh||Un,f=Kn.exp||Un,p=Kn.expm1||Un,h=Kn.log1p||Un;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,Kn.log(g+Kn.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>Kn.log(e+Kn.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>Kn.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>Kn.exp(e)-1/Kn.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(Kn.exp(e)+1/Kn.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(Kn.exp(2*e)-1)/(Kn.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>Kn.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>Kn.log(1+e))(10),powPI:(e=>Kn.pow(Kn.PI,e))(-100)};var g},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){const{ApplePaySession:e}=window;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(to())return-3;try{return e.canMakePayments()?1:0}catch(t){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(t)}},privateClickMeasurement:function(){var e;const t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(_n()||kn()))return-2;if(!window.AudioContext)return-1;const e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function({cache:e}){var t,n,o,i,r,a;const s=so(e);if(!s)return-1;if(!ho(s))return-2;const c=fo()?null:s.getExtension(ao);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function({cache:e}){const t=so(e);if(!t)return-1;if(!ho(t))return-2;const n=t.getSupportedExtensions(),o=t.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(const d of Object.keys(o))r.push(`${d}=${o[d]}`);const l=lo(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${no.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===ao&&fo()||"WEBGL_polygon_mode"===d&&po())continue;const e=t.getExtension(d);if(e)for(const n of lo(e)){const o=e[n];s.push(`${n}=${o}${oo.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of io)for(const e of ro){const n=co(t,d,e);c.push(`${d}.${e}=${n.join(",")}`)}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function mo(e){const t=function(e){if(_n())return.4;if(kn())return!En()||Tn()&&In()?.3:.5;const t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return an(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score".replace(/\$/g,`${n}`)}}function bo(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?s({name:(n=t).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):t;var n,o},2)}function yo(e){return wn(function(e){let t="";for(const n of Object.keys(e).sort()){const o=e[n],i="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${i}`}return t}(e))}function vo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):Jt(Math.min(e,t))}(e,2*e)}function wo(e,t){const n=Date.now();return{get(o){return d(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=mo(e);return{get visitorId(){return void 0===t&&(t=yo(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:Xt}}(r);return(t||(null==o?void 0:o.debug))&&console.log(`Copy the text below to get the debug data:\n\n\`\`\`\nversion: ${a.version}\nuserAgent: ${navigator.userAgent}\ntimeBetweenLoadAndGet: ${i-n}\nvisitorId: ${a.visitorId}\ncomponents: ${bo(r)}\n\`\`\``),a})}}}var xo={load:function(){return d(this,arguments,function*(e={}){const{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${Xt}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield vo(t);const i=function(e){return xn(go,e,[])}({cache:{},debug:n});return wo(i,n)})},hashComponents:yo,componentsToDebugString:bo};D(),function(){if(Y||"undefined"==typeof window)return;Y=!0;const e=window;let t=e.BrainfishAnalytics?$(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?$(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=$(e.BrainfishAnalytics))}}();let So=null;const Co="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(So||(So=function(){const e=[];let t=null;function n(n,o){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const r=i[e[e.length-1]];if("function"==typeof r)return r.apply(i,o)}else e.push([n,o])}return{Widgets:{init:(...e)=>n("Widgets.init",e),setTheme:(...e)=>n("Widgets.setTheme",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:o})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:o}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),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(o){for(t=o;e.length>0;){const[t,o]=e.shift();n(t,o)}}}}(),"undefined"!=typeof window&&(window.Brainfish=So)),So),ko=new Map,Eo=new Map;let Io=!1;function Lo(e,t,n,o,i){return d(this,null,function*(){var r,a,s,c,l,d,u;const f=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(a=null==t?void 0:t.settings)?void 0:a.enableRecording)||!1,p=(null==(s=e.overrides)?void 0:s.version)||(null==t?void 0:t.version);Eo.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(jt(e,t,i),Io||(Io=!0,Yt(()=>{Eo.forEach(({options:e,config:t,fingerprint:n})=>{var o;const i=(null==(o=e.overrides)?void 0:o.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&&jt(e,t,n)})}))):h.push(E(e,t)),h.push(_(e.widgetKey,t.trackingToken||"",n,o,f,{blocklist:null==(c=null==t?void 0:t.settings)?void 0:c.recordingBlocklist,sampleRate:null==(d=null==(l=null==t?void 0:t.settings)?void 0:l.ambientSettings)?void 0:d.sampleRate,_allowLocalhostRecording:null==(u=null==t?void 0:t.settings)?void 0:u._allowLocalhostRecording})),h.push(Zt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&Co._setRealBrainfish(g.value)})}Co.Widgets.isReady=!1,Co.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):z(e)},Co.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},Co.Widgets.init=e=>d(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=S(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield xo.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(A(e.config));else{const{config:n}=yield w({widgetKey:e.widgetKey,apiHost:t});r=n}let a=ko.get(e.widgetKey);if(a||(a=Lo(e,r,t,n,i),ko.set(e.widgetKey,a)),yield a,!mt.isWidgetDOMExisting(e.widgetKey,r)){ko.delete(e.widgetKey);const o=Lo(e,r,t,n,i);ko.set(e.widgetKey,o),yield o}yield Vt(r),Co.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),Co.Widgets.setTheme=e=>{var t;const n=document.querySelector("#bf-iframe-container .trigger-iframe");if(n){const o=new URL(n.src),i=new URLSearchParams(o.hash.substring(1)),r=i.get("theme");let a;r&&(a=JSON.parse(A(r)));const c=s(s({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:c},"*");const l=M(JSON.stringify(c));i.set("theme",l),o.hash=`#${i.toString()}`,n.src=o.toString()}},Co.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{It.set(e,t)})(e,t)};exports.BrainfishAnalytics=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)},exports.default=Co;
|
|
2
2
|
//# sourceMappingURL=web.cjs.js.map
|
package/dist/web.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&a(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>new Promise((o,i)=>{var r=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?o(e.value):Promise.resolve(e.value).then(r,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]="8754439f-d54e-4747-b58f-74128c2e21b9",e._sentryDebugIdIdentifier="sentry-dbid-8754439f-d54e-4747-b58f-74128c2e21b9")}catch(n){}}(),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var h,g,m,b;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.23.0"},(g=h||(h={})).Sidebar="sidebar",g.Searchbar="searchbar",g.Popup="popup",h.Sidebar,h.Searchbar,h.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),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}}}(b=m||(m={})).LINK="link",b.CALLBACK="callback",b.EMAIL="email",b.PHONE="phone";const w=(e,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const o=t.toJSON(),i=e||"https://app.brainfi.sh",r={error:`WebWidgetVersion: 1.23.0. ${t.message}`,stack:t.stack,cause:{message:o.message,stack:o.stack,cause:o.cause}};fetch(`${i}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(r)})})(e,new y(i,{cause:r}),o)};const v=e=>d(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return d(this,null,function*(){let o,i=0;for(;i<3;)try{const o=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!o.ok)throw new Error(`API call failed with status: ${o.status}`);const i=yield o.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(r){if(o=r,i++,i>=3)throw w(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const o=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{o[e]&&(o[e]=o[e].map(e=>e.type===m.CALLBACK&&e.value?c(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),c(s({},e),{settings:o,apiHost:n,widgetMode:e.widgetType,apiKey:t})},S=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",C=e=>d(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=>d(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const o=document.createElement("script");o.id="brainfish-widget",o.src=e,o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},o.onerror=t=>{const o=t,i={message:`Failed to load script: ${e}`,type:o.type,fileName:o.filename,lineNumber:o.lineno,columnNumber:o.colno,error:o.error?o.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(o)})}))(e);return{widget:t}}catch(o){Math.random()<.05&&w(e,o,o.message,t)}});const k=/* @__PURE__ */new Set,E=(e,t)=>d(null,null,function*(){const n=S(e.overrides);try{if(k.has(e.widgetKey))return;const o=yield C({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.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())})(t.settings[e],n))}),function(e,t){t.widgetType===h.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(i,r),k.add(e.widgetKey),i}}catch(o){w(n,o,o.message,e.widgetKey)}}),I=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},L=e=>{try{if(I())return window.localStorage.getItem(e)}catch(t){}return null},W=e=>{try{I()&&window.localStorage.removeItem(e)}catch(t){}};let T=!1;const _=(e,t,n,...o)=>d(null,[e,t,n,...o],function*(e,t,n,o="",i=!1,r){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!T)try{const a=(()=>{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)})(),s="true"===L("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),T=!0,yield((e,t)=>d(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const o=document.createElement("script");o.id="brainfish-analytics",o.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},o.onerror=()=>{Math.random()<.05&&w(e,new Error(`Failed to load script: ${o.src}`),`Failed to load script: ${o.src}`,t),n(void 0)},document.head.appendChild(o)})}))(n,e)}catch(a){w(n,a,"Failed to initialize BrainfishAnalytics",e)}});function M(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 A=e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=t.charCodeAt(e);return(new TextDecoder).decode(o)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")},O="USER_IDENTIFY";let P=null;const R=/* @__PURE__ */new Set,B=/* @__PURE__ */new Map;let F=!1;function j(e){try{return new URL(e).origin}catch(t){return e}}function N(e){R.add(j(e))}function V(e,t,n){var o;const i=function(e,t){try{return new URL(e.src).origin}catch(n){if(t)return j(t)}return"*"}(e,n);null==(o=e.contentWindow)||o.postMessage({type:O,payload:t},i)}function H(e,t,n){var o;N(t),B.set(e,{widgetHost:t});const i=()=>{P&&V(e,P,t)};e.addEventListener("load",i,(null==n?void 0:n.signal)?{signal:n.signal}:void 0),null==(o=null==n?void 0:n.signal)||o.addEventListener("abort",()=>{B.delete(e)},{once:!0}),e.contentWindow&&i()}function Z(e){var t;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&P&&e.source&&function(e){if(R.has(e))return!0;for(const n of B.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e.origin)&&(!function(e){if(!e)return!1;for(const t of B.keys())if(t.contentWindow===e)return!0;return!1}(e.source)?console.warn("[Brainfish] Rejected REQUEST_USER_IDENTITY from untrusted iframe source:",e.origin):e.source.postMessage({type:O,payload:P},e.origin))}function D(){F||"undefined"==typeof window||(F=!0,window.addEventListener("message",Z))}const G=/* @__PURE__ */new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function z(e){D();const t=function(e){const t=e.userId,n="string"==typeof t?t:"number"==typeof t&&Number.isFinite(t)?String(t):"";if(!n)return console.warn("[Brainfish] Widgets.identify requires a non-empty userId (string or finite number)."),null;const o={userId:n};"string"==typeof e.firstName&&(o.firstName=e.firstName),"string"==typeof e.lastName&&(o.lastName=e.lastName),"string"==typeof e.email&&(o.email=e.email),"string"==typeof e.phone&&(o.phone=e.phone),"string"==typeof e.avatar&&(o.avatar=e.avatar);const i={};for(const a of Object.keys(e))G.has(a)||(i[a]=e[a]);const r=e.properties&&"object"==typeof e.properties&&!Array.isArray(e.properties)?e.properties:void 0;return(Object.keys(i).length>0||r)&&(o.properties=s(s({},i),r)),o}(e);return t?(t.phone&&!/^\+[1-9]\d{1,14}$/.test(t.phone)&&console.warn("[Brainfish] phone should be in E.164 format (e.g., +14155552671)."),P=t,function(e){for(const[t,{widgetHost:n}]of B)V(t,e,n)}(t),t):null}function Y(e){if(e.__bfIdentityWrapped)return e;const t=(t,...n)=>{if("identify"===t&&n[0]&&"object"==typeof n[0]&&!Array.isArray(n[0])){const o=z(n[0]);if(o)return e(t,o,...n.slice(1))}return e(t,...n)};return t.__bfIdentityWrapped=!0,e.q&&(t.q=e.q),t}let $=!1;function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,K={exports:{}},U={exports:{}},q={exports:{}};function Q(){return J||(J=1,function(e,t){function n(e){return Math.round(255*e)}function o(e,t,o){return n(e)+","+n(t)+","+n(o)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=o),0===t)return i(n,n,n);var r=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(r%2-1)),c=0,l=0,d=0;r>=0&&r<1?(c=a,l=s):r>=1&&r<2?(c=s,l=a):r>=2&&r<3?(l=a,d=s):r>=3&&r<4?(l=s,d=a):r>=4&&r<5?(c=s,d=a):r>=5&&r<6&&(c=a,d=s);var u=n-a/2;return i(c+u,l+u,d+u)},e.exports=t.default}(q,q.exports)),q.exports}var ee,te={exports:{}};function ne(){return ee||(ee=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}(te,te.exports)),te.exports}var oe,ie,re,ae={exports:{}};function se(){return oe||(oe=1,function(e,t){function n(e){var t="function"==typeof Map?/* @__PURE__ */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(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&i(a,n.prototype),a}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=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 r(e){return(r=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 o,i=t[0],r=[];for(o=1;o<t.length;o+=1)r.push(t[o]);return r.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=/* @__PURE__ */function(e){var t,n;function o(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 o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];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=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),o}(/* @__PURE__ */n(Error)),e.exports=t.default}(ae,ae.exports)),ae.exports}function ce(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,o.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 r=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:r}}if(t.match(c))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(l)){var h=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:h}}var g=d.exec(t);if(g)return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};var m=u.exec(t.substring(0,50));if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10),alpha:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])};var b=f.exec(t);if(b){var y=parseInt(""+b[1],10),w=parseInt(""+b[2],10)/100,v=parseInt(""+b[3],10)/100,x="rgb("+(0,n.default)(y,w,v)+")",S=d.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 C=p.exec(t.substring(0,50));if(C){var k=parseInt(""+C[1],10),E=parseInt(""+C[2],10)/100,I=parseInt(""+C[3],10)/100,L="rgb("+(0,n.default)(k,E,I)+")",W=d.exec(L);if(!W)throw new i.default(4,t,L);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(/* @__PURE__ */Q()),o=r(/* @__PURE__ */ne()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,c=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^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}(U,U.exports)),U.exports}function le(){return re||(re=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,o.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],r=n[1],a=n[2];return parseFloat((.2126*i+.7152*r+.0722*a).toFixed(3))};var n,o=(n=/* @__PURE__ */ce())&&n.__esModule?n:{default:n};e.exports=t.default}(K,K.exports)),K.exports}const de=/* @__PURE__ */X(/* @__PURE__ */le());var ue,fe={exports:{}},pe={exports:{}};function he(){return ue||(ue=1,function(e,t){function n(e,t,o){return function(){var i=o.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}(pe,pe.exports)),pe.exports}var ge,me={exports:{}};function be(){return ge||(ge=1,e=me,(t=me.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),me.exports;var e,t}var ye,we,ve={exports:{}},xe={exports:{}};function Se(){return ye||(ye=1,e=xe,(t=xe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,o=e.green/255,i=e.blue/255,r=Math.max(n,o,i),a=Math.min(n,o,i),s=(r+a)/2;if(r===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=r-a,l=s>.5?c/(2-r-a):c/(r+a);switch(r){case n:t=(o-i)/c+(o<i?6:0);break;case o:t=(i-n)/c+2;break;default:t=(n-o)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),xe.exports;var e,t}function Ce(){return we||(we=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(/* @__PURE__ */ce()),o=i(/* @__PURE__ */Se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ve,ve.exports)),ve.exports}var ke,Ee={exports:{}},Ie={exports:{}},Le={exports:{}},We={exports:{}};function Te(){return ke||(ke=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}(We,We.exports)),We.exports}var _e,Me,Ae,Oe={exports:{}};function Pe(){return _e||(_e=1,e=Oe,(t=Oe.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),Oe.exports;var e,t}function Re(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(/* @__PURE__ */Q()),o=r(/* @__PURE__ */Te()),i=r(/* @__PURE__ */Pe());function r(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,o.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,o){return(0,n.default)(e,t,o,s)},e.exports=t.default}(Le,Le.exports)),Le.exports}function Be(){return Ae||(Ae=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 o.default(1)};var n=i(/* @__PURE__ */Re()),o=i(/* @__PURE__ */se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var Fe,je={exports:{}};function Ne(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,n.default)(e,t,r):"rgba("+(0,o.default)(e,t,r)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)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(/* @__PURE__ */Re()),o=r(/* @__PURE__ */Q()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(je,je.exports)),je.exports}var Ve,He={exports:{}};function Ze(){return Ve||(Ve=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(t)+(0,o.default)(r));if("object"==typeof e&&void 0===t&&void 0===r)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(/* @__PURE__ */Te()),o=r(/* @__PURE__ */Pe()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(He,He.exports)),He.exports}var De,Ge,ze,Ye={exports:{}};function $e(){return De||(De=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,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 r&&"number"==typeof a)return a>=1?(0,o.default)(e,t,r):"rgba("+e+","+t+","+r+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)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(/* @__PURE__ */ce()),o=r(/* @__PURE__ */Ze()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ye,Ye.exports)),Ye.exports}function Xe(){return Ge||(Ge=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,r.default)(e);if(c(e))return(0,i.default)(e);if(u(e))return(0,o.default)(e);if(d(e))return(0,n.default)(e);throw new a.default(8)};var n=s(/* @__PURE__ */Be()),o=s(/* @__PURE__ */Ne()),i=s(/* @__PURE__ */Ze()),r=s(/* @__PURE__ */$e()),a=s(/* @__PURE__ */se());function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},d=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(Ee,Ee.exports)),Ee.exports}function Je(){return ze||(ze=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */he()),o=a(/* @__PURE__ */be()),i=a(/* @__PURE__ */Ce()),r=a(/* @__PURE__ */Xe());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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness-parseFloat(e))}))});t.default=c,e.exports=t.default}(fe,fe.exports)),fe.exports}const Ke=/* @__PURE__ */X(/* @__PURE__ */Je());var Ue,qe={exports:{}};function Qe(){return Ue||(Ue=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */he()),o=a(/* @__PURE__ */be()),i=a(/* @__PURE__ */Ce()),r=a(/* @__PURE__ */Xe());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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness+parseFloat(e))}))});t.default=c,e.exports=t.default}(qe,qe.exports)),qe.exports}const et=/* @__PURE__ */X(/* @__PURE__ */Qe()),tt="bf-iframe-container",nt="bf-trigger-button",ot="bf-search-bar-iframe-container",it="bf-search-bar-iframe-backdrop";function rt(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 o=de(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;max-width:36px;max-height:36px}.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);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));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,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@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.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.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 .${nt} { background: ${e}; }\n .${nt}:hover {\n background: ${o?Ke(.05,e):et(.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")}}class at{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function st(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const ct="brainfish-search-widget";class lt{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===h.Searchbar?ot:tt}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${it}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,o;const i=document.querySelector(`.${this.containerClass}`),r=null==i?void 0:i.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==r?void 0:r.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==r?void 0:r.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(o=null==r?void 0:r.contentWindow)||o.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==h.Searchbar&&(null==i||i.classList.add("open"),e.position&&(null==i||i.classList.add(`position-${e.position}`),null==i||i.setAttribute("data-current-position",e.position))),null==i||i.setAttribute("aria-hidden","false"),this.widgetType!==h.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=st("div",it);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(ct);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==h.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){const n=document.querySelector(`.${ot}[data-widget-key="${e}"]`);if(n){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(n)}if(document.getElementById(`trigger-button-${e}`))return!0;if("Search"!==t.widgetType){if(document.querySelector(`.${tt}`))return!0}return!1}}class dt{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===h.Popup)}static clear(){this.instances.clear()}}l(dt,"instances",/* @__PURE__ */new Map);const ut=({formUrl:e,width:t="500px",height:n="600px"})=>{const o=document.createElement("div");o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("tabindex","-1"),o.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const i=document.createElement("button");i.innerHTML="×",i.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const r=document.createElement("iframe");r.src=e,r.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[i,r],n=document.activeElement,o=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?o<=0?t[t.length-1].focus():t[o-1].focus():o>=t.length-1?t[0].focus():t[o+1].focus()}else"Escape"===e.key&&c()},c=()=>{o.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",i.onclick=c,l.onclick=c,document.addEventListener("keydown",s),o.appendChild(i),o.appendChild(r),document.body.appendChild(l),document.body.appendChild(o),o.focus(),r.onload=()=>{r.setAttribute("tabindex","0"),i.focus()}},ft=e=>`brainfish_conversation_${e}`,pt={save(e,t){if(t){const o=L(ft(e));let i=Date.now();if(o)try{const e=JSON.parse(o);e.conversationId===t&&(i=e.persistedAt)}catch(n){}const r={conversationId:t,persistedAt:i};((e,t)=>{try{I()&&window.localStorage.setItem(e,t)}catch(n){}})(ft(e),JSON.stringify(r))}else W(ft(e))},load(e){const t=L(ft(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(W(ft(e)),null):n.conversationId}catch(n){return W(ft(e)),null}},clear(e){W(ft(e))}};class ht{static getIframeForInstance(e){var t,n;const o=e.widgetType===h.Searchbar?ot:tt,i=e.widgetType===h.Searchbar?`.${o}[data-widget-key="${e.widgetKey}"]`:`.${o}`;return null!=(n=null==(t=document.querySelector(i))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,o;null==(o=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||o.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=ut,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=dt.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=dt.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,o={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(o.newConversation=!0),(null==n?void 0:n.trigger)&&(o.trigger=n.trigger),(null==n?void 0:n.position)&&(o.position=n.position),t.openWidget(o)}}static createNewThread(){const e=dt.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=dt.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=dt.getOpenInstance();if(n||(n=dt.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=c(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(o)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=dt.getOpenInstance();const n=!!t;t||(t=dt.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=dt.getOpenInstance())?e:dt.getClosedPopupInstance();t?(pt.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(ht,"isInitialized",!1);class gt{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case h.Searchbar:n="searchbar_widget";break;case h.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,c(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class mt{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new at(e,t),this.domController=new lt(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new gt(t,e)}static getInstance(e){return dt.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),dt.register(this.widgetKey,this),ht.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=pt.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){dt.unregister(this.widgetKey)}static initialize(e){const t=new mt(e.widgetKey,e.widgetType);return t.initialize(e),t}}function bt({widgetUrl:e,widgetType:t,props:n}){const o=t===h.Searchbar?ot:tt,i=st("div",o,s({id:o,"aria-live":"polite","aria-hidden":t===h.Searchbar?"false":"true"},n||{})),r=st("div","iframe-loading-indicator"),a=st("div","spinner");r.setAttribute("aria-label","Loading content"),r.setAttribute("role","status"),r.appendChild(a),i.appendChild(r);const c=st("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{r.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),r.innerHTML="";const t=st("div","loading-error");r.appendChild(t),r.setAttribute("aria-label","Failed to load content")}),i.appendChild(c),{iframeContainer:i,iframe:c}}function yt(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())})()}const wt=/* @__PURE__ */new Map,vt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,xt=(e,t)=>d(null,null,function*(){if(wt.has(e)){const i=wt.get(e);if("function"!=typeof i)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield i(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(o){return{success:!1,reason:vt(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),St=/* @__PURE__ */new Map,Ct=/* @__PURE__ */new Set;function kt(e,{widgetHost:t,apiHost:n,widgetKey:o,widgetType:i,signal:r,stateManager:a}){window.addEventListener("message",r=>d(null,null,function*(){var s,c;if(r.origin!==t)return;const{type:l,widgetKey:d}=r.data;if(!d||d===o){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${tt}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=r.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{messageId:e,eventName:t,data:n}=r.data;if(e){if(Ct.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);Ct.add(e),setTimeout(()=>Ct.delete(e),5e3)}a.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:i,answer:a,conversation:s}=r.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=St.get(e.id);if(c&&Date.now()-c<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-c}ms ago)`);St.set(e.id,Date.now()),setTimeout(()=>St.delete(e.id),1e3),pt.clear(o);const l={query:i,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](i,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",o),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const r=document.createElement("script");r.src=t.toString(),document.head.appendChild(r),r.onload=()=>{window.__bfCallbacks[e.id](i,a,l),setTimeout(()=>{document.head.removeChild(r)},300)},r.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:o}=r.data,i=yield xt(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=r.data;i!==h.Searchbar&&pt.save(o,e)}if("REQUEST_USER_IDENTITY"===l&&r.source===e.contentWindow&&i===h.Popup){const t=pt.load(o);t&&(null==(c=e.contentWindow)||c.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:r})}function Et(e,t,n){let o;const i=()=>{(t=>{var o;const i={type:"UPDATE_BODY_CLASS",isMobile:t};null==(o=e.contentWindow)||o.postMessage(i,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},r=()=>{o&&clearTimeout(o),o=window.setTimeout(i,300)};i(),(()=>{const e=new ResizeObserver(r);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const It=/* @__PURE__ */new Set;function Lt(e,t,{isButtonHidden:n,triggerButtonIcon:o}){const i=document.createDocumentFragment();let r;if(n)r=mt.initialize({isButtonHidden:n,widgetType:h.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=st("button",nt,{id:`trigger-button-${e}`,"aria-controls":tt,"aria-expanded":"false","data-name":nt}),o=st("div","trigger-button-icon",{"aria-hidden":"true"});return o.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" 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(o),{button:n,icon:o}}(e,o);i.appendChild(t),r=mt.initialize({button:t,icon:n,widgetType:h.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=bt({widgetUrl:t,widgetType:h.Popup});return i.appendChild(a),{fragment:i,iframe:s,stateManager:r}}const Wt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i,hideTriggerButton:r})=>{const{settings:a}=e,s=null!=r?r:null==a?void 0:a.hideTriggerButton,c=null==a?void 0:a.triggerButtonIcon;try{if(function(e){return It.has(e)}(i))return;if(function(e){return!!document.getElementById(`trigger-button-${e}`)}(i))return;rt(e);const{fragment:r,iframe:a,stateManager:l}=Lt(i,t,{isButtonHidden:s||!1,triggerButtonIcon:c||""}),d=new AbortController,{signal:u}=d;H(a,o,{signal:u}),a.onload=()=>{setTimeout(()=>{var e;yt(a,u),kt(a,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Popup,signal:u,stateManager:l}),Et(a,u,l);const r=pt.load(i),s=new URL(t).searchParams.has("conversation");r&&!s&&(null==(e=a.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:r},"*"))},0)},document.body?document.body.appendChild(r):(console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(r)},{once:!0})),It.add(i);const f=()=>{d.abort(),window.removeEventListener("beforeunload",f)};return void window.addEventListener("beforeunload",f)}catch(l){!function(e,t,n){w(e,t,t.message,n)}(n,l,i)}},Tt=/* @__PURE__ */new Map;const _t=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i})=>{var r,a,s,c;const{settings:l}=e;let d=mt.getInstance(i);null==(r=Tt.get(i))||r.abort();const u=new AbortController;Tt.set(i,u),rt(e);try{const e=document.querySelector(`.${ot}[data-widget-key="${i}"]`),r=document.querySelector(ct);e&&r&&!r.contains(e)&&(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(a=r.parentElement)||a.style.setProperty("width","100%"))),d||(d=mt.initialize({isButtonHidden:!0,widgetType:h.Searchbar,widgetKey:i}));const{signal:l}=u,f=e=>{H(e,o,{signal:l}),yt(e,l),kt(e,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Searchbar,signal:l,stateManager:d}),Et(e,l,d)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(c=t.contentDocument)?void 0:c.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:o}=bt({widgetUrl:t,widgetType:h.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":i}});o.onload=()=>{setTimeout(()=>{f(o)},0)},e.appendChild(n),r?(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(s=r.parentElement)||s.style.setProperty("width","100%"))):document.body.appendChild(e)}const p=()=>{u.abort(),Tt.delete(i),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(f){!function(e,t,n){w(e,t,t.message,n)}(n,f,i)}},Mt=(e,t,n)=>{var a;const c=S(e.overrides),l=(null==(d=e.overrides)?void 0:d.widgetHost)||"https://agent.brainfi.sh";var d;N(l);const u=null==(a=e.overrides)?void 0:a.hideTriggerButton,{theme:f,settings:p}=t,h=e.overrides||{},{theme:g,redirectRules:m,regions:b,customCss:y}=h,w=((e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&r.call(e,a)&&(n[a]=e[a]);return n})(h,["theme","redirectRules","regions","customCss"]),v=s(s({},f),g),x=s(s({},p),w),C=M(JSON.stringify(m)),k={theme:M(JSON.stringify(v)),settings:M(JSON.stringify(x)),redirectRules:C};b&&(k.regions=M(JSON.stringify(b))),y&&(k.customCss=M(y)),n&&(k.fingerprint=M(n));const E=`${l}/?widgetKey=${e.widgetKey}#${new URLSearchParams(k).toString()}`;"Search"===t.widgetType?_t({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey}):Wt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey,hideTriggerButton:u})};var At=/* @__PURE__ */(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(At||{});const Ot=e=>d(null,null,function*(){if(e.widgetType===h.Popup){const e=window.fcWidget?At.FRESHCHAT:null;e&&e===At.FRESHCHAT&&(yield d(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Pt="brainfish-nudges",Rt=(e,t)=>d(null,null,function*(){try{yield d(null,null,function*(){if(!document.getElementById(Pt))return new Promise(e=>{const t=document.createElement("script");t.id=Pt,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){w(e,n,"Failed to initialize Nudge widget",t)}});let Bt,Ft,jt,Nt=!1;const Vt=e=>{null==Bt||Bt.abort(),Bt=new AbortController;const{signal:t}=Bt;let n=window.location.pathname;const o=()=>{if(t.aborted)return;const o=window.location.pathname;o!==n&&(n=o,e())};window.addEventListener("popstate",o,{signal:t}),Nt||(Ft=history.pushState,jt=history.replaceState,history.pushState=function(...e){Ft.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){jt.apply(this,e),setTimeout(o,0)},Nt=!0),t.addEventListener("abort",()=>{Nt&&(history.pushState=Ft,history.replaceState=jt,Nt=!1)})};var Ht="5.2.0";function Zt(e,t){return new Promise(n=>setTimeout(n,e,t))}function Dt(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Gt(e){return!!e&&"function"==typeof e.then}function zt(e,t){try{const n=e();Gt(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function Yt(e,t,n=16){return d(this,null,function*(){const o=Array(e.length);let i=Date.now();for(let r=0;r<e.length;++r){o[r]=t(e[r],r);const a=Date.now();a>=i+n&&(i=a,yield Dt())}return o})}function $t(e){return e.then(void 0,()=>{}),e}function Xt(e){return parseInt(e)}function Jt(e){return parseFloat(e)}function Kt(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Ut(e){return e.reduce((e,t)=>e+(t?1:0),0)}function qt(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function Qt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let l=0,d=0,u=0,f=0;f+=r+(65535&t[1]),u+=f>>>16,f&=65535,u+=i+c,d+=u>>>16,u&=65535,d+=o+s,l+=d>>>16,d&=65535,l+=n+a,l&=65535,e[0]=l<<16|d,e[1]=u<<16|f}function en(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,l=65535&t[1];let d=0,u=0,f=0,p=0;p+=r*l,f+=p>>>16,p&=65535,f+=i*l,u+=f>>>16,f&=65535,f+=r*c,u+=f>>>16,f&=65535,u+=o*l,d+=u>>>16,u&=65535,u+=i*c,d+=u>>>16,u&=65535,u+=r*s,d+=u>>>16,u&=65535,d+=n*l+o*c+i*s+r*a,d&=65535,e[0]=d<<16|u,e[1]=f<<16|p}function tn(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function nn(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function on(e,t){e[0]^=t[0],e[1]^=t[1]}const rn=[4283543511,3981806797],an=[3301882366,444984403];function sn(e){const t=[0,e[0]>>>1];on(e,t),en(e,rn),t[1]=e[0]>>>1,on(e,t),en(e,an),t[1]=e[0]>>>1,on(e,t)}const cn=[2277735313,289559509],ln=[1291169091,658871167],dn=[0,5],un=[0,1390208809],fn=[0,944331445];function pn(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e);t=t||0;const o=[0,n.length],i=o[1]%16,r=o[1]-i,a=[0,t],s=[0,t],c=[0,0],l=[0,0];let d;for(d=0;d<r;d+=16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,l[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,l[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,en(c,cn),tn(c,31),en(c,ln),on(a,c),tn(a,27),Qt(a,s),en(a,dn),Qt(a,un),en(l,ln),tn(l,33),en(l,cn),on(s,l),tn(s,31),Qt(s,a),en(s,dn),Qt(s,fn);c[0]=0,c[1]=0,l[0]=0,l[1]=0;const u=[0,0];switch(i){case 15:u[1]=n[d+14],nn(u,48),on(l,u);case 14:u[1]=n[d+13],nn(u,40),on(l,u);case 13:u[1]=n[d+12],nn(u,32),on(l,u);case 12:u[1]=n[d+11],nn(u,24),on(l,u);case 11:u[1]=n[d+10],nn(u,16),on(l,u);case 10:u[1]=n[d+9],nn(u,8),on(l,u);case 9:u[1]=n[d+8],on(l,u),en(l,ln),tn(l,33),en(l,cn),on(s,l);case 8:u[1]=n[d+7],nn(u,56),on(c,u);case 7:u[1]=n[d+6],nn(u,48),on(c,u);case 6:u[1]=n[d+5],nn(u,40),on(c,u);case 5:u[1]=n[d+4],nn(u,32),on(c,u);case 4:u[1]=n[d+3],nn(u,24),on(c,u);case 3:u[1]=n[d+2],nn(u,16),on(c,u);case 2:u[1]=n[d+1],nn(u,8),on(c,u);case 1:u[1]=n[d],on(c,u),en(c,cn),tn(c,31),en(c,ln),on(a,c)}return on(a,o),on(s,o),Qt(a,s),Qt(s,a),sn(a),sn(s),Qt(a,s),Qt(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function hn(e,t,n,o){const i=Object.keys(e).filter(e=>!function(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}(n,e)),r=$t(Yt(i,n=>function(e,t){const n=$t(new Promise(n=>{const o=Date.now();zt(e.bind(null,t),(...e)=>{const t=Date.now()-o;if(!e[0])return n(()=>({error:e[1],duration:t}));const i=e[1];if(function(e){return"function"!=typeof e}(i))return n(()=>({value:i,duration:t}));n(()=>new Promise(e=>{const n=Date.now();zt(i,(...o)=>{const i=t+Date.now()-n;if(!o[0])return e({error:o[1],duration:i});e({value:o[1],duration:i})})}))})}));return function(){return n.then(e=>e())}}(e[n],t),o));return function(){return d(this,null,function*(){const e=yield r,t=yield Yt(e,e=>$t(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function gn(){const e=window,t=navigator;return Ut(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function mn(){const e=window,t=navigator;return Ut(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function bn(){const e=window;return Ut(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function yn(){const e=window,{HTMLElement:t,Document:n}=e;return Ut(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function wn(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function vn(){var e,t;const n=window;return Ut(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function xn(){const{CSS:e}=window;return Ut([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Sn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return Ut([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Cn(){const e=mn(),t=vn(),n=window,o=navigator,i="connection";return e?Ut([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&Ut(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function kn(e){const t=new Error(e);return t.name=e,t}function En(e,t,n=50){return d(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield Zt(n);const s=a.createElement("iframe");try{for((yield new Promise((e,n)=>{let o=!1;const i=()=>{o=!0,e()};s.onload=i,s.onerror=e=>{o=!0,n(e)};const{style:r}=s;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);const c=()=>{var e,t;o||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}));!(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body);)yield Zt(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function In(e){const[t,n]=function(e){var t,n;const o=`Unexpected syntax '${e}'`,i=/^\s*([a-z-]*)(.*)$/i.exec(e),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=(e,t)=>{a[e]=a[e]||[],a[e].push(t)};for(;;){const e=s.exec(i[2]);if(!e)break;const r=e[0];switch(r[0]){case".":c("class",r.slice(1));break;case"#":c("id",r.slice(1));break;case"[":{const e=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(r);if(!e)throw new Error(o);c(e[1],null!==(n=null!==(t=e[4])&&void 0!==t?t:e[5])&&void 0!==n?n:"");break}default:throw new Error(o)}}return[r,a]}(e),o=document.createElement(null!=t?t:"div");for(const i of Object.keys(n)){const e=n[i].join(" ");"style"===i?Ln(o.style,e):o.setAttribute(i,e)}return o}function Ln(e,t){for(const n of t.split(";")){const t=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(t){const[,n,o,,i]=t;e.setProperty(n,o,i||"")}}}const Wn=["monospace","sans-serif","serif"],Tn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function _n(e){return e.toDataURL()}let Mn,An;function On(){return function(){if(void 0!==An)return;const e=()=>{const t=Pn();Rn(t)?An=setTimeout(e,2500):(Mn=t,An=void 0)};e()}(),()=>d(null,null,function*(){let e=Pn();if(Rn(e)){if(Mn)return[...Mn];(function(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null})()&&(yield function(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}(),e=Pn())}return Rn(e)||(Mn=e),e})}function Pn(){const e=screen;return[Kt(Jt(e.availTop),null),Kt(Jt(e.width)-Jt(e.availWidth)-Kt(Jt(e.availLeft),0),null),Kt(Jt(e.height)-Jt(e.availHeight)-Kt(Jt(e.availTop),0),null),Kt(Jt(e.availLeft),null)]}function Rn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Bn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Fn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function jn(e){return matchMedia(`(forced-colors: ${e})`).matches}function Nn(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Vn(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Hn(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Zn(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Dn=Math,Gn=()=>0;const zn="mmMwWLliI0fiflO&1",Yn={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function $n(e){const t=Cn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const Xn=function(){let e=window;for(;;){const n=e.parent;if(!n||n===e)return!1;try{if(n.location.origin!==e.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}e=n}};const Jn=/* @__PURE__ */new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Kn=/* @__PURE__ */new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Un=["FRAGMENT_SHADER","VERTEX_SHADER"],qn=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Qn="WEBGL_debug_renderer_info";function eo(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch(o){}if(n)break}return e.webgl={context:n},n}function to(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function no(e){return Object.keys(e.__proto__).filter(oo)}function oo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function io(){return vn()}function ro(){return mn()||bn()}function ao(e){return"function"==typeof e.getParameter}const so={userAgentData:function(){return d(this,null,function*(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:e})=>!function(e){return/not/i.test(e)}(e)).map(({brand:e})=>e),n={brands:t.length>1?t.filter(e=>"Chromium"!==e):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);n.architecture=t.architecture,n.bitness=t.bitness,n.model=t.model,n.platformVersion=t.platformVersion}catch(o){if(!(o instanceof DOMException&&"NotAllowedError"===o.name))throw o;n.highEntropyStatus="not_allowed"}return n})},fonts:function(){return En((e,t)=>d(null,[e,t],function*(e,{document:t}){const n=t.body;n.style.fontSize="48px";const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i={},r={},a=e=>{const n=t.createElement("span"),{style:i}=n;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",o.appendChild(n),n},s=(e,t)=>a(`'${e}',${t}`),c=Wn.map(a),l=(()=>{const e={};for(const t of Tn)e[t]=Wn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Wn.length;d++)i[Wn[d]]=c[d].offsetWidth,r[Wn[d]]=c[d].offsetHeight;return Tn.filter(e=>{return t=l[e],Wn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return d(this,arguments,function*({debug:e}={}){if(!bn()&&!Cn())return;const t=function(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}(),n=Object.keys(t),o=[].concat(...n.map(e=>t[e])),i=yield function(e){return d(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Bn(o);for(let a=0;a<e.length;++a){const t=In(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Bn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield Zt(50);n.body.appendChild(o);try{for(let t=0;t<e.length;++t)i[t].offsetParent||(r[e[t]]=!0)}finally{null===(t=o.parentNode)||void 0===t||t.removeChild(o)}return r})}(o);e&&function(e,t){let n="DOM blockers debug:\n```";for(const o of Object.keys(e)){n+=`\n${o}:`;for(const i of e[o])n+=`\n ${t[i]?"🚫":"➡️"} ${i}`}console.log(`${n}\n\`\`\``)}(t,i);const r=n.filter(e=>{const n=t[e];return Ut(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return En((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",mn()?r.style.zoom=""+1/o.devicePixelRatio:bn()&&(r.style.zoom="reset");const s=i.createElement("div");return s.textContent=[...Array(t/20|0)].map(()=>"word").join(" "),r.appendChild(s),e(i,r,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((e,t,n)=>{const o={},i={};for(const a of Object.keys(Yn)){const[n={},i=zn]=Yn[a],r=e.createElement("span");r.textContent=i,r.style.whiteSpace="nowrap";for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(r.style[e]=t)}o[a]=r,t.append(e.createElement("br"),r)}const r=mn()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return Ut([o&&"try"in o,"caretPositionFromPoint"in t,i&&"onerror"in i.prototype,n.supports("ruby-align","space-around")])>=3}();for(const a of Object.keys(Yn)){const e=o[a].getBoundingClientRect().width;i[a]=r?$n(e*n.devicePixelRatio):e}return i})},audio:function(){return bn()&&Sn()&&wn()||mn()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return Ut(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}()&&function(){const e=window,{URLPattern:t}=e;return Ut(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(bn()&&!yn()&&!function(){const e=window;return Ut(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;const n=4500,o=new t(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;const r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);const[a,s]=function(e){const t=3,n=500,o=500,i=5e3;let r=()=>{};const a=new Promise((a,s)=>{let c=!1,l=0,d=0;e.oncomplete=e=>a(e.renderedBuffer);const u=()=>{setTimeout(()=>s(kn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(Gt(o)&&$t(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(kn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=$t(a.then(e=>function(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n)),e=>{if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return()=>(s(),c)}()},screenFrame:function(){const e=bn()&&Sn()&&wn(),t=vn()&&xn();if(e||t)return()=>Promise.resolve(void 0);const n=On();return()=>d(null,null,function*(){const e=yield n(),t=e=>null===e?null:qt(e,10);return[t(e[0]),t(e[1]),t(e[2]),t(e[3])]})},canvas:function(){return function(e){let t,n,o=!1;const[i,r]=function(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}();!function(e,t){return!(!t||!e.toDataURL)}(i,r)?t=n="unsupported":(o=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(r),e?t=n="skipped":[t,n]=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n=`Cwm fjordbank gly ${String.fromCharCode(55357,56835)}`;t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);const n=_n(e),o=_n(e);if(n!==o)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,o,i]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,i,40,0,2*Math.PI,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);const i=_n(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=bn()&&Sn()&&wn(),t=vn()&&function(){const e=window,t=navigator,{CSS:n}=e;return Ut(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}();return e||t}())},osCpu:function(){return navigator.oscpu},languages:function(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))mn()&&function(){const e=window;return Ut([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Kt(Jt(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(bn()&&Sn()&&wn()))return function(){const e=screen,t=e=>Kt(Xt(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=Kt(Xt(navigator.hardwareConcurrency),void 0);return void 0!==e&&vn()&&xn()?e>=8?8:4:e},timezone:function(){var e;const t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){const e=(new t).resolvedOptions().timeZone;if(e)return e}const n=-function(){const e=/* @__PURE__ */(new Date).getFullYear();return Math.max(Jt(new Date(e,0,1).getTimezoneOffset()),Jt(new Date(e,6,1).getTimezoneOffset()))}();return`UTC${n>=0?"+":""}${n}`},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!gn()&&!function(){const e=window,t=navigator;return Ut(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!gn()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){const{platform:e}=navigator;return"MacIntel"===e&&bn()&&!yn()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return Ut(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const o=e[n];if(!o)continue;const i=[];for(let e=0;e<o.length;++e){const t=o[e];i.push({type:t.type,suffixes:t.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:i})}return t},touchSupport:function(){const e=navigator;let t,n=0;void 0!==e.maxTouchPoints?n=Xt(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(o){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&"object"==typeof n&&e.push(t)}return e.sort()},cookiesEnabled:function(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}},colorGamut:function(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e},invertedColors:function(){return!!Fn("inverted")||!Fn("none")&&void 0},forcedColors:function(){return!!jn("active")||!jn("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=100;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}},contrast:function(){return Nn("no-preference")?0:Nn("high")||Nn("more")?1:Nn("low")||Nn("less")?-1:Nn("forced")?10:void 0},reducedMotion:function(){return!!Vn("reduce")||!Vn("no-preference")&&void 0},reducedTransparency:function(){return!!Hn("reduce")||!Hn("no-preference")&&void 0},hdr:function(){return!!Zn("high")||!Zn("standard")&&void 0},math:function(){const e=Dn.acos||Gn,t=Dn.acosh||Gn,n=Dn.asin||Gn,o=Dn.asinh||Gn,i=Dn.atanh||Gn,r=Dn.atan||Gn,a=Dn.sin||Gn,s=Dn.sinh||Gn,c=Dn.cos||Gn,l=Dn.cosh||Gn,d=Dn.tan||Gn,u=Dn.tanh||Gn,f=Dn.exp||Gn,p=Dn.expm1||Gn,h=Dn.log1p||Gn;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,Dn.log(g+Dn.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>Dn.log(e+Dn.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>Dn.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>Dn.exp(e)-1/Dn.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(Dn.exp(e)+1/Dn.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(Dn.exp(2*e)-1)/(Dn.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>Dn.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>Dn.log(1+e))(10),powPI:(e=>Dn.pow(Dn.PI,e))(-100)};var g},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){const{ApplePaySession:e}=window;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(Xn())return-3;try{return e.canMakePayments()?1:0}catch(t){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(t)}},privateClickMeasurement:function(){var e;const t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(Cn()||bn()))return-2;if(!window.AudioContext)return-1;const e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function({cache:e}){var t,n,o,i,r,a;const s=eo(e);if(!s)return-1;if(!ao(s))return-2;const c=io()?null:s.getExtension(Qn);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function({cache:e}){const t=eo(e);if(!t)return-1;if(!ao(t))return-2;const n=t.getSupportedExtensions(),o=t.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(const d of Object.keys(o))r.push(`${d}=${o[d]}`);const l=no(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${Jn.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===Qn&&io()||"WEBGL_polygon_mode"===d&&ro())continue;const e=t.getExtension(d);if(e)for(const n of no(e)){const o=e[n];s.push(`${n}=${o}${Kn.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of Un)for(const e of qn){const n=to(t,d,e);c.push(`${d}.${e}=${n.join(",")}`)}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function co(e){const t=function(e){if(Cn())return.4;if(bn())return!yn()||Sn()&&wn()?.3:.5;const t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return qt(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score".replace(/\$/g,`${n}`)}}function lo(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?s({name:(n=t).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):t;var n,o},2)}function uo(e){return pn(function(e){let t="";for(const n of Object.keys(e).sort()){const o=e[n],i="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${i}`}return t}(e))}function fo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):Zt(Math.min(e,t))}(e,2*e)}function po(e,t){const n=Date.now();return{get(o){return d(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=co(e);return{get visitorId(){return void 0===t&&(t=uo(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:Ht}}(r);return(t||(null==o?void 0:o.debug))&&console.log(`Copy the text below to get the debug data:\n\n\`\`\`\nversion: ${a.version}\nuserAgent: ${navigator.userAgent}\ntimeBetweenLoadAndGet: ${i-n}\nvisitorId: ${a.visitorId}\ncomponents: ${lo(r)}\n\`\`\``),a})}}}var ho={load:function(){return d(this,arguments,function*(e={}){const{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${Ht}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield fo(t);const i=function(e){return hn(so,e,[])}({cache:{},debug:n});return po(i,n)})},hashComponents:uo,componentsToDebugString:lo};D(),function(){if($||"undefined"==typeof window)return;$=!0;const e=window;let t=e.BrainfishAnalytics?Y(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?Y(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=Y(e.BrainfishAnalytics))}}();let go=null;const mo="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(go||(go=function(){const e=[];let t=null;function n(n,o){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const r=i[e[e.length-1]];if("function"==typeof r)return r.apply(i,o)}else e.push([n,o])}return{Widgets:{init:(...e)=>n("Widgets.init",e),setTheme:(...e)=>n("Widgets.setTheme",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:o})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:o}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),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(o){for(t=o;e.length>0;){const[t,o]=e.shift();n(t,o)}}}}(),"undefined"!=typeof window&&(window.Brainfish=go)),go),bo=/* @__PURE__ */new Map,yo=/* @__PURE__ */new Map;let wo=!1;function vo(e,t,n,o,i){return d(this,null,function*(){var r,a,s,c,l,d,u;const f=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(a=null==t?void 0:t.settings)?void 0:a.enableRecording)||!1,p=(null==(s=e.overrides)?void 0:s.version)||(null==t?void 0:t.version);yo.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(Mt(e,t,i),wo||(wo=!0,Vt(()=>{yo.forEach(({options:e,config:t,fingerprint:n})=>{var o;const i=(null==(o=e.overrides)?void 0:o.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&&Mt(e,t,n)})}))):h.push(E(e,t)),h.push(_(e.widgetKey,t.trackingToken||"",n,o,f,{blocklist:null==(c=null==t?void 0:t.settings)?void 0:c.recordingBlocklist,sampleRate:null==(d=null==(l=null==t?void 0:t.settings)?void 0:l.ambientSettings)?void 0:d.sampleRate,_allowLocalhostRecording:null==(u=null==t?void 0:t.settings)?void 0:u._allowLocalhostRecording})),h.push(Rt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&mo._setRealBrainfish(g.value)})}mo.Widgets.isReady=!1,mo.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):z(e)},mo.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},mo.Widgets.init=e=>d(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=S(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield ho.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(A(e.config));else{const{config:n}=yield v({widgetKey:e.widgetKey,apiHost:t});r=n}let a=bo.get(e.widgetKey);if(a||(a=vo(e,r,t,n,i),bo.set(e.widgetKey,a)),yield a,!lt.isWidgetDOMExisting(e.widgetKey,r)){bo.delete(e.widgetKey);const o=vo(e,r,t,n,i);bo.set(e.widgetKey,o),yield o}yield Ot(r),mo.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),mo.Widgets.setTheme=e=>{var t;const n=document.querySelector("#bf-iframe-container .trigger-iframe");if(n){const o=new URL(n.src),i=new URLSearchParams(o.hash.substring(1)),r=i.get("theme");let a;r&&(a=JSON.parse(A(r)));const c=s(s({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:c},"*");const l=M(JSON.stringify(c));i.set("theme",l),o.hash=`#${i.toString()}`,n.src=o.toString()}},mo.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{wt.set(e,t)})(e,t)};const xo=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)};export{xo as BrainfishAnalytics,mo as default};
|
|
1
|
+
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&a(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>new Promise((o,i)=>{var r=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?o(e.value):Promise.resolve(e.value).then(r,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]="1eb93ecf-d438-4b2e-8ac5-6ec2f1426a64",e._sentryDebugIdIdentifier="sentry-dbid-1eb93ecf-d438-4b2e-8ac5-6ec2f1426a64")}catch(n){}}(),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var h,g,m,b;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.24.0"},(g=h||(h={})).Sidebar="sidebar",g.Searchbar="searchbar",g.Popup="popup",h.Sidebar,h.Searchbar,h.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),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}}}(b=m||(m={})).LINK="link",b.CALLBACK="callback",b.EMAIL="email",b.PHONE="phone";const w=(e,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const o=t.toJSON(),i=e||"https://app.brainfi.sh",r={error:`WebWidgetVersion: 1.24.0. ${t.message}`,stack:t.stack,cause:{message:o.message,stack:o.stack,cause:o.cause}};fetch(`${i}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(r)})})(e,new y(i,{cause:r}),o)};const v=e=>d(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return d(this,null,function*(){let o,i=0;for(;i<3;)try{const o=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!o.ok)throw new Error(`API call failed with status: ${o.status}`);const i=yield o.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(r){if(o=r,i++,i>=3)throw w(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const o=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{o[e]&&(o[e]=o[e].map(e=>e.type===m.CALLBACK&&e.value?c(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),c(s({},e),{settings:o,apiHost:n,widgetMode:e.widgetType,apiKey:t})},S=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",C=e=>d(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=>d(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const o=document.createElement("script");o.id="brainfish-widget",o.src=e,o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},o.onerror=t=>{const o=t,i={message:`Failed to load script: ${e}`,type:o.type,fileName:o.filename,lineNumber:o.lineno,columnNumber:o.colno,error:o.error?o.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(o)})}))(e);return{widget:t}}catch(o){Math.random()<.05&&w(e,o,o.message,t)}});const k=/* @__PURE__ */new Set,E=(e,t)=>d(null,null,function*(){const n=S(e.overrides);try{if(k.has(e.widgetKey))return;const o=yield C({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.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())})(t.settings[e],n))}),function(e,t){t.widgetType===h.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(i,r),k.add(e.widgetKey),i}}catch(o){w(n,o,o.message,e.widgetKey)}}),I=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},L=e=>{try{if(I())return window.localStorage.getItem(e)}catch(t){}return null},W=e=>{try{I()&&window.localStorage.removeItem(e)}catch(t){}};let T=!1;const _=(e,t,n,...o)=>d(null,[e,t,n,...o],function*(e,t,n,o="",i=!1,r){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!T)try{const a=(()=>{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)})(),s="true"===L("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),T=!0,yield((e,t)=>d(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const o=document.createElement("script");o.id="brainfish-analytics",o.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},o.onerror=()=>{Math.random()<.05&&w(e,new Error(`Failed to load script: ${o.src}`),`Failed to load script: ${o.src}`,t),n(void 0)},document.head.appendChild(o)})}))(n,e)}catch(a){w(n,a,"Failed to initialize BrainfishAnalytics",e)}});function M(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 A=e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=t.charCodeAt(e);return(new TextDecoder).decode(o)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")},O="USER_IDENTIFY";let P=null;const R=/* @__PURE__ */new Set,B=/* @__PURE__ */new Map;let F=!1;function j(e){try{return new URL(e).origin}catch(t){return e}}function N(e){R.add(j(e))}function V(e,t,n){var o;const i=function(e,t){try{return new URL(e.src).origin}catch(n){if(t)return j(t)}return"*"}(e,n);null==(o=e.contentWindow)||o.postMessage({type:O,payload:t},i)}function H(e,t,n){var o;N(t),B.set(e,{widgetHost:t});const i=()=>{P&&V(e,P,t)};e.addEventListener("load",i,(null==n?void 0:n.signal)?{signal:n.signal}:void 0),null==(o=null==n?void 0:n.signal)||o.addEventListener("abort",()=>{B.delete(e)},{once:!0}),e.contentWindow&&i()}function Z(e){var t;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&P&&e.source&&function(e){if(R.has(e))return!0;for(const n of B.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e.origin)&&(!function(e){if(!e)return!1;for(const t of B.keys())if(t.contentWindow===e)return!0;return!1}(e.source)?console.warn("[Brainfish] Rejected REQUEST_USER_IDENTITY from untrusted iframe source:",e.origin):e.source.postMessage({type:O,payload:P},e.origin))}function D(){F||"undefined"==typeof window||(F=!0,window.addEventListener("message",Z))}const G=/* @__PURE__ */new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function z(e){D();const t=function(e){const t=e.userId,n="string"==typeof t?t:"number"==typeof t&&Number.isFinite(t)?String(t):"";if(!n)return console.warn("[Brainfish] Widgets.identify requires a non-empty userId (string or finite number)."),null;const o={userId:n};"string"==typeof e.firstName&&(o.firstName=e.firstName),"string"==typeof e.lastName&&(o.lastName=e.lastName),"string"==typeof e.email&&(o.email=e.email),"string"==typeof e.phone&&(o.phone=e.phone),"string"==typeof e.avatar&&(o.avatar=e.avatar);const i={};for(const a of Object.keys(e))G.has(a)||(i[a]=e[a]);const r=e.properties&&"object"==typeof e.properties&&!Array.isArray(e.properties)?e.properties:void 0;return(Object.keys(i).length>0||r)&&(o.properties=s(s({},i),r)),o}(e);return t?(t.phone&&!/^\+[1-9]\d{1,14}$/.test(t.phone)&&console.warn("[Brainfish] phone should be in E.164 format (e.g., +14155552671)."),P=t,function(e){for(const[t,{widgetHost:n}]of B)V(t,e,n)}(t),t):null}function $(e){if(e.__bfIdentityWrapped)return e;const t=(t,...n)=>{if("identify"===t&&n[0]&&"object"==typeof n[0]&&!Array.isArray(n[0])){const o=z(n[0]);if(o)return e(t,o,...n.slice(1))}return e(t,...n)};return t.__bfIdentityWrapped=!0,e.q&&(t.q=e.q),t}let Y=!1;function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,K={exports:{}},U={exports:{}},q={exports:{}};function Q(){return J||(J=1,function(e,t){function n(e){return Math.round(255*e)}function o(e,t,o){return n(e)+","+n(t)+","+n(o)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=o),0===t)return i(n,n,n);var r=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(r%2-1)),c=0,l=0,d=0;r>=0&&r<1?(c=a,l=s):r>=1&&r<2?(c=s,l=a):r>=2&&r<3?(l=a,d=s):r>=3&&r<4?(l=s,d=a):r>=4&&r<5?(c=s,d=a):r>=5&&r<6&&(c=a,d=s);var u=n-a/2;return i(c+u,l+u,d+u)},e.exports=t.default}(q,q.exports)),q.exports}var ee,te={exports:{}};function ne(){return ee||(ee=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}(te,te.exports)),te.exports}var oe,ie,re,ae={exports:{}};function se(){return oe||(oe=1,function(e,t){function n(e){var t="function"==typeof Map?/* @__PURE__ */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(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&i(a,n.prototype),a}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=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 r(e){return(r=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 o,i=t[0],r=[];for(o=1;o<t.length;o+=1)r.push(t[o]);return r.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=/* @__PURE__ */function(e){var t,n;function o(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 o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];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=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),o}(/* @__PURE__ */n(Error)),e.exports=t.default}(ae,ae.exports)),ae.exports}function ce(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,o.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 r=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:r}}if(t.match(c))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(l)){var h=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:h}}var g=d.exec(t);if(g)return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};var m=u.exec(t.substring(0,50));if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10),alpha:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])};var b=f.exec(t);if(b){var y=parseInt(""+b[1],10),w=parseInt(""+b[2],10)/100,v=parseInt(""+b[3],10)/100,x="rgb("+(0,n.default)(y,w,v)+")",S=d.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 C=p.exec(t.substring(0,50));if(C){var k=parseInt(""+C[1],10),E=parseInt(""+C[2],10)/100,I=parseInt(""+C[3],10)/100,L="rgb("+(0,n.default)(k,E,I)+")",W=d.exec(L);if(!W)throw new i.default(4,t,L);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(/* @__PURE__ */Q()),o=r(/* @__PURE__ */ne()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,c=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^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}(U,U.exports)),U.exports}function le(){return re||(re=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,o.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],r=n[1],a=n[2];return parseFloat((.2126*i+.7152*r+.0722*a).toFixed(3))};var n,o=(n=/* @__PURE__ */ce())&&n.__esModule?n:{default:n};e.exports=t.default}(K,K.exports)),K.exports}const de=/* @__PURE__ */X(/* @__PURE__ */le());var ue,fe={exports:{}},pe={exports:{}};function he(){return ue||(ue=1,function(e,t){function n(e,t,o){return function(){var i=o.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}(pe,pe.exports)),pe.exports}var ge,me={exports:{}};function be(){return ge||(ge=1,e=me,(t=me.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),me.exports;var e,t}var ye,we,ve={exports:{}},xe={exports:{}};function Se(){return ye||(ye=1,e=xe,(t=xe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,o=e.green/255,i=e.blue/255,r=Math.max(n,o,i),a=Math.min(n,o,i),s=(r+a)/2;if(r===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=r-a,l=s>.5?c/(2-r-a):c/(r+a);switch(r){case n:t=(o-i)/c+(o<i?6:0);break;case o:t=(i-n)/c+2;break;default:t=(n-o)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),xe.exports;var e,t}function Ce(){return we||(we=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(/* @__PURE__ */ce()),o=i(/* @__PURE__ */Se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ve,ve.exports)),ve.exports}var ke,Ee={exports:{}},Ie={exports:{}},Le={exports:{}},We={exports:{}};function Te(){return ke||(ke=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}(We,We.exports)),We.exports}var _e,Me,Ae,Oe={exports:{}};function Pe(){return _e||(_e=1,e=Oe,(t=Oe.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),Oe.exports;var e,t}function Re(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(/* @__PURE__ */Q()),o=r(/* @__PURE__ */Te()),i=r(/* @__PURE__ */Pe());function r(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,o.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,o){return(0,n.default)(e,t,o,s)},e.exports=t.default}(Le,Le.exports)),Le.exports}function Be(){return Ae||(Ae=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 o.default(1)};var n=i(/* @__PURE__ */Re()),o=i(/* @__PURE__ */se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var Fe,je={exports:{}};function Ne(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,n.default)(e,t,r):"rgba("+(0,o.default)(e,t,r)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)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(/* @__PURE__ */Re()),o=r(/* @__PURE__ */Q()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(je,je.exports)),je.exports}var Ve,He={exports:{}};function Ze(){return Ve||(Ve=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(t)+(0,o.default)(r));if("object"==typeof e&&void 0===t&&void 0===r)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(/* @__PURE__ */Te()),o=r(/* @__PURE__ */Pe()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(He,He.exports)),He.exports}var De,Ge,ze,$e={exports:{}};function Ye(){return De||(De=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,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 r&&"number"==typeof a)return a>=1?(0,o.default)(e,t,r):"rgba("+e+","+t+","+r+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)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(/* @__PURE__ */ce()),o=r(/* @__PURE__ */Ze()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}($e,$e.exports)),$e.exports}function Xe(){return Ge||(Ge=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,r.default)(e);if(c(e))return(0,i.default)(e);if(u(e))return(0,o.default)(e);if(d(e))return(0,n.default)(e);throw new a.default(8)};var n=s(/* @__PURE__ */Be()),o=s(/* @__PURE__ */Ne()),i=s(/* @__PURE__ */Ze()),r=s(/* @__PURE__ */Ye()),a=s(/* @__PURE__ */se());function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},d=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(Ee,Ee.exports)),Ee.exports}function Je(){return ze||(ze=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */he()),o=a(/* @__PURE__ */be()),i=a(/* @__PURE__ */Ce()),r=a(/* @__PURE__ */Xe());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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness-parseFloat(e))}))});t.default=c,e.exports=t.default}(fe,fe.exports)),fe.exports}const Ke=/* @__PURE__ */X(/* @__PURE__ */Je());var Ue,qe={exports:{}};function Qe(){return Ue||(Ue=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */he()),o=a(/* @__PURE__ */be()),i=a(/* @__PURE__ */Ce()),r=a(/* @__PURE__ */Xe());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 o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness+parseFloat(e))}))});t.default=c,e.exports=t.default}(qe,qe.exports)),qe.exports}const et=/* @__PURE__ */X(/* @__PURE__ */Qe()),tt="bf-iframe-container",nt="bf-trigger-button",ot="bf-search-bar-iframe-container",it="bf-search-bar-iframe-backdrop";function rt(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 o=de(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;max-width:36px;max-height:36px}.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);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));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,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@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.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.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 .${nt} { background: ${e}; }\n .${nt}:hover {\n background: ${o?Ke(.05,e):et(.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")}}class at{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function st(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const ct="brainfish-search-widget";function lt(e){const t=document.querySelector(e);return t instanceof HTMLElement?t:null}function dt(e){const t=null==e?void 0:e.trim();if(!t)return null;const n=lt(t);return n||console.warn(`[Brainfish] mountTarget "${t}" not found or is not a valid element. Falling back to document.body.`),n}function ut(e,t){const n=function(e){const t=document.getElementById(`trigger-button-${e}`);return t||document.querySelector(`.${tt}`)}(e);if(!n)return!1;const o=null==t?void 0:t.trim();if(!o)return!0;const i=lt(o);if(!i)return!1;if(!i.contains(n))return!1;if(document.getElementById(`trigger-button-${e}`)){const e=document.querySelector(`.${tt}`);if(e&&!i.contains(e))return!1}return!0}function ft(e,t){const n=()=>{(function(e){var t;return null!=(t=dt(e))?t:document.body})(t).appendChild(e)};if(!document.body)return console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),void document.addEventListener("DOMContentLoaded",n,{once:!0});n()}const pt=["bottom-left","bottom-right","top-left","top-right"];let ht;function gt(e){return pt.includes(e)}class mt{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===h.Searchbar?ot:tt}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${it}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,o;const i=document.querySelector(`.${this.containerClass}`),r=null==i?void 0:i.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==r?void 0:r.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==r?void 0:r.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(o=null==r?void 0:r.contentWindow)||o.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==h.Searchbar){null==i||i.classList.add("open");const t=gt(a=e.position)?a:ht;t&&(null==i||i.classList.add(`position-${t}`),null==i||i.setAttribute("data-current-position",t))}var a;if(null==i||i.setAttribute("aria-hidden","false"),this.widgetType!==h.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=st("div",it);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(ct);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==h.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){var n;const o=document.querySelector(`.${ot}[data-widget-key="${e}"]`);if(o){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(o)}return"Search"!==t.widgetType&&ut(e,null==(n=t.settings)?void 0:n.mountTarget)}}class bt{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===h.Popup)}static clear(){this.instances.clear()}}l(bt,"instances",/* @__PURE__ */new Map);const yt=({formUrl:e,width:t="500px",height:n="600px"})=>{const o=document.createElement("div");o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("tabindex","-1"),o.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const i=document.createElement("button");i.innerHTML="×",i.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const r=document.createElement("iframe");r.src=e,r.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[i,r],n=document.activeElement,o=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?o<=0?t[t.length-1].focus():t[o-1].focus():o>=t.length-1?t[0].focus():t[o+1].focus()}else"Escape"===e.key&&c()},c=()=>{o.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",i.onclick=c,l.onclick=c,document.addEventListener("keydown",s),o.appendChild(i),o.appendChild(r),document.body.appendChild(l),document.body.appendChild(o),o.focus(),r.onload=()=>{r.setAttribute("tabindex","0"),i.focus()}},wt=e=>`brainfish_conversation_${e}`,vt={save(e,t){if(t){const o=L(wt(e));let i=Date.now();if(o)try{const e=JSON.parse(o);e.conversationId===t&&(i=e.persistedAt)}catch(n){}const r={conversationId:t,persistedAt:i};((e,t)=>{try{I()&&window.localStorage.setItem(e,t)}catch(n){}})(wt(e),JSON.stringify(r))}else W(wt(e))},load(e){const t=L(wt(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(W(wt(e)),null):n.conversationId}catch(n){return W(wt(e)),null}},clear(e){W(wt(e))}};class xt{static getIframeForInstance(e){var t,n;const o=e.widgetType===h.Searchbar?ot:tt,i=e.widgetType===h.Searchbar?`.${o}[data-widget-key="${e.widgetKey}"]`:`.${o}`;return null!=(n=null==(t=document.querySelector(i))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,o;null==(o=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||o.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=yt,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=bt.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=bt.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,o={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(o.newConversation=!0),(null==n?void 0:n.trigger)&&(o.trigger=n.trigger),(null==n?void 0:n.position)&&(o.position=n.position),t.openWidget(o)}}static createNewThread(){const e=bt.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=bt.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=bt.getOpenInstance();if(n||(n=bt.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=c(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(o)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=bt.getOpenInstance();const n=!!t;t||(t=bt.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=bt.getOpenInstance())?e:bt.getClosedPopupInstance();t?(vt.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(xt,"isInitialized",!1);class St{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case h.Searchbar:n="searchbar_widget";break;case h.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,c(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class Ct{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new at(e,t),this.domController=new mt(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new St(t,e)}static getInstance(e){return bt.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),bt.register(this.widgetKey,this),xt.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=vt.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){bt.unregister(this.widgetKey)}static initialize(e){const t=new Ct(e.widgetKey,e.widgetType);return t.initialize(e),t}}function kt({widgetUrl:e,widgetType:t,props:n}){const o=t===h.Searchbar?ot:tt,i=st("div",o,s({id:o,"aria-live":"polite","aria-hidden":t===h.Searchbar?"false":"true"},n||{})),r=st("div","iframe-loading-indicator"),a=st("div","spinner");r.setAttribute("aria-label","Loading content"),r.setAttribute("role","status"),r.appendChild(a),i.appendChild(r);const c=st("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{r.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),r.innerHTML="";const t=st("div","loading-error");r.appendChild(t),r.setAttribute("aria-label","Failed to load content")}),i.appendChild(c),{iframeContainer:i,iframe:c}}function Et(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())})()}const It=/* @__PURE__ */new Map,Lt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,Wt=(e,t)=>d(null,null,function*(){if(It.has(e)){const i=It.get(e);if("function"!=typeof i)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield i(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(o){return{success:!1,reason:Lt(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),Tt=/* @__PURE__ */new Map,_t=/* @__PURE__ */new Set;function Mt(e,{widgetHost:t,apiHost:n,widgetKey:o,widgetType:i,signal:r,stateManager:a}){window.addEventListener("message",r=>d(null,null,function*(){var s,c;if(r.origin!==t)return;const{type:l,widgetKey:d}=r.data;if(!d||d===o){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${tt}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=r.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{messageId:e,eventName:t,data:n}=r.data;if(e){if(_t.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);_t.add(e),setTimeout(()=>_t.delete(e),5e3)}a.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:i,answer:a,conversation:s}=r.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=Tt.get(e.id);if(c&&Date.now()-c<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-c}ms ago)`);Tt.set(e.id,Date.now()),setTimeout(()=>Tt.delete(e.id),1e3),vt.clear(o);const l={query:i,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](i,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",o),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const r=document.createElement("script");r.src=t.toString(),document.head.appendChild(r),r.onload=()=>{window.__bfCallbacks[e.id](i,a,l),setTimeout(()=>{document.head.removeChild(r)},300)},r.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:o}=r.data,i=yield Wt(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=r.data;i!==h.Searchbar&&vt.save(o,e)}if("REQUEST_USER_IDENTITY"===l&&r.source===e.contentWindow&&i===h.Popup){const t=vt.load(o);t&&(null==(c=e.contentWindow)||c.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:r})}function At(e,t,n){let o;const i=()=>{(t=>{var o;const i={type:"UPDATE_BODY_CLASS",isMobile:t};null==(o=e.contentWindow)||o.postMessage(i,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},r=()=>{o&&clearTimeout(o),o=window.setTimeout(i,300)};i(),(()=>{const e=new ResizeObserver(r);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const Ot=/* @__PURE__ */new Set;function Pt(e,t,{isButtonHidden:n,triggerButtonIcon:o}){const i=document.createDocumentFragment();let r;if(n)r=Ct.initialize({isButtonHidden:n,widgetType:h.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=st("button",nt,{id:`trigger-button-${e}`,"aria-controls":tt,"aria-expanded":"false","data-name":nt}),o=st("div","trigger-button-icon",{"aria-hidden":"true"});return o.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" 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(o),{button:n,icon:o}}(e,o);i.appendChild(t),r=Ct.initialize({button:t,icon:n,widgetType:h.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=kt({widgetUrl:t,widgetType:h.Popup});return i.appendChild(a),{fragment:i,iframe:s,stateManager:r}}const Rt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i,hideTriggerButton:r})=>{const{settings:a}=e,s=null!=r?r:null==a?void 0:a.hideTriggerButton,c=null==a?void 0:a.triggerButtonIcon,l=null==a?void 0:a.mountTarget;try{if(d=null==a?void 0:a.popupPosition,ht=gt(d)?d:void 0,function(e,t){const n=dt(t);if(!n)return!1;const o=document.getElementById(`trigger-button-${e}`),i=document.querySelector(`.${tt}`);if(!o&&!i)return!1;let r=!1;o&&!n.contains(o)&&(n.appendChild(o),r=!0),i&&!n.contains(i)&&(n.appendChild(i),r=!0)}(i,l),ut(i,l))return void Ot.add(i);if(function(e){return Ot.has(e)}(i))return;rt(e);const{fragment:r,iframe:u,stateManager:f}=Pt(i,t,{isButtonHidden:s||!1,triggerButtonIcon:c||""}),p=new AbortController,{signal:g}=p;H(u,o,{signal:g}),u.onload=()=>{setTimeout(()=>{var e;Et(u,g),Mt(u,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Popup,signal:g,stateManager:f}),At(u,g,f);const r=vt.load(i),a=new URL(t).searchParams.has("conversation");r&&!a&&(null==(e=u.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:r},"*"))},0)},ft(r,l),Ot.add(i);const m=()=>{p.abort(),window.removeEventListener("beforeunload",m)};return void window.addEventListener("beforeunload",m)}catch(u){!function(e,t,n){w(e,t,t.message,n)}(n,u,i)}var d},Bt=/* @__PURE__ */new Map;const Ft=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i})=>{var r,a,s,c;let l=Ct.getInstance(i);null==(r=Bt.get(i))||r.abort();const d=new AbortController;Bt.set(i,d),rt(e);try{const e=document.querySelector(`.${ot}[data-widget-key="${i}"]`),r=document.querySelector(ct);e&&r&&!r.contains(e)&&(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(a=r.parentElement)||a.style.setProperty("width","100%"))),l||(l=Ct.initialize({isButtonHidden:!0,widgetType:h.Searchbar,widgetKey:i}));const{signal:u}=d,f=e=>{H(e,o,{signal:u}),Et(e,u),Mt(e,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Searchbar,signal:u,stateManager:l}),At(e,u,l)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(c=t.contentDocument)?void 0:c.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:o}=kt({widgetUrl:t,widgetType:h.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":i}});o.onload=()=>{setTimeout(()=>{f(o)},0)},e.appendChild(n),r?(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(s=r.parentElement)||s.style.setProperty("width","100%"))):document.body.appendChild(e)}const p=()=>{d.abort(),Bt.delete(i),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(u){!function(e,t,n){w(e,t,t.message,n)}(n,u,i)}},jt=(e,t,n)=>{var a;const l=S(e.overrides),d=(null==(u=e.overrides)?void 0:u.widgetHost)||"https://agent.brainfi.sh";var u;N(d);const f=null==(a=e.overrides)?void 0:a.hideTriggerButton,{theme:p,settings:h}=t,g=e.overrides||{},{theme:m,redirectRules:b,regions:y,customCss:w}=g,v=((e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&r.call(e,a)&&(n[a]=e[a]);return n})(g,["theme","redirectRules","regions","customCss"]),x=s(s({},p),m),C=s(s({},h),v),k=M(JSON.stringify(b)),E={theme:M(JSON.stringify(x)),settings:M(JSON.stringify(C)),redirectRules:k};y&&(E.regions=M(JSON.stringify(y))),w&&(E.customCss=M(w)),n&&(E.fingerprint=M(n));const I=`${d}/?widgetKey=${e.widgetKey}#${new URLSearchParams(E).toString()}`,L=c(s({},t),{theme:x,settings:C});"Search"===t.widgetType?Ft({config:L,widgetUrl:I,apiHost:l,widgetHost:d,widgetKey:e.widgetKey}):Rt({config:L,widgetUrl:I,apiHost:l,widgetHost:d,widgetKey:e.widgetKey,hideTriggerButton:f})};var Nt=/* @__PURE__ */(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(Nt||{});const Vt=e=>d(null,null,function*(){if(e.widgetType===h.Popup){const e=window.fcWidget?Nt.FRESHCHAT:null;e&&e===Nt.FRESHCHAT&&(yield d(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Ht="brainfish-nudges",Zt=(e,t)=>d(null,null,function*(){try{yield d(null,null,function*(){if(!document.getElementById(Ht))return new Promise(e=>{const t=document.createElement("script");t.id=Ht,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){w(e,n,"Failed to initialize Nudge widget",t)}});let Dt,Gt,zt,$t=!1;const Yt=e=>{null==Dt||Dt.abort(),Dt=new AbortController;const{signal:t}=Dt;let n=window.location.pathname;const o=()=>{if(t.aborted)return;const o=window.location.pathname;o!==n&&(n=o,e())};window.addEventListener("popstate",o,{signal:t}),$t||(Gt=history.pushState,zt=history.replaceState,history.pushState=function(...e){Gt.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){zt.apply(this,e),setTimeout(o,0)},$t=!0),t.addEventListener("abort",()=>{$t&&(history.pushState=Gt,history.replaceState=zt,$t=!1)})};var Xt="5.2.0";function Jt(e,t){return new Promise(n=>setTimeout(n,e,t))}function Kt(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Ut(e){return!!e&&"function"==typeof e.then}function qt(e,t){try{const n=e();Ut(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function Qt(e,t,n=16){return d(this,null,function*(){const o=Array(e.length);let i=Date.now();for(let r=0;r<e.length;++r){o[r]=t(e[r],r);const a=Date.now();a>=i+n&&(i=a,yield Kt())}return o})}function en(e){return e.then(void 0,()=>{}),e}function tn(e){return parseInt(e)}function nn(e){return parseFloat(e)}function on(e,t){return"number"==typeof e&&isNaN(e)?t:e}function rn(e){return e.reduce((e,t)=>e+(t?1:0),0)}function an(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function sn(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let l=0,d=0,u=0,f=0;f+=r+(65535&t[1]),u+=f>>>16,f&=65535,u+=i+c,d+=u>>>16,u&=65535,d+=o+s,l+=d>>>16,d&=65535,l+=n+a,l&=65535,e[0]=l<<16|d,e[1]=u<<16|f}function cn(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,l=65535&t[1];let d=0,u=0,f=0,p=0;p+=r*l,f+=p>>>16,p&=65535,f+=i*l,u+=f>>>16,f&=65535,f+=r*c,u+=f>>>16,f&=65535,u+=o*l,d+=u>>>16,u&=65535,u+=i*c,d+=u>>>16,u&=65535,u+=r*s,d+=u>>>16,u&=65535,d+=n*l+o*c+i*s+r*a,d&=65535,e[0]=d<<16|u,e[1]=f<<16|p}function ln(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function dn(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function un(e,t){e[0]^=t[0],e[1]^=t[1]}const fn=[4283543511,3981806797],pn=[3301882366,444984403];function hn(e){const t=[0,e[0]>>>1];un(e,t),cn(e,fn),t[1]=e[0]>>>1,un(e,t),cn(e,pn),t[1]=e[0]>>>1,un(e,t)}const gn=[2277735313,289559509],mn=[1291169091,658871167],bn=[0,5],yn=[0,1390208809],wn=[0,944331445];function vn(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e);t=t||0;const o=[0,n.length],i=o[1]%16,r=o[1]-i,a=[0,t],s=[0,t],c=[0,0],l=[0,0];let d;for(d=0;d<r;d+=16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,l[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,l[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,cn(c,gn),ln(c,31),cn(c,mn),un(a,c),ln(a,27),sn(a,s),cn(a,bn),sn(a,yn),cn(l,mn),ln(l,33),cn(l,gn),un(s,l),ln(s,31),sn(s,a),cn(s,bn),sn(s,wn);c[0]=0,c[1]=0,l[0]=0,l[1]=0;const u=[0,0];switch(i){case 15:u[1]=n[d+14],dn(u,48),un(l,u);case 14:u[1]=n[d+13],dn(u,40),un(l,u);case 13:u[1]=n[d+12],dn(u,32),un(l,u);case 12:u[1]=n[d+11],dn(u,24),un(l,u);case 11:u[1]=n[d+10],dn(u,16),un(l,u);case 10:u[1]=n[d+9],dn(u,8),un(l,u);case 9:u[1]=n[d+8],un(l,u),cn(l,mn),ln(l,33),cn(l,gn),un(s,l);case 8:u[1]=n[d+7],dn(u,56),un(c,u);case 7:u[1]=n[d+6],dn(u,48),un(c,u);case 6:u[1]=n[d+5],dn(u,40),un(c,u);case 5:u[1]=n[d+4],dn(u,32),un(c,u);case 4:u[1]=n[d+3],dn(u,24),un(c,u);case 3:u[1]=n[d+2],dn(u,16),un(c,u);case 2:u[1]=n[d+1],dn(u,8),un(c,u);case 1:u[1]=n[d],un(c,u),cn(c,gn),ln(c,31),cn(c,mn),un(a,c)}return un(a,o),un(s,o),sn(a,s),sn(s,a),hn(a),hn(s),sn(a,s),sn(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function xn(e,t,n,o){const i=Object.keys(e).filter(e=>!function(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}(n,e)),r=en(Qt(i,n=>function(e,t){const n=en(new Promise(n=>{const o=Date.now();qt(e.bind(null,t),(...e)=>{const t=Date.now()-o;if(!e[0])return n(()=>({error:e[1],duration:t}));const i=e[1];if(function(e){return"function"!=typeof e}(i))return n(()=>({value:i,duration:t}));n(()=>new Promise(e=>{const n=Date.now();qt(i,(...o)=>{const i=t+Date.now()-n;if(!o[0])return e({error:o[1],duration:i});e({value:o[1],duration:i})})}))})}));return function(){return n.then(e=>e())}}(e[n],t),o));return function(){return d(this,null,function*(){const e=yield r,t=yield Qt(e,e=>en(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function Sn(){const e=window,t=navigator;return rn(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Cn(){const e=window,t=navigator;return rn(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function kn(){const e=window;return rn(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function En(){const e=window,{HTMLElement:t,Document:n}=e;return rn(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function In(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function Ln(){var e,t;const n=window;return rn(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Wn(){const{CSS:e}=window;return rn([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Tn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return rn([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function _n(){const e=Cn(),t=Ln(),n=window,o=navigator,i="connection";return e?rn([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&rn(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function Mn(e){const t=new Error(e);return t.name=e,t}function An(e,t,n=50){return d(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield Jt(n);const s=a.createElement("iframe");try{for((yield new Promise((e,n)=>{let o=!1;const i=()=>{o=!0,e()};s.onload=i,s.onerror=e=>{o=!0,n(e)};const{style:r}=s;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);const c=()=>{var e,t;o||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}));!(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body);)yield Jt(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function On(e){const[t,n]=function(e){var t,n;const o=`Unexpected syntax '${e}'`,i=/^\s*([a-z-]*)(.*)$/i.exec(e),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=(e,t)=>{a[e]=a[e]||[],a[e].push(t)};for(;;){const e=s.exec(i[2]);if(!e)break;const r=e[0];switch(r[0]){case".":c("class",r.slice(1));break;case"#":c("id",r.slice(1));break;case"[":{const e=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(r);if(!e)throw new Error(o);c(e[1],null!==(n=null!==(t=e[4])&&void 0!==t?t:e[5])&&void 0!==n?n:"");break}default:throw new Error(o)}}return[r,a]}(e),o=document.createElement(null!=t?t:"div");for(const i of Object.keys(n)){const e=n[i].join(" ");"style"===i?Pn(o.style,e):o.setAttribute(i,e)}return o}function Pn(e,t){for(const n of t.split(";")){const t=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(t){const[,n,o,,i]=t;e.setProperty(n,o,i||"")}}}const Rn=["monospace","sans-serif","serif"],Bn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Fn(e){return e.toDataURL()}let jn,Nn;function Vn(){return function(){if(void 0!==Nn)return;const e=()=>{const t=Hn();Zn(t)?Nn=setTimeout(e,2500):(jn=t,Nn=void 0)};e()}(),()=>d(null,null,function*(){let e=Hn();if(Zn(e)){if(jn)return[...jn];(function(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null})()&&(yield function(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}(),e=Hn())}return Zn(e)||(jn=e),e})}function Hn(){const e=screen;return[on(nn(e.availTop),null),on(nn(e.width)-nn(e.availWidth)-on(nn(e.availLeft),0),null),on(nn(e.height)-nn(e.availHeight)-on(nn(e.availTop),0),null),on(nn(e.availLeft),null)]}function Zn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Dn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Gn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function zn(e){return matchMedia(`(forced-colors: ${e})`).matches}function $n(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Yn(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Xn(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Jn(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Kn=Math,Un=()=>0;const qn="mmMwWLliI0fiflO&1",Qn={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function eo(e){const t=_n()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const to=function(){let e=window;for(;;){const n=e.parent;if(!n||n===e)return!1;try{if(n.location.origin!==e.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}e=n}};const no=/* @__PURE__ */new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),oo=/* @__PURE__ */new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),io=["FRAGMENT_SHADER","VERTEX_SHADER"],ro=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],ao="WEBGL_debug_renderer_info";function so(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch(o){}if(n)break}return e.webgl={context:n},n}function co(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function lo(e){return Object.keys(e.__proto__).filter(uo)}function uo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function fo(){return Ln()}function po(){return Cn()||kn()}function ho(e){return"function"==typeof e.getParameter}const go={userAgentData:function(){return d(this,null,function*(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:e})=>!function(e){return/not/i.test(e)}(e)).map(({brand:e})=>e),n={brands:t.length>1?t.filter(e=>"Chromium"!==e):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);n.architecture=t.architecture,n.bitness=t.bitness,n.model=t.model,n.platformVersion=t.platformVersion}catch(o){if(!(o instanceof DOMException&&"NotAllowedError"===o.name))throw o;n.highEntropyStatus="not_allowed"}return n})},fonts:function(){return An((e,t)=>d(null,[e,t],function*(e,{document:t}){const n=t.body;n.style.fontSize="48px";const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i={},r={},a=e=>{const n=t.createElement("span"),{style:i}=n;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",o.appendChild(n),n},s=(e,t)=>a(`'${e}',${t}`),c=Rn.map(a),l=(()=>{const e={};for(const t of Bn)e[t]=Rn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Rn.length;d++)i[Rn[d]]=c[d].offsetWidth,r[Rn[d]]=c[d].offsetHeight;return Bn.filter(e=>{return t=l[e],Rn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return d(this,arguments,function*({debug:e}={}){if(!kn()&&!_n())return;const t=function(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}(),n=Object.keys(t),o=[].concat(...n.map(e=>t[e])),i=yield function(e){return d(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Dn(o);for(let a=0;a<e.length;++a){const t=On(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Dn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield Jt(50);n.body.appendChild(o);try{for(let t=0;t<e.length;++t)i[t].offsetParent||(r[e[t]]=!0)}finally{null===(t=o.parentNode)||void 0===t||t.removeChild(o)}return r})}(o);e&&function(e,t){let n="DOM blockers debug:\n```";for(const o of Object.keys(e)){n+=`\n${o}:`;for(const i of e[o])n+=`\n ${t[i]?"🚫":"➡️"} ${i}`}console.log(`${n}\n\`\`\``)}(t,i);const r=n.filter(e=>{const n=t[e];return rn(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return An((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",Cn()?r.style.zoom=""+1/o.devicePixelRatio:kn()&&(r.style.zoom="reset");const s=i.createElement("div");return s.textContent=[...Array(t/20|0)].map(()=>"word").join(" "),r.appendChild(s),e(i,r,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((e,t,n)=>{const o={},i={};for(const a of Object.keys(Qn)){const[n={},i=qn]=Qn[a],r=e.createElement("span");r.textContent=i,r.style.whiteSpace="nowrap";for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(r.style[e]=t)}o[a]=r,t.append(e.createElement("br"),r)}const r=Cn()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return rn([o&&"try"in o,"caretPositionFromPoint"in t,i&&"onerror"in i.prototype,n.supports("ruby-align","space-around")])>=3}();for(const a of Object.keys(Qn)){const e=o[a].getBoundingClientRect().width;i[a]=r?eo(e*n.devicePixelRatio):e}return i})},audio:function(){return kn()&&Tn()&&In()||Cn()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return rn(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}()&&function(){const e=window,{URLPattern:t}=e;return rn(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(kn()&&!En()&&!function(){const e=window;return rn(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;const n=4500,o=new t(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;const r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);const[a,s]=function(e){const t=3,n=500,o=500,i=5e3;let r=()=>{};const a=new Promise((a,s)=>{let c=!1,l=0,d=0;e.oncomplete=e=>a(e.renderedBuffer);const u=()=>{setTimeout(()=>s(Mn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(Ut(o)&&en(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(Mn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=en(a.then(e=>function(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n)),e=>{if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return()=>(s(),c)}()},screenFrame:function(){const e=kn()&&Tn()&&In(),t=Ln()&&Wn();if(e||t)return()=>Promise.resolve(void 0);const n=Vn();return()=>d(null,null,function*(){const e=yield n(),t=e=>null===e?null:an(e,10);return[t(e[0]),t(e[1]),t(e[2]),t(e[3])]})},canvas:function(){return function(e){let t,n,o=!1;const[i,r]=function(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}();!function(e,t){return!(!t||!e.toDataURL)}(i,r)?t=n="unsupported":(o=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(r),e?t=n="skipped":[t,n]=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n=`Cwm fjordbank gly ${String.fromCharCode(55357,56835)}`;t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);const n=Fn(e),o=Fn(e);if(n!==o)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,o,i]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,i,40,0,2*Math.PI,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);const i=Fn(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=kn()&&Tn()&&In(),t=Ln()&&function(){const e=window,t=navigator,{CSS:n}=e;return rn(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}();return e||t}())},osCpu:function(){return navigator.oscpu},languages:function(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))Cn()&&function(){const e=window;return rn([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return on(nn(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(kn()&&Tn()&&In()))return function(){const e=screen,t=e=>on(tn(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=on(tn(navigator.hardwareConcurrency),void 0);return void 0!==e&&Ln()&&Wn()?e>=8?8:4:e},timezone:function(){var e;const t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){const e=(new t).resolvedOptions().timeZone;if(e)return e}const n=-function(){const e=/* @__PURE__ */(new Date).getFullYear();return Math.max(nn(new Date(e,0,1).getTimezoneOffset()),nn(new Date(e,6,1).getTimezoneOffset()))}();return`UTC${n>=0?"+":""}${n}`},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!Sn()&&!function(){const e=window,t=navigator;return rn(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Sn()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){const{platform:e}=navigator;return"MacIntel"===e&&kn()&&!En()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return rn(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const o=e[n];if(!o)continue;const i=[];for(let e=0;e<o.length;++e){const t=o[e];i.push({type:t.type,suffixes:t.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:i})}return t},touchSupport:function(){const e=navigator;let t,n=0;void 0!==e.maxTouchPoints?n=tn(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(o){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&"object"==typeof n&&e.push(t)}return e.sort()},cookiesEnabled:function(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}},colorGamut:function(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e},invertedColors:function(){return!!Gn("inverted")||!Gn("none")&&void 0},forcedColors:function(){return!!zn("active")||!zn("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=100;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}},contrast:function(){return $n("no-preference")?0:$n("high")||$n("more")?1:$n("low")||$n("less")?-1:$n("forced")?10:void 0},reducedMotion:function(){return!!Yn("reduce")||!Yn("no-preference")&&void 0},reducedTransparency:function(){return!!Xn("reduce")||!Xn("no-preference")&&void 0},hdr:function(){return!!Jn("high")||!Jn("standard")&&void 0},math:function(){const e=Kn.acos||Un,t=Kn.acosh||Un,n=Kn.asin||Un,o=Kn.asinh||Un,i=Kn.atanh||Un,r=Kn.atan||Un,a=Kn.sin||Un,s=Kn.sinh||Un,c=Kn.cos||Un,l=Kn.cosh||Un,d=Kn.tan||Un,u=Kn.tanh||Un,f=Kn.exp||Un,p=Kn.expm1||Un,h=Kn.log1p||Un;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,Kn.log(g+Kn.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>Kn.log(e+Kn.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>Kn.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>Kn.exp(e)-1/Kn.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(Kn.exp(e)+1/Kn.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(Kn.exp(2*e)-1)/(Kn.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>Kn.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>Kn.log(1+e))(10),powPI:(e=>Kn.pow(Kn.PI,e))(-100)};var g},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){const{ApplePaySession:e}=window;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(to())return-3;try{return e.canMakePayments()?1:0}catch(t){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(t)}},privateClickMeasurement:function(){var e;const t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(_n()||kn()))return-2;if(!window.AudioContext)return-1;const e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function({cache:e}){var t,n,o,i,r,a;const s=so(e);if(!s)return-1;if(!ho(s))return-2;const c=fo()?null:s.getExtension(ao);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function({cache:e}){const t=so(e);if(!t)return-1;if(!ho(t))return-2;const n=t.getSupportedExtensions(),o=t.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(const d of Object.keys(o))r.push(`${d}=${o[d]}`);const l=lo(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${no.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===ao&&fo()||"WEBGL_polygon_mode"===d&&po())continue;const e=t.getExtension(d);if(e)for(const n of lo(e)){const o=e[n];s.push(`${n}=${o}${oo.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of io)for(const e of ro){const n=co(t,d,e);c.push(`${d}.${e}=${n.join(",")}`)}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function mo(e){const t=function(e){if(_n())return.4;if(kn())return!En()||Tn()&&In()?.3:.5;const t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return an(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score".replace(/\$/g,`${n}`)}}function bo(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?s({name:(n=t).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):t;var n,o},2)}function yo(e){return vn(function(e){let t="";for(const n of Object.keys(e).sort()){const o=e[n],i="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${i}`}return t}(e))}function wo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):Jt(Math.min(e,t))}(e,2*e)}function vo(e,t){const n=Date.now();return{get(o){return d(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=mo(e);return{get visitorId(){return void 0===t&&(t=yo(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:Xt}}(r);return(t||(null==o?void 0:o.debug))&&console.log(`Copy the text below to get the debug data:\n\n\`\`\`\nversion: ${a.version}\nuserAgent: ${navigator.userAgent}\ntimeBetweenLoadAndGet: ${i-n}\nvisitorId: ${a.visitorId}\ncomponents: ${bo(r)}\n\`\`\``),a})}}}var xo={load:function(){return d(this,arguments,function*(e={}){const{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${Xt}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield wo(t);const i=function(e){return xn(go,e,[])}({cache:{},debug:n});return vo(i,n)})},hashComponents:yo,componentsToDebugString:bo};D(),function(){if(Y||"undefined"==typeof window)return;Y=!0;const e=window;let t=e.BrainfishAnalytics?$(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?$(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=$(e.BrainfishAnalytics))}}();let So=null;const Co="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(So||(So=function(){const e=[];let t=null;function n(n,o){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const r=i[e[e.length-1]];if("function"==typeof r)return r.apply(i,o)}else e.push([n,o])}return{Widgets:{init:(...e)=>n("Widgets.init",e),setTheme:(...e)=>n("Widgets.setTheme",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:o})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:o}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),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(o){for(t=o;e.length>0;){const[t,o]=e.shift();n(t,o)}}}}(),"undefined"!=typeof window&&(window.Brainfish=So)),So),ko=/* @__PURE__ */new Map,Eo=/* @__PURE__ */new Map;let Io=!1;function Lo(e,t,n,o,i){return d(this,null,function*(){var r,a,s,c,l,d,u;const f=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(a=null==t?void 0:t.settings)?void 0:a.enableRecording)||!1,p=(null==(s=e.overrides)?void 0:s.version)||(null==t?void 0:t.version);Eo.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(jt(e,t,i),Io||(Io=!0,Yt(()=>{Eo.forEach(({options:e,config:t,fingerprint:n})=>{var o;const i=(null==(o=e.overrides)?void 0:o.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&&jt(e,t,n)})}))):h.push(E(e,t)),h.push(_(e.widgetKey,t.trackingToken||"",n,o,f,{blocklist:null==(c=null==t?void 0:t.settings)?void 0:c.recordingBlocklist,sampleRate:null==(d=null==(l=null==t?void 0:t.settings)?void 0:l.ambientSettings)?void 0:d.sampleRate,_allowLocalhostRecording:null==(u=null==t?void 0:t.settings)?void 0:u._allowLocalhostRecording})),h.push(Zt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&Co._setRealBrainfish(g.value)})}Co.Widgets.isReady=!1,Co.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):z(e)},Co.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},Co.Widgets.init=e=>d(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=S(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield xo.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(A(e.config));else{const{config:n}=yield v({widgetKey:e.widgetKey,apiHost:t});r=n}let a=ko.get(e.widgetKey);if(a||(a=Lo(e,r,t,n,i),ko.set(e.widgetKey,a)),yield a,!mt.isWidgetDOMExisting(e.widgetKey,r)){ko.delete(e.widgetKey);const o=Lo(e,r,t,n,i);ko.set(e.widgetKey,o),yield o}yield Vt(r),Co.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),Co.Widgets.setTheme=e=>{var t;const n=document.querySelector("#bf-iframe-container .trigger-iframe");if(n){const o=new URL(n.src),i=new URLSearchParams(o.hash.substring(1)),r=i.get("theme");let a;r&&(a=JSON.parse(A(r)));const c=s(s({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:c},"*");const l=M(JSON.stringify(c));i.set("theme",l),o.hash=`#${i.toString()}`,n.src=o.toString()}},Co.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{It.set(e,t)})(e,t)};const Wo=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)};export{Wo as BrainfishAnalytics,Co as default};
|
|
2
2
|
//# sourceMappingURL=web.js.map
|