reflex-agent 0.10.1 → 0.13.2
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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +153 -127
- package/.next/app-path-routes-manifest.json +12 -11
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +7 -7
- package/.next/react-loadable-manifest.json +1 -1
- package/.next/routes-manifest.json +8 -0
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/agents/[agentId]/page.js +2 -2
- package/.next/server/app/agents/[agentId]/page.js.nft.json +1 -1
- package/.next/server/app/agents/[agentId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/[agentId]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/images/[rootId]/[file]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/callback/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/oauth/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/attachments/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/chat/[topicId]/stream/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/roots/[id]/suggestions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/bundle.js/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route.js.nft.json +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-api.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/host-ui.mjs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route.js +4 -4
- package/.next/server/app/api/utilities/[scope]/[id]/iframe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/utilities/[scope]/[id]/style.css/route_client-reference-manifest.js +1 -1
- package/.next/server/app/audit/page.js +2 -2
- package/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page.js +3 -3
- package/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js +2 -2
- package/.next/server/app/roots/[id]/chat/[topicId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/chat/[topicId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js +2 -2
- package/.next/server/app/roots/[id]/kb/[...slug]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/kb/[...slug]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/memory/page.js +2 -0
- package/.next/server/app/roots/[id]/memory/page.js.nft.json +1 -0
- package/.next/server/app/roots/[id]/memory/page_client-reference-manifest.js +1 -0
- package/.next/server/app/roots/[id]/page.js +6 -6
- package/.next/server/app/roots/[id]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/[wfId]/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/[wfId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/[id]/workflows/page.js +2 -2
- package/.next/server/app/roots/[id]/workflows/page.js.nft.json +1 -1
- package/.next/server/app/roots/[id]/workflows/page_client-reference-manifest.js +1 -1
- package/.next/server/app/roots/new/page.js +3 -3
- package/.next/server/app/roots/new/page.js.nft.json +1 -1
- package/.next/server/app/roots/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js +5 -5
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/file/page.js +2 -2
- package/.next/server/app/share/[id]/file/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/file/page_client-reference-manifest.js +1 -1
- package/.next/server/app/share/[id]/page.js +2 -2
- package/.next/server/app/share/[id]/page.js.nft.json +1 -1
- package/.next/server/app/share/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page.js +2 -2
- package/.next/server/app/utilities/[scope]/[id]/page.js.nft.json +1 -1
- package/.next/server/app/utilities/[scope]/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/utilities/page.js +2 -2
- package/.next/server/app/utilities/page.js.nft.json +1 -1
- package/.next/server/app/utilities/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +12 -11
- package/.next/server/chunks/1105.js +1 -1
- package/.next/server/chunks/1116.js +1 -0
- package/.next/server/chunks/1244.js +1 -1
- package/.next/server/chunks/1358.js +1 -1
- package/.next/server/chunks/2455.js +4 -0
- package/.next/server/chunks/2485.js +51 -2
- package/.next/server/chunks/2552.js +1 -1
- package/.next/server/chunks/269.js +1 -0
- package/.next/server/chunks/285.js +67 -17
- package/.next/server/chunks/3240.js +1 -1
- package/.next/server/chunks/3332.js +1 -1
- package/.next/server/chunks/4031.js +46 -2
- package/.next/server/chunks/{5470.js → 4460.js} +3 -3
- package/.next/server/chunks/4812.js +2 -2
- package/.next/server/chunks/4925.js +1 -1
- package/.next/server/chunks/5082.js +1 -0
- package/.next/server/chunks/5172.js +1 -0
- package/.next/server/chunks/569.js +1 -1
- package/.next/server/chunks/6880.js +3 -0
- package/.next/server/chunks/7188.js +1 -1
- package/.next/server/chunks/7220.js +1 -1
- package/.next/server/chunks/7358.js +13 -12
- package/.next/server/chunks/7800.js +1 -1
- package/.next/server/chunks/9098.js +1 -1
- package/.next/server/chunks/9157.js +1 -0
- package/.next/server/chunks/9809.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/124-15fc36c432df3dbf.js +1 -0
- package/.next/static/chunks/2084-7233d5537043daca.js +1 -0
- package/.next/static/chunks/4108.dc018213e45cb33d.js +1 -0
- package/.next/static/chunks/4678-15402b9832b27389.js +1 -0
- package/.next/static/chunks/4728-bc5cf7af49fca773.js +1 -0
- package/.next/static/chunks/6785-9a72b10489bc9c60.js +1 -0
- package/.next/static/chunks/951-5ff2aaad965fedb7.js +1 -0
- package/.next/static/chunks/9813-b766d258f203cf47.js +1 -0
- package/.next/static/chunks/{5475-fd7801895adb058e.js → 9819-9c9fce1bc9bfd112.js} +1 -1
- package/.next/static/chunks/app/agents/[agentId]/{page-5d6f4cb16b42d02b.js → page-2ee5d78dc94253c5.js} +1 -1
- package/.next/static/chunks/app/audit/{page-8dcb779a1ca1f1d1.js → page-9bac9e3674f0fae9.js} +1 -1
- package/.next/static/chunks/app/layout-2a915770c355308f.js +1 -0
- package/.next/static/chunks/app/onboarding/page-863f1b600bf234e0.js +1 -0
- package/.next/static/chunks/app/page-13508f16cf38f321.js +1 -0
- package/.next/static/chunks/app/roots/[id]/chat/[topicId]/{page-ca235f5f1d523635.js → page-3be786d8da8f76d5.js} +1 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-46920cb7c416ea8a.js +1 -0
- package/.next/static/chunks/app/roots/[id]/memory/page-8391c646562e05f2.js +1 -0
- package/.next/static/chunks/app/roots/[id]/page-22fd50b40a9d7da1.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-7efe470b18d48df2.js +1 -0
- package/.next/static/chunks/app/roots/[id]/workflows/page-8783e266b597fb1a.js +1 -0
- package/.next/static/chunks/app/roots/new/page-f3fc15595bc31190.js +1 -0
- package/.next/static/chunks/app/settings/page-ef1f77cbd60deaa7.js +1 -0
- package/.next/static/chunks/app/share/[id]/page-517af2077ca1619b.js +1 -0
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-cd2a7884a45d7e3d.js +1 -0
- package/.next/static/chunks/app/utilities/page-d6d31ca1ba920ef9.js +1 -0
- package/.next/static/chunks/{webpack-680c8fa1cf6aef64.js → webpack-96a46ed6f170dc97.js} +1 -1
- package/.next/static/css/6144318015aa8092.css +1 -0
- package/.next/trace +90 -89
- package/.next/types/app/roots/[id]/memory/page.ts +84 -0
- package/.next/types/routes.d.ts +2 -1
- package/.next/types/validator.ts +9 -0
- package/README.md +147 -32
- package/dist/lib/reflex/agents/prompts.js +25 -0
- package/dist/lib/reflex/agents/prompts.js.map +1 -1
- package/dist/lib/reflex/prompts/defaults.js +2 -1
- package/dist/lib/reflex/prompts/defaults.js.map +1 -1
- package/package.json +1 -1
- package/.next/server/chunks/2108.js +0 -1
- package/.next/server/chunks/243.js +0 -1
- package/.next/server/chunks/3829.js +0 -4
- package/.next/server/chunks/827.js +0 -1
- package/.next/server/chunks/8501.js +0 -1
- package/.next/server/chunks/9448.js +0 -3
- package/.next/static/chunks/1215-6bf6c0997a3966b5.js +0 -1
- package/.next/static/chunks/1217-407174d9b164a499.js +0 -1
- package/.next/static/chunks/4108.e60f6f2d13c6e341.js +0 -1
- package/.next/static/chunks/5041-50b52df22f60e028.js +0 -1
- package/.next/static/chunks/7529-5e60df9bb54dac00.js +0 -1
- package/.next/static/chunks/7544-361ab91088caf4e2.js +0 -1
- package/.next/static/chunks/83-c3e4801d1362769d.js +0 -1
- package/.next/static/chunks/app/layout-d10a100470029f0e.js +0 -1
- package/.next/static/chunks/app/onboarding/page-a52d76f48c071f59.js +0 -1
- package/.next/static/chunks/app/page-8551ff0fd6989e65.js +0 -1
- package/.next/static/chunks/app/roots/[id]/kb/[...slug]/page-aebc35e79e6e16d6.js +0 -1
- package/.next/static/chunks/app/roots/[id]/page-9b4a28b335dd8190.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/[wfId]/page-ab2801337dc9cc52.js +0 -1
- package/.next/static/chunks/app/roots/[id]/workflows/page-85f4eb885ecb80a1.js +0 -1
- package/.next/static/chunks/app/roots/new/page-4036140c7828948d.js +0 -1
- package/.next/static/chunks/app/settings/page-175f2087baeb2328.js +0 -1
- package/.next/static/chunks/app/share/[id]/page-5f86538339553350.js +0 -1
- package/.next/static/chunks/app/utilities/[scope]/[id]/page-223495e5566167ef.js +0 -1
- package/.next/static/chunks/app/utilities/page-cbd341f4f56941a0.js +0 -1
- package/.next/static/css/2bc00775af31f40f.css +0 -1
- /package/.next/static/{fQIjUyzIepDxqQpzYlf6H → 14BmONHeyoAOMNd2xJOGC}/_buildManifest.js +0 -0
- /package/.next/static/{fQIjUyzIepDxqQpzYlf6H → 14BmONHeyoAOMNd2xJOGC}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// File: /home/runner/work/reflex-agent/reflex-agent/app/roots/[id]/memory/page.tsx
|
|
2
|
+
import * as entry from '../../../../../../app/roots/[id]/memory/page.js'
|
|
3
|
+
import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
|
|
4
|
+
|
|
5
|
+
type TEntry = typeof import('../../../../../../app/roots/[id]/memory/page.js')
|
|
6
|
+
|
|
7
|
+
type SegmentParams<T extends Object = any> = T extends Record<string, any>
|
|
8
|
+
? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
|
|
9
|
+
: T
|
|
10
|
+
|
|
11
|
+
// Check that the entry is a valid entry
|
|
12
|
+
checkFields<Diff<{
|
|
13
|
+
default: Function
|
|
14
|
+
config?: {}
|
|
15
|
+
generateStaticParams?: Function
|
|
16
|
+
revalidate?: RevalidateRange<TEntry> | false
|
|
17
|
+
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
|
|
18
|
+
dynamicParams?: boolean
|
|
19
|
+
fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
|
|
20
|
+
preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
|
|
21
|
+
runtime?: 'nodejs' | 'experimental-edge' | 'edge'
|
|
22
|
+
maxDuration?: number
|
|
23
|
+
|
|
24
|
+
metadata?: any
|
|
25
|
+
generateMetadata?: Function
|
|
26
|
+
viewport?: any
|
|
27
|
+
generateViewport?: Function
|
|
28
|
+
experimental_ppr?: boolean
|
|
29
|
+
|
|
30
|
+
}, TEntry, ''>>()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// Check the prop type of the entry function
|
|
34
|
+
checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
|
|
35
|
+
|
|
36
|
+
// Check the arguments and return type of the generateMetadata function
|
|
37
|
+
if ('generateMetadata' in entry) {
|
|
38
|
+
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
|
|
39
|
+
checkFields<Diff<ResolvingMetadata, SecondArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Check the arguments and return type of the generateViewport function
|
|
43
|
+
if ('generateViewport' in entry) {
|
|
44
|
+
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
|
|
45
|
+
checkFields<Diff<ResolvingViewport, SecondArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Check the arguments and return type of the generateStaticParams function
|
|
49
|
+
if ('generateStaticParams' in entry) {
|
|
50
|
+
checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
|
|
51
|
+
checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface PageProps {
|
|
55
|
+
params?: Promise<SegmentParams>
|
|
56
|
+
searchParams?: Promise<any>
|
|
57
|
+
}
|
|
58
|
+
export interface LayoutProps {
|
|
59
|
+
children?: React.ReactNode
|
|
60
|
+
|
|
61
|
+
params?: Promise<SegmentParams>
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// =============
|
|
65
|
+
// Utility types
|
|
66
|
+
type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
|
|
67
|
+
|
|
68
|
+
// If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
|
|
69
|
+
type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
|
|
70
|
+
type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
|
|
71
|
+
|
|
72
|
+
type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
|
|
73
|
+
type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
|
|
74
|
+
type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
function checkFields<_ extends { [k in keyof any]: never }>() {}
|
|
79
|
+
|
|
80
|
+
// https://github.com/sindresorhus/type-fest
|
|
81
|
+
type Numeric = number | bigint
|
|
82
|
+
type Zero = 0 | 0n
|
|
83
|
+
type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
|
|
84
|
+
type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'
|
package/.next/types/routes.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is generated automatically by Next.js
|
|
2
2
|
// Do not edit this file manually
|
|
3
3
|
|
|
4
|
-
type AppRoutes = "/" | "/agents/[agentId]" | "/audit" | "/onboarding" | "/roots/[id]" | "/roots/[id]/chat/[topicId]" | "/roots/[id]/kb/[...slug]" | "/roots/[id]/workflows" | "/roots/[id]/workflows/[wfId]" | "/roots/new" | "/settings" | "/share/[id]" | "/share/[id]/file" | "/utilities" | "/utilities/[scope]/[id]"
|
|
4
|
+
type AppRoutes = "/" | "/agents/[agentId]" | "/audit" | "/onboarding" | "/roots/[id]" | "/roots/[id]/chat/[topicId]" | "/roots/[id]/kb/[...slug]" | "/roots/[id]/memory" | "/roots/[id]/workflows" | "/roots/[id]/workflows/[wfId]" | "/roots/new" | "/settings" | "/share/[id]" | "/share/[id]/file" | "/utilities" | "/utilities/[scope]/[id]"
|
|
5
5
|
type AppRouteHandlerRoutes = "/api/agents/[agentId]/respond" | "/api/images/[rootId]/[file]" | "/api/oauth/callback" | "/api/oauth/start" | "/api/roots/[id]/attachments" | "/api/roots/[id]/chat/[topicId]/send" | "/api/roots/[id]/chat/[topicId]/stop" | "/api/roots/[id]/chat/[topicId]/stream" | "/api/roots/[id]/dashboard" | "/api/roots/[id]/suggestions" | "/api/utilities/[scope]/[id]/bundle.js" | "/api/utilities/[scope]/[id]/host" | "/api/utilities/[scope]/[id]/host-api.mjs" | "/api/utilities/[scope]/[id]/host-ui.mjs" | "/api/utilities/[scope]/[id]/iframe" | "/api/utilities/[scope]/[id]/style.css"
|
|
6
6
|
type PageRoutes = never
|
|
7
7
|
type LayoutRoutes = "/" | "/roots/[id]"
|
|
@@ -34,6 +34,7 @@ interface ParamMap {
|
|
|
34
34
|
"/roots/[id]": { "id": string; }
|
|
35
35
|
"/roots/[id]/chat/[topicId]": { "id": string; "topicId": string; }
|
|
36
36
|
"/roots/[id]/kb/[...slug]": { "id": string; "slug": string[]; }
|
|
37
|
+
"/roots/[id]/memory": { "id": string; }
|
|
37
38
|
"/roots/[id]/workflows": { "id": string; }
|
|
38
39
|
"/roots/[id]/workflows/[wfId]": { "id": string; "wfId": string; }
|
|
39
40
|
"/roots/new": {}
|
package/.next/types/validator.ts
CHANGED
|
@@ -101,6 +101,15 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
|
|
|
101
101
|
type __Unused = __Check
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
// Validate ../../app/roots/[id]/memory/page.tsx
|
|
105
|
+
{
|
|
106
|
+
type __IsExpected<Specific extends AppPageConfig<"/roots/[id]/memory">> = Specific
|
|
107
|
+
const handler = {} as typeof import("../../app/roots/[id]/memory/page.js")
|
|
108
|
+
type __Check = __IsExpected<typeof handler>
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
type __Unused = __Check
|
|
111
|
+
}
|
|
112
|
+
|
|
104
113
|
// Validate ../../app/roots/[id]/page.tsx
|
|
105
114
|
{
|
|
106
115
|
type __IsExpected<Specific extends AppPageConfig<"/roots/[id]">> = Specific
|
package/README.md
CHANGED
|
@@ -1,36 +1,156 @@
|
|
|
1
1
|
# Reflex
|
|
2
2
|
|
|
3
|
-
Local-first knowledge base. You point Reflex at a
|
|
3
|
+
Local-first AI knowledge base + agent platform. You point Reflex at a
|
|
4
|
+
directory ("a Space"), and an agent (Claude Code or Codex) becomes
|
|
5
|
+
your second brain for that directory: it keeps a knowledge tree, runs
|
|
6
|
+
scheduled workflows, recalls past conversations, and dispatches
|
|
7
|
+
sub-tasks in isolated git worktrees.
|
|
8
|
+
|
|
9
|
+
Everything is stored as plain markdown + JSON in your filesystem. No
|
|
10
|
+
external database, no cloud, no daemon. The only persistent process is
|
|
11
|
+
the Next.js server itself.
|
|
4
12
|
|
|
5
13
|
## Install
|
|
6
14
|
|
|
7
15
|
Prerequisites:
|
|
8
16
|
|
|
9
|
-
- **Node.js
|
|
10
|
-
|
|
17
|
+
- **Node.js 22+** ([nodejs.org](https://nodejs.org/) or `nvm`/`fnm`).
|
|
18
|
+
Node 24 recommended (built-in SQLite powers session search).
|
|
19
|
+
- A coding-agent CLI authenticated:
|
|
20
|
+
- `npm i -g @openai/codex && codex login`, or
|
|
21
|
+
- `npm i -g @anthropic-ai/claude-code && claude login`
|
|
11
22
|
|
|
12
23
|
Install Reflex globally:
|
|
13
24
|
|
|
14
25
|
```sh
|
|
15
26
|
npm i -g reflex-agent
|
|
16
27
|
# or: pnpm add -g reflex-agent
|
|
17
|
-
# or: yarn global add reflex-agent
|
|
18
28
|
```
|
|
19
29
|
|
|
20
|
-
|
|
30
|
+
Launch the web UI:
|
|
21
31
|
|
|
22
32
|
```sh
|
|
23
|
-
reflex start
|
|
33
|
+
reflex start # opens http://localhost:3210 in your browser
|
|
24
34
|
reflex start --port 4000 --no-open
|
|
25
35
|
```
|
|
26
36
|
|
|
27
37
|
Dev runs on `:3211` by default so a `pnpm dev` and an installed
|
|
28
38
|
`reflex start` can co-exist without a port collision.
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
## First run
|
|
41
|
+
|
|
42
|
+
1. Click **Add a root** on the home screen and pick a directory.
|
|
43
|
+
2. On the Space dashboard, the onboarding wizard asks a few short
|
|
44
|
+
questions to seed memory + suggest a first workflow.
|
|
45
|
+
3. Open a chat — type in plain language. The agent reads / writes the
|
|
46
|
+
`.reflex/` tree, your memory files, and (with permission) shell +
|
|
47
|
+
web tools.
|
|
48
|
+
|
|
49
|
+
## What Reflex actually does
|
|
50
|
+
|
|
51
|
+
### A knowledge base per Space
|
|
52
|
+
|
|
53
|
+
The agent builds a tree of markdown notes under `<your-dir>/.reflex/`:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
<your-dir>/
|
|
57
|
+
├── .reflexignore — gitignore-syntax — same rules
|
|
58
|
+
└── .reflex/
|
|
59
|
+
├── INDEX.md — top-level summary
|
|
60
|
+
├── kb/ — categorised entries (note, article, diagram, …)
|
|
61
|
+
├── memory/ — eight files describing the user / project
|
|
62
|
+
├── topics/ — chat transcripts
|
|
63
|
+
├── journal/ — daily entries
|
|
64
|
+
├── workflows/ — saved recipes
|
|
65
|
+
├── utilities/ — locally-installed extensions
|
|
66
|
+
└── worktrees/ — task-bound git worktrees
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
See [docs/kb.md](docs/kb.md) and [docs/architecture.md](docs/architecture.md).
|
|
70
|
+
|
|
71
|
+
### Cross-session memory
|
|
72
|
+
|
|
73
|
+
Eight bounded markdown files capture who the user is and what the
|
|
74
|
+
project is about. Every chat starts with this loaded into the system
|
|
75
|
+
prompt — the agent never re-asks who you are.
|
|
76
|
+
|
|
77
|
+
A weekly system task rolls up journal entries into a `RECENT.md`
|
|
78
|
+
summary. A hygiene scanner refuses memory writes that look like
|
|
79
|
+
prompt injection, credentials, or invisible unicode.
|
|
80
|
+
|
|
81
|
+
See [docs/memory.md](docs/memory.md).
|
|
82
|
+
|
|
83
|
+
### Searchable conversation history
|
|
84
|
+
|
|
85
|
+
Every journal entry + chat transcript across every Space is indexed
|
|
86
|
+
into a SQLite FTS5 database under `$REFLEX_HOME/sessions.db`. The
|
|
87
|
+
agent (or you, or a utility) can ask "what did we say about X?" with
|
|
88
|
+
ranked snippets returning in milliseconds.
|
|
89
|
+
|
|
90
|
+
See [docs/sessions.md](docs/sessions.md).
|
|
91
|
+
|
|
92
|
+
### Linear workflows, scheduled
|
|
93
|
+
|
|
94
|
+
The user (or the agent) composes "recipes" from typed steps —
|
|
95
|
+
`web-fetch`, `ask-agent`, `kb-write`, `image-generate`, etc. The
|
|
96
|
+
background scheduler fires triggered ones hourly / daily / weekly.
|
|
97
|
+
|
|
98
|
+
See [docs/workflows.md](docs/workflows.md).
|
|
99
|
+
|
|
100
|
+
### Installable utilities
|
|
101
|
+
|
|
102
|
+
Mini-apps that bring a UI iframe, server actions, slash commands,
|
|
103
|
+
skills, system-prompt addenda, and workflows. Shipped curated or
|
|
104
|
+
installed from GitHub. Two examples ship by default:
|
|
105
|
+
|
|
106
|
+
- **`learn-anything`** — chat-driven topic learning, materialised into
|
|
107
|
+
the KB.
|
|
108
|
+
- **`task-board`** — Kanban board with agent-dispatch, git worktrees,
|
|
109
|
+
pre/post hooks, auto-pickup.
|
|
110
|
+
|
|
111
|
+
See [docs/utilities.md](docs/utilities.md).
|
|
112
|
+
|
|
113
|
+
### Agent dispatch via worktrees
|
|
114
|
+
|
|
115
|
+
Code tasks dispatched from the task-board get an isolated git worktree
|
|
116
|
+
on `task/<slug>`, so two parallel agents can work on the same repo
|
|
117
|
+
without stepping on each other. PR mode auto-detects `gh` CLI and
|
|
118
|
+
turns "Merge" into "Open PR".
|
|
119
|
+
|
|
120
|
+
See [docs/tasks.md](docs/tasks.md).
|
|
121
|
+
|
|
122
|
+
## Architecture at a glance
|
|
123
|
+
|
|
124
|
+
One Node process. Inside it:
|
|
125
|
+
|
|
126
|
+
- Next.js App Router HTTP server (UI + server actions).
|
|
127
|
+
- A background workflow scheduler (in-process singleton).
|
|
128
|
+
- A worker pool for utility server actions.
|
|
129
|
+
- Subprocess agents (Claude Code / Codex) spawned per topic.
|
|
130
|
+
- MCP servers on demand.
|
|
131
|
+
|
|
132
|
+
Two filesystem homes: `REFLEX_HOME` (global state) and
|
|
133
|
+
`<root>/.reflex/` (per-Space).
|
|
134
|
+
|
|
135
|
+
For the full layer diagram and component map see
|
|
136
|
+
[docs/architecture.md](docs/architecture.md).
|
|
137
|
+
|
|
138
|
+
## Documentation
|
|
139
|
+
|
|
140
|
+
| Doc | Topic |
|
|
141
|
+
|---|---|
|
|
142
|
+
| [docs/architecture.md](docs/architecture.md) | System map, process model, two-homes layout |
|
|
143
|
+
| [docs/memory.md](docs/memory.md) | 8-file taxonomy, caps, hygiene, weekly rollup |
|
|
144
|
+
| [docs/sessions.md](docs/sessions.md) | FTS5 recall over journal + topics |
|
|
145
|
+
| [docs/topics.md](docs/topics.md) | Chat transcripts, event log, `/goal` mode |
|
|
146
|
+
| [docs/kb.md](docs/kb.md) | Knowledge-base entries, kinds, slug rules |
|
|
147
|
+
| [docs/workflows.md](docs/workflows.md) | Step kinds, templates, scheduler, system tasks |
|
|
148
|
+
| [docs/utilities.md](docs/utilities.md) | Extension model, manifest, permissions, iframe + worker |
|
|
149
|
+
| [docs/host-api.md](docs/host-api.md) | Full `reflex.*` method reference |
|
|
150
|
+
| [docs/markers.md](docs/markers.md) | `<<reflex:*>>` protocol reference |
|
|
151
|
+
| [docs/skills.md](docs/skills.md) | Skill files, scopes, marker authoring |
|
|
152
|
+
| [docs/tasks.md](docs/tasks.md) | task-board utility, worktree mechanics, PR mode |
|
|
153
|
+
| [docs/agents.md](docs/agents.md) | Claude Code / Codex App Server integration, permissioning |
|
|
34
154
|
|
|
35
155
|
## CLI
|
|
36
156
|
|
|
@@ -41,38 +161,28 @@ reflex watch <dir> # watch dir and refresh KB on changes
|
|
|
41
161
|
reflex chat <dir> # open a chat scoped to dir's KB
|
|
42
162
|
```
|
|
43
163
|
|
|
44
|
-
## Develop from source
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
pnpm install
|
|
48
|
-
pnpm dev # http://localhost:3211 (Next dev server with HMR)
|
|
49
|
-
pnpm build # produce dist/ + .next/ for `reflex start`
|
|
50
|
-
```
|
|
51
|
-
|
|
52
164
|
## Data directory
|
|
53
165
|
|
|
54
166
|
Reflex stores its global state (registered roots, settings, MCP config,
|
|
55
|
-
|
|
167
|
+
secrets, skills, sessions index, …) in one directory:
|
|
56
168
|
|
|
57
169
|
- **Dev (`pnpm dev`)** → `~/.reflex`
|
|
58
170
|
- **Prod (`reflex start` via npm-installed CLI)** → `~/.reflex-agent`
|
|
59
171
|
|
|
60
|
-
Override either by setting `REFLEX_HOME=/your/path` before launching.
|
|
61
|
-
two defaults keep prod and dev experiments isolated.
|
|
172
|
+
Override either by setting `REFLEX_HOME=/your/path` before launching.
|
|
62
173
|
|
|
63
|
-
##
|
|
174
|
+
## Develop from source
|
|
64
175
|
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
├── INDEX.md # description of the whole dir
|
|
71
|
-
└── <subdir>/
|
|
72
|
-
├── INDEX.md # description of this subdir
|
|
73
|
-
└── *.md # topic-structured notes
|
|
176
|
+
```sh
|
|
177
|
+
pnpm install
|
|
178
|
+
pnpm dev # http://localhost:3211 (Next dev server with HMR)
|
|
179
|
+
pnpm build # produce dist/ + .next/ for `reflex start`
|
|
180
|
+
pnpm typecheck
|
|
74
181
|
```
|
|
75
182
|
|
|
183
|
+
PRs welcome. The codebase favours small, focused modules — when in
|
|
184
|
+
doubt, look at neighbouring files and match the style.
|
|
185
|
+
|
|
76
186
|
## Config (`.reflex/config.json`)
|
|
77
187
|
|
|
78
188
|
```json
|
|
@@ -83,4 +193,9 @@ two defaults keep prod and dev experiments isolated.
|
|
|
83
193
|
}
|
|
84
194
|
```
|
|
85
195
|
|
|
86
|
-
`watchDebounceMs` defaults to 30 minutes (`1800000`).
|
|
196
|
+
`watchDebounceMs` defaults to 30 minutes (`1800000`). Lower it for
|
|
197
|
+
tighter loops; the enforced minimum is 1 second (anti-thrash).
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MIT.
|
|
@@ -41,8 +41,33 @@ export async function chatSystemPrompt(scope) {
|
|
|
41
41
|
memoryInstructions(),
|
|
42
42
|
skillAuthoringInstructions(),
|
|
43
43
|
taskAuthoringInstructions(),
|
|
44
|
+
appBuildRoutingInstructions(),
|
|
44
45
|
].join("\n\n");
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Disambiguation guard for "build me an app / tool / bot / integration"
|
|
49
|
+
* requests. Reflex's flagship output is a *utility* (a mini-app that
|
|
50
|
+
* runs INSIDE Reflex — iframe + Host API, TypeScript, no separate
|
|
51
|
+
* hosting), not a standalone service. The orchestrator otherwise treats
|
|
52
|
+
* such a request as a greenfield project and asks about language /
|
|
53
|
+
* deploy, which is wrong when the user means a utility. This is a
|
|
54
|
+
* runtime block (not the editable chat.md) so the routing stays correct
|
|
55
|
+
* regardless of local prompt edits.
|
|
56
|
+
*/
|
|
57
|
+
function appBuildRoutingInstructions() {
|
|
58
|
+
return [
|
|
59
|
+
"## Building an app / tool / integration — utility first",
|
|
60
|
+
"",
|
|
61
|
+
"When the user asks to build, make, or release an app, tool, bot, integration, dashboard, form, or service, FIRST decide what KIND of thing it is — before asking about language, framework, or hosting:",
|
|
62
|
+
"",
|
|
63
|
+
"- **Reflex utility** (the default for anything that extends Reflex or lives in this ecosystem) — a mini-app that runs INSIDE Reflex: a React/TypeScript `ui.tsx` in an iframe, talking to the world only through the Host API (`reflex.*`) with manifest permissions. There is NO separate backend to host and NO deploy step — installing the utility IS the deploy. Utilities are ALWAYS TypeScript, so never ask \"which language?\".",
|
|
64
|
+
"- **Standalone project** — a normal codebase the user will run/host themselves (a server, a CLI, a website). Only here do language/framework/deploy questions make sense.",
|
|
65
|
+
"",
|
|
66
|
+
"Routing signals that mean **utility**: the project name starts with `rflx-`/`reflex-`, it lives under a `reflex-*` parent, the user says \"utility\"/\"mini-app\"/\"плагин\"/\"виджет\", or the thing is meant to surface inside Reflex (a panel, a card, a GitHub/Calendar/etc. integration the user will open in the Mini-apps screen).",
|
|
67
|
+
"",
|
|
68
|
+
"If those signals are present, proceed as a utility — gather the missing essentials (what it does, which data/permissions, any secrets) and emit `<<reflex:utility>>`. Do NOT ask about stack or deployment. If it's genuinely unclear which kind it is, ask THAT question first via `<<reflex:question>>` (\"Reflex utility that runs inside Reflex, or a standalone app you'll host yourself?\") — don't jump to language selection.",
|
|
69
|
+
].join("\n");
|
|
70
|
+
}
|
|
46
71
|
/**
|
|
47
72
|
* Inline image generation via `<<reflex:image-gen>>`. Reflex calls
|
|
48
73
|
* Gemini Nano Banana (or Codex `$imagegen`) post-turn, saves the bytes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../lib/reflex/agents/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAEnC,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAmB;IACrD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,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SAAS,yBAAyB;IAChC,OAAO;QACL,4CAA4C;QAC5C,EAAE;QACF,6ZAA6Z;QAC7Z,EAAE;QACF,KAAK;QACL,yBAAyB;QACzB,wCAAwC;QACxC,uGAAuG;QACvG,yGAAyG;QACzG,oFAAoF;QACpF,0CAA0C;QAC1C,+BAA+B;QAC/B,+CAA+C;QAC/C,0BAA0B;QAC1B,KAAK;QACL,EAAE;QACF,uSAAuS;QACvS,EAAE;QACF,KAAK;QACL,yBAAyB;QACzB,gBAAgB;QAChB,cAAc;QACd,uBAAuB;QACvB,sEAAsE;QACtE,KAAK;QACL,0BAA0B;QAC1B,KAAK;QACL,EAAE;QACF,QAAQ;QACR,4FAA4F;QAC5F,qJAAqJ;QACrJ,mIAAmI;QACnI,uEAAuE;QACvE,iFAAiF;KAClF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -220,7 +220,7 @@ To create a utility, emit a marker:
|
|
|
220
220
|
- \`"@host/api"\` — gives the \`{ reflex }\` object (see below).
|
|
221
221
|
- \`"@host/ui"\` — gives primitives: Button, Input, Textarea, Label, Card, CardContent, CardHeader, CardTitle, Badge, ScrollArea.
|
|
222
222
|
- No other packages / node_modules / node:* modules. esbuild rejects any other import.
|
|
223
|
-
3. **No fetch/XHR/WebSocket/localStorage** inside the utility. Only \`reflex.web.fetch({url})\` with an explicitly whitelisted domain in the manifest.
|
|
223
|
+
3. **No fetch/XHR/WebSocket/localStorage** inside the utility. Only \`reflex.web.fetch({url})\` with an explicitly whitelisted domain in the manifest. To DISPLAY external images via \`<img src>\`, list their hosts in \`permissions.images.domains\` — the CSP blocks any host not on that list.
|
|
224
224
|
4. **State** is persisted via \`reflex.fs.write({path, content})\` (in \`<utility>/data/\`) or \`reflex.kb.add({...})\`.
|
|
225
225
|
5. **Manifest** must list every required permission — the user sees this list at install time and can refuse.
|
|
226
226
|
|
|
@@ -238,6 +238,7 @@ To create a utility, emit a marker:
|
|
|
238
238
|
"kb": {"read": true, "write": true, "kinds": ["3d-model"]},
|
|
239
239
|
"fs": {"sandbox": true},
|
|
240
240
|
"web": {"fetch": {"domains": ["api.example.com"]}, "search": false},
|
|
241
|
+
"images": {"domains": ["cdn.example.com"]},
|
|
241
242
|
"audit": {"write": true},
|
|
242
243
|
"workers": {"enabled": true}
|
|
243
244
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../../lib/reflex/prompts/defaults.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,CAAU,CAAC;AAG3D,MAAM,CAAC,MAAM,eAAe,GAAiC;IAC3D,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE,eAAe;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAmC;IAChE,OAAO,EAAE;QACP,UAAU;QACV,MAAM;QACN,OAAO;QACP,UAAU;QACV,aAAa;QACb,OAAO;QACP,WAAW;QACX,UAAU;KACX;IACD,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC;CACnD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAiC;IAC7D,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DV;IAEC,IAAI,EAAE
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../../lib/reflex/prompts/defaults.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,CAAU,CAAC;AAG3D,MAAM,CAAC,MAAM,eAAe,GAAiC;IAC3D,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE,eAAe;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAmC;IAChE,OAAO,EAAE;QACP,UAAU;QACV,MAAM;QACN,OAAO;QACP,UAAU;QACV,aAAa;QACb,OAAO;QACP,WAAW;QACX,UAAU;KACX;IACD,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC;CACnD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAiC;IAC7D,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DV;IAEC,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkRP;CACA,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.id=2108,exports.ids=[2108],exports.modules={4953:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"unstable_rethrow",{enumerable:!0,get:function(){return d}});let d=c(24688).unstable_rethrow;("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},6993:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(63003),e=c(9310),f=c(24576);async function g({children:a,params:b}){let{id:c}=await b;return await (0,f.Zn)(c)||(0,e.notFound)(),(0,d.jsx)("div",{className:"flex-1 flex flex-col min-h-0",children:a})}},7902:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{AY:()=>m,LH:()=>q,LK:()=>l,Ll:()=>r,XF:()=>s,Xz:()=>o,hb:()=>n,nf:()=>p});var e=c(73745);c(66493);var f=c(65326),g=c(53905),h=c(73928),i=c(55143),j=c(63781),k=a([i]);async function l(a){try{let b=await (0,g.Zn)(a);if(!b)return{ok:!1,error:"Root not found"};let d=await (0,h.listWorkflows)(b.path),{collectExtensions:e}=await Promise.resolve().then(c.bind(c,35961)),f=await e({rootId:a}),i=new Set(d.map(a=>a.id)),j=[...d,...f.workflows.filter(a=>!i.has(a.id))];return{ok:!0,workflows:j}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function m(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await (0,h.readWorkflow)(c.path,b);if(!d)return{ok:!1,error:"Not found"};return{ok:!0,workflow:d}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function n(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await (0,h.readWorkflow)(c.path,b.id),e={...b,createdAt:d?.createdAt??b.createdAt??new Date().toISOString(),updatedAt:new Date().toISOString()},j=(0,i.n)(e);if(j)return{ok:!1,error:j};return await (0,h.r$)(c.path,e),(0,f.revalidatePath)(`/roots/${a}/workflows`),(0,f.revalidatePath)(`/roots/${a}/workflows/${b.id}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function o(a,b,c){try{let d=await (0,g.Zn)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await (0,h.readWorkflow)(d.path,b);if(!e)return{ok:!1,error:"Workflow lives in a utility manifest — uninstall or fork it to disable."};return await (0,h.r$)(d.path,{...e,enabled:c,updatedAt:new Date().toISOString()}),(0,f.revalidatePath)(`/roots/${a}/workflows`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function p(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};return await (0,h.L6)(c.path,b),(0,f.revalidatePath)(`/roots/${a}/workflows`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function q(a,b,c){return(0,i.runWorkflow)(a,b,c)}async function r(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await (0,h.v)(c.path,b);return{ok:!0,runs:d}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function s(a,b,c,d){try{let e=await (0,g.Zn)(a);if(!e)return{ok:!1,error:"Root not found"};let i=await (0,h.readWorkflow)(e.path,b);if(!i)return{ok:!1,error:"Not found"};let j=i.steps.findIndex(a=>a.id===c);if(j<0)return{ok:!1,error:"Step not found"};let k="up"===d?j-1:j+1;if(k<0||k>=i.steps.length)return{ok:!0};let l=[...i.steps],m=l[j],n=l[k];return l[j]=n,l[k]=m,i.steps=l,i.updatedAt=new Date().toISOString(),await (0,h.r$)(e.path,i),(0,f.revalidatePath)(`/roots/${a}/workflows/${b}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}i=(k.then?(await k)():k)[0],(0,j.D)([l,m,n,o,p,q,r,s]),(0,e.A)(l,"405ddccbe8bef6d489f4992bda020a2e5bc9f8fae6",null),(0,e.A)(m,"60c82f17604f25eeacd9af7eb98ef2d725c514479e",null),(0,e.A)(n,"60dd5dac778413a6a294ef0b84d0efc3f2bbb648cc",null),(0,e.A)(o,"70051d59581f5c9bb39c5af94036fd17a66b297228",null),(0,e.A)(p,"60df8920bf8e0f288c1daa078d444de5bfce2462b6",null),(0,e.A)(q,"70f18a8b702169b839b3250592ffa4c54fbf738b6c",null),(0,e.A)(r,"607e0286eafa2dc39d12abe59825f9fd9a54026bf9",null),(0,e.A)(s,"78835df1a359bcae4eb4db6365978df62c5d36af8b",null),d()}catch(a){d(a)}})},9310:(a,b,c)=>{"use strict";var d=c(74830);c.o(d,"notFound")&&c.d(b,{notFound:function(){return d.notFound}}),c.o(d,"redirect")&&c.d(b,{redirect:function(){return d.redirect}})},16144:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{"00de78a30d1f02726db8d523a71da4c1f36e96c3f7":()=>g.i,"402e8f8df3442e9022ae18759f7068904e2bc922aa":()=>e.nY,"403e4f3de036fe384be3e5ea40c1312ed13dee7483":()=>h.$z,"405cdcdcb0153357309cbdfd6ea4f78daa27ecf5f6":()=>e.nC,"405ddccbe8bef6d489f4992bda020a2e5bc9f8fae6":()=>i.LK,"4092545769dd65089368bb8058fc7afd52f1ce88e0":()=>f.z,"40930251adfbc5f2553990de7ada6a1100aed1690c":()=>f.u,"409a0534e867f63ddc913b4b1884e09f5a6e1a4b50":()=>h.MU,"607e0286eafa2dc39d12abe59825f9fd9a54026bf9":()=>i.Ll,"6086483d8a166bf6af9245a867f2f5d82269cca46f":()=>h.Tc,"60b25f9a7912f946be9377bda0c1a37aec72f7d8ed":()=>e.OQ,"60c2a4c8a50ed88e5adf0646cff15ad227ad80c5ce":()=>e.L4,"60c82f17604f25eeacd9af7eb98ef2d725c514479e":()=>i.AY,"60d39ef1f029bc97175fe7e6620d90366a0f9201ea":()=>e.T$,"60dd5dac778413a6a294ef0b84d0efc3f2bbb648cc":()=>i.hb,"60df8920bf8e0f288c1daa078d444de5bfce2462b6":()=>i.nf,"70051d59581f5c9bb39c5af94036fd17a66b297228":()=>i.Xz,"708c38608029960899f79a68beb1401258ac0f4c87":()=>e.h$,"70f18a8b702169b839b3250592ffa4c54fbf738b6c":()=>i.LH,"78835df1a359bcae4eb4db6365978df62c5d36af8b":()=>i.XF,"78d12bf078b77e342c117678b70a4104ecdf74c3d7":()=>e.g3});var e=c(13415),f=c(3890),g=c(50995),h=c(15754),i=c(7902),j=a([e,h,i]);[e,h,i]=j.then?(await j)():j,d()}catch(a){d(a)}})},17596:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(19963).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},24688:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"unstable_rethrow",{enumerable:!0,get:function(){return function a(b){if((0,g.isNextRouterError)(b)||(0,f.isBailoutToCSRError)(b)||(0,i.isDynamicServerError)(b)||(0,h.isDynamicPostpone)(b)||(0,e.isPostpone)(b)||(0,d.isHangingPromiseRejectionError)(b))throw b;b instanceof Error&&"cause"in b&&a(b.cause)}}});let d=c(88546),e=c(60703),f=c(61052),g=c(54144),h=c(44113),i=c(43909);("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},26290:(a,b,c)=>{"use strict";c.d(b,{cn:()=>f});var d=c(83243),e=c(86103);function f(...a){return(0,e.QP)((0,d.$)(a))}},30717:(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0})}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"unauthorized",{enumerable:!0,get:function(){return d}}),c(75826).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},42343:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"notFound",{enumerable:!0,get:function(){return e}});let d=""+c(75826).HTTP_ERROR_FALLBACK_ERROR_CODE+";404";function e(){let a=Object.defineProperty(Error(d),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw a.digest=d,a}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},42382:(a,b,c)=>{"use strict";c.d(b,{E:()=>i});var d=c(64173);c(17240);var e=c(20483),f=c(91520),g=c(91344);let h=(0,e.F)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function i({className:a,variant:b="default",asChild:c=!1,...e}){let i=c?f.bL:"span";return(0,d.jsx)(i,{"data-slot":"badge","data-variant":b,className:(0,g.cn)(h({variant:b}),a),...e})}},43490:(a,b,c)=>{"use strict";function d(){throw Object.defineProperty(Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0})}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"forbidden",{enumerable:!0,get:function(){return d}}),c(75826).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},47452:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(19963).A)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]])},52231:(a,b,c)=>{"use strict";c.r(b),c.d(b,{"404adc50a01485162509b4a9fdde6d7bfaf805c3f1":()=>d.rD,"40503422fc01a775f357588b2fc0717b684d2c284d":()=>d.Gh,"40a01fd29d879aec92ff36c832cd9d7aef4c3b229d":()=>d.summarizeYoutubeAction,"40a329d4915128f2aca8e828860155b2e68a750b04":()=>d.AZ,"40cb00e3c11070b27380f847f92ec52b3a61950357":()=>d.O1});var d=c(18746)},60524:(a,b,c)=>{"use strict";c.d(b,{Separator:()=>d});let d=(0,c(54491).registerClientReference)(function(){throw Error("Attempted to call Separator() from the server but Separator is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/reflex-agent/reflex-agent/components/ui/separator.tsx","Separator")},71495:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),!function(a,b){for(var c in b)Object.defineProperty(a,c,{enumerable:!0,get:b[c]})}(b,{getRedirectError:function(){return g},getRedirectStatusCodeFromError:function(){return l},getRedirectTypeFromError:function(){return k},getURLFromRedirectError:function(){return j},permanentRedirect:function(){return i},redirect:function(){return h}});let d=c(20498),e=c(52512),f=c(19121).actionAsyncStorage;function g(a,b,c){void 0===c&&(c=d.RedirectStatusCode.TemporaryRedirect);let f=Object.defineProperty(Error(e.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return f.digest=e.REDIRECT_ERROR_CODE+";"+b+";"+a+";"+c+";",f}function h(a,b){var c;throw null!=b||(b=(null==f||null==(c=f.getStore())?void 0:c.isAction)?e.RedirectType.push:e.RedirectType.replace),g(a,b,d.RedirectStatusCode.TemporaryRedirect)}function i(a,b){throw void 0===b&&(b=e.RedirectType.replace),g(a,b,d.RedirectStatusCode.PermanentRedirect)}function j(a){return(0,e.isRedirectError)(a)?a.digest.split(";").slice(2,-2).join(";"):null}function k(a){if(!(0,e.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return a.digest.split(";",2)[1]}function l(a){if(!(0,e.isRedirectError)(a))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return Number(a.digest.split(";").at(-2))}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},74830:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),!function(a,b){for(var c in b)Object.defineProperty(a,c,{enumerable:!0,get:b[c]})}(b,{ReadonlyURLSearchParams:function(){return k},RedirectType:function(){return e.RedirectType},forbidden:function(){return g.forbidden},notFound:function(){return f.notFound},permanentRedirect:function(){return d.permanentRedirect},redirect:function(){return d.redirect},unauthorized:function(){return h.unauthorized},unstable_isUnrecognizedActionError:function(){return l},unstable_rethrow:function(){return i.unstable_rethrow}});let d=c(71495),e=c(52512),f=c(42343),g=c(43490),h=c(30717),i=c(4953);class j extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class k extends URLSearchParams{append(){throw new j}delete(){throw new j}set(){throw new j}sort(){throw new j}}function l(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof b.default||"object"==typeof b.default&&null!==b.default)&&void 0===b.default.__esModule&&(Object.defineProperty(b.default,"__esModule",{value:!0}),Object.assign(b.default,b),a.exports=b.default)},80432:()=>{},84913:(a,b,c)=>{"use strict";c.d(b,{$:()=>i});var d=c(63003);c(34750);var e=c(86209),f=c(65715),g=c(26290);let h=(0,e.F)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function i({className:a,variant:b="default",size:c="default",asChild:e=!1,...i}){let j=e?f.bL:"button";return(0,d.jsx)(j,{"data-slot":"button","data-variant":b,"data-size":c,className:(0,g.cn)(h({variant:b,size:c,className:a})),...i})}},90160:()=>{}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports.id=243,exports.ids=[243],exports.modules={6993:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(63003),e=c(9310),f=c(24576);async function g({children:a,params:b}){let{id:c}=await b;return await (0,f.Zn)(c)||(0,e.notFound)(),(0,d.jsx)("div",{className:"flex-1 flex flex-col min-h-0",children:a})}},30515:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},34639:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Aq:()=>o,KV:()=>u,Mh:()=>s,cl:()=>v,hL:()=>p,mm:()=>t,ru:()=>r,tT:()=>q});var e=c(73745);c(66493);var f=c(65326),g=c(53905),h=c(69509),i=c(1405),j=c(93554),k=c(51021),l=c(63781),m=a([j,k]);async function n(a,b){let c=await (0,h.listWidgets)(a),d=await (0,h.readLayout)(a),e=b(d),f=(0,h.reconcileLayout)(e,c.map(a=>a.id),i.SYSTEM_WIDGET_IDS);return await (0,h.writeLayout)(a,f),{ok:!0,layout:f}}async function o(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await n(c.path,a=>({...a,order:b.filter(b=>!a.hidden.includes(b))}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function p(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await n(c.path,a=>({order:a.order.filter(a=>a!==b),hidden:[...new Set([b,...a.hidden])]}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function q(a,b){try{let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};let d=await n(c.path,a=>({order:[b,...a.order.filter(a=>a!==b)],hidden:a.hidden.filter(a=>a!==b)}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function r(a,b,c,d){try{let e=await (0,g.Zn)(a);if(!e)return{ok:!1,error:"Root not found"};let i=await (0,h.readWidget)(e.path,b);if(!i)return{ok:!1,error:"Widget not found"};if(!c||"object"!=typeof c)return{ok:!1,error:"newData must be an object"};let j={...i,data:c,updatedAt:new Date().toISOString(),...void 0!==d?{memory:d}:{}};return await (0,h.writeWidget)(e.path,j),(0,f.revalidatePath)(`/roots/${a}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function s(a,b,c){try{let d=await (0,g.Zn)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await n(d.path,a=>({...a,sizes:{...a.sizes??{},[b]:c}}));return(0,f.revalidatePath)(`/roots/${a}`),e}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function t(a,b,c){try{let d=await (0,g.Zn)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await (0,h.readWidget)(d.path,b);if(!e)return{ok:!1,error:"Widget not found"};let i={...e,refresh:c};return await (0,h.writeWidget)(d.path,i),(0,f.revalidatePath)(`/roots/${a}`),{ok:!0}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function u(a,b){try{let d=await (0,g.Zn)(a);if(!d)return{ok:!1,error:"Root not found"};let e=await (0,h.readWidget)(d.path,b);if(!e)return{ok:!1,error:"Widget not found"};if(!e.sourceTopicId)return{ok:!1,error:"Widget has no source topic — update it from any chat first."};if(j.z.isActive(e.sourceTopicId))return{ok:!1,error:"The source topic is already occupied by an agent — wait for the current turn to finish."};let f={...e,lastRefreshAt:new Date().toISOString()};await (0,h.writeWidget)(d.path,f);let{buildRefreshPromptForWidget:i}=await c.e(4553).then(c.bind(c,94553)),l=await i(d.path,f),m=await (0,k.W)({rootId:a,topicId:e.sourceTopicId,message:l,attachments:[]});if("error"in m)return{ok:!1,error:m.error};return{ok:!0,agentId:m.agentId}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}async function v(a,b){try{if(i.SYSTEM_WIDGET_IDS.includes(b))return{ok:!1,error:"System widget cannot be deleted — only hidden."};let c=await (0,g.Zn)(a);if(!c)return{ok:!1,error:"Root not found"};await (0,h.uv)(c.path,b);let d=await n(c.path,a=>({order:a.order.filter(a=>a!==b),hidden:a.hidden.filter(a=>a!==b)}));return(0,f.revalidatePath)(`/roots/${a}`),d}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}[j,k]=m.then?(await m)():m,(0,l.D)([o,p,q,r,s,t,u,v]),(0,e.A)(o,"60cb7b9c1e5df6376b4db0f7eeac4f5ac0450ca144",null),(0,e.A)(p,"6020efe762909bd7e7b01e9a4831ff20c870794f11",null),(0,e.A)(q,"602e9230549d15e3e2d7dbc093d910cb29119eddce",null),(0,e.A)(r,"78b524de210963de47d6b8ac7abeb11cfdc59e9792",null),(0,e.A)(s,"70f31acc9fb9961f4471a648b52cdec6bef1fd79cb",null),(0,e.A)(t,"7004b2bead0a4ed4f407efd6f178a12bff92dd772a",null),(0,e.A)(u,"600835002437c3c09ab22588ba9d3b965dc91f6ecd",null),(0,e.A)(v,"60ca627fc2997cae1aa88854156e93a78ae4c0e164",null),d()}catch(a){d(a)}})},45911:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(3265);let e=(0,d.createServerReference)("40a329d4915128f2aca8e828860155b2e68a750b04",d.callServer,void 0,d.findSourceMapURL,"saveGeminiKeyAction")},48272:(a,b,c)=>{"use strict";c.d(b,{w:()=>f});var d=c(73745);c(66493);var e=c(36017);async function f(){return{ok:!0,enabled:(await (0,e.M)()).mapServices.enabled}}(0,c(63781).D)([f]),(0,d.A)(f,"0071b07333e7efbb4f929e627e50a711f18f1be62e",null)},54874:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},59190:(a,b,c)=>{"use strict";c.d(b,{v:()=>N});var d=c(64173),e=c(71813),f=c(77424),g=c(17240),h=c(42557);let i=(0,h.A)("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);var j=c(65177),k=c(12619),l=c(66979);let m=(0,h.A)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);var n=c(97338);let o=(0,h.A)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),p=(0,h.A)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var q=c(62481),r=c(25436),s=c(30515),t=c(62261),u=c(20583),v=c(47071);let w=(0,h.A)("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);var x=c(1056),y=c.n(x),z=c(68669);let A=(0,h.A)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var B=c(65943);let C=(0,h.A)("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]),D=(0,h.A)("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);var E=c(28082),F=c(44052),G=c(85548);function H({service:a,size:b=18,className:c}){return(0,d.jsx)("span",{className:"inline-flex items-center justify-center rounded-[5px] font-bold leading-none text-white shrink-0 "+(c??""),style:{background:a.brand,width:b,height:b,fontSize:Math.max(8,Math.floor(.55*b)),letterSpacing:a.glyph.length>1?"-0.05em":"0"},"aria-hidden":!0,children:a.glyph})}var I=c(3265);function J({point:a,services:b,interactive:c,onRemove:f}){let g=(0,e.c)("roots");return(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[b.slice(0,4).map(b=>(0,d.jsx)("a",{href:b.urlFor(a.lat,a.lng),target:"_blank",rel:"noopener noreferrer",className:"rounded p-0.5 hover:ring-1 hover:ring-offset-1 hover:ring-violet-300",title:g("mapWidget.navigationTitle",{service:b.label}),children:(0,d.jsx)(H,{service:b,size:18})},b.id)),(0,d.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(`${a.lat}, ${a.lng}`).then(()=>F.oR.success(g("mapWidget.coordsCopied"))).catch(()=>F.oR.error(g("mapWidget.clipboardUnavailable")))},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground",title:g("mapWidget.copyCoords"),children:(0,d.jsx)(E.A,{className:"h-3 w-3"})}),c&&(0,d.jsx)("button",{type:"button",onClick:f,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-destructive",title:g("mapWidget.removePoint"),children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]})}function K({service:a,stops:b}){let c=(0,e.c)("roots"),f=a.routeUrlFor(b),g=b=>{b.preventDefault(),b.stopPropagation(),navigator.clipboard.writeText(f).then(()=>F.oR.success(c("mapWidget.linkCopied",{service:a.label}))).catch(()=>F.oR.error(c("mapWidget.clipboardUnavailable")))};return(0,d.jsxs)("a",{href:f,target:"_blank",rel:"noopener noreferrer",onContextMenu:g,className:"inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[11px] hover:bg-accent",title:c("mapWidget.openTitle",{service:a.label}),children:[(0,d.jsx)(H,{service:a,size:16}),(0,d.jsx)("span",{className:"truncate max-w-[80px]",children:a.label}),(0,d.jsx)("button",{type:"button",onClick:g,className:"text-muted-foreground hover:text-foreground",title:c("mapWidget.copyLinkTitle"),children:(0,d.jsx)(E.A,{className:"h-2.5 w-2.5"})})]})}I.callServer,I.findSourceMapURL;var L=c(69552);let M={markdown:function({data:a}){return(0,d.jsx)("div",{className:"text-sm",children:(0,d.jsx)(f.p,{source:a.body??""})})},"news-list":function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[m,n]=(0,g.useState)(h),[o,p]=(0,g.useTransition)();(0,g.useRef)("");let q=a=>{n(a),c&&p(async()=>{try{await c({items:a})}catch{}})};return 0===m.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("newsListWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-2",children:m.map((a,c)=>(0,d.jsxs)("li",{className:`group/row relative border-l-2 pl-2.5 py-0.5 transition ${a.read?"border-muted-foreground/30 opacity-60":"border-violet-200"}`,children:[(0,d.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,d.jsx)(i,{className:`h-3 w-3 mt-1 shrink-0 ${a.read?"text-muted-foreground":"text-violet-600"}`}),(0,d.jsxs)("div",{className:"min-w-0 flex-1 pr-12",children:[a.url?(0,d.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[a.title,(0,d.jsx)(j.A,{className:"h-3 w-3 opacity-50"})]}):(0,d.jsx)("span",{className:"text-sm font-medium",children:a.title}),a.summary&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:a.summary}),(a.source||a.date)&&(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-0.5 flex gap-1.5",children:[a.source&&(0,d.jsx)("span",{children:a.source}),a.source&&a.date&&(0,d.jsx)("span",{children:"\xb7"}),a.date&&(0,d.jsx)("span",{className:"font-mono",children:a.date})]})]})]}),!b&&(0,d.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[(0,d.jsx)("button",{type:"button",onClick:()=>{!b&&q(m.map((a,b)=>b===c?{...a,read:!a.read}:a))},disabled:o,"aria-label":a.read?f("newsListWidget.markUnreadAria"):f("newsListWidget.markReadAria"),title:a.read?f("newsListWidget.markUnreadTitle"):f("newsListWidget.markReadTitle"),className:"p-1 rounded hover:bg-emerald-100 dark:hover:bg-emerald-950/40 text-muted-foreground hover:text-emerald-600 disabled:opacity-30",children:(0,d.jsx)(k.A,{className:"h-3 w-3"})}),(0,d.jsx)("button",{type:"button",onClick:()=>{!b&&q(m.filter((a,b)=>b!==c))},disabled:o,"aria-label":f("newsListWidget.dismissAria"),title:f("newsListWidget.dismissTitle"),className:"p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]})]},c))})},"link-list":function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[i,k]=(0,g.useState)(h),[l,o]=(0,g.useTransition)();return((0,g.useRef)(""),0===i.length)?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("linkListWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-0.5",children:i.map((a,e)=>(0,d.jsxs)("li",{className:"group/row relative",children:[(0,d.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-start gap-1.5 rounded-md px-2 py-1.5 hover:bg-accent/40 transition",children:[(0,d.jsx)(m,{className:"h-3 w-3 mt-1 shrink-0 text-sky-600"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"text-sm font-medium hover:underline inline-flex items-center gap-1",children:[a.title,(0,d.jsx)(j.A,{className:"h-3 w-3 opacity-50"})]}),a.hint&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:a.hint}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground truncate font-mono mt-0.5",children:a.url})]})]}),!b&&(0,d.jsx)("button",{type:"button",onClick:()=>(a=>{if(!b){var d;k(d=i.filter((b,c)=>c!==a)),c&&o(async()=>{try{await c({items:d})}catch{}})}})(e),disabled:l,"aria-label":f("linkListWidget.removeAria"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(n.A,{className:"h-3 w-3"})})]},e))})},kpi:function({data:a}){let b=(0,e.c)("roots"),c=a.items??[];if(0===c.length)return(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("kpiWidget.empty")});let f=Math.min(c.length,3);return(0,d.jsx)("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${f}, minmax(0,1fr))`},children:c.map((a,b)=>(0,d.jsxs)("div",{className:"rounded-md border bg-card px-3 py-2 flex flex-col gap-0.5",children:[(0,d.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:a.label}),(0,d.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,d.jsx)("span",{className:"text-lg font-semibold tabular-nums",children:a.value}),"up"===a.delta&&(0,d.jsx)(o,{className:"h-3.5 w-3.5 text-emerald-600"}),"down"===a.delta&&(0,d.jsx)(p,{className:"h-3.5 w-3.5 text-rose-600"}),"flat"===a.delta&&(0,d.jsx)(q.A,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),a.hint&&(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground leading-snug",children:a.hint})]},b))})},checklist:function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[i,j]=(0,g.useState)(h),[l,m]=(0,g.useTransition)(),[o,p]=(0,g.useState)("");(0,g.useRef)("");let q=a=>{j(a),c&&m(async()=>{try{await c({items:a})}catch{}})},w=a=>{b||q(i.map((b,c)=>c===a?{...b,done:!b.done}:b))};return 0===i.length&&b?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("checklistWidget.empty")}):(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("ul",{className:"space-y-0.5",children:i.map((a,c)=>(0,d.jsxs)("li",{className:`group/row flex items-start gap-2 text-sm py-0.5 rounded hover:bg-accent/30 px-1 -mx-1 ${a.done?"text-muted-foreground":""}`,children:[(0,d.jsx)("button",{type:"button",onClick:()=>w(c),disabled:b||l,"aria-label":a.done?f("checklistWidget.uncheckAria"):f("checklistWidget.checkAria"),className:"shrink-0 mt-0.5 disabled:opacity-50",children:a.done?(0,d.jsx)(k.A,{className:"h-3.5 w-3.5 text-emerald-600"}):(0,d.jsx)(r.A,{className:"h-3.5 w-3.5 text-muted-foreground/60 hover:text-foreground"})}),(0,d.jsx)("span",{className:`flex-1 min-w-0 break-words ${a.done?"line-through":""}`,onClick:()=>w(c),style:b?{}:{cursor:"pointer"},children:a.text}),!b&&(0,d.jsx)("button",{type:"button",onClick:()=>{!b&&q(i.filter((a,b)=>b!==c))},disabled:l,"aria-label":f("checklistWidget.removeAria"),className:"opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0 p-0.5 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(n.A,{className:"h-3 w-3"})})]},c))}),!b&&(0,d.jsxs)("form",{className:"flex items-center gap-1 pt-1",onSubmit:a=>{a.preventDefault(),(()=>{if(b)return;let a=o.trim();a&&(q([...i,{text:a,done:!1}]),p(""))})()},children:[(0,d.jsx)(s.A,{className:"h-3 w-3 text-muted-foreground shrink-0"}),(0,d.jsx)(v.p,{value:o,onChange:a=>p(a.target.value),placeholder:f("checklistWidget.newItemPlaceholder"),className:"h-7 text-xs flex-1 border-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 px-1",disabled:l}),o.trim()&&(0,d.jsx)(u.$,{type:"submit",size:"sm",variant:"ghost",className:"h-6 text-[10px] px-1.5",disabled:l,children:l?(0,d.jsx)(t.A,{className:"h-3 w-3 animate-spin"}):f("checklistWidget.add")})]})]})},quote:function({data:a}){let b=(0,e.c)("roots");return a?.text?(0,d.jsxs)("figure",{className:"relative pl-6",children:[(0,d.jsx)(w,{className:"h-5 w-5 absolute left-0 top-0 text-violet-300"}),(0,d.jsx)("blockquote",{className:"text-sm italic leading-relaxed",children:a.text}),a.attribution&&(0,d.jsxs)("figcaption",{className:"text-xs text-muted-foreground mt-1.5",children:["— ",a.attribution]})]}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("quoteWidget.empty")})},"kb-pinned":function({rootId:a,data:b,readonly:c,onPatch:f}){let h=(0,e.c)("roots"),i=b.items??[],[j,k]=(0,g.useState)(i),[m,n]=(0,g.useTransition)();return((0,g.useRef)(""),0===j.length)?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:h("kbPinnedWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-1",children:j.map((b,e)=>{let g=b.rel.split("/").map(encodeURIComponent).join("/");return(0,d.jsxs)("li",{className:"group/row relative",children:[(0,d.jsxs)(y(),{href:`/roots/${a}/kb/${g}`,className:"flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent/40 transition pr-7",children:[(0,d.jsx)(z.A,{className:"h-3 w-3 mt-0.5 shrink-0 text-emerald-700"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"text-sm font-medium truncate",children:b.title??b.rel}),b.snippet&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed mt-0.5",children:b.snippet}),(0,d.jsx)("div",{className:"text-[10px] text-muted-foreground font-mono mt-0.5 truncate",children:b.rel})]})]}),!c&&(0,d.jsx)("button",{type:"button",onClick:()=>(a=>{if(!c){var b;k(b=j.filter((b,c)=>c!==a)),f&&n(async()=>{try{await f({items:b})}catch{}})}})(e),disabled:m,"aria-label":h("kbPinnedWidget.unpinAria"),title:h("kbPinnedWidget.unpinTitle"),className:"absolute top-1.5 right-1.5 opacity-0 group-hover/row:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/15 text-muted-foreground hover:text-destructive disabled:opacity-30",children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]},e)})})},progress:function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=a.items??[],[i,j]=(0,g.useState)(h),[k,l]=(0,g.useTransition)();(0,g.useRef)("");let m=(a,d)=>{if(!b){var e;j(e=i.map((b,c)=>c===a?{...b,current:Math.max(0,b.current+d)}:b)),c&&l(async()=>{try{await c({items:e})}catch{}})}};return 0===i.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("progressWidget.empty")}):(0,d.jsx)("ul",{className:"space-y-2.5",children:i.map((a,c)=>{let e=a.target>0?Math.max(0,Math.min(100,a.current/a.target*100)):0;return(0,d.jsxs)("li",{className:"space-y-1 group/row",children:[(0,d.jsxs)("div",{className:"flex items-baseline justify-between gap-2 text-sm",children:[(0,d.jsx)("span",{className:"truncate flex-1 min-w-0",children:a.label}),!b&&(0,d.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/row:opacity-100 transition-opacity shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:()=>m(c,-1),disabled:k||a.current<=0,"aria-label":"−1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)(A,{className:"h-3 w-3"})}),(0,d.jsx)("button",{type:"button",onClick:()=>m(c,1),disabled:k,"aria-label":"+1",className:"p-0.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground disabled:opacity-30",children:(0,d.jsx)(s.A,{className:"h-3 w-3"})})]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0",children:[a.current," / ",a.target,a.unit?` ${a.unit}`:""]})]}),(0,d.jsx)("div",{className:"h-1.5 rounded-full bg-muted overflow-hidden",children:(0,d.jsx)("div",{className:"h-full bg-violet-600 transition-all",style:{width:`${e}%`}})})]},c)})})},image:function({data:a}){let b=(0,e.c)("roots");return a?.url?(0,d.jsxs)("figure",{className:"space-y-1",children:[(0,d.jsx)("img",{src:a.url,alt:a.alt??"",className:"rounded-md w-full h-auto border",loading:"lazy"}),a.caption&&(0,d.jsx)("figcaption",{className:"text-xs text-muted-foreground text-center",children:a.caption})]}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("imageWidget.empty")})},"stat-table":function({data:a}){let b=(0,e.c)("roots"),c=a.rows??[];return 0===c.length?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:b("statTableWidget.empty")}):(0,d.jsx)("div",{className:"overflow-x-auto -mx-1",children:(0,d.jsxs)("table",{className:"w-full text-sm",children:[a.columns&&a.columns.length>0&&(0,d.jsx)("thead",{children:(0,d.jsx)("tr",{className:"border-b",children:a.columns.map((a,b)=>(0,d.jsx)("th",{className:"text-left text-[10px] uppercase tracking-wider text-muted-foreground font-medium px-1.5 py-1.5",children:a},b))})}),(0,d.jsx)("tbody",{children:c.map((a,b)=>(0,d.jsx)("tr",{className:"border-b border-dashed last:border-b-0 hover:bg-accent/30",children:a.map((a,b)=>(0,d.jsx)("td",{className:"px-1.5 py-1.5 align-top",children:a},b))},b))})]})})},map:function({data:a,readonly:b,onPatch:c}){let f=(0,e.c)("roots"),h=(0,g.useRef)(null),i=(0,g.useRef)(null),[j,k]=(0,g.useState)(!1),[m,o]=(0,g.useState)(G.JY),[p,q]=(0,g.useState)(""),[r,u]=(0,g.useState)(!1),[v,w]=(0,g.useState)([]),[x,y]=(0,g.useState)(!1),[z,A]=(0,g.useState)([]),E=a.points??[],H=a.route?.stops??[],I=x?z:H,L=(0,g.useMemo)(()=>I.map(a=>E[a]).filter(a=>!!a).map(a=>({lat:a.lat,lng:a.lng})),[I,E]),M=(0,g.useMemo)(()=>G.yp.filter(a=>m.includes(a.id)),[m]);(0,g.useEffect)(()=>{if(!j||!h.current)return;let b=window.L;if(!b||(i.current&&(i.current.remove(),i.current=null),0===E.length))return;let c=b.map(h.current,{scrollWheelZoom:!1,zoomControl:!0});i.current=c,b.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(c);let d=E.map((a,d)=>{let e=I.includes(d),g=function(a,b,c){let d=a=>a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),e=b.map(b=>{let c=b.urlFor(a.lat,a.lng);return`<a href="${d(c)}" target="_blank" rel="noopener noreferrer" title="${d(b.label)}" style="display:inline-flex;align-items:center;gap:4px;margin:2px 4px 2px 0;padding:2px 6px;border-radius:5px;border:1px solid #e5e7eb;text-decoration:none;font-size:11px;color:#111;background:#fff;"><span style="display:inline-block;width:14px;height:14px;border-radius:3px;background:${b.brand};color:#fff;font-size:9px;font-weight:700;line-height:14px;text-align:center;letter-spacing:${b.glyph.length>1?"-0.05em":"0"}">${d(b.glyph)}</span><span>${d(b.label)}</span></a>`}).join("");return['<div style="font-family:inherit;min-width:200px">',`<div style="font-weight:600;font-size:13px;margin-bottom:2px">${d(a.title)}</div>`,a.description?`<div style="font-size:12px;color:#666;margin-bottom:6px">${d(a.description)}</div>`:"",`<div style="font-family:monospace;font-size:10px;color:#888;margin-bottom:6px">${a.lat.toFixed(5)}, ${a.lng.toFixed(5)}</div>`,b.length>0?`<div style="font-size:10px;color:#888;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:2px">${d(c.openIn)}</div>${e}`:"",`<div style="margin-top:6px"><button type="button" data-reflex-copy="${a.lat}, ${a.lng}" style="font-size:11px;padding:2px 8px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer">📋 ${d(c.copyCoords)}</button></div>`,"</div>"].filter(Boolean).join("")}(a,M,{openIn:f("mapWidget.openIn"),copyCoords:f("mapWidget.copyCoords")}),h=b.marker([a.lat,a.lng],{opacity:x&&!e?.55:1}).addTo(c);return h.bindPopup(g,{maxWidth:280}),h.on("click",()=>{x&&A(a=>a.includes(d)?a.filter(a=>a!==d):[...a,d])}),h});L.length>=2&&b.polyline(L.map(a=>[a.lat,a.lng]),{color:a.route?.color??"#7c3aed",weight:4,opacity:.85,dashArray:x?"6,6":void 0}).addTo(c);let e=a=>{let b=a.target.closest("[data-reflex-copy]");if(b){let c=b.getAttribute("data-reflex-copy");c&&navigator.clipboard.writeText(c).then(()=>F.oR.success(f("mapWidget.copied"))).catch(()=>F.oR.error(f("mapWidget.clipboardUnavailable"))),a.preventDefault()}};if(h.current.addEventListener("click",e),a.center&&"number"==typeof a.zoom)c.setView([a.center.lat,a.center.lng],a.zoom);else if(1===E.length)c.setView([E[0].lat,E[0].lng],a.zoom??12);else{let a=b.featureGroup(d);c.fitBounds(a.getBounds().pad(.2))}return()=>{h.current?.removeEventListener("click",e),c.remove(),i.current=null}},[j,a,m.join("|"),x,z.join(",")]);let N=!b&&!!c,O=async()=>{let a=p.trim();if(a){u(!0),w([]);try{let b=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(a)}&format=json&limit=6`,c=await fetch(b,{headers:{Accept:"application/json"}});if(!c.ok)throw Error(`status ${c.status}`);let d=await c.json();w(d),0===d.length&&F.oR.message(f("mapWidget.nothingFound"))}catch(a){F.oR.error(f("mapWidget.searchFailed",{error:a instanceof Error?a.message:String(a)}))}finally{u(!1)}}},P=async b=>{if(!N)return;let d=Number(b.lat),e=Number(b.lon);if(!Number.isFinite(d)||!Number.isFinite(e))return void F.oR.error(f("mapWidget.invalidCoordinates"));let g=b.display_name.split(",")[0]?.trim()||b.display_name.slice(0,60),h={...a,points:[...E,{lat:d,lng:e,title:g,description:b.display_name}]};w([]),q(""),await c?.(h)},Q=async b=>{if(!N)return;let d=E.filter((a,c)=>c!==b),e=a.route;if(a.route?.stops?.length){let c=a.route.stops.filter(a=>a!==b).map(a=>a>b?a-1:a);e=c.length>=2?{...a.route,stops:c}:void 0}let f={...a,points:d,...e?{route:e}:{route:void 0}};await c?.(f)},R=async()=>{if(!N)return;let b={...a,route:void 0};await c?.(b),y(!1),A([])},S=async()=>{if(!N)return;if(z.length<2)return void F.oR.error(f("mapWidget.routeNeedsTwo"));let b={...a,route:{...a.route??{},stops:z}};await c?.(b),y(!1)};return 0!==E.length||N?(0,d.jsxs)("div",{className:"space-y-2",children:[N&&(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)(B.A,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground pointer-events-none"}),(0,d.jsx)("input",{type:"search",value:p,onChange:a=>q(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),O())},placeholder:f("mapWidget.searchPlaceholder"),className:"w-full rounded border bg-background pl-7 pr-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-violet-400"})]}),(0,d.jsxs)("button",{type:"button",onClick:()=>void O(),disabled:r||!p.trim(),className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",children:[r?(0,d.jsx)(t.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(B.A,{className:"h-3 w-3"}),f("mapWidget.search")]}),x?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{type:"button",onClick:()=>void S(),className:"rounded px-2 py-1 text-xs bg-violet-600 text-white hover:bg-violet-700 inline-flex items-center gap-1",title:f("mapWidget.saveRouteTitle"),children:[(0,d.jsx)(C,{className:"h-3 w-3"})," ",f("mapWidget.save")]}),(0,d.jsx)("button",{type:"button",onClick:()=>{y(!1),A([])},className:"rounded border px-2 py-1 text-xs hover:bg-accent inline-flex items-center gap-1",title:f("mapWidget.cancelTitle"),children:(0,d.jsx)(l.A,{className:"h-3 w-3"})})]}):(0,d.jsxs)("button",{type:"button",onClick:()=>{A(H),y(!0)},disabled:E.length<2,className:"rounded border px-2 py-1 text-xs hover:bg-accent disabled:opacity-50 inline-flex items-center gap-1",title:f("mapWidget.routeButtonTitle"),children:[(0,d.jsx)(C,{className:"h-3 w-3"}),f("mapWidget.route")]})]}),v.length>0&&(0,d.jsx)("ul",{className:"rounded border bg-card divide-y text-xs max-h-44 overflow-y-auto",children:v.map((a,b)=>(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>void P(a),className:"w-full text-left flex items-start gap-2 px-2 py-1.5 hover:bg-accent",children:[(0,d.jsx)(s.A,{className:"h-3 w-3 mt-0.5 text-emerald-700 shrink-0"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block font-medium truncate",children:a.display_name.split(",")[0]}),(0,d.jsx)("span",{className:"block text-[10px] text-muted-foreground truncate",children:a.display_name})]})]})},b))}),x&&(0,d.jsx)("div",{className:"rounded border border-violet-200 bg-violet-50 dark:bg-violet-950/30 dark:border-violet-900/50 px-2 py-1.5 text-[11px] text-violet-900 dark:text-violet-200",children:f.rich("mapWidget.routeModeHint",{count:z.length,strong:a=>(0,d.jsx)("strong",{children:a})})})]}),(0,d.jsx)("div",{ref:h,className:"rounded-md border overflow-hidden bg-muted/30",style:{height:280}}),!x&&L.length>=2&&M.length>0&&(0,d.jsx)("div",{className:"rounded border bg-card px-2 py-1.5",children:(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium",children:[(0,d.jsx)(C,{className:"h-3 w-3 text-violet-600"}),f("mapWidget.routeLabel",{count:L.length})]}),M.map(a=>(0,d.jsx)(K,{service:a,stops:L},a.id)),N&&(0,d.jsxs)("button",{type:"button",onClick:()=>void R(),className:"ml-auto text-[10px] text-muted-foreground hover:text-destructive inline-flex items-center gap-0.5",title:f("mapWidget.deleteRouteTitle"),children:[(0,d.jsx)(n.A,{className:"h-3 w-3"}),f("mapWidget.delete")]})]})}),(0,d.jsx)("ul",{className:"space-y-1",children:E.map((a,b)=>{let c=I.indexOf(b);return(0,d.jsxs)("li",{className:"flex items-start gap-2 rounded-md border bg-card px-2 py-1.5 text-xs "+(x&&c>=0?"ring-1 ring-violet-400 border-violet-300":""),children:[x?(0,d.jsx)("button",{type:"button",onClick:()=>A(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b]),className:"h-5 w-5 mt-0.5 shrink-0 rounded-full border text-[10px] font-mono inline-flex items-center justify-center "+(c>=0?"bg-violet-600 text-white border-violet-600":"bg-card text-muted-foreground"),title:c>=0?f("mapWidget.removeFromRoute"):f("mapWidget.addToRoute"),children:c>=0?c+1:"+"}):(0,d.jsx)(D,{className:"h-3 w-3 mt-1 shrink-0 "+(H.includes(b)?"text-violet-600":"text-emerald-700")}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("div",{className:"font-medium truncate",children:a.title}),a.description&&(0,d.jsx)("p",{className:"text-muted-foreground leading-snug mt-0.5 line-clamp-2",children:a.description}),(0,d.jsxs)("div",{className:"text-[10px] text-muted-foreground/80 font-mono mt-0.5",children:[a.lat.toFixed(5),", ",a.lng.toFixed(5)]})]}),(0,d.jsx)(J,{point:a,services:M,interactive:N,onRemove:()=>void Q(b)})]},b)})})]}):(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:f("mapWidget.noPointsReadonly")})},"utility-card":function({rootId:a,data:b,readonly:c}){let f=(0,e.c)("roots"),g="project"===b.utilityScope?`/utilities/project/${b.utilityId}?rootId=${encodeURIComponent(a)}`:`/utilities/global/${b.utilityId}`;return(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,d.jsx)(L.A,{className:"h-3 w-3 text-violet-600"}),(0,d.jsx)("span",{children:f("utilityCardWidget.miniAppLabel")}),(0,d.jsx)("span",{className:"font-mono normal-case tracking-normal text-muted-foreground/80",children:b.utilityId}),(0,d.jsxs)(y(),{href:g,className:"ml-auto inline-flex items-center gap-0.5 text-[10px] text-violet-700 hover:underline normal-case tracking-normal",title:f("utilityCardWidget.openFullTitle"),children:[f("utilityCardWidget.openLabel"),(0,d.jsx)(j.A,{className:"h-2.5 w-2.5"})]})]}),b.inner.title&&(0,d.jsx)("h4",{className:"text-sm font-medium",children:b.inner.title}),b.inner.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground -mt-1",children:b.inner.description}),(0,d.jsx)("div",{children:N(a,b.inner.kind,b.inner.data,{readonly:!0})})]})}};function N(a,b,c,e){let f=M[b];return f?(0,d.jsx)(f,{rootId:a,data:c,readonly:e?.readonly??!1,onPatch:e?.onPatch}):(0,d.jsx)(O,{kind:b})}function O({kind:a}){let b=(0,e.c)("roots");return(0,d.jsx)("p",{className:"text-xs text-destructive",children:b.rich("widgetsCommon.unknownKind",{kind:a,code:a=>(0,d.jsx)("code",{className:"font-mono",children:a})})})}},62481:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(42557).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},77424:(a,b,c)=>{"use strict";c.d(b,{p:()=>x});var d=c(64173),e=c(17240),f=c(71813),g=c(90775),h=c(56992),i=c(39755),j=c(66979),k=c(14878),l=c(62261),m=c(69552),n=c(96705),o=c(13530),p=c(12619),q=c(73569),r=c(44052),s=c(20583),t=c(47071),u=c(3265);let v=(0,u.createServerReference)("40a01fd29d879aec92ff36c832cd9d7aef4c3b229d",u.callServer,void 0,u.findSourceMapURL,"summarizeYoutubeAction");var w=c(45911);function x({source:a,onSendToChat:b,autoSummarizeYoutube:c}){let[f,j]=(0,e.useState)(null);return(0,d.jsxs)("div",{className:"prose prose-neutral dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:p-4 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-foreground [&_:not(pre)>code]:bg-muted [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:rounded [&_:not(pre)>code]:text-[0.9em] [&_code]:font-mono [&_table]:text-sm",children:[(0,d.jsx)(g.oz,{remarkPlugins:[h.A],rehypePlugins:[[i.A,{detect:!0,ignoreMissing:!0}]],components:{a:({href:a,children:e,...f})=>{let g=a?function(a){try{let b=new URL(a),c=b.hostname.replace(/^www\./,"");if("youtu.be"===c){let a=b.pathname.slice(1).split("/")[0];return a&&/^[A-Za-z0-9_-]{6,}$/.test(a)?a:null}if("youtube.com"===c||"m.youtube.com"===c||"youtube-nocookie.com"===c){if("/watch"===b.pathname){let a=b.searchParams.get("v");return a&&/^[A-Za-z0-9_-]{6,}$/.test(a)?a:null}let a=/^\/(shorts|embed|live|v)\/([^/?#]+)/.exec(b.pathname);if(a&&/^[A-Za-z0-9_-]{6,}$/.test(a[2]))return a[2]}}catch{}return null}(a):null;return g&&a?(0,d.jsx)(A,{url:a,videoId:g,autoSummarize:c??!1,...b?{onSendToChat:b}:{}}):(0,d.jsx)("a",{href:a,...f,children:e})},img:({src:a,alt:b,title:c})=>"string"!=typeof a||0===a.length?null:(0,d.jsx)(y,{src:a,alt:"string"==typeof b?b:"",title:"string"==typeof c?c:void 0,onZoom:a=>j(a)})},children:a}),f&&(0,d.jsx)(z,{src:f.src,alt:f.alt,onClose:()=>j(null)})]})}function y({src:a,alt:b,title:c,onZoom:e}){let g=(0,f.c)("roots");return(0,d.jsx)("img",{src:a,alt:b,title:c??b??g("markdown.openFullscreen"),onClick:()=>e({src:a,alt:b}),className:"cursor-zoom-in rounded-md border bg-muted/40 transition hover:opacity-90",loading:"lazy"})}function z({src:a,alt:b,onClose:c}){let g=(0,f.c)("roots");return(0,e.useCallback)(a=>{"Escape"===a.key&&c()},[c]),(0,d.jsxs)("div",{className:"fixed inset-0 z-[80] flex items-center justify-center p-6 bg-background/85 backdrop-blur-sm cursor-zoom-out",onClick:c,role:"dialog","aria-label":b||g("markdown.imagePreview"),children:[(0,d.jsx)(s.$,{type:"button",size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-9 w-9 bg-card/80 hover:bg-card",onClick:a=>{a.stopPropagation(),c()},"aria-label":g("markdown.closeAria"),children:(0,d.jsx)(j.A,{className:"h-5 w-5"})}),(0,d.jsx)("img",{src:a,alt:b,className:"max-h-full max-w-full object-contain rounded-lg shadow-2xl",onClick:a=>a.stopPropagation()}),b&&(0,d.jsx)("div",{className:"absolute bottom-6 inset-x-0 mx-auto max-w-3xl px-6 text-center text-sm text-foreground/80 pointer-events-none",children:b})]})}function A({url:a,videoId:b,onSendToChat:c,autoSummarize:g}){let h=(0,f.c)("roots"),[i,u]=(0,e.useTransition)(),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(""),[D,E]=(0,e.useState)(!1);(0,e.useRef)(!1);let F=()=>{y(null),u(async()=>{let b=await v({url:a});if(b.ok){y(b.text),A(!1);return}if(b.needsKey)return void A(!0);r.oR.error(b.error)})},G=async()=>{if(!B.trim())return void r.oR.error(h("markdown.enterKey"));E(!0);try{let a=await (0,w.A)(B.trim());if(!a.ok)return void r.oR.error(a.error);r.oR.success(h("markdown.geminiKeySaved")),C(""),A(!1),F()}finally{E(!1)}};return(0,d.jsxs)("span",{className:"not-prose my-4 block rounded-lg border bg-card overflow-hidden",children:[(0,d.jsx)("span",{className:"relative block w-full",style:{paddingTop:"56.25%"},children:(0,d.jsx)("iframe",{src:`https://www.youtube-nocookie.com/embed/${b}`,className:"absolute inset-0 h-full w-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0,title:"YouTube video"})}),(0,d.jsxs)("span",{className:"flex items-center gap-2 p-2 border-t bg-muted/30",children:[(0,d.jsx)(k.A,{className:"h-4 w-4 text-red-600 shrink-0"}),(0,d.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:underline truncate flex-1 min-w-0",children:a}),(0,d.jsxs)(s.$,{type:"button",size:"sm",variant:"outline",onClick:F,disabled:i,className:"gap-1 shrink-0 h-7",children:[i?(0,d.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(m.A,{className:"h-3 w-3"}),h("markdown.summarize")]})]}),z&&(0,d.jsxs)("span",{className:"block border-t bg-amber-50/60 p-3 space-y-2",children:[(0,d.jsxs)("span",{className:"flex items-center gap-2 text-xs text-amber-900",children:[(0,d.jsx)(n.A,{className:"h-3.5 w-3.5"}),(0,d.jsx)("span",{className:"font-medium",children:h("markdown.needsGeminiKey")})]}),(0,d.jsx)("span",{className:"block text-[11px] text-amber-900/80",children:h.rich("markdown.geminiKeyHelp",{link:()=>(0,d.jsx)("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"aistudio.google.com/apikey"}),path:()=>(0,d.jsx)("code",{className:"font-mono",children:"~/.reflex/api-keys/gemini.json"}),modelsList:()=>(0,d.jsx)("code",{className:"font-mono",children:"models.list"})})}),(0,d.jsxs)("span",{className:"flex items-center gap-2",children:[(0,d.jsx)(t.p,{type:"password",value:B,onChange:a=>C(a.target.value),placeholder:"AIza…",className:"font-mono text-xs h-8 flex-1",disabled:D}),(0,d.jsxs)(s.$,{type:"button",size:"sm",onClick:()=>void G(),disabled:D||!B.trim(),className:"h-8 gap-1",children:[D?(0,d.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(o.A,{className:"h-3 w-3"}),h("markdown.saveAndContinue")]}),(0,d.jsx)(s.$,{type:"button",size:"icon",variant:"ghost",onClick:()=>A(!1),className:"h-8 w-8",children:(0,d.jsx)(j.A,{className:"h-3.5 w-3.5"})})]})]}),x&&(0,d.jsxs)("span",{className:"block border-t p-3 space-y-2",children:[(0,d.jsxs)("span",{className:"flex items-center gap-2 text-[11px] uppercase tracking-wider text-muted-foreground",children:[(0,d.jsx)(p.A,{className:"h-3 w-3 text-emerald-600"}),"Gemini summary",(0,d.jsxs)(s.$,{type:"button",size:"sm",variant:"ghost",onClick:F,className:"ml-auto h-6 text-[10px] gap-1",disabled:i,children:[i?(0,d.jsx)(l.A,{className:"h-3 w-3 animate-spin"}):(0,d.jsx)(m.A,{className:"h-3 w-3"}),h("markdown.redo")]}),c&&(0,d.jsxs)(s.$,{type:"button",size:"sm",variant:"outline",onClick:()=>c(x,a),className:"h-6 text-[10px] gap-1",children:[(0,d.jsx)(q.A,{className:"h-3 w-3"}),h("markdown.toChat")]})]}),(0,d.jsx)("span",{className:"block",children:(0,d.jsx)("span",{className:"block text-sm whitespace-pre-wrap leading-relaxed",children:x})})]})]})}},80432:()=>{},85096:(a,b,c)=>{"use strict";c.d(b,{t:()=>e});var d=c(3265);let e=(0,d.createServerReference)("602e9230549d15e3e2d7dbc093d910cb29119eddce",d.callServer,void 0,d.findSourceMapURL,"restoreWidgetAction")},85548:(a,b,c)=>{"use strict";function d(a){return`${a.lat},${a.lng}`}function e(a){return`${a.lng},${a.lat}`}c.d(b,{JY:()=>g,yp:()=>f});let f=[{id:"google",label:"Google Maps",description:"Global, navigation + street view. Works everywhere except where the RF blocks it.",brand:"#4285F4",glyph:"G",urlFor:(a,b)=>`https://www.google.com/maps/dir/?api=1&destination=${a},${b}`,routeUrlFor:a=>{if(a.length<2)return"";let b=d(a[0]),c=d(a[a.length-1]),e=a.slice(1,-1).map(d).join("|"),f=e?`&waypoints=${encodeURIComponent(e)}`:"";return`https://www.google.com/maps/dir/?api=1&origin=${b}&destination=${c}${f}`}},{id:"yandex",label:"Yandex Maps",description:"CIS region, best RF detail and real-time traffic.",brand:"#FFCC00",glyph:"Y",urlFor:(a,b)=>`https://yandex.ru/maps/?rtext=~${a},${b}&rtt=auto`,routeUrlFor:a=>`https://yandex.ru/maps/?rtext=${a.map(d).join("~")}&rtt=auto`},{id:"2gis",label:"2GIS",description:"CIS region, precise addresses and POI. Uniquely strong on RF cities.",brand:"#1BA049",glyph:"2",urlFor:(a,b)=>`https://2gis.ru/routeSearch/to/${b},${a}`,routeUrlFor:a=>{let b=e(a[0]),c=e(a[a.length-1]),d=a.slice(1,-1).map(a=>`/via/${e(a)}`).join("");return`https://2gis.ru/routeSearch/rsType/car/from/${b}${d}/to/${c}`}},{id:"apple",label:"Apple Maps",description:"Opens in the native app on iOS/macOS, otherwise on the website.",brand:"#1d1d1f",glyph:"A",urlFor:(a,b)=>`https://maps.apple.com/?daddr=${a},${b}`,routeUrlFor:a=>{let b=d(a[0]),c=a.slice(1).map(a=>`+to:${d(a)}`).join("");return`https://maps.apple.com/?saddr=${b}&daddr=${b}${c}`}},{id:"osm",label:"OpenStreetMap",description:"Open data, no account required. Basic navigation.",brand:"#7EB73F",glyph:"OSM",urlFor:(a,b)=>`https://www.openstreetmap.org/directions?to=${a},${b}`,routeUrlFor:a=>{let b=a.map(d).join(";");return`https://www.openstreetmap.org/directions?route=${encodeURIComponent(b)}`}},{id:"waze",label:"Waze",description:"Car navigation with crowd-sourced traffic and alerts.",brand:"#33CCFF",glyph:"W",urlFor:(a,b)=>`https://waze.com/ul?ll=${a},${b}&navigate=yes`,routeUrlFor:a=>{let b=a[a.length-1];return`https://waze.com/ul?ll=${b.lat},${b.lng}&navigate=yes`}},{id:"organic",label:"Organic Maps",description:"Offline maps with open data. Opens in the app.",brand:"#006C35",glyph:"OM",urlFor:(a,b)=>`om://map?ll=${a},${b}`,routeUrlFor:a=>{let b=a[0],c=a[a.length-1];return`om://route?sll=${b.lat},${b.lng}&saddr=&dll=${c.lat},${c.lng}&daddr=&type=vehicle`}}],g=["google","yandex","apple","osm"]},90160:()=>{}};
|