@velastack/patterns 0.0.49 → 0.0.51
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/chunks/write-result-I15cELAq.js +258 -0
- package/dist/chunks/{write-result-BmL8uLNd.js.map → write-result-I15cELAq.js.map} +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +68 -61
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/write-result-BmL8uLNd.js +0 -247
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { n as e, t } from "./logger-BpgCb-ZG.js";
|
|
2
|
+
import { existsSync as n, mkdirSync as r, readFileSync as i, rmSync as a, writeFileSync as o } from "node:fs";
|
|
3
|
+
import s from "node:path";
|
|
4
|
+
import { detect as c } from "package-manager-detector";
|
|
5
|
+
import { resolveCommand as l } from "package-manager-detector/commands";
|
|
6
|
+
import u from "cross-spawn";
|
|
7
|
+
//#region src/ui/components/auth-menu/auth-menu-content.svelte?raw
|
|
8
|
+
var d = "<script lang=\"ts\">\n import { cn } from '$lib/utils';\n import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\n import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';\n import { getContext } from 'svelte';\n import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\n\n let {\n children,\n class: className,\n ...restProps\n }: DropdownMenuPrimitive.ContentProps & {\n portalProps?: DropdownMenuPrimitive.PortalProps;\n } = $props();\n\n let { isDesktop } =\n getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\n<\/script>\n\n{#if isDesktop}\n <DropdownMenu.Content class={className} {...restProps}>\n {@render children?.()}\n </DropdownMenu.Content>\n{:else}\n <div class={cn('flex flex-col w-full', className)}>\n {@render children?.()}\n </div>\n{/if}\n", f = "<script lang=\"ts\">\n import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\n import { getContext } from 'svelte';\n import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\n let { isDesktop } =\n getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\n let { children, ...restProps } = $props();\n<\/script>\n\n{#if isDesktop}\n <DropdownMenu.Group {...restProps}>\n {@render children?.()}\n </DropdownMenu.Group>\n{:else}\n {@render children?.()}\n{/if}\n", p = "<script lang=\"ts\">\n import { goto } from '$app/navigation';\n import * as DropdownMenu from '$lib/components/ui/dropdown-menu';\n import { Button } from '$lib/components/ui/button';\n import { getContext } from 'svelte';\n import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\n let { children, href = undefined, ...restProps } = $props();\n\n const { isDesktop } =\n getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\n\n const handleClick = () => {\n if (restProps.onclick) {\n restProps.onclick();\n } else {\n if (href) {\n goto(href);\n }\n }\n };\n<\/script>\n\n{#if isDesktop}\n <DropdownMenu.Item {...restProps} onclick={handleClick}>\n {@render children?.()}\n </DropdownMenu.Item>\n{:else}\n <Button\n class=\"w-full justify-start md:justify-center md:w-auto\"\n variant=\"ghost\"\n {href}\n {...restProps}\n >\n {@render children?.()}\n </Button>\n{/if}\n", m = "<script lang=\"ts\">\n import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\n import { getContext } from 'svelte';\n import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\n const { isDesktop } =\n getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\n let { children, ...restProps } = $props();\n<\/script>\n\n{#if isDesktop}\n <DropdownMenu.Label {...restProps}>\n {@render children?.()}\n </DropdownMenu.Label>\n{/if}\n", h = "<script lang=\"ts\">\n import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\n import { getContext } from 'svelte';\n import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\n const { isDesktop } =\n getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\n let restProps = $props();\n<\/script>\n\n{#if isDesktop}\n <DropdownMenu.Separator {...restProps} />\n{/if}\n", ee = "<script lang=\"ts\">\n import { cn } from '$lib/utils';\n import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\n import { getContext } from 'svelte';\n import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\n let { class: className = '', ...restProps } = $props();\n\n const { isDesktop } =\n getContext<AuthMenuContext>(AUTH_MENU_CONTEXT_KEY) ?? ({ isDesktop: false } as AuthMenuContext);\n<\/script>\n\n{#if isDesktop}\n <DropdownMenu.Trigger class={cn('inline-flex', className)} {...restProps} />\n{/if}\n", te = "<script lang=\"ts\">\n import { page } from '$app/state';\n import { browser } from '$app/environment';\n import { onMount, setContext } from 'svelte';\n import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';\n import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';\n\n let { user, guest } = $props();\n\n const breakpoint = 768;\n const breakpointQuery = `(min-width: ${breakpoint}px)`;\n\n let hasMounted = $state(false);\n let authMenuContext = $state<AuthMenuContext>({ isDesktop: true });\n\n setContext(AUTH_MENU_CONTEXT_KEY, authMenuContext);\n\n function updateIsDesktop() {\n if (!browser) return;\n authMenuContext.isDesktop = window.matchMedia(breakpointQuery).matches;\n }\n\n onMount(() => {\n updateIsDesktop();\n hasMounted = true;\n const mq = window.matchMedia(breakpointQuery);\n const listener = () => (authMenuContext.isDesktop = mq.matches);\n mq.addEventListener('change', listener);\n return () => mq.removeEventListener('change', listener);\n });\n<\/script>\n\n{#if page.data.user}\n {#if authMenuContext.isDesktop}\n <DropdownMenu.Root>\n {@render user?.()}\n </DropdownMenu.Root>\n {:else}\n <!-- This prevents the menu from being rendered twice before we know if we're on desktop or not -->\n {#if hasMounted}\n {@render user?.()}\n {/if}\n {/if}\n{:else}\n {@render guest?.()}\n{/if}\n", g = "export type AuthMenuContext = {\n isDesktop: boolean;\n};\n\nexport const AUTH_MENU_CONTEXT_KEY = Symbol(\"auth-menu-context\");\n", _ = "import Root from \"./auth-menu.svelte\";\nimport Content from \"./auth-menu-content.svelte\";\nimport Trigger from \"./auth-menu-trigger.svelte\";\nimport Group from \"./auth-menu-group.svelte\";\nimport Label from \"./auth-menu-label.svelte\";\nimport Separator from \"./auth-menu-separator.svelte\";\nimport Item from \"./auth-menu-item.svelte\";\n\nexport { Root, Content, Trigger, Group, Label, Separator, Item };\n", ne = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {#if value}\n {new Date(value).toLocaleDateString()}\n {/if}\n</div>\n", re = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: { value: boolean | undefined } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {value ? 'Yes' : 'No'}\n</div>\n", ie = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {#if value}\n {new Date(value).toLocaleDateString()}\n {/if}\n</div>\n", ae = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {value}\n</div>\n", oe = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {value}\n</div>\n", se = "<script lang=\"ts\">\n import FileIcon from '@lucide/svelte/icons/file';\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n collectionId,\n id,\n class: className,\n ...restProps\n }: {\n value: string[] | string | undefined;\n collectionId: string;\n id: string;\n } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {#if value}\n {#if Array.isArray(value)}\n {#each value.slice(0, 2) as filename}\n {#if ['.jpg', '.png', '.jpeg', '.webp', '.gif'].some((ext) => filename.endsWith(ext))}\n <img\n src=\"/api/files/{collectionId}/{id}/{filename}\"\n class=\"w-8 h-8 rounded-sm object-cover inline-block mr-2\"\n alt={filename}\n title={filename}\n />\n {:else}\n <div\n class=\"inline-flex items-center justify-center w-8 h-8 bg-muted rounded-sm mr-2\"\n title={filename}\n >\n <FileIcon class=\"w-4 h-4\" />\n </div>\n {/if}\n {/each}\n {#if value.length > 2}\n and {value.length - 2} more files\n {/if}\n {:else if ['.jpg', '.png', '.jpeg', '.webp', '.gif'].some((ext) => value.endsWith(ext))}\n <img\n src=\"/api/files/{collectionId}/{id}/{value}\"\n class=\"w-8 h-8 rounded-sm object-cover\"\n alt={value}\n title={value}\n />\n {:else}\n <div\n class=\"inline-flex items-center justify-center w-8 h-8 bg-muted rounded-sm\"\n title={value}\n >\n <FileIcon class=\"w-4 h-4\" />\n </div>\n {/if}\n {/if}\n</div>\n", v = "<script lang=\"ts\">\n import MapPinIcon from '@lucide/svelte/icons/map-pin';\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: {\n value: { lat: number; lon: number } | undefined;\n } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center space-x-1', className)} {...restProps}>\n {#if value}\n <MapPinIcon class=\"inline-block w-4 h-4 text-muted-foreground\" />\n <span>{value.lat.toFixed(6)}, {value.lon.toFixed(6)}</span>\n {/if}\n</div>\n", y = "export { default as AutodateCell } from \"./autodate.svelte\";\nexport { default as BoolCell } from \"./bool.svelte\";\nexport { default as DateCell } from \"./date.svelte\";\nexport { default as EditorCell } from \"./editor.svelte\";\nexport { default as EmailCell } from \"./email.svelte\";\nexport { default as FileCell } from \"./file.svelte\";\nexport { default as GeoPointCell } from \"./geoPoint.svelte\";\nexport { default as JsonCell } from \"./json.svelte\";\nexport { default as NumberCell } from \"./number.svelte\";\nexport { default as PasswordCell } from \"./password.svelte\";\nexport { default as RelationCell } from \"./relation.svelte\";\nexport { default as SelectCell } from \"./select.svelte\";\nexport { default as TextCell } from \"./text.svelte\";\nexport { default as UrlCell } from \"./url.svelte\";\n", b = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: { value: any } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {#if value !== undefined}\n {JSON.stringify(value)}\n {/if}\n</div>\n", x = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: { value: number | undefined } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {value}\n</div>\n", S = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>********</div>\n", C = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { Badge } from '$lib/components/ui/badge';\n import { cn } from '$lib/utils';\n\n let {\n value,\n expanded,\n displayField = 'id',\n class: className,\n ...restProps\n }: {\n value: string[] | string | undefined;\n expanded: any;\n displayField?: string;\n } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {#if expanded}\n {#if Array.isArray(expanded)}\n {#each expanded.slice(0, 2) as item}\n <Badge variant=\"outline\" class=\"mr-1\">\n {item[displayField]}\n </Badge>\n {/each}\n {#if expanded.length > 2}\n <Badge variant=\"secondary\" class=\"mr-1\">\n +{expanded.length - 2}\n </Badge>\n {/if}\n {:else}\n <Badge variant=\"outline\" class=\"mr-1\">\n {expanded[displayField]}\n </Badge>\n {/if}\n {/if}\n</div>\n", w = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { Badge } from '$lib/components/ui/badge';\n import { cn } from '$lib/utils';\n\n let {\n value,\n options,\n class: className,\n ...restProps\n }: {\n value: string[] | string | undefined;\n options: Record<string, { label: string; value: string }>;\n } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {#if value}\n {#if Array.isArray(value)}\n {#each value.slice(0, 2) as item}\n <Badge variant=\"outline\" class=\"mr-1\">\n {options[item].label}\n </Badge>\n {/each}\n {:else}\n {options[value].label}\n {/if}\n {/if}\n</div>\n", T = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n ...restProps\n }: { value: string | undefined } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {value}\n</div>\n", E = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import { cn } from '$lib/utils';\n\n let {\n value,\n class: className,\n target = '_blank',\n rel = 'noopener noreferrer',\n ...restProps\n }: {\n value: string | undefined;\n target?: string;\n rel?: string;\n } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n<div class={cn('flex items-center', className)} {...restProps}>\n {#if value}\n <a href={value} {target} {rel}>{value}</a>\n {/if}\n</div>\n", D = "<script lang=\"ts\">\n import type { HTMLAttributes } from 'svelte/elements';\n import type { Column } from '@tanstack/table-core';\n import * as DropdownMenu from '$lib/components/ui/dropdown-menu';\n import { Button } from '$lib/components/ui/button';\n import ArrowUpIcon from '@lucide/svelte/icons/arrow-up';\n import ArrowDownIcon from '@lucide/svelte/icons/arrow-down';\n import ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';\n import { cn } from '$lib/utils';\n\n let {\n column,\n title,\n class: className,\n ...restProps\n }: { column: Column<any>; title: string } & HTMLAttributes<HTMLDivElement> = $props();\n<\/script>\n\n{#if !column?.getCanSort()}\n <div class={className} {...restProps}>\n {title}\n </div>\n{:else}\n <div class={cn('flex items-center', className)} {...restProps}>\n <DropdownMenu.Root>\n <DropdownMenu.Trigger>\n {#snippet child({ props })}\n <Button\n {...props}\n variant=\"ghost\"\n size=\"sm\"\n class=\"data-[state=open]:bg-accent -ml-3 h-8\"\n >\n <span>\n {title}\n </span>\n {#if column.getIsSorted() === 'desc'}\n <ArrowDownIcon />\n {:else if column.getIsSorted() === 'asc'}\n <ArrowUpIcon />\n {:else}\n <ChevronsUpDownIcon />\n {/if}\n </Button>\n {/snippet}\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"start\">\n <DropdownMenu.Item onclick={() => column.toggleSorting(false)}>\n <ArrowUpIcon class=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenu.Item>\n <DropdownMenu.Item onclick={() => column.toggleSorting(true)}>\n <ArrowDownIcon class=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </div>\n{/if}\n", O = "export { default as ColumnHeader } from \"./column-header.svelte\";\n", k = "<script lang=\"ts\" generics=\"TData, TValue\">\n import type { Component } from 'svelte';\n import { SvelteSet } from 'svelte/reactivity';\n import type { Column } from '@tanstack/table-core';\n import CirclePlusIcon from '@lucide/svelte/icons/circle-plus';\n import CheckIcon from '@lucide/svelte/icons/check';\n import * as Command from '$lib/components/ui/command';\n import * as Popover from '$lib/components/ui/popover';\n import { Button } from '$lib/components/ui/button';\n import { Separator } from '$lib/components/ui/separator';\n import { Badge } from '$lib/components/ui/badge';\n import { cn } from '$lib/utils';\n\n let {\n column,\n title,\n options\n }: {\n column: Column<TData, TValue>;\n title: string;\n options: {\n label: string;\n value: string;\n icon?: Component;\n }[];\n } = $props();\n\n const facets = $derived(column?.getFacetedUniqueValues());\n const selectedValues = $derived(new SvelteSet(column?.getFilterValue() as string[]));\n<\/script>\n\n<Popover.Root>\n <Popover.Trigger>\n {#snippet child({ props })}\n <Button {...props} variant=\"outline\" size=\"sm\" class=\"h-8 border-dashed\">\n <CirclePlusIcon />\n {title}\n {#if selectedValues.size > 0}\n <Separator orientation=\"vertical\" class=\"mx-2 h-4\" />\n <Badge variant=\"secondary\" class=\"rounded-sm px-1 font-normal lg:hidden\">\n {selectedValues.size}\n </Badge>\n <div class=\"hidden space-x-1 lg:flex\">\n {#if selectedValues.size > 2}\n <Badge variant=\"secondary\" class=\"rounded-sm px-1 font-normal\">\n {selectedValues.size} selected\n </Badge>\n {:else}\n {#each options.filter((opt) => selectedValues.has(opt.value)) as option (option)}\n <Badge variant=\"secondary\" class=\"rounded-sm px-1 font-normal\">\n {option.label}\n </Badge>\n {/each}\n {/if}\n </div>\n {/if}\n </Button>\n {/snippet}\n </Popover.Trigger>\n <Popover.Content class=\"w-[200px] p-0\" align=\"start\">\n <Command.Root>\n <Command.Input placeholder={title} />\n <Command.List>\n <Command.Empty>No results found.</Command.Empty>\n <Command.Group>\n {#each options as option (option)}\n {@const isSelected = selectedValues.has(option.value)}\n <Command.Item\n onSelect={() => {\n if (isSelected) {\n selectedValues.delete(option.value);\n } else {\n selectedValues.add(option.value);\n }\n const filterValues = Array.from(selectedValues);\n column?.setFilterValue(filterValues.length ? filterValues : undefined);\n }}\n >\n <div\n class={cn(\n 'border-primary mr-2 flex size-4 items-center justify-center rounded-sm border',\n isSelected ? 'bg-primary text-primary-foreground' : 'opacity-50 [&_svg]:invisible'\n )}\n >\n <CheckIcon class=\"size-4\" />\n </div>\n {#if option.icon}\n {@const Icon = option.icon}\n <Icon class=\"text-muted-foreground\" />\n {/if}\n\n <span>{option.label}</span>\n {#if facets?.get(option.value)}\n <span class=\"ml-auto flex size-4 items-center justify-center font-mono text-xs\">\n {facets.get(option.value)}\n </span>\n {/if}\n </Command.Item>\n {/each}\n </Command.Group>\n {#if selectedValues.size > 0}\n <Command.Separator />\n <Command.Group>\n <Command.Item\n onSelect={() => column?.setFilterValue(undefined)}\n class=\"justify-center text-center\"\n >\n Clear filters\n </Command.Item>\n </Command.Group>\n {/if}\n </Command.List>\n </Command.Root>\n </Popover.Content>\n</Popover.Root>\n", A = "export { default as FacetedFilter } from \"./faceted-filter.svelte\";\n", j = "<script lang=\"ts\" generics=\"T extends Record<string, unknown>, U extends FormPath<T>\">\n import * as FormPrimitive from 'formsnap';\n import type { FormPath } from 'sveltekit-superforms';\n import { cn, type WithElementRef, type WithoutChildren } from '$lib/utils';\n import type { HTMLAttributes } from 'svelte/elements';\n import { setContext } from 'svelte';\n\n let {\n ref = $bindable(null),\n class: className,\n form,\n name,\n children: childrenProp,\n ...restProps\n }: FormPrimitive.FieldProps<T, U> &\n WithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> = $props();\n\n setContext('file-field', {\n get form() {\n return form;\n },\n get name() {\n return name;\n }\n });\n<\/script>\n\n<FormPrimitive.Field {form} {name}>\n {#snippet children({ constraints, errors, tainted, value })}\n <div bind:this={ref} data-slot=\"form-item\" class={cn('space-y-2', className)} {...restProps}>\n {@render childrenProp?.({ constraints, errors, tainted, value: value as T[U] })}\n </div>\n {/snippet}\n</FormPrimitive.Field>\n", M = "<script lang=\"ts\">\n import { getContext } from 'svelte';\n import { fileProxy, filesProxy, type SuperForm } from 'sveltekit-superforms';\n import { Input } from '$lib/components/ui/input';\n\n const ctx = getContext<{ form: SuperForm<any, any>; name: string }>('file-field');\n const { multiple } = getContext<{ multiple: boolean }>('file-field-multiple');\n\n const files = multiple ? filesProxy(ctx.form, `${ctx.name}+`) : fileProxy(ctx.form, ctx.name);\n const { form: formData, reset } = ctx.form;\n\n const { ...props } = $props();\n\n const onchange = () => {\n reset({\n data: $formData\n });\n };\n<\/script>\n\n{#if !multiple}\n {#if $formData[ctx.name]}\n {#if typeof $formData[ctx.name] === 'string'}\n <input type=\"text\" name={ctx.name} value={$formData[ctx.name]} class=\"hidden\" />\n {:else}\n <input type=\"file\" name={ctx.name} files={$files} class=\"hidden\" />\n {/if}\n {:else}\n <input type=\"text\" name={ctx.name} value=\"\" class=\"hidden\" />\n {/if}\n{/if}\n\n<Input\n type=\"file\"\n bind:files={$files}\n {multiple}\n {onchange}\n {...props}\n name={multiple ? `${ctx.name}+` : ''}\n/>\n", N = "<script lang=\"ts\">\n import { setContext, getContext } from 'svelte';\n import { type SuperForm } from 'sveltekit-superforms';\n import { getName } from './shared';\n\n const ctx = getContext<{ form: SuperForm<any, any>; name: string }>('file-field');\n const {\n display,\n input\n }: {\n display: (props: {\n file: File | string;\n filename: string;\n onremove: (file: File | string) => void;\n }) => any;\n input: () => any;\n } = $props();\n\n setContext('file-field-multiple', { multiple: true });\n\n const { form: formData, reset } = ctx.form;\n\n let removed = $state<string[]>([]);\n\n const onremove = (file: File | string) => {\n if (typeof file === 'string') {\n removed.push(file);\n } else {\n if (Array.isArray($formData[`${ctx.name}+`])) {\n reset({\n data: {\n ...$formData,\n [`${ctx.name}+`]: $formData[`${ctx.name}+`].filter((f: File | string) => f !== file) as\n | File[]\n | undefined\n }\n });\n }\n }\n };\n\n const initialFiles = $formData[ctx.name] || [];\n<\/script>\n\n{#if initialFiles}\n {#each initialFiles as file}\n {#if !removed.includes(file)}\n {@render display({ file, filename: getName(file), onremove })}\n {/if}\n {/each}\n{/if}\n\n{#each $formData[`${ctx.name}+`] as file}\n {#if file && typeof file !== 'string'}\n {@render display({ file, filename: getName(file), onremove })}\n {/if}\n{/each}\n\n{#each removed as removedFile}\n <input type=\"text\" name={`${ctx.name}-`} value={removedFile} class=\"hidden\" />\n{/each}\n\n{@render input()}\n", P = "<script lang=\"ts\">\n import { setContext, getContext } from 'svelte';\n import { type SuperForm } from 'sveltekit-superforms';\n import { getName } from './shared';\n\n const ctx = getContext<{ form: SuperForm<any, any>; name: string }>('file-field');\n const {\n display,\n input\n }: {\n display: (props: {\n file: File | string;\n filename: string;\n onremove: (file: File | string) => void;\n }) => any;\n input: () => any;\n } = $props();\n\n const { form: formData, reset } = ctx.form;\n\n setContext('file-field-multiple', { multiple: false });\n\n const onremove = () => {\n reset({\n data: {\n ...$formData,\n [ctx.name]: ''\n }\n });\n };\n<\/script>\n\n{#if $formData[ctx.name]}\n {@render display({ file: $formData[ctx.name], filename: getName($formData[ctx.name]), onremove })}\n{/if}\n\n{@render input()}\n", F = "<script lang=\"ts\">\n import { getContext } from 'svelte';\n import { type SuperForm } from 'sveltekit-superforms';\n import FileIcon from '@lucide/svelte/icons/file';\n import ImageIcon from '@lucide/svelte/icons/image';\n import { cn } from '$lib/utils';\n import type { HTMLAttributes } from 'svelte/elements';\n\n const ctx = getContext<{ form: SuperForm<any, any>; name: string }>('file-field');\n const { form: formData } = ctx.form;\n\n const {\n file,\n filename,\n collectionId,\n id,\n thumb = '50x50',\n class: className,\n type = 'image',\n ...props\n }: {\n file: File | string;\n filename: string;\n collectionId?: string;\n id?: string;\n thumb?: string;\n class?: string;\n type?: 'image' | 'file';\n } & HTMLAttributes<HTMLImageElement> = $props();\n\n const isImage = $derived(\n type === 'image' ||\n filename.toLowerCase().endsWith('.png') ||\n filename.toLowerCase().endsWith('.jpg') ||\n filename.toLowerCase().endsWith('.jpeg') ||\n filename.toLowerCase().endsWith('.gif') ||\n filename.toLowerCase().endsWith('.webp')\n );\n\n function getUrl(file: string) {\n return `/api/files/${collectionId ?? $formData.collectionId}/${id ?? $formData.id}/${file}?thumb=${thumb}`;\n }\n<\/script>\n\n{#if typeof file === 'string'}\n {#if (id ?? $formData.collectionId) && (id ?? $formData.id) && isImage}\n <img src={getUrl(file)} alt={filename} class={className} {...props} />\n {:else}\n <div\n class={cn('flex items-center justify-center w-full h-full bg-muted rounded-md', className)}\n {...props as HTMLAttributes<HTMLDivElement>}\n >\n {#if isImage}\n <ImageIcon class=\"w-4 h-4\" />\n {:else}\n <FileIcon class=\"w-4 h-4\" />\n {/if}\n </div>\n {/if}\n{:else if isImage}\n <img src={URL.createObjectURL(file)} alt={filename} class={className} {...props} />\n{:else}\n <div\n class={cn('flex items-center justify-center w-full h-full bg-muted rounded-md', className)}\n {...props as HTMLAttributes<HTMLDivElement>}\n >\n <FileIcon class=\"w-4 h-4\" />\n </div>\n{/if}\n", I = "export { default as Field } from \"./file-field.svelte\";\nexport { default as Single } from \"./file-single.svelte\";\nexport { default as Multiple } from \"./file-multiple.svelte\";\nexport { default as Input } from \"./file-input.svelte\";\nexport { default as Thumb } from \"./file-thumb.svelte\";\n", L = "export function getUrl(\n file: File | string,\n collectionId: string,\n recordId: string,\n thumb: string,\n) {\n return typeof file === \"string\"\n ? `/api/files/${collectionId}/${recordId}/${file}?thumb=${thumb}`\n : URL.createObjectURL(file);\n}\n\nexport function getName(file: File | string) {\n return typeof file === \"string\" ? (file.split(\"/\").pop() ?? \"\") : file.name;\n}\n", R = "<script lang=\"ts\">\n import { cn } from '$lib/utils';\n\n let {\n value = $bindable(),\n id,\n label,\n shortLabel,\n mapOpen\n }: {\n value: number;\n id: string;\n label: string;\n shortLabel: string;\n mapOpen: boolean;\n } = $props();\n<\/script>\n\n<div\n class={cn(\n 'border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n 'pr-0 flex items-center',\n label === 'Latitude' && 'rounded-r-none',\n label === 'Longitude' && 'rounded-none -ml-px',\n mapOpen && 'rounded-b-none'\n )}\n>\n <label for={id} class=\"text-muted-foreground mr-2\">\n <span class=\"hidden md:block\">{label}</span>\n <span class=\"block md:hidden\">{shortLabel}</span>\n </label>\n\n <input\n bind:value\n type=\"number\"\n class=\"border-none outline-none min-w-0 w-full pr-2\"\n {id}\n step=\"0.000001\"\n />\n</div>\n", z = "export { default as GeopointInput } from \"./input.svelte\";\n", B = "<script lang=\"ts\">\n import { setContext } from 'svelte';\n import ToggleMap from './toggle-map.svelte';\n import Coordinate from './coordinate.svelte';\n\n let {\n name,\n value = $bindable()\n }: {\n name: string;\n value: string | undefined;\n } = $props();\n\n const geopoint = $state(value ? JSON.parse(value) : { lat: 0, lon: 0 });\n const map = $state({ open: false });\n\n setContext('geopoint', {\n geopoint,\n map\n });\n\n $effect(() => {\n if (value) {\n const parsed = JSON.parse(value);\n\n if (typeof parsed === 'object' && parsed !== null && 'lat' in parsed && 'lon' in parsed) {\n geopoint.lat = parsed.lat.toFixed(6);\n geopoint.lon = parsed.lon.toFixed(6);\n }\n }\n });\n\n const stringValue = $derived(\n JSON.stringify({ lat: parseFloat(geopoint.lat), lon: parseFloat(geopoint.lon) })\n );\n<\/script>\n\n<input type=\"hidden\" {name} value={stringValue} />\n\n<div class=\"w-full\">\n <div class=\"w-full flex\">\n <Coordinate\n id=\"latitude\"\n label=\"Latitude\"\n shortLabel=\"Lat\"\n bind:value={geopoint.lat}\n mapOpen={map.open}\n />\n <Coordinate\n id=\"longitude\"\n label=\"Longitude\"\n shortLabel=\"Lon\"\n bind:value={geopoint.lon}\n mapOpen={map.open}\n />\n <ToggleMap />\n </div>\n\n {#if map.open}\n {#await import('$lib/components/ui/leaflet/leaflet.svelte')}\n <div class=\"h-[225px] w-full bg-input rounded-b-md\"></div>\n {:then { default: Leaflet }}\n <Leaflet height={225} point={geopoint} class=\"rounded-b-md overflow-hidden\" />\n {/await}\n {/if}\n</div>\n", V = "<script>\n import { Button } from '$lib/components/ui/button';\n import MapIcon from '@lucide/svelte/icons/map';\n import { getContext } from 'svelte';\n import { cn } from '$lib/utils';\n\n let { map } = getContext('geopoint');\n<\/script>\n\n<Button\n variant=\"outline\"\n size=\"icon\"\n class={cn('w-10 rounded-none rounded-r-md border-l-0', map.open && 'rounded-b-none')}\n onclick={() => (map.open = !map.open)}\n>\n <MapIcon class=\"w-4 h-4\" />\n</Button>\n", H = "export { default as Leaflet } from \"./leaflet.svelte\";\n", U = "<script lang=\"ts\">\n import { onMount } from 'svelte';\n import L from 'leaflet';\n import 'leaflet/dist/leaflet.css';\n\n // manually load the markers so that they can be embedded in the prod bundle\n import markerIconUrl from 'leaflet/dist/images/marker-icon.png';\n import markerIconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';\n import markerShadowUrl from 'leaflet/dist/images/marker-shadow.png';\n\n let { height = 225, point = $bindable(), readonly = false, ...props } = $props();\n\n let map: L.Map;\n let mapEl: HTMLElement;\n let marker: L.Marker;\n let panTimeoutId: ReturnType<typeof setTimeout>;\n\n const defaultZoomLevel = 8;\n\n $effect(() => {\n if (point.lat && point.lon) {\n panInside();\n }\n });\n\n function normalizeCoordinate(coord: any) {\n return +(+coord).toFixed(6);\n }\n\n function panInside(debounce = 200) {\n clearTimeout(panTimeoutId);\n panTimeoutId = setTimeout(() => {\n marker?.setLatLng([point.lat, point.lon]);\n map?.panInside([point.lat, point.lon], { padding: [20, 40] });\n }, debounce);\n }\n\n function initMap() {\n const latlon = [\n normalizeCoordinate(point.lat),\n normalizeCoordinate(point.lon)\n ] as L.LatLngTuple;\n\n map = L.map(mapEl, {\n zoomControl: false,\n maxBounds: [\n [-90, -180],\n [90, 180]\n ],\n minZoom: 2\n }).setView(latlon, defaultZoomLevel);\n\n if (readonly) {\n map.dragging.disable();\n map.touchZoom.disable();\n map.doubleClickZoom.disable();\n map.scrollWheelZoom.disable();\n map.boxZoom.disable();\n map.keyboard.disable();\n }\n\n L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '© <a href=\"https://www.openstreetmap.org/copyright\">OSM</a>',\n noWrap: true\n }).addTo(map);\n\n map.attributionControl.setPrefix('');\n\n // reassign the default marker images with the loaded ones\n // (https://leafletjs.com/reference.html#icon-default-option)\n L.Icon.Default.prototype.options.iconUrl = markerIconUrl;\n L.Icon.Default.prototype.options.iconRetinaUrl = markerIconRetinaUrl;\n L.Icon.Default.prototype.options.shadowUrl = markerShadowUrl;\n L.Icon.Default.imagePath = '';\n\n marker = L.marker(latlon, {\n draggable: true,\n autoPan: true\n }).addTo(map);\n\n marker.bindTooltip('drag or right click anywhere on the map to move');\n\n marker.on('moveend', (e) => {\n if (e.sourceTarget?._latlng) {\n select(e.sourceTarget._latlng.lat, e.sourceTarget._latlng.lng, false);\n }\n });\n\n map.on('contextmenu', (e) => {\n select(e.latlng.lat, e.latlng.lng, false);\n });\n }\n\n function destroyMap() {\n marker?.remove();\n map?.remove();\n }\n\n function select(lat: number, lon: number, centerMap = true) {\n point.lat = normalizeCoordinate(lat);\n point.lon = normalizeCoordinate(lon);\n\n // center the map\n if (centerMap) {\n marker?.setLatLng([point.lat, point.lon]); // optimistic marker update\n map?.panTo([point.lat, point.lon], { animate: false });\n }\n }\n\n onMount(() => {\n initMap();\n\n return () => {\n destroyMap();\n };\n });\n<\/script>\n\n<div class=\"map-wrapper\" style=\"{height ? `height:${height}px` : null};\" {...props}>\n <div bind:this={mapEl} class=\"map-box\"></div>\n</div>\n\n<style>\n .map-wrapper {\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n }\n .map-box {\n z-index: 1;\n height: 100%;\n width: 100%;\n }\n</style>\n", W = "<script lang=\"ts\">\n import type { Snippet } from 'svelte';\n import { cn } from '$lib/utils';\n\n let { children, class: className }: { children: Snippet; class?: string } = $props();\n<\/script>\n\n<span class={cn('bg-secondary text-secondary-foreground px-2 py-1 rounded-sm text-sm', className)}>\n {@render children?.()}\n</span>\n", ce = "<script lang=\"ts\">\n import { Popover as PopoverPrimitive } from 'bits-ui';\n import * as Popover from '$lib/components/ui/popover';\n\n let {\n children,\n ...props\n }: PopoverPrimitive.ContentProps & {\n portalProps?: PopoverPrimitive.PortalProps;\n } = $props();\n<\/script>\n\n<Popover.Content {...props}>\n {@render children?.()}\n</Popover.Content>\n", G = "<script lang=\"ts\" generics=\"T extends Record<string, unknown>, U extends FormPath<T>\">\n import * as FormPrimitive from 'formsnap';\n import type { FormPath } from 'sveltekit-superforms';\n import { cn, type WithElementRef, type WithoutChildren } from '$lib/utils';\n import type { HTMLAttributes } from 'svelte/elements';\n import { setContext } from 'svelte';\n import * as Popover from '$lib/components/ui/popover';\n\n let {\n ref = $bindable(null),\n class: className,\n type,\n form,\n name,\n required,\n children: childrenProp,\n ...restProps\n }: FormPrimitive.FieldProps<T, U> & {\n type: 'multiple' | 'single';\n required?: boolean;\n } & WithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> = $props();\n\n const { form: formData } = form;\n\n const toggleSelected = (value: string) => {\n if (type === 'single') {\n if (!required && $formData[name] === value) {\n $formData[name] = undefined as T[U];\n } else {\n $formData[name] = value as T[U];\n }\n } else if (type === 'multiple') {\n if (!$formData[name]) {\n $formData[name] = [] as T[U];\n }\n\n const currentValue = $formData[name] as string[];\n const index = currentValue.indexOf(value);\n\n if (index > -1) {\n $formData[name] = currentValue.filter((id) => id !== value) as T[U];\n } else {\n $formData[name] = [...currentValue, value] as T[U];\n }\n }\n };\n\n const isSelected = (value: string) => {\n if (type === 'single') {\n return $formData[name] === value;\n } else if (type === 'multiple') {\n return ($formData[name] as string[])?.includes(value) ?? false;\n }\n };\n\n setContext('multiselect-field', {\n form,\n name,\n type,\n toggleSelected,\n isSelected\n });\n<\/script>\n\n<Popover.Root>\n <FormPrimitive.Field {form} {name}>\n {#snippet children({ constraints, errors, tainted, value })}\n <div bind:this={ref} data-slot=\"form-item\" class={cn('space-y-2', className)} {...restProps}>\n {@render childrenProp?.({ constraints, errors, tainted, value: value as T[U] })}\n </div>\n {/snippet}\n </FormPrimitive.Field>\n</Popover.Root>\n", le = "export { default as Field } from \"./field.svelte\";\nexport { default as Trigger } from \"./trigger.svelte\";\nexport { default as Input } from \"./input.svelte\";\nexport { default as Content } from \"./content.svelte\";\nexport { default as Item } from \"./item.svelte\";\nexport { default as Chip } from \"./chip.svelte\";\n", ue = "<script lang=\"ts\" generics=\"T extends string\">\n import type { SuperForm } from 'sveltekit-superforms';\n import { getContext, type Snippet } from 'svelte';\n\n const { form, type } = getContext<{ form: SuperForm<any, any>; type: 'single' | 'multiple' }>(\n 'multiselect-field'\n );\n const { form: formData } = form;\n\n let {\n children,\n placeholder,\n name,\n value = $bindable()\n }: {\n children: Snippet<[{ selected: T[] }]>;\n placeholder?: string;\n name: string;\n value: T[] | T | undefined;\n } = $props();\n<\/script>\n\n{#if value && value.length > 0}\n {@render children?.({ selected: type === 'single' ? [$formData[name]] : $formData[name] })}\n {#if type === 'multiple'}\n {#each value as v}\n <input type=\"hidden\" {name} value={v} />\n {/each}\n {:else}\n <input type=\"hidden\" {name} {value} />\n {/if}\n{:else}\n {placeholder}\n{/if}\n", de = "<script lang=\"ts\">\n import { getContext, type Snippet } from 'svelte';\n import { cn } from '$lib/utils';\n import { Command as CommandPrimitive } from 'bits-ui';\n import * as Command from '$lib/components/ui/command';\n import CheckIcon from '@lucide/svelte/icons/check';\n\n let {\n children,\n value,\n label,\n class: className,\n ...props\n }: CommandPrimitive.ItemProps & {\n value: string;\n label: string | undefined;\n children?: Snippet;\n class?: string;\n } = $props();\n\n const { toggleSelected, isSelected } = getContext<{\n toggleSelected: (value: string) => void;\n isSelected: (value: string) => boolean;\n }>('multiselect-field');\n\n const handleSelect = () => {\n toggleSelected(value);\n };\n<\/script>\n\n<Command.Item\n class={cn('cursor-pointer', className)}\n {...props}\n value={label}\n onSelect={handleSelect}\n>\n {label}\n <CheckIcon class={cn('ml-auto', !isSelected(value) && 'text-transparent')} />\n</Command.Item>\n", fe = "<script lang=\"ts\">\n import * as Popover from '$lib/components/ui/popover';\n import { Popover as PopoverPrimitive } from 'bits-ui';\n import { cn } from '$lib/utils';\n import { buttonVariants } from '$lib/components/ui/button';\n import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';\n\n let { children, class: className, ...props }: PopoverPrimitive.TriggerProps = $props();\n<\/script>\n\n<Popover.Trigger\n class={cn(buttonVariants({ variant: 'outline' }), className)}\n role=\"combobox\"\n {...props}\n>\n {@render children?.()}\n <ChevronDownIcon class=\"size-4 opacity-50\" />\n</Popover.Trigger>\n", pe = "export { default as Pagination } from \"./pagination.svelte\";\n", me = "<script lang=\"ts\">\n import * as Select from '$lib/components/ui/select';\n import { Button } from '$lib/components/ui/button';\n import ChevronsLeftIcon from '@lucide/svelte/icons/chevrons-left';\n import ChevronLeftIcon from '@lucide/svelte/icons/chevron-left';\n import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';\n import ChevronsRightIcon from '@lucide/svelte/icons/chevrons-right';\n import type { Table as TableType } from '@tanstack/table-core';\n\n let { table }: { table: TableType<any> } = $props();\n<\/script>\n\n<div class=\"flex items-center justify-between px-2\">\n <div class=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of\n {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div class=\"flex items-center space-x-6 lg:space-x-8\">\n <div class=\"flex items-center space-x-2\">\n <p class=\"text-sm font-medium\">Rows per page</p>\n <Select.Root\n allowDeselect={false}\n type=\"single\"\n value={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <Select.Trigger class=\"h-8 w-[70px]\">\n {String(table.getState().pagination.pageSize)}\n </Select.Trigger>\n <Select.Content side=\"top\">\n {#each [10, 20, 30, 40, 50] as pageSize (pageSize)}\n <Select.Item value={`${pageSize}`}>\n {pageSize}\n </Select.Item>\n {/each}\n </Select.Content>\n </Select.Root>\n </div>\n <div class=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of\n {table.getPageCount()}\n </div>\n <div class=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n class=\"hidden size-8 p-0 lg:flex\"\n onclick={() => table.setPageIndex(0)}\n disabled={!table.getCanPreviousPage()}\n >\n <span class=\"sr-only\">Go to first page</span>\n <ChevronsLeftIcon />\n </Button>\n <Button\n variant=\"outline\"\n class=\"size-8 p-0\"\n onclick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n >\n <span class=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon />\n </Button>\n <Button\n variant=\"outline\"\n class=\"size-8 p-0\"\n onclick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n >\n <span class=\"sr-only\">Go to next page</span>\n <ChevronRightIcon />\n </Button>\n <Button\n variant=\"outline\"\n class=\"hidden size-8 p-0 lg:flex\"\n onclick={() => table.setPageIndex(table.getPageCount() - 1)}\n disabled={!table.getCanNextPage()}\n >\n <span class=\"sr-only\">Go to last page</span>\n <ChevronsRightIcon />\n </Button>\n </div>\n </div>\n</div>\n", he = "export { default as RowActions } from \"./row-actions.svelte\";\n", ge = "<script lang=\"ts\">\n import { goto } from '$app/navigation';\n import * as DropdownMenu from '$lib/components/ui/dropdown-menu';\n import { Button } from '$lib/components/ui/button';\n import EllipsisIcon from '@lucide/svelte/icons/ellipsis';\n\n let {\n viewPath,\n editPath,\n deletePath\n }: {\n viewPath: string;\n editPath: string;\n deletePath: string;\n } = $props();\n<\/script>\n\n<DropdownMenu.Root>\n <DropdownMenu.Trigger>\n {#snippet child({ props })}\n <Button {...props} variant=\"ghost\" class=\"data-[state=open]:bg-muted flex h-8 w-8 p-0\">\n <EllipsisIcon />\n <span class=\"sr-only\">Open Menu</span>\n </Button>\n {/snippet}\n </DropdownMenu.Trigger>\n <DropdownMenu.Content class=\"w-[160px]\" align=\"end\">\n <DropdownMenu.Item onclick={() => goto(viewPath)}>View</DropdownMenu.Item>\n <DropdownMenu.Item onclick={() => goto(editPath)}>Edit</DropdownMenu.Item>\n <DropdownMenu.Item>\n <form method=\"POST\" action={deletePath}>\n <button type=\"submit\" class=\"contents\">Delete</button>\n </form>\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n</DropdownMenu.Root>\n", _e = {
|
|
9
|
+
"file-form": ["input", "form"],
|
|
10
|
+
multiselect: [
|
|
11
|
+
"command",
|
|
12
|
+
"popover",
|
|
13
|
+
"button",
|
|
14
|
+
"badge"
|
|
15
|
+
],
|
|
16
|
+
geopoint: ["button", "leaflet"],
|
|
17
|
+
cells: [],
|
|
18
|
+
"column-header": ["dropdown-menu", "button"],
|
|
19
|
+
"faceted-filter": [
|
|
20
|
+
"command",
|
|
21
|
+
"popover",
|
|
22
|
+
"button",
|
|
23
|
+
"separator",
|
|
24
|
+
"badge"
|
|
25
|
+
],
|
|
26
|
+
pagination: ["button", "select"],
|
|
27
|
+
"row-actions": ["dropdown-menu", "button"],
|
|
28
|
+
leaflet: [],
|
|
29
|
+
"auth-menu": ["dropdown-menu", "button"]
|
|
30
|
+
}, ve = {
|
|
31
|
+
"file-form": [],
|
|
32
|
+
multiselect: [],
|
|
33
|
+
geopoint: [],
|
|
34
|
+
cells: [],
|
|
35
|
+
"column-header": ["@tanstack/table-core"],
|
|
36
|
+
"faceted-filter": ["@tanstack/table-core"],
|
|
37
|
+
pagination: ["@tanstack/table-core"],
|
|
38
|
+
"row-actions": [],
|
|
39
|
+
leaflet: ["leaflet", "@types/leaflet"]
|
|
40
|
+
}, K = /* @__PURE__ */ Object.assign({
|
|
41
|
+
"../ui/components/auth-menu/auth-menu-content.svelte": d,
|
|
42
|
+
"../ui/components/auth-menu/auth-menu-group.svelte": f,
|
|
43
|
+
"../ui/components/auth-menu/auth-menu-item.svelte": p,
|
|
44
|
+
"../ui/components/auth-menu/auth-menu-label.svelte": m,
|
|
45
|
+
"../ui/components/auth-menu/auth-menu-separator.svelte": h,
|
|
46
|
+
"../ui/components/auth-menu/auth-menu-trigger.svelte": ee,
|
|
47
|
+
"../ui/components/auth-menu/auth-menu.svelte": te,
|
|
48
|
+
"../ui/components/auth-menu/context.ts": g,
|
|
49
|
+
"../ui/components/auth-menu/index.ts": _,
|
|
50
|
+
"../ui/components/cells/autodate.svelte": ne,
|
|
51
|
+
"../ui/components/cells/bool.svelte": re,
|
|
52
|
+
"../ui/components/cells/date.svelte": ie,
|
|
53
|
+
"../ui/components/cells/editor.svelte": ae,
|
|
54
|
+
"../ui/components/cells/email.svelte": oe,
|
|
55
|
+
"../ui/components/cells/file.svelte": se,
|
|
56
|
+
"../ui/components/cells/geoPoint.svelte": v,
|
|
57
|
+
"../ui/components/cells/index.ts": y,
|
|
58
|
+
"../ui/components/cells/json.svelte": b,
|
|
59
|
+
"../ui/components/cells/number.svelte": x,
|
|
60
|
+
"../ui/components/cells/password.svelte": S,
|
|
61
|
+
"../ui/components/cells/relation.svelte": C,
|
|
62
|
+
"../ui/components/cells/select.svelte": w,
|
|
63
|
+
"../ui/components/cells/text.svelte": T,
|
|
64
|
+
"../ui/components/cells/url.svelte": E,
|
|
65
|
+
"../ui/components/column-header/column-header.svelte": D,
|
|
66
|
+
"../ui/components/column-header/index.ts": O,
|
|
67
|
+
"../ui/components/faceted-filter/faceted-filter.svelte": k,
|
|
68
|
+
"../ui/components/faceted-filter/index.ts": A,
|
|
69
|
+
"../ui/components/file-form/file-field.svelte": j,
|
|
70
|
+
"../ui/components/file-form/file-input.svelte": M,
|
|
71
|
+
"../ui/components/file-form/file-multiple.svelte": N,
|
|
72
|
+
"../ui/components/file-form/file-single.svelte": P,
|
|
73
|
+
"../ui/components/file-form/file-thumb.svelte": F,
|
|
74
|
+
"../ui/components/file-form/index.ts": I,
|
|
75
|
+
"../ui/components/file-form/shared.ts": L,
|
|
76
|
+
"../ui/components/geopoint/coordinate.svelte": R,
|
|
77
|
+
"../ui/components/geopoint/index.ts": z,
|
|
78
|
+
"../ui/components/geopoint/input.svelte": B,
|
|
79
|
+
"../ui/components/geopoint/toggle-map.svelte": V,
|
|
80
|
+
"../ui/components/leaflet/index.ts": H,
|
|
81
|
+
"../ui/components/leaflet/leaflet.svelte": U,
|
|
82
|
+
"../ui/components/multiselect/chip.svelte": W,
|
|
83
|
+
"../ui/components/multiselect/content.svelte": ce,
|
|
84
|
+
"../ui/components/multiselect/field.svelte": G,
|
|
85
|
+
"../ui/components/multiselect/index.ts": le,
|
|
86
|
+
"../ui/components/multiselect/input.svelte": ue,
|
|
87
|
+
"../ui/components/multiselect/item.svelte": de,
|
|
88
|
+
"../ui/components/multiselect/trigger.svelte": fe,
|
|
89
|
+
"../ui/components/pagination/index.ts": pe,
|
|
90
|
+
"../ui/components/pagination/pagination.svelte": me,
|
|
91
|
+
"../ui/components/row-actions/index.ts": he,
|
|
92
|
+
"../ui/components/row-actions/row-actions.svelte": ge
|
|
93
|
+
});
|
|
94
|
+
function ye() {
|
|
95
|
+
return [...new Set(Object.keys(K).map(q))].filter(Boolean).sort();
|
|
96
|
+
}
|
|
97
|
+
function q(e) {
|
|
98
|
+
let t = e.split("/");
|
|
99
|
+
return t[t.indexOf("components") + 1] ?? "";
|
|
100
|
+
}
|
|
101
|
+
function be(e) {
|
|
102
|
+
let t = e.split("/"), n = t.indexOf("components");
|
|
103
|
+
return t.slice(n + 2).join("/");
|
|
104
|
+
}
|
|
105
|
+
function J(e, t) {
|
|
106
|
+
return s.isAbsolute(t) ? t : s.join(e, t);
|
|
107
|
+
}
|
|
108
|
+
function Y(e, t) {
|
|
109
|
+
return s.isAbsolute(t) ? s.relative(e, t) : t;
|
|
110
|
+
}
|
|
111
|
+
function X(e, t) {
|
|
112
|
+
r(s.dirname(e), { recursive: !0 }), o(e, t, "utf8");
|
|
113
|
+
}
|
|
114
|
+
function xe(e) {
|
|
115
|
+
n(e) && a(e, {
|
|
116
|
+
force: !0,
|
|
117
|
+
recursive: !0
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async function Se(e, t, n) {
|
|
121
|
+
let r = (await c({ cwd: e }))?.name ?? "npm", i = l(r, t, n);
|
|
122
|
+
if (!i) throw Error(`Unable to resolve ${t} command for ${r}`);
|
|
123
|
+
let a = [...i.args];
|
|
124
|
+
r === "npm" && a.unshift("--yes"), await new Promise((t, n) => {
|
|
125
|
+
let r = u(i.command, a, {
|
|
126
|
+
cwd: e,
|
|
127
|
+
stdio: "inherit"
|
|
128
|
+
});
|
|
129
|
+
r.on("error", n), r.on("exit", (e) => {
|
|
130
|
+
if (e === 0) {
|
|
131
|
+
t();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
n(/* @__PURE__ */ Error(`${i.command} exited with code ${e ?? "unknown"}`));
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
async function Z(e, t, n, r) {
|
|
139
|
+
if (r?.executeCommand) {
|
|
140
|
+
await r.executeCommand(e, t, n);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
await Se(e, t, n);
|
|
144
|
+
}
|
|
145
|
+
function Ce(e) {
|
|
146
|
+
let t = s.join(e, "package.json");
|
|
147
|
+
if (!n(t)) return /* @__PURE__ */ new Set();
|
|
148
|
+
let r = JSON.parse(i(t, "utf8"));
|
|
149
|
+
return new Set([
|
|
150
|
+
...Object.keys(r.dependencies ?? {}),
|
|
151
|
+
...Object.keys(r.devDependencies ?? {}),
|
|
152
|
+
...Object.keys(r.optionalDependencies ?? {}),
|
|
153
|
+
...Object.keys(r.peerDependencies ?? {})
|
|
154
|
+
]);
|
|
155
|
+
}
|
|
156
|
+
async function Q(e, n, r, i = t) {
|
|
157
|
+
if (n.length === 0) return [];
|
|
158
|
+
let a = Ce(e), o = [...new Set(n)].filter((e) => !a.has(e));
|
|
159
|
+
return o.length === 0 ? [] : (i.info(`Installing packages: ${o.join(", ")}`), await Z(e, "install", o, r), o);
|
|
160
|
+
}
|
|
161
|
+
function $(e) {
|
|
162
|
+
return ye().includes(e);
|
|
163
|
+
}
|
|
164
|
+
function we(e) {
|
|
165
|
+
return [...new Set(e.flatMap((e) => ve[e] ?? []))];
|
|
166
|
+
}
|
|
167
|
+
function Te(e, t) {
|
|
168
|
+
let n = s.join(t, e);
|
|
169
|
+
r(n, { recursive: !0 });
|
|
170
|
+
for (let [t, i] of Object.entries(K)) {
|
|
171
|
+
if (q(t) !== e) continue;
|
|
172
|
+
let a = be(t);
|
|
173
|
+
if (!a) continue;
|
|
174
|
+
let c = s.join(n, a);
|
|
175
|
+
r(s.dirname(c), { recursive: !0 }), o(c, i, "utf8");
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
async function Ee(e, i, a, o = t) {
|
|
179
|
+
if (i.length === 0) return {
|
|
180
|
+
components: [],
|
|
181
|
+
packages: []
|
|
182
|
+
};
|
|
183
|
+
let c = s.join(e, "src", "lib", "components", "ui");
|
|
184
|
+
r(c, { recursive: !0 });
|
|
185
|
+
let l = [...new Set(i)].filter((e) => !n(s.join(c, e)));
|
|
186
|
+
if (l.length === 0) return {
|
|
187
|
+
components: [],
|
|
188
|
+
packages: []
|
|
189
|
+
};
|
|
190
|
+
let u = new Set(l.filter($)), d = new Set(l.filter((e) => !$(e)));
|
|
191
|
+
for (let e of [...u]) for (let t of _e[e] ?? []) n(s.join(c, t)) || ($(t) ? u.add(t) : d.add(t));
|
|
192
|
+
let f = [], p = [...u].sort();
|
|
193
|
+
p.length > 0 && o.info(`Installing custom components: ${p.join(", ")}`);
|
|
194
|
+
for (let e of p) Te(e, c), f.push(e), d.delete(e);
|
|
195
|
+
let m = await Q(e, we([...u]), a, o), h = [...d].sort();
|
|
196
|
+
return h.length > 0 && (o.info(`Installing shadcn-svelte components: ${h.join(", ")}`), await Z(e, "execute", [
|
|
197
|
+
"shadcn-svelte",
|
|
198
|
+
"add",
|
|
199
|
+
"--yes",
|
|
200
|
+
"--overwrite",
|
|
201
|
+
...h
|
|
202
|
+
], a), f.push(...h)), {
|
|
203
|
+
components: [...new Set(f)],
|
|
204
|
+
packages: m
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
async function De(t, r, a) {
|
|
208
|
+
let o = e(r), s = {
|
|
209
|
+
creates: [],
|
|
210
|
+
modifies: [],
|
|
211
|
+
deletes: [],
|
|
212
|
+
components: [],
|
|
213
|
+
packages: [],
|
|
214
|
+
collections: [],
|
|
215
|
+
collectionPatches: [],
|
|
216
|
+
collectionDrops: []
|
|
217
|
+
}, c = [];
|
|
218
|
+
if (t.collectionDrops.length > 0) {
|
|
219
|
+
let { dropCollections: e } = await import("./collections-BwO27pJg.js");
|
|
220
|
+
c = await e(t.collectionDrops, r);
|
|
221
|
+
}
|
|
222
|
+
let l = await Q(r.root, t.packages, a, o), u = await Ee(r.root, t.components, a, o);
|
|
223
|
+
for (let e of [...t.creates, ...c]) {
|
|
224
|
+
if (e.status !== "success") continue;
|
|
225
|
+
let t = J(r.root, e.path);
|
|
226
|
+
if (!n(t)) {
|
|
227
|
+
X(t, e.content), s.creates.push({
|
|
228
|
+
...e,
|
|
229
|
+
path: Y(r.root, e.path)
|
|
230
|
+
});
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
i(t, "utf8") !== e.content && (X(t, e.content), s.modifies.push({
|
|
234
|
+
...e,
|
|
235
|
+
path: Y(r.root, e.path)
|
|
236
|
+
}));
|
|
237
|
+
}
|
|
238
|
+
for (let e of t.modifies) e.status === "success" && (X(J(r.root, e.path), e.content), s.modifies.push({
|
|
239
|
+
...e,
|
|
240
|
+
path: Y(r.root, e.path)
|
|
241
|
+
}));
|
|
242
|
+
for (let e of t.deletes) e.status === "success" && n(J(r.root, e.path)) && (xe(J(r.root, e.path)), s.deletes.push({
|
|
243
|
+
...e,
|
|
244
|
+
path: Y(r.root, e.path)
|
|
245
|
+
}));
|
|
246
|
+
return {
|
|
247
|
+
...t,
|
|
248
|
+
creates: s.creates,
|
|
249
|
+
modifies: s.modifies,
|
|
250
|
+
deletes: s.deletes,
|
|
251
|
+
components: u.components,
|
|
252
|
+
packages: [...new Set([...l, ...u.packages])]
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
256
|
+
export { De as writeResult };
|
|
257
|
+
|
|
258
|
+
//# sourceMappingURL=write-result-I15cELAq.js.map
|