@joryio/web-sdk 1.4.0-beta.5 → 1.4.0-beta.6

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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## 1.4.0 - 2026-11-18
4
4
 
5
+ Changed (1.4.0-beta.6): the on-site Web personalization editor (`joryio-editor.min.js`) is redesigned (Joryio BACKLOG D444, design handoff screens 1-3). All of its UI is in one closed shadow root on an `all: initial` host, so the site's CSS cannot restyle it and its CSS cannot reach the site; the previews it puts in the page are custom elements with their own shadow roots (never a `div`, so the site's `:nth-of-type` selectors do not move). Hover shows a dashed outline with a label ("Heading · h1"); a click selects (it never reaches the site); arrow up / down, two buttons and a breadcrumb ("Page › Main › Heading") move to the element around it or the first one inside it. A light side panel names the element and how many elements its selector matches (1 match / "Matches N - all will change" / Not found) and offers Change text, Change link (off with "Not a link"), Change image (images only, `replace_image`), Hide it and Add content slot (`insert_placement`, Above it / Below it / Instead of it = position `replace` / inside at the start or end), each with its own field: the new text with "Was:", Insert chips for profile fields (`{{ user.firstName }}`, the dashboard's format) and "If a value is missing" (the `| default:`); the address; the slot name, turned into a placement key as typed ("after blog" -> `after_blog`, never refused). A collapsible CSS selector field for developers. Every edit shows live on the page while editing, with the dashboard's sample values for the variables, else their fallbacks; text is set as text, addresses must be http(s), and the original nodes come back on cancel, undo and stop. A dock shows campaign, variant and page, "N edits" (a click jumps to that edit), Undo and "Save & return to Joryio" (Esc still finishes). New messages with the dashboard, all origin- and window-checked: `joryio:editor-context` (dashboard -> editor: campaign and variant names, the variant's edits, profile fields, placements, sample values, translated words and `dir`), `joryio:editor-focus` `{ id }` (jump to an edit), `joryio:editor-remove` `{ id }` (Undo of a new edit) and `joryio:editor-done`; `joryio:editor-pick` now carries the edit's `id` (an id the dashboard has replaces that edit). A dashboard that sends no context works as before, with Undo off. The editor's words are English unless the dashboard sends its translations. `joryio-editor.min.js` 13127 bytes gzip, budget raised from 3500 to 14000 (loaded only in a tab the dashboard opened for the editor; no visitor downloads it). Web only: iOS, Android, React Native and Unity are not applicable - the editor edits a web page in a browser tab.
6
+
7
+ Fixed (1.4.0-beta.6): a beta reports its own version. The release build writes the beta (`1.4.0-beta.6`) into `SDK_VERSION` of the published copy, not only into `package.json`: the beta sends it in `X-Joryio-SDK-Version`, and its side files (`joryio-cards-ui.min.js`, `joryio-editor.min.js`) are loaded from `sdk.joryio.com/web/1.4.0-beta.6/`. Before, a beta said `1.4.0`, so an npm beta (bundled into the site, or loaded from a CDN that is not sdk.joryio.com) asked `web/1.4.0/` and `web/1/` - neither exists for a beta - and the card feed showed `unavailable`. A pre-release never falls back to the major channel `web/<major>/` (it holds finals only); a final keeps it as the last resort. The source keeps saying `1.4.0`. The same fix on iOS, Android, React Native and Unity.
8
+
9
+ Added (1.4.0-beta.6): page-edit position `replace` - "Instead of it" (Joryio BACKLOG D444, from main, PR #876). An `insert_placement` edit at `replace` hides the chosen element (`display: none !important`, as `hide` does) and puts the placement spot right after it, so the placement takes the element's place; undoing it (destroy, a route change, an answer that no longer carries it) removes the spot and shows the element as it was. A store plugin may write it into the page's HTML too (server-side page edits, D450): the SDK keeps it when the answer carries it, and undoes both parts - the spot, and the hide with the same rule as a server-written `hide` - when it does not. A build before this one reads `replace` as `after` (the element stays visible, the spot goes after it). Web only: iOS, Android, React Native and Unity are not applicable - page edits change a web page's DOM.
10
+
5
11
  Changed (1.4.0-beta.5): one subscription type for every listener, the same on all five SDKs (Joryio BACKLOG D444 / D446, owner decisions 2026-11-23). `onCardsUpdated`, `onPlacementsUpdated` and `onFlagsUpdated` return a `JoryioSubscription` (new exported type): `cancel()` stops the updates - the same type name and method on iOS, Android, React Native and Unity (`JoryioSubscription.Cancel()`). It can still be called, `sub()` being `sub.cancel()`, so code that called the returned function keeps working. Cancelling twice is harmless, and the same callback subscribed twice now counts as two subscriptions. Neither placements, flags nor cards are in a final release (none of the three listeners exists in 1.3.3), so the breaking renames are made now. No wire changes.
6
12
 
7
13
  Changed (1.4.0-beta.4): the page-edit site settings (`GET /v1/in-app/site-settings`) are asked once per SDK session instead of once per page load. The answer is kept in `sessionStorage`, per workspace (`jry_page_edit_site_<hash>`, the SDK-key hash of the other page-edit stores), tied to the session id - a new session asks again - and refreshed at most every `SITE_SETTINGS_SESSION_REFRESH_SECONDS` (600, new export) within the session; the server's `ttlSeconds` (60, the browser and CDN cache lifetime) no longer shortens that. With a stored answer a page no longer waits for the site settings before asking for its edits: the stored answer is used at once and refreshed in the background when it is 10 minutes old (if that refresh finds a newly live campaign, the page asks for its edits then). What this means for marketers: a page-edit campaign launched while a visitor is on the site reaches that visitor within 10 minutes (on a new session at once); pausing is not delayed, because `/v1/in-app/page-edits` checks every campaign's liveness on every page. A failed request is still "unknown": nothing is stored, the page asks `/v1/in-app/page-edits` as before, and a failed background refresh drops the stale answer. `reset()`, `resetTo()`, `wipeData()` and every consent change remove the stored answer, as the other per-workspace stores; `identify()` keeps it - it is the same for every visitor. No wire changes. Web only: iOS, Android, React Native and Unity are not applicable - page edits are a browser concept (no DOM, no page loads in an app screen).
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "1.4.0";
1
+ export declare const SDK_VERSION = "1.4.0-beta.6";
2
2
  export declare const SDK_PLATFORM_HEADER = "X-Joryio-SDK";
3
3
  export declare const SDK_VERSION_HEADER = "X-Joryio-SDK-Version";
4
4
  export declare const SDK_PLATFORM = "web";
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,UAAU,CAAC;AAUnC,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE3D;AACD,eAAO,MAAM,oBAA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,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;CACpE;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AA6CD,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,cAAc,CA+FhE"}
@@ -5,7 +5,7 @@ import type { InAppAuthProvider } from './inapp';
5
5
  import type { PlacementConsent } from './placements';
6
6
  import { type PageContextTracker } from './page-context';
7
7
  export declare const PAGE_EDIT_OPERATIONS: readonly ["replace_text", "replace_image", "replace_link", "hide", "insert_placement"];
8
- export declare const PAGE_EDIT_POSITIONS: readonly ["before", "after", "prepend", "append"];
8
+ export declare const PAGE_EDIT_POSITIONS: readonly ["before", "after", "prepend", "append", "replace"];
9
9
  export declare const PAGE_EDITS_CAPABILITY = "page_edits";
10
10
  export declare const PAGE_EDIT_ANTI_FLICKER_MS = 300;
11
11
  export declare const pageEditsStorageKeys: (sdkKey: string) => {
@@ -1 +1 @@
1
- {"version":3,"file":"page-edits.d.ts","sourceRoot":"","sources":["../../src/core/page-edits.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAA2C,KAAK,k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AO,CAAC,aAAa;IAQrB,OAAO,CAAC,IAAI;CAmBb"}
@@ -1,5 +1,5 @@
1
1
  export declare const SDK_HOST = "https://sdk.joryio.com";
2
2
  export declare function coreFolderOf(src: string | null | undefined): string | null;
3
- export declare function sdkHostFileUrls(file: string, override?: string, ownFolder?: string | null): string[];
3
+ export declare function sdkHostFileUrls(file: string, override?: string, ownFolder?: string | null, version?: string): string[];
4
4
  export declare function loadSdkScript(src: string, marker: string): Promise<void>;
5
5
  //# sourceMappingURL=sdk-host-files.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-host-files.d.ts","sourceRoot":"","sources":["../../src/core/sdk-host-files.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ,2BAA2B,CAAC;AAWjD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAU1E;AAuCD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,MAAM,GAAG,IAAiB,GAAG,MAAM,EAAE,CAOhH;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxE"}
1
+ {"version":3,"file":"sdk-host-files.d.ts","sourceRoot":"","sources":["../../src/core/sdk-host-files.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ,2BAA2B,CAAC;AAWjD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAU1E;AA0CD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,MAAM,GAAG,IAAiB,EAAE,OAAO,GAAE,MAAoB,GAAG,MAAM,EAAE,CAS/I;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxE"}
@@ -0,0 +1,13 @@
1
+ import type { EditorStringKey } from './editor-strings';
2
+ export declare function liquidOutputs(value: string): Array<{
3
+ expr: string;
4
+ fallback: string | null;
5
+ }>;
6
+ export declare function textFallback(value: string): string | null;
7
+ export declare function setTextFallback(value: string, fallback: string): string;
8
+ export declare function variableTag(name: string, custom: boolean, fallback?: string | null): string;
9
+ export declare function previewText(value: string, sample: Record<string, string>): string;
10
+ export declare function slugify(name: string): string;
11
+ export declare const newEditId: () => string;
12
+ export declare function kindKey(tagOrSelector: string, isSelector?: boolean): EditorStringKey;
13
+ //# sourceMappingURL=editor-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-model.d.ts","sourceRoot":"","sources":["../../src/editor/editor-model.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAOxD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAU7F;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKzD;AAKD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKvE;AAGD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAG3F;AAQD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CASjF;AAGD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ5C;AAGD,eAAO,MAAM,SAAS,QAAO,MAAsE,CAAC;AAGpG,wBAAgB,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,UAAQ,GAAG,eAAe,CAoBlF"}
@@ -0,0 +1,79 @@
1
+ export declare const EDITOR_STRINGS: {
2
+ title: string;
3
+ variant: string;
4
+ hintPoint: string;
5
+ hintEditing: string;
6
+ editsOne: string;
7
+ editsMany: string;
8
+ noEdits: string;
9
+ undo: string;
10
+ undoOffline: string;
11
+ saveReturn: string;
12
+ clickToEdit: string;
13
+ helpTitle: string;
14
+ helpUp: string;
15
+ helpDown: string;
16
+ helpClickKey: string;
17
+ helpClick: string;
18
+ dismiss: string;
19
+ page: string;
20
+ up: string;
21
+ down: string;
22
+ matchOne: string;
23
+ matchMany: string;
24
+ matchNone: string;
25
+ whatToDo: string;
26
+ actText: string;
27
+ actLink: string;
28
+ actImage: string;
29
+ actHide: string;
30
+ actSlot: string;
31
+ noText: string;
32
+ notLink: string;
33
+ notImage: string;
34
+ newText: string;
35
+ was: string;
36
+ insert: string;
37
+ fallback: string;
38
+ fallbackHelp: string;
39
+ newLink: string;
40
+ newImage: string;
41
+ urlBad: string;
42
+ hideNote: string;
43
+ hiddenFor: string;
44
+ slotName: string;
45
+ savedAs: string;
46
+ slotHelp: string;
47
+ slotEmpty: string;
48
+ where: string;
49
+ posBefore: string;
50
+ posAfter: string;
51
+ posReplace: string;
52
+ posPrepend: string;
53
+ posAppend: string;
54
+ slotPreview: string;
55
+ css: string;
56
+ cssHelp: string;
57
+ cssBad: string;
58
+ cancel: string;
59
+ save: string;
60
+ noSelector: string;
61
+ kHeading: string;
62
+ kText: string;
63
+ kLink: string;
64
+ kButton: string;
65
+ kImage: string;
66
+ kList: string;
67
+ kSection: string;
68
+ kMain: string;
69
+ kHeader: string;
70
+ kFooter: string;
71
+ kNav: string;
72
+ kForm: string;
73
+ kElement: string;
74
+ };
75
+ export type EditorStringKey = keyof typeof EDITOR_STRINGS;
76
+ export type EditorStrings = Record<EditorStringKey, string>;
77
+ export declare function mergeStrings(over: unknown): EditorStrings;
78
+ export declare function fill(text: string, vars?: Record<string, string | number>): string;
79
+ //# sourceMappingURL=editor-strings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-strings.d.ts","sourceRoot":"","sources":["../../src/editor/editor-strings.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyE1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,cAAc,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAG5D,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,CASzD;AAGD,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAM,GAAG,MAAM,CAErF"}
@@ -0,0 +1,25 @@
1
+ type Kid = Node | string | null | undefined | false;
2
+ export declare function h<K extends keyof HTMLElementTagNameMap>(tag: K, attrs?: Record<string, string | boolean | undefined> | null, ...kids: Kid[]): HTMLElementTagNameMap[K];
3
+ declare const ICONS: {
4
+ text: string[];
5
+ link: string[];
6
+ image: string[];
7
+ hide: string[];
8
+ slot: string[];
9
+ undo: string[];
10
+ up: string[];
11
+ down: string[];
12
+ cursor: string[];
13
+ code: string[];
14
+ chevron: string[];
15
+ check: string[];
16
+ close: string[];
17
+ };
18
+ export type IconName = keyof typeof ICONS;
19
+ export declare function icon(name: IconName, size?: number): SVGSVGElement;
20
+ export declare const HOST_STYLE = "all:initial !important;position:fixed !important;top:0 !important;left:0 !important;width:0 !important;height:0 !important;z-index:2147483647 !important;display:block !important";
21
+ export declare const PREVIEW_HOST_STYLE = "all:initial !important;display:block !important;margin:10px 0 !important";
22
+ export declare const PREVIEW_CSS = ".s,.x{font:12.5px/1.4 Inter,system-ui,-apple-system,\"Segoe UI\",Roboto,sans-serif;border-radius:10px;padding:14px 16px;text-align:center}.s{border:2px dashed #7A6CFF;background:#F4F2FF;color:#4C3FD1}.s b{font-weight:700}.s code{font-family:ui-monospace,\"SF Mono\",Menlo,monospace}.s div{font-size:11.5px;color:#6B5FD9;margin-top:3px}.x{border:1.5px dashed #F04438;background:#FEF3F2;color:#B42318;text-align:start;padding:10px 12px;font-size:12px}";
23
+ export declare const EDITOR_CSS = "\n*{box-sizing:border-box}\n.r{font:13px/1.4 Inter,system-ui,-apple-system,\"Segoe UI\",Roboto,sans-serif;color:#242B3A;-webkit-font-smoothing:antialiased}\nbutton{font:inherit;color:inherit;cursor:pointer}\nbutton:disabled{cursor:not-allowed}\nbutton:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #31D6C8;outline-offset:1px}\n.box{position:fixed;pointer-events:none;border:2px dashed #00A99A;background:rgba(0,169,154,.07);border-radius:4px;display:none}\n.box.sel{border-style:solid;background:rgba(0,169,154,.04)}\n.chip{position:absolute;bottom:100%;inset-inline-start:-2px;margin-bottom:2px;background:#00A99A;color:#fff;font-size:11px;font-weight:600;padding:3px 8px;border-radius:6px 6px 6px 0;white-space:nowrap;max-width:60vw;overflow:hidden;text-overflow:ellipsis}\n.help{position:fixed;top:16px;inset-inline-end:16px;width:240px;background:#fff;border:1px solid #E5EAF2;border-radius:10px;box-shadow:0 8px 24px rgba(10,18,64,.14);padding:10px 12px}\n.help h3{margin:0 0 6px;font-size:11px;font-weight:700;color:#6B7280;letter-spacing:.5px;text-transform:uppercase}\n.help .row{display:flex;align-items:center;gap:8px;font-size:12px;padding:3px 0}\n.kbd{min-width:38px;text-align:center;font-size:11px;font-weight:600;border:1px solid #E5EAF2;border-radius:5px;padding:1px 5px;background:#F8FAFC}\n.help .x{position:absolute;top:6px;inset-inline-end:6px;border:0;background:none;color:#8990A8;padding:2px;display:grid}\n.dock{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:6px;background:#071342;color:#fff;border-radius:14px;padding:7px 7px 7px 14px;box-shadow:0 12px 32px rgba(10,18,64,.35);white-space:nowrap;max-width:calc(100vw - 24px)}\n.r.open .dock{left:calc(50% - 190px)}\n.r.open[dir=rtl] .dock{left:calc(50% + 190px)}\n.logo{width:22px;height:22px;border-radius:6px;background:#fff;color:#071342;display:grid;place-items:center;font-weight:800;font-size:13px;flex:none}\n.name{font-size:12.5px;font-weight:600;margin-inline-start:4px;overflow:hidden;text-overflow:ellipsis;max-width:200px}\n.sub{font-size:12px;color:#A8AEC1;overflow:hidden;text-overflow:ellipsis;max-width:220px}\n.sep{width:1px;height:22px;background:#2A3366;margin:0 8px;flex:none}\n.hint{font-size:12px;color:#C9CEDD;display:inline-flex;align-items:center;gap:6px}\n.hint svg{color:#31D6C8}\n.db{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 10px;border-radius:8px;border:0;background:#1B245A;color:#fff;font-size:12.5px;font-weight:600}\n.ib{height:32px;width:32px;border-radius:8px;border:0;background:transparent;color:#fff;display:grid;place-items:center}\n.ib:disabled{color:#4A527A}\n.go{height:32px;padding:0 14px;border-radius:8px;border:0;background:#31D6C8;color:#071342;font-size:12.5px;font-weight:700}\n.pop{position:absolute;bottom:calc(100% + 10px);left:0;right:0;min-width:280px;max-height:50vh;overflow:auto;background:#fff;color:#242B3A;border-radius:12px;border:1px solid #E5EAF2;box-shadow:0 12px 32px rgba(10,18,64,.18);padding:6px;white-space:normal}\n.pop .e{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:none;border-radius:8px;font-size:12.5px;text-align:start}\n.pop .e:hover{background:#F8FAFC}\n.pop .empty{padding:12px;font-size:12.5px;color:#6B7280}\n.num{width:20px;height:20px;border-radius:99px;background:#071342;color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center;flex:none}\n.panel{position:fixed;top:0;bottom:0;inset-inline-end:0;width:380px;max-width:100vw;background:#fff;border-inline-start:1px solid #E5EAF2;box-shadow:-8px 0 24px rgba(10,18,64,.06);display:flex;flex-direction:column}\n.hd{padding:16px 18px 14px;border-bottom:1px solid #E5EAF2}\n.crumbs{display:flex;align-items:center;flex-wrap:wrap;gap:4px;font-size:11.5px;color:#6B7280;margin-bottom:6px}\n.crumbs svg{color:#A8AEC1}\n.crumb{border:0;background:transparent;color:#6B7280;font-weight:500;font-size:11.5px;padding:2px 6px;border-radius:5px}\n.crumb.cur{background:#E5F9F6;color:#0F766E;font-weight:600}\n.nav{margin-inline-start:auto;display:flex;gap:2px}\n.nav button{border:1px solid #E5EAF2;background:#fff;border-radius:6px;width:24px;height:22px;display:grid;place-items:center;color:#3A4060;padding:0}\n.nav button:disabled{opacity:.4}\n.tr{display:flex;align-items:center;gap:10px}\n.title{font-size:17px;font-weight:700;color:#0A1240;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}\n.pill{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:600;padding:3px 8px;border-radius:999px;white-space:nowrap;flex:none}\n.pill.ok{background:#E5F9F6;color:#0F766E}\n.pill.many{background:#FFF7E6;color:#92400E}\n.pill.none{background:#FEF3F2;color:#B42318}\n.bd{padding:16px 18px;overflow:auto;flex:1}\n.lbl{display:block;font-size:12.5px;font-weight:600;color:#242B3A;margin-bottom:8px}\n.tiles{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:18px}\n.tile{display:flex;align-items:center;gap:9px;padding:10px 11px;border-radius:10px;text-align:start;background:#fff;border:1.5px solid #E5EAF2;color:#3A4060}\n.tile[aria-checked=true]{background:#E5F9F6;border-color:#00C8B7;color:#0F766E}\n.tile.slot[aria-checked=true]{background:#F4F2FF;border-color:#7A6CFF;color:#4C3FD1}\n.tile:disabled{opacity:.55}\n.tile b{display:block;font-size:12.5px;font-weight:600;color:#0A1240}\n.tile small{display:block;font-size:10.5px;color:#6B7280}\n.fr{display:flex;align-items:baseline;margin-bottom:8px}\n.fr .lbl{margin:0}\n.was{margin-inline-start:auto;font-size:11.5px;color:#6B7280;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:55%}\ntextarea,input{width:100%;font:inherit;font-size:13.5px;color:#0F1424;padding:10px 12px;border-radius:10px;border:1.5px solid #E5EAF2;background:#fff;outline:none}\ntextarea{line-height:1.5;resize:vertical;border-color:#00C8B7}\ninput{height:40px;padding:0 12px}\ninput.slotin{border-color:#7A6CFF}\ninput.mono{font-family:ui-monospace,\"SF Mono\",Menlo,monospace;font-size:12px;height:36px;background:#F8FAFC;border-width:1px}\n.chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;align-items:center}\n.chips span{font-size:11.5px;color:#6B7280;margin-inline-end:2px}\n.vc{font-family:ui-monospace,\"SF Mono\",Menlo,monospace;font-size:11.5px;padding:3px 8px;border-radius:6px;border:1px solid #E5EAF2;background:#F8FAFC;color:#3A4060}\n.help2{font-size:11.5px;color:#6B7280;margin-top:5px}\n.err{font-size:11.5px;color:#B42318;margin-top:5px}\n.mt{margin-top:14px}\n.note{background:#FFF7E6;border:1px solid #FCD34D;border-radius:10px;padding:10px 12px;font-size:12.5px;color:#92400E;line-height:1.5}\n.key{font-family:ui-monospace,\"SF Mono\",Menlo,monospace;color:#4C3FD1;background:#F4F2FF;padding:1px 6px;border-radius:4px}\n.seg{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;background:#F3F5FA;border-radius:9px;padding:3px}\n.seg button{border:0;background:transparent;border-radius:7px;padding:6px 4px;font-size:12px;color:#3A4060}\n.seg button[aria-checked=true]{background:#fff;color:#0A1240;font-weight:600;box-shadow:0 1px 2px rgba(10,18,64,.08)}\n.css{margin-top:20px;display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;padding:0;color:#6B7280;font-size:12px}\n.ft{padding:12px 18px;border-top:1px solid #E5EAF2;display:flex;gap:10px;background:#F8FAFC}\n.cancel{height:38px;padding:0 14px;border-radius:10px;border:1px solid #E5EAF2;background:#fff;color:#242B3A;font-size:13px;font-weight:600}\n.save{flex:1;height:38px;border-radius:10px;border:0;background:#071342;color:#fff;font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.save:disabled{opacity:.45}\n@media (max-width:760px){.r.open .dock{display:none}.help{display:none}}\n";
24
+ export {};
25
+ //# sourceMappingURL=editor-ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-ui.d.ts","sourceRoot":"","sources":["../../src/editor/editor-ui.ts"],"names":[],"mappings":"AAWA,KAAK,GAAG,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC;AAEpD,wBAAgB,CAAC,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAQtK;AAGD,QAAA,MAAM,KAAK;;;;;;;;;;;;;;CAcV,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,wBAAgB,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,SAAK,GAAG,aAAa,CAS7D;AAGD,eAAO,MAAM,UAAU,sLAAsL,CAAC;AAG9M,eAAO,MAAM,kBAAkB,6EAA6E,CAAC;AAK7G,eAAO,MAAM,WAAW,scAAgX,CAAC;AAEzY,eAAO,MAAM,UAAU,iqPAiFtB,CAAC"}
@@ -1,17 +1,24 @@
1
1
  import type { Logger } from '../utils/logger';
2
- import { type PageEditOperation } from '../core/page-edits';
2
+ import { type PageEditOperation, type PageEditPosition, type PageEditWire } from '../core/page-edits';
3
3
  import { EDITOR_MESSAGES } from '../core/editor-gate';
4
4
  export { EDITOR_MESSAGES };
5
+ export declare const EDITOR_SESSION_MESSAGES: {
6
+ readonly CONTEXT: "joryio:editor-context";
7
+ readonly FOCUS: "joryio:editor-focus";
8
+ readonly REMOVE: "joryio:editor-remove";
9
+ readonly DONE: "joryio:editor-done";
10
+ };
5
11
  export declare function cssEscape(value: string): string;
6
12
  export declare function robustSelector(el: Element): string | null;
7
13
  export declare function operationsFor(el: Element): PageEditOperation[];
8
14
  export interface EditorPick {
9
15
  type: typeof EDITOR_MESSAGES.PICK;
16
+ id: string;
10
17
  selector: string;
11
18
  operation: PageEditOperation;
12
19
  value?: string;
13
20
  placementKey?: string;
14
- position?: 'before' | 'after' | 'prepend' | 'append';
21
+ position?: PageEditPosition;
15
22
  tag: string;
16
23
  text: string;
17
24
  }
@@ -21,19 +28,63 @@ export declare class VisualEditor {
21
28
  private logger;
22
29
  private onStop;
23
30
  private listeners;
24
- private highlight;
31
+ private active;
32
+ private host;
33
+ root: ShadowRoot | null;
34
+ private wrap;
35
+ private hoverBox;
36
+ private selBox;
37
+ private dock;
25
38
  private panel;
39
+ private help;
40
+ private hovered;
26
41
  private selected;
27
- private active;
42
+ private draft;
43
+ private showCss;
44
+ private popOpen;
45
+ private edits;
46
+ private history;
47
+ private synced;
48
+ private t;
49
+ private dir;
50
+ private ctx;
51
+ private previewUndo;
52
+ private originals;
28
53
  constructor(dashboardOrigin: string, opener: Window, logger: Logger, onStop?: () => void);
29
54
  start(): void;
30
55
  isActive(): boolean;
56
+ editList(): PageEditWire[];
31
57
  stop(): void;
32
58
  private send;
33
59
  private activate;
34
- private outline;
35
- private unselect;
36
- select(el: Element): void;
37
- pick(el: Element, selector: string, operation: PageEditOperation, value: string): boolean;
60
+ private applyContext;
61
+ private place;
62
+ private move;
63
+ select(el: Element, edit?: PageEditWire): void;
64
+ private enabled;
65
+ private newDraft;
66
+ private draftOf;
67
+ private orig;
68
+ focusEdit(id: unknown): boolean;
69
+ private draftEdit;
70
+ private save;
71
+ pick(el: Element | null, selector: string, operation: PageEditOperation, value: string, opts?: {
72
+ id?: string;
73
+ position?: PageEditPosition;
74
+ }): boolean;
75
+ private cancel;
76
+ private closePanel;
77
+ undo(): boolean;
78
+ done(): void;
79
+ private clearPreview;
80
+ private renderPreview;
81
+ private previewNode;
82
+ private applyPreview;
83
+ private renderHelp;
84
+ private editTitle;
85
+ private togglePop;
86
+ private renderDock;
87
+ private renderPanel;
88
+ private renderFields;
38
89
  }
39
90
  //# sourceMappingURL=visual-editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"visual-editor.d.ts","sourceRoot":"","sources":["../../src/editor/visual-editor.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAiC,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,CAAC;AAO3B,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAa/C;AAmBD,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAmCzD;AAGD,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,GAAG,iBAAiB,EAAE,CAO9D;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,eAAe,CAAC,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,YAAY;IAQrB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,MAAM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ts CHANGED
@@ -343,7 +343,7 @@ declare class IdentityManager {
343
343
  isIdentified(): boolean;
344
344
  }
345
345
 
346
- declare const SDK_VERSION = "1.4.0";
346
+ declare const SDK_VERSION = "1.4.0-beta.6";
347
347
  interface InAppDisplayOptions {
348
348
  defaultPosition?: 'top' | 'center' | 'bottom';
349
349
  defaultAnimation?: 'fade' | 'slide' | 'none';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Joryio Web SDK v1.4.0-beta.5
2
+ * Joryio Web SDK v1.4.0-beta.6
3
3
  * (c) 2026 Joryio. All rights reserved.
4
4
  * @license Commercial - see https://github.com/joryio/joryio-web-sdk/blob/main/LICENSE
5
5
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Joryio Web SDK v1.4.0-beta.5
2
+ * Joryio Web SDK v1.4.0-beta.6
3
3
  * (c) 2026 Joryio. All rights reserved.
4
4
  * @license Commercial - see https://github.com/joryio/joryio-web-sdk/blob/main/LICENSE
5
5
  */
6
- !function(){"use strict";function t(t){if("string"!=typeof t)return!1;const e=t.trim();if(!e||e.length>500)return!1;if(/[{};<@]/.test(e)||e.includes("/*")||e.includes("*/"))return!1;if(/[\u0000-\u001f\u007f]/.test(e))return!1;try{"undefined"!=typeof document&&document.createDocumentFragment().querySelector(e)}catch(t){return!1}return!0}const e=/\/joryio(?:\.umd)?(?:\.min)?\.js$/;function i(t){if(!t||"string"!=typeof t)return null;let i;try{i=new URL(t)}catch(t){return null}return"https:"===i.protocol&&e.test(i.pathname)?`${i.origin}${i.pathname.replace(/[^/]*$/,"")}`:null}!function(){if("undefined"==typeof document)return null;try{const t=document.currentScript,e=i(t&&t.src);if(e||t&&t.src)return e;const n=document.querySelectorAll("script[src]");for(let t=n.length-1;t>=0;t--){const e=i(n[t].src);if(e)return e}}catch(t){}}();const n="__joryioEditor",o=["data-joryio-id","data-testid","data-test","data-qa","data-cy","data-id","name"],r=/^[a-z0-9][a-z0-9_]{0,63}$/,s=(t,e,i)=>{try{const n=t.querySelectorAll(e);return 1===n.length&&n[0]===i}catch(t){return!1}};class c{constructor(t,e,i,n=()=>{}){this.dashboardOrigin=t,this.opener=e,this.logger=i,this.onStop=n,this.listeners=[],this.highlight=null,this.panel=null,this.selected=null,this.active=!1}start(){if(this.active)return;this.active=!0;const t=t=>{const e=t.data;e&&"string"==typeof e.type&&t.origin===this.dashboardOrigin&&t.source===this.opener&&"joryio:editor-close"===e.type&&this.stop()};window.addEventListener("message",t),this.listeners.push(()=>window.removeEventListener("message",t)),this.activate()}isActive(){return this.active}stop(){var t,e;if(this.active){this.send({type:"joryio:editor-closed"}),this.active=!1;for(const t of this.listeners.splice(0))t();null===(t=this.highlight)||void 0===t||t.remove(),null===(e=this.panel)||void 0===e||e.remove(),this.highlight=this.panel=null,this.selected=null;try{this.onStop()}catch(t){this.logger.debug("Joryio editor stop callback failed",t)}}}send(t){if(this.active)try{this.opener.postMessage(t,this.dashboardOrigin)}catch(t){}}activate(){const t=document,e=t.createElement("div");e.setAttribute("data-joryio-editor","highlight"),e.style.cssText="position:fixed;pointer-events:none;z-index:2147483646;border:2px solid #14b8a6;background:rgba(20,184,166,.12);border-radius:3px;display:none";const i=t.createElement("div");i.setAttribute("data-joryio-editor","panel"),i.style.cssText="position:fixed;left:16px;right:16px;bottom:16px;z-index:2147483647;max-width:560px;margin:0 auto;background:#0f172a;color:#fff;font:14px/1.4 system-ui,sans-serif;padding:12px 14px;border-radius:10px;box-shadow:0 8px 30px rgba(0,0,0,.3)",i.textContent="Joryio editor - click an element on the page. Esc to finish.",t.body.appendChild(e),t.body.appendChild(i),this.highlight=e,this.panel=i;const n=t=>t instanceof Element&&!!t.closest("[data-joryio-editor]"),o=t=>{this.selected||n(t.target)||this.outline(t.target instanceof Element?t.target:null)},r=t=>{n(t.target)||(t.preventDefault(),t.stopPropagation(),t.target instanceof Element&&this.select(t.target))},s=t=>{"Escape"===t.key&&(this.selected?this.unselect():this.stop())};t.addEventListener("mousemove",o,!0),t.addEventListener("click",r,!0),t.addEventListener("keydown",s,!0),this.listeners.push(()=>t.removeEventListener("mousemove",o,!0),()=>t.removeEventListener("click",r,!0),()=>t.removeEventListener("keydown",s,!0)),this.send({type:"joryio:editor-active",url:`${location.origin}${location.pathname}`})}outline(t){if(!this.highlight)return;if(!t||t===document.body||t===document.documentElement)return void(this.highlight.style.display="none");const e=t.getBoundingClientRect();Object.assign(this.highlight.style,{display:"block",top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`})}unselect(){this.selected=null,this.panel&&(this.panel.textContent="Joryio editor - click an element on the page. Esc to finish.")}select(e){const i=function(e){const i=e.ownerDocument;if(!i)return null;const n=t=>{if((e=t.id)&&e.length<=64&&!/\d{4,}/.test(e)&&!/^(ember|react|radix|headlessui|mui)[-_:]/i.test(e)&&!/:/.test(e)){const e=`#${function(t){const e=globalThis.CSS;if(e&&"function"==typeof e.escape)return e.escape(t);let i="";for(let e=0;e<t.length;e++){const n=t[e],o=t.charCodeAt(e);0===o?i+="�":/[0-9]/.test(n)&&(0===e||1===e&&"-"===t[0])?i+=`\\${o.toString(16)} `:/[A-Za-z0-9_-]/.test(n)||o>=128?i+=n:i+=`\\${n}`}return i}(t.id)}`;if(s(i,e,t))return e}var e;for(const e of o){const n=t.getAttribute(e);if(!n||n.length>100)continue;const o=`${t.tagName.toLowerCase()}[${e}="${n.replace(/["\\]/g,"\\$&")}"]`;if(s(i,o,t))return o}return null},r=n(e);if(r)return t(r)?r:null;const c=[];let a=e;for(;a&&a!==i.body&&a!==i.documentElement;){const t=c.length?n(a):null;if(t){c.unshift(t);break}const e=a.tagName.toLowerCase(),o=a.parentElement,r=o?Array.from(o.children).filter(t=>t.tagName===a.tagName):[];c.unshift(r.length>1?`${e}:nth-of-type(${r.indexOf(a)+1})`:e),a=o,a===i.body&&c.unshift("body")}const l=c.join(" > ");return l&&t(l)&&s(i,l,e)?l:null}(e);if(!this.panel)return;if(!i)return void(this.panel.textContent="This element has no stable selector. Choose its parent or another element.");this.selected=e,this.outline(e);const n=this.panel;n.textContent="";const r=(t,e=!1)=>{const i=document.createElement("div");i.textContent=t,e&&(i.style.cssText="font-family:ui-monospace,monospace;font-size:12px;opacity:.8;word-break:break-all;margin:4px 0 8px"),n.appendChild(i)};r(`<${e.tagName.toLowerCase()}> ${(e.textContent||"").trim().slice(0,60)}`),r(i,!0);const c=document.createElement("input");c.setAttribute("data-joryio-editor","value"),c.style.cssText="width:100%;box-sizing:border-box;padding:6px 8px;border-radius:6px;border:0;margin-bottom:8px;color:#0f172a",c.placeholder="New text, https:// address or placement key",n.appendChild(c);const a=document.createElement("div");a.style.cssText="display:flex;flex-wrap:wrap;gap:6px";const l={replace_text:"Replace text",replace_image:"Replace image",replace_link:"Replace link",hide:"Hide",insert_placement:"Insert placement after"};for(const t of function(t){const e=[];return"IMG"!==t.tagName&&(t.textContent||"").trim()&&e.push("replace_text"),"IMG"===t.tagName&&e.push("replace_image"),"A"===t.tagName&&e.push("replace_link"),e.push("hide","insert_placement"),e}(e)){const n=document.createElement("button");n.type="button",n.textContent=l[t],n.setAttribute("data-joryio-op",t),n.style.cssText="padding:6px 10px;border-radius:6px;border:0;background:#14b8a6;color:#fff;cursor:pointer",n.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.pick(e,i,t,c.value.trim())}),a.appendChild(n)}n.appendChild(a)}pick(t,e,i,n){const o={type:"joryio:editor-pick",selector:e,operation:i,tag:t.tagName.toLowerCase(),text:(t.textContent||"").trim().slice(0,200)};let s=null;if("hide"===i?s=o:"replace_text"===i?s=n||o.text?Object.assign(Object.assign({},o),{value:(n||o.text).slice(0,2e3)}):null:"replace_image"===i||"replace_link"===i?s=function(t){if("string"!=typeof t)return!1;const e=t.trim();return!(!e||e.length>2048)&&!/[\u0000-\u001f\u007f\s]/.test(e)&&/^https?:\/\/[^/?#\s]+/i.test(e)}(n)?Object.assign(Object.assign({},o),{value:n}):null:"insert_placement"===i&&(s=r.test(n)?Object.assign(Object.assign({},o),{placementKey:n,position:"after"}):null),!s){if(this.panel){const t=document.createElement("div");t.style.cssText="margin-top:6px;color:#fca5a5",t.textContent="insert_placement"===i?"Enter a placement key (lowercase letters, digits, _).":"Enter an address starting with https:// (or http://).",this.panel.appendChild(t)}return!1}return this.send(s),this.unselect(),!0}}const a={version:1,start({dashboardOrigin:t,opener:e,logger:i,onStop:n}){const o=new c(t,e,i,n);return o.start(),{stop:()=>o.stop()}}};"undefined"==typeof window||window[n]||(window[n]=a)}();
6
+ !function(){"use strict";"function"==typeof SuppressedError&&SuppressedError;const t=["before","after","prepend","append","replace"],e=/^[a-z0-9][a-z0-9_]{0,63}$/;function i(t){if("string"!=typeof t)return!1;const e=t.trim();if(!e||e.length>500)return!1;if(/[{};<@]/.test(e)||e.includes("/*")||e.includes("*/"))return!1;if(/[\u0000-\u001f\u007f]/.test(e))return!1;try{"undefined"!=typeof document&&document.createDocumentFragment().querySelector(e)}catch(t){return!1}return!0}function n(t){if("string"!=typeof t)return!1;const e=t.trim();return!(!e||e.length>2048)&&!/[\u0000-\u001f\u007f\s]/.test(e)&&/^https?:\/\/[^/?#\s]+/i.test(e)}const o=/\/joryio(?:\.umd)?(?:\.min)?\.js$/;function s(t){if(!t||"string"!=typeof t)return null;let e;try{e=new URL(t)}catch(t){return null}return"https:"===e.protocol&&o.test(e.pathname)?`${e.origin}${e.pathname.replace(/[^/]*$/,"")}`:null}!function(){if("undefined"==typeof document)return null;try{const t=document.currentScript,e=s(t&&t.src);if(e||t&&t.src)return e;const i=document.querySelectorAll("script[src]");for(let t=i.length-1;t>=0;t--){const e=s(i[t].src);if(e)return e}}catch(t){}}();const r="joryio:editor-pick",a="__joryioEditor",l={title:"Joryio editor",variant:"Variant {name}",hintPoint:"Point at anything on the page",hintEditing:"Editing · changes show live",editsOne:"1 edit",editsMany:"{n} edits",noEdits:"No edits yet.",undo:"Undo last edit",undoOffline:"Undo is available once the Joryio dashboard is connected",saveReturn:"Save & return to Joryio",clickToEdit:"click to edit",helpTitle:"Not the right box?",helpUp:"Select the section around it",helpDown:"Select something inside it",helpClickKey:"Click",helpClick:"Edit this one",dismiss:"Dismiss",page:"Page",up:"Select the element around it",down:"Select the first element inside it",matchOne:"1 match on page",matchMany:"Matches {n} - all will change",matchNone:"Not found",whatToDo:"What do you want to do?",actText:"Change text",actLink:"Change link",actImage:"Change image",actHide:"Hide it",actSlot:"Add content slot",noText:"No text here",notLink:"Not a link",notImage:"Not an image",newText:"New text",was:'Was: "{value}"',insert:"Insert",fallback:"If a value is missing",fallbackHelp:"Shown to visitors we don't know yet.",newLink:"New link address",newImage:"New image address",urlBad:"Enter an address starting with https:// (or http://).",hideNote:"The {kind} is removed for people in this campaign's audience. Everyone else still sees it.",hiddenFor:"Hidden for this audience",slotName:"Slot name",savedAs:"Saved as",slotHelp:"Filled by a Placement campaign or a journey step.",slotEmpty:"Enter a name for the slot.",where:"Where",posBefore:"Above it",posAfter:"Below it",posReplace:"Instead of it",posPrepend:"Inside, at the start",posAppend:"Inside, at the end",slotPreview:"Content slot",css:"CSS selector",cssHelp:"For developers. Matches {n} on this page.",cssBad:"Not a selector this page can use.",cancel:"Cancel",save:"Save · {action}",noSelector:"This element has no stable selector. Choose the element around it (arrow up) or another one.",kHeading:"Heading",kText:"Text",kLink:"Link",kButton:"Button",kImage:"Image",kList:"List",kSection:"Section",kMain:"Main",kHeader:"Header",kFooter:"Footer",kNav:"Navigation",kForm:"Form",kElement:"Element"};function c(t,e={}){return t.replace(/\{(\w+)\}/g,(t,i)=>i in e?String(e[i]):t)}const d=/\{\{-?([\s\S]*?)-?\}\}/g,p=/\|\s*default\s*:\s*("[^"]*"|'[^']*'|[^|}]*?)\s*(?=\||$)/,h=t=>t.trim().replace(/^(["'])([\s\S]*)\1$/,"$2");function u(t){const e=[],i=new RegExp(d.source,"g");let n;for(;n=i.exec(t||"");){const t=n[1].trim(),i=p.exec(t);e.push({expr:t,fallback:i?h(i[1]):null})}return e}function f(t){const e=u(t);if(!e.length)return null;const i=e.filter(t=>null!==t.fallback)[0];return i?i.fallback:""}const x=t=>t.includes('"')?`'${t.replace(/'/g,"")}'`:`"${t}"`;function b(t,e,i){const n=e?`user.custom.${t}`:`user.${t}`;return i?`{{ ${n} | default: ${x(i)} }}`:`{{ ${n} }}`}function g(t){return(t||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,64).replace(/_+$/,"")}function m(t,e=!1){let i=(t||"").toLowerCase();if(e){const t=i.trim().split(/[\s>+~]+/).filter(Boolean),e=/^[a-z][a-z0-9]*/.exec(t[t.length-1]||"");i=e?e[0]:""}return/^h[1-6]$/.test(i)?"kHeading":/^(p|span|strong|em|small|label|blockquote|b|i)$/.test(i)?"kText":"a"===i?"kLink":"button"===i?"kButton":"img"===i||"picture"===i?"kImage":/^(ul|ol|li)$/.test(i)?"kList":"main"===i?"kMain":"header"===i?"kHeader":"footer"===i?"kFooter":"nav"===i?"kNav":"form"===i?"kForm":/^(section|div|article|aside)$/.test(i)?"kSection":"kElement"}function k(t,e,...i){const n=document.createElement(t);for(const[t,i]of Object.entries(e||{}))void 0!==i&&!1!==i&&n.setAttribute(t,!0===i?"":i);for(const t of i)null!=t&&!1!==t&&n.appendChild("string"==typeof t?document.createTextNode(t):t);return n}const y="http://www.w3.org/2000/svg",w={text:["M4 7V5h16v2M9 19h6M12 5v14"],link:["M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71","M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"],image:["M3 5h18v14H3z","m3 16 5-5 4 4 3-3 6 6","M15.5 8.5h.01"],hide:["M9.88 9.88a3 3 0 1 0 4.24 4.24","M10.73 5.08A10.4 10.4 0 0 1 12 5c7 0 10 7 10 7a13.2 13.2 0 0 1-1.67 2.68","M6.61 6.61A13.5 13.5 0 0 0 2 12s3 7 10 7a9.7 9.7 0 0 0 5.39-1.61","m2 2 20 20"],slot:["M3 3h18v18H3z","M7 9h10v6H7z"],undo:["M3 7v6h6","M21 17a9 9 0 0 0-15-6.7L3 13"],up:["m18 15-6-6-6 6"],down:["m6 9 6 6 6-6"],cursor:["m4 4 7.07 17 2.51-7.39L21 11.07z"],code:["m16 18 6-6-6-6M8 6l-6 6 6 6"],chevron:["m9 18 6-6-6-6"],check:["M20 6 9 17l-5-5"],close:["M18 6 6 18M6 6l12 12"]};function v(t,e=15){const i=document.createElementNS(y,"svg");for(const[t,n]of Object.entries({width:String(e),height:String(e),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.9","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))i.setAttribute(t,n);for(const e of w[t]){const t=document.createElementNS(y,"path");t.setAttribute("d",e),i.appendChild(t)}return i}const j='Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif',F='ui-monospace,"SF Mono",Menlo,monospace',A=`.s,.x{font:12.5px/1.4 ${j};border-radius:10px;padding:14px 16px;text-align:center}.s{border:2px dashed #7A6CFF;background:#F4F2FF;color:#4C3FD1}.s b{font-weight:700}.s code{font-family:${F}}.s div{font-size:11.5px;color:#6B5FD9;margin-top:3px}.x{border:1.5px dashed #F04438;background:#FEF3F2;color:#B42318;text-align:start;padding:10px 12px;font-size:12px}`,$=`\n*{box-sizing:border-box}\n.r{font:13px/1.4 ${j};color:#242B3A;-webkit-font-smoothing:antialiased}\nbutton{font:inherit;color:inherit;cursor:pointer}\nbutton:disabled{cursor:not-allowed}\nbutton:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #31D6C8;outline-offset:1px}\n.box{position:fixed;pointer-events:none;border:2px dashed #00A99A;background:rgba(0,169,154,.07);border-radius:4px;display:none}\n.box.sel{border-style:solid;background:rgba(0,169,154,.04)}\n.chip{position:absolute;bottom:100%;inset-inline-start:-2px;margin-bottom:2px;background:#00A99A;color:#fff;font-size:11px;font-weight:600;padding:3px 8px;border-radius:6px 6px 6px 0;white-space:nowrap;max-width:60vw;overflow:hidden;text-overflow:ellipsis}\n.help{position:fixed;top:16px;inset-inline-end:16px;width:240px;background:#fff;border:1px solid #E5EAF2;border-radius:10px;box-shadow:0 8px 24px rgba(10,18,64,.14);padding:10px 12px}\n.help h3{margin:0 0 6px;font-size:11px;font-weight:700;color:#6B7280;letter-spacing:.5px;text-transform:uppercase}\n.help .row{display:flex;align-items:center;gap:8px;font-size:12px;padding:3px 0}\n.kbd{min-width:38px;text-align:center;font-size:11px;font-weight:600;border:1px solid #E5EAF2;border-radius:5px;padding:1px 5px;background:#F8FAFC}\n.help .x{position:absolute;top:6px;inset-inline-end:6px;border:0;background:none;color:#8990A8;padding:2px;display:grid}\n.dock{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:6px;background:#071342;color:#fff;border-radius:14px;padding:7px 7px 7px 14px;box-shadow:0 12px 32px rgba(10,18,64,.35);white-space:nowrap;max-width:calc(100vw - 24px)}\n.r.open .dock{left:calc(50% - 190px)}\n.r.open[dir=rtl] .dock{left:calc(50% + 190px)}\n.logo{width:22px;height:22px;border-radius:6px;background:#fff;color:#071342;display:grid;place-items:center;font-weight:800;font-size:13px;flex:none}\n.name{font-size:12.5px;font-weight:600;margin-inline-start:4px;overflow:hidden;text-overflow:ellipsis;max-width:200px}\n.sub{font-size:12px;color:#A8AEC1;overflow:hidden;text-overflow:ellipsis;max-width:220px}\n.sep{width:1px;height:22px;background:#2A3366;margin:0 8px;flex:none}\n.hint{font-size:12px;color:#C9CEDD;display:inline-flex;align-items:center;gap:6px}\n.hint svg{color:#31D6C8}\n.db{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 10px;border-radius:8px;border:0;background:#1B245A;color:#fff;font-size:12.5px;font-weight:600}\n.ib{height:32px;width:32px;border-radius:8px;border:0;background:transparent;color:#fff;display:grid;place-items:center}\n.ib:disabled{color:#4A527A}\n.go{height:32px;padding:0 14px;border-radius:8px;border:0;background:#31D6C8;color:#071342;font-size:12.5px;font-weight:700}\n.pop{position:absolute;bottom:calc(100% + 10px);left:0;right:0;min-width:280px;max-height:50vh;overflow:auto;background:#fff;color:#242B3A;border-radius:12px;border:1px solid #E5EAF2;box-shadow:0 12px 32px rgba(10,18,64,.18);padding:6px;white-space:normal}\n.pop .e{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:none;border-radius:8px;font-size:12.5px;text-align:start}\n.pop .e:hover{background:#F8FAFC}\n.pop .empty{padding:12px;font-size:12.5px;color:#6B7280}\n.num{width:20px;height:20px;border-radius:99px;background:#071342;color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center;flex:none}\n.panel{position:fixed;top:0;bottom:0;inset-inline-end:0;width:380px;max-width:100vw;background:#fff;border-inline-start:1px solid #E5EAF2;box-shadow:-8px 0 24px rgba(10,18,64,.06);display:flex;flex-direction:column}\n.hd{padding:16px 18px 14px;border-bottom:1px solid #E5EAF2}\n.crumbs{display:flex;align-items:center;flex-wrap:wrap;gap:4px;font-size:11.5px;color:#6B7280;margin-bottom:6px}\n.crumbs svg{color:#A8AEC1}\n.crumb{border:0;background:transparent;color:#6B7280;font-weight:500;font-size:11.5px;padding:2px 6px;border-radius:5px}\n.crumb.cur{background:#E5F9F6;color:#0F766E;font-weight:600}\n.nav{margin-inline-start:auto;display:flex;gap:2px}\n.nav button{border:1px solid #E5EAF2;background:#fff;border-radius:6px;width:24px;height:22px;display:grid;place-items:center;color:#3A4060;padding:0}\n.nav button:disabled{opacity:.4}\n.tr{display:flex;align-items:center;gap:10px}\n.title{font-size:17px;font-weight:700;color:#0A1240;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}\n.pill{margin-inline-start:auto;display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:600;padding:3px 8px;border-radius:999px;white-space:nowrap;flex:none}\n.pill.ok{background:#E5F9F6;color:#0F766E}\n.pill.many{background:#FFF7E6;color:#92400E}\n.pill.none{background:#FEF3F2;color:#B42318}\n.bd{padding:16px 18px;overflow:auto;flex:1}\n.lbl{display:block;font-size:12.5px;font-weight:600;color:#242B3A;margin-bottom:8px}\n.tiles{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:18px}\n.tile{display:flex;align-items:center;gap:9px;padding:10px 11px;border-radius:10px;text-align:start;background:#fff;border:1.5px solid #E5EAF2;color:#3A4060}\n.tile[aria-checked=true]{background:#E5F9F6;border-color:#00C8B7;color:#0F766E}\n.tile.slot[aria-checked=true]{background:#F4F2FF;border-color:#7A6CFF;color:#4C3FD1}\n.tile:disabled{opacity:.55}\n.tile b{display:block;font-size:12.5px;font-weight:600;color:#0A1240}\n.tile small{display:block;font-size:10.5px;color:#6B7280}\n.fr{display:flex;align-items:baseline;margin-bottom:8px}\n.fr .lbl{margin:0}\n.was{margin-inline-start:auto;font-size:11.5px;color:#6B7280;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:55%}\ntextarea,input{width:100%;font:inherit;font-size:13.5px;color:#0F1424;padding:10px 12px;border-radius:10px;border:1.5px solid #E5EAF2;background:#fff;outline:none}\ntextarea{line-height:1.5;resize:vertical;border-color:#00C8B7}\ninput{height:40px;padding:0 12px}\ninput.slotin{border-color:#7A6CFF}\ninput.mono{font-family:${F};font-size:12px;height:36px;background:#F8FAFC;border-width:1px}\n.chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;align-items:center}\n.chips span{font-size:11.5px;color:#6B7280;margin-inline-end:2px}\n.vc{font-family:${F};font-size:11.5px;padding:3px 8px;border-radius:6px;border:1px solid #E5EAF2;background:#F8FAFC;color:#3A4060}\n.help2{font-size:11.5px;color:#6B7280;margin-top:5px}\n.err{font-size:11.5px;color:#B42318;margin-top:5px}\n.mt{margin-top:14px}\n.note{background:#FFF7E6;border:1px solid #FCD34D;border-radius:10px;padding:10px 12px;font-size:12.5px;color:#92400E;line-height:1.5}\n.key{font-family:${F};color:#4C3FD1;background:#F4F2FF;padding:1px 6px;border-radius:4px}\n.seg{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;background:#F3F5FA;border-radius:9px;padding:3px}\n.seg button{border:0;background:transparent;border-radius:7px;padding:6px 4px;font-size:12px;color:#3A4060}\n.seg button[aria-checked=true]{background:#fff;color:#0A1240;font-weight:600;box-shadow:0 1px 2px rgba(10,18,64,.08)}\n.css{margin-top:20px;display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;padding:0;color:#6B7280;font-size:12px}\n.ft{padding:12px 18px;border-top:1px solid #E5EAF2;display:flex;gap:10px;background:#F8FAFC}\n.cancel{height:38px;padding:0 14px;border-radius:10px;border:1px solid #E5EAF2;background:#fff;color:#242B3A;font-size:13px;font-weight:600}\n.save{flex:1;height:38px;border-radius:10px;border:0;background:#071342;color:#fff;font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.save:disabled{opacity:.45}\n@media (max-width:760px){.r.open .dock{display:none}.help{display:none}}\n`,E=["data-joryio-id","data-testid","data-test","data-qa","data-cy","data-id","name"],z=/^[a-z0-9][a-z0-9_]{0,63}$/,O=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/,_=2e3,S="jry_editor_help_dismissed",C=t=>!!t&&!!t.closest("[data-joryio-editor]");function M(t){if(!i(t))return[];try{return Array.from(document.querySelectorAll(t)).filter(t=>!C(t))}catch(t){return[]}}const B=(t,e,i)=>{try{const n=Array.from(t.querySelectorAll(e)).filter(t=>!C(t));return 1===n.length&&n[0]===i}catch(t){return!1}};const N=["text","link","image","hide","slot"],I={text:"replace_text",link:"replace_link",image:"replace_image",hide:"hide",slot:"insert_placement"},D={replace_text:"text",replace_link:"link",replace_image:"image",hide:"hide",insert_placement:"slot"},H={text:"actText",link:"actLink",image:"actImage",hide:"actHide",slot:"actSlot"},L={text:"text",link:"link",image:"image",hide:"hide",slot:"slot"},T=[["before","posBefore"],["after","posAfter"],["replace","posReplace"],["prepend","posPrepend"],["append","posAppend"]],P=(t,e)=>"string"==typeof t?t.trim().slice(0,e):"",R=t=>(t&&t.textContent||"").replace(/\s+/g," ").trim();class U{constructor(t,e,i,n=()=>{}){this.dashboardOrigin=t,this.opener=e,this.logger=i,this.onStop=n,this.listeners=[],this.active=!1,this.host=null,this.root=null,this.wrap=null,this.hoverBox=null,this.selBox=null,this.dock=null,this.panel=null,this.help=null,this.hovered=null,this.selected=null,this.draft=null,this.showCss=!1,this.popOpen=!1,this.edits=[],this.history=[],this.synced=!1,this.t=Object.assign({},l),this.dir="ltr",this.ctx={campaignName:"",variantName:"",attributes:[],placements:[],sample:{}},this.previewUndo=[],this.originals=new WeakMap}start(){if(this.active)return;this.active=!0;const t=t=>{const e=t.data;e&&"string"==typeof e.type&&t.origin===this.dashboardOrigin&&t.source===this.opener&&("joryio:editor-close"===e.type?this.stop():"joryio:editor-context"===e.type?this.applyContext(e):"joryio:editor-focus"===e.type&&this.focusEdit(e.id))};window.addEventListener("message",t),this.listeners.push(()=>window.removeEventListener("message",t)),this.activate()}isActive(){return this.active}editList(){return this.edits.slice()}stop(){var t;if(this.active){this.send({type:"joryio:editor-closed"}),this.active=!1;for(const t of this.listeners.splice(0))t();this.clearPreview(),null===(t=this.host)||void 0===t||t.remove(),this.host=this.root=this.wrap=this.hoverBox=this.selBox=this.dock=this.panel=this.help=null,this.selected=this.hovered=null,this.draft=null;try{this.onStop()}catch(t){this.logger.debug("Joryio editor stop callback failed",t)}}}send(t){if(this.active)try{this.opener.postMessage(t,this.dashboardOrigin)}catch(t){}}activate(){const t=document,e=t.createElement("joryio-editor");e.setAttribute("data-joryio-editor","root"),e.setAttribute("style","all:initial !important;position:fixed !important;top:0 !important;left:0 !important;width:0 !important;height:0 !important;z-index:2147483647 !important;display:block !important");const i=e.attachShadow({mode:"closed"});i.appendChild(k("style",null,$));const n=k("div",{class:"r",dir:this.dir});this.hoverBox=k("div",{class:"box","data-j":"hover"}),this.selBox=k("div",{class:"box sel","data-j":"selected"}),n.append(this.hoverBox,this.selBox),i.appendChild(n),t.documentElement.appendChild(e),this.host=e,this.root=i,this.wrap=n;const o=e=>{const i=e.target instanceof Element?e.target:null;C(i)||(this.hovered=i&&i!==t.body&&i!==t.documentElement?i:null,this.place(this.hoverBox,this.hovered===this.selected?null:this.hovered,!0))},s=e=>{C(e.target instanceof Element?e.target:null)||(e.preventDefault(),e.stopPropagation(),e.target instanceof Element&&e.target!==t.body&&e.target!==t.documentElement&&this.select(e.target))},r=t=>{if("Escape"!==t.key){if(!C(t.target instanceof Element?t.target:null)&&("ArrowUp"===t.key||"ArrowDown"===t.key)){const e=this.selected||this.hovered;if(!e)return;t.preventDefault(),t.stopPropagation(),this.move("ArrowUp"===t.key?"up":"down",e)}}else this.popOpen?this.togglePop(!1):this.panel?this.cancel():this.stop()},a=()=>{this.place(this.hoverBox,this.hovered===this.selected?null:this.hovered,!0),this.place(this.selBox,this.selected)};t.addEventListener("mousemove",o,!0),t.addEventListener("click",s,!0),t.addEventListener("keydown",r,!0),window.addEventListener("scroll",a,!0),window.addEventListener("resize",a),this.listeners.push(()=>t.removeEventListener("mousemove",o,!0),()=>t.removeEventListener("click",s,!0),()=>t.removeEventListener("keydown",r,!0),()=>window.removeEventListener("scroll",a,!0),()=>window.removeEventListener("resize",a)),this.renderDock(),this.renderHelp(),this.send({type:"joryio:editor-active",url:`${location.origin}${location.pathname}`})}applyContext(o){var s;this.synced=!0,this.t=function(t){const e=Object.assign({},l);if(t&&"object"==typeof t)for(const i of Object.keys(l)){const n=t[i];"string"==typeof n&&n.trim()&&n.length<=500&&(e[i]=n)}return e}(o.strings),this.dir="rtl"===o.dir?"rtl":"ltr",null===(s=this.wrap)||void 0===s||s.setAttribute("dir",this.dir);const r=(t,e,i)=>(Array.isArray(t)?t:[]).map(e).filter(t=>null!==t).slice(0,i);if(this.ctx={campaignName:P(o.campaignName,120),variantName:P(o.variantName,60),attributes:r(o.attributes,t=>t&&"string"==typeof t.name&&O.test(t.name)?{name:t.name,custom:!0===t.custom}:null,40),placements:r(o.placements,t=>t&&"string"==typeof t.key&&z.test(t.key)?{key:t.key,name:P(t.name,80)}:null,40),sample:{}},o.sample&&"object"==typeof o.sample)for(const[t,e]of Object.entries(o.sample).slice(0,100))/^user\.[A-Za-z0-9_.]{1,80}$/.test(t)&&"string"==typeof e&&(this.ctx.sample[t]=e.slice(0,200));Array.isArray(o.edits)&&(this.edits=r(o.edits,o=>function(o){if(!o||"object"!=typeof o||"string"!=typeof o.id||!i(o.selector))return null;const s=Object.assign({id:o.id,selector:o.selector.trim()},!0===o.personalized?{personalized:!0}:{});switch(o.operation){case"hide":return Object.assign(Object.assign({},s),{operation:"hide"});case"replace_text":return"string"==typeof o.value&&o.value.length<=2e3?Object.assign(Object.assign({},s),{operation:"replace_text",value:o.value}):null;case"replace_image":case"replace_link":return n(o.value)?Object.assign(Object.assign({},s),{operation:o.operation,value:o.value.trim()}):null;case"insert_placement":return"string"==typeof o.placementKey&&e.test(o.placementKey)?Object.assign(Object.assign({},s),{operation:"insert_placement",placementKey:o.placementKey,position:t.includes(o.position)?o.position:"after"}):null;default:return null}}(o),100).map(t=>{const{personalized:e}=t,i=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i}(t,["personalized"]);return i}),this.history=[]),this.renderPreview(),this.renderDock(),this.renderHelp(),this.draft&&this.renderPanel(),"string"==typeof o.focusId&&this.focusEdit(o.focusId)}place(t,e,i=!1){if(!t)return;if(!e||!e.isConnected)return void(t.style.display="none");const n=e.getBoundingClientRect();Object.assign(t.style,{display:"block",top:n.top-2+"px",left:n.left-2+"px",width:`${n.width+4}px`,height:`${n.height+4}px`}),t.textContent="";const o=`${this.t[m(e.tagName)]} · ${e.tagName.toLowerCase()}`;t.appendChild(k("span",{class:"chip","data-j":"label"},i?`${o} - ${this.t.clickToEdit}`:o))}move(t,e){const i="up"===t?e.parentElement:Array.from(e.children).filter(t=>!C(t))[0]||null;i&&i!==document.body&&i!==document.documentElement&&this.select(i)}select(t,e){if(!this.active)return;this.selected=t,this.hovered=null,this.place(this.hoverBox,null),this.place(this.selBox,t),this.popOpen=!1;const n=e?e.selector:function(t){const e=t.ownerDocument;if(!e)return null;const n=t=>{if((i=t.id)&&i.length<=64&&!/\d{4,}/.test(i)&&!/^(ember|react|radix|headlessui|mui)[-_:]/i.test(i)&&!/:/.test(i)){const i=`#${function(t){const e=globalThis.CSS;if(e&&"function"==typeof e.escape)return e.escape(t);let i="";for(let e=0;e<t.length;e++){const n=t[e],o=t.charCodeAt(e);0===o?i+="�":/[0-9]/.test(n)&&(0===e||1===e&&"-"===t[0])?i+=`\\${o.toString(16)} `:/[A-Za-z0-9_-]/.test(n)||o>=128?i+=n:i+=`\\${n}`}return i}(t.id)}`;if(B(e,i,t))return i}var i;for(const i of E){const n=t.getAttribute(i);if(!n||n.length>100)continue;const o=`${t.tagName.toLowerCase()}[${i}="${n.replace(/["\\]/g,"\\$&")}"]`;if(B(e,o,t))return o}return null},o=n(t);if(o)return i(o)?o:null;const s=[];let r=t;for(;r&&r!==e.body&&r!==e.documentElement;){const t=s.length?n(r):null;if(t){s.unshift(t);break}const i=r.tagName.toLowerCase(),o=r.parentElement,a=o?Array.from(o.children).filter(t=>t.tagName===r.tagName):[];s.unshift(a.length>1?`${i}:nth-of-type(${a.indexOf(r)+1})`:i),r=o,r===e.body&&s.unshift("body")}const a=s.join(" > ");return a&&i(a)&&B(e,a,t)?a:null}(t)||"";this.showCss=!n,this.draft=e?this.draftOf(e):this.newDraft(t,n),this.renderPanel(),this.renderDock(),this.renderHelp(),this.renderPreview()}enabled(t,e){return!e||("text"===t?"IMG"!==e.tagName&&!!this.orig(e).text:"link"===t?"A"===e.tagName:"image"!==t||"IMG"===e.tagName)}newDraft(t,e){const i=this.orig(t),n="IMG"===t.tagName?"image":this.enabled("text",t)?"text":"A"===t.tagName?"link":"hide";return{action:n,text:i.text.slice(0,_),url:("image"===n?i.src:i.href)||"",slotName:"",position:"after",selector:e,editingId:null,touched:!1}}draftOf(t){const e=D[t.operation];return{action:e,text:"replace_text"===t.operation&&t.value||"",url:("link"===e||"image"===e)&&t.value||"",slotName:t.placementKey||"",position:t.position||"after",selector:t.selector,editingId:t.id,touched:!0}}orig(t){return this.originals.get(t)||{text:R(t),href:t.getAttribute("href"),src:t.getAttribute("src")}}focusEdit(t){const e=this.edits.filter(e=>e.id===t)[0];if(!e||!this.active)return!1;const i=M(e.selector)[0]||null;if(i){try{i.scrollIntoView({block:"center"})}catch(t){}this.select(i,e)}else this.selected=null,this.place(this.selBox,null),this.draft=this.draftOf(e),this.showCss=!0,this.renderPanel(),this.renderDock(),this.renderHelp(),this.renderPreview();return!0}draftEdit(t){const e={id:t.editingId||"",selector:t.selector.trim()};if(!i(e.selector))return null;const o=I[t.action];if("hide"===t.action)return Object.assign(Object.assign({},e),{operation:o});if("text"===t.action)return t.text.trim()&&t.text.length<=_?Object.assign(Object.assign({},e),{operation:o,value:t.text}):null;if("link"===t.action||"image"===t.action)return n(t.url)?Object.assign(Object.assign({},e),{operation:o,value:t.url.trim()}):null;const s=g(t.slotName);return z.test(s)?Object.assign(Object.assign({},e),{operation:o,placementKey:s,position:t.position}):null}save(){var t,e;const i=this.draft,n=i&&this.draftEdit(i);if(!i||!n)return;const o=this.selected||M(n.selector)[0]||null;this.pick(o,n.selector,n.operation,null!==(e=null!==(t=n.value)&&void 0!==t?t:n.placementKey)&&void 0!==e?e:"",{id:i.editingId||void 0,position:n.position})}pick(t,e,o,s,a={}){const l=a.id||`e${Math.random().toString(36).slice(2,10).padEnd(8,"0")}`,c=t?t.tagName.toLowerCase():"",d=t?this.orig(t).text.slice(0,200):"";let p=null;if(i(e)){const t={id:l,selector:e.trim()};if("hide"===o)p=Object.assign(Object.assign({},t),{operation:o});else if("replace_text"===o)p=(s||d)&&(s||d).length<=_?Object.assign(Object.assign({},t),{operation:o,value:s||d}):null;else if("replace_image"===o||"replace_link"===o)p=n(s)?Object.assign(Object.assign({},t),{operation:o,value:s.trim()}):null;else if("insert_placement"===o){const e=g(s);p=z.test(e)?Object.assign(Object.assign({},t),{operation:o,placementKey:e,position:a.position||"after"}):null}}if(!p)return!1;const h=Object.assign(Object.assign({type:r},p),{tag:c,text:d});this.send(h);const u=this.edits.map(t=>t.id).indexOf(l);return this.history.push({id:l,before:u>=0?this.edits[u]:null}),u>=0?this.edits[u]=p:this.edits.push(p),this.closePanel(),!0}cancel(){this.closePanel()}closePanel(){var t,e;this.draft=null,this.selected=null,null===(t=this.panel)||void 0===t||t.remove(),this.panel=null,null===(e=this.wrap)||void 0===e||e.classList.remove("open"),this.place(this.selBox,null),this.renderPreview(),this.renderDock(),this.renderHelp()}undo(){if(!this.synced)return!1;const t=this.history.pop();if(!t)return!1;const e=this.edits.map(t=>t.id).indexOf(t.id);if(t.before){e>=0&&(this.edits[e]=t.before);const i=t.before;this.send(Object.assign(Object.assign({type:r},i),{tag:"",text:""}))}else e>=0&&this.edits.splice(e,1),this.send({type:"joryio:editor-remove",id:t.id});return this.draft?this.closePanel():(this.renderPreview(),this.renderDock()),!0}done(){this.send({type:"joryio:editor-done"}),this.stop();try{this.opener.focus()}catch(t){}try{window.close()}catch(t){}}clearPreview(){for(const t of this.previewUndo.splice(0).reverse())try{t()}catch(t){}}renderPreview(){if(this.clearPreview(),!this.active)return;const t=this.draft,e=t?this.draftEdit(t):null,i=[];for(const n of this.edits)i.push(t&&t.editingId===n.id&&e||n);t&&!t.editingId&&e&&t.touched&&i.push(e);for(const t of i)for(const e of M(t.selector).slice(0,50))this.applyPreview(t,e);this.selected&&this.place(this.selBox,this.selected)}previewNode(t){const e=document.createElement("joryio-editor-preview");e.setAttribute("data-joryio-editor","preview"),e.setAttribute("style","all:initial !important;display:block !important;margin:10px 0 !important");const i=e.attachShadow({mode:"open"});return i.appendChild(k("style",null,A)),t(i),e}applyPreview(t,e){this.originals.has(e)||this.originals.set(e,{text:R(e),href:e.getAttribute("href"),src:e.getAttribute("src")});const i=this.previewUndo,n=(t,n)=>{const o=e.getAttribute(t);null===n?e.removeAttribute(t):e.setAttribute(t,n),i.push(()=>null===o?e.removeAttribute(t):e.setAttribute(t,o))},o=()=>{const t=e.style;if(!t)return;const n=t.getPropertyValue("display"),o=t.getPropertyPriority("display");t.setProperty("display","none","important"),i.push(()=>n?t.setProperty("display",n,o):t.removeProperty("display"))},s=(t,n)=>{const o=e.parentNode;"before"===n&&o?o.insertBefore(t,e):"after"!==n&&"replace"!==n||!o?"prepend"===n?e.insertBefore(t,e.firstChild):e.appendChild(t):o.insertBefore(t,e.nextSibling),i.push(()=>t.parentNode&&t.parentNode.removeChild(t))};switch(t.operation){case"replace_text":{const n=Array.from(e.childNodes);e.textContent=(r=t.value||"",a=this.ctx.sample,(r||"").replace(new RegExp(d.source,"g"),(t,e)=>{const i=e.trim(),n=i.split("|")[0].trim(),o=p.exec(i);return Object.prototype.hasOwnProperty.call(a,n)&&""!==a[n]?a[n]:o&&h(o[1])?h(o[1]):`[${n.replace(/^user\.(custom\.)?/,"")}]`})),i.push(()=>{e.textContent="";for(const t of n)e.appendChild(t)});break}case"replace_link":n("href",t.value||null);break;case"replace_image":n("srcset",null),n("src",t.value||null);break;case"hide":{const t=`${this.t[m(e.tagName)]} "${this.orig(e).text.slice(0,40)}"`;s(this.previewNode(e=>e.appendChild(k("div",{class:"x"},`${this.t.hiddenFor}: ${t}`))),"after"),o();break}case"insert_placement":{const e=t.position||"after";s(this.previewNode(e=>e.appendChild(k("div",{class:"s"},k("b",null,`${this.t.slotPreview} · `),k("code",null,t.placementKey||""),k("div",null,this.t.slotHelp)))),e),"replace"===e&&o();break}}var r,a}renderHelp(){var t;null===(t=this.help)||void 0===t||t.remove(),this.help=null;let e=!1;try{e="1"===localStorage.getItem(S)}catch(t){}if(e||this.draft||!this.wrap)return;const i=this.t,n=(t,e)=>k("div",{class:"row"},k("span",{class:"kbd"},t),e),o=k("button",{class:"x",type:"button","aria-label":i.dismiss,title:i.dismiss,"data-j":"help-dismiss"},v("close",13));o.addEventListener("click",()=>{var t;try{localStorage.setItem(S,"1")}catch(t){}null===(t=this.help)||void 0===t||t.remove(),this.help=null}),this.help=k("div",{class:"help","data-j":"help",role:"note"},o,k("h3",null,i.helpTitle),n("↑",i.helpUp),n("↓",i.helpDown),n(i.helpClickKey,i.helpClick)),this.wrap.appendChild(this.help)}editTitle(t){const e=M(t.selector)[0],i=this.t[e?m(e.tagName):m(t.selector,!0)];return`${this.t[H[D[t.operation]]]} · ${i}`}togglePop(t){this.popOpen=t,this.renderDock()}renderDock(){var t;if(!this.wrap)return;const e=this.t;null===(t=this.dock)||void 0===t||t.remove();const i=this.edits.length,n=[this.ctx.variantName?c(e.variant,{name:this.ctx.variantName}):"",location.pathname||"/"].filter(Boolean).join(" · "),o=k("button",{class:"db",type:"button","aria-expanded":String(this.popOpen),"data-j":"edits"},1===i?e.editsOne:c(e.editsMany,{n:i}),v(this.popOpen?"down":"up",11));o.addEventListener("click",()=>this.togglePop(!this.popOpen));const s=this.synced&&this.history.length>0,r=k("button",{class:"ib",type:"button","aria-label":e.undo,title:this.synced?e.undo:e.undoOffline,disabled:!s,"data-j":"undo"},v("undo",14));r.addEventListener("click",()=>this.undo());const a=k("button",{class:"go",type:"button","data-j":"done"},e.saveReturn);a.addEventListener("click",()=>this.done());const l=k("div",{class:"dock","data-j":"dock",role:"toolbar","aria-label":e.title},k("span",{class:"logo","aria-hidden":"true"},"J"),k("span",{class:"name","data-j":"campaign"},this.ctx.campaignName||e.title),k("span",{class:"sub"},`· ${n}`),k("span",{class:"sep"}),k("span",{class:"hint","data-j":"hint"},v("cursor",13),this.draft?e.hintEditing:e.hintPoint),k("span",{class:"sep"}),o,r,a);if(this.popOpen){const t=k("div",{class:"pop","data-j":"edit-list",role:"menu"});i||t.appendChild(k("div",{class:"empty"},e.noEdits)),this.edits.forEach((e,i)=>{const n=k("button",{class:"e",type:"button",role:"menuitem","data-j":"edit-item","data-edit-id":e.id},k("span",{class:"num"},String(i+1)),this.editTitle(e));n.addEventListener("click",()=>this.focusEdit(e.id)),t.appendChild(n)}),l.appendChild(t)}this.dock=l,this.wrap.appendChild(l)}renderPanel(){var t;const e=this.draft;if(!e||!this.wrap)return;const n=this.t,o=this.selected;null===(t=this.panel)||void 0===t||t.remove(),this.wrap.classList.add("open");const s=k("div",{class:"crumbs","data-j":"crumbs"});if(o){const t=[];for(let e=o;e&&e!==document.body&&e!==document.documentElement;e=e.parentElement)t.unshift(e);const e=t.slice(-3),i=(t,e,i)=>{const n=k("button",{class:i?"crumb cur":"crumb",type:"button","data-j":"crumb","aria-current":i?"true":void 0,disabled:!e},t);return e&&!i&&n.addEventListener("click",()=>this.select(e)),n};s.appendChild(i(n.page,null,!1));for(const t of e)s.append(v("chevron",9),i(n[m(t.tagName)],t,t===o));const r=k("button",{type:"button","aria-label":n.up,title:n.up,"data-j":"up",disabled:!o.parentElement||o.parentElement===document.body},v("up",12));r.addEventListener("click",()=>this.move("up",o));const a=k("button",{type:"button","aria-label":n.down,title:n.down,"data-j":"down",disabled:!Array.from(o.children).some(t=>!C(t))},v("down",12));a.addEventListener("click",()=>this.move("down",o)),s.appendChild(k("span",{class:"nav"},r,a))}const r=n[o?m(o.tagName):m(e.selector,!0)],a=o?"IMG"===o.tagName?o.getAttribute("alt")||"":this.orig(o).text:"",l=k("div",{class:"title","data-j":"title"},a?`${r} "${a.slice(0,40)}"`:r),d=k("span",{class:"pill","data-j":"matches"}),p=k("div",{class:"hd"},s,k("div",{class:"tr"},l,d)),h=k("div",{class:"tiles",role:"radiogroup","aria-label":n.whatToDo});for(const t of N){const i=e.action===t,s=i||this.enabled(t,o),r=s?"":"link"===t?n.notLink:"image"===t?n.notImage:n.noText,a=k("button",{class:"slot"===t?"tile slot":"tile",type:"button",role:"radio","aria-checked":String(i),disabled:!s,"data-j":`action-${t}`},v(L[t]),k("span",null,k("b",null,n[H[t]]),r?k("small",null,r):null));a.addEventListener("click",()=>{this.draft&&this.draft.action!==t&&(this.draft.action=t,this.draft.touched=!0,"link"!==t&&"image"!==t||!o||(this.draft.url=("image"===t?this.orig(o).src:this.orig(o).href)||""),this.renderPanel(),this.renderPreview())}),h.appendChild(a)}const u=k("div",{"data-j":"fields"}),f=k("button",{class:"save",type:"button","data-j":"save"}),x=()=>{const t=!!this.draftEdit(e);f.disabled=!t,f.textContent=c(n.save,{action:n[H[e.action]]});const i=M(e.selector).length;d.className="pill "+(1===i?"ok":i>1?"many":"none"),d.textContent=1===i?n.matchOne:i>1?c(n.matchMany,{n:i}):n.matchNone},b=()=>{e.touched=!0,x(),this.renderPreview()};this.renderFields(u,e,o,b);const g=k("button",{class:"css",type:"button","aria-expanded":String(this.showCss),"data-j":"css-toggle"},v("code",13),n.css,v(this.showCss?"up":"down",10));g.addEventListener("click",()=>{this.showCss=!this.showCss,this.renderPanel()});const y=k("div",{class:"bd"},k("span",{class:"lbl"},n.whatToDo),h,u,g);if(this.showCss){const t=k("input",{class:"mono",dir:"ltr","aria-label":n.css,spellcheck:"false","data-j":"selector"});t.value=e.selector;const o=k("div",{class:"help2"}),s=()=>{const t=i(e.selector);o.className=t?"help2":"err",o.textContent=e.selector.trim()?t?c(n.cssHelp,{n:M(e.selector).length}):n.cssBad:n.noSelector};t.addEventListener("input",()=>{e.selector=t.value,s(),b()}),s(),y.append(k("div",{class:"mt"},t,o))}const w=k("button",{class:"cancel",type:"button","data-j":"cancel"},n.cancel);w.addEventListener("click",()=>this.cancel()),f.addEventListener("click",()=>this.save());const j=k("aside",{class:"panel","data-j":"panel",role:"dialog","aria-label":n.whatToDo},p,y,k("div",{class:"ft"},w,f));x(),this.panel=j,this.wrap.appendChild(j)}renderFields(t,e,i,o){const s=this.t;t.textContent="";const r=t=>t?k("span",{class:"was",title:t},c(s.was,{value:t.slice(0,60)})):null;if("text"===e.action){const n=k("textarea",{rows:"3",dir:"auto","data-j":"text","aria-label":s.newText});n.value=e.text;const a=k("div",{"data-j":"fallback-box"}),l=()=>{a.textContent="";const t=f(e.text);if(null===t)return;const i=k("input",{dir:"auto","data-j":"fallback","aria-label":s.fallback});i.value=t,i.addEventListener("input",()=>{var t,s;e.text=(t=e.text,s=i.value,(t||"").replace(new RegExp(d.source,"g"),(t,e)=>{const i=e.trim().replace(new RegExp(p.source,"g"),"").trim();return s?`{{ ${i} | default: ${x(s)} }}`:`{{ ${i} }}`})),n.value=e.text,o()}),a.append(k("div",{class:"mt"},k("label",{class:"lbl"},s.fallback),i,k("div",{class:"help2"},s.fallbackHelp)))};let c=u(e.text).length>0;n.addEventListener("input",()=>{e.text=n.value;const t=u(e.text).length>0;t!==c&&(c=t,l()),o()});const h=k("div",{class:"chips","data-j":"chips"},k("span",null,s.insert)),g=this.ctx.attributes.length?this.ctx.attributes:[{name:"firstName",custom:!1},{name:"lastName",custom:!1}];for(const t of g.slice(0,12)){const i=k("button",{class:"vc",type:"button","data-j":"chip"},t.name);i.addEventListener("click",()=>{const i=b(t.name,t.custom,f(e.text)||null);e.text=e.text?`${e.text.replace(/\s+$/,"")} ${i}`:i,n.value=e.text,c||(c=!0,l()),o()}),h.appendChild(i)}t.append(k("div",{class:"fr"},k("label",{class:"lbl"},s.newText),r(i?this.orig(i).text:null)),n,h,a),l()}else if("link"===e.action||"image"===e.action){const a=k("input",{type:"url",dir:"ltr",inputmode:"url",placeholder:"https://","data-j":"url","aria-label":"link"===e.action?s.newLink:s.newImage});a.value=e.url;const l=k("div",{class:"err"}),c=()=>l.textContent=e.url.trim()&&!n(e.url)?s.urlBad:"";a.addEventListener("input",()=>{e.url=a.value,c(),o()}),c();const d=i?"image"===e.action?this.orig(i).src:this.orig(i).href:null;t.append(k("div",{class:"fr"},k("label",{class:"lbl"},"link"===e.action?s.newLink:s.newImage),r(d)),a,l)}else if("hide"===e.action){const n=s[i?m(i.tagName):m(e.selector,!0)].toLowerCase();t.appendChild(k("div",{class:"note","data-j":"hide-note"},c(s.hideNote,{kind:n})))}else{const i=k("input",{class:"slotin",dir:"auto","data-j":"slot-name","aria-label":s.slotName,maxlength:"80"});i.value=e.slotName;const n=k("span",{class:"key","data-j":"slot-key"}),r=k("div",{class:"help2"}),a=()=>{const t=g(e.slotName);n.textContent=t||"-",r.textContent="",r.append(`${s.savedAs} `,n,t?"":` · ${s.slotEmpty}`)};if(i.addEventListener("input",()=>{e.slotName=i.value,a(),o()}),a(),t.append(k("label",{class:"lbl"},s.slotName),i,r),this.ctx.placements.length){const n=k("div",{class:"chips","data-j":"placements"});for(const t of this.ctx.placements.slice(0,12)){const s=k("button",{class:"vc",type:"button",title:t.name||t.key,"data-j":"placement"},t.key);s.addEventListener("click",()=>{e.slotName=t.key,i.value=t.key,a(),o()}),n.appendChild(s)}t.appendChild(n)}t.appendChild(k("div",{class:"help2"},s.slotHelp));const l=k("div",{class:"seg",role:"radiogroup","aria-label":s.where,"data-j":"positions"});for(const[t,i]of T){const n=k("button",{type:"button",role:"radio","aria-checked":String(e.position===t),"data-j":`pos-${t}`},s[i]);n.addEventListener("click",()=>{e.position=t;for(const t of Array.from(l.children))t.setAttribute("aria-checked",String(t===n));o()}),l.appendChild(n)}t.append(k("div",{class:"mt"},k("span",{class:"lbl"},s.where),l))}}}const J={version:1,start({dashboardOrigin:t,opener:e,logger:i,onStop:n}){const o=new U(t,e,i,n);return o.start(),{stop:()=>o.stop()}}};"undefined"==typeof window||window[a]||(window[a]=J)}();
7
7
  //# sourceMappingURL=joryio-editor.min.js.map