@wodira/browser 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/README.md +97 -48
- package/dist/index.cjs +5 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/ui/boxes/cdn.js +9 -9
- package/dist/ui/index-tfej862z.js +3264 -0
- package/dist/ui/index-xdhg885t.js +997 -0
- package/dist/ui/index.js +26 -2277
- package/dist/ui/shirt-3d-renderer-jyks1h8f.js +10 -0
- package/dist/ui/shirt-sponsors/cdn.js +5115 -73
- package/dist/ui/shirt-sponsors/index.js +8 -1667
- package/dist/ui/shirt-sponsors/render/auction-model.d.ts +55 -0
- package/dist/ui/shirt-sponsors/render/auction-model.d.ts.map +1 -0
- package/dist/ui/shirt-sponsors/render/index.d.ts +7 -0
- package/dist/ui/shirt-sponsors/render/index.d.ts.map +1 -0
- package/dist/ui/shirt-sponsors/render/index.js +34 -0
- package/dist/ui/shirt-sponsors/render/shirt-3d-renderer.d.ts +109 -0
- package/dist/ui/shirt-sponsors/render/shirt-3d-renderer.d.ts.map +1 -0
- package/dist/ui/shirt-sponsors/render/shirt-artwork-projection.d.ts +13 -0
- package/dist/ui/shirt-sponsors/render/shirt-artwork-projection.d.ts.map +1 -0
- package/dist/ui/shirt-sponsors/render/shirt-artwork.d.ts +17 -0
- package/dist/ui/shirt-sponsors/render/shirt-artwork.d.ts.map +1 -0
- package/dist/ui/shirt-sponsors/render/shirt-cloth-motion.d.ts +31 -0
- package/dist/ui/shirt-sponsors/render/shirt-cloth-motion.d.ts.map +1 -0
- package/dist/ui/shirt-sponsors/render/shirt-silhouette.d.ts +9 -0
- package/dist/ui/shirt-sponsors/render/shirt-silhouette.d.ts.map +1 -0
- package/dist/ui/shirt-sponsors/shirt-auction.d.ts +101 -15
- package/dist/ui/shirt-sponsors/shirt-auction.d.ts.map +1 -1
- package/package.json +12 -4
|
@@ -1,1669 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class CSSResult {
|
|
9
|
-
constructor(cssText, strings, safeToken) {
|
|
10
|
-
this["_$cssResult$"] = true;
|
|
11
|
-
if (safeToken !== constructionToken) {
|
|
12
|
-
throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
13
|
-
}
|
|
14
|
-
this.cssText = cssText;
|
|
15
|
-
this._strings = strings;
|
|
16
|
-
}
|
|
17
|
-
get styleSheet() {
|
|
18
|
-
let styleSheet = this._styleSheet;
|
|
19
|
-
const strings = this._strings;
|
|
20
|
-
if (supportsAdoptingStyleSheets && styleSheet === undefined) {
|
|
21
|
-
const cacheable = strings !== undefined && strings.length === 1;
|
|
22
|
-
if (cacheable) {
|
|
23
|
-
styleSheet = cssTagCache.get(strings);
|
|
24
|
-
}
|
|
25
|
-
if (styleSheet === undefined) {
|
|
26
|
-
(this._styleSheet = styleSheet = new CSSStyleSheet).replaceSync(this.cssText);
|
|
27
|
-
if (cacheable) {
|
|
28
|
-
cssTagCache.set(strings, styleSheet);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return styleSheet;
|
|
33
|
-
}
|
|
34
|
-
toString() {
|
|
35
|
-
return this.cssText;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
var textFromCSSResult = (value) => {
|
|
39
|
-
if (value["_$cssResult$"] === true) {
|
|
40
|
-
return value.cssText;
|
|
41
|
-
} else if (typeof value === "number") {
|
|
42
|
-
return value;
|
|
43
|
-
} else {
|
|
44
|
-
throw new Error(`Value passed to 'css' function must be a 'css' function result: ` + `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` + `to ensure page security.`);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
var unsafeCSS = (value) => new CSSResult(typeof value === "string" ? value : String(value), undefined, constructionToken);
|
|
48
|
-
var css = (strings, ...values) => {
|
|
49
|
-
const cssText = strings.length === 1 ? strings[0] : values.reduce((acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1], strings[0]);
|
|
50
|
-
return new CSSResult(cssText, strings, constructionToken);
|
|
51
|
-
};
|
|
52
|
-
var adoptStyles = (renderRoot, styles) => {
|
|
53
|
-
if (supportsAdoptingStyleSheets) {
|
|
54
|
-
renderRoot.adoptedStyleSheets = styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);
|
|
55
|
-
} else {
|
|
56
|
-
for (const s of styles) {
|
|
57
|
-
const style = document.createElement("style");
|
|
58
|
-
const nonce = global["litNonce"];
|
|
59
|
-
if (nonce !== undefined) {
|
|
60
|
-
style.setAttribute("nonce", nonce);
|
|
61
|
-
}
|
|
62
|
-
style.textContent = s.cssText;
|
|
63
|
-
renderRoot.appendChild(style);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var cssResultFromStyleSheet = (sheet) => {
|
|
68
|
-
let cssText = "";
|
|
69
|
-
for (const rule of sheet.cssRules) {
|
|
70
|
-
cssText += rule.cssText;
|
|
71
|
-
}
|
|
72
|
-
return unsafeCSS(cssText);
|
|
73
|
-
};
|
|
74
|
-
var getCompatibleStyle = supportsAdoptingStyleSheets || NODE_MODE && global.CSSStyleSheet === undefined ? (s) => s : (s) => s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;
|
|
75
|
-
|
|
76
|
-
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/development/reactive-element.js
|
|
77
|
-
var { is, defineProperty, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf } = Object;
|
|
78
|
-
var NODE_MODE2 = false;
|
|
79
|
-
var global2 = globalThis;
|
|
80
|
-
if (NODE_MODE2) {
|
|
81
|
-
global2.customElements ??= customElements;
|
|
82
|
-
}
|
|
83
|
-
var DEV_MODE = true;
|
|
84
|
-
var issueWarning;
|
|
85
|
-
var trustedTypes = global2.trustedTypes;
|
|
86
|
-
var emptyStringForBooleanAttribute = trustedTypes ? trustedTypes.emptyScript : "";
|
|
87
|
-
var polyfillSupport = DEV_MODE ? global2.reactiveElementPolyfillSupportDevMode : global2.reactiveElementPolyfillSupport;
|
|
88
|
-
if (DEV_MODE) {
|
|
89
|
-
global2.litIssuedWarnings ??= new Set;
|
|
90
|
-
issueWarning = (code, warning) => {
|
|
91
|
-
warning += ` See https://lit.dev/msg/${code} for more information.`;
|
|
92
|
-
if (!global2.litIssuedWarnings.has(warning) && !global2.litIssuedWarnings.has(code)) {
|
|
93
|
-
console.warn(warning);
|
|
94
|
-
global2.litIssuedWarnings.add(warning);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
queueMicrotask(() => {
|
|
98
|
-
issueWarning("dev-mode", `Lit is in dev mode. Not recommended for production!`);
|
|
99
|
-
if (global2.ShadyDOM?.inUse && polyfillSupport === undefined) {
|
|
100
|
-
issueWarning("polyfill-support-missing", `Shadow DOM is being polyfilled via \`ShadyDOM\` but ` + `the \`polyfill-support\` module has not been loaded.`);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
var debugLogEvent = DEV_MODE ? (event) => {
|
|
105
|
-
const shouldEmit = global2.emitLitDebugLogEvents;
|
|
106
|
-
if (!shouldEmit) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
global2.dispatchEvent(new CustomEvent("lit-debug", {
|
|
110
|
-
detail: event
|
|
111
|
-
}));
|
|
112
|
-
} : undefined;
|
|
113
|
-
var JSCompiler_renameProperty = (prop, _obj) => prop;
|
|
114
|
-
var defaultConverter = {
|
|
115
|
-
toAttribute(value, type) {
|
|
116
|
-
switch (type) {
|
|
117
|
-
case Boolean:
|
|
118
|
-
value = value ? emptyStringForBooleanAttribute : null;
|
|
119
|
-
break;
|
|
120
|
-
case Object:
|
|
121
|
-
case Array:
|
|
122
|
-
value = value == null ? value : JSON.stringify(value);
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
return value;
|
|
126
|
-
},
|
|
127
|
-
fromAttribute(value, type) {
|
|
128
|
-
let fromValue = value;
|
|
129
|
-
switch (type) {
|
|
130
|
-
case Boolean:
|
|
131
|
-
fromValue = value !== null;
|
|
132
|
-
break;
|
|
133
|
-
case Number:
|
|
134
|
-
fromValue = value === null ? null : Number(value);
|
|
135
|
-
break;
|
|
136
|
-
case Object:
|
|
137
|
-
case Array:
|
|
138
|
-
try {
|
|
139
|
-
fromValue = JSON.parse(value);
|
|
140
|
-
} catch (e) {
|
|
141
|
-
fromValue = null;
|
|
142
|
-
}
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
return fromValue;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
var notEqual = (value, old) => !is(value, old);
|
|
149
|
-
var defaultPropertyDeclaration = {
|
|
150
|
-
attribute: true,
|
|
151
|
-
type: String,
|
|
152
|
-
converter: defaultConverter,
|
|
153
|
-
reflect: false,
|
|
154
|
-
useDefault: false,
|
|
155
|
-
hasChanged: notEqual
|
|
156
|
-
};
|
|
157
|
-
Symbol.metadata ??= Symbol("metadata");
|
|
158
|
-
global2.litPropertyMetadata ??= new WeakMap;
|
|
159
|
-
|
|
160
|
-
class ReactiveElement extends HTMLElement {
|
|
161
|
-
static addInitializer(initializer) {
|
|
162
|
-
this.__prepare();
|
|
163
|
-
(this._initializers ??= []).push(initializer);
|
|
164
|
-
}
|
|
165
|
-
static get observedAttributes() {
|
|
166
|
-
this.finalize();
|
|
167
|
-
return this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()];
|
|
168
|
-
}
|
|
169
|
-
static createProperty(name, options = defaultPropertyDeclaration) {
|
|
170
|
-
if (options.state) {
|
|
171
|
-
options.attribute = false;
|
|
172
|
-
}
|
|
173
|
-
this.__prepare();
|
|
174
|
-
if (this.prototype.hasOwnProperty(name)) {
|
|
175
|
-
options = Object.create(options);
|
|
176
|
-
options.wrapped = true;
|
|
177
|
-
}
|
|
178
|
-
this.elementProperties.set(name, options);
|
|
179
|
-
if (!options.noAccessor) {
|
|
180
|
-
const key = DEV_MODE ? Symbol.for(`${String(name)} (@property() cache)`) : Symbol();
|
|
181
|
-
const descriptor = this.getPropertyDescriptor(name, key, options);
|
|
182
|
-
if (descriptor !== undefined) {
|
|
183
|
-
defineProperty(this.prototype, name, descriptor);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
static getPropertyDescriptor(name, key, options) {
|
|
188
|
-
const { get, set } = getOwnPropertyDescriptor(this.prototype, name) ?? {
|
|
189
|
-
get() {
|
|
190
|
-
return this[key];
|
|
191
|
-
},
|
|
192
|
-
set(v) {
|
|
193
|
-
this[key] = v;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
if (DEV_MODE && get == null) {
|
|
197
|
-
if ("value" in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {
|
|
198
|
-
throw new Error(`Field ${JSON.stringify(String(name))} on ` + `${this.name} was declared as a reactive property ` + `but it's actually declared as a value on the prototype. ` + `Usually this is due to using @property or @state on a method.`);
|
|
199
|
-
}
|
|
200
|
-
issueWarning("reactive-property-without-getter", `Field ${JSON.stringify(String(name))} on ` + `${this.name} was declared as a reactive property ` + `but it does not have a getter. This will be an error in a ` + `future version of Lit.`);
|
|
201
|
-
}
|
|
202
|
-
return {
|
|
203
|
-
get,
|
|
204
|
-
set(value) {
|
|
205
|
-
const oldValue = get?.call(this);
|
|
206
|
-
set?.call(this, value);
|
|
207
|
-
this.requestUpdate(name, oldValue, options);
|
|
208
|
-
},
|
|
209
|
-
configurable: true,
|
|
210
|
-
enumerable: true
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
static getPropertyOptions(name) {
|
|
214
|
-
return this.elementProperties.get(name) ?? defaultPropertyDeclaration;
|
|
215
|
-
}
|
|
216
|
-
static __prepare() {
|
|
217
|
-
if (this.hasOwnProperty(JSCompiler_renameProperty("elementProperties", this))) {
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
const superCtor = getPrototypeOf(this);
|
|
221
|
-
superCtor.finalize();
|
|
222
|
-
if (superCtor._initializers !== undefined) {
|
|
223
|
-
this._initializers = [...superCtor._initializers];
|
|
224
|
-
}
|
|
225
|
-
this.elementProperties = new Map(superCtor.elementProperties);
|
|
226
|
-
}
|
|
227
|
-
static finalize() {
|
|
228
|
-
if (this.hasOwnProperty(JSCompiler_renameProperty("finalized", this))) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
this.finalized = true;
|
|
232
|
-
this.__prepare();
|
|
233
|
-
if (this.hasOwnProperty(JSCompiler_renameProperty("properties", this))) {
|
|
234
|
-
const props = this.properties;
|
|
235
|
-
const propKeys = [
|
|
236
|
-
...getOwnPropertyNames(props),
|
|
237
|
-
...getOwnPropertySymbols(props)
|
|
238
|
-
];
|
|
239
|
-
for (const p of propKeys) {
|
|
240
|
-
this.createProperty(p, props[p]);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
const metadata = this[Symbol.metadata];
|
|
244
|
-
if (metadata !== null) {
|
|
245
|
-
const properties = litPropertyMetadata.get(metadata);
|
|
246
|
-
if (properties !== undefined) {
|
|
247
|
-
for (const [p, options] of properties) {
|
|
248
|
-
this.elementProperties.set(p, options);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
this.__attributeToPropertyMap = new Map;
|
|
253
|
-
for (const [p, options] of this.elementProperties) {
|
|
254
|
-
const attr = this.__attributeNameForProperty(p, options);
|
|
255
|
-
if (attr !== undefined) {
|
|
256
|
-
this.__attributeToPropertyMap.set(attr, p);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
this.elementStyles = this.finalizeStyles(this.styles);
|
|
260
|
-
if (DEV_MODE) {
|
|
261
|
-
if (this.hasOwnProperty("createProperty")) {
|
|
262
|
-
issueWarning("no-override-create-property", "Overriding ReactiveElement.createProperty() is deprecated. " + "The override will not be called with standard decorators");
|
|
263
|
-
}
|
|
264
|
-
if (this.hasOwnProperty("getPropertyDescriptor")) {
|
|
265
|
-
issueWarning("no-override-get-property-descriptor", "Overriding ReactiveElement.getPropertyDescriptor() is deprecated. " + "The override will not be called with standard decorators");
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
static finalizeStyles(styles) {
|
|
270
|
-
const elementStyles = [];
|
|
271
|
-
if (Array.isArray(styles)) {
|
|
272
|
-
const set = new Set(styles.flat(Infinity).reverse());
|
|
273
|
-
for (const s of set) {
|
|
274
|
-
elementStyles.unshift(getCompatibleStyle(s));
|
|
275
|
-
}
|
|
276
|
-
} else if (styles !== undefined) {
|
|
277
|
-
elementStyles.push(getCompatibleStyle(styles));
|
|
278
|
-
}
|
|
279
|
-
return elementStyles;
|
|
280
|
-
}
|
|
281
|
-
static __attributeNameForProperty(name, options) {
|
|
282
|
-
const attribute = options.attribute;
|
|
283
|
-
return attribute === false ? undefined : typeof attribute === "string" ? attribute : typeof name === "string" ? name.toLowerCase() : undefined;
|
|
284
|
-
}
|
|
285
|
-
constructor() {
|
|
286
|
-
super();
|
|
287
|
-
this.__instanceProperties = undefined;
|
|
288
|
-
this.isUpdatePending = false;
|
|
289
|
-
this.hasUpdated = false;
|
|
290
|
-
this.__reflectingProperty = null;
|
|
291
|
-
this.__initialize();
|
|
292
|
-
}
|
|
293
|
-
__initialize() {
|
|
294
|
-
this.__updatePromise = new Promise((res) => this.enableUpdating = res);
|
|
295
|
-
this._$changedProperties = new Map;
|
|
296
|
-
this.__saveInstanceProperties();
|
|
297
|
-
this.requestUpdate();
|
|
298
|
-
this.constructor._initializers?.forEach((i) => i(this));
|
|
299
|
-
}
|
|
300
|
-
addController(controller) {
|
|
301
|
-
(this.__controllers ??= new Set).add(controller);
|
|
302
|
-
if (this.renderRoot !== undefined && this.isConnected) {
|
|
303
|
-
controller.hostConnected?.();
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
removeController(controller) {
|
|
307
|
-
this.__controllers?.delete(controller);
|
|
308
|
-
}
|
|
309
|
-
__saveInstanceProperties() {
|
|
310
|
-
const instanceProperties = new Map;
|
|
311
|
-
const elementProperties = this.constructor.elementProperties;
|
|
312
|
-
for (const p of elementProperties.keys()) {
|
|
313
|
-
if (this.hasOwnProperty(p)) {
|
|
314
|
-
instanceProperties.set(p, this[p]);
|
|
315
|
-
delete this[p];
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
if (instanceProperties.size > 0) {
|
|
319
|
-
this.__instanceProperties = instanceProperties;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
createRenderRoot() {
|
|
323
|
-
const renderRoot = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
324
|
-
adoptStyles(renderRoot, this.constructor.elementStyles);
|
|
325
|
-
return renderRoot;
|
|
326
|
-
}
|
|
327
|
-
connectedCallback() {
|
|
328
|
-
this.renderRoot ??= this.createRenderRoot();
|
|
329
|
-
this.enableUpdating(true);
|
|
330
|
-
this.__controllers?.forEach((c) => c.hostConnected?.());
|
|
331
|
-
}
|
|
332
|
-
enableUpdating(_requestedUpdate) {}
|
|
333
|
-
disconnectedCallback() {
|
|
334
|
-
this.__controllers?.forEach((c) => c.hostDisconnected?.());
|
|
335
|
-
}
|
|
336
|
-
attributeChangedCallback(name, _old, value) {
|
|
337
|
-
this._$attributeToProperty(name, value);
|
|
338
|
-
}
|
|
339
|
-
__propertyToAttribute(name, value) {
|
|
340
|
-
const elemProperties = this.constructor.elementProperties;
|
|
341
|
-
const options = elemProperties.get(name);
|
|
342
|
-
const attr = this.constructor.__attributeNameForProperty(name, options);
|
|
343
|
-
if (attr !== undefined && options.reflect === true) {
|
|
344
|
-
const converter = options.converter?.toAttribute !== undefined ? options.converter : defaultConverter;
|
|
345
|
-
const attrValue = converter.toAttribute(value, options.type);
|
|
346
|
-
if (DEV_MODE && this.constructor.enabledWarnings.includes("migration") && attrValue === undefined) {
|
|
347
|
-
issueWarning("undefined-attribute-value", `The attribute value for the ${name} property is ` + `undefined on element ${this.localName}. The attribute will be ` + `removed, but in the previous version of \`ReactiveElement\`, ` + `the attribute would not have changed.`);
|
|
348
|
-
}
|
|
349
|
-
this.__reflectingProperty = name;
|
|
350
|
-
if (attrValue == null) {
|
|
351
|
-
this.removeAttribute(attr);
|
|
352
|
-
} else {
|
|
353
|
-
this.setAttribute(attr, attrValue);
|
|
354
|
-
}
|
|
355
|
-
this.__reflectingProperty = null;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
_$attributeToProperty(name, value) {
|
|
359
|
-
const ctor = this.constructor;
|
|
360
|
-
const propName = ctor.__attributeToPropertyMap.get(name);
|
|
361
|
-
if (propName !== undefined && this.__reflectingProperty !== propName) {
|
|
362
|
-
const options = ctor.getPropertyOptions(propName);
|
|
363
|
-
const converter = typeof options.converter === "function" ? { fromAttribute: options.converter } : options.converter?.fromAttribute !== undefined ? options.converter : defaultConverter;
|
|
364
|
-
this.__reflectingProperty = propName;
|
|
365
|
-
const convertedValue = converter.fromAttribute(value, options.type);
|
|
366
|
-
this[propName] = convertedValue ?? this.__defaultValues?.get(propName) ?? convertedValue;
|
|
367
|
-
this.__reflectingProperty = null;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
requestUpdate(name, oldValue, options, useNewValue = false, newValue) {
|
|
371
|
-
if (name !== undefined) {
|
|
372
|
-
if (DEV_MODE && name instanceof Event) {
|
|
373
|
-
issueWarning(``, `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`);
|
|
374
|
-
}
|
|
375
|
-
const ctor = this.constructor;
|
|
376
|
-
if (useNewValue === false) {
|
|
377
|
-
newValue = this[name];
|
|
378
|
-
}
|
|
379
|
-
options ??= ctor.getPropertyOptions(name);
|
|
380
|
-
const changed = (options.hasChanged ?? notEqual)(newValue, oldValue) || options.useDefault && options.reflect && newValue === this.__defaultValues?.get(name) && !this.hasAttribute(ctor.__attributeNameForProperty(name, options));
|
|
381
|
-
if (changed) {
|
|
382
|
-
this._$changeProperty(name, oldValue, options);
|
|
383
|
-
} else {
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
if (this.isUpdatePending === false) {
|
|
388
|
-
this.__updatePromise = this.__enqueueUpdate();
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
_$changeProperty(name, oldValue, { useDefault, reflect, wrapped }, initializeValue) {
|
|
392
|
-
if (useDefault && !(this.__defaultValues ??= new Map).has(name)) {
|
|
393
|
-
this.__defaultValues.set(name, initializeValue ?? oldValue ?? this[name]);
|
|
394
|
-
if (wrapped !== true || initializeValue !== undefined) {
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
if (!this._$changedProperties.has(name)) {
|
|
399
|
-
if (!this.hasUpdated && !useDefault) {
|
|
400
|
-
oldValue = undefined;
|
|
401
|
-
}
|
|
402
|
-
this._$changedProperties.set(name, oldValue);
|
|
403
|
-
}
|
|
404
|
-
if (reflect === true && this.__reflectingProperty !== name) {
|
|
405
|
-
(this.__reflectingProperties ??= new Set).add(name);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
async __enqueueUpdate() {
|
|
409
|
-
this.isUpdatePending = true;
|
|
410
|
-
try {
|
|
411
|
-
await this.__updatePromise;
|
|
412
|
-
} catch (e) {
|
|
413
|
-
Promise.reject(e);
|
|
414
|
-
}
|
|
415
|
-
const result = this.scheduleUpdate();
|
|
416
|
-
if (result != null) {
|
|
417
|
-
await result;
|
|
418
|
-
}
|
|
419
|
-
return !this.isUpdatePending;
|
|
420
|
-
}
|
|
421
|
-
scheduleUpdate() {
|
|
422
|
-
const result = this.performUpdate();
|
|
423
|
-
if (DEV_MODE && this.constructor.enabledWarnings.includes("async-perform-update") && typeof result?.then === "function") {
|
|
424
|
-
issueWarning("async-perform-update", `Element ${this.localName} returned a Promise from performUpdate(). ` + `This behavior is deprecated and will be removed in a future ` + `version of ReactiveElement.`);
|
|
425
|
-
}
|
|
426
|
-
return result;
|
|
427
|
-
}
|
|
428
|
-
performUpdate() {
|
|
429
|
-
if (!this.isUpdatePending) {
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
debugLogEvent?.({ kind: "update" });
|
|
433
|
-
if (!this.hasUpdated) {
|
|
434
|
-
this.renderRoot ??= this.createRenderRoot();
|
|
435
|
-
if (DEV_MODE) {
|
|
436
|
-
const ctor = this.constructor;
|
|
437
|
-
const shadowedProperties = [...ctor.elementProperties.keys()].filter((p) => this.hasOwnProperty(p) && (p in getPrototypeOf(this)));
|
|
438
|
-
if (shadowedProperties.length) {
|
|
439
|
-
throw new Error(`The following properties on element ${this.localName} will not ` + `trigger updates as expected because they are set using class ` + `fields: ${shadowedProperties.join(", ")}. ` + `Native class fields and some compiled output will overwrite ` + `accessors used for detecting changes. See ` + `https://lit.dev/msg/class-field-shadowing ` + `for more information.`);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
if (this.__instanceProperties) {
|
|
443
|
-
for (const [p, value] of this.__instanceProperties) {
|
|
444
|
-
this[p] = value;
|
|
445
|
-
}
|
|
446
|
-
this.__instanceProperties = undefined;
|
|
447
|
-
}
|
|
448
|
-
const elementProperties = this.constructor.elementProperties;
|
|
449
|
-
if (elementProperties.size > 0) {
|
|
450
|
-
for (const [p, options] of elementProperties) {
|
|
451
|
-
const { wrapped } = options;
|
|
452
|
-
const value = this[p];
|
|
453
|
-
if (wrapped === true && !this._$changedProperties.has(p) && value !== undefined) {
|
|
454
|
-
this._$changeProperty(p, undefined, options, value);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
let shouldUpdate = false;
|
|
460
|
-
const changedProperties = this._$changedProperties;
|
|
461
|
-
try {
|
|
462
|
-
shouldUpdate = this.shouldUpdate(changedProperties);
|
|
463
|
-
if (shouldUpdate) {
|
|
464
|
-
this.willUpdate(changedProperties);
|
|
465
|
-
this.__controllers?.forEach((c) => c.hostUpdate?.());
|
|
466
|
-
this.update(changedProperties);
|
|
467
|
-
} else {
|
|
468
|
-
this.__markUpdated();
|
|
469
|
-
}
|
|
470
|
-
} catch (e) {
|
|
471
|
-
shouldUpdate = false;
|
|
472
|
-
this.__markUpdated();
|
|
473
|
-
throw e;
|
|
474
|
-
}
|
|
475
|
-
if (shouldUpdate) {
|
|
476
|
-
this._$didUpdate(changedProperties);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
willUpdate(_changedProperties) {}
|
|
480
|
-
_$didUpdate(changedProperties) {
|
|
481
|
-
this.__controllers?.forEach((c) => c.hostUpdated?.());
|
|
482
|
-
if (!this.hasUpdated) {
|
|
483
|
-
this.hasUpdated = true;
|
|
484
|
-
this.firstUpdated(changedProperties);
|
|
485
|
-
}
|
|
486
|
-
this.updated(changedProperties);
|
|
487
|
-
if (DEV_MODE && this.isUpdatePending && this.constructor.enabledWarnings.includes("change-in-update")) {
|
|
488
|
-
issueWarning("change-in-update", `Element ${this.localName} scheduled an update ` + `(generally because a property was set) ` + `after an update completed, causing a new update to be scheduled. ` + `This is inefficient and should be avoided unless the next update ` + `can only be scheduled as a side effect of the previous update.`);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
__markUpdated() {
|
|
492
|
-
this._$changedProperties = new Map;
|
|
493
|
-
this.isUpdatePending = false;
|
|
494
|
-
}
|
|
495
|
-
get updateComplete() {
|
|
496
|
-
return this.getUpdateComplete();
|
|
497
|
-
}
|
|
498
|
-
getUpdateComplete() {
|
|
499
|
-
return this.__updatePromise;
|
|
500
|
-
}
|
|
501
|
-
shouldUpdate(_changedProperties) {
|
|
502
|
-
return true;
|
|
503
|
-
}
|
|
504
|
-
update(_changedProperties) {
|
|
505
|
-
this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) => this.__propertyToAttribute(p, this[p]));
|
|
506
|
-
this.__markUpdated();
|
|
507
|
-
}
|
|
508
|
-
updated(_changedProperties) {}
|
|
509
|
-
firstUpdated(_changedProperties) {}
|
|
510
|
-
}
|
|
511
|
-
ReactiveElement.elementStyles = [];
|
|
512
|
-
ReactiveElement.shadowRootOptions = { mode: "open" };
|
|
513
|
-
ReactiveElement[JSCompiler_renameProperty("elementProperties", ReactiveElement)] = new Map;
|
|
514
|
-
ReactiveElement[JSCompiler_renameProperty("finalized", ReactiveElement)] = new Map;
|
|
515
|
-
polyfillSupport?.({ ReactiveElement });
|
|
516
|
-
if (DEV_MODE) {
|
|
517
|
-
ReactiveElement.enabledWarnings = [
|
|
518
|
-
"change-in-update",
|
|
519
|
-
"async-perform-update"
|
|
520
|
-
];
|
|
521
|
-
const ensureOwnWarnings = function(ctor) {
|
|
522
|
-
if (!ctor.hasOwnProperty(JSCompiler_renameProperty("enabledWarnings", ctor))) {
|
|
523
|
-
ctor.enabledWarnings = ctor.enabledWarnings.slice();
|
|
524
|
-
}
|
|
525
|
-
};
|
|
526
|
-
ReactiveElement.enableWarning = function(warning) {
|
|
527
|
-
ensureOwnWarnings(this);
|
|
528
|
-
if (!this.enabledWarnings.includes(warning)) {
|
|
529
|
-
this.enabledWarnings.push(warning);
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
ReactiveElement.disableWarning = function(warning) {
|
|
533
|
-
ensureOwnWarnings(this);
|
|
534
|
-
const i = this.enabledWarnings.indexOf(warning);
|
|
535
|
-
if (i >= 0) {
|
|
536
|
-
this.enabledWarnings.splice(i, 1);
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
(global2.reactiveElementVersions ??= []).push("2.1.2");
|
|
541
|
-
if (DEV_MODE && global2.reactiveElementVersions.length > 1) {
|
|
542
|
-
queueMicrotask(() => {
|
|
543
|
-
issueWarning("multiple-versions", `Multiple versions of Lit loaded. Loading multiple versions ` + `is not recommended.`);
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
// ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/development/lit-html.js
|
|
548
|
-
var DEV_MODE2 = true;
|
|
549
|
-
var ENABLE_EXTRA_SECURITY_HOOKS = true;
|
|
550
|
-
var ENABLE_SHADYDOM_NOPATCH = true;
|
|
551
|
-
var NODE_MODE3 = false;
|
|
552
|
-
var global3 = globalThis;
|
|
553
|
-
var debugLogEvent2 = DEV_MODE2 ? (event) => {
|
|
554
|
-
const shouldEmit = global3.emitLitDebugLogEvents;
|
|
555
|
-
if (!shouldEmit) {
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
558
|
-
global3.dispatchEvent(new CustomEvent("lit-debug", {
|
|
559
|
-
detail: event
|
|
560
|
-
}));
|
|
561
|
-
} : undefined;
|
|
562
|
-
var debugLogRenderId = 0;
|
|
563
|
-
var issueWarning2;
|
|
564
|
-
if (DEV_MODE2) {
|
|
565
|
-
global3.litIssuedWarnings ??= new Set;
|
|
566
|
-
issueWarning2 = (code, warning) => {
|
|
567
|
-
warning += code ? ` See https://lit.dev/msg/${code} for more information.` : "";
|
|
568
|
-
if (!global3.litIssuedWarnings.has(warning) && !global3.litIssuedWarnings.has(code)) {
|
|
569
|
-
console.warn(warning);
|
|
570
|
-
global3.litIssuedWarnings.add(warning);
|
|
571
|
-
}
|
|
572
|
-
};
|
|
573
|
-
queueMicrotask(() => {
|
|
574
|
-
issueWarning2("dev-mode", `Lit is in dev mode. Not recommended for production!`);
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
var wrap = ENABLE_SHADYDOM_NOPATCH && global3.ShadyDOM?.inUse && global3.ShadyDOM?.noPatch === true ? global3.ShadyDOM.wrap : (node) => node;
|
|
578
|
-
var trustedTypes2 = global3.trustedTypes;
|
|
579
|
-
var policy = trustedTypes2 ? trustedTypes2.createPolicy("lit-html", {
|
|
580
|
-
createHTML: (s) => s
|
|
581
|
-
}) : undefined;
|
|
582
|
-
var identityFunction = (value) => value;
|
|
583
|
-
var noopSanitizer = (_node, _name, _type) => identityFunction;
|
|
584
|
-
var setSanitizer = (newSanitizer) => {
|
|
585
|
-
if (!ENABLE_EXTRA_SECURITY_HOOKS) {
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
if (sanitizerFactoryInternal !== noopSanitizer) {
|
|
589
|
-
throw new Error(`Attempted to overwrite existing lit-html security policy.` + ` setSanitizeDOMValueFactory should be called at most once.`);
|
|
590
|
-
}
|
|
591
|
-
sanitizerFactoryInternal = newSanitizer;
|
|
592
|
-
};
|
|
593
|
-
var _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {
|
|
594
|
-
sanitizerFactoryInternal = noopSanitizer;
|
|
595
|
-
};
|
|
596
|
-
var createSanitizer = (node, name, type) => {
|
|
597
|
-
return sanitizerFactoryInternal(node, name, type);
|
|
598
|
-
};
|
|
599
|
-
var boundAttributeSuffix = "$lit$";
|
|
600
|
-
var marker = `lit$${Math.random().toFixed(9).slice(2)}$`;
|
|
601
|
-
var markerMatch = "?" + marker;
|
|
602
|
-
var nodeMarker = `<${markerMatch}>`;
|
|
603
|
-
var d = NODE_MODE3 && global3.document === undefined ? {
|
|
604
|
-
createTreeWalker() {
|
|
605
|
-
return {};
|
|
606
|
-
}
|
|
607
|
-
} : document;
|
|
608
|
-
var createMarker = () => d.createComment("");
|
|
609
|
-
var isPrimitive = (value) => value === null || typeof value != "object" && typeof value != "function";
|
|
610
|
-
var isArray = Array.isArray;
|
|
611
|
-
var isIterable = (value) => isArray(value) || typeof value?.[Symbol.iterator] === "function";
|
|
612
|
-
var SPACE_CHAR = `[
|
|
613
|
-
\f\r]`;
|
|
614
|
-
var ATTR_VALUE_CHAR = `[^
|
|
615
|
-
\f\r"'\`<>=]`;
|
|
616
|
-
var NAME_CHAR = `[^\\s"'>=/]`;
|
|
617
|
-
var textEndRegex = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
|
|
618
|
-
var COMMENT_START = 1;
|
|
619
|
-
var TAG_NAME = 2;
|
|
620
|
-
var DYNAMIC_TAG_NAME = 3;
|
|
621
|
-
var commentEndRegex = /-->/g;
|
|
622
|
-
var comment2EndRegex = />/g;
|
|
623
|
-
var tagEndRegex = new RegExp(`>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|("|')|))|$)`, "g");
|
|
624
|
-
var ENTIRE_MATCH = 0;
|
|
625
|
-
var ATTRIBUTE_NAME = 1;
|
|
626
|
-
var SPACES_AND_EQUALS = 2;
|
|
627
|
-
var QUOTE_CHAR = 3;
|
|
628
|
-
var singleQuoteAttrEndRegex = /'/g;
|
|
629
|
-
var doubleQuoteAttrEndRegex = /"/g;
|
|
630
|
-
var rawTextElement = /^(?:script|style|textarea|title)$/i;
|
|
631
|
-
var HTML_RESULT = 1;
|
|
632
|
-
var SVG_RESULT = 2;
|
|
633
|
-
var MATHML_RESULT = 3;
|
|
634
|
-
var ATTRIBUTE_PART = 1;
|
|
635
|
-
var CHILD_PART = 2;
|
|
636
|
-
var PROPERTY_PART = 3;
|
|
637
|
-
var BOOLEAN_ATTRIBUTE_PART = 4;
|
|
638
|
-
var EVENT_PART = 5;
|
|
639
|
-
var ELEMENT_PART = 6;
|
|
640
|
-
var COMMENT_PART = 7;
|
|
641
|
-
var tag = (type) => (strings, ...values) => {
|
|
642
|
-
if (DEV_MODE2 && strings.some((s) => s === undefined)) {
|
|
643
|
-
console.warn(`Some template strings are undefined.
|
|
644
|
-
` + "This is probably caused by illegal octal escape sequences.");
|
|
645
|
-
}
|
|
646
|
-
if (DEV_MODE2) {
|
|
647
|
-
if (values.some((val) => val?.["_$litStatic$"])) {
|
|
648
|
-
issueWarning2("", `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.
|
|
649
|
-
` + `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
return {
|
|
653
|
-
["_$litType$"]: type,
|
|
654
|
-
strings,
|
|
655
|
-
values
|
|
656
|
-
};
|
|
657
|
-
};
|
|
658
|
-
var html = tag(HTML_RESULT);
|
|
659
|
-
var svg = tag(SVG_RESULT);
|
|
660
|
-
var mathml = tag(MATHML_RESULT);
|
|
661
|
-
var noChange = Symbol.for("lit-noChange");
|
|
662
|
-
var nothing = Symbol.for("lit-nothing");
|
|
663
|
-
var templateCache = new WeakMap;
|
|
664
|
-
var walker = d.createTreeWalker(d, 129);
|
|
665
|
-
var sanitizerFactoryInternal = noopSanitizer;
|
|
666
|
-
function trustFromTemplateString(tsa, stringFromTSA) {
|
|
667
|
-
if (!isArray(tsa) || !tsa.hasOwnProperty("raw")) {
|
|
668
|
-
let message = "invalid template strings array";
|
|
669
|
-
if (DEV_MODE2) {
|
|
670
|
-
message = `
|
|
671
|
-
Internal Error: expected template strings to be an array
|
|
672
|
-
with a 'raw' field. Faking a template strings array by
|
|
673
|
-
calling html or svg like an ordinary function is effectively
|
|
674
|
-
the same as calling unsafeHtml and can lead to major security
|
|
675
|
-
issues, e.g. opening your code up to XSS attacks.
|
|
676
|
-
If you're using the html or svg tagged template functions normally
|
|
677
|
-
and still seeing this error, please file a bug at
|
|
678
|
-
https://github.com/lit/lit/issues/new?template=bug_report.md
|
|
679
|
-
and include information about your build tooling, if any.
|
|
680
|
-
`.trim().replace(/\n */g, `
|
|
681
|
-
`);
|
|
682
|
-
}
|
|
683
|
-
throw new Error(message);
|
|
684
|
-
}
|
|
685
|
-
return policy !== undefined ? policy.createHTML(stringFromTSA) : stringFromTSA;
|
|
686
|
-
}
|
|
687
|
-
var getTemplateHtml = (strings, type) => {
|
|
688
|
-
const l = strings.length - 1;
|
|
689
|
-
const attrNames = [];
|
|
690
|
-
let html = type === SVG_RESULT ? "<svg>" : type === MATHML_RESULT ? "<math>" : "";
|
|
691
|
-
let rawTextEndRegex;
|
|
692
|
-
let regex = textEndRegex;
|
|
693
|
-
for (let i = 0;i < l; i++) {
|
|
694
|
-
const s = strings[i];
|
|
695
|
-
let attrNameEndIndex = -1;
|
|
696
|
-
let attrName;
|
|
697
|
-
let lastIndex = 0;
|
|
698
|
-
let match;
|
|
699
|
-
while (lastIndex < s.length) {
|
|
700
|
-
regex.lastIndex = lastIndex;
|
|
701
|
-
match = regex.exec(s);
|
|
702
|
-
if (match === null) {
|
|
703
|
-
break;
|
|
704
|
-
}
|
|
705
|
-
lastIndex = regex.lastIndex;
|
|
706
|
-
if (regex === textEndRegex) {
|
|
707
|
-
if (match[COMMENT_START] === "!--") {
|
|
708
|
-
regex = commentEndRegex;
|
|
709
|
-
} else if (match[COMMENT_START] !== undefined) {
|
|
710
|
-
regex = comment2EndRegex;
|
|
711
|
-
} else if (match[TAG_NAME] !== undefined) {
|
|
712
|
-
if (rawTextElement.test(match[TAG_NAME])) {
|
|
713
|
-
rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, "g");
|
|
714
|
-
}
|
|
715
|
-
regex = tagEndRegex;
|
|
716
|
-
} else if (match[DYNAMIC_TAG_NAME] !== undefined) {
|
|
717
|
-
if (DEV_MODE2) {
|
|
718
|
-
throw new Error("Bindings in tag names are not supported. Please use static templates instead. " + "See https://lit.dev/docs/templates/expressions/#static-expressions");
|
|
719
|
-
}
|
|
720
|
-
regex = tagEndRegex;
|
|
721
|
-
}
|
|
722
|
-
} else if (regex === tagEndRegex) {
|
|
723
|
-
if (match[ENTIRE_MATCH] === ">") {
|
|
724
|
-
regex = rawTextEndRegex ?? textEndRegex;
|
|
725
|
-
attrNameEndIndex = -1;
|
|
726
|
-
} else if (match[ATTRIBUTE_NAME] === undefined) {
|
|
727
|
-
attrNameEndIndex = -2;
|
|
728
|
-
} else {
|
|
729
|
-
attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;
|
|
730
|
-
attrName = match[ATTRIBUTE_NAME];
|
|
731
|
-
regex = match[QUOTE_CHAR] === undefined ? tagEndRegex : match[QUOTE_CHAR] === '"' ? doubleQuoteAttrEndRegex : singleQuoteAttrEndRegex;
|
|
732
|
-
}
|
|
733
|
-
} else if (regex === doubleQuoteAttrEndRegex || regex === singleQuoteAttrEndRegex) {
|
|
734
|
-
regex = tagEndRegex;
|
|
735
|
-
} else if (regex === commentEndRegex || regex === comment2EndRegex) {
|
|
736
|
-
regex = textEndRegex;
|
|
737
|
-
} else {
|
|
738
|
-
regex = tagEndRegex;
|
|
739
|
-
rawTextEndRegex = undefined;
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
if (DEV_MODE2) {
|
|
743
|
-
console.assert(attrNameEndIndex === -1 || regex === tagEndRegex || regex === singleQuoteAttrEndRegex || regex === doubleQuoteAttrEndRegex, "unexpected parse state B");
|
|
744
|
-
}
|
|
745
|
-
const end = regex === tagEndRegex && strings[i + 1].startsWith("/>") ? " " : "";
|
|
746
|
-
html += regex === textEndRegex ? s + nodeMarker : attrNameEndIndex >= 0 ? (attrNames.push(attrName), s.slice(0, attrNameEndIndex) + boundAttributeSuffix + s.slice(attrNameEndIndex)) + marker + end : s + marker + (attrNameEndIndex === -2 ? i : end);
|
|
747
|
-
}
|
|
748
|
-
const htmlResult = html + (strings[l] || "<?>") + (type === SVG_RESULT ? "</svg>" : type === MATHML_RESULT ? "</math>" : "");
|
|
749
|
-
return [trustFromTemplateString(strings, htmlResult), attrNames];
|
|
750
|
-
};
|
|
751
|
-
|
|
752
|
-
class Template {
|
|
753
|
-
constructor({ strings, ["_$litType$"]: type }, options) {
|
|
754
|
-
this.parts = [];
|
|
755
|
-
let node;
|
|
756
|
-
let nodeIndex = 0;
|
|
757
|
-
let attrNameIndex = 0;
|
|
758
|
-
const partCount = strings.length - 1;
|
|
759
|
-
const parts = this.parts;
|
|
760
|
-
const [html, attrNames] = getTemplateHtml(strings, type);
|
|
761
|
-
this.el = Template.createElement(html, options);
|
|
762
|
-
walker.currentNode = this.el.content;
|
|
763
|
-
if (type === SVG_RESULT || type === MATHML_RESULT) {
|
|
764
|
-
const wrapper = this.el.content.firstChild;
|
|
765
|
-
wrapper.replaceWith(...wrapper.childNodes);
|
|
766
|
-
}
|
|
767
|
-
while ((node = walker.nextNode()) !== null && parts.length < partCount) {
|
|
768
|
-
if (node.nodeType === 1) {
|
|
769
|
-
if (DEV_MODE2) {
|
|
770
|
-
const tag = node.localName;
|
|
771
|
-
if (/^(?:textarea|template)$/i.test(tag) && node.innerHTML.includes(marker)) {
|
|
772
|
-
const m = `Expressions are not supported inside \`${tag}\` ` + `elements. See https://lit.dev/msg/expression-in-${tag} for more ` + `information.`;
|
|
773
|
-
if (tag === "template") {
|
|
774
|
-
throw new Error(m);
|
|
775
|
-
} else
|
|
776
|
-
issueWarning2("", m);
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
if (node.hasAttributes()) {
|
|
780
|
-
for (const name of node.getAttributeNames()) {
|
|
781
|
-
if (name.endsWith(boundAttributeSuffix)) {
|
|
782
|
-
const realName = attrNames[attrNameIndex++];
|
|
783
|
-
const value = node.getAttribute(name);
|
|
784
|
-
const statics = value.split(marker);
|
|
785
|
-
const m = /([.?@])?(.*)/.exec(realName);
|
|
786
|
-
parts.push({
|
|
787
|
-
type: ATTRIBUTE_PART,
|
|
788
|
-
index: nodeIndex,
|
|
789
|
-
name: m[2],
|
|
790
|
-
strings: statics,
|
|
791
|
-
ctor: m[1] === "." ? PropertyPart : m[1] === "?" ? BooleanAttributePart : m[1] === "@" ? EventPart : AttributePart
|
|
792
|
-
});
|
|
793
|
-
node.removeAttribute(name);
|
|
794
|
-
} else if (name.startsWith(marker)) {
|
|
795
|
-
parts.push({
|
|
796
|
-
type: ELEMENT_PART,
|
|
797
|
-
index: nodeIndex
|
|
798
|
-
});
|
|
799
|
-
node.removeAttribute(name);
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
if (rawTextElement.test(node.tagName)) {
|
|
804
|
-
const strings = node.textContent.split(marker);
|
|
805
|
-
const lastIndex = strings.length - 1;
|
|
806
|
-
if (lastIndex > 0) {
|
|
807
|
-
node.textContent = trustedTypes2 ? trustedTypes2.emptyScript : "";
|
|
808
|
-
for (let i = 0;i < lastIndex; i++) {
|
|
809
|
-
node.append(strings[i], createMarker());
|
|
810
|
-
walker.nextNode();
|
|
811
|
-
parts.push({ type: CHILD_PART, index: ++nodeIndex });
|
|
812
|
-
}
|
|
813
|
-
node.append(strings[lastIndex], createMarker());
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
} else if (node.nodeType === 8) {
|
|
817
|
-
const data = node.data;
|
|
818
|
-
if (data === markerMatch) {
|
|
819
|
-
parts.push({ type: CHILD_PART, index: nodeIndex });
|
|
820
|
-
} else {
|
|
821
|
-
let i = -1;
|
|
822
|
-
while ((i = node.data.indexOf(marker, i + 1)) !== -1) {
|
|
823
|
-
parts.push({ type: COMMENT_PART, index: nodeIndex });
|
|
824
|
-
i += marker.length - 1;
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
nodeIndex++;
|
|
829
|
-
}
|
|
830
|
-
if (DEV_MODE2) {
|
|
831
|
-
if (attrNames.length !== attrNameIndex) {
|
|
832
|
-
throw new Error(`Detected duplicate attribute bindings. This occurs if your template ` + `has duplicate attributes on an element tag. For example ` + `"<input ?disabled=\${true} ?disabled=\${false}>" contains a ` + `duplicate "disabled" attribute. The error was detected in ` + `the following template:
|
|
833
|
-
` + "`" + strings.join("${...}") + "`");
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
debugLogEvent2 && debugLogEvent2({
|
|
837
|
-
kind: "template prep",
|
|
838
|
-
template: this,
|
|
839
|
-
clonableTemplate: this.el,
|
|
840
|
-
parts: this.parts,
|
|
841
|
-
strings
|
|
842
|
-
});
|
|
843
|
-
}
|
|
844
|
-
static createElement(html, _options) {
|
|
845
|
-
const el = d.createElement("template");
|
|
846
|
-
el.innerHTML = html;
|
|
847
|
-
return el;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
function resolveDirective(part, value, parent = part, attributeIndex) {
|
|
851
|
-
if (value === noChange) {
|
|
852
|
-
return value;
|
|
853
|
-
}
|
|
854
|
-
let currentDirective = attributeIndex !== undefined ? parent.__directives?.[attributeIndex] : parent.__directive;
|
|
855
|
-
const nextDirectiveConstructor = isPrimitive(value) ? undefined : value["_$litDirective$"];
|
|
856
|
-
if (currentDirective?.constructor !== nextDirectiveConstructor) {
|
|
857
|
-
currentDirective?.["_$notifyDirectiveConnectionChanged"]?.(false);
|
|
858
|
-
if (nextDirectiveConstructor === undefined) {
|
|
859
|
-
currentDirective = undefined;
|
|
860
|
-
} else {
|
|
861
|
-
currentDirective = new nextDirectiveConstructor(part);
|
|
862
|
-
currentDirective._$initialize(part, parent, attributeIndex);
|
|
863
|
-
}
|
|
864
|
-
if (attributeIndex !== undefined) {
|
|
865
|
-
(parent.__directives ??= [])[attributeIndex] = currentDirective;
|
|
866
|
-
} else {
|
|
867
|
-
parent.__directive = currentDirective;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
if (currentDirective !== undefined) {
|
|
871
|
-
value = resolveDirective(part, currentDirective._$resolve(part, value.values), currentDirective, attributeIndex);
|
|
872
|
-
}
|
|
873
|
-
return value;
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
class TemplateInstance {
|
|
877
|
-
constructor(template, parent) {
|
|
878
|
-
this._$parts = [];
|
|
879
|
-
this._$disconnectableChildren = undefined;
|
|
880
|
-
this._$template = template;
|
|
881
|
-
this._$parent = parent;
|
|
882
|
-
}
|
|
883
|
-
get parentNode() {
|
|
884
|
-
return this._$parent.parentNode;
|
|
885
|
-
}
|
|
886
|
-
get _$isConnected() {
|
|
887
|
-
return this._$parent._$isConnected;
|
|
888
|
-
}
|
|
889
|
-
_clone(options) {
|
|
890
|
-
const { el: { content }, parts } = this._$template;
|
|
891
|
-
const fragment = (options?.creationScope ?? d).importNode(content, true);
|
|
892
|
-
walker.currentNode = fragment;
|
|
893
|
-
let node = walker.nextNode();
|
|
894
|
-
let nodeIndex = 0;
|
|
895
|
-
let partIndex = 0;
|
|
896
|
-
let templatePart = parts[0];
|
|
897
|
-
while (templatePart !== undefined) {
|
|
898
|
-
if (nodeIndex === templatePart.index) {
|
|
899
|
-
let part;
|
|
900
|
-
if (templatePart.type === CHILD_PART) {
|
|
901
|
-
part = new ChildPart(node, node.nextSibling, this, options);
|
|
902
|
-
} else if (templatePart.type === ATTRIBUTE_PART) {
|
|
903
|
-
part = new templatePart.ctor(node, templatePart.name, templatePart.strings, this, options);
|
|
904
|
-
} else if (templatePart.type === ELEMENT_PART) {
|
|
905
|
-
part = new ElementPart(node, this, options);
|
|
906
|
-
}
|
|
907
|
-
this._$parts.push(part);
|
|
908
|
-
templatePart = parts[++partIndex];
|
|
909
|
-
}
|
|
910
|
-
if (nodeIndex !== templatePart?.index) {
|
|
911
|
-
node = walker.nextNode();
|
|
912
|
-
nodeIndex++;
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
walker.currentNode = d;
|
|
916
|
-
return fragment;
|
|
917
|
-
}
|
|
918
|
-
_update(values) {
|
|
919
|
-
let i = 0;
|
|
920
|
-
for (const part of this._$parts) {
|
|
921
|
-
if (part !== undefined) {
|
|
922
|
-
debugLogEvent2 && debugLogEvent2({
|
|
923
|
-
kind: "set part",
|
|
924
|
-
part,
|
|
925
|
-
value: values[i],
|
|
926
|
-
valueIndex: i,
|
|
927
|
-
values,
|
|
928
|
-
templateInstance: this
|
|
929
|
-
});
|
|
930
|
-
if (part.strings !== undefined) {
|
|
931
|
-
part._$setValue(values, part, i);
|
|
932
|
-
i += part.strings.length - 2;
|
|
933
|
-
} else {
|
|
934
|
-
part._$setValue(values[i]);
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
i++;
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
class ChildPart {
|
|
943
|
-
get _$isConnected() {
|
|
944
|
-
return this._$parent?._$isConnected ?? this.__isConnected;
|
|
945
|
-
}
|
|
946
|
-
constructor(startNode, endNode, parent, options) {
|
|
947
|
-
this.type = CHILD_PART;
|
|
948
|
-
this._$committedValue = nothing;
|
|
949
|
-
this._$disconnectableChildren = undefined;
|
|
950
|
-
this._$startNode = startNode;
|
|
951
|
-
this._$endNode = endNode;
|
|
952
|
-
this._$parent = parent;
|
|
953
|
-
this.options = options;
|
|
954
|
-
this.__isConnected = options?.isConnected ?? true;
|
|
955
|
-
if (ENABLE_EXTRA_SECURITY_HOOKS) {
|
|
956
|
-
this._textSanitizer = undefined;
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
get parentNode() {
|
|
960
|
-
let parentNode = wrap(this._$startNode).parentNode;
|
|
961
|
-
const parent = this._$parent;
|
|
962
|
-
if (parent !== undefined && parentNode?.nodeType === 11) {
|
|
963
|
-
parentNode = parent.parentNode;
|
|
964
|
-
}
|
|
965
|
-
return parentNode;
|
|
966
|
-
}
|
|
967
|
-
get startNode() {
|
|
968
|
-
return this._$startNode;
|
|
969
|
-
}
|
|
970
|
-
get endNode() {
|
|
971
|
-
return this._$endNode;
|
|
972
|
-
}
|
|
973
|
-
_$setValue(value, directiveParent = this) {
|
|
974
|
-
if (DEV_MODE2 && this.parentNode === null) {
|
|
975
|
-
throw new Error(`This \`ChildPart\` has no \`parentNode\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \`innerHTML\` or \`textContent\` can do this.`);
|
|
976
|
-
}
|
|
977
|
-
value = resolveDirective(this, value, directiveParent);
|
|
978
|
-
if (isPrimitive(value)) {
|
|
979
|
-
if (value === nothing || value == null || value === "") {
|
|
980
|
-
if (this._$committedValue !== nothing) {
|
|
981
|
-
debugLogEvent2 && debugLogEvent2({
|
|
982
|
-
kind: "commit nothing to child",
|
|
983
|
-
start: this._$startNode,
|
|
984
|
-
end: this._$endNode,
|
|
985
|
-
parent: this._$parent,
|
|
986
|
-
options: this.options
|
|
987
|
-
});
|
|
988
|
-
this._$clear();
|
|
989
|
-
}
|
|
990
|
-
this._$committedValue = nothing;
|
|
991
|
-
} else if (value !== this._$committedValue && value !== noChange) {
|
|
992
|
-
this._commitText(value);
|
|
993
|
-
}
|
|
994
|
-
} else if (value["_$litType$"] !== undefined) {
|
|
995
|
-
this._commitTemplateResult(value);
|
|
996
|
-
} else if (value.nodeType !== undefined) {
|
|
997
|
-
if (DEV_MODE2 && this.options?.host === value) {
|
|
998
|
-
this._commitText(`[probable mistake: rendered a template's host in itself ` + `(commonly caused by writing \${this} in a template]`);
|
|
999
|
-
console.warn(`Attempted to render the template host`, value, `inside itself. This is almost always a mistake, and in dev mode `, `we render some warning text. In production however, we'll `, `render it, which will usually result in an error, and sometimes `, `in the element disappearing from the DOM.`);
|
|
1000
|
-
return;
|
|
1001
|
-
}
|
|
1002
|
-
this._commitNode(value);
|
|
1003
|
-
} else if (isIterable(value)) {
|
|
1004
|
-
this._commitIterable(value);
|
|
1005
|
-
} else {
|
|
1006
|
-
this._commitText(value);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
_insert(node) {
|
|
1010
|
-
return wrap(wrap(this._$startNode).parentNode).insertBefore(node, this._$endNode);
|
|
1011
|
-
}
|
|
1012
|
-
_commitNode(value) {
|
|
1013
|
-
if (this._$committedValue !== value) {
|
|
1014
|
-
this._$clear();
|
|
1015
|
-
if (ENABLE_EXTRA_SECURITY_HOOKS && sanitizerFactoryInternal !== noopSanitizer) {
|
|
1016
|
-
const parentNodeName = this._$startNode.parentNode?.nodeName;
|
|
1017
|
-
if (parentNodeName === "STYLE" || parentNodeName === "SCRIPT") {
|
|
1018
|
-
let message = "Forbidden";
|
|
1019
|
-
if (DEV_MODE2) {
|
|
1020
|
-
if (parentNodeName === "STYLE") {
|
|
1021
|
-
message = `Lit does not support binding inside style nodes. ` + `This is a security risk, as style injection attacks can ` + `exfiltrate data and spoof UIs. ` + `Consider instead using css\`...\` literals ` + `to compose styles, and do dynamic styling with ` + `css custom properties, ::parts, <slot>s, ` + `and by mutating the DOM rather than stylesheets.`;
|
|
1022
|
-
} else {
|
|
1023
|
-
message = `Lit does not support binding inside script nodes. ` + `This is a security risk, as it could allow arbitrary ` + `code execution.`;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
throw new Error(message);
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1030
|
-
kind: "commit node",
|
|
1031
|
-
start: this._$startNode,
|
|
1032
|
-
parent: this._$parent,
|
|
1033
|
-
value,
|
|
1034
|
-
options: this.options
|
|
1035
|
-
});
|
|
1036
|
-
this._$committedValue = this._insert(value);
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
_commitText(value) {
|
|
1040
|
-
if (this._$committedValue !== nothing && isPrimitive(this._$committedValue)) {
|
|
1041
|
-
const node = wrap(this._$startNode).nextSibling;
|
|
1042
|
-
if (ENABLE_EXTRA_SECURITY_HOOKS) {
|
|
1043
|
-
if (this._textSanitizer === undefined) {
|
|
1044
|
-
this._textSanitizer = createSanitizer(node, "data", "property");
|
|
1045
|
-
}
|
|
1046
|
-
value = this._textSanitizer(value);
|
|
1047
|
-
}
|
|
1048
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1049
|
-
kind: "commit text",
|
|
1050
|
-
node,
|
|
1051
|
-
value,
|
|
1052
|
-
options: this.options
|
|
1053
|
-
});
|
|
1054
|
-
node.data = value;
|
|
1055
|
-
} else {
|
|
1056
|
-
if (ENABLE_EXTRA_SECURITY_HOOKS) {
|
|
1057
|
-
const textNode = d.createTextNode("");
|
|
1058
|
-
this._commitNode(textNode);
|
|
1059
|
-
if (this._textSanitizer === undefined) {
|
|
1060
|
-
this._textSanitizer = createSanitizer(textNode, "data", "property");
|
|
1061
|
-
}
|
|
1062
|
-
value = this._textSanitizer(value);
|
|
1063
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1064
|
-
kind: "commit text",
|
|
1065
|
-
node: textNode,
|
|
1066
|
-
value,
|
|
1067
|
-
options: this.options
|
|
1068
|
-
});
|
|
1069
|
-
textNode.data = value;
|
|
1070
|
-
} else {
|
|
1071
|
-
this._commitNode(d.createTextNode(value));
|
|
1072
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1073
|
-
kind: "commit text",
|
|
1074
|
-
node: wrap(this._$startNode).nextSibling,
|
|
1075
|
-
value,
|
|
1076
|
-
options: this.options
|
|
1077
|
-
});
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
this._$committedValue = value;
|
|
1081
|
-
}
|
|
1082
|
-
_commitTemplateResult(result) {
|
|
1083
|
-
const { values, ["_$litType$"]: type } = result;
|
|
1084
|
-
const template = typeof type === "number" ? this._$getTemplate(result) : (type.el === undefined && (type.el = Template.createElement(trustFromTemplateString(type.h, type.h[0]), this.options)), type);
|
|
1085
|
-
if (this._$committedValue?._$template === template) {
|
|
1086
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1087
|
-
kind: "template updating",
|
|
1088
|
-
template,
|
|
1089
|
-
instance: this._$committedValue,
|
|
1090
|
-
parts: this._$committedValue._$parts,
|
|
1091
|
-
options: this.options,
|
|
1092
|
-
values
|
|
1093
|
-
});
|
|
1094
|
-
this._$committedValue._update(values);
|
|
1095
|
-
} else {
|
|
1096
|
-
const instance = new TemplateInstance(template, this);
|
|
1097
|
-
const fragment = instance._clone(this.options);
|
|
1098
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1099
|
-
kind: "template instantiated",
|
|
1100
|
-
template,
|
|
1101
|
-
instance,
|
|
1102
|
-
parts: instance._$parts,
|
|
1103
|
-
options: this.options,
|
|
1104
|
-
fragment,
|
|
1105
|
-
values
|
|
1106
|
-
});
|
|
1107
|
-
instance._update(values);
|
|
1108
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1109
|
-
kind: "template instantiated and updated",
|
|
1110
|
-
template,
|
|
1111
|
-
instance,
|
|
1112
|
-
parts: instance._$parts,
|
|
1113
|
-
options: this.options,
|
|
1114
|
-
fragment,
|
|
1115
|
-
values
|
|
1116
|
-
});
|
|
1117
|
-
this._commitNode(fragment);
|
|
1118
|
-
this._$committedValue = instance;
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
_$getTemplate(result) {
|
|
1122
|
-
let template = templateCache.get(result.strings);
|
|
1123
|
-
if (template === undefined) {
|
|
1124
|
-
templateCache.set(result.strings, template = new Template(result));
|
|
1125
|
-
}
|
|
1126
|
-
return template;
|
|
1127
|
-
}
|
|
1128
|
-
_commitIterable(value) {
|
|
1129
|
-
if (!isArray(this._$committedValue)) {
|
|
1130
|
-
this._$committedValue = [];
|
|
1131
|
-
this._$clear();
|
|
1132
|
-
}
|
|
1133
|
-
const itemParts = this._$committedValue;
|
|
1134
|
-
let partIndex = 0;
|
|
1135
|
-
let itemPart;
|
|
1136
|
-
for (const item of value) {
|
|
1137
|
-
if (partIndex === itemParts.length) {
|
|
1138
|
-
itemParts.push(itemPart = new ChildPart(this._insert(createMarker()), this._insert(createMarker()), this, this.options));
|
|
1139
|
-
} else {
|
|
1140
|
-
itemPart = itemParts[partIndex];
|
|
1141
|
-
}
|
|
1142
|
-
itemPart._$setValue(item);
|
|
1143
|
-
partIndex++;
|
|
1144
|
-
}
|
|
1145
|
-
if (partIndex < itemParts.length) {
|
|
1146
|
-
this._$clear(itemPart && wrap(itemPart._$endNode).nextSibling, partIndex);
|
|
1147
|
-
itemParts.length = partIndex;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
_$clear(start = wrap(this._$startNode).nextSibling, from) {
|
|
1151
|
-
this._$notifyConnectionChanged?.(false, true, from);
|
|
1152
|
-
while (start !== this._$endNode) {
|
|
1153
|
-
const n = wrap(start).nextSibling;
|
|
1154
|
-
wrap(start).remove();
|
|
1155
|
-
start = n;
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
setConnected(isConnected) {
|
|
1159
|
-
if (this._$parent === undefined) {
|
|
1160
|
-
this.__isConnected = isConnected;
|
|
1161
|
-
this._$notifyConnectionChanged?.(isConnected);
|
|
1162
|
-
} else if (DEV_MODE2) {
|
|
1163
|
-
throw new Error("part.setConnected() may only be called on a " + "RootPart returned from render().");
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
class AttributePart {
|
|
1169
|
-
get tagName() {
|
|
1170
|
-
return this.element.tagName;
|
|
1171
|
-
}
|
|
1172
|
-
get _$isConnected() {
|
|
1173
|
-
return this._$parent._$isConnected;
|
|
1174
|
-
}
|
|
1175
|
-
constructor(element, name, strings, parent, options) {
|
|
1176
|
-
this.type = ATTRIBUTE_PART;
|
|
1177
|
-
this._$committedValue = nothing;
|
|
1178
|
-
this._$disconnectableChildren = undefined;
|
|
1179
|
-
this.element = element;
|
|
1180
|
-
this.name = name;
|
|
1181
|
-
this._$parent = parent;
|
|
1182
|
-
this.options = options;
|
|
1183
|
-
if (strings.length > 2 || strings[0] !== "" || strings[1] !== "") {
|
|
1184
|
-
this._$committedValue = new Array(strings.length - 1).fill(new String);
|
|
1185
|
-
this.strings = strings;
|
|
1186
|
-
} else {
|
|
1187
|
-
this._$committedValue = nothing;
|
|
1188
|
-
}
|
|
1189
|
-
if (ENABLE_EXTRA_SECURITY_HOOKS) {
|
|
1190
|
-
this._sanitizer = undefined;
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
_$setValue(value, directiveParent = this, valueIndex, noCommit) {
|
|
1194
|
-
const strings = this.strings;
|
|
1195
|
-
let change = false;
|
|
1196
|
-
if (strings === undefined) {
|
|
1197
|
-
value = resolveDirective(this, value, directiveParent, 0);
|
|
1198
|
-
change = !isPrimitive(value) || value !== this._$committedValue && value !== noChange;
|
|
1199
|
-
if (change) {
|
|
1200
|
-
this._$committedValue = value;
|
|
1201
|
-
}
|
|
1202
|
-
} else {
|
|
1203
|
-
const values = value;
|
|
1204
|
-
value = strings[0];
|
|
1205
|
-
let i, v;
|
|
1206
|
-
for (i = 0;i < strings.length - 1; i++) {
|
|
1207
|
-
v = resolveDirective(this, values[valueIndex + i], directiveParent, i);
|
|
1208
|
-
if (v === noChange) {
|
|
1209
|
-
v = this._$committedValue[i];
|
|
1210
|
-
}
|
|
1211
|
-
change ||= !isPrimitive(v) || v !== this._$committedValue[i];
|
|
1212
|
-
if (v === nothing) {
|
|
1213
|
-
value = nothing;
|
|
1214
|
-
} else if (value !== nothing) {
|
|
1215
|
-
value += (v ?? "") + strings[i + 1];
|
|
1216
|
-
}
|
|
1217
|
-
this._$committedValue[i] = v;
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
|
-
if (change && !noCommit) {
|
|
1221
|
-
this._commitValue(value);
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
_commitValue(value) {
|
|
1225
|
-
if (value === nothing) {
|
|
1226
|
-
wrap(this.element).removeAttribute(this.name);
|
|
1227
|
-
} else {
|
|
1228
|
-
if (ENABLE_EXTRA_SECURITY_HOOKS) {
|
|
1229
|
-
if (this._sanitizer === undefined) {
|
|
1230
|
-
this._sanitizer = sanitizerFactoryInternal(this.element, this.name, "attribute");
|
|
1231
|
-
}
|
|
1232
|
-
value = this._sanitizer(value ?? "");
|
|
1233
|
-
}
|
|
1234
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1235
|
-
kind: "commit attribute",
|
|
1236
|
-
element: this.element,
|
|
1237
|
-
name: this.name,
|
|
1238
|
-
value,
|
|
1239
|
-
options: this.options
|
|
1240
|
-
});
|
|
1241
|
-
wrap(this.element).setAttribute(this.name, value ?? "");
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
class PropertyPart extends AttributePart {
|
|
1247
|
-
constructor() {
|
|
1248
|
-
super(...arguments);
|
|
1249
|
-
this.type = PROPERTY_PART;
|
|
1250
|
-
}
|
|
1251
|
-
_commitValue(value) {
|
|
1252
|
-
if (ENABLE_EXTRA_SECURITY_HOOKS) {
|
|
1253
|
-
if (this._sanitizer === undefined) {
|
|
1254
|
-
this._sanitizer = sanitizerFactoryInternal(this.element, this.name, "property");
|
|
1255
|
-
}
|
|
1256
|
-
value = this._sanitizer(value);
|
|
1257
|
-
}
|
|
1258
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1259
|
-
kind: "commit property",
|
|
1260
|
-
element: this.element,
|
|
1261
|
-
name: this.name,
|
|
1262
|
-
value,
|
|
1263
|
-
options: this.options
|
|
1264
|
-
});
|
|
1265
|
-
this.element[this.name] = value === nothing ? undefined : value;
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
class BooleanAttributePart extends AttributePart {
|
|
1270
|
-
constructor() {
|
|
1271
|
-
super(...arguments);
|
|
1272
|
-
this.type = BOOLEAN_ATTRIBUTE_PART;
|
|
1273
|
-
}
|
|
1274
|
-
_commitValue(value) {
|
|
1275
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1276
|
-
kind: "commit boolean attribute",
|
|
1277
|
-
element: this.element,
|
|
1278
|
-
name: this.name,
|
|
1279
|
-
value: !!(value && value !== nothing),
|
|
1280
|
-
options: this.options
|
|
1281
|
-
});
|
|
1282
|
-
wrap(this.element).toggleAttribute(this.name, !!value && value !== nothing);
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
class EventPart extends AttributePart {
|
|
1287
|
-
constructor(element, name, strings, parent, options) {
|
|
1288
|
-
super(element, name, strings, parent, options);
|
|
1289
|
-
this.type = EVENT_PART;
|
|
1290
|
-
if (DEV_MODE2 && this.strings !== undefined) {
|
|
1291
|
-
throw new Error(`A \`<${element.localName}>\` has a \`@${name}=...\` listener with ` + "invalid content. Event listeners in templates must have exactly " + "one expression and no surrounding text.");
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
_$setValue(newListener, directiveParent = this) {
|
|
1295
|
-
newListener = resolveDirective(this, newListener, directiveParent, 0) ?? nothing;
|
|
1296
|
-
if (newListener === noChange) {
|
|
1297
|
-
return;
|
|
1298
|
-
}
|
|
1299
|
-
const oldListener = this._$committedValue;
|
|
1300
|
-
const shouldRemoveListener = newListener === nothing && oldListener !== nothing || newListener.capture !== oldListener.capture || newListener.once !== oldListener.once || newListener.passive !== oldListener.passive;
|
|
1301
|
-
const shouldAddListener = newListener !== nothing && (oldListener === nothing || shouldRemoveListener);
|
|
1302
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1303
|
-
kind: "commit event listener",
|
|
1304
|
-
element: this.element,
|
|
1305
|
-
name: this.name,
|
|
1306
|
-
value: newListener,
|
|
1307
|
-
options: this.options,
|
|
1308
|
-
removeListener: shouldRemoveListener,
|
|
1309
|
-
addListener: shouldAddListener,
|
|
1310
|
-
oldListener
|
|
1311
|
-
});
|
|
1312
|
-
if (shouldRemoveListener) {
|
|
1313
|
-
this.element.removeEventListener(this.name, this, oldListener);
|
|
1314
|
-
}
|
|
1315
|
-
if (shouldAddListener) {
|
|
1316
|
-
this.element.addEventListener(this.name, this, newListener);
|
|
1317
|
-
}
|
|
1318
|
-
this._$committedValue = newListener;
|
|
1319
|
-
}
|
|
1320
|
-
handleEvent(event) {
|
|
1321
|
-
if (typeof this._$committedValue === "function") {
|
|
1322
|
-
this._$committedValue.call(this.options?.host ?? this.element, event);
|
|
1323
|
-
} else {
|
|
1324
|
-
this._$committedValue.handleEvent(event);
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
class ElementPart {
|
|
1330
|
-
constructor(element, parent, options) {
|
|
1331
|
-
this.element = element;
|
|
1332
|
-
this.type = ELEMENT_PART;
|
|
1333
|
-
this._$disconnectableChildren = undefined;
|
|
1334
|
-
this._$parent = parent;
|
|
1335
|
-
this.options = options;
|
|
1336
|
-
}
|
|
1337
|
-
get _$isConnected() {
|
|
1338
|
-
return this._$parent._$isConnected;
|
|
1339
|
-
}
|
|
1340
|
-
_$setValue(value) {
|
|
1341
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1342
|
-
kind: "commit to element binding",
|
|
1343
|
-
element: this.element,
|
|
1344
|
-
value,
|
|
1345
|
-
options: this.options
|
|
1346
|
-
});
|
|
1347
|
-
resolveDirective(this, value);
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
var polyfillSupport2 = DEV_MODE2 ? global3.litHtmlPolyfillSupportDevMode : global3.litHtmlPolyfillSupport;
|
|
1351
|
-
polyfillSupport2?.(Template, ChildPart);
|
|
1352
|
-
(global3.litHtmlVersions ??= []).push("3.3.3");
|
|
1353
|
-
if (DEV_MODE2 && global3.litHtmlVersions.length > 1) {
|
|
1354
|
-
queueMicrotask(() => {
|
|
1355
|
-
issueWarning2("multiple-versions", `Multiple versions of Lit loaded. ` + `Loading multiple versions is not recommended.`);
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1358
|
-
var render = (value, container, options) => {
|
|
1359
|
-
if (DEV_MODE2 && container == null) {
|
|
1360
|
-
throw new TypeError(`The container to render into may not be ${container}`);
|
|
1361
|
-
}
|
|
1362
|
-
const renderId = DEV_MODE2 ? debugLogRenderId++ : 0;
|
|
1363
|
-
const partOwnerNode = options?.renderBefore ?? container;
|
|
1364
|
-
let part = partOwnerNode["_$litPart$"];
|
|
1365
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1366
|
-
kind: "begin render",
|
|
1367
|
-
id: renderId,
|
|
1368
|
-
value,
|
|
1369
|
-
container,
|
|
1370
|
-
options,
|
|
1371
|
-
part
|
|
1372
|
-
});
|
|
1373
|
-
if (part === undefined) {
|
|
1374
|
-
const endNode = options?.renderBefore ?? null;
|
|
1375
|
-
partOwnerNode["_$litPart$"] = part = new ChildPart(container.insertBefore(createMarker(), endNode), endNode, undefined, options ?? {});
|
|
1376
|
-
}
|
|
1377
|
-
part._$setValue(value);
|
|
1378
|
-
debugLogEvent2 && debugLogEvent2({
|
|
1379
|
-
kind: "end render",
|
|
1380
|
-
id: renderId,
|
|
1381
|
-
value,
|
|
1382
|
-
container,
|
|
1383
|
-
options,
|
|
1384
|
-
part
|
|
1385
|
-
});
|
|
1386
|
-
return part;
|
|
1387
|
-
};
|
|
1388
|
-
if (ENABLE_EXTRA_SECURITY_HOOKS) {
|
|
1389
|
-
render.setSanitizer = setSanitizer;
|
|
1390
|
-
render.createSanitizer = createSanitizer;
|
|
1391
|
-
if (DEV_MODE2) {
|
|
1392
|
-
render._testOnlyClearSanitizerFactoryDoNotCallOrElse = _testOnlyClearSanitizerFactoryDoNotCallOrElse;
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
// ../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/development/lit-element.js
|
|
1397
|
-
var JSCompiler_renameProperty2 = (prop, _obj) => prop;
|
|
1398
|
-
var DEV_MODE3 = true;
|
|
1399
|
-
var global4 = globalThis;
|
|
1400
|
-
var issueWarning3;
|
|
1401
|
-
if (DEV_MODE3) {
|
|
1402
|
-
global4.litIssuedWarnings ??= new Set;
|
|
1403
|
-
issueWarning3 = (code, warning) => {
|
|
1404
|
-
warning += ` See https://lit.dev/msg/${code} for more information.`;
|
|
1405
|
-
if (!global4.litIssuedWarnings.has(warning) && !global4.litIssuedWarnings.has(code)) {
|
|
1406
|
-
console.warn(warning);
|
|
1407
|
-
global4.litIssuedWarnings.add(warning);
|
|
1408
|
-
}
|
|
1409
|
-
};
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
class LitElement extends ReactiveElement {
|
|
1413
|
-
constructor() {
|
|
1414
|
-
super(...arguments);
|
|
1415
|
-
this.renderOptions = { host: this };
|
|
1416
|
-
this.__childPart = undefined;
|
|
1417
|
-
}
|
|
1418
|
-
createRenderRoot() {
|
|
1419
|
-
const renderRoot = super.createRenderRoot();
|
|
1420
|
-
this.renderOptions.renderBefore ??= renderRoot.firstChild;
|
|
1421
|
-
return renderRoot;
|
|
1422
|
-
}
|
|
1423
|
-
update(changedProperties) {
|
|
1424
|
-
const value = this.render();
|
|
1425
|
-
if (!this.hasUpdated) {
|
|
1426
|
-
this.renderOptions.isConnected = this.isConnected;
|
|
1427
|
-
}
|
|
1428
|
-
super.update(changedProperties);
|
|
1429
|
-
this.__childPart = render(value, this.renderRoot, this.renderOptions);
|
|
1430
|
-
}
|
|
1431
|
-
connectedCallback() {
|
|
1432
|
-
super.connectedCallback();
|
|
1433
|
-
this.__childPart?.setConnected(true);
|
|
1434
|
-
}
|
|
1435
|
-
disconnectedCallback() {
|
|
1436
|
-
super.disconnectedCallback();
|
|
1437
|
-
this.__childPart?.setConnected(false);
|
|
1438
|
-
}
|
|
1439
|
-
render() {
|
|
1440
|
-
return noChange;
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
LitElement["_$litElement$"] = true;
|
|
1444
|
-
LitElement[JSCompiler_renameProperty2("finalized", LitElement)] = true;
|
|
1445
|
-
global4.litElementHydrateSupport?.({ LitElement });
|
|
1446
|
-
var polyfillSupport3 = DEV_MODE3 ? global4.litElementPolyfillSupportDevMode : global4.litElementPolyfillSupport;
|
|
1447
|
-
polyfillSupport3?.({ LitElement });
|
|
1448
|
-
(global4.litElementVersions ??= []).push("4.2.2");
|
|
1449
|
-
if (DEV_MODE3 && global4.litElementVersions.length > 1) {
|
|
1450
|
-
queueMicrotask(() => {
|
|
1451
|
-
issueWarning3("multiple-versions", `Multiple versions of Lit loaded. Loading multiple versions ` + `is not recommended.`);
|
|
1452
|
-
});
|
|
1453
|
-
}
|
|
1454
|
-
// src/ui/shirt-sponsors/shirt-auction.ts
|
|
1455
|
-
var copy = {
|
|
1456
|
-
es: {
|
|
1457
|
-
title: "Patrocina la camiseta del evento",
|
|
1458
|
-
loading: "Cargando camiseta y pujas…",
|
|
1459
|
-
open: "Abrir en WODira",
|
|
1460
|
-
error: "No se ha podido cargar la campaña.",
|
|
1461
|
-
invalid: "Configura una campaña y una URL de WODira válidas.",
|
|
1462
|
-
retry: "Reintentar"
|
|
1463
|
-
},
|
|
1464
|
-
en: {
|
|
1465
|
-
title: "Sponsor the event shirt",
|
|
1466
|
-
loading: "Loading shirt and bids…",
|
|
1467
|
-
open: "Open in WODira",
|
|
1468
|
-
error: "The campaign could not be loaded.",
|
|
1469
|
-
invalid: "Set a valid campaign and WODira URL.",
|
|
1470
|
-
retry: "Retry"
|
|
1471
|
-
},
|
|
1472
|
-
pt: {
|
|
1473
|
-
title: "Patrocina a camisola do evento",
|
|
1474
|
-
loading: "A carregar camisola e licitações…",
|
|
1475
|
-
open: "Abrir na WODira",
|
|
1476
|
-
error: "Não foi possível carregar a campanha.",
|
|
1477
|
-
invalid: "Configura uma campanha e um URL da WODira válidos.",
|
|
1478
|
-
retry: "Tentar novamente"
|
|
1479
|
-
}
|
|
1480
|
-
};
|
|
1481
|
-
|
|
1482
|
-
class WodiraShirtAuction extends LitElement {
|
|
1483
|
-
static properties = {
|
|
1484
|
-
campaignId: { type: String, attribute: "campaign-id" },
|
|
1485
|
-
appUrl: { type: String, attribute: "app-url" },
|
|
1486
|
-
locale: { type: String },
|
|
1487
|
-
frameHeight: { state: true },
|
|
1488
|
-
ready: { state: true },
|
|
1489
|
-
failed: { state: true },
|
|
1490
|
-
attempt: { state: true }
|
|
1491
|
-
};
|
|
1492
|
-
static styles = css`
|
|
1493
|
-
:host {
|
|
1494
|
-
display: block;
|
|
1495
|
-
width: 100%;
|
|
1496
|
-
color: var(--wodira-text, #0b093f);
|
|
1497
|
-
font: inherit;
|
|
1498
|
-
}
|
|
1499
|
-
.shell {
|
|
1500
|
-
overflow: hidden;
|
|
1501
|
-
border: 1px solid var(--wodira-border, #e6e3ed);
|
|
1502
|
-
border-radius: var(--wodira-radius, 16px);
|
|
1503
|
-
background: var(--wodira-background, #fff);
|
|
1504
|
-
}
|
|
1505
|
-
iframe {
|
|
1506
|
-
display: block;
|
|
1507
|
-
border: 0;
|
|
1508
|
-
width: 100%;
|
|
1509
|
-
}
|
|
1510
|
-
.status,
|
|
1511
|
-
footer {
|
|
1512
|
-
padding: 16px;
|
|
1513
|
-
}
|
|
1514
|
-
footer {
|
|
1515
|
-
display: flex;
|
|
1516
|
-
flex-wrap: wrap;
|
|
1517
|
-
gap: 12px;
|
|
1518
|
-
justify-content: space-between;
|
|
1519
|
-
border-top: 1px solid var(--wodira-border, #e6e3ed);
|
|
1520
|
-
font-size: 14px;
|
|
1521
|
-
}
|
|
1522
|
-
a {
|
|
1523
|
-
color: var(--wodira-primary, #a90a65);
|
|
1524
|
-
text-underline-offset: 3px;
|
|
1525
|
-
}
|
|
1526
|
-
button {
|
|
1527
|
-
font: inherit;
|
|
1528
|
-
cursor: pointer;
|
|
1529
|
-
padding: 8px 14px;
|
|
1530
|
-
}
|
|
1531
|
-
a:focus-visible,
|
|
1532
|
-
button:focus-visible {
|
|
1533
|
-
outline: 3px solid var(--wodira-primary, #a90a65);
|
|
1534
|
-
outline-offset: 4px;
|
|
1535
|
-
}
|
|
1536
|
-
`;
|
|
1537
|
-
channel = globalThis.crypto.randomUUID();
|
|
1538
|
-
timeout;
|
|
1539
|
-
constructor() {
|
|
1540
|
-
super();
|
|
1541
|
-
this.campaignId = "";
|
|
1542
|
-
this.appUrl = "https://wodira.app";
|
|
1543
|
-
this.locale = "auto";
|
|
1544
|
-
this.frameHeight = 960;
|
|
1545
|
-
this.ready = false;
|
|
1546
|
-
this.failed = false;
|
|
1547
|
-
this.attempt = 0;
|
|
1548
|
-
}
|
|
1549
|
-
get language() {
|
|
1550
|
-
const locale = this.locale === "auto" ? this.ownerDocument.documentElement.lang || navigator.language : this.locale;
|
|
1551
|
-
const language = locale.toLowerCase().split("-")[0];
|
|
1552
|
-
return language === "en" || language === "pt" ? language : "es";
|
|
1553
|
-
}
|
|
1554
|
-
get urls() {
|
|
1555
|
-
try {
|
|
1556
|
-
if (!/^[a-zA-Z0-9_-]{1,160}$/.test(this.campaignId))
|
|
1557
|
-
return null;
|
|
1558
|
-
const base = new URL(this.appUrl);
|
|
1559
|
-
const local = ["localhost", "127.0.0.1", "[::1]"].includes(base.hostname);
|
|
1560
|
-
if (base.username || base.password || base.protocol !== "https:" && !(local && base.protocol === "http:"))
|
|
1561
|
-
return null;
|
|
1562
|
-
const prefix = local ? "" : `/${this.language}`;
|
|
1563
|
-
const publicUrl = new URL(`${prefix}/patrocinios/camisetas/${this.campaignId}`, base.origin);
|
|
1564
|
-
const embed = new URL(`${prefix}/embed/shirt-sponsors/${this.campaignId}`, base.origin);
|
|
1565
|
-
embed.searchParams.set("parentOrigin", location.origin);
|
|
1566
|
-
embed.searchParams.set("channel", this.channel);
|
|
1567
|
-
embed.searchParams.set("attempt", String(this.attempt));
|
|
1568
|
-
return { publicUrl: publicUrl.href, embed: embed.href, origin: base.origin };
|
|
1569
|
-
} catch {
|
|
1570
|
-
return null;
|
|
1571
|
-
}
|
|
1572
|
-
}
|
|
1573
|
-
connectedCallback() {
|
|
1574
|
-
super.connectedCallback();
|
|
1575
|
-
window.addEventListener("message", this.onMessage);
|
|
1576
|
-
this.startTimeout();
|
|
1577
|
-
}
|
|
1578
|
-
disconnectedCallback() {
|
|
1579
|
-
window.removeEventListener("message", this.onMessage);
|
|
1580
|
-
clearTimeout(this.timeout);
|
|
1581
|
-
super.disconnectedCallback();
|
|
1582
|
-
}
|
|
1583
|
-
willUpdate(changes) {
|
|
1584
|
-
if (changes.has("campaignId") || changes.has("appUrl") || changes.has("locale")) {
|
|
1585
|
-
this.channel = globalThis.crypto.randomUUID();
|
|
1586
|
-
this.reset();
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
reset() {
|
|
1590
|
-
this.ready = false;
|
|
1591
|
-
this.failed = false;
|
|
1592
|
-
this.frameHeight = 960;
|
|
1593
|
-
this.startTimeout();
|
|
1594
|
-
}
|
|
1595
|
-
startTimeout() {
|
|
1596
|
-
clearTimeout(this.timeout);
|
|
1597
|
-
if (this.isConnected)
|
|
1598
|
-
this.timeout = setTimeout(() => {
|
|
1599
|
-
if (!this.ready)
|
|
1600
|
-
this.failed = true;
|
|
1601
|
-
}, 30000);
|
|
1602
|
-
}
|
|
1603
|
-
retry() {
|
|
1604
|
-
this.channel = globalThis.crypto.randomUUID();
|
|
1605
|
-
this.reset();
|
|
1606
|
-
this.attempt++;
|
|
1607
|
-
}
|
|
1608
|
-
onMessage = (event) => {
|
|
1609
|
-
const frame = this.renderRoot.querySelector("iframe");
|
|
1610
|
-
if (event.origin !== this.urls?.origin || !frame || event.source !== frame.contentWindow)
|
|
1611
|
-
return;
|
|
1612
|
-
const data = event.data;
|
|
1613
|
-
if (!data || typeof data !== "object" || !("channel" in data) || data.channel !== this.channel || !("type" in data))
|
|
1614
|
-
return;
|
|
1615
|
-
if (data.type === "wodira:shirt:resize" && "height" in data && typeof data.height === "number" && Number.isFinite(data.height)) {
|
|
1616
|
-
this.frameHeight = Math.max(360, Math.min(12000, Math.ceil(data.height)));
|
|
1617
|
-
this.ready = true;
|
|
1618
|
-
this.failed = false;
|
|
1619
|
-
clearTimeout(this.timeout);
|
|
1620
|
-
}
|
|
1621
|
-
if (data.type === "wodira:shirt:paid") {
|
|
1622
|
-
this.dispatchEvent(new CustomEvent("wodira:shirt:paid", {
|
|
1623
|
-
bubbles: true,
|
|
1624
|
-
composed: true,
|
|
1625
|
-
detail: { campaignId: this.campaignId }
|
|
1626
|
-
}));
|
|
1627
|
-
}
|
|
1628
|
-
};
|
|
1629
|
-
render() {
|
|
1630
|
-
const text = copy[this.language];
|
|
1631
|
-
const urls = this.urls;
|
|
1632
|
-
return html`<section class="shell" part="container" aria-label=${text.title}>
|
|
1633
|
-
${!urls ? html`<p class="status" role="alert">${text.invalid}</p>` : html`
|
|
1634
|
-
${!this.ready || this.failed ? html`<div class="status" role="status">
|
|
1635
|
-
${this.failed ? text.error : text.loading}
|
|
1636
|
-
${this.failed ? html`<button @click=${this.retry}>${text.retry}</button>` : nothing}
|
|
1637
|
-
</div>` : nothing}
|
|
1638
|
-
<iframe
|
|
1639
|
-
part="frame"
|
|
1640
|
-
title=${text.title}
|
|
1641
|
-
src=${urls.embed}
|
|
1642
|
-
height=${this.frameHeight}
|
|
1643
|
-
loading="eager"
|
|
1644
|
-
allow="payment *"
|
|
1645
|
-
referrerpolicy="strict-origin-when-cross-origin"
|
|
1646
|
-
sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
|
|
1647
|
-
></iframe>
|
|
1648
|
-
<footer part="footer">
|
|
1649
|
-
<span>WODira</span
|
|
1650
|
-
><a href=${urls.publicUrl} target="_blank" rel="noopener noreferrer"
|
|
1651
|
-
>${text.open} ↗</a
|
|
1652
|
-
>
|
|
1653
|
-
</footer>
|
|
1654
|
-
`}
|
|
1655
|
-
</section>`;
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
// src/ui/shirt-sponsors/index.ts
|
|
1660
|
-
function defineWodiraShirtElements() {
|
|
1661
|
-
if (!globalThis.customElements)
|
|
1662
|
-
throw new Error("WODira shirt elements require a browser.");
|
|
1663
|
-
if (!customElements.get("wodira-shirt-auction"))
|
|
1664
|
-
customElements.define("wodira-shirt-auction", WodiraShirtAuction);
|
|
1665
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
__chunks,
|
|
3
|
+
WodiraShirtAuction2,
|
|
4
|
+
defineWodiraShirtElements2
|
|
5
|
+
} from "../index-tfej862z.js";
|
|
6
|
+
__chunks(import.meta.url,["z93s1cyb","tfej862z","jyks1h8f","xdhg885t"],[["./index.js",1],["../index-tfej862z.js"],["../shirt-3d-renderer-jyks1h8f.js",3],["../index-xdhg885t.js"]],0);
|
|
1666
7
|
export {
|
|
1667
|
-
WodiraShirtAuction,
|
|
1668
|
-
defineWodiraShirtElements
|
|
8
|
+
WodiraShirtAuction2 as WodiraShirtAuction,
|
|
9
|
+
defineWodiraShirtElements2 as defineWodiraShirtElements
|
|
1669
10
|
};
|