taggedjs 2.4.2 → 2.4.12
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/bundle.js +3612 -0
- package/bundle.js.map +1 -0
- package/index.js +1 -1
- package/js/Subject.d.ts +3 -4
- package/js/Subject.js +4 -4
- package/js/Subject.js.map +1 -1
- package/js/Tag.class.d.ts +25 -17
- package/js/Tag.class.js +208 -78
- package/js/Tag.class.js.map +1 -1
- package/js/Tag.utils.d.ts +13 -13
- package/js/Tag.utils.js +2 -18
- package/js/Tag.utils.js.map +1 -1
- package/js/TagSupport.class.d.ts +15 -14
- package/js/TagSupport.class.js +24 -46
- package/js/TagSupport.class.js.map +1 -1
- package/js/TemplaterResult.class.d.ts +36 -0
- package/js/TemplaterResult.class.js +73 -0
- package/js/TemplaterResult.class.js.map +1 -0
- package/js/ValueSubject.d.ts +4 -2
- package/js/ValueSubject.js +1 -1
- package/js/ValueSubject.js.map +1 -1
- package/js/alterProps.function.d.ts +4 -0
- package/js/alterProps.function.js +45 -0
- package/js/alterProps.function.js.map +1 -0
- package/js/bindSubjectCallback.function 9.27.33/342/200/257AM.js" +32 -0
- package/js/bindSubjectCallback.function.d 9.27.33/342/200/257AM.ts" +8 -0
- package/js/bindSubjectCallback.function.d.ts +3 -4
- package/js/bindSubjectCallback.function.js +20 -8
- package/js/bindSubjectCallback.function.js.map +1 -1
- package/js/checkDestroyPrevious.function.d.ts +6 -0
- package/js/checkDestroyPrevious.function.js +62 -0
- package/js/checkDestroyPrevious.function.js.map +1 -0
- package/js/destroyTag.function.d.ts +5 -0
- package/js/destroyTag.function.js +18 -0
- package/js/destroyTag.function.js.map +1 -0
- package/js/elementInitCheck.d.ts +1 -1
- package/js/getCallback.d.ts +1 -1
- package/js/getCallback.js +16 -15
- package/js/getCallback.js.map +1 -1
- package/js/hasTagSupportChanged.function.d.ts +6 -6
- package/js/hasTagSupportChanged.function.js +30 -21
- package/js/hasTagSupportChanged.function.js.map +1 -1
- package/js/html.d.ts +1 -1
- package/js/html.js +1 -1
- package/js/html.js.map +1 -1
- package/js/index.d.ts +22 -27
- package/js/index.js +26 -27
- package/js/index.js.map +1 -1
- package/js/interpolateAttributes.d.ts +2 -3
- package/js/interpolateAttributes.js +1 -127
- package/js/interpolateAttributes.js.map +1 -1
- package/js/interpolateContentTemplates.d.ts +9 -6
- package/js/interpolateContentTemplates.js +18 -28
- package/js/interpolateContentTemplates.js.map +1 -1
- package/js/interpolateElement.d.ts +7 -6
- package/js/interpolateElement.js +13 -10
- package/js/interpolateElement.js.map +1 -1
- package/js/interpolateTemplate.d.ts +22 -7
- package/js/interpolateTemplate.js +65 -27
- package/js/interpolateTemplate.js.map +1 -1
- package/js/isInstance.d.ts +3 -4
- package/js/isInstance.js.map +1 -1
- package/js/isLikeTags.function.d.ts +2 -0
- package/js/isLikeTags.function.js +30 -0
- package/js/isLikeTags.function.js.map +1 -0
- package/js/onDestroy.js +3 -3
- package/js/onDestroy.js.map +1 -1
- package/js/onInit.js +6 -4
- package/js/onInit.js.map +1 -1
- package/js/processAttribute.function.d.ts +3 -0
- package/js/processAttribute.function.js +122 -0
- package/js/processAttribute.function.js.map +1 -0
- package/js/processNewValue.function.d.ts +2 -2
- package/js/processNewValue.function.js +13 -15
- package/js/processNewValue.function.js.map +1 -1
- package/js/processRegularValue.function.d.ts +5 -7
- package/js/processRegularValue.function.js +10 -17
- package/js/processRegularValue.function.js.map +1 -1
- package/js/processSubjectComponent.function.d.ts +6 -6
- package/js/processSubjectComponent.function.js +30 -22
- package/js/processSubjectComponent.function.js.map +1 -1
- package/js/processSubjectValue.function.d.ts +17 -14
- package/js/processSubjectValue.function.js +55 -79
- package/js/processSubjectValue.function.js.map +1 -1
- package/js/processTagArray.d.ts +9 -8
- package/js/processTagArray.js +36 -37
- package/js/processTagArray.js.map +1 -1
- package/js/processTagResult.function.d.ts +7 -8
- package/js/processTagResult.function.js +40 -17
- package/js/processTagResult.function.js.map +1 -1
- package/js/provider.utils.d.ts +1 -1
- package/js/provider.utils.js +19 -8
- package/js/provider.utils.js.map +1 -1
- package/js/providers.js +6 -6
- package/js/providers.js.map +1 -1
- package/js/redrawTag.function.d.ts +5 -8
- package/js/redrawTag.function.js +16 -4
- package/js/redrawTag.function.js.map +1 -1
- package/js/render.d.ts +1 -1
- package/js/render.js.map +1 -1
- package/js/renderExistingTag.function.d.ts +7 -0
- package/js/renderExistingTag.function.js +30 -0
- package/js/renderExistingTag.function.js.map +1 -0
- package/js/renderTagSupport.function.d.ts +4 -0
- package/js/renderTagSupport.function.js +42 -0
- package/js/renderTagSupport.function.js.map +1 -0
- package/js/scanTextAreaValue.function.d.ts +2 -0
- package/js/scanTextAreaValue.function.js +16 -0
- package/js/scanTextAreaValue.function.js.map +1 -0
- package/js/set.function.d.ts +4 -3
- package/js/set.function.js +25 -34
- package/js/set.function.js.map +1 -1
- package/js/setLet.function.d.ts +1 -1
- package/js/setLet.function.js +14 -3
- package/js/setLet.function.js.map +1 -1
- package/js/setProp.function.d.ts +1 -1
- package/js/setProp.function.js +6 -3
- package/js/setProp.function.js.map +1 -1
- package/js/setUse.function.d.ts +11 -11
- package/js/tag.d.ts +6 -4
- package/js/tag.js +78 -71
- package/js/tag.js.map +1 -1
- package/js/tagElement.d.ts +5 -7
- package/js/tagElement.js +20 -31
- package/js/tagElement.js.map +1 -1
- package/js/tagRunner.d.ts +6 -6
- package/js/tagRunner.js +1 -1
- package/js/tagRunner.js.map +1 -1
- package/js/templater.utils.d.ts +23 -12
- package/js/templater.utils.js +55 -40
- package/js/templater.utils.js.map +1 -1
- package/js/updateExistingTag.function.d.ts +4 -4
- package/js/updateExistingTag.function.js +16 -7
- package/js/updateExistingTag.function.js.map +1 -1
- package/js/updateExistingTagComponent.function.d.ts +4 -4
- package/js/updateExistingTagComponent.function.js +105 -39
- package/js/updateExistingTagComponent.function.js.map +1 -1
- package/js/updateExistingValue.function.d.ts +8 -10
- package/js/updateExistingValue.function.js +62 -89
- package/js/updateExistingValue.function.js.map +1 -1
- package/js/watch.function.js +4 -3
- package/js/watch.function.js.map +1 -1
- package/package.json +1 -2
- package/js/CustomError.d.ts +0 -7
- package/js/CustomError.js +0 -9
- package/js/CustomError.js.map +0 -1
- package/js/ElementTarget.interface.d.ts +0 -7
- package/js/ElementTarget.interface.js +0 -2
- package/js/ElementTarget.interface.js.map +0 -1
- package/js/Errors2.d.ts +0 -14
- package/js/Errors2.js +0 -21
- package/js/Errors2.js.map +0 -1
- package/js/gateway/gateway.web.component.d.ts +0 -11
- package/js/gateway/gateway.web.component.js +0 -20
- package/js/gateway/gateway.web.component.js.map +0 -1
- package/js/gateway/index.d.ts +0 -3
- package/js/gateway/index.js +0 -4
- package/js/gateway/index.js.map +0 -1
- package/js/gateway/loadTagGateway.function.d.ts +0 -2
- package/js/gateway/loadTagGateway.function.js +0 -18
- package/js/gateway/loadTagGateway.function.js.map +0 -1
- package/js/gateway/tagGateway.function.d.ts +0 -5
- package/js/gateway/tagGateway.function.js +0 -49
- package/js/gateway/tagGateway.function.js.map +0 -1
- package/js/gateway/tagGateway.utils.d.ts +0 -22
- package/js/gateway/tagGateway.utils.js +0 -137
- package/js/gateway/tagGateway.utils.js.map +0 -1
- package/js/getTagSupport.d.ts +0 -20
- package/js/getTagSupport.js +0 -114
- package/js/getTagSupport.js.map +0 -1
- package/js/renderAppToElement.d.ts +0 -14
- package/js/renderAppToElement.js +0 -57
- package/js/renderAppToElement.js.map +0 -1
- package/js/state.d.ts +0 -22
- package/js/state.js +0 -128
- package/js/state.js.map +0 -1
- package/js/tagGateway.function.d.ts +0 -14
- package/js/tagGateway.function.js +0 -138
- package/js/tagGateway.function.js.map +0 -1
- package/js/updateTag.utils.d.ts +0 -8
- package/js/updateTag.utils.js +0 -83
- package/js/updateTag.utils.js.map +0 -1
- package/taggedjs.js +0 -1
- /package/js/{Errors.d.ts → errors.d.ts} +0 -0
- /package/js/{Errors.js → errors.js} +0 -0
- /package/js/{Errors.js.map → errors.js.map} +0 -0
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { runAfterRender, runBeforeRedraw } from
|
|
1
|
+
import { runAfterRender, runBeforeRedraw } from './tagRunner';
|
|
2
2
|
export function updateExistingTag(templater, ogTag, existingSubject) {
|
|
3
|
+
if (!templater.tagSupport) {
|
|
4
|
+
throw new Error('start clone tag support here');
|
|
5
|
+
}
|
|
6
|
+
console.log('redraw templater!!!!', { wrapp: templater.wrapper?.original });
|
|
7
|
+
templater.render();
|
|
8
|
+
return;
|
|
3
9
|
const tagSupport = ogTag.tagSupport;
|
|
4
|
-
const oldest =
|
|
5
|
-
const newest =
|
|
6
|
-
runBeforeRedraw(oldest.tagSupport, newest || oldest)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
const oldest = templater.global.oldest;
|
|
11
|
+
const newest = templater.global.newest;
|
|
12
|
+
// runBeforeRedraw(oldest.tagSupport, newest || oldest)
|
|
13
|
+
runBeforeRedraw(oldest.tagSupport, oldest);
|
|
14
|
+
const wrapTagSupport = tagSupport; // newest.tagSupport || tagSupport
|
|
15
|
+
// const retag = templater.wrapper(wrapTagSupport)
|
|
16
|
+
const retag = templater.wrapper(wrapTagSupport);
|
|
17
|
+
templater.global.newest = retag;
|
|
10
18
|
runAfterRender(oldest.tagSupport, oldest);
|
|
11
19
|
ogTag.updateByTag(retag);
|
|
20
|
+
// oldest.updateByTag(retag)
|
|
12
21
|
existingSubject.set(templater);
|
|
13
22
|
return [];
|
|
14
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateExistingTag.function.js","sourceRoot":"","sources":["../ts/updateExistingTag.function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateExistingTag.function.js","sourceRoot":"","sources":["../ts/updateExistingTag.function.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAG7D,MAAM,UAAU,iBAAiB,CAC/B,SAA0B,EAC1B,KAAU,EACV,eAA2B;IAE3B,IAAG,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;IACjD,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAC,KAAK,EAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAC,CAAC,CAEvE;IAAC,SAAiB,CAAC,MAAM,EAAE,CAAA;IAC5B,OAAM;IAEN,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAA;IACnC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,MAAa,CAAA;IAC7C,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,MAAa,CAAA;IAE7C,uDAAuD;IACvD,eAAe,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IAE1C,MAAM,cAAc,GAAG,UAAU,CAAA,CAAC,kCAAkC;IAEpE,kDAAkD;IAClD,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IAE/C,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAA;IAE/B,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IACzC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IACxB,4BAA4B;IAE5B,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAE9B,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TagSubject } from
|
|
2
|
-
import {
|
|
3
|
-
import { Tag } from
|
|
4
|
-
export declare function updateExistingTagComponent(
|
|
1
|
+
import { TagSubject } from './Tag.utils';
|
|
2
|
+
import { TemplaterResult } from './TemplaterResult.class';
|
|
3
|
+
import { Tag } from './Tag.class';
|
|
4
|
+
export declare function updateExistingTagComponent(ownerTag: Tag, templater: TemplaterResult, subject: TagSubject, insertBefore: Element | Text): void;
|
|
@@ -1,56 +1,122 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
setValueRedraw(tempResult, existingSubject, tag);
|
|
11
|
-
tempResult.redraw();
|
|
12
|
-
return;
|
|
1
|
+
import { hasTagSupportChanged } from './hasTagSupportChanged.function';
|
|
2
|
+
import { processSubjectComponent } from './processSubjectComponent.function';
|
|
3
|
+
import { destroyTagMemory } from './destroyTag.function';
|
|
4
|
+
import { renderTagSupport } from './renderTagSupport.function';
|
|
5
|
+
export function updateExistingTagComponent(ownerTag, templater, subject, insertBefore) {
|
|
6
|
+
let existingTag = subject.tag;
|
|
7
|
+
/*
|
|
8
|
+
if(existingTag && !existingTag.hasLiveElements) {
|
|
9
|
+
throw new Error('issue already began')
|
|
13
10
|
}
|
|
14
|
-
|
|
11
|
+
*/
|
|
15
12
|
const oldWrapper = existingTag.tagSupport.templater.wrapper;
|
|
16
|
-
const newWrapper =
|
|
13
|
+
const newWrapper = templater.wrapper;
|
|
17
14
|
let isSameTag = false;
|
|
15
|
+
if (templater.global.oldest && !templater.global.oldest.hasLiveElements) {
|
|
16
|
+
throw new Error('88893434');
|
|
17
|
+
}
|
|
18
18
|
if (oldWrapper && newWrapper) {
|
|
19
19
|
const oldFunction = oldWrapper.original;
|
|
20
20
|
const newFunction = newWrapper.original;
|
|
21
21
|
isSameTag = oldFunction === newFunction;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
const oldTagSupport = existingTag.tagSupport;
|
|
24
|
+
const oldGlobal = oldTagSupport.templater.global;
|
|
25
|
+
const globalInsert = oldGlobal.insertBefore;
|
|
26
|
+
const oldInsertBefore = globalInsert?.parentNode ? globalInsert : insertBefore;
|
|
27
|
+
if (!oldInsertBefore.parentNode) {
|
|
28
|
+
throw new Error('stop here no parent node update existing tag');
|
|
29
|
+
}
|
|
26
30
|
if (!isSameTag) {
|
|
27
|
-
destroyTagMemory(
|
|
31
|
+
destroyTagMemory(oldTagSupport.templater.global.oldest, subject);
|
|
32
|
+
processSubjectComponent(templater, subject, oldInsertBefore, ownerTag, {
|
|
33
|
+
forceElement: false,
|
|
34
|
+
counts: { added: 0, removed: 0 },
|
|
35
|
+
});
|
|
36
|
+
return;
|
|
28
37
|
}
|
|
29
38
|
else {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (!isTagInstance(subjectTagSupport.props)) {
|
|
35
|
-
oldCloneProps = deepClone(subjectTagSupport.props);
|
|
39
|
+
const newTagSupport = templater.tagSupport;
|
|
40
|
+
const hasChanged = hasTagSupportChanged(oldTagSupport, newTagSupport, templater);
|
|
41
|
+
if (!hasChanged) {
|
|
42
|
+
return; // its the same tag component
|
|
36
43
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
}
|
|
45
|
+
const oldestTag = templater.global.oldest; // oldTagSupport.oldest as Tag // existingTag
|
|
46
|
+
const previous = templater.global.newest;
|
|
47
|
+
if (!previous || !oldestTag) {
|
|
48
|
+
throw new Error('how no previous or oldest nor newest?');
|
|
49
|
+
}
|
|
50
|
+
const newTag = renderTagSupport(templater.tagSupport, false);
|
|
51
|
+
existingTag = subject.tag;
|
|
52
|
+
const newOldest = newTag.tagSupport.templater.global.oldest;
|
|
53
|
+
const hasOldest = newOldest ? true : false;
|
|
54
|
+
if (!hasOldest) {
|
|
55
|
+
return buildNewTag(newTag, oldInsertBefore, oldTagSupport, subject);
|
|
56
|
+
}
|
|
57
|
+
if (newOldest && templater.children.value.length) {
|
|
58
|
+
const oldKidsSub = newOldest.tagSupport.templater.children;
|
|
59
|
+
oldKidsSub.set(templater.children.value);
|
|
60
|
+
}
|
|
61
|
+
// const newTag = tempResult.newest as Tag
|
|
62
|
+
if (previous && !oldestTag) {
|
|
63
|
+
throw new Error('bad elders');
|
|
64
|
+
}
|
|
65
|
+
// detect if both the function is the same and the return is the same
|
|
66
|
+
const isLikeTag = isSameTag && previous.isLikeTag(newTag);
|
|
67
|
+
if (previous && !oldestTag) {
|
|
68
|
+
throw new Error('bad elders');
|
|
69
|
+
}
|
|
70
|
+
let oldest = oldTagSupport.templater.global.oldest;
|
|
71
|
+
if (isLikeTag) {
|
|
72
|
+
if (!newTag.tagSupport.templater.global.oldest) {
|
|
73
|
+
throw new Error('maybe 6');
|
|
43
74
|
}
|
|
75
|
+
subject.tag = newTag;
|
|
76
|
+
oldestTag.updateByTag(newTag); // the oldest tag has element references
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
// Although function looked the same it returned a different html result
|
|
81
|
+
if (isSameTag && existingTag) {
|
|
82
|
+
destroyTagMemory(existingTag, subject);
|
|
83
|
+
newTag.tagSupport.templater.global.context = {}; // do not share previous outputs
|
|
84
|
+
}
|
|
85
|
+
oldest = undefined;
|
|
86
|
+
}
|
|
87
|
+
if (!oldest) {
|
|
88
|
+
buildNewTag(newTag, oldTagSupport.templater.global.insertBefore, oldTagSupport, subject);
|
|
89
|
+
}
|
|
90
|
+
oldTagSupport.templater.global.newest = newTag;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
function checkStateChanged(state) {
|
|
94
|
+
return !state.newest.every(state => {
|
|
95
|
+
const lastValue = state.lastValue;
|
|
96
|
+
const nowValue = state.get();
|
|
97
|
+
const matched = lastValue === nowValue;
|
|
98
|
+
if (matched) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function buildNewTag(newTag, oldInsertBefore, oldTagSupport, subject) {
|
|
105
|
+
newTag.buildBeforeElement(oldInsertBefore, {
|
|
106
|
+
forceElement: true,
|
|
107
|
+
counts: { added: 0, removed: 0 }, test: false,
|
|
108
|
+
});
|
|
109
|
+
newTag.tagSupport.templater.global.oldest = newTag;
|
|
110
|
+
newTag.tagSupport.templater.global.newest = newTag;
|
|
111
|
+
oldTagSupport.templater.global.oldest = newTag;
|
|
112
|
+
oldTagSupport.templater.global.newest = newTag;
|
|
113
|
+
if (!newTag.tagSupport.templater.global.oldest) {
|
|
114
|
+
throw new Error('maybe 5');
|
|
115
|
+
}
|
|
116
|
+
subject.tag = newTag;
|
|
117
|
+
if (!newTag.hasLiveElements) {
|
|
118
|
+
throw new Error('44444 - 5');
|
|
44
119
|
}
|
|
45
|
-
setValueRedraw(tempResult, existingSubject, tag);
|
|
46
|
-
oldTagSetup.templater = tempResult;
|
|
47
|
-
const redraw = tempResult.redraw();
|
|
48
|
-
/*
|
|
49
|
-
// ???
|
|
50
|
-
const redraw = tempResult.redraw() as Tag
|
|
51
|
-
existingSubject.value.tag = oldTagSetup.newest = redraw
|
|
52
|
-
*/
|
|
53
|
-
oldTagSetup.propsConfig = { ...tempResult.tagSupport.propsConfig };
|
|
54
120
|
return;
|
|
55
121
|
}
|
|
56
122
|
//# sourceMappingURL=updateExistingTagComponent.function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateExistingTagComponent.function.js","sourceRoot":"","sources":["../ts/updateExistingTagComponent.function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateExistingTagComponent.function.js","sourceRoot":"","sources":["../ts/updateExistingTagComponent.function.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAE9D,MAAM,UAAU,0BAA0B,CACxC,QAAa,EACb,SAA0B,EAC1B,OAAmB,EACnB,YAA4B;IAE5B,IA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
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
type
|
|
8
|
-
export declare function updateExistingValue(
|
|
9
|
-
export declare function destroyTagMemory(existingTag: Tag, existingSubject: TagSubject): void;
|
|
10
|
-
export {};
|
|
1
|
+
import { TagSupport } from './TagSupport.class';
|
|
2
|
+
import { Subject } from './Subject';
|
|
3
|
+
import { TemplaterResult } from './TemplaterResult.class';
|
|
4
|
+
import { Tag } from './Tag.class';
|
|
5
|
+
import { InterpolateSubject } from './processSubjectValue.function';
|
|
6
|
+
import { RegularValue } from './processRegularValue.function';
|
|
7
|
+
export type ExistingValue = TemplaterResult | Tag[] | TagSupport | Function | Subject<unknown> | RegularValue | Tag;
|
|
8
|
+
export declare function updateExistingValue(subject: InterpolateSubject, value: ExistingValue, ownerTag: Tag, insertBefore: Element | Text): InterpolateSubject;
|
|
@@ -1,112 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { processTagArray } from
|
|
5
|
-
import { updateExistingTagComponent } from
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
// no longer a tag
|
|
29
|
-
if (!isTagInstance(value)) {
|
|
30
|
-
destroyTagMemory(existingTag, existingTagSubject);
|
|
31
|
-
return;
|
|
1
|
+
import { TagSupport } from './TagSupport.class';
|
|
2
|
+
import { isSubjectInstance, isTagArray, isTagComponent, isTagInstance } from './isInstance';
|
|
3
|
+
import { applyFakeTemplater, processTag } from './processSubjectValue.function';
|
|
4
|
+
import { processTagArray } from './processTagArray';
|
|
5
|
+
import { updateExistingTagComponent } from './updateExistingTagComponent.function';
|
|
6
|
+
import { processRegularValue } from './processRegularValue.function';
|
|
7
|
+
import { checkDestroyPrevious } from './checkDestroyPrevious.function';
|
|
8
|
+
import { processSubjectComponent } from './processSubjectComponent.function';
|
|
9
|
+
import { isLikeTags } from './isLikeTags.function';
|
|
10
|
+
import { bindSubjectCallback } from './bindSubjectCallback.function';
|
|
11
|
+
export function updateExistingValue(subject, value, ownerTag, insertBefore) {
|
|
12
|
+
const subjectTag = subject;
|
|
13
|
+
const isComponent = isTagComponent(value);
|
|
14
|
+
const oldInsertBefore = subject.template || subjectTag.tag?.tagSupport.templater.global.insertBefore || subject.clone;
|
|
15
|
+
checkDestroyPrevious(subject, value);
|
|
16
|
+
// handle already seen tag components
|
|
17
|
+
if (isComponent) {
|
|
18
|
+
const templater = value;
|
|
19
|
+
// When was something before component
|
|
20
|
+
if (!subjectTag.tag) {
|
|
21
|
+
processSubjectComponent(templater, subjectTag, oldInsertBefore, ownerTag, {
|
|
22
|
+
forceElement: true,
|
|
23
|
+
counts: { added: 0, removed: 0 },
|
|
24
|
+
});
|
|
25
|
+
return subjectTag;
|
|
32
26
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
destroySimpleValue(displaySubject.template, displaySubject);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export function updateExistingValue(existing, value, ownerTag) {
|
|
43
|
-
const subjectValue = existing.value;
|
|
44
|
-
const tempResult = value;
|
|
45
|
-
const existingSubArray = existing;
|
|
46
|
-
const existingSubTag = existing;
|
|
47
|
-
checkDestroyPrevious(existing, value);
|
|
48
|
-
// If we are working with tag component 2nd argument children, the value has to be digged
|
|
49
|
-
if (existingSubArray.isChildSubject) {
|
|
50
|
-
value = value.value; // A subject contains the value
|
|
27
|
+
templater.tagSupport = new TagSupport(
|
|
28
|
+
// subjectTag.tag.tagSupport.ownerTagSupport,
|
|
29
|
+
ownerTag.tagSupport, templater, subjectTag);
|
|
30
|
+
updateExistingTagComponent(ownerTag, templater, // latest value
|
|
31
|
+
subjectTag, insertBefore);
|
|
32
|
+
return subjectTag;
|
|
51
33
|
}
|
|
52
34
|
// was component but no longer
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
handleStillTag(
|
|
56
|
-
return;
|
|
35
|
+
const tag = subjectTag.tag;
|
|
36
|
+
if (tag) {
|
|
37
|
+
handleStillTag(tag, subject, value, ownerTag);
|
|
38
|
+
return subjectTag;
|
|
57
39
|
}
|
|
58
40
|
// its another tag array
|
|
59
41
|
if (isTagArray(value)) {
|
|
60
|
-
|
|
61
|
-
processTagArray(existing, value, insertBefore, ownerTag, { counts: {
|
|
42
|
+
processTagArray(subject, value, oldInsertBefore, ownerTag, { counts: {
|
|
62
43
|
added: 0,
|
|
63
44
|
removed: 0,
|
|
64
45
|
} });
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
// handle already seen tag components
|
|
68
|
-
if (isTagComponent(tempResult)) {
|
|
69
|
-
return updateExistingTagComponent(ownerTag, tempResult, existingSubTag, subjectValue);
|
|
46
|
+
return subject;
|
|
70
47
|
}
|
|
71
48
|
// now its a function
|
|
72
49
|
if (value instanceof Function) {
|
|
73
|
-
|
|
74
|
-
|
|
50
|
+
// const newSubject = getSubjectFunction(value, ownerTag)
|
|
51
|
+
const bound = bindSubjectCallback(value, ownerTag);
|
|
52
|
+
subject.set(bound);
|
|
53
|
+
return subject;
|
|
54
|
+
}
|
|
55
|
+
if (isTagInstance(value)) {
|
|
56
|
+
subjectTag.template = oldInsertBefore;
|
|
57
|
+
processTag(value, subjectTag, subjectTag.template, ownerTag);
|
|
58
|
+
return subjectTag;
|
|
75
59
|
}
|
|
76
60
|
// we have been given a subject
|
|
77
61
|
if (isSubjectInstance(value)) {
|
|
78
|
-
|
|
79
|
-
return;
|
|
62
|
+
return value;
|
|
80
63
|
}
|
|
81
|
-
|
|
82
|
-
|
|
64
|
+
// This will cause all other values to render
|
|
65
|
+
processRegularValue(value, subject, oldInsertBefore);
|
|
66
|
+
return subjectTag;
|
|
83
67
|
}
|
|
84
|
-
function handleStillTag(existingTag,
|
|
85
|
-
const oldWrapper = existingTag.tagSupport.templater.wrapper;
|
|
86
|
-
const newWrapper = value?.wrapper;
|
|
87
|
-
const wrapMatch = oldWrapper && newWrapper && oldWrapper?.original === newWrapper?.original;
|
|
68
|
+
function handleStillTag(existingTag, subject, value, ownerTag) {
|
|
88
69
|
// TODO: We shouldn't need both of these
|
|
89
|
-
const isSameTag = value && existingTag
|
|
70
|
+
const isSameTag = value && isLikeTags(existingTag, value);
|
|
90
71
|
const isSameTag2 = value && value.getTemplate && existingTag.isLikeTag(value);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
counts: {
|
|
95
|
-
added: 0,
|
|
96
|
-
removed: 0,
|
|
97
|
-
}
|
|
98
|
-
});
|
|
72
|
+
const tag = value;
|
|
73
|
+
if (!tag.tagSupport) {
|
|
74
|
+
applyFakeTemplater(tag, ownerTag, subject);
|
|
99
75
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
76
|
+
if (isSameTag) {
|
|
77
|
+
existingTag.updateByTag(tag);
|
|
78
|
+
return;
|
|
102
79
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
delete existingSubject.tag;
|
|
108
|
-
delete existingSubject.tagSupport;
|
|
109
|
-
// delete subjectValue.tagSupport
|
|
110
|
-
existingTag.destroy();
|
|
80
|
+
if (isSameTag || isSameTag2) {
|
|
81
|
+
return processTag(value, subject, subject.template, ownerTag);
|
|
82
|
+
}
|
|
83
|
+
return processRegularValue(value, subject, subject.template);
|
|
111
84
|
}
|
|
112
85
|
//# sourceMappingURL=updateExistingValue.function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateExistingValue.function.js","sourceRoot":"","sources":["../ts/updateExistingValue.function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateExistingValue.function.js","sourceRoot":"","sources":["../ts/updateExistingValue.function.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE3F,OAAO,EAAsB,kBAAkB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AACnG,OAAO,EAAmB,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAA;AAClF,OAAO,EAAgB,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAY,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAI9E,MAAM,UAAU,mBAAmB,CACjC,OAA2B,EAC3B,KAAoB,EACpB,QAAa,EACb,YAA4B;IAE5B,MAAM,UAAU,GAAG,OAAqB,CAAA;IACxC,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;IACzC,MAAM,eAAe,GAAI,OAA0B,CAAC,QAAQ,IAAI,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,IAAK,OAA0B,CAAC,KAAK,CAAA;IAE7J,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAEpC,qCAAqC;IACrC,IAAG,WAAW,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,KAAwB,CAAA;QAE1C,sCAAsC;QACtC,IAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;YACnB,uBAAuB,CAC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UAAU,EACV,UAAU,CAAC,QAAQ,EACnB,QAAQ,CACT,CAAA;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;IAED,+BAA+B;IAC/B,IAAG,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,KAA0B,CAAA;IACnC,CAAC;IAED,6CAA6C;IAC7C,mBAAmB,CACjB,KAAqB,EACrB,OAAyB,EACzB,eAAe,CAChB,CAAA;IAED,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,SAAS,cAAc,CACrB,WAAgB,EAChB,OAA2B,EAC3B,KAA2C,EAC3C,QAAa;IAEb,wCAAwC;IACxC,MAAM,SAAS,GAAG,KAAK,IAAI,UAAU,CAAC,WAAW,EAAE,KAAY,CAAC,CAAA;IAChE,MAAM,UAAU,GAAG,KAAK,IAAK,KAAa,CAAC,WAAW,IAAI,WAAW,CAAC,SAAS,CAAC,KAAY,CAAC,CAAA;IAE7F,MAAM,GAAG,GAAG,KAAY,CAAA;IAExB,IAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;QACnB,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAqB,CAAC,CAAA;IAC1D,CAAC;IAED,IAAG,SAAS,EAAE,CAAC;QACb,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;QAC5B,OAAM;IACR,CAAC;IAED,IAAG,SAAS,IAAI,UAAU,EAAE,CAAC;QAC3B,OAAO,UAAU,CACf,KAAY,EACZ,OAAqB,EACpB,OAAsB,CAAC,QAAQ,EAChC,QAAQ,CACT,CAAA;IACH,CAAC;IAED,OAAO,mBAAmB,CACxB,KAAqB,EACrB,OAAyB,EACxB,OAA0B,CAAC,QAAQ,CACrC,CAAA;AACH,CAAC"}
|
package/js/watch.function.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { setLet } from
|
|
1
|
+
import { setLet } from './setLet.function';
|
|
2
2
|
/** When an item in watch array changes, callback function will be triggered */
|
|
3
3
|
export function watch(currentValues, callback) {
|
|
4
4
|
let previousValues = setLet(undefined)(x => [previousValues, previousValues = x]);
|
|
5
5
|
if (previousValues === undefined) {
|
|
6
6
|
callback(currentValues, previousValues);
|
|
7
|
-
const result = {
|
|
7
|
+
// const result = {currentValues, previousValues}
|
|
8
8
|
previousValues = currentValues;
|
|
9
9
|
return currentValues;
|
|
10
10
|
}
|
|
@@ -13,7 +13,8 @@ export function watch(currentValues, callback) {
|
|
|
13
13
|
return currentValues;
|
|
14
14
|
}
|
|
15
15
|
callback(currentValues, previousValues);
|
|
16
|
-
previousValues =
|
|
16
|
+
previousValues.length = 0;
|
|
17
|
+
previousValues.push(...currentValues);
|
|
17
18
|
return currentValues;
|
|
18
19
|
}
|
|
19
20
|
//# sourceMappingURL=watch.function.js.map
|
package/js/watch.function.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.function.js","sourceRoot":"","sources":["../ts/watch.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"watch.function.js","sourceRoot":"","sources":["../ts/watch.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAO1C,+EAA+E;AAC/E,MAAM,UAAU,KAAK,CACnB,aAAkB,EAClB,QAAuB;IAEvB,IAAI,cAAc,GAAG,MAAM,CAAC,SAAkC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,cAAc,EAAE,cAAc,GAAG,CAAC,CAAC,CAAC,CAAA;IAE1G,IAAG,cAAc,KAAK,SAAS,EAAE,CAAC;QAChC,QAAQ,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;QACvC,iDAAiD;QACjD,cAAc,GAAG,aAAa,CAAA;QAC9B,OAAO,aAAa,CAAA;IACtB,CAAC;IAED,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAM,cAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;IAChG,IAAG,QAAQ,EAAE,CAAC;QACZ,OAAO,aAAa,CAAA;IACtB,CAAC;IAED,QAAQ,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IACvC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAA;IACzB,cAAc,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAA;IAErC,OAAO,aAAa,CAAA;AACtB,CAAC"}
|
package/package.json
CHANGED
package/js/CustomError.d.ts
DELETED
package/js/CustomError.js
DELETED
package/js/CustomError.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomError.js","sourceRoot":"","sources":["../ts/CustomError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,OAAO,CAGL;IAEF,YAAY,OAAe,EAAE,SAAiB,EAAE,cAAsB;QACpE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ElementTarget.interface.js","sourceRoot":"","sources":["../ts/ElementTarget.interface.ts"],"names":[],"mappings":""}
|
package/js/Errors2.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type TagErrorDetails = Record<string, unknown>;
|
|
2
|
-
export type TagErrorFullDetails = Record<string, unknown> & {
|
|
3
|
-
errorCode: string;
|
|
4
|
-
};
|
|
5
|
-
export declare class TagError extends Error {
|
|
6
|
-
details: TagErrorFullDetails;
|
|
7
|
-
constructor(message: string, errorCode: string, details?: Record<string, unknown>);
|
|
8
|
-
}
|
|
9
|
-
export declare class ArrayNoKeyError extends TagError {
|
|
10
|
-
constructor(message: string, details?: TagErrorDetails);
|
|
11
|
-
}
|
|
12
|
-
export declare class StateMismatchError extends TagError {
|
|
13
|
-
constructor(message: string, details?: TagErrorDetails);
|
|
14
|
-
}
|
package/js/Errors2.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export class TagError extends Error {
|
|
2
|
-
details;
|
|
3
|
-
constructor(message, errorCode, details = {}) {
|
|
4
|
-
super(message);
|
|
5
|
-
this.name = TagError.name;
|
|
6
|
-
this.details = { ...details, errorCode };
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export class ArrayNoKeyError extends TagError {
|
|
10
|
-
constructor(message, details) {
|
|
11
|
-
super(message, 'array-no-key-error', details);
|
|
12
|
-
this.name = ArrayNoKeyError.name;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export class StateMismatchError extends TagError {
|
|
16
|
-
constructor(message, details) {
|
|
17
|
-
super(message, 'state-mismatch-error', details);
|
|
18
|
-
this.name = StateMismatchError.name;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=Errors2.js.map
|
package/js/Errors2.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Errors2.js","sourceRoot":"","sources":["../ts/Errors2.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,OAAO,CAAqB;IAE5B,YACE,OAAe,EACf,SAAiB,EACjB,UAAmC,EAAE;QAErC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,EAAC,GAAG,OAAO,EAAE,SAAS,EAAC,CAAA;IACxC,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAC3C,YAAY,OAAe,EAAE,OAAyB;QACpD,KAAK,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;IACnC,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,QAAQ;IAC9C,YAAY,OAAe,EAAE,OAAyB;QACpD,KAAK,CAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Gateway } from "./tagGateway.utils.js";
|
|
2
|
-
/** <tag-element id="" props="json-string" />
|
|
3
|
-
* For Angular @NgModule({schemas: [CUSTOM_ELEMENTS_SCHEMA]}) is required
|
|
4
|
-
*/
|
|
5
|
-
export declare class TagElement extends HTMLElement {
|
|
6
|
-
gateway: Gateway;
|
|
7
|
-
constructor();
|
|
8
|
-
disconnectedCallback(): void;
|
|
9
|
-
}
|
|
10
|
-
/** Call me one time */
|
|
11
|
-
export declare function initWebComponents(): void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { checkByElement, destroyGateway } from "./tagGateway.utils.js";
|
|
2
|
-
/** <tag-element id="" props="json-string" />
|
|
3
|
-
* For Angular @NgModule({schemas: [CUSTOM_ELEMENTS_SCHEMA]}) is required
|
|
4
|
-
*/
|
|
5
|
-
export class TagElement extends HTMLElement {
|
|
6
|
-
gateway;
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
// attributes are not available right away
|
|
10
|
-
setTimeout(() => this.gateway = checkByElement(this), 0);
|
|
11
|
-
}
|
|
12
|
-
disconnectedCallback() {
|
|
13
|
-
destroyGateway(this.gateway);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
/** Call me one time */
|
|
17
|
-
export function initWebComponents() {
|
|
18
|
-
customElements.define('tag-element', TagElement);
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=gateway.web.component.js.map
|