@uploadcare/file-uploader 1.25.0 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstract/loadFileUploaderFrom.js +4 -75
- package/dist/env.js +4 -33
- package/dist/index.css +5 -2660
- package/dist/index.d.ts +2326 -1670
- package/dist/index.js +6 -12012
- package/dist/index.layered.css +4 -2716
- package/dist/index.ssr.js +532 -768
- package/dist/locales/file-uploader/ar.js +4 -165
- package/dist/locales/file-uploader/az.js +4 -157
- package/dist/locales/file-uploader/ca.js +4 -159
- package/dist/locales/file-uploader/cs.js +4 -161
- package/dist/locales/file-uploader/da.js +4 -157
- package/dist/locales/file-uploader/de.js +4 -157
- package/dist/locales/file-uploader/el.js +4 -157
- package/dist/locales/file-uploader/en.js +4 -157
- package/dist/locales/file-uploader/es.js +4 -159
- package/dist/locales/file-uploader/et.js +4 -157
- package/dist/locales/file-uploader/fi.js +4 -157
- package/dist/locales/file-uploader/fr.js +4 -159
- package/dist/locales/file-uploader/he.js +4 -159
- package/dist/locales/file-uploader/hy.js +4 -157
- package/dist/locales/file-uploader/is.js +4 -157
- package/dist/locales/file-uploader/it.js +4 -159
- package/dist/locales/file-uploader/ja.js +4 -157
- package/dist/locales/file-uploader/ka.js +4 -157
- package/dist/locales/file-uploader/kk.js +4 -157
- package/dist/locales/file-uploader/ko.js +4 -157
- package/dist/locales/file-uploader/lv.js +4 -159
- package/dist/locales/file-uploader/nb.js +4 -157
- package/dist/locales/file-uploader/nl.js +4 -157
- package/dist/locales/file-uploader/pl.js +4 -161
- package/dist/locales/file-uploader/pt.js +4 -159
- package/dist/locales/file-uploader/ro.js +4 -159
- package/dist/locales/file-uploader/ru.js +4 -161
- package/dist/locales/file-uploader/sk.js +4 -161
- package/dist/locales/file-uploader/sr.js +4 -159
- package/dist/locales/file-uploader/sv.js +4 -157
- package/dist/locales/file-uploader/tr.js +4 -157
- package/dist/locales/file-uploader/uk.js +4 -161
- package/dist/locales/file-uploader/vi.js +4 -157
- package/dist/locales/file-uploader/zh-TW.js +4 -157
- package/dist/locales/file-uploader/zh.js +4 -157
- package/package.json +44 -32
- package/types/jsx.d.ts +75 -48
- package/web/file-uploader.iife.min.d.ts +2619 -1833
- package/web/file-uploader.iife.min.js +6 -27
- package/web/file-uploader.iife.min.js.LEGAL.txt +71 -0
- package/web/file-uploader.min.d.ts +2619 -1833
- package/web/file-uploader.min.js +5 -26
- package/web/file-uploader.min.js.LEGAL.txt +71 -0
- package/web/uc-basic.layered.min.css +4 -23
- package/web/uc-basic.min.css +4 -23
- package/web/uc-cloud-image-editor.layered.min.css +4 -23
- package/web/uc-cloud-image-editor.min.css +4 -23
- package/web/uc-cloud-image-editor.min.d.ts +1835 -580
- package/web/uc-cloud-image-editor.min.js +5 -26
- package/web/uc-cloud-image-editor.min.js.LEGAL.txt +70 -0
- package/web/uc-file-uploader-inline.layered.min.css +4 -23
- package/web/uc-file-uploader-inline.min.css +4 -23
- package/web/uc-file-uploader-inline.min.d.ts +2619 -1833
- package/web/uc-file-uploader-inline.min.js +5 -26
- package/web/uc-file-uploader-inline.min.js.LEGAL.txt +71 -0
- package/web/uc-file-uploader-minimal.layered.min.css +4 -23
- package/web/uc-file-uploader-minimal.min.css +4 -23
- package/web/uc-file-uploader-minimal.min.d.ts +2619 -1833
- package/web/uc-file-uploader-minimal.min.js +5 -26
- package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +71 -0
- package/web/uc-file-uploader-regular.layered.min.css +4 -23
- package/web/uc-file-uploader-regular.min.css +4 -23
- package/web/uc-file-uploader-regular.min.d.ts +2619 -1833
- package/web/uc-file-uploader-regular.min.js +5 -26
- package/web/uc-file-uploader-regular.min.js.LEGAL.txt +71 -0
- package/web/uc-img.min.d.ts +60 -100
- package/web/uc-img.min.js +5 -25
- package/web/uc-img.min.js.LEGAL.txt +24 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Bundled license information:
|
|
2
|
+
|
|
3
|
+
@lit/reactive-element/css-tag.js:
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2019 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@lit/reactive-element/reactive-element.js:
|
|
11
|
+
lit-html/lit-html.js:
|
|
12
|
+
lit-element/lit-element.js:
|
|
13
|
+
@lit/context/lib/decorators/provide.js:
|
|
14
|
+
@lit/reactive-element/decorators/custom-element.js:
|
|
15
|
+
@lit/reactive-element/decorators/property.js:
|
|
16
|
+
@lit/reactive-element/decorators/state.js:
|
|
17
|
+
@lit/reactive-element/decorators/event-options.js:
|
|
18
|
+
@lit/reactive-element/decorators/base.js:
|
|
19
|
+
@lit/reactive-element/decorators/query.js:
|
|
20
|
+
@lit/reactive-element/decorators/query-all.js:
|
|
21
|
+
@lit/reactive-element/decorators/query-async.js:
|
|
22
|
+
@lit/reactive-element/decorators/query-assigned-nodes.js:
|
|
23
|
+
lit-html/directive.js:
|
|
24
|
+
lit-html/directives/unsafe-html.js:
|
|
25
|
+
lit-html/directives/unsafe-svg.js:
|
|
26
|
+
lit-html/async-directive.js:
|
|
27
|
+
lit-html/directives/repeat.js:
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2017 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
lit-html/is-server.js:
|
|
35
|
+
@lit/context/lib/decorators/consume.js:
|
|
36
|
+
/**
|
|
37
|
+
* @license
|
|
38
|
+
* Copyright 2022 Google LLC
|
|
39
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
@lit/context/lib/context-request-event.js:
|
|
43
|
+
@lit/context/lib/create-context.js:
|
|
44
|
+
@lit/context/lib/controllers/context-consumer.js:
|
|
45
|
+
@lit/context/lib/value-notifier.js:
|
|
46
|
+
@lit/context/lib/controllers/context-provider.js:
|
|
47
|
+
@lit/context/lib/context-root.js:
|
|
48
|
+
@lit/reactive-element/decorators/query-assigned-elements.js:
|
|
49
|
+
lit-html/directives/when.js:
|
|
50
|
+
/**
|
|
51
|
+
* @license
|
|
52
|
+
* Copyright 2021 Google LLC
|
|
53
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
lit-html/directive-helpers.js:
|
|
57
|
+
lit-html/directives/ref.js:
|
|
58
|
+
/**
|
|
59
|
+
* @license
|
|
60
|
+
* Copyright 2020 Google LLC
|
|
61
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
lit-html/directives/style-map.js:
|
|
65
|
+
lit-html/directives/class-map.js:
|
|
66
|
+
lit-html/directives/if-defined.js:
|
|
67
|
+
/**
|
|
68
|
+
* @license
|
|
69
|
+
* Copyright 2018 Google LLC
|
|
70
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
71
|
+
*/
|
package/web/uc-img.min.d.ts
CHANGED
|
@@ -1,115 +1,75 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @param {String} key
|
|
16
|
-
* @param {(val: any) => void} kbFn
|
|
17
|
-
*/
|
|
18
|
-
sub$$(key: string, kbFn: (val: any) => void): void;
|
|
19
|
-
analyticsParams(): string;
|
|
20
|
-
initAttributes(el: any): void;
|
|
21
|
-
/**
|
|
22
|
-
* @param {HTMLElement} el
|
|
23
|
-
* @param {() => void} cbkFn
|
|
24
|
-
*/
|
|
25
|
-
initIntersection(el: HTMLElement, cbkFn: () => void): void;
|
|
26
|
-
/** @private */
|
|
3
|
+
type Constructor<T = unknown> = new (...args: any[]) => T;
|
|
4
|
+
|
|
5
|
+
type CssPropValue = string | number | undefined | null;
|
|
6
|
+
declare const ImgConfig_base: typeof LitElement & Constructor<LitElement> & {
|
|
7
|
+
reg(tagName: string): void;
|
|
8
|
+
} & Constructor<{
|
|
9
|
+
getCssData(propName: string, silentCheck?: boolean): string | number | boolean | null | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
declare class ImgConfig extends ImgConfig_base {
|
|
12
|
+
private _state;
|
|
13
|
+
private _subscribers;
|
|
27
14
|
private _isnObserver;
|
|
28
|
-
/** @private */
|
|
29
15
|
private _observed;
|
|
30
|
-
|
|
16
|
+
createRenderRoot(): HTMLElement | ShadowRoot;
|
|
17
|
+
constructor();
|
|
18
|
+
protected $$(key: string): unknown;
|
|
19
|
+
protected set$$(kvObj: Record<string, CssPropValue>): void;
|
|
20
|
+
protected sub$$<T = unknown>(key: string, kbFn: (val: T) => void): void;
|
|
21
|
+
private _notify;
|
|
22
|
+
protected analyticsParams(): string;
|
|
23
|
+
protected initAttributes(el: HTMLElement): void;
|
|
24
|
+
protected initIntersection(el: HTMLElement, cbkFn: () => void): void;
|
|
25
|
+
connectedCallback(): void;
|
|
26
|
+
private _initCssProperties;
|
|
27
|
+
disconnectedCallback(): void;
|
|
28
|
+
static get observedAttributes(): string[];
|
|
29
|
+
attributeChangedCallback(name: string, _oldVal: string | null, newVal: string | null): void;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
declare class ImgBase extends ImgConfig {
|
|
34
|
-
_img
|
|
35
|
-
_imgPreview
|
|
36
|
-
/**
|
|
37
|
-
* @private
|
|
38
|
-
* @param {String} src
|
|
39
|
-
*/
|
|
33
|
+
private _img;
|
|
34
|
+
private _imgPreview;
|
|
40
35
|
private _fmtAbs;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* @param {String} [size]
|
|
45
|
-
* @returns {String | Number}
|
|
46
|
-
*/
|
|
47
|
-
_validateSize(size?: string): string | number;
|
|
48
|
-
/**
|
|
49
|
-
* Image operations
|
|
50
|
-
*
|
|
51
|
-
* @param {String} [size]
|
|
52
|
-
* @param {String} [blur]
|
|
53
|
-
*/
|
|
54
|
-
_getCdnModifiers(size?: string, blur?: string): string;
|
|
55
|
-
/**
|
|
56
|
-
* @private
|
|
57
|
-
* @param {String} [size]
|
|
58
|
-
* @param {String} [blur]
|
|
59
|
-
* @returns {any}
|
|
60
|
-
*/
|
|
36
|
+
private _validateSize;
|
|
37
|
+
private _getCdnModifiers;
|
|
38
|
+
private _getTypedCssValue;
|
|
61
39
|
private _getUrlBase;
|
|
62
|
-
/**
|
|
63
|
-
* @private
|
|
64
|
-
* @param {String} url
|
|
65
|
-
* @returns {String}
|
|
66
|
-
*/
|
|
67
40
|
private _proxyUrl;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
get bgSelector(): any;
|
|
87
|
-
get breakpoints(): number[] | null;
|
|
88
|
-
get hasFormatJPG(): boolean;
|
|
89
|
-
/** @param {HTMLElement} el */
|
|
90
|
-
renderBg(el: HTMLElement): void;
|
|
91
|
-
getSrcset(): string;
|
|
92
|
-
getSrc(): any;
|
|
93
|
-
get srcUrlPreview(): any;
|
|
94
|
-
renderBackground(): void;
|
|
95
|
-
_appendURL({ elNode, src, srcset }: {
|
|
96
|
-
elNode: any;
|
|
97
|
-
src: any;
|
|
98
|
-
srcset: any;
|
|
99
|
-
}): void;
|
|
100
|
-
_setupConfigForImage({ elNode }: {
|
|
101
|
-
elNode: any;
|
|
102
|
-
}): void;
|
|
103
|
-
loaderImage({ src, srcset, elNode }: {
|
|
104
|
-
src: any;
|
|
105
|
-
srcset: any;
|
|
106
|
-
elNode: any;
|
|
107
|
-
}): Promise<any>;
|
|
108
|
-
renderImage(): Promise<void>;
|
|
109
|
-
init(): void;
|
|
41
|
+
protected _getElSize(el: HTMLElement, k?: number, wOnly?: boolean): string | null;
|
|
42
|
+
private _setupEventProxy;
|
|
43
|
+
protected get img(): HTMLImageElement;
|
|
44
|
+
private get _currentImg();
|
|
45
|
+
private get _hasPreviewImage();
|
|
46
|
+
private get _bgSelector();
|
|
47
|
+
private get _breakpoints();
|
|
48
|
+
private get _hasFormatJPG();
|
|
49
|
+
private _renderBg;
|
|
50
|
+
private _getSrcset;
|
|
51
|
+
private _getSrc;
|
|
52
|
+
private get _srcUrlPreview();
|
|
53
|
+
private _renderBackground;
|
|
54
|
+
private _appendURL;
|
|
55
|
+
private _setupConfigForImage;
|
|
56
|
+
private _loaderImage;
|
|
57
|
+
private _renderImage;
|
|
58
|
+
protected init(): void;
|
|
110
59
|
}
|
|
111
60
|
|
|
112
61
|
declare class Img extends ImgBase {
|
|
62
|
+
attributesMeta: {
|
|
63
|
+
src: string;
|
|
64
|
+
} | {
|
|
65
|
+
uuid: string;
|
|
66
|
+
};
|
|
67
|
+
connectedCallback(): void;
|
|
68
|
+
}
|
|
69
|
+
declare global {
|
|
70
|
+
interface HTMLElementTagNameMap {
|
|
71
|
+
'uc-img': Img;
|
|
72
|
+
}
|
|
113
73
|
}
|
|
114
74
|
|
|
115
75
|
export { Img };
|
package/web/uc-img.min.js
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* MIT
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
* furnished to do so, subject to the following conditions:
|
|
13
|
-
*
|
|
14
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
* copies or substantial portions of the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
* SOFTWARE.
|
|
24
|
-
*
|
|
3
|
+
* Package: @uploadcare/file-uploader@1.26.0 (MIT)
|
|
4
|
+
* License: https://github.com/uploadcare/file-uploader/blob/main/LICENSE
|
|
5
|
+
* Built: 2026-01-27T15:05:39.444Z
|
|
25
6
|
*/
|
|
26
|
-
var nt=e=>{if(typeof e!="string"||!e)return"";let t=e.trim();return t.startsWith("-/")?t=t.slice(2):t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,t.length-1)),t},ot=(...e)=>e.filter(t=>typeof t=="string"&&!!t).map(t=>nt(t)).join("/-/"),F=(...e)=>{let t=ot(...e);return t?`-/${t}/`:""};function X(e){let t=new URL(e),s=t.pathname+t.search+t.hash,i=s.lastIndexOf("http"),r=s.lastIndexOf("/"),n="";return i>=0?n=s.slice(i):r>=0&&(n=s.slice(r+1)),n}function at(e){let t=new URL(e),s=X(e),i=K(s)?z(s).pathname:s;return t.pathname=t.pathname.replace(i,""),t.search="",t.hash="",t.toString()}function K(e){return e.startsWith("http")}function z(e){let t=new URL(e);return{pathname:`${t.origin}${t.pathname??""}`,search:t.search??"",hash:t.hash??""}}var g=(e,t,s)=>{let i=new URL(at(e)),r=s??X(e),n=t??"";if(i.pathname.startsWith("//")&&(i.pathname=i.pathname.replace("//","/")),r&&K(r)){let o=z(r);i.pathname=`${i.pathname}${n}${o.pathname||""}`,i.search=o.search,i.hash=o.hash}else i.pathname=`${i.pathname}${n}${r||""}`;return i.toString()},I=(e,t)=>{let s=new URL(e);return s.pathname=`${t}/`,s.toString()};var W=(e,t=",")=>e.trim().split(t).map(s=>s.trim()).filter(s=>s.length>0);var lt=e=>e;function q(e,t={},s={}){let{openToken:i="{{",closeToken:r="}}",transform:n=lt}=s;for(let o in t){let l=t[o],u=l?.toString(),f=typeof u=="string"?n(u):String(u);e=e.replaceAll(i+o+r,f)}return e}var H=e=>[...new Set(e)];var b="--uc-img-",D="unresolved";var N=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),j=3e3,k=5e3,L=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"});var ct=Object.defineProperty,ut=(e,t,s)=>t in e?ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,M=(e,t,s)=>(ut(e,typeof t!="symbol"?t+"":t,s),s);function ht(e){let t=s=>{var i;for(let r in s)((i=s[r])==null?void 0:i.constructor)===Object&&(s[r]=t(s[r]));return{...s}};return t(e)}var h=class{constructor(e){e.constructor===Object?this.store=ht(e):(this._storeIsProxy=!0,this.store=e),this.callbackMap=Object.create(null)}static warn(e,t){console.warn(`Symbiote Data: cannot ${e}. Prop name: `+t)}read(e){return!this._storeIsProxy&&!this.store.hasOwnProperty(e)?(h.warn("read",e),null):this.store[e]}has(e){return this._storeIsProxy?this.store[e]!==void 0:this.store.hasOwnProperty(e)}add(e,t,s=!1){!s&&Object.keys(this.store).includes(e)||(this.store[e]=t,this.notify(e))}pub(e,t){if(!this._storeIsProxy&&!this.store.hasOwnProperty(e)){h.warn("publish",e);return}this.store[e]=t,this.notify(e)}multiPub(e){for(let t in e)this.pub(t,e[t])}notify(e){this.callbackMap[e]&&this.callbackMap[e].forEach(t=>{t(this.store[e])})}sub(e,t,s=!0){return!this._storeIsProxy&&!this.store.hasOwnProperty(e)?(h.warn("subscribe",e),null):(this.callbackMap[e]||(this.callbackMap[e]=new Set),this.callbackMap[e].add(t),s&&t(this.store[e]),{remove:()=>{this.callbackMap[e].delete(t),this.callbackMap[e].size||delete this.callbackMap[e]},callback:t})}static registerCtx(e,t=Symbol()){let s=h.globalStore.get(t);return s?console.warn('State: context UID "'+t+'" already in use'):(s=new h(e),h.globalStore.set(t,s)),s}static deleteCtx(e){h.globalStore.delete(e)}static getCtx(e,t=!0){return h.globalStore.get(e)||(t&&console.warn('State: wrong context UID - "'+e+'"'),null)}};h.globalStore=new Map;var a=Object.freeze({BIND_ATTR:"set",ATTR_BIND_PRFX:"@",EXT_DATA_CTX_PRFX:"*",NAMED_DATA_CTX_SPLTR:"/",CTX_NAME_ATTR:"ctx-name",CTX_OWNER_ATTR:"ctx-owner",CSS_CTX_PROP:"--ctx-name",EL_REF_ATTR:"ref",AUTO_TAG_PRFX:"sym",REPEAT_ATTR:"repeat",REPEAT_ITEM_TAG_ATTR:"repeat-item-tag",SET_LATER_KEY:"__toSetLater__",USE_TPL:"use-template",ROOT_STYLE_ATTR_NAME:"sym-component"}),Y="1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",dt=Y.length-1,pt=class{static generate(e="XXXXXXXXX-XXX"){let t="";for(let s=0;s<e.length;s++)t+=e[s]==="-"?e[s]:Y.charAt(Math.random()*dt);return t}};function J(e,t,s){let i=!0,r,n=t.split(".");return n.forEach((o,l)=>{l<n.length-1?e=e[o]:r=o}),e?e[r]=s:i=!1,i}function _t(e){return e.split("-").map((t,s)=>t&&s?t[0].toUpperCase()+t.slice(1):t).join("").split("_").map((t,s)=>t&&s?t.toUpperCase():t).join("")}function mt(e,t){[...e.querySelectorAll(`[${a.REPEAT_ATTR}]`)].forEach(s=>{let i=s.getAttribute(a.REPEAT_ITEM_TAG_ATTR),r;if(i&&(r=window.customElements.get(i)),!r){r=class extends t.BaseComponent{constructor(){super(),i||(this.style.display="contents")}};let o=s.innerHTML;r.template=o,r.reg(i)}for(;s.firstChild;)s.firstChild.remove();let n=s.getAttribute(a.REPEAT_ATTR);t.sub(n,o=>{if(!o){for(;s.firstChild;)s.firstChild.remove();return}let l=[...s.children],u,f=d=>{d.forEach((c,x)=>{if(l[x])if(l[x].set$)setTimeout(()=>{l[x].set$(c)});else for(let T in c)l[x][T]=c[T];else{u||(u=new DocumentFragment);let T=new r;Object.assign(T.init$,c),u.appendChild(T)}}),u&&s.appendChild(u);let p=l.slice(d.length,l.length);for(let c of p)c.remove()};if(o.constructor===Array)f(o);else if(o.constructor===Object){let d=[];for(let p in o){let c=o[p];Object.defineProperty(c,"_KEY_",{value:p,enumerable:!0}),d.push(c)}f(d)}else console.warn("Symbiote repeat data type error:"),console.log(o)}),s.removeAttribute(a.REPEAT_ATTR),s.removeAttribute(a.REPEAT_ITEM_TAG_ATTR)})}var V="__default__";function ft(e,t){if(t.shadowRoot)return;let s=[...e.querySelectorAll("slot")];if(!s.length)return;let i={};s.forEach(r=>{let n=r.getAttribute("name")||V;i[n]={slot:r,fr:document.createDocumentFragment()}}),t.initChildren.forEach(r=>{var n;let o=V;r instanceof Element&&r.hasAttribute("slot")&&(o=r.getAttribute("slot"),r.removeAttribute("slot")),(n=i[o])==null||n.fr.appendChild(r)}),Object.values(i).forEach(r=>{if(r.fr.childNodes.length)r.slot.parentNode.replaceChild(r.fr,r.slot);else if(r.slot.childNodes.length){let n=document.createDocumentFragment();n.append(...r.slot.childNodes),r.slot.parentNode.replaceChild(n,r.slot)}else r.slot.remove()})}function gt(e,t){[...e.querySelectorAll(`[${a.EL_REF_ATTR}]`)].forEach(s=>{let i=s.getAttribute(a.EL_REF_ATTR);t.ref[i]=s,s.removeAttribute(a.EL_REF_ATTR)})}function bt(e,t){[...e.querySelectorAll(`[${a.BIND_ATTR}]`)].forEach(s=>{let r=s.getAttribute(a.BIND_ATTR).split(";");[...s.attributes].forEach(n=>{if(n.name.startsWith("-")&&n.value){let o=_t(n.name.replace("-",""));r.push(o+":"+n.value),s.removeAttribute(n.name)}}),r.forEach(n=>{if(!n)return;let o=n.split(":").map(d=>d.trim()),l=o[0],u;l.indexOf(a.ATTR_BIND_PRFX)===0&&(u=!0,l=l.replace(a.ATTR_BIND_PRFX,""));let f=o[1].split(",").map(d=>d.trim());for(let d of f){let p;d.startsWith("!!")?(p="double",d=d.replace("!!","")):d.startsWith("!")&&(p="single",d=d.replace("!","")),t.sub(d,c=>{p==="double"?c=!!c:p==="single"&&(c=!c),u?c?.constructor===Boolean?c?s.setAttribute(l,""):s.removeAttribute(l):s.setAttribute(l,c):J(s,l,c)||(s[a.SET_LATER_KEY]||(s[a.SET_LATER_KEY]=Object.create(null)),s[a.SET_LATER_KEY][l]=c)})}}),s.removeAttribute(a.BIND_ATTR)})}var C="{{",E="}}",yt="skip-text";function wt(e){let t,s=[],i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:r=>{var n;return!((n=r.parentElement)!=null&&n.hasAttribute(yt))&&r.textContent.includes(C)&&r.textContent.includes(E)&&1}});for(;t=i.nextNode();)s.push(t);return s}var Tt=function(e,t){wt(e).forEach(i=>{let r=[],n;for(;i.textContent.includes(E);)i.textContent.startsWith(C)?(n=i.textContent.indexOf(E)+E.length,i.splitText(n),r.push(i)):(n=i.textContent.indexOf(C),i.splitText(n)),i=i.nextSibling;r.forEach(o=>{let l=o.textContent.replace(C,"").replace(E,"");o.textContent="",t.sub(l,u=>{o.textContent=u})})})},Et=[mt,ft,gt,bt,Tt],A="'",w='"',vt=/\\([0-9a-fA-F]{1,6} ?)/g;function xt(e){return(e[0]===w||e[0]===A)&&(e[e.length-1]===w||e[e.length-1]===A)}function Ct(e){return(e[0]===w||e[0]===A)&&(e=e.slice(1)),(e[e.length-1]===w||e[e.length-1]===A)&&(e=e.slice(0,-1)),e}function At(e){let t="",s="";for(var i=0;i<e.length;i++){let r=e[i+1];e[i]==="\\"&&r==='"'?(t+='\\"',i++):e[i]==='"'&&s!=="\\"?t+='\\"':t+=e[i],s=e[i]}return t}function St(e){let t=e;xt(e)&&(t=Ct(t),t=t.replace(vt,(s,i)=>String.fromCodePoint(parseInt(i.trim(),16))),t=t.replaceAll(`\\
|
|
27
|
-
|
|
28
|
-
`));return}window.customElements.define(e,t?class extends this{}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(e){this.observedAttributes=Object.keys(e),this.__attrDesc=e}attributeChangedCallback(e,t,s){var i;if(t===s)return;let r=(i=this.constructor.__attrDesc)==null?void 0:i[e];r?this.__dataCtxInitialized?this.$[r]=s:this.init$[r]=s:this[e]=s}getCssData(e,t=!1){if(this.__cssDataCache||(this.__cssDataCache=Object.create(null)),!Object.keys(this.__cssDataCache).includes(e)){this.__computedStyle||(this.__computedStyle=window.getComputedStyle(this));let s=this.__computedStyle.getPropertyValue(e).trim();try{this.__cssDataCache[e]=St(s)}catch{!t&&console.warn(`CSS Data error: ${e}`),this.__cssDataCache[e]=null}}return this.__cssDataCache[e]}__extractCssName(e){return e.split("--").map((t,s)=>s===0?"":t).join("--")}__initStyleAttrObserver(){_||(_=new Set),_.add(this.updateCssData),y||(y=new MutationObserver(e=>{e[0].type==="attributes"&&_.forEach(t=>{t()})}),y.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}))}bindCssData(e,t=""){this.__boundCssProps||(this.__boundCssProps=new Set),this.__boundCssProps.add(e);let s=this.getCssData(this.__extractCssName(e),!0);s===null&&(s=t),this.add(e,s),this.__initStyleAttrObserver()}dropCssDataCache(){this.__cssDataCache=null,this.__computedStyle=null}defineAccessor(e,t,s){let i="__"+e;this[i]=this[e],Object.defineProperty(this,e,{set:r=>{this[i]=r,s?window.setTimeout(()=>{t?.(r)}):t?.(r)},get:()=>this[i]}),this[e]=this[i]}static set shadowStyles(e){let t=new Blob([e],{type:"text/css"});this.__shadowStylesUrl=URL.createObjectURL(t)}static set rootStyles(e){if(!this.__rootStylesLink){let t=new Blob([e],{type:"text/css"}),s=URL.createObjectURL(t),i=document.createElement("link");i.href=s,i.rel="stylesheet",this.__rootStylesLink=i}}},B=m;M(B,"template");var U=class{static _print(e){console.warn(e)}static setDefaultTitle(e){this.defaultTitle=e}static setRoutingMap(e){Object.assign(this.appMap,e);for(let t in this.appMap)!this.defaultRoute&&this.appMap[t].default===!0?this.defaultRoute=t:!this.errorRoute&&this.appMap[t].error===!0&&(this.errorRoute=t)}static set routingEventName(e){this.__routingEventName=e}static get routingEventName(){return this.__routingEventName||"sym-on-route"}static readAddressBar(){let e={route:null,options:{}};return window.location.search.split(this.separator).forEach(s=>{if(s.includes("?"))e.route=s.replace("?","");else if(s.includes("=")){let i=s.split("=");e.options[i[0]]=decodeURI(i[1])}else e.options[s]=!0}),e}static notify(){let e=this.readAddressBar(),t=this.appMap[e.route];if(t&&t.title&&(document.title=t.title),e.route===null&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!t&&this.errorRoute){this.applyRoute(this.errorRoute);return}else if(!t&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!t){this._print(`Route "${e.route}" not found...`);return}let s=new CustomEvent(U.routingEventName,{detail:{route:e.route,options:Object.assign(t||{},e.options)}});window.dispatchEvent(s)}static reflect(e,t={}){let s=this.appMap[e];if(!s){this._print("Wrong route: "+e);return}let i="?"+e;for(let n in t)t[n]===!0?i+=this.separator+n:i+=this.separator+n+`=${t[n]}`;let r=s.title||this.defaultTitle||"";window.history.pushState(null,r,i),document.title=r}static applyRoute(e,t={}){this.reflect(e,t),this.notify()}static setSeparator(e){this._separator=e}static get separator(){return this._separator||"&"}static createRouterData(e,t){this.setRoutingMap(t);let s=h.registerCtx({route:null,options:null,title:null},e);return window.addEventListener(this.routingEventName,i=>{var r;s.multiPub({route:i.detail.route,options:i.detail.options,title:((r=i.detail.options)==null?void 0:r.title)||this.defaultTitle||""})}),U.notify(),this.initPopstateListener(),s}static initPopstateListener(){this.__onPopstate||(this.__onPopstate=()=>{this.notify()},window.addEventListener("popstate",this.__onPopstate))}static removePopstateListener(){window.removeEventListener("popstate",this.__onPopstate),this.__onPopstate=null}};U.appMap=Object.create(null);var Q="idb-store-ready",Pt="symbiote-db",$t="symbiote-idb-update_",Rt=class{_notifyWhenReady(e=null){window.dispatchEvent(new CustomEvent(Q,{detail:{dbName:this.name,storeName:this.storeName,event:e}}))}get _updEventName(){return $t+this.name}_getUpdateEvent(e){return new CustomEvent(this._updEventName,{detail:{key:this.name,newValue:e}})}_notifySubscribers(e){window.localStorage.removeItem(this.name),window.localStorage.setItem(this.name,e),window.dispatchEvent(this._getUpdateEvent(e))}constructor(e,t){this.name=e,this.storeName=t,this.version=1,this.request=window.indexedDB.open(this.name,this.version),this.request.onupgradeneeded=s=>{this.db=s.target.result,this.objStore=this.db.createObjectStore(t,{keyPath:"_key"}),this.objStore.transaction.oncomplete=i=>{this._notifyWhenReady(i)}},this.request.onsuccess=s=>{this.db=s.target.result,this._notifyWhenReady(s)},this.request.onerror=s=>{console.error(s)},this._subscriptionsMap={},this._updateHandler=s=>{s.key===this.name&&this._subscriptionsMap[s.newValue]&&this._subscriptionsMap[s.newValue].forEach(async r=>{r(await this.read(s.newValue))})},this._localUpdateHandler=s=>{this._updateHandler(s.detail)},window.addEventListener("storage",this._updateHandler),window.addEventListener(this._updEventName,this._localUpdateHandler)}read(e){let s=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).get(e);return new Promise((i,r)=>{s.onsuccess=n=>{var o;(o=n.target.result)!=null&&o._value?i(n.target.result._value):(i(null),console.warn(`IDB: cannot read "${e}"`))},s.onerror=n=>{r(n)}})}write(e,t,s=!1){let i={_key:e,_value:t},n=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(i);return new Promise((o,l)=>{n.onsuccess=u=>{s||this._notifySubscribers(e),o(u.target.result)},n.onerror=u=>{l(u)}})}delete(e,t=!1){let i=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(e);return new Promise((r,n)=>{i.onsuccess=o=>{t||this._notifySubscribers(e),r(o)},i.onerror=o=>{n(o)}})}getAll(){let t=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).getAll();return new Promise((s,i)=>{t.onsuccess=r=>{let n=r.target.result;s(n.map(o=>o._value))},t.onerror=r=>{i(r)}})}subscribe(e,t){this._subscriptionsMap[e]||(this._subscriptionsMap[e]=new Set);let s=this._subscriptionsMap[e];return s.add(t),{remove:()=>{s.delete(t),s.size||delete this._subscriptionsMap[e]}}}stop(){window.removeEventListener("storage",this._updateHandler),this._subscriptionsMap=null,Z.clear(this.name)}},Z=class{static get readyEventName(){return Q}static open(e=Pt,t="store"){let s=e+"/"+t;return this._reg[s]||(this._reg[s]=new Rt(e,t)),this._reg[s]}static clear(e){window.indexedDB.deleteDatabase(e);for(let t in this._reg)t.split("/")[0]===e&&delete this._reg[t]}};M(Z,"_reg",Object.create(null));var tt="1.25.0";var et="blocks",st=tt;var It="https://ucarecdn.com",v=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:It},"proxy-cname":{},"secure-delivery-proxy":{},"hi-res-support":{default:1},"ultra-res-support":{},format:{},"cdn-operations":{},progressive:{},quality:{},"is-background-for":{},"is-preview-blur":{default:1}});var it=Object.create(null);for(let e in v)it[b+e]=v[e]?.default||"";var S=class extends B{cssInit$=it;$$(t){return this.$[b+t]}set$$(t){for(let s in t)this.$[b+s]=t[s]}sub$$(t,s){this.sub(b+t,i=>{i===null||i===""||s(i)})}analyticsParams(){return`-/@clib/${et}/${st}/uc-img/`}initAttributes(t){[...this.attributes].forEach(s=>{v[s.name]||t.setAttribute(s.name,s.value)})}initIntersection(t,s){let i={root:null,rootMargin:"0px"};this._isnObserver=new IntersectionObserver(r=>{r.forEach(n=>{n.isIntersecting&&(s(),this._isnObserver.unobserve(t))})},i),this._isnObserver.observe(t),this._observed||(this._observed=new Set),this._observed.add(t)}destroyCallback(){super.destroyCallback(),this._isnObserver&&(this._observed.forEach(t=>{this._isnObserver.unobserve(t)}),this._isnObserver=null),h.deleteCtx(this)}static get observedAttributes(){return Object.keys(v)}attributeChangedCallback(t,s,i){window.setTimeout(()=>{this.$[b+t]=i})}};var rt=e=>Object.entries(e).filter(([t,s])=>s!==void 0&&s!=="").map(([t,s])=>t==="cdn-operations"||t==="analytics"?s:`${t}/${s}`);var R=class extends S{_img=new Image;_imgPreview=new Image;_fmtAbs(t){return!t.includes("//")&&!N&&(t=new URL(t,document.baseURI).href),t}_validateSize(t){if(t?.trim()!==""){let s=t.match(/\d+/)[0],i=t.match(/[a-zA-Z]+/)[0],r=parseInt(s,10);if(Number(r)>k&&this.hasFormatJPG)return k+i;if(Number(r)>j&&!this.hasFormatJPG)return j+i}return t}_getCdnModifiers(t,s){let i={format:this.$$("format"),quality:this.$$("quality"),resize:this._validateSize(t),blur:s,"cdn-operations":this.$$("cdn-operations"),analytics:this.analyticsParams()};return F(...rt(i))}_getUrlBase(t="",s=""){if(this.$$("src").startsWith("data:")||this.$$("src").startsWith("blob:"))return this.$$("src");if(N&&this.$$("src")&&!this.$$("src").includes("//"))return this._proxyUrl(this.$$("src"));let i=this._getCdnModifiers(t,s);if(this.$$("src").startsWith(this.$$("cdn-cname")))return g(this.$$("src"),i);if(this.$$("cdn-cname")&&this.$$("uuid"))return this._proxyUrl(g(I(this.$$("cdn-cname"),this.$$("uuid")),i));if(this.$$("uuid"))return this._proxyUrl(g(I(this.$$("cdn-cname"),this.$$("uuid")),i));if(this.$$("proxy-cname"))return this._proxyUrl(g(this.$$("proxy-cname"),i,this._fmtAbs(this.$$("src"))));if(this.$$("pubkey"))return this._proxyUrl(g(`https://${this.$$("pubkey")}.ucr.io/`,i,this._fmtAbs(this.$$("src"))))}_proxyUrl(t){return this.$$("secure-delivery-proxy")?q(this.$$("secure-delivery-proxy"),{previewUrl:t},{transform:i=>window.encodeURIComponent(i)}):t}_getElSize(t,s=1,i=!0){let r=t.getBoundingClientRect(),n=s*Math.round(r.width),o=i?"":s*Math.round(r.height);return n||o?`${n||""}x${o||""}`:null}_setupEventProxy(t){let s=r=>{r.stopPropagation();let n=new Event(r.type,r);this.dispatchEvent(n)},i=["load","error"];for(let r of i)t.addEventListener(r,s)}get img(){return this.hasPreviewImage||(this._setupConfigForImage({elNode:this._img}),this.appendChild(this._img)),this._img}get currentImg(){return this.hasPreviewImage?{type:L.PREVIEW,img:this._imgPreview}:{type:L.MAIN,img:this.img}}get hasPreviewImage(){return this.$$("is-preview-blur")}get bgSelector(){return this.$$("is-background-for")}get breakpoints(){if(this.$$("breakpoints")){let t=W(this.$$("breakpoints"));return H(t.map(s=>parseInt(s,10)))}else return null}get hasFormatJPG(){return this.$$("format").toLowerCase()==="jpeg"}renderBg(t){let s=new Set;s.add(`url("${this._getUrlBase(this._getElSize(t))}") 1x`),this.$$("hi-res-support")&&s.add(`url("${this._getUrlBase(this._getElSize(t,2))}") ${2}x`),this.$$("ultra-res-support")&&s.add(`url("${this._getUrlBase(this._getElSize(t,3))}") ${3}x`);let i=`image-set(${[...s].join(", ")})`;t.style.setProperty("background-image",i),t.style.setProperty("background-image","-webkit-"+i)}getSrcset(){let t=new Set;return this.breakpoints?this.breakpoints.forEach(s=>{t.add(this._getUrlBase(s+"x")+` ${this._validateSize(s+"w")}`),this.$$("hi-res-support")&&t.add(this._getUrlBase(s*2+"x")+` ${this._validateSize(s*2+"w")}`),this.$$("ultra-res-support")&&t.add(this._getUrlBase(s*3+"x")+` ${this._validateSize(s*3+"w")}`)}):(t.add(this._getUrlBase(this._getElSize(this.currentImg.img))+" 1x"),this.$$("hi-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,2))+" 2x"),this.$$("ultra-res-support")&&t.add(this._getUrlBase(this._getElSize(this.currentImg.img,3))+" 3x")),[...t].join()}getSrc(){return this._getUrlBase()}get srcUrlPreview(){return this._getUrlBase("100x","100")}renderBackground(){[...document.querySelectorAll(this.bgSelector)].forEach(t=>{this.$$("intersection")?this.initIntersection(t,()=>{this.renderBg(t)}):this.renderBg(t)})}_appendURL({elNode:t,src:s,srcset:i}){s&&(t.src=s),i&&(t.srcset=i)}_setupConfigForImage({elNode:t}){this._setupEventProxy(t),this.initAttributes(t)}loaderImage({src:t,srcset:s,elNode:i}){return new Promise((r,n)=>{this._setupConfigForImage({elNode:i}),i.setAttribute(D,""),i.addEventListener("load",()=>{i.removeAttribute(D),r(i)}),i.addEventListener("error",()=>{n(!1)}),this._appendURL({elNode:i,src:t,srcset:s})})}async renderImage(){if(this.$$("intersection")){this.hasPreviewImage&&(this._setupConfigForImage({elNode:this._imgPreview}),this.appendChild(this._imgPreview)),this.initIntersection(this.currentImg.img,async()=>{this.hasPreviewImage&&(this._imgPreview.src=this.srcUrlPreview);try{await this.loaderImage({src:this.getSrc(),srcset:this.getSrcset(),elNode:this._img}),this.hasPreviewImage&&await this._imgPreview.remove(),this.appendChild(this._img)}catch{this.hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img)}});return}try{this.hasPreviewImage&&(await this.loaderImage({src:this.srcUrlPreview,elNode:this._imgPreview}),this.appendChild(this._imgPreview)),await this.loaderImage({src:this.getSrc(),srcset:this.getSrcset(),elNode:this._img}),this.hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img)}catch{this.hasPreviewImage&&await this._imgPreview?.remove(),this.appendChild(this._img)}}init(){this.bgSelector?this.renderBackground():this.renderImage()}};var O=class extends R{initCallback(){super.initCallback(),this.sub$$("src",()=>{this.init()}),this.sub$$("uuid",()=>{this.init()}),this.sub$$("lazy",t=>{!this.$$("is-background-for")&&!this.$$("is-preview-blur")&&(this.img.loading=t?"lazy":"eager")})}};O.reg("uc-img");export{O as Img};
|
|
7
|
+
var Kt=n=>{if(typeof n!="string"||!n)return "";let t=n.trim();return t.startsWith("-/")?t=t.slice(2):t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,t.length-1)),t},Vt=(...n)=>n.filter(t=>typeof t=="string"&&!!t).map(t=>Kt(t)).join("/-/"),lt=(...n)=>{let t=Vt(...n);return t?`-/${t}/`:""};function ct(n){let t=new URL(n),e=t.pathname+t.search+t.hash,s=e.lastIndexOf("http"),i=e.lastIndexOf("/"),r="";return s>=0?r=e.slice(s):i>=0&&(r=e.slice(i+1)),r}function Bt(n){let t=new URL(n),e=ct(n),s=ht(e)?pt(e).pathname:e;return t.pathname=t.pathname.replace(s,""),t.search="",t.hash="",t.toString()}function ht(n){return n.startsWith("http")}function pt(n){let t=new URL(n);return {pathname:`${t.origin}${t.pathname??""}`,search:t.search??"",hash:t.hash??""}}var S=(n,t,e)=>{let s=new URL(Bt(n)),i=e??ct(n),r=t??"";if(s.pathname.startsWith("//")&&(s.pathname=s.pathname.replace("//","/")),i&&ht(i)){let o=pt(i);s.pathname=`${s.pathname}${r}${o.pathname||""}`,s.search=o.search,s.hash=o.hash;}else s.pathname=`${s.pathname}${r}${i||""}`;return s.toString()},H=(n,t)=>{let e=new URL(n);return e.pathname=`${t}/`,e.toString()};var dt=(n,t=",")=>n.trim().split(t).map(e=>e.trim()).filter(e=>e.length>0);var Ht=n=>n;function ut(n,t={},e={}){let{openToken:s="{{",closeToken:i="}}",transform:r=Ht}=e;for(let o in t){let l=t[o],a=l?.toString(),h=typeof a=="string"?r(a):String(a);n=n.replaceAll(s+o+i,h);}return n}var mt=n=>[...new Set(n)];var b="--uc-img-",W="unresolved";var F=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),Q=3e3,q=5e3,G=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"});var L=globalThis,j=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),ft=new WeakMap,k=class{constructor(t,e,s){if(this.St=true,s!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o,e=this.t;if(j&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=ft.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&ft.set(e,t));}return t}toString(){return this.cssText}},yt=n=>new k(typeof n=="string"?n:n+"",void 0,gt);var bt=(n,t)=>{if(j)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s);}},J=j?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return yt(e)})(n):n;var{is:Wt,defineProperty:Ft,getOwnPropertyDescriptor:Qt,getOwnPropertyNames:qt,getOwnPropertySymbols:Gt,getPrototypeOf:Jt}=Object,N=globalThis,vt=N.trustedTypes,Xt=vt?vt.emptyScript:"",Zt=N.reactiveElementPolyfillSupport,$=(n,t)=>n,X={toAttribute(n,t){switch(t){case Boolean:n=n?Xt:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n);}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n);}catch{e=null;}}return e}},wt=(n,t)=>!Wt(n,t),xt={attribute:true,type:String,converter:X,reflect:false,useDefault:false,hasChanged:wt};Symbol.metadata??=Symbol("metadata"),N.litPropertyMetadata??=new WeakMap;var m=class extends HTMLElement{static addInitializer(t){this.G(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this.S&&[...this.S.keys()]}static createProperty(t,e=xt){if(e.state&&(e.attribute=false),this.G(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=true),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Ft(this.prototype,t,i);}}static getPropertyDescriptor(t,e,s){let{get:i,set:r}=Qt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o;}};return {get:i,set(o){let l=i?.call(this);r?.call(this,o),this.requestUpdate(t,l,s);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??xt}static G(){if(this.hasOwnProperty($("elementProperties")))return;let t=Jt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty($("finalized")))return;if(this.finalized=true,this.G(),this.hasOwnProperty($("properties"))){let e=this.properties,s=[...qt(e),...Gt(e)];for(let i of s)this.createProperty(i,e[i]);}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i);}this.S=new Map;for(let[e,s]of this.elementProperties){let i=this.J(e,s);i!==void 0&&this.S.set(i,e);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(J(i));}else t!==void 0&&e.push(J(t));return e}static J(t,e){let s=e.attribute;return s===false?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._=void 0,this.isUpdatePending=false,this.hasUpdated=false,this.f=null,this.Ct();}Ct(){this.X=new Promise(t=>this.enableUpdating=t),this.c=new Map,this.Tt(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this));}addController(t){(this.x??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.();}removeController(t){this.x?.delete(t);}Tt(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._=t);}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return bt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this.x?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this.x?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,e,s){this.Z(t,s);}Pt(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor.J(t,s);if(i!==void 0&&s.reflect===true){let r=(s.converter?.toAttribute!==void 0?s.converter:X).toAttribute(e,s.type);this.f=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this.f=null;}}Z(t,e){let s=this.constructor,i=s.S.get(t);if(i!==void 0&&this.f!==i){let r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:X;this.f=i;let l=o.fromAttribute(e,r.type);this[i]=l??this.Y?.get(i)??l,this.f=null;}}requestUpdate(t,e,s,i=false,r){if(t!==void 0){let o=this.constructor;if(i===false&&(r=this[t]),s??=o.getPropertyOptions(t),!((s.hasChanged??wt)(r,e)||s.useDefault&&s.reflect&&r===this.Y?.get(t)&&!this.hasAttribute(o.J(t,s))))return;this.C(t,e,s);}this.isUpdatePending===false&&(this.X=this.$t());}C(t,e,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this.Y??=new Map).has(t)&&(this.Y.set(t,o??e??this[t]),r!==true||o!==void 0)||(this.c.has(t)||(this.hasUpdated||s||(e=void 0),this.c.set(t,e)),i===true&&this.f!==t&&(this.lt??=new Set).add(t));}async $t(){this.isUpdatePending=true;try{await this.X;}catch(e){Promise.reject(e);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._){for(let[i,r]of this._)this[i]=r;this._=void 0;}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,r]of s){let{wrapped:o}=r,l=this[i];o!==true||this.c.has(i)||l===void 0||this.C(i,void 0,r,l);}}let t=false,e=this.c;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this.x?.forEach(s=>s.hostUpdate?.()),this.update(e)):this.tt();}catch(s){throw t=false,this.tt(),s}t&&this.Ot(e);}willUpdate(t){}Ot(t){this.x?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}tt(){this.c=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.X}shouldUpdate(t){return true}update(t){this.lt&&=this.lt.forEach(e=>this.Pt(e,this[e])),this.tt();}updated(t){}firstUpdated(t){}};m.elementStyles=[],m.shadowRootOptions={mode:"open"},m[$("elementProperties")]=new Map,m[$("finalized")]=new Map,Zt?.({ReactiveElement:m}),(N.reactiveElementVersions??=[]).push("2.1.2");var nt=globalThis,Et=n=>n,_=nt.trustedTypes,St=_?_.createPolicy("lit-html",{createHTML:n=>n}):void 0,At="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,Ut="?"+g,Yt=`<${Ut}>`,w=document,A=()=>w.createComment(""),U=n=>n===null||typeof n!="object"&&typeof n!="function",rt=Array.isArray,te=n=>rt(n)||typeof n?.[Symbol.iterator]=="function",Z=`[ \f\r]`,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ct=/-->/g,Tt=/>/g,v=RegExp(`>|${Z}(?:([^\\s"'>=/]+)(${Z}*=${Z}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Pt=/'/g,$t=/"/g,Rt=/^(?:script|style|textarea|title)$/i,E=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Ot=new WeakMap,x=w.createTreeWalker(w,129);function Mt(n,t){if(!rt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return St!==void 0?St.createHTML(t):t}var ee=(n,t)=>{let e=n.length-1,s=[],i,r=t===2?"<svg>":t===3?"<math>":"",o=O;for(let l=0;l<e;l++){let a=n[l],h,p,c=-1,u=0;for(;u<a.length&&(o.lastIndex=u,p=o.exec(a),p!==null);)u=o.lastIndex,o===O?p[1]==="!--"?o=Ct:p[1]!==void 0?o=Tt:p[2]!==void 0?(Rt.test(p[2])&&(i=RegExp("</"+p[2],"g")),o=v):p[3]!==void 0&&(o=v):o===v?p[0]===">"?(o=i??O,c=-1):p[1]===void 0?c=-2:(c=o.lastIndex-p[2].length,h=p[1],o=p[3]===void 0?v:p[3]==='"'?$t:Pt):o===$t||o===Pt?o=v:o===Ct||o===Tt?o=O:(o=v,i=void 0);let f=o===v&&n[l+1].startsWith("/>")?" ":"";r+=o===O?a+Yt:c>=0?(s.push(h),a.slice(0,c)+At+a.slice(c)+g+f):a+g+(c===-2?l:f);}return [Mt(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},R=class n{constructor({strings:t,et:e},s){let i;this.parts=[];let r=0,o=0,l=t.length-1,a=this.parts,[h,p]=ee(t,e);if(this.el=n.createElement(h,s),x.currentNode=this.el.content,e===2||e===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes);}for(;(i=x.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(let c of i.getAttributeNames())if(c.endsWith(At)){let u=p[o++],f=i.getAttribute(c).split(g),I=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:I[2],strings:f,ctor:I[1]==="."?tt:I[1]==="?"?et:I[1]==="@"?st:T}),i.removeAttribute(c);}else c.startsWith(g)&&(a.push({type:6,index:r}),i.removeAttribute(c));if(Rt.test(i.tagName)){let c=i.textContent.split(g),u=c.length-1;if(u>0){i.textContent=_?_.emptyScript:"";for(let f=0;f<u;f++)i.append(c[f],A()),x.nextNode(),a.push({type:2,index:++r});i.append(c[u],A());}}}else if(i.nodeType===8)if(i.data===Ut)a.push({type:2,index:r});else {let c=-1;for(;(c=i.data.indexOf(g,c+1))!==-1;)a.push({type:7,index:r}),c+=g.length-1;}r++;}}static createElement(t,e){let s=w.createElement("template");return s.innerHTML=t,s}};function C(n,t,e=n,s){if(t===E)return t;let i=s!==void 0?e.At?.[s]:e.Ut,r=U(t)?void 0:t.zt;return i?.constructor!==r&&(i?.Kt?.(false),r===void 0?i=void 0:(i=new r(n),i.Vt(n,e,s)),s!==void 0?(e.At??=[])[s]=i:e.Ut=i),i!==void 0&&(t=C(n,i.Bt(n,t.values),i,s)),t}var Y=class{constructor(t,e){this.ct=[],this.st=void 0,this.ht=t,this.i=e;}get parentNode(){return this.i.parentNode}get d(){return this.i.d}u(t){let{el:{content:e},parts:s}=this.ht,i=(t?.creationScope??w).importNode(e,true);x.currentNode=i;let r=x.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let h;a.type===2?h=new M(r,r.nextSibling,this,t):a.type===1?h=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(h=new it(r,this,t)),this.ct.push(h),a=s[++l];}o!==a?.index&&(r=x.nextNode(),o++);}return x.currentNode=w,i}p(t){let e=0;for(let s of this.ct)s!==void 0&&(s.strings!==void 0?(s.m(t,s,e),e+=s.strings.length-2):s.m(t[e])),e++;}},M=class n{get d(){return this.i?.d??this.pt}constructor(t,e,s,i){this.type=2,this.e=d,this.st=void 0,this.w=t,this.z=e,this.i=s,this.options=i,this.pt=i?.isConnected??true;}get parentNode(){let t=this.w.parentNode,e=this.i;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this.w}get endNode(){return this.z}m(t,e=this){t=C(this,t,e),U(t)?t===d||t==null||t===""?(this.e!==d&&this.K(),this.e=d):t!==this.e&&t!==E&&this.dt(t):t.et!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):te(t)?this.k(t):this.dt(t);}O(t){return this.w.parentNode.insertBefore(t,this.z)}T(t){this.e!==t&&(this.K(),this.e=this.O(t));}dt(t){this.e!==d&&U(this.e)?this.w.nextSibling.data=t:this.T(w.createTextNode(t)),this.e=t;}$(t){let{values:e,et:s}=t,i=typeof s=="number"?this.Rt(t):(s.el===void 0&&(s.el=R.createElement(Mt(s.h,s.h[0]),this.options)),s);if(this.e?.ht===i)this.e.p(e);else {let r=new Y(i,this),o=r.u(this.options);r.p(e),this.T(o),this.e=r;}}Rt(t){let e=Ot.get(t.strings);return e===void 0&&Ot.set(t.strings,e=new R(t)),e}k(t){rt(this.e)||(this.e=[],this.K());let e=this.e,s,i=0;for(let r of t)i===e.length?e.push(s=new n(this.O(A()),this.O(A()),this,this.options)):s=e[i],s.m(r),i++;i<e.length&&(this.K(s&&s.z.nextSibling,i),e.length=i);}K(t=this.w.nextSibling,e){for(this.Mt?.(false,true,e);t!==this.z;){let s=Et(t).nextSibling;Et(t).remove(),t=s;}}setConnected(t){this.i===void 0&&(this.pt=t,this.Mt?.(t));}},T=class{get tagName(){return this.element.tagName}get d(){return this.i.d}constructor(t,e,s,i,r){this.type=1,this.e=d,this.st=void 0,this.element=t,this.name=e,this.i=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this.e=Array(s.length-1).fill(new String),this.strings=s):this.e=d;}m(t,e=this,s,i){let r=this.strings,o=false;if(r===void 0)t=C(this,t,e,0),o=!U(t)||t!==this.e&&t!==E,o&&(this.e=t);else {let l=t,a,h;for(t=r[0],a=0;a<r.length-1;a++)h=C(this,l[s+a],e,a),h===E&&(h=this.e[a]),o||=!U(h)||h!==this.e[a],h===d?t=d:t!==d&&(t+=(h??"")+r[a+1]),this.e[a]=h;}o&&!i&&this.j(t);}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}},tt=class extends T{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===d?void 0:t;}},et=class extends T{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d);}},st=class extends T{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5;}m(t,e=this){if((t=C(this,t,e,0)??d)===E)return;let s=this.e,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this.e=t;}handleEvent(t){typeof this.e=="function"?this.e.call(this.options?.host??this.element,t):this.e.handleEvent(t);}},it=class{constructor(t,e,s){this.element=t,this.type=6,this.st=void 0,this.i=e,this.options=s;}get d(){return this.i.d}m(t){C(this,t);}};var se=nt.litHtmlPolyfillSupport;se?.(R,M),(nt.litHtmlVersions??=[]).push("3.3.2");var It=(n,t,e)=>{let s=e?.renderBefore??t,i=s.It;if(i===void 0){let r=e?.renderBefore??null;s.It=i=new M(t.insertBefore(A(),r),r,void 0,e??{});}return i.m(n),i};var at=globalThis,y=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this.it=void 0;}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.it=It(e,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this.it?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this.it?.setConnected(false);}render(){return E}};y.Ht=true,y.finalized=true,at.litElementHydrateSupport?.({LitElement:y});var ie=at.litElementPolyfillSupport;ie?.({LitElement:y});(at.litElementVersions??=[]).push("4.2.2");var Lt="1.26.0";var kt="blocks",jt=Lt;var re=/\\([0-9a-fA-F]{1,6} ?)/g;function oe(n){return n.length<2?false:(n[0]==='"'||n[0]==="'")&&(n[n.length-1]==='"'||n[n.length-1]==="'")}function ae(n){let t=n;return (t[0]==='"'||t[0]==="'")&&(t=t.slice(1)),(t[t.length-1]==='"'||t[t.length-1]==="'")&&(t=t.slice(0,-1)),t}function le(n){let t="",e="";for(let s=0;s<n.length;s++){let i=n[s+1];n[s]==="\\"&&i==='"'?(t+='\\"',s++):n[s]==='"'&&e!=="\\"?t+='\\"':t+=n[s],e=n[s]??"";}return t}function Nt(n){let t=n;oe(n)&&(t=ae(t),t=t.replace(re,(e,s)=>String.fromCodePoint(parseInt(s.trim(),16))),t=t.replaceAll(`\\ `,"\\n"),t=le(t),t='"'+t+'"');try{return JSON.parse(t)}catch{return}}function _t(n){class t extends n{constructor(){super(...arguments);this.ut=null;this.nt=null;}getCssData(i,r=false){let o=this.ut??Object.create(null);if(!Object.keys(o).includes(i)||!o[i]){this.nt||(this.nt=window.getComputedStyle(this));let l=this.nt.getPropertyValue(i).trim();try{o[i]=Nt(l);}catch(a){r||console.warn(`CSS Data error: ${i}`,a),o[i]=null;}}return this.ut=o,o[i]}}return t}function Dt(n){class t extends n{static reg(s){let i=this,r=window.customElements.get(s);if(r){r!==i&&console.warn([`Element with tag name "${s}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join(` `));return}window.customElements.define(s,i);}}return t}var ce="https://ucarecdn.com",P=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:ce},"proxy-cname":{},"secure-delivery-proxy":{},"hi-res-support":{default:1},"ultra-res-support":{},format:{},"cdn-operations":{},progressive:{},quality:{},"is-background-for":{},"is-preview-blur":{default:1}});var D=class extends _t(Dt(y)){constructor(){super();this.g={};this.y=new Map;this.b=null;this.W=null;for(let e in P){let s=P[e];this.g[b+e]=s?.default||"";}}createRenderRoot(){return this}$$(e){return this.g[b+e]}set$$(e){for(let s in e){let i=b+s,r=e[s];this.g[i]=r,this.mt(i,r);}}sub$$(e,s){let i=b+e;this.y.has(i)||this.y.set(i,new Set),this.y.get(i)?.add(s);let r=this.g[i];r!==null&&r!==""&&s(r);}mt(e,s){this.y.has(e)&&this.y.get(e)?.forEach(i=>{s===null||s===""||i(s);});}analyticsParams(){return `-/@clib/${kt}/${jt}/uc-img/`}initAttributes(e){Array.from(this.attributes).forEach(s=>{let i=s;P[i.name]||e.setAttribute(i.name,i.value);});}initIntersection(e,s){let i={root:null,rootMargin:"0px"};this.b=new IntersectionObserver(r=>{r.forEach(o=>{o.isIntersecting&&(s(),this.b?.unobserve(e));});},i),this.b.observe(e),this.W||(this.W=new Set),this.W.add(e);}connectedCallback(){super.connectedCallback(),this.Lt();}Lt(){for(let e in P){let s=b+e,i=this.getCssData(s,true);i!=null&&(this.g[s]=i);}}disconnectedCallback(){super.disconnectedCallback(),this.b&&(this.W?.forEach(e=>{this.b?.unobserve(e);}),this.b=null),this.y.clear();}static get observedAttributes(){return Object.keys(P)}attributeChangedCallback(e,s,i){window.setTimeout(()=>{let r=b+e;this.g[r]=i,this.mt(r,i);});}};var zt=n=>Object.entries(n).filter(([t,e])=>e!==void 0&&e!=="").map(([t,e])=>t==="cdn-operations"||t==="analytics"?e:`${t}/${e}`);var V=class extends D{constructor(){super(...arguments);this.r=new Image;this.n=new Image;}ft(e){return !e.includes("//")&&!F&&(e=new URL(e,document.baseURI).href),e}Q(e){if(!e)return;let s=e,i=s.match(/\d+/)?.[0],r=s.match(/[a-zA-Z]+/)?.[0];if(!i||!r)return;let o=parseInt(i,10);return Number(o)>q&&this.gt?q+r:Number(o)>Q&&!this.gt?Q+r:e}kt(e,s){let i={format:this.rt("format"),quality:this.rt("quality"),resize:this.Q(e),blur:s,"cdn-operations":this.rt("cdn-operations")??void 0,analytics:this.analyticsParams()};return lt(...zt(i))}rt(e){let s=this.$$(e);if(s==null||typeof s=="string"||typeof s=="number"||typeof s=="boolean")return s}s(e="",s=""){let i=this.$$("src");if(i.startsWith("data:")||i.startsWith("blob:"))return i;if(F&&i&&!i.includes("//"))return this.E(i);let r=this.kt(e,s),o=this.$$("cdn-cname"),l=o;if(i.startsWith(String(o)))return S(i,r);let a=this.$$("uuid");if(l&&a)return this.E(S(H(l,a),r));if(a)return this.E(S(H(l,a),r));let h=this.$$("proxy-cname");if(h)return this.E(S(h,r,this.ft(i)));let p=this.$$("pubkey");if(p)return this.E(S(`https://${p}.ucr.io/`,r,this.ft(i)))}E(e){let s=this.$$("secure-delivery-proxy");return s?ut(s,{previewUrl:e},{transform:i=>window.encodeURIComponent(i)}):e}v(e,s=1,i=true){let r=e.getBoundingClientRect(),o=s*Math.round(r.width),l=i?"":s*Math.round(r.height);return o||l?`${o||""}x${l||""}`:null}jt(e){let s=r=>{r.stopPropagation();let o=new Event(r.type,r);this.dispatchEvent(o);},i=["load","error"];for(let r of i)e.addEventListener(r,s);}get img(){return this.a||(this.ot({elNode:this.r}),this.appendChild(this.r)),this.r}get q(){return this.a?{type:G.PREVIEW,img:this.n}:{type:G.MAIN,img:this.img}}get a(){return this.$$("is-preview-blur")}get yt(){return this.$$("is-background-for")}get bt(){let e=this.$$("breakpoints");if(e){let s=dt(e);return mt(s.map(i=>parseInt(i,10)))}else return null}get gt(){return this.$$("format").toLowerCase()==="jpeg"}vt(e){let s=new Set;s.add(`url("${this.s(this.v(e))}") 1x`),this.$$("hi-res-support")&&s.add(`url("${this.s(this.v(e,2))}") ${2}x`),this.$$("ultra-res-support")&&s.add(`url("${this.s(this.v(e,3))}") ${3}x`);let i=`image-set(${[...s].join(", ")})`;e.style.setProperty("background-image",i),e.style.setProperty("background-image",`-webkit-${i}`);}xt(){let e=new Set;return this.bt?this.bt.forEach(s=>{e.add(`${this.s(`${s}x`)} ${this.Q(`${s}w`)}`),this.$$("hi-res-support")&&e.add(`${this.s(`${s*2}x`)} ${this.Q(`${s*2}w`)}`),this.$$("ultra-res-support")&&e.add(`${this.s(`${s*3}x`)} ${this.Q(`${s*3}w`)}`);}):(e.add(`${this.s(this.v(this.q.img))} 1x`),this.$$("hi-res-support")&&e.add(`${this.s(this.v(this.q.img,2))} 2x`),this.$$("ultra-res-support")&&e.add(`${this.s(this.v(this.q.img,3))} 3x`)),[...e].join()}wt(){return this.s()}get Et(){return this.s("100x","100")}Nt(){let e=this.yt;[...document.querySelectorAll(e)].forEach(s=>{this.$$("intersection")?this.initIntersection(s,()=>{this.vt(s);}):this.vt(s);});}_t({elNode:e,src:s,srcset:i}){s&&(e.src=s),i&&(e.srcset=i);}ot({elNode:e}){this.jt(e),this.initAttributes(e);}at({src:e,srcset:s,elNode:i}){return new Promise((r,o)=>{this.ot({elNode:i}),i.setAttribute(W,""),i.addEventListener("load",()=>{i.removeAttribute(W),r(i);}),i.addEventListener("error",()=>{o(false);}),this._t({elNode:i,src:e,srcset:s});})}async Dt(){if(this.$$("intersection")){this.a&&(this.ot({elNode:this.n}),this.appendChild(this.n)),this.initIntersection(this.q.img,async()=>{this.a&&(this.n.src=this.Et);try{await this.at({src:this.wt(),srcset:this.xt(),elNode:this.r}),this.a&&await this.n.remove(),this.appendChild(this.r);}catch{this.a&&await this.n?.remove(),this.appendChild(this.r);}});return}try{this.a&&(await this.at({src:this.Et,elNode:this.n}),this.appendChild(this.n)),await this.at({src:this.wt(),srcset:this.xt(),elNode:this.r}),this.a&&await this.n?.remove(),this.appendChild(this.r);}catch{this.a&&await this.n?.remove(),this.appendChild(this.r);}}init(){this.yt?this.Nt():this.Dt();}};var B=class extends V{connectedCallback(){super.connectedCallback(),this.sub$$("src",()=>{this.init();}),this.sub$$("uuid",()=>{this.init();}),this.sub$$("lazy",t=>{!this.$$("is-background-for")&&!this.$$("is-preview-blur")&&(this.img.loading=t?"lazy":"eager");});}};B.reg("uc-img");/*! For license information please see uc-img.min.js.LEGAL.txt */
|
|
8
|
+
export{B as Img};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Bundled license information:
|
|
2
|
+
|
|
3
|
+
@lit/reactive-element/css-tag.js:
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2019 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@lit/reactive-element/reactive-element.js:
|
|
11
|
+
lit-html/lit-html.js:
|
|
12
|
+
lit-element/lit-element.js:
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2017 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
lit-html/is-server.js:
|
|
20
|
+
/**
|
|
21
|
+
* @license
|
|
22
|
+
* Copyright 2022 Google LLC
|
|
23
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
24
|
+
*/
|