@simai-studio/mail 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +188 -0
- package/README.md +79 -2
- package/dist/package-receipt.json +1176 -0
- package/dist/set.json +97 -0
- package/dist/smart/mail-canvas/component.json +562 -0
- package/dist/smart/mail-canvas/component.json.gz +0 -0
- package/dist/smart/mail-canvas/css/mail-canvas.css +85 -0
- package/dist/smart/mail-canvas/css/mail-canvas.css.gz +0 -0
- package/dist/smart/mail-canvas/css/mail-canvas.min.css +2 -0
- package/dist/smart/mail-canvas/css/mail-canvas.min.css.gz +0 -0
- package/dist/smart/mail-canvas/examples.json +731 -0
- package/dist/smart/mail-canvas/examples.json.gz +0 -0
- package/dist/smart/mail-canvas/js/mail-canvas.js +1039 -0
- package/dist/smart/mail-canvas/js/mail-canvas.js.gz +0 -0
- package/dist/smart/mail-canvas/js/mail-canvas.min.js +22 -0
- package/dist/smart/mail-canvas/js/mail-canvas.min.js.gz +0 -0
- package/dist/smart/mail-canvas/lang/en.json +25 -0
- package/dist/smart/mail-canvas/lang/en.json.gz +0 -0
- package/dist/smart/mail-canvas/lang/ru.json +25 -0
- package/dist/smart/mail-canvas/lang/ru.json.gz +0 -0
- package/dist/smart/mail-canvas/probe.json +465 -0
- package/dist/smart/mail-canvas/probe.json.gz +0 -0
- package/dist/smart/mail-canvas/smart.manifest.json +550 -0
- package/dist/smart/mail-canvas/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-canvas/static/default/notes.html +43 -0
- package/dist/smart/mail-canvas/static/default/notes.html.gz +0 -0
- package/dist/smart/mail-canvas/static/default/phone.html +43 -0
- package/dist/smart/mail-canvas/static/default/phone.html.gz +0 -0
- package/dist/smart/mail-canvas/static/default/reference.html +48 -0
- package/dist/smart/mail-canvas/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-canvas/static/sheets.json +132 -0
- package/dist/smart/mail-canvas/static/sheets.json.gz +0 -0
- package/dist/smart/mail-canvas/studio.fixture.json +63 -0
- package/dist/smart/mail-canvas/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-canvas/studio.scenario.json +39 -0
- package/dist/smart/mail-canvas/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-canvas/template/default.css +73 -0
- package/dist/smart/mail-canvas/template/default.css.gz +0 -0
- package/dist/smart/mail-canvas/template/default.js +38 -0
- package/dist/smart/mail-canvas/template/default.js.gz +0 -0
- package/dist/smart/mail-inspector/component.json +768 -0
- package/dist/smart/mail-inspector/component.json.gz +0 -0
- package/dist/smart/mail-inspector/css/mail-inspector.css +194 -0
- package/dist/smart/mail-inspector/css/mail-inspector.css.gz +0 -0
- package/dist/smart/mail-inspector/css/mail-inspector.min.css +2 -0
- package/dist/smart/mail-inspector/css/mail-inspector.min.css.gz +0 -0
- package/dist/smart/mail-inspector/examples.json +1301 -0
- package/dist/smart/mail-inspector/examples.json.gz +0 -0
- package/dist/smart/mail-inspector/js/mail-inspector.js +1619 -0
- package/dist/smart/mail-inspector/js/mail-inspector.js.gz +0 -0
- package/dist/smart/mail-inspector/js/mail-inspector.min.js +103 -0
- package/dist/smart/mail-inspector/js/mail-inspector.min.js.gz +0 -0
- package/dist/smart/mail-inspector/lang/en.json +29 -0
- package/dist/smart/mail-inspector/lang/en.json.gz +0 -0
- package/dist/smart/mail-inspector/lang/ru.json +29 -0
- package/dist/smart/mail-inspector/lang/ru.json.gz +0 -0
- package/dist/smart/mail-inspector/probe.json +648 -0
- package/dist/smart/mail-inspector/probe.json.gz +0 -0
- package/dist/smart/mail-inspector/smart.manifest.json +920 -0
- package/dist/smart/mail-inspector/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-inspector/static/default/item.html +189 -0
- package/dist/smart/mail-inspector/static/default/item.html.gz +0 -0
- package/dist/smart/mail-inspector/static/default/letter.html +247 -0
- package/dist/smart/mail-inspector/static/default/letter.html.gz +0 -0
- package/dist/smart/mail-inspector/static/default/reference.html +545 -0
- package/dist/smart/mail-inspector/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-inspector/static/sheets.json +226 -0
- package/dist/smart/mail-inspector/static/sheets.json.gz +0 -0
- package/dist/smart/mail-inspector/studio.fixture.json +232 -0
- package/dist/smart/mail-inspector/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-inspector/studio.scenario.json +43 -0
- package/dist/smart/mail-inspector/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-inspector/template/default.css +190 -0
- package/dist/smart/mail-inspector/template/default.css.gz +0 -0
- package/dist/smart/mail-inspector/template/default.js +249 -0
- package/dist/smart/mail-inspector/template/default.js.gz +0 -0
- package/dist/smart/mail-letters/component.json +455 -0
- package/dist/smart/mail-letters/component.json.gz +0 -0
- package/dist/smart/mail-letters/css/mail-letters.css +72 -0
- package/dist/smart/mail-letters/css/mail-letters.css.gz +0 -0
- package/dist/smart/mail-letters/css/mail-letters.min.css +2 -0
- package/dist/smart/mail-letters/css/mail-letters.min.css.gz +0 -0
- package/dist/smart/mail-letters/examples.json +477 -0
- package/dist/smart/mail-letters/examples.json.gz +0 -0
- package/dist/smart/mail-letters/js/mail-letters.js +1772 -0
- package/dist/smart/mail-letters/js/mail-letters.js.gz +0 -0
- package/dist/smart/mail-letters/js/mail-letters.min.js +35 -0
- package/dist/smart/mail-letters/js/mail-letters.min.js.gz +0 -0
- package/dist/smart/mail-letters/lang/en.json +29 -0
- package/dist/smart/mail-letters/lang/en.json.gz +0 -0
- package/dist/smart/mail-letters/lang/ru.json +31 -0
- package/dist/smart/mail-letters/lang/ru.json.gz +0 -0
- package/dist/smart/mail-letters/probe.json +290 -0
- package/dist/smart/mail-letters/probe.json.gz +0 -0
- package/dist/smart/mail-letters/smart.manifest.json +476 -0
- package/dist/smart/mail-letters/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-letters/static/default/by-title.html +177 -0
- package/dist/smart/mail-letters/static/default/by-title.html.gz +0 -0
- package/dist/smart/mail-letters/static/default/empty.html +88 -0
- package/dist/smart/mail-letters/static/default/empty.html.gz +0 -0
- package/dist/smart/mail-letters/static/default/nothing-found.html +88 -0
- package/dist/smart/mail-letters/static/default/nothing-found.html.gz +0 -0
- package/dist/smart/mail-letters/static/default/reference.html +168 -0
- package/dist/smart/mail-letters/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-letters/static/sheets.json +245 -0
- package/dist/smart/mail-letters/static/sheets.json.gz +0 -0
- package/dist/smart/mail-letters/studio.fixture.json +41 -0
- package/dist/smart/mail-letters/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-letters/studio.scenario.json +41 -0
- package/dist/smart/mail-letters/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-letters/template/default.css +79 -0
- package/dist/smart/mail-letters/template/default.css.gz +0 -0
- package/dist/smart/mail-letters/template/default.js +61 -0
- package/dist/smart/mail-letters/template/default.js.gz +0 -0
- package/dist/smart/mail-library/component.json +512 -0
- package/dist/smart/mail-library/component.json.gz +0 -0
- package/dist/smart/mail-library/css/mail-library.css +149 -0
- package/dist/smart/mail-library/css/mail-library.css.gz +0 -0
- package/dist/smart/mail-library/css/mail-library.min.css +2 -0
- package/dist/smart/mail-library/css/mail-library.min.css.gz +0 -0
- package/dist/smart/mail-library/examples.json +616 -0
- package/dist/smart/mail-library/examples.json.gz +0 -0
- package/dist/smart/mail-library/js/mail-library.js +559 -0
- package/dist/smart/mail-library/js/mail-library.js.gz +0 -0
- package/dist/smart/mail-library/js/mail-library.min.js +52 -0
- package/dist/smart/mail-library/js/mail-library.min.js.gz +0 -0
- package/dist/smart/mail-library/lang/en.json +21 -0
- package/dist/smart/mail-library/lang/en.json.gz +0 -0
- package/dist/smart/mail-library/lang/ru.json +21 -0
- package/dist/smart/mail-library/lang/ru.json.gz +0 -0
- package/dist/smart/mail-library/probe.json +275 -0
- package/dist/smart/mail-library/probe.json.gz +0 -0
- package/dist/smart/mail-library/smart.manifest.json +512 -0
- package/dist/smart/mail-library/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-library/static/default/category.html +85 -0
- package/dist/smart/mail-library/static/default/category.html.gz +0 -0
- package/dist/smart/mail-library/static/default/nothing-found.html +81 -0
- package/dist/smart/mail-library/static/default/nothing-found.html.gz +0 -0
- package/dist/smart/mail-library/static/default/one-group.html +67 -0
- package/dist/smart/mail-library/static/default/one-group.html.gz +0 -0
- package/dist/smart/mail-library/static/default/reference.html +135 -0
- package/dist/smart/mail-library/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-library/static/sheets.json +180 -0
- package/dist/smart/mail-library/static/sheets.json.gz +0 -0
- package/dist/smart/mail-library/studio.fixture.json +75 -0
- package/dist/smart/mail-library/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-library/studio.scenario.json +41 -0
- package/dist/smart/mail-library/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-library/template/default.css +133 -0
- package/dist/smart/mail-library/template/default.css.gz +0 -0
- package/dist/smart/mail-library/template/default.js +83 -0
- package/dist/smart/mail-library/template/default.js.gz +0 -0
- package/dist/smart/mail-structure/component.json +497 -0
- package/dist/smart/mail-structure/component.json.gz +0 -0
- package/dist/smart/mail-structure/css/mail-structure.css +106 -0
- package/dist/smart/mail-structure/css/mail-structure.css.gz +0 -0
- package/dist/smart/mail-structure/css/mail-structure.min.css +2 -0
- package/dist/smart/mail-structure/css/mail-structure.min.css.gz +0 -0
- package/dist/smart/mail-structure/examples.json +286 -0
- package/dist/smart/mail-structure/examples.json.gz +0 -0
- package/dist/smart/mail-structure/js/mail-structure.js +767 -0
- package/dist/smart/mail-structure/js/mail-structure.js.gz +0 -0
- package/dist/smart/mail-structure/js/mail-structure.min.js +48 -0
- package/dist/smart/mail-structure/js/mail-structure.min.js.gz +0 -0
- package/dist/smart/mail-structure/lang/en.json +22 -0
- package/dist/smart/mail-structure/lang/en.json.gz +0 -0
- package/dist/smart/mail-structure/lang/ru.json +22 -0
- package/dist/smart/mail-structure/lang/ru.json.gz +0 -0
- package/dist/smart/mail-structure/probe.json +112 -0
- package/dist/smart/mail-structure/probe.json.gz +0 -0
- package/dist/smart/mail-structure/smart.manifest.json +495 -0
- package/dist/smart/mail-structure/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-structure/static/default/empty.html +76 -0
- package/dist/smart/mail-structure/static/default/empty.html.gz +0 -0
- package/dist/smart/mail-structure/static/default/reference.html +98 -0
- package/dist/smart/mail-structure/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-structure/static/default/settings.html +98 -0
- package/dist/smart/mail-structure/static/default/settings.html.gz +0 -0
- package/dist/smart/mail-structure/static/sheets.json +142 -0
- package/dist/smart/mail-structure/static/sheets.json.gz +0 -0
- package/dist/smart/mail-structure/studio.fixture.json +45 -0
- package/dist/smart/mail-structure/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-structure/studio.scenario.json +42 -0
- package/dist/smart/mail-structure/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-structure/template/default.css +100 -0
- package/dist/smart/mail-structure/template/default.css.gz +0 -0
- package/dist/smart/mail-structure/template/default.js +80 -0
- package/dist/smart/mail-structure/template/default.js.gz +0 -0
- package/dist/smart/rule.js +161 -0
- package/dist/smart/rule.js.gz +0 -0
- package/package.json +29 -4
|
@@ -0,0 +1,1619 @@
|
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ "151a293c8c90"
|
|
6
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
|
+
|
|
8
|
+
__webpack_require__.r(__webpack_exports__);
|
|
9
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10
|
+
/* harmony export */ ariaKeyShortcuts: () => (/* binding */ ariaKeyShortcuts),
|
|
11
|
+
/* harmony export */ isApplePlatform: () => (/* binding */ isApplePlatform),
|
|
12
|
+
/* harmony export */ isCommandShortcut: () => (/* binding */ isCommandShortcut),
|
|
13
|
+
/* harmony export */ isEditableTarget: () => (/* binding */ isEditableTarget),
|
|
14
|
+
/* harmony export */ matchesShortcut: () => (/* binding */ matchesShortcut),
|
|
15
|
+
/* harmony export */ parseShortcut: () => (/* binding */ parseShortcut),
|
|
16
|
+
/* harmony export */ shortcutCaps: () => (/* binding */ shortcutCaps),
|
|
17
|
+
/* harmony export */ shortcutView: () => (/* binding */ shortcutView)
|
|
18
|
+
/* harmony export */ });
|
|
19
|
+
// A key combination as a `shortcut` setting writes it (sf-button, an entry
|
|
20
|
+
// of sf-menu-context, a row of sf-search): words joined by +, the modifiers
|
|
21
|
+
// first and the key last -- mod+k, shift+/, /, escape. `mod` is the
|
|
22
|
+
// platform's command modifier: Cmd on Apple platforms, Ctrl elsewhere. Read
|
|
23
|
+
// once per render; nothing here holds state.
|
|
24
|
+
//
|
|
25
|
+
// The kbd component owns how a combination reads (owner decision 2026-11-07,
|
|
26
|
+
// docs review R030, rule C04): on an Apple platform the modifiers are glyphs
|
|
27
|
+
// in the platform's order, side by side (⇧⌘P); elsewhere they are words in
|
|
28
|
+
// Ctrl+Shift+P order, and shortcutView() says to join them with + -- the kbd
|
|
29
|
+
// sheet shows the joins where keys are plain glyphs (a menu row, a tooltip)
|
|
30
|
+
// and hides them between caps, which stand apart. A host renders the view
|
|
31
|
+
// and never styles the keys.
|
|
32
|
+
const MODIFIERS = ['mod', 'ctrl', 'alt', 'shift', 'meta']; // What a person reads on a key cap, per platform.
|
|
33
|
+
|
|
34
|
+
const MAC_CAPS = {
|
|
35
|
+
mod: '⌘',
|
|
36
|
+
meta: '⌘',
|
|
37
|
+
ctrl: '⌃',
|
|
38
|
+
alt: '⌥',
|
|
39
|
+
shift: '⇧'
|
|
40
|
+
};
|
|
41
|
+
const OTHER_CAPS = {
|
|
42
|
+
mod: 'Ctrl',
|
|
43
|
+
meta: 'Win',
|
|
44
|
+
ctrl: 'Ctrl',
|
|
45
|
+
alt: 'Alt',
|
|
46
|
+
shift: 'Shift'
|
|
47
|
+
}; // A cap of one character -- a letter, ⌘, ⇧, ↵ -- is a square key; a cap of
|
|
48
|
+
// several letters (Esc, Ctrl, Shift) hugs its word (sheet:
|
|
49
|
+
// .sf-button-shortcut-key--square). A modifier's cap is the platform's own
|
|
50
|
+
// word, so a page printed on a Mac and drawn on Windows widens by the
|
|
51
|
+
// difference: the keys are true to their caps, not to the widest platform
|
|
52
|
+
// (docs review R010, 2026-11-06).
|
|
53
|
+
|
|
54
|
+
const KEY_CAPS = {
|
|
55
|
+
enter: '↵',
|
|
56
|
+
return: '↵',
|
|
57
|
+
escape: 'Esc',
|
|
58
|
+
esc: 'Esc',
|
|
59
|
+
tab: 'Tab',
|
|
60
|
+
space: 'Space',
|
|
61
|
+
backspace: '⌫',
|
|
62
|
+
delete: 'Del',
|
|
63
|
+
up: '↑',
|
|
64
|
+
down: '↓',
|
|
65
|
+
left: '←',
|
|
66
|
+
right: '→',
|
|
67
|
+
arrowup: '↑',
|
|
68
|
+
arrowdown: '↓',
|
|
69
|
+
arrowleft: '←',
|
|
70
|
+
arrowright: '→',
|
|
71
|
+
home: 'Home',
|
|
72
|
+
end: 'End',
|
|
73
|
+
pageup: 'PgUp',
|
|
74
|
+
pagedown: 'PgDn'
|
|
75
|
+
}; // An Apple keyboard's own signs where they differ (component.kbd 1.3.3, CM-9
|
|
76
|
+
// of ui-control research 2026-11-14-context-menu): forward delete is ⌦, as
|
|
77
|
+
// macOS menus print it; Del is a Windows word.
|
|
78
|
+
|
|
79
|
+
const MAC_KEY_CAPS = {
|
|
80
|
+
delete: '⌦'
|
|
81
|
+
}; // The names of KeyboardEvent.key for the words above.
|
|
82
|
+
|
|
83
|
+
const KEY_NAMES = {
|
|
84
|
+
enter: 'Enter',
|
|
85
|
+
return: 'Enter',
|
|
86
|
+
escape: 'Escape',
|
|
87
|
+
esc: 'Escape',
|
|
88
|
+
tab: 'Tab',
|
|
89
|
+
space: ' ',
|
|
90
|
+
backspace: 'Backspace',
|
|
91
|
+
delete: 'Delete',
|
|
92
|
+
up: 'ArrowUp',
|
|
93
|
+
down: 'ArrowDown',
|
|
94
|
+
left: 'ArrowLeft',
|
|
95
|
+
right: 'ArrowRight',
|
|
96
|
+
arrowup: 'ArrowUp',
|
|
97
|
+
arrowdown: 'ArrowDown',
|
|
98
|
+
arrowleft: 'ArrowLeft',
|
|
99
|
+
arrowright: 'ArrowRight',
|
|
100
|
+
home: 'Home',
|
|
101
|
+
end: 'End',
|
|
102
|
+
pageup: 'PageUp',
|
|
103
|
+
pagedown: 'PageDown'
|
|
104
|
+
}; // KeyboardEvent.code of the punctuation a shortcut is usually written with,
|
|
105
|
+
// so the combination is heard on any keyboard layout.
|
|
106
|
+
|
|
107
|
+
const PUNCTUATION_CODES = {
|
|
108
|
+
'/': 'Slash',
|
|
109
|
+
'.': 'Period',
|
|
110
|
+
',': 'Comma',
|
|
111
|
+
';': 'Semicolon',
|
|
112
|
+
"'": 'Quote',
|
|
113
|
+
'[': 'BracketLeft',
|
|
114
|
+
']': 'BracketRight',
|
|
115
|
+
'-': 'Minus',
|
|
116
|
+
'=': 'Equal',
|
|
117
|
+
'`': 'Backquote',
|
|
118
|
+
'\\': 'Backslash'
|
|
119
|
+
};
|
|
120
|
+
function isApplePlatform() {
|
|
121
|
+
const platform = globalThis.navigator?.userAgentData?.platform || globalThis.navigator?.platform || '';
|
|
122
|
+
return /mac|iphone|ipad|ipod/iu.test(platform);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The combination as parts: `{modifiers: Set, key}`, or null when there is
|
|
126
|
+
* none. `+` as the key itself is written `mod+plus`.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
function parseShortcut(value) {
|
|
130
|
+
const text = String(value ?? '').trim().toLowerCase();
|
|
131
|
+
if (!text) return null;
|
|
132
|
+
const words = text === '+' ? ['+'] : text.split('+').map(word => word.trim()).filter(Boolean);
|
|
133
|
+
if (!words.length) return null;
|
|
134
|
+
const key = words.at(-1) === 'plus' ? '+' : words.at(-1);
|
|
135
|
+
const modifiers = new Set(words.slice(0, -1).filter(word => MODIFIERS.includes(word)));
|
|
136
|
+
return {
|
|
137
|
+
modifiers,
|
|
138
|
+
key
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* What the keys read, one cap per key in the platform's words: {text, square},
|
|
143
|
+
* square when the cap is one character.
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
function shortcutCaps(parsed, apple = isApplePlatform()) {
|
|
147
|
+
if (!parsed) return [];
|
|
148
|
+
const caps = apple ? MAC_CAPS : OTHER_CAPS;
|
|
149
|
+
const order = apple ? ['ctrl', 'alt', 'shift', 'mod', 'meta'] : ['mod', 'ctrl', 'meta', 'alt', 'shift'];
|
|
150
|
+
const modifiers = [];
|
|
151
|
+
|
|
152
|
+
for (const name of order.filter(one => parsed.modifiers.has(one))) {
|
|
153
|
+
// On a Mac mod and meta are one key.
|
|
154
|
+
if (modifiers.includes(caps[name])) continue;
|
|
155
|
+
modifiers.push(caps[name]);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const key = (apple ? MAC_KEY_CAPS[parsed.key] : undefined) ?? KEY_CAPS[parsed.key] ?? (parsed.key.length === 1 ? parsed.key.toUpperCase() : parsed.key.charAt(0).toUpperCase() + parsed.key.slice(1));
|
|
159
|
+
return [...modifiers, key].map(text => ({
|
|
160
|
+
text,
|
|
161
|
+
square: [...text].length === 1
|
|
162
|
+
}));
|
|
163
|
+
} // A function key (F1-F24) reads as its name.
|
|
164
|
+
|
|
165
|
+
const FUNCTION_KEY = /^f(?:[1-9]|1[0-9]|2[0-4])$/u; // Whether a written value is the notation above rather than text a page
|
|
166
|
+
// already wrote for people (⇧⌘L, «Ctrl K»): every word but the last a
|
|
167
|
+
// modifier, the last one character, a named key or a function key.
|
|
168
|
+
|
|
169
|
+
function isNotation(value) {
|
|
170
|
+
const text = String(value ?? '').trim().toLowerCase();
|
|
171
|
+
if (!text || /\s/u.test(text.replace(/\s*\+\s*/gu, '+'))) return false;
|
|
172
|
+
if (text === '+') return true;
|
|
173
|
+
const words = text.split('+').map(word => word.trim());
|
|
174
|
+
if (words.some(word => !word)) return false;
|
|
175
|
+
const key = words.at(-1) === 'plus' ? '+' : words.at(-1);
|
|
176
|
+
return words.slice(0, -1).every(word => MODIFIERS.includes(word)) && ([...key].length === 1 || key in KEY_CAPS || FUNCTION_KEY.test(key));
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* What a host draws for a `shortcut` value: {keys: [{text, square}], join},
|
|
180
|
+
* the keys in this platform's words and whether they are joined with + (not
|
|
181
|
+
* on an Apple platform, and only between keys). A value that is not the
|
|
182
|
+
* notation -- text a page wrote for people, such as ⇧⌘L -- is one key of
|
|
183
|
+
* that text. Empty: no keys.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
function shortcutView(value, apple = isApplePlatform()) {
|
|
188
|
+
const text = String(value ?? '').trim();
|
|
189
|
+
if (!text) return {
|
|
190
|
+
keys: [],
|
|
191
|
+
join: false
|
|
192
|
+
};
|
|
193
|
+
if (!isNotation(text)) return {
|
|
194
|
+
keys: [{
|
|
195
|
+
text,
|
|
196
|
+
square: [...text].length === 1
|
|
197
|
+
}],
|
|
198
|
+
join: false
|
|
199
|
+
};
|
|
200
|
+
const keys = shortcutCaps(parseShortcut(text), apple);
|
|
201
|
+
return {
|
|
202
|
+
keys,
|
|
203
|
+
join: !apple && keys.length > 1
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
/** The value of aria-keyshortcuts (WAI-ARIA 1.2): Meta+K, Control+K, /. */
|
|
207
|
+
|
|
208
|
+
function ariaKeyShortcuts(parsed, apple = isApplePlatform()) {
|
|
209
|
+
if (!parsed) return '';
|
|
210
|
+
const names = [];
|
|
211
|
+
if (parsed.modifiers.has('ctrl') || parsed.modifiers.has('mod') && !apple) names.push('Control');
|
|
212
|
+
if (parsed.modifiers.has('alt')) names.push('Alt');
|
|
213
|
+
if (parsed.modifiers.has('shift')) names.push('Shift');
|
|
214
|
+
if (parsed.modifiers.has('meta') || parsed.modifiers.has('mod') && apple) names.push('Meta');
|
|
215
|
+
const key = KEY_NAMES[parsed.key] ?? (parsed.key === ' ' ? 'Space' : parsed.key.length === 1 ? parsed.key.toUpperCase() : parsed.key);
|
|
216
|
+
return [...names, key === ' ' ? 'Space' : key].join('+');
|
|
217
|
+
} // Whether the event's key is the combination's key: by the character it
|
|
218
|
+
// typed, or by the physical key for a letter, a digit or the punctuation
|
|
219
|
+
// above, so mod+k is heard on a Russian layout too.
|
|
220
|
+
|
|
221
|
+
function sameKey(event, key) {
|
|
222
|
+
const name = KEY_NAMES[key];
|
|
223
|
+
if (name) return event.key === name;
|
|
224
|
+
if (String(event.key).toLowerCase() === key) return true;
|
|
225
|
+
if (/^[a-z]$/u.test(key)) return event.code === `Key${key.toUpperCase()}`;
|
|
226
|
+
if (/^[0-9]$/u.test(key)) return event.code === `Digit${key}`;
|
|
227
|
+
return PUNCTUATION_CODES[key] !== undefined && event.code === PUNCTUATION_CODES[key];
|
|
228
|
+
}
|
|
229
|
+
/** Whether a keydown is the combination. */
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
function matchesShortcut(event, parsed, apple = isApplePlatform()) {
|
|
233
|
+
if (!parsed || !event) return false;
|
|
234
|
+
const wants = {
|
|
235
|
+
ctrl: parsed.modifiers.has('ctrl') || parsed.modifiers.has('mod') && !apple,
|
|
236
|
+
meta: parsed.modifiers.has('meta') || parsed.modifiers.has('mod') && apple,
|
|
237
|
+
alt: parsed.modifiers.has('alt'),
|
|
238
|
+
shift: parsed.modifiers.has('shift')
|
|
239
|
+
};
|
|
240
|
+
if (Boolean(event.ctrlKey) !== wants.ctrl || Boolean(event.metaKey) !== wants.meta || Boolean(event.altKey) !== wants.alt) return false; // Shift is part of typing a punctuation mark on many layouts (? is shift+/):
|
|
241
|
+
// a combination that does not name it does not mind it for punctuation, and
|
|
242
|
+
// minds it for a letter, a digit or a named key.
|
|
243
|
+
|
|
244
|
+
const punctuation = parsed.key.length === 1 && !/^[a-z0-9]$/u.test(parsed.key);
|
|
245
|
+
if (!punctuation && Boolean(event.shiftKey) !== wants.shift) return false;
|
|
246
|
+
if (punctuation && wants.shift && !event.shiftKey) return false;
|
|
247
|
+
return sameKey(event, parsed.key);
|
|
248
|
+
}
|
|
249
|
+
/** A combination with mod, ctrl, alt or meta is a command even in a field. */
|
|
250
|
+
|
|
251
|
+
function isCommandShortcut(parsed) {
|
|
252
|
+
return Boolean(parsed) && ['mod', 'ctrl', 'alt', 'meta'].some(name => parsed.modifiers.has(name));
|
|
253
|
+
}
|
|
254
|
+
/** Whether focus is where a person types: a field, a select or editable text. */
|
|
255
|
+
|
|
256
|
+
function isEditableTarget(target) {
|
|
257
|
+
const element = target instanceof Element ? target : null;
|
|
258
|
+
if (!element) return false;
|
|
259
|
+
if (element.isContentEditable) return true;
|
|
260
|
+
const tag = element.localName;
|
|
261
|
+
if (tag === 'textarea' || tag === 'select') return true;
|
|
262
|
+
if (tag !== 'input') return false;
|
|
263
|
+
const type = (element.getAttribute('type') || 'text').toLowerCase();
|
|
264
|
+
return !['button', 'submit', 'reset', 'checkbox', 'radio', 'range', 'color', 'file', 'image', 'hidden'].includes(type);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/***/ },
|
|
268
|
+
|
|
269
|
+
/***/ "655f8764d00d"
|
|
270
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
271
|
+
|
|
272
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
273
|
+
__webpack_require__.r(__webpack_exports__);
|
|
274
|
+
/* harmony import */ var _core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("deb1a4d61565");
|
|
275
|
+
/* harmony import */ var _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5b7d7695b41b");
|
|
276
|
+
/* harmony import */ var _core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("e92fd2d1a38c");
|
|
277
|
+
/* harmony import */ var _js_templates_default_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("b7e5645ce5ca");
|
|
278
|
+
/* harmony import */ var _component_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("aa5b7d941e7a");
|
|
279
|
+
/* harmony import */ var _lang_en_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("bb284bc57393");
|
|
280
|
+
/* harmony import */ var _lang_ru_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("5cdf0e37db1f");
|
|
281
|
+
/* harmony import */ var _component_kbd_js_shortcut__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("151a293c8c90");
|
|
282
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__, _js_templates_default_js__WEBPACK_IMPORTED_MODULE_3__]);
|
|
283
|
+
([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__, _js_templates_default_js__WEBPACK_IMPORTED_MODULE_3__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
284
|
+
/* harmony import */ var _core_js_smart_base__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__);
|
|
285
|
+
/* harmony import */ var _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__);
|
|
286
|
+
/* harmony import */ var _core_js_instance_path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__);
|
|
287
|
+
// sf-mail-inspector: the right panel of SIMAI Email Editor as a form drawn from
|
|
288
|
+
// data. A heading with the actions on what is being edited, the path of levels,
|
|
289
|
+
// tabs, accordion sections, and every field the editor has: text, several
|
|
290
|
+
// lines, a link, a number, a choice, a switch, a group of fields, an image and a
|
|
291
|
+
// list of items.
|
|
292
|
+
//
|
|
293
|
+
// It knows no letter, no block manifest and no store. The host passes the form
|
|
294
|
+
// in the person's language -- each field's value, error, hint and placeholder --
|
|
295
|
+
// hears what the person did and passes the form back; the element changes
|
|
296
|
+
// nothing and validates nothing. The contents of a tab with `slot` are the
|
|
297
|
+
// host's own panel.
|
|
298
|
+
//
|
|
299
|
+
// Typed text: a field being typed in is never written to, and a field whose
|
|
300
|
+
// value the host did not take keeps the typed text for as long as the host
|
|
301
|
+
// passes `error`. So the attribute `value` holds still while there is typed
|
|
302
|
+
// text (a new attribute would make sf-input write it over what came since), and
|
|
303
|
+
// afterRender() writes what a field must show only when it differs.
|
|
304
|
+
//
|
|
305
|
+
// From its component.json (standard simai.smart-component 1.4 §3, §4, §8,
|
|
306
|
+
// §11): the settings are attributes and properties made by
|
|
307
|
+
// core/js/element-manifest.js, its words are lang/<locale>.json, and the actions
|
|
308
|
+
// answer outcomes.
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
// A right click on an item opens its ⋯ menu at the pointer (decision C164
|
|
317
|
+
// (1)(2), defect TL-2) through sf-menu-context's point anchor (1.18.0: a fixed
|
|
318
|
+
// box of no size, removed when the menu closes); the context-menu key and
|
|
319
|
+
// Shift+F10 already open it (onToggleKeydown). The core's one SF.menu.open
|
|
320
|
+
// (C184) is not in the pair this is built over; when it is, openItemMenu()
|
|
321
|
+
// opens through it and this helper goes.
|
|
322
|
+
|
|
323
|
+
function pointAnchor(event) {
|
|
324
|
+
const point = document.createElement("span");
|
|
325
|
+
point.style.cssText = `position: fixed; left: ${event.clientX}px; top: ${event.clientY}px`;
|
|
326
|
+
document.body.append(point);
|
|
327
|
+
return point;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const applied = () => ({
|
|
331
|
+
outcome: "applied"
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
const refused = reason => ({
|
|
335
|
+
outcome: "refused",
|
|
336
|
+
reason
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
const TEXT_KINDS = new Set(["text", "multiline", "link", "number"]);
|
|
340
|
+
|
|
341
|
+
const text = value => value === null || value === undefined ? "" : String(value);
|
|
342
|
+
|
|
343
|
+
const imageKey = value => value ? `${value.value ?? ""}|${value.href ?? ""}` : "";
|
|
344
|
+
/** A short, stable name for a list: sf-sortable's group is at most 32 characters. */
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
const groupOf = path => {
|
|
348
|
+
let hash = 5381;
|
|
349
|
+
|
|
350
|
+
for (const character of String(path)) hash = (hash * 33 + character.charCodeAt(0)) % 4294967296;
|
|
351
|
+
|
|
352
|
+
return `items-${hash.toString(36)}`;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
const MailInspectorElement = (0,_core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__.elementFromManifest)(_component_json__WEBPACK_IMPORTED_MODULE_4__, {
|
|
356
|
+
base: (_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0___default()),
|
|
357
|
+
lang: {
|
|
358
|
+
en: _lang_en_json__WEBPACK_IMPORTED_MODULE_5__,
|
|
359
|
+
ru: _lang_ru_json__WEBPACK_IMPORTED_MODULE_6__
|
|
360
|
+
},
|
|
361
|
+
source: "ru",
|
|
362
|
+
actions: {
|
|
363
|
+
// Not `remove`: that is the DOM's own method, and the element would take itself off the page.
|
|
364
|
+
delete() {
|
|
365
|
+
if (!this.headActionList().includes("delete")) return refused("unknown");
|
|
366
|
+
this.sfEmit("delete", {});
|
|
367
|
+
return applied();
|
|
368
|
+
},
|
|
369
|
+
|
|
370
|
+
duplicate() {
|
|
371
|
+
if (!this.headActionList().includes("duplicate")) return refused("unknown");
|
|
372
|
+
this.sfEmit("duplicate", {});
|
|
373
|
+
return applied();
|
|
374
|
+
},
|
|
375
|
+
|
|
376
|
+
replace() {
|
|
377
|
+
if (!this.headActionList().includes("replace")) return refused("unknown");
|
|
378
|
+
this.sfEmit("replace", {});
|
|
379
|
+
return applied();
|
|
380
|
+
},
|
|
381
|
+
|
|
382
|
+
"level-up"() {
|
|
383
|
+
if (!this.levelList().length) return refused("top");
|
|
384
|
+
this.sfEmit("level", {
|
|
385
|
+
index: this.levelList().length - 2
|
|
386
|
+
});
|
|
387
|
+
return applied();
|
|
388
|
+
},
|
|
389
|
+
|
|
390
|
+
"go-to-level"({
|
|
391
|
+
index
|
|
392
|
+
} = {}) {
|
|
393
|
+
const at = Number(index);
|
|
394
|
+
if (!Number.isInteger(at) || at < 0 || at >= this.levelList().length) return refused("unknown");
|
|
395
|
+
this.sfEmit("level", {
|
|
396
|
+
index: at
|
|
397
|
+
});
|
|
398
|
+
return applied();
|
|
399
|
+
},
|
|
400
|
+
|
|
401
|
+
"open-tab"({
|
|
402
|
+
id
|
|
403
|
+
} = {}) {
|
|
404
|
+
const wanted = text(id);
|
|
405
|
+
if (!this.tabList().some(tab => tab.id === wanted)) return refused("unknown");
|
|
406
|
+
this.sfEmit("tab", {
|
|
407
|
+
id: wanted
|
|
408
|
+
});
|
|
409
|
+
return applied();
|
|
410
|
+
},
|
|
411
|
+
|
|
412
|
+
"toggle-section"({
|
|
413
|
+
key
|
|
414
|
+
} = {}) {
|
|
415
|
+
const wanted = text(key);
|
|
416
|
+
if (!this.sectionList().some(section => section.key === wanted)) return refused("unknown");
|
|
417
|
+
const closed = new Set(this.closedKeys());
|
|
418
|
+
const open = closed.has(wanted);
|
|
419
|
+
if (open) closed.delete(wanted);else closed.add(wanted);
|
|
420
|
+
this.closedSections = [...closed];
|
|
421
|
+
this.sfEmit("toggle", {
|
|
422
|
+
key: wanted,
|
|
423
|
+
open
|
|
424
|
+
});
|
|
425
|
+
return applied();
|
|
426
|
+
},
|
|
427
|
+
|
|
428
|
+
"item-toggle"({
|
|
429
|
+
path,
|
|
430
|
+
index
|
|
431
|
+
} = {}) {
|
|
432
|
+
const list = this.listField(path);
|
|
433
|
+
if (!list) return refused("unknown");
|
|
434
|
+
const at = Number(index);
|
|
435
|
+
if (!this.itemsOf(list)[at]) return refused("unknown");
|
|
436
|
+
const open = list.open !== at;
|
|
437
|
+
this.sfEmit("item-toggle", {
|
|
438
|
+
path: list.path,
|
|
439
|
+
index: at,
|
|
440
|
+
open
|
|
441
|
+
});
|
|
442
|
+
return applied();
|
|
443
|
+
},
|
|
444
|
+
|
|
445
|
+
"item-add"({
|
|
446
|
+
path
|
|
447
|
+
} = {}) {
|
|
448
|
+
const list = this.listField(path);
|
|
449
|
+
if (!list) return refused("unknown");
|
|
450
|
+
if (this.isFull(list)) return refused("full");
|
|
451
|
+
this.focusAfter = {
|
|
452
|
+
path: list.path,
|
|
453
|
+
index: this.itemsOf(list).length,
|
|
454
|
+
generation: this.generation
|
|
455
|
+
};
|
|
456
|
+
this.sfEmit("item-add", {
|
|
457
|
+
path: list.path
|
|
458
|
+
});
|
|
459
|
+
return applied();
|
|
460
|
+
},
|
|
461
|
+
|
|
462
|
+
// Any item goes anywhere in its list: nothing in a list is pinned.
|
|
463
|
+
"item-move"({
|
|
464
|
+
path,
|
|
465
|
+
index,
|
|
466
|
+
to,
|
|
467
|
+
by
|
|
468
|
+
} = {}) {
|
|
469
|
+
const list = this.listField(path);
|
|
470
|
+
if (!list) return refused("unknown");
|
|
471
|
+
const items = this.itemsOf(list);
|
|
472
|
+
const from = Number(index);
|
|
473
|
+
if (!items[from]) return refused("unknown");
|
|
474
|
+
const wanted = to !== undefined && to !== null ? Number(to) : from + Number(by ?? 0);
|
|
475
|
+
const target = Math.min(items.length - 1, Math.max(0, wanted));
|
|
476
|
+
if (!Number.isInteger(target) || target === from) return refused("unchanged");
|
|
477
|
+
this.focusAfter = {
|
|
478
|
+
path: list.path,
|
|
479
|
+
index: target,
|
|
480
|
+
generation: this.generation
|
|
481
|
+
};
|
|
482
|
+
this.sfEmit("item-move", {
|
|
483
|
+
path: list.path,
|
|
484
|
+
from,
|
|
485
|
+
to: target
|
|
486
|
+
});
|
|
487
|
+
return applied();
|
|
488
|
+
},
|
|
489
|
+
|
|
490
|
+
"item-duplicate"({
|
|
491
|
+
path,
|
|
492
|
+
index
|
|
493
|
+
} = {}) {
|
|
494
|
+
const list = this.listField(path);
|
|
495
|
+
if (!list) return refused("unknown");
|
|
496
|
+
const at = Number(index);
|
|
497
|
+
if (!this.itemsOf(list)[at]) return refused("unknown");
|
|
498
|
+
if (this.isFull(list)) return refused("full");
|
|
499
|
+
this.focusAfter = {
|
|
500
|
+
path: list.path,
|
|
501
|
+
index: at + 1,
|
|
502
|
+
generation: this.generation
|
|
503
|
+
};
|
|
504
|
+
this.sfEmit("item-duplicate", {
|
|
505
|
+
path: list.path,
|
|
506
|
+
index: at
|
|
507
|
+
});
|
|
508
|
+
return applied();
|
|
509
|
+
},
|
|
510
|
+
|
|
511
|
+
"item-delete"({
|
|
512
|
+
path,
|
|
513
|
+
index
|
|
514
|
+
} = {}) {
|
|
515
|
+
const list = this.listField(path);
|
|
516
|
+
if (!list) return refused("unknown");
|
|
517
|
+
const items = this.itemsOf(list);
|
|
518
|
+
const at = Number(index);
|
|
519
|
+
if (!items[at]) return refused("unknown");
|
|
520
|
+
if (this.isLeast(list)) return refused("least");
|
|
521
|
+
this.focusAfter = {
|
|
522
|
+
path: list.path,
|
|
523
|
+
index: Math.min(at, items.length - 2),
|
|
524
|
+
generation: this.generation
|
|
525
|
+
};
|
|
526
|
+
this.sfEmit("item-delete", {
|
|
527
|
+
path: list.path,
|
|
528
|
+
index: at
|
|
529
|
+
});
|
|
530
|
+
return applied();
|
|
531
|
+
},
|
|
532
|
+
|
|
533
|
+
"focus-item"({
|
|
534
|
+
path,
|
|
535
|
+
index
|
|
536
|
+
} = {}) {
|
|
537
|
+
if (!path) return refused("unknown");
|
|
538
|
+
this.focusAfter = {
|
|
539
|
+
path: String(path),
|
|
540
|
+
index: Number(index),
|
|
541
|
+
generation: this.generation - 1
|
|
542
|
+
};
|
|
543
|
+
this.requestComponentUpdate("focus-item");
|
|
544
|
+
return applied();
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
class SfMailInspector extends MailInspectorElement {
|
|
551
|
+
static get props() {
|
|
552
|
+
return { ...super.props,
|
|
553
|
+
templateName: {
|
|
554
|
+
attribute: "template",
|
|
555
|
+
default: "default"
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
constructor() {
|
|
561
|
+
super(); // A list set as a property before the element was defined is an own
|
|
562
|
+
// property that would hide the accessor; it is taken through it.
|
|
563
|
+
|
|
564
|
+
for (const name of ["levels", "headActions", "tabs", "sections", "closedSections", "notice"]) {
|
|
565
|
+
if (Object.prototype.hasOwnProperty.call(this, name)) {
|
|
566
|
+
const early = this[name];
|
|
567
|
+
delete this[name];
|
|
568
|
+
this[name] = early;
|
|
569
|
+
}
|
|
570
|
+
} // By path: {text, answered}. What the person typed that the host has not settled.
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
this.typed = new Map(); // By path: the attribute `value` while there is typed text.
|
|
574
|
+
|
|
575
|
+
this.heldValues = new Map(); // By path: what the element itself says at an image field.
|
|
576
|
+
|
|
577
|
+
this.ownErrors = new Map(); // Paths whose image the person just chose; the field previews it until the host answers.
|
|
578
|
+
|
|
579
|
+
this.attaching = new Set();
|
|
580
|
+
this.fields = new Map();
|
|
581
|
+
this.generation = 0;
|
|
582
|
+
this.seenSections = null;
|
|
583
|
+
this.seenKey = null;
|
|
584
|
+
this.seenTab = null;
|
|
585
|
+
this.focusAfter = null;
|
|
586
|
+
this.menuFor = null;
|
|
587
|
+
this.said = "";
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
levelList() {
|
|
591
|
+
return Array.isArray(this.levels) ? this.levels.filter(level => level && typeof level.text === "string") : [];
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
headActionList() {
|
|
595
|
+
return Array.isArray(this.headActions) ? this.headActions.map(String) : [];
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
tabList() {
|
|
599
|
+
return Array.isArray(this.tabs) ? this.tabs.filter(tab => tab && typeof tab.id === "string" && tab.id) : [];
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
sectionList() {
|
|
603
|
+
return Array.isArray(this.sections) ? this.sections.filter(section => section && typeof section.key === "string" && section.key) : [];
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
closedKeys() {
|
|
607
|
+
return Array.isArray(this.closedSections) ? this.closedSections.map(String) : [];
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
itemsOf(list) {
|
|
611
|
+
return Array.isArray(list?.items) ? list.items.filter(Boolean) : [];
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
isFull(list) {
|
|
615
|
+
return Number.isFinite(list.max) && this.itemsOf(list).length >= list.max;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
isLeast(list) {
|
|
619
|
+
return Number.isFinite(list.min) && this.itemsOf(list).length <= list.min;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
listField(path) {
|
|
623
|
+
const field = this.fields.get(text(path));
|
|
624
|
+
return field?.kind === "items" ? field : null;
|
|
625
|
+
}
|
|
626
|
+
/** Every field that is drawn, by path: a group's, and an open item's. */
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
indexFields() {
|
|
630
|
+
this.fields = new Map();
|
|
631
|
+
|
|
632
|
+
const walk = fields => {
|
|
633
|
+
for (const field of Array.isArray(fields) ? fields : []) {
|
|
634
|
+
if (!field) continue;
|
|
635
|
+
if (typeof field.path === "string") this.fields.set(field.path, field);
|
|
636
|
+
if (field.kind === "group") for (const row of Array.isArray(field.rows) ? field.rows : []) walk(row);
|
|
637
|
+
if (field.kind === "items") walk(this.itemsOf(field)[Number(field.open)]?.fields);
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
for (const section of this.sectionList()) walk(section.fields);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
fieldNode(path) {
|
|
645
|
+
return this.querySelector(`[data-path="${CSS.escape(path)}"]`);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
holdsFocus(path) {
|
|
649
|
+
return Boolean(this.fieldNode(path)?.contains(document.activeElement));
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* New data from the host. What was typed for another form goes with its key.
|
|
653
|
+
* Typed text stays while the host passes an error and while the person is
|
|
654
|
+
* still in the field; otherwise the host's value is what the field shows.
|
|
655
|
+
*/
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
takeData() {
|
|
659
|
+
const key = text(this.formKey);
|
|
660
|
+
|
|
661
|
+
if (key !== this.seenKey) {
|
|
662
|
+
this.seenKey = key;
|
|
663
|
+
this.typed.clear();
|
|
664
|
+
this.heldValues.clear();
|
|
665
|
+
this.ownErrors.clear();
|
|
666
|
+
this.attaching.clear();
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
if (this.sections === this.seenSections) return;
|
|
670
|
+
this.seenSections = this.sections;
|
|
671
|
+
this.generation += 1;
|
|
672
|
+
this.indexFields();
|
|
673
|
+
|
|
674
|
+
for (const [path, entry] of this.typed) {
|
|
675
|
+
const field = this.fields.get(path); // Not drawn now (a closed item): it comes back with the field.
|
|
676
|
+
|
|
677
|
+
if (!field || field.error) continue;
|
|
678
|
+
if (this.holdsFocus(path)) entry.answered = true;else this.typed.delete(path);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
for (const path of this.attaching) {
|
|
682
|
+
const field = this.fields.get(path);
|
|
683
|
+
const node = this.fieldNode(path);
|
|
684
|
+
if (!field || field.error || imageKey(node?.value) === imageKey(field.value)) this.attaching.delete(path);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
/** The attribute `value`: it holds still while the field has typed text. */
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
valueAttribute(field) {
|
|
691
|
+
const value = text(field.value);
|
|
692
|
+
if (!this.typed.has(field.path)) this.heldValues.set(field.path, value);
|
|
693
|
+
return this.heldValues.get(field.path) ?? value;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
isDraft(field) {
|
|
697
|
+
return Boolean(field.error) && this.typed.has(field.path);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
errorOf(field) {
|
|
701
|
+
return field.error || this.ownErrors.get(field.path) || "";
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
onFieldInput(path, node) {
|
|
705
|
+
const raw = node.value;
|
|
706
|
+
this.typed.set(path, {
|
|
707
|
+
text: raw,
|
|
708
|
+
answered: false
|
|
709
|
+
});
|
|
710
|
+
this.sfEmit("change", {
|
|
711
|
+
path,
|
|
712
|
+
value: raw,
|
|
713
|
+
typed: true
|
|
714
|
+
});
|
|
715
|
+
} // Leaving a field the host has answered for: it now shows the host's value.
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
onFieldLeave(path) {
|
|
719
|
+
requestAnimationFrame(() => {
|
|
720
|
+
const entry = this.typed.get(path);
|
|
721
|
+
if (!entry || !entry.answered || this.holdsFocus(path) || this.fields.get(path)?.error) return;
|
|
722
|
+
this.typed.delete(path);
|
|
723
|
+
this.requestComponentUpdate("left-field");
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
onChoice(path, event) {
|
|
728
|
+
const value = event.detail?.value;
|
|
729
|
+
if (typeof value !== "string") return;
|
|
730
|
+
this.sfEmit("change", {
|
|
731
|
+
path,
|
|
732
|
+
value,
|
|
733
|
+
typed: false
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
onImageChoice(path, event) {
|
|
738
|
+
const value = event.detail?.value;
|
|
739
|
+
if (typeof value !== "string" || !value) return;
|
|
740
|
+
this.ownErrors.delete(path);
|
|
741
|
+
this.sfEmit("change", {
|
|
742
|
+
path,
|
|
743
|
+
value,
|
|
744
|
+
typed: false
|
|
745
|
+
}); // A list that offers an action, not a value: it reads as not chosen again.
|
|
746
|
+
|
|
747
|
+
const node = event.currentTarget;
|
|
748
|
+
requestAnimationFrame(() => node.setAttribute?.("value", ""));
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
onSwitch(path, node) {
|
|
752
|
+
this.sfEmit("change", {
|
|
753
|
+
path,
|
|
754
|
+
value: Boolean(node.isChecked?.()),
|
|
755
|
+
typed: false
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
onAttach(path, event) {
|
|
760
|
+
event.stopPropagation();
|
|
761
|
+
const {
|
|
762
|
+
files,
|
|
763
|
+
file
|
|
764
|
+
} = event.detail ?? {};
|
|
765
|
+
const list = Array.isArray(files) && files.length ? files : file ? [file] : [];
|
|
766
|
+
if (!list.length) return;
|
|
767
|
+
this.ownErrors.delete(path);
|
|
768
|
+
this.attaching.add(path);
|
|
769
|
+
this.sfEmit("attach", {
|
|
770
|
+
path,
|
|
771
|
+
files: list
|
|
772
|
+
});
|
|
773
|
+
this.requestComponentUpdate("attach");
|
|
774
|
+
} // A required image can be replaced, not removed: the field offers «Убрать»
|
|
775
|
+
// all the same, so the element puts the image back and says why.
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
onDetach(path, event) {
|
|
779
|
+
event.stopPropagation();
|
|
780
|
+
const field = this.fields.get(path);
|
|
781
|
+
this.attaching.delete(path);
|
|
782
|
+
|
|
783
|
+
if (field?.required) {
|
|
784
|
+
this.ownErrors.set(path, this.sfWord("image-required-text"));
|
|
785
|
+
this.requestComponentUpdate("image-required");
|
|
786
|
+
event.currentTarget.value = field.value ?? null;
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
this.ownErrors.delete(path);
|
|
791
|
+
this.sfEmit("detach", {
|
|
792
|
+
path
|
|
793
|
+
});
|
|
794
|
+
this.requestComponentUpdate("detach");
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
onRejected(path, event) {
|
|
798
|
+
event.stopPropagation();
|
|
799
|
+
this.ownErrors.set(path, this.sfWord("image-formats-text"));
|
|
800
|
+
this.requestComponentUpdate("image-rejected");
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
onLevelPress(event) {
|
|
804
|
+
event.stopPropagation();
|
|
805
|
+
this.goToLevel({
|
|
806
|
+
index: event.detail?.index
|
|
807
|
+
});
|
|
808
|
+
} // Escape goes one level up, unless a list, a menu, a window or a drag has it.
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
onKeydown(event) {
|
|
812
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
813
|
+
const target = event.target;
|
|
814
|
+
if (target.closest?.("sf-modal, .sf-modal, sf-dropdown, sf-menu-context, [role=\"listbox\"], [role=\"menu\"]")) return;
|
|
815
|
+
if (document.documentElement.dataset.sfPopoverOpen || document.querySelector("sf-modal[open], [role=\"menu\"]:popover-open, [data-sf-sortable-state=\"dragging\"]")) return;
|
|
816
|
+
const body = target.closest?.("[data-item-body]");
|
|
817
|
+
const answer = this.levelUp();
|
|
818
|
+
if (answer.outcome !== "applied") return;
|
|
819
|
+
event.preventDefault();
|
|
820
|
+
event.stopPropagation(); // The field that holds the focus goes with the item: the focus stays on the item.
|
|
821
|
+
|
|
822
|
+
if (body) this.focusAfter = {
|
|
823
|
+
path: body.dataset.itemList,
|
|
824
|
+
index: Number(body.dataset.itemBody),
|
|
825
|
+
generation: this.generation
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
onTabChange(event) {
|
|
830
|
+
if (event.target !== event.currentTarget) return;
|
|
831
|
+
event.stopPropagation();
|
|
832
|
+
const tab = this.tabList()[event.detail?.current];
|
|
833
|
+
if (!tab) return; // sf-tabs has shown it already; `tab` follows, so the host can name another.
|
|
834
|
+
|
|
835
|
+
this.seenTab = tab.id;
|
|
836
|
+
this.tab = tab.id;
|
|
837
|
+
this.sfEmit("tab", {
|
|
838
|
+
id: tab.id
|
|
839
|
+
});
|
|
840
|
+
} // sf-sortable only asks; the list's own redraw comes with the data the host passes.
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
onSortableMove(path, event) {
|
|
844
|
+
event.stopPropagation();
|
|
845
|
+
const {
|
|
846
|
+
item,
|
|
847
|
+
index
|
|
848
|
+
} = event.detail ?? {};
|
|
849
|
+
this.itemMove({
|
|
850
|
+
path,
|
|
851
|
+
index: Number(String(item).replace("item-", "")),
|
|
852
|
+
to: index
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
onToggleKeydown(path, index, event) {
|
|
857
|
+
if (event.key === "ContextMenu" || event.shiftKey && event.key === "F10") {
|
|
858
|
+
event.preventDefault();
|
|
859
|
+
this.openItemMenu(path, index, event.currentTarget.closest("[data-item]")?.querySelector("sf-button-icon"));
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
if (!event.altKey || event.key !== "ArrowUp" && event.key !== "ArrowDown") return;
|
|
864
|
+
event.preventDefault();
|
|
865
|
+
event.stopPropagation();
|
|
866
|
+
const answer = this.itemMove({
|
|
867
|
+
path,
|
|
868
|
+
index,
|
|
869
|
+
by: event.key === "ArrowUp" ? -1 : 1
|
|
870
|
+
});
|
|
871
|
+
if (answer.outcome !== "applied") return;
|
|
872
|
+
const total = this.itemsOf(this.listField(path)).length;
|
|
873
|
+
this.said = this.sfWord("item-moved-text", {
|
|
874
|
+
vars: {
|
|
875
|
+
n: this.focusAfter.index + 1,
|
|
876
|
+
total
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
this.requestComponentUpdate("said");
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
get menu() {
|
|
883
|
+
return this.querySelector(".sf-mail-inspector-menu");
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
menuEntries(list, index) {
|
|
887
|
+
const total = this.itemsOf(list).length;
|
|
888
|
+
return [// SIMAI Framework's shortcut notation (C04): ⌥↑ on a Mac, Alt+↑ elsewhere.
|
|
889
|
+
{
|
|
890
|
+
id: "up",
|
|
891
|
+
text: this.sfWord("up-text"),
|
|
892
|
+
icon: "arrow_upward",
|
|
893
|
+
shortcut: "alt+up",
|
|
894
|
+
disabled: index === 0
|
|
895
|
+
}, {
|
|
896
|
+
id: "down",
|
|
897
|
+
text: this.sfWord("down-text"),
|
|
898
|
+
icon: "arrow_downward",
|
|
899
|
+
shortcut: "alt+down",
|
|
900
|
+
disabled: index === total - 1
|
|
901
|
+
}, {
|
|
902
|
+
id: "duplicate",
|
|
903
|
+
text: this.sfWord("duplicate-text"),
|
|
904
|
+
icon: "content_copy",
|
|
905
|
+
disabled: this.isFull(list)
|
|
906
|
+
}, {
|
|
907
|
+
type: "separator"
|
|
908
|
+
}, {
|
|
909
|
+
id: "remove",
|
|
910
|
+
text: this.sfWord("delete-text"),
|
|
911
|
+
icon: "delete",
|
|
912
|
+
danger: true,
|
|
913
|
+
disabled: this.isLeast(list)
|
|
914
|
+
}];
|
|
915
|
+
}
|
|
916
|
+
/** A right click on an item's row opens its ⋯ menu at the pointer (C164). */
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
onItemContextMenu(path, index, event) {
|
|
920
|
+
if (event.shiftKey || (0,_component_kbd_js_shortcut__WEBPACK_IMPORTED_MODULE_7__.isEditableTarget)(event.target) || !this.menu) return;
|
|
921
|
+
event.preventDefault();
|
|
922
|
+
const point = pointAnchor(event);
|
|
923
|
+
this.menu.addEventListener("sf-menu-context-closed", () => point.remove(), {
|
|
924
|
+
once: true
|
|
925
|
+
});
|
|
926
|
+
this.openItemMenu(path, index, point);
|
|
927
|
+
}
|
|
928
|
+
/** The ⋯ of an item: one menu, filled for the item it was opened from. */
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
openItemMenu(path, index, anchor) {
|
|
932
|
+
const list = this.listField(path);
|
|
933
|
+
const menu = this.menu;
|
|
934
|
+
if (!list || !menu) return;
|
|
935
|
+
this.menuFor = {
|
|
936
|
+
path,
|
|
937
|
+
index
|
|
938
|
+
};
|
|
939
|
+
const native = anchor?.querySelector?.("button") ?? anchor; // The Loader brings sf-menu-context when the page is ready (the rule
|
|
940
|
+
// fetches it lazily); a press before that asks the Loader for it now
|
|
941
|
+
// (SF.Loader.ensure, defect TL-7) and waits for it.
|
|
942
|
+
|
|
943
|
+
Promise.resolve(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"])).catch(() => null).then(() => customElements.whenDefined("sf-menu-context")).then(() => {
|
|
944
|
+
menu.entries = this.menuEntries(list, index);
|
|
945
|
+
menu.toggleFor(native);
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
onMenuSelect(detail = {}) {
|
|
950
|
+
const choice = String(detail.id ?? detail.entry?.id ?? "");
|
|
951
|
+
const asked = this.menuFor;
|
|
952
|
+
if (!choice || !asked) return; // The menu gives focus back to ⋯ first; the host's answer then moves it where it belongs.
|
|
953
|
+
|
|
954
|
+
setTimeout(() => {
|
|
955
|
+
if (choice === "up") this.itemMove({ ...asked,
|
|
956
|
+
by: -1
|
|
957
|
+
});else if (choice === "down") this.itemMove({ ...asked,
|
|
958
|
+
by: 1
|
|
959
|
+
});else if (choice === "duplicate") this.itemDuplicate(asked);else if (choice === "remove") this.itemDelete(asked);
|
|
960
|
+
}, 0);
|
|
961
|
+
}
|
|
962
|
+
/** After the draw: what a field must show, and where the focus goes. */
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
afterRender(changed) {
|
|
966
|
+
const result = super.afterRender?.(changed);
|
|
967
|
+
|
|
968
|
+
for (const [path, field] of this.fields) {
|
|
969
|
+
const node = this.fieldNode(path);
|
|
970
|
+
if (!node) continue;
|
|
971
|
+
|
|
972
|
+
if (TEXT_KINDS.has(field.kind)) {
|
|
973
|
+
const shown = this.typed.get(path)?.text ?? text(field.value);
|
|
974
|
+
if (node.value !== shown) node.value = shown;
|
|
975
|
+
} else if (field.kind === "select") {
|
|
976
|
+
if (node.getAttribute("value") !== text(field.value)) node.setAttribute("value", text(field.value));
|
|
977
|
+
} else if (field.kind === "switch") {
|
|
978
|
+
if (node.isChecked && node.isChecked() !== Boolean(field.value)) node.setChecked?.(Boolean(field.value));
|
|
979
|
+
} else if (field.kind === "image") {
|
|
980
|
+
const well = node.matches("sf-input-image") ? node : node.querySelector("sf-input-image");
|
|
981
|
+
if (well && !this.attaching.has(path) && imageKey(well.value) !== imageKey(field.value)) well.value = field.value ?? null;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
this.syncTab();
|
|
986
|
+
const asked = this.focusAfter;
|
|
987
|
+
|
|
988
|
+
if (asked && asked.generation < this.generation) {
|
|
989
|
+
this.focusAfter = null;
|
|
990
|
+
this.querySelector(`[data-items="${CSS.escape(asked.path)}"] [data-toggle="${asked.index}"]`)?.focus();
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
return result;
|
|
994
|
+
} // The tab the host names; a press has already moved sf-tabs.
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
syncTab() {
|
|
998
|
+
const wanted = text(this.tab);
|
|
999
|
+
if (wanted === this.seenTab) return;
|
|
1000
|
+
this.seenTab = wanted;
|
|
1001
|
+
const at = this.tabList().findIndex(tab => tab.id === wanted);
|
|
1002
|
+
const node = this.querySelector(":scope sf-tabs.sf-mail-inspector-tabs");
|
|
1003
|
+
if (at >= 0 && node?.goTo && Number(node.activeIndex) !== at) node.goTo(at);
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
templateContext() {
|
|
1007
|
+
this.takeData();
|
|
1008
|
+
const closed = new Set(this.closedKeys());
|
|
1009
|
+
const path = (0,_core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__.instancePath)(this, {
|
|
1010
|
+
kind: "sf-mail-inspector"
|
|
1011
|
+
});
|
|
1012
|
+
const tabs = this.tabList();
|
|
1013
|
+
return {
|
|
1014
|
+
component: this,
|
|
1015
|
+
heading: text(this.heading),
|
|
1016
|
+
headingIcon: text(this.headingIcon),
|
|
1017
|
+
levels: this.levelList(),
|
|
1018
|
+
actions: this.headActionList(),
|
|
1019
|
+
notice: this.notice && this.notice.text ? this.notice : null,
|
|
1020
|
+
formKey: text(this.formKey),
|
|
1021
|
+
tabs,
|
|
1022
|
+
tabIndex: Math.max(0, tabs.findIndex(tab => tab.id === text(this.tab))),
|
|
1023
|
+
tabsKey: tabs.map(tab => `${tab.id}:${tab.slot ?? ""}`).join("|"),
|
|
1024
|
+
sections: this.sectionList().map((section, index) => ({ ...section,
|
|
1025
|
+
isOpen: !closed.has(section.key),
|
|
1026
|
+
triggerId: (0,_core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__.partId)(path, `trigger-${index}`),
|
|
1027
|
+
panelId: (0,_core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__.partId)(path, `panel-${index}`)
|
|
1028
|
+
})),
|
|
1029
|
+
words: {
|
|
1030
|
+
path: this.sfWord("path-label"),
|
|
1031
|
+
duplicate: this.sfWord("duplicate-text"),
|
|
1032
|
+
delete: this.sfWord("delete-text"),
|
|
1033
|
+
replace: this.sfWord("replace-text"),
|
|
1034
|
+
add: this.sfWord("item-add-text"),
|
|
1035
|
+
imageEmpty: this.sfWord("image-empty-text"),
|
|
1036
|
+
itemMenu: this.sfWord("item-menu-label")
|
|
1037
|
+
},
|
|
1038
|
+
itemActionsLabel: label => this.sfWord("item-actions-label", {
|
|
1039
|
+
vars: {
|
|
1040
|
+
label
|
|
1041
|
+
}
|
|
1042
|
+
}),
|
|
1043
|
+
groupOf,
|
|
1044
|
+
partOf: name => (0,_core_js_instance_path__WEBPACK_IMPORTED_MODULE_2__.partId)(path, name),
|
|
1045
|
+
said: this.said,
|
|
1046
|
+
rootClass: this.getRootClass?.() ?? ""
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
template() {
|
|
1051
|
+
return (0,_js_templates_default_js__WEBPACK_IMPORTED_MODULE_3__.renderMailInspectorTemplate)(this.templateContext());
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
SfMailInspector.define("sf-mail-inspector");
|
|
1057
|
+
__webpack_async_result__();
|
|
1058
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
1059
|
+
|
|
1060
|
+
/***/ },
|
|
1061
|
+
|
|
1062
|
+
/***/ "b7e5645ce5ca"
|
|
1063
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
1064
|
+
|
|
1065
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
1066
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1067
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1068
|
+
/* harmony export */ renderMailInspectorTemplate: () => (/* binding */ renderMailInspectorTemplate)
|
|
1069
|
+
/* harmony export */ });
|
|
1070
|
+
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2a080a730149");
|
|
1071
|
+
/* harmony import */ var lit_directives_keyed_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("9d9903b87148");
|
|
1072
|
+
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("efa66f8927d1");
|
|
1073
|
+
/* harmony import */ var _default_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("5817d4e2cdcc");
|
|
1074
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([lit__WEBPACK_IMPORTED_MODULE_0__, lit_directives_keyed_js__WEBPACK_IMPORTED_MODULE_1__, lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__]);
|
|
1075
|
+
([lit__WEBPACK_IMPORTED_MODULE_0__, lit_directives_keyed_js__WEBPACK_IMPORTED_MODULE_1__, lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
1076
|
+
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lit__WEBPACK_IMPORTED_MODULE_0__);
|
|
1077
|
+
/* harmony import */ var lit_directives_keyed_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lit_directives_keyed_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
1078
|
+
/* harmony import */ var lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
const ICONS = {
|
|
1084
|
+
duplicate: "content_copy",
|
|
1085
|
+
delete: "delete",
|
|
1086
|
+
replace: "swap_horiz"
|
|
1087
|
+
}; // A text-like field. `value` holds still while there is typed text (see
|
|
1088
|
+
// index.js), and the same element stays under a redraw, so the focus and the
|
|
1089
|
+
// caret stay in it.
|
|
1090
|
+
|
|
1091
|
+
function renderText(context, field) {
|
|
1092
|
+
const {
|
|
1093
|
+
component
|
|
1094
|
+
} = context;
|
|
1095
|
+
const error = component.errorOf(field);
|
|
1096
|
+
|
|
1097
|
+
const onLeave = () => component.onFieldLeave(field.path);
|
|
1098
|
+
|
|
1099
|
+
const onInput = event => component.onFieldInput(field.path, event.currentTarget);
|
|
1100
|
+
|
|
1101
|
+
if (field.kind === "multiline") {
|
|
1102
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-input-textarea class="sf-mail-inspector-field" size="1/2" auto-grow data-path=${field.path}
|
|
1103
|
+
label=${field.label || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} aria-label=${field.ariaLabel || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1104
|
+
value=${component.valueAttribute(field)} placeholder=${field.placeholder || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} hint=${field.hint || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1105
|
+
inherited-value=${field.inheritedValue || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} ?required=${field.required} ?disabled=${field.disabled}
|
|
1106
|
+
?invalid=${Boolean(error)} error-message=${error || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} data-draft=${component.isDraft(field) ? "true" : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1107
|
+
@input=${onInput} @focusout=${onLeave}></sf-input-textarea>`;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-input class="sf-mail-inspector-field" size="1/2" data-path=${field.path}
|
|
1111
|
+
label=${field.label || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} aria-label=${field.ariaLabel || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1112
|
+
value=${component.valueAttribute(field)} placeholder=${field.placeholder || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} hint=${field.hint || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1113
|
+
input-type=${field.kind === "link" ? "url" : lit__WEBPACK_IMPORTED_MODULE_0__.nothing} inputmode=${field.inputmode || (field.kind === "number" ? "numeric" : lit__WEBPACK_IMPORTED_MODULE_0__.nothing)}
|
|
1114
|
+
inherited-value=${field.inheritedValue || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} ?required=${field.required} ?disabled=${field.disabled}
|
|
1115
|
+
?invalid=${Boolean(error)} error-message=${error || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} data-draft=${component.isDraft(field) ? "true" : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1116
|
+
@input=${onInput} @focusout=${onLeave}></sf-input>`;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
function renderSelect(context, field) {
|
|
1120
|
+
const {
|
|
1121
|
+
component
|
|
1122
|
+
} = context;
|
|
1123
|
+
const options = Array.isArray(field.options) ? field.options : []; // A value of nothing reads as the choice that means it.
|
|
1124
|
+
|
|
1125
|
+
const none = options.find(option => option.value === "")?.text;
|
|
1126
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-dropdown class="sf-mail-inspector-field" size="1/2" mode="select" data-path=${field.path} label=${field.label || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1127
|
+
value=${field.value ?? ""} placeholder=${field.placeholder || none || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} hint=${field.hint || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1128
|
+
?required=${field.required} ?disabled=${field.disabled} ?invalid=${Boolean(field.error)} error-message=${field.error || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1129
|
+
.options=${options} @change=${event => component.onChoice(field.path, event)}></sf-dropdown>`;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
function renderSwitch(context, field) {
|
|
1133
|
+
const {
|
|
1134
|
+
component
|
|
1135
|
+
} = context;
|
|
1136
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-switch class="sf-mail-inspector-field" size="1/2" data-path=${field.path} label=${field.label || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1137
|
+
?checked=${field.value === true} ?disabled=${field.disabled}
|
|
1138
|
+
@change=${event => component.onSwitch(field.path, event.currentTarget)}></sf-switch>`;
|
|
1139
|
+
} // A group of fields under one name, row by row: a price is its amount and old
|
|
1140
|
+
// price, its currency and unit, then its note.
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
function renderGroup(context, field) {
|
|
1144
|
+
const rows = Array.isArray(field.rows) ? field.rows : [];
|
|
1145
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="sf-mail-inspector-group" data-group=${field.path} role="group" aria-label=${field.label || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}>
|
|
1146
|
+
${rows.map(row => (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class=${row.length > 1 ? "sf-mail-inspector-pair" : "sf-mail-inspector-row"}>${row.map(part => renderField(context, part))}</div>`)}
|
|
1147
|
+
</div>`;
|
|
1148
|
+
} // One image as sf-input-image: the picture, its name and size, «Заменить…» and
|
|
1149
|
+
// «Убрать»; a file dropped on it replaces it. Under it, what the host offers to
|
|
1150
|
+
// choose again. The field uploads nothing: the host stores the file.
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
function renderImage(context, field) {
|
|
1154
|
+
const {
|
|
1155
|
+
component
|
|
1156
|
+
} = context;
|
|
1157
|
+
const error = component.errorOf(field);
|
|
1158
|
+
const choices = Array.isArray(field.choices) ? field.choices : [];
|
|
1159
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="sf-mail-inspector-image" data-path=${field.path}>
|
|
1160
|
+
<sf-input-image size="1/2" label=${field.label || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} aria-label=${field.label ? lit__WEBPACK_IMPORTED_MODULE_0__.nothing : field.ariaLabel || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1161
|
+
accept=${field.accept || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} empty-text=${field.emptyText || context.words.imageEmpty} hint=${field.hint || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1162
|
+
value=${field.value ? JSON.stringify(field.value) : lit__WEBPACK_IMPORTED_MODULE_0__.nothing} ?required=${field.required} ?disabled=${field.disabled}
|
|
1163
|
+
?invalid=${Boolean(error)} error-message=${error || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1164
|
+
@sf-input-image-attach=${event => component.onAttach(field.path, event)}
|
|
1165
|
+
@sf-input-image-detach=${event => component.onDetach(field.path, event)}
|
|
1166
|
+
@sf-input-image-rejected=${event => component.onRejected(field.path, event)}></sf-input-image>
|
|
1167
|
+
${choices.length ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-dropdown class="sf-mail-inspector-choose" size="1/2" mode="select" data-choose=${field.path} label=${field.chooseLabel || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1168
|
+
placeholder=${field.choosePlaceholder || lit__WEBPACK_IMPORTED_MODULE_0__.nothing} value="" .options=${choices}
|
|
1169
|
+
@change=${event => component.onImageChoice(field.path, event)}></sf-dropdown>` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1170
|
+
</div>`;
|
|
1171
|
+
} // A row: its handle, a disclosure with the item's label, and ⋯. One item is open
|
|
1172
|
+
// at a time and shows its fields. `slot` marks the row as the list's content, not
|
|
1173
|
+
// as sf-sortable's own first paint: sf-sortable may arrive first and would drop it.
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
function renderItem(context, field, item, index) {
|
|
1177
|
+
const {
|
|
1178
|
+
component
|
|
1179
|
+
} = context;
|
|
1180
|
+
const isOpen = field.open === index;
|
|
1181
|
+
const label = String(item.label ?? "");
|
|
1182
|
+
const actions = context.itemActionsLabel(label);
|
|
1183
|
+
const bodyId = context.partOf(`${context.groupOf(field.path)}-item-${index}`);
|
|
1184
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
1185
|
+
<div slot="item" class=${["sf-mail-inspector-item", isOpen ? "is-open" : "", item.problem ? "has-problem" : ""].filter(Boolean).join(" ")}
|
|
1186
|
+
data-sf-sortable-item=${`item-${index}`} data-item=${index} tabindex="-1">
|
|
1187
|
+
<div class="sf-mail-inspector-item-head" @contextmenu=${event => component.onItemContextMenu(field.path, index, event)}>
|
|
1188
|
+
<span class="sf-mail-inspector-handle" data-sf-sortable-handle aria-hidden="true"><sf-icon icon="drag_indicator" size="1"></sf-icon></span>
|
|
1189
|
+
<button type="button" class="sf-mail-inspector-toggle" aria-expanded=${isOpen ? "true" : "false"} aria-controls=${bodyId} data-toggle=${index}
|
|
1190
|
+
@click=${() => component.itemToggle({
|
|
1191
|
+
path: field.path,
|
|
1192
|
+
index
|
|
1193
|
+
})}
|
|
1194
|
+
@keydown=${event => component.onToggleKeydown(field.path, index, event)}>
|
|
1195
|
+
<sf-icon icon=${isOpen ? "expand_more" : "chevron_right"} size="1" aria-hidden="true"></sf-icon>
|
|
1196
|
+
<span class="sf-mail-inspector-item-label">${label}</span>
|
|
1197
|
+
</button>
|
|
1198
|
+
<sf-button-icon class="sf-mail-inspector-item-more" appearance="ghost" scheme="on-surface" size="1/2" icon="more_horiz"
|
|
1199
|
+
aria-label=${actions} title=${actions} data-item-menu=${index}
|
|
1200
|
+
@click=${event => component.openItemMenu(field.path, index, event.currentTarget)}></sf-button-icon>
|
|
1201
|
+
</div>
|
|
1202
|
+
<div id=${bodyId} class="sf-mail-inspector-item-body" role="group" aria-label=${label} data-item-body=${index} data-item-list=${field.path} ?hidden=${!isOpen}>
|
|
1203
|
+
${isOpen ? renderFields(context, item.fields) : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1204
|
+
</div>
|
|
1205
|
+
</div>
|
|
1206
|
+
`;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
function renderItems(context, field) {
|
|
1210
|
+
const {
|
|
1211
|
+
component
|
|
1212
|
+
} = context;
|
|
1213
|
+
const items = component.itemsOf(field);
|
|
1214
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="sf-mail-inspector-items" data-items=${field.path}>
|
|
1215
|
+
<sf-sortable class="sf-mail-inspector-list" group=${context.groupOf(field.path)} label=${field.label || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1216
|
+
@sf-sortable-move=${event => component.onSortableMove(field.path, event)}>
|
|
1217
|
+
${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__.repeat)(items, (_, index) => index, (item, index) => renderItem(context, field, item, index))}
|
|
1218
|
+
</sf-sortable>
|
|
1219
|
+
<sf-button class="sf-mail-inspector-add" appearance="ghost" scheme="on-surface" size="1/2" icon-start="add" text=${context.words.add}
|
|
1220
|
+
data-item-add=${field.path} ?disabled=${component.isFull(field)}
|
|
1221
|
+
@click=${() => component.itemAdd({
|
|
1222
|
+
path: field.path
|
|
1223
|
+
})}></sf-button>
|
|
1224
|
+
</div>`;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
function renderField(context, field) {
|
|
1228
|
+
switch (field?.kind) {
|
|
1229
|
+
case "text":
|
|
1230
|
+
case "multiline":
|
|
1231
|
+
case "link":
|
|
1232
|
+
case "number":
|
|
1233
|
+
return renderText(context, field);
|
|
1234
|
+
|
|
1235
|
+
case "select":
|
|
1236
|
+
return renderSelect(context, field);
|
|
1237
|
+
|
|
1238
|
+
case "switch":
|
|
1239
|
+
return renderSwitch(context, field);
|
|
1240
|
+
|
|
1241
|
+
case "group":
|
|
1242
|
+
return renderGroup(context, field);
|
|
1243
|
+
|
|
1244
|
+
case "image":
|
|
1245
|
+
return renderImage(context, field);
|
|
1246
|
+
|
|
1247
|
+
case "items":
|
|
1248
|
+
return renderItems(context, field);
|
|
1249
|
+
|
|
1250
|
+
default:
|
|
1251
|
+
return lit__WEBPACK_IMPORTED_MODULE_0__.nothing;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
function renderFields(context, fields) {
|
|
1256
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="sf-mail-inspector-fields">${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__.repeat)(Array.isArray(fields) ? fields : [], field => field.path, field => renderField(context, field))}</div>`;
|
|
1257
|
+
} // One flush section of the class accordion. The element owns its state, so the
|
|
1258
|
+
// class runtime leaves it alone (data-sf-accordion-init).
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
function renderSection(context, section) {
|
|
1262
|
+
const {
|
|
1263
|
+
component
|
|
1264
|
+
} = context;
|
|
1265
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
1266
|
+
<article class=${["sf-accordion", "sf-accordion--flush", "sf-accordion--size-1/2", section.isOpen ? "active" : ""].filter(Boolean).join(" ")}
|
|
1267
|
+
data-sf-accordion-init="1" data-section=${section.key}>
|
|
1268
|
+
<h3 class="sf-accordion-heading">
|
|
1269
|
+
<button class="sf-accordion-trigger" type="button" id=${section.triggerId} aria-expanded=${section.isOpen ? "true" : "false"} aria-controls=${section.panelId}
|
|
1270
|
+
@click=${() => component.toggleSection({
|
|
1271
|
+
key: section.key
|
|
1272
|
+
})}>
|
|
1273
|
+
<span class="sf-accordion-title">${section.title}</span>
|
|
1274
|
+
<i class="sf-icon" aria-hidden="true">chevron_right</i>
|
|
1275
|
+
</button>
|
|
1276
|
+
</h3>
|
|
1277
|
+
<div class="sf-accordion-content" id=${section.panelId} role="region" aria-labelledby=${section.triggerId} ?hidden=${!section.isOpen}>${renderFields(context, section.fields)}</div>
|
|
1278
|
+
</article>
|
|
1279
|
+
`;
|
|
1280
|
+
} // One section needs no disclosure: its fields stand on their own.
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
function renderForm(context) {
|
|
1284
|
+
const {
|
|
1285
|
+
sections
|
|
1286
|
+
} = context;
|
|
1287
|
+
if (sections.length === 1) return renderFields(context, sections[0].fields);
|
|
1288
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="sf-accordion-group sf-mail-inspector-sections">${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__.repeat)(sections, section => section.key, section => renderSection(context, section))}</div>`;
|
|
1289
|
+
} // The tabs: one panel per tab, the form in those without a slot, the host's own
|
|
1290
|
+
// panel in those with one. sf-tabs takes the panels as it connects, so a new list
|
|
1291
|
+
// of tabs is a new sf-tabs (keyed in the caller).
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
function renderTabs(context) {
|
|
1295
|
+
const {
|
|
1296
|
+
component
|
|
1297
|
+
} = context;
|
|
1298
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-tabs class="sf-mail-inspector-tabs" type="underline" size="1/2" aria-label=${context.heading || lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1299
|
+
active-index=${context.tabIndex} items=${context.tabs.map(tab => tab.label).join("|")}
|
|
1300
|
+
@sf-tabs-change=${event => component.onTabChange(event)}>
|
|
1301
|
+
${(0,lit_directives_repeat_js__WEBPACK_IMPORTED_MODULE_2__.repeat)(context.tabs, tab => tab.id, (tab, index) => (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
1302
|
+
<div slot=${`panel-${index}`} class="sf-mail-inspector-panel" data-tab=${tab.id}>
|
|
1303
|
+
${tab.slot ? component.hasSlotContent(tab.slot) ? component.getSlotContent(tab.slot) : lit__WEBPACK_IMPORTED_MODULE_0__.nothing : renderForm(context)}
|
|
1304
|
+
</div>`)}
|
|
1305
|
+
</sf-tabs>`;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
function renderHead(context) {
|
|
1309
|
+
const {
|
|
1310
|
+
component
|
|
1311
|
+
} = context;
|
|
1312
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
1313
|
+
<div class="sf-mail-inspector-head">
|
|
1314
|
+
${context.levels.length > 1 ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-breadcrumbs class="sf-mail-inspector-path" aria-label=${context.words.path}
|
|
1315
|
+
items=${JSON.stringify(context.levels.map((level, index) => index === context.levels.length - 1 ? {
|
|
1316
|
+
text: level.text,
|
|
1317
|
+
current: true
|
|
1318
|
+
} : {
|
|
1319
|
+
text: level.text,
|
|
1320
|
+
href: `#level-${index}`
|
|
1321
|
+
}))}
|
|
1322
|
+
@sf-breadcrumbs-press=${event => component.onLevelPress(event)}
|
|
1323
|
+
@click=${event => event.preventDefault()}></sf-breadcrumbs>` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1324
|
+
${context.heading ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="sf-mail-inspector-title-row">
|
|
1325
|
+
${context.headingIcon ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-icon icon=${context.headingIcon} size="2" aria-hidden="true"></sf-icon>` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1326
|
+
<h2 class="sf-mail-inspector-title">${context.heading}</h2>
|
|
1327
|
+
${context.actions.map(name => (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-button-icon class="sf-mail-inspector-action" appearance="ghost" scheme="on-surface" size="1/2" icon=${ICONS[name] || "more_horiz"}
|
|
1328
|
+
aria-label=${context.words[name] || name} title=${context.words[name] || name} data-action=${name}
|
|
1329
|
+
@click=${() => component[name]?.()}></sf-button-icon>`)}
|
|
1330
|
+
</div>` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1331
|
+
</div>
|
|
1332
|
+
`;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
function renderNotice(context) {
|
|
1336
|
+
const {
|
|
1337
|
+
component,
|
|
1338
|
+
notice
|
|
1339
|
+
} = context;
|
|
1340
|
+
if (!notice) return lit__WEBPACK_IMPORTED_MODULE_0__.nothing;
|
|
1341
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<div class="sf-mail-inspector-notice">
|
|
1342
|
+
<span class="sf-mail-inspector-notice-text">${notice.text}</span>
|
|
1343
|
+
${notice.action ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-button appearance="outline" size="1/2" text=${notice.action} data-notice-action @click=${() => component.sfEmit("notice-action", {})}></sf-button>` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1344
|
+
</div>`;
|
|
1345
|
+
} // The panel: heading and path, what the host has to say, then the form -- in
|
|
1346
|
+
// tabs when there are tabs -- and one ⋯ menu for every list. The fields' own
|
|
1347
|
+
// input and change stop at the root: the change the host hears is the element's,
|
|
1348
|
+
// sent on the host itself. A press on the path is a level, so its link goes nowhere.
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
function renderMailInspectorTemplate(context) {
|
|
1352
|
+
const {
|
|
1353
|
+
component
|
|
1354
|
+
} = context;
|
|
1355
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
1356
|
+
<div class=${["sf-mail-inspector", context.rootClass].filter(Boolean).join(" ")} @keydown=${event => component.onKeydown(event)}
|
|
1357
|
+
@input=${event => event.stopPropagation()} @change=${event => event.stopPropagation()}>
|
|
1358
|
+
${renderHead(context)}
|
|
1359
|
+
${renderNotice(context)}
|
|
1360
|
+
${(0,lit_directives_keyed_js__WEBPACK_IMPORTED_MODULE_1__.keyed)(`${context.formKey}\n${context.tabsKey}`, context.tabs.length ? renderTabs(context) : renderForm(context))}
|
|
1361
|
+
<span class="sf-mail-inspector-said sr-only" role="status">${context.said}</span>
|
|
1362
|
+
<sf-menu-context class="sf-mail-inspector-menu" popup size="1/2" aria-label=${context.words.itemMenu}
|
|
1363
|
+
@sf-menu-context-select=${event => {
|
|
1364
|
+
event.stopPropagation();
|
|
1365
|
+
component.onMenuSelect(event.detail);
|
|
1366
|
+
}}></sf-menu-context>
|
|
1367
|
+
</div>
|
|
1368
|
+
`;
|
|
1369
|
+
}
|
|
1370
|
+
__webpack_async_result__();
|
|
1371
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
1372
|
+
|
|
1373
|
+
/***/ },
|
|
1374
|
+
|
|
1375
|
+
/***/ "5817d4e2cdcc"
|
|
1376
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1377
|
+
|
|
1378
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1379
|
+
// extracted by mini-css-extract-plugin
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
/***/ },
|
|
1383
|
+
|
|
1384
|
+
/***/ "5b7d7695b41b"
|
|
1385
|
+
(module) {
|
|
1386
|
+
|
|
1387
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("element-manifest", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("element-manifest", 1).then(resolve, reject), { once: true })));
|
|
1388
|
+
|
|
1389
|
+
/***/ },
|
|
1390
|
+
|
|
1391
|
+
/***/ "e92fd2d1a38c"
|
|
1392
|
+
(module) {
|
|
1393
|
+
|
|
1394
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("instance-path", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("instance-path", 1).then(resolve, reject), { once: true })));
|
|
1395
|
+
|
|
1396
|
+
/***/ },
|
|
1397
|
+
|
|
1398
|
+
/***/ "9d9903b87148"
|
|
1399
|
+
(module) {
|
|
1400
|
+
|
|
1401
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("lit/directives/keyed.js", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("lit/directives/keyed.js", 1).then(resolve, reject), { once: true })));
|
|
1402
|
+
|
|
1403
|
+
/***/ },
|
|
1404
|
+
|
|
1405
|
+
/***/ "efa66f8927d1"
|
|
1406
|
+
(module) {
|
|
1407
|
+
|
|
1408
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("lit/directives/repeat.js", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("lit/directives/repeat.js", 1).then(resolve, reject), { once: true })));
|
|
1409
|
+
|
|
1410
|
+
/***/ },
|
|
1411
|
+
|
|
1412
|
+
/***/ "2a080a730149"
|
|
1413
|
+
(module) {
|
|
1414
|
+
|
|
1415
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("lit", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("lit", 1).then(resolve, reject), { once: true })));
|
|
1416
|
+
|
|
1417
|
+
/***/ },
|
|
1418
|
+
|
|
1419
|
+
/***/ "deb1a4d61565"
|
|
1420
|
+
(module) {
|
|
1421
|
+
|
|
1422
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("smart-base", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("smart-base", 1).then(resolve, reject), { once: true })));
|
|
1423
|
+
|
|
1424
|
+
/***/ },
|
|
1425
|
+
|
|
1426
|
+
/***/ "aa5b7d941e7a"
|
|
1427
|
+
(module) {
|
|
1428
|
+
|
|
1429
|
+
module.exports = /*#__PURE__*/JSON.parse('{"id":"smart.mail-inspector","tag":"sf-mail-inspector","version":"1.1.5","kind":"leaf","settings":{"heading":{"type":"string","default":""},"heading-icon":{"type":"icon","default":""},"form-key":{"type":"string","default":""},"tab":{"type":"id","default":""},"levels":{"type":"list","default":[],"of":{"text":"string"},"entries":{"key":"text","changes":"content"}},"head-actions":{"type":"list","default":[],"of":"string"},"notice":{"type":"object","default":{}},"tabs":{"type":"list","default":[],"of":{"id":"id","label":"string","slot":{"type":"string","optional":true}},"entries":{"key":"id","changes":"content"}},"sections":{"type":"list","default":[],"of":{"key":"id","title":"string","fields":"list"},"entries":{"key":"key","changes":"content"}},"closed-sections":{"type":"list","default":[],"of":"string"}},"values":{},"events":{"change":{"carries":{"path":"string","value":{"type":"string"},"typed":"boolean"}},"attach":{"carries":{"path":"string","files":"list"}},"detach":{"carries":{"path":"string"}},"toggle":{"carries":{"key":"id","open":"boolean"}},"level":{"carries":{"index":"number"},"own-verb":true},"tab":{"carries":{"id":"id"},"own-verb":true},"notice-action":{"carries":{},"own-verb":true},"duplicate":{"carries":{},"own-verb":true},"delete":{"carries":{}},"replace":{"carries":{}},"item-toggle":{"carries":{"path":"string","index":"number","open":"boolean"},"own-verb":true},"item-add":{"carries":{"path":"string"},"own-verb":true},"item-move":{"carries":{"path":"string","from":"number","to":"number"},"own-verb":true},"item-duplicate":{"carries":{"path":"string","index":"number"},"own-verb":true},"item-delete":{"carries":{"path":"string","index":"number"},"own-verb":true}},"actions":{"duplicate":{"with":{}},"delete":{"with":{}},"replace":{"with":{}},"level-up":{"with":{}},"go-to-level":{"with":{"index":"number"}},"open-tab":{"with":{"id":"id"}},"toggle-section":{"with":{"key":"id"}},"item-toggle":{"with":{"path":"string","index":"number"}},"item-add":{"with":{"path":"string"}},"item-move":{"with":{"path":"string","index":"number","to":{"type":"number","optional":true},"by":{"type":"number","optional":true}}},"item-duplicate":{"with":{"path":"string","index":"number"}},"item-delete":{"with":{"path":"string","index":"number"}},"focus-item":{"with":{"path":"string","index":"number"}}},"host-states":{},"css-variables":{}}');
|
|
1430
|
+
|
|
1431
|
+
/***/ },
|
|
1432
|
+
|
|
1433
|
+
/***/ "bb284bc57393"
|
|
1434
|
+
(module) {
|
|
1435
|
+
|
|
1436
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Letter inspector","runtime":{"delete-text":"Remove","down-text":"Move down","duplicate-text":"Duplicate","image-empty-text":"Add an image…","image-formats-text":"Only PNG and JPEG images fit","image-required-text":"This image is required: it can be replaced, not removed","item-actions-label":"Item actions: {label}","item-add-text":"Add an item","item-menu-label":"Item actions","item-moved-text":"Item: position {n} of {total}","path-label":"Path","replace-text":"Change the variant…","up-text":"Move up"},"events":{"duplicate":{"label":"Duplicate what is being edited"},"level":{"label":"Go to a level of the path"},"tab":{"label":"Go to a tab"},"notice-action":{"label":"Press the notice\'s button"},"item-toggle":{"label":"Open or close an item"},"item-add":{"label":"Add an item"},"item-move":{"label":"Move an item"},"item-duplicate":{"label":"Duplicate an item"},"item-delete":{"label":"Remove an item"}}}');
|
|
1437
|
+
|
|
1438
|
+
/***/ },
|
|
1439
|
+
|
|
1440
|
+
/***/ "5cdf0e37db1f"
|
|
1441
|
+
(module) {
|
|
1442
|
+
|
|
1443
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Инспектор письма","runtime":{"delete-text":"Удалить","down-text":"Ниже","duplicate-text":"Дублировать","image-empty-text":"Добавить изображение…","image-formats-text":"Подходят только PNG и JPEG","image-required-text":"Это изображение обязательно: его можно заменить, но не убрать","item-actions-label":"Действия с элементом: {label}","item-add-text":"Добавить элемент","item-menu-label":"Действия с элементом","item-moved-text":"Элемент: позиция {n} из {total}","path-label":"Путь","replace-text":"Сменить вариант…","up-text":"Выше"},"events":{"duplicate":{"label":"Дублировать то, что редактируется"},"level":{"label":"Перейти на уровень пути"},"tab":{"label":"Перейти на вкладку"},"notice-action":{"label":"Нажать кнопку сообщения"},"item-toggle":{"label":"Открыть или закрыть элемент"},"item-add":{"label":"Добавить элемент"},"item-move":{"label":"Переместить элемент"},"item-duplicate":{"label":"Дублировать элемент"},"item-delete":{"label":"Удалить элемент"}}}');
|
|
1444
|
+
|
|
1445
|
+
/***/ }
|
|
1446
|
+
|
|
1447
|
+
/******/ });
|
|
1448
|
+
/************************************************************************/
|
|
1449
|
+
/******/ // The module cache
|
|
1450
|
+
/******/ const __webpack_module_cache__ = {};
|
|
1451
|
+
/******/
|
|
1452
|
+
/******/ // The require function
|
|
1453
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1454
|
+
/******/ // Check if module is in cache
|
|
1455
|
+
/******/ const cachedModule = __webpack_module_cache__[moduleId];
|
|
1456
|
+
/******/ if (cachedModule !== undefined) {
|
|
1457
|
+
/******/ return cachedModule.exports;
|
|
1458
|
+
/******/ }
|
|
1459
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1460
|
+
/******/ const module = __webpack_module_cache__[moduleId] = {
|
|
1461
|
+
/******/ // no module.id needed
|
|
1462
|
+
/******/ // no module.loaded needed
|
|
1463
|
+
/******/ exports: {}
|
|
1464
|
+
/******/ };
|
|
1465
|
+
/******/
|
|
1466
|
+
/******/ // Execute the module function
|
|
1467
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
1468
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
1469
|
+
/******/ const e = new Error("Cannot find module '" + moduleId + "'");
|
|
1470
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
1471
|
+
/******/ throw e;
|
|
1472
|
+
/******/ }
|
|
1473
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
1474
|
+
/******/
|
|
1475
|
+
/******/ // Return the exports of the module
|
|
1476
|
+
/******/ return module.exports;
|
|
1477
|
+
/******/ }
|
|
1478
|
+
/******/
|
|
1479
|
+
/************************************************************************/
|
|
1480
|
+
/******/ /* webpack/runtime/async module */
|
|
1481
|
+
/******/ (() => {
|
|
1482
|
+
/******/ const hasSymbol = typeof Symbol === "function";
|
|
1483
|
+
/******/ const webpackQueues = hasSymbol ? Symbol("webpack queues") : "__webpack_queues__";
|
|
1484
|
+
/******/ const webpackExports = hasSymbol ? Symbol("webpack exports") : "__webpack_exports__";
|
|
1485
|
+
/******/ const webpackError = hasSymbol ? Symbol("webpack error") : "__webpack_error__";
|
|
1486
|
+
/******/
|
|
1487
|
+
/******/ const resolveQueue = (queue) => {
|
|
1488
|
+
/******/ if(queue?.d < 1) {
|
|
1489
|
+
/******/ queue.d = 1;
|
|
1490
|
+
/******/ queue.forEach((fn) => (fn.r--));
|
|
1491
|
+
/******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));
|
|
1492
|
+
/******/ }
|
|
1493
|
+
/******/ }
|
|
1494
|
+
/******/ const wrapDeps = (deps) => (deps.map((dep) => {
|
|
1495
|
+
/******/ if(dep !== null && typeof dep === "object") {
|
|
1496
|
+
/******/
|
|
1497
|
+
/******/ if(dep[webpackQueues]) return dep;
|
|
1498
|
+
/******/ if(dep.then) {
|
|
1499
|
+
/******/ const queue = [];
|
|
1500
|
+
/******/ queue.d = 0;
|
|
1501
|
+
/******/ dep.then((r) => {
|
|
1502
|
+
/******/ obj[webpackExports] = r;
|
|
1503
|
+
/******/ resolveQueue(queue);
|
|
1504
|
+
/******/ }, (e) => {
|
|
1505
|
+
/******/ obj[webpackError] = e;
|
|
1506
|
+
/******/ resolveQueue(queue);
|
|
1507
|
+
/******/ });
|
|
1508
|
+
/******/ const obj = {};
|
|
1509
|
+
/******/
|
|
1510
|
+
/******/ obj[webpackQueues] = (fn) => (fn(queue));
|
|
1511
|
+
/******/ return obj;
|
|
1512
|
+
/******/ }
|
|
1513
|
+
/******/ }
|
|
1514
|
+
/******/ const ret = {};
|
|
1515
|
+
/******/ ret[webpackQueues] = x => {};
|
|
1516
|
+
/******/ ret[webpackExports] = dep;
|
|
1517
|
+
/******/ return ret;
|
|
1518
|
+
/******/ }));
|
|
1519
|
+
/******/ __webpack_require__.a = (module, body, hasAwait) => {
|
|
1520
|
+
/******/ let queue;
|
|
1521
|
+
/******/ hasAwait && ((queue = []).d = -1);
|
|
1522
|
+
/******/ const depQueues = new Set();
|
|
1523
|
+
/******/ const exports = module.exports;
|
|
1524
|
+
/******/ let currentDeps;
|
|
1525
|
+
/******/ let outerResolve;
|
|
1526
|
+
/******/ let reject;
|
|
1527
|
+
/******/ const promise = new Promise((resolve, rej) => {
|
|
1528
|
+
/******/ reject = rej;
|
|
1529
|
+
/******/ outerResolve = resolve;
|
|
1530
|
+
/******/ });
|
|
1531
|
+
/******/ promise[webpackExports] = exports;
|
|
1532
|
+
/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
|
|
1533
|
+
/******/ module.exports = promise;
|
|
1534
|
+
/******/ const handle = (deps) => {
|
|
1535
|
+
/******/ currentDeps = wrapDeps(deps);
|
|
1536
|
+
/******/ let fn;
|
|
1537
|
+
/******/ const getResult = () => (currentDeps.map((d) => {
|
|
1538
|
+
/******/
|
|
1539
|
+
/******/ if(d[webpackError]) throw d[webpackError];
|
|
1540
|
+
/******/ return d[webpackExports];
|
|
1541
|
+
/******/ }))
|
|
1542
|
+
/******/ const promise = new Promise((resolve) => {
|
|
1543
|
+
/******/ fn = () => (resolve(getResult));
|
|
1544
|
+
/******/ fn.r = 0;
|
|
1545
|
+
/******/ const fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));
|
|
1546
|
+
/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
|
|
1547
|
+
/******/ });
|
|
1548
|
+
/******/ return fn.r ? promise : getResult();
|
|
1549
|
+
/******/ }
|
|
1550
|
+
/******/ const done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
|
|
1551
|
+
/******/ body(handle, done);
|
|
1552
|
+
/******/ queue?.d < 0 && (queue.d = 0);
|
|
1553
|
+
/******/ };
|
|
1554
|
+
/******/ })();
|
|
1555
|
+
/******/
|
|
1556
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
1557
|
+
/******/ (() => {
|
|
1558
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
1559
|
+
/******/ __webpack_require__.n = (module) => {
|
|
1560
|
+
/******/ const getter = module && module.__esModule ?
|
|
1561
|
+
/******/ () => (module['default']) :
|
|
1562
|
+
/******/ () => (module);
|
|
1563
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
1564
|
+
/******/ return getter;
|
|
1565
|
+
/******/ };
|
|
1566
|
+
/******/ })();
|
|
1567
|
+
/******/
|
|
1568
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1569
|
+
/******/ (() => {
|
|
1570
|
+
/******/ // define getter/value functions for harmony exports
|
|
1571
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
1572
|
+
/******/ if(Array.isArray(definition)) {
|
|
1573
|
+
/******/ var i = 0;
|
|
1574
|
+
/******/ while(i < definition.length) {
|
|
1575
|
+
/******/ var key = definition[i++];
|
|
1576
|
+
/******/ var binding = definition[i++];
|
|
1577
|
+
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
1578
|
+
/******/ if(binding === 0) {
|
|
1579
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
1580
|
+
/******/ } else {
|
|
1581
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
1582
|
+
/******/ }
|
|
1583
|
+
/******/ } else if(binding === 0) { i++; }
|
|
1584
|
+
/******/ }
|
|
1585
|
+
/******/ } else {
|
|
1586
|
+
/******/ for(var key in definition) {
|
|
1587
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
1588
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
1589
|
+
/******/ }
|
|
1590
|
+
/******/ }
|
|
1591
|
+
/******/ }
|
|
1592
|
+
/******/ };
|
|
1593
|
+
/******/ })();
|
|
1594
|
+
/******/
|
|
1595
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1596
|
+
/******/ (() => {
|
|
1597
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1598
|
+
/******/ })();
|
|
1599
|
+
/******/
|
|
1600
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
1601
|
+
/******/ (() => {
|
|
1602
|
+
/******/ // define __esModule on exports
|
|
1603
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
1604
|
+
/******/ if(Symbol.toStringTag) {
|
|
1605
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
1606
|
+
/******/ }
|
|
1607
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
1608
|
+
/******/ };
|
|
1609
|
+
/******/ })();
|
|
1610
|
+
/******/
|
|
1611
|
+
/************************************************************************/
|
|
1612
|
+
/******/
|
|
1613
|
+
/******/ // startup
|
|
1614
|
+
/******/ // Load entry module and return exports
|
|
1615
|
+
/******/ // This entry module used 'module' so it can't be inlined
|
|
1616
|
+
/******/ let __webpack_exports__ = __webpack_require__("655f8764d00d");
|
|
1617
|
+
/******/
|
|
1618
|
+
/******/ })()
|
|
1619
|
+
;
|