aimeat 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-stamp.json +4 -4
- package/dist/locales/en.json +9103 -9101
- package/dist/locales/es.json +9095 -0
- package/dist/locales/fi.json +9103 -9101
- package/dist/public/cortex-bundled/aimeat-input.js +611 -0
- package/dist/public/cortex-bundled/aimeat-input.yaml +149 -0
- package/dist/public/css/views/agents-detail.css +11 -0
- package/dist/public/js/utils.js +12 -7
- package/dist/public/spa.html +5 -2
- package/dist/public/views/admin/email-tab.js +459 -458
- package/dist/public/views/profile/agents/agent-card.js +25 -0
- package/dist/public/views/profile/agents/scope-model.js +296 -288
- package/dist/public/views/profile/agents-tab.js +26 -3
- package/dist/scripts/check-ai-disclosure.d.ts.map +1 -1
- package/dist/scripts/check-ai-disclosure.js +33 -18
- package/dist/scripts/check-ai-disclosure.js.map +1 -1
- package/dist/scripts/check-locales.d.ts +2 -0
- package/dist/scripts/check-locales.d.ts.map +1 -0
- package/dist/scripts/check-locales.js +46 -0
- package/dist/scripts/check-locales.js.map +1 -0
- package/dist/scripts/lib/locale-files.d.ts +40 -0
- package/dist/scripts/lib/locale-files.d.ts.map +1 -0
- package/dist/scripts/lib/locale-files.js +181 -0
- package/dist/scripts/lib/locale-files.js.map +1 -0
- package/dist/scripts/locale-extract.d.ts +2 -0
- package/dist/scripts/locale-extract.d.ts.map +1 -0
- package/dist/scripts/locale-extract.js +99 -0
- package/dist/scripts/locale-extract.js.map +1 -0
- package/dist/scripts/locale-merge.d.ts +2 -0
- package/dist/scripts/locale-merge.d.ts.map +1 -0
- package/dist/scripts/locale-merge.js +114 -0
- package/dist/scripts/locale-merge.js.map +1 -0
- package/dist/src/auth/middleware.d.ts +6 -0
- package/dist/src/auth/middleware.d.ts.map +1 -1
- package/dist/src/auth/middleware.js +24 -4
- package/dist/src/auth/middleware.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-management.d.ts +1 -0
- package/dist/src/cli/connect/mcp/tools/agent-management.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/agent-management.js +9 -0
- package/dist/src/cli/connect/mcp/tools/agent-management.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/schedules.d.ts +3 -0
- package/dist/src/cli/connect/mcp/tools/schedules.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/schedules.js +5 -0
- package/dist/src/cli/connect/mcp/tools/schedules.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-agent.d.ts +2 -0
- package/dist/src/cli/connect/tool-call-defs-agent.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-agent.js +16 -0
- package/dist/src/cli/connect/tool-call-defs-agent.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-organism.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-organism.js +6 -0
- package/dist/src/cli/connect/tool-call-defs-organism.js.map +1 -1
- package/dist/src/config-operator.d.ts +4 -1
- package/dist/src/config-operator.d.ts.map +1 -1
- package/dist/src/config-operator.js +4 -4
- package/dist/src/config-operator.js.map +1 -1
- package/dist/src/data/library-packs/cortex.d.ts +3 -0
- package/dist/src/data/library-packs/cortex.d.ts.map +1 -1
- package/dist/src/data/library-packs/cortex.js +58 -0
- package/dist/src/data/library-packs/cortex.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +90 -2
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/i18n.d.ts +1 -1
- package/dist/src/i18n.d.ts.map +1 -1
- package/dist/src/i18n.js +13 -6
- package/dist/src/i18n.js.map +1 -1
- package/dist/src/mcp/agent-management.d.ts +6 -2
- package/dist/src/mcp/agent-management.d.ts.map +1 -1
- package/dist/src/mcp/agent-management.js +34 -3
- package/dist/src/mcp/agent-management.js.map +1 -1
- package/dist/src/mcp/agent-schedules.d.ts +6 -2
- package/dist/src/mcp/agent-schedules.d.ts.map +1 -1
- package/dist/src/mcp/agent-schedules.js +22 -1
- package/dist/src/mcp/agent-schedules.js.map +1 -1
- package/dist/src/mcp/annotations.d.ts +1 -0
- package/dist/src/mcp/annotations.d.ts.map +1 -1
- package/dist/src/mcp/annotations.js +5 -0
- package/dist/src/mcp/annotations.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/agent-messaging.d.ts +2 -0
- package/dist/src/mcp/catalog/definitions/agent-messaging.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/agent-messaging.js +12 -0
- package/dist/src/mcp/catalog/definitions/agent-messaging.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js +7 -0
- package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
- package/dist/src/mcp/catalog/scopes.js +5 -0
- package/dist/src/mcp/catalog/scopes.js.map +1 -1
- package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
- package/dist/src/mcp/catalog/surfaces.js +4 -2
- package/dist/src/mcp/catalog/surfaces.js.map +1 -1
- package/dist/src/routes/admin-features.d.ts.map +1 -1
- package/dist/src/routes/admin-features.js +5 -4
- package/dist/src/routes/admin-features.js.map +1 -1
- package/dist/src/routes/agents/constants.d.ts +18 -2
- package/dist/src/routes/agents/constants.d.ts.map +1 -1
- package/dist/src/routes/agents/constants.js +18 -2
- package/dist/src/routes/agents/constants.js.map +1 -1
- package/dist/src/routes/agents/device-auth.d.ts +2 -0
- package/dist/src/routes/agents/device-auth.d.ts.map +1 -1
- package/dist/src/routes/agents/device-auth.js +22 -2
- package/dist/src/routes/agents/device-auth.js.map +1 -1
- package/dist/src/routes/agents/management.d.ts +7 -0
- package/dist/src/routes/agents/management.d.ts.map +1 -1
- package/dist/src/routes/agents/management.js +59 -4
- package/dist/src/routes/agents/management.js.map +1 -1
- package/dist/src/routes/agents/profile-metadata.d.ts +4 -0
- package/dist/src/routes/agents/profile-metadata.d.ts.map +1 -1
- package/dist/src/routes/agents/profile-metadata.js +31 -2
- package/dist/src/routes/agents/profile-metadata.js.map +1 -1
- package/dist/src/routes/agents/registration.d.ts +2 -0
- package/dist/src/routes/agents/registration.d.ts.map +1 -1
- package/dist/src/routes/agents/registration.js +3 -0
- package/dist/src/routes/agents/registration.js.map +1 -1
- package/dist/src/routes/ai-transparency.d.ts.map +1 -1
- package/dist/src/routes/ai-transparency.js +5 -1
- package/dist/src/routes/ai-transparency.js.map +1 -1
- package/dist/src/routes/auth.d.ts +3 -0
- package/dist/src/routes/auth.d.ts.map +1 -1
- package/dist/src/routes/auth.js +22 -5
- package/dist/src/routes/auth.js.map +1 -1
- package/dist/src/routes/portal.d.ts +3 -0
- package/dist/src/routes/portal.d.ts.map +1 -1
- package/dist/src/routes/portal.js +39 -17
- package/dist/src/routes/portal.js.map +1 -1
- package/dist/src/routes/schedules.d.ts +3 -0
- package/dist/src/routes/schedules.d.ts.map +1 -1
- package/dist/src/routes/schedules.js +16 -29
- package/dist/src/routes/schedules.js.map +1 -1
- package/dist/src/services/agent-profile-write.d.ts +13 -1
- package/dist/src/services/agent-profile-write.d.ts.map +1 -1
- package/dist/src/services/agent-profile-write.js +55 -0
- package/dist/src/services/agent-profile-write.js.map +1 -1
- package/dist/src/services/build-app-prompt.d.ts.map +1 -1
- package/dist/src/services/build-app-prompt.js +22 -0
- package/dist/src/services/build-app-prompt.js.map +1 -1
- package/dist/src/services/email-templates.d.ts.map +1 -1
- package/dist/src/services/email-templates.js +79 -3
- package/dist/src/services/email-templates.js.map +1 -1
- package/dist/src/services/notification-templates.d.ts +5 -3
- package/dist/src/services/notification-templates.d.ts.map +1 -1
- package/dist/src/services/notification-templates.js +23 -3
- package/dist/src/services/notification-templates.js.map +1 -1
- package/dist/src/services/schedule-write.d.ts +25 -2
- package/dist/src/services/schedule-write.d.ts.map +1 -1
- package/dist/src/services/schedule-write.js +44 -0
- package/dist/src/services/schedule-write.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/db-types.d.ts +2 -0
- package/dist/src/storage/providers/postgres-kysely/db-types.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js +5 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/sessions.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/sessions.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/sessions.js +4 -0
- package/dist/src/storage/providers/postgres-kysely/methods/sessions.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/migrations/0034_agent_console_url.sql +16 -0
- package/dist/src/storage/providers/postgres-kysely/migrations/0035_agent_registered_by.sql +19 -0
- package/dist/src/storage/providers/sqlite/methods/extensions-notify.d.ts +2 -0
- package/dist/src/storage/providers/sqlite/methods/extensions-notify.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/extensions-notify.js +4 -0
- package/dist/src/storage/providers/sqlite/methods/extensions-notify.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts +5 -0
- package/dist/src/storage/providers/sqlite/methods/owner.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/owner.js +13 -4
- package/dist/src/storage/providers/sqlite/methods/owner.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/auth.d.ts +2 -0
- package/dist/src/storage/providers/sqlite/repos/auth.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/auth.js +4 -0
- package/dist/src/storage/providers/sqlite/repos/auth.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-1.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/schema-tables-1.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-1.js +4 -2
- package/dist/src/storage/providers/sqlite/schema-tables-1.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-2.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/schema-tables-2.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-2.js +4 -3
- package/dist/src/storage/providers/sqlite/schema-tables-2.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-3.d.ts +3 -0
- package/dist/src/storage/providers/sqlite/schema-tables-3.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema-tables-3.js +6 -9
- package/dist/src/storage/providers/sqlite/schema-tables-3.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.d.ts +6 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +9 -0
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/session.repository.d.ts +14 -0
- package/dist/src/storage/repositories/session.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/session.repository.js +2 -0
- package/dist/src/storage/repositories/session.repository.js.map +1 -1
- package/dist/src/storage/storage-factory.d.ts +6 -0
- package/dist/src/storage/storage-factory.d.ts.map +1 -1
- package/dist/src/storage/storage-factory.js +38 -19
- package/dist/src/storage/storage-factory.js.map +1 -1
- package/dist/src/storage/types/identity.d.ts +31 -0
- package/dist/src/storage/types/identity.d.ts.map +1 -1
- package/dist/src/utils/gaii.d.ts +11 -0
- package/dist/src/utils/gaii.d.ts.map +1 -1
- package/dist/src/utils/gaii.js +16 -0
- package/dist/src/utils/gaii.js.map +1 -1
- package/dist/static/sdk-libs/ai/strings.js +5 -2
- package/dist/static/sdk-libs/auth/i18n.js +9 -4
- package/dist/static/sdk-libs/auth/modal.js +11 -3
- package/dist/static/sdk-libs/auth/pill-strings.js +52 -0
- package/dist/static/sdk-libs/auth/pill.js +16 -2
- package/dist/static/sdk-libs/dist/aimeat-ai.js +30 -1
- package/dist/static/sdk-libs/dist/aimeat-auth.js +61 -5
- package/dist/static/sdk-libs/dist/aimeat-game.js +32 -2
- package/dist/static/sdk-libs/dist/aimeat-header.js +9 -4
- package/dist/static/sdk-libs/game/i18n.js +38 -7
- package/dist/static/sdk-libs/header/index.js +11 -5
- package/package.json +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../src/storage/types/identity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../src/storage/types/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,0BAA0B,CAAC,EAAE,kBAAkB,EAAE,CAAC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B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/dist/src/utils/gaii.d.ts
CHANGED
|
@@ -111,6 +111,17 @@ export declare function isSameOwner(gaiiA: string, gaiiB: string): boolean;
|
|
|
111
111
|
* principal, and that distinction is the whole point of agents having identities.
|
|
112
112
|
*/
|
|
113
113
|
export declare function ownerGhiiOf(principal: string): string;
|
|
114
|
+
/**
|
|
115
|
+
* Is this identity something acting FOR a person rather than the person themselves?
|
|
116
|
+
*
|
|
117
|
+
* `bot#alice@node` (GAII) and `eco:drum#alice@node` (GEAI) are; `alice` and `alice@node` are not.
|
|
118
|
+
* The '#' is what separates them, which is why both forms were given one.
|
|
119
|
+
*
|
|
120
|
+
* Used where a surface is about the human's own sign-ins: their device list, and signing out
|
|
121
|
+
* everywhere. Those rows share an `owner` column with every agent session, and treating the two the
|
|
122
|
+
* same turns "sign out of my other browser" into disconnecting a fleet.
|
|
123
|
+
*/
|
|
124
|
+
export declare function isExternalPrincipal(id: string): boolean;
|
|
114
125
|
export interface ParsedChatInstanceId {
|
|
115
126
|
platform: string;
|
|
116
127
|
appName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gaii.d.ts","sourceRoot":"","sources":["../../../src/utils/gaii.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gaii.d.ts","sourceRoot":"","sources":["../../../src/utils/gaii.ts"],"names":[],"mappings":"AAuCA,wFAAwF;AACxF,eAAO,MAAM,UAAU,SAAS,CAAC;AAMjC,eAAO,MAAM,cAAc,aAIzB,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BAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1G;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CASzC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAmD3E"}
|
package/dist/src/utils/gaii.js
CHANGED
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
* - Chat instance + device-auth user-code helpers
|
|
14
14
|
* @usage import { resolveIdentity, parseGEAI, isGEAI } from '../utils/gaii.js';
|
|
15
15
|
* @version-history
|
|
16
|
+
* v1.4.0 — 2026-08-13 — `isExternalPrincipal`: does this identity act FOR a person, or is it the
|
|
17
|
+
* person. Session rows share an owner column, so the device list and "sign out everywhere" need
|
|
18
|
+
* to tell the human's own sign-ins from their agents'.
|
|
16
19
|
* v1.3.0 — 2026-07-28 — `callerPrincipal` + `appSlug`: a hosted app is named `eco:{app}#{owner}@{node}`
|
|
17
20
|
* where the question is who acted. Storage identity is untouched, so no app's data moves.
|
|
18
21
|
* v1.2.0 — 2026-07-27 — `ownerGhiiOf`: the identity anything about MONEY keys on, since the wallet
|
|
@@ -206,6 +209,19 @@ export function ownerGhiiOf(principal) {
|
|
|
206
209
|
const owner = namePart.includes('#') ? namePart.split('#').pop() : namePart;
|
|
207
210
|
return host ? `${owner}@${host}` : owner;
|
|
208
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Is this identity something acting FOR a person rather than the person themselves?
|
|
214
|
+
*
|
|
215
|
+
* `bot#alice@node` (GAII) and `eco:drum#alice@node` (GEAI) are; `alice` and `alice@node` are not.
|
|
216
|
+
* The '#' is what separates them, which is why both forms were given one.
|
|
217
|
+
*
|
|
218
|
+
* Used where a surface is about the human's own sign-ins: their device list, and signing out
|
|
219
|
+
* everywhere. Those rows share an `owner` column with every agent session, and treating the two the
|
|
220
|
+
* same turns "sign out of my other browser" into disconnecting a fleet.
|
|
221
|
+
*/
|
|
222
|
+
export function isExternalPrincipal(id) {
|
|
223
|
+
return id.includes('#');
|
|
224
|
+
}
|
|
209
225
|
export function buildChatInstanceId(platform, appName, owner, node) {
|
|
210
226
|
return `${platform}-${appName}#${owner}@${node}`;
|
|
211
227
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gaii.js","sourceRoot":"","sources":["../../../src/utils/gaii.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"gaii.js","sourceRoot":"","sources":["../../../src/utils/gaii.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,gCAAgC;AAChC,2CAA2C;AAC3C,2CAA2C;AAC3C,uDAAuD;AACvD,kFAAkF;AAElF,MAAM,QAAQ,GAAG,mCAAmC,CAAC;AACrD,MAAM,QAAQ,GAAG,mCAAmC,CAAC;AACrD,MAAM,OAAO,GAAG,+CAA+C,CAAC;AAChE,MAAM,OAAO,GAAG,qHAAqH,CAAC;AAEtI,wFAAwF;AACxF,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AACjC,MAAM,OAAO,GAAG,yHAAyH,CAAC;AAE1I,8FAA8F;AAC9F,iGAAiG;AACjG,yEAAyE;AACzE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS;IAClG,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;IACzE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ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AO,CAAC,EAAE,CAAC;QACxE,mFAAmF;QACnF,MAAM,OAAO,GAAG,gBAAgB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACtD,QAAQ,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,eAAe,CAAC;IAC5E,CAAC;SAAM,CAAC;QACN,sDAAsD;QACtD,QAAQ,GAAG,gBAAgB,CAAC;QAC5B,OAAO,GAAG,eAAe,CAAC;IAC5B,CAAC;IAED,IAAI,CAAC,QAAQ,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAEvC,OAAO;QACL,QAAQ;QACR,OAAO;QACP,SAAS;QACT,MAAM;QACN,IAAI,EAAE,EAAE;QACR,WAAW,EAAE,SAAS,KAAK,WAAW;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -12,16 +12,19 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The strings come from the platform's own locales/*.json — one source, tree-shaken to this block
|
|
14
14
|
* at bundle time — so an app's label and the apex SPA's label say the same words.
|
|
15
|
-
* @structure STRINGS — { en, fi } · pick(key, loc) — full dotted key → string
|
|
15
|
+
* @structure STRINGS — { en, fi, es } · pick(key, loc) — full dotted key → string
|
|
16
16
|
* @usage import { pick } from './strings.js'; pick('aiLabel.short', 'fi')
|
|
17
17
|
* @version-history
|
|
18
|
+
* v1.1.0 — 2026-08-12 — Spanish (es) added. The disclosure the EU AI Act asks for is now carried
|
|
19
|
+
* in every language the node declares at /v1/ai-transparency, not two of the three.
|
|
18
20
|
* v1.0.0 — 2026-08-01 — TARGET-058 Phase 5, after a browser showed raw keys on the chip.
|
|
19
21
|
*/
|
|
20
22
|
import { aiLabel as EN } from '../../../../locales/en.json';
|
|
21
23
|
import { aiLabel as FI } from '../../../../locales/fi.json';
|
|
24
|
+
import { aiLabel as ES } from '../../../../locales/es.json';
|
|
22
25
|
|
|
23
26
|
/** The label strings, per language the node ships. */
|
|
24
|
-
export const STRINGS = { en: EN, fi: FI };
|
|
27
|
+
export const STRINGS = { en: EN, fi: FI, es: ES };
|
|
25
28
|
|
|
26
29
|
/**
|
|
27
30
|
* A platform string by its FULL dotted key, in `loc`, falling back to English and finally to the key
|
|
@@ -6,23 +6,28 @@
|
|
|
6
6
|
* 'aimeat-lang' localStorage key + cookie the header uses so the choice stays in sync with the SPA.
|
|
7
7
|
* loadModalI18n fetches en.json (base) + <lang>.json (overrides) from the node and returns just the
|
|
8
8
|
* modal.* strings with the 'modal.' prefix stripped. Extracted from auth-lib-part2.ts.
|
|
9
|
-
* @structure MODAL_LANG_KEY · currentModalLang() · flattenModalI18n() · loadModalI18n(lang).
|
|
9
|
+
* @structure MODAL_LANG_KEY · MODAL_LANGS · currentModalLang() · flattenModalI18n() · loadModalI18n(lang).
|
|
10
10
|
* @usage import { currentModalLang, loadModalI18n } from './i18n.js';
|
|
11
11
|
* @version-history
|
|
12
|
+
* v1.1.0 — 2026-08-12 — Spanish added; the language list is one array rather than four comparisons.
|
|
12
13
|
* v1.0.0 — 2026-07-19 — Extracted from src/routes/libs/auth-lib-part2.ts (SDK-libs migration Phase 3).
|
|
13
14
|
*/
|
|
14
15
|
import { NODE_URL } from './config.js';
|
|
15
16
|
|
|
16
17
|
export var MODAL_LANG_KEY = 'aimeat-lang';
|
|
17
18
|
|
|
19
|
+
/** The languages the node ships modal text in. Mirrors LOCALES in src/i18n.ts. */
|
|
20
|
+
export var MODAL_LANGS = ['en', 'fi', 'es'];
|
|
21
|
+
|
|
18
22
|
export function currentModalLang() {
|
|
19
23
|
try {
|
|
20
24
|
var u = new URLSearchParams(location.search).get('lang');
|
|
21
|
-
if (u
|
|
25
|
+
if (MODAL_LANGS.indexOf(u) !== -1) return u;
|
|
22
26
|
var s = localStorage.getItem(MODAL_LANG_KEY);
|
|
23
|
-
if (s
|
|
27
|
+
if (MODAL_LANGS.indexOf(s) !== -1) return s;
|
|
24
28
|
} catch { /* storage blocked */ }
|
|
25
|
-
|
|
29
|
+
var nav = (navigator.language || 'en').slice(0, 2).toLowerCase();
|
|
30
|
+
return MODAL_LANGS.indexOf(nav) !== -1 ? nav : 'en';
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
export function flattenModalI18n(obj, prefix, out) {
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* openEmailCompletion, sendEmailCode, showView, capture/restoreInputs }.
|
|
14
14
|
* @usage import { showLoginModal } from './modal.js';
|
|
15
15
|
* @version-history
|
|
16
|
+
* v1.3.0 — 2026-08-12 — The language switch is generated from MODAL_LANGS instead of two written-out
|
|
17
|
+
* buttons. Spanish arrived and the modal kept offering EN and FI while serving Spanish text.
|
|
16
18
|
* v1.0.0 — 2026-07-19 — Extracted from src/routes/libs/auth-lib-part2/3.ts (SDK-libs migration Phase 3).
|
|
17
19
|
* v1.0.1 — 2026-07-25 — Fix: adopt the node's full locale dict when any key differs, so newer modal
|
|
18
20
|
* keys (email-step strings) missing from a host's opts.i18n no longer fall back to English.
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
*/
|
|
27
29
|
import { auth, api } from './session.js';
|
|
28
30
|
import { escHtml } from './theme.js';
|
|
29
|
-
import { currentModalLang, loadModalI18n, MODAL_LANG_KEY } from './i18n.js';
|
|
31
|
+
import { currentModalLang, loadModalI18n, MODAL_LANG_KEY, MODAL_LANGS } from './i18n.js';
|
|
30
32
|
import { NODE_URL, NODE_ID, AUTH_PROVIDERS, PROVIDER_ICONS, EMAIL_REQUIRED } from './config.js';
|
|
31
33
|
|
|
32
34
|
/** An identifier is an email when it carries a dot-bearing domain. A GHII (`alice@node-id`) never
|
|
@@ -132,9 +134,15 @@ export function showLoginModal(opts, renderBtn) {
|
|
|
132
134
|
+ '<div style="position:fixed;inset:0;background:rgba(26,26,46,.4);backdrop-filter:blur(8px);display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;z-index:99999;font-family:DM Sans,system-ui,sans-serif;padding:24px">'
|
|
133
135
|
+ '<div style="background:#FFFFFF;border-radius:16px;max-width:420px;width:100%;margin:auto;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.05);' + (anim ? 'animation:aimeatModalIn .3s ease' : '') + '">'
|
|
134
136
|
+ '<div style="padding:28px 32px 0;position:relative">'
|
|
137
|
+
// One button per language the NODE ships, from MODAL_LANGS — the modal loads its strings from
|
|
138
|
+
// that node's /locales/<tag>.json, so the list of buttons and the list of files are the same
|
|
139
|
+
// list. Writing the languages out here is how the switch came to offer two while the node
|
|
140
|
+
// served three.
|
|
135
141
|
+ '<div class="aimeat-langsw">'
|
|
136
|
-
+
|
|
137
|
-
|
|
142
|
+
+ MODAL_LANGS.map(function (l) {
|
|
143
|
+
return '<button type="button" class="aimeat-lang' + (lang === l ? ' active' : '')
|
|
144
|
+
+ '" data-lang="' + l + '">' + l.toUpperCase() + '</button>';
|
|
145
|
+
}).join('')
|
|
138
146
|
+ '</div>'
|
|
139
147
|
+ '<h2 style="margin:0;font-size:22px;font-weight:800;display:flex;align-items:center;gap:8px;color:#1A1A2E">'
|
|
140
148
|
+ 'AIME <span style="width:28px;height:28px;border-radius:7px;background:linear-gradient(135deg,#E8564A,#D4493F);display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:14px">♥</span> AT'
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file auth/pill-strings.js
|
|
3
|
+
* @description The login pill's OWN labels, in the languages the node ships. The pill draws the
|
|
4
|
+
* language switch, so it is the one widget on the page that always knows which language the reader
|
|
5
|
+
* chose; before this it rendered "logged in / Logout" in English underneath a Spanish page, because
|
|
6
|
+
* the labels defaulted to English literals and only the SPA ever passed `opts.i18n`. Every app that
|
|
7
|
+
* declares `aimeat-locales` now gets the pill in the reader's language without passing anything.
|
|
8
|
+
*
|
|
9
|
+
* Why a table rather than a fetch: locales/en.json is 479 kB, and loading half a megabyte on every
|
|
10
|
+
* app page for eleven words is not a trade worth making. These eleven strings are the pill cluster's
|
|
11
|
+
* entire vocabulary.
|
|
12
|
+
*
|
|
13
|
+
* The English column matches `modal.*` in locales/en.json where a key exists there, EXCEPT
|
|
14
|
+
* `signInBtn`: the pill's button keeps the heart and the shorter wording it has always had, because
|
|
15
|
+
* it sits in a header row rather than in the modal. `federated`, `manageAccess` and `account` are
|
|
16
|
+
* pill-only and live here alone.
|
|
17
|
+
* @structure PILL_STRINGS (en/fi/es) · pillStrings(lang)
|
|
18
|
+
* @usage import { pillStrings } from './pill-strings.js';
|
|
19
|
+
* const i = Object.assign({}, pillStrings(lang), opts.i18n); // a caller's strings always win
|
|
20
|
+
* @version-history
|
|
21
|
+
* v1.0.0 — 2026-08-13 — Initial. Born from a Spanish CADENCE showing an English "Logout".
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export var PILL_STRINGS = {
|
|
25
|
+
en: {
|
|
26
|
+
loggedIn: 'logged in', logoutBtn: 'Logout', signInBtn: '❤️ Sign In', account: 'Account',
|
|
27
|
+
federated: 'Federated', manageAccess: 'Manage permissions',
|
|
28
|
+
lightMode: 'Light mode', darkMode: 'Dark mode', themeLabel: 'Theme',
|
|
29
|
+
chooseLook: 'Choose look', switchLanguage: 'Language',
|
|
30
|
+
},
|
|
31
|
+
fi: {
|
|
32
|
+
loggedIn: 'kirjautuneena', logoutBtn: 'Kirjaudu ulos', signInBtn: '❤️ Kirjaudu', account: 'Tili',
|
|
33
|
+
federated: 'Federoitu', manageAccess: 'Hallitse oikeuksia',
|
|
34
|
+
lightMode: 'Vaalea tila', darkMode: 'Tumma tila', themeLabel: 'Teema',
|
|
35
|
+
chooseLook: 'Valitse tyyli', switchLanguage: 'Kieli',
|
|
36
|
+
},
|
|
37
|
+
es: {
|
|
38
|
+
loggedIn: 'sesión iniciada', logoutBtn: 'Cerrar sesión', signInBtn: '❤️ Entrar', account: 'Cuenta',
|
|
39
|
+
federated: 'Federado', manageAccess: 'Gestionar permisos',
|
|
40
|
+
lightMode: 'Modo claro', darkMode: 'Modo oscuro', themeLabel: 'Tema',
|
|
41
|
+
chooseLook: 'Elige el aspecto', switchLanguage: 'Idioma',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** The pill's labels for one language, falling back to English per key. */
|
|
46
|
+
export function pillStrings(lang) {
|
|
47
|
+
var base = PILL_STRINGS.en;
|
|
48
|
+
var over = PILL_STRINGS[lang] || {};
|
|
49
|
+
var out = {};
|
|
50
|
+
for (var k in base) if (Object.prototype.hasOwnProperty.call(base, k)) out[k] = over[k] || base[k];
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
* @structure mountPill(auth, selector, opts) → render() + event wiring.
|
|
11
11
|
* @usage import { mountPill } from './pill.js'; (auth.mountLoginButton delegates here)
|
|
12
12
|
* @version-history
|
|
13
|
+
* v1.3.0 — 2026-08-13 — The pill speaks the reader's language on its own. It draws the language
|
|
14
|
+
* switch, so it always knows which language was chosen, yet its own labels fell back to English
|
|
15
|
+
* literals unless the host passed opts.i18n — which only the SPA did, so a Spanish CADENCE
|
|
16
|
+
* showed an English "Logout". Labels now come from pill-strings.js under whatever the caller
|
|
17
|
+
* passes, and the pill re-renders on 'aimeat-lang-change' so they follow its own switch.
|
|
13
18
|
* v1.2.0 — 2026-08-07 — The host's onLogout fires from the auth lib's 'logout' event (after the
|
|
14
19
|
* session is gone) instead of synchronously after the un-awaited logout() — the race that left
|
|
15
20
|
* hosts rendering a signed-in header next to a "Sign In" button.
|
|
@@ -21,7 +26,8 @@
|
|
|
21
26
|
import { isAppOrigin, restoreSessionFromAppOrigin } from './session.js';
|
|
22
27
|
import { showLoginModal } from './modal.js';
|
|
23
28
|
import { escHtml, modeSwitchHtml, wireModeSwitch, ensureAuthPillStyles, pillInitials } from './theme.js';
|
|
24
|
-
import { readLocales, langSwitchHtml, wireLangSwitch } from './locale.js';
|
|
29
|
+
import { readLocales, langSwitchHtml, wireLangSwitch, aimeatReadLang } from './locale.js';
|
|
30
|
+
import { pillStrings } from './pill-strings.js';
|
|
25
31
|
import { paletteControlHtml, wirePaletteControl } from './palette.js';
|
|
26
32
|
import { ensureClusterStyles, clampPopover } from './cluster.js';
|
|
27
33
|
import { load, remove } from './crypto.js';
|
|
@@ -42,14 +48,19 @@ export function mountPill(auth, selector, opts = {}) {
|
|
|
42
48
|
if (!container) { console.error('AIMEAT: mountLoginButton container not found for selector:', selector, '— pass a CSS selector string, a DOM element, or an options object.'); return; }
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
const i = opts.i18n || {};
|
|
46
51
|
// Languages the APP says it has: opts.locales, else <meta name="aimeat-locales" content="en fi">.
|
|
47
52
|
// Empty when the app declares none or only one, and then no language control renders at all.
|
|
48
53
|
const locales = readLocales(opts);
|
|
54
|
+
// The pill's own labels follow the reader's language. The caller's strings always win, so the SPA
|
|
55
|
+
// (which passes the node's full dictionary) is unaffected; an app that passes nothing stops
|
|
56
|
+
// getting an English "Logout" under a Spanish page. Recomputed per render, because the pill's own
|
|
57
|
+
// switch can change the language while the page is open.
|
|
58
|
+
let i = Object.assign({}, pillStrings(aimeatReadLang(locales.length ? locales : ['en'])), opts.i18n);
|
|
49
59
|
// Compact pill (account button + popover on ≤600px) is the mobile-safe DEFAULT on app origins.
|
|
50
60
|
const useCompact = opts.compact !== undefined ? !!opts.compact : isAppOrigin();
|
|
51
61
|
|
|
52
62
|
function render() {
|
|
63
|
+
i = Object.assign({}, pillStrings(aimeatReadLang(locales.length ? locales : ['en'])), opts.i18n);
|
|
53
64
|
// Prefer the live session (carries the H-2 _app/_own grant metadata) over the persisted copy.
|
|
54
65
|
const stored = auth.getSession() || load('session');
|
|
55
66
|
if (stored) {
|
|
@@ -149,6 +160,9 @@ export function mountPill(auth, selector, opts = {}) {
|
|
|
149
160
|
}
|
|
150
161
|
ensureClusterStyles();
|
|
151
162
|
render();
|
|
163
|
+
// The pill's own switch fires this, and so does an app that sets the language itself. Re-render so
|
|
164
|
+
// the pill's labels follow the language it just changed rather than staying in the old one.
|
|
165
|
+
window.addEventListener('aimeat-lang-change', render);
|
|
152
166
|
// Close any open cluster popover (palette / language list) on an outside click or Escape.
|
|
153
167
|
document.addEventListener('click', (ev) => {
|
|
154
168
|
container.querySelectorAll('.aimeat-pop-wrap.aimeat-open').forEach((w) => {
|
|
@@ -504,8 +504,37 @@
|
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
506
|
|
|
507
|
+
// locales/es.json
|
|
508
|
+
var aiLabel3 = {
|
|
509
|
+
short: "Generado por IA",
|
|
510
|
+
assisted: "Con ayuda de IA",
|
|
511
|
+
original: "Escrito por una persona",
|
|
512
|
+
unstated: "Origen sin declarar",
|
|
513
|
+
chat: "Estás hablando con un asistente de IA.",
|
|
514
|
+
publicText: "Este texto lo escribió una IA sin que ninguna persona lo revisara.",
|
|
515
|
+
assistedLong: "Lo escribió una persona. La IA ayudó a editarlo o a pulirlo.",
|
|
516
|
+
reviewedGeneric: "La IA escribió el borrador y una persona revisó el contenido.",
|
|
517
|
+
originalLong: "Lo escribió una persona. No intervino ninguna IA.",
|
|
518
|
+
unstatedLong: "No sabemos si intervino una IA en esto.",
|
|
519
|
+
reviewed: "Borrador de IA, revisado por {{name}}.",
|
|
520
|
+
detailsLink: "Cómo se hizo esto",
|
|
521
|
+
policyLong: "Un modelo intervino en esto. Este nodo lo declara incluso donde la ley no lo exige.",
|
|
522
|
+
interactionTitle: "Estás hablando con un asistente de IA",
|
|
523
|
+
interactionBody: "Puede equivocarse, así que comprueba todo lo que te importe. Tus mensajes van a un modelo de lenguaje con tu propia clave de API.",
|
|
524
|
+
draftTitle: "Este borrador lo escribió una IA",
|
|
525
|
+
draftBody: "Léelo antes de enviarlo. Lo que salga con tu nombre es responsabilidad tuya.",
|
|
526
|
+
regionLabel: "Transparencia sobre la IA",
|
|
527
|
+
expand: "Ver la declaración sobre la IA",
|
|
528
|
+
iconAlt: {
|
|
529
|
+
aiGenerated: "Contenido generado por IA",
|
|
530
|
+
aiModified: "Contenido modificado en parte por IA",
|
|
531
|
+
aiBasic: "Una IA intervino en la creación de este contenido",
|
|
532
|
+
unstated: "Intervención de la IA sin declarar"
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
|
|
507
536
|
// src/static/sdk-libs/ai/strings.js
|
|
508
|
-
var STRINGS2 = { en: aiLabel, fi: aiLabel2 };
|
|
537
|
+
var STRINGS2 = { en: aiLabel, fi: aiLabel2, es: aiLabel3 };
|
|
509
538
|
function pick(key, loc) {
|
|
510
539
|
const path = (key.startsWith("aiLabel.") ? key.slice("aiLabel.".length) : key).split(".");
|
|
511
540
|
for (const bundle of [STRINGS2[loc], STRINGS2.en]) {
|
|
@@ -323,15 +323,17 @@
|
|
|
323
323
|
|
|
324
324
|
// src/static/sdk-libs/auth/i18n.js
|
|
325
325
|
var MODAL_LANG_KEY = "aimeat-lang";
|
|
326
|
+
var MODAL_LANGS = ["en", "fi", "es"];
|
|
326
327
|
function currentModalLang() {
|
|
327
328
|
try {
|
|
328
329
|
var u = new URLSearchParams(location.search).get("lang");
|
|
329
|
-
if (u
|
|
330
|
+
if (MODAL_LANGS.indexOf(u) !== -1) return u;
|
|
330
331
|
var s = localStorage.getItem(MODAL_LANG_KEY);
|
|
331
|
-
if (s
|
|
332
|
+
if (MODAL_LANGS.indexOf(s) !== -1) return s;
|
|
332
333
|
} catch {
|
|
333
334
|
}
|
|
334
|
-
|
|
335
|
+
var nav = (navigator.language || "en").slice(0, 2).toLowerCase();
|
|
336
|
+
return MODAL_LANGS.indexOf(nav) !== -1 ? nav : "en";
|
|
335
337
|
}
|
|
336
338
|
function flattenModalI18n(obj, prefix, out) {
|
|
337
339
|
out = out || {};
|
|
@@ -450,7 +452,9 @@
|
|
|
450
452
|
});
|
|
451
453
|
function buildModalInner(i2, lang2, anim, tab2) {
|
|
452
454
|
var isReg = tab2 === "register";
|
|
453
|
-
return '<style>.aimeat-inp{width:100%;padding:11px 14px;border:1.5px solid #E5E7EB;border-radius:10px;font-family:DM Sans,system-ui,sans-serif;font-size:15px;color:#1A1A2E;background:#FAFAF8;box-sizing:border-box;transition:all .15s;outline:none}.aimeat-inp:focus{border-color:#E8564A;box-shadow:0 0 0 3px rgba(232,86,74,.1)}.aimeat-inp::placeholder{color:#9CA3AF}.aimeat-go{flex:1;padding:12px;background:linear-gradient(135deg,#E8564A,#D4493F);color:#fff;border:none;border-radius:10px;cursor:pointer;font-weight:700;font-size:15px;font-family:DM Sans,system-ui,sans-serif;box-shadow:0 2px 8px rgba(232,86,74,.25);transition:transform .15s,box-shadow .15s}.aimeat-go:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(232,86,74,.35)}.aimeat-label{display:block;margin-bottom:5px;font-size:12px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;color:#6B7280}.aimeat-cancel{padding:12px 20px;background:none;color:#1A1A2E;border:1px solid #E5E7EB;border-radius:10px;cursor:pointer;font-size:15px;font-weight:500;font-family:DM Sans,system-ui,sans-serif;transition:background .15s}.aimeat-cancel:hover{background:#F3F4F6}.aimeat-fi{width:20px;height:20px;border-radius:5px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;flex-shrink:0;margin-top:1px}.aimeat-langsw{position:absolute;top:24px;right:28px;display:flex;gap:5px}.aimeat-lang{padding:4px 9px;border:1px solid #E5E7EB;background:#fff;color:#6B7280;border-radius:7px;cursor:pointer;font-size:11px;font-weight:700;letter-spacing:.4px;line-height:1;font-family:DM Sans,system-ui,sans-serif;transition:all .15s}.aimeat-lang:hover{border-color:#E8564A;color:#E8564A}.aimeat-lang.active{background:#E8564A;color:#fff;border-color:#E8564A;cursor:default}.aimeat-tabs{display:flex;gap:0;margin:18px 0 0;border-bottom:1.5px solid #E5E7EB}.aimeat-tab{flex:1;padding:11px 8px;background:none;border:none;border-bottom:2.5px solid transparent;margin-bottom:-1.5px;cursor:pointer;font-family:DM Sans,system-ui,sans-serif;font-size:15px;font-weight:600;color:#6B7280;transition:color .15s,border-color .15s}.aimeat-tab:hover{color:#1A1A2E}.aimeat-tab.active{color:#E8564A;border-bottom-color:#E8564A;cursor:default}@keyframes aimeatModalIn{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}</style><div style="position:fixed;inset:0;background:rgba(26,26,46,.4);backdrop-filter:blur(8px);display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;z-index:99999;font-family:DM Sans,system-ui,sans-serif;padding:24px"><div style="background:#FFFFFF;border-radius:16px;max-width:420px;width:100%;margin:auto;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.05);' + (anim ? "animation:aimeatModalIn .3s ease" : "") + '"><div style="padding:28px 32px 0;position:relative"><div class="aimeat-langsw"
|
|
455
|
+
return '<style>.aimeat-inp{width:100%;padding:11px 14px;border:1.5px solid #E5E7EB;border-radius:10px;font-family:DM Sans,system-ui,sans-serif;font-size:15px;color:#1A1A2E;background:#FAFAF8;box-sizing:border-box;transition:all .15s;outline:none}.aimeat-inp:focus{border-color:#E8564A;box-shadow:0 0 0 3px rgba(232,86,74,.1)}.aimeat-inp::placeholder{color:#9CA3AF}.aimeat-go{flex:1;padding:12px;background:linear-gradient(135deg,#E8564A,#D4493F);color:#fff;border:none;border-radius:10px;cursor:pointer;font-weight:700;font-size:15px;font-family:DM Sans,system-ui,sans-serif;box-shadow:0 2px 8px rgba(232,86,74,.25);transition:transform .15s,box-shadow .15s}.aimeat-go:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(232,86,74,.35)}.aimeat-label{display:block;margin-bottom:5px;font-size:12px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;color:#6B7280}.aimeat-cancel{padding:12px 20px;background:none;color:#1A1A2E;border:1px solid #E5E7EB;border-radius:10px;cursor:pointer;font-size:15px;font-weight:500;font-family:DM Sans,system-ui,sans-serif;transition:background .15s}.aimeat-cancel:hover{background:#F3F4F6}.aimeat-fi{width:20px;height:20px;border-radius:5px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;flex-shrink:0;margin-top:1px}.aimeat-langsw{position:absolute;top:24px;right:28px;display:flex;gap:5px}.aimeat-lang{padding:4px 9px;border:1px solid #E5E7EB;background:#fff;color:#6B7280;border-radius:7px;cursor:pointer;font-size:11px;font-weight:700;letter-spacing:.4px;line-height:1;font-family:DM Sans,system-ui,sans-serif;transition:all .15s}.aimeat-lang:hover{border-color:#E8564A;color:#E8564A}.aimeat-lang.active{background:#E8564A;color:#fff;border-color:#E8564A;cursor:default}.aimeat-tabs{display:flex;gap:0;margin:18px 0 0;border-bottom:1.5px solid #E5E7EB}.aimeat-tab{flex:1;padding:11px 8px;background:none;border:none;border-bottom:2.5px solid transparent;margin-bottom:-1.5px;cursor:pointer;font-family:DM Sans,system-ui,sans-serif;font-size:15px;font-weight:600;color:#6B7280;transition:color .15s,border-color .15s}.aimeat-tab:hover{color:#1A1A2E}.aimeat-tab.active{color:#E8564A;border-bottom-color:#E8564A;cursor:default}@keyframes aimeatModalIn{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}</style><div style="position:fixed;inset:0;background:rgba(26,26,46,.4);backdrop-filter:blur(8px);display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;z-index:99999;font-family:DM Sans,system-ui,sans-serif;padding:24px"><div style="background:#FFFFFF;border-radius:16px;max-width:420px;width:100%;margin:auto;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.05);' + (anim ? "animation:aimeatModalIn .3s ease" : "") + '"><div style="padding:28px 32px 0;position:relative"><div class="aimeat-langsw">' + MODAL_LANGS.map(function(l) {
|
|
456
|
+
return '<button type="button" class="aimeat-lang' + (lang2 === l ? " active" : "") + '" data-lang="' + l + '">' + l.toUpperCase() + "</button>";
|
|
457
|
+
}).join("") + '</div><h2 style="margin:0;font-size:22px;font-weight:800;display:flex;align-items:center;gap:8px;color:#1A1A2E">AIME <span style="width:28px;height:28px;border-radius:7px;background:linear-gradient(135deg,#E8564A,#D4493F);display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:14px">♥</span> AT</h2><p style="margin:8px 0 0;font-size:14px;color:#6B7280;line-height:1.5">' + escHtml(isReg ? i2.descNew || "Pick a username and password to create an account." : i2.descReturning || "Enter the username or email you signed up with.") + '</p><div class="aimeat-tabs" role="tablist"><button type="button" role="tab" class="aimeat-tab' + (isReg ? "" : " active") + '" data-tab="signin" aria-selected="' + (isReg ? "false" : "true") + '">' + escHtml(i2.tabSignIn || "Sign in") + '</button><button type="button" role="tab" class="aimeat-tab' + (isReg ? " active" : "") + '" data-tab="register" aria-selected="' + (isReg ? "true" : "false") + '">' + escHtml(i2.tabRegister || "Create account") + '</button></div></div><div id="aimeat-modal-body" style="padding:24px 32px"><div id="aimeat-tab-signin" style="' + (isReg ? "display:none" : "") + '"><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.identifierLabel || "Username or email") + '</label><input id="aimeat-username" class="aimeat-inp" autocomplete="username" placeholder="' + escHtml(i2.identifierPlaceholder || "Username or email") + '"></div><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.passwordLabel || "Password") + '</label><input id="aimeat-password" type="password" autocomplete="current-password" class="aimeat-inp" placeholder="' + escHtml(i2.passwordPlaceholder || "Password") + '"></div><div style="display:flex;gap:10px;margin-top:20px"><button id="aimeat-go-btn" class="aimeat-go">' + escHtml(i2.signInOnlyBtn || "Sign in") + '</button><button id="aimeat-cancel-btn" class="aimeat-cancel">' + escHtml(i2.cancelBtn || "Cancel") + '</button></div><p id="aimeat-error" style="margin:8px 0 0;font-size:13px;color:#ef4444;display:none"></p><div style="margin-top:14px;display:flex;gap:16px"><a href="#" id="aimeat-forgot-pw" style="font-size:13px;color:#6B7280;cursor:pointer;text-decoration:underline">' + escHtml(i2.forgotPassword || "Forgot password?") + '</a><a href="#" id="aimeat-forgot-user" style="font-size:13px;color:#6B7280;cursor:pointer;text-decoration:underline">' + escHtml(i2.forgotUsername || "Forgot username?") + '</a></div></div><div id="aimeat-tab-register" style="' + (isReg ? "" : "display:none") + '"><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.usernameLabel || "Username") + '</label><input id="aimeat-reg-username" class="aimeat-inp" autocomplete="username" placeholder="' + escHtml(i2.usernamePlaceholder || "Username") + '"><p style="margin:5px 0 0;font-size:12px;color:#9CA3AF">' + escHtml(i2.usernameHint || "This becomes your permanent identity on this node.") + "</p></div>" + (EMAIL_REQUIRED ? '<div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.emailLabel || "Email") + '</label><input id="aimeat-reg-email" type="email" autocomplete="email" class="aimeat-inp" placeholder="you@example.com"><p style="margin:5px 0 0;font-size:12px;color:#9CA3AF">' + escHtml(i2.registerEmailHint || "We send a 6-digit code here to confirm the address. You can sign in with it later.") + "</p></div>" : "") + '<div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.passwordLabel || "Password") + '</label><input id="aimeat-reg-password" type="password" autocomplete="new-password" class="aimeat-inp" placeholder="' + escHtml(i2.passwordPlaceholder || "Password (min 8 chars)") + '"></div><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.displayNameLabel || "Display Name") + ' <span style="font-weight:400;text-transform:none;letter-spacing:0">(' + escHtml(i2.displayNameOptional || "optional") + ')</span></label><input id="aimeat-reg-displayname" class="aimeat-inp" placeholder="' + escHtml(i2.displayNamePlaceholder || "Display Name") + '"></div><div style="display:flex;gap:10px;margin-top:20px"><button id="aimeat-reg-btn" class="aimeat-go">' + escHtml(i2.createAccountBtn || "Create account") + '</button><button id="aimeat-reg-cancel-btn" class="aimeat-cancel">' + escHtml(i2.cancelBtn || "Cancel") + '</button></div><p id="aimeat-reg-error" style="margin:8px 0 0;font-size:13px;color:#ef4444;display:none"></p></div>' + (AUTH_PROVIDERS.length ? '<div style="display:flex;align-items:center;gap:12px;margin:18px 0 14px;color:#9CA3AF;font-size:12px;font-weight:600;letter-spacing:.5px"><span style="flex:1;height:1px;background:#E5E7EB"></span>' + escHtml(i2.orLabel || "OR") + '<span style="flex:1;height:1px;background:#E5E7EB"></span></div>' + AUTH_PROVIDERS.map(function(p) {
|
|
454
458
|
return '<button type="button" class="aimeat-oauth-btn" data-provider="' + escHtml(p.id) + '" style="width:100%;display:flex;align-items:center;justify-content:center;gap:10px;padding:11px;margin-bottom:8px;background:#fff;color:#1A1A2E;border:1.5px solid #E5E7EB;border-radius:10px;cursor:pointer;font-weight:600;font-size:15px;font-family:DM Sans,system-ui,sans-serif;transition:background .15s,border-color .15s">' + (PROVIDER_ICONS[p.id] || "") + escHtml(i2[p.i18nKey] || p.label) + "</button>";
|
|
455
459
|
}).join("") : "") + '</div><div id="aimeat-forgot-pw-view" style="padding:24px 32px;display:none"><div id="aimeat-fpw-step1"><h3 style="margin:0 0 8px;font-size:17px;font-weight:700;color:#1A1A2E">' + escHtml(i2.resetPasswordTitle || "Reset Password") + '</h3><p style="font-size:13px;color:#6B7280;margin-bottom:14px">' + escHtml(i2.resetPasswordDesc || "Enter your username to receive a reset code by email.") + '</p><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.usernameLabel || "Username") + '</label><input id="aimeat-fpw-username" class="aimeat-inp" placeholder="' + escHtml(i2.usernamePlaceholder || "Username") + '"></div><div style="display:flex;gap:10px"><button id="aimeat-fpw-send" class="aimeat-go">' + escHtml(i2.sendResetCode || "Send Reset Code") + '</button><button id="aimeat-fpw-back" class="aimeat-cancel">' + escHtml(i2.backToLogin || "Back to Login") + '</button></div><p id="aimeat-fpw-msg" style="margin:8px 0 0;font-size:13px;color:#22C55E;display:none"></p><p id="aimeat-fpw-err" style="margin:8px 0 0;font-size:13px;color:#ef4444;display:none"></p></div><div id="aimeat-fpw-step2" style="display:none"><h3 style="margin:0 0 8px;font-size:17px;font-weight:700;color:#1A1A2E">' + escHtml(i2.enterNewPasswordTitle || "Enter New Password") + '</h3><p style="font-size:13px;color:#6B7280;margin-bottom:14px">' + escHtml(i2.resetCodeSent || "A reset code was sent to your email. Enter it below with your new password.") + '</p><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.codeLabel || "Reset Code") + '</label><input id="aimeat-fpw-code" class="aimeat-inp" placeholder="123456" maxlength="6"></div><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.newPasswordLabel || "New Password") + '</label><input id="aimeat-fpw-newpass" type="password" class="aimeat-inp" placeholder="' + escHtml(i2.newPasswordPlaceholder || "New password (min 8 chars)") + '"></div><div style="display:flex;gap:10px"><button id="aimeat-fpw-reset" class="aimeat-go">' + escHtml(i2.resetPassword || "Reset Password") + '</button><button id="aimeat-fpw-back2" class="aimeat-cancel">' + escHtml(i2.backToLogin || "Back to Login") + '</button></div><p id="aimeat-fpw-msg2" style="margin:8px 0 0;font-size:13px;color:#22C55E;display:none"></p><p id="aimeat-fpw-err2" style="margin:8px 0 0;font-size:13px;color:#ef4444;display:none"></p></div></div><div id="aimeat-forgot-user-view" style="padding:24px 32px;display:none"><h3 style="margin:0 0 8px;font-size:17px;font-weight:700;color:#1A1A2E">' + escHtml(i2.recoverUsernameTitle || "Recover Username") + '</h3><p style="font-size:13px;color:#6B7280;margin-bottom:14px">' + escHtml(i2.recoverUsernameDesc || "Enter the email address associated with your account.") + '</p><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.emailLabel || "Email") + '</label><input id="aimeat-fu-email" class="aimeat-inp" type="email" placeholder="you@example.com"></div><div style="display:flex;gap:10px"><button id="aimeat-fu-send" class="aimeat-go">' + escHtml(i2.sendUsername || "Send My Username") + '</button><button id="aimeat-fu-back" class="aimeat-cancel">' + escHtml(i2.backToLogin || "Back to Login") + '</button></div><p id="aimeat-fu-msg" style="margin:8px 0 0;font-size:13px;color:#22C55E;display:none"></p></div><div id="aimeat-email-view" style="padding:24px 32px;display:none"><div id="aimeat-em-step1"><h3 style="margin:0 0 8px;font-size:17px;font-weight:700;color:#1A1A2E">' + escHtml(i2.completeAccountTitle || "One last step") + '</h3><p style="font-size:13px;color:#6B7280;margin-bottom:14px">' + escHtml(i2.completeAccountDesc || "Add an email to finish setting up your account. We’ll send a verification code to confirm it.") + '</p><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.emailLabel || "Email") + '</label><input id="aimeat-em-email" class="aimeat-inp" type="email" placeholder="you@example.com"></div><div style="display:flex;gap:10px"><button id="aimeat-em-send" class="aimeat-go">' + escHtml(i2.sendVerificationCode || "Send Verification Code") + '</button><button id="aimeat-em-back" class="aimeat-cancel">' + escHtml(i2.backToLogin || "Back to Login") + '</button></div><p id="aimeat-em-err" style="margin:8px 0 0;font-size:13px;color:#ef4444;display:none"></p></div><div id="aimeat-em-step2" style="display:none"><h3 style="margin:0 0 8px;font-size:17px;font-weight:700;color:#1A1A2E">' + escHtml(i2.enterCodeTitle || "Enter Verification Code") + '</h3><p style="font-size:13px;color:#6B7280;margin-bottom:14px">' + escHtml(i2.enterCodeDesc || "We sent a 6-digit code to your email. Enter it below to finish and sign in.") + '</p><div style="margin-bottom:14px"><label class="aimeat-label">' + escHtml(i2.codeLabel || "Verification Code") + '</label><input id="aimeat-em-code" class="aimeat-inp" placeholder="123456" maxlength="6" inputmode="numeric"></div><div style="display:flex;gap:10px"><button id="aimeat-em-confirm" class="aimeat-go">' + escHtml(i2.confirmAndSignIn || "Confirm & Sign In") + '</button><button id="aimeat-em-back2" class="aimeat-cancel">' + escHtml(i2.backToLogin || "Back to Login") + '</button></div><p id="aimeat-em-msg2" style="margin:8px 0 0;font-size:13px;color:#22C55E;display:none"></p><p id="aimeat-em-err2" style="margin:8px 0 0;font-size:13px;color:#ef4444;display:none"></p></div></div><div id="aimeat-why" style="padding:20px 32px 28px;background:#F9FAFB;border-top:1px solid #E5E7EB;' + (isReg ? "" : "display:none") + '"><h4 style="margin:0 0 12px;font-size:13px;font-weight:700;color:#1A1A2E;display:flex;align-items:center;gap:6px">' + escHtml(i2.whyTitle || "What do you get?") + '</h4><div style="display:flex;align-items:flex-start;gap:10px;font-size:13.5px;color:#6B7280;margin-bottom:8px;line-height:1.45"><div class="aimeat-fi" style="background:#FFF1F0;color:#E8564A">♥</div><span>' + escHtml(i2.whyGhii || "A free GHII (Global Human Intelligence Identifier), your personal AI identity") + '</span></div><div style="display:flex;align-items:flex-start;gap:10px;font-size:13.5px;color:#6B7280;margin-bottom:8px;line-height:1.45"><div class="aimeat-fi" style="background:#EFF6FF;color:#3B82F6">🔒</div><span>' + escHtml(i2.whyPrivacy || "Your own private memory space, protected by your password") + '</span></div><div style="display:flex;align-items:flex-start;gap:10px;font-size:13.5px;color:#6B7280;margin-bottom:8px;line-height:1.45"><div class="aimeat-fi" style="background:#F0FDF4;color:#22C55E">🤖</div><span>' + escHtml(i2.whyAgents || "Connect AI agents that remember you and work on your behalf") + '</span></div><div style="display:flex;align-items:flex-start;gap:10px;font-size:13.5px;color:#6B7280;line-height:1.45"><div class="aimeat-fi" style="background:#FFF1F0;color:#E8564A">♥</div><span><strong>' + escHtml(i2.whyMorsels || "Your own AI-built apps and agents work for you — a digital agency under your own roof.") + "</strong></span></div></div></div></div>";
|
|
456
460
|
}
|
|
@@ -1052,6 +1056,56 @@
|
|
|
1052
1056
|
});
|
|
1053
1057
|
}
|
|
1054
1058
|
|
|
1059
|
+
// src/static/sdk-libs/auth/pill-strings.js
|
|
1060
|
+
var PILL_STRINGS = {
|
|
1061
|
+
en: {
|
|
1062
|
+
loggedIn: "logged in",
|
|
1063
|
+
logoutBtn: "Logout",
|
|
1064
|
+
signInBtn: "❤️ Sign In",
|
|
1065
|
+
account: "Account",
|
|
1066
|
+
federated: "Federated",
|
|
1067
|
+
manageAccess: "Manage permissions",
|
|
1068
|
+
lightMode: "Light mode",
|
|
1069
|
+
darkMode: "Dark mode",
|
|
1070
|
+
themeLabel: "Theme",
|
|
1071
|
+
chooseLook: "Choose look",
|
|
1072
|
+
switchLanguage: "Language"
|
|
1073
|
+
},
|
|
1074
|
+
fi: {
|
|
1075
|
+
loggedIn: "kirjautuneena",
|
|
1076
|
+
logoutBtn: "Kirjaudu ulos",
|
|
1077
|
+
signInBtn: "❤️ Kirjaudu",
|
|
1078
|
+
account: "Tili",
|
|
1079
|
+
federated: "Federoitu",
|
|
1080
|
+
manageAccess: "Hallitse oikeuksia",
|
|
1081
|
+
lightMode: "Vaalea tila",
|
|
1082
|
+
darkMode: "Tumma tila",
|
|
1083
|
+
themeLabel: "Teema",
|
|
1084
|
+
chooseLook: "Valitse tyyli",
|
|
1085
|
+
switchLanguage: "Kieli"
|
|
1086
|
+
},
|
|
1087
|
+
es: {
|
|
1088
|
+
loggedIn: "sesión iniciada",
|
|
1089
|
+
logoutBtn: "Cerrar sesión",
|
|
1090
|
+
signInBtn: "❤️ Entrar",
|
|
1091
|
+
account: "Cuenta",
|
|
1092
|
+
federated: "Federado",
|
|
1093
|
+
manageAccess: "Gestionar permisos",
|
|
1094
|
+
lightMode: "Modo claro",
|
|
1095
|
+
darkMode: "Modo oscuro",
|
|
1096
|
+
themeLabel: "Tema",
|
|
1097
|
+
chooseLook: "Elige el aspecto",
|
|
1098
|
+
switchLanguage: "Idioma"
|
|
1099
|
+
}
|
|
1100
|
+
};
|
|
1101
|
+
function pillStrings(lang) {
|
|
1102
|
+
var base = PILL_STRINGS.en;
|
|
1103
|
+
var over = PILL_STRINGS[lang] || {};
|
|
1104
|
+
var out = {};
|
|
1105
|
+
for (var k in base) if (Object.prototype.hasOwnProperty.call(base, k)) out[k] = over[k] || base[k];
|
|
1106
|
+
return out;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1055
1109
|
// src/static/sdk-libs/auth/palette.js
|
|
1056
1110
|
var AIMEAT_PALETTE_KEY = "aimeat-palette";
|
|
1057
1111
|
var PALETTES = [
|
|
@@ -1216,10 +1270,11 @@
|
|
|
1216
1270
|
return;
|
|
1217
1271
|
}
|
|
1218
1272
|
}
|
|
1219
|
-
const i = opts.i18n || {};
|
|
1220
1273
|
const locales = readLocales(opts);
|
|
1274
|
+
let i = Object.assign({}, pillStrings(aimeatReadLang(locales.length ? locales : ["en"])), opts.i18n);
|
|
1221
1275
|
const useCompact = opts.compact !== void 0 ? !!opts.compact : isAppOrigin();
|
|
1222
1276
|
function render() {
|
|
1277
|
+
i = Object.assign({}, pillStrings(aimeatReadLang(locales.length ? locales : ["en"])), opts.i18n);
|
|
1223
1278
|
const stored = auth2.getSession() || load("session");
|
|
1224
1279
|
if (stored) {
|
|
1225
1280
|
var pillHtml = '<div class="aimeat-auth-pill" style="display:inline-flex;align-items:center;gap:10px;padding:8px 18px;background:linear-gradient(160deg,#3d2e1a 0%,#6b4c2a 15%,#c9a84c 30%,#f5e6a3 45%,#c9a84c 55%,#8b6914 70%,#4a3520 100%);border:1px solid rgba(201,168,76,.6);border-top-color:rgba(245,230,163,.5);border-bottom-color:rgba(75,53,32,.8);border-radius:10px;box-shadow:0 1px 0 rgba(245,230,163,.3) inset,0 -1px 0 rgba(75,53,32,.5) inset,0 3px 10px rgba(0,0,0,.4),0 0 20px rgba(201,168,76,.15);font-family:system-ui;font-size:14px"><span class="aimeat-auth-dot" style="display:inline-block;flex:0 0 auto;width:9px;height:9px;border-radius:50%;background:radial-gradient(circle at 35% 35%,#b0ffc8,#00c853 40%,#00802e 80%,#003d15);box-shadow:0 0 5px rgba(0,200,83,.7),0 0 12px rgba(0,200,83,.3),inset 0 -1px 2px rgba(0,0,0,.3)"></span><span class="aimeat-auth-label" style="display:inline-flex;align-items:center;font-size:12px;font-weight:600;letter-spacing:.5px;color:#a0ffb8;text-shadow:0 0 4px rgba(0,210,80,.6),0 0 10px rgba(0,180,70,.3)">' + escHtml(i.loggedIn || "logged in") + '</span><span class="aimeat-auth-ghii" style="color:rgba(90,65,20,.7);font-weight:700;letter-spacing:.5px;font-size:13px;text-shadow:0 1px 0 rgba(245,230,163,.6),0 -1px 0 rgba(50,35,10,.3);-webkit-text-stroke:.2px rgba(120,85,20,.3)">' + escHtml(stored.displayName || stored.ghii || stored.owner) + "</span>" + (stored.federated ? '<span style="display:inline-flex;align-items:center;gap:3px;font-size:10px;font-weight:700;letter-spacing:.5px;color:#7dd3fc;background:rgba(56,189,248,.15);padding:2px 6px;border-radius:4px;border:1px solid rgba(56,189,248,.3)">🌐 ' + escHtml(i.federated || "Federated") + "</span>" : "") + (stored._appOrigin && stored._app && !stored._own ? '<button id="aimeat-grant-gear" title="' + escHtml(i.manageAccess || "Manage permissions") + '" aria-label="' + escHtml(i.manageAccess || "Manage permissions") + '" style="background:rgba(90,65,20,.18);color:#5a4114;border:1px solid rgba(120,85,20,.35);border-radius:6px;padding:3px 8px;cursor:pointer;font-size:13px;line-height:1">⚙️</button>' : "") + '<span class="aimeat-ctl">' + langSwitchHtml(i, locales) + modeSwitchHtml(i) + paletteControlHtml(i) + '</span><button id="aimeat-logout-btn" class="aimeat-auth-logout" style="background:radial-gradient(ellipse at 50% 30%,#ff6b6b 0%,#dc2626 35%,#991b1b 70%,#7f1d1d 100%);color:#ffd7d7;border:1px solid rgba(220,38,38,.6);border-top-color:rgba(255,130,130,.4);border-bottom-color:rgba(100,20,20,.8);border-radius:6px;padding:3px 10px;cursor:pointer;font-size:11px;font-weight:700;letter-spacing:.3px;box-shadow:0 1px 0 rgba(255,140,140,.25) inset,0 -1px 0 rgba(80,10,10,.4) inset,0 2px 6px rgba(153,27,27,.5);text-shadow:0 1px 1px rgba(0,0,0,.4)">' + escHtml(i.logoutBtn || "Logout") + "</button></div>";
|
|
@@ -1267,6 +1322,7 @@
|
|
|
1267
1322
|
}
|
|
1268
1323
|
ensureClusterStyles();
|
|
1269
1324
|
render();
|
|
1325
|
+
window.addEventListener("aimeat-lang-change", render);
|
|
1270
1326
|
document.addEventListener("click", (ev) => {
|
|
1271
1327
|
container.querySelectorAll(".aimeat-pop-wrap.aimeat-open").forEach((w) => {
|
|
1272
1328
|
if (!w.contains(
|
|
@@ -230,9 +230,39 @@
|
|
|
230
230
|
morsels: "morselia",
|
|
231
231
|
target: "Tavoite {n}",
|
|
232
232
|
fix: "Korjaa tämä"
|
|
233
|
+
},
|
|
234
|
+
es: {
|
|
235
|
+
close: "Cerrar",
|
|
236
|
+
back: "Atrás",
|
|
237
|
+
cancel: "Cancelar",
|
|
238
|
+
confirm: "Confirmar",
|
|
239
|
+
menu: "Menú",
|
|
240
|
+
locked: "Bloqueado",
|
|
241
|
+
done: "Listo",
|
|
242
|
+
open: "Abierto",
|
|
243
|
+
now: "Ahora",
|
|
244
|
+
later: "Después",
|
|
245
|
+
comingSoon: "Próximamente",
|
|
246
|
+
notifyMe: "Avísame cuando abra",
|
|
247
|
+
notified: "Te avisamos",
|
|
248
|
+
eta: "Previsto {when}",
|
|
249
|
+
empty: "Aquí todavía no hay nada",
|
|
250
|
+
nobodyYet: "Todavía no hay nadie en la tabla: el primero pone la marca",
|
|
251
|
+
you: "Tú",
|
|
252
|
+
total: "Total",
|
|
253
|
+
points: "{a} / {b}",
|
|
254
|
+
earned: "Conseguido",
|
|
255
|
+
notEarned: "Todavía sin conseguir",
|
|
256
|
+
earnedOn: "Conseguido {when}",
|
|
257
|
+
best: "Mejor {n}",
|
|
258
|
+
inARow: "{n} seguidos",
|
|
259
|
+
sortBy: "Ordenar por",
|
|
260
|
+
morsels: "morsels",
|
|
261
|
+
target: "Objetivo {n}",
|
|
262
|
+
fix: "Corrige esto"
|
|
233
263
|
}
|
|
234
264
|
};
|
|
235
|
-
var HOST = { en: {}, fi: {} };
|
|
265
|
+
var HOST = { en: {}, fi: {}, es: {} };
|
|
236
266
|
var listeners = [];
|
|
237
267
|
var current = detect();
|
|
238
268
|
function detect() {
|
|
@@ -273,7 +303,7 @@
|
|
|
273
303
|
}
|
|
274
304
|
var i18n = {
|
|
275
305
|
/** The languages the kit itself ships. A host may add more via `use()`. */
|
|
276
|
-
langs: ["en", "fi"],
|
|
306
|
+
langs: ["en", "fi", "es"],
|
|
277
307
|
/** The language in force right now. @returns {string} */
|
|
278
308
|
lang() {
|
|
279
309
|
return current;
|