@retinalabsllc/zairusjs 21.1.9 → 21.2.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/index.d.mts CHANGED
@@ -1285,7 +1285,7 @@ interface RootSidebarProps {
1285
1285
  showLogoutAction?: boolean;
1286
1286
  onLogout?: () => Promise<void>;
1287
1287
  }
1288
- declare function RootSidebar({ NavItem2s, currentPath, isMobileOpen, closeMobile, onNavClick, avatarSrc, title, subtitle, homeUrl, showWorkspaceSwitcher, workspaces, activeWorkspaceId, onSwitchWorkspace, showLogoutAction, onLogout }: RootSidebarProps): React.JSX.Element;
1288
+ declare function RootSidebar({ NavItem2s, currentPath, isMobileOpen, closeMobile, openMobile, onNavClick, avatarSrc, title, subtitle, homeUrl, showWorkspaceSwitcher, workspaces, activeWorkspaceId, onSwitchWorkspace, showLogoutAction, onLogout }: RootSidebarProps): React.JSX.Element;
1289
1289
 
1290
1290
  interface UniversalMember3 {
1291
1291
  id: string;
@@ -1415,9 +1415,16 @@ interface UniversalCompanyApp {
1415
1415
  name: string;
1416
1416
  isPrivate: boolean;
1417
1417
  }
1418
+ interface ApplicationTypeMeta {
1419
+ key: string;
1420
+ label: string;
1421
+ desc: string;
1422
+ available?: boolean;
1423
+ }
1418
1424
  interface UniversalCreateApplicationProps {
1419
1425
  onBackHref: string;
1420
1426
  userRole?: string;
1427
+ applicationTypesMeta: ApplicationTypeMeta[];
1421
1428
  members: UniversalMemberApp[];
1422
1429
  isMembersLoading: boolean;
1423
1430
  membersCurrentPage: number;
package/dist/index.d.ts CHANGED
@@ -1285,7 +1285,7 @@ interface RootSidebarProps {
1285
1285
  showLogoutAction?: boolean;
1286
1286
  onLogout?: () => Promise<void>;
1287
1287
  }
1288
- declare function RootSidebar({ NavItem2s, currentPath, isMobileOpen, closeMobile, onNavClick, avatarSrc, title, subtitle, homeUrl, showWorkspaceSwitcher, workspaces, activeWorkspaceId, onSwitchWorkspace, showLogoutAction, onLogout }: RootSidebarProps): React.JSX.Element;
1288
+ declare function RootSidebar({ NavItem2s, currentPath, isMobileOpen, closeMobile, openMobile, onNavClick, avatarSrc, title, subtitle, homeUrl, showWorkspaceSwitcher, workspaces, activeWorkspaceId, onSwitchWorkspace, showLogoutAction, onLogout }: RootSidebarProps): React.JSX.Element;
1289
1289
 
1290
1290
  interface UniversalMember3 {
1291
1291
  id: string;
@@ -1415,9 +1415,16 @@ interface UniversalCompanyApp {
1415
1415
  name: string;
1416
1416
  isPrivate: boolean;
1417
1417
  }
1418
+ interface ApplicationTypeMeta {
1419
+ key: string;
1420
+ label: string;
1421
+ desc: string;
1422
+ available?: boolean;
1423
+ }
1418
1424
  interface UniversalCreateApplicationProps {
1419
1425
  onBackHref: string;
1420
1426
  userRole?: string;
1427
+ applicationTypesMeta: ApplicationTypeMeta[];
1421
1428
  members: UniversalMemberApp[];
1422
1429
  isMembersLoading: boolean;
1423
1430
  membersCurrentPage: number;
package/dist/index.js CHANGED
@@ -6430,7 +6430,7 @@ var UniversalHome3 = ({
6430
6430
  setIsResolving(false);
6431
6431
  }
6432
6432
  };
6433
- return /* @__PURE__ */ import_react97.default.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ import_react97.default.createElement("div", { className: "flex items-center justify-between w-full pb-4" }, /* @__PURE__ */ import_react97.default.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ import_react97.default.createElement(
6433
+ return /* @__PURE__ */ import_react97.default.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ import_react97.default.createElement("div", { className: "flex items-center justify-between w-full pb-4" }, /* @__PURE__ */ import_react97.default.createElement("div", { className: "flex items-center gap-3" }), /* @__PURE__ */ import_react97.default.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ import_react97.default.createElement(
6434
6434
  "button",
6435
6435
  {
6436
6436
  onClick: () => router.push("/app/ai"),
@@ -6540,6 +6540,7 @@ function RootSidebar({
6540
6540
  currentPath,
6541
6541
  isMobileOpen,
6542
6542
  closeMobile,
6543
+ openMobile,
6543
6544
  onNavClick,
6544
6545
  avatarSrc,
6545
6546
  title = "App",
@@ -6576,7 +6577,22 @@ function RootSidebar({
6576
6577
  }
6577
6578
  };
6578
6579
  const finalAvatarSrc = avatarSrc || "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
6579
- return /* @__PURE__ */ import_react99.default.createElement(import_react99.default.Fragment, null, /* @__PURE__ */ import_react99.default.createElement(
6580
+ return /* @__PURE__ */ import_react99.default.createElement(import_react99.default.Fragment, null, !isMobileOpen && /* @__PURE__ */ import_react99.default.createElement(
6581
+ "button",
6582
+ {
6583
+ onClick: openMobile,
6584
+ className: "md:hidden fixed left-0 top-1/2 -translate-y-1/2 z-50 bg-white border border-stone-200 border-l-0 shadow-[4px_0_24px_rgba(0,0,0,0.06)] rounded-r-xl py-6 px-1.5 flex items-center justify-center outline-none hover:bg-stone-50 transition-colors",
6585
+ "aria-label": "Open Menu"
6586
+ },
6587
+ /* @__PURE__ */ import_react99.default.createElement(
6588
+ "span",
6589
+ {
6590
+ className: "text-[10px] font-medium uppercase tracking-[0.2em] text-stone-500",
6591
+ style: { writingMode: "vertical-rl", transform: "rotate(180deg)" }
6592
+ },
6593
+ "Open Menu"
6594
+ )
6595
+ ), /* @__PURE__ */ import_react99.default.createElement(
6580
6596
  "div",
6581
6597
  {
6582
6598
  className: `fixed inset-0 bg-black/30 shadow-2xl transition-opacity duration-300 md:hidden z-90 ${isMobileOpen ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
@@ -7336,7 +7352,7 @@ var UniversalApplicationDetails = ({
7336
7352
  onClose: () => setConfirmDialog(false),
7337
7353
  onConfirm: handleDelete
7338
7354
  }
7339
- ), /* @__PURE__ */ import_react106.default.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ import_react106.default.createElement("a", { href: onBackHref, className: "flex items-center gap-2 text-[#d97757] hover:text-[#d97757] transition-colors text-sm outline-none" }, /* @__PURE__ */ import_react106.default.createElement(import_react107.HugeiconsIcon, { icon: import_core_free_icons42.ArrowLeft01Icon, size: 16 }), " Back")), /* @__PURE__ */ import_react106.default.createElement("div", { className: "mb-8 px-1 flex flex-col sm:flex-row sm:items-center justify-between gap-4" }, /* @__PURE__ */ import_react106.default.createElement("div", null, /* @__PURE__ */ import_react106.default.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Application Details"), /* @__PURE__ */ import_react106.default.createElement("p", { className: "text-xs text-stone-500" }, "Review your filing entity and access its workspace.")), /* @__PURE__ */ import_react106.default.createElement("div", { className: "px-4 py-1.5 bg-stone-100 text-stone-600 rounded-full text-xs self-start sm:self-auto uppercase tracking-widest font-medium" }, application.status)), /* @__PURE__ */ import_react106.default.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ import_react106.default.createElement("div", { className: "flex flex-col gap-1 w-full" }, /* @__PURE__ */ import_react106.default.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Target Company"), /* @__PURE__ */ import_react106.default.createElement("span", { className: "text-sm text-black py-2 font-medium" }, application.name)), /* @__PURE__ */ import_react106.default.createElement("div", { className: "flex flex-col gap-1 w-full border-t border-stone-100 pt-6" }, /* @__PURE__ */ import_react106.default.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Filing Type"), /* @__PURE__ */ import_react106.default.createElement("span", { className: "text-sm text-black py-2" }, formatType2(application.type))), /* @__PURE__ */ import_react106.default.createElement("div", { className: "flex flex-col sm:flex-row items-center gap-3 pt-6 mt-2 border-t border-stone-100" }, /* @__PURE__ */ import_react106.default.createElement("a", { href: `/app/applications/app/${application.id}`, className: "flex-1 w-full py-2.5 bg-[#d97757] text-white rounded-full text-center text-xs transition-colors hover:bg-[#d97757]/90" }, "Open Application"), /* @__PURE__ */ import_react106.default.createElement("a", { href: `/app/applications/assets/${application.id}`, className: "flex-1 w-full py-2.5 bg-transparent border border-stone-200 text-black rounded-full text-center text-xs transition-colors hover:bg-stone-50" }, "Application Assets"), deletePermitted && /* @__PURE__ */ import_react106.default.createElement("button", { onClick: () => setConfirmDialog(true), className: "flex-1 w-full py-2.5 bg-transparent border border-stone-200 text-black rounded-full text-center text-xs transition-colors hover:bg-stone-50" }, "Delete Application"))));
7355
+ ), /* @__PURE__ */ import_react106.default.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ import_react106.default.createElement("a", { href: onBackHref, className: "flex items-center gap-2 text-[#d97757] hover:text-[#d97757] transition-colors text-sm outline-none" }, /* @__PURE__ */ import_react106.default.createElement(import_react107.HugeiconsIcon, { icon: import_core_free_icons42.ArrowLeft01Icon, size: 16 }), " Back")), /* @__PURE__ */ import_react106.default.createElement("div", { className: "mb-8 px-1 flex flex-col sm:flex-row sm:items-center justify-between gap-4" }, /* @__PURE__ */ import_react106.default.createElement("div", null, /* @__PURE__ */ import_react106.default.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Application Details"), /* @__PURE__ */ import_react106.default.createElement("p", { className: "text-xs text-stone-500" }, "Review your filing entity and access its workspace.")), /* @__PURE__ */ import_react106.default.createElement("div", { className: "px-4 py-1.5 bg-stone-100 text-stone-600 rounded-full text-xs self-start sm:self-auto uppercase tracking-widest " }, application.status)), /* @__PURE__ */ import_react106.default.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ import_react106.default.createElement("div", { className: "flex flex-col gap-1 w-full" }, /* @__PURE__ */ import_react106.default.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Target Company"), /* @__PURE__ */ import_react106.default.createElement("span", { className: "text-sm text-black py-2 " }, application.name)), /* @__PURE__ */ import_react106.default.createElement("div", { className: "flex flex-col gap-1 w-full border-t border-stone-100 pt-6" }, /* @__PURE__ */ import_react106.default.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Filing Type"), /* @__PURE__ */ import_react106.default.createElement("span", { className: "text-sm text-black py-2" }, formatType2(application.type))), /* @__PURE__ */ import_react106.default.createElement("div", { className: "flex flex-col sm:flex-row items-center gap-3 pt-6 mt-2 border-t border-stone-100" }, /* @__PURE__ */ import_react106.default.createElement("a", { href: `/app/applications/app/${application.id}`, className: "flex-1 w-full py-2.5 bg-[#d97757] text-white rounded-full text-center text-xs transition-colors hover:bg-[#d97757]/90" }, "Open Application"), /* @__PURE__ */ import_react106.default.createElement("a", { href: `/app/applications/assets/${application.id}`, className: "flex-1 w-full py-2.5 bg-transparent border border-stone-200 text-black rounded-full text-center text-xs transition-colors hover:bg-stone-50" }, "Application Assets"), deletePermitted && /* @__PURE__ */ import_react106.default.createElement("button", { onClick: () => setConfirmDialog(true), className: "flex-1 w-full py-2.5 bg-transparent border border-stone-200 text-black rounded-full text-center text-xs transition-colors hover:bg-stone-50" }, "Delete Application"))));
7340
7356
  };
7341
7357
 
7342
7358
  // src/components/UniversalCreateApplication.tsx
@@ -7350,30 +7366,10 @@ var MemberAvatar6 = ({ src, sizeClass = "w-10 h-10" }) => {
7350
7366
  const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
7351
7367
  return /* @__PURE__ */ import_react108.default.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "w-full h-full rounded-lg bg-stone-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Loading03Icon, className: "animate-spin text-stone-400 absolute", size: 14 }), /* @__PURE__ */ import_react108.default.createElement("img", { src: error || !src ? defaultAvatar : src, alt: "Avatar", className: `w-full h-full object-cover transition-opacity duration-300 ${loaded || error ? "opacity-100" : "opacity-0"}`, onLoad: () => setLoaded(true), onError: () => setError(true) })));
7352
7368
  };
7353
- var APPLICATION_TYPES = [
7354
- "COMPANY_REGISTRATION",
7355
- "BUSINESS_NAME",
7356
- "NGO_INCORPORATION",
7357
- "TRADEMARK",
7358
- "COPYRIGHT",
7359
- "PATENT",
7360
- "NDPC",
7361
- "GDPR",
7362
- "SCUML_CERTIFICATE",
7363
- "TAX_FILING",
7364
- "TIN_APPLICATION",
7365
- "VAT_REGISTRATION",
7366
- "ANNUAL_RETURNS",
7367
- "CHANGE_OF_DIRECTORS",
7368
- "CHANGE_OF_NAME",
7369
- "NAFDAC_REGISTRATION",
7370
- "OTHER"
7371
- ];
7372
- var formatType3 = (type) => type.split("_").map((w) => w[0] + w.slice(1).toLowerCase()).join(" ");
7373
- var FORMATTED_TYPES = APPLICATION_TYPES.map(formatType3);
7374
7369
  var UniversalCreateApplication = ({
7375
7370
  onBackHref,
7376
7371
  userRole = "MEMBER",
7372
+ applicationTypesMeta = [],
7377
7373
  members,
7378
7374
  isMembersLoading,
7379
7375
  membersCurrentPage,
@@ -7392,7 +7388,13 @@ var UniversalCreateApplication = ({
7392
7388
  }) => {
7393
7389
  const canManage = userRole === "ADMIN" || userRole === "MANAGER" || userRole === "OWNER";
7394
7390
  const [creationMode, setCreationMode] = (0, import_react108.useState)("EXISTING");
7395
- const [selectedTypeFormatted, setSelectedTypeFormatted] = (0, import_react108.useState)("Company Registration");
7391
+ const defaultTypeKey = applicationTypesMeta.length > 0 ? applicationTypesMeta[0].key : "";
7392
+ const [selectedTypeKey, setSelectedTypeKey] = (0, import_react108.useState)(defaultTypeKey);
7393
+ (0, import_react108.useEffect)(() => {
7394
+ if (!selectedTypeKey && applicationTypesMeta.length > 0) {
7395
+ setSelectedTypeKey(applicationTypesMeta[0].key);
7396
+ }
7397
+ }, [applicationTypesMeta, selectedTypeKey]);
7396
7398
  const [selectedCompanyId, setSelectedCompanyId] = (0, import_react108.useState)(null);
7397
7399
  const [newCompanyName, setNewCompanyName] = (0, import_react108.useState)("");
7398
7400
  const [isPrivate, setIsPrivate] = (0, import_react108.useState)(false);
@@ -7427,8 +7429,7 @@ var UniversalCreateApplication = ({
7427
7429
  const handleSubmit = async (e) => {
7428
7430
  e.preventDefault();
7429
7431
  if (!canManage) return;
7430
- const rawType = APPLICATION_TYPES[FORMATTED_TYPES.indexOf(selectedTypeFormatted)];
7431
- if (!rawType) return import_react_hot_toast21.default.error("Please select a valid application type.");
7432
+ if (!selectedTypeKey) return import_react_hot_toast21.default.error("Please select a valid application type.");
7432
7433
  if (creationMode === "EXISTING" && !selectedCompanyId) return import_react_hot_toast21.default.error("Please select a company.");
7433
7434
  if (creationMode === "NEW" && newCompanyName.trim().length < 2) return import_react_hot_toast21.default.error("Company name is required.");
7434
7435
  setIsSubmitting(true);
@@ -7441,7 +7442,7 @@ var UniversalCreateApplication = ({
7441
7442
  isPrivate,
7442
7443
  assignedUsers: isPrivate ? Array.from(selectedParticipants) : []
7443
7444
  } : void 0,
7444
- type: rawType
7445
+ type: selectedTypeKey
7445
7446
  });
7446
7447
  } catch (error) {
7447
7448
  import_react_hot_toast21.default.error(error.message || "Failed to create application.");
@@ -7449,7 +7450,40 @@ var UniversalCreateApplication = ({
7449
7450
  }
7450
7451
  };
7451
7452
  const activeCompany = companies.find((c) => c.id === selectedCompanyId);
7452
- return /* @__PURE__ */ import_react108.default.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ import_react108.default.createElement(ManagedToaster, null), /* @__PURE__ */ import_react108.default.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ import_react108.default.createElement("a", { href: onBackHref, className: "flex items-center gap-2 text-[#d97757] hover:text-[#d97757] transition-colors text-sm outline-none" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.ArrowLeft01Icon, size: 16 }), " Back")), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col gap-1 mb-6 px-1" }, /* @__PURE__ */ import_react108.default.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Create Application"), /* @__PURE__ */ import_react108.default.createElement("p", { className: "text-xs text-stone-500" }, "Initiate a new registration or filing for a company.")), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-center gap-6 mb-6 px-1" }, /* @__PURE__ */ import_react108.default.createElement("button", { onClick: () => setCreationMode("EXISTING"), disabled: isSubmitting, className: `pb-2 text-sm outline-none transition-colors border-b-2 ${creationMode === "EXISTING" ? "border-black text-black" : "border-transparent text-stone-500 hover:text-black"}` }, "Select Company"), /* @__PURE__ */ import_react108.default.createElement("button", { onClick: () => setCreationMode("NEW"), disabled: isSubmitting, className: `pb-2 text-sm outline-none transition-colors border-b-2 ${creationMode === "NEW" ? "border-black text-black" : "border-transparent text-stone-500 hover:text-black"}` }, "New Company")), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ import_react108.default.createElement("form", { className: "flex flex-col gap-8", onSubmit: handleSubmit, autoComplete: "off" }, !canManage && /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-start gap-3 p-4 bg-stone-50 rounded-xl" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.CircleLock02Icon, size: 20, className: "text-stone-500 shrink-0 mt-0.5" }), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-sm text-black tracking-tight" }, "Access Restricted"), /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-xs text-stone-500 mt-1 leading-relaxed" }, "You lack clearance to create applications."))), creationMode === "EXISTING" ? /* @__PURE__ */ import_react108.default.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ import_react108.default.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Target Company"), /* @__PURE__ */ import_react108.default.createElement("div", { onClick: () => canManage && !isSubmitting && setShowCompaniesModal(true), className: `flex items-center relative w-full border-b border-stone-200 transition-all duration-300 pb-3 pt-3 ${!canManage || isSubmitting ? "opacity-50 pointer-events-none" : "hover:border-black cursor-pointer"}` }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Building03Icon, size: 16, className: "text-stone-400 absolute left-0" }), /* @__PURE__ */ import_react108.default.createElement("span", { className: `w-full pl-8 text-sm truncate block ${activeCompany ? "text-black" : "text-stone-400"}` }, activeCompany ? activeCompany.name : "Select an existing company..."))) : /* @__PURE__ */ import_react108.default.createElement(import_react108.default.Fragment, null, /* @__PURE__ */ import_react108.default.createElement(TextInput, { label: "Company Name", value: newCompanyName, onChange: (val) => setNewCompanyName(val), disabled: isSubmitting || !canManage, placeholder: "e.g. Acme Innovations Ltd.", maxLength: 80 }), /* @__PURE__ */ import_react108.default.createElement("div", { className: `flex items-center justify-between py-2 mt-2 ${!canManage ? "opacity-50 pointer-events-none" : ""}` }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-sm text-black tracking-tight" }, "Private Company"), /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-xs text-stone-500" }, "Only assigned members can view and access its applications.")), /* @__PURE__ */ import_react108.default.createElement("button", { type: "button", onClick: () => setIsPrivate(!isPrivate), disabled: !canManage || isSubmitting, className: `relative w-11 h-6 rounded-full transition-colors outline-none shrink-0 ${isPrivate ? "bg-[#d97757]" : "bg-stone-200"}` }, /* @__PURE__ */ import_react108.default.createElement("div", { className: `absolute top-1 left-1 bg-white w-4 h-4 rounded-full transition-transform ${isPrivate ? "translate-x-5" : "translate-x-0"}` }))), isPrivate && /* @__PURE__ */ import_react108.default.createElement("div", { className: `flex items-center justify-between animate-in fade-in zoom-in-95 duration-200 bg-stone-50 p-4 rounded-xl ${!canManage ? "opacity-50" : ""}` }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-xs text-black tracking-tight" }, "Assigned Members"), /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-xs text-[#d97757] " }, selectedParticipants.size, " added")), /* @__PURE__ */ import_react108.default.createElement("button", { type: "button", onClick: () => setShowMembersModal(true), disabled: !canManage || isSubmitting, className: "px-4 py-2 border border-stone-200 text-black text-xs tracking-wide rounded-full hover:bg-white transition-colors outline-none bg-transparent" }, "Manage Access"))), /* @__PURE__ */ import_react108.default.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ import_react108.default.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Application Type"), /* @__PURE__ */ import_react108.default.createElement("div", { onClick: () => canManage && !isSubmitting && setShowTypeModal(true), className: `flex items-center relative w-full border-b border-stone-200 transition-all duration-300 pb-3 pt-3 ${!canManage || isSubmitting ? "opacity-50 pointer-events-none" : "hover:border-black cursor-pointer"}` }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.File02Icon, size: 16, className: "text-stone-400 absolute left-0" }), /* @__PURE__ */ import_react108.default.createElement("span", { className: "w-full pl-8 text-sm text-black truncate block" }, selectedTypeFormatted))), canManage && /* @__PURE__ */ import_react108.default.createElement("div", { className: "pt-6" }, /* @__PURE__ */ import_react108.default.createElement(ThreeDActionButton, { type: "submit", disabled: isSubmitting || creationMode === "EXISTING" && !selectedCompanyId || creationMode === "NEW" && newCompanyName.length < 2, isLoading: isSubmitting, className: "w-full sm:w-auto min-w-40" }, "Create Application")))), canManage && /* @__PURE__ */ import_react108.default.createElement(ReusableOptions, { isOpen: showTypeModal, onClose: () => setShowTypeModal(false), title: "Application Type", options: FORMATTED_TYPES, selectedOption: selectedTypeFormatted, onSelect: (t) => setSelectedTypeFormatted(t), showSearch: true }), showCompaniesModal && canManage && /* @__PURE__ */ import_react108.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowCompaniesModal(false) }), /* @__PURE__ */ import_react108.default.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ import_react108.default.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Select Company"), /* @__PURE__ */ import_react108.default.createElement("button", { onClick: () => setShowCompaniesModal(false), className: "text-[#d97757] outline-none text-sm" }, "Close")), /* @__PURE__ */ import_react108.default.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Search01Icon, size: 16, className: "text-stone-400 absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none" }), /* @__PURE__ */ import_react108.default.createElement("input", { type: "text", placeholder: "Search companies...", value: localCompSearch, onChange: handleCompSearch, className: "w-full pl-10 pr-4 py-2.5 bg-stone-100 rounded-full focus:border-[#d97757] border border-transparent text-sm text-black outline-none focus:bg-stone-200 transition-colors" }))), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, isCompaniesLoading ? /* @__PURE__ */ import_react108.default.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Loading03Icon, size: 28, className: "animate-spin text-black" })) : companies.length === 0 ? /* @__PURE__ */ import_react108.default.createElement("div", { className: "p-8 text-center text-xs text-stone-400" }, "No companies available.") : companies.map((comp) => /* @__PURE__ */ import_react108.default.createElement("div", { key: comp.id, onClick: () => {
7453
+ const activeTypeObj = applicationTypesMeta.find((t) => t.key === selectedTypeKey) || applicationTypesMeta[0];
7454
+ const modeTabs = [
7455
+ { id: "EXISTING", label: "Select Company" },
7456
+ { id: "NEW", label: "New Company" }
7457
+ ];
7458
+ return /* @__PURE__ */ import_react108.default.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ import_react108.default.createElement(ManagedToaster, null), /* @__PURE__ */ import_react108.default.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ import_react108.default.createElement("a", { href: onBackHref, className: "flex items-center gap-2 text-[#d97757] hover:text-[#d97757] transition-colors text-sm outline-none" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.ArrowLeft01Icon, size: 16 }), " Back")), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col gap-1 mb-6 px-1" }, /* @__PURE__ */ import_react108.default.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Create Application"), /* @__PURE__ */ import_react108.default.createElement("p", { className: "text-xs text-stone-500" }, "Initiate a new registration or filing for a company.")), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-center mb-4 w-full animate-in fade-in duration-300 px-2" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-center bg-white rounded-full p-1 sm:p-1.5 max-w-full overflow-x-auto custom-scrollbar" }, modeTabs.map((tab) => {
7459
+ const isActive = creationMode === tab.id;
7460
+ return /* @__PURE__ */ import_react108.default.createElement(
7461
+ "button",
7462
+ {
7463
+ key: tab.id,
7464
+ type: "button",
7465
+ onClick: () => setCreationMode(tab.id),
7466
+ disabled: isSubmitting,
7467
+ className: `px-4 py-1.5 rounded-full text-xs transition-all duration-200 outline-none whitespace-nowrap shrink-0 ${isActive ? "bg-stone-50 text-black" : "text-stone-500 hover:text-black hover:bg-stone-50/50"}`
7468
+ },
7469
+ tab.label
7470
+ );
7471
+ }))), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ import_react108.default.createElement("form", { className: "flex flex-col gap-8", onSubmit: handleSubmit, autoComplete: "off" }, !canManage && /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-start gap-3 p-4 bg-stone-50 rounded-xl" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.CircleLock02Icon, size: 20, className: "text-stone-500 shrink-0 mt-0.5" }), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-sm text-black tracking-tight" }, "Access Restricted"), /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-xs text-stone-500 mt-1 leading-relaxed" }, "You lack clearance to create applications."))), creationMode === "EXISTING" ? /* @__PURE__ */ import_react108.default.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ import_react108.default.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Target Company"), /* @__PURE__ */ import_react108.default.createElement("div", { onClick: () => canManage && !isSubmitting && setShowCompaniesModal(true), className: `flex items-center relative w-full border-b border-stone-200 transition-all duration-300 pb-3 pt-3 ${!canManage || isSubmitting ? "opacity-50 pointer-events-none" : "hover:border-black cursor-pointer"}` }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Building03Icon, size: 16, className: "text-stone-400 absolute left-0" }), /* @__PURE__ */ import_react108.default.createElement("span", { className: `w-full pl-8 text-sm truncate block ${activeCompany ? "text-black" : "text-stone-400"}` }, activeCompany ? activeCompany.name : "Select an existing company..."))) : /* @__PURE__ */ import_react108.default.createElement(import_react108.default.Fragment, null, /* @__PURE__ */ import_react108.default.createElement(TextInput, { label: "Company Name", value: newCompanyName, onChange: (val) => setNewCompanyName(val), disabled: isSubmitting || !canManage, placeholder: "e.g. Acme Innovations Ltd.", maxLength: 80 }), /* @__PURE__ */ import_react108.default.createElement("div", { className: `flex items-center justify-between py-2 mt-2 ${!canManage ? "opacity-50 pointer-events-none" : ""}` }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-sm text-black tracking-tight" }, "Private Company"), /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-xs text-stone-500" }, "Only assigned members can view and access its applications.")), /* @__PURE__ */ import_react108.default.createElement("button", { type: "button", onClick: () => setIsPrivate(!isPrivate), disabled: !canManage || isSubmitting, className: `relative w-11 h-6 rounded-full transition-colors outline-none shrink-0 ${isPrivate ? "bg-[#d97757]" : "bg-stone-200"}` }, /* @__PURE__ */ import_react108.default.createElement("div", { className: `absolute top-1 left-1 bg-white w-4 h-4 rounded-full transition-transform ${isPrivate ? "translate-x-5" : "translate-x-0"}` }))), isPrivate && /* @__PURE__ */ import_react108.default.createElement("div", { className: `flex items-center justify-between animate-in fade-in zoom-in-95 duration-200 bg-stone-50 p-4 rounded-xl ${!canManage ? "opacity-50" : ""}` }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-xs text-black tracking-tight" }, "Assigned Members"), /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-xs text-[#d97757]" }, selectedParticipants.size, " added")), /* @__PURE__ */ import_react108.default.createElement("button", { type: "button", onClick: () => setShowMembersModal(true), disabled: !canManage || isSubmitting, className: "px-4 py-2 border border-stone-200 text-black text-xs tracking-wide rounded-full hover:bg-white transition-colors outline-none bg-transparent" }, "Manage Access"))), /* @__PURE__ */ import_react108.default.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ import_react108.default.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Application Type"), /* @__PURE__ */ import_react108.default.createElement("div", { onClick: () => canManage && !isSubmitting && setShowTypeModal(true), className: `flex items-center relative w-full border-b border-stone-200 transition-all duration-300 pb-3 pt-3 ${!canManage || isSubmitting ? "opacity-50 pointer-events-none" : "hover:border-black cursor-pointer"}` }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.File02Icon, size: 16, className: "text-stone-400 absolute left-0" }), /* @__PURE__ */ import_react108.default.createElement("span", { className: "w-full pl-8 text-sm text-black truncate block" }, activeTypeObj?.label || "Select Type..."))), canManage && /* @__PURE__ */ import_react108.default.createElement("div", { className: "pt-6" }, /* @__PURE__ */ import_react108.default.createElement(ThreeDActionButton, { type: "submit", disabled: isSubmitting || !selectedTypeKey || creationMode === "EXISTING" && !selectedCompanyId || creationMode === "NEW" && newCompanyName.length < 2, isLoading: isSubmitting, className: "w-full sm:w-auto min-w-40" }, "Create Application")))), showTypeModal && canManage && /* @__PURE__ */ import_react108.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowTypeModal(false) }), /* @__PURE__ */ import_react108.default.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 border-b border-stone-100" }, /* @__PURE__ */ import_react108.default.createElement("h3", { className: "text-sm text-black tracking-tight " }, "Application Type"), /* @__PURE__ */ import_react108.default.createElement("button", { onClick: () => setShowTypeModal(false), className: "text-[#d97757] outline-none text-sm" }, "Done")), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-3 space-y-2" }, applicationTypesMeta.map((item) => {
7472
+ const isSelected = selectedTypeKey === item.key;
7473
+ return /* @__PURE__ */ import_react108.default.createElement(
7474
+ "div",
7475
+ {
7476
+ key: item.key,
7477
+ onClick: () => {
7478
+ setSelectedTypeKey(item.key);
7479
+ setShowTypeModal(false);
7480
+ },
7481
+ className: `p-4 rounded-xl cursor-pointer transition-all border ${isSelected ? "bg-white border-[#d97757]" : "bg-stone-100 border-transparent hover:bg-stone-200/60"}`
7482
+ },
7483
+ /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-center justify-between gap-2" }, /* @__PURE__ */ import_react108.default.createElement("h4", { className: "text-xs text-black" }, item.label), isSelected && /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Tick02Icon, size: 16, className: "text-[#d97757] shrink-0" })),
7484
+ /* @__PURE__ */ import_react108.default.createElement("p", { className: "text-[11px] text-stone-500 mt-1 leading-relaxed whitespace-normal wrap-break-word" }, item.desc)
7485
+ );
7486
+ })))), showCompaniesModal && canManage && /* @__PURE__ */ import_react108.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowCompaniesModal(false) }), /* @__PURE__ */ import_react108.default.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ import_react108.default.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Select Company"), /* @__PURE__ */ import_react108.default.createElement("button", { onClick: () => setShowCompaniesModal(false), className: "text-[#d97757] outline-none text-sm" }, "Close")), /* @__PURE__ */ import_react108.default.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Search01Icon, size: 16, className: "text-stone-400 absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none" }), /* @__PURE__ */ import_react108.default.createElement("input", { type: "text", placeholder: "Search companies...", value: localCompSearch, onChange: handleCompSearch, className: "w-full pl-10 pr-4 py-2.5 bg-stone-100 rounded-full focus:border-[#d97757] border border-transparent text-sm text-black outline-none focus:bg-stone-200 transition-colors" }))), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, isCompaniesLoading ? /* @__PURE__ */ import_react108.default.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Loading03Icon, size: 28, className: "animate-spin text-black" })) : companies.length === 0 ? /* @__PURE__ */ import_react108.default.createElement("div", { className: "p-8 text-center text-xs text-stone-400" }, "No companies available.") : companies.map((comp) => /* @__PURE__ */ import_react108.default.createElement("div", { key: comp.id, onClick: () => {
7453
7487
  setSelectedCompanyId(comp.id);
7454
7488
  setShowCompaniesModal(false);
7455
7489
  }, className: "flex items-center justify-between p-3 rounded-xl cursor-pointer hover:bg-stone-50 transition-colors" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex flex-col min-w-0 flex-1 pl-2" }, /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-sm text-black truncate" }, comp.name), comp.isPrivate && /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-[10px] text-[#d97757] mt-0.5 tracking-widest uppercase" }, "Private")), selectedCompanyId === comp.id && /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Tick02Icon, size: 16, className: "text-[#d97757] mr-2" })))), /* @__PURE__ */ import_react108.default.createElement("div", { className: "p-4 flex items-center justify-between shrink-0 bg-white" }, /* @__PURE__ */ import_react108.default.createElement("span", { className: "text-xs text-stone-400 tracking-widest" }, "Page ", companiesCurrentPage, " of ", companiesTotalPages || 1), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex gap-1" }, /* @__PURE__ */ import_react108.default.createElement("button", { disabled: companiesCurrentPage <= 1 || isCompaniesLoading, onClick: () => onCompaniesPageChange(companiesCurrentPage - 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.ArrowLeft01Icon, size: 12 })), /* @__PURE__ */ import_react108.default.createElement("button", { disabled: companiesCurrentPage >= companiesTotalPages || isCompaniesLoading, onClick: () => onCompaniesPageChange(companiesCurrentPage + 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.ArrowRight01Icon, size: 12 })))))), showMembersModal && canManage && /* @__PURE__ */ import_react108.default.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowMembersModal(false) }), /* @__PURE__ */ import_react108.default.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ import_react108.default.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Assign Members"), /* @__PURE__ */ import_react108.default.createElement("button", { onClick: () => setShowMembersModal(false), className: "text-[#d97757] outline-none text-sm" }, "Done")), /* @__PURE__ */ import_react108.default.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ import_react108.default.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Search01Icon, size: 16, className: "text-stone-400 absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none" }), /* @__PURE__ */ import_react108.default.createElement("input", { type: "text", placeholder: "Search team...", value: localMemSearch, onChange: handleMemSearch, className: "w-full pl-10 pr-4 py-2.5 bg-stone-100 rounded-full focus:border-[#d97757] border border-transparent text-sm text-black outline-none focus:bg-stone-200 transition-colors" }))), /* @__PURE__ */ import_react108.default.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, isMembersLoading ? /* @__PURE__ */ import_react108.default.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ import_react108.default.createElement(import_react109.HugeiconsIcon, { icon: import_core_free_icons43.Loading03Icon, size: 28, className: "animate-spin text-black" })) : members.length === 0 ? /* @__PURE__ */ import_react108.default.createElement("div", { className: "p-8 text-center text-xs text-stone-400" }, "No members found.") : members.map((member) => {
package/dist/index.mjs CHANGED
@@ -6505,7 +6505,7 @@ var UniversalHome3 = ({
6505
6505
  setIsResolving(false);
6506
6506
  }
6507
6507
  };
6508
- return /* @__PURE__ */ React56.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React56.createElement("div", { className: "flex items-center justify-between w-full pb-4" }, /* @__PURE__ */ React56.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ React56.createElement(
6508
+ return /* @__PURE__ */ React56.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React56.createElement("div", { className: "flex items-center justify-between w-full pb-4" }, /* @__PURE__ */ React56.createElement("div", { className: "flex items-center gap-3" }), /* @__PURE__ */ React56.createElement("div", { className: "flex items-center gap-2 shrink-0" }, /* @__PURE__ */ React56.createElement(
6509
6509
  "button",
6510
6510
  {
6511
6511
  onClick: () => router.push("/app/ai"),
@@ -6622,6 +6622,7 @@ function RootSidebar({
6622
6622
  currentPath,
6623
6623
  isMobileOpen,
6624
6624
  closeMobile,
6625
+ openMobile,
6625
6626
  onNavClick,
6626
6627
  avatarSrc,
6627
6628
  title = "App",
@@ -6658,7 +6659,22 @@ function RootSidebar({
6658
6659
  }
6659
6660
  };
6660
6661
  const finalAvatarSrc = avatarSrc || "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
6661
- return /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(
6662
+ return /* @__PURE__ */ React57.createElement(React57.Fragment, null, !isMobileOpen && /* @__PURE__ */ React57.createElement(
6663
+ "button",
6664
+ {
6665
+ onClick: openMobile,
6666
+ className: "md:hidden fixed left-0 top-1/2 -translate-y-1/2 z-50 bg-white border border-stone-200 border-l-0 shadow-[4px_0_24px_rgba(0,0,0,0.06)] rounded-r-xl py-6 px-1.5 flex items-center justify-center outline-none hover:bg-stone-50 transition-colors",
6667
+ "aria-label": "Open Menu"
6668
+ },
6669
+ /* @__PURE__ */ React57.createElement(
6670
+ "span",
6671
+ {
6672
+ className: "text-[10px] font-medium uppercase tracking-[0.2em] text-stone-500",
6673
+ style: { writingMode: "vertical-rl", transform: "rotate(180deg)" }
6674
+ },
6675
+ "Open Menu"
6676
+ )
6677
+ ), /* @__PURE__ */ React57.createElement(
6662
6678
  "div",
6663
6679
  {
6664
6680
  className: `fixed inset-0 bg-black/30 shadow-2xl transition-opacity duration-300 md:hidden z-90 ${isMobileOpen ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
@@ -7427,11 +7443,11 @@ var UniversalApplicationDetails = ({
7427
7443
  onClose: () => setConfirmDialog(false),
7428
7444
  onConfirm: handleDelete
7429
7445
  }
7430
- ), /* @__PURE__ */ React61.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ React61.createElement("a", { href: onBackHref, className: "flex items-center gap-2 text-[#d97757] hover:text-[#d97757] transition-colors text-sm outline-none" }, /* @__PURE__ */ React61.createElement(HugeiconsIcon46, { icon: ArrowLeft01Icon24, size: 16 }), " Back")), /* @__PURE__ */ React61.createElement("div", { className: "mb-8 px-1 flex flex-col sm:flex-row sm:items-center justify-between gap-4" }, /* @__PURE__ */ React61.createElement("div", null, /* @__PURE__ */ React61.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Application Details"), /* @__PURE__ */ React61.createElement("p", { className: "text-xs text-stone-500" }, "Review your filing entity and access its workspace.")), /* @__PURE__ */ React61.createElement("div", { className: "px-4 py-1.5 bg-stone-100 text-stone-600 rounded-full text-xs self-start sm:self-auto uppercase tracking-widest font-medium" }, application.status)), /* @__PURE__ */ React61.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ React61.createElement("div", { className: "flex flex-col gap-1 w-full" }, /* @__PURE__ */ React61.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Target Company"), /* @__PURE__ */ React61.createElement("span", { className: "text-sm text-black py-2 font-medium" }, application.name)), /* @__PURE__ */ React61.createElement("div", { className: "flex flex-col gap-1 w-full border-t border-stone-100 pt-6" }, /* @__PURE__ */ React61.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Filing Type"), /* @__PURE__ */ React61.createElement("span", { className: "text-sm text-black py-2" }, formatType2(application.type))), /* @__PURE__ */ React61.createElement("div", { className: "flex flex-col sm:flex-row items-center gap-3 pt-6 mt-2 border-t border-stone-100" }, /* @__PURE__ */ React61.createElement("a", { href: `/app/applications/app/${application.id}`, className: "flex-1 w-full py-2.5 bg-[#d97757] text-white rounded-full text-center text-xs transition-colors hover:bg-[#d97757]/90" }, "Open Application"), /* @__PURE__ */ React61.createElement("a", { href: `/app/applications/assets/${application.id}`, className: "flex-1 w-full py-2.5 bg-transparent border border-stone-200 text-black rounded-full text-center text-xs transition-colors hover:bg-stone-50" }, "Application Assets"), deletePermitted && /* @__PURE__ */ React61.createElement("button", { onClick: () => setConfirmDialog(true), className: "flex-1 w-full py-2.5 bg-transparent border border-stone-200 text-black rounded-full text-center text-xs transition-colors hover:bg-stone-50" }, "Delete Application"))));
7446
+ ), /* @__PURE__ */ React61.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ React61.createElement("a", { href: onBackHref, className: "flex items-center gap-2 text-[#d97757] hover:text-[#d97757] transition-colors text-sm outline-none" }, /* @__PURE__ */ React61.createElement(HugeiconsIcon46, { icon: ArrowLeft01Icon24, size: 16 }), " Back")), /* @__PURE__ */ React61.createElement("div", { className: "mb-8 px-1 flex flex-col sm:flex-row sm:items-center justify-between gap-4" }, /* @__PURE__ */ React61.createElement("div", null, /* @__PURE__ */ React61.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Application Details"), /* @__PURE__ */ React61.createElement("p", { className: "text-xs text-stone-500" }, "Review your filing entity and access its workspace.")), /* @__PURE__ */ React61.createElement("div", { className: "px-4 py-1.5 bg-stone-100 text-stone-600 rounded-full text-xs self-start sm:self-auto uppercase tracking-widest " }, application.status)), /* @__PURE__ */ React61.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ React61.createElement("div", { className: "flex flex-col gap-1 w-full" }, /* @__PURE__ */ React61.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Target Company"), /* @__PURE__ */ React61.createElement("span", { className: "text-sm text-black py-2 " }, application.name)), /* @__PURE__ */ React61.createElement("div", { className: "flex flex-col gap-1 w-full border-t border-stone-100 pt-6" }, /* @__PURE__ */ React61.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Filing Type"), /* @__PURE__ */ React61.createElement("span", { className: "text-sm text-black py-2" }, formatType2(application.type))), /* @__PURE__ */ React61.createElement("div", { className: "flex flex-col sm:flex-row items-center gap-3 pt-6 mt-2 border-t border-stone-100" }, /* @__PURE__ */ React61.createElement("a", { href: `/app/applications/app/${application.id}`, className: "flex-1 w-full py-2.5 bg-[#d97757] text-white rounded-full text-center text-xs transition-colors hover:bg-[#d97757]/90" }, "Open Application"), /* @__PURE__ */ React61.createElement("a", { href: `/app/applications/assets/${application.id}`, className: "flex-1 w-full py-2.5 bg-transparent border border-stone-200 text-black rounded-full text-center text-xs transition-colors hover:bg-stone-50" }, "Application Assets"), deletePermitted && /* @__PURE__ */ React61.createElement("button", { onClick: () => setConfirmDialog(true), className: "flex-1 w-full py-2.5 bg-transparent border border-stone-200 text-black rounded-full text-center text-xs transition-colors hover:bg-stone-50" }, "Delete Application"))));
7431
7447
  };
7432
7448
 
7433
7449
  // src/components/UniversalCreateApplication.tsx
7434
- import React62, { useState as useState46, useRef as useRef19 } from "react";
7450
+ import React62, { useState as useState46, useRef as useRef19, useEffect as useEffect26 } from "react";
7435
7451
  import toast20 from "react-hot-toast";
7436
7452
  import { HugeiconsIcon as HugeiconsIcon47 } from "@hugeicons/react";
7437
7453
  import {
@@ -7450,30 +7466,10 @@ var MemberAvatar6 = ({ src, sizeClass = "w-10 h-10" }) => {
7450
7466
  const defaultAvatar = "https://storage.googleapis.com/retina-cloud-v2/assets/images/avatar.avif";
7451
7467
  return /* @__PURE__ */ React62.createElement("div", { className: `relative shrink-0 ${sizeClass}` }, /* @__PURE__ */ React62.createElement("div", { className: "w-full h-full rounded-lg bg-stone-100 flex items-center justify-center overflow-hidden" }, !loaded && !error && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Loading03Icon33, className: "animate-spin text-stone-400 absolute", size: 14 }), /* @__PURE__ */ React62.createElement("img", { src: error || !src ? defaultAvatar : src, alt: "Avatar", className: `w-full h-full object-cover transition-opacity duration-300 ${loaded || error ? "opacity-100" : "opacity-0"}`, onLoad: () => setLoaded(true), onError: () => setError(true) })));
7452
7468
  };
7453
- var APPLICATION_TYPES = [
7454
- "COMPANY_REGISTRATION",
7455
- "BUSINESS_NAME",
7456
- "NGO_INCORPORATION",
7457
- "TRADEMARK",
7458
- "COPYRIGHT",
7459
- "PATENT",
7460
- "NDPC",
7461
- "GDPR",
7462
- "SCUML_CERTIFICATE",
7463
- "TAX_FILING",
7464
- "TIN_APPLICATION",
7465
- "VAT_REGISTRATION",
7466
- "ANNUAL_RETURNS",
7467
- "CHANGE_OF_DIRECTORS",
7468
- "CHANGE_OF_NAME",
7469
- "NAFDAC_REGISTRATION",
7470
- "OTHER"
7471
- ];
7472
- var formatType3 = (type) => type.split("_").map((w) => w[0] + w.slice(1).toLowerCase()).join(" ");
7473
- var FORMATTED_TYPES = APPLICATION_TYPES.map(formatType3);
7474
7469
  var UniversalCreateApplication = ({
7475
7470
  onBackHref,
7476
7471
  userRole = "MEMBER",
7472
+ applicationTypesMeta = [],
7477
7473
  members,
7478
7474
  isMembersLoading,
7479
7475
  membersCurrentPage,
@@ -7492,7 +7488,13 @@ var UniversalCreateApplication = ({
7492
7488
  }) => {
7493
7489
  const canManage = userRole === "ADMIN" || userRole === "MANAGER" || userRole === "OWNER";
7494
7490
  const [creationMode, setCreationMode] = useState46("EXISTING");
7495
- const [selectedTypeFormatted, setSelectedTypeFormatted] = useState46("Company Registration");
7491
+ const defaultTypeKey = applicationTypesMeta.length > 0 ? applicationTypesMeta[0].key : "";
7492
+ const [selectedTypeKey, setSelectedTypeKey] = useState46(defaultTypeKey);
7493
+ useEffect26(() => {
7494
+ if (!selectedTypeKey && applicationTypesMeta.length > 0) {
7495
+ setSelectedTypeKey(applicationTypesMeta[0].key);
7496
+ }
7497
+ }, [applicationTypesMeta, selectedTypeKey]);
7496
7498
  const [selectedCompanyId, setSelectedCompanyId] = useState46(null);
7497
7499
  const [newCompanyName, setNewCompanyName] = useState46("");
7498
7500
  const [isPrivate, setIsPrivate] = useState46(false);
@@ -7527,8 +7529,7 @@ var UniversalCreateApplication = ({
7527
7529
  const handleSubmit = async (e) => {
7528
7530
  e.preventDefault();
7529
7531
  if (!canManage) return;
7530
- const rawType = APPLICATION_TYPES[FORMATTED_TYPES.indexOf(selectedTypeFormatted)];
7531
- if (!rawType) return toast20.error("Please select a valid application type.");
7532
+ if (!selectedTypeKey) return toast20.error("Please select a valid application type.");
7532
7533
  if (creationMode === "EXISTING" && !selectedCompanyId) return toast20.error("Please select a company.");
7533
7534
  if (creationMode === "NEW" && newCompanyName.trim().length < 2) return toast20.error("Company name is required.");
7534
7535
  setIsSubmitting(true);
@@ -7541,7 +7542,7 @@ var UniversalCreateApplication = ({
7541
7542
  isPrivate,
7542
7543
  assignedUsers: isPrivate ? Array.from(selectedParticipants) : []
7543
7544
  } : void 0,
7544
- type: rawType
7545
+ type: selectedTypeKey
7545
7546
  });
7546
7547
  } catch (error) {
7547
7548
  toast20.error(error.message || "Failed to create application.");
@@ -7549,7 +7550,40 @@ var UniversalCreateApplication = ({
7549
7550
  }
7550
7551
  };
7551
7552
  const activeCompany = companies.find((c) => c.id === selectedCompanyId);
7552
- return /* @__PURE__ */ React62.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React62.createElement(ManagedToaster, null), /* @__PURE__ */ React62.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ React62.createElement("a", { href: onBackHref, className: "flex items-center gap-2 text-[#d97757] hover:text-[#d97757] transition-colors text-sm outline-none" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowLeft01Icon25, size: 16 }), " Back")), /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col gap-1 mb-6 px-1" }, /* @__PURE__ */ React62.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Create Application"), /* @__PURE__ */ React62.createElement("p", { className: "text-xs text-stone-500" }, "Initiate a new registration or filing for a company.")), /* @__PURE__ */ React62.createElement("div", { className: "flex items-center gap-6 mb-6 px-1" }, /* @__PURE__ */ React62.createElement("button", { onClick: () => setCreationMode("EXISTING"), disabled: isSubmitting, className: `pb-2 text-sm outline-none transition-colors border-b-2 ${creationMode === "EXISTING" ? "border-black text-black" : "border-transparent text-stone-500 hover:text-black"}` }, "Select Company"), /* @__PURE__ */ React62.createElement("button", { onClick: () => setCreationMode("NEW"), disabled: isSubmitting, className: `pb-2 text-sm outline-none transition-colors border-b-2 ${creationMode === "NEW" ? "border-black text-black" : "border-transparent text-stone-500 hover:text-black"}` }, "New Company")), /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ React62.createElement("form", { className: "flex flex-col gap-8", onSubmit: handleSubmit, autoComplete: "off" }, !canManage && /* @__PURE__ */ React62.createElement("div", { className: "flex items-start gap-3 p-4 bg-stone-50 rounded-xl" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: CircleLock02Icon6, size: 20, className: "text-stone-500 shrink-0 mt-0.5" }), /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React62.createElement("span", { className: "text-sm text-black tracking-tight" }, "Access Restricted"), /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-500 mt-1 leading-relaxed" }, "You lack clearance to create applications."))), creationMode === "EXISTING" ? /* @__PURE__ */ React62.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ React62.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Target Company"), /* @__PURE__ */ React62.createElement("div", { onClick: () => canManage && !isSubmitting && setShowCompaniesModal(true), className: `flex items-center relative w-full border-b border-stone-200 transition-all duration-300 pb-3 pt-3 ${!canManage || isSubmitting ? "opacity-50 pointer-events-none" : "hover:border-black cursor-pointer"}` }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Building03Icon, size: 16, className: "text-stone-400 absolute left-0" }), /* @__PURE__ */ React62.createElement("span", { className: `w-full pl-8 text-sm truncate block ${activeCompany ? "text-black" : "text-stone-400"}` }, activeCompany ? activeCompany.name : "Select an existing company..."))) : /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement(TextInput, { label: "Company Name", value: newCompanyName, onChange: (val) => setNewCompanyName(val), disabled: isSubmitting || !canManage, placeholder: "e.g. Acme Innovations Ltd.", maxLength: 80 }), /* @__PURE__ */ React62.createElement("div", { className: `flex items-center justify-between py-2 mt-2 ${!canManage ? "opacity-50 pointer-events-none" : ""}` }, /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React62.createElement("span", { className: "text-sm text-black tracking-tight" }, "Private Company"), /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-500" }, "Only assigned members can view and access its applications.")), /* @__PURE__ */ React62.createElement("button", { type: "button", onClick: () => setIsPrivate(!isPrivate), disabled: !canManage || isSubmitting, className: `relative w-11 h-6 rounded-full transition-colors outline-none shrink-0 ${isPrivate ? "bg-[#d97757]" : "bg-stone-200"}` }, /* @__PURE__ */ React62.createElement("div", { className: `absolute top-1 left-1 bg-white w-4 h-4 rounded-full transition-transform ${isPrivate ? "translate-x-5" : "translate-x-0"}` }))), isPrivate && /* @__PURE__ */ React62.createElement("div", { className: `flex items-center justify-between animate-in fade-in zoom-in-95 duration-200 bg-stone-50 p-4 rounded-xl ${!canManage ? "opacity-50" : ""}` }, /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-black tracking-tight" }, "Assigned Members"), /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-[#d97757] " }, selectedParticipants.size, " added")), /* @__PURE__ */ React62.createElement("button", { type: "button", onClick: () => setShowMembersModal(true), disabled: !canManage || isSubmitting, className: "px-4 py-2 border border-stone-200 text-black text-xs tracking-wide rounded-full hover:bg-white transition-colors outline-none bg-transparent" }, "Manage Access"))), /* @__PURE__ */ React62.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ React62.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Application Type"), /* @__PURE__ */ React62.createElement("div", { onClick: () => canManage && !isSubmitting && setShowTypeModal(true), className: `flex items-center relative w-full border-b border-stone-200 transition-all duration-300 pb-3 pt-3 ${!canManage || isSubmitting ? "opacity-50 pointer-events-none" : "hover:border-black cursor-pointer"}` }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: File02Icon, size: 16, className: "text-stone-400 absolute left-0" }), /* @__PURE__ */ React62.createElement("span", { className: "w-full pl-8 text-sm text-black truncate block" }, selectedTypeFormatted))), canManage && /* @__PURE__ */ React62.createElement("div", { className: "pt-6" }, /* @__PURE__ */ React62.createElement(ThreeDActionButton, { type: "submit", disabled: isSubmitting || creationMode === "EXISTING" && !selectedCompanyId || creationMode === "NEW" && newCompanyName.length < 2, isLoading: isSubmitting, className: "w-full sm:w-auto min-w-40" }, "Create Application")))), canManage && /* @__PURE__ */ React62.createElement(ReusableOptions, { isOpen: showTypeModal, onClose: () => setShowTypeModal(false), title: "Application Type", options: FORMATTED_TYPES, selectedOption: selectedTypeFormatted, onSelect: (t) => setSelectedTypeFormatted(t), showSearch: true }), showCompaniesModal && canManage && /* @__PURE__ */ React62.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowCompaniesModal(false) }), /* @__PURE__ */ React62.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React62.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Select Company"), /* @__PURE__ */ React62.createElement("button", { onClick: () => setShowCompaniesModal(false), className: "text-[#d97757] outline-none text-sm" }, "Close")), /* @__PURE__ */ React62.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ React62.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Search01Icon11, size: 16, className: "text-stone-400 absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none" }), /* @__PURE__ */ React62.createElement("input", { type: "text", placeholder: "Search companies...", value: localCompSearch, onChange: handleCompSearch, className: "w-full pl-10 pr-4 py-2.5 bg-stone-100 rounded-full focus:border-[#d97757] border border-transparent text-sm text-black outline-none focus:bg-stone-200 transition-colors" }))), /* @__PURE__ */ React62.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, isCompaniesLoading ? /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Loading03Icon33, size: 28, className: "animate-spin text-black" })) : companies.length === 0 ? /* @__PURE__ */ React62.createElement("div", { className: "p-8 text-center text-xs text-stone-400" }, "No companies available.") : companies.map((comp) => /* @__PURE__ */ React62.createElement("div", { key: comp.id, onClick: () => {
7553
+ const activeTypeObj = applicationTypesMeta.find((t) => t.key === selectedTypeKey) || applicationTypesMeta[0];
7554
+ const modeTabs = [
7555
+ { id: "EXISTING", label: "Select Company" },
7556
+ { id: "NEW", label: "New Company" }
7557
+ ];
7558
+ return /* @__PURE__ */ React62.createElement("div", { className: "w-full max-w-3xl mx-auto flex flex-col animate-in fade-in duration-300 relative" }, /* @__PURE__ */ React62.createElement(ManagedToaster, null), /* @__PURE__ */ React62.createElement("div", { className: "mb-6 flex w-full items-center px-1" }, /* @__PURE__ */ React62.createElement("a", { href: onBackHref, className: "flex items-center gap-2 text-[#d97757] hover:text-[#d97757] transition-colors text-sm outline-none" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowLeft01Icon25, size: 16 }), " Back")), /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col gap-1 mb-6 px-1" }, /* @__PURE__ */ React62.createElement("h1", { className: "text-black text-xl tracking-tight" }, "Create Application"), /* @__PURE__ */ React62.createElement("p", { className: "text-xs text-stone-500" }, "Initiate a new registration or filing for a company.")), /* @__PURE__ */ React62.createElement("div", { className: "flex items-center mb-4 w-full animate-in fade-in duration-300 px-2" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center bg-white rounded-full p-1 sm:p-1.5 max-w-full overflow-x-auto custom-scrollbar" }, modeTabs.map((tab) => {
7559
+ const isActive = creationMode === tab.id;
7560
+ return /* @__PURE__ */ React62.createElement(
7561
+ "button",
7562
+ {
7563
+ key: tab.id,
7564
+ type: "button",
7565
+ onClick: () => setCreationMode(tab.id),
7566
+ disabled: isSubmitting,
7567
+ className: `px-4 py-1.5 rounded-full text-xs transition-all duration-200 outline-none whitespace-nowrap shrink-0 ${isActive ? "bg-stone-50 text-black" : "text-stone-500 hover:text-black hover:bg-stone-50/50"}`
7568
+ },
7569
+ tab.label
7570
+ );
7571
+ }))), /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col gap-8 animate-in rounded-2xl p-6 bg-white fade-in duration-300" }, /* @__PURE__ */ React62.createElement("form", { className: "flex flex-col gap-8", onSubmit: handleSubmit, autoComplete: "off" }, !canManage && /* @__PURE__ */ React62.createElement("div", { className: "flex items-start gap-3 p-4 bg-stone-50 rounded-xl" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: CircleLock02Icon6, size: 20, className: "text-stone-500 shrink-0 mt-0.5" }), /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React62.createElement("span", { className: "text-sm text-black tracking-tight" }, "Access Restricted"), /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-500 mt-1 leading-relaxed" }, "You lack clearance to create applications."))), creationMode === "EXISTING" ? /* @__PURE__ */ React62.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ React62.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Target Company"), /* @__PURE__ */ React62.createElement("div", { onClick: () => canManage && !isSubmitting && setShowCompaniesModal(true), className: `flex items-center relative w-full border-b border-stone-200 transition-all duration-300 pb-3 pt-3 ${!canManage || isSubmitting ? "opacity-50 pointer-events-none" : "hover:border-black cursor-pointer"}` }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Building03Icon, size: 16, className: "text-stone-400 absolute left-0" }), /* @__PURE__ */ React62.createElement("span", { className: `w-full pl-8 text-sm truncate block ${activeCompany ? "text-black" : "text-stone-400"}` }, activeCompany ? activeCompany.name : "Select an existing company..."))) : /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement(TextInput, { label: "Company Name", value: newCompanyName, onChange: (val) => setNewCompanyName(val), disabled: isSubmitting || !canManage, placeholder: "e.g. Acme Innovations Ltd.", maxLength: 80 }), /* @__PURE__ */ React62.createElement("div", { className: `flex items-center justify-between py-2 mt-2 ${!canManage ? "opacity-50 pointer-events-none" : ""}` }, /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React62.createElement("span", { className: "text-sm text-black tracking-tight" }, "Private Company"), /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-500" }, "Only assigned members can view and access its applications.")), /* @__PURE__ */ React62.createElement("button", { type: "button", onClick: () => setIsPrivate(!isPrivate), disabled: !canManage || isSubmitting, className: `relative w-11 h-6 rounded-full transition-colors outline-none shrink-0 ${isPrivate ? "bg-[#d97757]" : "bg-stone-200"}` }, /* @__PURE__ */ React62.createElement("div", { className: `absolute top-1 left-1 bg-white w-4 h-4 rounded-full transition-transform ${isPrivate ? "translate-x-5" : "translate-x-0"}` }))), isPrivate && /* @__PURE__ */ React62.createElement("div", { className: `flex items-center justify-between animate-in fade-in zoom-in-95 duration-200 bg-stone-50 p-4 rounded-xl ${!canManage ? "opacity-50" : ""}` }, /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-black tracking-tight" }, "Assigned Members"), /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-[#d97757]" }, selectedParticipants.size, " added")), /* @__PURE__ */ React62.createElement("button", { type: "button", onClick: () => setShowMembersModal(true), disabled: !canManage || isSubmitting, className: "px-4 py-2 border border-stone-200 text-black text-xs tracking-wide rounded-full hover:bg-white transition-colors outline-none bg-transparent" }, "Manage Access"))), /* @__PURE__ */ React62.createElement("div", { className: "space-y-1.5 w-full" }, /* @__PURE__ */ React62.createElement("label", { className: "text-xs text-stone-400 tracking-[0.2em] block" }, "Application Type"), /* @__PURE__ */ React62.createElement("div", { onClick: () => canManage && !isSubmitting && setShowTypeModal(true), className: `flex items-center relative w-full border-b border-stone-200 transition-all duration-300 pb-3 pt-3 ${!canManage || isSubmitting ? "opacity-50 pointer-events-none" : "hover:border-black cursor-pointer"}` }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: File02Icon, size: 16, className: "text-stone-400 absolute left-0" }), /* @__PURE__ */ React62.createElement("span", { className: "w-full pl-8 text-sm text-black truncate block" }, activeTypeObj?.label || "Select Type..."))), canManage && /* @__PURE__ */ React62.createElement("div", { className: "pt-6" }, /* @__PURE__ */ React62.createElement(ThreeDActionButton, { type: "submit", disabled: isSubmitting || !selectedTypeKey || creationMode === "EXISTING" && !selectedCompanyId || creationMode === "NEW" && newCompanyName.length < 2, isLoading: isSubmitting, className: "w-full sm:w-auto min-w-40" }, "Create Application")))), showTypeModal && canManage && /* @__PURE__ */ React62.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowTypeModal(false) }), /* @__PURE__ */ React62.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between p-5 shrink-0 border-b border-stone-100" }, /* @__PURE__ */ React62.createElement("h3", { className: "text-sm text-black tracking-tight " }, "Application Type"), /* @__PURE__ */ React62.createElement("button", { onClick: () => setShowTypeModal(false), className: "text-[#d97757] outline-none text-sm" }, "Done")), /* @__PURE__ */ React62.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-3 space-y-2" }, applicationTypesMeta.map((item) => {
7572
+ const isSelected = selectedTypeKey === item.key;
7573
+ return /* @__PURE__ */ React62.createElement(
7574
+ "div",
7575
+ {
7576
+ key: item.key,
7577
+ onClick: () => {
7578
+ setSelectedTypeKey(item.key);
7579
+ setShowTypeModal(false);
7580
+ },
7581
+ className: `p-4 rounded-xl cursor-pointer transition-all border ${isSelected ? "bg-white border-[#d97757]" : "bg-stone-100 border-transparent hover:bg-stone-200/60"}`
7582
+ },
7583
+ /* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between gap-2" }, /* @__PURE__ */ React62.createElement("h4", { className: "text-xs text-black" }, item.label), isSelected && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Tick02Icon4, size: 16, className: "text-[#d97757] shrink-0" })),
7584
+ /* @__PURE__ */ React62.createElement("p", { className: "text-[11px] text-stone-500 mt-1 leading-relaxed whitespace-normal wrap-break-word" }, item.desc)
7585
+ );
7586
+ })))), showCompaniesModal && canManage && /* @__PURE__ */ React62.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowCompaniesModal(false) }), /* @__PURE__ */ React62.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React62.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Select Company"), /* @__PURE__ */ React62.createElement("button", { onClick: () => setShowCompaniesModal(false), className: "text-[#d97757] outline-none text-sm" }, "Close")), /* @__PURE__ */ React62.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ React62.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Search01Icon11, size: 16, className: "text-stone-400 absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none" }), /* @__PURE__ */ React62.createElement("input", { type: "text", placeholder: "Search companies...", value: localCompSearch, onChange: handleCompSearch, className: "w-full pl-10 pr-4 py-2.5 bg-stone-100 rounded-full focus:border-[#d97757] border border-transparent text-sm text-black outline-none focus:bg-stone-200 transition-colors" }))), /* @__PURE__ */ React62.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, isCompaniesLoading ? /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Loading03Icon33, size: 28, className: "animate-spin text-black" })) : companies.length === 0 ? /* @__PURE__ */ React62.createElement("div", { className: "p-8 text-center text-xs text-stone-400" }, "No companies available.") : companies.map((comp) => /* @__PURE__ */ React62.createElement("div", { key: comp.id, onClick: () => {
7553
7587
  setSelectedCompanyId(comp.id);
7554
7588
  setShowCompaniesModal(false);
7555
7589
  }, className: "flex items-center justify-between p-3 rounded-xl cursor-pointer hover:bg-stone-50 transition-colors" }, /* @__PURE__ */ React62.createElement("div", { className: "flex flex-col min-w-0 flex-1 pl-2" }, /* @__PURE__ */ React62.createElement("span", { className: "text-sm text-black truncate" }, comp.name), comp.isPrivate && /* @__PURE__ */ React62.createElement("span", { className: "text-[10px] text-[#d97757] mt-0.5 tracking-widest uppercase" }, "Private")), selectedCompanyId === comp.id && /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Tick02Icon4, size: 16, className: "text-[#d97757] mr-2" })))), /* @__PURE__ */ React62.createElement("div", { className: "p-4 flex items-center justify-between shrink-0 bg-white" }, /* @__PURE__ */ React62.createElement("span", { className: "text-xs text-stone-400 tracking-widest" }, "Page ", companiesCurrentPage, " of ", companiesTotalPages || 1), /* @__PURE__ */ React62.createElement("div", { className: "flex gap-1" }, /* @__PURE__ */ React62.createElement("button", { disabled: companiesCurrentPage <= 1 || isCompaniesLoading, onClick: () => onCompaniesPageChange(companiesCurrentPage - 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowLeft01Icon25, size: 12 })), /* @__PURE__ */ React62.createElement("button", { disabled: companiesCurrentPage >= companiesTotalPages || isCompaniesLoading, onClick: () => onCompaniesPageChange(companiesCurrentPage + 1), className: "w-7 h-7 flex items-center justify-center rounded-full bg-white border border-stone-200 text-stone-600 disabled:opacity-30 outline-none hover:bg-stone-50" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: ArrowRight01Icon19, size: 12 })))))), showMembersModal && canManage && /* @__PURE__ */ React62.createElement("div", { className: "fixed inset-0 z-120 flex items-center justify-center p-4 pointer-events-auto" }, /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowMembersModal(false) }), /* @__PURE__ */ React62.createElement("div", { className: "relative w-full max-w-md bg-white rounded-2xl flex flex-col overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200 h-[80vh]" }, /* @__PURE__ */ React62.createElement("div", { className: "flex items-center justify-between p-5 shrink-0" }, /* @__PURE__ */ React62.createElement("h3", { className: "text-sm text-black tracking-tight" }, "Assign Members"), /* @__PURE__ */ React62.createElement("button", { onClick: () => setShowMembersModal(false), className: "text-[#d97757] outline-none text-sm" }, "Done")), /* @__PURE__ */ React62.createElement("div", { className: "p-4 shrink-0" }, /* @__PURE__ */ React62.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Search01Icon11, size: 16, className: "text-stone-400 absolute left-4 top-1/2 -translate-y-1/2 pointer-events-none" }), /* @__PURE__ */ React62.createElement("input", { type: "text", placeholder: "Search team...", value: localMemSearch, onChange: handleMemSearch, className: "w-full pl-10 pr-4 py-2.5 bg-stone-100 rounded-full focus:border-[#d97757] border border-transparent text-sm text-black outline-none focus:bg-stone-200 transition-colors" }))), /* @__PURE__ */ React62.createElement("div", { className: "flex-1 overflow-y-auto custom-scrollbar p-2" }, isMembersLoading ? /* @__PURE__ */ React62.createElement("div", { className: "absolute inset-0 flex items-center justify-center" }, /* @__PURE__ */ React62.createElement(HugeiconsIcon47, { icon: Loading03Icon33, size: 28, className: "animate-spin text-black" })) : members.length === 0 ? /* @__PURE__ */ React62.createElement("div", { className: "p-8 text-center text-xs text-stone-400" }, "No members found.") : members.map((member) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retinalabsllc/zairusjs",
3
- "version": "21.1.9",
3
+ "version": "21.2.0",
4
4
  "description": "A perceptive, Ai data driven Next.js UI component library.",
5
5
  "author": "Retina Labs Company",
6
6
  "license": "MIT",