From 48af4d83ca5627e02020d2f47f0c5d03e3659b50 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Wed, 11 Oct 2023 17:03:52 +0530 Subject: [PATCH 1/3] chore: implement new worksapace wrapper for global views pages --- web/components/headers/global-issues.tsx | 102 +++++++++--------- web/components/views/view-list-item.tsx | 2 +- web/components/views/views-list.tsx | 9 +- web/components/workspace/views/header.tsx | 6 ++ .../workspace/views/view-list-item.tsx | 2 +- web/components/workspace/views/views-list.tsx | 13 ++- web/helpers/analytics.helper.ts | 11 +- web/layouts/app-layout/layout.tsx | 3 +- .../workspace-views/[globalViewId].tsx | 25 +---- .../workspace-views/all-issues.tsx | 49 ++------- .../workspace-views/assigned.tsx | 49 ++------- .../workspace-views/created.tsx | 49 ++------- .../[workspaceSlug]/workspace-views/index.tsx | 28 +---- .../workspace-views/subscribed.tsx | 51 ++------- 14 files changed, 133 insertions(+), 266 deletions(-) diff --git a/web/components/headers/global-issues.tsx b/web/components/headers/global-issues.tsx index 2e4aa588a61..482d3b633ca 100644 --- a/web/components/headers/global-issues.tsx +++ b/web/components/headers/global-issues.tsx @@ -12,7 +12,7 @@ import { CreateUpdateWorkspaceViewModal } from "components/workspace"; // ui import { PrimaryButton, Tooltip } from "components/ui"; // icons -import { List, PlusIcon, Sheet } from "lucide-react"; +import { CheckCircle, List, PlusIcon, Sheet } from "lucide-react"; // types import { IIssueDisplayFilterOptions, IIssueDisplayProperties, IIssueFilterOptions, TStaticViewTypes } from "types"; // constants @@ -98,57 +98,63 @@ export const GlobalIssuesHeader: React.FC = observer((props) => { return ( <> setCreateViewModal(false)} /> -
-
- {GLOBAL_VIEW_LAYOUTS.map((layout) => ( - - - -
- -
-
-
- - ))} +
+
+ {activeLayout === "spreadsheet" && } + Workspace {activeLayout === "spreadsheet" ? "Issues" : "Views"}
- {activeLayout === "spreadsheet" && ( - <> - {!STATIC_VIEW_TYPES.some((word) => router.pathname.includes(word)) && ( - - +
+ {GLOBAL_VIEW_LAYOUTS.map((layout) => ( + + + +
+ +
+
+
+ + ))} +
+ {activeLayout === "spreadsheet" && ( + <> + {!STATIC_VIEW_TYPES.some((word) => router.pathname.includes(word)) && ( + + + + )} + + + - )} - - - - - - )} - setCreateViewModal(true)}> - - New View - + + )} + setCreateViewModal(true)}> + + New View + +
); diff --git a/web/components/views/view-list-item.tsx b/web/components/views/view-list-item.tsx index 9417213cbf4..c418d175da1 100644 --- a/web/components/views/view-list-item.tsx +++ b/web/components/views/view-list-item.tsx @@ -50,7 +50,7 @@ export const ProjectViewListItem: React.FC = observer((props) => { setDeleteViewModal(false)} />
- +
diff --git a/web/components/views/views-list.tsx b/web/components/views/views-list.tsx index 9ba37dc09bd..34e8a457c46 100644 --- a/web/components/views/views-list.tsx +++ b/web/components/views/views-list.tsx @@ -25,10 +25,11 @@ export const ProjectViewsList = observer(() => { if (!viewsList) return ( - - - - + + + + + ); diff --git a/web/components/workspace/views/header.tsx b/web/components/workspace/views/header.tsx index 20692d414be..8cfd79f8254 100644 --- a/web/components/workspace/views/header.tsx +++ b/web/components/workspace/views/header.tsx @@ -2,6 +2,7 @@ import React, { useState } from "react"; import { useRouter } from "next/router"; import Link from "next/link"; import { observer } from "mobx-react-lite"; +import useSWR from "swr"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; @@ -20,6 +21,11 @@ export const GlobalViewsHeader: React.FC = observer(() => { const { globalViews: globalViewsStore } = useMobxStore(); + useSWR( + workspaceSlug ? `GLOBAL_VIEWS_LIST_${workspaceSlug.toString()}` : null, + workspaceSlug ? () => globalViewsStore.fetchAllGlobalViews(workspaceSlug.toString()) : null + ); + const isTabSelected = (tabKey: string) => router.pathname.includes(tabKey); return ( diff --git a/web/components/workspace/views/view-list-item.tsx b/web/components/workspace/views/view-list-item.tsx index 608e432a9c1..b603ed2cdb4 100644 --- a/web/components/workspace/views/view-list-item.tsx +++ b/web/components/workspace/views/view-list-item.tsx @@ -34,7 +34,7 @@ export const GlobalViewListItem: React.FC = observer((props) => { setDeleteViewModal(false)} />
- +
diff --git a/web/components/workspace/views/views-list.tsx b/web/components/workspace/views/views-list.tsx index ccfeba75b80..ba890ba4c93 100644 --- a/web/components/workspace/views/views-list.tsx +++ b/web/components/workspace/views/views-list.tsx @@ -1,4 +1,6 @@ +import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; +import useSWR from "swr"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; @@ -12,16 +14,23 @@ type Props = { }; export const GlobalViewsList: React.FC = observer((props) => { + const router = useRouter(); + const { workspaceSlug } = router.query; + const { searchQuery } = props; const { globalViews: globalViewsStore } = useMobxStore(); + useSWR( + workspaceSlug ? `GLOBAL_VIEWS_LIST_${workspaceSlug.toString()}` : null, + workspaceSlug ? () => globalViewsStore.fetchAllGlobalViews(workspaceSlug.toString()) : null + ); + const viewsList = globalViewsStore.globalViewsList; if (!viewsList) return ( - - + diff --git a/web/helpers/analytics.helper.ts b/web/helpers/analytics.helper.ts index 08b76372045..09dbb6b354e 100644 --- a/web/helpers/analytics.helper.ts +++ b/web/helpers/analytics.helper.ts @@ -72,8 +72,7 @@ export const generateBarColor = ( if (params[type] === "state__name" || params[type] === "labels__name") color = analytics?.extras?.colors.find((c) => c.name === value)?.color; - if (params[type] === "state__group") - color = STATE_GROUP_COLORS[value.toLowerCase() as TStateGroups]; + if (params[type] === "state__group") color = STATE_GROUP_COLORS[value.toLowerCase() as TStateGroups]; if (params[type] === "priority") { const priority = value.toLowerCase(); @@ -96,8 +95,8 @@ export const generateBarColor = ( export const renderMonthAndYear = (date: string | number | null): string => { if (!date || date === "") return ""; - return ( - (MONTHS_LIST.find((m) => `${m.value}` === `${date}`.split("-")[1])?.label.substring(0, 3) ?? - "None") + ` ${date}`.split("-")[0] ?? "" - ); + const monthNumber = parseInt(`${date}`.split("-")[1], 10); + const year = `${date}`.split("-")[0]; + + return (MONTHS_LIST[monthNumber]?.shortTitle ?? "None") + ` ${year}` ?? ""; }; diff --git a/web/layouts/app-layout/layout.tsx b/web/layouts/app-layout/layout.tsx index 394d35d6bdb..6f0d65450ba 100644 --- a/web/layouts/app-layout/layout.tsx +++ b/web/layouts/app-layout/layout.tsx @@ -12,8 +12,9 @@ export interface IAppLayout { export const AppLayout: FC = (props) => { const { children, header } = props; + return ( -
+
{/* */} diff --git a/web/pages/[workspaceSlug]/workspace-views/[globalViewId].tsx b/web/pages/[workspaceSlug]/workspace-views/[globalViewId].tsx index 17d7259e21f..799a654f6f5 100644 --- a/web/pages/[workspaceSlug]/workspace-views/[globalViewId].tsx +++ b/web/pages/[workspaceSlug]/workspace-views/[globalViewId].tsx @@ -4,17 +4,13 @@ import useSWR from "swr"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; +import { AppLayout } from "layouts/app-layout"; // components import { GlobalViewsHeader } from "components/workspace"; import { GlobalViewsAllLayouts } from "components/issues"; import { GlobalIssuesHeader } from "components/headers"; -// icons -import { CheckCircle } from "lucide-react"; // types import { NextPage } from "next"; -// fetch-keys -import { GLOBAL_VIEWS_LIST, GLOBAL_VIEW_DETAILS } from "constants/fetch-keys"; const GlobalViewIssues: NextPage = () => { const router = useRouter(); @@ -23,34 +19,21 @@ const GlobalViewIssues: NextPage = () => { const { globalViews: globalViewsStore } = useMobxStore(); useSWR( - workspaceSlug ? GLOBAL_VIEWS_LIST(workspaceSlug.toString()) : null, - workspaceSlug ? () => globalViewsStore.fetchAllGlobalViews(workspaceSlug.toString()) : null - ); - - useSWR( - workspaceSlug && globalViewId ? GLOBAL_VIEW_DETAILS(globalViewId.toString()) : null, + workspaceSlug && globalViewId ? `GLOBAL_VIEW_DETAILS_${globalViewId.toString()}` : null, workspaceSlug && globalViewId ? () => globalViewsStore.fetchGlobalViewDetails(workspaceSlug.toString(), globalViewId.toString()) : null ); return ( - - - Workspace issues -
- } - right={} - > + }>
- +
); }; diff --git a/web/pages/[workspaceSlug]/workspace-views/all-issues.tsx b/web/pages/[workspaceSlug]/workspace-views/all-issues.tsx index 6761f70401d..83a892e2a31 100644 --- a/web/pages/[workspaceSlug]/workspace-views/all-issues.tsx +++ b/web/pages/[workspaceSlug]/workspace-views/all-issues.tsx @@ -1,50 +1,21 @@ -import { useRouter } from "next/router"; -import useSWR from "swr"; - -// mobx store -import { useMobxStore } from "lib/mobx/store-provider"; // components import { GlobalViewsHeader } from "components/workspace"; import { GlobalIssuesHeader } from "components/headers"; import { GlobalViewsAllLayouts } from "components/issues"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; -// icons -import { CheckCircle } from "lucide-react"; +import { AppLayout } from "layouts/app-layout"; // types import { NextPage } from "next"; -// fetch-keys -import { GLOBAL_VIEWS_LIST } from "constants/fetch-keys"; - -const GlobalViewAllIssues: NextPage = () => { - const router = useRouter(); - const { workspaceSlug } = router.query; - - const { globalViews: globalViewsStore } = useMobxStore(); - - useSWR( - workspaceSlug ? GLOBAL_VIEWS_LIST(workspaceSlug.toString()) : null, - workspaceSlug ? () => globalViewsStore.fetchAllGlobalViews(workspaceSlug.toString()) : null - ); - return ( - - - Workspace issues -
- } - right={} - > -
-
- - -
+const GlobalViewAllIssues: NextPage = () => ( + }> +
+
+ +
- - ); -}; +
+
+); export default GlobalViewAllIssues; diff --git a/web/pages/[workspaceSlug]/workspace-views/assigned.tsx b/web/pages/[workspaceSlug]/workspace-views/assigned.tsx index 5d6aafc009b..65dfd41308a 100644 --- a/web/pages/[workspaceSlug]/workspace-views/assigned.tsx +++ b/web/pages/[workspaceSlug]/workspace-views/assigned.tsx @@ -1,50 +1,21 @@ -import { useRouter } from "next/router"; -import useSWR from "swr"; - -// mobx store -import { useMobxStore } from "lib/mobx/store-provider"; // components import { GlobalViewsHeader } from "components/workspace"; import { GlobalIssuesHeader } from "components/headers"; import { GlobalViewsAllLayouts } from "components/issues"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; -// icons -import { CheckCircle } from "lucide-react"; +import { AppLayout } from "layouts/app-layout"; // types import { NextPage } from "next"; -// fetch-keys -import { GLOBAL_VIEWS_LIST } from "constants/fetch-keys"; - -const GlobalViewAssignedIssues: NextPage = () => { - const router = useRouter(); - const { workspaceSlug } = router.query; - - const { globalViews: globalViewsStore } = useMobxStore(); - - useSWR( - workspaceSlug ? GLOBAL_VIEWS_LIST(workspaceSlug.toString()) : null, - workspaceSlug ? () => globalViewsStore.fetchAllGlobalViews(workspaceSlug.toString()) : null - ); - return ( - - - Workspace issues -
- } - right={} - > -
-
- - -
+const GlobalViewAssignedIssues: NextPage = () => ( + }> +
+
+ +
- - ); -}; +
+
+); export default GlobalViewAssignedIssues; diff --git a/web/pages/[workspaceSlug]/workspace-views/created.tsx b/web/pages/[workspaceSlug]/workspace-views/created.tsx index 699133fcbfd..78e6ecae0b6 100644 --- a/web/pages/[workspaceSlug]/workspace-views/created.tsx +++ b/web/pages/[workspaceSlug]/workspace-views/created.tsx @@ -1,50 +1,21 @@ -import { useRouter } from "next/router"; -import useSWR from "swr"; - -// mobx store -import { useMobxStore } from "lib/mobx/store-provider"; // components import { GlobalViewsHeader } from "components/workspace"; import { GlobalIssuesHeader } from "components/headers"; import { GlobalViewsAllLayouts } from "components/issues"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; -// icons -import { CheckCircle } from "lucide-react"; +import { AppLayout } from "layouts/app-layout"; // types import { NextPage } from "next"; -// fetch-keys -import { GLOBAL_VIEWS_LIST } from "constants/fetch-keys"; - -const GlobalViewCreatedIssues: NextPage = () => { - const router = useRouter(); - const { workspaceSlug } = router.query; - - const { globalViews: globalViewsStore } = useMobxStore(); - - useSWR( - workspaceSlug ? GLOBAL_VIEWS_LIST(workspaceSlug.toString()) : null, - workspaceSlug ? () => globalViewsStore.fetchAllGlobalViews(workspaceSlug.toString()) : null - ); - return ( - - - Workspace issues -
- } - right={} - > -
-
- - -
+const GlobalViewCreatedIssues: NextPage = () => ( + }> +
+
+ +
- - ); -}; +
+
+); export default GlobalViewCreatedIssues; diff --git a/web/pages/[workspaceSlug]/workspace-views/index.tsx b/web/pages/[workspaceSlug]/workspace-views/index.tsx index 9b46cdf9abb..8401394543a 100644 --- a/web/pages/[workspaceSlug]/workspace-views/index.tsx +++ b/web/pages/[workspaceSlug]/workspace-views/index.tsx @@ -1,11 +1,6 @@ import React, { useState } from "react"; -import { useRouter } from "next/router"; -import useSWR from "swr"; - -// mobx store -import { useMobxStore } from "lib/mobx/store-provider"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; +import { AppLayout } from "layouts/app-layout"; // components import { GlobalDefaultViewListItem, GlobalViewsList } from "components/workspace"; import { GlobalIssuesHeader } from "components/headers"; @@ -21,25 +16,8 @@ import { DEFAULT_GLOBAL_VIEWS_LIST } from "constants/workspace"; const WorkspaceViews: NextPage = () => { const [query, setQuery] = useState(""); - const router = useRouter(); - const { workspaceSlug } = router.query; - - const { globalViews: globalViewsStore } = useMobxStore(); - - useSWR( - workspaceSlug ? `GLOBAL_VIEWS_LIST_${workspaceSlug.toString()}` : null, - workspaceSlug ? () => globalViewsStore.fetchAllGlobalViews(workspaceSlug.toString()) : null - ); - return ( - - Workspace Views -
- } - right={} - > + }>
@@ -58,7 +36,7 @@ const WorkspaceViews: NextPage = () => { ))}
- + ); }; diff --git a/web/pages/[workspaceSlug]/workspace-views/subscribed.tsx b/web/pages/[workspaceSlug]/workspace-views/subscribed.tsx index 74984df5b5d..fb126f81b32 100644 --- a/web/pages/[workspaceSlug]/workspace-views/subscribed.tsx +++ b/web/pages/[workspaceSlug]/workspace-views/subscribed.tsx @@ -1,50 +1,21 @@ -import { useRouter } from "next/router"; -import useSWR from "swr"; - -// mobx store -import { useMobxStore } from "lib/mobx/store-provider"; +// layouts +import { AppLayout } from "layouts/app-layout"; // components import { GlobalViewsHeader } from "components/workspace"; import { GlobalIssuesHeader } from "components/headers"; import { GlobalViewsAllLayouts } from "components/issues"; -// layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; -// icons -import { CheckCircle } from "lucide-react"; // types import { NextPage } from "next"; -// fetch-keys -import { GLOBAL_VIEWS_LIST } from "constants/fetch-keys"; - -const GlobalViewSubscribedIssues: NextPage = () => { - const router = useRouter(); - const { workspaceSlug } = router.query; - - const { globalViews: globalViewsStore } = useMobxStore(); - - useSWR( - workspaceSlug ? GLOBAL_VIEWS_LIST(workspaceSlug.toString()) : null, - workspaceSlug ? () => globalViewsStore.fetchAllGlobalViews(workspaceSlug.toString()) : null - ); - return ( - - - Workspace issues -
- } - right={} - > -
-
- - -
+const GlobalViewSubscribedIssues: NextPage = () => ( + }> +
+
+ +
- - ); -}; +
+
+); export default GlobalViewSubscribedIssues; From 8c4ac055d4cc53a96a9a128a4c4b9fcb20f7a673 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Wed, 11 Oct 2023 17:06:35 +0530 Subject: [PATCH 2/3] fix: merge conflicts --- packages/ui/dist/index.js | 530 +++++++++++++++++++++++++++++++++++-- packages/ui/dist/index.mjs | 512 +++++++++++++++++++++++++++++++++-- 2 files changed, 1001 insertions(+), 41 deletions(-) diff --git a/packages/ui/dist/index.js b/packages/ui/dist/index.js index 7ac83b1aece..8fccd1b1acd 100644 --- a/packages/ui/dist/index.js +++ b/packages/ui/dist/index.js @@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); @@ -23,6 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +// ../../node_modules/tsup/assets/cjs_shims.js +var init_cjs_shims = __esm({ + "../../node_modules/tsup/assets/cjs_shims.js"() { + } +}); + // src/index.tsx var src_exports = {}; __export(src_exports, { @@ -36,11 +45,14 @@ __export(src_exports, { ToggleSwitch: () => ToggleSwitch }); module.exports = __toCommonJS(src_exports); +init_cjs_shims(); // src/button/button.tsx +init_cjs_shims(); var React = __toESM(require("react")); // src/button/helper.tsx +init_cjs_shims(); var buttonStyling = { primary: { default: `text-white bg-custom-primary-100`, @@ -160,11 +172,471 @@ var Button = React.forwardRef( Button.displayName = "plane-ui-button"; // src/button/toggle-switch.tsx +init_cjs_shims(); var React2 = __toESM(require("react")); -var import_react = require("@headlessui/react"); + +// ../../node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +init_cjs_shims(); +var import_react = require("react"); + +// ../../node_modules/@headlessui/react/dist/utils/env.js +init_cjs_shims(); +var i = Object.defineProperty; +var d = (t7, e, n) => e in t7 ? i(t7, e, { enumerable: true, configurable: true, writable: true, value: n }) : t7[e] = n; +var r = (t7, e, n) => (d(t7, typeof e != "symbol" ? e + "" : e, n), n); +var o = class { + constructor() { + r(this, "current", this.detect()); + r(this, "handoffState", "pending"); + r(this, "currentId", 0); + } + set(e) { + this.current !== e && (this.handoffState = "pending", this.currentId = 0, this.current = e); + } + reset() { + this.set(this.detect()); + } + nextId() { + return ++this.currentId; + } + get isServer() { + return this.current === "server"; + } + get isClient() { + return this.current === "client"; + } + detect() { + return typeof window == "undefined" || typeof document == "undefined" ? "server" : "client"; + } + handoff() { + this.handoffState === "pending" && (this.handoffState = "complete"); + } + get isHandoffComplete() { + return this.handoffState === "complete"; + } +}; +var s = new o(); + +// ../../node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +var l = (e, f4) => { + s.isServer ? (0, import_react.useEffect)(e, f4) : (0, import_react.useLayoutEffect)(e, f4); +}; + +// ../../node_modules/@headlessui/react/dist/hooks/use-latest-value.js +init_cjs_shims(); +var import_react2 = require("react"); +function s2(e) { + let r3 = (0, import_react2.useRef)(e); + return l(() => { + r3.current = e; + }, [e]), r3; +} + +// ../../node_modules/@headlessui/react/dist/hooks/use-disposables.js +init_cjs_shims(); +var import_react3 = require("react"); + +// ../../node_modules/@headlessui/react/dist/utils/disposables.js +init_cjs_shims(); + +// ../../node_modules/@headlessui/react/dist/utils/micro-task.js +init_cjs_shims(); +function t3(e) { + typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((o9) => setTimeout(() => { + throw o9; + })); +} + +// ../../node_modules/@headlessui/react/dist/utils/disposables.js +function o2() { + let n = [], r3 = { addEventListener(e, t7, s7, a3) { + return e.addEventListener(t7, s7, a3), r3.add(() => e.removeEventListener(t7, s7, a3)); + }, requestAnimationFrame(...e) { + let t7 = requestAnimationFrame(...e); + return r3.add(() => cancelAnimationFrame(t7)); + }, nextFrame(...e) { + return r3.requestAnimationFrame(() => r3.requestAnimationFrame(...e)); + }, setTimeout(...e) { + let t7 = setTimeout(...e); + return r3.add(() => clearTimeout(t7)); + }, microTask(...e) { + let t7 = { current: true }; + return t3(() => { + t7.current && e[0](); + }), r3.add(() => { + t7.current = false; + }); + }, style(e, t7, s7) { + let a3 = e.style.getPropertyValue(t7); + return Object.assign(e.style, { [t7]: s7 }), this.add(() => { + Object.assign(e.style, { [t7]: a3 }); + }); + }, group(e) { + let t7 = o2(); + return e(t7), this.add(() => t7.dispose()); + }, add(e) { + return n.push(e), () => { + let t7 = n.indexOf(e); + if (t7 >= 0) + for (let s7 of n.splice(t7, 1)) + s7(); + }; + }, dispose() { + for (let e of n.splice(0)) + e(); + } }; + return r3; +} + +// ../../node_modules/@headlessui/react/dist/hooks/use-disposables.js +function p() { + let [e] = (0, import_react3.useState)(o2); + return (0, import_react3.useEffect)(() => () => e.dispose(), [e]), e; +} + +// ../../node_modules/@headlessui/react/dist/hooks/use-event.js +init_cjs_shims(); +var import_react4 = __toESM(require("react"), 1); +var o4 = function(t7) { + let e = s2(t7); + return import_react4.default.useCallback((...r3) => e.current(...r3), [e]); +}; + +// ../../node_modules/@headlessui/react/dist/hooks/use-id.js +init_cjs_shims(); +var import_react5 = __toESM(require("react"), 1); + +// ../../node_modules/@headlessui/react/dist/hooks/use-server-handoff-complete.js +init_cjs_shims(); +var t4 = __toESM(require("react"), 1); +function s4() { + let r3 = typeof document == "undefined"; + return "useSyncExternalStore" in t4 ? ((o9) => o9.useSyncExternalStore)(t4)(() => () => { + }, () => false, () => !r3) : false; +} +function l2() { + let r3 = s4(), [e, n] = t4.useState(s.isHandoffComplete); + return e && s.isHandoffComplete === false && n(false), t4.useEffect(() => { + e !== true && n(true); + }, [e]), t4.useEffect(() => s.handoff(), []), r3 ? false : e; +} + +// ../../node_modules/@headlessui/react/dist/hooks/use-id.js +var o5; +var I = (o5 = import_react5.default.useId) != null ? o5 : function() { + let n = l2(), [e, u5] = import_react5.default.useState(n ? () => s.nextId() : null); + return l(() => { + e === null && u5(s.nextId()); + }, [e]), e != null ? "" + e : void 0; +}; + +// ../../node_modules/@headlessui/react/dist/utils/match.js +init_cjs_shims(); +function u(r3, n, ...a3) { + if (r3 in n) { + let e = n[r3]; + return typeof e == "function" ? e(...a3) : e; + } + let t7 = new Error(`Tried to handle "${r3}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map((e) => `"${e}"`).join(", ")}.`); + throw Error.captureStackTrace && Error.captureStackTrace(t7, u), t7; +} + +// ../../node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +init_cjs_shims(); +var import_react6 = require("react"); +function i2(t7) { + var n; + if (t7.type) + return t7.type; + let e = (n = t7.as) != null ? n : "button"; + if (typeof e == "string" && e.toLowerCase() === "button") + return "button"; +} +function s5(t7, e) { + let [n, u5] = (0, import_react6.useState)(() => i2(t7)); + return l(() => { + u5(i2(t7)); + }, [t7.type, t7.as]), l(() => { + n || e.current && e.current instanceof HTMLButtonElement && !e.current.hasAttribute("type") && u5("button"); + }, [n, e]), n; +} + +// ../../node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +init_cjs_shims(); +var import_react7 = require("react"); +var u2 = Symbol(); +function y(...t7) { + let n = (0, import_react7.useRef)(t7); + (0, import_react7.useEffect)(() => { + n.current = t7; + }, [t7]); + let c5 = o4((e) => { + for (let o9 of n.current) + o9 != null && (typeof o9 == "function" ? o9(e) : o9.current = e); + }); + return t7.every((e) => e == null || (e == null ? void 0 : e[u2])) ? void 0 : c5; +} + +// ../../node_modules/@headlessui/react/dist/utils/render.js +init_cjs_shims(); +var import_react8 = require("react"); + +// ../../node_modules/@headlessui/react/dist/utils/class-names.js +init_cjs_shims(); +function t6(...r3) { + return Array.from(new Set(r3.flatMap((n) => typeof n == "string" ? n.split(" ") : []))).filter(Boolean).join(" "); +} + +// ../../node_modules/@headlessui/react/dist/utils/render.js +var S = ((a3) => (a3[a3.None = 0] = "None", a3[a3.RenderStrategy = 1] = "RenderStrategy", a3[a3.Static = 2] = "Static", a3))(S || {}); +var j = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(j || {}); +function X({ ourProps: r3, theirProps: t7, slot: e, defaultTag: a3, features: s7, visible: n = true, name: f4 }) { + let o9 = N(t7, r3); + if (n) + return c2(o9, e, a3, f4); + let u5 = s7 != null ? s7 : 0; + if (u5 & 2) { + let { static: l5 = false, ...p4 } = o9; + if (l5) + return c2(p4, e, a3, f4); + } + if (u5 & 1) { + let { unmount: l5 = true, ...p4 } = o9; + return u(l5 ? 0 : 1, { [0]() { + return null; + }, [1]() { + return c2({ ...p4, hidden: true, style: { display: "none" } }, e, a3, f4); + } }); + } + return c2(o9, e, a3, f4); +} +function c2(r3, t7 = {}, e, a3) { + let { as: s7 = e, children: n, refName: f4 = "ref", ...o9 } = g(r3, ["unmount", "static"]), u5 = r3.ref !== void 0 ? { [f4]: r3.ref } : {}, l5 = typeof n == "function" ? n(t7) : n; + "className" in o9 && o9.className && typeof o9.className == "function" && (o9.className = o9.className(t7)); + let p4 = {}; + if (t7) { + let i6 = false, m3 = []; + for (let [y4, d4] of Object.entries(t7)) + typeof d4 == "boolean" && (i6 = true), d4 === true && m3.push(y4); + i6 && (p4["data-headlessui-state"] = m3.join(" ")); + } + if (s7 === import_react8.Fragment && Object.keys(R(o9)).length > 0) { + if (!(0, import_react8.isValidElement)(l5) || Array.isArray(l5) && l5.length > 1) + throw new Error(['Passing props on "Fragment"!', "", `The current component <${a3} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(o9).map((d4) => ` - ${d4}`).join(` +`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((d4) => ` - ${d4}`).join(` +`)].join(` +`)); + let i6 = l5.props, m3 = typeof (i6 == null ? void 0 : i6.className) == "function" ? (...d4) => t6(i6 == null ? void 0 : i6.className(...d4), o9.className) : t6(i6 == null ? void 0 : i6.className, o9.className), y4 = m3 ? { className: m3 } : {}; + return (0, import_react8.cloneElement)(l5, Object.assign({}, N(l5.props, R(g(o9, ["ref"]))), p4, u5, w(l5.ref, u5.ref), y4)); + } + return (0, import_react8.createElement)(s7, Object.assign({}, g(o9, ["ref"]), s7 !== import_react8.Fragment && u5, s7 !== import_react8.Fragment && p4), l5); +} +function w(...r3) { + return { ref: r3.every((t7) => t7 == null) ? void 0 : (t7) => { + for (let e of r3) + e != null && (typeof e == "function" ? e(t7) : e.current = t7); + } }; +} +function N(...r3) { + var a3; + if (r3.length === 0) + return {}; + if (r3.length === 1) + return r3[0]; + let t7 = {}, e = {}; + for (let s7 of r3) + for (let n in s7) + n.startsWith("on") && typeof s7[n] == "function" ? ((a3 = e[n]) != null || (e[n] = []), e[n].push(s7[n])) : t7[n] = s7[n]; + if (t7.disabled || t7["aria-disabled"]) + return Object.assign(t7, Object.fromEntries(Object.keys(e).map((s7) => [s7, void 0]))); + for (let s7 in e) + Object.assign(t7, { [s7](n, ...f4) { + let o9 = e[s7]; + for (let u5 of o9) { + if ((n instanceof Event || (n == null ? void 0 : n.nativeEvent) instanceof Event) && n.defaultPrevented) + return; + u5(n, ...f4); + } + } }); + return t7; +} +function D(r3) { + var t7; + return Object.assign((0, import_react8.forwardRef)(r3), { displayName: (t7 = r3.displayName) != null ? t7 : r3.name }); +} +function R(r3) { + let t7 = Object.assign({}, r3); + for (let e in t7) + t7[e] === void 0 && delete t7[e]; + return t7; +} +function g(r3, t7 = []) { + let e = Object.assign({}, r3); + for (let a3 of t7) + a3 in e && delete e[a3]; + return e; +} + +// ../../node_modules/@headlessui/react/dist/utils/bugs.js +init_cjs_shims(); +function r2(n) { + let e = n.parentElement, l5 = null; + for (; e && !(e instanceof HTMLFieldSetElement); ) + e instanceof HTMLLegendElement && (l5 = e), e = e.parentElement; + let t7 = (e == null ? void 0 : e.getAttribute("disabled")) === ""; + return t7 && i4(l5) ? false : t7; +} +function i4(n) { + if (!n) + return false; + let e = n.previousElementSibling; + for (; e !== null; ) { + if (e instanceof HTMLLegendElement) + return false; + e = e.previousElementSibling; + } + return true; +} + +// ../../node_modules/@headlessui/react/dist/utils/form.js +init_cjs_shims(); +function p2(i6) { + var t7, r3; + let s7 = (t7 = i6 == null ? void 0 : i6.form) != null ? t7 : i6.closest("form"); + if (s7) { + for (let n of s7.elements) + if (n !== i6 && (n.tagName === "INPUT" && n.type === "submit" || n.tagName === "BUTTON" && n.type === "submit" || n.nodeName === "INPUT" && n.type === "image")) { + n.click(); + return; + } + (r3 = s7.requestSubmit) == null || r3.call(s7); + } +} + +// ../../node_modules/@headlessui/react/dist/internal/hidden.js +init_cjs_shims(); +var a2 = "div"; +var p3 = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(p3 || {}); +function s6(t7, o9) { + let { features: n = 1, ...e } = t7, d4 = { ref: o9, "aria-hidden": (n & 2) === 2 ? true : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(n & 4) === 4 && (n & 2) !== 2 && { display: "none" } } }; + return X({ ourProps: d4, theirProps: e, slot: {}, defaultTag: a2, name: "Hidden" }); +} +var c3 = D(s6); + +// ../../node_modules/@headlessui/react/dist/components/keyboard.js +init_cjs_shims(); +var o7 = ((r3) => (r3.Space = " ", r3.Enter = "Enter", r3.Escape = "Escape", r3.Backspace = "Backspace", r3.Delete = "Delete", r3.ArrowLeft = "ArrowLeft", r3.ArrowUp = "ArrowUp", r3.ArrowRight = "ArrowRight", r3.ArrowDown = "ArrowDown", r3.Home = "Home", r3.End = "End", r3.PageUp = "PageUp", r3.PageDown = "PageDown", r3.Tab = "Tab", r3))(o7 || {}); + +// ../../node_modules/@headlessui/react/dist/hooks/use-controllable.js +init_cjs_shims(); +var import_react9 = require("react"); +function T2(l5, r3, c5) { + let [i6, s7] = (0, import_react9.useState)(c5), e = l5 !== void 0, t7 = (0, import_react9.useRef)(e), u5 = (0, import_react9.useRef)(false), d4 = (0, import_react9.useRef)(false); + return e && !t7.current && !u5.current ? (u5.current = true, t7.current = e, console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")) : !e && t7.current && !d4.current && (d4.current = true, t7.current = e, console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")), [e ? l5 : i6, o4((n) => (e || s7(n), r3 == null ? void 0 : r3(n)))]; +} + +// ../../node_modules/@headlessui/react/dist/components/description/description.js +init_cjs_shims(); +var import_react10 = __toESM(require("react"), 1); +var d2 = (0, import_react10.createContext)(null); +function f2() { + let r3 = (0, import_react10.useContext)(d2); + if (r3 === null) { + let t7 = new Error("You used a component, but it is not inside a relevant parent."); + throw Error.captureStackTrace && Error.captureStackTrace(t7, f2), t7; + } + return r3; +} +function M() { + let [r3, t7] = (0, import_react10.useState)([]); + return [r3.length > 0 ? r3.join(" ") : void 0, (0, import_react10.useMemo)(() => function(e) { + let i6 = o4((s7) => (t7((o9) => [...o9, s7]), () => t7((o9) => { + let p4 = o9.slice(), c5 = p4.indexOf(s7); + return c5 !== -1 && p4.splice(c5, 1), p4; + }))), n = (0, import_react10.useMemo)(() => ({ register: i6, slot: e.slot, name: e.name, props: e.props }), [i6, e.slot, e.name, e.props]); + return import_react10.default.createElement(d2.Provider, { value: n }, e.children); + }, [t7])]; +} +var S2 = "p"; +function h2(r3, t7) { + let a3 = I(), { id: e = `headlessui-description-${a3}`, ...i6 } = r3, n = f2(), s7 = y(t7); + l(() => n.register(e), [e, n.register]); + let o9 = { ref: s7, ...n.props, id: e }; + return X({ ourProps: o9, theirProps: i6, slot: n.slot || {}, defaultTag: S2, name: n.name || "Description" }); +} +var y2 = D(h2); +var b2 = Object.assign(y2, {}); + +// ../../node_modules/@headlessui/react/dist/components/label/label.js +init_cjs_shims(); +var import_react11 = __toESM(require("react"), 1); +var d3 = (0, import_react11.createContext)(null); +function u4() { + let o9 = (0, import_react11.useContext)(d3); + if (o9 === null) { + let t7 = new Error("You used a