import{af as o}from"./c4b350ac1-KLFM4jkb.js";import{t as a}from"./index-CSvjYuL_.js";import{p as e,o as l,n,a as i,s as t}from"./vendor-zod-DIcz3Rbr.js";const s=["Sales","Marketing","Finance","Product Management","Engineering","Software Engineer","Design","Data Science","Legal","Human Resources","Operations"];const r={Sales:["Gmail","Google Drive","Slack","Google Calendar","HubSpot","Microsoft 365","Notion","Atlassian"],Marketing:["Google Drive","Gmail","Slack","Google Calendar","Notion","Microsoft 365","Canva","HubSpot"],Finance:["Gmail","Google Drive","Microsoft 365","Slack","Google Calendar","Notion","Atlassian","NetSuite"],"Product Management":["Slack","Google Drive","Gmail","Atlassian","Google Calendar","Notion","Microsoft 365","Figma"],Engineering:["Slack","Atlassian","Gmail","Google Drive","Google Calendar","Microsoft 365","Notion","Linear"],"Software Engineer":["Slack","Atlassian","Gmail","Google Drive","Google Calendar","Microsoft 365","Notion","Linear"],Design:["Figma","Gmail","Slack","Google Drive","Notion","Google Calendar","Atlassian","Microsoft 365"],"Data Science":["Google Drive","Gmail","Slack","Google Calendar","Atlassian","Notion","Microsoft 365","PubMed"],Legal:["Gmail","Google Drive","Slack","Google Calendar","Microsoft 365","Notion","Atlassian","Asana"],"Human Resources":["Google Drive","Slack","Gmail","Google Calendar","Notion","Microsoft 365","Atlassian","Granola"],Operations:["Google Drive","Gmail","Slack","Google Calendar","Microsoft 365","Notion","Atlassian","HubSpot"]},c=new Map([["Gmail",{slug:"gmail-gmailmcp"}],["Google Drive",{slug:"google-drive-drivemcp"}],["Google Calendar",{slug:"google-calendar-calendarmcp"}],["Slack",{slug:"slack"}],["Notion",{slug:"notion"}],["Microsoft 365",{slug:"microsoft-365"}],["Atlassian",{slug:"atlassian",displayAs:"Atlassian"}],["Canva",{slug:"canva"}],["HubSpot",{slug:"hubspot"}],["Figma",{slug:"figma"}],["Linear",{slug:"linear"}],["NetSuite",{slug:"netsuite"}],["Asana",{slug:"asana"}],["Granola",{slug:"granola"}],["PubMed",{slug:null}]]);function g(o,a){const e=new Map,l=new Map;for(const i of a)"firstParty"===i.type&&e.set(i.name,i),i.slug&&l.set(i.slug,i);const n=new Map;for(const i of o){const o=c.get(i)?.slug,a=(o?l.get(o):void 0)??e.get(i);a&&n.set(i,a)}return n}function u(o){return i(t()).min(1).max(12).refine(o=>new Set(o).size===o.length,"duplicate connector").default([...o]).catch([...o])}const f=l(Object.fromEntries(s.map(o=>[o,u(r[o])]))),m=f.parse({}),G=e(o=>o??{},l({default_top_8:u(["Gmail","Google Drive","Slack","Google Calendar","Notion","Microsoft 365","Atlassian","Canva"]),top_8_by_role:f.default({}).catch(m),generic_max_tiles:n().int().min(1).max(12).default(3).catch(3),role_max_tiles:n().int().min(1).max(12).default(3).catch(3)})),d=G.parse({});function p(e){const{data:l,isPending:n,isError:i}=a(),t=!n&&!i,r=l?.work_function??null,c=null!==r&&function(o){return s.includes(o)}(r)?r:null,g="everyone"===e?null:e??c,u=o("cowork_connector_tool_sheet_config",d,G);return{connectors:g?u.top_8_by_role[g]:u.default_top_8,genericConnectors:u.default_top_8,profileRole:c,effectiveRole:g,availableRoles:s,genericMaxTiles:u.generic_max_tiles,roleMaxTiles:u.role_max_tiles,profileSettled:t,profilePending:n}}export{c as T,g as r,p as u};
