@panphora/clayjs 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clay.standalone.js +1602 -1168
- package/dist/server/checkpoint.cjs +1 -70690
- package/dist/server/core.cjs +72210 -0
- package/dist/server/rooms.cjs +1 -72039
- package/docs/guide.md +35 -8
- package/entries/sap.js +5 -5
- package/package.json +1 -1
- package/packed-contract.json +1 -0
- package/src/core/boot-phase.js +6 -0
- package/src/core/conflict-download.js +1 -1
- package/src/core/save.js +94 -6
- package/src/core/snapshot.js +12 -0
- package/src/lib/derived.js +116 -0
- package/src/lib/mutation.js +3 -1
- package/src/lib/style.js +10 -7
- package/src/loader-logic.js +12 -4
- package/src/loader.js +31 -1
- package/src/page/blocks.js +61 -12
- package/src/page/editor.js +3 -1
- package/src/plugins/derive.js +12 -0
- package/src/plugins/undo.js +2 -1
- package/src/sync/conflict-revert.js +2 -0
- package/src/sync/conflicts.js +2 -2
- package/src/sync/live-sync.js +23 -6
- package/src/vendor/sap-core.vendor.js +9 -0
- package/src/vendor/sap-ownership.vendor.js +111 -0
package/dist/clay.standalone.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* clayjs 1.
|
|
1
|
+
/* clayjs 1.15.0 standalone build: every clayjs module in one file. https://clayjs.com/offline
|
|
2
2
|
Third-party code inside keeps its own license (Sortable MIT, Squire MIT, DOMPurify Apache-2.0 OR MPL-2.0, MicroModal MIT, parse5 MIT, Highlights from Pierre Apache-2.0): https://clayjs.com/THIRD-PARTY-NOTICES.md */
|
|
3
3
|
(() => {
|
|
4
4
|
var __create = Object.create;
|
|
@@ -753,6 +753,192 @@
|
|
|
753
753
|
}
|
|
754
754
|
});
|
|
755
755
|
|
|
756
|
+
// src/vendor/sap-ownership.vendor.js
|
|
757
|
+
function recordOwnsFormState(el11) {
|
|
758
|
+
return el11.hasAttribute("bind") || el11.hasAttribute("persist") || !!el11.closest("select[bind]");
|
|
759
|
+
}
|
|
760
|
+
function inert(el11) {
|
|
761
|
+
return el11.localName === "template" || el11.hasAttribute("template") || el11.hasAttribute("cms-template") || el11.hasAttribute("sap-ignore");
|
|
762
|
+
}
|
|
763
|
+
function appOf(el11) {
|
|
764
|
+
for (let cur = el11; cur && cur.nodeType === 1; cur = cur.parentElement) {
|
|
765
|
+
if (inert(cur)) return null;
|
|
766
|
+
if (cur.hasAttribute("sap")) return cur;
|
|
767
|
+
}
|
|
768
|
+
return null;
|
|
769
|
+
}
|
|
770
|
+
function declares(el11, name) {
|
|
771
|
+
const decl2 = el11.getAttribute("state");
|
|
772
|
+
if (!decl2) return false;
|
|
773
|
+
for (const token2 of decl2.trim().split(/\s+/)) {
|
|
774
|
+
if (token2.split("=")[0].split(":")[0] === name) return true;
|
|
775
|
+
}
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
function paintsHidden(el11) {
|
|
779
|
+
if (el11.hasAttribute("show")) return true;
|
|
780
|
+
for (const a2 of el11.attributes) if (WHEN.test(a2.name)) return true;
|
|
781
|
+
return false;
|
|
782
|
+
}
|
|
783
|
+
function ownsAttr(el11, name) {
|
|
784
|
+
if (!el11 || el11.nodeType !== 1 || !name) return false;
|
|
785
|
+
if (name === BEACON) return !!appOf(el11);
|
|
786
|
+
if (NEVER2.has(name)) return false;
|
|
787
|
+
if (FORM_STATE.has(name) && recordOwnsFormState(el11)) return false;
|
|
788
|
+
if (name === "hidden") return paintsHidden(el11) && !!appOf(el11);
|
|
789
|
+
return el11.hasAttribute("attr:" + name) && !declares(el11, name) && !!appOf(el11);
|
|
790
|
+
}
|
|
791
|
+
function paintsOf(el11) {
|
|
792
|
+
if (!el11 || el11.nodeType !== 1 || !appOf(el11)) return null;
|
|
793
|
+
let out = null;
|
|
794
|
+
const add2 = (key2, v5) => (out || (out = { attrs: [], classes: [], vars: [], text: false }))[key2].push(v5);
|
|
795
|
+
for (const a2 of el11.attributes) {
|
|
796
|
+
const n3 = a2.name;
|
|
797
|
+
if (n3 === "text" || n3.startsWith("text:")) {
|
|
798
|
+
if (!el11.hasAttribute("bind")) (out || (out = { attrs: [], classes: [], vars: [], text: false })).text = true;
|
|
799
|
+
} else if (n3.startsWith("attr:")) {
|
|
800
|
+
const target = n3.slice(5);
|
|
801
|
+
if (target && !NEVER2.has(target) && !(FORM_STATE.has(target) && recordOwnsFormState(el11)) && !declares(el11, target)) add2("attrs", target);
|
|
802
|
+
} else if (n3.startsWith("class:")) add2("classes", n3.slice(6));
|
|
803
|
+
else if (n3.startsWith("css:")) add2("vars", "--" + n3.slice(4));
|
|
804
|
+
}
|
|
805
|
+
if (paintsHidden(el11)) add2("attrs", "hidden");
|
|
806
|
+
if (el11.hasAttribute(BEACON)) add2("attrs", BEACON);
|
|
807
|
+
return out;
|
|
808
|
+
}
|
|
809
|
+
function eachPainted(root3, visit) {
|
|
810
|
+
if (!root3 || root3.nodeType !== 1 && root3.nodeType !== 9) return;
|
|
811
|
+
const apps = root3.nodeType === 1 && root3.hasAttribute("sap") ? [root3] : [...root3.querySelectorAll("[sap]")].filter((app) => !app.parentElement || !app.parentElement.closest("[sap]"));
|
|
812
|
+
for (const app of apps) {
|
|
813
|
+
for (const el11 of [app, ...app.querySelectorAll("*")]) {
|
|
814
|
+
const p3 = paintsOf(el11);
|
|
815
|
+
if (p3) visit(el11, p3);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
function stripPaints(root3) {
|
|
820
|
+
eachPainted(root3, (el11, p3) => {
|
|
821
|
+
for (const name of p3.attrs) if (el11.hasAttribute(name)) el11.removeAttribute(name);
|
|
822
|
+
for (const token2 of p3.classes) if (el11.classList.contains(token2)) el11.classList.remove(token2);
|
|
823
|
+
if (!el11.getAttribute("class") && el11.hasAttribute("class") && p3.classes.length) el11.removeAttribute("class");
|
|
824
|
+
for (const v5 of p3.vars) if (el11.style.getPropertyValue(v5) !== "") el11.style.removeProperty(v5);
|
|
825
|
+
if (p3.vars.length && el11.hasAttribute("style") && !el11.getAttribute("style").trim()) el11.removeAttribute("style");
|
|
826
|
+
if (p3.text && el11.firstChild) el11.replaceChildren();
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
var BEACON, WHEN, NEVER2, FORM_STATE;
|
|
830
|
+
var init_sap_ownership_vendor = __esm({
|
|
831
|
+
"src/vendor/sap-ownership.vendor.js"() {
|
|
832
|
+
BEACON = "sap-error";
|
|
833
|
+
WHEN = /^(show-when|hide-when|option|option-not):/;
|
|
834
|
+
NEVER2 = /* @__PURE__ */ new Set([
|
|
835
|
+
"id",
|
|
836
|
+
"data-id",
|
|
837
|
+
"class",
|
|
838
|
+
"style",
|
|
839
|
+
"sap",
|
|
840
|
+
"scope",
|
|
841
|
+
"items",
|
|
842
|
+
"item",
|
|
843
|
+
"bind",
|
|
844
|
+
"state",
|
|
845
|
+
"template",
|
|
846
|
+
"cms-template",
|
|
847
|
+
"sap-ignore"
|
|
848
|
+
]);
|
|
849
|
+
FORM_STATE = /* @__PURE__ */ new Set(["value", "checked", "selected"]);
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
|
|
853
|
+
// src/core/boot-phase.js
|
|
854
|
+
var bootPhase;
|
|
855
|
+
var init_boot_phase = __esm({
|
|
856
|
+
"src/core/boot-phase.js"() {
|
|
857
|
+
bootPhase = { holdSettle: false };
|
|
858
|
+
}
|
|
859
|
+
});
|
|
860
|
+
|
|
861
|
+
// src/lib/derived.js
|
|
862
|
+
function paintSignature(root3) {
|
|
863
|
+
const parts = [];
|
|
864
|
+
eachPainted(root3, (el11, p3) => {
|
|
865
|
+
parts.push(el11.localName);
|
|
866
|
+
for (const n3 of p3.attrs) if (n3 !== "sap-error") parts.push(n3 + "=" + (el11.getAttribute(n3) ?? "\0"));
|
|
867
|
+
for (const t2 of p3.classes) parts.push("." + t2 + "=" + el11.classList.contains(t2));
|
|
868
|
+
for (const v5 of p3.vars) parts.push(v5 + "=" + el11.style.getPropertyValue(v5));
|
|
869
|
+
if (p3.text) parts.push("#" + el11.textContent);
|
|
870
|
+
});
|
|
871
|
+
return parts.join("");
|
|
872
|
+
}
|
|
873
|
+
function paintSignatureOfHtml(html) {
|
|
874
|
+
return paintSignature(new DOMParser().parseFromString(html, "text/html"));
|
|
875
|
+
}
|
|
876
|
+
function withoutTokens(value, owned2, split, join, nameOf) {
|
|
877
|
+
return split(value || "").map((t2) => t2.trim()).filter((t2) => t2 && !owned2.includes(nameOf(t2))).sort().join(join);
|
|
878
|
+
}
|
|
879
|
+
function onlyPaintedTokens(el11, name, before, after) {
|
|
880
|
+
const p3 = paintsOf(el11);
|
|
881
|
+
if (!p3) return false;
|
|
882
|
+
if (name === "class") {
|
|
883
|
+
if (!p3.classes.length) return false;
|
|
884
|
+
const rest2 = (v5) => withoutTokens(v5, p3.classes, (s2) => s2.split(/\s+/), " ", (t2) => t2);
|
|
885
|
+
return rest2(before) === rest2(after);
|
|
886
|
+
}
|
|
887
|
+
if (!p3.vars.length) return false;
|
|
888
|
+
const rest = (v5) => withoutTokens(v5, p3.vars, (s2) => s2.split(";"), ";", (t2) => t2.split(":")[0].trim());
|
|
889
|
+
return rest(before) === rest(after);
|
|
890
|
+
}
|
|
891
|
+
function isDerivedChange(change) {
|
|
892
|
+
if (change.__derived !== void 0) return change.__derived;
|
|
893
|
+
const el11 = change.element;
|
|
894
|
+
let derived2 = false;
|
|
895
|
+
if (el11 && el11.nodeType === 1) {
|
|
896
|
+
if (change.type === "attribute") {
|
|
897
|
+
const name = change.attribute;
|
|
898
|
+
derived2 = isDerivedAttr(el11, name) || (name === "class" || name === "style") && onlyPaintedTokens(el11, name, change.oldValue, change.newValue);
|
|
899
|
+
} else if (change.type === "characterData") {
|
|
900
|
+
derived2 = ownsDerivedText(el11);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
change.__derived = derived2;
|
|
904
|
+
return derived2;
|
|
905
|
+
}
|
|
906
|
+
function derivedActive() {
|
|
907
|
+
return engines.size > 0 || bootPhase.holdSettle;
|
|
908
|
+
}
|
|
909
|
+
function repaintDerived() {
|
|
910
|
+
for (const repaint of [...engines]) {
|
|
911
|
+
try {
|
|
912
|
+
repaint();
|
|
913
|
+
} catch (err) {
|
|
914
|
+
console.error("clayjs: a derived repaint failed:", err);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
var isDerivedAttr, ownsDerivedText, stripDerived, engines, mountedOnce, mountWaiters, derived;
|
|
919
|
+
var init_derived = __esm({
|
|
920
|
+
"src/lib/derived.js"() {
|
|
921
|
+
init_sap_ownership_vendor();
|
|
922
|
+
init_boot_phase();
|
|
923
|
+
isDerivedAttr = (el11, name) => ownsAttr(el11, name);
|
|
924
|
+
ownsDerivedText = (el11) => !!el11 && el11.nodeType === 1 && !!paintsOf(el11)?.text;
|
|
925
|
+
stripDerived = (root3) => stripPaints(root3);
|
|
926
|
+
engines = /* @__PURE__ */ new Set();
|
|
927
|
+
mountedOnce = false;
|
|
928
|
+
mountWaiters = [];
|
|
929
|
+
derived = {
|
|
930
|
+
register(repaint) {
|
|
931
|
+
engines.add(repaint);
|
|
932
|
+
return () => engines.delete(repaint);
|
|
933
|
+
},
|
|
934
|
+
mounted() {
|
|
935
|
+
mountedOnce = true;
|
|
936
|
+
for (const fn4 of mountWaiters.splice(0)) fn4();
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
|
|
756
942
|
// src/lib/user-gesture.js
|
|
757
943
|
function now() {
|
|
758
944
|
return typeof performance !== "undefined" && performance.now ? performance.now() : Date.now();
|
|
@@ -853,6 +1039,7 @@
|
|
|
853
1039
|
init_region_capabilities();
|
|
854
1040
|
init_root_attrs();
|
|
855
1041
|
init_ephemeral();
|
|
1042
|
+
init_derived();
|
|
856
1043
|
init_user_gesture();
|
|
857
1044
|
dummyElem = document.createElement("div");
|
|
858
1045
|
ROOT_LIBRARY_ATTR_SET = new Set(ROOT_LIBRARY_ATTRS);
|
|
@@ -939,6 +1126,7 @@
|
|
|
939
1126
|
const { fn: fn4, debounce: debounce2 = 0, maxWait = 0, selectorFilter, omitChangeDetails, require: require2, skip } = callback;
|
|
940
1127
|
let filteredChanges = changes2.filter(
|
|
941
1128
|
(change) => {
|
|
1129
|
+
if (require2 !== "observed" && isDerivedChange(change)) return false;
|
|
942
1130
|
const currentSkipped = skipForPolicy(this._policyForChange(change), require2, skip);
|
|
943
1131
|
if (!change.policyTransition) return !currentSkipped;
|
|
944
1132
|
const previousSkipped = skipForPolicy(change.previousPolicy, require2, skip);
|
|
@@ -1308,7 +1496,7 @@
|
|
|
1308
1496
|
});
|
|
1309
1497
|
if (!onlyNonPausable && isUserDrivenNow()) {
|
|
1310
1498
|
for (const change of changes2) {
|
|
1311
|
-
if (!skipForPolicy(this._policyForChange(change), "dirty")) {
|
|
1499
|
+
if (!isDerivedChange(change) && !skipForPolicy(this._policyForChange(change), "dirty")) {
|
|
1312
1500
|
markUserDriven();
|
|
1313
1501
|
break;
|
|
1314
1502
|
}
|
|
@@ -1692,9 +1880,9 @@
|
|
|
1692
1880
|
if (!blocks.length) return "<!DOCTYPE html>" + clone.outerHTML;
|
|
1693
1881
|
const nonce2 = Math.random().toString(36).slice(2);
|
|
1694
1882
|
const raw = blocks.map(([el11, kids], i2) => {
|
|
1695
|
-
const
|
|
1696
|
-
el11.replaceChildren(el11.ownerDocument.createTextNode(
|
|
1697
|
-
return [
|
|
1883
|
+
const marker2 = `\uE000clay-noscript-${nonce2}-${i2}\uE000`;
|
|
1884
|
+
el11.replaceChildren(el11.ownerDocument.createTextNode(marker2));
|
|
1885
|
+
return [marker2, kids.map((n3) => n3.data).join("")];
|
|
1698
1886
|
});
|
|
1699
1887
|
let html;
|
|
1700
1888
|
try {
|
|
@@ -1702,7 +1890,7 @@
|
|
|
1702
1890
|
} finally {
|
|
1703
1891
|
for (const [el11, kids] of blocks) el11.replaceChildren(...kids);
|
|
1704
1892
|
}
|
|
1705
|
-
for (const [
|
|
1893
|
+
for (const [marker2, text2] of raw) html = html.split(marker2).join(text2);
|
|
1706
1894
|
return html;
|
|
1707
1895
|
}
|
|
1708
1896
|
function serializeSaveClone(clone) {
|
|
@@ -1757,12 +1945,17 @@
|
|
|
1757
1945
|
for (const el11 of clone.querySelectorAll(STRIP_FROM_SAVE)) {
|
|
1758
1946
|
el11.remove();
|
|
1759
1947
|
}
|
|
1948
|
+
stripDiagnosticBeacons(clone);
|
|
1760
1949
|
return clone;
|
|
1761
1950
|
}
|
|
1951
|
+
function stripDiagnosticBeacons(clone) {
|
|
1952
|
+
for (const el11 of clone.querySelectorAll("[sap-error]")) el11.removeAttribute("sap-error");
|
|
1953
|
+
}
|
|
1762
1954
|
function captureSaveClone({ flushUndo = true, authored: authored3 = true } = {}) {
|
|
1763
1955
|
return prepareCloneForSave(captureSnapshot({ flushUndo, authored: authored3 }), { authored: authored3 });
|
|
1764
1956
|
}
|
|
1765
1957
|
function serializeForCompare(clone) {
|
|
1958
|
+
stripDerived(clone);
|
|
1766
1959
|
for (const name of EMPTY_INERT_ATTRS) {
|
|
1767
1960
|
if (clone.getAttribute(name) === "") clone.removeAttribute(name);
|
|
1768
1961
|
for (const el11 of clone.querySelectorAll(`[${name}=""]`)) el11.removeAttribute(name);
|
|
@@ -1842,6 +2035,7 @@
|
|
|
1842
2035
|
for (const el11 of clone.querySelectorAll(STRIP_FROM_SAVE)) {
|
|
1843
2036
|
el11.remove();
|
|
1844
2037
|
}
|
|
2038
|
+
stripDiagnosticBeacons(clone);
|
|
1845
2039
|
const forSave = serializeSaveClone(clone);
|
|
1846
2040
|
for (const el11 of compareClone.querySelectorAll(STRIP_FROM_COMPARISON)) {
|
|
1847
2041
|
el11.remove();
|
|
@@ -1887,6 +2081,7 @@
|
|
|
1887
2081
|
for (const el11 of clone.querySelectorAll(STRIP_FROM_SAVE)) {
|
|
1888
2082
|
el11.remove();
|
|
1889
2083
|
}
|
|
2084
|
+
stripDiagnosticBeacons(clone);
|
|
1890
2085
|
for (const el11 of compareClone.querySelectorAll(STRIP_FROM_DIRTY_CHECK)) {
|
|
1891
2086
|
el11.remove();
|
|
1892
2087
|
}
|
|
@@ -1935,6 +2130,7 @@
|
|
|
1935
2130
|
init_region_policy();
|
|
1936
2131
|
init_root_attrs();
|
|
1937
2132
|
init_ephemeral();
|
|
2133
|
+
init_derived();
|
|
1938
2134
|
init_content_dom();
|
|
1939
2135
|
snapshotHooks = [];
|
|
1940
2136
|
documentTransforms = [];
|
|
@@ -8578,6 +8774,7 @@
|
|
|
8578
8774
|
autosaveIsSuspended: () => autosaveIsSuspended,
|
|
8579
8775
|
baselineSettled: () => baselineSettled,
|
|
8580
8776
|
conflictResolvedBySync: () => conflictResolvedBySync,
|
|
8777
|
+
currentPaintSignature: () => currentPaintSignature,
|
|
8581
8778
|
default: () => save_default,
|
|
8582
8779
|
flushSave: () => flushSave,
|
|
8583
8780
|
getLastSavedBytes: () => getLastSavedBytes,
|
|
@@ -8591,6 +8788,7 @@
|
|
|
8591
8788
|
initSaveKeyboardShortcut: () => initSaveKeyboardShortcut,
|
|
8592
8789
|
isSaveConflicted: () => isSaveConflicted,
|
|
8593
8790
|
releaseAllSaves: () => releaseAllSaves,
|
|
8791
|
+
releaseBootSettle: () => releaseBootSettle,
|
|
8594
8792
|
replacePageWith: () => replacePageWith2,
|
|
8595
8793
|
resumeAutosave: () => resumeAutosave,
|
|
8596
8794
|
saveHoldReason: () => saveHoldReason,
|
|
@@ -8599,6 +8797,7 @@
|
|
|
8599
8797
|
savePageForce: () => savePageForce,
|
|
8600
8798
|
savePageThrottled: () => savePageThrottled,
|
|
8601
8799
|
savesHeld: () => savesHeld,
|
|
8800
|
+
schedulePaintHeal: () => schedulePaintHeal,
|
|
8602
8801
|
setLastSavedBaselines: () => setLastSavedBaselines,
|
|
8603
8802
|
setLastSavedContents: () => setLastSavedContents,
|
|
8604
8803
|
setUnsavedChanges: () => setUnsavedChanges,
|
|
@@ -8710,7 +8909,7 @@
|
|
|
8710
8909
|
function skipped_(msg) {
|
|
8711
8910
|
return { ok: false, msg, msgType: "skipped", code: null, etag: null };
|
|
8712
8911
|
}
|
|
8713
|
-
function applySaveResult(result2, forComparison, forDirty, label, gateToken, forSave = null, captureId = null) {
|
|
8912
|
+
function applySaveResult(result2, forComparison, forDirty, label, gateToken, forSave = null, captureId = null, quietConflict = false) {
|
|
8714
8913
|
if (result2.ok) {
|
|
8715
8914
|
setLastSavedBaselines(forComparison, forDirty);
|
|
8716
8915
|
lastSavedBytes = forSave;
|
|
@@ -8720,6 +8919,14 @@
|
|
|
8720
8919
|
logBaseline(label, `${lastSavedContents.length} chars`);
|
|
8721
8920
|
releaseConflictHold();
|
|
8722
8921
|
} else if (result2.msgType === "conflict") {
|
|
8922
|
+
if (quietConflict) {
|
|
8923
|
+
if (savingTimeout) {
|
|
8924
|
+
clearTimeout(savingTimeout);
|
|
8925
|
+
savingTimeout = null;
|
|
8926
|
+
}
|
|
8927
|
+
document.documentElement.setAttribute("savestatus", "saved");
|
|
8928
|
+
return;
|
|
8929
|
+
}
|
|
8723
8930
|
holdForConflict(result2.conflictEtag);
|
|
8724
8931
|
setSaveState("conflict", result2.msg, result2.msgType, {
|
|
8725
8932
|
hadTimeout: result2.hadTimeout === true,
|
|
@@ -8845,7 +9052,7 @@
|
|
|
8845
9052
|
});
|
|
8846
9053
|
}
|
|
8847
9054
|
function savePageForce(callback = () => {
|
|
8848
|
-
}) {
|
|
9055
|
+
}, { quietConflict = false } = {}) {
|
|
8849
9056
|
return new Promise((resolve) => {
|
|
8850
9057
|
if (!isEditMode && !window.clay?.testMode) {
|
|
8851
9058
|
const skipped = skipped_("Not in edit mode");
|
|
@@ -8883,7 +9090,7 @@
|
|
|
8883
9090
|
saveCapturedHtml(forSave, captureId, (result2) => {
|
|
8884
9091
|
ownSaveOnWire = false;
|
|
8885
9092
|
inFlightComparisons.delete(comparison);
|
|
8886
|
-
applySaveResult(result2, comparison.forComparison, comparison.forDirty, "updated after force save", gateToken, forSave, captureId);
|
|
9093
|
+
applySaveResult(result2, comparison.forComparison, comparison.forDirty, "updated after force save", gateToken, forSave, captureId, quietConflict);
|
|
8887
9094
|
if (typeof callback === "function") {
|
|
8888
9095
|
callback(result2);
|
|
8889
9096
|
}
|
|
@@ -8993,6 +9200,46 @@
|
|
|
8993
9200
|
function baselineSettled() {
|
|
8994
9201
|
return baselineSettledAt;
|
|
8995
9202
|
}
|
|
9203
|
+
function hashSignature(s2) {
|
|
9204
|
+
let h = 5381;
|
|
9205
|
+
for (let i2 = 0; i2 < s2.length; i2++) h = (h << 5) + h + s2.charCodeAt(i2) | 0;
|
|
9206
|
+
return String(h >>> 0);
|
|
9207
|
+
}
|
|
9208
|
+
function healedFrom(signature) {
|
|
9209
|
+
try {
|
|
9210
|
+
return localStorage.getItem(HEAL_KEY) === hashSignature(signature);
|
|
9211
|
+
} catch {
|
|
9212
|
+
return false;
|
|
9213
|
+
}
|
|
9214
|
+
}
|
|
9215
|
+
function noteHealedFrom(signature) {
|
|
9216
|
+
try {
|
|
9217
|
+
localStorage.setItem(HEAL_KEY, hashSignature(signature));
|
|
9218
|
+
} catch {
|
|
9219
|
+
}
|
|
9220
|
+
}
|
|
9221
|
+
function currentPaintSignature() {
|
|
9222
|
+
return paintSignature(captureSaveClone({ flushUndo: false }));
|
|
9223
|
+
}
|
|
9224
|
+
function schedulePaintHeal(fileSignature) {
|
|
9225
|
+
if (!isEditMode || isDraftMode) return;
|
|
9226
|
+
clearTimeout(paintHealTimer);
|
|
9227
|
+
paintHealTimer = setTimeout(() => {
|
|
9228
|
+
paintHealTimer = null;
|
|
9229
|
+
const onDisk = typeof fileSignature === "function" ? fileSignature() : fileSignature;
|
|
9230
|
+
if (onDisk == null || !autosaveActive() || !baselineSettled() || isSaveConflicted() || autosaveIsSuspended()) return;
|
|
9231
|
+
if (captureForDirtyCheck({ flushUndo: false }) !== lastSavedDirty) return;
|
|
9232
|
+
if (onDisk === currentPaintSignature()) return;
|
|
9233
|
+
if (healedFrom(onDisk)) return;
|
|
9234
|
+
noteHealedFrom(onDisk);
|
|
9235
|
+
savePageForce(() => {
|
|
9236
|
+
}, { quietConflict: true });
|
|
9237
|
+
}, PAINT_HEAL_MIN_MS + Math.random() * PAINT_HEAL_SPREAD_MS);
|
|
9238
|
+
}
|
|
9239
|
+
function releaseBootSettle() {
|
|
9240
|
+
bootPhase.holdSettle = false;
|
|
9241
|
+
if (settleNow) settleNow();
|
|
9242
|
+
}
|
|
8996
9243
|
function initBaselineCapture() {
|
|
8997
9244
|
if (!isEditMode) return;
|
|
8998
9245
|
let userEdited = false;
|
|
@@ -9030,13 +9277,20 @@
|
|
|
9030
9277
|
baselineSettledAt = true;
|
|
9031
9278
|
document.dispatchEvent(new CustomEvent("clay:baseline-settled"));
|
|
9032
9279
|
};
|
|
9280
|
+
settleNow = captureBaseline;
|
|
9281
|
+
const settle6 = () => {
|
|
9282
|
+
if (!bootPhase.holdSettle) captureBaseline();
|
|
9283
|
+
};
|
|
9033
9284
|
unsubscribeMutation = mutation_default.onAnyChange(
|
|
9034
9285
|
{ debounce: SETTLE_MS, omitChangeDetails: true, require: "autosave" },
|
|
9035
|
-
|
|
9286
|
+
settle6
|
|
9036
9287
|
);
|
|
9037
9288
|
setTimeout(() => {
|
|
9038
|
-
if (!settled2)
|
|
9289
|
+
if (!settled2) settle6();
|
|
9039
9290
|
}, MAX_SETTLE_MS);
|
|
9291
|
+
setTimeout(() => {
|
|
9292
|
+
if (!settled2 && bootPhase.holdSettle) releaseBootSettle();
|
|
9293
|
+
}, MAX_HOLD_MS);
|
|
9040
9294
|
}
|
|
9041
9295
|
function savePageThrottled(callback = () => {
|
|
9042
9296
|
}) {
|
|
@@ -9125,7 +9379,7 @@
|
|
|
9125
9379
|
initSaveKeyboardShortcut();
|
|
9126
9380
|
initHyperclaySaveButton();
|
|
9127
9381
|
}
|
|
9128
|
-
var savingTimeout, unsavedChanges, lastSavedContents, lastSavedDirty, baselineRevision, inFlightComparisons, pendingSave, pendingAutosave, ownSaveOnWire, autosaveSuspended, autosaveMissed, previewHold, previewMissed, previewAutosaveMissed, PREVIEW_HOLD_REASON, holdReasons, conflictHold, conflictEtag, lastSavedBytes, throttledSave, baselineContents, baselineActive, baselineSettledAt, SETTLE_MS, MAX_SETTLE_MS, save_default;
|
|
9382
|
+
var savingTimeout, unsavedChanges, lastSavedContents, lastSavedDirty, baselineRevision, inFlightComparisons, pendingSave, pendingAutosave, ownSaveOnWire, autosaveSuspended, autosaveMissed, previewHold, previewMissed, previewAutosaveMissed, PREVIEW_HOLD_REASON, holdReasons, conflictHold, conflictEtag, lastSavedBytes, throttledSave, baselineContents, baselineActive, baselineSettledAt, PAINT_HEAL_MIN_MS, PAINT_HEAL_SPREAD_MS, paintHealTimer, HEAL_KEY, SETTLE_MS, MAX_SETTLE_MS, MAX_HOLD_MS, settleNow, save_default;
|
|
9129
9383
|
var init_save = __esm({
|
|
9130
9384
|
"src/core/save.js"() {
|
|
9131
9385
|
init_throttle();
|
|
@@ -9133,6 +9387,7 @@
|
|
|
9133
9387
|
init_is_edit_mode();
|
|
9134
9388
|
init_save_core();
|
|
9135
9389
|
init_snapshot();
|
|
9390
|
+
init_derived();
|
|
9136
9391
|
init_region_policy();
|
|
9137
9392
|
init_etag();
|
|
9138
9393
|
init_dirty_gate();
|
|
@@ -9144,6 +9399,7 @@
|
|
|
9144
9399
|
init_autosave_debug();
|
|
9145
9400
|
init_user_gesture();
|
|
9146
9401
|
init_unsaved_warning();
|
|
9402
|
+
init_boot_phase();
|
|
9147
9403
|
addDocumentTransform((clone) => {
|
|
9148
9404
|
for (const name of ROOT_LIBRARY_ATTRS) clone.removeAttribute(name);
|
|
9149
9405
|
});
|
|
@@ -9184,6 +9440,10 @@
|
|
|
9184
9440
|
baselineContents = "";
|
|
9185
9441
|
baselineActive = true;
|
|
9186
9442
|
baselineSettledAt = false;
|
|
9443
|
+
PAINT_HEAL_MIN_MS = 250;
|
|
9444
|
+
PAINT_HEAL_SPREAD_MS = 1250;
|
|
9445
|
+
paintHealTimer = null;
|
|
9446
|
+
HEAL_KEY = "clay:paint-heal:" + location.pathname;
|
|
9187
9447
|
registerStyleAdoption((identity) => {
|
|
9188
9448
|
const strip = styleComparisonStripper(identity);
|
|
9189
9449
|
lastSavedContents = strip(lastSavedContents);
|
|
@@ -9196,6 +9456,8 @@
|
|
|
9196
9456
|
});
|
|
9197
9457
|
SETTLE_MS = 500;
|
|
9198
9458
|
MAX_SETTLE_MS = 3e3;
|
|
9459
|
+
MAX_HOLD_MS = 1e4;
|
|
9460
|
+
settleNow = null;
|
|
9199
9461
|
if (document.readyState === "loading") {
|
|
9200
9462
|
document.addEventListener("DOMContentLoaded", initBaselineCapture);
|
|
9201
9463
|
} else {
|
|
@@ -9910,7 +10172,7 @@
|
|
|
9910
10172
|
}
|
|
9911
10173
|
}
|
|
9912
10174
|
applies2.sort((a2, b4) => (a2.ticket || 0) - (b4.ticket || 0));
|
|
9913
|
-
const pageOf = (a2) => serializeRecoveryClone(a2.root, { prepared: a2.domain === "save" });
|
|
10175
|
+
const pageOf = (a2) => serializeRecoveryClone(a2.recoveryRoot ?? a2.root, { prepared: a2.domain === "save" });
|
|
9914
10176
|
let html;
|
|
9915
10177
|
let older;
|
|
9916
10178
|
if (refused2 || !applies2.length) {
|
|
@@ -17675,9 +17937,9 @@
|
|
|
17675
17937
|
apply2.ids.add(id);
|
|
17676
17938
|
return id;
|
|
17677
17939
|
}
|
|
17678
|
-
function beginApply({ source: source3, seq = null, etag = null, domain, root: root3 }) {
|
|
17940
|
+
function beginApply({ source: source3, seq = null, etag = null, domain, root: root3, recoveryRoot = null }) {
|
|
17679
17941
|
const id = nextId("a");
|
|
17680
|
-
applies.set(id, { id, source: source3, seq, etag, ticket: 0, domain, root: root3, ids: /* @__PURE__ */ new Set() });
|
|
17942
|
+
applies.set(id, { id, source: source3, seq, etag, ticket: 0, domain, root: root3, recoveryRoot, ids: /* @__PURE__ */ new Set() });
|
|
17681
17943
|
pending2.add(id);
|
|
17682
17944
|
register().changed();
|
|
17683
17945
|
return id;
|
|
@@ -18885,6 +19147,7 @@
|
|
|
18885
19147
|
});
|
|
18886
19148
|
function emptyScratchpads(root3) {
|
|
18887
19149
|
for (const el11 of root3.querySelectorAll(FREEZE_SELECTOR2)) el11.replaceChildren();
|
|
19150
|
+
if (derivedActive()) stripDerived(root3);
|
|
18888
19151
|
return root3;
|
|
18889
19152
|
}
|
|
18890
19153
|
function scratchpadsEmptied(input) {
|
|
@@ -18949,6 +19212,7 @@
|
|
|
18949
19212
|
init_stream_bridge();
|
|
18950
19213
|
init_conflicts();
|
|
18951
19214
|
init_conflict_footprints();
|
|
19215
|
+
init_derived();
|
|
18952
19216
|
init_save();
|
|
18953
19217
|
({ createIdentityStore } = HyperMorph);
|
|
18954
19218
|
SYNC_IGNORE_SELECTOR = [
|
|
@@ -20001,9 +20265,9 @@
|
|
|
20001
20265
|
live: document,
|
|
20002
20266
|
remote,
|
|
20003
20267
|
ignore: (el11) => el11.matches(SYNC_IGNORE_SELECTOR),
|
|
20004
|
-
opaque: (el11) => el11.matches(FREEZE_SELECTOR2),
|
|
20268
|
+
opaque: (el11) => el11.matches(FREEZE_SELECTOR2) || derivedActive() && ownsDerivedText(el11),
|
|
20005
20269
|
remoteWins: (el11) => el11.matches(REMOTE_WINS_SELECTOR),
|
|
20006
|
-
ignoreAttribute: isRootLocalAttr,
|
|
20270
|
+
ignoreAttribute: (el11, name, merged) => isRootLocalAttr(el11, name, merged) || derivedActive() && isDerivedAttr(merged || el11, name),
|
|
20007
20271
|
protectFocusedValue: true,
|
|
20008
20272
|
keepLiveOnly: source3 === "peer",
|
|
20009
20273
|
scripts: { mergeTags: mergeTagRecognizers },
|
|
@@ -20038,12 +20302,15 @@
|
|
|
20038
20302
|
}
|
|
20039
20303
|
});
|
|
20040
20304
|
} else {
|
|
20041
|
-
|
|
20305
|
+
const captured = captureLocal();
|
|
20306
|
+
const recoveryRoot = captured.cloneNode(true);
|
|
20307
|
+
localRoot = emptyScratchpads(captured);
|
|
20042
20308
|
applyId = beginApply({
|
|
20043
20309
|
source: source3,
|
|
20044
20310
|
seq,
|
|
20045
20311
|
etag,
|
|
20046
20312
|
root: localRoot,
|
|
20313
|
+
recoveryRoot,
|
|
20047
20314
|
domain: source3 === "disk" ? "save" : "sync"
|
|
20048
20315
|
});
|
|
20049
20316
|
try {
|
|
@@ -20157,6 +20424,7 @@
|
|
|
20157
20424
|
});
|
|
20158
20425
|
diverged = report2.localDiverged;
|
|
20159
20426
|
typedDuringWait = typed;
|
|
20427
|
+
repaintDerived();
|
|
20160
20428
|
window.scrollTo(scrollX, scrollY2);
|
|
20161
20429
|
this._setPeerBase(html, identityMap, ticket);
|
|
20162
20430
|
this._applyGen++;
|
|
@@ -20205,6 +20473,7 @@
|
|
|
20205
20473
|
* local edits.
|
|
20206
20474
|
*/
|
|
20207
20475
|
async _doApplyExternal(html, seq, etag = null, by = null, fetchOptions = null) {
|
|
20476
|
+
const priorDisk = this._diskBase;
|
|
20208
20477
|
this._log(`applyExternal - external disk change (seq=${seq})`);
|
|
20209
20478
|
this.isPaused = true;
|
|
20210
20479
|
const scrollX = window.scrollX;
|
|
@@ -20250,6 +20519,7 @@
|
|
|
20250
20519
|
});
|
|
20251
20520
|
diverged = report2.localDiverged;
|
|
20252
20521
|
typedDuringWait = typed;
|
|
20522
|
+
repaintDerived();
|
|
20253
20523
|
this._setDiskBase(html, ticket);
|
|
20254
20524
|
window.scrollTo(scrollX, scrollY2);
|
|
20255
20525
|
if (!(this._acceptedSaveTicket > ticket)) {
|
|
@@ -20290,6 +20560,9 @@
|
|
|
20290
20560
|
}
|
|
20291
20561
|
if (stamped) conflictResolvedBySync(etag);
|
|
20292
20562
|
this._saveAfterMerge(diverged, typedDuringWait);
|
|
20563
|
+
if (priorDisk != null && paintSignatureOfHtml(priorDisk) === paintSignatureOfHtml(html)) {
|
|
20564
|
+
schedulePaintHeal(() => this._diskBase == null ? null : paintSignatureOfHtml(this._diskBase));
|
|
20565
|
+
}
|
|
20293
20566
|
}
|
|
20294
20567
|
/**
|
|
20295
20568
|
* Handle a notification message from the server
|
|
@@ -21209,6 +21482,7 @@
|
|
|
21209
21482
|
await Promise.resolve();
|
|
21210
21483
|
const plan = prepareRevert(ids);
|
|
21211
21484
|
const revertedIds = applyRevert(plan);
|
|
21485
|
+
repaintDerived();
|
|
21212
21486
|
let saveResult = null;
|
|
21213
21487
|
if (revertedIds.length) {
|
|
21214
21488
|
gateMarkDirty();
|
|
@@ -21228,6 +21502,7 @@
|
|
|
21228
21502
|
init_live_sync();
|
|
21229
21503
|
init_save();
|
|
21230
21504
|
init_dirty_gate();
|
|
21505
|
+
init_derived();
|
|
21231
21506
|
init_mutation();
|
|
21232
21507
|
init_user_gesture();
|
|
21233
21508
|
init_admin_contenteditable();
|
|
@@ -27237,13 +27512,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
27237
27512
|
}
|
|
27238
27513
|
const data = view3(state2, []);
|
|
27239
27514
|
let resolveReady;
|
|
27240
|
-
const
|
|
27515
|
+
const ready6 = new Promise((resolve) => {
|
|
27241
27516
|
resolveReady = resolve;
|
|
27242
27517
|
});
|
|
27243
27518
|
const handle = Object.freeze({
|
|
27244
27519
|
name,
|
|
27245
27520
|
ephemeral: ephemeral2,
|
|
27246
|
-
ready:
|
|
27521
|
+
ready: ready6,
|
|
27247
27522
|
get data() {
|
|
27248
27523
|
return data;
|
|
27249
27524
|
},
|
|
@@ -38088,7 +38363,7 @@ ${Object.entries(inner).map(([k5, v5]) => `${serializeLive(k5)}:${serializeLive(
|
|
|
38088
38363
|
}
|
|
38089
38364
|
function identityPlugin() {
|
|
38090
38365
|
const clean2 = /* @__PURE__ */ new WeakSet();
|
|
38091
|
-
const
|
|
38366
|
+
const ready6 = (doc) => {
|
|
38092
38367
|
const ids = /* @__PURE__ */ new Set();
|
|
38093
38368
|
let previous = null, valid2 = true;
|
|
38094
38369
|
doc.forEach((node) => {
|
|
@@ -38109,7 +38384,7 @@ ${Object.entries(inner).map(([k5, v5]) => `${serializeLive(k5)}:${serializeLive(
|
|
|
38109
38384
|
return new Oi.Plugin({
|
|
38110
38385
|
state: {
|
|
38111
38386
|
init(_config, editor) {
|
|
38112
|
-
if (
|
|
38387
|
+
if (ready6(editor.doc)) clean2.add(editor.doc);
|
|
38113
38388
|
return null;
|
|
38114
38389
|
},
|
|
38115
38390
|
apply() {
|
|
@@ -38122,7 +38397,7 @@ ${Object.entries(inner).map(([k5, v5]) => `${serializeLive(k5)}:${serializeLive(
|
|
|
38122
38397
|
return null;
|
|
38123
38398
|
}
|
|
38124
38399
|
if (!transactions.some((tr5) => tr5.docChanged && !tr5.getMeta(REMOTE))) {
|
|
38125
|
-
if (clean2.has(old.doc) &&
|
|
38400
|
+
if (clean2.has(old.doc) && ready6(next.doc)) clean2.add(next.doc);
|
|
38126
38401
|
return null;
|
|
38127
38402
|
}
|
|
38128
38403
|
const tr4 = next.tr;
|
|
@@ -39078,12 +39353,29 @@ ${Object.entries(inner).map(([k5, v5]) => `${serializeLive(k5)}:${serializeLive(
|
|
|
39078
39353
|
if (dispatch) dispatch(joinIntoSummary(st6, ents, ti4, ni4).scrollIntoView());
|
|
39079
39354
|
return true;
|
|
39080
39355
|
}
|
|
39356
|
+
function deleteBeforeToggle(st6, dispatch) {
|
|
39357
|
+
const { $from, empty } = st6.selection;
|
|
39358
|
+
if (!empty || $from.depth !== 1) return false;
|
|
39359
|
+
const n3 = $from.parent, i2 = $from.index(0);
|
|
39360
|
+
if (!n3.isTextblock || n3.type.spec.code || isToggle(n3) || !n3.content.size || $from.parentOffset !== n3.content.size) return false;
|
|
39361
|
+
if (i2 + 1 >= st6.doc.childCount || !isToggle(st6.doc.child(i2 + 1))) return false;
|
|
39362
|
+
if (dispatch && n3.type !== N3.paragraph) dispatch(st6.tr.setSelection(TextSelection3.create(st6.doc, $from.after() + 1)).scrollIntoView());
|
|
39363
|
+
else if (dispatch) {
|
|
39364
|
+
const at5 = $from.before();
|
|
39365
|
+
const tr4 = st6.tr.insert($from.after() + 1, n3.content).delete(at5, $from.after());
|
|
39366
|
+
dispatch(tr4.setSelection(TextSelection3.create(tr4.doc, at5 + 1 + n3.content.size)).scrollIntoView());
|
|
39367
|
+
}
|
|
39368
|
+
return true;
|
|
39369
|
+
}
|
|
39081
39370
|
function backspaceBodyBlock(st6, dispatch) {
|
|
39082
39371
|
const { $from, empty } = st6.selection;
|
|
39083
39372
|
if (!empty || $from.depth !== 1 || $from.parentOffset !== 0 || !$from.parent.isTextblock) return false;
|
|
39084
39373
|
const n3 = $from.parent;
|
|
39085
39374
|
if (isList(n3) || isToggle(n3) || parentOf(n3) === null) return false;
|
|
39086
|
-
|
|
39375
|
+
const i2 = $from.index(0);
|
|
39376
|
+
if (st6.doc.child(i2 - 1).attrs.id !== parentOf(n3)) return false;
|
|
39377
|
+
if (dispatch) dispatch(joinIntoSummary(st6, outline(st6.doc), i2 - 1, i2).scrollIntoView());
|
|
39378
|
+
return true;
|
|
39087
39379
|
}
|
|
39088
39380
|
function setOpen(st6, ti4, open2, ents = outline(st6.doc)) {
|
|
39089
39381
|
const e20 = ents[ti4];
|
|
@@ -39502,7 +39794,7 @@ ${Object.entries(inner).map(([k5, v5]) => `${serializeLive(k5)}:${serializeLive(
|
|
|
39502
39794
|
}
|
|
39503
39795
|
});
|
|
39504
39796
|
}
|
|
39505
|
-
var alignOf, Plugin3, PluginKey3, TextSelection3, NodeSelection2, Selection3, N3, isList, isToggle, parentOf, STEP, MOVE, asStep2, subtreeRange, touchedBlocks, boundary, blockRef, matchesRef, mapSpan, BlockSelection, BlockBookmark, prevSibling, moveBlock, MAX_INDENT, sameRun, inside, ALPHA, ROMAN, collapseKey, STRUCTURAL2, LIST_LINE, LIST_TAGS, BLOCK_TAGS2, numberAttr, parentAttr, clipboardParser, ClipboardSerializer, base, clipboardSerializer, backspace, blockKeys;
|
|
39797
|
+
var alignOf, Plugin3, PluginKey3, TextSelection3, NodeSelection2, Selection3, N3, isList, isToggle, parentOf, STEP, MOVE, asStep2, subtreeRange, touchedBlocks, boundary, blockRef, matchesRef, mapSpan, BlockSelection, BlockBookmark, prevSibling, moveBlock, MAX_INDENT, sameRun, codeEdge, backspaceCodeEdge, deleteCodeEdge, inside, ALPHA, ROMAN, collapseKey, STRUCTURAL2, LIST_LINE, LIST_TAGS, BLOCK_TAGS2, numberAttr, parentAttr, clipboardParser, ClipboardSerializer, base, clipboardSerializer, backspace, del, blockKeys;
|
|
39506
39798
|
var init_blocks = __esm({
|
|
39507
39799
|
"src/page/blocks.js"() {
|
|
39508
39800
|
init_prosemirror_vendor();
|
|
@@ -39605,6 +39897,28 @@ ${Object.entries(inner).map(([k5, v5]) => `${serializeLive(k5)}:${serializeLive(
|
|
|
39605
39897
|
};
|
|
39606
39898
|
MAX_INDENT = 8;
|
|
39607
39899
|
sameRun = (x6, y4) => isList(x6.node) && isList(y4.node) && parentOf(x6.node) === parentOf(y4.node);
|
|
39900
|
+
codeEdge = (dir) => (st6, dispatch) => {
|
|
39901
|
+
const { $from, empty } = st6.selection;
|
|
39902
|
+
if (!empty || $from.depth !== 1 || !$from.parent.isTextblock) return false;
|
|
39903
|
+
const n3 = $from.parent, i2 = $from.index(0);
|
|
39904
|
+
if ($from.parentOffset !== (dir < 0 ? 0 : n3.content.size)) return false;
|
|
39905
|
+
const ents = outline(st6.doc);
|
|
39906
|
+
const ti4 = dir < 0 ? collapsedBefore(ents, i2) : -1;
|
|
39907
|
+
const j6 = ti4 >= 0 ? ti4 : i2 + dir;
|
|
39908
|
+
if (j6 < 0 || j6 >= ents.length) return false;
|
|
39909
|
+
const o3 = ents[j6].node;
|
|
39910
|
+
if (!o3.isTextblock || !n3.type.spec.code && !o3.type.spec.code) return false;
|
|
39911
|
+
if (!dispatch) return true;
|
|
39912
|
+
const tr4 = st6.tr, mine = ents[i2], other = ents[j6];
|
|
39913
|
+
const target = dir < 0 ? other.end - 1 : other.at + 1;
|
|
39914
|
+
if (!n3.content.size && !n3.type.spec.code) tr4.delete(mine.at, mine.end).setSelection(TextSelection3.create(tr4.doc, tr4.mapping.map(target)));
|
|
39915
|
+
else if (!o3.content.size && !o3.type.spec.code) tr4.delete(other.at, other.end);
|
|
39916
|
+
else tr4.setSelection(TextSelection3.create(tr4.doc, target));
|
|
39917
|
+
dispatch(tr4.scrollIntoView());
|
|
39918
|
+
return true;
|
|
39919
|
+
};
|
|
39920
|
+
backspaceCodeEdge = codeEdge(-1);
|
|
39921
|
+
deleteCodeEdge = codeEdge(1);
|
|
39608
39922
|
inside = (r44, p3) => p3 > r44.from && p3 < r44.to;
|
|
39609
39923
|
ALPHA = (n3) => {
|
|
39610
39924
|
let s2 = "";
|
|
@@ -39686,7 +40000,8 @@ ${Object.entries(inner).map(([k5, v5]) => `${serializeLive(k5)}:${serializeLive(
|
|
|
39686
40000
|
};
|
|
39687
40001
|
base = Qr.DOMSerializer.fromSchema(schema);
|
|
39688
40002
|
clipboardSerializer = new ClipboardSerializer(base.nodes, base.marks);
|
|
39689
|
-
backspace = lo.chainCommands(backspaceListItem, backspaceToggle, backspaceBodyBlock, backspaceAfterCollapsed);
|
|
40003
|
+
backspace = lo.chainCommands(backspaceListItem, backspaceToggle, backspaceCodeEdge, backspaceBodyBlock, backspaceAfterCollapsed);
|
|
40004
|
+
del = lo.chainCommands(deleteAtCollapsedEnd, deleteBeforeToggle, deleteCodeEdge);
|
|
39690
40005
|
blockKeys = {
|
|
39691
40006
|
Enter: lo.chainCommands(enterListItem, enterToggle, exitToggleOnEmpty, enterBodyBlock),
|
|
39692
40007
|
Backspace: backspace,
|
|
@@ -39694,12 +40009,12 @@ ${Object.entries(inner).map(([k5, v5]) => `${serializeLive(k5)}:${serializeLive(
|
|
|
39694
40009
|
"Mod-Backspace": backspace,
|
|
39695
40010
|
"Alt-Backspace": backspace,
|
|
39696
40011
|
"Ctrl-h": backspace,
|
|
39697
|
-
Delete:
|
|
39698
|
-
"Shift-Delete":
|
|
39699
|
-
"Mod-Delete":
|
|
39700
|
-
"Alt-Delete":
|
|
39701
|
-
"Ctrl-d":
|
|
39702
|
-
"Ctrl-Alt-Backspace":
|
|
40012
|
+
Delete: del,
|
|
40013
|
+
"Shift-Delete": del,
|
|
40014
|
+
"Mod-Delete": del,
|
|
40015
|
+
"Alt-Delete": del,
|
|
40016
|
+
"Ctrl-d": del,
|
|
40017
|
+
"Ctrl-Alt-Backspace": del,
|
|
39703
40018
|
Tab: indentBlocks,
|
|
39704
40019
|
"Shift-Tab": outdentBlocks,
|
|
39705
40020
|
"Mod-Shift-ArrowUp": moveBlock(-1),
|
|
@@ -45604,7 +45919,7 @@ ${n3.toString()}`);
|
|
|
45604
45919
|
const records3 = textDeletes(pd.gone);
|
|
45605
45920
|
Qt3(transaction, um.currStackItem.deletions, (item) => {
|
|
45606
45921
|
if (!(item instanceof b) || item.parent !== pd.flow || !item.countable || !item.redone) return;
|
|
45607
|
-
const
|
|
45922
|
+
const marker2 = item.content instanceof wt3 && item.content.embed?.b !== void 0;
|
|
45608
45923
|
for (let offset = 0; offset < item.length; offset++) {
|
|
45609
45924
|
const original = { client: item.id.client, clock: item.id.clock + offset };
|
|
45610
45925
|
const source3 = index.resolve(original);
|
|
@@ -45616,11 +45931,11 @@ ${n3.toString()}`);
|
|
|
45616
45931
|
}
|
|
45617
45932
|
if (!(live3 instanceof b) || live3.deleted) continue;
|
|
45618
45933
|
if (dest.clock < (transaction.beforeState.get(dest.client) ?? 0)) continue;
|
|
45619
|
-
if (!
|
|
45934
|
+
if (!marker2 && coversOriginal(records3, pd.ydoc.clientID, original)) {
|
|
45620
45935
|
repairs.push(dest);
|
|
45621
45936
|
continue;
|
|
45622
45937
|
}
|
|
45623
|
-
(
|
|
45938
|
+
(marker2 ? aliases : spans).push({ dest, source: source3 });
|
|
45624
45939
|
}
|
|
45625
45940
|
});
|
|
45626
45941
|
if (spans.length || aliases.length) pd.ydoc.transact(() => {
|
|
@@ -46403,8 +46718,8 @@ ${n3.toString()}`);
|
|
|
46403
46718
|
return { type, attrs, key: best.restore.key };
|
|
46404
46719
|
}
|
|
46405
46720
|
function sourceRecord(pd, index, sourceKey, removals, hidden, intents, visible, groups) {
|
|
46406
|
-
const effective = (blockId2,
|
|
46407
|
-
const boundary3 = index.boundaryOf(
|
|
46721
|
+
const effective = (blockId2, marker2, overrides2 = null) => {
|
|
46722
|
+
const boundary3 = index.boundaryOf(marker2);
|
|
46408
46723
|
if (!boundary3 || boundary3.blockId !== blockId2 || !boundary3.recoveryOf) return blockOf2(pd, blockId2, overrides2);
|
|
46409
46724
|
const root4 = recoveredRoot(boundary3.recoveryOf, groups.get(boundary3.recoveryOf) ?? [], intents);
|
|
46410
46725
|
const type = typeof overrides2?.get("t") === "string" && schema.nodes[overrides2.get("t")] ? overrides2.get("t") : root4?.type ?? "paragraph";
|
|
@@ -53438,10 +53753,10 @@ ${text2}`;
|
|
|
53438
53753
|
function style2(nameOrHref, css) {
|
|
53439
53754
|
return writeStyle(nameOrHref, css);
|
|
53440
53755
|
}
|
|
53441
|
-
function styleWithLegacyId(name, css, legacyId) {
|
|
53442
|
-
return writeStyle(name, css, legacyId);
|
|
53756
|
+
function styleWithLegacyId(name, css, legacyId, tokens = []) {
|
|
53757
|
+
return writeStyle(name, css, legacyId, tokens);
|
|
53443
53758
|
}
|
|
53444
|
-
function writeStyle(nameOrHref, css, legacyId) {
|
|
53759
|
+
function writeStyle(nameOrHref, css, legacyId, tokens = []) {
|
|
53445
53760
|
const inline = typeof css === "string";
|
|
53446
53761
|
const identity = inline ? { name: nameOrHref, legacyId } : { href: getStyleBaseUrl(nameOrHref) };
|
|
53447
53762
|
const legacy = legacyId === void 0 ? [] : document.querySelectorAll(`style[id="${legacyId}"]:not([data-name])`);
|
|
@@ -53450,7 +53765,7 @@ ${text2}`;
|
|
|
53450
53765
|
adoptStyleComparisons(identity);
|
|
53451
53766
|
for (const el11 of legacy) el11.dataset.name = nameOrHref;
|
|
53452
53767
|
if (inline) {
|
|
53453
|
-
const el11 = insertStyles(nameOrHref, css,
|
|
53768
|
+
const el11 = insertStyles(nameOrHref, css, marker(tokens));
|
|
53454
53769
|
if (legacyId !== void 0) el11.id = legacyId;
|
|
53455
53770
|
return el11;
|
|
53456
53771
|
}
|
|
@@ -53462,16 +53777,18 @@ ${text2}`;
|
|
|
53462
53777
|
mutation_default.resume();
|
|
53463
53778
|
}
|
|
53464
53779
|
}
|
|
53465
|
-
var markNoDirty;
|
|
53780
|
+
var marker, markNoDirty;
|
|
53466
53781
|
var init_style = __esm({
|
|
53467
53782
|
"src/lib/style.js"() {
|
|
53468
53783
|
init_insert_style_tag();
|
|
53469
53784
|
init_mutation();
|
|
53470
53785
|
init_style_adoption();
|
|
53471
|
-
|
|
53786
|
+
marker = (extra = []) => (el11) => {
|
|
53472
53787
|
const tokens = (el11.getAttribute("clay") ?? "").split(/\s+/).filter(Boolean);
|
|
53473
|
-
|
|
53788
|
+
const missing = ["no-dirty", ...extra].filter((token2) => !tokens.includes(token2));
|
|
53789
|
+
if (missing.length) el11.setAttribute("clay", [...tokens, ...missing].join(" "));
|
|
53474
53790
|
};
|
|
53791
|
+
markNoDirty = marker();
|
|
53475
53792
|
}
|
|
53476
53793
|
});
|
|
53477
53794
|
|
|
@@ -53540,7 +53857,7 @@ ${text2}`;
|
|
|
53540
53857
|
function createPageEditor(mount2, { blocks = null, onChange = null, upload: upload2, highlight: highlight2, doc: initialDoc, dispatch, history: useHistory = true, undo: undo2, redo, editable = true, toolHost: providedToolHost = null, onAiTool = null, reviseTool = null, board = null } = {}) {
|
|
53541
53858
|
const doc = mount2.ownerDocument;
|
|
53542
53859
|
const toolHost = providedToolHost ?? createToolHost({ mode: "edit" });
|
|
53543
|
-
styleWithLegacyId(STYLE_ID, PAGE_EDITOR_CSS, STYLE_ID);
|
|
53860
|
+
styleWithLegacyId(STYLE_ID, PAGE_EDITOR_CSS, STYLE_ID, ["editor-ui"]);
|
|
53544
53861
|
const shell = doc.createElement("div");
|
|
53545
53862
|
shell.className = "page-shell";
|
|
53546
53863
|
shell.setAttribute("clay", "editor-ui");
|
|
@@ -54456,7 +54773,7 @@ ${BOARD_CSS}
|
|
|
54456
54773
|
function installAdoption({
|
|
54457
54774
|
view: view3,
|
|
54458
54775
|
source: source3 = null,
|
|
54459
|
-
ready:
|
|
54776
|
+
ready: ready6 = Promise.resolve(),
|
|
54460
54777
|
isAdopter = () => true,
|
|
54461
54778
|
idle = () => compositionIdle(view3),
|
|
54462
54779
|
requestCheckpoint: requestCheckpoint2 = () => {
|
|
@@ -54497,7 +54814,7 @@ ${BOARD_CSS}
|
|
|
54497
54814
|
timer = setTimeout(() => resolve("timeout"), holdMs);
|
|
54498
54815
|
});
|
|
54499
54816
|
try {
|
|
54500
|
-
return await Promise.race([Promise.resolve(
|
|
54817
|
+
return await Promise.race([Promise.resolve(ready6).then(() => idle()).then(() => "ready"), cancelled.then(() => "disposed"), timeout]);
|
|
54501
54818
|
} finally {
|
|
54502
54819
|
clearTimeout(timer);
|
|
54503
54820
|
}
|
|
@@ -55731,13 +56048,13 @@ ${BOARD_CSS}
|
|
|
55731
56048
|
}
|
|
55732
56049
|
return { start: start2, endA, endB };
|
|
55733
56050
|
}
|
|
55734
|
-
function keepViewPos(
|
|
56051
|
+
function keepViewPos(derived2, current4 = null) {
|
|
55735
56052
|
const previous = /* @__PURE__ */ new Map();
|
|
55736
56053
|
current4?.forEach((block2) => {
|
|
55737
56054
|
if (block2.attrs.id) previous.set(block2.attrs.id, block2);
|
|
55738
56055
|
});
|
|
55739
56056
|
const blocks = [];
|
|
55740
|
-
|
|
56057
|
+
derived2.forEach((block2) => blocks.push(block2));
|
|
55741
56058
|
const positions = blocks.map((block2) => ({ id: block2.attrs.id, pos: previous.get(block2.attrs.id)?.attrs.pos ?? block2.attrs.pos }));
|
|
55742
56059
|
const changes2 = repairSiblings(positions, "b");
|
|
55743
56060
|
let changed2 = false;
|
|
@@ -55759,7 +56076,7 @@ ${BOARD_CSS}
|
|
|
55759
56076
|
changed2 = true;
|
|
55760
56077
|
return block2.type.create({ ...block2.attrs, pos }, content, block2.marks);
|
|
55761
56078
|
});
|
|
55762
|
-
return changed2 ?
|
|
56079
|
+
return changed2 ? derived2.type.create(derived2.attrs, placed2) : derived2;
|
|
55763
56080
|
}
|
|
55764
56081
|
function createBridge({ pd, onNotice = () => {
|
|
55765
56082
|
}, ownedTokens = [], authorToken = null, stats = { groups: 0, mismatch: 0, renders: 0, first: null }, captureTimeout = 500 }) {
|
|
@@ -55839,10 +56156,10 @@ ${BOARD_CSS}
|
|
|
55839
56156
|
stats.renders++;
|
|
55840
56157
|
const keep = saved2;
|
|
55841
56158
|
saved2 = null;
|
|
55842
|
-
const
|
|
55843
|
-
const d = docDiff(view3.state.doc,
|
|
56159
|
+
const derived2 = keepViewPos(fresh ?? refresh2(), view3.state.doc);
|
|
56160
|
+
const d = docDiff(view3.state.doc, derived2);
|
|
55844
56161
|
if (!d) return;
|
|
55845
|
-
const tr4 = view3.state.tr.replace(d.start, d.endA,
|
|
56162
|
+
const tr4 = view3.state.tr.replace(d.start, d.endA, derived2.slice(d.start, d.endB)).setMeta(REMOTE_META, true).setMeta("addToHistory", false);
|
|
55846
56163
|
if (own) tr4.setMeta("yundo", true);
|
|
55847
56164
|
if (keep) {
|
|
55848
56165
|
const hiddenUnit = (y4) => y4 >= 0 && w4.holes.some((hole) => y4 >= yBefore(w4.holes, hole.at) && y4 < yAfter(w4.holes, hole.at));
|
|
@@ -55977,12 +56294,12 @@ ${BOARD_CSS}
|
|
|
55977
56294
|
const register2 = registerAuthor;
|
|
55978
56295
|
registerAuthor = null;
|
|
55979
56296
|
localGroup(pd, local3, w4, stats, um, history3, register2);
|
|
55980
|
-
const
|
|
55981
|
-
if (!sameBareShape(
|
|
56297
|
+
const derived2 = refresh2();
|
|
56298
|
+
if (!sameBareShape(derived2, view3.state.doc)) {
|
|
55982
56299
|
stats.mismatch++;
|
|
55983
|
-
stats.first ??= { before: bareShape(local3[0].before), pm: bareShape(view3.state.doc), y: bareShape(
|
|
56300
|
+
stats.first ??= { before: bareShape(local3[0].before), pm: bareShape(view3.state.doc), y: bareShape(derived2) };
|
|
55984
56301
|
}
|
|
55985
|
-
render3(false,
|
|
56302
|
+
render3(false, derived2);
|
|
55986
56303
|
},
|
|
55987
56304
|
// Restore inserts the displaced source as a normal block found by its Yjs identity, with no
|
|
55988
56305
|
// provenance layer. Four edge cases are accepted because they are rare and lose no text
|
|
@@ -56007,12 +56324,12 @@ ${BOARD_CSS}
|
|
|
56007
56324
|
}
|
|
56008
56325
|
const blockId = `${RECOVERED_PREFIX}${sourceKey}`;
|
|
56009
56326
|
um.stopCapturing();
|
|
56010
|
-
let
|
|
56327
|
+
let marker2 = null;
|
|
56011
56328
|
pd.ydoc.transact(() => {
|
|
56012
56329
|
pd.gone.set(restoreKey(sourceKey, mintOp(pd)), { covers: record6.removals.map((removal) => removal.key), baseline: { type: record6.type, attrs: JSON.parse(JSON.stringify(record6.attrs)) } });
|
|
56013
56330
|
pd.flow.insertEmbed(restoreIndexAt(pd, sourceKey), { b: blockId });
|
|
56014
|
-
|
|
56015
|
-
origins.recordBoundary(
|
|
56331
|
+
marker2 = newestLocalMarker(pd, blockId);
|
|
56332
|
+
origins.recordBoundary(marker2, { blockId, kind: "restore", recoveryOf: sourceKey });
|
|
56016
56333
|
}, LOCAL2);
|
|
56017
56334
|
um.stopCapturing();
|
|
56018
56335
|
render3();
|
|
@@ -57264,11 +57581,11 @@ ${doc.documentElement.outerHTML}`);
|
|
|
57264
57581
|
})]);
|
|
57265
57582
|
clearTimeout(timer);
|
|
57266
57583
|
};
|
|
57267
|
-
const
|
|
57584
|
+
const ready6 = needsAdoption ? awaitWriter() : Promise.resolve();
|
|
57268
57585
|
const adoption = installAdoption({
|
|
57269
57586
|
view: view3,
|
|
57270
57587
|
source: source3,
|
|
57271
|
-
ready:
|
|
57588
|
+
ready: ready6,
|
|
57272
57589
|
isAdopter: () => {
|
|
57273
57590
|
const lane = fastLane();
|
|
57274
57591
|
return !lane || lane.status.writer === null ? true : lane.isWriter();
|
|
@@ -58891,12 +59208,13 @@ ${doc.documentElement.outerHTML}`);
|
|
|
58891
59208
|
init_hyper_undo_vendor();
|
|
58892
59209
|
init_is_edit_mode();
|
|
58893
59210
|
init_root_attrs();
|
|
59211
|
+
init_derived();
|
|
58894
59212
|
init_attr_aliases();
|
|
58895
59213
|
withTabLocal = (opts = {}) => {
|
|
58896
59214
|
const own = opts.ignoreAttribute;
|
|
58897
59215
|
return {
|
|
58898
59216
|
...opts,
|
|
58899
|
-
ignoreAttribute: (name, target) => isTabLocalAttr(name, target) || (own ? own(name, target) : false)
|
|
59217
|
+
ignoreAttribute: (name, target) => isTabLocalAttr(name, target) || isDerivedAttr(target, name) || (own ? own(name, target) : false)
|
|
58900
59218
|
};
|
|
58901
59219
|
};
|
|
58902
59220
|
createScope = undo.create.bind(undo);
|
|
@@ -71397,6 +71715,35 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
71397
71715
|
}
|
|
71398
71716
|
});
|
|
71399
71717
|
|
|
71718
|
+
// no-sap-core:../vendor/sap-core.vendor.js
|
|
71719
|
+
var sap_core_vendor_exports = {};
|
|
71720
|
+
__export(sap_core_vendor_exports, {
|
|
71721
|
+
default: () => sap_core_vendor_default
|
|
71722
|
+
});
|
|
71723
|
+
var sap_core_vendor_default;
|
|
71724
|
+
var init_sap_core_vendor = __esm({
|
|
71725
|
+
"no-sap-core:../vendor/sap-core.vendor.js"() {
|
|
71726
|
+
sap_core_vendor_default = null;
|
|
71727
|
+
}
|
|
71728
|
+
});
|
|
71729
|
+
|
|
71730
|
+
// src/plugins/derive.js
|
|
71731
|
+
var derive_exports = {};
|
|
71732
|
+
__export(derive_exports, {
|
|
71733
|
+
ready: () => ready5
|
|
71734
|
+
});
|
|
71735
|
+
function fullSapjs() {
|
|
71736
|
+
const sap = window.Sap;
|
|
71737
|
+
return Boolean(sap && !sap.core || window.clay?.loaded?.sap);
|
|
71738
|
+
}
|
|
71739
|
+
var ready5;
|
|
71740
|
+
var init_derive = __esm({
|
|
71741
|
+
"src/plugins/derive.js"() {
|
|
71742
|
+
ready5 = fullSapjs() ? null : Promise.resolve().then(() => (init_sap_core_vendor(), sap_core_vendor_exports)).then(() => {
|
|
71743
|
+
});
|
|
71744
|
+
}
|
|
71745
|
+
});
|
|
71746
|
+
|
|
71400
71747
|
// entries/clay-data.js
|
|
71401
71748
|
var clay_data_exports = {};
|
|
71402
71749
|
var init_clay_data = __esm({
|
|
@@ -72610,54 +72957,54 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
72610
72957
|
"entries/sap.js"() {
|
|
72611
72958
|
(function() {
|
|
72612
72959
|
var Sap = (() => {
|
|
72613
|
-
var
|
|
72614
|
-
var
|
|
72615
|
-
var
|
|
72616
|
-
var
|
|
72617
|
-
var
|
|
72618
|
-
for (var r44 in e20)
|
|
72619
|
-
},
|
|
72620
|
-
if (e20 && typeof e20 == "object" || typeof e20 == "function") for (let o3 of
|
|
72960
|
+
var Ot5 = Object.defineProperty;
|
|
72961
|
+
var mn3 = Object.getOwnPropertyDescriptor;
|
|
72962
|
+
var hn4 = Object.getOwnPropertyNames;
|
|
72963
|
+
var bn4 = Object.prototype.hasOwnProperty;
|
|
72964
|
+
var gn5 = (t2, e20) => {
|
|
72965
|
+
for (var r44 in e20) Ot5(t2, r44, { get: e20[r44], enumerable: true });
|
|
72966
|
+
}, wn4 = (t2, e20, r44, n3) => {
|
|
72967
|
+
if (e20 && typeof e20 == "object" || typeof e20 == "function") for (let o3 of hn4(e20)) !bn4.call(t2, o3) && o3 !== r44 && Ot5(t2, o3, { get: () => e20[o3], enumerable: !(n3 = mn3(e20, o3)) || n3.enumerable });
|
|
72621
72968
|
return t2;
|
|
72622
72969
|
};
|
|
72623
|
-
var
|
|
72624
|
-
var
|
|
72625
|
-
|
|
72626
|
-
function
|
|
72970
|
+
var yn4 = (t2) => wn4(Ot5({}, "__esModule", { value: true }), t2);
|
|
72971
|
+
var hr4 = {};
|
|
72972
|
+
gn5(hr4, { Sap: () => Mt6, default: () => mr4, mount: () => dr4, mountAll: () => pn4, runtime: () => pr4 });
|
|
72973
|
+
function ee6(t2) {
|
|
72627
72974
|
let e20 = false, r44 = /* @__PURE__ */ new Set(), n3 = [];
|
|
72628
|
-
function o3(
|
|
72629
|
-
|
|
72975
|
+
function o3(u3) {
|
|
72976
|
+
u3 && (n3.push(u3), n3.length > 8 && n3.shift());
|
|
72630
72977
|
}
|
|
72631
|
-
function s2(
|
|
72632
|
-
o3(
|
|
72978
|
+
function s2(u3, E4) {
|
|
72979
|
+
o3(E4), !u3._broken && (r44.add(u3), !e20 && (e20 = true, queueMicrotask(a2)));
|
|
72633
72980
|
}
|
|
72634
72981
|
function a2() {
|
|
72635
72982
|
e20 = false;
|
|
72636
|
-
let
|
|
72983
|
+
let u3 = [...r44];
|
|
72637
72984
|
r44.clear();
|
|
72638
|
-
for (let
|
|
72985
|
+
for (let E4 of u3) g2(E4);
|
|
72639
72986
|
}
|
|
72640
|
-
function
|
|
72641
|
-
if (!
|
|
72642
|
-
if (
|
|
72643
|
-
|
|
72987
|
+
function g2(u3, E4 = false) {
|
|
72988
|
+
if (!(u3._broken || u3.halted)) {
|
|
72989
|
+
if (u3._passes = (u3._passes || 0) + 1, u3._passes > 50) {
|
|
72990
|
+
u3._broken = true, u3._breakerRing = n3.slice(), t2(u3, { breaker: true });
|
|
72644
72991
|
return;
|
|
72645
72992
|
}
|
|
72646
|
-
|
|
72647
|
-
|
|
72648
|
-
}, 0)), t2(
|
|
72993
|
+
u3._resetArmed || (u3._resetArmed = true, setTimeout(() => {
|
|
72994
|
+
u3._passes = 0, u3._resetArmed = false;
|
|
72995
|
+
}, 0)), t2(u3, E4 ? { full: true } : {});
|
|
72649
72996
|
}
|
|
72650
72997
|
}
|
|
72651
|
-
function
|
|
72652
|
-
o3(
|
|
72998
|
+
function b4(u3, E4) {
|
|
72999
|
+
o3(E4), g2(u3, true);
|
|
72653
73000
|
}
|
|
72654
|
-
function
|
|
72655
|
-
|
|
73001
|
+
function d(u3) {
|
|
73002
|
+
u3._broken = false, u3._passes = 0;
|
|
72656
73003
|
}
|
|
72657
|
-
return { schedule: s2, runNow:
|
|
73004
|
+
return { schedule: s2, runNow: b4, rearm: d, ring: n3 };
|
|
72658
73005
|
}
|
|
72659
|
-
var
|
|
72660
|
-
function
|
|
73006
|
+
var Bt5 = { E01: { slug: "foreign-dialect", behavior: "HALT" }, E02: { slug: "moustaches-in-text", behavior: "HALT" }, E04: { slug: "duplicate-declaration", behavior: "HALT" }, E05: { slug: "reserved-name", behavior: "HALT" }, E06: { slug: "global-html-name", behavior: "HALT" }, E07: { slug: "calc-cycle", behavior: "ERR" }, E08: { slug: "expression-syntax", behavior: "HALT" }, E10: { slug: "orphan-item", behavior: "HALT" }, E12: { slug: "unknown-state-key", behavior: "ERR" }, E15: { slug: "write-to-undeclared-key", behavior: "ERR" }, E16: { slug: "write-to-computed-field", behavior: "ERR" }, E17: { slug: "unresolvable-action-target", behavior: "HALT" }, E18: { slug: "paint-on-form-control", behavior: "HALT" }, E20: { slug: "bind-on-non-control", behavior: "HALT" }, E22: { slug: "format-type", behavior: "ERR" }, E24: { slug: "runtime-expression-throw", behavior: "ERR" }, E26: { slug: "circuit-breaker", behavior: "HALT" }, E30: { slug: "attr-on-bound-control", behavior: "HALT" }, E31: { slug: "password-without-transient", behavior: "HALT" }, E32: { slug: "file-bind", behavior: "HALT" }, E33: { slug: "dialog-state-open", behavior: "HALT" }, E34: { slug: "transient-persist-collision", behavior: "HALT" }, E35: { slug: "presence-state-misuse", behavior: "HALT" }, E40: { slug: "each-not-array", behavior: "ERR" }, E41: { slug: "each-bad-key", behavior: "ERR" }, E42: { slug: "each-template", behavior: "ERR" }, E43: { slug: "bind-in-each-row", behavior: "ERR" }, E50: { slug: "needs-full-sapjs", behavior: "HALT" }, W03: { slug: "unknown-colon-attribute", behavior: "WARN" }, W04: { slug: "expression-in-when", behavior: "WARN" }, W30: { slug: "nonzero-mount-writes", behavior: "WARN" }, W31: { slug: "detail-dialog-saved-open", behavior: "WARN" } }, J6 = ["disabled", "readonly", "required", "checked", "selected", "multiple", "open", "inert", "autofocus", "novalidate", "hidden"], at5 = /* @__PURE__ */ new Set(["title", "style", "hidden", "lang", "dir", "translate", "class", "id", "nonce", "autofocus", "tabindex", "contenteditable", "spellcheck", "draggable", "role", "slot", "part", "name", "value", "type", "itemscope", "itemtype", "itemid", "itemprop", "itemref"]), wt6 = /* @__PURE__ */ new Set(["sap", "scope", "items", "item", "template", "bind", "calc", "text", "show", "attr", "set", "trigger", "move", "sort", "detail", "each", "effect", "invalid", "confirm", "transient", "default", "persist", "sortable", "editmode"]);
|
|
73007
|
+
function yt6(t2) {
|
|
72661
73008
|
if (!t2 || t2.nodeType !== 1) return "?";
|
|
72662
73009
|
if (t2.id) return `${t2.tagName.toLowerCase()}#${t2.id}`;
|
|
72663
73010
|
let e20 = [], r44 = t2, n3 = 0;
|
|
@@ -72666,7 +73013,7 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
72666
73013
|
if (r44.hasAttribute("sap")) o3 += "[sap]";
|
|
72667
73014
|
else if (r44.parentElement) {
|
|
72668
73015
|
let s2 = 0, a2 = 0;
|
|
72669
|
-
for (let
|
|
73016
|
+
for (let g2 = r44.parentElement.firstElementChild; g2; g2 = g2.nextElementSibling) g2.tagName === r44.tagName && (s2++, g2 === r44 && (a2 = s2));
|
|
72670
73017
|
s2 > 1 && (o3 += `:nth-of-type(${a2})`);
|
|
72671
73018
|
}
|
|
72672
73019
|
if (e20.unshift(o3), r44.hasAttribute("sap")) break;
|
|
@@ -72674,16 +73021,12 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
72674
73021
|
}
|
|
72675
73022
|
return e20.join(" > ");
|
|
72676
73023
|
}
|
|
72677
|
-
|
|
72678
|
-
let e20 = t2.toLowerCase();
|
|
72679
|
-
return /^x-text$|^x-html$/.test(e20) ? 'use text="state.x" (Sap paints text only)' : /^x-show$|^v-show$|^v-if$/.test(e20) ? 'use show="expr" (toggles native hidden)' : /^x-model$|^v-model$/.test(e20) ? 'use bind="field"' : /^@|^x-on:|^v-on:|^on:/.test(e20) ? "use native onclick + Sap(this) (no event directive)" : /^:|^x-bind:class$|^v-bind:class$/.test(e20) ? 'use class:NAME="expr" or attr:NAME="expr"' : /^x-for$|^v-for$/.test(e20) ? 'use items="name" on the container and item template on the row' : /^x-data$/.test(e20) ? "declare state with state= / bind / items (no JS state object)" : /^x-init$/.test(e20) ? "use a <script> or onclick + Sap(this)" : /^bind:/.test(e20) ? 'use bind="field"; one-way paint is attr:NAME="expr"' : /^x-/.test(e20) || /^v-/.test(e20) ? "this is a foreign-dialect attribute; Sap has no x-/v- attributes" : null;
|
|
72680
|
-
}
|
|
72681
|
-
var ht6 = class {
|
|
73024
|
+
var K7 = class {
|
|
72682
73025
|
constructor(e20) {
|
|
72683
73026
|
this.appName = e20, this.errors = [], this.warnings = [], this.halted = false, this.haltReason = null;
|
|
72684
73027
|
}
|
|
72685
73028
|
block(e20, r44, n3 = {}) {
|
|
72686
|
-
let o3 = (
|
|
73029
|
+
let o3 = (Bt5[e20] || {}).slug || "error", s2 = { code: e20, slug: o3, el: yt6(r44), attr: n3.attr || null, expr: n3.expr || null, key: n3.key || null, problem: n3.problem || "", didYouMean: n3.didYouMean || null, fix: n3.fix || null, phase: n3.phase || "runtime" }, a2 = [`
|
|
72687
73030
|
` + (e20[0] === "W" ? "sap \u26A0 " : "sap \u2717 ") + e20 + " " + o3];
|
|
72688
73031
|
return a2.push(` at ${s2.el}${s2.attr ? ` \u2014 ${s2.attr}="${s2.expr ?? ""}"` : ""}`), s2.problem && a2.push(` problem: ${s2.problem}`), s2.didYouMean && a2.push(` did you mean: ${s2.didYouMean}`), s2.fix && a2.push(` fix: ${s2.fix}`), (e20[0] === "W" ? console.warn : console.error)(a2.join(`
|
|
72689
73032
|
`)), s2;
|
|
@@ -72700,55 +73043,55 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
72700
73043
|
return { ok: this.errors.length === 0 && !this.halted, app: this.appName, halted: this.halted, haltReason: this.haltReason, errors: this.errors.slice(), warnings: this.warnings.slice() };
|
|
72701
73044
|
}
|
|
72702
73045
|
};
|
|
72703
|
-
function
|
|
73046
|
+
function M6(t2, e20) {
|
|
72704
73047
|
t2 && t2.getAttribute("sap-error") !== e20 && t2.setAttribute("sap-error", e20);
|
|
72705
73048
|
}
|
|
72706
|
-
function
|
|
73049
|
+
function Q6(t2) {
|
|
72707
73050
|
t2 && t2.hasAttribute("sap-error") && t2.removeAttribute("sap-error");
|
|
72708
73051
|
}
|
|
72709
|
-
function
|
|
73052
|
+
function ut6(t2, e20) {
|
|
72710
73053
|
let r44 = null, n3 = 3;
|
|
72711
73054
|
for (let o3 of e20) {
|
|
72712
|
-
let s2 =
|
|
73055
|
+
let s2 = An4(t2, o3);
|
|
72713
73056
|
s2 < n3 && (n3 = s2, r44 = o3);
|
|
72714
73057
|
}
|
|
72715
73058
|
return r44;
|
|
72716
73059
|
}
|
|
72717
|
-
function
|
|
73060
|
+
function An4(t2, e20) {
|
|
72718
73061
|
let r44 = t2.length, n3 = e20.length, o3 = Array.from({ length: r44 + 1 }, (s2, a2) => [a2, ...new Array(n3).fill(0)]);
|
|
72719
73062
|
for (let s2 = 0; s2 <= n3; s2++) o3[0][s2] = s2;
|
|
72720
73063
|
for (let s2 = 1; s2 <= r44; s2++) for (let a2 = 1; a2 <= n3; a2++) o3[s2][a2] = Math.min(o3[s2 - 1][a2] + 1, o3[s2][a2 - 1] + 1, o3[s2 - 1][a2 - 1] + (t2[s2 - 1] === e20[a2 - 1] ? 0 : 1));
|
|
72721
73064
|
return o3[r44][n3];
|
|
72722
73065
|
}
|
|
72723
|
-
var
|
|
72724
|
-
function
|
|
73066
|
+
var En4 = new Set(J6), vn4 = { readonly: "readOnly", novalidate: "noValidate" }, xn4 = 0, ne6 = /* @__PURE__ */ new WeakMap();
|
|
73067
|
+
function At5(t2, e20 = "sap") {
|
|
72725
73068
|
let r44 = t2.getAttribute("data-id");
|
|
72726
73069
|
if (r44) return r44;
|
|
72727
73070
|
if (t2.id) return t2.id;
|
|
72728
|
-
let n3 =
|
|
72729
|
-
return n3 || (n3 = `${e20}-${(
|
|
73071
|
+
let n3 = ne6.get(t2);
|
|
73072
|
+
return n3 || (n3 = `${e20}-${(xn4++).toString(36)}`, ne6.set(t2, n3)), n3;
|
|
72730
73073
|
}
|
|
72731
|
-
function
|
|
73074
|
+
function re5(t2, e20 = "row") {
|
|
72732
73075
|
for (; ; ) {
|
|
72733
73076
|
let r44 = `${e20}-${Math.random().toString(36).slice(2, 8)}`;
|
|
72734
73077
|
if (!t2.getElementById(r44) && !t2.querySelector(`[data-id="${r44}"]`)) return r44;
|
|
72735
73078
|
}
|
|
72736
73079
|
}
|
|
72737
|
-
function
|
|
73080
|
+
function Sn3(t2) {
|
|
72738
73081
|
return t2.hasAttribute("scope") || t2.hasAttribute("items") || t2.hasAttribute("detail") || t2.hasAttribute("each");
|
|
72739
73082
|
}
|
|
72740
|
-
function
|
|
73083
|
+
function kn4(t2) {
|
|
72741
73084
|
return t2.tagName === "TEMPLATE" || t2.hasAttribute("sap-ignore") || t2.hasAttribute("template") || t2.hasAttribute("cms-template");
|
|
72742
73085
|
}
|
|
72743
|
-
function
|
|
73086
|
+
function O4(t2, e20) {
|
|
72744
73087
|
for (let n3 = t2.firstElementChild; n3; n3 = n3.nextElementSibling) r44(n3);
|
|
72745
73088
|
function r44(n3) {
|
|
72746
|
-
if (
|
|
72747
|
-
let o3 =
|
|
73089
|
+
if (kn4(n3)) return;
|
|
73090
|
+
let o3 = Sn3(n3);
|
|
72748
73091
|
if (e20(n3, o3), !o3) for (let s2 = n3.firstElementChild; s2; s2 = s2.nextElementSibling) r44(s2);
|
|
72749
73092
|
}
|
|
72750
73093
|
}
|
|
72751
|
-
function
|
|
73094
|
+
function F5(t2) {
|
|
72752
73095
|
let e20 = t2;
|
|
72753
73096
|
for (; e20; ) {
|
|
72754
73097
|
if (e20.hasAttribute("sap") || e20.hasAttribute("scope") || e20.hasAttribute("item") || e20.hasAttribute("detail")) return e20;
|
|
@@ -72756,14 +73099,14 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
72756
73099
|
}
|
|
72757
73100
|
return null;
|
|
72758
73101
|
}
|
|
72759
|
-
function
|
|
73102
|
+
function H6(t2) {
|
|
72760
73103
|
for (let e20 = t2; e20 && e20.nodeType === 1; e20 = e20.parentElement) {
|
|
72761
73104
|
if (e20._sapEachRow) return e20;
|
|
72762
73105
|
if (e20.hasAttribute("item") || e20.hasAttribute("sap")) return null;
|
|
72763
73106
|
}
|
|
72764
73107
|
return null;
|
|
72765
73108
|
}
|
|
72766
|
-
function
|
|
73109
|
+
function Et6(t2) {
|
|
72767
73110
|
let e20 = t2;
|
|
72768
73111
|
for (; e20; ) {
|
|
72769
73112
|
if (e20.hasAttribute("detail") || e20.hasAttribute("item")) return e20;
|
|
@@ -72771,7 +73114,7 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
72771
73114
|
}
|
|
72772
73115
|
return null;
|
|
72773
73116
|
}
|
|
72774
|
-
function
|
|
73117
|
+
function ct6(t2) {
|
|
72775
73118
|
let e20 = t2;
|
|
72776
73119
|
for (; e20; ) {
|
|
72777
73120
|
if (e20.hasAttribute("detail")) return e20;
|
|
@@ -72779,58 +73122,58 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
72779
73122
|
}
|
|
72780
73123
|
return null;
|
|
72781
73124
|
}
|
|
72782
|
-
function
|
|
73125
|
+
function U6(t2, e20) {
|
|
72783
73126
|
if (t2.hasAttribute("item") && t2.getAttribute("bind") === e20) return t2;
|
|
72784
73127
|
let r44 = null;
|
|
72785
|
-
return
|
|
73128
|
+
return O4(t2, (n3) => {
|
|
72786
73129
|
!r44 && n3.getAttribute("bind") === e20 && (r44 = n3);
|
|
72787
73130
|
}), r44;
|
|
72788
73131
|
}
|
|
72789
|
-
function
|
|
73132
|
+
function Z7(t2, e20) {
|
|
72790
73133
|
let r44 = null;
|
|
72791
|
-
return
|
|
73134
|
+
return O4(t2, (n3) => {
|
|
72792
73135
|
!r44 && n3.getAttribute("items") === e20 && (r44 = n3);
|
|
72793
73136
|
}), r44;
|
|
72794
73137
|
}
|
|
72795
|
-
function
|
|
72796
|
-
return !t2 || t2.nodeType !== 1 || !t2.hasAttribute("item") ? false :
|
|
73138
|
+
function tt6(t2, e20) {
|
|
73139
|
+
return !t2 || t2.nodeType !== 1 || !t2.hasAttribute("item") ? false : U6(t2, e20) || Z7(t2, e20) ? true : C5(t2.getAttribute("state") || "").some((r44) => r44.name === e20);
|
|
72797
73140
|
}
|
|
72798
|
-
function
|
|
73141
|
+
function oe6(t2) {
|
|
72799
73142
|
let e20 = t2 && t2.$el;
|
|
72800
73143
|
return e20 && e20.nodeType === 1 && e20.isConnected && e20.hasAttribute("item") ? e20 : null;
|
|
72801
73144
|
}
|
|
72802
|
-
function
|
|
73145
|
+
function vt5(t2) {
|
|
72803
73146
|
return !!t2.closest("form[trigger-add]");
|
|
72804
73147
|
}
|
|
72805
|
-
function
|
|
73148
|
+
function W6(t2) {
|
|
72806
73149
|
let e20 = [];
|
|
72807
73150
|
for (let r44 = t2.firstElementChild; r44; r44 = r44.nextElementSibling) r44.hasAttribute("item") && !r44.hasAttribute("template") && !r44.hasAttribute("cms-template") && e20.push(r44);
|
|
72808
73151
|
return e20;
|
|
72809
73152
|
}
|
|
72810
|
-
function
|
|
73153
|
+
function Wt6(t2, e20) {
|
|
72811
73154
|
if (!t2 || !e20) return null;
|
|
72812
73155
|
let r44 = [...t2.querySelectorAll(`template[items="${e20}"]`)].find((o3) => o3.closest("[sap]") === t2), n3 = r44 && r44.content.firstElementChild;
|
|
72813
73156
|
return n3 && n3.hasAttribute("item") ? n3 : null;
|
|
72814
73157
|
}
|
|
72815
|
-
function
|
|
73158
|
+
function xt6(t2) {
|
|
72816
73159
|
for (let e20 = t2.firstElementChild; e20; e20 = e20.nextElementSibling) if (e20.hasAttribute("item") && e20.hasAttribute("template")) return e20;
|
|
72817
|
-
return
|
|
73160
|
+
return Wt6(t2.closest("[sap]"), t2.getAttribute("items"));
|
|
72818
73161
|
}
|
|
72819
|
-
function
|
|
73162
|
+
function C5(t2) {
|
|
72820
73163
|
let e20 = [];
|
|
72821
73164
|
if (!t2) return e20;
|
|
72822
73165
|
for (let r44 of t2.trim().split(/\s+/)) {
|
|
72823
73166
|
if (!r44) continue;
|
|
72824
73167
|
let n3 = r44, o3, s2 = n3.indexOf("=");
|
|
72825
73168
|
s2 >= 0 && (o3 = n3.slice(s2 + 1), n3 = n3.slice(0, s2));
|
|
72826
|
-
let a2 = n3.split(":"),
|
|
72827
|
-
for (let
|
|
72828
|
-
let
|
|
72829
|
-
e20.push({ name:
|
|
73169
|
+
let a2 = n3.split(":"), g2 = a2[0], b4 = "string", d = false;
|
|
73170
|
+
for (let S4 of a2.slice(1)) S4 === "num" ? b4 = "num" : S4 === "bool" ? b4 = "bool" : S4 === "presence" ? b4 = "presence" : S4 === "transient" && (d = true);
|
|
73171
|
+
let u3 = g2, E4 = u3.startsWith("data-") && u3.length > 5 ? u3.slice(5).replace(/-([a-z])/g, (S4, k5) => k5.toUpperCase()) : u3;
|
|
73172
|
+
e20.push({ name: E4, attr: u3, type: b4, default: o3, transient: d });
|
|
72830
73173
|
}
|
|
72831
73174
|
return e20;
|
|
72832
73175
|
}
|
|
72833
|
-
function
|
|
73176
|
+
function z5(t2, e20) {
|
|
72834
73177
|
if (e20 === "num") {
|
|
72835
73178
|
if (t2 == null || t2 === "") return 0;
|
|
72836
73179
|
let r44 = Number(t2);
|
|
@@ -72838,119 +73181,119 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
72838
73181
|
}
|
|
72839
73182
|
return e20 === "bool" ? t2 === "true" || t2 === "" || t2 === "1" : t2 ?? "";
|
|
72840
73183
|
}
|
|
72841
|
-
function
|
|
73184
|
+
function qt5(t2, e20) {
|
|
72842
73185
|
return e20 === "bool" ? t2 ? "true" : "false" : t2 == null ? "" : String(t2);
|
|
72843
73186
|
}
|
|
72844
|
-
function
|
|
72845
|
-
return
|
|
73187
|
+
function jt6(t2, e20) {
|
|
73188
|
+
return En4.has(e20) && typeof t2[vn4[e20] || e20] == "boolean";
|
|
72846
73189
|
}
|
|
72847
|
-
function
|
|
72848
|
-
return e20.type === "presence" || e20.type !== "num" &&
|
|
73190
|
+
function G5(t2, e20) {
|
|
73191
|
+
return e20.type === "presence" || e20.type !== "num" && jt6(t2, e20.attr || e20.name);
|
|
72849
73192
|
}
|
|
72850
|
-
function
|
|
73193
|
+
function ft5(t2) {
|
|
72851
73194
|
return t2.default != null ? t2.default : t2.type === "num" ? "0" : t2.type === "bool" ? "false" : "";
|
|
72852
73195
|
}
|
|
72853
|
-
function
|
|
73196
|
+
function ie6(t2, e20) {
|
|
72854
73197
|
let r44 = e20.attr || e20.name;
|
|
72855
|
-
if (
|
|
73198
|
+
if (G5(t2, e20)) return t2.hasAttribute(r44);
|
|
72856
73199
|
let n3 = t2.getAttribute(r44);
|
|
72857
|
-
return
|
|
73200
|
+
return z5(n3 ?? ft5(e20), e20.type);
|
|
72858
73201
|
}
|
|
72859
|
-
function
|
|
72860
|
-
return
|
|
73202
|
+
function se6(t2, e20) {
|
|
73203
|
+
return G5(t2, e20) ? e20.default != null ? z5(e20.default, "bool") : false : z5(ft5(e20), e20.type);
|
|
72861
73204
|
}
|
|
72862
|
-
function
|
|
73205
|
+
function lt6(t2, e20, r44) {
|
|
72863
73206
|
let n3 = e20.attr || e20.name;
|
|
72864
|
-
if (
|
|
73207
|
+
if (G5(t2, e20)) {
|
|
72865
73208
|
r44 ? t2.hasAttribute(n3) || t2.setAttribute(n3, "") : t2.hasAttribute(n3) && t2.removeAttribute(n3);
|
|
72866
73209
|
return;
|
|
72867
73210
|
}
|
|
72868
|
-
t2.setAttribute(n3,
|
|
73211
|
+
t2.setAttribute(n3, qt5(r44, e20.type));
|
|
72869
73212
|
}
|
|
72870
|
-
function
|
|
73213
|
+
function St6(t2, e20) {
|
|
72871
73214
|
let r44 = e20.attr || e20.name, n3 = t2._sapTransient || (t2._sapTransient = {});
|
|
72872
73215
|
if (!(e20.name in n3)) {
|
|
72873
73216
|
let o3 = t2.getAttribute(r44);
|
|
72874
|
-
o3 == null && (o3 =
|
|
73217
|
+
o3 == null && (o3 = ft5(e20)), n3[e20.name] = z5(o3, e20.type);
|
|
72875
73218
|
}
|
|
72876
73219
|
return t2.hasAttribute(r44) && t2.removeAttribute(r44), n3[e20.name];
|
|
72877
73220
|
}
|
|
72878
|
-
function
|
|
73221
|
+
function dt6(t2, e20, r44) {
|
|
72879
73222
|
let n3 = e20.attr || e20.name;
|
|
72880
73223
|
(t2._sapTransient || (t2._sapTransient = {}))[e20.name] = r44, t2.hasAttribute(n3) && t2.removeAttribute(n3);
|
|
72881
73224
|
}
|
|
72882
|
-
function
|
|
73225
|
+
function pt6(t2, e20, r44) {
|
|
72883
73226
|
let n3 = String(r44).split("."), o3 = n3[n3.length - 1];
|
|
72884
73227
|
if (n3.length === 1) {
|
|
72885
|
-
let
|
|
72886
|
-
return
|
|
73228
|
+
let g2 = $n2(e20, o3);
|
|
73229
|
+
return g2 || (t2.getAttribute("items") === o3 ? t2 : t2.querySelector(`[items="${o3}"]:not(template)`));
|
|
72887
73230
|
}
|
|
72888
|
-
let s2 = n3[n3.length - 2], a2 = [...t2.querySelectorAll(`[scope="${s2}"]`)].find((
|
|
72889
|
-
return a2 ?
|
|
73231
|
+
let s2 = n3[n3.length - 2], a2 = [...t2.querySelectorAll(`[scope="${s2}"]`)].find((g2) => Z7(g2, o3));
|
|
73232
|
+
return a2 ? Z7(a2, o3) : null;
|
|
72890
73233
|
}
|
|
72891
|
-
function
|
|
72892
|
-
let r44 =
|
|
73234
|
+
function $n2(t2, e20) {
|
|
73235
|
+
let r44 = F5(t2);
|
|
72893
73236
|
for (; r44; ) {
|
|
72894
73237
|
if (r44.getAttribute("items") === e20) return r44;
|
|
72895
|
-
let n3 =
|
|
73238
|
+
let n3 = Z7(r44, e20);
|
|
72896
73239
|
if (n3) return n3;
|
|
72897
|
-
r44 =
|
|
73240
|
+
r44 = F5(r44.parentElement);
|
|
72898
73241
|
}
|
|
72899
73242
|
return null;
|
|
72900
73243
|
}
|
|
72901
|
-
function
|
|
73244
|
+
function P7(t2) {
|
|
72902
73245
|
if (typeof t2 == "number") return t2;
|
|
72903
73246
|
if (t2 == null || t2 === "") return 0;
|
|
72904
73247
|
let e20 = Number(typeof t2 == "string" ? t2.replace(/[$,%\s]/g, "") : t2);
|
|
72905
73248
|
return Number.isNaN(e20) ? 0 : e20;
|
|
72906
73249
|
}
|
|
72907
|
-
function
|
|
73250
|
+
function kt6(t2, e20) {
|
|
72908
73251
|
return Array.isArray(t2) ? e20 == null ? t2 : t2.map((r44) => typeof e20 == "function" ? e20(r44) : r44?.[e20]) : [];
|
|
72909
73252
|
}
|
|
72910
|
-
function
|
|
72911
|
-
return
|
|
73253
|
+
function Vt5(t2, e20) {
|
|
73254
|
+
return kt6(t2, e20).reduce((r44, n3) => r44 + P7(n3), 0);
|
|
72912
73255
|
}
|
|
72913
|
-
function
|
|
73256
|
+
function ae6(t2, e20) {
|
|
72914
73257
|
return Array.isArray(t2) ? e20 == null ? t2.length : t2.reduce((r44, n3) => r44 + (e20(n3) ? 1 : 0), 0) : 0;
|
|
72915
73258
|
}
|
|
72916
|
-
function
|
|
72917
|
-
let r44 =
|
|
72918
|
-
return r44.length ?
|
|
73259
|
+
function ue5(t2, e20) {
|
|
73260
|
+
let r44 = kt6(t2, e20);
|
|
73261
|
+
return r44.length ? Vt5(t2, e20) / r44.length : 0;
|
|
72919
73262
|
}
|
|
72920
|
-
function
|
|
72921
|
-
let r44 =
|
|
73263
|
+
function ce6(t2, e20) {
|
|
73264
|
+
let r44 = kt6(t2, e20).filter((n3) => n3 != null && n3 !== "");
|
|
72922
73265
|
return r44.length ? r44.every((n3) => typeof n3 == "number" || !Number.isNaN(Number(n3))) ? Math.min(...r44.map(Number)) : r44.reduce((n3, o3) => String(n3) <= String(o3) ? n3 : o3) : 0;
|
|
72923
73266
|
}
|
|
72924
|
-
function
|
|
72925
|
-
let r44 =
|
|
73267
|
+
function fe5(t2, e20) {
|
|
73268
|
+
let r44 = kt6(t2, e20).filter((n3) => n3 != null && n3 !== "");
|
|
72926
73269
|
return r44.length ? r44.every((n3) => typeof n3 == "number" || !Number.isNaN(Number(n3))) ? Math.max(...r44.map(Number)) : r44.reduce((n3, o3) => String(n3) >= String(o3) ? n3 : o3) : 0;
|
|
72927
73270
|
}
|
|
72928
|
-
function
|
|
72929
|
-
let n3 =
|
|
73271
|
+
function le6(t2, e20, r44) {
|
|
73272
|
+
let n3 = P7(t2) === 1 ? e20 : r44 ?? e20 + "s";
|
|
72930
73273
|
return `${t2} ${n3}`;
|
|
72931
73274
|
}
|
|
72932
|
-
function
|
|
73275
|
+
function de6(t2, e20) {
|
|
72933
73276
|
let r44 = new Date(t2), n3 = new Date(e20);
|
|
72934
73277
|
return Number.isNaN(+r44) || Number.isNaN(+n3) ? 0 : Math.round((n3 - r44) / 864e5);
|
|
72935
73278
|
}
|
|
72936
|
-
function
|
|
73279
|
+
function B5(t2) {
|
|
72937
73280
|
return typeof t2 == "number" ? t2 : Number(t2);
|
|
72938
73281
|
}
|
|
72939
|
-
var
|
|
73282
|
+
var et6 = { usd: (t2) => "$" + B5(t2).toLocaleString("en-US", { maximumFractionDigits: 0 }), usd2: (t2) => "$" + B5(t2).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }), pct: (t2) => Math.round(B5(t2)) + "%", pct1: (t2) => B5(t2).toFixed(1) + "%", int: (t2) => Math.round(B5(t2)).toLocaleString("en-US"), num: (t2) => B5(t2).toLocaleString("en-US"), num2: (t2) => B5(t2).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 }), compact: (t2) => B5(t2).toLocaleString("en-US", { notation: "compact" }), date: (t2) => {
|
|
72940
73283
|
let e20 = new Date(t2);
|
|
72941
73284
|
return Number.isNaN(+e20) ? String(t2) : e20.toLocaleDateString("en-US");
|
|
72942
73285
|
}, clock: (t2) => {
|
|
72943
|
-
let e20 =
|
|
73286
|
+
let e20 = B5(t2), r44 = Math.floor(e20 / 100), n3 = r44 % 10, o3 = Math.floor(r44 / 10) % 60;
|
|
72944
73287
|
return `${Math.floor(r44 / 600)}:${String(o3).padStart(2, "0")}.${n3}`;
|
|
72945
|
-
} },
|
|
72946
|
-
function
|
|
73288
|
+
} }, _n4 = /* @__PURE__ */ new Set(["usd", "usd2", "pct", "pct1", "int", "num", "num2", "compact", "clock"]);
|
|
73289
|
+
function pe5(t2, e20) {
|
|
72947
73290
|
if (!t2) return e20 == null ? "" : String(e20);
|
|
72948
|
-
let r44 =
|
|
73291
|
+
let r44 = et6[t2];
|
|
72949
73292
|
if (typeof r44 != "function") {
|
|
72950
73293
|
let n3 = new Error(`unknown format "${t2}"`);
|
|
72951
73294
|
throw n3.sapCode = "E22", n3;
|
|
72952
73295
|
}
|
|
72953
|
-
if (
|
|
73296
|
+
if (_n4.has(t2)) {
|
|
72954
73297
|
let n3 = typeof e20 == "number" ? e20 : Number(e20);
|
|
72955
73298
|
if (!Number.isFinite(n3)) {
|
|
72956
73299
|
let o3 = new Error(`format "${t2}" received ${typeof e20 == "string" ? `"${e20}"` : e20}`);
|
|
@@ -72959,52 +73302,52 @@ body:has(> .clay-intro) { height: auto !important; overflow: visible !important;
|
|
|
72959
73302
|
}
|
|
72960
73303
|
return r44(e20);
|
|
72961
73304
|
}
|
|
72962
|
-
var
|
|
72963
|
-
function
|
|
73305
|
+
var Tn3 = ["state", "item", "el", "root", "fmt", "num", "sum", "count", "avg", "min", "max", "plural", "days"], $t6 = /* @__PURE__ */ new Map(), me6 = /\bstate\.([a-z][a-z0-9_]*)/g, he6 = /\bitem\.([a-z][a-z0-9_]*)/g;
|
|
73306
|
+
function Nn4(t2) {
|
|
72964
73307
|
let e20 = /* @__PURE__ */ new Set(), r44 = /* @__PURE__ */ new Set(), n3;
|
|
72965
|
-
for (
|
|
72966
|
-
for (
|
|
73308
|
+
for (me6.lastIndex = 0; n3 = me6.exec(t2); ) e20.add(n3[1]);
|
|
73309
|
+
for (he6.lastIndex = 0; n3 = he6.exec(t2); ) r44.add(n3[1]);
|
|
72967
73310
|
return { state: e20, item: r44 };
|
|
72968
73311
|
}
|
|
72969
|
-
function
|
|
72970
|
-
let r44 = (e20 ? "!" : "") + t2, n3 =
|
|
73312
|
+
function N16(t2, e20 = false) {
|
|
73313
|
+
let r44 = (e20 ? "!" : "") + t2, n3 = $t6.get(r44);
|
|
72971
73314
|
if (n3) return n3;
|
|
72972
|
-
|
|
73315
|
+
$t6.size > 512 && $t6.clear();
|
|
72973
73316
|
try {
|
|
72974
73317
|
let o3 = e20 ? `"use strict";
|
|
72975
73318
|
${t2}` : `"use strict"; return (${t2});`;
|
|
72976
|
-
n3 = { fn: new Function(...
|
|
73319
|
+
n3 = { fn: new Function(...Tn3, o3), src: t2, statement: e20, deps: Nn4(t2), error: null };
|
|
72977
73320
|
} catch (o3) {
|
|
72978
73321
|
n3 = { fn: null, src: t2, statement: e20, deps: { state: /* @__PURE__ */ new Set(), item: /* @__PURE__ */ new Set() }, error: o3 };
|
|
72979
73322
|
}
|
|
72980
|
-
return
|
|
73323
|
+
return $t6.set(r44, n3), n3;
|
|
72981
73324
|
}
|
|
72982
|
-
function
|
|
72983
|
-
return
|
|
73325
|
+
function Y5(t2, e20) {
|
|
73326
|
+
return I5(t2, e20.state, e20.item, e20.el ?? null, e20.root);
|
|
72984
73327
|
}
|
|
72985
|
-
function
|
|
73328
|
+
function I5(t2, e20, r44, n3, o3) {
|
|
72986
73329
|
if (t2.error) throw t2.error;
|
|
72987
|
-
return t2.fn(e20, r44, n3, o3,
|
|
73330
|
+
return t2.fn(e20, r44, n3, o3, et6, P7, Vt5, ae6, ue5, ce6, fe5, le6, de6);
|
|
72988
73331
|
}
|
|
72989
|
-
function
|
|
73332
|
+
function be5(t2) {
|
|
72990
73333
|
let e20 = /* @__PURE__ */ new Map();
|
|
72991
73334
|
for (let a2 of t2) e20.set(a2.name, a2);
|
|
72992
73335
|
let r44 = [], n3 = /* @__PURE__ */ new Map(), o3 = [];
|
|
72993
73336
|
function s2(a2) {
|
|
72994
|
-
let
|
|
72995
|
-
if (
|
|
72996
|
-
if (
|
|
72997
|
-
let
|
|
72998
|
-
throw
|
|
73337
|
+
let g2 = n3.get(a2.name);
|
|
73338
|
+
if (g2 !== 1) {
|
|
73339
|
+
if (g2 === 0) {
|
|
73340
|
+
let b4 = [...o3.slice(o3.indexOf(a2.name)), a2.name].join(" -> "), d = new Error(`calc: cycle: ${b4}`);
|
|
73341
|
+
throw d.sapCode = "E07", d.cycle = b4, d;
|
|
72999
73342
|
}
|
|
73000
73343
|
n3.set(a2.name, 0), o3.push(a2.name);
|
|
73001
|
-
for (let
|
|
73002
|
-
let
|
|
73003
|
-
|
|
73344
|
+
for (let b4 of a2.entry.deps.state) {
|
|
73345
|
+
let d = e20.get(b4);
|
|
73346
|
+
d && d !== a2 && s2(d);
|
|
73004
73347
|
}
|
|
73005
|
-
for (let
|
|
73006
|
-
let
|
|
73007
|
-
|
|
73348
|
+
for (let b4 of a2.entry.deps.item) {
|
|
73349
|
+
let d = e20.get(b4);
|
|
73350
|
+
d && d !== a2 && s2(d);
|
|
73008
73351
|
}
|
|
73009
73352
|
o3.pop(), n3.set(a2.name, 1), r44.push(a2);
|
|
73010
73353
|
}
|
|
@@ -73012,42 +73355,42 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73012
73355
|
for (let a2 of t2) s2(a2);
|
|
73013
73356
|
return r44;
|
|
73014
73357
|
}
|
|
73015
|
-
var
|
|
73016
|
-
function
|
|
73017
|
-
|
|
73358
|
+
var mt6 = {}, X6 = null, we6 = true, Tt6 = false;
|
|
73359
|
+
function ye6() {
|
|
73360
|
+
mt6 = {};
|
|
73018
73361
|
}
|
|
73019
|
-
function
|
|
73020
|
-
let e20 =
|
|
73021
|
-
return
|
|
73362
|
+
function Ae6(t2) {
|
|
73363
|
+
let e20 = Tt6;
|
|
73364
|
+
return X6 ? zt5(X6.takeRecords()) : we6 && Ln4(), Tt6 = !!X6 && t2.getRootNode() === document, e20;
|
|
73022
73365
|
}
|
|
73023
|
-
function
|
|
73024
|
-
|
|
73366
|
+
function Ee6(t2) {
|
|
73367
|
+
Tt6 = t2;
|
|
73025
73368
|
}
|
|
73026
|
-
function
|
|
73027
|
-
|
|
73369
|
+
function Nt4() {
|
|
73370
|
+
X6 && zt5(X6.takeRecords());
|
|
73028
73371
|
}
|
|
73029
|
-
function
|
|
73372
|
+
function Ln4() {
|
|
73030
73373
|
if (typeof document > "u" || typeof MutationObserver != "function") {
|
|
73031
|
-
|
|
73374
|
+
we6 = false;
|
|
73032
73375
|
return;
|
|
73033
73376
|
}
|
|
73034
|
-
|
|
73377
|
+
X6 = new MutationObserver(zt5), X6.observe(document, { attributes: true, childList: true, subtree: true });
|
|
73035
73378
|
}
|
|
73036
|
-
function
|
|
73379
|
+
function zt5(t2) {
|
|
73037
73380
|
for (let e20 of t2) if (e20.type === "attributes") e20.target._sapPlan && (e20.target._sapPlan = null);
|
|
73038
|
-
else for (let r44 of e20.addedNodes) r44.nodeType === 1 &&
|
|
73381
|
+
else for (let r44 of e20.addedNodes) r44.nodeType === 1 && ve6(r44);
|
|
73039
73382
|
}
|
|
73040
|
-
function
|
|
73383
|
+
function ve6(t2) {
|
|
73041
73384
|
t2._sapPlan && (t2._sapPlan = null);
|
|
73042
|
-
for (let e20 = t2.firstElementChild; e20; e20 = e20.nextElementSibling)
|
|
73385
|
+
for (let e20 = t2.firstElementChild; e20; e20 = e20.nextElementSibling) ve6(e20);
|
|
73043
73386
|
}
|
|
73044
|
-
function
|
|
73045
|
-
if (!
|
|
73387
|
+
function q7(t2) {
|
|
73388
|
+
if (!Tt6) return ge6(t2);
|
|
73046
73389
|
let e20 = t2._sapPlan;
|
|
73047
|
-
return e20 && e20.gen ===
|
|
73390
|
+
return e20 && e20.gen === mt6 ? e20 : t2._sapPlan = ge6(t2);
|
|
73048
73391
|
}
|
|
73049
|
-
function
|
|
73050
|
-
let e20 = { gen:
|
|
73392
|
+
function ge6(t2) {
|
|
73393
|
+
let e20 = { gen: mt6, inert: t2.tagName === "TEMPLATE", template: false, item: false, scope: false, items: false, detail: false, each: false, boundary: null, bind: null, transient: false, decls: null, calcs: null, paints: null, effects: null, invalids: null };
|
|
73051
73394
|
for (let r44 of t2.attributes) {
|
|
73052
73395
|
let n3 = r44.name, o3 = r44.value, s2 = n3.indexOf(":");
|
|
73053
73396
|
if (s2 < 0) {
|
|
@@ -73083,68 +73426,68 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73083
73426
|
e20.transient = true;
|
|
73084
73427
|
break;
|
|
73085
73428
|
case "state":
|
|
73086
|
-
e20.decls =
|
|
73429
|
+
e20.decls = C5(o3);
|
|
73087
73430
|
break;
|
|
73088
73431
|
case "text":
|
|
73089
|
-
(e20.paints || (e20.paints = [])).push({ kind: "text", fmt: null, entry:
|
|
73432
|
+
(e20.paints || (e20.paints = [])).push({ kind: "text", fmt: null, entry: N16(o3) });
|
|
73090
73433
|
break;
|
|
73091
73434
|
case "show":
|
|
73092
|
-
(e20.paints || (e20.paints = [])).push({ kind: "show", entry:
|
|
73435
|
+
(e20.paints || (e20.paints = [])).push({ kind: "show", entry: N16(o3) });
|
|
73093
73436
|
break;
|
|
73094
73437
|
case "effect":
|
|
73095
|
-
(e20.effects || (e20.effects = [])).push({ entry:
|
|
73438
|
+
(e20.effects || (e20.effects = [])).push({ entry: N16(o3, true) });
|
|
73096
73439
|
break;
|
|
73097
73440
|
case "invalid":
|
|
73098
|
-
(e20.invalids || (e20.invalids = [])).push({ entry:
|
|
73441
|
+
(e20.invalids || (e20.invalids = [])).push({ entry: N16(o3) });
|
|
73099
73442
|
break;
|
|
73100
73443
|
}
|
|
73101
73444
|
continue;
|
|
73102
73445
|
}
|
|
73103
|
-
let a2 = n3.slice(0, s2),
|
|
73446
|
+
let a2 = n3.slice(0, s2), g2 = n3.slice(s2 + 1);
|
|
73104
73447
|
switch (a2) {
|
|
73105
73448
|
case "calc":
|
|
73106
|
-
(e20.calcs || (e20.calcs = [])).push({ name:
|
|
73449
|
+
(e20.calcs || (e20.calcs = [])).push({ name: g2, entry: N16(o3) });
|
|
73107
73450
|
break;
|
|
73108
73451
|
case "text":
|
|
73109
|
-
(e20.paints || (e20.paints = [])).push({ kind: "text", fmt:
|
|
73452
|
+
(e20.paints || (e20.paints = [])).push({ kind: "text", fmt: g2, entry: N16(o3) });
|
|
73110
73453
|
break;
|
|
73111
73454
|
case "attr":
|
|
73112
|
-
(e20.paints || (e20.paints = [])).push({ kind: "attr", arg:
|
|
73455
|
+
(e20.paints || (e20.paints = [])).push({ kind: "attr", arg: g2, entry: N16(o3) });
|
|
73113
73456
|
break;
|
|
73114
73457
|
case "class":
|
|
73115
|
-
(e20.paints || (e20.paints = [])).push({ kind: "class", arg:
|
|
73458
|
+
(e20.paints || (e20.paints = [])).push({ kind: "class", arg: g2, entry: N16(o3) });
|
|
73116
73459
|
break;
|
|
73117
73460
|
case "css":
|
|
73118
|
-
(e20.paints || (e20.paints = [])).push({ kind: "css", arg:
|
|
73461
|
+
(e20.paints || (e20.paints = [])).push({ kind: "css", arg: g2, entry: N16(o3) });
|
|
73119
73462
|
break;
|
|
73120
73463
|
case "show-when":
|
|
73121
73464
|
case "option":
|
|
73122
|
-
(e20.paints || (e20.paints = [])).push({ kind: "when", match: "show", field:
|
|
73465
|
+
(e20.paints || (e20.paints = [])).push({ kind: "when", match: "show", field: g2, values: o3.split("|") });
|
|
73123
73466
|
break;
|
|
73124
73467
|
case "hide-when":
|
|
73125
|
-
(e20.paints || (e20.paints = [])).push({ kind: "when", match: "hide", field:
|
|
73468
|
+
(e20.paints || (e20.paints = [])).push({ kind: "when", match: "hide", field: g2, values: o3.split("|") });
|
|
73126
73469
|
break;
|
|
73127
73470
|
case "option-not":
|
|
73128
|
-
(e20.paints || (e20.paints = [])).push({ kind: "when", match: "show-not", field:
|
|
73471
|
+
(e20.paints || (e20.paints = [])).push({ kind: "when", match: "show-not", field: g2, values: o3.split("|") });
|
|
73129
73472
|
break;
|
|
73130
73473
|
}
|
|
73131
73474
|
}
|
|
73132
|
-
return e20.boundary = e20.scope ? "scope" : e20.items ? "items" : e20.detail ? "detail" : e20.each ? "each" : null,
|
|
73475
|
+
return e20.boundary = e20.scope ? "scope" : e20.items ? "items" : e20.detail ? "detail" : e20.each ? "each" : null, Rn4(e20) ? Cn3() : e20;
|
|
73133
73476
|
}
|
|
73134
|
-
var
|
|
73135
|
-
function
|
|
73136
|
-
return (!
|
|
73477
|
+
var _t5 = null;
|
|
73478
|
+
function Cn3() {
|
|
73479
|
+
return (!_t5 || _t5.gen !== mt6) && (_t5 = Object.freeze({ gen: mt6, inert: false, template: false, item: false, scope: false, items: false, detail: false, each: false, boundary: null, bind: null, transient: false, decls: null, calcs: null, paints: null, effects: null, invalids: null })), _t5;
|
|
73137
73480
|
}
|
|
73138
|
-
function
|
|
73481
|
+
function Rn4(t2) {
|
|
73139
73482
|
return !t2.inert && !t2.item && t2.boundary === null && t2.bind === null && !t2.transient && !t2.decls && !t2.calcs && !t2.paints && !t2.effects && !t2.invalids;
|
|
73140
73483
|
}
|
|
73141
|
-
function
|
|
73484
|
+
function xe6(t2) {
|
|
73142
73485
|
return (t2.getAttribute("type") || "text").toLowerCase();
|
|
73143
73486
|
}
|
|
73144
|
-
function
|
|
73487
|
+
function nt6(t2) {
|
|
73145
73488
|
let e20 = t2.tagName;
|
|
73146
73489
|
if (e20 === "INPUT") {
|
|
73147
|
-
let r44 =
|
|
73490
|
+
let r44 = xe6(t2);
|
|
73148
73491
|
r44 === "checkbox" || r44 === "radio" ? t2.checked ? t2.setAttribute("checked", "") : t2.removeAttribute("checked") : t2.setAttribute("value", t2.value);
|
|
73149
73492
|
return;
|
|
73150
73493
|
}
|
|
@@ -73157,10 +73500,10 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73157
73500
|
for (let n3 = 0; n3 < r44.length; n3++) r44[n3].selected ? r44[n3].setAttribute("selected", "") : r44[n3].removeAttribute("selected");
|
|
73158
73501
|
}
|
|
73159
73502
|
}
|
|
73160
|
-
function
|
|
73503
|
+
function Se6(t2, e20 = t2) {
|
|
73161
73504
|
let r44 = t2.tagName;
|
|
73162
73505
|
if (r44 === "INPUT") {
|
|
73163
|
-
let n3 =
|
|
73506
|
+
let n3 = xe6(t2);
|
|
73164
73507
|
n3 === "checkbox" || n3 === "radio" ? e20.checked ? t2.hasAttribute("checked") || t2.setAttribute("checked", "") : t2.removeAttribute("checked") : e20.value !== (t2.getAttribute("value") ?? "") && t2.setAttribute("value", e20.value);
|
|
73165
73508
|
return;
|
|
73166
73509
|
}
|
|
@@ -73176,20 +73519,20 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73176
73519
|
for (let s2 = 0; s2 < n3.length; s2++) o3[s2] && o3[s2].selected ? n3[s2].hasAttribute("selected") || n3[s2].setAttribute("selected", "") : n3[s2].removeAttribute("selected");
|
|
73177
73520
|
}
|
|
73178
73521
|
}
|
|
73179
|
-
function
|
|
73522
|
+
function Lt5(t2) {
|
|
73180
73523
|
t2.tagName !== "TEXTAREA" || !t2.hasAttribute("data-value") || t2 !== t2.ownerDocument.activeElement && (t2.textContent = t2.getAttribute("data-value"), t2.removeAttribute("data-value"));
|
|
73181
73524
|
}
|
|
73182
|
-
function
|
|
73525
|
+
function L7(t2) {
|
|
73183
73526
|
if (typeof window > "u") return null;
|
|
73184
73527
|
let e20 = window.clay, r44 = window.hyperclay;
|
|
73185
73528
|
return t2 === "consent" ? e20?.confirm || r44?.consent || null : e20?.[t2] || r44?.[t2] || null;
|
|
73186
73529
|
}
|
|
73187
|
-
function
|
|
73188
|
-
let t2 =
|
|
73530
|
+
function ke6() {
|
|
73531
|
+
let t2 = L7("visitorDrafts");
|
|
73189
73532
|
return !!(t2 && typeof t2.restored == "function" && t2.restored()?.restored);
|
|
73190
73533
|
}
|
|
73191
|
-
var
|
|
73192
|
-
function
|
|
73534
|
+
var Ht5 = ["clay:mutation-ready", "hyperclay:mutation-ready"], Dn4 = ["clay:sync-applied", "hyperclay:livesync-applied"], Fn4 = ["clay:ready", "hyperclay:ready"], Pn4 = ["clay:route"];
|
|
73535
|
+
function rt6(t2, e20, r44) {
|
|
73193
73536
|
let n3 = null, o3 = (s2) => {
|
|
73194
73537
|
n3 !== null && n3 !== s2.type || (n3 = s2.type, queueMicrotask(() => {
|
|
73195
73538
|
n3 = null;
|
|
@@ -73200,53 +73543,54 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73200
73543
|
for (let s2 of e20) t2.removeEventListener(s2, o3);
|
|
73201
73544
|
};
|
|
73202
73545
|
}
|
|
73203
|
-
function
|
|
73546
|
+
function $e6(t2) {
|
|
73204
73547
|
let e20 = typeof window < "u" && window.clay && window.clay.ready;
|
|
73205
73548
|
e20 && typeof e20.then == "function" ? e20.then(() => t2(), () => t2()) : t2();
|
|
73206
73549
|
}
|
|
73207
|
-
function
|
|
73208
|
-
let e20 =
|
|
73550
|
+
function Ct6(t2) {
|
|
73551
|
+
let e20 = L7("region");
|
|
73209
73552
|
return !e20 || typeof e20.resolveRegionPolicy != "function" || typeof e20.skipForPolicy != "function" ? false : e20.skipForPolicy(e20.resolveRegionPolicy(t2), void 0, ["no-save", "freeze"]);
|
|
73210
73553
|
}
|
|
73211
|
-
function
|
|
73212
|
-
let t2 =
|
|
73554
|
+
function _e6() {
|
|
73555
|
+
let t2 = L7("consent");
|
|
73213
73556
|
return typeof t2 == "function" ? t2 : null;
|
|
73214
73557
|
}
|
|
73215
|
-
function
|
|
73558
|
+
function Te6(t2, e20) {
|
|
73216
73559
|
if (typeof e20 != "function") throw new Error("Sap.batch(label, fn): fn must be a function");
|
|
73217
|
-
let r44 =
|
|
73560
|
+
let r44 = L7("undo");
|
|
73218
73561
|
r44 && r44.flush && r44.flush();
|
|
73219
73562
|
let n3 = e20();
|
|
73220
73563
|
if (n3 && typeof n3.then == "function") throw new Error("Sap.batch fn must be synchronous (it returned a promise)");
|
|
73221
73564
|
return r44 && r44.commitCaptured && r44.commitCaptured(t2), n3;
|
|
73222
73565
|
}
|
|
73223
|
-
function
|
|
73566
|
+
function Ne6(t2) {
|
|
73224
73567
|
if (typeof window > "u" || typeof document > "u") return;
|
|
73225
73568
|
let e20 = () => {
|
|
73226
|
-
let
|
|
73227
|
-
for (let
|
|
73228
|
-
|
|
73569
|
+
let d = false;
|
|
73570
|
+
for (let u3 of t2.apps()) u3.root.isConnected ? t2.runNow(u3, "platform") : d = true;
|
|
73571
|
+
d && t2.pruneDisconnected(), t2.remountIfPresent();
|
|
73572
|
+
}, r44 = L7("derived"), n3 = r44 && typeof r44.register == "function" ? r44.register(e20) : null, o3 = typeof n3 == "function" ? null : rt6(document, Dn4, e20), s2 = rt6(document, Pn4, e20), a2 = false, g2 = () => {
|
|
73573
|
+
}, b4 = () => {
|
|
73574
|
+
if (a2) return true;
|
|
73575
|
+
let d = L7("undo");
|
|
73576
|
+
if (!d || typeof d.on != "function") return false;
|
|
73577
|
+
let u3 = d.on("undo", e20);
|
|
73578
|
+
return typeof u3 != "function" ? false : typeof d.on("redo", e20) != "function" ? (u3(), false) : (a2 = true, g2(), true);
|
|
73229
73579
|
};
|
|
73230
|
-
|
|
73231
|
-
|
|
73232
|
-
|
|
73233
|
-
|
|
73234
|
-
let s2 = X6("undo");
|
|
73235
|
-
if (!s2 || typeof s2.on != "function") return false;
|
|
73236
|
-
let a2 = s2.on("undo", e20);
|
|
73237
|
-
return typeof a2 != "function" ? false : typeof s2.on("redo", e20) != "function" ? (a2(), false) : (r44 = true, n3(), true);
|
|
73238
|
-
};
|
|
73239
|
-
if (!o3()) {
|
|
73240
|
-
let s2 = St6(document, le6, o3), a2 = St6(document, zn4, o3);
|
|
73241
|
-
n3 = () => {
|
|
73242
|
-
s2(), a2();
|
|
73580
|
+
if (!b4()) {
|
|
73581
|
+
let d = rt6(document, Ht5, b4), u3 = rt6(document, Fn4, b4);
|
|
73582
|
+
g2 = () => {
|
|
73583
|
+
d(), u3();
|
|
73243
73584
|
};
|
|
73244
|
-
let
|
|
73245
|
-
|
|
73585
|
+
let E4 = L7("ready");
|
|
73586
|
+
E4 && typeof E4.then == "function" && E4.then(b4, () => {
|
|
73246
73587
|
});
|
|
73247
73588
|
}
|
|
73589
|
+
return () => {
|
|
73590
|
+
typeof n3 == "function" && n3(), o3 && o3(), s2(), g2();
|
|
73591
|
+
};
|
|
73248
73592
|
}
|
|
73249
|
-
function
|
|
73593
|
+
function ht6(t2) {
|
|
73250
73594
|
let e20 = t2.tagName;
|
|
73251
73595
|
if (e20 === "INPUT") {
|
|
73252
73596
|
let r44 = (t2.getAttribute("type") || "text").toLowerCase();
|
|
@@ -73254,20 +73598,20 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73254
73598
|
}
|
|
73255
73599
|
return e20 === "TEXTAREA" ? "text" : e20 === "SELECT" ? t2.multiple ? "select-multiple" : "select-one" : "leaf";
|
|
73256
73600
|
}
|
|
73257
|
-
function
|
|
73601
|
+
function In4(t2) {
|
|
73258
73602
|
if (t2.validity && t2.validity.badInput) return t2.hasAttribute("value") ? Number(t2.getAttribute("value")) || 0 : t2._sapLastGood ?? 0;
|
|
73259
73603
|
if (t2.value === "") return 0;
|
|
73260
73604
|
let e20 = Number(t2.value);
|
|
73261
73605
|
return Number.isNaN(e20) ? t2._sapLastGood ?? 0 : (t2._sapLastGood = e20, e20);
|
|
73262
73606
|
}
|
|
73263
|
-
function
|
|
73607
|
+
function Le6(t2, e20) {
|
|
73264
73608
|
switch (e20) {
|
|
73265
73609
|
case "checkbox":
|
|
73266
73610
|
return t2.checked;
|
|
73267
73611
|
case "radio":
|
|
73268
73612
|
return t2.checked ? t2.value : void 0;
|
|
73269
73613
|
case "number":
|
|
73270
|
-
return
|
|
73614
|
+
return In4(t2);
|
|
73271
73615
|
case "select-one":
|
|
73272
73616
|
return t2.value;
|
|
73273
73617
|
case "select-multiple":
|
|
@@ -73281,7 +73625,7 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73281
73625
|
return t2.value;
|
|
73282
73626
|
}
|
|
73283
73627
|
}
|
|
73284
|
-
function
|
|
73628
|
+
function Ce6(t2, e20, r44) {
|
|
73285
73629
|
switch (e20) {
|
|
73286
73630
|
case "checkbox":
|
|
73287
73631
|
t2.checked = !!r44;
|
|
@@ -73309,34 +73653,34 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73309
73653
|
t2.value = r44 == null ? "" : String(r44);
|
|
73310
73654
|
}
|
|
73311
73655
|
}
|
|
73312
|
-
function
|
|
73656
|
+
function Ut5(t2) {
|
|
73313
73657
|
if (t2.hasAttribute("transient")) {
|
|
73314
73658
|
t2.removeAttribute("value"), t2.removeAttribute("checked"), t2.removeAttribute("data-value");
|
|
73315
73659
|
return;
|
|
73316
73660
|
}
|
|
73317
|
-
|
|
73661
|
+
Ct6(t2) || nt6(t2);
|
|
73318
73662
|
}
|
|
73319
|
-
function
|
|
73663
|
+
function Mn4(t2) {
|
|
73320
73664
|
t2.dispatchEvent(new Event("input", { bubbles: true })), t2.dispatchEvent(new Event("change", { bubbles: true }));
|
|
73321
73665
|
}
|
|
73322
|
-
function
|
|
73323
|
-
return
|
|
73666
|
+
function Rt6(t2, e20) {
|
|
73667
|
+
return Le6(t2, e20);
|
|
73324
73668
|
}
|
|
73325
|
-
function
|
|
73326
|
-
|
|
73669
|
+
function Re6(t2, e20, r44) {
|
|
73670
|
+
Ce6(t2, e20, r44), Ut5(t2);
|
|
73327
73671
|
}
|
|
73328
|
-
function
|
|
73329
|
-
let e20 =
|
|
73672
|
+
function R5(t2) {
|
|
73673
|
+
let e20 = ht6(t2);
|
|
73330
73674
|
return { el: t2, kind: e20, read() {
|
|
73331
|
-
return
|
|
73675
|
+
return Le6(t2, e20);
|
|
73332
73676
|
}, write(r44, n3 = {}) {
|
|
73333
|
-
|
|
73677
|
+
Ce6(t2, e20, r44), n3.noMirror || Ut5(t2), n3.silent || Mn4(t2);
|
|
73334
73678
|
}, mirror() {
|
|
73335
|
-
|
|
73679
|
+
Ut5(t2);
|
|
73336
73680
|
} };
|
|
73337
73681
|
}
|
|
73338
|
-
var
|
|
73339
|
-
function
|
|
73682
|
+
var j6 = null, Ft5 = false, ot6 = null;
|
|
73683
|
+
function De5(t2) {
|
|
73340
73684
|
let e20 = null;
|
|
73341
73685
|
return { kind: "hub", subscribe(r44) {
|
|
73342
73686
|
let n3 = t2.onAnyChange({ debounce: 0, require: "observed" }, r44);
|
|
@@ -73358,14 +73702,14 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73358
73702
|
}
|
|
73359
73703
|
} };
|
|
73360
73704
|
}
|
|
73361
|
-
function
|
|
73705
|
+
function On4() {
|
|
73362
73706
|
let t2 = null;
|
|
73363
73707
|
return { kind: "native", subscribe(e20) {
|
|
73364
|
-
t2 = new MutationObserver((n3) => e20(
|
|
73708
|
+
t2 = new MutationObserver((n3) => e20(Bn4(n3)));
|
|
73365
73709
|
let r44 = typeof document < "u" && document.body || typeof document < "u" && document.documentElement;
|
|
73366
73710
|
r44 && t2.observe(r44, { childList: true, subtree: true, attributes: true, characterData: true });
|
|
73367
73711
|
}, suppress(e20) {
|
|
73368
|
-
let r44 =
|
|
73712
|
+
let r44 = L7("undo");
|
|
73369
73713
|
r44 && r44.pause && r44.pause();
|
|
73370
73714
|
try {
|
|
73371
73715
|
return e20();
|
|
@@ -73376,24 +73720,24 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73376
73720
|
t2 && (t2.disconnect(), t2 = null);
|
|
73377
73721
|
} };
|
|
73378
73722
|
}
|
|
73379
|
-
function
|
|
73723
|
+
function Bn4(t2) {
|
|
73380
73724
|
let e20 = [];
|
|
73381
73725
|
for (let r44 of t2) if (r44.type === "attributes") {
|
|
73382
73726
|
let n3 = r44.target;
|
|
73383
|
-
n3 && n3.nodeType === 1 && !
|
|
73727
|
+
n3 && n3.nodeType === 1 && !Dt6(n3) && e20.push({ type: "attribute", element: n3 });
|
|
73384
73728
|
} else if (r44.type === "characterData") {
|
|
73385
73729
|
let n3 = r44.target && r44.target.parentElement;
|
|
73386
|
-
n3 && !
|
|
73730
|
+
n3 && !Dt6(n3) && e20.push({ type: "characterData", element: n3 });
|
|
73387
73731
|
} else if (r44.type === "childList") {
|
|
73388
|
-
for (let n3 of r44.addedNodes) if (!(n3.nodeType !== 1 ||
|
|
73732
|
+
for (let n3 of r44.addedNodes) if (!(n3.nodeType !== 1 || Dt6(n3)) && (e20.push({ type: "add", element: n3 }), n3.querySelectorAll)) for (let o3 of n3.querySelectorAll("*")) Dt6(o3) || e20.push({ type: "add", element: o3 });
|
|
73389
73733
|
for (let n3 of r44.removedNodes) n3.nodeType === 1 && e20.push({ type: "remove", element: n3, parent: r44.target });
|
|
73390
73734
|
}
|
|
73391
73735
|
return e20;
|
|
73392
73736
|
}
|
|
73393
|
-
function
|
|
73737
|
+
function Dt6(t2) {
|
|
73394
73738
|
return !!(t2.closest && t2.closest("[sap-ignore],[template],[cms-template]"));
|
|
73395
73739
|
}
|
|
73396
|
-
function
|
|
73740
|
+
function Wn3(t2, e20) {
|
|
73397
73741
|
t2.pruneDisconnected();
|
|
73398
73742
|
let r44 = /* @__PURE__ */ new Set(), n3 = false;
|
|
73399
73743
|
for (let o3 of e20) {
|
|
@@ -73403,9 +73747,9 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73403
73747
|
n3 && t2.remountIfPresent();
|
|
73404
73748
|
for (let o3 of r44) o3.root.isConnected && t2.schedule(o3, "mutation");
|
|
73405
73749
|
}
|
|
73406
|
-
function
|
|
73407
|
-
if (
|
|
73408
|
-
let e20 =
|
|
73750
|
+
function Fe6(t2) {
|
|
73751
|
+
if (j6) return j6.suppress(t2);
|
|
73752
|
+
let e20 = L7("undo");
|
|
73409
73753
|
if (e20 && e20.pause && e20.resume) {
|
|
73410
73754
|
e20.pause();
|
|
73411
73755
|
try {
|
|
@@ -73416,256 +73760,136 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73416
73760
|
}
|
|
73417
73761
|
return t2();
|
|
73418
73762
|
}
|
|
73419
|
-
function
|
|
73420
|
-
|
|
73763
|
+
function Gt5(t2, e20) {
|
|
73764
|
+
Ft5 = true, j6 = t2, t2.subscribe((r44) => Wn3(e20, r44));
|
|
73421
73765
|
}
|
|
73422
|
-
function
|
|
73423
|
-
if (
|
|
73424
|
-
let e20 =
|
|
73766
|
+
function Yt5(t2) {
|
|
73767
|
+
if (Ft5 || typeof window > "u" || typeof document > "u") return;
|
|
73768
|
+
let e20 = L7("Mutation");
|
|
73425
73769
|
if (e20 && typeof e20.onAnyChange == "function") {
|
|
73426
|
-
|
|
73770
|
+
Gt5(De5(e20), t2);
|
|
73427
73771
|
return;
|
|
73428
73772
|
}
|
|
73429
|
-
typeof MutationObserver == "function" && (
|
|
73430
|
-
let n3 =
|
|
73431
|
-
n3 && (
|
|
73773
|
+
typeof MutationObserver == "function" && (Gt5(On4(), t2), ot6 = rt6(document, Ht5, function() {
|
|
73774
|
+
let n3 = L7("Mutation");
|
|
73775
|
+
n3 && (ot6(), ot6 = null, j6 && j6.teardown(), Ft5 = false, Gt5(De5(n3), t2));
|
|
73432
73776
|
}));
|
|
73433
73777
|
}
|
|
73434
|
-
function
|
|
73435
|
-
if (
|
|
73436
|
-
|
|
73778
|
+
function Xt5() {
|
|
73779
|
+
if (j6) try {
|
|
73780
|
+
j6.teardown();
|
|
73437
73781
|
} catch {
|
|
73438
73782
|
}
|
|
73439
|
-
|
|
73783
|
+
ot6 && typeof document < "u" && ot6(), j6 = null, Ft5 = false, ot6 = null;
|
|
73440
73784
|
}
|
|
73441
|
-
var
|
|
73442
|
-
function
|
|
73785
|
+
var qn4 = new Set(J6), V7 = [], Ie6 = {}, Me6 = {};
|
|
73786
|
+
function Oe6(t2) {
|
|
73787
|
+
V7.includes(t2) || (V7.push(t2), t2.boundary && Object.assign(Ie6, t2.boundary), t2.paintKinds && Object.assign(Me6, t2.paintKinds));
|
|
73788
|
+
}
|
|
73789
|
+
function it6(t2, e20 = {}) {
|
|
73443
73790
|
if (e20.breaker) {
|
|
73444
|
-
t2.diag.error("E26", t2.root, { problem: "recompute loop halted after 50 passes; recent triggers: " + (t2._breakerRing || []).join(", ") }),
|
|
73791
|
+
t2.diag.error("E26", t2.root, { problem: "recompute loop halted after 50 passes; recent triggers: " + (t2._breakerRing || []).join(", ") }), M6(t2.root, "loop");
|
|
73445
73792
|
return;
|
|
73446
73793
|
}
|
|
73447
|
-
e20.full &&
|
|
73448
|
-
let r44 =
|
|
73794
|
+
e20.full && ye6();
|
|
73795
|
+
let r44 = Ae6(t2.root);
|
|
73449
73796
|
try {
|
|
73450
|
-
|
|
73797
|
+
Fe6(() => jn3(t2, e20));
|
|
73451
73798
|
} finally {
|
|
73452
|
-
|
|
73799
|
+
Ee6(r44);
|
|
73453
73800
|
}
|
|
73454
73801
|
t2._viewsChanged && (t2._viewsChanged = false, t2.root.dispatchEvent(new CustomEvent("sap:views-updated", { bubbles: true })));
|
|
73455
73802
|
}
|
|
73456
|
-
function
|
|
73457
|
-
let r44 = t2.root, n3 = {}, o3 = [], s2 = [], a2 =
|
|
73803
|
+
function jn3(t2, e20) {
|
|
73804
|
+
let r44 = t2.root, n3 = {}, o3 = [], s2 = [], a2 = /* @__PURE__ */ new Set();
|
|
73458
73805
|
t2.diag.errors = [];
|
|
73459
|
-
let
|
|
73460
|
-
function
|
|
73461
|
-
let
|
|
73462
|
-
return
|
|
73463
|
-
}
|
|
73464
|
-
function
|
|
73465
|
-
let
|
|
73466
|
-
if (
|
|
73467
|
-
if (
|
|
73468
|
-
|
|
73806
|
+
let g2 = { root: n3, state: n3, item: null, ownerEl: r44, projection: false };
|
|
73807
|
+
function b4(i2, l2) {
|
|
73808
|
+
let m4 = l2.attr || l2.name, y4 = i2.getAttribute(m4);
|
|
73809
|
+
return y4 == null && (y4 = ft5(l2), s2.push({ el: i2, name: l2.name, attr: m4, value: qt5(z5(y4, l2.type), l2.type) })), z5(y4, l2.type);
|
|
73810
|
+
}
|
|
73811
|
+
function d(i2, l2, m4) {
|
|
73812
|
+
let y4 = l2.decls;
|
|
73813
|
+
if (y4) for (let x6 of y4) {
|
|
73814
|
+
if (x6.transient) {
|
|
73815
|
+
m4[x6.name] = St6(i2, x6);
|
|
73469
73816
|
continue;
|
|
73470
73817
|
}
|
|
73471
|
-
if (
|
|
73472
|
-
|
|
73818
|
+
if (G5(i2, x6)) {
|
|
73819
|
+
m4[x6.name] = i2.hasAttribute(x6.attr);
|
|
73473
73820
|
continue;
|
|
73474
73821
|
}
|
|
73475
|
-
|
|
73822
|
+
m4[x6.name] = b4(i2, x6);
|
|
73476
73823
|
}
|
|
73477
73824
|
}
|
|
73478
|
-
function
|
|
73479
|
-
let
|
|
73480
|
-
|
|
73825
|
+
function u3(i2, l2, m4) {
|
|
73826
|
+
let y4 = l2.bind, x6 = m4.item || m4.state, $6 = ht6(i2);
|
|
73827
|
+
$6 === "radio" ? (y4 in x6 || (x6[y4] = ""), i2.checked && (x6[y4] = i2.value)) : x6[y4] = Rt6(i2, $6), l2.transient && (i2.removeAttribute("value"), i2.removeAttribute("checked"));
|
|
73481
73828
|
}
|
|
73482
|
-
function
|
|
73483
|
-
if (
|
|
73484
|
-
|
|
73485
|
-
for (let T5 of h.calcs) o3.push({ owner: g2, ownerEl: f3.ownerEl, name: T5.name, entry: T5.entry, def: T5, el: i2, ctx: f3 });
|
|
73486
|
-
}
|
|
73487
|
-
if (h.paints) for (let g2 of h.paints) g2.kind === "when" && w4.add(g2.field), s2.push({ def: g2, el: i2, ctx: f3 });
|
|
73488
|
-
if (h.effects) for (let g2 of h.effects) a2.push({ def: g2, el: i2, ctx: f3 });
|
|
73489
|
-
if (h.invalids) for (let g2 of h.invalids) k5.push({ def: g2, el: i2, ctx: f3 });
|
|
73490
|
-
if (h.bind != null && (f3.view || f3.projection) && !qt5(i2)) {
|
|
73491
|
-
let g2 = h.bind;
|
|
73492
|
-
f3.view ? wt6(ke6(f3.item), g2) ? (i2._sapViewBind = "item", s2.push({ def: { kind: "projection", field: g2, from: "item" }, el: i2, ctx: f3 })) : g2 in f3.state || g2 in f3.root ? (i2._sapViewBind = "drawn", s2.push({ def: { kind: "projection", field: g2, from: "drawn" }, el: i2, ctx: f3 })) : (i2._sapViewBind = null, t2.diag.error("E43", i2, { attr: "bind", expr: g2, problem: `bind="${g2}" inside an each row matches no field of the row's record or of the scope the row is drawn in`, fix: "bind a field the record owns (bind, state= or items= on the [item]), or declare it with state= where the list is drawn" })) : s2.push({ def: { kind: "projection", field: g2, from: null }, el: i2, ctx: f3 });
|
|
73493
|
-
}
|
|
73829
|
+
function E4(i2, l2, m4) {
|
|
73830
|
+
if (l2.paints) for (let y4 of l2.paints) y4.kind === "when" && a2.add(y4.field), o3.push({ def: y4, el: i2, ctx: m4 });
|
|
73831
|
+
for (let y4 of V7) y4.collect && y4.collect(w4, i2, l2, m4);
|
|
73494
73832
|
}
|
|
73495
|
-
function
|
|
73496
|
-
Object.defineProperty(i2, "$key", { value:
|
|
73833
|
+
function S4(i2, l2, m4) {
|
|
73834
|
+
Object.defineProperty(i2, "$key", { value: At5(l2, "row"), enumerable: false }), Object.defineProperty(i2, "$index", { value: m4, enumerable: false }), Object.defineProperty(i2, "$el", { value: l2, enumerable: false });
|
|
73497
73835
|
}
|
|
73498
|
-
function
|
|
73499
|
-
let
|
|
73500
|
-
|
|
73836
|
+
function k5(i2, l2, m4) {
|
|
73837
|
+
let y4 = q7(i2);
|
|
73838
|
+
d(i2, y4, l2), i2._sapScope = l2, !m4.projection && y4.bind != null && u3(i2, y4, m4), E4(i2, y4, m4), y4.items ? p3(i2, l2, m4) : _4(i2, l2, m4);
|
|
73501
73839
|
}
|
|
73502
|
-
function
|
|
73503
|
-
for (let
|
|
73840
|
+
function _4(i2, l2, m4) {
|
|
73841
|
+
for (let y4 = i2.firstElementChild; y4; y4 = y4.nextElementSibling) h(y4, l2, m4);
|
|
73504
73842
|
}
|
|
73505
|
-
function
|
|
73506
|
-
let
|
|
73507
|
-
if (!
|
|
73508
|
-
if (
|
|
73509
|
-
|
|
73843
|
+
function h(i2, l2, m4) {
|
|
73844
|
+
let y4 = q7(i2);
|
|
73845
|
+
if (!y4.inert) {
|
|
73846
|
+
if (y4.boundary) {
|
|
73847
|
+
y4.boundary === "scope" ? A4(i2, l2, m4) : y4.boundary === "items" ? (E4(i2, y4, m4), p3(i2, l2, m4)) : Ie6[y4.boundary](w4, i2, y4, l2, m4);
|
|
73510
73848
|
return;
|
|
73511
73849
|
}
|
|
73512
|
-
!
|
|
73513
|
-
for (let
|
|
73850
|
+
!m4.projection && !m4.view && y4.bind != null && u3(i2, y4, m4), E4(i2, y4, m4);
|
|
73851
|
+
for (let x6 = i2.firstElementChild; x6; x6 = x6.nextElementSibling) h(x6, l2, m4);
|
|
73514
73852
|
}
|
|
73515
73853
|
}
|
|
73516
|
-
function
|
|
73517
|
-
let
|
|
73518
|
-
|
|
73519
|
-
let
|
|
73520
|
-
|
|
73521
|
-
}
|
|
73522
|
-
function
|
|
73523
|
-
let
|
|
73524
|
-
|
|
73525
|
-
let
|
|
73526
|
-
for (let
|
|
73527
|
-
let
|
|
73528
|
-
if (!
|
|
73529
|
-
let
|
|
73530
|
-
|
|
73531
|
-
let
|
|
73532
|
-
|
|
73854
|
+
function A4(i2, l2, m4) {
|
|
73855
|
+
let y4 = i2.getAttribute("scope"), x6 = {};
|
|
73856
|
+
l2[y4] = x6;
|
|
73857
|
+
let $6 = { root: m4.root, state: x6, item: null, ownerEl: i2, projection: m4.projection };
|
|
73858
|
+
k5(i2, x6, $6);
|
|
73859
|
+
}
|
|
73860
|
+
function p3(i2, l2, m4) {
|
|
73861
|
+
let y4 = i2.getAttribute("items"), x6 = [];
|
|
73862
|
+
l2[y4] = x6, i2._sapList = x6;
|
|
73863
|
+
let $6 = 0;
|
|
73864
|
+
for (let T5 = i2.firstElementChild; T5; T5 = T5.nextElementSibling) {
|
|
73865
|
+
let gt6 = q7(T5);
|
|
73866
|
+
if (!gt6.item || gt6.template || T5.hasAttribute("cms-template")) continue;
|
|
73867
|
+
let D4 = {};
|
|
73868
|
+
S4(D4, T5, $6);
|
|
73869
|
+
let st6 = { root: m4.root, state: m4.state, item: D4, ownerEl: T5, projection: m4.projection };
|
|
73870
|
+
k5(T5, D4, st6), x6.push(D4), $6++;
|
|
73533
73871
|
}
|
|
73534
73872
|
}
|
|
73535
|
-
|
|
73536
|
-
|
|
73537
|
-
|
|
73538
|
-
|
|
73539
|
-
|
|
73540
|
-
|
|
73541
|
-
|
|
73542
|
-
|
|
73543
|
-
|
|
73544
|
-
}
|
|
73545
|
-
function c3(i2, h, f3) {
|
|
73546
|
-
for (let g2 of V7(i2.getAttribute("state") || "")) g2.name in h || (h[g2.name] = yt6(i2, g2) ? i2.hasAttribute(g2.attr) : P7(i2, g2));
|
|
73547
|
-
A4.push({ el: i2, parentObj: h, ctx: f3 });
|
|
73548
|
-
}
|
|
73549
|
-
function u3(i2, h, f3) {
|
|
73550
|
-
i2._sapScope = h;
|
|
73551
|
-
let g2 = i2.getAttribute("detail") || "", T5 = /^([\w.]+)\s+by\s+(.+)$/.exec(g2);
|
|
73552
|
-
if (!T5) {
|
|
73553
|
-
i2.hidden = true, i2._sapDetailRow = null;
|
|
73554
|
-
return;
|
|
73555
|
-
}
|
|
73556
|
-
let I5 = T5[1], W6 = T5[2].trim(), Y5 = H6(I5, f3), K7;
|
|
73557
|
-
try {
|
|
73558
|
-
K7 = Et6(q7(W6), { state: h, item: f3.item, el: i2, root: f3.root });
|
|
73559
|
-
} catch {
|
|
73560
|
-
K7 = void 0;
|
|
73561
|
-
}
|
|
73562
|
-
let U6 = Array.isArray(Y5) && K7 != null ? Y5.find((j6) => j6 && typeof j6 == "object" && j6.$el && String(j6.$key) === String(K7)) : null;
|
|
73563
|
-
if (i2._sapDetailRow = U6 ? U6.$el : null, i2.tagName === "DIALOG") {
|
|
73564
|
-
let j6 = U6 ? String(U6.$key) : null;
|
|
73565
|
-
if (j6 !== i2._sapDetailKey && (i2._sapDetailKey = j6, i2._sapDismissed = false), !U6) {
|
|
73566
|
-
i2._sapOpenedFor = null, i2.open && typeof i2.close == "function" && (i2._sapEngineClose = true, i2.close());
|
|
73567
|
-
return;
|
|
73568
|
-
}
|
|
73569
|
-
i2.open ? i2._sapOpenedFor = j6 : (i2._sapOpenedFor === j6 && (i2._sapDismissed = true), i2._sapOpenedFor = null, !i2._sapDismissed && i2.isConnected && typeof i2.showModal == "function" && (i2.hidden && (i2.hidden = false), i2.showModal(), i2._sapOpenedFor = j6));
|
|
73570
|
-
} else {
|
|
73571
|
-
if (!U6) {
|
|
73572
|
-
i2.hidden || (i2.hidden = true);
|
|
73573
|
-
return;
|
|
73574
|
-
}
|
|
73575
|
-
i2.hidden && (i2.hidden = false);
|
|
73576
|
-
}
|
|
73577
|
-
ue5();
|
|
73578
|
-
let at5 = { root: f3.root, state: h, item: U6, ownerEl: U6.$el, projection: true };
|
|
73579
|
-
d(i2, vt5(i2), at5), E4(i2, U6, at5);
|
|
73580
|
-
}
|
|
73581
|
-
function b4(i2, h) {
|
|
73582
|
-
for (let f3 = i2.parentElement; f3; f3 = f3.parentElement) if (f3._sapScope === h && !f3.hasAttribute("detail") || f3.hasAttribute("sap")) return f3;
|
|
73583
|
-
return r44;
|
|
73584
|
-
}
|
|
73585
|
-
function v5(i2, h) {
|
|
73586
|
-
i2._sapDrawnEl = b4(i2, h.state);
|
|
73587
|
-
let f3 = null;
|
|
73588
|
-
for (let B5 = i2.firstElementChild; B5; B5 = B5.nextElementSibling) if (B5.tagName === "TEMPLATE") {
|
|
73589
|
-
f3 = B5;
|
|
73590
|
-
break;
|
|
73591
|
-
}
|
|
73592
|
-
let g2 = f3 && f3.content.children.length === 1 ? f3.content.firstElementChild : null;
|
|
73593
|
-
if (!g2) return t2.diag.error("E42", i2, { attr: "each", problem: "each needs one <template> child with exactly one element root" }), 0;
|
|
73594
|
-
let T5 = i2.getAttribute("each"), I5;
|
|
73595
|
-
try {
|
|
73596
|
-
I5 = Et6(q7(T5), { state: h.state, item: h.item, el: i2, root: h.root });
|
|
73597
|
-
} catch (B5) {
|
|
73598
|
-
return t2.diag.error("E24", i2, { attr: "each", expr: T5, problem: String(B5.message) }), 0;
|
|
73599
|
-
}
|
|
73600
|
-
if (!Array.isArray(I5)) return t2.diag.error("E40", i2, { attr: "each", expr: T5, problem: "each must evaluate to an array; the list keeps its last good rows" }), 0;
|
|
73601
|
-
let W6 = q7(i2.getAttribute("key") || "item.$key"), Y5 = [], K7 = /* @__PURE__ */ new Set();
|
|
73602
|
-
for (let B5 of I5) {
|
|
73603
|
-
let J6;
|
|
73604
|
-
try {
|
|
73605
|
-
J6 = dt6(W6, h.state, B5, i2, h.root);
|
|
73606
|
-
} catch {
|
|
73607
|
-
J6 = void 0;
|
|
73608
|
-
}
|
|
73609
|
-
let D4 = J6 == null ? "" : String(J6);
|
|
73610
|
-
if (D4 === "" || K7.has(D4)) return t2.diag.error("E41", i2, { attr: "key", expr: W6.src, problem: D4 === "" ? "an item has no key; the list keeps its last good rows" : `duplicate key "${D4}"; the list keeps its last good rows` }), 0;
|
|
73611
|
-
K7.add(D4), Y5.push(D4);
|
|
73612
|
-
}
|
|
73613
|
-
let U6 = i2._sapEach || /* @__PURE__ */ new Map(), at5 = /* @__PURE__ */ new Map(), j6 = 0, ee6 = f3;
|
|
73614
|
-
Y5.forEach((B5, J6) => {
|
|
73615
|
-
let D4 = U6.get(B5);
|
|
73616
|
-
if (!D4 || D4.parentElement !== i2) {
|
|
73617
|
-
D4 = i2.ownerDocument.importNode(g2, true);
|
|
73618
|
-
let _t5 = (D4.getAttribute("clay") || "").split(/\s+/).filter(Boolean);
|
|
73619
|
-
_t5.includes("editor-ui") || D4.setAttribute("clay", [..._t5, "editor-ui"].join(" ")), D4._sapEachRow = true, j6++;
|
|
73620
|
-
}
|
|
73621
|
-
D4.getAttribute("data-key") !== B5 && D4.setAttribute("data-key", B5), ee6.nextElementSibling !== D4 && (nr4(i2, D4, ee6), j6++), D4._sapEachItem = I5[J6], at5.set(B5, D4), ee6 = D4;
|
|
73622
|
-
});
|
|
73623
|
-
for (let [B5, J6] of U6) at5.get(B5) !== J6 && J6.parentElement === i2 && (J6.remove(), j6++);
|
|
73624
|
-
return i2._sapEach = at5, ue5(), Y5.forEach((B5, J6) => {
|
|
73625
|
-
let D4 = at5.get(B5), _t5 = { root: h.root, state: h.state, item: I5[J6], ownerEl: D4, projection: false, view: true };
|
|
73626
|
-
d(D4, vt5(D4), _t5), E4(D4, {}, _t5);
|
|
73627
|
-
}), j6;
|
|
73628
|
-
}
|
|
73629
|
-
y4(r44, n3, N16);
|
|
73630
|
-
for (let i2 = 0; i2 < A4.length; i2++) {
|
|
73631
|
-
let { el: h, parentObj: f3, ctx: g2 } = A4[i2];
|
|
73632
|
-
u3(h, f3, g2);
|
|
73633
|
-
}
|
|
73634
|
-
if ($6.length && w4.size) for (let i2 of $6) w4.has(i2.attr) && i2.el.getAttribute(i2.attr) == null && i2.el.setAttribute(i2.attr, i2.value);
|
|
73635
|
-
let x6 = /* @__PURE__ */ new Map();
|
|
73873
|
+
let w4 = { app: t2, root: r44, rootObj: n3, paints: o3, stats: { calcs: 0, lists: 0 }, resolveDefault: b4, collectEl: E4, walkScope: _4 };
|
|
73874
|
+
for (let i2 of V7) i2.begin && i2.begin(w4);
|
|
73875
|
+
if (k5(r44, n3, g2), t2.halted) return;
|
|
73876
|
+
for (let i2 of V7) i2.afterIntake && i2.afterIntake(w4);
|
|
73877
|
+
if (s2.length && a2.size) for (let i2 of s2) a2.has(i2.attr) && i2.el.getAttribute(i2.attr) == null && i2.el.setAttribute(i2.attr, i2.value);
|
|
73878
|
+
for (let i2 of V7) i2.compute && i2.compute(w4);
|
|
73879
|
+
let v5 = 0;
|
|
73880
|
+
for (let i2 of V7) i2.reconcile && (v5 += i2.reconcile(w4));
|
|
73881
|
+
let f3 = 0, c3 = v5;
|
|
73636
73882
|
for (let i2 of o3) {
|
|
73637
|
-
let
|
|
73638
|
-
|
|
73639
|
-
}
|
|
73640
|
-
let L7 = [...x6.values()].sort((i2, h) => sn3(h.ownerEl) - sn3(i2.ownerEl));
|
|
73641
|
-
for (let i2 of L7) {
|
|
73642
|
-
let h;
|
|
73643
|
-
try {
|
|
73644
|
-
h = Oe6(i2.list);
|
|
73645
|
-
} catch (f3) {
|
|
73646
|
-
t2.diag.error("E07", i2.list[0].el, { problem: f3.message }), h = i2.list;
|
|
73647
|
-
}
|
|
73648
|
-
for (let f3 of h) try {
|
|
73649
|
-
f3.owner[f3.name] = dt6(f3.entry, f3.ctx.state, f3.ctx.item, f3.el, f3.ctx.root), Ft5(f3.el);
|
|
73650
|
-
} catch (g2) {
|
|
73651
|
-
f3.owner[f3.name] = void 0, t2.diag.error("E24", f3.el, { attr: "calc:" + f3.name, expr: f3.entry.src, problem: String(g2.message) }), ut6(f3.el, g2.sapCode || "E24");
|
|
73652
|
-
}
|
|
73653
|
-
}
|
|
73654
|
-
let C5 = 0;
|
|
73655
|
-
for (let i2 = 0; i2 < l2.length; i2++) C5 += v5(l2[i2].el, l2[i2].ctx);
|
|
73656
|
-
let R5 = 0, F5 = C5;
|
|
73657
|
-
for (let i2 of s2) {
|
|
73658
|
-
let h = Zn3(i2, t2);
|
|
73659
|
-
i2.ctx.view ? F5 += h : R5 += h;
|
|
73883
|
+
let l2 = zn4(i2, t2);
|
|
73884
|
+
i2.ctx.view ? c3 += l2 : f3 += l2;
|
|
73660
73885
|
}
|
|
73661
|
-
for (let i2 of
|
|
73662
|
-
|
|
73663
|
-
t2._state = n3, t2._stats = { fields: Object.keys(n3).filter((i2) => typeof n3[i2] != "function").length, calcs: o3.length, paints: s2.length, lists: x6.size, writes: R5, viewWrites: F5 }, t2._viewsChanged = F5 > 0, t2._lastPass = { trigger: e20.trigger || "refresh", writes: R5 }, t2._debug && console.log(`sap pass \xB7 trigger: ${t2._lastPass.trigger} \xB7 writes ${R5}/${s2.length}`);
|
|
73886
|
+
for (let i2 of V7) i2.afterPaint && i2.afterPaint(w4);
|
|
73887
|
+
t2._state = n3, t2._stats = { fields: Object.keys(n3).filter((i2) => typeof n3[i2] != "function").length, calcs: w4.stats.calcs, paints: o3.length, lists: w4.stats.lists, writes: f3, viewWrites: c3 }, t2._viewsChanged = c3 > 0, t2._lastPass = { trigger: e20.trigger || "refresh", writes: f3 }, t2._debug && console.log(`sap pass \xB7 trigger: ${t2._lastPass.trigger} \xB7 writes ${f3}/${o3.length}`);
|
|
73664
73888
|
}
|
|
73665
|
-
function
|
|
73889
|
+
function Vn4(t2) {
|
|
73666
73890
|
return t2.kind === "text" ? t2.fmt ? "text:" + t2.fmt : "text" : t2.kind === "attr" ? "attr:" + t2.arg : t2.kind === "class" ? "class:" + t2.arg : t2.kind === "css" ? "css:" + t2.arg : t2.kind === "when" ? (t2.match === "hide" ? "hide-when:" : t2.match === "show-not" ? "option-not:" : "show-when:") + t2.field : t2.kind;
|
|
73667
73891
|
}
|
|
73668
|
-
function
|
|
73892
|
+
function Kt5(t2, e20, r44, n3) {
|
|
73669
73893
|
let o3 = t2;
|
|
73670
73894
|
for (; o3 && o3.nodeType === 1; ) {
|
|
73671
73895
|
if (o3.hasAttribute && o3.hasAttribute(e20)) {
|
|
@@ -73676,36 +73900,21 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73676
73900
|
}
|
|
73677
73901
|
return false;
|
|
73678
73902
|
}
|
|
73679
|
-
function
|
|
73680
|
-
|
|
73681
|
-
if (t2
|
|
73682
|
-
|
|
73683
|
-
return t2.checked === s2 ? 0 : (t2.checked = s2, 1);
|
|
73684
|
-
}
|
|
73685
|
-
let r44 = Kt5(t2), n3 = de6(t2, r44), o3 = e20 ?? "";
|
|
73686
|
-
return String(n3) !== String(o3) ? (Ze5(t2, r44, o3), 1) : 0;
|
|
73687
|
-
}
|
|
73688
|
-
function Zn3(t2, e20) {
|
|
73689
|
-
let r44 = t2.def, n3 = t2.el;
|
|
73690
|
-
if (r44.kind === "projection") {
|
|
73691
|
-
if (r44.from === "drawn") {
|
|
73692
|
-
let o3 = r44.field in t2.ctx.state ? t2.ctx.state : t2.ctx.root;
|
|
73693
|
-
return rn3(n3, o3[r44.field]);
|
|
73694
|
-
}
|
|
73695
|
-
return rn3(n3, t2.ctx.item ? t2.ctx.item[r44.field] : "");
|
|
73696
|
-
}
|
|
73697
|
-
if (r44.kind === "when") return on4(r44, n3, null);
|
|
73903
|
+
function zn4(t2, e20) {
|
|
73904
|
+
let r44 = t2.def, n3 = t2.el, o3 = Me6[r44.kind];
|
|
73905
|
+
if (o3) return o3(t2, e20);
|
|
73906
|
+
if (r44.kind === "when") return Pe6(r44, n3, null);
|
|
73698
73907
|
try {
|
|
73699
|
-
let
|
|
73700
|
-
return
|
|
73701
|
-
} catch (
|
|
73702
|
-
return e20.diag.error(
|
|
73908
|
+
let s2 = I5(r44.entry, t2.ctx.state, t2.ctx.item, n3, t2.ctx.root), a2 = Pe6(r44, n3, s2);
|
|
73909
|
+
return Q6(n3), a2;
|
|
73910
|
+
} catch (s2) {
|
|
73911
|
+
return e20.diag.error(s2.sapCode === "E22" ? "E22" : "E24", n3, { attr: Vn4(r44), expr: r44.entry && r44.entry.src, problem: String(s2.message) }), M6(n3, s2.sapCode || "E24"), 0;
|
|
73703
73912
|
}
|
|
73704
73913
|
}
|
|
73705
|
-
function
|
|
73914
|
+
function Pe6(t2, e20, r44) {
|
|
73706
73915
|
switch (t2.kind) {
|
|
73707
73916
|
case "text": {
|
|
73708
|
-
let n3 = t2.fmt != null ?
|
|
73917
|
+
let n3 = t2.fmt != null ? pe5(t2.fmt, r44) : r44 == null ? "" : String(r44);
|
|
73709
73918
|
return e20.textContent !== n3 ? (e20.textContent = n3, 1) : 0;
|
|
73710
73919
|
}
|
|
73711
73920
|
case "show": {
|
|
@@ -73713,10 +73922,10 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73713
73922
|
return e20.hidden !== n3 ? (e20.hidden = n3, 1) : 0;
|
|
73714
73923
|
}
|
|
73715
73924
|
case "when": {
|
|
73716
|
-
let n3 =
|
|
73925
|
+
let n3 = L7("optionVisibility");
|
|
73717
73926
|
if (n3 && n3._started) return e20._sapWhen && e20.hidden ? (e20.hidden = false, e20._sapWhen = false, 1) : 0;
|
|
73718
73927
|
let o3;
|
|
73719
|
-
t2.match === "hide" ? o3 = !
|
|
73928
|
+
t2.match === "hide" ? o3 = !Kt5(e20, t2.field, t2.values, false) : t2.match === "show-not" ? o3 = Kt5(e20, t2.field, t2.values, true) : o3 = Kt5(e20, t2.field, t2.values, false), e20._sapWhen = true;
|
|
73720
73929
|
let s2 = !o3;
|
|
73721
73930
|
return e20.hidden !== s2 ? (e20.hidden = s2, 1) : 0;
|
|
73722
73931
|
}
|
|
@@ -73726,7 +73935,7 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73726
73935
|
let s2 = 0;
|
|
73727
73936
|
return e20[n3] !== !!r44 && (e20[n3] = !!r44, s2 = 1), !!r44 !== e20.hasAttribute(n3) && (r44 ? e20.setAttribute(n3, "") : e20.removeAttribute(n3), s2 = 1), s2;
|
|
73728
73937
|
}
|
|
73729
|
-
if (
|
|
73938
|
+
if (qn4.has(n3)) {
|
|
73730
73939
|
let s2 = e20.hasAttribute(n3);
|
|
73731
73940
|
return r44 && !s2 ? (e20.setAttribute(n3, ""), 1) : !r44 && s2 ? (e20.removeAttribute(n3), 1) : 0;
|
|
73732
73941
|
}
|
|
@@ -73745,45 +73954,17 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73745
73954
|
return 0;
|
|
73746
73955
|
}
|
|
73747
73956
|
}
|
|
73748
|
-
|
|
73749
|
-
|
|
73750
|
-
|
|
73751
|
-
} catch (r44) {
|
|
73752
|
-
e20.diag.error("E24", t2.el, { attr: "effect", expr: t2.def.entry && t2.def.entry.src, problem: String(r44.message) }), ut6(t2.el, "E24");
|
|
73753
|
-
}
|
|
73754
|
-
}
|
|
73755
|
-
function er2(t2) {
|
|
73756
|
-
let e20 = "";
|
|
73757
|
-
try {
|
|
73758
|
-
let r44 = dt6(t2.def.entry, t2.ctx.state, t2.ctx.item, t2.el, t2.ctx.root);
|
|
73759
|
-
e20 = typeof r44 == "string" ? r44 : "";
|
|
73760
|
-
} catch {
|
|
73761
|
-
e20 = "";
|
|
73762
|
-
}
|
|
73763
|
-
typeof t2.el.setCustomValidity == "function" && t2.el.setCustomValidity(e20);
|
|
73764
|
-
}
|
|
73765
|
-
function sn3(t2) {
|
|
73766
|
-
let e20 = 0, r44 = t2;
|
|
73767
|
-
for (; r44 && !(r44.hasAttribute && r44.hasAttribute("sap")); ) r44 = r44.parentElement, e20++;
|
|
73768
|
-
return e20;
|
|
73769
|
-
}
|
|
73770
|
-
function nr4(t2, e20, r44) {
|
|
73771
|
-
let n3 = r44.nextSibling;
|
|
73772
|
-
if (e20.isConnected && t2.moveBefore) try {
|
|
73773
|
-
t2.moveBefore(e20, n3);
|
|
73774
|
-
return;
|
|
73775
|
-
} catch {
|
|
73776
|
-
}
|
|
73777
|
-
t2.insertBefore(e20, n3);
|
|
73957
|
+
var Hn3 = new Set(J6), Be6 = /* @__PURE__ */ new Set(["calc", "text", "attr", "class", "css", "set", "move", "sort", "option", "option-not", "show-when", "hide-when", "editmode"]), Un3 = /* @__PURE__ */ new Set(["show-when", "hide-when", "option", "option-not"]), Gn4 = /\b(?:state|item|root)\.|===|!==|&&|\|\||[()]|^\s*!/, We6 = /* @__PURE__ */ new Set(["sap", "scope", "items", "item", "template", "bind", "show", "effect", "invalid", "detail", "state", "transient", "confirm", "default", "persist", "sortable", "trigger-add", "trigger-remove", "trigger-reset", "sap-ignore", "sap-error", "no-save", "no-watch", "no-undo", "no-trigger-autosave", "freeze", "mutations-ignore", "save-remove", "save-ignore", "save-freeze"]), Qt4 = [];
|
|
73958
|
+
function qe6(t2) {
|
|
73959
|
+
Qt4.includes(t2) || Qt4.push(t2);
|
|
73778
73960
|
}
|
|
73779
|
-
|
|
73780
|
-
function sr4(t2) {
|
|
73961
|
+
function Yn4(t2) {
|
|
73781
73962
|
return t2.tagName === "INPUT" || t2.tagName === "SELECT" || t2.tagName === "TEXTAREA";
|
|
73782
73963
|
}
|
|
73783
|
-
function
|
|
73964
|
+
function Jt5(t2) {
|
|
73784
73965
|
return t2.hasAttribute("bind");
|
|
73785
73966
|
}
|
|
73786
|
-
function
|
|
73967
|
+
function Xn4(t2, e20) {
|
|
73787
73968
|
e20(t2);
|
|
73788
73969
|
for (let n3 = t2.firstElementChild; n3; n3 = n3.nextElementSibling) r44(n3);
|
|
73789
73970
|
function r44(n3) {
|
|
@@ -73797,547 +73978,672 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
73797
73978
|
}
|
|
73798
73979
|
}
|
|
73799
73980
|
}
|
|
73800
|
-
function
|
|
73801
|
-
let r44 = false, n3 = (a2,
|
|
73802
|
-
e20.error(a2,
|
|
73981
|
+
function Pt5(t2, e20) {
|
|
73982
|
+
let r44 = false, n3 = (a2, g2, b4) => {
|
|
73983
|
+
e20.error(a2, g2, b4), r44 = true;
|
|
73803
73984
|
}, o3 = t2.ownerDocument.createTreeWalker(t2, 4), s2;
|
|
73804
73985
|
for (; s2 = o3.nextNode(); ) if (/\{\{.*\}\}/.test(s2.nodeValue || "")) {
|
|
73805
73986
|
n3("E02", s2.parentElement || t2, { problem: "moustaches in text content are not a Sap feature", fix: 'move the expression onto the element: text="state.x"' });
|
|
73806
73987
|
break;
|
|
73807
73988
|
}
|
|
73808
|
-
return
|
|
73809
|
-
let
|
|
73810
|
-
for (let
|
|
73811
|
-
|
|
73812
|
-
|
|
73813
|
-
|
|
73814
|
-
|
|
73815
|
-
|
|
73816
|
-
|
|
73817
|
-
|
|
73818
|
-
|
|
73819
|
-
|
|
73820
|
-
|
|
73821
|
-
e20.warn("W04", a2, { attr: A4, expr: $6.value, problem: `${N16}: compares the "${P7}" attribute against a literal value, not a JS expression`, fix: `use show="${$6.value}" for an expression, or a literal like ${N16}:${P7}="overview"` });
|
|
73989
|
+
return Xn4(t2, (a2) => {
|
|
73990
|
+
let g2 = /* @__PURE__ */ new Set();
|
|
73991
|
+
for (let d of Qt4) d(a2, n3, (u3) => g2.add(u3));
|
|
73992
|
+
let b4 = a2.closest && a2.closest("[detail]");
|
|
73993
|
+
for (let d of [...a2.attributes]) {
|
|
73994
|
+
let u3 = d.name;
|
|
73995
|
+
if (g2.has(u3)) continue;
|
|
73996
|
+
if (u3.includes(":")) {
|
|
73997
|
+
let S4 = u3.slice(0, u3.indexOf(":"));
|
|
73998
|
+
if (Be6.has(S4)) {
|
|
73999
|
+
if (Un3.has(S4) && Gn4.test(d.value)) {
|
|
74000
|
+
let k5 = u3.slice(u3.indexOf(":") + 1);
|
|
74001
|
+
e20.warn("W04", a2, { attr: u3, expr: d.value, problem: `${S4}: compares the "${k5}" attribute against a literal value, not a JS expression`, fix: `use show="${d.value}" for an expression, or a literal like ${S4}:${k5}="overview"` });
|
|
73822
74002
|
}
|
|
73823
74003
|
} else {
|
|
73824
|
-
let
|
|
73825
|
-
e20.warn("W03", a2, { attr:
|
|
74004
|
+
let k5 = ut6(S4, [...Be6]);
|
|
74005
|
+
e20.warn("W03", a2, { attr: u3, problem: `unknown "${S4}:" attribute`, didYouMean: k5 ? `${k5}:` : null });
|
|
73826
74006
|
}
|
|
73827
|
-
} else if (!
|
|
73828
|
-
let
|
|
73829
|
-
|
|
74007
|
+
} else if (!We6.has(u3) && !at5.has(u3) && !Hn3.has(u3) && !/^(data-|aria-|on)/.test(u3) && !(u3 in a2)) {
|
|
74008
|
+
let S4 = ut6(u3, [...We6]);
|
|
74009
|
+
S4 && e20.warn("W03", a2, { attr: u3, problem: `unknown "${u3}" attribute`, didYouMean: S4 });
|
|
73830
74010
|
}
|
|
73831
|
-
|
|
73832
|
-
let
|
|
73833
|
-
(
|
|
74011
|
+
u3 === "attr:hidden" && e20.warn("W03", a2, { attr: u3, problem: "attr:hidden paints the wrong attribute", fix: 'use show="expr"' });
|
|
74012
|
+
let E4 = Jt5(a2) || u3 === "attr:selected" && a2.tagName === "OPTION" && !!a2.closest("select[bind]");
|
|
74013
|
+
(u3 === "attr:value" || u3 === "attr:checked" || u3 === "attr:selected") && E4 && n3("E30", a2, { attr: u3, problem: "attr: on a bound control collides with persist ownership", fix: "remove it; bind owns this attribute" }), u3 === "effect" && Jt5(a2) && /\b(value|checked)\s*=[^=]/.test(d.value) && n3("E30", a2, { attr: u3, expr: d.value, problem: "effect writes value/checked on a bound control (writes a stale value with no synthetic event)", fix: "write through onclick + Sap(this) instead" }), (u3 === "text" || u3.startsWith("text:") || u3 === "show") && Yn4(a2) && (u3 === "show" || n3("E18", a2, { attr: u3, problem: "paint belongs on output elements, not form controls", fix: "move the paint to an <output> or <span>" }));
|
|
73834
74014
|
}
|
|
73835
74015
|
if (a2.hasAttribute("state")) {
|
|
73836
|
-
let
|
|
73837
|
-
for (let
|
|
73838
|
-
|
|
73839
|
-
let
|
|
73840
|
-
|
|
74016
|
+
let d = C5(a2.getAttribute("state")), u3 = /* @__PURE__ */ new Set();
|
|
74017
|
+
for (let E4 of d) {
|
|
74018
|
+
E4.name.includes("-") && n3("E08", a2, { attr: "state", problem: `field "${E4.name}" is not a valid identifier (the hyphen parses as subtraction)`, fix: `rename to ${E4.name.replace(/-/g, "")}` }), u3.has(E4.name) && n3("E04", a2, { attr: "state", problem: `field "${E4.name}" is declared twice in one scope` }), u3.add(E4.name), wt6.has(E4.attr) && n3("E05", a2, { attr: "state", problem: `"${E4.name}" is a reserved Sap word` }), at5.has(E4.attr) && n3("E06", a2, { attr: "state", problem: `"${E4.name}" is a global HTML attribute name; pick another field name` }), E4.name === "open" && a2.tagName === "DIALOG" && n3("E33", a2, { attr: "state", problem: "dialog open is transient", fix: "use showModal() \u2014 declare state= only on <details> or popovers" });
|
|
74019
|
+
let S4 = jt6(a2, E4.attr);
|
|
74020
|
+
S4 && (E4.attr === "checked" || E4.attr === "selected") && n3("E35", a2, { attr: "state", problem: `"${E4.attr}" on a form control is the control's own state, not a declared field`, fix: 'bind the control instead, e.g. <input type="checkbox" bind="done">' }), S4 && E4.type === "num" && n3("E35", a2, { attr: "state", problem: `"${E4.attr}" is an HTML boolean attribute; it cannot hold a number`, fix: `declare it bare: state="${E4.attr}"` }), E4.transient && (S4 || E4.type === "presence") && n3("E35", a2, { attr: "state", problem: `"${E4.name}" is carried by attribute presence, which transient would strip`, fix: "declare a separate name:bool:transient field and paint the attribute from it" });
|
|
73841
74021
|
}
|
|
73842
74022
|
}
|
|
73843
|
-
if (
|
|
74023
|
+
if (Jt5(a2)) {
|
|
73844
74024
|
if (a2.hasAttribute("-"), a2.tagName === "INPUT") {
|
|
73845
|
-
let
|
|
73846
|
-
|
|
74025
|
+
let d = (a2.getAttribute("type") || "text").toLowerCase();
|
|
74026
|
+
d === "file" && n3("E32", a2, { attr: "bind", problem: "files never serialize into an HTML file", fix: "use no-save + effect instead of bind" }), d === "password" && !a2.hasAttribute("transient") && n3("E31", a2, { attr: "bind", problem: "a password must never serialize into a world-readable file", fix: "add transient to the password input" });
|
|
73847
74027
|
} else if (a2.tagName !== "SELECT" && a2.tagName !== "TEXTAREA") {
|
|
73848
|
-
let
|
|
73849
|
-
!(
|
|
74028
|
+
let d = a2.getAttribute("contenteditable");
|
|
74029
|
+
!(d != null && d !== "false") && a2.children.length > 0 && n3("E20", a2, { attr: "bind", problem: "bind on a container element is not a control; a write would overwrite its children", fix: "bind a control (input/select/textarea), a contenteditable, or an empty text leaf" });
|
|
73850
74030
|
}
|
|
73851
74031
|
}
|
|
73852
74032
|
if (a2.hasAttribute("transient") && a2.hasAttribute("persist") && n3("E34", a2, { problem: "transient and persist are opposite: persist forces the live value into the saved bytes, leaking exactly what transient drops", fix: "remove one \u2014 transient to keep it out of the file, or persist to save it" }), a2.tagName === "DIALOG" && a2.hasAttribute("detail") && !(a2.parentElement && a2.parentElement.closest('[clay~="freeze"], [freeze], [save-freeze]')) && e20.warn("W31", a2, { attr: "detail", problem: "a detail dialog writes open when it opens, and that attribute would be saved into the file", fix: 'wrap the dialog in an element with clay="freeze" (not editor-ui, which removes it from the file), and make its key field transient' }), a2.hasAttribute("item") && !a2.hasAttribute("template") && a2.parentNode && a2.parentNode.nodeType === 1) {
|
|
73853
|
-
let
|
|
73854
|
-
(
|
|
74033
|
+
let d = a2.parentElement;
|
|
74034
|
+
(!d || !d.hasAttribute("items")) && n3("E10", a2, { problem: "an [item] must be a direct child of an [items] list", fix: 'wrap it in a container with items="name"' });
|
|
73855
74035
|
}
|
|
73856
|
-
if (a2.hasAttribute("items") &&
|
|
73857
|
-
let
|
|
73858
|
-
!
|
|
74036
|
+
if (a2.hasAttribute("items") && b4 && n3("E17", a2, { attr: "items", problem: "nested items inside a detail panel is a v1 mount error (nested collections ship in v1.1)" }), a2.hasAttribute("items")) {
|
|
74037
|
+
let d = t2.querySelector(`[trigger-add="${a2.getAttribute("items")}"]`);
|
|
74038
|
+
!xt6(a2) && !Wt6(t2, a2.getAttribute("items")) && W6(a2).length === 0 && d && n3("E17", a2, { attr: "items", problem: `trigger-add targets items="${a2.getAttribute("items")}" but it has no [item template] to clone` });
|
|
73859
74039
|
}
|
|
73860
|
-
}), r44 && (e20.halted = true, e20.haltReason = e20.errors[0] ? e20.errors[0].code : "halt",
|
|
74040
|
+
}), r44 && (e20.halted = true, e20.haltReason = e20.errors[0] ? e20.errors[0].code : "halt", M6(t2, e20.haltReason)), !r44;
|
|
73861
74041
|
}
|
|
73862
|
-
var
|
|
73863
|
-
function
|
|
73864
|
-
if (
|
|
74042
|
+
var je6 = "sap-styles", Ve5 = "[item][template]{display:none!important}[hidden]{display:none!important}[sap-error]{outline:2px solid #e5484d;outline-offset:1px}", Zt5 = /* @__PURE__ */ new WeakSet();
|
|
74043
|
+
function Kn4(t2) {
|
|
74044
|
+
if (Zt5.has(t2)) return;
|
|
73865
74045
|
let e20 = t2.defaultView, r44 = e20 && e20.CSSStyleSheet;
|
|
73866
74046
|
if (r44 && "adoptedStyleSheets" in t2) try {
|
|
73867
74047
|
let n3 = new r44();
|
|
73868
|
-
n3.replaceSync(
|
|
74048
|
+
n3.replaceSync(Ve5), t2.adoptedStyleSheets = [...t2.adoptedStyleSheets, n3], Zt5.add(t2);
|
|
73869
74049
|
return;
|
|
73870
74050
|
} catch {
|
|
73871
74051
|
}
|
|
73872
|
-
if (!t2.getElementById(
|
|
74052
|
+
if (!t2.getElementById(je6)) {
|
|
73873
74053
|
let n3 = t2.createElement("style");
|
|
73874
|
-
n3.id =
|
|
74054
|
+
n3.id = je6, n3.textContent = Ve5, (t2.head || t2.documentElement).appendChild(n3);
|
|
73875
74055
|
}
|
|
73876
|
-
|
|
74056
|
+
Zt5.add(t2);
|
|
73877
74057
|
}
|
|
73878
|
-
var
|
|
73879
|
-
function
|
|
74058
|
+
var Jn4 = 0;
|
|
74059
|
+
function ze6() {
|
|
73880
74060
|
return typeof performance < "u" && performance.now ? performance.now() : 0;
|
|
73881
74061
|
}
|
|
73882
|
-
function
|
|
73883
|
-
let e20 = t2.id || t2.getAttribute("sap") || `app-${
|
|
73884
|
-
if (!
|
|
73885
|
-
|
|
73886
|
-
for (let a2 of t2.querySelectorAll("textarea[data-value]"))
|
|
73887
|
-
let s2 =
|
|
73888
|
-
return
|
|
74062
|
+
function te6(t2) {
|
|
74063
|
+
let e20 = t2.id || t2.getAttribute("sap") || `app-${Jn4++}`, r44 = new K7(e20), n3 = { root: t2, name: e20, diag: r44, _state: null, _stats: null, _lastPass: null, _passes: 0, _broken: false, _mountMs: 0, _mountWrites: 0 };
|
|
74064
|
+
if (!Pt5(t2, r44)) return n3.halted = true, n3;
|
|
74065
|
+
Kn4(t2.ownerDocument);
|
|
74066
|
+
for (let a2 of t2.querySelectorAll("textarea[data-value]")) Lt5(a2);
|
|
74067
|
+
let s2 = ze6();
|
|
74068
|
+
return it6(n3, { trigger: "mount", full: true }), n3._mountMs = ze6() - s2, n3._mountWrites = n3._stats ? n3._stats.writes : 0, n3._mountWrites > 0 && !ke6() && !L7("derived") && r44.warn("W30", t2, { problem: `${n3._mountWrites} paint(s) ran at mount; the saved file was out of sync with its declared state`, fix: "re-save once so the file mounts clean (a settled file writes nothing)" }), n3;
|
|
73889
74069
|
}
|
|
73890
|
-
var
|
|
73891
|
-
function
|
|
74070
|
+
var He6 = /^(set:|move:|sort:|trigger-add$|trigger-remove$|trigger-reset$)/;
|
|
74071
|
+
function It6(t2) {
|
|
74072
|
+
return `${t2.tagName.toLowerCase()}[sap]`;
|
|
74073
|
+
}
|
|
74074
|
+
function Qn4(t2) {
|
|
74075
|
+
let e20 = 0;
|
|
74076
|
+
for (let r44 of t2.querySelectorAll("*")) for (let n3 of r44.attributes) if (He6.test(n3.name)) {
|
|
74077
|
+
e20++;
|
|
74078
|
+
break;
|
|
74079
|
+
}
|
|
74080
|
+
for (let r44 of t2.attributes) if (He6.test(r44.name)) {
|
|
74081
|
+
e20++;
|
|
74082
|
+
break;
|
|
74083
|
+
}
|
|
74084
|
+
return e20;
|
|
74085
|
+
}
|
|
74086
|
+
function Ue6(t2) {
|
|
74087
|
+
function e20(g2) {
|
|
74088
|
+
let b4 = g2._stats || {}, d = g2.root;
|
|
74089
|
+
return { root: It6(d), fields: b4.fields || 0, calcs: b4.calcs || 0, paints: b4.paints || 0, actions: Qn4(d), lists: (d.hasAttribute("items") ? 1 : 0) + d.querySelectorAll("[items]").length, rows: d.querySelectorAll("[item]:not([template])").length, warnings: g2.diag.warnings.length, errors: g2.diag.errors.length, mountWrites: g2._mountWrites || 0, ms: Math.round((g2._mountMs || 0) * 10) / 10, passes: g2._passes || 0, lastPass: g2._lastPass || null, ok: g2.diag.errors.length === 0 && !g2.halted };
|
|
74090
|
+
}
|
|
74091
|
+
function r44() {
|
|
74092
|
+
let g2 = t2.apps().map(e20);
|
|
74093
|
+
return { ok: g2.every((b4) => b4.ok), apps: g2 };
|
|
74094
|
+
}
|
|
74095
|
+
function n3(g2) {
|
|
74096
|
+
let b4 = e20(g2);
|
|
74097
|
+
return b4.ok ? `sap \u2713 ${b4.root} \xB7 fields ${b4.fields} \xB7 calcs ${b4.calcs} \xB7 paints ${b4.paints} \xB7 actions ${b4.actions} \xB7 lists ${b4.lists} \xB7 rows ${b4.rows} \xB7 warnings ${b4.warnings} \xB7 mount writes ${b4.mountWrites} \xB7 ${b4.ms}ms` : `sap \u2717 ${b4.root} \xB7 errors ${b4.errors} \xB7 warnings ${b4.warnings} \xB7 ${b4.ms}ms`;
|
|
74098
|
+
}
|
|
74099
|
+
function o3() {
|
|
74100
|
+
for (let g2 of t2.apps()) {
|
|
74101
|
+
let b4 = n3(g2);
|
|
74102
|
+
g2.diag.errors.length || g2.halted ? console.error(b4) : console.log(b4);
|
|
74103
|
+
}
|
|
74104
|
+
}
|
|
74105
|
+
function s2() {
|
|
74106
|
+
let g2 = [], b4 = [];
|
|
74107
|
+
for (let d of t2.apps()) g2.push(...d.diag.errors), b4.push(...d.diag.warnings);
|
|
74108
|
+
return { ok: g2.length === 0, errors: g2, warnings: b4, counts: { errors: g2.length, warnings: b4.length } };
|
|
74109
|
+
}
|
|
74110
|
+
function a2(g2) {
|
|
74111
|
+
let b4 = g2 === void 0 ? true : !!g2;
|
|
74112
|
+
for (let d of t2.apps()) d._debug = b4;
|
|
74113
|
+
return console.log(`sap debug ${b4 ? "on" : "off"} \u2014 per-pass headers will ${b4 ? "" : "no longer "}log`), b4;
|
|
74114
|
+
}
|
|
74115
|
+
return { status: r44, report: s2, debug: a2, greenLine: n3, printGreenLines: o3, REGISTRY: Bt5 };
|
|
74116
|
+
}
|
|
74117
|
+
var Ge6 = "0.6.0";
|
|
74118
|
+
function Ye6({ createAccessor: t2, installInput: e20, debugExtras: r44 }) {
|
|
74119
|
+
let n3 = /* @__PURE__ */ new Map(), o3 = [], s2 = ee6(it6);
|
|
74120
|
+
function a2(i2) {
|
|
74121
|
+
let l2 = i2;
|
|
74122
|
+
for (; l2; ) {
|
|
74123
|
+
if (l2.nodeType === 1 && l2.hasAttribute && l2.hasAttribute("sap")) return n3.get(l2) || null;
|
|
74124
|
+
l2 = l2.parentNode && l2.parentNode.host ? l2.parentNode.host : l2.parentElement;
|
|
74125
|
+
}
|
|
74126
|
+
return null;
|
|
74127
|
+
}
|
|
74128
|
+
function g2() {
|
|
74129
|
+
for (let i2 = o3.length - 1; i2 >= 0; i2--) {
|
|
74130
|
+
let l2 = o3[i2];
|
|
74131
|
+
l2.root.isConnected || (n3.delete(l2.root), o3.splice(i2, 1));
|
|
74132
|
+
}
|
|
74133
|
+
}
|
|
74134
|
+
function b4(i2, l2) {
|
|
74135
|
+
if (i2.moveBefore) try {
|
|
74136
|
+
i2.moveBefore(l2, null);
|
|
74137
|
+
return;
|
|
74138
|
+
} catch {
|
|
74139
|
+
}
|
|
74140
|
+
i2.appendChild(l2);
|
|
74141
|
+
}
|
|
74142
|
+
function d(i2, l2) {
|
|
74143
|
+
let m4 = l2.parentElement;
|
|
74144
|
+
if (m4) {
|
|
74145
|
+
if (m4.moveBefore) try {
|
|
74146
|
+
m4.moveBefore(i2, l2);
|
|
74147
|
+
return;
|
|
74148
|
+
} catch {
|
|
74149
|
+
}
|
|
74150
|
+
m4.insertBefore(i2, l2);
|
|
74151
|
+
}
|
|
74152
|
+
}
|
|
74153
|
+
let u3 = { apps: () => o3.slice(), appFor: a2, isRegistered: (i2) => n3.has(i2), pruneDisconnected: g2, schedule: (i2, l2) => s2.schedule(i2, l2), runNow: (i2, l2) => s2.runNow(i2, l2), moveInto: b4, placeBefore: d, remountIfPresent: () => v5() }, E4 = t2(u3), S4 = Ue6(u3), k5 = r44 ? r44(u3, S4) : {}, _4 = false, h = false, A4 = null;
|
|
74154
|
+
function p3() {
|
|
74155
|
+
_4 || (_4 = true, e20(u3, E4, document), A4 = Ne6(u3));
|
|
74156
|
+
}
|
|
74157
|
+
function w4() {
|
|
74158
|
+
let i2 = L7("derived");
|
|
74159
|
+
i2 && typeof i2.mounted == "function" && i2.mounted();
|
|
74160
|
+
}
|
|
74161
|
+
function v5(i2 = document) {
|
|
74162
|
+
if (h) return [];
|
|
74163
|
+
p3(), Yt5(u3);
|
|
74164
|
+
let l2 = i2.querySelectorAll("[sap]"), m4 = [];
|
|
74165
|
+
for (let y4 of l2) {
|
|
74166
|
+
if (n3.has(y4)) continue;
|
|
74167
|
+
let x6 = te6(y4);
|
|
74168
|
+
n3.set(y4, x6), o3.push(x6), m4.push(x6);
|
|
74169
|
+
}
|
|
74170
|
+
for (let y4 of m4) {
|
|
74171
|
+
let x6 = S4.greenLine(y4);
|
|
74172
|
+
y4.diag.errors.length || y4.halted ? console.error(x6) : console.log(x6);
|
|
74173
|
+
}
|
|
74174
|
+
return w4(), m4;
|
|
74175
|
+
}
|
|
74176
|
+
function f3(i2) {
|
|
74177
|
+
if (h) return null;
|
|
74178
|
+
if (p3(), Yt5(u3), !i2) return v5();
|
|
74179
|
+
let l2 = typeof i2 == "string" ? document.querySelector(i2) : i2;
|
|
74180
|
+
if (!l2) return null;
|
|
74181
|
+
if (n3.has(l2)) return n3.get(l2);
|
|
74182
|
+
let m4 = te6(l2);
|
|
74183
|
+
n3.set(l2, m4), o3.push(m4);
|
|
74184
|
+
let y4 = S4.greenLine(m4);
|
|
74185
|
+
return m4.diag.errors.length || m4.halted ? console.error(y4) : console.log(y4), m4;
|
|
74186
|
+
}
|
|
74187
|
+
let c3 = E4.Sap;
|
|
74188
|
+
return c3.version = Ge6, c3.refresh = function() {
|
|
74189
|
+
for (let l2 of o3) l2.root.isConnected && s2.runNow(l2, "refresh");
|
|
74190
|
+
}, c3.batch = Te6, c3.status = S4.status, c3.report = S4.report, c3.why = k5.why, c3.debug = S4.debug, c3.doctor = k5.doctor, c3.greenLine = S4.greenLine, c3.formats = et6, c3.serializeControlToAttributes = nt6, c3.finalizeControlForSave = Se6, c3.rehydrateControlFromAttributes = Lt5, c3.mount = f3, c3.config = function(l2 = {}) {
|
|
74191
|
+
return l2.formats && Object.assign(et6, l2.formats), c3;
|
|
74192
|
+
}, c3._registry = n3, c3._reset = function() {
|
|
74193
|
+
n3.clear(), o3.length = 0, Xt5();
|
|
74194
|
+
}, c3.unmount = function() {
|
|
74195
|
+
h = true, n3.clear(), o3.length = 0, Xt5(), typeof A4 == "function" && A4();
|
|
74196
|
+
}, { Sap: c3, mountAll: v5, mount: f3, runtime: u3 };
|
|
74197
|
+
}
|
|
74198
|
+
function Xe6(t2) {
|
|
74199
|
+
if (typeof document > "u") return;
|
|
74200
|
+
let e20 = () => $e6(() => t2());
|
|
74201
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e20) : e20();
|
|
74202
|
+
}
|
|
74203
|
+
var Zn3 = ["for", "form", "list", "headers", "popovertarget", "commandfor", "anchor", "aria-activedescendant", "aria-controls", "aria-describedby", "aria-details", "aria-errormessage", "aria-flowto", "aria-labelledby", "aria-owns"];
|
|
74204
|
+
function tr4(t2, e20) {
|
|
73892
74205
|
let r44 = null;
|
|
73893
|
-
return
|
|
74206
|
+
return O4(t2, (n3) => {
|
|
73894
74207
|
!r44 && n3.getAttribute("scope") === e20 && (r44 = n3);
|
|
73895
74208
|
}), r44;
|
|
73896
74209
|
}
|
|
73897
|
-
function
|
|
73898
|
-
let n3 =
|
|
74210
|
+
function Ke6(t2, e20, r44) {
|
|
74211
|
+
let n3 = F5(t2) || e20;
|
|
73899
74212
|
for (; n3; ) {
|
|
73900
|
-
for (let o3 of
|
|
74213
|
+
for (let o3 of C5(n3.getAttribute("state") || "")) if (o3.name === r44) return { el: n3, decl: o3 };
|
|
73901
74214
|
if (n3.hasAttribute("sap")) break;
|
|
73902
|
-
n3 =
|
|
74215
|
+
n3 = F5(n3.parentElement);
|
|
73903
74216
|
}
|
|
73904
74217
|
return null;
|
|
73905
74218
|
}
|
|
73906
|
-
function
|
|
74219
|
+
function er2(t2) {
|
|
73907
74220
|
return typeof t2 == "number" ? "num" : typeof t2 == "boolean" ? "bool" : "string";
|
|
73908
74221
|
}
|
|
73909
|
-
function
|
|
73910
|
-
function e20(
|
|
73911
|
-
let
|
|
73912
|
-
if (!
|
|
73913
|
-
let p3 =
|
|
73914
|
-
if (
|
|
73915
|
-
let
|
|
73916
|
-
if (
|
|
73917
|
-
let
|
|
73918
|
-
if (
|
|
73919
|
-
let
|
|
73920
|
-
return { ctxEl:
|
|
73921
|
-
}
|
|
73922
|
-
function r44(
|
|
73923
|
-
let
|
|
73924
|
-
if (!
|
|
73925
|
-
let p3 = e20(
|
|
73926
|
-
return p3 ?
|
|
73927
|
-
}
|
|
73928
|
-
function n3(
|
|
73929
|
-
let p3 =
|
|
73930
|
-
if (!p3) return r44(
|
|
73931
|
-
let
|
|
73932
|
-
if (
|
|
73933
|
-
let
|
|
73934
|
-
return !
|
|
73935
|
-
}
|
|
73936
|
-
function o3(
|
|
73937
|
-
let
|
|
73938
|
-
if (
|
|
73939
|
-
let
|
|
73940
|
-
if (
|
|
73941
|
-
let
|
|
73942
|
-
if (
|
|
73943
|
-
let
|
|
73944
|
-
if (
|
|
73945
|
-
let
|
|
73946
|
-
return
|
|
73947
|
-
}
|
|
73948
|
-
function s2(
|
|
73949
|
-
|
|
73950
|
-
}
|
|
73951
|
-
function a2(
|
|
73952
|
-
let p3 = /* @__PURE__ */ new Set(),
|
|
73953
|
-
for (;
|
|
73954
|
-
for (let
|
|
73955
|
-
if (
|
|
73956
|
-
|
|
74222
|
+
function Je6(t2) {
|
|
74223
|
+
function e20(h) {
|
|
74224
|
+
let A4 = t2.appFor(h);
|
|
74225
|
+
if (!A4) return null;
|
|
74226
|
+
let p3 = H6(h), w4 = p3 && p3._sapEachItem && p3._sapEachItem.$el;
|
|
74227
|
+
if (w4 && w4.isConnected) return { ctxEl: w4, appRec: A4, isRow: true };
|
|
74228
|
+
let v5 = ct6(h);
|
|
74229
|
+
if (v5) return v5._sapDetailRow ? { ctxEl: v5._sapDetailRow, appRec: A4, isRow: true } : { ctxEl: F5(v5.parentElement) || A4.root, appRec: A4, isRow: false };
|
|
74230
|
+
let f3 = Et6(h);
|
|
74231
|
+
if (f3 && f3.hasAttribute("item")) return { ctxEl: f3, appRec: A4, isRow: true };
|
|
74232
|
+
let c3 = F5(h) || A4.root;
|
|
74233
|
+
return { ctxEl: c3, appRec: A4, isRow: c3.hasAttribute("item") };
|
|
74234
|
+
}
|
|
74235
|
+
function r44(h) {
|
|
74236
|
+
let A4 = typeof h == "string" ? document.querySelector(h) : h;
|
|
74237
|
+
if (!A4 || A4.nodeType !== 1) return null;
|
|
74238
|
+
let p3 = e20(A4);
|
|
74239
|
+
return p3 ? _4(p3.ctxEl, p3.appRec, p3.isRow) : null;
|
|
74240
|
+
}
|
|
74241
|
+
function n3(h, A4) {
|
|
74242
|
+
let p3 = H6(h);
|
|
74243
|
+
if (!p3) return r44(h);
|
|
74244
|
+
let w4 = t2.appFor(h), v5 = p3._sapEachItem && p3._sapEachItem.$el;
|
|
74245
|
+
if (v5 && v5.nodeType === 1 && v5.hasAttribute("item") && tt6(v5, A4)) return v5.isConnected ? _4(v5, w4, true) : null;
|
|
74246
|
+
let f3 = p3.parentElement && p3.parentElement._sapDrawnEl;
|
|
74247
|
+
return !f3 || !f3.isConnected ? null : _4(f3, w4, f3.hasAttribute("item"));
|
|
74248
|
+
}
|
|
74249
|
+
function o3(h, A4, p3) {
|
|
74250
|
+
let w4 = U6(h, p3);
|
|
74251
|
+
if (w4) return R5(w4).read();
|
|
74252
|
+
let v5 = Z7(h, p3);
|
|
74253
|
+
if (v5) return W6(v5).map((l2) => _4(l2, A4, true));
|
|
74254
|
+
let f3 = tr4(h, p3);
|
|
74255
|
+
if (f3) return _4(f3, A4, false);
|
|
74256
|
+
let c3 = Ke6(h, A4.root, p3);
|
|
74257
|
+
if (c3) return c3.decl.transient ? St6(c3.el, c3.decl) : ie6(c3.el, c3.decl);
|
|
74258
|
+
let i2 = h._sapScope;
|
|
74259
|
+
return i2 ? i2[p3] : void 0;
|
|
74260
|
+
}
|
|
74261
|
+
function s2(h, A4, p3, w4, v5) {
|
|
74262
|
+
w4.transient ? dt6(h, w4, p3) : lt6(h, w4, p3), t2.schedule(v5, "set:" + A4);
|
|
74263
|
+
}
|
|
74264
|
+
function a2(h, A4) {
|
|
74265
|
+
let p3 = /* @__PURE__ */ new Set(), w4 = F5(h) || A4;
|
|
74266
|
+
for (; w4; ) {
|
|
74267
|
+
for (let v5 of C5(w4.getAttribute("state") || "")) p3.add(v5.name);
|
|
74268
|
+
if (w4.hasAttribute("sap")) break;
|
|
74269
|
+
w4 = F5(w4.parentElement);
|
|
73957
74270
|
}
|
|
73958
|
-
return
|
|
73959
|
-
let
|
|
73960
|
-
|
|
74271
|
+
return O4(h, (v5) => {
|
|
74272
|
+
let f3 = v5.getAttribute("bind");
|
|
74273
|
+
f3 && p3.add(f3);
|
|
73961
74274
|
}), p3;
|
|
73962
74275
|
}
|
|
73963
|
-
function
|
|
73964
|
-
let
|
|
73965
|
-
if (
|
|
73966
|
-
|
|
74276
|
+
function g2(h, A4, p3, w4) {
|
|
74277
|
+
let v5 = U6(h, p3);
|
|
74278
|
+
if (v5) {
|
|
74279
|
+
R5(v5).write(w4);
|
|
73967
74280
|
return;
|
|
73968
74281
|
}
|
|
73969
|
-
let
|
|
73970
|
-
for (;
|
|
73971
|
-
for (let
|
|
73972
|
-
|
|
74282
|
+
let f3 = h;
|
|
74283
|
+
for (; f3; ) {
|
|
74284
|
+
for (let T5 of f3.attributes) if (T5.name === "calc:" + p3) {
|
|
74285
|
+
A4.diag.error("E16", f3, { attr: "calc:" + p3, problem: `"${p3}" is a computed field; computed fields are read-only` });
|
|
73973
74286
|
return;
|
|
73974
74287
|
}
|
|
73975
|
-
if (
|
|
73976
|
-
|
|
74288
|
+
if (f3.hasAttribute("sap")) break;
|
|
74289
|
+
f3 = f3.parentElement;
|
|
73977
74290
|
}
|
|
73978
|
-
let
|
|
73979
|
-
if (
|
|
73980
|
-
s2(
|
|
74291
|
+
let c3 = Ke6(h, A4.root, p3);
|
|
74292
|
+
if (c3) {
|
|
74293
|
+
s2(c3.el, p3, w4, c3.decl, A4);
|
|
73981
74294
|
return;
|
|
73982
74295
|
}
|
|
73983
|
-
let
|
|
73984
|
-
|
|
73985
|
-
let
|
|
73986
|
-
if (
|
|
73987
|
-
|
|
74296
|
+
let i2 = a2(h, A4.root);
|
|
74297
|
+
i2.delete(p3);
|
|
74298
|
+
let l2 = p3.length >= 4 ? ut6(p3, [...i2]) : null;
|
|
74299
|
+
if (l2) {
|
|
74300
|
+
A4.diag.error("E12", h, { key: p3, problem: `unknown state key "${p3}"`, didYouMean: l2 });
|
|
73988
74301
|
return;
|
|
73989
74302
|
}
|
|
73990
|
-
if (
|
|
73991
|
-
|
|
74303
|
+
if (wt6.has(p3) || at5.has(p3)) {
|
|
74304
|
+
A4.diag.error("E15", h, { key: p3, problem: `cannot write undeclared field "${p3}" \u2014 it is a reserved/global name and cannot become state`, fix: "pick a different field name, or declare it explicitly in a state= attribute" });
|
|
73992
74305
|
return;
|
|
73993
74306
|
}
|
|
73994
|
-
let
|
|
73995
|
-
|
|
74307
|
+
let m4 = A4.root, y4 = er2(w4), x6 = m4.getAttribute("state") || "", $6 = y4 === "string" ? p3 : `${p3}:${y4}`;
|
|
74308
|
+
m4.setAttribute("state", x6 ? `${x6} ${$6}` : $6), s2(m4, p3, w4, { name: p3, attr: p3, type: y4, transient: false }, A4);
|
|
73996
74309
|
}
|
|
73997
|
-
function
|
|
73998
|
-
let
|
|
73999
|
-
let
|
|
74000
|
-
|
|
74310
|
+
function b4(h) {
|
|
74311
|
+
let A4 = h.ownerDocument, p3 = /* @__PURE__ */ new Map(), w4 = (v5, f3) => {
|
|
74312
|
+
let c3 = re5(A4), i2 = v5.getAttribute(f3);
|
|
74313
|
+
i2 && f3 === "id" && p3.set(i2, c3), v5.setAttribute(f3, c3);
|
|
74001
74314
|
};
|
|
74002
|
-
|
|
74003
|
-
for (let
|
|
74004
|
-
let
|
|
74005
|
-
if (
|
|
74006
|
-
let
|
|
74007
|
-
|
|
74315
|
+
h.querySelectorAll("[id]").forEach((v5) => w4(v5, "id")), h.querySelectorAll("[data-id]").forEach((v5) => w4(v5, "data-id")), h.querySelectorAll("[sap-error]").forEach((v5) => v5.removeAttribute("sap-error")), h.removeAttribute("sap-error"), h.hasAttribute("data-id") ? (h.removeAttribute("id"), w4(h, "data-id")) : w4(h, "id");
|
|
74316
|
+
for (let v5 of [h, ...h.querySelectorAll("*")]) for (let f3 of Zn3) {
|
|
74317
|
+
let c3 = v5.getAttribute(f3);
|
|
74318
|
+
if (c3 == null) continue;
|
|
74319
|
+
let i2 = c3.split(/\s+/).map((l2) => p3.get(l2) || l2).join(" ");
|
|
74320
|
+
i2 !== c3 && v5.setAttribute(f3, i2);
|
|
74008
74321
|
}
|
|
74009
74322
|
}
|
|
74010
|
-
function
|
|
74011
|
-
let
|
|
74012
|
-
if (!
|
|
74013
|
-
let
|
|
74014
|
-
if (!
|
|
74015
|
-
let
|
|
74016
|
-
return
|
|
74323
|
+
function d(h, A4, p3) {
|
|
74324
|
+
let w4 = pt6(A4.root, h, p3);
|
|
74325
|
+
if (!w4) return A4.diag.error("E17", h, { problem: `cannot resolve a list named "${p3}" from here` }), null;
|
|
74326
|
+
let v5 = xt6(w4);
|
|
74327
|
+
if (!v5) return A4.diag.error("E17", w4, { problem: `items="${p3}" has no [item template] to clone` }), null;
|
|
74328
|
+
let f3 = w4.ownerDocument.importNode(v5, true);
|
|
74329
|
+
return f3.removeAttribute("template"), b4(f3), w4.appendChild(f3), t2.schedule(A4, "trigger-add:" + p3), _4(f3, A4, true);
|
|
74017
74330
|
}
|
|
74018
|
-
function
|
|
74019
|
-
|
|
74331
|
+
function u3(h, A4) {
|
|
74332
|
+
O4(h, (p3) => {
|
|
74020
74333
|
if (p3.hasAttribute("bind")) {
|
|
74021
|
-
let
|
|
74022
|
-
|
|
74334
|
+
let w4 = R5(p3), v5 = p3.getAttribute("default");
|
|
74335
|
+
w4.kind === "checkbox" || w4.kind === "radio" ? w4.write(v5 != null ? v5 === "" || v5 === "true" || p3.value === v5 : p3.hasAttribute("checked")) : w4.write(v5 ?? (p3.getAttribute("value") || ""));
|
|
74023
74336
|
}
|
|
74024
74337
|
});
|
|
74025
|
-
for (let p3 of
|
|
74026
|
-
let
|
|
74027
|
-
p3.transient ?
|
|
74338
|
+
for (let p3 of C5(h.getAttribute("state") || "")) {
|
|
74339
|
+
let w4 = se6(h, p3);
|
|
74340
|
+
p3.transient ? dt6(h, p3, w4) : lt6(h, p3, w4);
|
|
74028
74341
|
}
|
|
74029
|
-
t2.schedule(
|
|
74342
|
+
t2.schedule(A4, "trigger-reset");
|
|
74030
74343
|
}
|
|
74031
|
-
function
|
|
74032
|
-
if (!
|
|
74033
|
-
|
|
74344
|
+
function E4(h, A4) {
|
|
74345
|
+
if (!h.isConnected) throw new Error("stale row handle: $remove() on a removed row");
|
|
74346
|
+
h.remove(), t2.schedule(A4, "trigger-remove");
|
|
74034
74347
|
}
|
|
74035
|
-
function
|
|
74036
|
-
if (!
|
|
74037
|
-
let
|
|
74038
|
-
if (p3 && p3.nodeType === 1 ?
|
|
74039
|
-
|
|
74348
|
+
function S4(h, A4, p3) {
|
|
74349
|
+
if (!h.isConnected) throw new Error("stale row handle: $move() on a removed row");
|
|
74350
|
+
let w4 = null;
|
|
74351
|
+
if (p3 && p3.nodeType === 1 ? w4 = p3 : typeof p3 == "string" && (w4 = pt6(A4.root, h, p3)), !w4) {
|
|
74352
|
+
A4.diag.error("E17", h, { problem: `$move() cannot resolve target "${p3}"` });
|
|
74040
74353
|
return;
|
|
74041
74354
|
}
|
|
74042
|
-
t2.moveInto(
|
|
74355
|
+
t2.moveInto(w4, h), t2.schedule(A4, "trigger-move");
|
|
74043
74356
|
}
|
|
74044
|
-
function
|
|
74045
|
-
let
|
|
74046
|
-
return
|
|
74357
|
+
function k5(h) {
|
|
74358
|
+
let A4 = h.parentElement;
|
|
74359
|
+
return A4 ? W6(A4).indexOf(h) : -1;
|
|
74047
74360
|
}
|
|
74048
|
-
function
|
|
74049
|
-
let
|
|
74050
|
-
return
|
|
74361
|
+
function _4(h, A4, p3) {
|
|
74362
|
+
let w4 = { get $el() {
|
|
74363
|
+
return h;
|
|
74051
74364
|
}, get $key() {
|
|
74052
|
-
return
|
|
74365
|
+
return At5(h, p3 ? "row" : "scope");
|
|
74053
74366
|
}, get $index() {
|
|
74054
|
-
return
|
|
74055
|
-
}, $add(
|
|
74056
|
-
return
|
|
74367
|
+
return k5(h);
|
|
74368
|
+
}, $add(f3) {
|
|
74369
|
+
return d(h, A4, f3);
|
|
74057
74370
|
}, $reset() {
|
|
74058
|
-
return
|
|
74371
|
+
return u3(h, A4), v5;
|
|
74059
74372
|
}, $remove() {
|
|
74060
|
-
|
|
74061
|
-
}, $move(
|
|
74062
|
-
|
|
74373
|
+
E4(h, A4);
|
|
74374
|
+
}, $move(f3) {
|
|
74375
|
+
S4(h, A4, f3);
|
|
74063
74376
|
}, get $appRec() {
|
|
74064
|
-
return
|
|
74065
|
-
} },
|
|
74066
|
-
return typeof
|
|
74067
|
-
}, set(
|
|
74068
|
-
return typeof
|
|
74069
|
-
}, has(
|
|
74070
|
-
return typeof
|
|
74377
|
+
return A4;
|
|
74378
|
+
} }, v5 = new Proxy(w4, { get(f3, c3) {
|
|
74379
|
+
return typeof c3 == "symbol" || c3[0] === "$" ? f3[c3] : o3(h, A4, c3);
|
|
74380
|
+
}, set(f3, c3, i2) {
|
|
74381
|
+
return typeof c3 == "string" && c3[0] === "$" ? (f3[c3] = i2, true) : (g2(h, A4, c3, i2), true);
|
|
74382
|
+
}, has(f3, c3) {
|
|
74383
|
+
return typeof c3 == "string" && c3[0] === "$" ? c3 in f3 : o3(h, A4, c3) !== void 0;
|
|
74071
74384
|
} });
|
|
74072
|
-
return
|
|
74385
|
+
return v5;
|
|
74073
74386
|
}
|
|
74074
|
-
return { Sap: r44, contextElFor: e20, readField: o3, writeField:
|
|
74387
|
+
return { Sap: r44, contextElFor: e20, readField: o3, writeField: g2, makeProxy: _4, writeTargetFor: n3 };
|
|
74075
74388
|
}
|
|
74076
|
-
var
|
|
74077
|
-
function
|
|
74389
|
+
var nr4 = ["trigger-add", "trigger-remove", "trigger-reset"];
|
|
74390
|
+
function rr3(t2) {
|
|
74078
74391
|
if (t2.nodeType !== 1) return false;
|
|
74079
74392
|
for (let e20 of t2.attributes) {
|
|
74080
74393
|
let r44 = e20.name;
|
|
74081
|
-
if (r44.startsWith("set:") || r44.startsWith("move:") || r44.startsWith("sort:") ||
|
|
74394
|
+
if (r44.startsWith("set:") || r44.startsWith("move:") || r44.startsWith("sort:") || nr4.includes(r44)) return true;
|
|
74082
74395
|
}
|
|
74083
74396
|
return false;
|
|
74084
74397
|
}
|
|
74085
|
-
function
|
|
74398
|
+
function or4(t2, e20) {
|
|
74086
74399
|
let r44 = t2, n3 = e20.parentElement;
|
|
74087
74400
|
for (; r44 && r44 !== n3; ) {
|
|
74088
|
-
if (r44.nodeType === 1 &&
|
|
74401
|
+
if (r44.nodeType === 1 && rr3(r44) && !(r44.tagName === "FORM" && r44.hasAttribute("trigger-add"))) return r44;
|
|
74089
74402
|
r44 = r44.parentElement;
|
|
74090
74403
|
}
|
|
74091
74404
|
return null;
|
|
74092
74405
|
}
|
|
74093
|
-
function
|
|
74406
|
+
function Qe6(t2, e20) {
|
|
74094
74407
|
let { Sap: r44 } = e20;
|
|
74095
|
-
function n3(
|
|
74096
|
-
let
|
|
74097
|
-
if (
|
|
74098
|
-
else if (
|
|
74408
|
+
function n3(f3, c3) {
|
|
74409
|
+
let i2 = null, l2 = H6(f3), m4 = ct6(f3);
|
|
74410
|
+
if (l2) i2 = l2._sapEachItem ?? null;
|
|
74411
|
+
else if (m4 && m4._sapDetailRow) i2 = m4._sapDetailRow._sapScope || null;
|
|
74099
74412
|
else {
|
|
74100
|
-
let
|
|
74101
|
-
|
|
74413
|
+
let $6 = Et6(f3);
|
|
74414
|
+
$6 && $6.hasAttribute("item") && (i2 = $6._sapScope || null);
|
|
74102
74415
|
}
|
|
74103
|
-
return { state: (
|
|
74416
|
+
return { state: (F5(f3) || c3.root)._sapScope || c3._state || {}, item: i2, el: f3, root: c3._state || {} };
|
|
74104
74417
|
}
|
|
74105
|
-
function o3(
|
|
74106
|
-
if (!
|
|
74107
|
-
|
|
74418
|
+
function o3(f3, c3, i2) {
|
|
74419
|
+
if (!f3.hasAttribute("confirm")) {
|
|
74420
|
+
i2();
|
|
74108
74421
|
return;
|
|
74109
74422
|
}
|
|
74110
|
-
let
|
|
74111
|
-
if (!
|
|
74112
|
-
let
|
|
74113
|
-
(typeof
|
|
74423
|
+
let l2 = f3.getAttribute("confirm"), m4 = l2, y4 = N16(l2);
|
|
74424
|
+
if (!y4.error) try {
|
|
74425
|
+
let T5 = Y5(y4, n3(f3, c3));
|
|
74426
|
+
(typeof T5 == "string" || typeof T5 == "number") && (m4 = String(T5));
|
|
74114
74427
|
} catch {
|
|
74115
74428
|
}
|
|
74116
|
-
let
|
|
74117
|
-
if (!
|
|
74118
|
-
window.confirm(
|
|
74429
|
+
let x6 = _e6();
|
|
74430
|
+
if (!x6) {
|
|
74431
|
+
window.confirm(m4) && i2();
|
|
74119
74432
|
return;
|
|
74120
74433
|
}
|
|
74121
|
-
if (
|
|
74122
|
-
|
|
74123
|
-
let
|
|
74124
|
-
|
|
74434
|
+
if (f3._sapGatePending) return;
|
|
74435
|
+
f3._sapGatePending = true;
|
|
74436
|
+
let $6 = () => {
|
|
74437
|
+
f3._sapGatePending = false;
|
|
74125
74438
|
};
|
|
74126
|
-
|
|
74127
|
-
|
|
74128
|
-
}).catch(
|
|
74129
|
-
}
|
|
74130
|
-
function s2(
|
|
74131
|
-
for (let
|
|
74132
|
-
if (!
|
|
74133
|
-
let
|
|
74134
|
-
if (
|
|
74135
|
-
|
|
74439
|
+
x6(m4, () => {
|
|
74440
|
+
$6(), i2();
|
|
74441
|
+
}).catch($6);
|
|
74442
|
+
}
|
|
74443
|
+
function s2(f3, c3) {
|
|
74444
|
+
for (let i2 of f3.attributes) {
|
|
74445
|
+
if (!i2.name.startsWith("set:")) continue;
|
|
74446
|
+
let l2 = i2.name.slice(4), m4 = N16(i2.value);
|
|
74447
|
+
if (m4.error) {
|
|
74448
|
+
c3.diag.error("E08", f3, { attr: i2.name, expr: i2.value, problem: String(m4.error.message) });
|
|
74136
74449
|
continue;
|
|
74137
74450
|
}
|
|
74138
|
-
let
|
|
74451
|
+
let y4;
|
|
74139
74452
|
try {
|
|
74140
|
-
|
|
74141
|
-
} catch (
|
|
74142
|
-
|
|
74453
|
+
y4 = Y5(m4, n3(f3, c3));
|
|
74454
|
+
} catch ($6) {
|
|
74455
|
+
c3.diag.error("E24", f3, { attr: i2.name, expr: i2.value, problem: String($6.message) });
|
|
74143
74456
|
continue;
|
|
74144
74457
|
}
|
|
74145
|
-
let
|
|
74146
|
-
|
|
74458
|
+
let x6 = e20.writeTargetFor(f3, l2);
|
|
74459
|
+
x6 && (x6[l2] = y4);
|
|
74147
74460
|
}
|
|
74148
74461
|
}
|
|
74149
|
-
function a2(
|
|
74150
|
-
let
|
|
74151
|
-
if (!
|
|
74152
|
-
let
|
|
74153
|
-
return
|
|
74154
|
-
}
|
|
74155
|
-
function
|
|
74156
|
-
let
|
|
74157
|
-
if (!
|
|
74158
|
-
let
|
|
74159
|
-
|
|
74160
|
-
}
|
|
74161
|
-
function
|
|
74162
|
-
if (
|
|
74163
|
-
let
|
|
74164
|
-
for (;
|
|
74165
|
-
if (
|
|
74166
|
-
|
|
74462
|
+
function a2(f3) {
|
|
74463
|
+
let c3 = H6(f3);
|
|
74464
|
+
if (!c3) return f3.closest("[item]");
|
|
74465
|
+
let i2 = c3._sapEachItem && c3._sapEachItem.$el;
|
|
74466
|
+
return i2 && i2.nodeType === 1 && i2.hasAttribute("item") ? i2 : null;
|
|
74467
|
+
}
|
|
74468
|
+
function g2(f3, c3) {
|
|
74469
|
+
let i2 = a2(f3);
|
|
74470
|
+
if (!i2) return;
|
|
74471
|
+
let l2 = W6(i2.parentElement), m4 = l2.indexOf(i2);
|
|
74472
|
+
c3 === "up" && m4 > 0 ? t2.placeBefore(i2, l2[m4 - 1]) : c3 === "down" && m4 < l2.length - 1 && t2.placeBefore(l2[m4 + 1], i2);
|
|
74473
|
+
}
|
|
74474
|
+
function b4(f3, c3, i2) {
|
|
74475
|
+
if (c3) return pt6(i2.root, f3, c3);
|
|
74476
|
+
let l2 = f3;
|
|
74477
|
+
for (; l2; ) {
|
|
74478
|
+
if (l2.hasAttribute && l2.hasAttribute("items")) return l2;
|
|
74479
|
+
l2 = l2.parentElement;
|
|
74167
74480
|
}
|
|
74168
|
-
let
|
|
74169
|
-
return
|
|
74170
|
-
|
|
74171
|
-
}),
|
|
74172
|
-
}
|
|
74173
|
-
function
|
|
74174
|
-
let
|
|
74175
|
-
if (
|
|
74176
|
-
if (
|
|
74177
|
-
if (
|
|
74178
|
-
let
|
|
74179
|
-
return !Number.isNaN(
|
|
74180
|
-
}
|
|
74181
|
-
function
|
|
74182
|
-
let
|
|
74183
|
-
if (!
|
|
74184
|
-
|
|
74481
|
+
let m4 = F5(f3) || i2.root, y4 = [];
|
|
74482
|
+
return O4(m4, (x6) => {
|
|
74483
|
+
x6.hasAttribute("items") && y4.push(x6);
|
|
74484
|
+
}), y4[0] || null;
|
|
74485
|
+
}
|
|
74486
|
+
function d(f3, c3) {
|
|
74487
|
+
let i2 = f3 == null || f3 === "", l2 = c3 == null || c3 === "";
|
|
74488
|
+
if (i2 && l2) return 0;
|
|
74489
|
+
if (i2) return 1;
|
|
74490
|
+
if (l2) return -1;
|
|
74491
|
+
let m4 = Number(f3), y4 = Number(c3);
|
|
74492
|
+
return !Number.isNaN(m4) && !Number.isNaN(y4) ? m4 - y4 : String(f3) < String(c3) ? -1 : String(f3) > String(c3) ? 1 : 0;
|
|
74493
|
+
}
|
|
74494
|
+
function u3(f3, c3, i2, l2) {
|
|
74495
|
+
let m4 = b4(f3, i2, l2);
|
|
74496
|
+
if (!m4) {
|
|
74497
|
+
l2.diag.error("E17", f3, { attr: "sort:" + c3, problem: `no items list resolvable for sort:${c3}` });
|
|
74185
74498
|
return;
|
|
74186
74499
|
}
|
|
74187
|
-
let
|
|
74188
|
-
for (let
|
|
74189
|
-
t2.schedule(
|
|
74190
|
-
}
|
|
74191
|
-
function
|
|
74192
|
-
if (!
|
|
74193
|
-
let
|
|
74194
|
-
|
|
74195
|
-
}
|
|
74196
|
-
function
|
|
74197
|
-
o3(
|
|
74198
|
-
let
|
|
74199
|
-
for (let
|
|
74200
|
-
let
|
|
74201
|
-
if (
|
|
74202
|
-
else if (
|
|
74203
|
-
else if (
|
|
74204
|
-
let
|
|
74205
|
-
|
|
74206
|
-
} else
|
|
74500
|
+
let y4 = W6(m4), x6 = (D4) => D4._sapScope ? D4._sapScope[c3] : void 0, $6 = [...y4].sort((D4, st6) => d(x6(D4), x6(st6))), gt6 = $6.every((D4, st6) => D4 === y4[st6]) ? [...$6].reverse() : $6;
|
|
74501
|
+
for (let D4 of gt6) t2.moveInto(m4, D4);
|
|
74502
|
+
t2.schedule(l2, "sort:" + c3);
|
|
74503
|
+
}
|
|
74504
|
+
function E4(f3) {
|
|
74505
|
+
if (!f3 || f3.hidden) return;
|
|
74506
|
+
let c3 = f3.querySelector("[bind]:not([type=hidden]), [contenteditable]");
|
|
74507
|
+
c3 && typeof c3.focus == "function" && c3.focus();
|
|
74508
|
+
}
|
|
74509
|
+
function S4(f3, c3) {
|
|
74510
|
+
o3(f3, c3, () => {
|
|
74511
|
+
let i2 = r44(f3);
|
|
74512
|
+
for (let l2 of [...f3.attributes]) {
|
|
74513
|
+
let m4 = l2.name;
|
|
74514
|
+
if (m4 === "trigger-remove") i2 && i2.$remove();
|
|
74515
|
+
else if (m4 === "trigger-reset") i2 && i2.$reset();
|
|
74516
|
+
else if (m4 === "trigger-add") {
|
|
74517
|
+
let y4 = i2 && i2.$add(l2.value);
|
|
74518
|
+
y4 && E4(y4.$el);
|
|
74519
|
+
} else m4 === "move:up" ? (g2(f3, "up"), t2.schedule(c3, "move:up")) : m4 === "move:down" ? (g2(f3, "down"), t2.schedule(c3, "move:down")) : m4.startsWith("move:to") ? i2 && i2.$move(l2.value) : m4.startsWith("sort:") && u3(f3, m4.slice(5), l2.value, c3);
|
|
74207
74520
|
}
|
|
74208
|
-
[...
|
|
74521
|
+
[...f3.attributes].some((l2) => l2.name.startsWith("set:")) && s2(f3, c3);
|
|
74209
74522
|
});
|
|
74210
74523
|
}
|
|
74211
|
-
function
|
|
74212
|
-
let
|
|
74213
|
-
if (!
|
|
74214
|
-
let
|
|
74215
|
-
if (!
|
|
74216
|
-
let
|
|
74217
|
-
|
|
74218
|
-
}
|
|
74219
|
-
function
|
|
74220
|
-
let
|
|
74221
|
-
|
|
74222
|
-
}
|
|
74223
|
-
function
|
|
74224
|
-
let
|
|
74225
|
-
if (!
|
|
74226
|
-
let
|
|
74227
|
-
if (!
|
|
74228
|
-
let
|
|
74229
|
-
|
|
74230
|
-
|
|
74524
|
+
function k5(f3) {
|
|
74525
|
+
let c3 = f3.target;
|
|
74526
|
+
if (!c3 || c3.nodeType !== 1) return;
|
|
74527
|
+
let i2 = t2.appFor(c3);
|
|
74528
|
+
if (!i2) return;
|
|
74529
|
+
let l2 = or4(c3, i2.root);
|
|
74530
|
+
l2 && S4(l2, i2);
|
|
74531
|
+
}
|
|
74532
|
+
function _4(f3) {
|
|
74533
|
+
let c3 = R5(f3), i2 = f3.getAttribute("default");
|
|
74534
|
+
c3.kind === "checkbox" ? c3.write(i2 === "" || i2 === "true") : c3.write(i2 ?? "");
|
|
74535
|
+
}
|
|
74536
|
+
function h(f3, c3, i2) {
|
|
74537
|
+
let l2 = r44(f3);
|
|
74538
|
+
if (!l2) return;
|
|
74539
|
+
let m4 = l2.$add(i2);
|
|
74540
|
+
if (!m4) return;
|
|
74541
|
+
let y4 = [];
|
|
74542
|
+
O4(f3, (x6) => {
|
|
74543
|
+
x6.hasAttribute("bind") && y4.push(x6);
|
|
74231
74544
|
});
|
|
74232
|
-
for (let
|
|
74233
|
-
if (
|
|
74234
|
-
let
|
|
74235
|
-
|
|
74545
|
+
for (let x6 of y4) {
|
|
74546
|
+
if (x6.type === "radio" && !x6.checked) continue;
|
|
74547
|
+
let $6 = x6.getAttribute("bind"), T5 = U6(m4.$el, $6);
|
|
74548
|
+
T5 ? R5(T5).write(R5(x6).read()) : tt6(m4.$el, $6) && (m4[$6] = R5(x6).read());
|
|
74236
74549
|
}
|
|
74237
|
-
|
|
74238
|
-
}
|
|
74239
|
-
function
|
|
74240
|
-
let
|
|
74241
|
-
if (!
|
|
74242
|
-
let
|
|
74243
|
-
|
|
74244
|
-
}
|
|
74245
|
-
function p3(
|
|
74246
|
-
let
|
|
74247
|
-
|
|
74248
|
-
|
|
74249
|
-
|
|
74250
|
-
}), t2.schedule(b4, "reset");
|
|
74251
|
-
}, 0);
|
|
74252
|
-
}
|
|
74253
|
-
function y4(c3) {
|
|
74254
|
-
let u3 = t2.appFor(c3.target);
|
|
74255
|
-
u3 && t2.schedule(u3, "toggle");
|
|
74256
|
-
}
|
|
74257
|
-
function E4(c3) {
|
|
74258
|
-
let u3 = c3.target;
|
|
74259
|
-
if (!u3 || u3.tagName !== "DIALOG" || !u3.hasAttribute("detail")) return;
|
|
74260
|
-
if (u3._sapEngineClose) {
|
|
74261
|
-
u3._sapEngineClose = false;
|
|
74550
|
+
y4.forEach(_4), y4.length ? typeof y4[0].focus == "function" && y4[0].focus() : E4(m4.$el);
|
|
74551
|
+
}
|
|
74552
|
+
function A4(f3) {
|
|
74553
|
+
let c3 = f3.target;
|
|
74554
|
+
if (!c3 || !c3.hasAttribute || !c3.hasAttribute("trigger-add")) return;
|
|
74555
|
+
let i2 = t2.appFor(c3);
|
|
74556
|
+
i2 && (f3.preventDefault(), o3(c3, i2, () => h(c3, i2, c3.getAttribute("trigger-add"))));
|
|
74557
|
+
}
|
|
74558
|
+
function p3(f3) {
|
|
74559
|
+
let c3 = f3.target;
|
|
74560
|
+
if (!c3 || c3.tagName !== "DIALOG" || !c3.hasAttribute("detail")) return;
|
|
74561
|
+
if (c3._sapEngineClose) {
|
|
74562
|
+
c3._sapEngineClose = false;
|
|
74262
74563
|
return;
|
|
74263
74564
|
}
|
|
74264
|
-
if (
|
|
74265
|
-
let
|
|
74266
|
-
if (!
|
|
74267
|
-
let
|
|
74268
|
-
if (
|
|
74269
|
-
|
|
74565
|
+
if (c3.open) return;
|
|
74566
|
+
let i2 = /^[\w.]+\s+by\s+state\.(\w+)\s*$/.exec(c3.getAttribute("detail") || ""), l2 = t2.appFor(c3);
|
|
74567
|
+
if (!i2 || !l2) return;
|
|
74568
|
+
let m4 = C5(c3.getAttribute("state") || "").find((x6) => x6.name === i2[1]);
|
|
74569
|
+
if (m4) {
|
|
74570
|
+
m4.transient ? dt6(c3, m4, "") : lt6(c3, m4, ""), t2.schedule(l2, "close");
|
|
74270
74571
|
return;
|
|
74271
74572
|
}
|
|
74272
|
-
let
|
|
74273
|
-
|
|
74274
|
-
}
|
|
74275
|
-
function
|
|
74276
|
-
let
|
|
74277
|
-
if (!
|
|
74278
|
-
|
|
74279
|
-
|
|
74280
|
-
u3.hasAttribute("persist") && !Xt5(u3) && xt6(u3);
|
|
74281
|
-
let v5 = u3.hasAttribute("bind") && qt5(u3);
|
|
74282
|
-
if (!v5 && u3.hasAttribute("bind") && lt6(u3)) {
|
|
74283
|
-
let L7 = u3.getAttribute("bind"), C5 = u3._sapViewBind ? e20.writeTargetFor(u3, L7) : null;
|
|
74284
|
-
C5 && (C5[L7] = G5(u3).read());
|
|
74285
|
-
return;
|
|
74573
|
+
let y4 = r44(c3.parentElement);
|
|
74574
|
+
y4 && y4[i2[1]] !== "" && (y4[i2[1]] = "");
|
|
74575
|
+
}
|
|
74576
|
+
function w4(f3, c3) {
|
|
74577
|
+
let i2 = f3.hasAttribute("bind") && vt5(f3);
|
|
74578
|
+
if (!i2 && f3.hasAttribute("bind") && H6(f3)) {
|
|
74579
|
+
let m4 = f3.getAttribute("bind"), y4 = f3._sapViewBind ? e20.writeTargetFor(f3, m4) : null;
|
|
74580
|
+
return y4 && (y4[m4] = R5(f3).read()), true;
|
|
74286
74581
|
}
|
|
74287
|
-
let
|
|
74288
|
-
if (
|
|
74289
|
-
let
|
|
74290
|
-
if (
|
|
74291
|
-
|
|
74292
|
-
return;
|
|
74293
|
-
}
|
|
74294
|
-
if (!R5 && V7(L7.getAttribute("state") || "").some((F5) => F5.name === C5)) {
|
|
74295
|
-
e20.writeField(L7, b4, C5, G5(u3).read());
|
|
74296
|
-
return;
|
|
74297
|
-
}
|
|
74582
|
+
let l2 = ct6(f3);
|
|
74583
|
+
if (l2 && l2._sapDetailRow && f3.hasAttribute("bind") && !i2) {
|
|
74584
|
+
let m4 = l2._sapDetailRow, y4 = f3.getAttribute("bind"), x6 = U6(m4, y4);
|
|
74585
|
+
if (x6 && x6 !== f3) return R5(x6).write(R5(f3).read()), true;
|
|
74586
|
+
if (!x6 && C5(m4.getAttribute("state") || "").some(($6) => $6.name === y4)) return e20.writeField(m4, c3, y4, R5(f3).read()), true;
|
|
74298
74587
|
}
|
|
74299
|
-
|
|
74300
|
-
}
|
|
74301
|
-
function
|
|
74302
|
-
|
|
74303
|
-
|
|
74304
|
-
|
|
74305
|
-
|
|
74306
|
-
|
|
74588
|
+
return false;
|
|
74589
|
+
}
|
|
74590
|
+
function v5(f3 = document) {
|
|
74591
|
+
f3.addEventListener("click", k5), f3.addEventListener("submit", A4), f3.addEventListener("close", p3, true);
|
|
74592
|
+
}
|
|
74593
|
+
return { install: v5, routeInput: w4 };
|
|
74594
|
+
}
|
|
74595
|
+
function Ze5(t2) {
|
|
74596
|
+
let e20 = [];
|
|
74597
|
+
function r44(b4) {
|
|
74598
|
+
let d = b4.target;
|
|
74599
|
+
if (!d || d.nodeType !== 1) return;
|
|
74600
|
+
let u3 = t2.appFor(d);
|
|
74601
|
+
if (u3) {
|
|
74602
|
+
d.hasAttribute("persist") && !Ct6(d) && nt6(d);
|
|
74603
|
+
for (let E4 of e20) if (E4(d, u3)) return;
|
|
74604
|
+
t2.schedule(u3, b4.type + " " + (d.id || d.tagName.toLowerCase()));
|
|
74307
74605
|
}
|
|
74308
74606
|
}
|
|
74309
|
-
function
|
|
74310
|
-
|
|
74311
|
-
|
|
74312
|
-
|
|
74313
|
-
|
|
74314
|
-
|
|
74315
|
-
|
|
74316
|
-
let x6 = Z7(u3.getAttribute("step")) || 1, L7 = c3.key === "ArrowUp" ? 1 : -1, C5 = Z7(u3.value) + x6 * (c3.shiftKey ? 10 : 1) * L7, R5 = u3.getAttribute("min"), F5 = u3.getAttribute("max");
|
|
74317
|
-
R5 !== null && R5 !== "" && C5 < Z7(R5) && (C5 = Z7(R5)), F5 !== null && F5 !== "" && C5 > Z7(F5) && (C5 = Z7(F5)), G5(u3).write(String(Number(C5.toFixed(2))));
|
|
74607
|
+
function n3(b4) {
|
|
74608
|
+
let d = b4.target, u3 = t2.appFor(d);
|
|
74609
|
+
u3 && setTimeout(() => {
|
|
74610
|
+
d.querySelectorAll("[bind]").forEach((E4) => {
|
|
74611
|
+
E4.dispatchEvent(new Event("input", { bubbles: true })), E4.dispatchEvent(new Event("change", { bubbles: true }));
|
|
74612
|
+
}), t2.schedule(u3, "reset");
|
|
74613
|
+
}, 0);
|
|
74318
74614
|
}
|
|
74319
|
-
function
|
|
74320
|
-
|
|
74615
|
+
function o3(b4) {
|
|
74616
|
+
let d = t2.appFor(b4.target);
|
|
74617
|
+
d && t2.schedule(d, "toggle");
|
|
74321
74618
|
}
|
|
74322
|
-
|
|
74323
|
-
|
|
74324
|
-
|
|
74325
|
-
|
|
74326
|
-
|
|
74327
|
-
|
|
74328
|
-
|
|
74329
|
-
let e20 = 0;
|
|
74330
|
-
for (let r44 of t2.querySelectorAll("*")) for (let n3 of r44.attributes) if (hn4.test(n3.name)) {
|
|
74331
|
-
e20++;
|
|
74332
|
-
break;
|
|
74619
|
+
function s2(b4) {
|
|
74620
|
+
let d = b4.detail || {};
|
|
74621
|
+
for (let u3 of [d.from, d.to, b4.target]) {
|
|
74622
|
+
if (!u3 || u3.nodeType !== 1) continue;
|
|
74623
|
+
let E4 = t2.appFor(u3);
|
|
74624
|
+
E4 && t2.schedule(E4, "sorted");
|
|
74625
|
+
}
|
|
74333
74626
|
}
|
|
74334
|
-
|
|
74335
|
-
|
|
74336
|
-
|
|
74627
|
+
function a2(b4) {
|
|
74628
|
+
if (b4.key !== "ArrowUp" && b4.key !== "ArrowDown") return;
|
|
74629
|
+
let d = b4.target;
|
|
74630
|
+
if (!d || d.nodeType !== 1 || d.tagName !== "INPUT" || !d.hasAttribute("bind") || !d.hasAttribute("step")) return;
|
|
74631
|
+
let u3 = (d.getAttribute("type") || "text").toLowerCase();
|
|
74632
|
+
if (u3 !== "text" && u3 !== "tel" && u3 !== "search" || !t2.appFor(d)) return;
|
|
74633
|
+
b4.preventDefault();
|
|
74634
|
+
let S4 = P7(d.getAttribute("step")) || 1, k5 = b4.key === "ArrowUp" ? 1 : -1, _4 = P7(d.value) + S4 * (b4.shiftKey ? 10 : 1) * k5, h = d.getAttribute("min"), A4 = d.getAttribute("max");
|
|
74635
|
+
h !== null && h !== "" && _4 < P7(h) && (_4 = P7(h)), A4 !== null && A4 !== "" && _4 > P7(A4) && (_4 = P7(A4)), R5(d).write(String(Number(_4.toFixed(2))));
|
|
74337
74636
|
}
|
|
74338
|
-
|
|
74637
|
+
function g2(b4 = document) {
|
|
74638
|
+
b4.addEventListener("reset", n3), b4.addEventListener("toggle", o3, true), b4.addEventListener("input", r44), b4.addEventListener("change", r44), b4.addEventListener("clay:sorted", s2), b4.addEventListener("keydown", a2);
|
|
74639
|
+
}
|
|
74640
|
+
return { install: g2, addRouter: (b4) => e20.push(b4) };
|
|
74641
|
+
}
|
|
74642
|
+
function tn3(t2) {
|
|
74643
|
+
let e20 = t2.toLowerCase();
|
|
74644
|
+
return /^x-text$|^x-html$/.test(e20) ? 'use text="state.x" (Sap paints text only)' : /^x-show$|^v-show$|^v-if$/.test(e20) ? 'use show="expr" (toggles native hidden)' : /^x-model$|^v-model$/.test(e20) ? 'use bind="field"' : /^@|^x-on:|^v-on:|^on:/.test(e20) ? "use native onclick + Sap(this) (no event directive)" : /^:|^x-bind:class$|^v-bind:class$/.test(e20) ? 'use class:NAME="expr" or attr:NAME="expr"' : /^x-for$|^v-for$/.test(e20) ? 'use items="name" on the container and item template on the row' : /^x-data$/.test(e20) ? "declare state with state= / bind / items (no JS state object)" : /^x-init$/.test(e20) ? "use a <script> or onclick + Sap(this)" : /^bind:/.test(e20) ? 'use bind="field"; one-way paint is attr:NAME="expr"' : /^x-/.test(e20) || /^v-/.test(e20) ? "this is a foreign-dialect attribute; Sap has no x-/v- attributes" : null;
|
|
74339
74645
|
}
|
|
74340
|
-
function
|
|
74646
|
+
function en3(t2) {
|
|
74341
74647
|
let e20 = [], r44 = (n3) => {
|
|
74342
74648
|
for (let o3 of n3.attributes) {
|
|
74343
74649
|
let s2 = o3.name;
|
|
@@ -74348,186 +74654,286 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
74348
74654
|
for (let n3 of t2.querySelectorAll("*")) r44(n3);
|
|
74349
74655
|
return e20;
|
|
74350
74656
|
}
|
|
74351
|
-
function
|
|
74352
|
-
function e20(
|
|
74353
|
-
|
|
74354
|
-
|
|
74355
|
-
|
|
74356
|
-
|
|
74357
|
-
|
|
74358
|
-
|
|
74359
|
-
|
|
74360
|
-
|
|
74361
|
-
|
|
74362
|
-
|
|
74363
|
-
|
|
74364
|
-
|
|
74365
|
-
|
|
74366
|
-
|
|
74367
|
-
|
|
74368
|
-
}
|
|
74369
|
-
}
|
|
74370
|
-
function s2() {
|
|
74371
|
-
let l2 = [], w4 = [];
|
|
74372
|
-
for (let N16 of t2.apps()) l2.push(...N16.diag.errors), w4.push(...N16.diag.warnings);
|
|
74373
|
-
return { ok: l2.length === 0, errors: l2, warnings: w4, counts: { errors: l2.length, warnings: w4.length } };
|
|
74374
|
-
}
|
|
74375
|
-
function a2(l2) {
|
|
74376
|
-
return l2 ? typeof l2 == "string" ? document.querySelector(l2) : l2.nodeType === 1 ? l2 : null : null;
|
|
74377
|
-
}
|
|
74378
|
-
function k5(l2, w4) {
|
|
74379
|
-
let N16 = a2(l2);
|
|
74380
|
-
if (!N16) return console.warn("sap why: element not found"), null;
|
|
74381
|
-
let P7 = [`sap why <${N16.tagName.toLowerCase()}> \u2014 ${Ot5(N16)}`], z5 = [...N16.attributes].filter((d) => /^(bind|text|show|effect|invalid|detail|calc:|text:|attr:|class:|css:|set:|state|items|scope)/.test(d.name));
|
|
74382
|
-
for (let d of z5) P7.push(` ${d.name}="${d.value}"`);
|
|
74383
|
-
let m4 = N16;
|
|
74384
|
-
for (; m4 && !m4._sapScope; ) m4 = m4.parentElement;
|
|
74385
|
-
if (m4 && m4._sapScope) {
|
|
74386
|
-
let d = m4._sapScope, p3 = w4 ? [w4] : Object.keys(d);
|
|
74387
|
-
P7.push(" reads:");
|
|
74388
|
-
for (let y4 of p3) {
|
|
74389
|
-
let E4 = d[y4];
|
|
74390
|
-
typeof E4 != "function" && P7.push(` ${y4} = ${JSON.stringify(Array.isArray(E4) ? `[${E4.length} rows]` : E4)}`);
|
|
74657
|
+
function nn2(t2) {
|
|
74658
|
+
function e20(o3) {
|
|
74659
|
+
return o3 ? typeof o3 == "string" ? document.querySelector(o3) : o3.nodeType === 1 ? o3 : null : null;
|
|
74660
|
+
}
|
|
74661
|
+
function r44(o3, s2) {
|
|
74662
|
+
let a2 = e20(o3);
|
|
74663
|
+
if (!a2) return console.warn("sap why: element not found"), null;
|
|
74664
|
+
let g2 = [`sap why <${a2.tagName.toLowerCase()}> \u2014 ${yt6(a2)}`], b4 = [...a2.attributes].filter((u3) => /^(bind|text|show|effect|invalid|detail|calc:|text:|attr:|class:|css:|set:|state|items|scope)/.test(u3.name));
|
|
74665
|
+
for (let u3 of b4) g2.push(` ${u3.name}="${u3.value}"`);
|
|
74666
|
+
let d = a2;
|
|
74667
|
+
for (; d && !d._sapScope; ) d = d.parentElement;
|
|
74668
|
+
if (d && d._sapScope) {
|
|
74669
|
+
let u3 = d._sapScope, E4 = s2 ? [s2] : Object.keys(u3);
|
|
74670
|
+
g2.push(" reads:");
|
|
74671
|
+
for (let S4 of E4) {
|
|
74672
|
+
let k5 = u3[S4];
|
|
74673
|
+
typeof k5 != "function" && g2.push(` ${S4} = ${JSON.stringify(Array.isArray(k5) ? `[${k5.length} rows]` : k5)}`);
|
|
74391
74674
|
}
|
|
74392
74675
|
}
|
|
74393
|
-
return
|
|
74676
|
+
return g2.push(" serialization: textContent and value/checked attributes save with the file; reads live from properties"), console.log(g2.join(`
|
|
74394
74677
|
`)), null;
|
|
74395
74678
|
}
|
|
74396
|
-
function
|
|
74397
|
-
let
|
|
74398
|
-
for (let
|
|
74399
|
-
|
|
74400
|
-
|
|
74401
|
-
|
|
74402
|
-
|
|
74403
|
-
|
|
74404
|
-
let
|
|
74405
|
-
|
|
74406
|
-
let
|
|
74407
|
-
|
|
74408
|
-
|
|
74409
|
-
for (let
|
|
74410
|
-
w4
|
|
74411
|
-
|
|
74412
|
-
|
|
74413
|
-
let
|
|
74414
|
-
for (let
|
|
74415
|
-
|
|
74416
|
-
w4
|
|
74417
|
-
|
|
74418
|
-
for (let
|
|
74419
|
-
|
|
74420
|
-
|
|
74421
|
-
for (let c3 of bn4(p3)) c3.src.length > 120 && l2.push({ code: "I33", severity: "info", message: `${y4}: ${c3.attr} expression is ${c3.src.length} chars; consider a calc: field` });
|
|
74422
|
-
w4++;
|
|
74423
|
-
for (let c3 of p3.querySelectorAll("[text], [text\\:num]")) {
|
|
74424
|
-
let u3 = c3.textContent || "";
|
|
74425
|
-
/\.\d{5,}/.test(u3) && l2.push({ code: "I33", severity: "info", message: `${y4}: ${Ot5(c3)} paints >4 decimals; consider text:FMT` });
|
|
74679
|
+
function n3() {
|
|
74680
|
+
let o3 = [], s2 = 0;
|
|
74681
|
+
for (let u3 of t2.apps()) {
|
|
74682
|
+
let E4 = u3.root, S4 = It6(E4);
|
|
74683
|
+
s2++;
|
|
74684
|
+
let k5 = new K7(u3.name);
|
|
74685
|
+
Pt5(E4, k5);
|
|
74686
|
+
for (let w4 of k5.errors) o3.push({ code: w4.code, severity: "error", message: `${S4}: ${w4.code} ${w4.slug} at ${w4.el}` });
|
|
74687
|
+
for (let w4 of k5.warnings) o3.push({ code: w4.code, severity: "warn", message: `${S4}: ${w4.code} ${w4.slug} at ${w4.el}` });
|
|
74688
|
+
s2++, it6(u3, { trigger: "doctor-dryrun" });
|
|
74689
|
+
let _4 = u3._stats ? u3._stats.writes : 0;
|
|
74690
|
+
_4 > 0 && o3.push({ code: "W30", severity: "warn", message: `${S4}: dry recompute wrote ${_4} cells on a quiet page; an element is stale or non-idempotent` }), s2++;
|
|
74691
|
+
let h = en3(E4).map((w4) => w4.src).join(" \0 "), A4 = [];
|
|
74692
|
+
for (let w4 of [E4, ...E4.querySelectorAll("[state]")]) for (let v5 of C5(w4.getAttribute("state") || "")) A4.push(v5.name);
|
|
74693
|
+
for (let w4 of A4) new RegExp(`(state|item)\\.${w4}\\b`).test(h) || o3.push({ code: "I33", severity: "info", message: `${S4}: field "${w4}" is declared but read nowhere (dead state)` });
|
|
74694
|
+
s2++;
|
|
74695
|
+
let p3 = /* @__PURE__ */ new Map();
|
|
74696
|
+
for (let w4 of E4.querySelectorAll("[id]")) p3.set(w4.id, (p3.get(w4.id) || 0) + 1);
|
|
74697
|
+
for (let [w4, v5] of p3) v5 > 1 && o3.push({ code: "W32", severity: "warn", message: `${S4}: duplicate id "${w4}" (${v5} elements) \u2014 clone/edit collision` });
|
|
74698
|
+
s2++;
|
|
74699
|
+
for (let w4 of en3(E4)) w4.src.length > 120 && o3.push({ code: "I33", severity: "info", message: `${S4}: ${w4.attr} expression is ${w4.src.length} chars; consider a calc: field` });
|
|
74700
|
+
s2++;
|
|
74701
|
+
for (let w4 of E4.querySelectorAll("[text], [text\\:num]")) {
|
|
74702
|
+
let v5 = w4.textContent || "";
|
|
74703
|
+
/\.\d{5,}/.test(v5) && o3.push({ code: "I33", severity: "info", message: `${S4}: ${yt6(w4)} paints >4 decimals; consider text:FMT` });
|
|
74426
74704
|
}
|
|
74427
74705
|
}
|
|
74428
|
-
let
|
|
74429
|
-
console.log(`sap doctor \xB7 ${t2.apps().map((
|
|
74430
|
-
for (let
|
|
74431
|
-
return
|
|
74706
|
+
let a2 = o3.filter((u3) => u3.severity === "error").length, g2 = o3.filter((u3) => u3.severity === "warn").length, b4 = o3.filter((u3) => u3.severity === "info").length;
|
|
74707
|
+
console.log(`sap doctor \xB7 ${t2.apps().map((u3) => It6(u3.root)).join(", ")} \xB7 errors ${a2} \xB7 warnings ${g2} \xB7 info ${b4} \xB7 ${s2} checks \xB7 0ms`);
|
|
74708
|
+
for (let u3 of o3) (u3.severity === "error" ? console.error : u3.severity === "warn" ? console.warn : console.info)(` ${u3.severity === "error" ? "\u2717" : u3.severity === "warn" ? "\u26A0" : "\xB7"} ${u3.message}`);
|
|
74709
|
+
return o3;
|
|
74432
74710
|
}
|
|
74433
|
-
return {
|
|
74711
|
+
return { why: r44, doctor: n3 };
|
|
74434
74712
|
}
|
|
74435
|
-
|
|
74436
|
-
|
|
74437
|
-
|
|
74438
|
-
|
|
74439
|
-
|
|
74440
|
-
|
|
74441
|
-
|
|
74442
|
-
}
|
|
74443
|
-
return
|
|
74713
|
+
function ir4(t2, e20) {
|
|
74714
|
+
let r44 = String(t2).split("."), n3 = (s2) => {
|
|
74715
|
+
for (let a2 of r44) {
|
|
74716
|
+
if (s2 == null) return;
|
|
74717
|
+
s2 = Array.isArray(s2) ? s2.flatMap((g2) => g2 && g2[a2] != null ? g2[a2] : []) : s2[a2];
|
|
74718
|
+
}
|
|
74719
|
+
return s2;
|
|
74720
|
+
}, o3 = n3(e20.state);
|
|
74721
|
+
return o3 === void 0 ? n3(e20.root) : o3;
|
|
74444
74722
|
}
|
|
74445
|
-
function
|
|
74446
|
-
|
|
74447
|
-
|
|
74448
|
-
|
|
74723
|
+
function sr4(t2, e20, r44, n3) {
|
|
74724
|
+
e20._sapScope = r44;
|
|
74725
|
+
let o3 = e20.getAttribute("detail") || "", s2 = /^([\w.]+)\s+by\s+(.+)$/.exec(o3);
|
|
74726
|
+
if (!s2) {
|
|
74727
|
+
e20.hidden = true, e20._sapDetailRow = null;
|
|
74728
|
+
return;
|
|
74729
|
+
}
|
|
74730
|
+
let a2 = s2[1], g2 = s2[2].trim(), b4 = ir4(a2, n3), d;
|
|
74731
|
+
try {
|
|
74732
|
+
d = Y5(N16(g2), { state: r44, item: n3.item, el: e20, root: n3.root });
|
|
74733
|
+
} catch {
|
|
74734
|
+
d = void 0;
|
|
74449
74735
|
}
|
|
74736
|
+
let u3 = Array.isArray(b4) && d != null ? b4.find((S4) => S4 && typeof S4 == "object" && S4.$el && String(S4.$key) === String(d)) : null;
|
|
74737
|
+
if (e20._sapDetailRow = u3 ? u3.$el : null, e20.tagName === "DIALOG") {
|
|
74738
|
+
let S4 = u3 ? String(u3.$key) : null;
|
|
74739
|
+
if (S4 !== e20._sapDetailKey && (e20._sapDetailKey = S4, e20._sapDismissed = false), !u3) {
|
|
74740
|
+
e20._sapOpenedFor = null, e20.open && typeof e20.close == "function" && (e20._sapEngineClose = true, e20.close());
|
|
74741
|
+
return;
|
|
74742
|
+
}
|
|
74743
|
+
e20.open ? e20._sapOpenedFor = S4 : (e20._sapOpenedFor === S4 && (e20._sapDismissed = true), e20._sapOpenedFor = null, !e20._sapDismissed && e20.isConnected && typeof e20.showModal == "function" && (e20.hidden && (e20.hidden = false), e20.showModal(), e20._sapOpenedFor = S4));
|
|
74744
|
+
} else {
|
|
74745
|
+
if (!u3) {
|
|
74746
|
+
e20.hidden || (e20.hidden = true);
|
|
74747
|
+
return;
|
|
74748
|
+
}
|
|
74749
|
+
e20.hidden && (e20.hidden = false);
|
|
74750
|
+
}
|
|
74751
|
+
Nt4();
|
|
74752
|
+
let E4 = { root: n3.root, state: r44, item: u3, ownerEl: u3.$el, projection: true };
|
|
74753
|
+
t2.collectEl(e20, q7(e20), E4), t2.walkScope(e20, u3, E4);
|
|
74754
|
+
}
|
|
74755
|
+
var rn3 = { name: "detail", begin(t2) {
|
|
74756
|
+
t2.deferredDetails = [];
|
|
74757
|
+
}, boundary: { detail(t2, e20, r44, n3, o3) {
|
|
74758
|
+
for (let s2 of C5(e20.getAttribute("state") || "")) s2.name in n3 || (n3[s2.name] = G5(e20, s2) ? e20.hasAttribute(s2.attr) : t2.resolveDefault(e20, s2));
|
|
74759
|
+
t2.deferredDetails.push({ el: e20, parentObj: n3, ctx: o3 });
|
|
74760
|
+
} }, afterIntake(t2) {
|
|
74761
|
+
for (let e20 = 0; e20 < t2.deferredDetails.length; e20++) {
|
|
74762
|
+
let { el: r44, parentObj: n3, ctx: o3 } = t2.deferredDetails[e20];
|
|
74763
|
+
sr4(t2, r44, n3, o3);
|
|
74764
|
+
}
|
|
74765
|
+
} };
|
|
74766
|
+
function on4(t2) {
|
|
74767
|
+
let e20 = 0, r44 = t2;
|
|
74768
|
+
for (; r44 && !(r44.hasAttribute && r44.hasAttribute("sap")); ) r44 = r44.parentElement, e20++;
|
|
74769
|
+
return e20;
|
|
74450
74770
|
}
|
|
74451
|
-
|
|
74452
|
-
|
|
74453
|
-
|
|
74771
|
+
var sn3 = { name: "calc", begin(t2) {
|
|
74772
|
+
t2.calcs = [];
|
|
74773
|
+
}, collect(t2, e20, r44, n3) {
|
|
74774
|
+
if (!r44.calcs) return;
|
|
74775
|
+
let o3 = n3.item || n3.state;
|
|
74776
|
+
for (let s2 of r44.calcs) t2.calcs.push({ owner: o3, ownerEl: n3.ownerEl, name: s2.name, entry: s2.entry, def: s2, el: e20, ctx: n3 });
|
|
74777
|
+
}, compute(t2) {
|
|
74778
|
+
let e20 = t2.app, r44 = /* @__PURE__ */ new Map();
|
|
74779
|
+
for (let o3 of t2.calcs) {
|
|
74780
|
+
let s2 = r44.get(o3.owner);
|
|
74781
|
+
s2 || (s2 = { ownerEl: o3.ownerEl, list: [] }, r44.set(o3.owner, s2)), s2.list.push(o3);
|
|
74782
|
+
}
|
|
74783
|
+
let n3 = [...r44.values()].sort((o3, s2) => on4(s2.ownerEl) - on4(o3.ownerEl));
|
|
74784
|
+
for (let o3 of n3) {
|
|
74785
|
+
let s2;
|
|
74786
|
+
try {
|
|
74787
|
+
s2 = be5(o3.list);
|
|
74788
|
+
} catch (a2) {
|
|
74789
|
+
e20.diag.error("E07", o3.list[0].el, { problem: a2.message }), s2 = o3.list;
|
|
74790
|
+
}
|
|
74791
|
+
for (let a2 of s2) try {
|
|
74792
|
+
a2.owner[a2.name] = I5(a2.entry, a2.ctx.state, a2.ctx.item, a2.el, a2.ctx.root), Q6(a2.el);
|
|
74793
|
+
} catch (g2) {
|
|
74794
|
+
a2.owner[a2.name] = void 0, e20.diag.error("E24", a2.el, { attr: "calc:" + a2.name, expr: a2.entry.src, problem: String(g2.message) }), M6(a2.el, g2.sapCode || "E24");
|
|
74795
|
+
}
|
|
74796
|
+
}
|
|
74797
|
+
t2.stats.calcs = t2.calcs.length, t2.stats.lists = r44.size;
|
|
74798
|
+
} };
|
|
74799
|
+
function ar4(t2, e20, r44) {
|
|
74800
|
+
let n3 = r44.nextSibling;
|
|
74801
|
+
if (e20.isConnected && t2.moveBefore) try {
|
|
74802
|
+
t2.moveBefore(e20, n3);
|
|
74454
74803
|
return;
|
|
74455
74804
|
} catch {
|
|
74456
74805
|
}
|
|
74457
|
-
t2.
|
|
74806
|
+
t2.insertBefore(e20, n3);
|
|
74458
74807
|
}
|
|
74459
|
-
function
|
|
74460
|
-
let
|
|
74461
|
-
|
|
74462
|
-
|
|
74463
|
-
|
|
74464
|
-
|
|
74808
|
+
function ur4(t2, e20, r44) {
|
|
74809
|
+
for (let n3 = e20.parentElement; n3; n3 = n3.parentElement) if (n3._sapScope === r44 && !n3.hasAttribute("detail") || n3.hasAttribute("sap")) return n3;
|
|
74810
|
+
return t2;
|
|
74811
|
+
}
|
|
74812
|
+
function cr4(t2, e20, r44) {
|
|
74813
|
+
let n3 = t2.app;
|
|
74814
|
+
e20._sapDrawnEl = ur4(t2.root, e20, r44.state);
|
|
74815
|
+
let o3 = null;
|
|
74816
|
+
for (let h = e20.firstElementChild; h; h = h.nextElementSibling) if (h.tagName === "TEMPLATE") {
|
|
74817
|
+
o3 = h;
|
|
74818
|
+
break;
|
|
74819
|
+
}
|
|
74820
|
+
let s2 = o3 && o3.content.children.length === 1 ? o3.content.firstElementChild : null;
|
|
74821
|
+
if (!s2) return n3.diag.error("E42", e20, { attr: "each", problem: "each needs one <template> child with exactly one element root" }), 0;
|
|
74822
|
+
let a2 = e20.getAttribute("each"), g2;
|
|
74823
|
+
try {
|
|
74824
|
+
g2 = Y5(N16(a2), { state: r44.state, item: r44.item, el: e20, root: r44.root });
|
|
74825
|
+
} catch (h) {
|
|
74826
|
+
return n3.diag.error("E24", e20, { attr: "each", expr: a2, problem: String(h.message) }), 0;
|
|
74827
|
+
}
|
|
74828
|
+
if (!Array.isArray(g2)) return n3.diag.error("E40", e20, { attr: "each", expr: a2, problem: "each must evaluate to an array; the list keeps its last good rows" }), 0;
|
|
74829
|
+
let b4 = N16(e20.getAttribute("key") || "item.$key"), d = [], u3 = /* @__PURE__ */ new Set();
|
|
74830
|
+
for (let h of g2) {
|
|
74831
|
+
let A4;
|
|
74832
|
+
try {
|
|
74833
|
+
A4 = I5(b4, r44.state, h, e20, r44.root);
|
|
74465
74834
|
} catch {
|
|
74835
|
+
A4 = void 0;
|
|
74466
74836
|
}
|
|
74467
|
-
|
|
74837
|
+
let p3 = A4 == null ? "" : String(A4);
|
|
74838
|
+
if (p3 === "" || u3.has(p3)) return n3.diag.error("E41", e20, { attr: "key", expr: b4.src, problem: p3 === "" ? "an item has no key; the list keeps its last good rows" : `duplicate key "${p3}"; the list keeps its last good rows` }), 0;
|
|
74839
|
+
u3.add(p3), d.push(p3);
|
|
74840
|
+
}
|
|
74841
|
+
let E4 = e20._sapEach || /* @__PURE__ */ new Map(), S4 = /* @__PURE__ */ new Map(), k5 = 0, _4 = o3;
|
|
74842
|
+
d.forEach((h, A4) => {
|
|
74843
|
+
let p3 = E4.get(h);
|
|
74844
|
+
if (!p3 || p3.parentElement !== e20) {
|
|
74845
|
+
p3 = e20.ownerDocument.importNode(s2, true);
|
|
74846
|
+
let w4 = (p3.getAttribute("clay") || "").split(/\s+/).filter(Boolean);
|
|
74847
|
+
w4.includes("editor-ui") || p3.setAttribute("clay", [...w4, "editor-ui"].join(" ")), p3._sapEachRow = true, k5++;
|
|
74848
|
+
}
|
|
74849
|
+
p3.getAttribute("data-key") !== h && p3.setAttribute("data-key", h), _4.nextElementSibling !== p3 && (ar4(e20, p3, _4), k5++), p3._sapEachItem = g2[A4], S4.set(h, p3), _4 = p3;
|
|
74850
|
+
});
|
|
74851
|
+
for (let [h, A4] of E4) S4.get(h) !== A4 && A4.parentElement === e20 && (A4.remove(), k5++);
|
|
74852
|
+
return e20._sapEach = S4, Nt4(), d.forEach((h, A4) => {
|
|
74853
|
+
let p3 = S4.get(h), w4 = { root: r44.root, state: r44.state, item: g2[A4], ownerEl: p3, projection: false, view: true };
|
|
74854
|
+
t2.collectEl(p3, q7(p3), w4), t2.walkScope(p3, {}, w4);
|
|
74855
|
+
}), k5;
|
|
74856
|
+
}
|
|
74857
|
+
var an3 = { name: "each", begin(t2) {
|
|
74858
|
+
t2.eachList = [];
|
|
74859
|
+
}, boundary: { each(t2, e20, r44, n3, o3) {
|
|
74860
|
+
t2.collectEl(e20, r44, o3), t2.eachList.push({ el: e20, ctx: o3 });
|
|
74861
|
+
} }, reconcile(t2) {
|
|
74862
|
+
let e20 = 0;
|
|
74863
|
+
for (let r44 = 0; r44 < t2.eachList.length; r44++) e20 += cr4(t2, t2.eachList[r44].el, t2.eachList[r44].ctx);
|
|
74864
|
+
return e20;
|
|
74865
|
+
} };
|
|
74866
|
+
function fr4(t2, e20) {
|
|
74867
|
+
try {
|
|
74868
|
+
I5(t2.def.entry, t2.ctx.state, t2.ctx.item, t2.el, t2.ctx.root), Q6(t2.el);
|
|
74869
|
+
} catch (r44) {
|
|
74870
|
+
e20.diag.error("E24", t2.el, { attr: "effect", expr: t2.def.entry && t2.def.entry.src, problem: String(r44.message) }), M6(t2.el, "E24");
|
|
74468
74871
|
}
|
|
74469
74872
|
}
|
|
74470
|
-
var
|
|
74471
|
-
|
|
74472
|
-
|
|
74473
|
-
|
|
74474
|
-
|
|
74475
|
-
|
|
74476
|
-
|
|
74477
|
-
|
|
74478
|
-
|
|
74479
|
-
|
|
74480
|
-
|
|
74873
|
+
var un4 = { name: "effect", begin(t2) {
|
|
74874
|
+
t2.effects = [];
|
|
74875
|
+
}, collect(t2, e20, r44, n3) {
|
|
74876
|
+
if (r44.effects) for (let o3 of r44.effects) t2.effects.push({ def: o3, el: e20, ctx: n3 });
|
|
74877
|
+
}, afterPaint(t2) {
|
|
74878
|
+
for (let e20 of t2.effects) fr4(e20, t2.app);
|
|
74879
|
+
} };
|
|
74880
|
+
function lr4(t2) {
|
|
74881
|
+
let e20 = "";
|
|
74882
|
+
try {
|
|
74883
|
+
let r44 = I5(t2.def.entry, t2.ctx.state, t2.ctx.item, t2.el, t2.ctx.root);
|
|
74884
|
+
e20 = typeof r44 == "string" ? r44 : "";
|
|
74885
|
+
} catch {
|
|
74886
|
+
e20 = "";
|
|
74481
74887
|
}
|
|
74482
|
-
|
|
74483
|
-
|
|
74484
|
-
|
|
74888
|
+
typeof t2.el.setCustomValidity == "function" && t2.el.setCustomValidity(e20);
|
|
74889
|
+
}
|
|
74890
|
+
var cn3 = { name: "validation", begin(t2) {
|
|
74891
|
+
t2.invalids = [];
|
|
74892
|
+
}, collect(t2, e20, r44, n3) {
|
|
74893
|
+
if (r44.invalids) for (let o3 of r44.invalids) t2.invalids.push({ def: o3, el: e20, ctx: n3 });
|
|
74894
|
+
}, afterPaint(t2) {
|
|
74895
|
+
for (let e20 of t2.invalids) lr4(e20);
|
|
74896
|
+
} };
|
|
74897
|
+
function fn4(t2, e20) {
|
|
74898
|
+
if (t2 === t2.ownerDocument.activeElement) return 0;
|
|
74899
|
+
if (t2.type === "radio") {
|
|
74900
|
+
let s2 = e20 != null && String(t2.value) === String(e20);
|
|
74901
|
+
return t2.checked === s2 ? 0 : (t2.checked = s2, 1);
|
|
74485
74902
|
}
|
|
74486
|
-
|
|
74903
|
+
let r44 = ht6(t2), n3 = Rt6(t2, r44), o3 = e20 ?? "";
|
|
74904
|
+
return String(n3) !== String(o3) ? (Re6(t2, r44, o3), 1) : 0;
|
|
74487
74905
|
}
|
|
74488
|
-
|
|
74489
|
-
if (
|
|
74490
|
-
let
|
|
74491
|
-
|
|
74492
|
-
|
|
74493
|
-
let
|
|
74494
|
-
|
|
74495
|
-
|
|
74496
|
-
|
|
74497
|
-
|
|
74498
|
-
|
|
74499
|
-
|
|
74500
|
-
|
|
74501
|
-
for (let
|
|
74502
|
-
};
|
|
74503
|
-
O4.batch = Xe6;
|
|
74504
|
-
O4.status = st6.status;
|
|
74505
|
-
O4.report = st6.report;
|
|
74506
|
-
O4.why = st6.why;
|
|
74507
|
-
O4.debug = st6.debug;
|
|
74508
|
-
O4.doctor = st6.doctor;
|
|
74509
|
-
O4.greenLine = st6.greenLine;
|
|
74510
|
-
O4.formats = At5;
|
|
74511
|
-
O4.serializeControlToAttributes = xt6;
|
|
74512
|
-
O4.finalizeControlForSave = je6;
|
|
74513
|
-
O4.rehydrateControlFromAttributes = Yt5;
|
|
74514
|
-
O4.mount = vn4;
|
|
74515
|
-
O4.config = function(e20 = {}) {
|
|
74516
|
-
return e20.formats && Object.assign(At5, e20.formats), O4;
|
|
74517
|
-
};
|
|
74518
|
-
O4._registry = tt6;
|
|
74519
|
-
O4._reset = function() {
|
|
74520
|
-
tt6.clear(), it6.length = 0, nn2();
|
|
74521
|
-
};
|
|
74522
|
-
function vr4() {
|
|
74523
|
-
if (typeof document > "u") return;
|
|
74524
|
-
let t2 = () => Ge6(() => te6());
|
|
74525
|
-
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", t2) : t2();
|
|
74906
|
+
var ln3 = { name: "projection", collect(t2, e20, r44, n3) {
|
|
74907
|
+
if (!(r44.bind != null && (n3.view || n3.projection) && !vt5(e20))) return;
|
|
74908
|
+
let o3 = r44.bind, s2 = t2.paints;
|
|
74909
|
+
n3.view ? tt6(oe6(n3.item), o3) ? (e20._sapViewBind = "item", s2.push({ def: { kind: "projection", field: o3, from: "item" }, el: e20, ctx: n3 })) : o3 in n3.state || o3 in n3.root ? (e20._sapViewBind = "drawn", s2.push({ def: { kind: "projection", field: o3, from: "drawn" }, el: e20, ctx: n3 })) : (e20._sapViewBind = null, t2.app.diag.error("E43", e20, { attr: "bind", expr: o3, problem: `bind="${o3}" inside an each row matches no field of the row's record or of the scope the row is drawn in`, fix: "bind a field the record owns (bind, state= or items= on the [item]), or declare it with state= where the list is drawn" })) : s2.push({ def: { kind: "projection", field: o3, from: null }, el: e20, ctx: n3 });
|
|
74910
|
+
}, paintKinds: { projection(t2) {
|
|
74911
|
+
let e20 = t2.def;
|
|
74912
|
+
if (e20.from === "drawn") {
|
|
74913
|
+
let r44 = e20.field in t2.ctx.state ? t2.ctx.state : t2.ctx.root;
|
|
74914
|
+
return fn4(t2.el, r44[e20.field]);
|
|
74915
|
+
}
|
|
74916
|
+
return fn4(t2.el, t2.ctx.item ? t2.ctx.item[e20.field] : "");
|
|
74917
|
+
} } };
|
|
74918
|
+
function dn3() {
|
|
74919
|
+
for (let t2 of [rn3, sn3, an3, un4, cn3, ln3]) Oe6(t2);
|
|
74526
74920
|
}
|
|
74527
|
-
|
|
74528
|
-
|
|
74529
|
-
|
|
74530
|
-
|
|
74921
|
+
dn3();
|
|
74922
|
+
qe6((t2, e20, r44) => {
|
|
74923
|
+
for (let n3 of t2.attributes) {
|
|
74924
|
+
let o3 = tn3(n3.name);
|
|
74925
|
+
o3 && (e20("E01", t2, { attr: n3.name, expr: n3.value, problem: `"${n3.name}" is a foreign-dialect attribute; Sap has no ${n3.name.split(/[:=]/)[0]} directive`, fix: o3 + " \u2014 or wrap the subtree in sap-ignore if intentional" }), r44(n3.name));
|
|
74926
|
+
}
|
|
74927
|
+
});
|
|
74928
|
+
var { Sap: Mt6, mountAll: pn4, mount: dr4, runtime: pr4 } = Ye6({ createAccessor: Je6, debugExtras: nn2, installInput(t2, e20, r44) {
|
|
74929
|
+
let n3 = Ze5(t2), o3 = Qe6(t2, e20);
|
|
74930
|
+
n3.addRouter(o3.routeInput), n3.install(r44), o3.install(r44);
|
|
74931
|
+
} }), bt6 = typeof window < "u" ? window.Sap : null;
|
|
74932
|
+
bt6 && bt6 !== Mt6 && bt6.core && typeof bt6.unmount == "function" && bt6.unmount();
|
|
74933
|
+
Xe6(pn4);
|
|
74934
|
+
typeof window < "u" && (window.Sap = Mt6);
|
|
74935
|
+
var mr4 = Mt6;
|
|
74936
|
+
return yn4(hr4);
|
|
74531
74937
|
})();
|
|
74532
74938
|
if (typeof window !== "undefined" && Sap && Sap.default) window.Sap = Sap.default;
|
|
74533
74939
|
var sapDefault = Sap.default;
|
|
@@ -75852,7 +76258,10 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
75852
76258
|
// verify is sent as the ordinary full serialization, so the floor is the behaviour
|
|
75853
76259
|
// it replaces. `exclude=source` turns it off.
|
|
75854
76260
|
source: { path: "plugins/source.js", editOnly: true, default: true },
|
|
75855
|
-
"visitor-drafts": { path: "plugins/visitor-drafts.js", editOnly: false, default: false }
|
|
76261
|
+
"visitor-drafts": { path: "plugins/visitor-drafts.js", editOnly: false, default: false },
|
|
76262
|
+
// The sapjs core. Loaded for any page with a [sap] root at boot (resolveModules'
|
|
76263
|
+
// hasSap), in view mode too: a reader's tab paints the same totals.
|
|
76264
|
+
derive: { path: "plugins/derive.js", editOnly: false, default: false }
|
|
75856
76265
|
};
|
|
75857
76266
|
var MODULES = {
|
|
75858
76267
|
"core/is-edit-mode.js": () => Promise.resolve().then(() => (init_is_edit_mode(), is_edit_mode_exports)),
|
|
@@ -75892,10 +76301,11 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
75892
76301
|
"plugins/ai-edit.js": () => Promise.resolve().then(() => (init_ai_edit(), ai_edit_exports)),
|
|
75893
76302
|
"plugins/demo.js": () => Promise.resolve().then(() => (init_demo(), demo_exports)),
|
|
75894
76303
|
"plugins/visitor-drafts.js": () => Promise.resolve().then(() => (init_visitor_drafts(), visitor_drafts_exports)),
|
|
75895
|
-
"plugins/source.js": () => Promise.resolve().then(() => (init_source2(), source_exports))
|
|
76304
|
+
"plugins/source.js": () => Promise.resolve().then(() => (init_source2(), source_exports)),
|
|
76305
|
+
"plugins/derive.js": () => Promise.resolve().then(() => (init_derive(), derive_exports))
|
|
75896
76306
|
};
|
|
75897
|
-
var PLUGIN_ORDER = ["visitor-drafts", "richclay", "indicator", "sortable", "undo", "quickcrop", "upload", "people", "cms", "sync", "live", "page", "message", "wire", "ai-edit", "demo", "source"];
|
|
75898
|
-
var IMPLIES = { cms: ["quickcrop", "upload"], "ai-edit": ["wire"], page: ["live", "sync"] };
|
|
76307
|
+
var PLUGIN_ORDER = ["visitor-drafts", "richclay", "indicator", "sortable", "undo", "quickcrop", "upload", "people", "cms", "sync", "live", "page", "message", "wire", "ai-edit", "demo", "derive", "source"];
|
|
76308
|
+
var IMPLIES = { cms: ["quickcrop", "upload"], "ai-edit": ["wire"], page: ["live", "sync", "upload"] };
|
|
75899
76309
|
function parseCsv2(params, key2, enabled, apply2) {
|
|
75900
76310
|
const raw = params.get(key2);
|
|
75901
76311
|
if (!raw) return;
|
|
@@ -75911,7 +76321,7 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
75911
76321
|
}
|
|
75912
76322
|
var DRAFT_DROPS = ["sync", "live", "page", "upload", "quickcrop", "cms", "people", "wire", "ai-edit", "demo", "source"];
|
|
75913
76323
|
var DRAFT_DROPS_CORE = ["attrs/refetch-on-save.js"];
|
|
75914
|
-
function resolveModules(params, isEditMode2, { isDraftMode: isDraftMode2 = false } = {}) {
|
|
76324
|
+
function resolveModules(params, isEditMode2, { isDraftMode: isDraftMode2 = false, hasSap = false } = {}) {
|
|
75915
76325
|
const core = [...CORE_WAVES.always];
|
|
75916
76326
|
if (isEditMode2) core.push(...CORE_WAVES.editOnly);
|
|
75917
76327
|
const explicit = /* @__PURE__ */ new Set();
|
|
@@ -75922,6 +76332,7 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
75922
76332
|
for (const [name, spec] of Object.entries(PLUGIN_PATHS)) {
|
|
75923
76333
|
if (spec.default) enabled.add(name);
|
|
75924
76334
|
}
|
|
76335
|
+
if (hasSap) enabled.add("derive");
|
|
75925
76336
|
if (excluded2.has("wire")) enabled.delete("ai-edit");
|
|
75926
76337
|
for (const name of [...enabled]) {
|
|
75927
76338
|
if (excluded2.has(name)) continue;
|
|
@@ -76063,6 +76474,8 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
76063
76474
|
|
|
76064
76475
|
// src/loader.js
|
|
76065
76476
|
init_style();
|
|
76477
|
+
init_derived();
|
|
76478
|
+
init_boot_phase();
|
|
76066
76479
|
function domReady() {
|
|
76067
76480
|
return new Promise((resolve) => dom_ready_default(resolve));
|
|
76068
76481
|
}
|
|
@@ -76076,7 +76489,9 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
76076
76489
|
window.__hyperclayEditMode = isEditMode2;
|
|
76077
76490
|
const regionPolicy = await MODULES["lib/region-policy.js"]();
|
|
76078
76491
|
const { isDraftMode: isDraftMode2 } = editMode;
|
|
76079
|
-
const
|
|
76492
|
+
const hasSap = Boolean(document.querySelector("[sap]"));
|
|
76493
|
+
bootPhase.holdSettle = hasSap && isEditMode2;
|
|
76494
|
+
const plan = resolveModules(params, isEditMode2, { isDraftMode: isDraftMode2, hasSap });
|
|
76080
76495
|
const loaded = {};
|
|
76081
76496
|
for (const path of plan.core) {
|
|
76082
76497
|
loaded[path] = await MODULES[path]();
|
|
@@ -76094,10 +76509,28 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
76094
76509
|
attachPluginMember(path, mod, loaded);
|
|
76095
76510
|
}
|
|
76096
76511
|
await Promise.allSettled(plan.plugins.map((path) => loaded[path]?.ready).filter(Boolean));
|
|
76512
|
+
if (hasSap) mountDerivedEngine(loaded);
|
|
76097
76513
|
installViewModeNotice(isEditMode2);
|
|
76098
76514
|
readyResolve(window.clay);
|
|
76099
76515
|
document.dispatchEvent(new CustomEvent("clay:ready", { detail: { clay: window.clay } }));
|
|
76100
76516
|
}
|
|
76517
|
+
function mountDerivedEngine(loaded) {
|
|
76518
|
+
const save = loaded["core/save.js"];
|
|
76519
|
+
let fileSignature = null;
|
|
76520
|
+
try {
|
|
76521
|
+
fileSignature = save ? save.currentPaintSignature() : null;
|
|
76522
|
+
} catch (err) {
|
|
76523
|
+
console.error("clayjs: could not read the page's painted values:", err);
|
|
76524
|
+
}
|
|
76525
|
+
try {
|
|
76526
|
+
if (window.Sap && typeof window.Sap.mount === "function") window.Sap.mount();
|
|
76527
|
+
} catch (err) {
|
|
76528
|
+
console.error("clayjs: the derive engine failed to mount:", err);
|
|
76529
|
+
} finally {
|
|
76530
|
+
save?.releaseBootSettle();
|
|
76531
|
+
}
|
|
76532
|
+
if (save && fileSignature != null) save.schedulePaintHeal(fileSignature);
|
|
76533
|
+
}
|
|
76101
76534
|
function assembleCore(loaded, { isDraftMode: isDraftMode2, isEditMode: isEditMode2, isOwner: isOwner2, siteVisibility: siteVisibility2 }, regionPolicy) {
|
|
76102
76535
|
const clay5 = window.clay;
|
|
76103
76536
|
const mutation = loaded["lib/mutation.js"];
|
|
@@ -76119,6 +76552,7 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
76119
76552
|
clay5.readData = pageData2.readData;
|
|
76120
76553
|
clay5.writeData = pageData2.writeData;
|
|
76121
76554
|
clay5.ephemeral = ephemeral;
|
|
76555
|
+
clay5.derived = derived;
|
|
76122
76556
|
clay5.effect = effect;
|
|
76123
76557
|
clay5.style = style2;
|
|
76124
76558
|
if (save) {
|
|
@@ -76212,9 +76646,9 @@ ${t2}` : `"use strict"; return (${t2});`;
|
|
|
76212
76646
|
if (started3[name]) return;
|
|
76213
76647
|
started3[name] = true;
|
|
76214
76648
|
var wait = function() {
|
|
76215
|
-
var
|
|
76216
|
-
return
|
|
76217
|
-
if (clay5.ready ===
|
|
76649
|
+
var ready6 = clay5.ready;
|
|
76650
|
+
return ready6.then(fn4, function(err) {
|
|
76651
|
+
if (clay5.ready === ready6) throw err;
|
|
76218
76652
|
return wait();
|
|
76219
76653
|
});
|
|
76220
76654
|
};
|