{"version":3,"file":"WebUIHeader.De8RyZ9i.mjs","names":["detectLocaleFromUrl","languages","UserConsentProvider","AnalyticsProvider","analyticsConfig","containerStyle","Footer","Trackers","languages","UserConsentProvider","AnalyticsProvider","LoadAuthClient","IdentifyAndTrackPageView","SearchModalProvider","UserWorkspacesProvider","Header","Logout","SearchModal"],"sources":["https:/framerusercontent.com/modules/uvx32eocEp654SpIVsN3/obtSKinv3TZQVszK9prS/WebUIFooter.js","https:/framerusercontent.com/modules/x0uPZJlADgSt5DQqBvzw/fjDqEOtMrSZIuaXdIb3h/WebUIHeader.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{Footer,languages,AnalyticsProvider,Trackers,UserConsentProvider}from\"https://framerusercontent.com/modules/2ZHvBtRmbXndSJHN8Pby/LlKDuXHeKotlDxK2yLEL/Components.js\";import{amplitudeApiKey,analyticsEnabled,baseUrl,jitsuApiKey,jitsuEndpoint}from\"https://framerusercontent.com/modules/reJAHDcqdBR6JUT35NJ6/0RZUeAq5VtTxEN8G6tcf/Const.js\";const analyticsConfig={jitsuEndpoint:jitsuEndpoint,amplitudeApiKey:amplitudeApiKey,jitsuApiKey:jitsuApiKey,isEnabled:analyticsEnabled===\"true\",isDevelopment:false};function detectLocaleFromUrl(){try{const urlObj=new URL(window.location.href);const pathname=urlObj.pathname;// Iterate through the languages to find a matching prefix\nfor(const lang of languages){// Check if there's a urlPrefix defined for the language\nif(lang.urlPrefix){// Construct the expected prefix pattern, e.g., \"/es/\" or \"/fr/\"\nconst prefixPattern=`/${lang.urlPrefix}/`;// Check if the pathname starts with the prefix or is just the prefix (e.g., \"/es\")\nif(pathname.startsWith(prefixPattern)||pathname===`/${lang.urlPrefix}`){return lang.locale;}}}// If no matching prefix is found, return the default locale (en-US)\n// Assuming en-US is always the default and has urlPrefix: null\nconst defaultLang=languages.find(lang=>lang.urlPrefix===null);return defaultLang?defaultLang.locale:\"en-US\"// Fallback to 'en-US' if no default found in array\n;}catch(err){console.error(\"Error detecting locale from URL:\",err);return\"en-US\"// Fallback in case of any error\n;}}export default function WebUIFooter(props){if(window&&window.location.host.includes(\"framercanvas.com\")){return /*#__PURE__*/_jsx(\"div\",{style:{height:\"64px\",width:\"100%\",backgroundColor:\"gray\",color:\"white\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:\"Footer placeholder\"});}return /*#__PURE__*/_jsx(UserConsentProvider,{children:/*#__PURE__*/_jsx(AnalyticsProvider,{config:analyticsConfig,children:/*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsx(Footer,{appUrl:baseUrl,locale:detectLocaleFromUrl()}),/*#__PURE__*/_jsx(Trackers,{gtmTagId:\"GTM-NGWCJJQ\"})]})})});}const containerStyle={width:\"100%\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WebUIFooter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{Header,languages,AnalyticsProvider,IdentifyAndTrackPageView,LoadAuthClient,ShowLoginModal,ShowRegisterModal,Logout,SearchModalProvider,SearchModal,UserWorkspacesProvider,UserConsentProvider}from\"https://framerusercontent.com/modules/2ZHvBtRmbXndSJHN8Pby/LlKDuXHeKotlDxK2yLEL/Components.js\";import{amplitudeApiKey,amplitudeWorkflowApiKey,analyticsEnabled,authLoginUrl,authUrl,baseUrl,gqlGatewayUrl,jitsuApiKey,jitsuEndpoint,workflowUrl}from\"https://framerusercontent.com/modules/reJAHDcqdBR6JUT35NJ6/0RZUeAq5VtTxEN8G6tcf/Const.js\";const analyticsConfig={jitsuEndpoint:jitsuEndpoint,amplitudeApiKey:amplitudeApiKey,amplitudeWorkflowApiKey:amplitudeWorkflowApiKey,jitsuApiKey:jitsuApiKey,isEnabled:analyticsEnabled===\"true\",isDevelopment:false};function handleLocaleChange(locale){try{const urlObj=new URL(window.location.href);let pathname=urlObj.pathname;// Find the selected language object\nconst selectedLang=languages.find(lang=>lang.locale===locale);if(!selectedLang){console.error(`Locale \"${locale}\" not found in languages list.`);return;// Exit if locale is not supported\n}// Remove any existing locale prefix from the pathname\nlet cleanedPathname=pathname;for(const lang of languages){if(lang.urlPrefix&&pathname.startsWith(`/${lang.urlPrefix}/`)){cleanedPathname=pathname.substring(lang.urlPrefix.length+1);break;}}// Construct the new URL with the appropriate locale prefix\nif(selectedLang.urlPrefix){urlObj.pathname=`/${selectedLang.urlPrefix}${cleanedPathname}`;}else{// For the default language (e.g., 'en-US'), remove the prefix\nurlObj.pathname=cleanedPathname;}// Redirect to the new URL\nwindow.location.href=urlObj.toString();}catch(err){console.error(\"Error handling locale change:\",err);}}function detectLocaleFromUrl(){try{const urlObj=new URL(window.location.href);const pathname=urlObj.pathname;// Iterate through the languages to find a matching prefix\nfor(const lang of languages){// Check if there's a urlPrefix defined for the language\nif(lang.urlPrefix){// Construct the expected prefix pattern, e.g., \"/es/\" or \"/fr/\"\nconst prefixPattern=`/${lang.urlPrefix}/`;// Check if the pathname starts with the prefix or is just the prefix (e.g., \"/es\")\nif(pathname.startsWith(prefixPattern)||pathname===`/${lang.urlPrefix}`){return lang.locale;}}}// If no matching prefix is found, return the default locale (en-US)\n// Assuming en-US is always the default and has urlPrefix: null\nconst defaultLang=languages.find(lang=>lang.urlPrefix===null);return defaultLang?defaultLang.locale:\"en-US\"// Fallback to 'en-US' if no default found in array\n;}catch(err){console.error(\"Error detecting locale from URL:\",err);return\"en-US\"// Fallback in case of any error\n;}}export default function WebUIHeader(props){if(window&&window.location.host.includes(\"framercanvas.com\")){return /*#__PURE__*/_jsx(\"div\",{style:{height:\"64px\",width:\"100%\",backgroundColor:\"gray\",color:\"white\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:\"Header placeholder\"});}return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(UserConsentProvider,{children:/*#__PURE__*/_jsxs(AnalyticsProvider,{config:analyticsConfig,children:[typeof window!==\"undefined\"&&/*#__PURE__*/_jsx(LoadAuthClient,{}),/*#__PURE__*/_jsx(IdentifyAndTrackPageView,{authUrl:authUrl}),/*#__PURE__*/_jsxs(SearchModalProvider,{children:[/*#__PURE__*/_jsx(UserWorkspacesProvider,{authUrl:authUrl,gqlGatewayUrl:gqlGatewayUrl,children:/*#__PURE__*/_jsx(Header,{authUrl:authUrl,appUrl:baseUrl,workflowUrl:workflowUrl,authLoginUrl:authLoginUrl,gqlGatewayUrl:gqlGatewayUrl,onLocaleChange:handleLocaleChange,locale:detectLocaleFromUrl(),openLoginModal:()=>{ShowLoginModal({returnToUrl:`${workflowUrl}?utm_medium=web&utm_source=login-main-nav`});},openRegisterModal:()=>{ShowRegisterModal({returnToUrl:`${workflowUrl}?utm_medium=web&utm_source=register-main-nav`});},onLogout:Logout,features:[{name:\"enable-topnav-state-machines\",enabled:true}]})}),/*#__PURE__*/_jsx(SearchModal,{locale:detectLocaleFromUrl(),appUrl:baseUrl,isReverseImageSearchEnabled:false})]})]})})});}const containerStyle={width:\"100%\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WebUIHeader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"sVAAijB,SAASA,GAAqB,CAAC,GAAG,CAA4C,IAAM,EAApC,IAAI,IAAI,EAAO,SAAS,KAAK,CAAuB,SACrpB,IAAI,IAAM,KAAQC,EAClB,GAAG,EAAK,UAAU,CAClB,IAAM,EAAc,IAAI,EAAK,UAAU,GACvC,GAAG,EAAS,WAAW,EAAc,EAAE,IAAW,IAAI,EAAK,YAAa,OAAO,EAAK,OAEpF,IAAM,EAAYA,EAAU,KAAK,GAAM,EAAK,YAAY,KAAK,CAAC,OAAO,EAAY,EAAY,OAAO,cAC5F,EAAI,CAAuD,OAAtD,QA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