crmbonus-component-wake 0.0.20 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. package/dist/crmbonus-component-wake/app-modal.entry.js +23 -0
  2. package/dist/crmbonus-component-wake/app-modal.entry.js.map +1 -0
  3. package/dist/{esm/app-modal_2.entry.js → crmbonus-component-wake/crm-bonus-form.entry.js} +13 -26
  4. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -0
  5. package/dist/{esm → crmbonus-component-wake}/crm-bonus.entry.js +16 -8
  6. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -0
  7. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +48 -1
  8. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  9. package/dist/{cjs/crmbonus.service-a626c034.js → crmbonus-component-wake/crmbonus.service-5e579e1c.js} +165 -92
  10. package/dist/crmbonus-component-wake/crmbonus.service-5e579e1c.js.map +1 -0
  11. package/dist/{components/p-629fcb5b.js → crmbonus-component-wake/crmbonus.service-72c64bc3.js} +166 -91
  12. package/dist/crmbonus-component-wake/crmbonus.service-72c64bc3.js.map +1 -0
  13. package/dist/crmbonus-component-wake/crmbonus.service-a0dea046.js +3868 -0
  14. package/dist/crmbonus-component-wake/crmbonus.service-a0dea046.js.map +1 -0
  15. package/dist/{esm/crmbonus.service-83f67708.js → crmbonus-component-wake/crmbonus.service-ce105f62.js} +165 -90
  16. package/dist/crmbonus-component-wake/crmbonus.service-ce105f62.js.map +1 -0
  17. package/dist/crmbonus-component-wake/giftback-finish.entry.js +19 -0
  18. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -0
  19. package/dist/crmbonus-component-wake/giftback-pin.entry.js +44 -0
  20. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
  21. package/dist/crmbonus-component-wake/giftback-progress.entry.js +40 -0
  22. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
  23. package/dist/crmbonus-component-wake/index-f557ce7c.js +3039 -0
  24. package/dist/crmbonus-component-wake/index-f557ce7c.js.map +1 -0
  25. package/dist/crmbonus-component-wake/index.esm.js +16 -1
  26. package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
  27. package/dist/{esm → crmbonus-component-wake}/loading-spinner.entry.js +3 -4
  28. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
  29. package/dist/{esm → crmbonus-component-wake}/pedido-finalizado.entry.js +3 -3
  30. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
  31. package/dist/{components/p-2dbfb2c7.js → crmbonus-component-wake/phone-input-mask.entry.js} +9 -30
  32. package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +1 -0
  33. package/dist/crmbonus-component-wake/phone-input.entry.js +21 -0
  34. package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
  35. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +334 -0
  36. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +1 -0
  37. package/dist/types/components/crm-bonus/crm-bonus.d.ts +1 -0
  38. package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +2 -0
  39. package/dist/types/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.d.ts +1 -0
  40. package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +1 -0
  41. package/dist/types/components.d.ts +6 -0
  42. package/package.json +1 -1
  43. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  44. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  45. package/dist/cjs/app-modal_2.cjs.entry.js +0 -127
  46. package/dist/cjs/app-modal_2.cjs.entry.js.map +0 -1
  47. package/dist/cjs/crm-bonus.cjs.entry.js +0 -46
  48. package/dist/cjs/crm-bonus.cjs.entry.js.map +0 -1
  49. package/dist/cjs/crmbonus-component-wake.cjs.js +0 -27
  50. package/dist/cjs/crmbonus-component-wake.cjs.js.map +0 -1
  51. package/dist/cjs/crmbonus.service-a626c034.js.map +0 -1
  52. package/dist/cjs/giftback-finish_5.cjs.entry.js +0 -153
  53. package/dist/cjs/giftback-finish_5.cjs.entry.js.map +0 -1
  54. package/dist/cjs/index-52d8a075.js +0 -1248
  55. package/dist/cjs/index-52d8a075.js.map +0 -1
  56. package/dist/cjs/index.cjs.js +0 -11
  57. package/dist/cjs/index.cjs.js.map +0 -1
  58. package/dist/cjs/loader.cjs.js +0 -17
  59. package/dist/cjs/loader.cjs.js.map +0 -1
  60. package/dist/cjs/loading-spinner.cjs.entry.js +0 -24
  61. package/dist/cjs/loading-spinner.cjs.entry.js.map +0 -1
  62. package/dist/cjs/pedido-finalizado.cjs.entry.js +0 -28
  63. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +0 -1
  64. package/dist/collection/collection-manifest.json +0 -21
  65. package/dist/collection/components/crm-bonus/assets/logo.svg +0 -18
  66. package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +0 -8
  67. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +0 -18
  68. package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +0 -8
  69. package/dist/collection/components/crm-bonus/crm-bonus.css +0 -20
  70. package/dist/collection/components/crm-bonus/crm-bonus.js +0 -123
  71. package/dist/collection/components/crm-bonus/crm-bonus.js.map +0 -1
  72. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -32
  73. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +0 -194
  74. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +0 -1
  75. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +0 -10
  76. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +0 -20
  77. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +0 -1
  78. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +0 -54
  79. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +0 -111
  80. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +0 -1
  81. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +0 -95
  82. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +0 -111
  83. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +0 -1
  84. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +0 -75
  85. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +0 -1
  86. package/dist/collection/components/loading-spinner/loading-spinner.css +0 -17
  87. package/dist/collection/components/loading-spinner/loading-spinner.js +0 -63
  88. package/dist/collection/components/loading-spinner/loading-spinner.js.map +0 -1
  89. package/dist/collection/components/modal/app-modal.css +0 -45
  90. package/dist/collection/components/modal/app-modal.js +0 -83
  91. package/dist/collection/components/modal/app-modal.js.map +0 -1
  92. package/dist/collection/components/pedido/pedido.js +0 -58
  93. package/dist/collection/components/pedido/pedido.js.map +0 -1
  94. package/dist/collection/components/phone/phone-input-mask.css +0 -47
  95. package/dist/collection/components/phone/phone-input-mask.js +0 -90
  96. package/dist/collection/components/phone/phone-input-mask.js.map +0 -1
  97. package/dist/collection/contants/index.js +0 -8
  98. package/dist/collection/contants/index.js.map +0 -1
  99. package/dist/collection/contants/mocks.js +0 -28
  100. package/dist/collection/contants/mocks.js.map +0 -1
  101. package/dist/collection/dto/pin.sent.js +0 -2
  102. package/dist/collection/dto/pin.sent.js.map +0 -1
  103. package/dist/collection/dto/validate.pin.bonus.js +0 -2
  104. package/dist/collection/dto/validate.pin.bonus.js.map +0 -1
  105. package/dist/collection/index.js +0 -11
  106. package/dist/collection/index.js.map +0 -1
  107. package/dist/collection/services/crmbonus.service.js +0 -39
  108. package/dist/collection/services/crmbonus.service.js.map +0 -1
  109. package/dist/collection/utils/utils.js +0 -4
  110. package/dist/collection/utils/utils.js.map +0 -1
  111. package/dist/components/app-modal.js +0 -8
  112. package/dist/components/app-modal.js.map +0 -1
  113. package/dist/components/crm-bonus-form.js +0 -8
  114. package/dist/components/crm-bonus-form.js.map +0 -1
  115. package/dist/components/crm-bonus.js +0 -117
  116. package/dist/components/crm-bonus.js.map +0 -1
  117. package/dist/components/giftback-finish.js +0 -8
  118. package/dist/components/giftback-finish.js.map +0 -1
  119. package/dist/components/giftback-pin.js +0 -8
  120. package/dist/components/giftback-pin.js.map +0 -1
  121. package/dist/components/giftback-progress.js +0 -8
  122. package/dist/components/giftback-progress.js.map +0 -1
  123. package/dist/components/index.js +0 -9
  124. package/dist/components/index.js.map +0 -1
  125. package/dist/components/loading-spinner.js +0 -8
  126. package/dist/components/loading-spinner.js.map +0 -1
  127. package/dist/components/p-17ee9996.js +0 -52
  128. package/dist/components/p-17ee9996.js.map +0 -1
  129. package/dist/components/p-2dbfb2c7.js.map +0 -1
  130. package/dist/components/p-563ea4c5.js +0 -166
  131. package/dist/components/p-563ea4c5.js.map +0 -1
  132. package/dist/components/p-629fcb5b.js.map +0 -1
  133. package/dist/components/p-7294e43f.js +0 -36
  134. package/dist/components/p-7294e43f.js.map +0 -1
  135. package/dist/components/p-78529eea.js +0 -39
  136. package/dist/components/p-78529eea.js.map +0 -1
  137. package/dist/components/p-8e0ed8dd.js +0 -43
  138. package/dist/components/p-8e0ed8dd.js.map +0 -1
  139. package/dist/components/p-a1781d03.js +0 -72
  140. package/dist/components/p-a1781d03.js.map +0 -1
  141. package/dist/components/p-a88bc337.js +0 -67
  142. package/dist/components/p-a88bc337.js.map +0 -1
  143. package/dist/components/p-faf7103e.js +0 -1064
  144. package/dist/components/p-faf7103e.js.map +0 -1
  145. package/dist/components/pedido-finalizado.js +0 -45
  146. package/dist/components/pedido-finalizado.js.map +0 -1
  147. package/dist/components/phone-input-mask.js +0 -8
  148. package/dist/components/phone-input-mask.js.map +0 -1
  149. package/dist/components/phone-input.js +0 -8
  150. package/dist/components/phone-input.js.map +0 -1
  151. package/dist/crmbonus-component-wake/p-54e51298.entry.js +0 -2
  152. package/dist/crmbonus-component-wake/p-54e51298.entry.js.map +0 -1
  153. package/dist/crmbonus-component-wake/p-629fcb5b.js +0 -2
  154. package/dist/crmbonus-component-wake/p-629fcb5b.js.map +0 -1
  155. package/dist/crmbonus-component-wake/p-6b075110.entry.js +0 -2
  156. package/dist/crmbonus-component-wake/p-6b075110.entry.js.map +0 -1
  157. package/dist/crmbonus-component-wake/p-72510682.js +0 -3
  158. package/dist/crmbonus-component-wake/p-72510682.js.map +0 -1
  159. package/dist/crmbonus-component-wake/p-ba53f0f3.entry.js +0 -2
  160. package/dist/crmbonus-component-wake/p-ba53f0f3.entry.js.map +0 -1
  161. package/dist/crmbonus-component-wake/p-bf4b486e.entry.js +0 -2
  162. package/dist/crmbonus-component-wake/p-bf4b486e.entry.js.map +0 -1
  163. package/dist/crmbonus-component-wake/p-e1255160.js +0 -2
  164. package/dist/crmbonus-component-wake/p-e1255160.js.map +0 -1
  165. package/dist/crmbonus-component-wake/p-f0d68c31.entry.js +0 -2
  166. package/dist/crmbonus-component-wake/p-f0d68c31.entry.js.map +0 -1
  167. package/dist/env.js +0 -5
  168. package/dist/env.js.map +0 -1
  169. package/dist/esm/app-modal_2.entry.js.map +0 -1
  170. package/dist/esm/crm-bonus.entry.js.map +0 -1
  171. package/dist/esm/crmbonus-component-wake.js +0 -22
  172. package/dist/esm/crmbonus-component-wake.js.map +0 -1
  173. package/dist/esm/crmbonus.service-83f67708.js.map +0 -1
  174. package/dist/esm/giftback-finish_5.entry.js +0 -145
  175. package/dist/esm/giftback-finish_5.entry.js.map +0 -1
  176. package/dist/esm/index-9f7bde48.js +0 -1220
  177. package/dist/esm/index-9f7bde48.js.map +0 -1
  178. package/dist/esm/index.js +0 -7
  179. package/dist/esm/index.js.map +0 -1
  180. package/dist/esm/loader.js +0 -13
  181. package/dist/esm/loader.js.map +0 -1
  182. package/dist/esm/loading-spinner.entry.js.map +0 -1
  183. package/dist/esm/pedido-finalizado.entry.js.map +0 -1
  184. package/dist/index.cjs.js +0 -1
  185. package/dist/index.js +0 -1
  186. /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js +0 -0
  187. /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js.map +0 -0
@@ -1,1064 +0,0 @@
1
- const NAMESPACE = 'crmbonus-component-wake';
2
- const BUILD = /* crmbonus-component-wake */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: false, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: false };
3
-
4
- /*
5
- Stencil Client Platform v4.22.2 | MIT Licensed | https://stenciljs.com
6
- */
7
- var __defProp = Object.defineProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var hostRefs = /* @__PURE__ */ new WeakMap();
13
- var getHostRef = (ref) => hostRefs.get(ref);
14
- var registerHost = (hostElement, cmpMeta) => {
15
- const hostRef = {
16
- $flags$: 0,
17
- $hostElement$: hostElement,
18
- $cmpMeta$: cmpMeta,
19
- $instanceValues$: /* @__PURE__ */ new Map()
20
- };
21
- {
22
- hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
23
- hostElement["s-p"] = [];
24
- hostElement["s-rc"] = [];
25
- }
26
- return hostRefs.set(hostElement, hostRef);
27
- };
28
- var isMemberInElement = (elm, memberName) => memberName in elm;
29
- var consoleError = (e, el) => (0, console.error)(e, el);
30
-
31
- // src/client/client-style.ts
32
- var styles = /* @__PURE__ */ new Map();
33
- var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
34
- var win = typeof window !== "undefined" ? window : {};
35
- var doc = win.document || { head: {} };
36
- var H = win.HTMLElement || class {
37
- };
38
- var plt = {
39
- $flags$: 0,
40
- $resourcesUrl$: "",
41
- jmp: (h2) => h2(),
42
- raf: (h2) => requestAnimationFrame(h2),
43
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
44
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
45
- ce: (eventName, opts) => new CustomEvent(eventName, opts)
46
- };
47
- var promiseResolve = (v) => Promise.resolve(v);
48
- var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
49
- try {
50
- new CSSStyleSheet();
51
- return typeof new CSSStyleSheet().replaceSync === "function";
52
- } catch (e) {
53
- }
54
- return false;
55
- })() ;
56
- var queuePending = false;
57
- var queueDomReads = [];
58
- var queueDomWrites = [];
59
- var queueTask = (queue, write) => (cb) => {
60
- queue.push(cb);
61
- if (!queuePending) {
62
- queuePending = true;
63
- if (write && plt.$flags$ & 4 /* queueSync */) {
64
- nextTick(flush);
65
- } else {
66
- plt.raf(flush);
67
- }
68
- }
69
- };
70
- var consume = (queue) => {
71
- for (let i2 = 0; i2 < queue.length; i2++) {
72
- try {
73
- queue[i2](performance.now());
74
- } catch (e) {
75
- consoleError(e);
76
- }
77
- }
78
- queue.length = 0;
79
- };
80
- var flush = () => {
81
- consume(queueDomReads);
82
- {
83
- consume(queueDomWrites);
84
- if (queuePending = queueDomReads.length > 0) {
85
- plt.raf(flush);
86
- }
87
- }
88
- };
89
- var nextTick = (cb) => promiseResolve().then(cb);
90
- var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
91
-
92
- // src/runtime/asset-path.ts
93
- var getAssetPath = (path) => {
94
- const assetUrl = new URL(path, plt.$resourcesUrl$);
95
- return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
96
- };
97
- var setAssetPath = (path) => plt.$resourcesUrl$ = path;
98
-
99
- // src/utils/constants.ts
100
- var EMPTY_OBJ = {};
101
-
102
- // src/utils/helpers.ts
103
- var isDef = (v) => v != null;
104
- var isComplexType = (o) => {
105
- o = typeof o;
106
- return o === "object" || o === "function";
107
- };
108
-
109
- // src/utils/query-nonce-meta-tag-content.ts
110
- function queryNonceMetaTagContent(doc2) {
111
- var _a, _b, _c;
112
- return (_c = (_b = (_a = doc2.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
113
- }
114
-
115
- // src/utils/result.ts
116
- var result_exports = {};
117
- __export(result_exports, {
118
- err: () => err,
119
- map: () => map,
120
- ok: () => ok,
121
- unwrap: () => unwrap,
122
- unwrapErr: () => unwrapErr
123
- });
124
- var ok = (value) => ({
125
- isOk: true,
126
- isErr: false,
127
- value
128
- });
129
- var err = (value) => ({
130
- isOk: false,
131
- isErr: true,
132
- value
133
- });
134
- function map(result, fn) {
135
- if (result.isOk) {
136
- const val = fn(result.value);
137
- if (val instanceof Promise) {
138
- return val.then((newVal) => ok(newVal));
139
- } else {
140
- return ok(val);
141
- }
142
- }
143
- if (result.isErr) {
144
- const value = result.value;
145
- return err(value);
146
- }
147
- throw "should never get here";
148
- }
149
- var unwrap = (result) => {
150
- if (result.isOk) {
151
- return result.value;
152
- } else {
153
- throw result.value;
154
- }
155
- };
156
- var unwrapErr = (result) => {
157
- if (result.isErr) {
158
- return result.value;
159
- } else {
160
- throw result.value;
161
- }
162
- };
163
- var createTime = (fnName, tagName = "") => {
164
- {
165
- return () => {
166
- return;
167
- };
168
- }
169
- };
170
- var h = (nodeName, vnodeData, ...children) => {
171
- let child = null;
172
- let key = null;
173
- let simple = false;
174
- let lastSimple = false;
175
- const vNodeChildren = [];
176
- const walk = (c) => {
177
- for (let i2 = 0; i2 < c.length; i2++) {
178
- child = c[i2];
179
- if (Array.isArray(child)) {
180
- walk(child);
181
- } else if (child != null && typeof child !== "boolean") {
182
- if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
183
- child = String(child);
184
- }
185
- if (simple && lastSimple) {
186
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
187
- } else {
188
- vNodeChildren.push(simple ? newVNode(null, child) : child);
189
- }
190
- lastSimple = simple;
191
- }
192
- }
193
- };
194
- walk(children);
195
- if (vnodeData) {
196
- if (vnodeData.key) {
197
- key = vnodeData.key;
198
- }
199
- {
200
- const classData = vnodeData.className || vnodeData.class;
201
- if (classData) {
202
- vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
203
- }
204
- }
205
- }
206
- const vnode = newVNode(nodeName, null);
207
- vnode.$attrs$ = vnodeData;
208
- if (vNodeChildren.length > 0) {
209
- vnode.$children$ = vNodeChildren;
210
- }
211
- {
212
- vnode.$key$ = key;
213
- }
214
- return vnode;
215
- };
216
- var newVNode = (tag, text) => {
217
- const vnode = {
218
- $flags$: 0,
219
- $tag$: tag,
220
- $text$: text,
221
- $elm$: null,
222
- $children$: null
223
- };
224
- {
225
- vnode.$attrs$ = null;
226
- }
227
- {
228
- vnode.$key$ = null;
229
- }
230
- return vnode;
231
- };
232
- var Host = {};
233
- var isHost = (node) => node && node.$tag$ === Host;
234
- var parsePropertyValue = (propValue, propType) => {
235
- if (propValue != null && !isComplexType(propValue)) {
236
- if (propType & 4 /* Boolean */) {
237
- return propValue === "false" ? false : propValue === "" || !!propValue;
238
- }
239
- if (propType & 2 /* Number */) {
240
- return parseFloat(propValue);
241
- }
242
- if (propType & 1 /* String */) {
243
- return String(propValue);
244
- }
245
- return propValue;
246
- }
247
- return propValue;
248
- };
249
- var getElement = (ref) => ref;
250
-
251
- // src/runtime/event-emitter.ts
252
- var createEvent = (ref, name, flags) => {
253
- const elm = getElement(ref);
254
- return {
255
- emit: (detail) => {
256
- return emitEvent(elm, name, {
257
- bubbles: !!(flags & 4 /* Bubbles */),
258
- composed: !!(flags & 2 /* Composed */),
259
- cancelable: !!(flags & 1 /* Cancellable */),
260
- detail
261
- });
262
- }
263
- };
264
- };
265
- var emitEvent = (elm, name, opts) => {
266
- const ev = plt.ce(name, opts);
267
- elm.dispatchEvent(ev);
268
- return ev;
269
- };
270
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
271
- var registerStyle = (scopeId2, cssText, allowCS) => {
272
- let style = styles.get(scopeId2);
273
- if (supportsConstructableStylesheets && allowCS) {
274
- style = style || new CSSStyleSheet();
275
- if (typeof style === "string") {
276
- style = cssText;
277
- } else {
278
- style.replaceSync(cssText);
279
- }
280
- } else {
281
- style = cssText;
282
- }
283
- styles.set(scopeId2, style);
284
- };
285
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
286
- var _a;
287
- const scopeId2 = getScopeId(cmpMeta);
288
- const style = styles.get(scopeId2);
289
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
290
- if (style) {
291
- if (typeof style === "string") {
292
- styleContainerNode = styleContainerNode.head || styleContainerNode;
293
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
294
- let styleElm;
295
- if (!appliedStyles) {
296
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
297
- }
298
- if (!appliedStyles.has(scopeId2)) {
299
- {
300
- styleElm = doc.createElement("style");
301
- styleElm.innerHTML = style;
302
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
303
- if (nonce != null) {
304
- styleElm.setAttribute("nonce", nonce);
305
- }
306
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
307
- if (styleContainerNode.nodeName === "HEAD") {
308
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
309
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
310
- styleContainerNode.insertBefore(styleElm, referenceNode2);
311
- } else if ("host" in styleContainerNode) {
312
- if (supportsConstructableStylesheets) {
313
- const stylesheet = new CSSStyleSheet();
314
- stylesheet.replaceSync(style);
315
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
316
- } else {
317
- const existingStyleContainer = styleContainerNode.querySelector("style");
318
- if (existingStyleContainer) {
319
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
320
- } else {
321
- styleContainerNode.prepend(styleElm);
322
- }
323
- }
324
- } else {
325
- styleContainerNode.append(styleElm);
326
- }
327
- }
328
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
329
- styleContainerNode.insertBefore(styleElm, null);
330
- }
331
- }
332
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
333
- styleElm.innerHTML += SLOT_FB_CSS;
334
- }
335
- if (appliedStyles) {
336
- appliedStyles.add(scopeId2);
337
- }
338
- }
339
- } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
340
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
341
- }
342
- }
343
- return scopeId2;
344
- };
345
- var attachStyles = (hostRef) => {
346
- const cmpMeta = hostRef.$cmpMeta$;
347
- const elm = hostRef.$hostElement$;
348
- const flags = cmpMeta.$flags$;
349
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
350
- const scopeId2 = addStyle(
351
- elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
352
- cmpMeta);
353
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
354
- elm["s-sc"] = scopeId2;
355
- elm.classList.add(scopeId2 + "-h");
356
- }
357
- endAttachStyles();
358
- };
359
- var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
360
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
361
- if (oldValue !== newValue) {
362
- let isProp = isMemberInElement(elm, memberName);
363
- let ln = memberName.toLowerCase();
364
- if (memberName === "class") {
365
- const classList = elm.classList;
366
- const oldClasses = parseClassList(oldValue);
367
- const newClasses = parseClassList(newValue);
368
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
369
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
370
- } else if (memberName === "style") {
371
- {
372
- for (const prop in oldValue) {
373
- if (!newValue || newValue[prop] == null) {
374
- if (prop.includes("-")) {
375
- elm.style.removeProperty(prop);
376
- } else {
377
- elm.style[prop] = "";
378
- }
379
- }
380
- }
381
- }
382
- for (const prop in newValue) {
383
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
384
- if (prop.includes("-")) {
385
- elm.style.setProperty(prop, newValue[prop]);
386
- } else {
387
- elm.style[prop] = newValue[prop];
388
- }
389
- }
390
- }
391
- } else if (memberName === "key") ; else if (memberName === "ref") {
392
- if (newValue) {
393
- newValue(elm);
394
- }
395
- } else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
396
- if (memberName[2] === "-") {
397
- memberName = memberName.slice(3);
398
- } else if (isMemberInElement(win, ln)) {
399
- memberName = ln.slice(2);
400
- } else {
401
- memberName = ln[2] + memberName.slice(3);
402
- }
403
- if (oldValue || newValue) {
404
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
405
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
406
- if (oldValue) {
407
- plt.rel(elm, memberName, oldValue, capture);
408
- }
409
- if (newValue) {
410
- plt.ael(elm, memberName, newValue, capture);
411
- }
412
- }
413
- } else {
414
- const isComplex = isComplexType(newValue);
415
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
416
- try {
417
- if (!elm.tagName.includes("-")) {
418
- const n = newValue == null ? "" : newValue;
419
- if (memberName === "list") {
420
- isProp = false;
421
- } else if (oldValue == null || elm[memberName] != n) {
422
- if (typeof elm.__lookupSetter__(memberName) === "function") {
423
- elm[memberName] = n;
424
- } else {
425
- elm.setAttribute(memberName, n);
426
- }
427
- }
428
- } else {
429
- elm[memberName] = newValue;
430
- }
431
- } catch (e) {
432
- }
433
- }
434
- if (newValue == null || newValue === false) {
435
- if (newValue !== false || elm.getAttribute(memberName) === "") {
436
- {
437
- elm.removeAttribute(memberName);
438
- }
439
- }
440
- } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
441
- newValue = newValue === true ? "" : newValue;
442
- {
443
- elm.setAttribute(memberName, newValue);
444
- }
445
- }
446
- }
447
- }
448
- };
449
- var parseClassListRegex = /\s/;
450
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
451
- var CAPTURE_EVENT_SUFFIX = "Capture";
452
- var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
453
-
454
- // src/runtime/vdom/update-element.ts
455
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
456
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
457
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
458
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
459
- {
460
- for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
461
- if (!(memberName in newVnodeAttrs)) {
462
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
463
- }
464
- }
465
- }
466
- for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
467
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
468
- }
469
- };
470
- function sortedAttrNames(attrNames) {
471
- return attrNames.includes("ref") ? (
472
- // we need to sort these to ensure that `'ref'` is the last attr
473
- [...attrNames.filter((attr) => attr !== "ref"), "ref"]
474
- ) : (
475
- // no need to sort, return the original array
476
- attrNames
477
- );
478
- }
479
-
480
- // src/runtime/vdom/vdom-render.ts
481
- var scopeId;
482
- var hostTagName;
483
- var useNativeShadowDom = false;
484
- var isSvgMode = false;
485
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
486
- const newVNode2 = newParentVNode.$children$[childIndex];
487
- let i2 = 0;
488
- let elm;
489
- let childNode;
490
- if (newVNode2.$text$ !== null) {
491
- elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
492
- } else {
493
- elm = newVNode2.$elm$ = doc.createElement(
494
- !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
495
- );
496
- {
497
- updateElement(null, newVNode2, isSvgMode);
498
- }
499
- const rootNode = elm.getRootNode();
500
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
501
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
502
- elm.classList.add(elm["s-si"] = scopeId);
503
- }
504
- if (newVNode2.$children$) {
505
- for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
506
- childNode = createElm(oldParentVNode, newVNode2, i2);
507
- if (childNode) {
508
- elm.appendChild(childNode);
509
- }
510
- }
511
- }
512
- }
513
- elm["s-hn"] = hostTagName;
514
- return elm;
515
- };
516
- var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
517
- let containerElm = parentElm;
518
- let childNode;
519
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
520
- containerElm = containerElm.shadowRoot;
521
- }
522
- for (; startIdx <= endIdx; ++startIdx) {
523
- if (vnodes[startIdx]) {
524
- childNode = createElm(null, parentVNode, startIdx);
525
- if (childNode) {
526
- vnodes[startIdx].$elm$ = childNode;
527
- insertBefore(containerElm, childNode, before);
528
- }
529
- }
530
- }
531
- };
532
- var removeVnodes = (vnodes, startIdx, endIdx) => {
533
- for (let index = startIdx; index <= endIdx; ++index) {
534
- const vnode = vnodes[index];
535
- if (vnode) {
536
- const elm = vnode.$elm$;
537
- nullifyVNodeRefs(vnode);
538
- if (elm) {
539
- elm.remove();
540
- }
541
- }
542
- }
543
- };
544
- var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
545
- let oldStartIdx = 0;
546
- let newStartIdx = 0;
547
- let idxInOld = 0;
548
- let i2 = 0;
549
- let oldEndIdx = oldCh.length - 1;
550
- let oldStartVnode = oldCh[0];
551
- let oldEndVnode = oldCh[oldEndIdx];
552
- let newEndIdx = newCh.length - 1;
553
- let newStartVnode = newCh[0];
554
- let newEndVnode = newCh[newEndIdx];
555
- let node;
556
- let elmToMove;
557
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
558
- if (oldStartVnode == null) {
559
- oldStartVnode = oldCh[++oldStartIdx];
560
- } else if (oldEndVnode == null) {
561
- oldEndVnode = oldCh[--oldEndIdx];
562
- } else if (newStartVnode == null) {
563
- newStartVnode = newCh[++newStartIdx];
564
- } else if (newEndVnode == null) {
565
- newEndVnode = newCh[--newEndIdx];
566
- } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
567
- patch(oldStartVnode, newStartVnode, isInitialRender);
568
- oldStartVnode = oldCh[++oldStartIdx];
569
- newStartVnode = newCh[++newStartIdx];
570
- } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
571
- patch(oldEndVnode, newEndVnode, isInitialRender);
572
- oldEndVnode = oldCh[--oldEndIdx];
573
- newEndVnode = newCh[--newEndIdx];
574
- } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
575
- patch(oldStartVnode, newEndVnode, isInitialRender);
576
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
577
- oldStartVnode = oldCh[++oldStartIdx];
578
- newEndVnode = newCh[--newEndIdx];
579
- } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
580
- patch(oldEndVnode, newStartVnode, isInitialRender);
581
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
582
- oldEndVnode = oldCh[--oldEndIdx];
583
- newStartVnode = newCh[++newStartIdx];
584
- } else {
585
- idxInOld = -1;
586
- {
587
- for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
588
- if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
589
- idxInOld = i2;
590
- break;
591
- }
592
- }
593
- }
594
- if (idxInOld >= 0) {
595
- elmToMove = oldCh[idxInOld];
596
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
597
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
598
- } else {
599
- patch(elmToMove, newStartVnode, isInitialRender);
600
- oldCh[idxInOld] = void 0;
601
- node = elmToMove.$elm$;
602
- }
603
- newStartVnode = newCh[++newStartIdx];
604
- } else {
605
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
606
- newStartVnode = newCh[++newStartIdx];
607
- }
608
- if (node) {
609
- {
610
- insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
611
- }
612
- }
613
- }
614
- }
615
- if (oldStartIdx > oldEndIdx) {
616
- addVnodes(
617
- parentElm,
618
- newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
619
- newVNode2,
620
- newCh,
621
- newStartIdx,
622
- newEndIdx
623
- );
624
- } else if (newStartIdx > newEndIdx) {
625
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
626
- }
627
- };
628
- var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
629
- if (leftVNode.$tag$ === rightVNode.$tag$) {
630
- if (!isInitialRender) {
631
- return leftVNode.$key$ === rightVNode.$key$;
632
- }
633
- return true;
634
- }
635
- return false;
636
- };
637
- var patch = (oldVNode, newVNode2, isInitialRender = false) => {
638
- const elm = newVNode2.$elm$ = oldVNode.$elm$;
639
- const oldChildren = oldVNode.$children$;
640
- const newChildren = newVNode2.$children$;
641
- const tag = newVNode2.$tag$;
642
- const text = newVNode2.$text$;
643
- if (text === null) {
644
- {
645
- if (tag === "slot" && !useNativeShadowDom) ; else {
646
- updateElement(oldVNode, newVNode2, isSvgMode);
647
- }
648
- }
649
- if (oldChildren !== null && newChildren !== null) {
650
- updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
651
- } else if (newChildren !== null) {
652
- if (oldVNode.$text$ !== null) {
653
- elm.textContent = "";
654
- }
655
- addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
656
- } else if (
657
- // don't do this on initial render as it can cause non-hydrated content to be removed
658
- !isInitialRender && BUILD.updatable && oldChildren !== null
659
- ) {
660
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
661
- }
662
- } else if (oldVNode.$text$ !== text) {
663
- elm.data = text;
664
- }
665
- };
666
- var nullifyVNodeRefs = (vNode) => {
667
- {
668
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
669
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
670
- }
671
- };
672
- var insertBefore = (parent, newNode, reference) => {
673
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
674
- return inserted;
675
- };
676
- var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
677
- const hostElm = hostRef.$hostElement$;
678
- const cmpMeta = hostRef.$cmpMeta$;
679
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
680
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
681
- hostTagName = hostElm.tagName;
682
- if (cmpMeta.$attrsToReflect$) {
683
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
684
- cmpMeta.$attrsToReflect$.map(
685
- ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
686
- );
687
- }
688
- if (isInitialLoad && rootVnode.$attrs$) {
689
- for (const key of Object.keys(rootVnode.$attrs$)) {
690
- if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
691
- rootVnode.$attrs$[key] = hostElm[key];
692
- }
693
- }
694
- }
695
- rootVnode.$tag$ = null;
696
- rootVnode.$flags$ |= 4 /* isHost */;
697
- hostRef.$vnode$ = rootVnode;
698
- rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
699
- {
700
- scopeId = hostElm["s-sc"];
701
- }
702
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
703
- patch(oldVNode, rootVnode, isInitialLoad);
704
- };
705
-
706
- // src/runtime/update-component.ts
707
- var attachToAncestor = (hostRef, ancestorComponent) => {
708
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
709
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
710
- }
711
- };
712
- var scheduleUpdate = (hostRef, isInitialLoad) => {
713
- {
714
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
715
- }
716
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
717
- hostRef.$flags$ |= 512 /* needsRerender */;
718
- return;
719
- }
720
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
721
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
722
- return writeTask(dispatch) ;
723
- };
724
- var dispatchHooks = (hostRef, isInitialLoad) => {
725
- const elm = hostRef.$hostElement$;
726
- const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
727
- const instance = elm;
728
- if (!instance) {
729
- throw new Error(
730
- `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
731
- );
732
- }
733
- let maybePromise;
734
- if (isInitialLoad) {
735
- {
736
- maybePromise = safeCall(instance, "componentWillLoad");
737
- }
738
- }
739
- endSchedule();
740
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
741
- };
742
- var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
743
- console.error(err2);
744
- fn();
745
- }) : fn();
746
- var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
747
- var updateComponent = async (hostRef, instance, isInitialLoad) => {
748
- var _a;
749
- const elm = hostRef.$hostElement$;
750
- const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
751
- const rc = elm["s-rc"];
752
- if (isInitialLoad) {
753
- attachStyles(hostRef);
754
- }
755
- const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
756
- {
757
- callRender(hostRef, instance, elm, isInitialLoad);
758
- }
759
- if (rc) {
760
- rc.map((cb) => cb());
761
- elm["s-rc"] = void 0;
762
- }
763
- endRender();
764
- endUpdate();
765
- {
766
- const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
767
- const postUpdate = () => postUpdateComponent(hostRef);
768
- if (childrenPromises.length === 0) {
769
- postUpdate();
770
- } else {
771
- Promise.all(childrenPromises).then(postUpdate);
772
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
773
- childrenPromises.length = 0;
774
- }
775
- }
776
- };
777
- var callRender = (hostRef, instance, elm, isInitialLoad) => {
778
- try {
779
- instance = instance.render() ;
780
- {
781
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
782
- }
783
- {
784
- hostRef.$flags$ |= 2 /* hasRendered */;
785
- }
786
- {
787
- {
788
- {
789
- renderVdom(hostRef, instance, isInitialLoad);
790
- }
791
- }
792
- }
793
- } catch (e) {
794
- consoleError(e, hostRef.$hostElement$);
795
- }
796
- return null;
797
- };
798
- var postUpdateComponent = (hostRef) => {
799
- const tagName = hostRef.$cmpMeta$.$tagName$;
800
- const elm = hostRef.$hostElement$;
801
- const endPostUpdate = createTime("postUpdate", tagName);
802
- const ancestorComponent = hostRef.$ancestorComponent$;
803
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
804
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
805
- {
806
- addHydratedFlag(elm);
807
- }
808
- endPostUpdate();
809
- {
810
- hostRef.$onReadyResolve$(elm);
811
- if (!ancestorComponent) {
812
- appDidLoad();
813
- }
814
- }
815
- } else {
816
- endPostUpdate();
817
- }
818
- {
819
- if (hostRef.$onRenderResolve$) {
820
- hostRef.$onRenderResolve$();
821
- hostRef.$onRenderResolve$ = void 0;
822
- }
823
- if (hostRef.$flags$ & 512 /* needsRerender */) {
824
- nextTick(() => scheduleUpdate(hostRef, false));
825
- }
826
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
827
- }
828
- };
829
- var appDidLoad = (who) => {
830
- {
831
- addHydratedFlag(doc.documentElement);
832
- }
833
- nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
834
- };
835
- var safeCall = (instance, method, arg) => {
836
- if (instance && instance[method]) {
837
- try {
838
- return instance[method](arg);
839
- } catch (e) {
840
- consoleError(e);
841
- }
842
- }
843
- return void 0;
844
- };
845
- var addHydratedFlag = (elm) => {
846
- var _a;
847
- return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
848
- };
849
-
850
- // src/runtime/set-value.ts
851
- var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
852
- var setValue = (ref, propName, newVal, cmpMeta) => {
853
- const hostRef = getHostRef(ref);
854
- const oldVal = hostRef.$instanceValues$.get(propName);
855
- const flags = hostRef.$flags$;
856
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
857
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
858
- const didValueChange = newVal !== oldVal && !areBothNaN;
859
- if (didValueChange) {
860
- hostRef.$instanceValues$.set(propName, newVal);
861
- {
862
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
863
- scheduleUpdate(hostRef, false);
864
- }
865
- }
866
- }
867
- };
868
-
869
- // src/runtime/proxy-component.ts
870
- var proxyComponent = (Cstr, cmpMeta, flags) => {
871
- var _a, _b;
872
- const prototype = Cstr.prototype;
873
- if (cmpMeta.$members$ || BUILD.watchCallback ) {
874
- const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
875
- members.map(([memberName, [memberFlags]]) => {
876
- if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
877
- Object.defineProperty(prototype, memberName, {
878
- get() {
879
- return getValue(this, memberName);
880
- },
881
- set(newValue) {
882
- setValue(this, memberName, newValue, cmpMeta);
883
- },
884
- configurable: true,
885
- enumerable: true
886
- });
887
- }
888
- });
889
- {
890
- const attrNameToPropName = /* @__PURE__ */ new Map();
891
- prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
892
- plt.jmp(() => {
893
- var _a2;
894
- const propName = attrNameToPropName.get(attrName);
895
- if (this.hasOwnProperty(propName)) {
896
- newValue = this[propName];
897
- delete this[propName];
898
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
899
- this[propName] == newValue) {
900
- return;
901
- } else if (propName == null) {
902
- const hostRef = getHostRef(this);
903
- const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
904
- if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
905
- const elm = this;
906
- const instance = elm;
907
- const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
908
- entry == null ? void 0 : entry.forEach((callbackName) => {
909
- if (instance[callbackName] != null) {
910
- instance[callbackName].call(instance, newValue, oldValue, attrName);
911
- }
912
- });
913
- }
914
- return;
915
- }
916
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
917
- });
918
- };
919
- Cstr.observedAttributes = Array.from(
920
- /* @__PURE__ */ new Set([
921
- ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
922
- ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
923
- var _a2;
924
- const attrName = m[1] || propName;
925
- attrNameToPropName.set(attrName, propName);
926
- if (m[0] & 512 /* ReflectAttr */) {
927
- (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
928
- }
929
- return attrName;
930
- })
931
- ])
932
- );
933
- }
934
- }
935
- return Cstr;
936
- };
937
-
938
- // src/runtime/initialize-component.ts
939
- var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
940
- let Cstr;
941
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
942
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
943
- {
944
- Cstr = elm.constructor;
945
- const cmpTag = elm.localName;
946
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
947
- }
948
- if (Cstr && Cstr.style) {
949
- let style;
950
- if (typeof Cstr.style === "string") {
951
- style = Cstr.style;
952
- }
953
- const scopeId2 = getScopeId(cmpMeta);
954
- if (!styles.has(scopeId2)) {
955
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
956
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
957
- endRegisterStyles();
958
- }
959
- }
960
- }
961
- const ancestorComponent = hostRef.$ancestorComponent$;
962
- const schedule = () => scheduleUpdate(hostRef, true);
963
- if (ancestorComponent && ancestorComponent["s-rc"]) {
964
- ancestorComponent["s-rc"].push(schedule);
965
- } else {
966
- schedule();
967
- }
968
- };
969
- var fireConnectedCallback = (instance) => {
970
- };
971
-
972
- // src/runtime/connected-callback.ts
973
- var connectedCallback = (elm) => {
974
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
975
- const hostRef = getHostRef(elm);
976
- const cmpMeta = hostRef.$cmpMeta$;
977
- const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
978
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
979
- hostRef.$flags$ |= 1 /* hasConnected */;
980
- {
981
- let ancestorComponent = elm;
982
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
983
- if (ancestorComponent["s-p"]) {
984
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
985
- break;
986
- }
987
- }
988
- }
989
- if (cmpMeta.$members$) {
990
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
991
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
992
- const value = elm[memberName];
993
- delete elm[memberName];
994
- elm[memberName] = value;
995
- }
996
- });
997
- }
998
- {
999
- initializeComponent(elm, hostRef, cmpMeta);
1000
- }
1001
- } else {
1002
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1003
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1004
- }
1005
- }
1006
- endConnected();
1007
- }
1008
- };
1009
- var disconnectedCallback = async (elm) => {
1010
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1011
- getHostRef(elm);
1012
- }
1013
- };
1014
- var proxyCustomElement = (Cstr, compactMeta) => {
1015
- const cmpMeta = {
1016
- $flags$: compactMeta[0],
1017
- $tagName$: compactMeta[1]
1018
- };
1019
- {
1020
- cmpMeta.$members$ = compactMeta[2];
1021
- }
1022
- {
1023
- cmpMeta.$attrsToReflect$ = [];
1024
- }
1025
- Object.assign(Cstr.prototype, {
1026
- __registerHost() {
1027
- registerHost(this, cmpMeta);
1028
- },
1029
- connectedCallback() {
1030
- getHostRef(this);
1031
- connectedCallback(this);
1032
- },
1033
- disconnectedCallback() {
1034
- disconnectedCallback(this);
1035
- },
1036
- __attachShadow() {
1037
- {
1038
- if (!this.shadowRoot) {
1039
- {
1040
- this.attachShadow({ mode: "open" });
1041
- }
1042
- } else {
1043
- if (this.shadowRoot.mode !== "open") {
1044
- throw new Error(
1045
- `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
1046
- );
1047
- }
1048
- }
1049
- }
1050
- }
1051
- });
1052
- Cstr.is = cmpMeta.$tagName$;
1053
- return proxyComponent(Cstr, cmpMeta);
1054
- };
1055
-
1056
- // src/runtime/nonce.ts
1057
- var setNonce = (nonce) => plt.$nonce$ = nonce;
1058
-
1059
- // src/runtime/platform-options.ts
1060
- var setPlatformOptions = (opts) => Object.assign(plt, opts);
1061
-
1062
- export { H, setNonce as a, setPlatformOptions as b, createEvent as c, Host as d, getAssetPath as g, h, proxyCustomElement as p, setAssetPath as s };
1063
-
1064
- //# sourceMappingURL=p-faf7103e.js.map