@superjackfruitlabs/vibekit-frame 0.0.0-stage → 0.0.16
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/CHANGELOG.md +21 -0
- package/LICENSE +26 -0
- package/README.md +99 -2
- package/package.json +43 -4
- package/src/brand/agentpod.svg +1 -0
- package/src/brand/captain-jack.svg +138 -0
- package/src/brand/lab.svg +25 -0
- package/src/brand/salaam.svg +1 -0
- package/src/brand/superdispatch.svg +1 -0
- package/src/brand/superexchange.svg +1 -0
- package/src/brand/superlibrary.svg +1 -0
- package/src/brand/supermessage.svg +1 -0
- package/src/brand/superpipeline.svg +1 -0
- package/src/brand/supertoolkit.svg +1 -0
- package/src/brand/superwitness.svg +1 -0
- package/src/client/backdrop-core.d.ts +2 -0
- package/src/client/backdrop-core.js +398 -0
- package/src/client/backdrop.ts +16 -0
- package/src/client/claims.ts +19 -0
- package/src/client/doorway.ts +140 -0
- package/src/client/footer.ts +34 -0
- package/src/client/header.ts +55 -0
- package/src/client/index.ts +54 -0
- package/src/client/jack-rig.ts +30 -0
- package/src/client/jack.ts +257 -0
- package/src/client/micro.ts +87 -0
- package/src/client/release.ts +31 -0
- package/src/client/theme-core.d.ts +19 -0
- package/src/client/theme-core.js +46 -0
- package/src/client/theme.ts +76 -0
- package/src/components/Claims.astro +30 -0
- package/src/components/Footer.astro +75 -0
- package/src/components/Frame.astro +29 -0
- package/src/components/ProductHeader.astro +38 -0
- package/src/components/SuiteBar.astro +44 -0
- package/src/components/SuiteHead.astro +26 -0
- package/src/components/early.js +94 -0
- package/src/components/shadow.ts +46 -0
- package/src/components/styles/bar.css +23 -0
- package/src/components/styles/claims.css +20 -0
- package/src/components/styles/footer.css +46 -0
- package/src/components/styles/header.css +35 -0
- package/src/components/styles/jack.css +28 -0
- package/src/components/styles/tokens.css +10 -0
- package/src/data/ledger.snapshot.json +617 -0
- package/src/data/ledger.ts +36 -0
- package/src/data/products.ts +119 -0
- package/src/data/release.ts +63 -0
- package/src/vendor/captain-jack/README.txt +3 -0
- package/src/vendor/captain-jack/THIRD_PARTY_NOTICES.txt +43 -0
- package/src/vendor/captain-jack/avatar.css +50 -0
- package/src/vendor/captain-jack/captain-jack.js +185 -0
- package/src/vendor/logo-motion.d.ts +2 -0
- package/src/vendor/logo-motion.js +142 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import snapshot from './ledger.snapshot.json';
|
|
2
|
+
import { PRODUCTS, type Slug } from './products';
|
|
3
|
+
|
|
4
|
+
export interface PublicClaim {
|
|
5
|
+
id: string;
|
|
6
|
+
product: string;
|
|
7
|
+
title: string;
|
|
8
|
+
status: 'verified' | 'limited';
|
|
9
|
+
caveat: string | null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** The public ledger, served by the suite worker at /captain/* on every product's own domain. */
|
|
13
|
+
export const ledgerUrl = (slug: Slug, origin?: string): string => `${origin ?? PRODUCTS[slug].url}/captain/ledger.json`;
|
|
14
|
+
|
|
15
|
+
const pub = (c: any): PublicClaim => ({
|
|
16
|
+
id: String(c.id), product: String(c.product), title: String(c.title),
|
|
17
|
+
status: c.status === 'limited' ? 'limited' : 'verified',
|
|
18
|
+
caveat: c.caveat ?? null,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/** Claims for one product. Never throws; never carries evidence. */
|
|
22
|
+
export async function loadClaims(slug: Slug, opts: { fetch?: typeof fetch; origin?: string } = {}): Promise<PublicClaim[]> {
|
|
23
|
+
const f = opts.fetch ?? globalThis.fetch;
|
|
24
|
+
try {
|
|
25
|
+
const res = await f(ledgerUrl(slug, opts.origin), { signal: AbortSignal.timeout(3000) });
|
|
26
|
+
if (res.ok) {
|
|
27
|
+
const body: any = await res.json();
|
|
28
|
+
if (Array.isArray(body?.claims)) {
|
|
29
|
+
return body.claims.filter((c: any) => c?.product === slug).map(pub);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
// fall through to the bundled snapshot
|
|
34
|
+
}
|
|
35
|
+
return (snapshot.claims as any[]).filter((c) => c.product === slug).map(pub);
|
|
36
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export type Slug = 'supermessage' | 'superpipeline' | 'superlibrary' | 'superwitness' | 'agentpod' | 'salaam' | 'superdispatch' | 'superexchange' | 'supertoolkit';
|
|
2
|
+
/** A site that wears the frame: a product, or the lab's own site (never in ORDER). */
|
|
3
|
+
export type Site = Slug | 'lab';
|
|
4
|
+
export type Theme = 'light' | 'dark';
|
|
5
|
+
|
|
6
|
+
export interface Product {
|
|
7
|
+
slug: Site;
|
|
8
|
+
name: string;
|
|
9
|
+
color: string;
|
|
10
|
+
hi: string;
|
|
11
|
+
url: string;
|
|
12
|
+
docs: string;
|
|
13
|
+
repo: string | null;
|
|
14
|
+
/** The header's button: the hosted app's sign-in, or how to get the product. */
|
|
15
|
+
app: { label: string; href: string } | null;
|
|
16
|
+
street: 'main' | 'quarter';
|
|
17
|
+
role: string;
|
|
18
|
+
line: string;
|
|
19
|
+
/** Port the product's site uses in local development (http://localhost:<port>/). */
|
|
20
|
+
port: number;
|
|
21
|
+
/** localStorage key the product's own site reads its theme from. */
|
|
22
|
+
themeKey: string;
|
|
23
|
+
/** The value that site expects for a suite-wide light/dark choice. */
|
|
24
|
+
themeValue(t: Theme): string;
|
|
25
|
+
/** The header's docs link label, and what Captain Jack's Ask field asks about. */
|
|
26
|
+
docsLabel: string;
|
|
27
|
+
about: string;
|
|
28
|
+
/** The repo's licence (SPDX id), shown in the footer; null for the lab's own site. */
|
|
29
|
+
licence: string | null;
|
|
30
|
+
/** Where its llms.txt is, when not at its docs site's root (see llmsOf). */
|
|
31
|
+
llms?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const same = (t: Theme): string => t;
|
|
35
|
+
const org = 'https://github.com/SuperJackfruitLabs';
|
|
36
|
+
|
|
37
|
+
const make = (
|
|
38
|
+
slug: Site, name: string, color: string, hi: string, domain: string, repo: string | null,
|
|
39
|
+
street: Product['street'], role: string, line: string, port: number,
|
|
40
|
+
themeKey = 'theme', themeValue: Product['themeValue'] = same,
|
|
41
|
+
): Product => ({
|
|
42
|
+
slug, name, color, hi, url: `https://${domain}`, docs: `https://docs.${domain}`,
|
|
43
|
+
repo: repo ? `${org}/${repo}` : null, app: null, street, role, line, port, themeKey, themeValue, docsLabel: 'Docs', about: name, licence: repo ? 'MIT' : null,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Every product colour follows vibekit: test/colours.test.ts checks each mark's OKLCH hue against
|
|
47
|
+
// vibekit's PRODUCT_ACCENTS and ACCENT_HUES, so a colour cannot drift from the suite's palette.
|
|
48
|
+
export const PRODUCTS: Record<Slug, Product> = {
|
|
49
|
+
supermessage: make('supermessage', 'SuperMessage', '#8549ef', '#c3a6ff', 'supermessage.dev', 'supermessage', 'main', 'Talk', 'A Matrix client where agents are participants.', 4501, 'sm-theme'),
|
|
50
|
+
superpipeline: make('superpipeline', 'SuperPipeline', '#ffc21a', '#ffd666', 'superpipeline.dev', 'superpipeline', 'main', 'Plan', 'A board agents work from, with gates for people.', 4502),
|
|
51
|
+
// vibekit plum (OKLCH hue 335), at the old mark's lightness and chroma.
|
|
52
|
+
superlibrary: make('superlibrary', 'SuperLibrary', '#da70c6', '#f0b3e2', 'superlibrary.dev', 'superlibrary', 'main', 'Remember', 'The memory of the stack, labelled by outcome.', 4503),
|
|
53
|
+
superwitness: make('superwitness', 'SuperWitness', '#0ea875', '#6ee7b7', 'superwitness.dev', 'superwitness', 'main', 'Witness', 'Every run, on the record.', 4504),
|
|
54
|
+
// vibekit cobalt (hue 260), at the old mark's lightness and chroma.
|
|
55
|
+
agentpod: make('agentpod', 'AgentPod', '#508ff7', '#9ec3ff', 'agentpod.dev', 'agentpod', 'quarter', 'Machines', 'A console for the machines agents live on.', 4505),
|
|
56
|
+
// vibekit pink (hue 3): the mark's #f74783 moved 1.6 deg, out of the signal band.
|
|
57
|
+
salaam: make('salaam', 'Salaam', '#f64787', '#ff9fb9', 'salaam.sh', 'salaam', 'quarter', 'Harness', 'The harness agents work in.', 4506, 'salaam-theme', (t) => (t === 'light' ? 'paper' : 'night')),
|
|
58
|
+
// vibekit teal (OKLCH hue 192); SuperExchange below is azure (230).
|
|
59
|
+
superdispatch: make('superdispatch', 'SuperDispatch', '#00afab', '#77e3de', 'superdispatch.dev', 'superdispatch', 'quarter', 'Dispatch', 'Which agent takes a card, and why.', 4507),
|
|
60
|
+
// vibekit indigo (hue 277).
|
|
61
|
+
supertoolkit: make('supertoolkit', 'SuperToolkit', '#5b5fe0', '#a9acff', 'supertoolkit.dev', 'supertoolkit', 'quarter', 'Credentials', 'The agent never holds the credential.', 4509),
|
|
62
|
+
superexchange: make('superexchange', 'SuperExchange', '#00a0d7', '#8bd6fa', 'superexchange.dev', 'superexchange', 'quarter', 'Exchange', 'Board work carried into chat, and the answers back.', 4508),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// The lab's own site: jackfruit amber (the site's suite accent), dark text on it; no docs site, no repo, no release.
|
|
66
|
+
export const LAB: Product = {
|
|
67
|
+
...make('lab', 'Super Jackfruit Labs', '#d98a1f', '#f2b45c', 'superjackfruit.com', null, 'main', 'Lab', 'Nine tools for working with agents.', 4500),
|
|
68
|
+
// the suite is the home page; the header offers the lab's notes, and the village as its button
|
|
69
|
+
docs: 'https://superjackfruit.com/blog/', docsLabel: 'Lab notes', about: 'the lab', app: { label: 'Drive the village', href: '/village' },
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** Where a site's llms.txt is: its docs site's, or the site's own when it has no docs site. */
|
|
73
|
+
export const llmsOf = (p: Product): string => p.llms ?? (p.docs.startsWith('https://docs.') ? `${p.docs}/llms.txt` : `${p.url}/llms.txt`);
|
|
74
|
+
|
|
75
|
+
/** Products whose brand-pack motion is drawn in another colour than their mark here: they keep the static mark. */
|
|
76
|
+
export const STATIC_MARK: ReadonlySet<Site> = new Set<Site>(['supertoolkit']);
|
|
77
|
+
|
|
78
|
+
export const SITES: Record<Site, Product> = { ...PRODUCTS, lab: LAB };
|
|
79
|
+
|
|
80
|
+
/** Text colour on the site colour. */
|
|
81
|
+
export const onColor = (p: Product): string =>
|
|
82
|
+
p.slug === 'superpipeline' ? '#2c2a26' : p.slug === 'lab' ? '#1f1b18' : p.slug === 'superdispatch' || p.slug === 'superexchange' ? '#06201f' : '#fff';
|
|
83
|
+
|
|
84
|
+
export const ORDER: Slug[] = ['supermessage', 'superpipeline', 'superlibrary', 'superwitness', 'agentpod', 'salaam', 'superdispatch', 'superexchange', 'supertoolkit'];
|
|
85
|
+
|
|
86
|
+
const LOCAL = /^(localhost|127\.0\.0\.1)$/;
|
|
87
|
+
|
|
88
|
+
/** Where a product lives, seen from `here`: its production URL, or its local port when `here` is localhost. */
|
|
89
|
+
export function hrefOf(slug: Slug, here?: { hostname: string }): string {
|
|
90
|
+
const p = PRODUCTS[slug];
|
|
91
|
+
return here && LOCAL.test(here.hostname) ? `http://localhost:${p.port}/` : p.url;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The product a URL belongs to (production origin, its www., or its local port), or null. */
|
|
95
|
+
export function slugOf(href: string): Slug | null {
|
|
96
|
+
try {
|
|
97
|
+
const u = new URL(href);
|
|
98
|
+
return ORDER.find((s) => {
|
|
99
|
+
const site = PRODUCTS[s].url;
|
|
100
|
+
return u.origin === site || u.origin === site.replace('://', '://www.') || (LOCAL.test(u.hostname) && +u.port === PRODUCTS[s].port);
|
|
101
|
+
}) ?? null;
|
|
102
|
+
} catch { return null; }
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
PRODUCTS.superpipeline.app = { label: 'Sign in', href: 'https://app.superpipeline.dev' };
|
|
106
|
+
PRODUCTS.superlibrary.app = { label: 'Sign in', href: 'https://app.superlibrary.dev' };
|
|
107
|
+
PRODUCTS.superwitness.app = { label: 'Sign in', href: 'https://app.superwitness.dev' };
|
|
108
|
+
PRODUCTS.agentpod.app = { label: 'Sign in', href: 'https://console.agentpod.dev' };
|
|
109
|
+
PRODUCTS.supermessage.app = { label: 'Download', href: `${org}/supermessage/releases/latest` };
|
|
110
|
+
PRODUCTS.salaam.app = { label: 'Install', href: 'https://docs.salaam.sh/install/' };
|
|
111
|
+
PRODUCTS.salaam.licence = 'Apache-2.0';
|
|
112
|
+
// Early services with no hosted app and no release to download yet: the header's button is the source.
|
|
113
|
+
PRODUCTS.superdispatch.app = { label: 'Source', href: `${org}/superdispatch` };
|
|
114
|
+
PRODUCTS.superdispatch.licence = 'Apache-2.0';
|
|
115
|
+
PRODUCTS.superexchange.app = { label: 'Source', href: `${org}/superexchange` };
|
|
116
|
+
PRODUCTS.supertoolkit.app = { label: 'Install', href: 'https://docs.supertoolkit.dev/install/' };
|
|
117
|
+
PRODUCTS.supertoolkit.licence = 'Apache-2.0';
|
|
118
|
+
// Its docs site serves no llms.txt; the landing page does.
|
|
119
|
+
PRODUCTS.supertoolkit.llms = 'https://supertoolkit.dev/llms.txt';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import snapshot from './ledger.snapshot.json';
|
|
2
|
+
import { PRODUCTS, type Slug } from './products';
|
|
3
|
+
|
|
4
|
+
export interface Release { tag: string; url: string; published_at?: string | null }
|
|
5
|
+
|
|
6
|
+
/** The suite worker's releases endpoint on a product's own site (see worker/src/releases.ts). */
|
|
7
|
+
export const releasesUrl = (slug: Slug, origin?: string): string => `${origin ?? PRODUCTS[slug].url}/captain/releases/${slug}`;
|
|
8
|
+
|
|
9
|
+
const TIMEOUT_MS = 3000;
|
|
10
|
+
const env = (k: string): string | undefined => (typeof process !== 'undefined' ? process.env?.[k] : undefined) || undefined;
|
|
11
|
+
const valid = (tag: unknown, url: unknown): boolean => typeof tag === 'string' && /^v?\d/.test(tag) && typeof url === 'string' && url.startsWith('https://');
|
|
12
|
+
|
|
13
|
+
export interface ReleaseOpts {
|
|
14
|
+
fetch?: typeof fetch;
|
|
15
|
+
/** Where to find /captain/releases; defaults to the product's own site. */
|
|
16
|
+
origin?: string;
|
|
17
|
+
/** A GitHub token, tried after the endpoint; defaults to the GITHUB_TOKEN environment variable. */
|
|
18
|
+
token?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Latest release tag and link, at build time. Tries the site's own /captain/releases, then
|
|
23
|
+
* GitHub when a token is available (never unauthenticated: 60 requests an hour per IP is what
|
|
24
|
+
* made every build fall back), then the bundled snapshot. Never throws; never requests a
|
|
25
|
+
* private (null) repo.
|
|
26
|
+
*/
|
|
27
|
+
export async function latestRelease(slug: Slug, opts: ReleaseOpts = {}): Promise<Release> {
|
|
28
|
+
const p = PRODUCTS[slug];
|
|
29
|
+
const line = (snapshot.releases as Record<string, { release: string }>)[slug]?.release ?? '';
|
|
30
|
+
const [snapTag = '', snapDate = ''] = line.split(',').map((s) => s.trim());
|
|
31
|
+
if (!p.repo) return { tag: snapTag, url: p.docs };
|
|
32
|
+
const f = opts.fetch ?? globalThis.fetch;
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const res = await f(releasesUrl(slug, opts.origin), { signal: AbortSignal.timeout(TIMEOUT_MS), headers: { accept: 'application/json' } });
|
|
36
|
+
if (res.ok) {
|
|
37
|
+
const b: any = await res.json();
|
|
38
|
+
if (valid(b?.tag, b?.url)) return { tag: b.tag, url: b.url, published_at: b.published_at ?? null };
|
|
39
|
+
}
|
|
40
|
+
} catch { /* next source */ }
|
|
41
|
+
|
|
42
|
+
const token = opts.token ?? env('GITHUB_TOKEN');
|
|
43
|
+
if (token) {
|
|
44
|
+
try {
|
|
45
|
+
const api = p.repo.replace('https://github.com/', 'https://api.github.com/repos/') + '/releases/latest';
|
|
46
|
+
const res = await f(api, { signal: AbortSignal.timeout(TIMEOUT_MS), headers: { accept: 'application/vnd.github+json', authorization: `Bearer ${token}`, 'user-agent': 'sjl-frontdoor' } });
|
|
47
|
+
if (res.ok) {
|
|
48
|
+
const b: any = await res.json();
|
|
49
|
+
if (valid(b?.tag_name, b?.html_url)) return { tag: b.tag_name, url: b.html_url, published_at: b.published_at ?? null };
|
|
50
|
+
}
|
|
51
|
+
} catch { /* the snapshot */ }
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return { tag: snapTag, url: snapTag ? `${p.repo}/releases/tag/${encodeURIComponent(snapTag)}` : `${p.repo}/releases`, published_at: /^\d{4}-\d{2}-\d{2}$/.test(snapDate) ? snapDate : null };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// One lookup per product per build: the bar, the header and the footer all show the version.
|
|
58
|
+
const memo = new Map<Slug, Promise<Release>>();
|
|
59
|
+
export const releaseOf = (slug: Slug): Promise<Release> => {
|
|
60
|
+
let r = memo.get(slug);
|
|
61
|
+
if (!r) memo.set(slug, (r = latestRelease(slug)));
|
|
62
|
+
return r;
|
|
63
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
The following Lucide icons are derived from the Feather project:
|
|
20
|
+
|
|
21
|
+
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
22
|
+
|
|
23
|
+
The MIT License (MIT) (for the icons listed above)
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2013-present Cole Bemis
|
|
26
|
+
|
|
27
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
28
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
29
|
+
in the Software without restriction, including without limitation the rights
|
|
30
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
31
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
32
|
+
furnished to do so, subject to the following conditions:
|
|
33
|
+
|
|
34
|
+
The above copyright notice and this permission notice shall be included in all
|
|
35
|
+
copies or substantial portions of the Software.
|
|
36
|
+
|
|
37
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
38
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
39
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
40
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
41
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
42
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
43
|
+
SOFTWARE.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.captain-jack .jack-scene {--jack-ink:light-dark(#19354c,#edf4fa);--jack-subtle:light-dark(#53697d,#a9bdcf);--jack-line:#16344b;position:relative;max-width:600px;height:440px;margin:6px auto 0;font:14px/1.5 system-ui,sans-serif;color:var(--jack-ink);}
|
|
2
|
+
.captain-jack .jack-art {position:absolute;width:360px;left:calc(50% - 195px);top:6px;pointer-events:none;}
|
|
3
|
+
.captain-jack .jack-art > svg {display:block;width:100%;height:auto;}
|
|
4
|
+
.captain-jack [hidden] {display:none!important;}
|
|
5
|
+
.captain-jack .jack-props {position:absolute;left:calc(50% + 80px);top:155px;width:80px;height:100px;pointer-events:none;}
|
|
6
|
+
.captain-jack .jack-prop {position:absolute;inset:0;animation:jack-arrive .5s cubic-bezier(.2,.8,.3,1) both;filter:drop-shadow(0 4px 0 #0b213b20);}
|
|
7
|
+
.captain-jack .jack-prop svg {display:block;width:100%!important;height:100%!important;stroke:var(--jack-line);stroke-width:1.9;}
|
|
8
|
+
.captain-jack .bulb {position:absolute;left:10px;top:0;width:58px;height:68px;transform:rotate(13deg);animation:jack-wonder 4s ease-in-out infinite;}
|
|
9
|
+
.captain-jack .bulb svg {fill:#ffe77c;stroke:#b77b19;filter:drop-shadow(0 0 8px #ffca3840);}
|
|
10
|
+
.captain-jack .spark {position:absolute;color:#edb533;font-size:22px;line-height:1;}
|
|
11
|
+
.captain-jack .spark.a {right:-1px;top:-5px;}
|
|
12
|
+
.captain-jack .spark.b {left:2px;top:-12px;font-size:13px;}
|
|
13
|
+
.captain-jack .thought-dot {position:absolute;background:#ffdf80;border:2px solid #a78039;border-radius:50%;}
|
|
14
|
+
.captain-jack .thought-dot.one {width:8px;height:8px;left:4px;top:62px;}
|
|
15
|
+
.captain-jack .thought-dot.two {width:4px;height:4px;left:-8px;top:74px;}
|
|
16
|
+
.captain-jack .speech-bubble {width:66px;height:51px;background:linear-gradient(135deg,#bdfff3,#43c9eb);border:3px solid #176482;border-radius:24px 24px 24px 5px;transform:rotate(9deg);color:#16526d;text-align:center;font:500 66px/1 Georgia,serif;animation:jack-talk 1.6s ease-in-out infinite;}
|
|
17
|
+
.captain-jack .working {transform:rotate(8deg);}
|
|
18
|
+
.captain-jack .paper {position:absolute;left:8px;top:4px;width:48px;height:61px;border:2px solid #8a7e57;border-radius:4px 12px 4px 4px;background:linear-gradient(130deg,#fffbea,#ffe6a4);}
|
|
19
|
+
.captain-jack .paper.back {transform:rotate(-13deg) translate(-4px,4px);background:#73d9e5;border-color:#2c7d96;}
|
|
20
|
+
.captain-jack .paper.front {transform:rotate(8deg);padding:15px 8px 0;box-sizing:border-box;}
|
|
21
|
+
.captain-jack .paper.front:after {content:"";position:absolute;right:0;top:0;width:10px;height:10px;background:#d9bd72;border-radius:0 9px 0 3px;}
|
|
22
|
+
.captain-jack .paper span {display:block;border-bottom:2px solid #b7a676;margin-bottom:7px;width:26px;}
|
|
23
|
+
.captain-jack .paper span:last-child {width:16px;}
|
|
24
|
+
.captain-jack .pencil {position:absolute;left:48px;top:14px;width:9px;height:47px;background:linear-gradient(90deg,#ffc32a 0 55%,#e48b0b 55%);border:1.5px solid #a46c1b;border-radius:3px 3px 1px 1px;transform:rotate(32deg);transform-origin:50% 100%;animation:jack-write 2.8s ease-in-out infinite;}
|
|
25
|
+
.captain-jack .pencil:before {content:"";position:absolute;left:-1.5px;bottom:-10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:10px solid #223b50;}
|
|
26
|
+
.captain-jack .pencil:after {content:"";position:absolute;left:-1.5px;right:-1.5px;top:-5px;height:8px;border-radius:3px 3px 0 0;background:#ed7591;border:1.5px solid #a44e6b;}
|
|
27
|
+
.captain-jack .success .seal {position:absolute;left:5px;top:0;width:56px;height:56px;border:5px double #aa7516;border-radius:50%;background:linear-gradient(135deg,#fff4a4,#ffc32d);box-sizing:border-box;padding:8px;transform:rotate(-12deg);}
|
|
28
|
+
.captain-jack .success .seal svg {stroke:#82601d;stroke-width:3;}
|
|
29
|
+
.captain-jack .ribbon {position:absolute;top:39px;left:13px;width:41px;height:37px;background:linear-gradient(90deg,#37b9db,#70e5e8);clip-path:polygon(0 0,100% 0,85% 100%,52% 72%,15% 100%);transform:rotate(-12deg);}
|
|
30
|
+
.captain-jack .success .spark {animation:jack-celebrate 1.2s ease-out both;}
|
|
31
|
+
.captain-jack .hourglass {width:52px;height:65px;transform:rotate(9deg);animation:jack-wait 5s ease-in-out infinite;}
|
|
32
|
+
.captain-jack .hourglass svg {stroke:#237e96;fill:#afe9df;}
|
|
33
|
+
.captain-jack .question {width:54px;height:58px;background:linear-gradient(145deg,#fff0b2,#ffbb82);border:3px solid #ba7a39;border-radius:24px 24px 24px 5px;text-align:center;font:500 42px/1.35 Georgia,serif;color:#814b27;transform:rotate(10deg);}
|
|
34
|
+
.captain-jack .small-spark {position:absolute;right:5px;top:-12px;color:#ffbe75;font-size:25px;}
|
|
35
|
+
.captain-jack .listening {left:-8px;top:15px;}
|
|
36
|
+
.captain-jack .listening span {position:absolute;left:0;top:0;width:17px;height:39px;border-right:3px solid #51c8df;border-radius:50%;transform:rotate(-16deg);animation:jack-listen 2.4s ease-in-out infinite;}
|
|
37
|
+
.captain-jack .listening span+span {left:9px;top:-5px;width:23px;height:49px;animation-delay:.2s;}
|
|
38
|
+
.captain-jack .jack-status {position:absolute;top:375px;left:12px;right:12px;text-align:center;}
|
|
39
|
+
.captain-jack .jack-status strong {display:block;font-size:17px;font-weight:500;}
|
|
40
|
+
.captain-jack .jack-status > span {display:block;font-size:13px;color:var(--jack-subtle);margin-top:4px;}
|
|
41
|
+
.captain-jack .jack-scene[data-paused="true"] *,.captain-jack .jack-scene[data-paused="true"] *:after {animation-play-state:paused!important;}
|
|
42
|
+
@keyframes jack-arrive {from{opacity:0;translate:-5px 8px;scale:.8}to{opacity:1;translate:0 0;scale:1}}
|
|
43
|
+
@keyframes jack-wonder {0%,100%{transform:rotate(13deg) translateY(0)}50%{transform:rotate(7deg) translateY(-3px)}}
|
|
44
|
+
@keyframes jack-talk {0%,100%{transform:rotate(9deg) scale(1)}50%{transform:rotate(7deg) scale(1.035)}}
|
|
45
|
+
@keyframes jack-write {0%,100%{transform:rotate(32deg) translate(0,0)}25%{transform:rotate(37deg) translate(-4px,2px)}50%{transform:rotate(32deg) translate(1px,5px)}75%{transform:rotate(37deg) translate(-3px,7px)}}
|
|
46
|
+
@keyframes jack-wait {0%,100%{transform:rotate(9deg)}50%{transform:rotate(-7deg)}}
|
|
47
|
+
@keyframes jack-celebrate {from{opacity:0;scale:.3;translate:0 8px}to{opacity:1;scale:1;translate:0 0}}
|
|
48
|
+
@keyframes jack-listen {0%,100%{opacity:.45}50%{opacity:1}}
|
|
49
|
+
@media(max-width:420px){.captain-jack .jack-scene{height:385px;}.captain-jack .jack-art{width:300px;left:calc(50% - 170px);top:10px;}.captain-jack .jack-props{left:calc(50% + 49px);top:133px;scale:.85;transform-origin:top left;}.captain-jack .jack-status{top:325px;}}
|
|
50
|
+
@media(prefers-reduced-motion:reduce){.captain-jack *,.captain-jack *:after{animation:none!important;transition:none!important;}}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/* Captain Jack: continuous vector rig. No raster frames or runtime dependencies. */
|
|
2
|
+
(() => {
|
|
3
|
+
'use strict';
|
|
4
|
+
let serial = 0;
|
|
5
|
+
const clamp = (x, lo, hi) => Math.min(hi, Math.max(lo, x));
|
|
6
|
+
const mix = (a, b, t) => a + (b - a) * t;
|
|
7
|
+
const smooth = x => x * x * (3 - 2 * x);
|
|
8
|
+
const neutral = {tilt:0,gx:0,gy:0,bl:0,br:0,ponder:0,talk:0,happy:0,work:0,listen:0};
|
|
9
|
+
const poses = Object.freeze({
|
|
10
|
+
idle: {...neutral},
|
|
11
|
+
listening: {...neutral,tilt:3,gx:2,bl:-3,br:-3,listen:1},
|
|
12
|
+
thinking: {...neutral,tilt:2,gx:5,gy:-5,bl:-4,br:1.5,ponder:1},
|
|
13
|
+
speaking: {...neutral,tilt:.7,bl:-2,br:-1,talk:1},
|
|
14
|
+
working: {...neutral,tilt:2,gx:5,gy:2,bl:1,br:1,work:1},
|
|
15
|
+
success: {...neutral,tilt:-1.5,bl:-3,br:-3,happy:1},
|
|
16
|
+
waiting: {...neutral,tilt:-1,gx:1,bl:-1,br:-1},
|
|
17
|
+
attention: {...neutral,tilt:-4,gx:0,bl:-5,br:2,ponder:.65}
|
|
18
|
+
});
|
|
19
|
+
const STATES = Object.freeze(Object.keys(poses));
|
|
20
|
+
function create(svg, {state='idle',autoplay=true,demoSpeech=false}={}) {
|
|
21
|
+
if(!svg || svg.localName!=='svg')throw new TypeError('Captain Jack requires an inline SVG.');
|
|
22
|
+
if(!STATES.includes(state))throw new RangeError('Unsupported Captain Jack state: '+state);
|
|
23
|
+
const doc=svg.ownerDocument, win=doc.defaultView;
|
|
24
|
+
const reduce=win.matchMedia('(prefers-reduced-motion: reduce)');
|
|
25
|
+
const nodes={};
|
|
26
|
+
for(const node of svg.querySelectorAll('[data-part]'))nodes[node.dataset.part]=node;
|
|
27
|
+
const required=['breath','head','cape','leaf-left','leaf-right','left-eye','right-eye','left-pupil','right-pupil','left-brow','right-brow','mouth','smile-line','visor-scan'];
|
|
28
|
+
for(const key of required)if(!nodes[key])throw new Error('Missing rig part: '+key);
|
|
29
|
+
const prefix='jack-'+(++serial)+'-';
|
|
30
|
+
const ids=new Map([...svg.querySelectorAll('[id]')].map(n=>[n.id,prefix+n.id]));
|
|
31
|
+
for(const node of [svg,...svg.querySelectorAll('*')])for(const attr of [...node.attributes]){
|
|
32
|
+
let value=attr.value.replace(/url\(#([^)]+)\)/g,(m,id)=>ids.has(id)?'url(#'+ids.get(id)+')':m);
|
|
33
|
+
if(attr.name==='id')value=ids.get(value)||value;
|
|
34
|
+
if(attr.name==='aria-labelledby'||attr.name==='aria-describedby')value=value.split(' ').map(id=>ids.get(id)||id).join(' ');
|
|
35
|
+
node.setAttribute(attr.name,value);
|
|
36
|
+
}
|
|
37
|
+
let selected=state, pose={...poses[state]}, from={...pose}, transitionStart=-2;
|
|
38
|
+
let elapsed=0, previous=null, raf=null, wanted=autoplay, destroyed=false;
|
|
39
|
+
let speechInput=null, speechValue=0;
|
|
40
|
+
const listeners=new Set();
|
|
41
|
+
const transform=(key,value)=>nodes[key].setAttribute('transform',value);
|
|
42
|
+
const f=n=>n.toFixed(3);
|
|
43
|
+
function blinkAt(t,start){
|
|
44
|
+
const x=t-start;if(x<0||x>.24)return 0;
|
|
45
|
+
return x<.09?smooth(x/.09):1-smooth((x-.09)/.15);
|
|
46
|
+
}
|
|
47
|
+
function updatePose() {
|
|
48
|
+
const u=smooth(clamp((elapsed-transitionStart)/.95,0,1)), target=poses[selected];
|
|
49
|
+
for(const key of Object.keys(pose))pose[key]=mix(from[key],target[key],u);
|
|
50
|
+
svg.dataset.transition=f(u);
|
|
51
|
+
}
|
|
52
|
+
function draw(still=false) {
|
|
53
|
+
const t=elapsed,p=pose;
|
|
54
|
+
const breath=still?0:Math.sin(t*Math.PI*2/4.7), sway=still?0:Math.sin(t*Math.PI*2/7.8);
|
|
55
|
+
transform('breath',`translate(0 ${f(-1.5*breath)})`);
|
|
56
|
+
const age=Math.max(0,t-transitionStart);
|
|
57
|
+
// One small acknowledgement on success, then hold a relaxed smile.
|
|
58
|
+
const nod=still||selected!=='success'||age>1.8?0:2.5*Math.sin(age*Math.PI/1.8)**2;
|
|
59
|
+
transform('head',`rotate(${f(p.tilt+.2*sway+nod)} 285 410)`);
|
|
60
|
+
transform('cape',`rotate(${f(still?0:1.3*Math.sin(t*1.15-.35))} 365 385)`);
|
|
61
|
+
transform('leaf-left',`rotate(${f(still?0:.9*Math.sin(t*1.25))} 266 168)`);
|
|
62
|
+
transform('leaf-right',`rotate(${f(still?0:1.15*Math.sin(t*1.25-.6))} 272 170)`);
|
|
63
|
+
const blink=still?0:Math.max(blinkAt(t%8.6,1.9),blinkAt(t%8.6,6.5));
|
|
64
|
+
const eyelid=Math.max(.035,(1-blink)*(1-.12*p.happy));
|
|
65
|
+
for(const key of ['left-eye','right-eye'])transform(key,`translate(0 297) scale(1 ${f(eyelid)}) translate(0 -297)`);
|
|
66
|
+
const glance=still?0:p.ponder*.9*Math.sin(t*.72);
|
|
67
|
+
for(const key of ['left-pupil','right-pupil'])transform(key,`translate(${f(p.gx+glance)} ${f(p.gy)})`);
|
|
68
|
+
transform('left-brow',`translate(0 ${f(p.bl)}) rotate(${f(-5*p.ponder)} 208 260)`);
|
|
69
|
+
transform('right-brow',`translate(0 ${f(p.br)}) rotate(${f(4*p.ponder)} 314 262)`);
|
|
70
|
+
const talk=still?0:speechValue*p.talk;
|
|
71
|
+
const mouthY=mix(356,361,p.ponder);
|
|
72
|
+
nodes.mouth.setAttribute('d',`M233 ${f(mouthY)}C254 ${f(mix(368,363,p.ponder)-talk*15)} 282 ${f(mix(368,362,p.ponder)-talk*15)} 304 ${f(mix(350,358,p.ponder))}C282 ${f(mix(380,366,p.ponder)+talk*21+p.happy*7)} 253 ${f(mix(380,369,p.ponder)+talk*19+p.happy*7)} 233 ${f(mouthY)}Z`);
|
|
73
|
+
nodes['smile-line'].setAttribute('opacity',f(.65*(1-p.ponder)*(1-talk)));
|
|
74
|
+
// Visor sweep stays clipped to the lens and appears only while working.
|
|
75
|
+
transform('visor-scan',`translate(${f(still?104:(t*.22%1)*230)} 0)`);
|
|
76
|
+
nodes['visor-scan'].setAttribute('opacity',f(.22*p.work));
|
|
77
|
+
svg.dataset.state=selected;
|
|
78
|
+
}
|
|
79
|
+
function snapshot(){return Object.freeze({state:selected,playing:wanted&&!reduce.matches&&!doc.hidden,reducedMotion:reduce.matches,destroyed});}
|
|
80
|
+
function notify(){const value=snapshot();for(const fn of listeners)fn(value);}
|
|
81
|
+
function cancelFrame(){if(raf!==null)win.cancelAnimationFrame(raf);raf=null;previous=null;}
|
|
82
|
+
function schedule(){if(!destroyed&&wanted&&!reduce.matches&&!doc.hidden&&raf===null)raf=win.requestAnimationFrame(tick);}
|
|
83
|
+
function tick(now){
|
|
84
|
+
raf=null;if(destroyed||!wanted||reduce.matches||doc.hidden)return;
|
|
85
|
+
const dt=previous===null?0:clamp((now-previous)/1000,0,.05);previous=now;elapsed+=dt;
|
|
86
|
+
const voice=speechInput!==null?speechInput:demoSpeech?clamp(.2+.52*Math.sin(elapsed*8.5)+.35*Math.sin(elapsed*17.3),0,1):0;
|
|
87
|
+
speechValue+=(voice-speechValue)*(1-Math.exp(-dt*24));
|
|
88
|
+
updatePose();draw();schedule();
|
|
89
|
+
}
|
|
90
|
+
function onVisibility(){cancelFrame();schedule();notify();}
|
|
91
|
+
function onReduction(){cancelFrame();if(reduce.matches){pose={...poses[selected]};from={...pose};transitionStart=-2;draw(true);}else schedule();notify();}
|
|
92
|
+
doc.addEventListener('visibilitychange',onVisibility);reduce.addEventListener('change',onReduction);
|
|
93
|
+
draw(reduce.matches);schedule();
|
|
94
|
+
return Object.freeze({
|
|
95
|
+
setState(next){
|
|
96
|
+
if(destroyed)throw new Error('Captain Jack rig was destroyed.');
|
|
97
|
+
if(!STATES.includes(next))throw new RangeError('Unsupported Captain Jack state: '+next);
|
|
98
|
+
if(next===selected)return;
|
|
99
|
+
from={...pose};selected=next;transitionStart=elapsed;
|
|
100
|
+
if(reduce.matches||!wanted){pose={...poses[next]};from={...pose};transitionStart=-2;draw(true);}
|
|
101
|
+
schedule();notify();
|
|
102
|
+
},
|
|
103
|
+
setSpeechLevel(level){
|
|
104
|
+
if(destroyed)throw new Error('Captain Jack rig was destroyed.');
|
|
105
|
+
if(level!==null&&(!Number.isFinite(level)||level<0||level>1))throw new RangeError('Speech level must be 0..1 or null.');
|
|
106
|
+
speechInput=level;
|
|
107
|
+
},
|
|
108
|
+
play(){if(destroyed)return;wanted=true;schedule();notify();},
|
|
109
|
+
pause(){wanted=false;cancelFrame();notify();},
|
|
110
|
+
getState:snapshot,
|
|
111
|
+
subscribe(fn){listeners.add(fn);fn(snapshot());return()=>listeners.delete(fn);},
|
|
112
|
+
destroy(){if(destroyed)return;destroyed=true;wanted=false;cancelFrame();doc.removeEventListener('visibilitychange',onVisibility);reduce.removeEventListener('change',onReduction);listeners.clear();}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
window.CaptainJackRig=Object.freeze({create,states:STATES});
|
|
116
|
+
})();
|
|
117
|
+
|
|
118
|
+
/* Source for the generated captain-jack.js bundle. Run node build.mjs after edits. */
|
|
119
|
+
(() => {
|
|
120
|
+
'use strict';
|
|
121
|
+
const template = "<div class=\"captain-jack\">\n<div class=\"jack-scene\" data-scene=\"thinking\">\n <div class=\"jack-art\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 560 580\" fill=\"none\" role=\"img\" aria-labelledby=\"cj-title cj-desc\">\n <title id=\"cj-title\">Captain Jack</title>\n <desc id=\"cj-desc\">A faceted golden and magenta jackfruit captain, wearing an ivory peaked cap, a translucent cyan visor and a navy cape.</desc>\n <defs>\n <linearGradient id=\"cj-rind\" x1=\"148\" y1=\"226\" x2=\"418\" y2=\"520\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#FFF04A\"/><stop offset=\".3\" stop-color=\"#FFBD0B\"/><stop offset=\".65\" stop-color=\"#FF6843\"/><stop offset=\".84\" stop-color=\"#F412A7\"/><stop offset=\"1\" stop-color=\"#8627CF\"/></linearGradient>\n <linearGradient id=\"cj-face\" x1=\"195\" y1=\"234\" x2=\"335\" y2=\"425\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#FFE744\"/><stop offset=\".5\" stop-color=\"#FFD11C\"/><stop offset=\"1\" stop-color=\"#FF9E0C\"/></linearGradient>\n <linearGradient id=\"cj-gold\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop stop-color=\"#FFF17C\"/><stop offset=\".45\" stop-color=\"#FFCE19\"/><stop offset=\"1\" stop-color=\"#FF8D05\"/></linearGradient>\n <linearGradient id=\"cj-orange\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop stop-color=\"#FFD32B\"/><stop offset=\".6\" stop-color=\"#FF9730\"/><stop offset=\"1\" stop-color=\"#FB3B68\"/></linearGradient>\n <linearGradient id=\"cj-pink\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop stop-color=\"#FF8F57\"/><stop offset=\".5\" stop-color=\"#F72A9F\"/><stop offset=\"1\" stop-color=\"#9510BB\"/></linearGradient>\n <linearGradient id=\"cj-purple\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop stop-color=\"#F62AA9\"/><stop offset=\".55\" stop-color=\"#A11BC6\"/><stop offset=\"1\" stop-color=\"#561EAA\"/></linearGradient>\n <linearGradient id=\"cj-leaf\" x1=\"0\" y1=\"0\" x2=\".8\" y2=\"1\"><stop stop-color=\"#F0FF43\"/><stop offset=\".4\" stop-color=\"#AEEA1F\"/><stop offset=\".75\" stop-color=\"#51C53A\"/><stop offset=\"1\" stop-color=\"#008663\"/></linearGradient>\n <linearGradient id=\"cj-leaf-deep\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop stop-color=\"#A2D925\"/><stop offset=\".55\" stop-color=\"#158F50\"/><stop offset=\"1\" stop-color=\"#064F50\"/></linearGradient>\n <linearGradient id=\"cj-navy\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop stop-color=\"#305D87\"/><stop offset=\".4\" stop-color=\"#163B65\"/><stop offset=\"1\" stop-color=\"#08182F\"/></linearGradient>\n <linearGradient id=\"cj-cape\" x1=\"339\" y1=\"371\" x2=\"512\" y2=\"510\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#13578B\"/><stop offset=\".5\" stop-color=\"#173D83\"/><stop offset=\"1\" stop-color=\"#4937B8\"/></linearGradient>\n <linearGradient id=\"cj-hat\" x1=\"195\" y1=\"142\" x2=\"383\" y2=\"236\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#FFFDF3\"/><stop offset=\".48\" stop-color=\"#FFF0CE\"/><stop offset=\".8\" stop-color=\"#EAD8D4\"/><stop offset=\"1\" stop-color=\"#B2AACB\"/></linearGradient>\n <linearGradient id=\"cj-brim\" x1=\"174\" y1=\"211\" x2=\"341\" y2=\"260\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#38658B\"/><stop offset=\".35\" stop-color=\"#0A274B\"/><stop offset=\"1\" stop-color=\"#07182F\"/></linearGradient>\n <linearGradient id=\"cj-visor\" x1=\"171\" y1=\"265\" x2=\"379\" y2=\"328\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#3DEAFF\" stop-opacity=\".2\"/><stop offset=\".4\" stop-color=\"#90FFF4\" stop-opacity=\".05\"/><stop offset=\"1\" stop-color=\"#1B99F1\" stop-opacity=\".27\"/></linearGradient>\n <linearGradient id=\"cj-iris\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop stop-color=\"#7B380A\"/><stop offset=\".65\" stop-color=\"#C85E0D\"/><stop offset=\"1\" stop-color=\"#FFBF29\"/></linearGradient>\n <clipPath id=\"cj-eye-left\"><path d=\"M182 283Q207 264 235 284Q237 314 214 319Q189 320 182 283Z\"/></clipPath>\n <clipPath id=\"cj-eye-right\"><path d=\"M284 288Q310 271 345 279Q340 314 315 321Q290 324 284 288Z\"/></clipPath>\n <clipPath id=\"cj-visor-clip\"><path d=\"M172 264Q266 283 381 277L367 326Q264 343 167 309Z\"/></clipPath>\n </defs>\n <g data-part=\"breath\">\n <g data-part=\"head\">\n <g data-part=\"cape\">\n <path d=\"M363 363Q410 375 434 418Q460 459 518 510Q473 490 442 501Q414 512 364 481L327 401Z\" fill=\"url(#cj-cape)\" stroke=\"#07192F\" stroke-width=\"5\" stroke-linejoin=\"round\"/>\n <path d=\"M380 386Q418 417 436 451L499 495Q458 479 435 485Z\" fill=\"#265AC0\"/>\n <path d=\"M377 381Q410 407 427 430L501 494L436 461Z\" fill=\"#16CCEF\"/>\n <path d=\"M366 391L434 463L462 483L405 461Z\" fill=\"#FFC02B\"/>\n <path d=\"M401 438L435 485Q409 481 382 466Z\" fill=\"#081D4F\"/>\n </g>\n <g data-part=\"fruit\">\n <path d=\"M191 211Q254 184 330 211Q384 230 408 296Q434 368 404 441Q375 508 287 542Q212 532 160 474Q128 430 137 358Q141 279 191 211Z\" fill=\"url(#cj-rind)\" stroke=\"#0B1A32\" stroke-width=\"8\" stroke-linejoin=\"round\"/>\n <g stroke=\"#101A35\" stroke-width=\"6\" stroke-linejoin=\"round\">\n <path d=\"M189 226L226 210L250 233L239 267L202 279L174 257Z\" fill=\"url(#cj-gold)\"/>\n <path d=\"M257 215L294 207L326 227L319 258L278 274L247 251Z\" fill=\"url(#cj-orange)\"/>\n <path d=\"M332 226L365 244L381 279L351 292L324 267Z\" fill=\"url(#cj-pink)\"/>\n <path d=\"M383 284L401 312L408 342L383 349L361 323L358 296Z\" fill=\"url(#cj-purple)\"/>\n <path d=\"M170 263L197 283L190 317L163 333L143 313Z\" fill=\"url(#cj-gold)\"/>\n <path d=\"M151 333L179 322L202 345L190 379L159 392L138 368Z\" fill=\"url(#cj-gold)\"/>\n <path d=\"M386 352L411 349L416 385L399 408L374 389Z\" fill=\"url(#cj-purple)\"/>\n <path d=\"M201 278L256 258L294 274L349 279L373 323L356 372L306 408L250 407L199 379L187 331Z\" fill=\"url(#cj-face)\"/>\n <path d=\"M161 399L190 387L218 414L209 448L176 460L149 438L141 414Z\" fill=\"url(#cj-orange)\"/>\n <path d=\"M223 414L252 417L275 443L259 479L223 481L208 455Z\" fill=\"url(#cj-gold)\"/>\n <path d=\"M264 419L306 417L337 439L322 472L279 480L269 448Z\" fill=\"url(#cj-orange)\"/>\n <path d=\"M364 381L391 403L385 439L350 449L323 425L325 407Z\" fill=\"url(#cj-pink)\"/>\n <path d=\"M180 469L207 461L222 489L211 507L188 491Z\" fill=\"url(#cj-gold)\"/>\n <path d=\"M229 489L258 488L275 515L257 532L226 517L216 504Z\" fill=\"url(#cj-orange)\"/>\n <path d=\"M281 489L318 480L340 498L314 526L287 537L273 519Z\" fill=\"url(#cj-pink)\"/>\n <path d=\"M345 458L377 448L365 481L346 494L327 475Z\" fill=\"url(#cj-purple)\"/>\n </g>\n <g fill=\"#FFF49A\" opacity=\".65\">\n <path d=\"M153 333L163 338L151 369L142 366Z\"/>\n <path d=\"M168 402L188 393L196 400L166 412L153 435L150 426Z\"/>\n <path d=\"M224 423L249 422L256 428L230 432L219 452L216 445Z\"/>\n <path d=\"M271 424L303 424L316 431L281 430Z\"/>\n </g>\n <g fill=\"#831F8F\" opacity=\".27\">\n <path d=\"M229 454L259 479L223 481L208 455Z\"/>\n <path d=\"M302 446L337 439L322 472L279 480Z\"/>\n <path d=\"M354 413L385 439L350 449L323 425Z\"/>\n <path d=\"M303 504L340 498L314 526L287 537Z\"/>\n </g>\n <g fill=\"#15233B\" stroke=\"#FFB236\" stroke-width=\"1.5\">\n <path d=\"M167 346L175 352L170 361L162 355Z\"/>\n <path d=\"M175 422L183 427L178 437L170 432Z\"/>\n <path d=\"M236 448L245 453L240 463L231 458Z\"/>\n <path d=\"M292 442L300 447L294 456L287 451Z\"/>\n <path d=\"M349 414L356 418L351 428L345 424Z\"/>\n <path d=\"M243 505L250 510L244 518L238 512Z\"/>\n <path d=\"M298 508L305 513L299 521L291 516Z\"/>\n </g>\n <g fill=\"#CA770C\" opacity=\".55\"><circle cx=\"206\" cy=\"351\" r=\"2.2\"/><circle cx=\"215\" cy=\"365\" r=\"2\"/><circle cx=\"208\" cy=\"376\" r=\"1.6\"/><circle cx=\"262\" cy=\"433\" r=\"1.8\"/><circle cx=\"156\" cy=\"418\" r=\"2\"/><circle cx=\"185\" cy=\"447\" r=\"1.7\"/></g>\n <g fill=\"#39205A\"><circle cx=\"390\" cy=\"321\" r=\"2.3\"/><circle cx=\"397\" cy=\"332\" r=\"1.7\"/><circle cx=\"398\" cy=\"369\" r=\"2.3\"/><circle cx=\"403\" cy=\"382\" r=\"1.9\"/><circle cx=\"360\" cy=\"464\" r=\"2\"/></g>\n </g>\n <g data-part=\"face\">\n <g data-part=\"left-eye\" transform=\"translate(0 0)\">\n <path d=\"M182 283Q207 264 235 284Q237 314 214 319Q189 320 182 283Z\" fill=\"#FFFBE9\" stroke=\"#12233C\" stroke-width=\"2.5\"/>\n <g clip-path=\"url(#cj-eye-left)\"><g data-part=\"left-pupil\"><ellipse cx=\"217\" cy=\"293\" rx=\"18\" ry=\"27\" fill=\"url(#cj-iris)\"/><ellipse cx=\"218\" cy=\"290\" rx=\"12\" ry=\"22\" fill=\"#091B32\"/><ellipse cx=\"211\" cy=\"280\" rx=\"6\" ry=\"7\" fill=\"#FFFFFF\"/><circle cx=\"225\" cy=\"300\" r=\"2.8\" fill=\"#FFEC9C\"/></g></g>\n <path d=\"M181 283Q207 266 235 284\" stroke=\"#10233A\" stroke-width=\"5\" stroke-linecap=\"round\"/>\n </g>\n <g data-part=\"right-eye\" transform=\"translate(0 0)\">\n <path d=\"M284 288Q310 271 345 279Q340 314 315 321Q290 324 284 288Z\" fill=\"#FFFBE9\" stroke=\"#12233C\" stroke-width=\"2.5\"/>\n <g clip-path=\"url(#cj-eye-right)\"><g data-part=\"right-pupil\"><ellipse cx=\"319\" cy=\"294\" rx=\"19\" ry=\"28\" fill=\"url(#cj-iris)\"/><ellipse cx=\"321\" cy=\"290\" rx=\"13\" ry=\"22\" fill=\"#091B32\"/><ellipse cx=\"312\" cy=\"280\" rx=\"6\" ry=\"7\" fill=\"#FFFFFF\"/><circle cx=\"329\" cy=\"303\" r=\"2.7\" fill=\"#FFEC9C\"/></g></g>\n <path d=\"M283 288Q308 273 345 279\" stroke=\"#10233A\" stroke-width=\"5\" stroke-linecap=\"round\"/>\n </g>\n <path data-part=\"left-brow\" d=\"M181 263Q199 242 216 253L236 266Q218 262 206 258Q195 255 181 263Z\" fill=\"#101E32\"/>\n <path data-part=\"right-brow\" d=\"M285 264L333 247Q342 248 349 259Q320 262 291 276Z\" fill=\"#101E32\"/>\n <path d=\"M248 326Q253 337 262 336\" stroke=\"#DA8C05\" stroke-width=\"3\" stroke-linecap=\"round\" opacity=\".7\"/>\n <path data-part=\"mouth\" d=\"M233 356C254 368 282 368 304 350C282 380 253 380 233 356Z\" fill=\"#14243A\"/>\n <path data-part=\"smile-line\" d=\"M247 380Q263 385 278 379\" stroke=\"#ED8E06\" stroke-width=\"2.5\" stroke-linecap=\"round\" opacity=\".65\"/>\n </g>\n <g data-part=\"visor\">\n <path d=\"M160 260L176 264L170 309L157 302Z\" fill=\"#17C7EA\" stroke=\"#126189\" stroke-width=\"2\"/>\n <path d=\"M172 264Q266 283 381 277L367 326Q264 343 167 309Z\" fill=\"url(#cj-visor)\" stroke=\"#62EBFF\" stroke-width=\"3\" stroke-linejoin=\"round\"/>\n <g clip-path=\"url(#cj-visor-clip)\">\n <path data-part=\"visor-scan\" d=\"M170 277L190 280L170 332L150 327Z\" fill=\"#D0FFFF\" opacity=\"0\"/>\n <path d=\"M188 256L202 259L177 323L166 319Z\" fill=\"#E0FFFF\" opacity=\".6\"/>\n <path d=\"M214 260L235 265L207 327L189 322Z\" fill=\"#C4FFFF\" opacity=\".14\"/>\n <path d=\"M355 266L366 268L347 335L337 336Z\" fill=\"#D0F9FF\" opacity=\".35\"/>\n </g>\n <path d=\"M178 269Q269 287 374 281\" stroke=\"#E4FFFF\" stroke-width=\"2\" stroke-linecap=\"round\" opacity=\".85\"/>\n <path d=\"M374 280L384 282L371 322L365 325Z\" fill=\"#2998E5\"/>\n </g>\n <g data-part=\"leaf-left\">\n <path d=\"M266 168C267 127 250 97 218 82C194 70 174 64 159 43C165 82 177 119 211 137C237 146 253 148 266 168Z\" fill=\"url(#cj-leaf)\" stroke=\"#0C4A46\" stroke-width=\"3\" stroke-linejoin=\"round\"/>\n <path d=\"M166 55Q195 100 244 125L266 168C248 145 226 146 204 131Q232 135 232 127L198 106L218 111Z\" fill=\"url(#cj-leaf-deep)\"/>\n <path d=\"M174 64Q196 78 220 86L237 110Q203 94 174 64Z\" fill=\"#F4FF67\"/>\n </g>\n <g data-part=\"leaf-right\">\n <path d=\"M272 170C269 123 298 77 344 71C383 67 411 100 467 65C449 110 421 148 373 147C331 145 299 150 272 170Z\" fill=\"url(#cj-leaf)\" stroke=\"#0B5346\" stroke-width=\"3\" stroke-linejoin=\"round\"/>\n <path d=\"M279 157Q322 103 389 112L451 80Q414 119 371 126L388 132L344 131L321 146Q298 152 272 170Z\" fill=\"url(#cj-leaf-deep)\"/>\n <path d=\"M285 132C295 100 320 80 344 79L327 98L361 86Q347 105 321 112Z\" fill=\"#F4FF80\"/>\n <path d=\"M383 98Q417 106 451 83Q420 115 376 119Z\" fill=\"#C3F33C\"/>\n </g>\n <g data-part=\"cap\">\n <path d=\"M151 205Q127 191 145 172Q180 141 223 143Q262 147 308 172L385 198Q419 211 422 231Q425 245 409 255L375 254L323 229L233 208L166 220Z\" fill=\"url(#cj-hat)\" stroke=\"#5A6581\" stroke-width=\"3\" stroke-linejoin=\"round\"/>\n <path d=\"M151 188Q192 153 222 153Q254 155 287 173\" stroke=\"#FFFFFF\" stroke-width=\"5\" stroke-linecap=\"round\" opacity=\".8\"/>\n <path d=\"M159 205Q244 185 319 214L402 241L397 267Q336 246 283 232L164 229Z\" fill=\"url(#cj-navy)\" stroke=\"#0A1C37\" stroke-width=\"3\"/>\n <path d=\"M166 217Q243 200 318 227L399 253L398 261Q333 242 313 236Q243 212 164 227Z\" fill=\"url(#cj-gold)\"/>\n <path d=\"M171 225C216 212 262 222 296 232Q331 242 354 247C335 266 294 266 262 254C226 243 180 240 147 246Q128 249 130 238Q137 228 171 225Z\" fill=\"url(#cj-brim)\" stroke=\"#102545\" stroke-width=\"3\"/>\n <path d=\"M142 235Q203 216 267 238Q308 254 344 249\" stroke=\"#6591B3\" stroke-width=\"2\" stroke-linecap=\"round\" opacity=\".8\"/>\n <path d=\"M212 163L239 190L218 222L192 193Z\" fill=\"url(#cj-gold)\" stroke=\"#6C4D32\" stroke-width=\"2.5\" stroke-linejoin=\"round\"/>\n <path d=\"M212 163L214 188L192 193Z\" fill=\"#FFF9A6\"/>\n <path d=\"M214 188L239 190L218 222Z\" fill=\"#EB8A02\"/>\n <path d=\"M213 182L221 191L214 200L206 192Z\" fill=\"#14243B\"/>\n <ellipse cx=\"389\" cy=\"248\" rx=\"8\" ry=\"11\" transform=\"rotate(-19 389 248)\" fill=\"url(#cj-gold)\" stroke=\"#75503A\" stroke-width=\"2\"/>\n </g>\n <g data-part=\"collar\">\n <path d=\"M352 408L372 373L416 351Q426 347 424 359L409 408L371 434Z\" fill=\"url(#cj-navy)\" stroke=\"#0B1B30\" stroke-width=\"5\" stroke-linejoin=\"round\"/>\n <path d=\"M359 409L378 381L416 364\" stroke=\"#FFD157\" stroke-width=\"4\" stroke-linecap=\"round\"/>\n <path d=\"M373 376L417 354\" stroke=\"#50DAFF\" stroke-width=\"3\" stroke-linecap=\"round\"/>\n <path d=\"M380 392L391 390L397 400L390 411L378 407L375 399Z\" fill=\"#18D3EF\" stroke=\"#F5C358\" stroke-width=\"3\"/>\n <path d=\"M382 395L390 394L391 399L382 405Z\" fill=\"#C2FFFF\"/>\n </g>\n </g>\n </g>\n</svg>\n</div>\n <div class=\"jack-props\" aria-hidden=\"true\">\n <div class=\"jack-prop listening\" data-prop=\"listening\" hidden><span></span><span></span></div>\n <div class=\"jack-prop thinking\" data-prop=\"thinking\"><div class=\"bulb\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\"/><path d=\"M9 18h6\"/><path d=\"M10 22h4\"/></svg></div><span class=\"spark a\">✦</span><span class=\"spark b\">✧</span><b class=\"thought-dot one\"></b><b class=\"thought-dot two\"></b></div>\n <div class=\"jack-prop speaking\" data-prop=\"speaking\" hidden><div class=\"speech-bubble\">“</div></div>\n <div class=\"jack-prop working\" data-prop=\"working\" hidden><div class=\"paper back\"></div><div class=\"paper front\"><span></span><span></span><span></span></div><div class=\"pencil\"></div></div>\n <div class=\"jack-prop success\" data-prop=\"success\" hidden><div class=\"ribbon\"></div><div class=\"seal\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M20 6 9 17l-5-5\"/></svg></div><span class=\"spark a\">✦</span><span class=\"spark b\">✦</span></div>\n <div class=\"jack-prop waiting\" data-prop=\"waiting\" hidden><div class=\"hourglass\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M5 22h14\"/><path d=\"M5 2h14\"/><path d=\"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22\"/><path d=\"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2\"/></svg></div></div>\n <div class=\"jack-prop attention\" data-prop=\"attention\" hidden><div class=\"question\">?</div><span class=\"small-spark\">✧</span></div>\n </div>\n <div class=\"jack-status\" role=\"status\" aria-live=\"polite\"><strong data-status>Thinking</strong><span data-detail>Give me a moment.</span></div>\n </div>\n</div>\n";
|
|
122
|
+
const states = window.CaptainJackRig.states;
|
|
123
|
+
const defaults = Object.freeze(Object.fromEntries(Object.entries({
|
|
124
|
+
idle: {status:'Ready when you are',detail:''},
|
|
125
|
+
listening: {status:'Listening',detail:'I’m here. Take your time.'},
|
|
126
|
+
thinking: {status:'Thinking',detail:'Give me a moment.'},
|
|
127
|
+
speaking: {status:'Speaking',detail:''},
|
|
128
|
+
working: {status:'Working',detail:'I’ll let you know when I’m done.'},
|
|
129
|
+
success: {status:'Done!',detail:''},
|
|
130
|
+
waiting: {status:'Waiting for you',detail:'Ready whenever you are.'},
|
|
131
|
+
attention: {status:'I need your help',detail:'Let’s sort this out together.'}
|
|
132
|
+
}).map(([key,value])=>[key,Object.freeze(value)])));
|
|
133
|
+
const mounted = new WeakMap();
|
|
134
|
+
function getText(state, context = null) {
|
|
135
|
+
if(!states.includes(state))throw new RangeError('Unsupported Captain Jack state: '+state);
|
|
136
|
+
const fallback=defaults[state], supplied=context?.[state];
|
|
137
|
+
const status=typeof supplied?.status==='string'?supplied.status.trim():'';
|
|
138
|
+
// A detail without a useful status is incomplete context: use the full fallback.
|
|
139
|
+
if(!status)return {...fallback};
|
|
140
|
+
return {status,detail:typeof supplied.detail==='string'?supplied.detail.trim():''};
|
|
141
|
+
}
|
|
142
|
+
function copyContext(context) {
|
|
143
|
+
return Object.fromEntries(states.filter(s=>context?.[s]).map(s=>[s,{status:context[s].status,detail:context[s].detail}]));
|
|
144
|
+
}
|
|
145
|
+
function mount(container, {state='idle',context=null,autoplay=true,demoSpeech=false}={}) {
|
|
146
|
+
if(!container || container.nodeType!==1)throw new TypeError('Captain Jack requires a container element.');
|
|
147
|
+
if(mounted.has(container))throw new Error('Captain Jack is already mounted in this container.');
|
|
148
|
+
getText(state);
|
|
149
|
+
const fragment=container.ownerDocument.createElement('template');
|
|
150
|
+
fragment.innerHTML=template;
|
|
151
|
+
const root=fragment.content.firstElementChild;
|
|
152
|
+
const scene=root.querySelector('.jack-scene');
|
|
153
|
+
const status=root.querySelector('[data-status]'),detail=root.querySelector('[data-detail]');
|
|
154
|
+
const props=[...root.querySelectorAll('[data-prop]')];
|
|
155
|
+
let currentContext=copyContext(context),destroyed=false;
|
|
156
|
+
container.append(root);
|
|
157
|
+
let rig;
|
|
158
|
+
try {rig=window.CaptainJackRig.create(root.querySelector('.jack-art > svg'),{state,autoplay,demoSpeech});}
|
|
159
|
+
catch(error){root.remove();throw error;}
|
|
160
|
+
const render=info=>{
|
|
161
|
+
scene.dataset.scene=info.state;
|
|
162
|
+
scene.dataset.paused=String(!info.playing);
|
|
163
|
+
props.forEach(p=>p.hidden=p.dataset.prop!==info.state);
|
|
164
|
+
const text=getText(info.state,currentContext);
|
|
165
|
+
// Task data is always plain text, never HTML.
|
|
166
|
+
if(status.textContent!==text.status)status.textContent=text.status;
|
|
167
|
+
if(detail.textContent!==text.detail)detail.textContent=text.detail;
|
|
168
|
+
};
|
|
169
|
+
const unsubscribe=rig.subscribe(render);
|
|
170
|
+
const assertLive=()=>{if(destroyed)throw new Error('Captain Jack was destroyed.');};
|
|
171
|
+
const api=Object.freeze({
|
|
172
|
+
setState:next=>{assertLive();rig.setState(next);},
|
|
173
|
+
setContext:next=>{assertLive();currentContext=copyContext(next);render(rig.getState());},
|
|
174
|
+
setSpeechLevel:level=>{assertLive();rig.setSpeechLevel(level);},
|
|
175
|
+
getState:()=>rig.getState(),
|
|
176
|
+
getText:()=>getText(rig.getState().state,currentContext),
|
|
177
|
+
subscribe:callback=>{assertLive();return rig.subscribe(callback);},
|
|
178
|
+
play:()=>rig.play(),pause:()=>rig.pause(),
|
|
179
|
+
destroy:()=>{if(destroyed)return;destroyed=true;unsubscribe();rig.destroy();root.remove();mounted.delete(container);}
|
|
180
|
+
});
|
|
181
|
+
mounted.set(container,api);
|
|
182
|
+
return api;
|
|
183
|
+
}
|
|
184
|
+
window.CaptainJack=Object.freeze({mount,states,defaults,getText});
|
|
185
|
+
})();
|