wcz-layout 10.2.2 → 11.0.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/{ChatLayout-CkS9oyPp.mjs → ChatLayout-B0MBrI-Y.mjs} +839 -371
- package/dist/ChatLayout-B0MBrI-Y.mjs.map +1 -0
- package/dist/{ExtractFile-ClTc-e1H.d.mts → ExtractFile-BQUXpuBS.d.mts} +27 -3
- package/dist/FileMeta-B5VU-eCi.d.mts +55 -0
- package/dist/FileMeta-BexXC_45.mjs +35 -0
- package/dist/FileMeta-BexXC_45.mjs.map +1 -0
- package/dist/QueryClientParam-BG9Q_9XU.d.mts +6 -0
- package/dist/{Translate-BiCjnlyx.mjs → Translate-C43AmXYW.mjs} +25 -37
- package/dist/Translate-C43AmXYW.mjs.map +1 -0
- package/dist/User-CvLutatT.d.mts +10 -0
- package/dist/ai.d.mts +1 -1
- package/dist/ai.mjs +2 -2
- package/dist/ai.mjs.map +1 -1
- package/dist/auth.d.mts +6 -14
- package/dist/auth.mjs +15 -38
- package/dist/auth.mjs.map +1 -1
- package/dist/{authMiddleware-D4GSt7m9.mjs → authMiddleware-ANa9Tlmp.mjs} +10 -15
- package/dist/authMiddleware-ANa9Tlmp.mjs.map +1 -0
- package/dist/{ChatLayout-BmLySLXy.d.mts → components-2HKj8GpC.d.mts} +219 -255
- package/dist/components.d.mts +2 -126
- package/dist/components.mjs +871 -919
- package/dist/components.mjs.map +1 -1
- package/dist/data/client.d.mts +299 -57
- package/dist/data/client.mjs +5 -6
- package/dist/data/client.mjs.map +1 -1
- package/dist/data/server.d.mts +6 -5
- package/dist/data/server.mjs +3 -5
- package/dist/data/server.mjs.map +1 -1
- package/dist/env-C4WLVJMm.mjs +32 -0
- package/dist/env-C4WLVJMm.mjs.map +1 -0
- package/dist/file-DBqTibcr.mjs +176 -0
- package/dist/file-DBqTibcr.mjs.map +1 -0
- package/dist/file-hecCQszp.mjs +114 -0
- package/dist/file-hecCQszp.mjs.map +1 -0
- package/dist/hooks.d.mts +11 -91
- package/dist/hooks.mjs +152 -960
- package/dist/hooks.mjs.map +1 -1
- package/dist/i18n-ZRiIIdpb.mjs +563 -0
- package/dist/i18n-ZRiIIdpb.mjs.map +1 -0
- package/dist/index.d.mts +3 -35
- package/dist/index.mjs +409 -510
- package/dist/index.mjs.map +1 -1
- package/dist/layout-DeTB6Ai1.mjs +224 -0
- package/dist/layout-DeTB6Ai1.mjs.map +1 -0
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.mjs +2 -2
- package/dist/models.d.mts +34 -42
- package/dist/models.mjs +4 -6
- package/dist/models.mjs.map +1 -1
- package/dist/oidc--D2ox365.mjs +97 -0
- package/dist/oidc--D2ox365.mjs.map +1 -0
- package/dist/peoplesoft-DhwB8jrM.d.mts +204 -0
- package/dist/tokens-C4djIAhl.mjs +97 -0
- package/dist/tokens-C4djIAhl.mjs.map +1 -0
- package/dist/useDialogs-QER-2rVG.mjs +297 -0
- package/dist/useDialogs-QER-2rVG.mjs.map +1 -0
- package/dist/{user-Bc2nLjAG.mjs → user-DQx1BanQ.mjs} +4 -20
- package/dist/user-DQx1BanQ.mjs.map +1 -0
- package/dist/{utils-CNYCSgip.d.mts → utils-BnyAEKW7.d.mts} +7 -9
- package/dist/{utils-CgabUlDD.mjs → utils-H4BskGF8.mjs} +21 -20
- package/dist/utils-H4BskGF8.mjs.map +1 -0
- package/dist/utils.d.mts +21 -4
- package/dist/utils.mjs +5 -4
- package/dist/vite.mjs +98 -32
- package/dist/vite.mjs.map +1 -1
- package/package.json +16 -43
- package/skills/ai/SKILL.md +1 -4
- package/skills/general/SKILL.md +15 -8
- package/skills/general/references/auth.md +10 -16
- package/skills/general/references/languages.md +56 -0
- package/skills/migrations/versions/migrate-v10-to-v11.md +98 -22
- package/skills/migrations/versions/migrate-v9-to-v10.md +22 -22
- package/skills/services/SKILL.md +1 -1
- package/skills/services/docs/email.md +2 -2
- package/skills/services/docs/file.md +100 -85
- package/skills/services/docs/layout.md +2 -3
- package/skills/start/steps/02-project-name-setup.md +1 -1
- package/skills/start/steps/06-entra-setup.md +1 -1
- package/skills/start/steps/08-generate-favicon.md +1 -1
- package/skills/table/SKILL.md +18 -5
- package/src/lib/locales/cs.json +120 -0
- package/src/lib/locales/en.json +119 -0
- package/src/lib/locales/uk.json +121 -0
- package/src/lib/locales/zh-TW.json +118 -0
- package/dist/ChatLayout-CkS9oyPp.mjs.map +0 -1
- package/dist/DialogsContext-D23fJjYR.mjs +0 -6
- package/dist/DialogsContext-D23fJjYR.mjs.map +0 -1
- package/dist/FileMeta-B39e2FLC.d.mts +0 -17
- package/dist/FileMeta-CPBWI_jA.mjs +0 -18
- package/dist/FileMeta-CPBWI_jA.mjs.map +0 -1
- package/dist/QueryClientParam-CTV1vj76.d.mts +0 -8
- package/dist/RouterListItemButton-CF-8w-08.mjs +0 -62
- package/dist/RouterListItemButton-CF-8w-08.mjs.map +0 -1
- package/dist/Translate-BiCjnlyx.mjs.map +0 -1
- package/dist/User-aJksXItw.d.mts +0 -12
- package/dist/authMiddleware-D4GSt7m9.mjs.map +0 -1
- package/dist/createApi-CF4ZL82B.mjs +0 -24
- package/dist/createApi-CF4ZL82B.mjs.map +0 -1
- package/dist/env-Cddts_dn.mjs +0 -49
- package/dist/env-Cddts_dn.mjs.map +0 -1
- package/dist/file-D4kSR_lC.mjs +0 -149
- package/dist/file-D4kSR_lC.mjs.map +0 -1
- package/dist/file-DcwYjofa.mjs +0 -150
- package/dist/file-DcwYjofa.mjs.map +0 -1
- package/dist/layout-6We_KFgN.mjs +0 -107
- package/dist/layout-6We_KFgN.mjs.map +0 -1
- package/dist/peoplesoft-DH31FCMC.mjs +0 -125
- package/dist/peoplesoft-DH31FCMC.mjs.map +0 -1
- package/dist/peoplesoft-DXukeeFr.d.mts +0 -161
- package/dist/providers-DOFje2P6.mjs +0 -56
- package/dist/providers-DOFje2P6.mjs.map +0 -1
- package/dist/tokens-DNe_Qifk.mjs +0 -204
- package/dist/tokens-DNe_Qifk.mjs.map +0 -1
- package/dist/user-Bc2nLjAG.mjs.map +0 -1
- package/dist/utils-CgabUlDD.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatLayout-B0MBrI-Y.mjs","names":["{\n textFieldProps,\n ...autocompleteProps\n}","getFieldStatus(field)","(_, value) => !autocompleteProps.freeSolo && field.handleChange(value)","(_, value, reason) =>\n reason !== \"reset\" && autocompleteProps.freeSolo && field.handleChange(value)","freeSolo","value","(parameters) => (\n <TextField\n {...parameters}\n name={field.name}\n error={error}\n helperText={helperText}\n {...textFieldProps}\n />\n )","name","<Autocomplete\n value={field.state.value}\n onChange={(_, value) => !autocompleteProps.freeSolo && field.handleChange(value)}\n onInputChange={(_, value, reason) =>\n reason !== \"reset\" && autocompleteProps.freeSolo && field.handleChange(value)\n }\n onBlur={field.handleBlur}\n {...autocompleteProps}\n renderInput={(parameters) => (\n <TextField\n {...parameters}\n name={field.name}\n error={error}\n helperText={helperText}\n {...textFieldProps}\n />\n )}\n />","handleBlur","{ label, ...props }","getFieldStatus(field)","(event) => field.handleChange(event.target.checked)","{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }","error || undefined","error ? helperId : undefined","<Checkbox\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />","handleBlur","name","Boolean(field.state.value)","field.name","<FormControlLabel\n control={\n <Checkbox\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />\n }\n label={label ?? \"\"}\n />","label ?? \"\"","error && <FormHelperText id={helperId}>{helperText}</FormHelperText>","<FormControl error={error}>\n <FormControlLabel\n control={\n <Checkbox\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />\n }\n label={label ?? \"\"}\n />\n {error && <FormHelperText id={helperId}>{helperText}</FormHelperText>}\n </FormControl>","{ Picker, textFieldProps, slotProps, ...props }: PickerFieldProps","getFieldStatus(field)","(value: Dayjs | null) => field.handleChange(value)","{\n ...slotProps?.textField,\n onBlur: field.handleBlur,\n error,\n helperText,\n ...textFieldProps,\n }","handleBlur","slotProps?.textField","{\n ...slotProps,\n textField: {\n ...slotProps?.textField,\n onBlur: field.handleBlur,\n error,\n helperText,\n ...textFieldProps,\n },\n }","<Picker\n {...props}\n name={field.name}\n value={field.state.value}\n onChange={(value: Dayjs | null) => field.handleChange(value)}\n slotProps={{\n ...slotProps,\n textField: {\n ...slotProps?.textField,\n onBlur: field.handleBlur,\n error,\n helperText,\n ...textFieldProps,\n },\n }}\n />","name","value","<PickerField Picker={DatePicker} {...props} />","<PickerField Picker={TimePicker} {...props} />","<PickerField Picker={DateTimePicker} {...props} />","{ options, ...props }","getFieldStatus(field)","({ floatValue }) => field.handleChange(floatValue)","{ floatValue }","<NumericFormat\n customInput={TextField}\n name={field.name}\n value={field.state.value ?? \"\"}\n onValueChange={({ floatValue }) => field.handleChange(floatValue)}\n onBlur={field.handleBlur}\n error={error}\n helperText={helperText}\n {...props}\n {...options}\n />","handleBlur","name","field.state.value ?? \"\"","{ label, options, ...props }","getFieldStatus(field)","label && <FormLabel component=\"legend\">{label}</FormLabel>","(event) => field.handleChange(event.target.value)","options.map((option) => (\n <FormControlLabel\n key={option.value}\n value={option.value}\n control={<Radio />}\n label={option.label}\n />\n ))","(option) => (\n <FormControlLabel\n key={option.value}\n value={option.value}\n control={<Radio />}\n label={option.label}\n />\n )","<RadioGroup\n name={field.name}\n value={field.state.value ?? \"\"}\n onChange={(event) => field.handleChange(event.target.value)}\n onBlur={field.handleBlur}\n aria-invalid={error || undefined}\n aria-describedby={error ? helperId : undefined}\n {...props}\n >\n {options.map((option) => (\n <FormControlLabel\n key={option.value}\n value={option.value}\n control={<Radio />}\n label={option.label}\n />\n ))}\n </RadioGroup>","handleBlur","name","field.state.value ?? \"\"","error || undefined","error ? helperId : undefined","field.name","field.handleBlur","error && <FormHelperText id={helperId}>{helperText}</FormHelperText>","<FormControl component=\"fieldset\" error={error}>\n {label && <FormLabel component=\"legend\">{label}</FormLabel>}\n <RadioGroup\n name={field.name}\n value={field.state.value ?? \"\"}\n onChange={(event) => field.handleChange(event.target.value)}\n onBlur={field.handleBlur}\n aria-invalid={error || undefined}\n aria-describedby={error ? helperId : undefined}\n {...props}\n >\n {options.map((option) => (\n <FormControlLabel\n key={option.value}\n value={option.value}\n control={<Radio />}\n label={option.label}\n />\n ))}\n </RadioGroup>\n {error && <FormHelperText id={helperId}>{helperText}</FormHelperText>}\n </FormControl>","_temp","{ label, ...props }","getFieldStatus(field)","label && <FormLabel id={labelId}>{label}</FormLabel>","(_, value) => field.handleChange(Array.isArray(value) ? value[0] : value)","{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }","error || undefined","error ? helperId : undefined","<Slider\n name={field.name}\n value={field.state.value ?? 0}\n onChange={(_, value) => field.handleChange(Array.isArray(value) ? value[0] : value)}\n onBlur={field.handleBlur}\n aria-labelledby={label ? labelId : undefined}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />","handleBlur","name","field.state.value ?? 0","label ? labelId : undefined","error && <FormHelperText id={helperId}>{helperText}</FormHelperText>","<FormControl error={error}>\n {label && <FormLabel id={labelId}>{label}</FormLabel>}\n <Slider\n name={field.name}\n value={field.state.value ?? 0}\n onChange={(_, value) => field.handleChange(Array.isArray(value) ? value[0] : value)}\n onBlur={field.handleBlur}\n aria-labelledby={label ? labelId : undefined}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />\n {error && <FormHelperText id={helperId}>{helperText}</FormHelperText>}\n </FormControl>","async (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n const scope = event.currentTarget.form ?? document;\n await form.handleSubmit();\n\n const fieldMeta: Partial<Record<string, { errors: Array<unknown> }>> = form.state.fieldMeta;\n // After the errors render, so the screen reader reads the field together with its error.\n requestAnimationFrame(() => {\n const invalid = Array.from(\n scope.querySelectorAll<HTMLElement>(\"input[name], textarea[name], select[name]\"),\n ).find((element) => fieldMeta[element.getAttribute(\"name\") ?? \"\"]?.errors.length);\n // MUI keeps the value of a Select or picker in a hidden input next to the visible control.\n const target =\n invalid?.getAttribute(\"aria-hidden\") === \"true\"\n ? (invalid.parentElement?.querySelector<HTMLElement>('[tabindex=\"0\"]') ?? invalid)\n : invalid;\n target?.focus();\n });\n }","(isSubmitting) => (\n <Button loading={isSubmitting} onClick={handleClick} type=\"submit\" {...props} />\n )","<form.Subscribe selector={(state) => state.isSubmitting}>\n {(isSubmitting) => (\n <Button loading={isSubmitting} onClick={handleClick} type=\"submit\" {...props} />\n )}\n </form.Subscribe>","Subscribe","form.Subscribe","(state) => state.isSubmitting","_temp","{ label, ...props }","getFieldStatus(field)","(event) => field.handleChange(event.target.checked)","{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }","error || undefined","error ? helperId : undefined","<Switch\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />","handleBlur","name","Boolean(field.state.value)","field.name","<FormControlLabel\n control={\n <Switch\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />\n }\n label={label ?? \"\"}\n />","label ?? \"\"","error && <FormHelperText id={helperId}>{helperText}</FormHelperText>","<FormControl error={error}>\n <FormControlLabel\n control={\n <Switch\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />\n }\n label={label ?? \"\"}\n />\n {error && <FormHelperText id={helperId}>{helperText}</FormHelperText>}\n </FormControl>","getFieldStatus(field)","(event) => field.handleChange(event.target.value)","<TextField\n name={field.name}\n value={field.state.value ?? \"\"}\n onChange={(event) => field.handleChange(event.target.value)}\n onBlur={field.handleBlur}\n error={error}\n helperText={helperText}\n {...props}\n />","handleBlur","name","field.state.value ?? \"\"","prefix = \"\"","{ prefix = \"\", options, dateFormat, ...props }","Typography","\"body2\"","\"text.secondary\"","noWrap","props","prefix","Array.isArray(value) ? value.map(format).join(\" – \") : format(value)","i18n.language","(entry: unknown) =>\n typeof entry === \"number\"\n ? entry.toLocaleString(undefined, options)\n : formatValue(entry, dateFormat, i18n.language)","<Typography variant=\"body2\" color=\"text.secondary\" noWrap {...props}>\n {prefix}\n {/* `extent` — the default aggregate for anything non-numeric — is a [min, max] pair. */}\n {Array.isArray(value) ? value.map(format).join(\" – \") : format(value)}\n </Typography>","useTranslation","z","{ node }: Readonly<{ node: Record<string, unknown> }>","isRecord(node.props) ? node.props : {}","props","<Skeleton variant=\"rounded\" height={typeof height === \"number\" ? height : 280} />","typeof height === \"number\" ? height : 280","streaming ? (\n placeholder\n ) : (\n <Suspense fallback={placeholder}>\n <GeneratedChart node={node} />\n </Suspense>\n )","{ part }: Readonly<{ part: ToolCallPart }>","part.input ?? (parsePartialJSON(part.arguments) as unknown)","arguments","input","{ overflowX: \"auto\", m: -0.5, p: 0.5 }","() => part.arguments","() => <Alert severity=\"warning\">{t(\"Layout.Chat.RenderFailed\")}</Alert>","renderGeneratedUi(input?.ui)","input?.ui","<Streaming value={part.input === undefined}>{renderGeneratedUi(input?.ui)}</Streaming>","part.input === undefined","<Box sx={{ overflowX: \"auto\", m: -0.5, p: 0.5 }}>\n <CatchBoundary\n getResetKey={() => part.arguments}\n errorComponent={() => <Alert severity=\"warning\">{t(\"Layout.Chat.RenderFailed\")}</Alert>}\n >\n <Streaming value={part.input === undefined}>{renderGeneratedUi(input?.ui)}</Streaming>\n </CatchBoundary>\n </Box>","{\n part,\n disabled,\n onAnswer,\n}: Readonly<{\n part: ToolCallPart;\n disabled: boolean;\n onAnswer: (values: Record<string, unknown>) => void;\n}>","(event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const { submitter } = event.nativeEvent as SubmitEvent;\n const values: Record<string, unknown> = {};\n for (const [name, value] of new FormData(event.currentTarget, submitter)) {\n const previous = values[name];\n values[name] = previous === undefined ? value : [previous, value].flat();\n }\n onAnswer(values);\n }","{\n border: 0,\n m: 0,\n p: 0,\n minWidth: 0,\n opacity: answer === undefined ? 1 : 0.6,\n pointerEvents: disabled ? \"none\" : undefined,\n }","answer === undefined ? 1 : 0.6","disabled ? \"none\" : undefined","<GeneratedUi part={part} />","<Box\n component=\"fieldset\"\n disabled={disabled}\n sx={{\n border: 0,\n m: 0,\n p: 0,\n minWidth: 0,\n opacity: answer === undefined ? 1 : 0.6,\n pointerEvents: disabled ? \"none\" : undefined,\n }}\n >\n <GeneratedUi part={part} />\n </Box>","isRecord(answer) && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {Object.entries(answer)\n .map(([name, value]) => `${name}: ${String(value)}`)\n .join(\", \")}\n </Typography>\n )","([name, value]) => `${name}: ${String(value)}`","<Box component=\"form\" onSubmit={submit}>\n <Box\n component=\"fieldset\"\n disabled={disabled}\n sx={{\n border: 0,\n m: 0,\n p: 0,\n minWidth: 0,\n opacity: answer === undefined ? 1 : 0.6,\n pointerEvents: disabled ? \"none\" : undefined,\n }}\n >\n <GeneratedUi part={part} />\n </Box>\n {isRecord(answer) && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {Object.entries(answer)\n .map(([name, value]) => `${name}: ${String(value)}`)\n .join(\", \")}\n </Typography>\n )}\n </Box>","name","value","[name, value]","_temp","{ href = \"\", children }: ComponentPropsWithoutRef<\"a\">","href = \"\"","href.startsWith(\"/\") && !href.startsWith(\"//\") ? (\n <RouterLink to={href}>{children}</RouterLink>\n ) : (\n <Link href={href} target=\"_blank\" rel=\"noreferrer\">\n {children}\n </Link>\n )","() => {\n const scroller = ref.current;\n if (!scroller) return;\n let previousTop = scroller.scrollTop;\n\n const onScroll = () => {\n following.current = keepsFollowing(following.current, previousTop, scroller);\n previousTop = scroller.scrollTop;\n };\n const observer = new ResizeObserver(() => {\n if (!following.current) return;\n scroller.scrollTop = scroller.scrollHeight;\n previousTop = scroller.scrollTop;\n });\n\n scroller.addEventListener(\"scroll\", onScroll, { passive: true });\n observer.observe(scroller);\n for (const child of scroller.children) observer.observe(child);\n return () => {\n scroller.removeEventListener(\"scroll\", onScroll);\n observer.disconnect();\n };\n }","[]","{ ref, following }","t(\"Layout.Chat.Reasoning\")","<Typography className={statusClass} sx={shimmerSx}>\n {t(\"Layout.Chat.Reasoning\")}\n </Typography>","{ part, live }: Readonly<{ part: ToolCallPart; live: boolean }>","running ? shimmerSx : { color: \"text.secondary\" }","activityText(t, part, live)","<Typography\n variant=\"body2\"\n className={statusClass}\n sx={running ? shimmerSx : { color: \"text.secondary\" }}\n >\n {activityText(t, part, live)}\n </Typography>","{\n message,\n live,\n canAnswer,\n addToolResult,\n}: Readonly<{\n message: UIMessage;\n live: boolean;\n canAnswer: boolean;\n addToolResult: Chat[\"addToolResult\"];\n}>","<Stack spacing={1} sx={{ alignSelf: \"flex-end\", alignItems: \"flex-end\", maxWidth: \"80%\" }}>\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", justifyContent: \"flex-end\", gap: 0.5 }}>\n {files.map((part, index) =>\n part.type === \"image\" ? (\n <Box\n key={index}\n component=\"img\"\n src={srcOf(part)}\n alt=\"Attached image\"\n sx={{ maxWidth: \"100%\", maxHeight: 160, borderRadius: 3 }}\n />\n ) : (\n <Chip key={index} variant=\"outlined\" label={fileNameOf(part)} />\n ),\n )}\n </Stack>\n )}\n {typed.length > 0 && (\n <Typography\n sx={{\n px: 2,\n py: 1.25,\n borderRadius: 4.5,\n bgcolor: \"action.hover\",\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n }}\n >\n {typed.join(\"\\n\")}\n </Typography>\n )}\n </Stack>","parts","(part) => (part.type === \"text\" ? [part.content] : [])","({ type }) => type === \"image\" || type === \"document\"","{ alignSelf: \"flex-end\", alignItems: \"flex-end\", maxWidth: \"80%\" }","(part, index) =>\n part.type === \"image\" ? (\n <Box\n key={index}\n component=\"img\"\n src={srcOf(part)}\n alt=\"Attached image\"\n sx={{ maxWidth: \"100%\", maxHeight: 160, borderRadius: 3 }}\n />\n ) : (\n <Chip key={index} variant=\"outlined\" label={fileNameOf(part)} />\n )","message.parts.map((part, index) => {\n if (part.type === \"text\")\n return part.content ? (\n <Box key={index} sx={markdownSx}>\n <Markdown extensions={markdownExtensions} components={markdownComponents}>\n {part.content}\n </Markdown>\n </Box>\n ) : null;\n if (part.type !== \"tool-call\") return null;\n const ui = part.name === \"show_ui\" || part.name === \"ask_user\";\n // The model draws a UI whose input failed again.\n if (ui && part.state === \"error\") return null;\n if (part.name === \"show_ui\") return <GeneratedUi key={part.id} part={part} />;\n if (part.name === \"ask_user\")\n return (\n <AskUser\n key={part.id}\n part={part}\n disabled={!canAnswer || part.output !== undefined}\n onAnswer={(output) =>\n void addToolResult({ toolCallId: part.id, tool: part.name, output })\n }\n />\n );\n return <ToolActivity key={part.id} part={part} live={live} />;\n })","(part, index) => {\n if (part.type === \"text\")\n return part.content ? (\n <Box key={index} sx={markdownSx}>\n <Markdown extensions={markdownExtensions} components={markdownComponents}>\n {part.content}\n </Markdown>\n </Box>\n ) : null;\n if (part.type !== \"tool-call\") return null;\n const ui = part.name === \"show_ui\" || part.name === \"ask_user\";\n // The model draws a UI whose input failed again.\n if (ui && part.state === \"error\") return null;\n if (part.name === \"show_ui\") return <GeneratedUi key={part.id} part={part} />;\n if (part.name === \"ask_user\")\n return (\n <AskUser\n key={part.id}\n part={part}\n disabled={!canAnswer || part.output !== undefined}\n onAnswer={(output) =>\n void addToolResult({ toolCallId: part.id, tool: part.name, output })\n }\n />\n );\n return <ToolActivity key={part.id} part={part} live={live} />;\n }","part","index","{ type }","{ chat }: Readonly<{ chat: Chat }>","chat.interrupts.map((interrupt) =>\n interrupt.metadata?.kind === \"approval\" &&\n interrupt.status === \"pending\" &&\n \"resolveInterrupt\" in interrupt ? (\n <Alert\n key={interrupt.id}\n severity=\"warning\"\n action={\n <Stack direction=\"row\" spacing={1}>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(false)}\n >\n {t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(true)}\n >\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </Stack>\n }\n >\n {t(\"Layout.Chat.AreYouSure\")}\n </Alert>\n ) : null,\n )","interrupts","resuming","(interrupt) =>\n interrupt.metadata?.kind === \"approval\" &&\n interrupt.status === \"pending\" &&\n \"resolveInterrupt\" in interrupt ? (\n <Alert\n key={interrupt.id}\n severity=\"warning\"\n action={\n <Stack direction=\"row\" spacing={1}>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(false)}\n >\n {t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(true)}\n >\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </Stack>\n }\n >\n {t(\"Layout.Chat.AreYouSure\")}\n </Alert>\n ) : null","{ chat, files, setFiles, pick, onSend }: Readonly<ChatInputProps>","draft.trim() !== \"\" || files.length > 0","length","(event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!ready) return;\n onSend();\n const parts = files.map(({ part }) => part);\n if (draft.trim()) parts.push({ type: \"text\", content: draft.trim() });\n void chat.sendMessage(files.length ? { content: parts } : draft.trim());\n setDraft(\"\");\n setFiles([]);\n }","({ part }) => part","(event: KeyboardEvent<HTMLFormElement>) => {\n if (event.key !== \"Enter\" || event.shiftKey || event.nativeEvent.isComposing) return;\n if (!(event.target instanceof HTMLTextAreaElement)) return;\n event.preventDefault();\n event.currentTarget.requestSubmit();\n }","async () => {\n if (await confirm(t(\"Layout.Chat.NewChatConfirm\"))) chat.clear();\n }","chat.queue.map(({ id, content }) => (\n <Chip\n key={id}\n variant=\"outlined\"\n label={queuedText(content)}\n onDelete={() => chat.cancelQueued(id)}\n sx={{ alignSelf: \"flex-end\", maxWidth: \"80%\" }}\n />\n ))","{ id, content }","{ p: 1, borderRadius: 7, boxShadow: 2 }","files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", gap: 0.5, px: 1, pb: 1 }}>\n {files.map(({ name, part }, index) => (\n <Chip\n key={index}\n size=\"small\"\n label={name}\n avatar={\n part.type === \"image\" ? (\n <Avatar variant=\"rounded\" src={srcOf(part)} alt=\"\" />\n ) : undefined\n }\n onDelete={() => setFiles(files.filter((_, at) => at !== index))}\n />\n ))}\n </Stack>\n )","{ name, part }","files.length","{ alignItems: \"flex-end\" }","t(\"Layout.Chat.NewChat\")","() => void newChat()","<Add />","<span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>","!chat.messages.length","<Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>","t(\"Layout.Chat.Attach\")","<AttachFile />","<IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>","<Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>","(event) => setDraft(event.target.value)","event","t(\"Layout.Chat.Message\")","{ input: { \"aria-label\": \"Ask anything\" } }","{ flex: 1, py: 1, pl: 0.5 }","<InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />","chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )","isLoading","stop","(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )","<Stack direction=\"row\" spacing={0.5} sx={{ alignItems: \"flex-end\" }}>\n <Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>\n <InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />\n {chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )}\n {(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )}\n </Stack>","<Paper\n component=\"form\"\n variant=\"outlined\"\n onSubmit={send}\n onKeyDown={sendOnEnter}\n sx={{ p: 1, borderRadius: 7, boxShadow: 2 }}\n >\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", gap: 0.5, px: 1, pb: 1 }}>\n {files.map(({ name, part }, index) => (\n <Chip\n key={index}\n size=\"small\"\n label={name}\n avatar={\n part.type === \"image\" ? (\n <Avatar variant=\"rounded\" src={srcOf(part)} alt=\"\" />\n ) : undefined\n }\n onDelete={() => setFiles(files.filter((_, at) => at !== index))}\n />\n ))}\n </Stack>\n )}\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: \"flex-end\" }}>\n <Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>\n <InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />\n {chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )}\n {(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )}\n </Stack>\n </Paper>","<Stack spacing={1}>\n {chat.queue.map(({ id, content }) => (\n <Chip\n key={id}\n variant=\"outlined\"\n label={queuedText(content)}\n onDelete={() => chat.cancelQueued(id)}\n sx={{ alignSelf: \"flex-end\", maxWidth: \"80%\" }}\n />\n ))}\n <Paper\n component=\"form\"\n variant=\"outlined\"\n onSubmit={send}\n onKeyDown={sendOnEnter}\n sx={{ p: 1, borderRadius: 7, boxShadow: 2 }}\n >\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", gap: 0.5, px: 1, pb: 1 }}>\n {files.map(({ name, part }, index) => (\n <Chip\n key={index}\n size=\"small\"\n label={name}\n avatar={\n part.type === \"image\" ? (\n <Avatar variant=\"rounded\" src={srcOf(part)} alt=\"\" />\n ) : undefined\n }\n onDelete={() => setFiles(files.filter((_, at) => at !== index))}\n />\n ))}\n </Stack>\n )}\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: \"flex-end\" }}>\n <Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>\n <InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />\n {chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )}\n {(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )}\n </Stack>\n </Paper>\n </Stack>","{ part }"],"sources":["../src/components/form/FormAutocomplete.tsx","../src/components/form/FormCheckbox.tsx","../src/components/form/FormPickers.tsx","../src/components/form/FormNumberField.tsx","../src/components/form/FormRadioGroup.tsx","../src/components/form/FormSlider.tsx","../src/components/form/FormSubmitButton.tsx","../src/components/form/FormSwitch.tsx","../src/components/form/FormTextField.tsx","../src/hooks/useForm.ts","../src/components/table/utils.ts","../src/components/table/formatValue.ts","../src/components/table/context.ts","../src/components/table/cells/formatters/AggregatedCell.tsx","../src/lib/ai/tools/ui.ts","../src/components/chat/generatedUi.tsx","../src/lib/ai/attachments.ts","../src/components/chat/ChatLayout.tsx"],"sourcesContent":["import { Autocomplete, TextField } from \"@mui/material\";\nimport type { AutocompleteProps, TextFieldProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/useForm\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormAutocompleteProps extends Omit<\n AutocompleteProps<any, boolean, boolean, boolean>,\n FormOmittedProps\n> {\n textFieldProps?: Omit<TextFieldProps, FormOmittedProps>;\n}\n\nexport const FormAutocomplete: FC<FormAutocompleteProps> = ({\n textFieldProps,\n ...autocompleteProps\n}) => {\n const field = useFieldContext();\n const { error, helperText } = getFieldStatus(field);\n\n return (\n <Autocomplete\n value={field.state.value}\n onChange={(_, value) => !autocompleteProps.freeSolo && field.handleChange(value)}\n onInputChange={(_, value, reason) =>\n reason !== \"reset\" && autocompleteProps.freeSolo && field.handleChange(value)\n }\n onBlur={field.handleBlur}\n {...autocompleteProps}\n renderInput={(parameters) => (\n <TextField\n {...parameters}\n name={field.name}\n error={error}\n helperText={helperText}\n {...textFieldProps}\n />\n )}\n />\n );\n};\n","import { Checkbox, FormControl, FormControlLabel, FormHelperText } from \"@mui/material\";\nimport type { CheckboxProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { useId } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/useForm\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormCheckboxProps extends Omit<CheckboxProps, FormOmittedProps> {\n label?: string;\n}\n\nexport const FormCheckbox: FC<FormCheckboxProps> = ({ label, ...props }) => {\n const field = useFieldContext<boolean | null | undefined>();\n const { error, helperText } = getFieldStatus(field);\n const helperId = useId();\n\n return (\n <FormControl error={error}>\n <FormControlLabel\n control={\n <Checkbox\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />\n }\n label={label ?? \"\"}\n />\n {error && <FormHelperText id={helperId}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { DatePicker, DateTimePicker, TimePicker } from \"@mui/x-date-pickers\";\nimport type { DatePickerProps, DateTimePickerProps, TimePickerProps } from \"@mui/x-date-pickers\";\nimport type { PickersTextFieldProps } from \"@mui/x-date-pickers/PickersTextField\";\nimport type { Dayjs } from \"dayjs\";\nimport type { ElementType, FC } from \"react\";\nimport { useFieldContext } from \"~/hooks/useForm\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\ntype FormPickerProps<TProps> = Omit<TProps, FormOmittedProps> & {\n textFieldProps?: Partial<PickersTextFieldProps>;\n};\n\nexport type FormDatePickerProps = FormPickerProps<DatePickerProps>;\nexport type FormTimePickerProps = FormPickerProps<TimePickerProps>;\nexport type FormDateTimePickerProps = FormPickerProps<DateTimePickerProps>;\n\ninterface PickerFieldProps {\n Picker: ElementType;\n textFieldProps?: Partial<PickersTextFieldProps>;\n slotProps?: { textField?: object };\n}\n\n/** `Picker` bound to the form field. The app's slotProps are kept; its text field props win. */\nfunction PickerField({ Picker, textFieldProps, slotProps, ...props }: PickerFieldProps) {\n const field = useFieldContext<Dayjs | null | undefined>();\n const { error, helperText } = getFieldStatus(field);\n\n return (\n <Picker\n {...props}\n name={field.name}\n value={field.state.value}\n onChange={(value: Dayjs | null) => field.handleChange(value)}\n slotProps={{\n ...slotProps,\n textField: {\n ...slotProps?.textField,\n onBlur: field.handleBlur,\n error,\n helperText,\n ...textFieldProps,\n },\n }}\n />\n );\n}\n\nexport const FormDatePicker: FC<FormDatePickerProps> = (props) => (\n <PickerField Picker={DatePicker} {...props} />\n);\n\nexport const FormTimePicker: FC<FormTimePickerProps> = (props) => (\n <PickerField Picker={TimePicker} {...props} />\n);\n\nexport const FormDateTimePicker: FC<FormDateTimePickerProps> = (props) => (\n <PickerField Picker={DateTimePicker} {...props} />\n);\n","import { TextField } from \"@mui/material\";\nimport { NumericFormat } from \"react-number-format\";\nimport type { InputAttributes, NumericFormatProps } from \"react-number-format/types/types\";\nimport type { FC } from \"react\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/useForm\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormNumberFieldProps extends Omit<TextFieldProps, FormOmittedProps> {\n defaultValue?: number | null;\n options?: Omit<\n NumericFormatProps<InputAttributes>,\n \"customInput\" | \"onValueChange\" | keyof InputAttributes\n >;\n}\n\nexport const FormNumberField: FC<FormNumberFieldProps> = ({ options, ...props }) => {\n const field = useFieldContext<number | null | undefined>();\n const { error, helperText } = getFieldStatus(field);\n\n return (\n <NumericFormat\n customInput={TextField}\n name={field.name}\n value={field.state.value ?? \"\"}\n onValueChange={({ floatValue }) => field.handleChange(floatValue)}\n onBlur={field.handleBlur}\n error={error}\n helperText={helperText}\n {...props}\n {...options}\n />\n );\n};\n","import {\n FormControl,\n FormControlLabel,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup,\n} from \"@mui/material\";\nimport type { RadioGroupProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { useId } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/useForm\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\ninterface Option {\n label: string;\n value: string | number;\n}\n\nexport interface FormRadioGroupProps extends Omit<RadioGroupProps, FormOmittedProps> {\n label?: string;\n options: Array<Option>;\n}\n\nexport const FormRadioGroup: FC<FormRadioGroupProps> = ({ label, options, ...props }) => {\n const field = useFieldContext<string | number | null | undefined>();\n const { error, helperText } = getFieldStatus(field);\n const helperId = useId();\n\n return (\n <FormControl component=\"fieldset\" error={error}>\n {label && <FormLabel component=\"legend\">{label}</FormLabel>}\n <RadioGroup\n name={field.name}\n value={field.state.value ?? \"\"}\n onChange={(event) => field.handleChange(event.target.value)}\n onBlur={field.handleBlur}\n aria-invalid={error || undefined}\n aria-describedby={error ? helperId : undefined}\n {...props}\n >\n {options.map((option) => (\n <FormControlLabel\n key={option.value}\n value={option.value}\n control={<Radio />}\n label={option.label}\n />\n ))}\n </RadioGroup>\n {error && <FormHelperText id={helperId}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { FormControl, FormHelperText, FormLabel, Slider } from \"@mui/material\";\nimport type { SliderProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { useId } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/useForm\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormSliderProps extends Omit<SliderProps, FormOmittedProps> {\n label?: string;\n}\n\nexport const FormSlider: FC<FormSliderProps> = ({ label, ...props }) => {\n const field = useFieldContext<number | null | undefined>();\n const { error, helperText } = getFieldStatus(field);\n const labelId = useId();\n const helperId = useId();\n\n return (\n <FormControl error={error}>\n {label && <FormLabel id={labelId}>{label}</FormLabel>}\n <Slider\n name={field.name}\n value={field.state.value ?? 0}\n onChange={(_, value) => field.handleChange(Array.isArray(value) ? value[0] : value)}\n onBlur={field.handleBlur}\n aria-labelledby={label ? labelId : undefined}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />\n {error && <FormHelperText id={helperId}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { Button } from \"@mui/material\";\nimport type { ButtonProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { useFormContext } from \"~/hooks/useForm\";\n\nexport type FormSubmitButtonProps = Omit<ButtonProps, \"loading\" | \"disabled\" | \"onClick\" | \"type\">;\n\nexport const FormSubmitButton: FC<FormSubmitButtonProps> = (props) => {\n const form = useFormContext();\n\n const handleClick = async (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n const scope = event.currentTarget.form ?? document;\n await form.handleSubmit();\n\n const fieldMeta: Partial<Record<string, { errors: Array<unknown> }>> = form.state.fieldMeta;\n // After the errors render, so the screen reader reads the field together with its error.\n requestAnimationFrame(() => {\n const invalid = Array.from(\n scope.querySelectorAll<HTMLElement>(\"input[name], textarea[name], select[name]\"),\n ).find((element) => fieldMeta[element.getAttribute(\"name\") ?? \"\"]?.errors.length);\n // MUI keeps the value of a Select or picker in a hidden input next to the visible control.\n const target =\n invalid?.getAttribute(\"aria-hidden\") === \"true\"\n ? (invalid.parentElement?.querySelector<HTMLElement>('[tabindex=\"0\"]') ?? invalid)\n : invalid;\n target?.focus();\n });\n };\n\n return (\n <form.Subscribe selector={(state) => state.isSubmitting}>\n {(isSubmitting) => (\n <Button loading={isSubmitting} onClick={handleClick} type=\"submit\" {...props} />\n )}\n </form.Subscribe>\n );\n};\n","import { Switch, FormControl, FormControlLabel, FormHelperText } from \"@mui/material\";\nimport type { SwitchProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { useId } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/useForm\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormSwitchProps extends Omit<SwitchProps, FormOmittedProps> {\n label?: string;\n}\n\nexport const FormSwitch: FC<FormSwitchProps> = ({ label, ...props }) => {\n const field = useFieldContext<boolean | null | undefined>();\n const { error, helperText } = getFieldStatus(field);\n const helperId = useId();\n\n return (\n <FormControl error={error}>\n <FormControlLabel\n control={\n <Switch\n name={field.name}\n checked={Boolean(field.state.value)}\n onChange={(event) => field.handleChange(event.target.checked)}\n onBlur={field.handleBlur}\n slotProps={{\n input: {\n \"aria-invalid\": error || undefined,\n \"aria-describedby\": error ? helperId : undefined,\n },\n }}\n {...props}\n />\n }\n label={label ?? \"\"}\n />\n {error && <FormHelperText id={helperId}>{helperText}</FormHelperText>}\n </FormControl>\n );\n};\n","import { TextField } from \"@mui/material\";\nimport type { TextFieldProps } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport type { FormOmittedProps } from \"~/lib/utils\";\nimport { useFieldContext } from \"~/hooks/useForm\";\nimport { getFieldStatus } from \"~/lib/utils\";\n\nexport interface FormTextFieldProps extends Omit<TextFieldProps, FormOmittedProps> {\n type?: \"color\" | \"email\" | \"password\" | \"search\" | \"tel\" | \"text\" | \"url\";\n}\n\nexport const FormTextField: FC<FormTextFieldProps> = (props) => {\n const field = useFieldContext<string | number | null | undefined>();\n const { error, helperText } = getFieldStatus(field);\n\n return (\n <TextField\n name={field.name}\n value={field.state.value ?? \"\"}\n onChange={(event) => field.handleChange(event.target.value)}\n onBlur={field.handleBlur}\n error={error}\n helperText={helperText}\n {...props}\n />\n );\n};\n","import { createFormHook, createFormHookContexts } from \"@tanstack/react-form\";\nimport type { AnyFieldApi } from \"@tanstack/react-form\";\nimport { FormAutocomplete as Autocomplete } from \"~/components/form/FormAutocomplete\";\nimport { FormCheckbox as Checkbox } from \"~/components/form/FormCheckbox\";\nimport {\n FormDatePicker as DatePicker,\n FormDateTimePicker as DateTimePicker,\n FormTimePicker as TimePicker,\n} from \"~/components/form/FormPickers\";\nimport { FormNumberField as NumberField } from \"~/components/form/FormNumberField\";\nimport { FormRadioGroup as RadioGroup } from \"~/components/form/FormRadioGroup\";\nimport { FormSlider as Slider } from \"~/components/form/FormSlider\";\nimport { FormSubmitButton as SubmitButton } from \"~/components/form/FormSubmitButton\";\nimport { FormSwitch as Switch } from \"~/components/form/FormSwitch\";\nimport { FormTextField as TextField } from \"~/components/form/FormTextField\";\n\nexport const { fieldContext, useFieldContext, formContext, useFormContext } =\n createFormHookContexts();\n\nconst fieldComponents = {\n TextField,\n NumberField,\n Autocomplete,\n Checkbox,\n Switch,\n RadioGroup,\n Slider,\n DatePicker,\n TimePicker,\n DateTimePicker,\n};\n\n/** The `field` an `AppField` render prop receives, e.g. in a column's `meta.edit`. */\nexport type LayoutFieldApi = AnyFieldApi & typeof fieldComponents;\n\nexport const { useAppForm: useLayoutForm, withForm: withLayoutForm } = createFormHook({\n fieldComponents,\n formComponents: {\n SubmitButton,\n },\n fieldContext,\n formContext,\n});\n","import type { Theme } from \"@mui/material\";\nimport type { DisplayHotkey } from \"@tanstack/react-hotkeys\";\nimport { formatForDisplay } from \"@tanstack/react-hotkeys\";\nimport type { Cell, CellData, Column, RowData } from \"@tanstack/react-table\";\nimport type { Range } from \"@tanstack/react-virtual\";\nimport { defaultRangeExtractor } from \"@tanstack/react-virtual\";\nimport type { LayoutTableFeatures } from \"~/components/table/context\";\nimport type { LayoutColumnMeta } from \"./types\";\n\n/** Stable class names on every table part, for `sx` selectors like `.MuiDataGrid-*`. */\nexport const layoutTableClasses = {\n root: \"LayoutTable-root\",\n main: \"LayoutTable-main\",\n table: \"LayoutTable-table\",\n\n toolbar: \"LayoutTable-toolbar\",\n toolbarLabel: \"LayoutTable-toolbarLabel\",\n toolbarTitle: \"LayoutTable-toolbarTitle\",\n toolbarSelectedCount: \"LayoutTable-toolbarSelectedCount\",\n toolbarDivider: \"LayoutTable-toolbarDivider\",\n toolbarQuickFilter: \"LayoutTable-toolbarQuickFilter\",\n columnsButton: \"LayoutTable-columnsButton\",\n columnsPanel: \"LayoutTable-columnsPanel\",\n filtersButton: \"LayoutTable-filtersButton\",\n filterPanel: \"LayoutTable-filterPanel\",\n\n columnHeaders: \"LayoutTable-columnHeaders\",\n columnHeaderRow: \"LayoutTable-columnHeaderRow\",\n columnHeader: \"LayoutTable-columnHeader\",\n \"columnHeader--sortable\": \"LayoutTable-columnHeader--sortable\",\n \"columnHeader--sorted\": \"LayoutTable-columnHeader--sorted\",\n \"columnHeader--filtered\": \"LayoutTable-columnHeader--filtered\",\n \"columnHeader--pinnedStart\": \"LayoutTable-columnHeader--pinnedStart\",\n \"columnHeader--pinnedEnd\": \"LayoutTable-columnHeader--pinnedEnd\",\n columnHeaderContent: \"LayoutTable-columnHeaderContent\",\n columnHeaderTitleContainer: \"LayoutTable-columnHeaderTitleContainer\",\n sortLabel: \"LayoutTable-sortLabel\",\n sortIndex: \"LayoutTable-sortIndex\",\n menuIcon: \"LayoutTable-menuIcon\",\n columnSeparator: \"LayoutTable-columnSeparator\",\n \"columnSeparator--resizable\": \"LayoutTable-columnSeparator--resizable\",\n \"columnSeparator--resizing\": \"LayoutTable-columnSeparator--resizing\",\n\n body: \"LayoutTable-body\",\n row: \"LayoutTable-row\",\n \"row--grouped\": \"LayoutTable-row--grouped\",\n \"row--expanded\": \"LayoutTable-row--expanded\",\n \"row--pinned\": \"LayoutTable-row--pinned\",\n cell: \"LayoutTable-cell\",\n \"cell--selected\": \"LayoutTable-cell--selected\",\n \"cell--grouped\": \"LayoutTable-cell--grouped\",\n \"cell--aggregated\": \"LayoutTable-cell--aggregated\",\n \"cell--pinnedStart\": \"LayoutTable-cell--pinnedStart\",\n \"cell--pinnedEnd\": \"LayoutTable-cell--pinnedEnd\",\n cellEditor: \"LayoutTable-cellEditor\",\n editButton: \"LayoutTable-editButton\",\n groupCell: \"LayoutTable-groupCell\",\n expandButton: \"LayoutTable-expandButton\",\n actionsCell: \"LayoutTable-actionsCell\",\n cellOffset: \"LayoutTable-cellOffset\",\n rowOffset: \"LayoutTable-rowOffset\",\n filler: \"LayoutTable-filler\",\n skeletonRow: \"LayoutTable-skeletonRow\",\n skeletonCell: \"LayoutTable-skeletonCell\",\n overlay: \"LayoutTable-overlay\",\n\n footer: \"LayoutTable-footer\",\n footerRow: \"LayoutTable-footerRow\",\n footerCell: \"LayoutTable-footerCell\",\n aggregationValue: \"LayoutTable-aggregationValue\",\n pagination: \"LayoutTable-pagination\",\n} as const;\n\nexport const classNames = (...names: Array<string | false | null | undefined>): string =>\n names.filter(Boolean).join(\" \");\n\nexport const pinnedClass = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n part: \"columnHeader\" | \"cell\",\n): string | false => {\n const pinned = column.getIsPinned();\n return (\n !!pinned && layoutTableClasses[`${part}--${pinned === \"start\" ? \"pinnedStart\" : \"pinnedEnd\"}`]\n );\n};\n\nexport const shortcutLabel = (label: string, hotkey: DisplayHotkey): string =>\n `${label} (${formatForDisplay(hotkey)})`;\n\ntype AnyColumn<TData extends RowData, TValue extends CellData> = Column<\n LayoutTableFeatures,\n TData,\n TValue\n>;\n\nexport const columnLabel = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n): string => {\n const meta = column.columnDef.meta as LayoutColumnMeta | undefined;\n if (meta?.label) return meta.label;\n\n return typeof column.columnDef.header === \"string\" ? column.columnDef.header : column.id;\n};\n\nexport const hasColumnLabel = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n): boolean =>\n Boolean((column.columnDef.meta as LayoutColumnMeta | undefined)?.label) ||\n typeof column.columnDef.header === \"string\";\n\nexport const columnAlign = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n): \"left\" | \"center\" | \"right\" =>\n (column.columnDef.meta as LayoutColumnMeta | undefined)?.align ??\n (hasColumnLabel(column) ? \"left\" : \"center\");\n\n/** The column's `meta.flex`, or 0 once the user has resized it to a fixed width. */\nexport const columnFlex = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n): number =>\n Object.hasOwn(column.table.atoms.columnSizing.get(), column.id)\n ? 0\n : ((column.columnDef.meta as LayoutColumnMeta | undefined)?.flex ?? 0);\n\nexport const moveColumn = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n delta: number,\n): void => {\n const { table } = column;\n const current = table.atoms.columnOrder.get();\n const order = current.length ? [...current] : table.getAllLeafColumns().map(({ id }) => id);\n const from = order.indexOf(column.id);\n const to = from + delta;\n if (from < 0 || to < 0 || to >= order.length) return;\n\n order.splice(to, 0, ...order.splice(from, 1));\n table.setColumnOrder(order);\n};\n\nexport const pinnedSx = <TData extends RowData, TValue extends CellData>(\n column: AnyColumn<TData, TValue>,\n isHeader = false,\n) => {\n const pinned = column.getIsPinned();\n if (!pinned) return {};\n\n return {\n position: \"sticky\",\n zIndex: isHeader ? 4 : 2,\n insetInlineStart: pinned === \"start\" ? column.getStart(\"start\") : undefined,\n insetInlineEnd: pinned === \"end\" ? column.getAfter(\"end\") : undefined,\n bgcolor: \"background.paper\",\n // `theme.vars`, not `theme.palette`: under cssVariables the palette holds the light scheme's\n // literal values, so dark mode would get them too.\n ...(!isHeader && {\n \".MuiTableRow-root:hover > &\": {\n backgroundImage: (theme: Theme) => {\n const { hover } = (theme.vars ?? theme).palette.action;\n return `linear-gradient(${hover}, ${hover})`;\n },\n },\n \".MuiTableRow-root.Mui-selected > &\": {\n backgroundImage: (theme: Theme) => {\n const { selected } = (theme.vars ?? theme).palette.action;\n return `linear-gradient(${selected}, ${selected})`;\n },\n },\n }),\n ...(pinned === \"start\" &&\n column.getIsLastColumn(\"start\") && {\n borderInlineEnd: 1,\n borderInlineEndStyle: \"solid\",\n borderColor: \"divider\",\n }),\n ...(pinned === \"end\" &&\n column.getIsFirstColumn(\"end\") && {\n borderInlineStart: 1,\n borderInlineStartStyle: \"solid\",\n borderColor: \"divider\",\n }),\n };\n};\n\nexport const cellSelectionSx = <TData extends RowData, TValue extends CellData>(\n cell: Cell<LayoutTableFeatures, TData, TValue>,\n) => {\n if (!cell.getIsSelected()) return {};\n\n const edges = cell.getSelectionEdges();\n // `theme.vars` for the dark scheme's colours, as in pinnedSx.\n const outline = (theme: Theme) => {\n const color = (theme.vars ?? theme).palette.primary.main;\n return (\n [\n edges.top && `inset 0 2px 0 0 ${color}`,\n edges.bottom && `inset 0 -2px 0 0 ${color}`,\n edges.left && `inset 2px 0 0 0 ${color}`,\n edges.right && `inset -2px 0 0 0 ${color}`,\n ]\n .filter(Boolean)\n .join(\", \") || \"none\"\n );\n };\n\n return {\n backgroundImage: (theme: Theme) => {\n const { selected } = (theme.vars ?? theme).palette.action;\n return `linear-gradient(${selected}, ${selected})`;\n },\n boxShadow: outline,\n };\n};\n\n/** Spreadsheet TSV quoting, so a cell holding a tab or a newline stays one cell. */\nconst quoteTsv = (text: string): string =>\n /[\"\\t\\n\\r]/.test(text) ? `\"${text.replaceAll('\"', '\"\"')}\"` : text;\n\nconst toClipboardValue = (value: unknown): string => {\n if (value == null) return \"\";\n if (typeof value === \"string\") return quoteTsv(value);\n if (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\")\n return quoteTsv(String(value));\n if (value instanceof Date) return quoteTsv(value.toISOString());\n\n // Everything else — objects, and the odd symbol or function — as JSON or blank.\n return quoteTsv(JSON.stringify(value) ?? \"\");\n};\n\n/**\n * Serializes `table.getSelectedCellRangesData()` as TSV, which is what Excel,\n * Google Sheets and LibreOffice all paste as a grid. Disjoint selection regions\n * are separated by a blank line.\n */\nexport const toClipboardText = (regions: Array<Array<Array<unknown>>>): string =>\n regions\n .map((rows) => rows.map((cells) => cells.map(toClipboardValue).join(\"\\t\")).join(\"\\n\"))\n .join(\"\\n\\n\");\n\nexport const lookaheadRange = (\n range: Range,\n direction: \"forward\" | \"backward\" | null,\n lookahead: number,\n): Array<number> => {\n const behind = direction ? 0 : range.overscan;\n const ahead = direction ? lookahead : range.overscan;\n\n return defaultRangeExtractor({\n ...range,\n startIndex: range.startIndex - (direction === \"backward\" ? ahead : behind),\n endIndex: range.endIndex + (direction === \"backward\" ? behind : ahead),\n overscan: 0,\n });\n};\n","import dayjs from \"dayjs\";\n\nexport const formatValue = (value: unknown, dateFormat = \"L LT\", locale?: string): string => {\n if (value === null || value === undefined) return \"\";\n if (value instanceof Date)\n return dayjs(value)\n .locale(locale ?? dayjs.locale())\n .format(dateFormat);\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\") {\n return value.toString();\n }\n\n return JSON.stringify(value) ?? \"\";\n};\n","import {\n aggregationFn_count,\n aggregationFn_extent,\n aggregationFn_first,\n aggregationFn_last,\n aggregationFn_max,\n aggregationFn_mean,\n aggregationFn_median,\n aggregationFn_min,\n aggregationFn_sum,\n aggregationFn_unique,\n aggregationFn_uniqueCount,\n createExpandedRowModel,\n createFacetedMinMaxValues,\n createFacetedRowModel,\n createFacetedUniqueValues,\n createFilteredRowModel,\n createGroupedRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n createTableHookContexts,\n metaHelper,\n sortFn_alphanumeric,\n sortFn_alphanumericCaseSensitive,\n sortFn_basic,\n sortFn_datetime,\n sortFn_text,\n sortFn_textCaseSensitive,\n stockFeatures,\n tableFeatures,\n} from \"@tanstack/react-table\";\nimport type { AggregationFnDef } from \"@tanstack/react-table\";\nimport type { LayoutColumnMeta } from \"~/components/table/types\";\n\n// table-core types min/max/extent with its non-exported `RangeValue`, which breaks .d.ts emit.\ntype RangeValue = Date | number | undefined;\ntype WithResult<TFn, TResult> =\n TFn extends AggregationFnDef<infer TFeatures, infer TData, infer TValue, unknown>\n ? AggregationFnDef<TFeatures, TData, TValue, TResult>\n : never;\n\n// ponytail: no filterFns registry. Every column filters with `dynamicFilterFn` (see\n// `useLayoutTable`); register filterFn_* here if a column must name a filter by string.\nexport const layoutTableFeatures = tableFeatures({\n ...stockFeatures,\n columnMeta: metaHelper<LayoutColumnMeta>(),\n filteredRowModel: createFilteredRowModel(),\n sortedRowModel: createSortedRowModel(),\n paginatedRowModel: createPaginatedRowModel(),\n expandedRowModel: createExpandedRowModel(),\n groupedRowModel: createGroupedRowModel(),\n facetedRowModel: createFacetedRowModel(),\n facetedUniqueValues: createFacetedUniqueValues(),\n facetedMinMaxValues: createFacetedMinMaxValues(),\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n alphanumericCaseSensitive: sortFn_alphanumericCaseSensitive,\n basic: sortFn_basic,\n datetime: sortFn_datetime,\n text: sortFn_text,\n textCaseSensitive: sortFn_textCaseSensitive,\n },\n aggregationFns: {\n sum: aggregationFn_sum,\n min: aggregationFn_min as WithResult<typeof aggregationFn_min, RangeValue>,\n max: aggregationFn_max as WithResult<typeof aggregationFn_max, RangeValue>,\n extent: aggregationFn_extent as WithResult<\n typeof aggregationFn_extent,\n [RangeValue, RangeValue]\n >,\n mean: aggregationFn_mean,\n median: aggregationFn_median,\n unique: aggregationFn_unique,\n uniqueCount: aggregationFn_uniqueCount,\n count: aggregationFn_count,\n first: aggregationFn_first,\n last: aggregationFn_last,\n },\n});\n\nexport type LayoutTableFeatures = typeof layoutTableFeatures;\n\nexport const {\n tableContext,\n cellContext,\n headerContext,\n useTableContext,\n useCellContext,\n useHeaderContext,\n} = createTableHookContexts<LayoutTableFeatures>();\n","import type { TypographyProps } from \"@mui/material\";\nimport { Typography } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { formatValue } from \"~/components/table/formatValue\";\nimport { useCellContext } from \"~/components/table/context\";\nimport { useTranslation } from \"~/hooks/useTranslation\";\n\nexport const AggregatedCell: FC<\n TypographyProps & {\n prefix?: string;\n options?: Intl.NumberFormatOptions;\n dateFormat?: string;\n }\n> = ({ prefix = \"\", options, dateFormat, ...props }) => {\n const cell = useCellContext();\n const { i18n } = useTranslation();\n const value = cell.getValue();\n if (value === null || value === undefined || value === \"\") return null;\n\n const format = (entry: unknown) =>\n typeof entry === \"number\"\n ? entry.toLocaleString(undefined, options)\n : formatValue(entry, dateFormat, i18n.language);\n\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" noWrap {...props}>\n {prefix}\n {/* `extent` — the default aggregate for anything non-numeric — is a [min, max] pair. */}\n {Array.isArray(value) ? value.map(format).join(\" – \") : format(value)}\n </Typography>\n );\n};\n","import {\n Accordion,\n AccordionActions,\n AccordionDetails,\n AccordionSummary,\n Alert,\n AlertTitle,\n Avatar,\n AvatarGroup,\n Badge,\n Box,\n Breadcrumbs,\n Button,\n ButtonGroup,\n Card,\n CardActions,\n CardContent,\n CardHeader,\n CardMedia,\n Checkbox,\n Chip,\n CircularProgress,\n Divider,\n FormControl,\n FormControlLabel,\n FormGroup,\n FormHelperText,\n FormLabel,\n Grid,\n ImageList,\n ImageListItem,\n ImageListItemBar,\n InputLabel,\n LinearProgress,\n Link,\n List,\n ListItem,\n ListItemAvatar,\n ListItemText,\n ListSubheader,\n MenuItem,\n Paper,\n Radio,\n RadioGroup,\n Rating,\n Select,\n Skeleton,\n Slider,\n Stack,\n Step,\n StepContent,\n StepLabel,\n Stepper,\n Switch,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableFooter,\n TableHead,\n TableRow,\n TextField,\n Tooltip,\n Typography,\n} from \"@mui/material\";\nimport { toolDefinition } from \"@tanstack/ai/client\";\nimport type { ElementType } from \"react\";\nimport { z } from \"zod\";\n\n/**\n * The MUI components the model may render, under their own names. Props pass through\n * untouched, so they are MUI's official props (`ComponentProps<typeof Card>`). Add a\n * component here and both tools offer it. Left out: anything that needs state, an icon,\n * an overlay or a callback to work.\n */\nexport const components = {\n Accordion,\n AccordionActions,\n AccordionDetails,\n AccordionSummary,\n Alert,\n AlertTitle,\n Avatar,\n AvatarGroup,\n Badge,\n Box,\n Breadcrumbs,\n Button,\n ButtonGroup,\n Card,\n CardActions,\n CardContent,\n CardHeader,\n CardMedia,\n Checkbox,\n Chip,\n CircularProgress,\n Divider,\n FormControl,\n FormControlLabel,\n FormGroup,\n FormHelperText,\n FormLabel,\n Grid,\n ImageList,\n ImageListItem,\n ImageListItemBar,\n InputLabel,\n LinearProgress,\n Link,\n List,\n ListItem,\n ListItemAvatar,\n ListItemText,\n ListSubheader,\n MenuItem,\n Paper,\n Radio,\n RadioGroup,\n Rating,\n Select,\n Skeleton,\n Slider,\n Stack,\n Step,\n StepContent,\n StepLabel,\n Stepper,\n Switch,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableFooter,\n TableHead,\n TableRow,\n TextField,\n Tooltip,\n Typography,\n} satisfies Record<string, ElementType>;\n\nexport type ComponentName = keyof typeof components;\n\n/**\n * The TanStack Charts marks a `Chart` node takes as children, under their own names. Props pass\n * through untouched too: the rows as `data`, the rest the mark's official options. Only the\n * names live here; the marks load with the first chart, so a chart costs nothing until one shows.\n */\nexport const chartMarks = [\n \"areaX\",\n \"areaY\",\n \"arrow\",\n \"bandX\",\n \"bandY\",\n \"barX\",\n \"barY\",\n \"boxX\",\n \"boxY\",\n \"cell\",\n \"crosshair\",\n \"differenceX\",\n \"differenceY\",\n \"dot\",\n \"frame\",\n \"hexagon\",\n \"lineX\",\n \"lineY\",\n \"linearRegressionX\",\n \"linearRegressionY\",\n \"link\",\n \"rect\",\n \"ridgelineX\",\n \"ridgelineY\",\n \"ruleX\",\n \"ruleY\",\n \"text\",\n \"tickX\",\n \"tickY\",\n \"vector\",\n \"violinX\",\n \"violinY\",\n \"waffleX\",\n \"waffleY\",\n] as const;\n\nexport type ChartMarkName = (typeof chartMarks)[number];\n\ntype NodeType = ComponentName | \"Chart\" | ChartMarkName;\n\n/**\n * `show_ui` and `ask_user`. Built on call, not at import: `wcz-layout/hooks` is imported by\n * every app, and module-level calls survive tree-shaking, registry and all.\n */\nexport function createUiTools() {\n const types: Array<NodeType> = [\n ...(Object.keys(components) as Array<ComponentName>),\n \"Chart\",\n ...chartMarks,\n ];\n const UiNode = z.object({\n type: z.enum(types as [NodeType, ...Array<NodeType>]),\n props: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\n \"Official props of the MUI component (sx works), or of the TanStack Charts chart or mark. \" +\n \"A prop can hold a node.\",\n ),\n get children() {\n const child = z.union([z.string(), z.number(), UiNode]);\n return z\n .union([child, z.array(child)])\n .optional()\n .describe(\"Text, a node, or a list of them\");\n },\n });\n const uiInput = z.object({ ui: UiNode });\n\n return [\n toolDefinition({\n name: \"show_ui\",\n description:\n \"Show Material UI (MUI v9) components in the chat. Prefer it to markdown for structured \" +\n \"content: tables, cards, lists, key facts, statuses, steps and progress.\" +\n \"`ui` is one node { type, props, children }: `type` is the component, `props` its \" +\n \"official MUI props (sx works; a prop can hold a node, e.g. CardHeader avatar or Alert \" +\n \"action), `children` text, a node or a list of them. MUI v9 has no system props: \" +\n \"alignItems, gap, p, m and the like go in sx. Grid takes `container`, and `size` on \" +\n \"children (e.g. { xs: 12, sm: 6 }); never `item` or `xs`. The chat can be as narrow as \" +\n \"a phone. Callbacks do nothing; to let the user answer, use ask_user. \" +\n \"A Chart node draws numbers that compare or change with TanStack Charts. Its props are \" +\n \"the defineChart spec without marks: scales.x and scales.y, each { scale: 'band' for \" +\n \"categories, 'point' for ordered labels such as months, 'linear' for numbers (the \" +\n \"default), and the official options such as axis: { label }, grid, nice; padding and a \" +\n \"fixed domain work too }, color ({ legend: true for several series, domain }), focus \" +\n \"('group-x' for lines); and the Chart's ariaLabel and height. Its children are the \" +\n \"marks (barY, barX, lineY, areaY, dot, ruleY, text, cell, crosshair and the rest), each \" +\n \"with props { data: the rows, then the mark's official options, channels naming fields, \" +\n \"e.g. x: 'month', y: 'count', color: 'state' }. Bars at the same x stack; layout: \" +\n \"{ type: 'group' } puts them side by side. A line takes points: true for its dots: a \" +\n \"dot mark of its own adds a second tooltip row. Dates are labels: there is no time scale.\",\n inputSchema: uiInput,\n }).client(() => ({ shown: true })),\n toolDefinition({\n name: \"ask_user\",\n description:\n \"Ask the user with a Material UI form and wait for the answer. Same `ui` format as \" +\n \"show_ui. Give every input a `name`: TextField (type date/number work; select: true \" +\n \"with MenuItem children), FormControlLabel with a Checkbox, Switch or Radio `control`, \" +\n \"RadioGroup, Slider, Rating. Add Button(s) with type 'submit'; the clicked button's \" +\n \"name/value is included, so several buttons work as choices. Returns { [name]: value }: \" +\n \"repeated names give arrays, unchecked boxes are left out. Never use it to confirm a \" +\n \"tool call: tools that need approval ask the user themselves.\",\n inputSchema: uiInput,\n }).client(),\n ] as const;\n}\n","import { Alert, Box, Skeleton, Typography } from \"@mui/material\";\nimport { parsePartialJSON } from \"@tanstack/ai-react\";\nimport type { UIMessage } from \"@tanstack/ai-react\";\nimport { CatchBoundary } from \"@tanstack/react-router\";\nimport { createContext, lazy, Suspense, useContext } from \"react\";\nimport type { ElementType, FormEvent, Key, ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { components } from \"~/lib/ai/tools/ui\";\nimport type { ComponentName } from \"~/lib/ai/tools/ui\";\n\ntype ToolCallPart = Extract<UIMessage[\"parts\"][number], { type: \"tool-call\" }>;\n\n/** Keys that run code or swap the rendered element. Checked at every depth: slotProps nest. */\nconst BLOCKED =\n /^([oO][nN]|form[A-Z]|component$|slots$|as$|key$|ref$|dangerouslySetInnerHTML$)|(Component|Ref)$/;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isNode = (\n value: unknown,\n): value is { type: ComponentName; props?: unknown; children?: unknown } =>\n isRecord(value) && typeof value.type === \"string\" && Object.hasOwn(components, value.type);\n\nconst isChart = (value: unknown): value is Record<string, unknown> =>\n isRecord(value) && value.type === \"Chart\";\n\nconst GeneratedChart = lazy(() =>\n import(\"./generatedChart\").then(({ GeneratedChart }) => ({ default: GeneratedChart })),\n);\n\nconst Streaming = createContext(false);\n\n/** Drawn once the arguments are complete; its data and options reach TanStack Charts as written. */\nfunction ChartNode({ node }: Readonly<{ node: Record<string, unknown> }>) {\n const streaming = useContext(Streaming);\n const { height } = isRecord(node.props) ? node.props : {};\n const placeholder = (\n <Skeleton variant=\"rounded\" height={typeof height === \"number\" ? height : 280} />\n );\n\n return streaming ? (\n placeholder\n ) : (\n <Suspense fallback={placeholder}>\n <GeneratedChart node={node} />\n </Suspense>\n );\n}\n\n/** Model-written props without blocked keys or password fields; nodes become elements. */\nconst toProps = (value: unknown): unknown => {\n if (isNode(value) || isChart(value)) return renderGeneratedUi(value);\n if (Array.isArray(value)) return value.map(toProps);\n if (!isRecord(value)) return value;\n return Object.fromEntries(\n Object.entries(value)\n .filter(([name, item]) => !BLOCKED.test(name) && !(name === \"type\" && item === \"password\"))\n .map(([name, item]) => [name, toProps(item)]),\n );\n};\n\n/** A node tree as the model wrote it. Anything that is not a known component renders nothing. */\nexport function renderGeneratedUi(value: unknown, key?: Key): ReactNode {\n if (typeof value === \"string\" || typeof value === \"number\") return value;\n // A lone child stays unwrapped: Tooltip and friends take exactly one element.\n if (Array.isArray(value))\n return value.length === 1 ? renderGeneratedUi(value[0], key) : value.map(renderGeneratedUi);\n if (isChart(value)) return <ChartNode key={key} node={value} />;\n if (!isNode(value)) return null;\n\n const Component: ElementType = components[value.type];\n const { children, ...props } = isRecord(value.props) ? value.props : {};\n return (\n <Component key={key} {...(toProps(props) as Record<string, unknown>)}>\n {renderGeneratedUi(value.children ?? children)}\n </Component>\n );\n}\n\n/** `show_ui`. Renders while the arguments still stream, so the UI builds up as the model writes it. */\nexport function GeneratedUi({ part }: Readonly<{ part: ToolCallPart }>) {\n const { t } = useTranslation();\n const input = (part.input ?? (parsePartialJSON(part.arguments) as unknown)) as\n | { ui?: unknown }\n | undefined;\n\n return (\n // Wide content (a table with many columns) scrolls inside the chat instead of widening the page.\n <Box sx={{ overflowX: \"auto\", m: -0.5, p: 0.5 }}>\n <CatchBoundary\n getResetKey={() => part.arguments}\n errorComponent={() => <Alert severity=\"warning\">{t(\"Layout.Chat.RenderFailed\")}</Alert>}\n >\n <Streaming value={part.input === undefined}>{renderGeneratedUi(input?.ui)}</Streaming>\n </CatchBoundary>\n </Box>\n );\n}\n\n/** `ask_user`. Submitting sends `{ [name]: value }` back to the model as the tool's result. */\nexport function AskUser({\n part,\n disabled,\n onAnswer,\n}: Readonly<{\n part: ToolCallPart;\n disabled: boolean;\n onAnswer: (values: Record<string, unknown>) => void;\n}>) {\n const answer: unknown = part.output;\n\n const submit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const { submitter } = event.nativeEvent as SubmitEvent;\n const values: Record<string, unknown> = {};\n for (const [name, value] of new FormData(event.currentTarget, submitter)) {\n const previous = values[name];\n values[name] = previous === undefined ? value : [previous, value].flat();\n }\n onAnswer(values);\n };\n\n return (\n <Box component=\"form\" onSubmit={submit}>\n <Box\n component=\"fieldset\"\n disabled={disabled}\n sx={{\n border: 0,\n m: 0,\n p: 0,\n minWidth: 0,\n opacity: answer === undefined ? 1 : 0.6,\n pointerEvents: disabled ? \"none\" : undefined,\n }}\n >\n <GeneratedUi part={part} />\n </Box>\n {isRecord(answer) && (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {Object.entries(answer)\n .map(([name, value]) => `${name}: ${String(value)}`)\n .join(\", \")}\n </Typography>\n )}\n </Box>\n );\n}\n","import type { ContentPart } from \"@tanstack/ai/client\";\n\n// A file travels with every request of the conversation, so a large one is refused.\nconst MAX_BYTES = 10 * 1024 * 1024;\n// The longest side a vision model reads in full. A phone photo is three times that.\nconst MAX_IMAGE_SIDE = 1568;\n\n// The documents the gateway's models read as they are, by extension: the browser's own type for\n// a file is often empty or another one (a .csv is an Excel file to Windows).\nconst DOCUMENTS: Record<string, string | undefined> = {\n pdf: \"application/pdf\",\n docx: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n xlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n pptx: \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n rtf: \"application/rtf\",\n csv: \"text/csv\",\n md: \"text/markdown\",\n json: \"application/json\",\n html: \"text/html\",\n txt: \"text/plain\",\n};\n\nconst base64 = (file: Blob) =>\n new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n // A data URL: the base64 follows its comma.\n reader.onload = () => resolve((reader.result as string).split(\",\")[1]);\n reader.onerror = () => reject(reader.error ?? new Error(\"Cannot read the file\"));\n reader.readAsDataURL(file);\n });\n\n/** An image as the model sees it: a JPEG no larger than it reads, base64. */\nasync function readImage(file: Blob) {\n const image = await createImageBitmap(file);\n const scale = Math.min(1, MAX_IMAGE_SIDE / Math.max(image.width, image.height));\n const canvas = document.createElement(\"canvas\");\n canvas.width = Math.round(image.width * scale);\n canvas.height = Math.round(image.height * scale);\n const context = canvas.getContext(\"2d\");\n if (!context) throw new Error(\"No canvas\");\n // JPEG has no transparency: a see-through screenshot would turn black.\n context.fillStyle = \"#fff\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n context.drawImage(image, 0, 0, canvas.width, canvas.height);\n return canvas.toDataURL(\"image/jpeg\", 0.85).split(\",\")[1];\n}\n\n/**\n * A file as one part of a user message, kept in the conversation and never uploaded to the file\n * service. The model reads it as it is: an image of any kind the browser shows, and a document\n * (PDF, Word, Excel, PowerPoint, CSV or text). Throws for a file it cannot read or a large one.\n */\nexport async function fileToPart(file: File): Promise<ContentPart> {\n if (file.type.startsWith(\"image/\"))\n return {\n type: \"image\",\n source: { type: \"data\", value: await readImage(file), mimeType: \"image/jpeg\" },\n };\n const extension = file.name.split(\".\").at(-1)?.toLowerCase() ?? \"\";\n // Any other text, such as a log or source code, reads as plain text.\n const mimeType = DOCUMENTS[extension] ?? (file.type.startsWith(\"text/\") ? \"text/plain\" : \"\");\n if (!mimeType || file.size > MAX_BYTES) throw new Error(`Cannot attach ${file.name}`);\n return {\n type: \"document\",\n source: { type: \"data\", value: await base64(file), mimeType },\n metadata: { filename: file.name },\n };\n}\n","import Add from \"@mui/icons-material/Add\";\nimport ArrowUpward from \"@mui/icons-material/ArrowUpward\";\nimport AttachFile from \"@mui/icons-material/AttachFile\";\nimport Refresh from \"@mui/icons-material/Refresh\";\nimport Stop from \"@mui/icons-material/Stop\";\nimport {\n Alert,\n Avatar,\n Box,\n Button,\n Chip,\n IconButton,\n InputBase,\n Link,\n Paper,\n Stack,\n Tooltip,\n Typography,\n} from \"@mui/material\";\nimport type { SxProps, Theme } from \"@mui/material\";\nimport { keyframes } from \"@mui/material/styles\";\nimport { parsePartialJSON } from \"@tanstack/ai-react\";\nimport type { UIMessage, UseChatReturn } from \"@tanstack/ai-react\";\nimport type { ContentPart } from \"@tanstack/ai/client\";\nimport { streamingMarkdownExtension } from \"@tanstack/markdown/extensions/streaming\";\nimport { Markdown } from \"@tanstack/markdown/react\";\nimport type { TFunction } from \"i18next\";\nimport { useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, FormEvent, KeyboardEvent } from \"react\";\nimport { useDropzone } from \"react-dropzone\";\nimport { useTranslation } from \"react-i18next\";\nimport { AskUser, GeneratedUi } from \"~/components/chat/generatedUi\";\nimport { RouterLink } from \"~/components/router/RouterLink\";\nimport { useDialogs } from \"~/hooks/useDialogs\";\nimport { fileToPart } from \"~/lib/ai/attachments\";\n\ntype Chat = UseChatReturn;\ntype ToolCallPart = Extract<UIMessage[\"parts\"][number], { type: \"tool-call\" }>;\ntype ImagePart = Extract<ContentPart, { type: \"image\" }>;\n/** A file the user attached, waiting in the input until the message is sent. */\ntype Attached = { name: string; part: ContentPart };\n\n/** Read by screen readers, invisible on screen (MUI's `visuallyHidden`). */\nconst visuallyHidden = {\n border: 0,\n clipPath: \"inset(50%)\",\n height: \"1px\",\n margin: \"-1px\",\n overflow: \"hidden\",\n padding: 0,\n position: \"absolute\",\n whiteSpace: \"nowrap\",\n width: \"1px\",\n} as const;\n\n/** One centered reading column, like ChatGPT: full width on a phone, 48rem on a desktop. */\nconst columnSx = { width: \"100%\", maxWidth: \"48rem\", mx: \"auto\", px: 2 } as const;\n\nconst markdownSx = {\n typography: \"body1\",\n overflowWrap: \"anywhere\",\n \"& > *\": { my: 0 },\n \"& > * + *\": { mt: 2 },\n \"& pre\": { overflowX: \"auto\", p: 1.5, borderRadius: 2, bgcolor: \"action.hover\" },\n \"& :not(pre) > code\": { px: 0.5, borderRadius: 1, bgcolor: \"action.hover\" },\n \"& table\": { display: \"block\", overflowX: \"auto\", borderCollapse: \"collapse\" },\n \"& th, & td\": { border: 1, borderColor: \"divider\", px: 1, py: 0.5 },\n \"& img\": { maxWidth: \"100%\" },\n} as const;\n\n// Hides a half-written heading or list item while the reply streams.\nconst markdownExtensions = [streamingMarkdownExtension()];\n\n/** The app's own pages open in place, through the router; anything else in a new tab. */\nfunction MarkdownLink({ href = \"\", children }: ComponentPropsWithoutRef<\"a\">) {\n return href.startsWith(\"/\") && !href.startsWith(\"//\") ? (\n <RouterLink to={href}>{children}</RouterLink>\n ) : (\n <Link href={href} target=\"_blank\" rel=\"noreferrer\">\n {children}\n </Link>\n );\n}\n\nconst markdownComponents = { a: MarkdownLink };\n\nconst shimmer = keyframes`\n from { background-position: 100% 0; }\n to { background-position: -100% 0; }\n`;\n\n/** The model is working on a reply, but nothing of it is on screen yet. */\nexport function isReasoning({ isLoading, messages }: Pick<Chat, \"isLoading\" | \"messages\">) {\n const last = messages.at(-1);\n const part = last?.role === \"assistant\" ? last.parts.at(-1) : undefined;\n // A tool call shows its own line or UI until its result is in.\n const streaming =\n (part?.type === \"text\" && part.content !== \"\") ||\n (part?.type === \"tool-call\" && part.output === undefined);\n return isLoading && !streaming;\n}\n\n/** After a scroll event: at the bottom it follows new content, after a scroll up it stops. */\nexport function keepsFollowing(\n following: boolean,\n previousTop: number,\n {\n scrollTop,\n scrollHeight,\n clientHeight,\n }: Pick<HTMLElement, \"scrollTop\" | \"scrollHeight\" | \"clientHeight\">,\n) {\n if (scrollHeight - clientHeight - scrollTop <= 1) return true;\n return scrollTop < previousTop ? false : following;\n}\n\n/** Keeps the scroll container at the bottom while content grows, unless the user scrolled up. */\nfunction useFollowContent() {\n const ref = useRef<HTMLDivElement>(null);\n const following = useRef(true);\n\n useEffect(() => {\n const scroller = ref.current;\n if (!scroller) return;\n let previousTop = scroller.scrollTop;\n\n const onScroll = () => {\n following.current = keepsFollowing(following.current, previousTop, scroller);\n previousTop = scroller.scrollTop;\n };\n const observer = new ResizeObserver(() => {\n if (!following.current) return;\n scroller.scrollTop = scroller.scrollHeight;\n previousTop = scroller.scrollTop;\n });\n\n scroller.addEventListener(\"scroll\", onScroll, { passive: true });\n observer.observe(scroller);\n for (const child of scroller.children) observer.observe(child);\n return () => {\n scroller.removeEventListener(\"scroll\", onScroll);\n observer.disconnect();\n };\n }, []);\n\n return { ref, following };\n}\n\nconst shimmerSx: SxProps<Theme> = (theme) => {\n const { text } = (theme.vars ?? theme).palette;\n return {\n alignSelf: \"flex-start\",\n color: \"transparent\",\n backgroundImage: `linear-gradient(90deg, ${text.disabled} 40%, ${text.primary} 50%, ${text.disabled} 60%)`,\n backgroundSize: \"200% 100%\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n animation: `${shimmer} 2s linear infinite`,\n \"@media (prefers-reduced-motion: reduce)\": { animation: \"none\" },\n };\n};\n\n// Status lines in a row sit together.\nconst statusClass = \"LayoutChat-status\";\n\nfunction Reasoning() {\n const { t } = useTranslation();\n\n return (\n <Typography className={statusClass} sx={shimmerSx}>\n {t(\"Layout.Chat.Reasoning\")}\n </Typography>\n );\n}\n\ntype ActivityKey =\n | \"WritingCode\"\n | \"RunningCode\"\n | \"RanCode\"\n | \"FindingTools\"\n | \"FoundTools\"\n | \"ReadingPage\"\n | \"ReadPage\"\n | \"Clicking\"\n | \"Clicked\"\n | \"Filling\"\n | \"Filled\"\n | \"PressingKey\"\n | \"PressedKey\"\n | \"UsingTool\"\n | \"UsedTool\";\n\n/** A tool's words while the model writes its input, while it runs, and once it is done. */\nconst activities: Record<string, [ActivityKey, ActivityKey, ActivityKey] | undefined> = {\n execute_typescript: [\"WritingCode\", \"RunningCode\", \"RanCode\"],\n discover_tools: [\"FindingTools\", \"FindingTools\", \"FoundTools\"],\n __lazy__tool__discovery__: [\"FindingTools\", \"FindingTools\", \"FoundTools\"],\n read_page: [\"ReadingPage\", \"ReadingPage\", \"ReadPage\"],\n click: [\"Clicking\", \"Clicking\", \"Clicked\"],\n fill: [\"Filling\", \"Filling\", \"Filled\"],\n press_key: [\"PressingKey\", \"PressingKey\", \"PressedKey\"],\n};\n\n/** A tool's name as words: external_create_device is \"create device\". */\nconst words = (name: string) => name.replace(/^external_/, \"\").replaceAll(\"_\", \" \");\n\n/** The functions a program calls, or a lookup asks for, as words: \"list devices, create device\". */\nfunction functionsOf({ input, arguments: json }: ToolCallPart) {\n // Read while the input still streams, so they show as the program is written.\n const { typescriptCode, toolNames } = (input ?? parsePartialJSON(json) ?? {}) as {\n typescriptCode?: unknown;\n toolNames?: unknown;\n };\n const called =\n typeof typescriptCode === \"string\"\n ? Array.from(typescriptCode.matchAll(/external_(\\w+)/g), ([, name]) => name)\n : [];\n const asked = Array.isArray(toolNames)\n ? toolNames.filter((name): name is string => typeof name === \"string\")\n : [];\n return [...new Set([...asked, ...called].map(words))].join(\", \");\n}\n\n/** What a page tool acted on, for its line: the element clicked, the values filled, the key. */\nfunction targetOf({ input }: ToolCallPart) {\n const { name, key, fields } = (input ?? {}) as {\n name?: string;\n key?: string;\n fields?: Array<{ value?: string }>;\n };\n const target = name ?? key ?? fields?.map(({ value }) => value).join(\", \") ?? \"\";\n return target.length > 60 ? `${target.slice(0, 59)}…` : target;\n}\n\nfunction activityOf({ name, state, output }: ToolCallPart, live: boolean) {\n const [writing, running, done] = activities[name] ?? [\"UsingTool\", \"UsingTool\", \"UsedTool\"];\n if (output !== undefined) return state === \"error\" ? \"ToolStopped\" : done;\n if (!live) return \"ToolStopped\";\n return state === \"awaiting-input\" || state === \"input-streaming\" ? writing : running;\n}\n\n/** A tool's line in words, e.g. \"Running code… · list devices\". */\nconst activityText = (t: TFunction, part: ToolCallPart, live: boolean) =>\n [\n t(`Layout.Chat.${activityOf(part, live)}`, { name: words(part.name), target: targetOf(part) }),\n functionsOf(part),\n ]\n .filter(Boolean)\n .join(\" · \");\n\n/** A tool without UI of its own, as one line: what it does while it runs, then what it did. */\nfunction ToolActivity({ part, live }: Readonly<{ part: ToolCallPart; live: boolean }>) {\n const { t } = useTranslation();\n const running = live && part.output === undefined;\n\n return (\n <Typography\n variant=\"body2\"\n className={statusClass}\n sx={running ? shimmerSx : { color: \"text.secondary\" }}\n >\n {activityText(t, part, live)}\n </Typography>\n );\n}\n\n/** The name a document was attached under. */\nconst fileNameOf = (part: { type: string; metadata?: unknown }) =>\n part.type === \"document\"\n ? ((part.metadata as { filename?: string } | undefined)?.filename ?? \"document\")\n : undefined;\n\nconst srcOf = ({ source }: Pick<ImagePart, \"source\">) =>\n source.type === \"data\" ? `data:${source.mimeType};base64,${source.value}` : source.value;\n\nfunction ChatMessage({\n message,\n live,\n canAnswer,\n addToolResult,\n}: Readonly<{\n message: UIMessage;\n live: boolean;\n canAnswer: boolean;\n addToolResult: Chat[\"addToolResult\"];\n}>) {\n if (message.role === \"user\") {\n const typed = message.parts.flatMap((part) => (part.type === \"text\" ? [part.content] : []));\n const files = message.parts.filter(({ type }) => type === \"image\" || type === \"document\");\n return (\n <Stack spacing={1} sx={{ alignSelf: \"flex-end\", alignItems: \"flex-end\", maxWidth: \"80%\" }}>\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", justifyContent: \"flex-end\", gap: 0.5 }}>\n {files.map((part, index) =>\n part.type === \"image\" ? (\n <Box\n key={index}\n component=\"img\"\n src={srcOf(part)}\n alt=\"Attached image\"\n sx={{ maxWidth: \"100%\", maxHeight: 160, borderRadius: 3 }}\n />\n ) : (\n <Chip key={index} variant=\"outlined\" label={fileNameOf(part)} />\n ),\n )}\n </Stack>\n )}\n {typed.length > 0 && (\n <Typography\n sx={{\n px: 2,\n py: 1.25,\n borderRadius: 4.5,\n bgcolor: \"action.hover\",\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n }}\n >\n {typed.join(\"\\n\")}\n </Typography>\n )}\n </Stack>\n );\n }\n\n return message.parts.map((part, index) => {\n if (part.type === \"text\")\n return part.content ? (\n <Box key={index} sx={markdownSx}>\n <Markdown extensions={markdownExtensions} components={markdownComponents}>\n {part.content}\n </Markdown>\n </Box>\n ) : null;\n if (part.type !== \"tool-call\") return null;\n const ui = part.name === \"show_ui\" || part.name === \"ask_user\";\n // The model draws a UI whose input failed again.\n if (ui && part.state === \"error\") return null;\n if (part.name === \"show_ui\") return <GeneratedUi key={part.id} part={part} />;\n if (part.name === \"ask_user\")\n return (\n <AskUser\n key={part.id}\n part={part}\n disabled={!canAnswer || part.output !== undefined}\n onAnswer={(output) =>\n void addToolResult({ toolCallId: part.id, tool: part.name, output })\n }\n />\n );\n return <ToolActivity key={part.id} part={part} live={live} />;\n });\n}\n\n/** Confirms a server tool marked `needsApproval`; the model has said what it is about to do. */\nfunction Approvals({ chat }: Readonly<{ chat: Chat }>) {\n const { t } = useTranslation();\n\n // Server tools are not registered on the client, so the typed `kind: \"tool-approval\"` never\n // matches here; the server's metadata marks the interrupt as an approval.\n return chat.interrupts.map((interrupt) =>\n interrupt.metadata?.kind === \"approval\" &&\n interrupt.status === \"pending\" &&\n \"resolveInterrupt\" in interrupt ? (\n <Alert\n key={interrupt.id}\n severity=\"warning\"\n action={\n <Stack direction=\"row\" spacing={1}>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(false)}\n >\n {t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button\n color=\"inherit\"\n size=\"small\"\n disabled={chat.resuming}\n onClick={() => interrupt.resolveInterrupt(true)}\n >\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </Stack>\n }\n >\n {t(\"Layout.Chat.AreYouSure\")}\n </Alert>\n ) : null,\n );\n}\n\nconst roundButtonSx = {\n bgcolor: \"text.primary\",\n color: \"background.paper\",\n \"&:hover\": { bgcolor: \"text.secondary\" },\n} as const;\n\n/** A message waiting for the reply to end, as one line: what was typed, or the files' names. */\nfunction queuedText(queued: Chat[\"queue\"][number][\"content\"]) {\n const content = typeof queued === \"string\" ? queued : queued.content;\n if (typeof content === \"string\") return content;\n const texts = content.flatMap((part) =>\n part.type === \"text\" ? [part.content] : (fileNameOf(part) ?? []),\n );\n return texts.join(\" · \") || \"…\";\n}\n\ninterface ChatInputProps {\n chat: Chat;\n files: Array<Attached>;\n setFiles: (files: Array<Attached>) => void;\n /** Opens the file picker. */\n pick: () => void;\n onSend: () => void;\n}\n\nfunction ChatInput({ chat, files, setFiles, pick, onSend }: Readonly<ChatInputProps>) {\n const { t } = useTranslation();\n const { confirm } = useDialogs();\n const [draft, setDraft] = useState(\"\");\n const ready = draft.trim() !== \"\" || files.length > 0;\n\n // A message sent while the reply still streams waits in the chat's queue, shown above the input.\n const send = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!ready) return;\n onSend();\n const parts = files.map(({ part }) => part);\n if (draft.trim()) parts.push({ type: \"text\", content: draft.trim() });\n void chat.sendMessage(files.length ? { content: parts } : draft.trim());\n setDraft(\"\");\n setFiles([]);\n };\n\n // Enter sends and Shift+Enter breaks the line; Enter that ends an IME composition (CJK) does neither.\n const sendOnEnter = (event: KeyboardEvent<HTMLFormElement>) => {\n if (event.key !== \"Enter\" || event.shiftKey || event.nativeEvent.isComposing) return;\n if (!(event.target instanceof HTMLTextAreaElement)) return;\n event.preventDefault();\n event.currentTarget.requestSubmit();\n };\n\n const newChat = async () => {\n if (await confirm(t(\"Layout.Chat.NewChatConfirm\"))) chat.clear();\n };\n\n return (\n <Stack spacing={1}>\n {chat.queue.map(({ id, content }) => (\n <Chip\n key={id}\n variant=\"outlined\"\n label={queuedText(content)}\n onDelete={() => chat.cancelQueued(id)}\n sx={{ alignSelf: \"flex-end\", maxWidth: \"80%\" }}\n />\n ))}\n <Paper\n component=\"form\"\n variant=\"outlined\"\n onSubmit={send}\n onKeyDown={sendOnEnter}\n sx={{ p: 1, borderRadius: 7, boxShadow: 2 }}\n >\n {files.length > 0 && (\n <Stack direction=\"row\" sx={{ flexWrap: \"wrap\", gap: 0.5, px: 1, pb: 1 }}>\n {files.map(({ name, part }, index) => (\n <Chip\n key={index}\n size=\"small\"\n label={name}\n avatar={\n part.type === \"image\" ? (\n <Avatar variant=\"rounded\" src={srcOf(part)} alt=\"\" />\n ) : undefined\n }\n onDelete={() => setFiles(files.filter((_, at) => at !== index))}\n />\n ))}\n </Stack>\n )}\n <Stack direction=\"row\" spacing={0.5} sx={{ alignItems: \"flex-end\" }}>\n <Tooltip title={t(\"Layout.Chat.NewChat\")}>\n <span>\n <IconButton\n aria-label=\"New chat\"\n onClick={() => void newChat()}\n disabled={!chat.messages.length}\n >\n <Add />\n </IconButton>\n </span>\n </Tooltip>\n <Tooltip title={t(\"Layout.Chat.Attach\")}>\n <IconButton aria-label=\"Attach files\" onClick={pick}>\n <AttachFile />\n </IconButton>\n </Tooltip>\n <InputBase\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={t(\"Layout.Chat.Message\")}\n multiline\n maxRows={8}\n slotProps={{ input: { \"aria-label\": \"Ask anything\" } }}\n sx={{ flex: 1, py: 1, pl: 0.5 }}\n />\n {chat.isLoading && (\n <Tooltip title={t(\"Layout.Chat.Stop\")}>\n <IconButton aria-label=\"Stop\" onClick={chat.stop} sx={roundButtonSx}>\n <Stop />\n </IconButton>\n </Tooltip>\n )}\n {(!chat.isLoading || ready) && (\n <Tooltip title={t(\"Layout.Chat.Send\")}>\n <IconButton aria-label=\"Send\" type=\"submit\" sx={roundButtonSx}>\n <ArrowUpward />\n </IconButton>\n </Tooltip>\n )}\n </Stack>\n </Paper>\n </Stack>\n );\n}\n\ninterface ChatLayoutProps {\n chat: Chat;\n /** Styles the chat's root box, e.g. a background. */\n sx?: SxProps<Theme>;\n}\n\n/** The chat screen. Give it a parent with a height (e.g. `Fullscreen`). */\nexport function ChatLayout({ chat, sx }: Readonly<ChatLayoutProps>) {\n const { t } = useTranslation();\n const { alert } = useDialogs();\n const { ref, following } = useFollowContent();\n const [files, setFiles] = useState<Array<Attached>>([]);\n const last = chat.messages.at(-1);\n\n // Kept in the message for the model to read as it is: nothing is uploaded anywhere.\n const attach = async (added: Array<File>) => {\n for (const file of added) {\n try {\n const part = await fileToPart(file);\n setFiles((current) => [...current, { name: file.name, part }]);\n } catch {\n await alert(t(\"Layout.Chat.FileNotRead\", { name: file.name }));\n }\n }\n };\n // The whole chat takes a dropped or pasted file, and shows that only while one is dragged over it.\n const { getRootProps, getInputProps, isDragActive, open } = useDropzone({\n noClick: true,\n noKeyboard: true,\n onDrop: (dropped) => void attach(dropped),\n });\n // A delete waiting for approval is still running.\n const live = chat.isLoading || chat.interrupts.some(({ status }) => status === \"pending\");\n const runningTool = live\n ? last?.parts.findLast(\n (part): part is ToolCallPart =>\n part.type === \"tool-call\" &&\n part.output === undefined &&\n part.name !== \"show_ui\" &&\n part.name !== \"ask_user\",\n )\n : undefined;\n const status = isReasoning(chat)\n ? t(\"Layout.Chat.Reasoning\")\n : runningTool\n ? activityText(t, runningTool, true)\n : \"\";\n\n return (\n <Box\n {...getRootProps({ className: \"LayoutChat-root\" })}\n sx={[\n {\n position: \"relative\",\n display: \"flex\",\n flexDirection: \"column\",\n flex: 1,\n minHeight: 0,\n height: \"100%\",\n },\n ...(Array.isArray(sx) ? sx : [sx]),\n ]}\n >\n <input {...getInputProps()} />\n <Box ref={ref} sx={{ flex: 1, minHeight: 0, overflowY: \"auto\" }}>\n <Stack\n spacing={2.5}\n sx={{ ...columnSx, py: 3, [`& > .${statusClass} + .${statusClass}`]: { mt: 0.5 } }}\n >\n {chat.messages.map((message) => (\n <ChatMessage\n key={message.id}\n message={message}\n live={live && message === last}\n // A form answers only the newest question, once the reply has stopped streaming.\n canAnswer={!chat.isLoading && message === last}\n addToolResult={chat.addToolResult}\n />\n ))}\n <Approvals chat={chat} />\n {isReasoning(chat) && <Reasoning />}\n {chat.error && (\n <Alert\n severity=\"error\"\n action={\n <Tooltip title={t(\"Layout.Chat.Regenerate\")}>\n <IconButton\n aria-label=\"Regenerate\"\n color=\"inherit\"\n size=\"small\"\n onClick={() => void chat.reload()}\n >\n <Refresh fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n }\n >\n {chat.error.message}\n </Alert>\n )}\n </Stack>\n </Box>\n <Box sx={{ ...columnSx, pb: 2 }}>\n <ChatInput\n chat={chat}\n files={files}\n setFiles={setFiles}\n pick={open}\n onSend={() => (following.current = true)}\n />\n </Box>\n {isDragActive && (\n <Box\n sx={{\n position: \"absolute\",\n inset: 8,\n zIndex: 2,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n border: 2,\n borderStyle: \"dashed\",\n borderColor: \"primary.main\",\n borderRadius: 4,\n bgcolor: \"background.paper\",\n opacity: 0.92,\n pointerEvents: \"none\",\n }}\n >\n <Typography color=\"primary\">{t(\"Layout.Chat.DropFiles\")}</Typography>\n </Box>\n )}\n {/* Mounted empty and kept, so screen readers announce every new status line. */}\n <Box role=\"status\" sx={visuallyHidden}>\n {status}\n </Box>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAa,oBAAA,OAGP;;CADD,IAAA;CADH,IAAA;CAD0DA,IAAAA,EAAAA,OAAAA,IAAAA;EAC1D,CAAA,CAAA,gBACA,GAAA,qBAF0DA;;;;;;;;CAI1D,MAAM,QAAQ,gBAAgB;CACAC,IAAAA;CAAe,IAAA,EAAA,OAAA,OAAA;EAAf,KAAA,eAAe,KAAK;EAAL,EAA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AAA;EAMW,EAAA,KAAA;EAAYD,EAAAA,KAAAA;EADC,EAAA,KAAA;EAKjC,EAAA,KAAA;EAD2D,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;CAA9DE,IAAAA;CAACT,IAAAA,EAAAA,QAAAA,MAAAA,EAAAA,QAAmBC,MAAAA,EAAAA,QAAcC,MAAAA,EAAAA,QAAiBC,MAAAA,EAAAA,QAAWC,MAAAA,EAAAA,QAC3DC,MAAAA,EAAAA,QAEAC,IAAAA;EAHH,KAAA,qBAACN,IAAD;GAAY,SAAQC;GAAQ,OAAMC;GAAiB,QAAA;GAAO,GAAIE;GAA9D,UAAA,CACGC,IAEAC,EACDN;;EAJDA,EAAAA,MAAAA;EAAmBC,EAAAA,MAAAA;EAAcC,EAAAA,MAAAA;EAAiBC,EAAAA,MAAAA;EAAWC,EAAAA,MAAAA;EAC3DC,EAAAA,MAAAA;EAEAC,EAAAA,MAAAA;;;CAJL,OACEG;AAMJ;;;;;;;;AC4CA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;AASA,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;AAUA,SAAgB,gBAAgB;CAC9B,MAAM,QAAyB;EAC7B,GAAI,OAAO,KAAK,UAAU;EAC1B;EACA,GAAG;CACL;CACA,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BAAC,SAAD;QAAS,OAAO,EAAE,wBAAwB;QACxC,UAAA,oBAAC,YAAD;SACE,cAAA;SACA,OAAA;SACA,MAAA;SACA,eAAe,KAAK,KAAK,OAAO;SAEhC,UAAA,oBAAC,SAAD,EAAS,UAAA,QAAA,CAAA;QACT,CAAA;OACF,CAAA;OAGH,UAAA,KAAK,MAAM;MACZ,CAAA;KAEJ;;GACF,CAAA;GACF,oBAAC,KAAD;IAAK,IAAI;KAAE,GAAG;KAAU,IAAI;IAAE;IAC5B,UAAA,oBAAC,WAAD;KACQ;KACC;KACG;KACV,MAAM;KACN,cAAe,UAAU,UAAU;IAAA,CAAA;GAErC,CAAA;GACD,gBACC,oBAAC,KAAD;IACE,IAAI;KACF,UAAU;KACV,OAAO;KACP,QAAQ;KACR,SAAS;KACT,YAAY;KACZ,gBAAgB;KAChB,QAAQ;KACR,aAAa;KACb,aAAa;KACb,cAAc;KACd,SAAS;KACT,SAAS;KACT,eAAe;IACjB;IAEA,UAAA,oBAAC,YAAD;KAAY,OAAA;KAAiB,UAAA,EAAE,uBAAuB;IAAI,CAAA;GAC1D,CAAA;GAGJ,oBAAC,KAAD;IAAK,MAAA;IAAc,IAAI;IACpB,UAAA;GACD,CAAA;EACF;;AAEN"}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import z, { z as z$1 } from "zod";
|
|
2
|
+
declare const ApprovalRequestType: z.ZodEnum<{
|
|
3
|
+
Batch: "Batch";
|
|
4
|
+
Single: "Single";
|
|
5
|
+
}>;
|
|
6
|
+
type ApprovalRequestType = z.infer<typeof ApprovalRequestType>;
|
|
7
|
+
declare const ApprovalStatus: z.ZodEnum<{
|
|
8
|
+
Approved: "Approved";
|
|
9
|
+
Cancelled: "Cancelled";
|
|
10
|
+
Rejected: "Rejected";
|
|
11
|
+
WaitingForApproval: "WaitingForApproval";
|
|
12
|
+
Withdrawn: "Withdrawn";
|
|
13
|
+
}>;
|
|
14
|
+
type ApprovalStatus = z.infer<typeof ApprovalStatus>;
|
|
2
15
|
declare const ApprovalSchema: z.ZodObject<{
|
|
3
16
|
id: z.ZodUUID;
|
|
4
17
|
number: z.ZodString;
|
|
@@ -324,6 +337,18 @@ declare const DepartmentSchema: z.ZodObject<{
|
|
|
324
337
|
}, z.core.$strip>;
|
|
325
338
|
}, z.core.$strip>;
|
|
326
339
|
type Department = z.infer<typeof DepartmentSchema>;
|
|
340
|
+
declare const EmployeeCategoryGroup: z.ZodEnum<{
|
|
341
|
+
FD: "FD";
|
|
342
|
+
FI: "FI";
|
|
343
|
+
IDL: "IDL";
|
|
344
|
+
}>;
|
|
345
|
+
type EmployeeCategoryGroup = z.infer<typeof EmployeeCategoryGroup>;
|
|
346
|
+
declare const EmployeeStatus: z.ZodEnum<{
|
|
347
|
+
Active: "Active";
|
|
348
|
+
"Leave of Absence": "Leave of Absence";
|
|
349
|
+
Terminated: "Terminated";
|
|
350
|
+
}>;
|
|
351
|
+
type EmployeeStatus = z.infer<typeof EmployeeStatus>;
|
|
327
352
|
declare const EmployeeSchema: z.ZodObject<{
|
|
328
353
|
badgeId: z.ZodString;
|
|
329
354
|
category: z.ZodString;
|
|
@@ -370,7 +395,6 @@ declare const EmployeeSchema: z.ZodObject<{
|
|
|
370
395
|
}, z.core.$strip>;
|
|
371
396
|
type Employee = z.infer<typeof EmployeeSchema>;
|
|
372
397
|
declare const ExtractFileSchema: z$1.ZodObject<{
|
|
373
|
-
appName: z$1.ZodString;
|
|
374
398
|
fileId: z$1.ZodUUID;
|
|
375
399
|
fields: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
|
|
376
400
|
type: z$1.ZodDefault<z$1.ZodEnum<{
|
|
@@ -386,5 +410,5 @@ declare const ExtractFileSchema: z$1.ZodObject<{
|
|
|
386
410
|
type ExtractFile = z$1.infer<typeof ExtractFileSchema>;
|
|
387
411
|
/** Each field's value, keyed by its name: `null` when the file does not show it, dates as YYYY-MM-DD. */
|
|
388
412
|
type FileExtraction = Record<string, string | number | boolean | null>;
|
|
389
|
-
export {
|
|
390
|
-
//# sourceMappingURL=ExtractFile-
|
|
413
|
+
export { WithdrawApprovalSchema as C, WithdrawApproval as S, CancelApprovalSchema as _, EmployeeCategoryGroup as a, ResubmitApproval as b, Department as c, ApprovalRequestType as d, ApprovalSchema as f, CancelApproval as g, ApproveApprovalSchema as h, Employee as i, DepartmentSchema as l, ApproveApproval as m, ExtractFileSchema as n, EmployeeSchema as o, ApprovalStatus as p, FileExtraction as r, EmployeeStatus as s, ExtractFile as t, Approval as u, CreateApproval as v, ResubmitApprovalSchema as x, CreateApprovalSchema as y };
|
|
414
|
+
//# sourceMappingURL=ExtractFile-BQUXpuBS.d.mts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as z$2 from "zod";
|
|
2
|
+
/** One access-list entry: an Entra group (sAMAccountName) or one employee. */
|
|
3
|
+
declare const FilePrincipalSchema: z$2.ZodUnion<readonly [z$2.ZodObject<{
|
|
4
|
+
group: z$2.ZodString;
|
|
5
|
+
}, z$2.core.$strict>, z$2.ZodObject<{
|
|
6
|
+
employeeId: z$2.ZodString;
|
|
7
|
+
}, z$2.core.$strict>]>;
|
|
8
|
+
declare const FilePermissionsSchema: z$2.ZodObject<{
|
|
9
|
+
read: z$2.ZodNullable<z$2.ZodArray<z$2.ZodUnion<readonly [z$2.ZodObject<{
|
|
10
|
+
group: z$2.ZodString;
|
|
11
|
+
}, z$2.core.$strict>, z$2.ZodObject<{
|
|
12
|
+
employeeId: z$2.ZodString;
|
|
13
|
+
}, z$2.core.$strict>]>>>;
|
|
14
|
+
write: z$2.ZodNullable<z$2.ZodArray<z$2.ZodUnion<readonly [z$2.ZodObject<{
|
|
15
|
+
group: z$2.ZodString;
|
|
16
|
+
}, z$2.core.$strict>, z$2.ZodObject<{
|
|
17
|
+
employeeId: z$2.ZodString;
|
|
18
|
+
}, z$2.core.$strict>]>>>;
|
|
19
|
+
}, z$2.core.$strip>;
|
|
20
|
+
declare const FileMetaSchema: z$2.ZodObject<{
|
|
21
|
+
id: z$2.ZodUUID;
|
|
22
|
+
appName: z$2.ZodString;
|
|
23
|
+
subId: z$2.ZodString;
|
|
24
|
+
fileName: z$2.ZodString;
|
|
25
|
+
fileExtension: z$2.ZodString;
|
|
26
|
+
fileSize: z$2.ZodNumber;
|
|
27
|
+
mimeType: z$2.ZodString;
|
|
28
|
+
mediaType: z$2.ZodString;
|
|
29
|
+
mediaSubType: z$2.ZodString;
|
|
30
|
+
public: z$2.ZodBoolean;
|
|
31
|
+
permissions: z$2.ZodObject<{
|
|
32
|
+
read: z$2.ZodNullable<z$2.ZodArray<z$2.ZodUnion<readonly [z$2.ZodObject<{
|
|
33
|
+
group: z$2.ZodString;
|
|
34
|
+
}, z$2.core.$strict>, z$2.ZodObject<{
|
|
35
|
+
employeeId: z$2.ZodString;
|
|
36
|
+
}, z$2.core.$strict>]>>>;
|
|
37
|
+
write: z$2.ZodNullable<z$2.ZodArray<z$2.ZodUnion<readonly [z$2.ZodObject<{
|
|
38
|
+
group: z$2.ZodString;
|
|
39
|
+
}, z$2.core.$strict>, z$2.ZodObject<{
|
|
40
|
+
employeeId: z$2.ZodString;
|
|
41
|
+
}, z$2.core.$strict>]>>>;
|
|
42
|
+
}, z$2.core.$strip>;
|
|
43
|
+
canWrite: z$2.ZodBoolean;
|
|
44
|
+
urls: z$2.ZodObject<{
|
|
45
|
+
view: z$2.ZodURL;
|
|
46
|
+
download: z$2.ZodURL;
|
|
47
|
+
thumbnail: z$2.ZodURL;
|
|
48
|
+
install: z$2.ZodOptional<z$2.ZodString>;
|
|
49
|
+
}, z$2.core.$strip>;
|
|
50
|
+
}, z$2.core.$strip>;
|
|
51
|
+
type FilePrincipal = z$2.infer<typeof FilePrincipalSchema>;
|
|
52
|
+
type FilePermissions = z$2.infer<typeof FilePermissionsSchema>;
|
|
53
|
+
type FileMeta = z$2.infer<typeof FileMetaSchema>;
|
|
54
|
+
export { FilePrincipal as a, FilePermissionsSchema as i, FileMetaSchema as n, FilePrincipalSchema as o, FilePermissions as r, FileMeta as t };
|
|
55
|
+
//# sourceMappingURL=FileMeta-B5VU-eCi.d.mts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as z$2 from "zod";
|
|
2
|
+
// src/models/file/FileMeta.ts
|
|
3
|
+
/** One access-list entry: an Entra group (sAMAccountName) or one employee. */
|
|
4
|
+
const FilePrincipalSchema = z$2.union([z$2.strictObject({ group: z$2.string().trim().min(1) }), z$2.strictObject({ employeeId: z$2.string().trim().min(1) })]);
|
|
5
|
+
const FileAccessSchema = z$2.array(FilePrincipalSchema).min(1).nullable();
|
|
6
|
+
const FilePermissionsSchema = z$2.object({
|
|
7
|
+
read: FileAccessSchema,
|
|
8
|
+
write: FileAccessSchema
|
|
9
|
+
});
|
|
10
|
+
const FileMetaSchema = z$2.object({
|
|
11
|
+
id: z$2.uuid(),
|
|
12
|
+
appName: z$2.string(),
|
|
13
|
+
subId: z$2.string(),
|
|
14
|
+
fileName: z$2.string(),
|
|
15
|
+
fileExtension: z$2.string(),
|
|
16
|
+
fileSize: z$2.number(),
|
|
17
|
+
mimeType: z$2.string(),
|
|
18
|
+
mediaType: z$2.string(),
|
|
19
|
+
mediaSubType: z$2.string(),
|
|
20
|
+
public: z$2.boolean(),
|
|
21
|
+
permissions: FilePermissionsSchema,
|
|
22
|
+
/** The signed-in user may rename and delete it. */
|
|
23
|
+
canWrite: z$2.boolean(),
|
|
24
|
+
/** For `<img src>`, `<a href>` and `window.open`. Signed for 2-3 h unless the file is public. */
|
|
25
|
+
urls: z$2.object({
|
|
26
|
+
view: z$2.url(),
|
|
27
|
+
download: z$2.url(),
|
|
28
|
+
thumbnail: z$2.url(),
|
|
29
|
+
/** `.ipa` only: the `itms-services://` install link. */
|
|
30
|
+
install: z$2.string().optional()
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
export { FilePermissionsSchema as n, FilePrincipalSchema as r, FileMetaSchema as t };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=FileMeta-BexXC_45.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileMeta-BexXC_45.mjs","names":["z"],"sources":["../src/models/file/FileMeta.ts"],"sourcesContent":["import * as z from \"zod\";\n\n/** One access-list entry: an Entra group (sAMAccountName) or one employee. */\nexport const FilePrincipalSchema = z.union([\n // strictObject: z.object would accept { group, employeeId } and silently drop one of them.\n z.strictObject({ group: z.string().trim().min(1) }),\n z.strictObject({ employeeId: z.string().trim().min(1) }),\n]);\n\n// null = no restriction (read: any employee, write: whoever can read); [] is rejected.\nconst FileAccessSchema = z.array(FilePrincipalSchema).min(1).nullable();\n\nexport const FilePermissionsSchema = z.object({\n read: FileAccessSchema,\n write: FileAccessSchema,\n});\n\nexport const FileMetaSchema = z.object({\n id: z.uuid(),\n appName: z.string(),\n subId: z.string(),\n fileName: z.string(),\n fileExtension: z.string(),\n fileSize: z.number(),\n mimeType: z.string(),\n mediaType: z.string(),\n mediaSubType: z.string(),\n public: z.boolean(),\n permissions: FilePermissionsSchema,\n /** The signed-in user may rename and delete it. */\n canWrite: z.boolean(),\n /** For `<img src>`, `<a href>` and `window.open`. Signed for 2-3 h unless the file is public. */\n urls: z.object({\n view: z.url(),\n download: z.url(),\n thumbnail: z.url(),\n /** `.ipa` only: the `itms-services://` install link. */\n install: z.string().optional(),\n }),\n});\n\nexport type FilePrincipal = z.infer<typeof FilePrincipalSchema>;\nexport type FilePermissions = z.infer<typeof FilePermissionsSchema>;\nexport type FileMeta = z.infer<typeof FileMetaSchema>;\n"],"mappings":";;;AAGA,MAAa,sBAAsBA,IAAE,MAAM,CAEzCA,IAAE,aAAa,EAAE,OAAOA,IAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,GAClDA,IAAE,aAAa,EAAE,YAAYA,IAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACzD,CAAC;AAGD,MAAM,mBAAmBA,IAAE,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;AAEtE,MAAa,wBAAwBA,IAAE,OAAO;CAC5C,MAAM;CACN,OAAO;AACT,CAAC;AAED,MAAa,iBAAiBA,IAAE,OAAO;CACrC,IAAIA,IAAE,KAAK;CACX,SAASA,IAAE,OAAO;CAClB,OAAOA,IAAE,OAAO;CAChB,UAAUA,IAAE,OAAO;CACnB,eAAeA,IAAE,OAAO;CACxB,UAAUA,IAAE,OAAO;CACnB,UAAUA,IAAE,OAAO;CACnB,WAAWA,IAAE,OAAO;CACpB,cAAcA,IAAE,OAAO;CACvB,QAAQA,IAAE,QAAQ;CAClB,aAAa;;CAEb,UAAUA,IAAE,QAAQ;;CAEpB,MAAMA,IAAE,OAAO;EACb,MAAMA,IAAE,IAAI;EACZ,UAAUA,IAAE,IAAI;EAChB,WAAWA,IAAE,IAAI;;EAEjB,SAASA,IAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,CAAC;AACH,CAAC"}
|