duckfn-docs-kit 0.1.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/AGENTS.md +689 -0
- package/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/dom.d.ts +69 -0
- package/dist/home/DfkFeatures.d.ts +20 -0
- package/dist/home/DfkHero.d.ts +25 -0
- package/dist/home/DfkNextSteps.d.ts +16 -0
- package/dist/home/styles.d.ts +8 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +2 -0
- package/dist/register-DKLiYs-F.js +2324 -0
- package/dist/register.d.ts +10 -0
- package/dist/remark.d.ts +21 -0
- package/dist/remark.js +15 -0
- package/dist/runtimeConfig-Bokbb8VH.js +106 -0
- package/dist/sql/DfkSql.d.ts +7 -0
- package/dist/sql/PreviewTabs.d.ts +37 -0
- package/dist/sql/client.d.ts +1 -0
- package/dist/sql/client.js +4 -0
- package/dist/sql/editor.d.ts +16 -0
- package/dist/sql/extensions.d.ts +108 -0
- package/dist/sql/extensions.js +198 -0
- package/dist/sql/remark.d.ts +88 -0
- package/dist/sql/remark.js +69 -0
- package/dist/sql/renderers.d.ts +44 -0
- package/dist/sql/runtime.d.ts +105 -0
- package/dist/sql/runtimeConfig.d.ts +80 -0
- package/dist/sql/styles.d.ts +6 -0
- package/dist/toc-toggle/TocToggle.d.ts +46 -0
- package/dist/toc-toggle/TocToggle.js +69 -0
- package/dist/toc-toggle/client.d.ts +1 -0
- package/dist/toc-toggle/client.js +9 -0
- package/dist/toc-toggle/plugin.d.ts +36 -0
- package/dist/toc-toggle/plugin.js +13 -0
- package/dist/types.d.ts +42 -0
- package/package.json +73 -0
- package/src/dom.ts +109 -0
- package/src/home/DfkFeatures.ts +78 -0
- package/src/home/DfkHero.ts +128 -0
- package/src/home/DfkNextSteps.ts +73 -0
- package/src/home/home.css +520 -0
- package/src/home/styles.ts +28 -0
- package/src/index.ts +59 -0
- package/src/kit.css +19 -0
- package/src/register.ts +39 -0
- package/src/remark.ts +60 -0
- package/src/sql/DfkSql.css +226 -0
- package/src/sql/DfkSql.ts +620 -0
- package/src/sql/PreviewTabs.ts +169 -0
- package/src/sql/client.ts +16 -0
- package/src/sql/editor.ts +75 -0
- package/src/sql/extensions.ts +470 -0
- package/src/sql/remark.ts +213 -0
- package/src/sql/renderers.ts +916 -0
- package/src/sql/runtime.ts +348 -0
- package/src/sql/runtimeConfig.ts +249 -0
- package/src/sql/sql.css +397 -0
- package/src/sql/styles.ts +24 -0
- package/src/theme/tokens.css +75 -0
- package/src/toc-toggle/TocToggle.css +69 -0
- package/src/toc-toggle/TocToggle.ts +172 -0
- package/src/toc-toggle/client.ts +20 -0
- package/src/toc-toggle/plugin.ts +54 -0
- package/src/types.ts +47 -0
- package/src/vite-env.d.ts +8 -0
|
@@ -0,0 +1,2324 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./runtimeConfig-Bokbb8VH.js";
|
|
2
|
+
//#region src/dom.ts
|
|
3
|
+
var c = typeof HTMLElement < "u" ? HTMLElement : class {};
|
|
4
|
+
function l(e, t, n) {
|
|
5
|
+
let r = document.createElement(e), i = typeof t == "function" ? t : n;
|
|
6
|
+
if (typeof t != "function" && t) {
|
|
7
|
+
let { class: e, text: n, attrs: i, ...a } = t;
|
|
8
|
+
e !== void 0 && (r.className = e), n !== void 0 && (r.textContent = n);
|
|
9
|
+
for (let [e, t] of Object.entries(a)) t !== void 0 && (r[e] = t);
|
|
10
|
+
for (let [e, t] of Object.entries(i ?? {})) r.setAttribute(e, t);
|
|
11
|
+
}
|
|
12
|
+
return i?.(r), r;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/home/home.css?inline
|
|
16
|
+
var u = ":host{display:block}*,:before,:after{box-sizing:border-box}.dfk-hero{isolation:isolate;text-align:center;padding:4.5rem 1.5rem 4rem;position:relative;overflow-x:clip}.dfk-hero:before,.dfk-hero:after{content:\"\";z-index:-1;pointer-events:none;border-radius:50%;position:absolute}.dfk-hero:before{background:radial-gradient(circle, var(--duckfn-glow), transparent 70%);width:52rem;height:52rem;top:-18rem;left:50%;transform:translate(-50%)}.dfk-hero:after{background:radial-gradient(circle, var(--duckfn-glow-warm), transparent 70%);width:34rem;height:34rem;bottom:-14rem;right:-10rem}.dfk-hero-inner{max-width:46rem;margin:0 auto}.dfk-logo-stage{line-height:0;display:inline-block}.dfk-logo{width:clamp(7rem,16vw,10rem);height:auto;filter:drop-shadow(0 14px 28px var(--duckfn-glow));display:block}.dfk-title{letter-spacing:-.02em;color:var(--duckfn-blue);margin:1.5rem 0 0;font-size:clamp(2.25rem,5vw,3.25rem);font-weight:700;line-height:1.1}@supports ((-webkit-background-clip:text) or (background-clip:text)){.dfk-title{background-image:linear-gradient(120deg, var(--duckfn-blue-deep), var(--duckfn-blue-bright));color:#0000;-webkit-background-clip:text;background-clip:text;padding-bottom:.06em}}.dfk-title:after{content:\"\";background-color:var(--duckfn-yellow);border-radius:999px;width:3rem;height:.25rem;margin:1rem auto 0;display:block}.dfk-tagline{max-width:34rem;color:var(--ifm-color-emphasis-700);margin:1.25rem auto 0;font-size:clamp(1.05rem,2.2vw,1.25rem);line-height:1.65}.dfk-actions{flex-wrap:wrap;justify-content:center;gap:.75rem 1rem;margin-top:2.25rem;display:flex}.dfk-button-primary,.dfk-button-secondary{transition:background-color .2s var(--ifm-transition-timing-default), border-color .2s var(--ifm-transition-timing-default), color .2s var(--ifm-transition-timing-default), box-shadow .2s var(--ifm-transition-timing-default);border:1px solid #0000;border-radius:999px;justify-content:center;align-items:center;gap:.5rem;padding:.7rem 1.6rem;font-size:1rem;font-weight:600;line-height:1.4;text-decoration:none;display:inline-flex}.dfk-button-primary{background-color:var(--duckfn-btn-bg);border-color:var(--duckfn-btn-bg);color:var(--duckfn-btn-fg)}.dfk-button-primary:hover,.dfk-button-primary:focus-visible{background-color:var(--duckfn-btn-bg-hover);border-color:var(--duckfn-btn-bg-hover);color:var(--duckfn-btn-fg);box-shadow:var(--duckfn-shadow);text-decoration:none}.dfk-button-secondary{border-color:var(--duckfn-outline-border);color:var(--duckfn-blue);background-color:#0000}.dfk-button-secondary:hover,.dfk-button-secondary:focus-visible{background-color:var(--duckfn-blue-soft);border-color:var(--duckfn-blue);color:var(--duckfn-blue);text-decoration:none}.dfk-button-icon{font-size:1.125rem}.dfk-badges{flex-wrap:wrap;justify-content:center;align-items:center;gap:.5rem;margin-top:2rem;display:flex}.dfk-badge{display:inline-flex}.dfk-badge-image{width:auto;height:20px;display:block}.dfk-section{padding:4.5rem 0}.dfk-section-inner{max-width:72rem;margin:0 auto;padding:0 1.5rem}.dfk-section-title{text-align:center;letter-spacing:-.01em;margin-bottom:0;font-size:clamp(1.5rem,3vw,2rem)}.dfk-feature-grid{grid-template-columns:repeat(auto-fit,minmax(min(17rem,100%),1fr));gap:1.25rem;margin-top:2.75rem;display:grid}.dfk-feature-card{border:1px solid var(--duckfn-card-border);background-color:var(--duckfn-card-bg);transition:border-color .2s var(--ifm-transition-timing-default), box-shadow .2s var(--ifm-transition-timing-default);border-radius:1rem;flex-direction:column;padding:1.5rem;display:flex}.dfk-feature-card:hover{border-color:var(--duckfn-blue);box-shadow:var(--duckfn-shadow)}.dfk-feature-icon-chip{background-color:var(--duckfn-blue-soft);width:2.5rem;height:2.5rem;color:var(--duckfn-blue);border-radius:.75rem;justify-content:center;align-items:center;margin-bottom:1rem;display:inline-flex}.dfk-feature-icon{font-size:1.375rem}.dfk-feature-title{margin-bottom:.5rem;font-size:1.0625rem;font-weight:600}.dfk-feature-details{color:var(--ifm-color-emphasis-700);margin-bottom:0;font-size:.9375rem;line-height:1.7}.dfk-next-grid{grid-template-columns:repeat(auto-fit,minmax(min(20rem,100%),1fr));gap:1rem;max-width:54rem;margin:2.75rem auto 0;display:grid}.dfk-next-card{border:1px solid var(--duckfn-card-border);background-color:var(--duckfn-card-bg);color:inherit;transition:border-color .2s var(--ifm-transition-timing-default), box-shadow .2s var(--ifm-transition-timing-default);border-radius:.875rem;align-items:center;gap:1rem;padding:1.25rem 1.375rem;text-decoration:none;display:flex}.dfk-next-card:hover,.dfk-next-card:focus-visible{border-color:var(--duckfn-blue);box-shadow:var(--duckfn-shadow);color:inherit;text-decoration:none}.dfk-next-card-body{flex-direction:column;flex:1;gap:.25rem;min-width:0;display:flex}.dfk-next-card-title{color:var(--duckfn-blue);font-size:1rem;font-weight:600}.dfk-next-card-details{color:var(--ifm-color-emphasis-700);font-size:.9rem;line-height:1.6}.dfk-next-card-arrow{color:var(--ifm-color-emphasis-500);transition:color .2s var(--ifm-transition-timing-default);flex-shrink:0;font-size:1.25rem}.dfk-next-card:hover .dfk-next-card-arrow,.dfk-next-card:focus-visible .dfk-next-card-arrow{color:var(--duckfn-blue)}@media (prefers-reduced-motion:no-preference){.dfk-logo-stage,.dfk-title,.dfk-tagline,.dfk-actions,.dfk-badges{animation:dfk-rise .6s var(--ifm-transition-timing-default) backwards}.dfk-title{animation-delay:60ms}.dfk-tagline{animation-delay:.12s}.dfk-actions{animation-delay:.18s}.dfk-badges{animation-delay:.24s}.dfk-logo{will-change:transform;animation:7s ease-in-out infinite dfk-float}.dfk-feature-card,.dfk-next-card{animation:dfk-rise .5s var(--ifm-transition-timing-default) backwards}.dfk-feature-card:nth-child(2),.dfk-next-card:nth-child(2){animation-delay:60ms}.dfk-feature-card:nth-child(3),.dfk-next-card:nth-child(3){animation-delay:.12s}.dfk-feature-card:nth-child(4),.dfk-next-card:nth-child(4){animation-delay:.18s}.dfk-feature-card:nth-child(5){animation-delay:.24s}.dfk-feature-card:nth-child(6){animation-delay:.3s}.dfk-feature-card,.dfk-next-card,.dfk-next-card-arrow{transition:transform .2s var(--ifm-transition-timing-default), border-color .2s var(--ifm-transition-timing-default), box-shadow .2s var(--ifm-transition-timing-default), color .2s var(--ifm-transition-timing-default)}.dfk-feature-card:hover{transform:translateY(-4px)}.dfk-next-card:hover{transform:translateY(-2px)}.dfk-next-card:hover .dfk-next-card-arrow{transform:translate(4px)}}@keyframes dfk-rise{0%{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}@keyframes dfk-float{0%,to{transform:translateY(-4px)}50%{transform:translateY(4px)}}@media screen and (max-width:996px){.dfk-hero{padding:3rem 1.5rem}.dfk-section{padding:3.5rem 0}}@media screen and (max-width:576px){.dfk-section-inner{padding:0 1rem}.dfk-actions{flex-direction:column;align-items:stretch}}", d = null;
|
|
17
|
+
function f() {
|
|
18
|
+
return d || (d = new CSSStyleSheet(), d.replaceSync(u)), d;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/home/DfkFeatures.ts
|
|
22
|
+
var p = class extends c {
|
|
23
|
+
#e = l("section", { class: "dfk-section" });
|
|
24
|
+
#t = l("div", { class: "dfk-section-inner" });
|
|
25
|
+
#n = l("h2", { class: "dfk-section-title" });
|
|
26
|
+
#r = l("div", { class: "dfk-feature-grid" });
|
|
27
|
+
#i = [];
|
|
28
|
+
constructor() {
|
|
29
|
+
super(), this.#t.append(this.#n, this.#r), this.#e.appendChild(this.#t);
|
|
30
|
+
let e = this.attachShadow({ mode: "open" });
|
|
31
|
+
e.adoptedStyleSheets = [f()], e.appendChild(this.#e);
|
|
32
|
+
}
|
|
33
|
+
setSectionTitle(e) {
|
|
34
|
+
this.#n.textContent = e;
|
|
35
|
+
}
|
|
36
|
+
setFeatures(e) {
|
|
37
|
+
for (; this.#i.length > e.length;) this.#i.pop()?.root.remove();
|
|
38
|
+
for (; this.#i.length < e.length;) {
|
|
39
|
+
let e = new m();
|
|
40
|
+
this.#i.push(e), this.#r.appendChild(e.root);
|
|
41
|
+
}
|
|
42
|
+
e.forEach((e, t) => this.#i[t].setFeature(e));
|
|
43
|
+
}
|
|
44
|
+
}, m = class {
|
|
45
|
+
root = l("article", { class: "dfk-feature-card" });
|
|
46
|
+
#e = l("iconify-icon", {
|
|
47
|
+
class: "dfk-feature-icon",
|
|
48
|
+
attrs: { "aria-hidden": "true" }
|
|
49
|
+
});
|
|
50
|
+
#t = l("h3", { class: "dfk-feature-title" });
|
|
51
|
+
#n = l("p", { class: "dfk-feature-details" });
|
|
52
|
+
constructor() {
|
|
53
|
+
this.root.append(l("span", { class: "dfk-feature-icon-chip" }, (e) => e.appendChild(this.#e)), this.#t, this.#n);
|
|
54
|
+
}
|
|
55
|
+
setFeature(e) {
|
|
56
|
+
this.#e.setAttribute("icon", e.icon), this.#t.textContent = e.title, this.#n.textContent = e.details;
|
|
57
|
+
}
|
|
58
|
+
}, h = class extends c {
|
|
59
|
+
#e = l("section", { class: "dfk-hero" });
|
|
60
|
+
#t = l("div", { class: "dfk-hero-inner" });
|
|
61
|
+
#n = l("span", { class: "dfk-logo-stage" });
|
|
62
|
+
#r = l("img", {
|
|
63
|
+
class: "dfk-logo",
|
|
64
|
+
alt: "",
|
|
65
|
+
width: 480,
|
|
66
|
+
height: 480
|
|
67
|
+
});
|
|
68
|
+
#i = l("h1", { class: "dfk-title" });
|
|
69
|
+
#a = l("p", { class: "dfk-tagline" });
|
|
70
|
+
#o = l("div", { class: "dfk-actions" });
|
|
71
|
+
#s = l("a", { class: "dfk-button-primary" });
|
|
72
|
+
#c = l("span");
|
|
73
|
+
#l = l("a", { class: "dfk-button-secondary" });
|
|
74
|
+
#u = l("iconify-icon", {
|
|
75
|
+
class: "dfk-button-icon",
|
|
76
|
+
attrs: { "aria-hidden": "true" }
|
|
77
|
+
});
|
|
78
|
+
#d = l("span");
|
|
79
|
+
#f = l("div", { class: "dfk-badges" });
|
|
80
|
+
#p = [];
|
|
81
|
+
constructor() {
|
|
82
|
+
super(), this.#n.appendChild(this.#r), this.#s.appendChild(this.#c), this.#l.append(this.#u, this.#d), this.#o.append(this.#s, this.#l), this.#t.append(this.#n, this.#i, this.#a, this.#o, this.#f), this.#e.appendChild(this.#t);
|
|
83
|
+
let e = this.attachShadow({ mode: "open" });
|
|
84
|
+
e.adoptedStyleSheets = [f()], e.appendChild(this.#e);
|
|
85
|
+
}
|
|
86
|
+
setLogo(e) {
|
|
87
|
+
this.#r.src = e;
|
|
88
|
+
}
|
|
89
|
+
setTitle(e) {
|
|
90
|
+
this.#i.textContent = e;
|
|
91
|
+
}
|
|
92
|
+
setTagline(e) {
|
|
93
|
+
this.#a.textContent = e;
|
|
94
|
+
}
|
|
95
|
+
setPrimaryAction(e) {
|
|
96
|
+
this.#m(this.#s, this.#c, e, !1);
|
|
97
|
+
}
|
|
98
|
+
setSecondaryAction(e) {
|
|
99
|
+
this.#m(this.#l, this.#d, e, !0), this.#u.setAttribute("icon", e.icon);
|
|
100
|
+
}
|
|
101
|
+
setBadges(e) {
|
|
102
|
+
for (; this.#p.length > e.length;) this.#p.pop()?.remove();
|
|
103
|
+
for (; this.#p.length < e.length;) {
|
|
104
|
+
let e = l("a", {
|
|
105
|
+
class: "dfk-badge",
|
|
106
|
+
target: "_blank",
|
|
107
|
+
rel: "noopener noreferrer"
|
|
108
|
+
});
|
|
109
|
+
e.appendChild(l("img", { class: "dfk-badge-image" })), this.#p.push(e), this.#f.appendChild(e);
|
|
110
|
+
}
|
|
111
|
+
e.forEach((e, t) => {
|
|
112
|
+
let n = this.#p[t];
|
|
113
|
+
n.href = e.href;
|
|
114
|
+
let r = n.firstElementChild;
|
|
115
|
+
r.src = e.src, r.alt = e.alt;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
#m(e, t, n, r) {
|
|
119
|
+
e.href = n.href, t.textContent = n.label, r ? (e.target = "_blank", e.rel = "noopener noreferrer") : (e.removeAttribute("target"), e.removeAttribute("rel"));
|
|
120
|
+
}
|
|
121
|
+
}, ee = class extends c {
|
|
122
|
+
#e = l("section", { class: "dfk-section" });
|
|
123
|
+
#t = l("div", { class: "dfk-section-inner" });
|
|
124
|
+
#n = l("h2", { class: "dfk-section-title" });
|
|
125
|
+
#r = l("div", { class: "dfk-next-grid" });
|
|
126
|
+
#i = [];
|
|
127
|
+
constructor() {
|
|
128
|
+
super(), this.#t.append(this.#n, this.#r), this.#e.appendChild(this.#t);
|
|
129
|
+
let e = this.attachShadow({ mode: "open" });
|
|
130
|
+
e.adoptedStyleSheets = [f()], e.appendChild(this.#e);
|
|
131
|
+
}
|
|
132
|
+
setSectionTitle(e) {
|
|
133
|
+
this.#n.textContent = e;
|
|
134
|
+
}
|
|
135
|
+
setSteps(e) {
|
|
136
|
+
for (; this.#i.length > e.length;) this.#i.pop()?.root.remove();
|
|
137
|
+
for (; this.#i.length < e.length;) {
|
|
138
|
+
let e = new te();
|
|
139
|
+
this.#i.push(e), this.#r.appendChild(e.root);
|
|
140
|
+
}
|
|
141
|
+
e.forEach((e, t) => this.#i[t].setStep(e));
|
|
142
|
+
}
|
|
143
|
+
}, te = class {
|
|
144
|
+
root = l("a", { class: "dfk-next-card" });
|
|
145
|
+
#e = l("span", { class: "dfk-next-card-title" });
|
|
146
|
+
#t = l("span", { class: "dfk-next-card-details" });
|
|
147
|
+
#n = l("iconify-icon", {
|
|
148
|
+
class: "dfk-next-card-arrow",
|
|
149
|
+
attrs: {
|
|
150
|
+
icon: "lucide:arrow-right",
|
|
151
|
+
"aria-hidden": "true"
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
constructor() {
|
|
155
|
+
this.root.append(l("span", { class: "dfk-next-card-body" }, (e) => e.append(this.#e, this.#t)), this.#n);
|
|
156
|
+
}
|
|
157
|
+
setStep(e) {
|
|
158
|
+
this.root.href = e.href, this.#e.textContent = e.title, this.#t.textContent = e.details;
|
|
159
|
+
}
|
|
160
|
+
}, g = null, _ = class e {
|
|
161
|
+
static getInstance() {
|
|
162
|
+
return g ??= new e(), g;
|
|
163
|
+
}
|
|
164
|
+
#e = "idle";
|
|
165
|
+
#t = "";
|
|
166
|
+
#n = null;
|
|
167
|
+
#r = null;
|
|
168
|
+
#i = null;
|
|
169
|
+
#a = !1;
|
|
170
|
+
#o = null;
|
|
171
|
+
#s = /* @__PURE__ */ new Map();
|
|
172
|
+
get state() {
|
|
173
|
+
return this.#e;
|
|
174
|
+
}
|
|
175
|
+
get message() {
|
|
176
|
+
return this.#t;
|
|
177
|
+
}
|
|
178
|
+
init(e = {}) {
|
|
179
|
+
if (e.allowUnsignedExtensions && (this.#a = !0), this.#e === "ready") return Promise.resolve();
|
|
180
|
+
if (this.#n) return this.#n;
|
|
181
|
+
let t = this.#c();
|
|
182
|
+
return t.allowUnsignedExtensions && (this.#a = !0), this.#e = "loading", this.#n = this.#l(t.preload).catch((e) => {
|
|
183
|
+
throw this.#e = "error", this.#t = y(e), this.#n = null, e;
|
|
184
|
+
}), this.#n;
|
|
185
|
+
}
|
|
186
|
+
#c() {
|
|
187
|
+
return this.#o ??= re(), this.#o;
|
|
188
|
+
}
|
|
189
|
+
async #l(e) {
|
|
190
|
+
let t = await import("@duckdb/duckdb-wasm"), n = await t.selectBundle(t.getJsDelivrBundles());
|
|
191
|
+
if (!n.mainWorker) throw Error("The selected DuckDB-Wasm bundle has no worker script");
|
|
192
|
+
let r = URL.createObjectURL(new Blob([`importScripts("${n.mainWorker}");`], { type: "text/javascript" })), i = new Worker(r);
|
|
193
|
+
URL.revokeObjectURL(r);
|
|
194
|
+
let a = new t.ConsoleLogger();
|
|
195
|
+
this.#r = new t.AsyncDuckDB(a, i), await this.#r.instantiate(n.mainModule, n.pthreadWorker), await this.#r.open({ allowUnsignedExtensions: this.#a }), this.#i = await this.#r.connect();
|
|
196
|
+
for (let t of e) await this.#u(t);
|
|
197
|
+
this.#e = "ready", this.#t = "";
|
|
198
|
+
}
|
|
199
|
+
async execute(e) {
|
|
200
|
+
await this.init();
|
|
201
|
+
let t = this.#i;
|
|
202
|
+
if (!t) return {
|
|
203
|
+
columns: [],
|
|
204
|
+
rows: [],
|
|
205
|
+
error: this.#t || "DuckDB unavailable"
|
|
206
|
+
};
|
|
207
|
+
try {
|
|
208
|
+
let n = await t.query(e);
|
|
209
|
+
return {
|
|
210
|
+
columns: n.schema.fields.map((e) => e.name),
|
|
211
|
+
rows: n.toArray()
|
|
212
|
+
};
|
|
213
|
+
} catch (e) {
|
|
214
|
+
return {
|
|
215
|
+
columns: [],
|
|
216
|
+
rows: [],
|
|
217
|
+
error: y(e)
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
async loadExtension(e, t = {}) {
|
|
222
|
+
return await this.init(), this.#u({
|
|
223
|
+
name: e,
|
|
224
|
+
repository: t.repository
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
#u(e) {
|
|
228
|
+
let t = o(e);
|
|
229
|
+
if (typeof t == "string") return this.#d(`\u0000${t}`, () => this.#f(t));
|
|
230
|
+
if ("name" in t) {
|
|
231
|
+
let { name: e, repository: n } = t;
|
|
232
|
+
return this.#d(`${n ?? ""}\u0000${e}`, () => this.#f(e, n));
|
|
233
|
+
}
|
|
234
|
+
let { url: n } = t;
|
|
235
|
+
return this.#d(`url\u0000${n}`, () => this.#p(n));
|
|
236
|
+
}
|
|
237
|
+
#d(e, t) {
|
|
238
|
+
let n = this.#s.get(e);
|
|
239
|
+
if (n) return n;
|
|
240
|
+
let r = t().catch((t) => {
|
|
241
|
+
throw this.#s.delete(e), t;
|
|
242
|
+
});
|
|
243
|
+
return this.#s.set(e, r), r;
|
|
244
|
+
}
|
|
245
|
+
async #f(e, t) {
|
|
246
|
+
if (!r.test(e)) throw Error(`Not a valid extension name: ${e}`);
|
|
247
|
+
let n = this.#m();
|
|
248
|
+
t !== void 0 && await n.query(`INSTALL ${e} FROM ${ne(t)}`), await n.query(`LOAD ${e}`);
|
|
249
|
+
}
|
|
250
|
+
async #p(e) {
|
|
251
|
+
await this.#m().query(`LOAD '${v(e)}'`);
|
|
252
|
+
}
|
|
253
|
+
#m() {
|
|
254
|
+
let e = this.#i;
|
|
255
|
+
if (!e) throw Error(this.#t || "DuckDB unavailable");
|
|
256
|
+
return e;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
function ne(e) {
|
|
260
|
+
let t = e.toLowerCase();
|
|
261
|
+
if (a.has(t)) return t;
|
|
262
|
+
if (!n.test(e)) throw Error(`Not a valid extension repository: ${e}`);
|
|
263
|
+
return `'${e}'`;
|
|
264
|
+
}
|
|
265
|
+
function v(t) {
|
|
266
|
+
let n = i(t) ? t : new URL(t, window.location.origin).href;
|
|
267
|
+
if (!r.test(e(n))) throw Error(`An extension file must be named <extension>.duckdb_extension.wasm — the base name before the first dot is the entry symbol: ${n}`);
|
|
268
|
+
return n;
|
|
269
|
+
}
|
|
270
|
+
function re() {
|
|
271
|
+
if (typeof document > "u") return { preload: [] };
|
|
272
|
+
let e = document.getElementById(s)?.textContent?.trim();
|
|
273
|
+
if (!e) return { preload: [] };
|
|
274
|
+
try {
|
|
275
|
+
return t(JSON.parse(e));
|
|
276
|
+
} catch (e) {
|
|
277
|
+
throw Error(`Invalid <script id="${s}"> config: ${y(e)}`);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function y(e) {
|
|
281
|
+
return e instanceof Error ? e.message : String(e);
|
|
282
|
+
}
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region src/sql/PreviewTabs.ts
|
|
285
|
+
var ie = 0, b = class {
|
|
286
|
+
#e = [];
|
|
287
|
+
#t = [];
|
|
288
|
+
#n = [];
|
|
289
|
+
#r = [];
|
|
290
|
+
#i;
|
|
291
|
+
#a = null;
|
|
292
|
+
#o = !1;
|
|
293
|
+
constructor(e, t, n, r, i) {
|
|
294
|
+
this.#i = r;
|
|
295
|
+
let a = `dfk-sql-tabs-${ie += 1}`, o = l("div", { class: "dfk-sql-tabs" }), s = l("div", {
|
|
296
|
+
class: "dfk-sql-tab-list",
|
|
297
|
+
attrs: { role: "tablist" }
|
|
298
|
+
}), c = l("div", { class: "dfk-sql-panels" }), u = (e, t) => {
|
|
299
|
+
let n = this.#e.length, r = l("div", {
|
|
300
|
+
class: "dfk-sql-panel",
|
|
301
|
+
hidden: !0,
|
|
302
|
+
attrs: {
|
|
303
|
+
role: "tabpanel",
|
|
304
|
+
id: `${a}-panel-${n}`,
|
|
305
|
+
"aria-labelledby": `${a}-tab-${n}`
|
|
306
|
+
}
|
|
307
|
+
}), i = l("button", {
|
|
308
|
+
class: "dfk-sql-tab",
|
|
309
|
+
type: "button",
|
|
310
|
+
text: e,
|
|
311
|
+
tabIndex: n === 0 ? 0 : -1,
|
|
312
|
+
attrs: {
|
|
313
|
+
role: "tab",
|
|
314
|
+
id: `${a}-tab-${n}`,
|
|
315
|
+
"aria-controls": `${a}-panel-${n}`,
|
|
316
|
+
"aria-selected": "false"
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
i.addEventListener("click", () => this.#s(n)), i.addEventListener("keydown", (e) => this.#l(e, n)), this.#e.push(i), this.#t.push(r), this.#n.push(t), this.#r.push(!1), s.appendChild(i), c.appendChild(r);
|
|
320
|
+
};
|
|
321
|
+
for (let e of t) u(e.label, e);
|
|
322
|
+
u(n, null), o.appendChild(s), i && o.appendChild(i), e.replaceChildren(o, c), this.#s(0);
|
|
323
|
+
}
|
|
324
|
+
dispose() {
|
|
325
|
+
this.#o = !0, this.#a?.dispose(), this.#a = null;
|
|
326
|
+
for (let e of this.#t) e.replaceChildren();
|
|
327
|
+
}
|
|
328
|
+
#s(e) {
|
|
329
|
+
for (let t = 0; t < this.#e.length; t += 1) {
|
|
330
|
+
let n = t === e, r = this.#e[t];
|
|
331
|
+
r.classList.toggle("dfk-sql-tab-active", n), r.setAttribute("aria-selected", String(n)), r.tabIndex = n ? 0 : -1, this.#t[t].hidden = !n;
|
|
332
|
+
}
|
|
333
|
+
if (this.#r[e]) return;
|
|
334
|
+
this.#r[e] = !0;
|
|
335
|
+
let t = this.#n[e];
|
|
336
|
+
t ? t.mount(this.#t[e]) : this.#c(e);
|
|
337
|
+
}
|
|
338
|
+
async #c(e) {
|
|
339
|
+
let t = await this.#i(this.#t[e]);
|
|
340
|
+
if (this.#o) {
|
|
341
|
+
t.dispose();
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
this.#a = t;
|
|
345
|
+
}
|
|
346
|
+
#l(e, t) {
|
|
347
|
+
let n = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
|
|
348
|
+
if (n === 0) return;
|
|
349
|
+
e.preventDefault();
|
|
350
|
+
let r = (t + n + this.#e.length) % this.#e.length;
|
|
351
|
+
this.#s(r), this.#e[r].focus();
|
|
352
|
+
}
|
|
353
|
+
}, ae = "allow-scripts", x = 30, oe = 32, S = {
|
|
354
|
+
copyCell: "dfk-copy-cell",
|
|
355
|
+
copyAll: "dfk-copy-all",
|
|
356
|
+
wrap: "dfk-wrap",
|
|
357
|
+
unwrap: "dfk-unwrap",
|
|
358
|
+
freeze: "dfk-freeze",
|
|
359
|
+
unfreeze: "dfk-unfreeze",
|
|
360
|
+
reset: "dfk-reset",
|
|
361
|
+
widthAdaptive: "dfk-width-adaptive",
|
|
362
|
+
widthStandard: "dfk-width-standard",
|
|
363
|
+
widthFill: "dfk-width-fill"
|
|
364
|
+
}, se = [
|
|
365
|
+
{
|
|
366
|
+
menuKey: S.widthAdaptive,
|
|
367
|
+
label: "widthAdaptive",
|
|
368
|
+
widthMode: "adaptive",
|
|
369
|
+
autoFillWidth: !1,
|
|
370
|
+
fallback: "Fill the width"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
menuKey: S.widthStandard,
|
|
374
|
+
label: "widthStandard",
|
|
375
|
+
widthMode: "standard",
|
|
376
|
+
autoFillWidth: !1,
|
|
377
|
+
fallback: "Content widths, scroll sideways"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
menuKey: S.widthFill,
|
|
381
|
+
label: "widthFill",
|
|
382
|
+
widthMode: "standard",
|
|
383
|
+
autoFillWidth: !0,
|
|
384
|
+
fallback: "Content first, fill when it fits"
|
|
385
|
+
}
|
|
386
|
+
];
|
|
387
|
+
function ce(e) {
|
|
388
|
+
return se.find((t) => t.menuKey === e) ?? se[0];
|
|
389
|
+
}
|
|
390
|
+
var le;
|
|
391
|
+
function ue(e, t) {
|
|
392
|
+
return le ??= new Intl.Collator(void 0, {
|
|
393
|
+
numeric: !0,
|
|
394
|
+
sensitivity: "base"
|
|
395
|
+
}), le.compare(e, t);
|
|
396
|
+
}
|
|
397
|
+
function de(e) {
|
|
398
|
+
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
399
|
+
if (typeof e == "bigint") return Number(e);
|
|
400
|
+
if (e instanceof Date) {
|
|
401
|
+
let t = e.getTime();
|
|
402
|
+
return Number.isNaN(t) ? null : t;
|
|
403
|
+
}
|
|
404
|
+
return typeof e == "boolean" ? +!!e : null;
|
|
405
|
+
}
|
|
406
|
+
function fe(e, t, n) {
|
|
407
|
+
let r = e == null, i = t == null;
|
|
408
|
+
if (r || i) return r && i ? 0 : r ? 1 : -1;
|
|
409
|
+
let a = de(e), o = de(t), s;
|
|
410
|
+
s = a !== null && o !== null ? a === o ? 0 : a < o ? -1 : 1 : ue(T(e), T(t));
|
|
411
|
+
let c = s === 0 ? 0 : s < 0 ? -1 : 1;
|
|
412
|
+
return c === 0 ? 0 : String(n).toLowerCase() === "desc" ? -c : c;
|
|
413
|
+
}
|
|
414
|
+
var pe = "http://www.w3.org/2000/svg";
|
|
415
|
+
function me(e) {
|
|
416
|
+
return e instanceof Error ? e.message : String(e);
|
|
417
|
+
}
|
|
418
|
+
function he(e, t) {
|
|
419
|
+
let n = e.createElement("pre");
|
|
420
|
+
return n.className = "dfk-sql-error", n.textContent = t, n;
|
|
421
|
+
}
|
|
422
|
+
function ge(e, t) {
|
|
423
|
+
return `${e.error ?? "Error"}: ${t}`;
|
|
424
|
+
}
|
|
425
|
+
var _e = class {
|
|
426
|
+
#e;
|
|
427
|
+
#t;
|
|
428
|
+
#n;
|
|
429
|
+
#r;
|
|
430
|
+
#i;
|
|
431
|
+
#a = /* @__PURE__ */ new Set();
|
|
432
|
+
#o = 0;
|
|
433
|
+
#s = 0;
|
|
434
|
+
#c;
|
|
435
|
+
#l = S.widthAdaptive;
|
|
436
|
+
#u;
|
|
437
|
+
#d;
|
|
438
|
+
constructor(e, t, n, r) {
|
|
439
|
+
this.#t = t, this.#n = n, this.#r = r, this.#i = e.themes, this.#e = new e.ListTable(this.#y()), this.#c = this.#h(), this.#u = new ResizeObserver(() => {
|
|
440
|
+
cancelAnimationFrame(this.#s), this.#s = requestAnimationFrame(() => {
|
|
441
|
+
this.#s = 0, this.#e.resize();
|
|
442
|
+
});
|
|
443
|
+
}), this.#u.observe(t), this.#d = new MutationObserver(() => {
|
|
444
|
+
this.#g();
|
|
445
|
+
}), this.#d.observe(t.ownerDocument.documentElement, { attributeFilter: ["data-theme", "class"] }), this.#e.on("dropdown_menu_click", (e) => this.#S(e));
|
|
446
|
+
}
|
|
447
|
+
#f(e) {
|
|
448
|
+
return e.map((e) => ({
|
|
449
|
+
field: e,
|
|
450
|
+
title: e,
|
|
451
|
+
sort: fe,
|
|
452
|
+
style: { autoWrapText: this.#a.has(e) }
|
|
453
|
+
}));
|
|
454
|
+
}
|
|
455
|
+
#p() {
|
|
456
|
+
let e = [];
|
|
457
|
+
for (let t = 0; t < this.#e.colCount; t += 1) {
|
|
458
|
+
let n = this.#e.getHeaderField(t, 0);
|
|
459
|
+
if (typeof n != "string" && typeof n != "number") return [...this.#n.columns];
|
|
460
|
+
e.push(String(n));
|
|
461
|
+
}
|
|
462
|
+
return e.length === this.#n.columns.length ? e : [...this.#n.columns];
|
|
463
|
+
}
|
|
464
|
+
#m() {
|
|
465
|
+
return this.#i[this.#h()];
|
|
466
|
+
}
|
|
467
|
+
#h() {
|
|
468
|
+
return this.#t.ownerDocument.documentElement.getAttribute("data-theme") === "dark" ? "DARK" : "DEFAULT";
|
|
469
|
+
}
|
|
470
|
+
#g() {
|
|
471
|
+
let e = this.#h();
|
|
472
|
+
e !== this.#c && (this.#c = e, this.#e.updateTheme(this.#m()));
|
|
473
|
+
}
|
|
474
|
+
#_() {
|
|
475
|
+
let e = this.#m(), t = e.bodyStyle?.color ?? e.defaultStyle?.color;
|
|
476
|
+
return typeof t == "string" ? t : "#000";
|
|
477
|
+
}
|
|
478
|
+
#v() {
|
|
479
|
+
let e = this.#m(), t = e.bodyStyle?.fontSize ?? e.defaultStyle?.fontSize;
|
|
480
|
+
return typeof t == "number" ? t : 12;
|
|
481
|
+
}
|
|
482
|
+
#y() {
|
|
483
|
+
let e = ce(this.#l);
|
|
484
|
+
return {
|
|
485
|
+
container: this.#t,
|
|
486
|
+
records: this.#n.rows,
|
|
487
|
+
columns: this.#f(this.#n.columns),
|
|
488
|
+
theme: this.#m(),
|
|
489
|
+
widthMode: e.widthMode,
|
|
490
|
+
autoFillWidth: e.autoFillWidth,
|
|
491
|
+
defaultRowHeight: this.#a.size > 0 ? "auto" : x,
|
|
492
|
+
defaultHeaderRowHeight: oe,
|
|
493
|
+
columnResizeMode: "all",
|
|
494
|
+
rowResizeMode: "all",
|
|
495
|
+
dragHeaderMode: "column",
|
|
496
|
+
hover: { highlightMode: "cross" },
|
|
497
|
+
keyboardOptions: {
|
|
498
|
+
copySelected: !0,
|
|
499
|
+
selectAllOnCtrlA: !0
|
|
500
|
+
},
|
|
501
|
+
tooltip: { isShowOverflowTextTooltip: !0 },
|
|
502
|
+
menu: {
|
|
503
|
+
renderMode: "html",
|
|
504
|
+
contextMenuItems: (e) => this.#b(String(e))
|
|
505
|
+
},
|
|
506
|
+
frozenColCount: this.#o,
|
|
507
|
+
emptyTip: {
|
|
508
|
+
text: this.#r.noData ?? "No rows",
|
|
509
|
+
textStyle: {
|
|
510
|
+
fontSize: this.#v(),
|
|
511
|
+
color: this.#_()
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
#b(e) {
|
|
517
|
+
let t = this.#r, n = this.#a.has(e), r = this.#o > 0 ? {
|
|
518
|
+
text: t.unfreezeColumns ?? "Unfreeze columns",
|
|
519
|
+
menuKey: S.unfreeze
|
|
520
|
+
} : {
|
|
521
|
+
text: t.freezeColumn ?? "Freeze up to here",
|
|
522
|
+
menuKey: S.freeze
|
|
523
|
+
};
|
|
524
|
+
return [
|
|
525
|
+
{
|
|
526
|
+
text: e,
|
|
527
|
+
type: "title"
|
|
528
|
+
},
|
|
529
|
+
{ type: "split" },
|
|
530
|
+
{
|
|
531
|
+
text: t.copy ?? "Copy cell",
|
|
532
|
+
menuKey: S.copyCell
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
text: t.copyAll ?? "Copy table",
|
|
536
|
+
menuKey: S.copyAll
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
text: n ? t.unwrapColumn ?? "Stop wrapping column" : t.wrapColumn ?? "Wrap column",
|
|
540
|
+
menuKey: n ? S.unwrap : S.wrap
|
|
541
|
+
},
|
|
542
|
+
r,
|
|
543
|
+
{ type: "split" },
|
|
544
|
+
{
|
|
545
|
+
text: t.widthMode ?? "Column width",
|
|
546
|
+
children: this.#x()
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
text: t.resetView ?? "Reset view",
|
|
550
|
+
menuKey: S.reset
|
|
551
|
+
}
|
|
552
|
+
];
|
|
553
|
+
}
|
|
554
|
+
#x() {
|
|
555
|
+
return se.map((e) => ({
|
|
556
|
+
text: `${e.menuKey === this.#l ? "✓ " : ""}${this.#r[e.label] ?? e.fallback}`,
|
|
557
|
+
menuKey: e.menuKey
|
|
558
|
+
}));
|
|
559
|
+
}
|
|
560
|
+
#S(e) {
|
|
561
|
+
let t = e.col ?? -1, n = e.row ?? -1, r = e.menuKey;
|
|
562
|
+
if (!r) return;
|
|
563
|
+
let i = t >= 0 && n >= 0 ? this.#e.getCellInfo(t, n) : void 0, a = i?.field === void 0 ? "" : String(i.field);
|
|
564
|
+
switch (r) {
|
|
565
|
+
case S.copyCell:
|
|
566
|
+
this.#k(this.#C(t, n));
|
|
567
|
+
break;
|
|
568
|
+
case S.copyAll:
|
|
569
|
+
this.#k(this.#O());
|
|
570
|
+
break;
|
|
571
|
+
case S.wrap:
|
|
572
|
+
a && this.#w(a, !0);
|
|
573
|
+
break;
|
|
574
|
+
case S.unwrap:
|
|
575
|
+
a && this.#w(a, !1);
|
|
576
|
+
break;
|
|
577
|
+
case S.freeze:
|
|
578
|
+
this.#T(t);
|
|
579
|
+
break;
|
|
580
|
+
case S.unfreeze:
|
|
581
|
+
this.#T(-1);
|
|
582
|
+
break;
|
|
583
|
+
case S.widthAdaptive:
|
|
584
|
+
case S.widthStandard:
|
|
585
|
+
case S.widthFill:
|
|
586
|
+
this.#E(ce(r));
|
|
587
|
+
break;
|
|
588
|
+
case S.reset: this.#D();
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
#C(e, t) {
|
|
592
|
+
return e < 0 || t < 0 ? "" : T(this.#e.getCellRawValue(e, t));
|
|
593
|
+
}
|
|
594
|
+
#w(e, t) {
|
|
595
|
+
t ? this.#a.add(e) : this.#a.delete(e), this.#e.defaultRowHeight = this.#a.size > 0 ? "auto" : x, this.#e.updateColumns(this.#f(this.#p()), {
|
|
596
|
+
clearColWidthCache: !1,
|
|
597
|
+
clearRowHeightCache: !0
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
#T(e) {
|
|
601
|
+
this.#e.setFrozenColCount(e < 0 ? 0 : e + 1), this.#o = this.#e.frozenColCount;
|
|
602
|
+
}
|
|
603
|
+
#E(e) {
|
|
604
|
+
e.menuKey !== this.#l && (this.#l = e.menuKey, this.#e.widthMode = e.widthMode, this.#e.autoFillWidth = e.autoFillWidth, this.#e.updateColumns(this.#f(this.#p()), {
|
|
605
|
+
clearColWidthCache: !0,
|
|
606
|
+
clearRowHeightCache: !1
|
|
607
|
+
}));
|
|
608
|
+
}
|
|
609
|
+
#D() {
|
|
610
|
+
this.#a.clear(), this.#o = 0, this.#l = S.widthAdaptive, this.#e.updateOption(this.#y(), {
|
|
611
|
+
clearColWidthCache: !0,
|
|
612
|
+
clearRowHeightCache: !0
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
#O() {
|
|
616
|
+
let e = this.#e, t = [this.#n.columns.join(" ")];
|
|
617
|
+
for (let n = e.columnHeaderLevelCount; n < e.rowCount; n += 1) {
|
|
618
|
+
let r = [];
|
|
619
|
+
for (let t = 0; t < e.colCount; t += 1) r.push(T(e.getCellRawValue(t, n)));
|
|
620
|
+
t.push(r.join(" "));
|
|
621
|
+
}
|
|
622
|
+
return t.join("\n");
|
|
623
|
+
}
|
|
624
|
+
async #k(e) {
|
|
625
|
+
try {
|
|
626
|
+
await navigator.clipboard.writeText(e);
|
|
627
|
+
} catch {}
|
|
628
|
+
}
|
|
629
|
+
dispose() {
|
|
630
|
+
cancelAnimationFrame(this.#s), this.#u?.disconnect(), this.#d?.disconnect(), this.#e.release();
|
|
631
|
+
}
|
|
632
|
+
}, ve = 2, ye = 4;
|
|
633
|
+
function be() {
|
|
634
|
+
let e = l("div", { class: "dfk-sql-table-skeleton" });
|
|
635
|
+
e.style.setProperty("--dfk-sql-skeleton-row-height", `${x}px`);
|
|
636
|
+
for (let t = 0; t < ve; t += 1) e.appendChild(l("div", { class: "dfk-sql-table-skeleton-row" }, (e) => {
|
|
637
|
+
for (let t = 0; t < ye; t += 1) e.appendChild(l("span", { class: "dfk-sql-table-skeleton-cell" }));
|
|
638
|
+
}));
|
|
639
|
+
return e;
|
|
640
|
+
}
|
|
641
|
+
async function C(e, t, n) {
|
|
642
|
+
let r = e.ownerDocument, i = l("div", { class: "dfk-sql-table" });
|
|
643
|
+
i.style.setProperty("--dfk-sql-table-height", `${Math.min(360, 36 + t.rows.length * x)}px`);
|
|
644
|
+
let a = be();
|
|
645
|
+
i.appendChild(a), e.appendChild(i);
|
|
646
|
+
try {
|
|
647
|
+
let e = new _e(await import("@visactor/vtable"), i, t, n);
|
|
648
|
+
return a.remove(), { dispose: () => e.dispose() };
|
|
649
|
+
} catch (e) {
|
|
650
|
+
return a.remove(), i.appendChild(he(r, ge(n, me(e)))), { dispose: () => {} };
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
var xe = async ({ host: e, labels: t, fullscreenButton: n }, r) => {
|
|
654
|
+
let i = new b(e, [], t.table ?? "Table", (e) => C(e, r, t), n);
|
|
655
|
+
return () => i.dispose();
|
|
656
|
+
};
|
|
657
|
+
function Se(e, t) {
|
|
658
|
+
let n = e.createElement("pre");
|
|
659
|
+
n.className = "dfk-sql-text";
|
|
660
|
+
let r = [t.columns.join(" ")];
|
|
661
|
+
for (let e of t.rows) r.push(t.columns.map((t) => T(e[t])).join(" "));
|
|
662
|
+
return n.textContent = r.join("\n"), n;
|
|
663
|
+
}
|
|
664
|
+
var Ce = async ({ host: e, labels: t, fullscreenButton: n }, r) => {
|
|
665
|
+
let i = new b(e, [{
|
|
666
|
+
label: t.text ?? "Text",
|
|
667
|
+
mount: (e) => e.appendChild(Se(e.ownerDocument, r))
|
|
668
|
+
}], t.table ?? "Table", (e) => C(e, r, t), n);
|
|
669
|
+
return () => i.dispose();
|
|
670
|
+
}, we = async ({ host: e, labels: t }, n) => {
|
|
671
|
+
e.replaceChildren(he(e.ownerDocument, ge(t, n.error ?? "unknown")));
|
|
672
|
+
};
|
|
673
|
+
function Te(e, t) {
|
|
674
|
+
return e.field ? e.field : t.columns.length === 1 ? t.columns[0] : null;
|
|
675
|
+
}
|
|
676
|
+
function Ee(e, t) {
|
|
677
|
+
if (!t.trim()) return null;
|
|
678
|
+
let n = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
679
|
+
return !n || n.localName === "parsererror" || n.namespaceURI !== pe ? null : (De(n), e.importNode(n, !0));
|
|
680
|
+
}
|
|
681
|
+
function De(e) {
|
|
682
|
+
for (let t of e.querySelectorAll("script, foreignObject")) t.remove();
|
|
683
|
+
let t = (e) => {
|
|
684
|
+
for (let t of [...e.attributes]) {
|
|
685
|
+
let n = t.name.toLowerCase(), r = t.value.replace(/\s/g, "").toLowerCase();
|
|
686
|
+
(n.startsWith("on") || (n === "href" || n === "xlink:href") && r.startsWith("javascript:")) && e.removeAttribute(t.name);
|
|
687
|
+
}
|
|
688
|
+
for (let n of e.children) t(n);
|
|
689
|
+
};
|
|
690
|
+
t(e);
|
|
691
|
+
}
|
|
692
|
+
function Oe(e, t) {
|
|
693
|
+
let { width: n, height: r } = t.option ?? {};
|
|
694
|
+
n && e.style.setProperty("--dfk-sql-preview-width", n), r && e.style.setProperty("--dfk-sql-preview-height", r);
|
|
695
|
+
}
|
|
696
|
+
function ke(e, t, n, r, i) {
|
|
697
|
+
let a = n == null ? "" : String(n);
|
|
698
|
+
if (e === "iframe") {
|
|
699
|
+
let e = l("iframe", {
|
|
700
|
+
class: "dfk-sql-frame",
|
|
701
|
+
srcdoc: a,
|
|
702
|
+
attrs: {
|
|
703
|
+
sandbox: i.option?.sandbox ?? ae,
|
|
704
|
+
loading: "lazy",
|
|
705
|
+
referrerpolicy: "no-referrer",
|
|
706
|
+
title: r
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
Oe(e, i), t.appendChild(e);
|
|
710
|
+
return;
|
|
711
|
+
}
|
|
712
|
+
let o = Ee(t.ownerDocument, a);
|
|
713
|
+
if (!o) {
|
|
714
|
+
t.appendChild(l("pre", {
|
|
715
|
+
class: "dfk-sql-text",
|
|
716
|
+
text: a
|
|
717
|
+
}));
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
let s = l("div", { class: "dfk-sql-svg" });
|
|
721
|
+
s.appendChild(o), Oe(s, i), t.appendChild(s);
|
|
722
|
+
}
|
|
723
|
+
function w(e) {
|
|
724
|
+
return async ({ host: t, config: n, labels: r, fullscreenButton: i }, a) => {
|
|
725
|
+
let o = Te(n, a);
|
|
726
|
+
if (!o) {
|
|
727
|
+
t.replaceChildren(he(t.ownerDocument, ge(r, r.noField ?? "this result has no markup column; set `field`")));
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
let s = n.tab_name, c = new b(t, a.rows.map((t, i) => {
|
|
731
|
+
let a = s ? t[s] : void 0;
|
|
732
|
+
return {
|
|
733
|
+
label: a == null ? `${r.row ?? "Row"} ${i + 1}` : T(a),
|
|
734
|
+
mount: (r) => ke(e, r, t[o], "", n)
|
|
735
|
+
};
|
|
736
|
+
}), r.table ?? "Table", (e) => C(e, a, r), i);
|
|
737
|
+
return () => c.dispose();
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
function T(e) {
|
|
741
|
+
return e == null ? "NULL" : e instanceof Date ? e.toLocaleString() : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
742
|
+
}
|
|
743
|
+
var Ae = {
|
|
744
|
+
table: xe,
|
|
745
|
+
text: Ce,
|
|
746
|
+
iframe: w("iframe"),
|
|
747
|
+
html: w("iframe"),
|
|
748
|
+
svg: w("svg")
|
|
749
|
+
};
|
|
750
|
+
function je(e, t) {
|
|
751
|
+
return t.error ? we : Ae[e.show ?? (t.columns.length === 1 && t.rows.length === 1 ? "text" : "table")] ?? xe;
|
|
752
|
+
}
|
|
753
|
+
//#endregion
|
|
754
|
+
//#region src/sql/editor.ts
|
|
755
|
+
async function Me(e, t, n) {
|
|
756
|
+
let [{ basicSetup: r }, { sql: i }, { EditorView: a, keymap: o }, { defaultKeymap: s, historyKeymap: c }, { Compartment: l }] = await Promise.all([
|
|
757
|
+
import("codemirror"),
|
|
758
|
+
import("@codemirror/lang-sql"),
|
|
759
|
+
import("@codemirror/view"),
|
|
760
|
+
import("@codemirror/commands"),
|
|
761
|
+
import("@codemirror/state")
|
|
762
|
+
]), u = new l(), d = new a({
|
|
763
|
+
doc: t,
|
|
764
|
+
extensions: [
|
|
765
|
+
r,
|
|
766
|
+
i(),
|
|
767
|
+
o.of([...s, ...c]),
|
|
768
|
+
u.of([]),
|
|
769
|
+
a.updateListener.of((e) => {
|
|
770
|
+
e.docChanged && n(e.state.doc.toString());
|
|
771
|
+
})
|
|
772
|
+
],
|
|
773
|
+
parent: e
|
|
774
|
+
});
|
|
775
|
+
return {
|
|
776
|
+
getValue: () => d.state.doc.toString(),
|
|
777
|
+
setValue: (e) => d.dispatch({ changes: {
|
|
778
|
+
from: 0,
|
|
779
|
+
to: d.state.doc.length,
|
|
780
|
+
insert: e
|
|
781
|
+
} }),
|
|
782
|
+
setWrap: (e) => d.dispatch({ effects: u.reconfigure(e ? a.lineWrapping : []) }),
|
|
783
|
+
destroy: () => d.destroy()
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region src/sql/DfkSql.css?inline
|
|
788
|
+
var Ne = "*,:before,:after{box-sizing:border-box}:host{margin:1rem 0;display:block}.dfk-sql-code{position:relative}.dfk-sql-editor{border:1px solid var(--ifm-global-border-color,#e0e0e0);border-radius:var(--ifm-global-radius,.4rem);background:var(--ifm-background-surface-color,#fff);font-size:var(--ifm-code-font-size,95%);overflow:hidden}.dfk-sql-editor .cm-editor{outline:none}.dfk-sql-editor-skeleton{padding:4px .75rem}.dfk-sql-editor-skeleton-line{align-items:center;height:1.6em;display:flex}.dfk-sql-editor-skeleton-line:before{content:\"\";background-color:var(--ifm-color-emphasis-200,#e6e6e6);background-image:linear-gradient(90deg, transparent 0%, var(--ifm-color-emphasis-100,#f5f5f5) 50%, transparent 100%);background-size:200% 100%;border-radius:.25em;flex:1;height:.75em;animation:1.6s linear infinite dfk-sql-shimmer}@keyframes dfk-sql-shimmer{0%{background-position:0 0}to{background-position:100% 0}}@media (prefers-reduced-motion:reduce){.dfk-sql-editor-skeleton-line{animation:none}}.dfk-sql-editor .cm-scroller{font-family:var(--ifm-font-family-monospace,ui-monospace, SFMono-Regular, Menlo, monospace);line-height:1.6}.dfk-sql-actions{z-index:1;border-radius:var(--ifm-global-radius,.3rem);background:var(--ifm-color-emphasis-100,#f5f5f5);opacity:0;pointer-events:none;align-items:center;gap:.15rem;padding:.1rem .2rem;transition:opacity .12s;display:flex;position:absolute;top:.25rem;right:.25rem}.dfk-sql-code:hover .dfk-sql-actions,.dfk-sql-code:focus-within .dfk-sql-actions,.dfk-sql-actions-busy{opacity:1;pointer-events:auto}.dfk-sql-status{color:var(--ifm-color-emphasis-700,#666);white-space:nowrap;padding:0 .25rem;font-size:.72rem}.dfk-sql-status:empty{display:none}.dfk-sql-icon-button{border-radius:var(--ifm-global-radius,.25rem);width:1.6rem;height:1.6rem;color:var(--ifm-color-emphasis-700,#666);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex;position:relative}.dfk-sql-icon-button:hover:not(:disabled),.dfk-sql-icon-button:focus-visible{background:var(--ifm-color-emphasis-200,#e6e6e6);color:var(--ifm-color-primary,#14459b)}.dfk-sql-icon-button:disabled{opacity:.45;cursor:progress}.dfk-sql-icon-button[hidden]{display:none}.dfk-sql-icon-on{color:var(--ifm-color-primary,#14459b)}.dfk-sql-icon{font-size:1rem}[data-tip]:after{content:attr(data-tip);z-index:2;border-radius:var(--ifm-global-radius,.25rem);background:var(--ifm-color-emphasis-800,#333);color:var(--ifm-color-emphasis-0,#fff);white-space:nowrap;opacity:0;pointer-events:none;padding:.15rem .4rem;font-size:.7rem;line-height:1.4;transition:opacity .12s;position:absolute;top:calc(100% + .3rem);right:0}[data-tip]:hover:after,[data-tip]:focus-visible:after{opacity:1}", E = null;
|
|
789
|
+
function Pe() {
|
|
790
|
+
return E || (E = new CSSStyleSheet(), E.replaceSync(Ne)), E;
|
|
791
|
+
}
|
|
792
|
+
//#endregion
|
|
793
|
+
//#region src/sql/DfkSql.ts
|
|
794
|
+
var D = {
|
|
795
|
+
en: {
|
|
796
|
+
run: "Run",
|
|
797
|
+
format: "Format SQL",
|
|
798
|
+
reset: "Reset",
|
|
799
|
+
wrapOn: "Wrap long lines",
|
|
800
|
+
wrapOff: "Stop wrapping lines",
|
|
801
|
+
copy: "Copy",
|
|
802
|
+
copied: "Copied",
|
|
803
|
+
copyAll: "Copy table",
|
|
804
|
+
wrapColumn: "Wrap column",
|
|
805
|
+
unwrapColumn: "Stop wrapping column",
|
|
806
|
+
freezeColumn: "Freeze up to here",
|
|
807
|
+
unfreezeColumns: "Unfreeze columns",
|
|
808
|
+
resetView: "Reset view",
|
|
809
|
+
noData: "No rows",
|
|
810
|
+
widthMode: "Column width",
|
|
811
|
+
widthAdaptive: "Fill the width",
|
|
812
|
+
widthStandard: "Content widths, scroll sideways",
|
|
813
|
+
widthFill: "Content first, fill when it fits",
|
|
814
|
+
running: "Running…",
|
|
815
|
+
initializing: "Initializing DuckDB…",
|
|
816
|
+
loadingExtensions: "Loading extensions…",
|
|
817
|
+
initFailed: "DuckDB failed to start",
|
|
818
|
+
error: "Error",
|
|
819
|
+
formatFailed: "Could not format the SQL",
|
|
820
|
+
fullscreen: "Fullscreen",
|
|
821
|
+
exitFullscreen: "Exit fullscreen",
|
|
822
|
+
table: "Table",
|
|
823
|
+
text: "Text",
|
|
824
|
+
row: "Row",
|
|
825
|
+
noField: "this result has no markup column; set `field`"
|
|
826
|
+
},
|
|
827
|
+
"zh-hans": {
|
|
828
|
+
run: "执行",
|
|
829
|
+
format: "格式化",
|
|
830
|
+
reset: "重置",
|
|
831
|
+
wrapOn: "折行显示",
|
|
832
|
+
wrapOff: "取消折行",
|
|
833
|
+
copy: "复制",
|
|
834
|
+
copied: "已复制",
|
|
835
|
+
copyAll: "复制整表",
|
|
836
|
+
wrapColumn: "此列折行",
|
|
837
|
+
unwrapColumn: "取消此列折行",
|
|
838
|
+
freezeColumn: "冻结到此列",
|
|
839
|
+
unfreezeColumns: "取消冻结",
|
|
840
|
+
resetView: "重置视图",
|
|
841
|
+
noData: "无数据",
|
|
842
|
+
widthMode: "列宽模式",
|
|
843
|
+
widthAdaptive: "铺满宽度",
|
|
844
|
+
widthStandard: "按内容列宽(可横向滚动)",
|
|
845
|
+
widthFill: "内容优先,装得下就铺满",
|
|
846
|
+
running: "执行中…",
|
|
847
|
+
initializing: "正在初始化 DuckDB…",
|
|
848
|
+
loadingExtensions: "正在加载扩展…",
|
|
849
|
+
initFailed: "DuckDB 初始化失败",
|
|
850
|
+
error: "错误",
|
|
851
|
+
formatFailed: "格式化失败",
|
|
852
|
+
fullscreen: "全屏",
|
|
853
|
+
exitFullscreen: "退出全屏",
|
|
854
|
+
table: "表格",
|
|
855
|
+
text: "文本",
|
|
856
|
+
row: "行",
|
|
857
|
+
noField: "该结果没有可展示的标记列,请设置 `field`"
|
|
858
|
+
}
|
|
859
|
+
}, Fe = 1600, Ie = null;
|
|
860
|
+
function Le() {
|
|
861
|
+
return Ie ??= import("sql-formatter"), Ie;
|
|
862
|
+
}
|
|
863
|
+
var Re = class extends c {
|
|
864
|
+
#e = l("div", { class: "dfk-sql-editor" });
|
|
865
|
+
#t = l("div", { class: "dfk-sql-editor-skeleton" });
|
|
866
|
+
#n = [];
|
|
867
|
+
#r = l("div", { class: "dfk-sql-code" });
|
|
868
|
+
#i = l("div", { class: "dfk-sql-actions" });
|
|
869
|
+
#a = l("span", {
|
|
870
|
+
class: "dfk-sql-status",
|
|
871
|
+
attrs: { "aria-live": "polite" }
|
|
872
|
+
});
|
|
873
|
+
#o;
|
|
874
|
+
#s;
|
|
875
|
+
#c;
|
|
876
|
+
#l;
|
|
877
|
+
#u;
|
|
878
|
+
#d;
|
|
879
|
+
#f = D.en;
|
|
880
|
+
#p = { type: "duckfn" };
|
|
881
|
+
#m = "";
|
|
882
|
+
#h = "";
|
|
883
|
+
#g = !0;
|
|
884
|
+
#_ = !1;
|
|
885
|
+
#v = !1;
|
|
886
|
+
#y = !1;
|
|
887
|
+
#b = !1;
|
|
888
|
+
#x = !1;
|
|
889
|
+
#S = !1;
|
|
890
|
+
#C = 0;
|
|
891
|
+
#w = (e) => {
|
|
892
|
+
e.key === "Escape" && this.#L(!1);
|
|
893
|
+
};
|
|
894
|
+
#T = null;
|
|
895
|
+
#E = null;
|
|
896
|
+
#D = null;
|
|
897
|
+
constructor() {
|
|
898
|
+
super(), this.#o = new O("lucide:play", () => void this.#z()), this.#s = new O("lucide:wand-sparkles", () => void this.#P()), this.#c = new O("lucide:rotate-ccw", () => this.#N()), this.#l = new O("lucide:wrap-text", () => this.#F()), this.#u = new O("lucide:copy", () => void this.#I()), this.#d = new O("lucide:maximize", () => this.#L(!this.#x)), this.#i.append(this.#a, this.#o.root, this.#s.root, this.#c.root, this.#l.root, this.#u.root), this.#A(!0), this.#r.append(this.#e, this.#i);
|
|
899
|
+
let e = this.attachShadow({ mode: "open" });
|
|
900
|
+
e.adoptedStyleSheets = [Pe()], e.append(this.#r, l("slot", { attrs: { name: "dfk-result" } })), this.#k();
|
|
901
|
+
}
|
|
902
|
+
connectedCallback() {
|
|
903
|
+
this.#y ||= (this.#O(), !0), this.#R(), this.#M();
|
|
904
|
+
}
|
|
905
|
+
disconnectedCallback() {
|
|
906
|
+
this.#L(!1), this.#D?.(), this.#D = null, this.#E?.destroy(), this.#E = null, this.#C !== 0 && (window.clearTimeout(this.#C), this.#C = 0);
|
|
907
|
+
}
|
|
908
|
+
#O() {
|
|
909
|
+
this.#f = D[(document.documentElement.getAttribute("lang") ?? "en").toLowerCase()] ?? D.en;
|
|
910
|
+
let e = this.getAttribute("config");
|
|
911
|
+
if (e) try {
|
|
912
|
+
this.#p = JSON.parse(e);
|
|
913
|
+
} catch {}
|
|
914
|
+
this.#m = this.getAttribute("sql") ?? "", this.#h = this.#m, this.#k();
|
|
915
|
+
}
|
|
916
|
+
#k() {
|
|
917
|
+
this.#o.setLabel(this.#f.run), this.#s.setLabel(this.#f.format), this.#c.setLabel(this.#f.reset), this.#l.setLabel(this.#g ? this.#f.wrapOff : this.#f.wrapOn), this.#l.setOn(this.#g), this.#u.setLabel(this.#f.copy), this.#d.setLabel(this.#x ? this.#f.exitFullscreen : this.#f.fullscreen);
|
|
918
|
+
}
|
|
919
|
+
#A(e) {
|
|
920
|
+
if (!e) {
|
|
921
|
+
this.#t.remove();
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
this.#j(), this.#e.appendChild(this.#t);
|
|
925
|
+
}
|
|
926
|
+
#j() {
|
|
927
|
+
let e = Math.max(1, this.#h.split("\n").length);
|
|
928
|
+
for (; this.#n.length > e;) this.#n.pop()?.remove();
|
|
929
|
+
for (; this.#n.length < e;) {
|
|
930
|
+
let e = l("span", { class: "dfk-sql-editor-skeleton-line" });
|
|
931
|
+
this.#n.push(e), this.#t.appendChild(e);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
async #M() {
|
|
935
|
+
if (!(this.#E || this.#b)) {
|
|
936
|
+
this.#b = !0, this.#A(!0);
|
|
937
|
+
try {
|
|
938
|
+
let e = await Me(this.#e, this.#h, (e) => {
|
|
939
|
+
this.#h = e;
|
|
940
|
+
});
|
|
941
|
+
if (!this.isConnected) {
|
|
942
|
+
e.destroy();
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
e.setWrap(this.#g), this.#E = e, this.#A(!1);
|
|
946
|
+
} catch (e) {
|
|
947
|
+
this.#A(!1), this.#V(ze(e));
|
|
948
|
+
} finally {
|
|
949
|
+
this.#b = !1;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
#N() {
|
|
954
|
+
this.#h = this.#m, this.#E?.setValue(this.#h), this.#K();
|
|
955
|
+
}
|
|
956
|
+
async #P() {
|
|
957
|
+
if (!this.#v) {
|
|
958
|
+
this.#v = !0, this.#s.setDisabled(!0);
|
|
959
|
+
try {
|
|
960
|
+
let { format: e } = await Le(), t = e(this.#h, { language: "duckdb" });
|
|
961
|
+
this.#h = t, this.#E?.setValue(t);
|
|
962
|
+
} catch {
|
|
963
|
+
this.#V(this.#f.formatFailed);
|
|
964
|
+
} finally {
|
|
965
|
+
this.#v = !1, this.#s.setDisabled(!1);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
#F() {
|
|
970
|
+
this.#g = !this.#g, this.#E?.setWrap(this.#g), this.#k();
|
|
971
|
+
}
|
|
972
|
+
async #I() {
|
|
973
|
+
try {
|
|
974
|
+
await navigator.clipboard.writeText(this.#h);
|
|
975
|
+
} catch {
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
this.#u.setIcon("lucide:check"), this.#u.setLabel(this.#f.copied), this.#C !== 0 && window.clearTimeout(this.#C), this.#C = window.setTimeout(() => {
|
|
979
|
+
this.#C = 0, this.#u.setIcon("lucide:copy"), this.#u.setLabel(this.#f.copy);
|
|
980
|
+
}, Fe);
|
|
981
|
+
}
|
|
982
|
+
#L(e) {
|
|
983
|
+
this.#x = e, this.#T?.classList.toggle("dfk-sql-result-expanded", e), this.#d.setIcon(e ? "lucide:minimize" : "lucide:maximize"), this.#k(), e !== this.#S && (e ? document.addEventListener("keydown", this.#w) : document.removeEventListener("keydown", this.#w), this.#S = e);
|
|
984
|
+
}
|
|
985
|
+
#R() {
|
|
986
|
+
_.getInstance().init({ allowUnsignedExtensions: this.#p.allowUnsignedExtensions === !0 }).catch(() => void 0);
|
|
987
|
+
}
|
|
988
|
+
async #z() {
|
|
989
|
+
if (this.#_) return;
|
|
990
|
+
this.#_ = !0, this.#B(!0);
|
|
991
|
+
let e = _.getInstance();
|
|
992
|
+
try {
|
|
993
|
+
e.state !== "ready" && this.#V(this.#f.initializing);
|
|
994
|
+
try {
|
|
995
|
+
await e.init({ allowUnsignedExtensions: this.#p.allowUnsignedExtensions === !0 });
|
|
996
|
+
} catch {
|
|
997
|
+
this.#H();
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
let t = this.#p.extensions ?? [];
|
|
1001
|
+
if (t.length > 0) {
|
|
1002
|
+
this.#V(this.#f.loadingExtensions);
|
|
1003
|
+
try {
|
|
1004
|
+
for (let n of t) await e.loadExtension(n, { repository: this.#p.repository });
|
|
1005
|
+
} catch (e) {
|
|
1006
|
+
this.#G(Be(this.#f, ze(e)));
|
|
1007
|
+
return;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
this.#V(this.#f.running);
|
|
1011
|
+
let n = await e.execute(this.#h);
|
|
1012
|
+
this.#W(n);
|
|
1013
|
+
} finally {
|
|
1014
|
+
this.#_ = !1, this.#B(!1), this.#V("");
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
#B(e) {
|
|
1018
|
+
this.#o.setDisabled(e), this.#s.setDisabled(e), this.#c.setDisabled(e), this.#i.classList.toggle("dfk-sql-actions-busy", e);
|
|
1019
|
+
}
|
|
1020
|
+
#V(e) {
|
|
1021
|
+
this.#a.textContent = e;
|
|
1022
|
+
}
|
|
1023
|
+
#H() {
|
|
1024
|
+
let e = _.getInstance().message;
|
|
1025
|
+
this.#G(this.#f.initFailed + (e ? `: ${e}` : ""));
|
|
1026
|
+
}
|
|
1027
|
+
#U() {
|
|
1028
|
+
return this.#T || (this.#T = l("div", { class: "dfk-sql-result" }), this.#T.slot = "dfk-result", this.appendChild(this.#T)), this.#T.hidden = !1, this.#T;
|
|
1029
|
+
}
|
|
1030
|
+
#W(e) {
|
|
1031
|
+
this.#D?.(), this.#D = null, e.error && this.#L(!1);
|
|
1032
|
+
let t = {
|
|
1033
|
+
host: this.#U(),
|
|
1034
|
+
config: this.#p,
|
|
1035
|
+
labels: this.#f,
|
|
1036
|
+
fullscreenButton: this.#d.root
|
|
1037
|
+
};
|
|
1038
|
+
je(this.#p, e)(t, e).then((e) => {
|
|
1039
|
+
this.#D = e ?? null;
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
#G(e) {
|
|
1043
|
+
this.#L(!1);
|
|
1044
|
+
let t = this.#U(), n = t.ownerDocument.createElement("pre");
|
|
1045
|
+
n.className = "dfk-sql-error", n.textContent = e, t.replaceChildren(n);
|
|
1046
|
+
}
|
|
1047
|
+
#K() {
|
|
1048
|
+
this.#L(!1), this.#D?.(), this.#D = null, this.#T && (this.#T.replaceChildren(), this.#T.hidden = !0);
|
|
1049
|
+
}
|
|
1050
|
+
}, O = class {
|
|
1051
|
+
root = l("button", {
|
|
1052
|
+
class: "dfk-sql-icon-button",
|
|
1053
|
+
type: "button"
|
|
1054
|
+
});
|
|
1055
|
+
#e = l("iconify-icon", {
|
|
1056
|
+
class: "dfk-sql-icon",
|
|
1057
|
+
attrs: { "aria-hidden": "true" }
|
|
1058
|
+
});
|
|
1059
|
+
constructor(e, t) {
|
|
1060
|
+
this.root.appendChild(this.#e), this.root.addEventListener("click", t), this.setIcon(e);
|
|
1061
|
+
}
|
|
1062
|
+
setIcon(e) {
|
|
1063
|
+
this.#e.setAttribute("icon", e);
|
|
1064
|
+
}
|
|
1065
|
+
setLabel(e) {
|
|
1066
|
+
this.root.setAttribute("data-tip", e), this.root.setAttribute("aria-label", e);
|
|
1067
|
+
}
|
|
1068
|
+
setOn(e) {
|
|
1069
|
+
this.root.classList.toggle("dfk-sql-icon-on", e);
|
|
1070
|
+
}
|
|
1071
|
+
setDisabled(e) {
|
|
1072
|
+
e ? this.root.setAttribute("disabled", "") : this.root.removeAttribute("disabled");
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
function ze(e) {
|
|
1076
|
+
return e instanceof Error ? e.message : String(e);
|
|
1077
|
+
}
|
|
1078
|
+
function Be(e, t) {
|
|
1079
|
+
return `${e.error}: ${t}`;
|
|
1080
|
+
}
|
|
1081
|
+
//#endregion
|
|
1082
|
+
//#region ../node_modules/iconify-icon/dist/iconify-icon.mjs
|
|
1083
|
+
var Ve = Object.freeze({
|
|
1084
|
+
left: 0,
|
|
1085
|
+
top: 0,
|
|
1086
|
+
width: 16,
|
|
1087
|
+
height: 16
|
|
1088
|
+
}), k = Object.freeze({
|
|
1089
|
+
rotate: 0,
|
|
1090
|
+
vFlip: !1,
|
|
1091
|
+
hFlip: !1
|
|
1092
|
+
}), A = Object.freeze({
|
|
1093
|
+
...Ve,
|
|
1094
|
+
...k
|
|
1095
|
+
}), He = Object.freeze({
|
|
1096
|
+
...A,
|
|
1097
|
+
body: "",
|
|
1098
|
+
hidden: !1
|
|
1099
|
+
}), Ue = Object.freeze({
|
|
1100
|
+
width: null,
|
|
1101
|
+
height: null
|
|
1102
|
+
}), We = Object.freeze({
|
|
1103
|
+
...Ue,
|
|
1104
|
+
...k
|
|
1105
|
+
});
|
|
1106
|
+
function Ge(e, t = 0) {
|
|
1107
|
+
let n = e.replace(/^-?[0-9.]*/, "");
|
|
1108
|
+
function r(e) {
|
|
1109
|
+
for (; e < 0;) e += 4;
|
|
1110
|
+
return e % 4;
|
|
1111
|
+
}
|
|
1112
|
+
if (n === "") {
|
|
1113
|
+
let t = parseInt(e);
|
|
1114
|
+
return isNaN(t) ? 0 : r(t);
|
|
1115
|
+
}
|
|
1116
|
+
if (n !== e) {
|
|
1117
|
+
let t = 0;
|
|
1118
|
+
switch (n) {
|
|
1119
|
+
case "%":
|
|
1120
|
+
t = 25;
|
|
1121
|
+
break;
|
|
1122
|
+
case "deg": t = 90;
|
|
1123
|
+
}
|
|
1124
|
+
if (t) {
|
|
1125
|
+
let i = parseFloat(e.slice(0, e.length - n.length));
|
|
1126
|
+
return isNaN(i) ? 0 : (i /= t, i % 1 == 0 ? r(i) : 0);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
return t;
|
|
1130
|
+
}
|
|
1131
|
+
var Ke = /[\s,]+/;
|
|
1132
|
+
function qe(e, t) {
|
|
1133
|
+
t.split(Ke).forEach((t) => {
|
|
1134
|
+
switch (t.trim()) {
|
|
1135
|
+
case "horizontal":
|
|
1136
|
+
e.hFlip = !0;
|
|
1137
|
+
break;
|
|
1138
|
+
case "vertical": e.vFlip = !0;
|
|
1139
|
+
}
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
var Je = {
|
|
1143
|
+
...We,
|
|
1144
|
+
preserveAspectRatio: ""
|
|
1145
|
+
};
|
|
1146
|
+
function Ye(e) {
|
|
1147
|
+
let t = { ...Je }, n = (t, n) => e.getAttribute(t) || n;
|
|
1148
|
+
return t.width = n("width", null), t.height = n("height", null), t.rotate = Ge(n("rotate", "")), qe(t, n("flip", "")), t.preserveAspectRatio = n("preserveAspectRatio", n("preserveaspectratio", "")), t;
|
|
1149
|
+
}
|
|
1150
|
+
function Xe(e, t) {
|
|
1151
|
+
for (let n in Je) if (e[n] !== t[n]) return !0;
|
|
1152
|
+
return !1;
|
|
1153
|
+
}
|
|
1154
|
+
var Ze = /^[a-z0-9]+(-[a-z0-9]+)*$/, j = (e, t, n, r = "") => {
|
|
1155
|
+
let i = e.split(":");
|
|
1156
|
+
if (e.slice(0, 1) === "@") {
|
|
1157
|
+
if (i.length < 2 || i.length > 3) return null;
|
|
1158
|
+
r = i.shift().slice(1);
|
|
1159
|
+
}
|
|
1160
|
+
if (i.length > 3 || !i.length) return null;
|
|
1161
|
+
if (i.length > 1) {
|
|
1162
|
+
let e = i.pop(), n = i.pop(), a = {
|
|
1163
|
+
provider: i.length > 0 ? i[0] : r,
|
|
1164
|
+
prefix: n,
|
|
1165
|
+
name: e
|
|
1166
|
+
};
|
|
1167
|
+
return t && !M(a) ? null : a;
|
|
1168
|
+
}
|
|
1169
|
+
let a = i[0], o = a.split("-");
|
|
1170
|
+
if (o.length > 1) {
|
|
1171
|
+
let e = {
|
|
1172
|
+
provider: r,
|
|
1173
|
+
prefix: o.shift(),
|
|
1174
|
+
name: o.join("-")
|
|
1175
|
+
};
|
|
1176
|
+
return t && !M(e) ? null : e;
|
|
1177
|
+
}
|
|
1178
|
+
if (n && r === "") {
|
|
1179
|
+
let e = {
|
|
1180
|
+
provider: r,
|
|
1181
|
+
prefix: "",
|
|
1182
|
+
name: a
|
|
1183
|
+
};
|
|
1184
|
+
return t && !M(e, n) ? null : e;
|
|
1185
|
+
}
|
|
1186
|
+
return null;
|
|
1187
|
+
}, M = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
|
|
1188
|
+
function Qe(e, t) {
|
|
1189
|
+
let n = e.icons, r = e.aliases || Object.create(null), i = Object.create(null);
|
|
1190
|
+
function a(e) {
|
|
1191
|
+
if (n[e]) return i[e] = [];
|
|
1192
|
+
if (!(e in i)) {
|
|
1193
|
+
i[e] = null;
|
|
1194
|
+
let t = r[e] && r[e].parent, n = t && a(t);
|
|
1195
|
+
n && (i[e] = [t].concat(n));
|
|
1196
|
+
}
|
|
1197
|
+
return i[e];
|
|
1198
|
+
}
|
|
1199
|
+
return Object.keys(n).concat(Object.keys(r)).forEach(a), i;
|
|
1200
|
+
}
|
|
1201
|
+
function $e(e, t) {
|
|
1202
|
+
let n = {};
|
|
1203
|
+
!e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
|
|
1204
|
+
let r = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
1205
|
+
return r && (n.rotate = r), n;
|
|
1206
|
+
}
|
|
1207
|
+
function et(e, t) {
|
|
1208
|
+
let n = $e(e, t);
|
|
1209
|
+
for (let r in He) r in k ? r in e && !(r in n) && (n[r] = k[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
|
|
1210
|
+
return n;
|
|
1211
|
+
}
|
|
1212
|
+
function tt(e, t, n) {
|
|
1213
|
+
let r = e.icons, i = e.aliases || Object.create(null), a = {};
|
|
1214
|
+
function o(e) {
|
|
1215
|
+
a = et(r[e] || i[e], a);
|
|
1216
|
+
}
|
|
1217
|
+
return o(t), n.forEach(o), et(e, a);
|
|
1218
|
+
}
|
|
1219
|
+
function nt(e, t) {
|
|
1220
|
+
let n = [];
|
|
1221
|
+
if (typeof e != "object" || typeof e.icons != "object") return n;
|
|
1222
|
+
e.not_found instanceof Array && e.not_found.forEach((e) => {
|
|
1223
|
+
t(e, null), n.push(e);
|
|
1224
|
+
});
|
|
1225
|
+
let r = Qe(e);
|
|
1226
|
+
for (let i in r) {
|
|
1227
|
+
let a = r[i];
|
|
1228
|
+
a && (t(i, tt(e, i, a)), n.push(i));
|
|
1229
|
+
}
|
|
1230
|
+
return n;
|
|
1231
|
+
}
|
|
1232
|
+
var rt = {
|
|
1233
|
+
provider: "",
|
|
1234
|
+
aliases: {},
|
|
1235
|
+
not_found: {},
|
|
1236
|
+
...Ve
|
|
1237
|
+
};
|
|
1238
|
+
function N(e, t) {
|
|
1239
|
+
for (let n in t) if (n in e && typeof e[n] != typeof t[n]) return !1;
|
|
1240
|
+
return !0;
|
|
1241
|
+
}
|
|
1242
|
+
function it(e) {
|
|
1243
|
+
if (typeof e != "object" || !e) return null;
|
|
1244
|
+
let t = e;
|
|
1245
|
+
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !N(e, rt)) return null;
|
|
1246
|
+
let n = t.icons;
|
|
1247
|
+
for (let e in n) {
|
|
1248
|
+
let t = n[e];
|
|
1249
|
+
if (!e || typeof t.body != "string" || !N(t, He)) return null;
|
|
1250
|
+
}
|
|
1251
|
+
let r = t.aliases || Object.create(null);
|
|
1252
|
+
for (let e in r) {
|
|
1253
|
+
let t = r[e], i = t.parent;
|
|
1254
|
+
if (!e || typeof i != "string" || !n[i] && !r[i] || !N(t, He)) return null;
|
|
1255
|
+
}
|
|
1256
|
+
return t;
|
|
1257
|
+
}
|
|
1258
|
+
var P = Object.create(null);
|
|
1259
|
+
function at(e, t) {
|
|
1260
|
+
return {
|
|
1261
|
+
provider: e,
|
|
1262
|
+
prefix: t,
|
|
1263
|
+
icons: Object.create(null),
|
|
1264
|
+
missing: /* @__PURE__ */ new Set()
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
function F(e, t) {
|
|
1268
|
+
let n = P[e] || (P[e] = Object.create(null));
|
|
1269
|
+
return n[t] || (n[t] = at(e, t));
|
|
1270
|
+
}
|
|
1271
|
+
function ot(e, t) {
|
|
1272
|
+
return it(t) ? nt(t, (t, n) => {
|
|
1273
|
+
n ? e.icons[t] = n : e.missing.add(t);
|
|
1274
|
+
}) : [];
|
|
1275
|
+
}
|
|
1276
|
+
function st(e, t, n) {
|
|
1277
|
+
try {
|
|
1278
|
+
if (typeof n.body == "string") return e.icons[t] = { ...n }, !0;
|
|
1279
|
+
} catch {}
|
|
1280
|
+
return !1;
|
|
1281
|
+
}
|
|
1282
|
+
function ct(e, t) {
|
|
1283
|
+
let n = [];
|
|
1284
|
+
return (typeof e == "string" ? [e] : Object.keys(P)).forEach((e) => {
|
|
1285
|
+
(typeof e == "string" && typeof t == "string" ? [t] : Object.keys(P[e] || {})).forEach((t) => {
|
|
1286
|
+
let r = F(e, t);
|
|
1287
|
+
n = n.concat(Object.keys(r.icons).map((n) => (e === "" ? "" : "@" + e + ":") + t + ":" + n));
|
|
1288
|
+
});
|
|
1289
|
+
}), n;
|
|
1290
|
+
}
|
|
1291
|
+
var I = !1;
|
|
1292
|
+
function lt(e) {
|
|
1293
|
+
return typeof e == "boolean" && (I = e), I;
|
|
1294
|
+
}
|
|
1295
|
+
function L(e) {
|
|
1296
|
+
let t = typeof e == "string" ? j(e, !0, I) : e;
|
|
1297
|
+
if (t) {
|
|
1298
|
+
let e = F(t.provider, t.prefix), n = t.name;
|
|
1299
|
+
return e.icons[n] || (e.missing.has(n) ? null : void 0);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
function ut(e, t) {
|
|
1303
|
+
let n = j(e, !0, I);
|
|
1304
|
+
if (!n) return !1;
|
|
1305
|
+
let r = F(n.provider, n.prefix);
|
|
1306
|
+
return t ? st(r, n.name, t) : (r.missing.add(n.name), !0);
|
|
1307
|
+
}
|
|
1308
|
+
function dt(e, t) {
|
|
1309
|
+
if (typeof e != "object") return !1;
|
|
1310
|
+
if (typeof t != "string" && (t = e.provider || ""), I && !t && !e.prefix) {
|
|
1311
|
+
let t = !1;
|
|
1312
|
+
return it(e) && (e.prefix = "", nt(e, (e, n) => {
|
|
1313
|
+
ut(e, n) && (t = !0);
|
|
1314
|
+
})), t;
|
|
1315
|
+
}
|
|
1316
|
+
let n = e.prefix;
|
|
1317
|
+
return M({
|
|
1318
|
+
prefix: n,
|
|
1319
|
+
name: "a"
|
|
1320
|
+
}) ? !!ot(F(t, n), e) : !1;
|
|
1321
|
+
}
|
|
1322
|
+
function ft(e) {
|
|
1323
|
+
return !!L(e);
|
|
1324
|
+
}
|
|
1325
|
+
function pt(e) {
|
|
1326
|
+
let t = L(e);
|
|
1327
|
+
return t && {
|
|
1328
|
+
...A,
|
|
1329
|
+
...t
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
function mt(e, t) {
|
|
1333
|
+
e.forEach((e) => {
|
|
1334
|
+
let n = e.loaderCallbacks;
|
|
1335
|
+
n && (e.loaderCallbacks = n.filter((e) => e.id !== t));
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
function ht(e) {
|
|
1339
|
+
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
1340
|
+
e.pendingCallbacksFlag = !1;
|
|
1341
|
+
let t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
1342
|
+
if (!t.length) return;
|
|
1343
|
+
let n = !1, r = e.provider, i = e.prefix;
|
|
1344
|
+
t.forEach((t) => {
|
|
1345
|
+
let a = t.icons, o = a.pending.length;
|
|
1346
|
+
a.pending = a.pending.filter((t) => {
|
|
1347
|
+
if (t.prefix !== i) return !0;
|
|
1348
|
+
let o = t.name;
|
|
1349
|
+
if (e.icons[o]) a.loaded.push({
|
|
1350
|
+
provider: r,
|
|
1351
|
+
prefix: i,
|
|
1352
|
+
name: o
|
|
1353
|
+
});
|
|
1354
|
+
else if (e.missing.has(o)) a.missing.push({
|
|
1355
|
+
provider: r,
|
|
1356
|
+
prefix: i,
|
|
1357
|
+
name: o
|
|
1358
|
+
});
|
|
1359
|
+
else return n = !0, !0;
|
|
1360
|
+
return !1;
|
|
1361
|
+
}), a.pending.length !== o && (n || mt([e], t.id), t.callback(a.loaded.slice(0), a.missing.slice(0), a.pending.slice(0), t.abort));
|
|
1362
|
+
});
|
|
1363
|
+
}));
|
|
1364
|
+
}
|
|
1365
|
+
var gt = 0;
|
|
1366
|
+
function _t(e, t, n) {
|
|
1367
|
+
let r = gt++, i = mt.bind(null, n, r);
|
|
1368
|
+
if (!t.pending.length) return i;
|
|
1369
|
+
let a = {
|
|
1370
|
+
id: r,
|
|
1371
|
+
icons: t,
|
|
1372
|
+
callback: e,
|
|
1373
|
+
abort: i
|
|
1374
|
+
};
|
|
1375
|
+
return n.forEach((e) => {
|
|
1376
|
+
(e.loaderCallbacks ||= []).push(a);
|
|
1377
|
+
}), i;
|
|
1378
|
+
}
|
|
1379
|
+
function vt(e) {
|
|
1380
|
+
let t = {
|
|
1381
|
+
loaded: [],
|
|
1382
|
+
missing: [],
|
|
1383
|
+
pending: []
|
|
1384
|
+
}, n = Object.create(null);
|
|
1385
|
+
e.sort((e, t) => e.provider === t.provider ? e.prefix === t.prefix ? e.name.localeCompare(t.name) : e.prefix.localeCompare(t.prefix) : e.provider.localeCompare(t.provider));
|
|
1386
|
+
let r = {
|
|
1387
|
+
provider: "",
|
|
1388
|
+
prefix: "",
|
|
1389
|
+
name: ""
|
|
1390
|
+
};
|
|
1391
|
+
return e.forEach((e) => {
|
|
1392
|
+
if (r.name === e.name && r.prefix === e.prefix && r.provider === e.provider) return;
|
|
1393
|
+
r = e;
|
|
1394
|
+
let i = e.provider, a = e.prefix, o = e.name, s = n[i] || (n[i] = Object.create(null)), c = s[a] || (s[a] = F(i, a)), l;
|
|
1395
|
+
l = o in c.icons ? t.loaded : a === "" || c.missing.has(o) ? t.missing : t.pending;
|
|
1396
|
+
let u = {
|
|
1397
|
+
provider: i,
|
|
1398
|
+
prefix: a,
|
|
1399
|
+
name: o
|
|
1400
|
+
};
|
|
1401
|
+
l.push(u);
|
|
1402
|
+
}), t;
|
|
1403
|
+
}
|
|
1404
|
+
var R = Object.create(null);
|
|
1405
|
+
function yt(e, t) {
|
|
1406
|
+
R[e] = t;
|
|
1407
|
+
}
|
|
1408
|
+
function z(e) {
|
|
1409
|
+
return R[e] || R[""];
|
|
1410
|
+
}
|
|
1411
|
+
function bt(e, t = !0, n = !1) {
|
|
1412
|
+
let r = [];
|
|
1413
|
+
return e.forEach((e) => {
|
|
1414
|
+
let i = typeof e == "string" ? j(e, t, n) : e;
|
|
1415
|
+
i && r.push(i);
|
|
1416
|
+
}), r;
|
|
1417
|
+
}
|
|
1418
|
+
function B(e) {
|
|
1419
|
+
let t;
|
|
1420
|
+
if (typeof e.resources == "string") t = [e.resources];
|
|
1421
|
+
else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
|
|
1422
|
+
return {
|
|
1423
|
+
resources: t,
|
|
1424
|
+
path: e.path || "/",
|
|
1425
|
+
maxURL: e.maxURL || 500,
|
|
1426
|
+
rotate: e.rotate || 750,
|
|
1427
|
+
timeout: e.timeout || 5e3,
|
|
1428
|
+
random: e.random === !0,
|
|
1429
|
+
index: e.index || 0,
|
|
1430
|
+
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
for (var V = Object.create(null), H = ["https://api.simplesvg.com", "https://api.unisvg.com"], U = []; H.length > 0;) H.length === 1 || Math.random() > .5 ? U.push(H.shift()) : U.push(H.pop());
|
|
1434
|
+
V[""] = B({ resources: ["https://api.iconify.design"].concat(U) });
|
|
1435
|
+
function xt(e, t) {
|
|
1436
|
+
let n = B(t);
|
|
1437
|
+
return n !== null && (V[e] = n, !0);
|
|
1438
|
+
}
|
|
1439
|
+
function W(e) {
|
|
1440
|
+
return V[e];
|
|
1441
|
+
}
|
|
1442
|
+
function St() {
|
|
1443
|
+
return Object.keys(V);
|
|
1444
|
+
}
|
|
1445
|
+
var Ct = {
|
|
1446
|
+
resources: [],
|
|
1447
|
+
index: 0,
|
|
1448
|
+
timeout: 2e3,
|
|
1449
|
+
rotate: 750,
|
|
1450
|
+
random: !1,
|
|
1451
|
+
dataAfterTimeout: !1
|
|
1452
|
+
};
|
|
1453
|
+
function wt(e, t, n, r) {
|
|
1454
|
+
let i = e.resources.length, a = e.random ? Math.floor(Math.random() * i) : e.index, o;
|
|
1455
|
+
if (e.random) {
|
|
1456
|
+
let t = e.resources.slice(0);
|
|
1457
|
+
for (o = []; t.length > 1;) {
|
|
1458
|
+
let e = Math.floor(Math.random() * t.length);
|
|
1459
|
+
o.push(t[e]), t = t.slice(0, e).concat(t.slice(e + 1));
|
|
1460
|
+
}
|
|
1461
|
+
o = o.concat(t);
|
|
1462
|
+
} else o = e.resources.slice(a).concat(e.resources.slice(0, a));
|
|
1463
|
+
let s = Date.now(), c = "pending", l = 0, u, d = null, f = [], p = [];
|
|
1464
|
+
typeof r == "function" && p.push(r);
|
|
1465
|
+
function m() {
|
|
1466
|
+
d &&= (clearTimeout(d), null);
|
|
1467
|
+
}
|
|
1468
|
+
function h() {
|
|
1469
|
+
c === "pending" && (c = "aborted"), m(), f.forEach((e) => {
|
|
1470
|
+
e.status === "pending" && (e.status = "aborted");
|
|
1471
|
+
}), f = [];
|
|
1472
|
+
}
|
|
1473
|
+
function ee(e, t) {
|
|
1474
|
+
t && (p = []), typeof e == "function" && p.push(e);
|
|
1475
|
+
}
|
|
1476
|
+
function te() {
|
|
1477
|
+
return {
|
|
1478
|
+
startTime: s,
|
|
1479
|
+
payload: t,
|
|
1480
|
+
status: c,
|
|
1481
|
+
queriesSent: l,
|
|
1482
|
+
queriesPending: f.length,
|
|
1483
|
+
subscribe: ee,
|
|
1484
|
+
abort: h
|
|
1485
|
+
};
|
|
1486
|
+
}
|
|
1487
|
+
function g() {
|
|
1488
|
+
c = "failed", p.forEach((e) => {
|
|
1489
|
+
e(void 0, u);
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
function _() {
|
|
1493
|
+
f.forEach((e) => {
|
|
1494
|
+
e.status === "pending" && (e.status = "aborted");
|
|
1495
|
+
}), f = [];
|
|
1496
|
+
}
|
|
1497
|
+
function ne(t, n, r) {
|
|
1498
|
+
let i = n !== "success";
|
|
1499
|
+
switch (f = f.filter((e) => e !== t), c) {
|
|
1500
|
+
case "pending": break;
|
|
1501
|
+
case "failed":
|
|
1502
|
+
if (i || !e.dataAfterTimeout) return;
|
|
1503
|
+
break;
|
|
1504
|
+
default: return;
|
|
1505
|
+
}
|
|
1506
|
+
if (n === "abort") {
|
|
1507
|
+
u = r, g();
|
|
1508
|
+
return;
|
|
1509
|
+
}
|
|
1510
|
+
if (i) {
|
|
1511
|
+
u = r, f.length || (o.length ? v() : g());
|
|
1512
|
+
return;
|
|
1513
|
+
}
|
|
1514
|
+
if (m(), _(), !e.random) {
|
|
1515
|
+
let n = e.resources.indexOf(t.resource);
|
|
1516
|
+
n !== -1 && n !== e.index && (e.index = n);
|
|
1517
|
+
}
|
|
1518
|
+
c = "completed", p.forEach((e) => {
|
|
1519
|
+
e(r);
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
function v() {
|
|
1523
|
+
if (c !== "pending") return;
|
|
1524
|
+
m();
|
|
1525
|
+
let r = o.shift();
|
|
1526
|
+
if (r === void 0) {
|
|
1527
|
+
if (f.length) {
|
|
1528
|
+
d = setTimeout(() => {
|
|
1529
|
+
m(), c === "pending" && (_(), g());
|
|
1530
|
+
}, e.timeout);
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1533
|
+
g();
|
|
1534
|
+
return;
|
|
1535
|
+
}
|
|
1536
|
+
let i = {
|
|
1537
|
+
status: "pending",
|
|
1538
|
+
resource: r,
|
|
1539
|
+
callback: (e, t) => {
|
|
1540
|
+
ne(i, e, t);
|
|
1541
|
+
}
|
|
1542
|
+
};
|
|
1543
|
+
f.push(i), l++, d = setTimeout(v, e.rotate), n(r, t, i.callback);
|
|
1544
|
+
}
|
|
1545
|
+
return setTimeout(v), te;
|
|
1546
|
+
}
|
|
1547
|
+
function Tt(e) {
|
|
1548
|
+
let t = {
|
|
1549
|
+
...Ct,
|
|
1550
|
+
...e
|
|
1551
|
+
}, n = [];
|
|
1552
|
+
function r() {
|
|
1553
|
+
n = n.filter((e) => e().status === "pending");
|
|
1554
|
+
}
|
|
1555
|
+
function i(e, i, a) {
|
|
1556
|
+
let o = wt(t, e, i, (e, t) => {
|
|
1557
|
+
r(), a && a(e, t);
|
|
1558
|
+
});
|
|
1559
|
+
return n.push(o), o;
|
|
1560
|
+
}
|
|
1561
|
+
function a(e) {
|
|
1562
|
+
return n.find((t) => e(t)) || null;
|
|
1563
|
+
}
|
|
1564
|
+
return {
|
|
1565
|
+
query: i,
|
|
1566
|
+
find: a,
|
|
1567
|
+
setIndex: (e) => {
|
|
1568
|
+
t.index = e;
|
|
1569
|
+
},
|
|
1570
|
+
getIndex: () => t.index,
|
|
1571
|
+
cleanup: r
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
function Et() {}
|
|
1575
|
+
var G = Object.create(null);
|
|
1576
|
+
function Dt(e) {
|
|
1577
|
+
if (!G[e]) {
|
|
1578
|
+
let t = W(e);
|
|
1579
|
+
if (!t) return;
|
|
1580
|
+
G[e] = {
|
|
1581
|
+
config: t,
|
|
1582
|
+
redundancy: Tt(t)
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
return G[e];
|
|
1586
|
+
}
|
|
1587
|
+
function Ot(e, t, n) {
|
|
1588
|
+
let r, i;
|
|
1589
|
+
if (typeof e == "string") {
|
|
1590
|
+
let t = z(e);
|
|
1591
|
+
if (!t) return n(void 0, 424), Et;
|
|
1592
|
+
i = t.send;
|
|
1593
|
+
let a = Dt(e);
|
|
1594
|
+
a && (r = a.redundancy);
|
|
1595
|
+
} else {
|
|
1596
|
+
let t = B(e);
|
|
1597
|
+
if (t) {
|
|
1598
|
+
r = Tt(t);
|
|
1599
|
+
let n = z(e.resources ? e.resources[0] : "");
|
|
1600
|
+
n && (i = n.send);
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
return !r || !i ? (n(void 0, 424), Et) : r.query(t, i, n)().abort;
|
|
1604
|
+
}
|
|
1605
|
+
function kt() {}
|
|
1606
|
+
function At(e) {
|
|
1607
|
+
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
1608
|
+
e.iconsLoaderFlag = !1, ht(e);
|
|
1609
|
+
}));
|
|
1610
|
+
}
|
|
1611
|
+
function jt(e) {
|
|
1612
|
+
let t = [], n = [];
|
|
1613
|
+
return e.forEach((e) => {
|
|
1614
|
+
(e.match(Ze) ? t : n).push(e);
|
|
1615
|
+
}), {
|
|
1616
|
+
valid: t,
|
|
1617
|
+
invalid: n
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
function K(e, t, n) {
|
|
1621
|
+
function r() {
|
|
1622
|
+
let n = e.pendingIcons;
|
|
1623
|
+
t.forEach((t) => {
|
|
1624
|
+
n && n.delete(t), e.icons[t] || e.missing.add(t);
|
|
1625
|
+
});
|
|
1626
|
+
}
|
|
1627
|
+
if (n && typeof n == "object") try {
|
|
1628
|
+
if (!ot(e, n).length) {
|
|
1629
|
+
r();
|
|
1630
|
+
return;
|
|
1631
|
+
}
|
|
1632
|
+
} catch (e) {
|
|
1633
|
+
console.error(e);
|
|
1634
|
+
}
|
|
1635
|
+
r(), At(e);
|
|
1636
|
+
}
|
|
1637
|
+
function Mt(e, t) {
|
|
1638
|
+
e instanceof Promise ? e.then((e) => {
|
|
1639
|
+
t(e);
|
|
1640
|
+
}).catch(() => {
|
|
1641
|
+
t(null);
|
|
1642
|
+
}) : t(e);
|
|
1643
|
+
}
|
|
1644
|
+
function Nt(e, t) {
|
|
1645
|
+
e.iconsToLoad = e.iconsToLoad ? e.iconsToLoad.concat(t).sort() : t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
|
1646
|
+
e.iconsQueueFlag = !1;
|
|
1647
|
+
let { provider: t, prefix: n } = e, r = e.iconsToLoad;
|
|
1648
|
+
if (delete e.iconsToLoad, !r || !r.length) return;
|
|
1649
|
+
let i = e.loadIcon;
|
|
1650
|
+
if (e.loadIcons && (r.length > 1 || !i)) {
|
|
1651
|
+
Mt(e.loadIcons(r, n, t), (t) => {
|
|
1652
|
+
K(e, r, t);
|
|
1653
|
+
});
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
if (i) {
|
|
1657
|
+
r.forEach((r) => {
|
|
1658
|
+
Mt(i(r, n, t), (t) => {
|
|
1659
|
+
K(e, [r], t ? {
|
|
1660
|
+
prefix: n,
|
|
1661
|
+
icons: { [r]: t }
|
|
1662
|
+
} : null);
|
|
1663
|
+
});
|
|
1664
|
+
});
|
|
1665
|
+
return;
|
|
1666
|
+
}
|
|
1667
|
+
let { valid: a, invalid: o } = jt(r);
|
|
1668
|
+
if (o.length && K(e, o, null), !a.length) return;
|
|
1669
|
+
let s = n.match(Ze) ? z(t) : null;
|
|
1670
|
+
if (!s) {
|
|
1671
|
+
K(e, a, null);
|
|
1672
|
+
return;
|
|
1673
|
+
}
|
|
1674
|
+
s.prepare(t, n, a).forEach((n) => {
|
|
1675
|
+
Ot(t, n, (t) => {
|
|
1676
|
+
K(e, n.icons, t);
|
|
1677
|
+
});
|
|
1678
|
+
});
|
|
1679
|
+
}));
|
|
1680
|
+
}
|
|
1681
|
+
var q = (e, t) => {
|
|
1682
|
+
let n = vt(bt(e, !0, lt()));
|
|
1683
|
+
if (!n.pending.length) {
|
|
1684
|
+
let e = !0;
|
|
1685
|
+
return t && setTimeout(() => {
|
|
1686
|
+
e && t(n.loaded, n.missing, n.pending, kt);
|
|
1687
|
+
}), () => {
|
|
1688
|
+
e = !1;
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
let r = Object.create(null), i = [], a, o;
|
|
1692
|
+
return n.pending.forEach((e) => {
|
|
1693
|
+
let { provider: t, prefix: n } = e;
|
|
1694
|
+
if (n === o && t === a) return;
|
|
1695
|
+
a = t, o = n, i.push(F(t, n));
|
|
1696
|
+
let s = r[t] || (r[t] = Object.create(null));
|
|
1697
|
+
s[n] || (s[n] = []);
|
|
1698
|
+
}), n.pending.forEach((e) => {
|
|
1699
|
+
let { provider: t, prefix: n, name: i } = e, a = F(t, n), o = a.pendingIcons ||= /* @__PURE__ */ new Set();
|
|
1700
|
+
o.has(i) || (o.add(i), r[t][n].push(i));
|
|
1701
|
+
}), i.forEach((e) => {
|
|
1702
|
+
let t = r[e.provider][e.prefix];
|
|
1703
|
+
t.length && Nt(e, t);
|
|
1704
|
+
}), t ? _t(t, n, i) : kt;
|
|
1705
|
+
}, Pt = (e) => new Promise((t, n) => {
|
|
1706
|
+
let r = typeof e == "string" ? j(e, !0) : e;
|
|
1707
|
+
if (!r) {
|
|
1708
|
+
n(e);
|
|
1709
|
+
return;
|
|
1710
|
+
}
|
|
1711
|
+
q([r || e], (i) => {
|
|
1712
|
+
if (i.length && r) {
|
|
1713
|
+
let e = L(r);
|
|
1714
|
+
if (e) {
|
|
1715
|
+
t({
|
|
1716
|
+
...A,
|
|
1717
|
+
...e
|
|
1718
|
+
});
|
|
1719
|
+
return;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
n(e);
|
|
1723
|
+
});
|
|
1724
|
+
});
|
|
1725
|
+
function Ft(e) {
|
|
1726
|
+
try {
|
|
1727
|
+
let t = typeof e == "string" ? JSON.parse(e) : e;
|
|
1728
|
+
if (typeof t.body == "string") return { ...t };
|
|
1729
|
+
} catch {}
|
|
1730
|
+
}
|
|
1731
|
+
function It(e, t) {
|
|
1732
|
+
if (typeof e == "object") return {
|
|
1733
|
+
data: Ft(e),
|
|
1734
|
+
value: e
|
|
1735
|
+
};
|
|
1736
|
+
if (typeof e != "string") return { value: e };
|
|
1737
|
+
if (e.includes("{")) {
|
|
1738
|
+
let t = Ft(e);
|
|
1739
|
+
if (t) return {
|
|
1740
|
+
data: t,
|
|
1741
|
+
value: e
|
|
1742
|
+
};
|
|
1743
|
+
}
|
|
1744
|
+
let n = j(e, !0, !0);
|
|
1745
|
+
if (!n) return { value: e };
|
|
1746
|
+
let r = L(n);
|
|
1747
|
+
return r !== void 0 || !n.prefix ? {
|
|
1748
|
+
value: e,
|
|
1749
|
+
name: n,
|
|
1750
|
+
data: r
|
|
1751
|
+
} : {
|
|
1752
|
+
value: e,
|
|
1753
|
+
name: n,
|
|
1754
|
+
loading: q([n], () => t(e, n, L(n)))
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
var Lt = !1;
|
|
1758
|
+
try {
|
|
1759
|
+
Lt = navigator.vendor.indexOf("Apple") === 0;
|
|
1760
|
+
} catch {}
|
|
1761
|
+
function Rt(e, t) {
|
|
1762
|
+
switch (t) {
|
|
1763
|
+
case "svg":
|
|
1764
|
+
case "bg":
|
|
1765
|
+
case "mask": return t;
|
|
1766
|
+
}
|
|
1767
|
+
return t !== "style" && (Lt || e.indexOf("<a") === -1) ? "svg" : e.indexOf("currentColor") === -1 ? "bg" : "mask";
|
|
1768
|
+
}
|
|
1769
|
+
var zt = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Bt = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
1770
|
+
function J(e, t, n) {
|
|
1771
|
+
if (t === 1) return e;
|
|
1772
|
+
if (n ||= 100, typeof e == "number") return Math.ceil(e * t * n) / n;
|
|
1773
|
+
if (typeof e != "string") return e;
|
|
1774
|
+
let r = e.split(zt);
|
|
1775
|
+
if (r === null || !r.length) return e;
|
|
1776
|
+
let i = [], a = r.shift(), o = Bt.test(a);
|
|
1777
|
+
for (;;) {
|
|
1778
|
+
if (o) {
|
|
1779
|
+
let e = parseFloat(a);
|
|
1780
|
+
isNaN(e) ? i.push(a) : i.push(Math.ceil(e * t * n) / n);
|
|
1781
|
+
} else i.push(a);
|
|
1782
|
+
if (a = r.shift(), a === void 0) return i.join("");
|
|
1783
|
+
o = !o;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
function Vt(e, t = "defs") {
|
|
1787
|
+
let n = "", r = e.indexOf("<" + t);
|
|
1788
|
+
for (; r >= 0;) {
|
|
1789
|
+
let i = e.indexOf(">", r), a = e.indexOf("</" + t);
|
|
1790
|
+
if (i === -1 || a === -1) break;
|
|
1791
|
+
let o = e.indexOf(">", a);
|
|
1792
|
+
if (o === -1) break;
|
|
1793
|
+
n += e.slice(i + 1, a).trim(), e = e.slice(0, r).trim() + e.slice(o + 1);
|
|
1794
|
+
}
|
|
1795
|
+
return {
|
|
1796
|
+
defs: n,
|
|
1797
|
+
content: e
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
function Ht(e, t) {
|
|
1801
|
+
return e ? "<defs>" + e + "</defs>" + t : t;
|
|
1802
|
+
}
|
|
1803
|
+
function Ut(e, t, n) {
|
|
1804
|
+
let r = Vt(e);
|
|
1805
|
+
return Ht(r.defs, t + r.content + n);
|
|
1806
|
+
}
|
|
1807
|
+
var Wt = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
1808
|
+
function Gt(e, t) {
|
|
1809
|
+
let n = {
|
|
1810
|
+
...A,
|
|
1811
|
+
...e
|
|
1812
|
+
}, r = {
|
|
1813
|
+
...We,
|
|
1814
|
+
...t
|
|
1815
|
+
}, i = {
|
|
1816
|
+
left: n.left,
|
|
1817
|
+
top: n.top,
|
|
1818
|
+
width: n.width,
|
|
1819
|
+
height: n.height
|
|
1820
|
+
}, a = n.body;
|
|
1821
|
+
[n, r].forEach((e) => {
|
|
1822
|
+
let t = [], n = e.hFlip, r = e.vFlip, o = e.rotate;
|
|
1823
|
+
n ? r ? o += 2 : (t.push("translate(" + (i.width + i.left).toString() + " " + (0 - i.top).toString() + ")"), t.push("scale(-1 1)"), i.top = i.left = 0) : r && (t.push("translate(" + (0 - i.left).toString() + " " + (i.height + i.top).toString() + ")"), t.push("scale(1 -1)"), i.top = i.left = 0);
|
|
1824
|
+
let s;
|
|
1825
|
+
switch (o < 0 && (o -= Math.floor(o / 4) * 4), o %= 4, o) {
|
|
1826
|
+
case 1:
|
|
1827
|
+
s = i.height / 2 + i.top, t.unshift("rotate(90 " + s.toString() + " " + s.toString() + ")");
|
|
1828
|
+
break;
|
|
1829
|
+
case 2:
|
|
1830
|
+
t.unshift("rotate(180 " + (i.width / 2 + i.left).toString() + " " + (i.height / 2 + i.top).toString() + ")");
|
|
1831
|
+
break;
|
|
1832
|
+
case 3: s = i.width / 2 + i.left, t.unshift("rotate(-90 " + s.toString() + " " + s.toString() + ")");
|
|
1833
|
+
}
|
|
1834
|
+
o % 2 == 1 && (i.left !== i.top && (s = i.left, i.left = i.top, i.top = s), i.width !== i.height && (s = i.width, i.width = i.height, i.height = s)), t.length && (a = Ut(a, "<g transform=\"" + t.join(" ") + "\">", "</g>"));
|
|
1835
|
+
});
|
|
1836
|
+
let o = r.width, s = r.height, c = i.width, l = i.height, u, d;
|
|
1837
|
+
o === null ? (d = s === null ? "1em" : s === "auto" ? l : s, u = J(d, c / l)) : (u = o === "auto" ? c : o, d = s === null ? J(u, l / c) : s === "auto" ? l : s);
|
|
1838
|
+
let f = {}, p = (e, t) => {
|
|
1839
|
+
Wt(t) || (f[e] = t.toString());
|
|
1840
|
+
};
|
|
1841
|
+
p("width", u), p("height", d);
|
|
1842
|
+
let m = [
|
|
1843
|
+
i.left,
|
|
1844
|
+
i.top,
|
|
1845
|
+
c,
|
|
1846
|
+
l
|
|
1847
|
+
];
|
|
1848
|
+
return f.viewBox = m.join(" "), {
|
|
1849
|
+
attributes: f,
|
|
1850
|
+
viewBox: m,
|
|
1851
|
+
body: a
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
function Kt(e, t) {
|
|
1855
|
+
let n = e.indexOf("xlink:") === -1 ? "" : " xmlns:xlink=\"http://www.w3.org/1999/xlink\"";
|
|
1856
|
+
for (let e in t) n += " " + e + "=\"" + t[e] + "\"";
|
|
1857
|
+
return "<svg xmlns=\"http://www.w3.org/2000/svg\"" + n + ">" + e + "</svg>";
|
|
1858
|
+
}
|
|
1859
|
+
function qt(e) {
|
|
1860
|
+
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ").replace(/:/g, "%3A").replace(/\//g, "%2F");
|
|
1861
|
+
}
|
|
1862
|
+
function Jt(e) {
|
|
1863
|
+
return "data:image/svg+xml," + qt(e);
|
|
1864
|
+
}
|
|
1865
|
+
function Yt(e) {
|
|
1866
|
+
return "url(\"" + Jt(e) + "\")";
|
|
1867
|
+
}
|
|
1868
|
+
var Y = (() => {
|
|
1869
|
+
let e;
|
|
1870
|
+
try {
|
|
1871
|
+
if (e = fetch, typeof e == "function") return e;
|
|
1872
|
+
} catch {}
|
|
1873
|
+
})();
|
|
1874
|
+
function Xt(e) {
|
|
1875
|
+
Y = e;
|
|
1876
|
+
}
|
|
1877
|
+
function Zt() {
|
|
1878
|
+
return Y;
|
|
1879
|
+
}
|
|
1880
|
+
function Qt(e, t) {
|
|
1881
|
+
let n = W(e);
|
|
1882
|
+
if (!n) return 0;
|
|
1883
|
+
let r;
|
|
1884
|
+
if (!n.maxURL) r = 0;
|
|
1885
|
+
else {
|
|
1886
|
+
let e = 0;
|
|
1887
|
+
n.resources.forEach((t) => {
|
|
1888
|
+
e = Math.max(e, t.length);
|
|
1889
|
+
});
|
|
1890
|
+
let i = t + ".json?icons=";
|
|
1891
|
+
r = n.maxURL - e - n.path.length - i.length;
|
|
1892
|
+
}
|
|
1893
|
+
return r;
|
|
1894
|
+
}
|
|
1895
|
+
function $t(e) {
|
|
1896
|
+
return e === 404;
|
|
1897
|
+
}
|
|
1898
|
+
var en = (e, t, n) => {
|
|
1899
|
+
let r = [], i = Qt(e, t), a = "icons", o = {
|
|
1900
|
+
type: a,
|
|
1901
|
+
provider: e,
|
|
1902
|
+
prefix: t,
|
|
1903
|
+
icons: []
|
|
1904
|
+
}, s = 0;
|
|
1905
|
+
return n.forEach((n, c) => {
|
|
1906
|
+
s += n.length + 1, s >= i && c > 0 && (r.push(o), o = {
|
|
1907
|
+
type: a,
|
|
1908
|
+
provider: e,
|
|
1909
|
+
prefix: t,
|
|
1910
|
+
icons: []
|
|
1911
|
+
}, s = n.length), o.icons.push(n);
|
|
1912
|
+
}), r.push(o), r;
|
|
1913
|
+
};
|
|
1914
|
+
function tn(e) {
|
|
1915
|
+
if (typeof e == "string") {
|
|
1916
|
+
let t = W(e);
|
|
1917
|
+
if (t) return t.path;
|
|
1918
|
+
}
|
|
1919
|
+
return "/";
|
|
1920
|
+
}
|
|
1921
|
+
var nn = {
|
|
1922
|
+
prepare: en,
|
|
1923
|
+
send: (e, t, n) => {
|
|
1924
|
+
if (!Y) {
|
|
1925
|
+
n("abort", 424);
|
|
1926
|
+
return;
|
|
1927
|
+
}
|
|
1928
|
+
let r = tn(t.provider);
|
|
1929
|
+
switch (t.type) {
|
|
1930
|
+
case "icons": {
|
|
1931
|
+
let e = t.prefix, n = t.icons.join(","), i = new URLSearchParams({ icons: n });
|
|
1932
|
+
r += e + ".json?" + i.toString();
|
|
1933
|
+
break;
|
|
1934
|
+
}
|
|
1935
|
+
case "custom": {
|
|
1936
|
+
let e = t.uri;
|
|
1937
|
+
r += e.slice(0, 1) === "/" ? e.slice(1) : e;
|
|
1938
|
+
break;
|
|
1939
|
+
}
|
|
1940
|
+
default:
|
|
1941
|
+
n("abort", 400);
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1944
|
+
let i = 503;
|
|
1945
|
+
Y(e + r).then((e) => {
|
|
1946
|
+
let t = e.status;
|
|
1947
|
+
if (t !== 200) {
|
|
1948
|
+
setTimeout(() => {
|
|
1949
|
+
n($t(t) ? "abort" : "next", t);
|
|
1950
|
+
});
|
|
1951
|
+
return;
|
|
1952
|
+
}
|
|
1953
|
+
return i = 501, e.json();
|
|
1954
|
+
}).then((e) => {
|
|
1955
|
+
if (typeof e != "object" || !e) {
|
|
1956
|
+
setTimeout(() => {
|
|
1957
|
+
e === 404 ? n("abort", e) : n("next", i);
|
|
1958
|
+
});
|
|
1959
|
+
return;
|
|
1960
|
+
}
|
|
1961
|
+
setTimeout(() => {
|
|
1962
|
+
n("success", e);
|
|
1963
|
+
});
|
|
1964
|
+
}).catch(() => {
|
|
1965
|
+
n("next", i);
|
|
1966
|
+
});
|
|
1967
|
+
}
|
|
1968
|
+
};
|
|
1969
|
+
function rn(e, t, n) {
|
|
1970
|
+
F(n || "", t).loadIcons = e;
|
|
1971
|
+
}
|
|
1972
|
+
function an(e, t, n) {
|
|
1973
|
+
F(n || "", t).loadIcon = e;
|
|
1974
|
+
}
|
|
1975
|
+
var on = "data-style", sn = "", X = {};
|
|
1976
|
+
function Z(e) {
|
|
1977
|
+
return ":host{display:inline-block;vertical-align:" + (e ? "-0.125em" : "0") + "}span,svg{display:block;margin:auto}" + sn;
|
|
1978
|
+
}
|
|
1979
|
+
function cn(e) {
|
|
1980
|
+
return "adoptedStyleSheets" in e && typeof CSSStyleSheet == "function" && typeof CSSStyleSheet.prototype.replaceSync == "function";
|
|
1981
|
+
}
|
|
1982
|
+
function ln(e) {
|
|
1983
|
+
let t = e ? "inline" : "block", n = X[t];
|
|
1984
|
+
return n || (n = X[t] = new CSSStyleSheet(), n.replaceSync(Z(e))), n;
|
|
1985
|
+
}
|
|
1986
|
+
function un(e) {
|
|
1987
|
+
sn = e, X.inline?.replaceSync(Z(!0)), X.block?.replaceSync(Z(!1));
|
|
1988
|
+
}
|
|
1989
|
+
function dn(e, t) {
|
|
1990
|
+
if (cn(e)) {
|
|
1991
|
+
let n = ln(t), r = e.adoptedStyleSheets;
|
|
1992
|
+
if (r.includes(n)) return;
|
|
1993
|
+
e.adoptedStyleSheets = r.filter((e) => e !== X.inline && e !== X.block).concat(n);
|
|
1994
|
+
return;
|
|
1995
|
+
}
|
|
1996
|
+
let n = Array.from(e.childNodes).find((e) => e.hasAttribute && e.hasAttribute(on));
|
|
1997
|
+
n || (n = document.createElement("style"), n.setAttribute(on, on), e.appendChild(n)), n.textContent = Z(t);
|
|
1998
|
+
}
|
|
1999
|
+
function fn() {
|
|
2000
|
+
yt("", nn), lt(!0);
|
|
2001
|
+
let e;
|
|
2002
|
+
try {
|
|
2003
|
+
e = window;
|
|
2004
|
+
} catch {}
|
|
2005
|
+
if (e) {
|
|
2006
|
+
if (e.IconifyPreload !== void 0) {
|
|
2007
|
+
let t = e.IconifyPreload, n = "Invalid IconifyPreload syntax.";
|
|
2008
|
+
typeof t == "object" && t && (t instanceof Array ? t : [t]).forEach((e) => {
|
|
2009
|
+
try {
|
|
2010
|
+
(typeof e != "object" || !e || e instanceof Array || typeof e.icons != "object" || typeof e.prefix != "string" || !dt(e)) && console.error(n);
|
|
2011
|
+
} catch {
|
|
2012
|
+
console.error(n);
|
|
2013
|
+
}
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
if (e.IconifyProviders !== void 0) {
|
|
2017
|
+
let t = e.IconifyProviders;
|
|
2018
|
+
if (typeof t == "object" && t) for (let e in t) {
|
|
2019
|
+
let n = "IconifyProviders[" + e + "] is invalid.";
|
|
2020
|
+
try {
|
|
2021
|
+
let r = t[e];
|
|
2022
|
+
if (typeof r != "object" || !r || r.resources === void 0) continue;
|
|
2023
|
+
xt(e, r) || console.error(n);
|
|
2024
|
+
} catch {
|
|
2025
|
+
console.error(n);
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
return {
|
|
2031
|
+
iconLoaded: ft,
|
|
2032
|
+
getIcon: pt,
|
|
2033
|
+
listIcons: ct,
|
|
2034
|
+
addIcon: ut,
|
|
2035
|
+
addCollection: dt,
|
|
2036
|
+
calculateSize: J,
|
|
2037
|
+
buildIcon: Gt,
|
|
2038
|
+
iconToHTML: Kt,
|
|
2039
|
+
svgToURL: Yt,
|
|
2040
|
+
loadIcons: q,
|
|
2041
|
+
loadIcon: Pt,
|
|
2042
|
+
addAPIProvider: xt,
|
|
2043
|
+
setCustomIconLoader: an,
|
|
2044
|
+
setCustomIconsLoader: rn,
|
|
2045
|
+
appendCustomStyle: un,
|
|
2046
|
+
_api: {
|
|
2047
|
+
getAPIConfig: W,
|
|
2048
|
+
setAPIModule: yt,
|
|
2049
|
+
sendAPIQuery: Ot,
|
|
2050
|
+
setFetch: Xt,
|
|
2051
|
+
getFetch: Zt,
|
|
2052
|
+
listAPIProviders: St
|
|
2053
|
+
}
|
|
2054
|
+
};
|
|
2055
|
+
}
|
|
2056
|
+
var pn = { "background-color": "currentColor" }, mn = { "background-color": "transparent" }, hn = {
|
|
2057
|
+
image: "var(--svg)",
|
|
2058
|
+
repeat: "no-repeat",
|
|
2059
|
+
size: "100% 100%"
|
|
2060
|
+
}, gn = {
|
|
2061
|
+
"-webkit-mask": pn,
|
|
2062
|
+
mask: pn,
|
|
2063
|
+
background: mn
|
|
2064
|
+
};
|
|
2065
|
+
for (let e in gn) {
|
|
2066
|
+
let t = gn[e];
|
|
2067
|
+
for (let n in hn) t[e + "-" + n] = hn[n];
|
|
2068
|
+
}
|
|
2069
|
+
function _n(e) {
|
|
2070
|
+
return e ? e + (e.match(/^[-0-9.]+$/) ? "px" : "") : "inherit";
|
|
2071
|
+
}
|
|
2072
|
+
function vn(e, t, n) {
|
|
2073
|
+
let r = document.createElement("span"), i = e.body;
|
|
2074
|
+
i.indexOf("<a") !== -1 && (i += "<!-- " + Date.now() + " -->");
|
|
2075
|
+
let a = e.attributes, o = Yt(Kt(i, {
|
|
2076
|
+
...a,
|
|
2077
|
+
width: t.width + "",
|
|
2078
|
+
height: t.height + ""
|
|
2079
|
+
})), s = r.style, c = {
|
|
2080
|
+
"--svg": o,
|
|
2081
|
+
width: _n(a.width),
|
|
2082
|
+
height: _n(a.height),
|
|
2083
|
+
...n ? pn : mn
|
|
2084
|
+
};
|
|
2085
|
+
for (let e in c) s.setProperty(e, c[e]);
|
|
2086
|
+
return r;
|
|
2087
|
+
}
|
|
2088
|
+
var Q;
|
|
2089
|
+
function yn() {
|
|
2090
|
+
try {
|
|
2091
|
+
Q = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
|
|
2092
|
+
} catch {
|
|
2093
|
+
Q = null;
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
function bn(e) {
|
|
2097
|
+
return Q === void 0 && yn(), Q ? Q.createHTML(e) : e;
|
|
2098
|
+
}
|
|
2099
|
+
function xn(e) {
|
|
2100
|
+
let t = document.createElement("span"), n = e.attributes, r = "";
|
|
2101
|
+
return n.width || (r = "width: inherit;"), n.height || (r += "height: inherit;"), r && (n.style = r), t.innerHTML = bn(Kt(e.body, n)), t.firstChild;
|
|
2102
|
+
}
|
|
2103
|
+
function Sn(e) {
|
|
2104
|
+
return Array.from(e.childNodes).find((e) => {
|
|
2105
|
+
let t = e.tagName && e.tagName.toUpperCase();
|
|
2106
|
+
return t === "SPAN" || t === "SVG";
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2109
|
+
function Cn(e, t) {
|
|
2110
|
+
let n = t.icon.data, r = t.customisations, i = Gt(n, r);
|
|
2111
|
+
r.preserveAspectRatio && (i.attributes.preserveAspectRatio = r.preserveAspectRatio);
|
|
2112
|
+
let a = t.renderedMode, o;
|
|
2113
|
+
switch (a) {
|
|
2114
|
+
case "svg":
|
|
2115
|
+
o = xn(i);
|
|
2116
|
+
break;
|
|
2117
|
+
default: o = vn(i, {
|
|
2118
|
+
...A,
|
|
2119
|
+
...n
|
|
2120
|
+
}, a === "mask");
|
|
2121
|
+
}
|
|
2122
|
+
let s = Sn(e);
|
|
2123
|
+
s ? o.tagName === "SPAN" && s.tagName === o.tagName ? s.setAttribute("style", o.getAttribute("style")) : e.replaceChild(o, s) : e.appendChild(o);
|
|
2124
|
+
}
|
|
2125
|
+
function wn(e, t, n) {
|
|
2126
|
+
return {
|
|
2127
|
+
rendered: !1,
|
|
2128
|
+
inline: t,
|
|
2129
|
+
icon: e,
|
|
2130
|
+
lastRender: n && (n.rendered ? n : n.lastRender)
|
|
2131
|
+
};
|
|
2132
|
+
}
|
|
2133
|
+
function Tn(e = "iconify-icon") {
|
|
2134
|
+
let t, n;
|
|
2135
|
+
try {
|
|
2136
|
+
t = window.customElements, n = window.HTMLElement;
|
|
2137
|
+
} catch {
|
|
2138
|
+
return;
|
|
2139
|
+
}
|
|
2140
|
+
if (!t || !n) return;
|
|
2141
|
+
let r = t.get(e);
|
|
2142
|
+
if (r) return r;
|
|
2143
|
+
let i = [
|
|
2144
|
+
"icon",
|
|
2145
|
+
"mode",
|
|
2146
|
+
"inline",
|
|
2147
|
+
"noobserver",
|
|
2148
|
+
"width",
|
|
2149
|
+
"height",
|
|
2150
|
+
"rotate",
|
|
2151
|
+
"flip"
|
|
2152
|
+
], a = class extends n {
|
|
2153
|
+
_shadowRoot;
|
|
2154
|
+
_initialised = !1;
|
|
2155
|
+
_state;
|
|
2156
|
+
_checkQueued = !1;
|
|
2157
|
+
_connected = !1;
|
|
2158
|
+
_observer = null;
|
|
2159
|
+
_visible = !0;
|
|
2160
|
+
constructor() {
|
|
2161
|
+
super();
|
|
2162
|
+
let e = this._shadowRoot = this.attachShadow({ mode: "open" }), t = this.hasAttribute("inline");
|
|
2163
|
+
dn(e, t), this._state = wn({ value: "" }, t), this._queueCheck();
|
|
2164
|
+
}
|
|
2165
|
+
connectedCallback() {
|
|
2166
|
+
this._connected = !0, this.startObserver();
|
|
2167
|
+
}
|
|
2168
|
+
disconnectedCallback() {
|
|
2169
|
+
this._connected = !1, this.stopObserver();
|
|
2170
|
+
}
|
|
2171
|
+
static get observedAttributes() {
|
|
2172
|
+
return i.slice(0);
|
|
2173
|
+
}
|
|
2174
|
+
attributeChangedCallback(e) {
|
|
2175
|
+
switch (e) {
|
|
2176
|
+
case "inline": {
|
|
2177
|
+
let e = this.hasAttribute("inline"), t = this._state;
|
|
2178
|
+
e !== t.inline && (t.inline = e, dn(this._shadowRoot, e));
|
|
2179
|
+
break;
|
|
2180
|
+
}
|
|
2181
|
+
case "noobserver":
|
|
2182
|
+
this.hasAttribute("noobserver") ? this.startObserver() : this.stopObserver();
|
|
2183
|
+
break;
|
|
2184
|
+
default: this._queueCheck();
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
get icon() {
|
|
2188
|
+
let e = this.getAttribute("icon");
|
|
2189
|
+
if (e && e.slice(0, 1) === "{") try {
|
|
2190
|
+
return JSON.parse(e);
|
|
2191
|
+
} catch {}
|
|
2192
|
+
return e;
|
|
2193
|
+
}
|
|
2194
|
+
set icon(e) {
|
|
2195
|
+
typeof e == "object" && (e = JSON.stringify(e)), this.setAttribute("icon", e);
|
|
2196
|
+
}
|
|
2197
|
+
get inline() {
|
|
2198
|
+
return this.hasAttribute("inline");
|
|
2199
|
+
}
|
|
2200
|
+
set inline(e) {
|
|
2201
|
+
e ? this.setAttribute("inline", "true") : this.removeAttribute("inline");
|
|
2202
|
+
}
|
|
2203
|
+
get observer() {
|
|
2204
|
+
return this.hasAttribute("observer");
|
|
2205
|
+
}
|
|
2206
|
+
set observer(e) {
|
|
2207
|
+
e ? this.setAttribute("observer", "true") : this.removeAttribute("observer");
|
|
2208
|
+
}
|
|
2209
|
+
restartAnimation() {
|
|
2210
|
+
let e = this._state;
|
|
2211
|
+
if (e.rendered) {
|
|
2212
|
+
let t = this._shadowRoot;
|
|
2213
|
+
if (e.renderedMode === "svg") try {
|
|
2214
|
+
t.lastChild.setCurrentTime(0);
|
|
2215
|
+
return;
|
|
2216
|
+
} catch {}
|
|
2217
|
+
Cn(t, e);
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
get status() {
|
|
2221
|
+
let e = this._state;
|
|
2222
|
+
return e.rendered ? "rendered" : e.icon.data === null ? "failed" : "loading";
|
|
2223
|
+
}
|
|
2224
|
+
_queueCheck() {
|
|
2225
|
+
this._checkQueued || (this._checkQueued = !0, setTimeout(() => {
|
|
2226
|
+
this._check();
|
|
2227
|
+
}));
|
|
2228
|
+
}
|
|
2229
|
+
_check() {
|
|
2230
|
+
if (!this._checkQueued) return;
|
|
2231
|
+
this._checkQueued = !1;
|
|
2232
|
+
let e = this._state, t = this.getAttribute("icon");
|
|
2233
|
+
if (t !== e.icon.value) {
|
|
2234
|
+
this._iconChanged(t);
|
|
2235
|
+
return;
|
|
2236
|
+
}
|
|
2237
|
+
if (!e.rendered || !this._visible) return;
|
|
2238
|
+
let n = this.getAttribute("mode"), r = Ye(this);
|
|
2239
|
+
(e.attrMode !== n || Xe(e.customisations, r) || !Sn(this._shadowRoot)) && this._renderIcon(e.icon, r, n);
|
|
2240
|
+
}
|
|
2241
|
+
_iconChanged(e) {
|
|
2242
|
+
let t = It(e, (e, t, n) => {
|
|
2243
|
+
let r = this._state;
|
|
2244
|
+
if (r.rendered || this.getAttribute("icon") !== e) return;
|
|
2245
|
+
let i = {
|
|
2246
|
+
value: e,
|
|
2247
|
+
name: t,
|
|
2248
|
+
data: n
|
|
2249
|
+
};
|
|
2250
|
+
i.data ? this._gotIconData(i) : r.icon = i;
|
|
2251
|
+
});
|
|
2252
|
+
t.data ? this._gotIconData(t) : this._state = wn(t, this._state.inline, this._state);
|
|
2253
|
+
}
|
|
2254
|
+
_forceRender() {
|
|
2255
|
+
if (!this._visible) {
|
|
2256
|
+
let e = Sn(this._shadowRoot);
|
|
2257
|
+
e && this._shadowRoot.removeChild(e);
|
|
2258
|
+
return;
|
|
2259
|
+
}
|
|
2260
|
+
this._queueCheck();
|
|
2261
|
+
}
|
|
2262
|
+
_gotIconData(e) {
|
|
2263
|
+
this._checkQueued = !1, this._renderIcon(e, Ye(this), this.getAttribute("mode"));
|
|
2264
|
+
}
|
|
2265
|
+
_renderIcon(e, t, n) {
|
|
2266
|
+
let r = Rt(e.data.body, n), i = this._state.inline;
|
|
2267
|
+
Cn(this._shadowRoot, this._state = {
|
|
2268
|
+
rendered: !0,
|
|
2269
|
+
icon: e,
|
|
2270
|
+
inline: i,
|
|
2271
|
+
customisations: t,
|
|
2272
|
+
attrMode: n,
|
|
2273
|
+
renderedMode: r
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
startObserver() {
|
|
2277
|
+
if (!this._observer && !this.hasAttribute("noobserver")) try {
|
|
2278
|
+
this._observer = new IntersectionObserver((e) => {
|
|
2279
|
+
let t = e.some((e) => e.isIntersecting);
|
|
2280
|
+
t !== this._visible && (this._visible = t, this._forceRender());
|
|
2281
|
+
}), this._observer.observe(this);
|
|
2282
|
+
} catch {
|
|
2283
|
+
if (this._observer) {
|
|
2284
|
+
try {
|
|
2285
|
+
this._observer.disconnect();
|
|
2286
|
+
} catch {}
|
|
2287
|
+
this._observer = null;
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
stopObserver() {
|
|
2292
|
+
this._observer && (this._observer.disconnect(), this._observer = null, this._visible = !0, this._connected && this._forceRender());
|
|
2293
|
+
}
|
|
2294
|
+
};
|
|
2295
|
+
i.forEach((e) => {
|
|
2296
|
+
e in a.prototype || Object.defineProperty(a.prototype, e, {
|
|
2297
|
+
get: function() {
|
|
2298
|
+
return this.getAttribute(e);
|
|
2299
|
+
},
|
|
2300
|
+
set: function(t) {
|
|
2301
|
+
t === null ? this.removeAttribute(e) : this.setAttribute(e, t);
|
|
2302
|
+
}
|
|
2303
|
+
});
|
|
2304
|
+
});
|
|
2305
|
+
let o = fn();
|
|
2306
|
+
for (let e in o) a[e] = a.prototype[e] = o[e];
|
|
2307
|
+
return t.define(e, a), a;
|
|
2308
|
+
}
|
|
2309
|
+
var { iconLoaded: En, getIcon: Dn, listIcons: On, addIcon: kn, addCollection: An, calculateSize: jn, buildIcon: Mn, iconToHTML: Nn, svgToURL: Pn, loadIcons: Fn, loadIcon: In, setCustomIconLoader: Ln, setCustomIconsLoader: Rn, addAPIProvider: zn, _api: Bn } = Tn() || fn(), $ = {
|
|
2310
|
+
hero: "dfk-hero",
|
|
2311
|
+
features: "dfk-features",
|
|
2312
|
+
nextSteps: "dfk-next-steps",
|
|
2313
|
+
sql: "dfk-sql"
|
|
2314
|
+
};
|
|
2315
|
+
function Vn() {
|
|
2316
|
+
if (typeof customElements < "u") for (let [e, t] of Object.entries({
|
|
2317
|
+
[$.hero]: h,
|
|
2318
|
+
[$.features]: p,
|
|
2319
|
+
[$.nextSteps]: ee,
|
|
2320
|
+
[$.sql]: Re
|
|
2321
|
+
})) customElements.get(e) || customElements.define(e, t);
|
|
2322
|
+
}
|
|
2323
|
+
//#endregion
|
|
2324
|
+
export { p as a, h as i, Re as n, ee as r, Vn as t };
|