{
  "version": 3,
  "sources": ["../../src/web/lib/useUpgradeTeamPlanUtils.ts"],
  "sourcesContent": ["import type { ProjectBase, TeamLicenseType } from \"@framerjs/app-shared\"\nimport { dashboardRecentPath } from \"@framerjs/app-shared\"\nimport { ModalType } from \"document/utils/ModalType.ts\"\nimport type { DashboardModal } from \"web/pages/projects/providers/DashboardModalProvider.tsx\"\n\nexport const QS_OPEN_MODAL_PARAM = \"open-team-upgrade-modal\"\nexport const QS_OPEN_MODAL_VALUE = \"1\"\n\nexport function generateUpgradeTeamPlanModalLink(teamId: string): string {\n\tconst sp = new URLSearchParams()\n\tsp.append(\"teamId\", teamId)\n\tsp.append(QS_OPEN_MODAL_PARAM, QS_OPEN_MODAL_VALUE)\n\treturn `${dashboardRecentPath}?${sp.toString()}`\n}\n\n/**\n * Shows the appropriate upgrade modal based on whether the team has projects.\n */\nexport function showUpgradeTeamModal(params: {\n\tprojects?: ProjectBase[]\n\tteamId: string\n\tcurrentTeamLicense: TeamLicenseType\n\thasActiveSubscription: boolean\n\tmodal: {\n\t\tshow: (modal: DashboardModal) => void\n\t\tdismiss: () => void\n\t}\n}): void {\n\tconst { projects, teamId, currentTeamLicense, hasActiveSubscription, modal } = params\n\n\tif (!projects || projects.length === 0) {\n\t\tmodal.show({\n\t\t\ttype: ModalType.Confirmation,\n\t\t\ttitle: \"Upgrade\",\n\t\t\tdescription:\n\t\t\t\t\"To add more editors, you must have at least one project on a Pro or Scale plan. Add and upgrade a project to continue.\",\n\t\t\tconfirmLabel: \"OK\",\n\t\t\tonConfirm: modal.dismiss,\n\t\t})\n\t} else {\n\t\tmodal.show({\n\t\t\ttype: ModalType.SelectProjectToUpgrade,\n\t\t\tteamId,\n\t\t\tcurrentTeamLicense,\n\t\t\thasActiveSubscription,\n\t\t\tonDismiss: modal.dismiss,\n\t\t\tprojects,\n\t\t})\n\t}\n}\n"],
  "mappings": ";;;;;AAKO,IAAM,sBAAsB;AAC5B,IAAM,sBAAsB;AAE5B,SAAS,iCAAiC,QAAwB;AACxE,QAAM,KAAK,IAAI,gBAAgB;AAC/B,KAAG,OAAO,UAAU,MAAM;AAC1B,KAAG,OAAO,qBAAqB,mBAAmB;AAClD,SAAO,GAAG,mBAAmB,IAAI,GAAG,SAAS,CAAC;AAC/C;AAKO,SAAS,qBAAqB,QAS5B;AACR,QAAM,EAAE,UAAU,QAAQ,oBAAoB,uBAAuB,MAAM,IAAI;AAE/E,MAAI,CAAC,YAAY,SAAS,WAAW,GAAG;AACvC,UAAM,KAAK;AAAA,MACV;AAAA,MACA,OAAO;AAAA,MACP,aACC;AAAA,MACD,cAAc;AAAA,MACd,WAAW,MAAM;AAAA,IAClB,CAAC;AAAA,EACF,OAAO;AACN,UAAM,KAAK;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,MAAM;AAAA,MACjB;AAAA,IACD,CAAC;AAAA,EACF;AACD;",
  "names": []
}
