ranui 0.2.0-alpha.4 → 0.2.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button-Be_uHDZG.js +117 -0
- package/dist/button.js +1 -1
- package/dist/{card-F-3fRynz.js → card-BVvXX6KM.js} +1 -1
- package/dist/card.js +1 -1
- package/dist/{checkbox-BS5kNY6n.js → checkbox-BtoX9X2Z.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{colorpicker-CdzUAVC5.js → colorpicker-Dukms7ET.js} +3 -3
- package/dist/colorpicker.js +1 -1
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/player.iife.js +2 -2
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/theme-switch.iife.js +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.iife.js +5 -5
- package/dist/index.js +10 -10
- package/dist/{input-BM6e_LQr.js → input-BMMM60e6.js} +32 -32
- package/dist/input.js +1 -1
- package/dist/{loading-Bd-gF1AH.js → loading-BScjyeVm.js} +1 -1
- package/dist/loading.js +1 -1
- package/dist/{player-C2pB5L2N.js → player-5olrw-qB.js} +1 -1
- package/dist/player.js +1 -1
- package/dist/{select-BSeCT9tF.js → select-aAaWoveE.js} +7 -7
- package/dist/select.js +1 -1
- package/dist/{tab-CqFrgo2v.js → tab-CiF2YPck.js} +1 -1
- package/dist/tab.js +1 -1
- package/dist/{theme-switch-B8K9y2RL.js → theme-switch-B_FZvqBN.js} +4 -4
- package/dist/theme-switch.js +1 -1
- package/docs/DESIGN.md +19 -9
- package/package.json +15 -8
- package/dist/button-CJFSrjq_.js +0 -117
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { _ as i, a as b, n as l, o as d, s as a, t as h } from "./utils-DBfrRFoE.js";
|
|
2
|
+
import { t as v } from "./events-C59wGdni.js";
|
|
3
|
+
import { _ as u, i as s, p as f } from "./factory-BdsO0dEW.js";
|
|
4
|
+
import { a as g, n as p } from "./ssr-DSGwPtEd.js";
|
|
5
|
+
var m = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{box-sizing:var(--ran-btn-box-sizing, border-box);position:var(--ran-btn-position, relative);display:var(--ran-btn-display, inline-flex);background-image:var(--ran-btn-background-image, none);box-shadow:var(--ran-btn-box-shadow, var(--ran-skin-raised-shadow, 0 2px #00000004));cursor:var(--ran-btn-cursor, pointer);-webkit-user-select:var(--ran-btn-user-select, none);user-select:var(--ran-btn-user-select, none);touch-action:var(--ran-btn-touch-action, manipulation);overflow:var(--ran-btn-overflow, hidden);pointer-events:var(--ran-btn-pointer-events, auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing, border-box);position:var(--ran-btn-contain-position, relative);display:var(--ran-btn-contain-display, block);background-image:var(--ran-btn-contain-background-image, none);cursor:var(--ran-btn-contain-cursor, pointer);transition:var(--ran-btn-contain-transition, opacity var(--ran-motion-duration-base, .2s) cubic-bezier(.645, .045, .355, 1));-webkit-user-select:var(--ran-btn-contain-user-select, none);user-select:var(--ran-btn-contain-user-select, none);touch-action:var(--ran-btn-contain-touch-action, manipulation);border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));background:var(--ran-btn-contain-background, var(--ran-color-bg-elevated, #fff))}:host,:host(:active),:host(:focus){outline:0;-webkit-tap-highlight-color:transparent}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline, 0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline, 2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset, 2px)}:host([type="primary"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-primary, #006bff));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-primary, #006bff));color:var(--ran-btn-content-color, #fff)}:host([type="primary"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="primary"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-primary-active, #005ff2));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-primary-active, #005ff2))}:host([type="contrast"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-contrast-bg, #171717));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-contrast-bg, #171717));color:var(--ran-btn-content-color, var(--ran-color-contrast-text, #fff))}:host([type="contrast"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, var(--ran-color-contrast-text, #fff) 10%, transparent 10.01%))}:host([type="contrast"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-contrast-bg-active, #4d4d4d));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-contrast-bg-active, #4d4d4d))}@media(min-width:1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-border-hover, #c9c9c9));color:var(--ran-btn-content-hover-color, var(--ran-color-text, #171717))}:host([type="primary"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-primary-hover, #0059ec));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-primary-hover, #0059ec));color:var(--ran-btn-content-hover-color, #fff)}:host([type="contrast"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-contrast-bg-hover, #383838));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-contrast-bg-hover, #383838));color:var(--ran-btn-content-hover-color, var(--ran-color-contrast-text, #fff))}:host([type="warning"]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));color:var(--ran-btn-content-warning-color, #fff)}}:host([type="warning"]) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));background-image:var(--ran-btn-content-background-image, none);color:var(--ran-btn-content-warning-color, #fff)}:host([type="warning"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="text"]) .ran-btn-content{border:var(--ran-btn-content-text-border, none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events, all);opacity:var(--ran-btn-disabled-opacity, .6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-disabled-container-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-container-pointer-events, all);opacity:var(--ran-btn-disabled-container-opacity, .6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform, translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity, .3);transition:var(--ran-btn-after-transition, 0s)}@media(min-width:1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,var(--ran-gray-alpha-400, #00000014) 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}}:host .slot{display:var(--ran-btn-slot-display, block)}.ran-btn-content{display:var(--ran-btn-content-display, flex);justify-content:var(--ran-btn-content-display, space-between);align-items:var(--ran-btn-content-align-items, center);padding:var(--ran-btn-content-padding, 4px 15px);border:var(--ran-btn-content-border, 1px solid transparent);border-image-source:var(--ran-btn-content-border-image-source, none);border-image-slice:var(--ran-btn-content-border-image-slice, 8);border-image-width:var(--ran-btn-content-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));border-color:var(--ran-btn-content-border-color, var(--ran-color-border, #eaeaea));color:var(--ran-btn-content-color, var(--ran-color-text, #000000d9));line-height:var(--ran-btn-content-line-height, 22px);font-size:var(--ran-btn-content-font-size, 14px);font-weight:var(--ran-btn-content-font-weight, 400);font-family:var(--ran-btn-content-font-family, var(--ran-skin-font-family, inherit));white-space:var(--ran-btn-content-white-space, nowrap);text-align:var(--ran-btn-content-text-align, center);box-sizing:var(--ran-btn-content-box-sizing, border-box)}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right, 2px)}', y = class extends p {
|
|
6
|
+
_btn;
|
|
7
|
+
_btnContent;
|
|
8
|
+
_iconElement;
|
|
9
|
+
_slot;
|
|
10
|
+
_shadowDom;
|
|
11
|
+
_events = new v();
|
|
12
|
+
debounceTimeId;
|
|
13
|
+
static get observedAttributes() {
|
|
14
|
+
return [
|
|
15
|
+
"disabled",
|
|
16
|
+
"icon",
|
|
17
|
+
"effect",
|
|
18
|
+
"iconSize",
|
|
19
|
+
"type",
|
|
20
|
+
"sheet"
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
constructor() {
|
|
24
|
+
super(), this._shadowDom = l(this, m);
|
|
25
|
+
const t = h(this._shadowDom, ".ran-btn", () => s().class("ran-btn").attr("part", "button").role("button").tabIndex(0).children(s().class("ran-btn-content").attr("part", "content").children(f().class("slot"))).build());
|
|
26
|
+
this._btn = t, this._btnContent = t.querySelector(".ran-btn-content"), this._slot = t.querySelector("slot");
|
|
27
|
+
}
|
|
28
|
+
get sheet() {
|
|
29
|
+
return this.getAttribute("sheet") || "";
|
|
30
|
+
}
|
|
31
|
+
set sheet(t) {
|
|
32
|
+
this.setAttribute("sheet", t || ""), this.handlerExternalCss();
|
|
33
|
+
}
|
|
34
|
+
get disabled() {
|
|
35
|
+
return a(this);
|
|
36
|
+
}
|
|
37
|
+
set disabled(t) {
|
|
38
|
+
!t || t === "false" ? (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")) : (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true"));
|
|
39
|
+
}
|
|
40
|
+
get iconSize() {
|
|
41
|
+
return this.getAttribute("iconSize") || "";
|
|
42
|
+
}
|
|
43
|
+
set iconSize(t) {
|
|
44
|
+
!t || t === "false" ? this.removeAttribute("iconSize") : (this.setAttribute("iconSize", t), this.setIcon());
|
|
45
|
+
}
|
|
46
|
+
get icon() {
|
|
47
|
+
return this.getAttribute("icon") || "";
|
|
48
|
+
}
|
|
49
|
+
set icon(t) {
|
|
50
|
+
!t || t === "false" ? this.removeAttribute("icon") : (this.setAttribute("icon", t), this.setIcon());
|
|
51
|
+
}
|
|
52
|
+
get effect() {
|
|
53
|
+
return this.getAttribute("effect") || "";
|
|
54
|
+
}
|
|
55
|
+
set effect(t) {
|
|
56
|
+
d.includes(t) || !t ? this.removeAttribute("effect") : this.setAttribute("effect", t);
|
|
57
|
+
}
|
|
58
|
+
get type() {
|
|
59
|
+
return this.getAttribute("type") || "";
|
|
60
|
+
}
|
|
61
|
+
set type(t) {
|
|
62
|
+
t ? this.setAttribute("type", t) : this.removeAttribute("type");
|
|
63
|
+
}
|
|
64
|
+
setIcon = () => {
|
|
65
|
+
if (typeof document > "u" || !this._slot) return;
|
|
66
|
+
const t = this.icon;
|
|
67
|
+
if (!t) {
|
|
68
|
+
this._iconElement && (this._iconElement.remove(), this._iconElement = void 0);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (this._iconElement) this._iconElement.setAttribute("name", t);
|
|
72
|
+
else {
|
|
73
|
+
let e = this._shadowDom.querySelector("r-icon");
|
|
74
|
+
e || (e = u("r-icon").attr("color", "currentColor").class("icon").build(), this._slot.insertAdjacentElement("beforebegin", e)), this._iconElement = e, this._iconElement.setAttribute("name", t);
|
|
75
|
+
}
|
|
76
|
+
const { width: n, height: r } = this._slot.getBoundingClientRect(), o = Math.min(n, r) || 16, c = this.iconSize || `${o > 5 ? o - 5 : o}`;
|
|
77
|
+
this._iconElement.setAttribute("size", String(c));
|
|
78
|
+
};
|
|
79
|
+
mousedown = (t) => {
|
|
80
|
+
if (i() === "pc" && !this.disabled) {
|
|
81
|
+
this.debounceMouseEvent();
|
|
82
|
+
const { left: n, top: r } = this.getBoundingClientRect();
|
|
83
|
+
this._btn.style.setProperty("--ran-x", `${t.clientX - n}px`), this._btn.style.setProperty("--ran-y", `${t.clientY - r}px`);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
mouseup = () => {
|
|
87
|
+
i() === "pc" && (this.debounceTimeId || (this.debounceTimeId = setTimeout(() => {
|
|
88
|
+
this._btn.style.removeProperty("--ran-x"), this._btn.style.removeProperty("--ran-y"), this.debounceMouseEvent();
|
|
89
|
+
}, 600)));
|
|
90
|
+
};
|
|
91
|
+
keydown = (t) => {
|
|
92
|
+
a(this) || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.click());
|
|
93
|
+
};
|
|
94
|
+
debounceMouseEvent = () => {
|
|
95
|
+
this.debounceTimeId && (clearTimeout(this.debounceTimeId), this.debounceTimeId = void 0);
|
|
96
|
+
};
|
|
97
|
+
handlerExternalCss = () => {
|
|
98
|
+
b(this, this._shadowDom, "sheet", null, this.sheet);
|
|
99
|
+
};
|
|
100
|
+
syncA11yState = () => {
|
|
101
|
+
const t = a(this);
|
|
102
|
+
this._btn.setAttribute("aria-disabled", t ? "true" : "false"), this._btn.tabIndex = t ? -1 : 0, t ? (this.setAttribute("aria-disabled", "true"), this._btnContent.setAttribute("disabled", "true")) : (this.removeAttribute("aria-disabled"), this._btnContent.removeAttribute("disabled"));
|
|
103
|
+
};
|
|
104
|
+
connectedCallback() {
|
|
105
|
+
this.handlerExternalCss(), this.setIcon(), this.syncA11yState(), this._events.on(this._btn, "mousedown", this.mousedown).on(this._btn, "mouseup", this.mouseup).on(this._btn, "keydown", this.keydown);
|
|
106
|
+
}
|
|
107
|
+
disconnectedCallback() {
|
|
108
|
+
this.debounceMouseEvent(), this._events.abort();
|
|
109
|
+
}
|
|
110
|
+
attributeChangedCallback(t, n, r) {
|
|
111
|
+
n !== r && (t === "disabled" && this._btnContent && this.syncA11yState(), (t === "icon" || t === "iconSize") && this.setIcon(), t === "sheet" && this.handlerExternalCss());
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
g("r-button", y);
|
|
115
|
+
export {
|
|
116
|
+
y as t
|
|
117
|
+
};
|
package/dist/button.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as n, i as a, n as d, r as i, t as c } from "./utils-DBfrRFoE.js";
|
|
2
2
|
import { i as t, p as o } from "./factory-BdsO0dEW.js";
|
|
3
3
|
import { a as l, n as h } from "./ssr-DSGwPtEd.js";
|
|
4
|
-
var p = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{display:var(--ran-card-display, block);box-sizing:border-box;min-height:var(--ran-card-min-height, 0)}:host([hoverable]
|
|
4
|
+
var p = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{display:var(--ran-card-display, block);box-sizing:border-box;min-height:var(--ran-card-min-height, 0)}:host([hoverable]:hover) .ran-card{border-color:var(--ran-card-hover-border-color, var(--ran-color-border-hover, #c9c9c9));box-shadow:var(--ran-card-hover-shadow, var(--ran-shadow-elevated, 0 1px 2px rgba(0, 0, 0, .04)))}.ran-card{display:grid;align-content:start;gap:var(--ran-card-gap, 14px);height:100%;min-width:0;padding:var(--ran-card-padding, 16px);border-width:var(--ran-skin-border-width, 1px);border-style:var(--ran-skin-border-style, solid);border-color:var(--ran-card-border-color, var(--ran-color-border, #eaeaea));border-radius:var(--ran-card-radius, var(--ran-radius-md));background:var(--ran-card-background, var(--ran-color-bg));box-shadow:var(--ran-card-shadow, none);box-sizing:border-box}.ran-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.ran-card-title-area{flex:1;min-width:0}.ran-card-title{margin:0;color:var(--ran-card-title-color, var(--ran-color-text));font-size:var(--ran-card-title-font-size, 16px);font-weight:var(--ran-card-title-font-weight, 600);line-height:1.3}.ran-card-title:empty{display:none}.ran-card-description{margin:4px 0 0;color:var(--ran-card-description-color, var(--ran-color-text-secondary));font-size:var(--ran-card-description-font-size, 14px);line-height:1.5}.ran-card-description:empty{display:none}.ran-card-body,.ran-card-footer{min-width:0}:host(:not([title]):not([description])) .ran-card-header{display:none}", b = class extends h {
|
|
5
5
|
_shadowDom;
|
|
6
6
|
_titleEl;
|
|
7
7
|
_descriptionEl;
|
package/dist/card.js
CHANGED
|
@@ -2,7 +2,7 @@ import { a as o, c as i, f as s, i as h, n as b, o as t, r as d, s as l, t as k
|
|
|
2
2
|
import { t as x } from "./events-C59wGdni.js";
|
|
3
3
|
import { i as a, m as c, p as u, s as p } from "./factory-BdsO0dEW.js";
|
|
4
4
|
import { a as v, n as f } from "./ssr-DSGwPtEd.js";
|
|
5
|
-
var g = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{position:var(--ran-checkbox-host-position, relative);display:var(--ran-checkbox-host-display, inline-flex);margin:var(--ran-checkbox-host-margin, 0);padding:var(--ran-checkbox-host-padding, 0);box-sizing:var(--ran-checkbox-host-box-sizing, border-box);list-style:var(--ran-checkbox-host-list-style, none)}:host([disabled]){opacity:var(--ran-checkbox-disabled-opacity, .6)}:host([disabled]) .ran-checkbox-input{cursor:var(--ran-checkbox-disabled-cursor, not-allowed);pointer-events:var(--ran-checkbox-disabled-pointer-events, all)}:host([disabled]) .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, var(--ran-color-bg-muted, #f2f2f2));border:1px solid var(--ran-color-border, #eaeaea)}:host([disabled]) .ran-checkbox-inner:after{cursor:not-allowed;pointer-events:none;opacity:var(--ran-checkbox-checked-after-opacity, 1)}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, var(--ran-color-bg-muted, #f2f2f2))}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-checked-after-opacity, 0)}.ran-checkbox-wrapper{display:inline-flex;align-items:center;gap:var(--ran-checkbox-label-gap, 8px);cursor:pointer;line-height:1}.ran-checkbox-label{color:var(--ran-checkbox-label-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-checkbox-label-font-size, 14px);font-family:var(--ran-checkbox-label-font-family, var(--ran-skin-font-family, inherit));line-height:var(--ran-checkbox-label-line-height, 1.5);-webkit-user-select:none;user-select:none}.ran-checkbox{position:var(--ran-checkbox-position, relative);display:var(--ran-checkbox-display, block);box-sizing:var(--ran-checkbox-box-sizing, border-box);margin:var(--ran-checkbox-margin, 0);width:var(--ran-checkbox-width, 16px);height:var(--ran-checkbox-height, 16px);padding:var(--ran-checkbox-padding, 0);color:var(--ran-checkbox-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-checkbox-font-size, 14px);line-height:var(--ran-checkbox-line-height, 1);list-style:var(--ran-checkbox-list-style, none);font-family:var(--ran-checkbox-font-family, var(--ran-skin-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));white-space:var(--ran-checkbox-white-space, nowrap);cursor:var(--ran-checkbox-cursor, pointer);border-radius:var(--ran-checkbox-border-radius, 4px)}.ran-checkbox-input{position:var(--ran-checkbox-input-position, absolute);inset:var(--ran-checkbox-input-inset, 0);z-index:var(--ran-checkbox-input-z-index, 1);cursor:var(--ran-checkbox-input-cursor, pointer);opacity:var(--ran-checkbox-input-opacity, 0);margin:var(--ran-checkbox-input-margin, 0)}.ran-checkbox-inner{box-sizing:var(--ran-checkbox-inner-box-sizing, border-box);display:var(--ran-checkbox-inner-display, block);width:var(--ran-checkbox-inner-width, 16px);height:var(--ran-checkbox-inner-height, 16px);direction:var(--ran-checkbox-inner-direction, ltr);background-color:var(--ran-checkbox-inner-background-color, var(--ran-color-bg-elevated, #fff));border:var(--ran-checkbox-inner-border, 1px solid var(--ran-color-border, #eaeaea));border-image-source:var(--ran-checkbox-inner-border-image-source, none);border-image-slice:var(--ran-checkbox-inner-border-image-slice, 8);border-image-width:var(--ran-checkbox-inner-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-checkbox-inner-border-radius, 4px);border-collapse:var(--ran-checkbox-inner-border-collapse, separate)}.ran-checkbox-inner:after{box-sizing:var(--ran-checkbox-inner-after-box-sizing, border-box);position:var(--ran-checkbox-inner-after-position, absolute);top:var(--ran-checkbox-inner-after-top, 50%);inset-inline-start:var(--ran-checkbox-inner-after-inset-inline-start, 25%);display:var(--ran-checkbox-inner-after-display, table);width:var(--ran-checkbox-inner-after-width, calc(16px / 14 * 5));height:var(--ran-checkbox-inner-after-height, calc(16px / 14 * 8));border:var(--ran-checkbox-inner-after-border, 2px solid #fff);border-top:var(--ran-checkbox-inner-after-border-top, 0);border-inline-start:var(--ran-checkbox-inner-after-border-inline-start, 0);opacity:var(--ran-checkbox-inner-after-opacity, 0);content:var(--ran-checkbox-inner-after-content, "");transition:var(--ran-checkbox-inner-after-transition,
|
|
5
|
+
var g = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{position:var(--ran-checkbox-host-position, relative);display:var(--ran-checkbox-host-display, inline-flex);margin:var(--ran-checkbox-host-margin, 0);padding:var(--ran-checkbox-host-padding, 0);box-sizing:var(--ran-checkbox-host-box-sizing, border-box);list-style:var(--ran-checkbox-host-list-style, none)}:host([disabled]){opacity:var(--ran-checkbox-disabled-opacity, .6)}:host([disabled]) .ran-checkbox-input{cursor:var(--ran-checkbox-disabled-cursor, not-allowed);pointer-events:var(--ran-checkbox-disabled-pointer-events, all)}:host([disabled]) .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, var(--ran-color-bg-muted, #f2f2f2));border:1px solid var(--ran-color-border, #eaeaea)}:host([disabled]) .ran-checkbox-inner:after{cursor:not-allowed;pointer-events:none;opacity:var(--ran-checkbox-checked-after-opacity, 1)}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, var(--ran-color-bg-muted, #f2f2f2))}:host([disabled]) .ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-checked-after-opacity, 0)}.ran-checkbox-wrapper{display:inline-flex;align-items:center;gap:var(--ran-checkbox-label-gap, 8px);cursor:pointer;line-height:1}.ran-checkbox-label{color:var(--ran-checkbox-label-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-checkbox-label-font-size, 14px);font-family:var(--ran-checkbox-label-font-family, var(--ran-skin-font-family, inherit));line-height:var(--ran-checkbox-label-line-height, 1.5);-webkit-user-select:none;user-select:none}.ran-checkbox{position:var(--ran-checkbox-position, relative);display:var(--ran-checkbox-display, block);box-sizing:var(--ran-checkbox-box-sizing, border-box);margin:var(--ran-checkbox-margin, 0);width:var(--ran-checkbox-width, 16px);height:var(--ran-checkbox-height, 16px);padding:var(--ran-checkbox-padding, 0);color:var(--ran-checkbox-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-checkbox-font-size, 14px);line-height:var(--ran-checkbox-line-height, 1);list-style:var(--ran-checkbox-list-style, none);font-family:var(--ran-checkbox-font-family, var(--ran-skin-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));white-space:var(--ran-checkbox-white-space, nowrap);cursor:var(--ran-checkbox-cursor, pointer);border-radius:var(--ran-checkbox-border-radius, 4px)}.ran-checkbox-input{position:var(--ran-checkbox-input-position, absolute);inset:var(--ran-checkbox-input-inset, 0);z-index:var(--ran-checkbox-input-z-index, 1);cursor:var(--ran-checkbox-input-cursor, pointer);opacity:var(--ran-checkbox-input-opacity, 0);margin:var(--ran-checkbox-input-margin, 0)}.ran-checkbox-inner{box-sizing:var(--ran-checkbox-inner-box-sizing, border-box);display:var(--ran-checkbox-inner-display, block);width:var(--ran-checkbox-inner-width, 16px);height:var(--ran-checkbox-inner-height, 16px);direction:var(--ran-checkbox-inner-direction, ltr);background-color:var(--ran-checkbox-inner-background-color, var(--ran-color-bg-elevated, #fff));border:var(--ran-checkbox-inner-border, 1px solid var(--ran-color-border, #eaeaea));border-image-source:var(--ran-checkbox-inner-border-image-source, none);border-image-slice:var(--ran-checkbox-inner-border-image-slice, 8);border-image-width:var(--ran-checkbox-inner-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-checkbox-inner-border-radius, 4px);border-collapse:var(--ran-checkbox-inner-border-collapse, separate)}.ran-checkbox-inner:after{box-sizing:var(--ran-checkbox-inner-after-box-sizing, border-box);position:var(--ran-checkbox-inner-after-position, absolute);top:var(--ran-checkbox-inner-after-top, 50%);inset-inline-start:var(--ran-checkbox-inner-after-inset-inline-start, 25%);display:var(--ran-checkbox-inner-after-display, table);width:var(--ran-checkbox-inner-after-width, calc(16px / 14 * 5));height:var(--ran-checkbox-inner-after-height, calc(16px / 14 * 8));border:var(--ran-checkbox-inner-after-border, 2px solid #fff);border-top:var(--ran-checkbox-inner-after-border-top, 0);border-inline-start:var(--ran-checkbox-inner-after-border-inline-start, 0);opacity:var(--ran-checkbox-inner-after-opacity, 0);content:var(--ran-checkbox-inner-after-content, "");transition:var(--ran-checkbox-inner-after-transition, transform .1s cubic-bezier(.71, -.46, .88, .6), opacity .1s);transform:var(--ran-checkbox-inner-after-transform, rotate(45deg) scale(1) translate(-50%, -50%))}.ran-checkbox-checked .ran-checkbox-inner{background-color:var(--ran-checkbox-checked-background-color, var(--ran-color-primary, #006bff));background-image:var(--ran-checkbox-checked-background-image, none);border:var(--ran-checkbox-checked-border, 1px solid var(--ran-color-primary, #006bff))}.ran-checkbox-checked .ran-checkbox-inner:after{opacity:var(--ran-checkbox-checked-after-opacity, 1)}.ran-checkbox:focus-within .ran-checkbox-inner{box-shadow:var(--ran-checkbox-focus-box-shadow, 0 0 0 2px var(--ran-blue-400, #cae7ff));border-color:var(--ran-checkbox-focus-border-color, var(--ran-color-primary, #006bff))}', m = class extends f {
|
|
6
6
|
static formAssociated = !0;
|
|
7
7
|
_events = new x();
|
|
8
8
|
_internals;
|
package/dist/checkbox.js
CHANGED
|
@@ -3,8 +3,8 @@ import { t as w } from "./events-C59wGdni.js";
|
|
|
3
3
|
import { i as S, r as p } from "./signal-CSSZxlK5.js";
|
|
4
4
|
import { _ as u, h as A, i as n } from "./factory-BdsO0dEW.js";
|
|
5
5
|
import { a as $, n as _ } from "./ssr-DSGwPtEd.js";
|
|
6
|
-
import "./input-
|
|
7
|
-
import "./select-
|
|
6
|
+
import "./input-BMMM60e6.js";
|
|
7
|
+
import "./select-aAaWoveE.js";
|
|
8
8
|
import "./popover-DRUQjdPs.js";
|
|
9
9
|
var D = (e) => {
|
|
10
10
|
const { r: t, g: i, b: r } = I(e);
|
|
@@ -71,7 +71,7 @@ var D = (e) => {
|
|
|
71
71
|
k(e),
|
|
72
72
|
k(t),
|
|
73
73
|
k(i)
|
|
74
|
-
].join(""), C = /^#([\da-f]{6}|[\da-f]{3})$/i, E = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/, R = /^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d{1,3}(\.\d+)?)\)$/, V = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-colorpicker{box-sizing:border-box;min-width:32px;height:32px;border-radius:var(--ran-colorpicker-border-radius, var(--ran-radius-md, 8px));border:var(--ran-colorpicker-border, 1px solid var(--ran-color-border, #eaeaea));cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:var(--ran-colorpicker-transition,
|
|
74
|
+
].join(""), C = /^#([\da-f]{6}|[\da-f]{3})$/i, E = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/, R = /^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d{1,3}(\.\d+)?)\)$/, V = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-colorpicker{box-sizing:border-box;min-width:32px;height:32px;border-radius:var(--ran-colorpicker-border-radius, var(--ran-radius-md, 8px));border:var(--ran-colorpicker-border, 1px solid var(--ran-color-border, #eaeaea));cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:var(--ran-colorpicker-transition, none);background:var(--ran-colorpicker-background, var(--ran-color-bg-elevated, #ffffff));padding:3px}.ran-colorpicker:hover{border-color:var(--ran-colorpicker-border-hover, var(--ran-color-border-hover, var(--ran-gray-500)))}.ran-colorpicker-block{position:relative;border-radius:var(--ran-colorpicker-block-border-radius, var(--ran-radius-sm, 4px));width:24px;height:24px;box-shadow:inset 0 0 0 1px var(--ran-gray-alpha-200, rgba(0, 0, 0, .09));background-image:conic-gradient(var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 25%,transparent 0 50%,var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 75%,transparent 0);background-size:50% 50%}.ran-colorpicker-inner{width:100%;height:100%;border-radius:inherit}.ran-colorpicker-block[disabled]{cursor:var(--ran-colorpicker-disabled-cursor, not-allowed);opacity:var(--ran-colorpicker-disabled-opacity, .5)}", H = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-color-picker-inner{box-sizing:border-box}.ran-color-picker-inner-content{box-sizing:border-box;display:flex;flex-direction:column;gap:12px;width:224px;padding:12px;font-family:var(--ran-font-family, inherit)}.ran-color-picker-inner-content *,.ran-color-picker-inner-content *:before,.ran-color-picker-inner-content *:after{box-sizing:border-box}.ran-color-picker-palette{position:relative;width:100%;height:160px;border-radius:var(--ran-radius-sm, 6px);overflow:hidden;cursor:crosshair;box-shadow:inset 0 0 0 1px var(--ran-gray-alpha-200, rgba(0, 0, 0, .09));touch-action:none}.ran-color-picker-saturation{position:absolute;inset:0;border-radius:inherit;background-image:linear-gradient(to top,#000,#0000),linear-gradient(to right,#fff,#fff0)}.ran-color-picker-palette-dot{position:absolute;top:0;left:0;z-index:2;width:14px;height:14px;transform:translate(-50%,-50%);border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #0003,0 1px 3px #00000059;pointer-events:none}.ran-color-picker-controls{display:flex;align-items:center;gap:12px}.ran-color-picker-preview{position:relative;flex:none;width:28px;height:28px;border-radius:50%;overflow:hidden;box-shadow:inset 0 0 0 1px var(--ran-gray-alpha-200, rgba(0, 0, 0, .09));background-image:conic-gradient(var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 25%,transparent 0 50%,var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 75%,transparent 0);background-size:12px 12px}.ran-color-picker-preview-inner{position:absolute;inset:0;border-radius:inherit}.ran-color-picker-sliders{flex:1;min-width:0;display:flex;flex-direction:column;gap:12px}.ran-color-picker-slider{position:relative;height:10px;border-radius:999px;cursor:pointer;box-shadow:inset 0 0 0 1px var(--ran-gray-alpha-200, rgba(0, 0, 0, .09));touch-action:none}.ran-color-picker-slider-hue{background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red)}.ran-color-picker-slider-alpha{background-image:conic-gradient(var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 25%,transparent 0 50%,var(--ran-gray-alpha-100, rgba(0, 0, 0, .06)) 0 75%,transparent 0);background-size:8px 8px}.ran-color-picker-slider-alpha-track{position:absolute;inset:0;border-radius:inherit}.ran-color-picker-slider-thumb{position:absolute;top:50%;left:0;z-index:1;width:14px;height:14px;transform:translate(-50%,-50%);border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #0003,0 1px 3px #00000059;pointer-events:none}.ran-color-picker-input-container{display:flex;align-items:center;gap:8px}.ran-color-picker-format{flex:none;width:68px}.ran-color-picker-value{flex:1;min-width:0}", d = 360, F = class extends _ {
|
|
75
75
|
colorpicker;
|
|
76
76
|
colorpickerInner;
|
|
77
77
|
context;
|
package/dist/colorpicker.js
CHANGED
package/dist/iife/button.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ranui_button=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=e=>typeof e==`function`,i=()=>{if(typeof window<`u`){let e=navigator.userAgent.toLowerCase();return/ipad|ipod/.test(e)?`ipad`:/android/.test(e)?`android`:/iphone/.test(e)?`iphone`:`pc`}return`pc`},a=12e4,o=`__ranuts_bridge__`,s=`default`,c=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},l=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=s){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,c.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:o,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:i,id:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof i==`string`?i:`Bridge request failed`)):e.resolve(i),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(r(l)){let t=e.source??this.targetWindow;Promise.resolve(l(i)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let r=n(10);return new Promise((n,i)=>{let o=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),i(Error(`Request timeout`)))},a),s=e=>{clearTimeout(o),i(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(o),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{c.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:r,channel:i})=>{let a=new l(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new t;var u=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new d(u[0],3609767458),new d(u[1],602891725),new d(u[2],3964484399),new d(u[3],2173295548),new d(u[4],4081628472),new d(u[5],3053834265),new d(u[6],2937671579),new d(u[7],3664609560),new d(u[8],2734883394),new d(u[9],1164996542),new d(u[10],1323610764),new d(u[11],3590304994),new d(u[12],4068182383),new d(u[13],991336113),new d(u[14],633803317),new d(u[15],3479774868),new d(u[16],2666613458),new d(u[17],944711139),new d(u[18],2341262773),new d(u[19],2007800933),new d(u[20],1495990901),new d(u[21],1856431235),new d(u[22],3175218132),new d(u[23],2198950837),new d(u[24],3999719339),new d(u[25],766784016),new d(u[26],2566594879),new d(u[27],3203337956),new d(u[28],1034457026),new d(u[29],2466948901),new d(u[30],3758326383),new d(u[31],168717936),new d(u[32],1188179964),new d(u[33],1546045734),new d(u[34],1522805485),new d(u[35],2643833823),new d(u[36],2343527390),new d(u[37],1014477480),new d(u[38],1206759142),new d(u[39],344077627),new d(u[40],1290863460),new d(u[41],3158454273),new d(u[42],3505952657),new d(u[43],106217008),new d(u[44],3606008344),new d(u[45],1432725776),new d(u[46],1467031594),new d(u[47],851169720),new d(u[48],3100823752),new d(u[49],1363258195),new d(u[50],3750685593),new d(u[51],3785050280),new d(u[52],3318307427),new d(u[53],3812723403),new d(u[54],2003034995),new d(u[55],3602036899),new d(u[56],1575990012),new d(u[57],1125592928),new d(u[58],2716904306),new d(u[59],442776044),new d(u[60],593698344),new d(u[61],3733110249),new d(u[62],2999351573),new d(u[63],3815920427),new d(3391569614,3928383900),new d(3515267271,566280711),new d(3940187606,3454069534),new d(4118630271,4000239992),new d(116418474,1914138554),new d(174292421,2731055270),new d(289380356,3203993006),new d(460393269,320620315),new d(685471733,587496836),new d(852142971,1086792851),new d(1017036298,365543100),new d(1126000580,2618297676),new d(1288033470,3409855158),new d(1501505948,4234509866),new d(1607167915,987167468),new d(1816402316,1246189591),new d(0,1),new d(0,32898),new d(2147483648,32906),new d(2147483648,2147516416),new d(0,32907),new d(0,2147483649),new d(2147483648,2147516545),new d(2147483648,32777),new d(0,138),new d(0,136),new d(0,2147516425),new d(0,2147483658),new d(0,2147516555),new d(2147483648,139),new d(2147483648,32905),new d(2147483648,32771),new d(2147483648,32770),new d(2147483648,128),new d(0,32778),new d(2147483648,2147483658),new d(2147483648,2147516545),new d(2147483648,32896),new d(0,2147483649),new d(2147483648,2147516424);var f=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(f),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(f);var p=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{box-sizing:var(--ran-btn-box-sizing,border-box);position:var(--ran-btn-position,relative);display:var(--ran-btn-display,inline-flex);background-image:var(--ran-btn-background-image,none);box-shadow:var(--ran-btn-box-shadow,var(--ran-skin-raised-shadow,0 2px #00000004));cursor:var(--ran-btn-cursor,pointer);user-select:var(--ran-btn-user-select,none);touch-action:var(--ran-btn-touch-action,manipulation);overflow:var(--ran-btn-overflow,hidden);pointer-events:var(--ran-btn-pointer-events,auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing,border-box);position:var(--ran-btn-contain-position,relative);display:var(--ran-btn-contain-display,block);background-image:var(--ran-btn-contain-background-image,none);cursor:var(--ran-btn-contain-cursor,pointer);transition:var(--ran-btn-contain-transition,color var(--ran-motion-duration-base,.2s) cubic-bezier(.645, .045, .355, 1), border-color var(--ran-motion-duration-base,.2s) cubic-bezier(.645, .045, .355, 1), box-shadow var(--ran-motion-duration-base,.2s) cubic-bezier(.645, .045, .355, 1), opacity var(--ran-motion-duration-base,.2s) cubic-bezier(.645, .045, .355, 1));user-select:var(--ran-btn-contain-user-select,none);touch-action:var(--ran-btn-contain-touch-action,manipulation);border-radius:var(--ran-btn-content-border-radius,var(--ran-radius-sm,6px));background:var(--ran-btn-contain-background,var(--ran-color-bg-elevated,#fff))}:host,:host(:active),:host(:focus){-webkit-tap-highlight-color:transparent;outline:0}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline,0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline,2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset,2px)}:host([type=primary]) .ran-btn-content{background-color:var(--ran-btn-content-background-color,var(--ran-color-primary,#006bff));background-image:var(--ran-btn-content-background-image,none);border-color:var(--ran-btn-content-border-color,var(--ran-color-primary,#006bff));color:var(--ran-btn-content-color,#fff)}:host([type=primary]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type=primary]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color,var(--ran-color-primary-active,#005ff2));border-color:var(--ran-btn-content-active-border-color,var(--ran-color-primary-active,#005ff2))}:host([type=contrast]) .ran-btn-content{background-color:var(--ran-btn-content-background-color,var(--ran-color-contrast-bg,#171717));background-image:var(--ran-btn-content-background-image,none);border-color:var(--ran-btn-content-border-color,var(--ran-color-contrast-bg,#171717));color:var(--ran-btn-content-color,var(--ran-color-contrast-text,#fff))}:host([type=contrast]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, var(--ran-color-contrast-text,#fff) 10%, transparent 10.01%))}:host([type=contrast]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color,var(--ran-color-contrast-bg-active,#4d4d4d));border-color:var(--ran-btn-content-active-border-color,var(--ran-color-contrast-bg-active,#4d4d4d))}@media (width>=1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color,var(--ran-color-border-hover,#c9c9c9));color:var(--ran-btn-content-hover-color,var(--ran-color-text,#171717))}:host([type=primary]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color,var(--ran-color-primary-hover,#0059ec));border-color:var(--ran-btn-content-hover-border-color,var(--ran-color-primary-hover,#0059ec));color:var(--ran-btn-content-hover-color,#fff)}:host([type=contrast]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color,var(--ran-color-contrast-bg-hover,#383838));border-color:var(--ran-btn-content-hover-border-color,var(--ran-color-contrast-bg-hover,#383838));color:var(--ran-btn-content-hover-color,var(--ran-color-contrast-text,#fff))}:host([type=warning]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color,var(--ran-color-danger,#ff4d4f));background-color:var(--ran-btn-content-warning-background-color,var(--ran-color-danger,#ff4d4f));color:var(--ran-btn-content-warning-color,#fff)}}:host([type=warning]) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color,var(--ran-color-danger,#ff4d4f));background-color:var(--ran-btn-content-warning-background-color,var(--ran-color-danger,#ff4d4f));background-image:var(--ran-btn-content-background-image,none);color:var(--ran-btn-content-warning-color,#fff)}:host([type=warning]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type=text]) .ran-btn-content{border:var(--ran-btn-content-text-border,none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor,not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events,all);opacity:var(--ran-btn-disabled-opacity,.6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-disabled-container-cursor,not-allowed);pointer-events:var(--ran-btn-disabled-container-pointer-events,all);opacity:var(--ran-btn-disabled-container-opacity,.6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform,translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity,.3);transition:var(--ran-btn-after-transition,0s)}@media (width>=1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";width:100%;height:100%;left:var(--ran-x,0);top:var(--ran-y,0);pointer-events:none;background-image:radial-gradient(circle, var(--ran-gray-alpha-400,#00000014) 10%, transparent 10.01%);opacity:0;background-position:50%;background-repeat:no-repeat;transition:transform .3s,opacity .8s;display:block;position:absolute;transform:translate(-50%,-50%)scale(10)}}:host .slot{display:var(--ran-btn-slot-display,block)}.ran-btn-content{display:var(--ran-btn-content-display,flex);justify-content:var(--ran-btn-content-display,space-between);align-items:var(--ran-btn-content-align-items,center);padding:var(--ran-btn-content-padding,4px 15px);border:var(--ran-btn-content-border,1px solid transparent);border-image-source:var(--ran-btn-content-border-image-source,none);border-image-slice:var(--ran-btn-content-border-image-slice,8);border-image-width:var(--ran-btn-content-border-image-width,4px);border-radius:var(--ran-btn-content-border-radius,var(--ran-radius-sm,6px));border-color:var(--ran-btn-content-border-color,var(--ran-color-border,#eaeaea));color:var(--ran-btn-content-color,var(--ran-color-text,#000000d9));line-height:var(--ran-btn-content-line-height,22px);font-size:var(--ran-btn-content-font-size,14px);font-weight:var(--ran-btn-content-font-weight,400);font-family:var(--ran-btn-content-font-family,var(--ran-skin-font-family,inherit));white-space:var(--ran-btn-content-white-space,nowrap);text-align:var(--ran-btn-content-text-align,center);box-sizing:var(--ran-btn-content-box-sizing,border-box);border-image-outset:0;border-image-repeat:stretch}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right,2px)}`,m=typeof document>`u`,h=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}};function g(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function _(e){return g(e)}var v=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,y=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},b=(e,t,n)=>{for(let r of e)v(r)&&(y(r,t)&&n.push(r),b(r.childrenList,t,n))},x=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?g(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return b(this.childrenList,e,t),t}},S=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new x)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new C(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return b(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${_(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${_(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?g(e):(e instanceof x,e.serialize())).join(``):a+=g(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},C=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return b(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${g(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?g(e):(e instanceof x,e.serialize())).join(``)}</template>`}},w=class e{el;constructor(e){this.el=m?new S(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return m?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let n=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(n(t)):e.concat(t),[]);return n(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?m?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(m){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new T(this.el,t,e)}build(){return this.el}serialize(){if(m)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},T=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof w?this.root.appendChild(e.build()):typeof e==`string`?m?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(m)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return m?this.root.serialize():this.root.innerHTML}},E=e=>new w(e),D=()=>E(`div`),O=()=>E(`slot`),k=[!1,`false`,null,void 0],A=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!!(t&&!k.includes(n))},j=new Map;function M(e,t){m?(j.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var N=typeof document<`u`?HTMLElement:S,P=new Map,F=new Map,I=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!P.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),P.set(t,e)}let n=P.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},L=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!F.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),F.set(t,e)}let n=F.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},R=new WeakMap,z=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,B=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||R.get(e)||e.attachShadow(n);return R.set(e,r),I(r,t?`${t}\n${z}`:z),r},V=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},H=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&L(t,a)},U=class extends N{_btn;_btnContent;_iconElement;_slot;_shadowDom;_events=new h;debounceTimeId;static get observedAttributes(){return[`disabled`,`icon`,`effect`,`iconSize`,`type`,`sheet`]}constructor(){super(),this._shadowDom=B(this,p);let e=V(this._shadowDom,`.ran-btn`,()=>D().class(`ran-btn`).attr(`part`,`button`).role(`button`).tabIndex(0).children(D().class(`ran-btn-content`).attr(`part`,`content`).children(O().class(`slot`))).build());this._btn=e,this._btnContent=e.querySelector(`.ran-btn-content`),this._slot=e.querySelector(`slot`)}get sheet(){return this.getAttribute(`sheet`)||``}set sheet(e){this.setAttribute(`sheet`,e||``),this.handlerExternalCss()}get disabled(){return A(this)}set disabled(e){!e||e===`false`?(this.removeAttribute(`disabled`),this.removeAttribute(`aria-disabled`)):(this.setAttribute(`disabled`,``),this.setAttribute(`aria-disabled`,`true`))}get iconSize(){return this.getAttribute(`iconSize`)||``}set iconSize(e){!e||e===`false`?this.removeAttribute(`iconSize`):(this.setAttribute(`iconSize`,e),this.setIcon())}get icon(){return this.getAttribute(`icon`)||``}set icon(e){!e||e===`false`?this.removeAttribute(`icon`):(this.setAttribute(`icon`,e),this.setIcon())}get effect(){return this.getAttribute(`effect`)||``}set effect(e){k.includes(e)||!e?this.removeAttribute(`effect`):this.setAttribute(`effect`,e)}get type(){return this.getAttribute(`type`)||``}set type(e){e?this.setAttribute(`type`,e):this.removeAttribute(`type`)}setIcon=()=>{if(typeof document>`u`||!this._slot)return;let e=this.icon;if(!e){this._iconElement&&=(this._iconElement.remove(),void 0);return}if(this._iconElement)this._iconElement.setAttribute(`name`,e);else{let t=this._shadowDom.querySelector(`r-icon`);t||(t=E(`r-icon`).attr(`color`,`currentColor`).class(`icon`).build(),this._slot.insertAdjacentElement(`beforebegin`,t)),this._iconElement=t,this._iconElement.setAttribute(`name`,e)}let{width:t,height:n}=this._slot.getBoundingClientRect(),r=Math.min(t,n)||16,i=this.iconSize||`${r>5?r-5:r}`;this._iconElement.setAttribute(`size`,String(i))};mousedown=e=>{if(i()===`pc`&&!this.disabled){this.debounceMouseEvent();let{left:t,top:n}=this.getBoundingClientRect();this._btn.style.setProperty(`--ran-x`,`${e.clientX-t}px`),this._btn.style.setProperty(`--ran-y`,`${e.clientY-n}px`)}};mouseup=()=>{i()===`pc`&&(this.debounceTimeId||=setTimeout(()=>{this._btn.style.removeProperty(`--ran-x`),this._btn.style.removeProperty(`--ran-y`),this.debounceMouseEvent()},600))};keydown=e=>{A(this)||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.click())};debounceMouseEvent=()=>{this.debounceTimeId&&=(clearTimeout(this.debounceTimeId),void 0)};handlerExternalCss=()=>{H(this,this._shadowDom,`sheet`,null,this.sheet)};syncA11yState=()=>{let e=A(this);this._btn.setAttribute(`aria-disabled`,e?`true`:`false`),this._btn.tabIndex=e?-1:0,e?(this.setAttribute(`aria-disabled`,`true`),this._btnContent.setAttribute(`disabled`,`true`)):(this.removeAttribute(`aria-disabled`),this._btnContent.removeAttribute(`disabled`))};connectedCallback(){this.handlerExternalCss(),this.setIcon(),this.syncA11yState(),this._events.on(this._btn,`mousedown`,this.mousedown).on(this._btn,`mouseup`,this.mouseup).on(this._btn,`keydown`,this.keydown)}disconnectedCallback(){this.debounceMouseEvent(),this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&this._btnContent&&this.syncA11yState(),(e===`icon`||e===`iconSize`)&&this.setIcon(),e===`sheet`&&this.handlerExternalCss())}};return M(`r-button`,U),e.Button=U,e.default=U,e})({});
|
|
1
|
+
var ranui_button=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=e=>typeof e==`function`,i=()=>{if(typeof window<`u`){let e=navigator.userAgent.toLowerCase();return/ipad|ipod/.test(e)?`ipad`:/android/.test(e)?`android`:/iphone/.test(e)?`iphone`:`pc`}return`pc`},a=12e4,o=`__ranuts_bridge__`,s=`default`,c=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},l=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=s){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,c.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:o,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:i,id:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof i==`string`?i:`Bridge request failed`)):e.resolve(i),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(r(l)){let t=e.source??this.targetWindow;Promise.resolve(l(i)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let r=n(10);return new Promise((n,i)=>{let o=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),i(Error(`Request timeout`)))},a),s=e=>{clearTimeout(o),i(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(o),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{c.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:r,channel:i})=>{let a=new l(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new t;var u=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new d(u[0],3609767458),new d(u[1],602891725),new d(u[2],3964484399),new d(u[3],2173295548),new d(u[4],4081628472),new d(u[5],3053834265),new d(u[6],2937671579),new d(u[7],3664609560),new d(u[8],2734883394),new d(u[9],1164996542),new d(u[10],1323610764),new d(u[11],3590304994),new d(u[12],4068182383),new d(u[13],991336113),new d(u[14],633803317),new d(u[15],3479774868),new d(u[16],2666613458),new d(u[17],944711139),new d(u[18],2341262773),new d(u[19],2007800933),new d(u[20],1495990901),new d(u[21],1856431235),new d(u[22],3175218132),new d(u[23],2198950837),new d(u[24],3999719339),new d(u[25],766784016),new d(u[26],2566594879),new d(u[27],3203337956),new d(u[28],1034457026),new d(u[29],2466948901),new d(u[30],3758326383),new d(u[31],168717936),new d(u[32],1188179964),new d(u[33],1546045734),new d(u[34],1522805485),new d(u[35],2643833823),new d(u[36],2343527390),new d(u[37],1014477480),new d(u[38],1206759142),new d(u[39],344077627),new d(u[40],1290863460),new d(u[41],3158454273),new d(u[42],3505952657),new d(u[43],106217008),new d(u[44],3606008344),new d(u[45],1432725776),new d(u[46],1467031594),new d(u[47],851169720),new d(u[48],3100823752),new d(u[49],1363258195),new d(u[50],3750685593),new d(u[51],3785050280),new d(u[52],3318307427),new d(u[53],3812723403),new d(u[54],2003034995),new d(u[55],3602036899),new d(u[56],1575990012),new d(u[57],1125592928),new d(u[58],2716904306),new d(u[59],442776044),new d(u[60],593698344),new d(u[61],3733110249),new d(u[62],2999351573),new d(u[63],3815920427),new d(3391569614,3928383900),new d(3515267271,566280711),new d(3940187606,3454069534),new d(4118630271,4000239992),new d(116418474,1914138554),new d(174292421,2731055270),new d(289380356,3203993006),new d(460393269,320620315),new d(685471733,587496836),new d(852142971,1086792851),new d(1017036298,365543100),new d(1126000580,2618297676),new d(1288033470,3409855158),new d(1501505948,4234509866),new d(1607167915,987167468),new d(1816402316,1246189591),new d(0,1),new d(0,32898),new d(2147483648,32906),new d(2147483648,2147516416),new d(0,32907),new d(0,2147483649),new d(2147483648,2147516545),new d(2147483648,32777),new d(0,138),new d(0,136),new d(0,2147516425),new d(0,2147483658),new d(0,2147516555),new d(2147483648,139),new d(2147483648,32905),new d(2147483648,32771),new d(2147483648,32770),new d(2147483648,128),new d(0,32778),new d(2147483648,2147483658),new d(2147483648,2147516545),new d(2147483648,32896),new d(0,2147483649),new d(2147483648,2147516424);var f=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(f),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(f);var p=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{box-sizing:var(--ran-btn-box-sizing,border-box);position:var(--ran-btn-position,relative);display:var(--ran-btn-display,inline-flex);background-image:var(--ran-btn-background-image,none);box-shadow:var(--ran-btn-box-shadow,var(--ran-skin-raised-shadow,0 2px #00000004));cursor:var(--ran-btn-cursor,pointer);user-select:var(--ran-btn-user-select,none);touch-action:var(--ran-btn-touch-action,manipulation);overflow:var(--ran-btn-overflow,hidden);pointer-events:var(--ran-btn-pointer-events,auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing,border-box);position:var(--ran-btn-contain-position,relative);display:var(--ran-btn-contain-display,block);background-image:var(--ran-btn-contain-background-image,none);cursor:var(--ran-btn-contain-cursor,pointer);transition:var(--ran-btn-contain-transition,opacity var(--ran-motion-duration-base,.2s) cubic-bezier(.645, .045, .355, 1));user-select:var(--ran-btn-contain-user-select,none);touch-action:var(--ran-btn-contain-touch-action,manipulation);border-radius:var(--ran-btn-content-border-radius,var(--ran-radius-sm,6px));background:var(--ran-btn-contain-background,var(--ran-color-bg-elevated,#fff))}:host,:host(:active),:host(:focus){-webkit-tap-highlight-color:transparent;outline:0}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline,0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline,2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset,2px)}:host([type=primary]) .ran-btn-content{background-color:var(--ran-btn-content-background-color,var(--ran-color-primary,#006bff));background-image:var(--ran-btn-content-background-image,none);border-color:var(--ran-btn-content-border-color,var(--ran-color-primary,#006bff));color:var(--ran-btn-content-color,#fff)}:host([type=primary]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type=primary]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color,var(--ran-color-primary-active,#005ff2));border-color:var(--ran-btn-content-active-border-color,var(--ran-color-primary-active,#005ff2))}:host([type=contrast]) .ran-btn-content{background-color:var(--ran-btn-content-background-color,var(--ran-color-contrast-bg,#171717));background-image:var(--ran-btn-content-background-image,none);border-color:var(--ran-btn-content-border-color,var(--ran-color-contrast-bg,#171717));color:var(--ran-btn-content-color,var(--ran-color-contrast-text,#fff))}:host([type=contrast]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, var(--ran-color-contrast-text,#fff) 10%, transparent 10.01%))}:host([type=contrast]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color,var(--ran-color-contrast-bg-active,#4d4d4d));border-color:var(--ran-btn-content-active-border-color,var(--ran-color-contrast-bg-active,#4d4d4d))}@media (width>=1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color,var(--ran-color-border-hover,#c9c9c9));color:var(--ran-btn-content-hover-color,var(--ran-color-text,#171717))}:host([type=primary]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color,var(--ran-color-primary-hover,#0059ec));border-color:var(--ran-btn-content-hover-border-color,var(--ran-color-primary-hover,#0059ec));color:var(--ran-btn-content-hover-color,#fff)}:host([type=contrast]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color,var(--ran-color-contrast-bg-hover,#383838));border-color:var(--ran-btn-content-hover-border-color,var(--ran-color-contrast-bg-hover,#383838));color:var(--ran-btn-content-hover-color,var(--ran-color-contrast-text,#fff))}:host([type=warning]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color,var(--ran-color-danger,#ff4d4f));background-color:var(--ran-btn-content-warning-background-color,var(--ran-color-danger,#ff4d4f));color:var(--ran-btn-content-warning-color,#fff)}}:host([type=warning]) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color,var(--ran-color-danger,#ff4d4f));background-color:var(--ran-btn-content-warning-background-color,var(--ran-color-danger,#ff4d4f));background-image:var(--ran-btn-content-background-image,none);color:var(--ran-btn-content-warning-color,#fff)}:host([type=warning]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image,radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type=text]) .ran-btn-content{border:var(--ran-btn-content-text-border,none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor,not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events,all);opacity:var(--ran-btn-disabled-opacity,.6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-disabled-container-cursor,not-allowed);pointer-events:var(--ran-btn-disabled-container-pointer-events,all);opacity:var(--ran-btn-disabled-container-opacity,.6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform,translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity,.3);transition:var(--ran-btn-after-transition,0s)}@media (width>=1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";width:100%;height:100%;left:var(--ran-x,0);top:var(--ran-y,0);pointer-events:none;background-image:radial-gradient(circle, var(--ran-gray-alpha-400,#00000014) 10%, transparent 10.01%);opacity:0;background-position:50%;background-repeat:no-repeat;transition:transform .3s,opacity .8s;display:block;position:absolute;transform:translate(-50%,-50%)scale(10)}}:host .slot{display:var(--ran-btn-slot-display,block)}.ran-btn-content{display:var(--ran-btn-content-display,flex);justify-content:var(--ran-btn-content-display,space-between);align-items:var(--ran-btn-content-align-items,center);padding:var(--ran-btn-content-padding,4px 15px);border:var(--ran-btn-content-border,1px solid transparent);border-image-source:var(--ran-btn-content-border-image-source,none);border-image-slice:var(--ran-btn-content-border-image-slice,8);border-image-width:var(--ran-btn-content-border-image-width,4px);border-radius:var(--ran-btn-content-border-radius,var(--ran-radius-sm,6px));border-color:var(--ran-btn-content-border-color,var(--ran-color-border,#eaeaea));color:var(--ran-btn-content-color,var(--ran-color-text,#000000d9));line-height:var(--ran-btn-content-line-height,22px);font-size:var(--ran-btn-content-font-size,14px);font-weight:var(--ran-btn-content-font-weight,400);font-family:var(--ran-btn-content-font-family,var(--ran-skin-font-family,inherit));white-space:var(--ran-btn-content-white-space,nowrap);text-align:var(--ran-btn-content-text-align,center);box-sizing:var(--ran-btn-content-box-sizing,border-box);border-image-outset:0;border-image-repeat:stretch}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right,2px)}`,m=typeof document>`u`,h=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}};function g(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function _(e){return g(e)}var v=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,y=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},b=(e,t,n)=>{for(let r of e)v(r)&&(y(r,t)&&n.push(r),b(r.childrenList,t,n))},x=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?g(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return b(this.childrenList,e,t),t}},S=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new x)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new C(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return b(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${_(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${_(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?g(e):(e instanceof x,e.serialize())).join(``):a+=g(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},C=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return b(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${g(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?g(e):(e instanceof x,e.serialize())).join(``)}</template>`}},w=class e{el;constructor(e){this.el=m?new S(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return m?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let n=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(n(t)):e.concat(t),[]);return n(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?m?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(m){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new T(this.el,t,e)}build(){return this.el}serialize(){if(m)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},T=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof w?this.root.appendChild(e.build()):typeof e==`string`?m?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(m)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return m?this.root.serialize():this.root.innerHTML}},E=e=>new w(e),D=()=>E(`div`),O=()=>E(`slot`),k=[!1,`false`,null,void 0],A=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!!(t&&!k.includes(n))},j=new Map;function M(e,t){m?(j.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var N=typeof document<`u`?HTMLElement:S,P=new Map,F=new Map,I=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!P.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),P.set(t,e)}let n=P.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},L=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!F.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),F.set(t,e)}let n=F.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},R=new WeakMap,z=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,B=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||R.get(e)||e.attachShadow(n);return R.set(e,r),I(r,t?`${t}\n${z}`:z),r},V=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},H=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&L(t,a)},U=class extends N{_btn;_btnContent;_iconElement;_slot;_shadowDom;_events=new h;debounceTimeId;static get observedAttributes(){return[`disabled`,`icon`,`effect`,`iconSize`,`type`,`sheet`]}constructor(){super(),this._shadowDom=B(this,p);let e=V(this._shadowDom,`.ran-btn`,()=>D().class(`ran-btn`).attr(`part`,`button`).role(`button`).tabIndex(0).children(D().class(`ran-btn-content`).attr(`part`,`content`).children(O().class(`slot`))).build());this._btn=e,this._btnContent=e.querySelector(`.ran-btn-content`),this._slot=e.querySelector(`slot`)}get sheet(){return this.getAttribute(`sheet`)||``}set sheet(e){this.setAttribute(`sheet`,e||``),this.handlerExternalCss()}get disabled(){return A(this)}set disabled(e){!e||e===`false`?(this.removeAttribute(`disabled`),this.removeAttribute(`aria-disabled`)):(this.setAttribute(`disabled`,``),this.setAttribute(`aria-disabled`,`true`))}get iconSize(){return this.getAttribute(`iconSize`)||``}set iconSize(e){!e||e===`false`?this.removeAttribute(`iconSize`):(this.setAttribute(`iconSize`,e),this.setIcon())}get icon(){return this.getAttribute(`icon`)||``}set icon(e){!e||e===`false`?this.removeAttribute(`icon`):(this.setAttribute(`icon`,e),this.setIcon())}get effect(){return this.getAttribute(`effect`)||``}set effect(e){k.includes(e)||!e?this.removeAttribute(`effect`):this.setAttribute(`effect`,e)}get type(){return this.getAttribute(`type`)||``}set type(e){e?this.setAttribute(`type`,e):this.removeAttribute(`type`)}setIcon=()=>{if(typeof document>`u`||!this._slot)return;let e=this.icon;if(!e){this._iconElement&&=(this._iconElement.remove(),void 0);return}if(this._iconElement)this._iconElement.setAttribute(`name`,e);else{let t=this._shadowDom.querySelector(`r-icon`);t||(t=E(`r-icon`).attr(`color`,`currentColor`).class(`icon`).build(),this._slot.insertAdjacentElement(`beforebegin`,t)),this._iconElement=t,this._iconElement.setAttribute(`name`,e)}let{width:t,height:n}=this._slot.getBoundingClientRect(),r=Math.min(t,n)||16,i=this.iconSize||`${r>5?r-5:r}`;this._iconElement.setAttribute(`size`,String(i))};mousedown=e=>{if(i()===`pc`&&!this.disabled){this.debounceMouseEvent();let{left:t,top:n}=this.getBoundingClientRect();this._btn.style.setProperty(`--ran-x`,`${e.clientX-t}px`),this._btn.style.setProperty(`--ran-y`,`${e.clientY-n}px`)}};mouseup=()=>{i()===`pc`&&(this.debounceTimeId||=setTimeout(()=>{this._btn.style.removeProperty(`--ran-x`),this._btn.style.removeProperty(`--ran-y`),this.debounceMouseEvent()},600))};keydown=e=>{A(this)||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.click())};debounceMouseEvent=()=>{this.debounceTimeId&&=(clearTimeout(this.debounceTimeId),void 0)};handlerExternalCss=()=>{H(this,this._shadowDom,`sheet`,null,this.sheet)};syncA11yState=()=>{let e=A(this);this._btn.setAttribute(`aria-disabled`,e?`true`:`false`),this._btn.tabIndex=e?-1:0,e?(this.setAttribute(`aria-disabled`,`true`),this._btnContent.setAttribute(`disabled`,`true`)):(this.removeAttribute(`aria-disabled`),this._btnContent.removeAttribute(`disabled`))};connectedCallback(){this.handlerExternalCss(),this.setIcon(),this.syncA11yState(),this._events.on(this._btn,`mousedown`,this.mousedown).on(this._btn,`mouseup`,this.mouseup).on(this._btn,`keydown`,this.keydown)}disconnectedCallback(){this.debounceMouseEvent(),this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&this._btnContent&&this.syncA11yState(),(e===`icon`||e===`iconSize`)&&this.setIcon(),e===`sheet`&&this.handlerExternalCss())}};return M(`r-button`,U),e.Button=U,e.default=U,e})({});
|
package/dist/iife/card.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ranui_card=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{display:var(--ran-card-display,block);box-sizing:border-box;min-height:var(--ran-card-min-height,0)}:host([hoverable]) .ran-card{transition:border-color var(--ran-motion-duration-base,.2s), box-shadow var(--ran-motion-duration-base,.2s)}:host([hoverable]:hover) .ran-card{border-color:var(--ran-card-hover-border-color,var(--ran-color-border-hover,#c9c9c9));box-shadow:var(--ran-card-hover-shadow,var(--ran-shadow-elevated,0 1px 2px #0000000a))}.ran-card{align-content:start;gap:var(--ran-card-gap,14px);min-width:0;height:100%;padding:var(--ran-card-padding,16px);border-width:var(--ran-skin-border-width,1px);border-style:var(--ran-skin-border-style,solid);border-color:var(--ran-card-border-color,var(--ran-color-border,#eaeaea));border-radius:var(--ran-card-radius,var(--ran-radius-md));background:var(--ran-card-background,var(--ran-color-bg));box-shadow:var(--ran-card-shadow,none);box-sizing:border-box;display:grid}.ran-card-header{justify-content:space-between;align-items:flex-start;gap:14px;display:flex}.ran-card-title-area{flex:1;min-width:0}.ran-card-title{color:var(--ran-card-title-color,var(--ran-color-text));font-size:var(--ran-card-title-font-size,16px);font-weight:var(--ran-card-title-font-weight,600);margin:0;line-height:1.3}.ran-card-title:empty{display:none}.ran-card-description{color:var(--ran-card-description-color,var(--ran-color-text-secondary));font-size:var(--ran-card-description-font-size,14px);margin:4px 0 0;line-height:1.5}.ran-card-description:empty{display:none}.ran-card-body,.ran-card-footer{min-width:0}:host(:not([title]):not([description])) .ran-card-header{display:none}`,n=typeof document>`u`;function r(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function i(e){return r(e)}var a=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,o=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},s=(e,t,n)=>{for(let r of e)a(r)&&(o(r,t)&&n.push(r),s(r.childrenList,t,n))},c=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?r(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}},l=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new c)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new u(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${i(t)}"`).join(``),a=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),o=a?` style="${i(a)}"`:``,s=``;return this.shadowRoot&&(s+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?s+=this._innerHTML:s+=this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof c,e.serialize())).join(``):s+=r(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!s?`<${t}${n}${o} />`:`<${t}${n}${o}>${s}</${t}>`}},u=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${r(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof c,e.serialize())).join(``)}</template>`}},d=class e{el;constructor(e){this.el=n?new l(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return n?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let r=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(r(t)):e.concat(t),[]);return r(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?n?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new f(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},f=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof d?this.root.appendChild(e.build()):typeof e==`string`?n?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},p=e=>new d(e),m=()=>p(`div`),h=()=>p(`slot`),g=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},_=(e=8)=>Math.random().toString(36).substring(2,e+2),v=e=>typeof e==`function`,y=12e4,b=`__ranuts_bridge__`,x=`default`,S=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},C=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=x){this.targetOrigin=t,this.channel=n,this.senderId=_(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,S.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:b,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(v(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=_(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},y),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{S.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new C(n,t,r);if(e||=_(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new g;var w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],T=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new T(w[0],3609767458),new T(w[1],602891725),new T(w[2],3964484399),new T(w[3],2173295548),new T(w[4],4081628472),new T(w[5],3053834265),new T(w[6],2937671579),new T(w[7],3664609560),new T(w[8],2734883394),new T(w[9],1164996542),new T(w[10],1323610764),new T(w[11],3590304994),new T(w[12],4068182383),new T(w[13],991336113),new T(w[14],633803317),new T(w[15],3479774868),new T(w[16],2666613458),new T(w[17],944711139),new T(w[18],2341262773),new T(w[19],2007800933),new T(w[20],1495990901),new T(w[21],1856431235),new T(w[22],3175218132),new T(w[23],2198950837),new T(w[24],3999719339),new T(w[25],766784016),new T(w[26],2566594879),new T(w[27],3203337956),new T(w[28],1034457026),new T(w[29],2466948901),new T(w[30],3758326383),new T(w[31],168717936),new T(w[32],1188179964),new T(w[33],1546045734),new T(w[34],1522805485),new T(w[35],2643833823),new T(w[36],2343527390),new T(w[37],1014477480),new T(w[38],1206759142),new T(w[39],344077627),new T(w[40],1290863460),new T(w[41],3158454273),new T(w[42],3505952657),new T(w[43],106217008),new T(w[44],3606008344),new T(w[45],1432725776),new T(w[46],1467031594),new T(w[47],851169720),new T(w[48],3100823752),new T(w[49],1363258195),new T(w[50],3750685593),new T(w[51],3785050280),new T(w[52],3318307427),new T(w[53],3812723403),new T(w[54],2003034995),new T(w[55],3602036899),new T(w[56],1575990012),new T(w[57],1125592928),new T(w[58],2716904306),new T(w[59],442776044),new T(w[60],593698344),new T(w[61],3733110249),new T(w[62],2999351573),new T(w[63],3815920427),new T(3391569614,3928383900),new T(3515267271,566280711),new T(3940187606,3454069534),new T(4118630271,4000239992),new T(116418474,1914138554),new T(174292421,2731055270),new T(289380356,3203993006),new T(460393269,320620315),new T(685471733,587496836),new T(852142971,1086792851),new T(1017036298,365543100),new T(1126000580,2618297676),new T(1288033470,3409855158),new T(1501505948,4234509866),new T(1607167915,987167468),new T(1816402316,1246189591),new T(0,1),new T(0,32898),new T(2147483648,32906),new T(2147483648,2147516416),new T(0,32907),new T(0,2147483649),new T(2147483648,2147516545),new T(2147483648,32777),new T(0,138),new T(0,136),new T(0,2147516425),new T(0,2147483658),new T(0,2147516555),new T(2147483648,139),new T(2147483648,32905),new T(2147483648,32771),new T(2147483648,32770),new T(2147483648,128),new T(0,32778),new T(2147483648,2147483658),new T(2147483648,2147516545),new T(2147483648,32896),new T(0,2147483649),new T(2147483648,2147516424);var E=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(E),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(E);var D=new Map;function O(e,t){n?(D.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var k=typeof document<`u`?HTMLElement:l,A=new Map,j=new Map,M=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!A.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),A.set(t,e)}let n=A.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},N=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!j.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),j.set(t,e)}let n=j.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},P=new WeakMap,F=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,I=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||P.get(e)||e.attachShadow(n);return P.set(e,r),M(r,t?`${t}\n${F}`:F),r},L=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},R=(e,t,n=``)=>e.getAttribute(t)??n,z=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},B=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&N(t,a)},V=class extends k{_shadowDom;_titleEl;_descriptionEl;_headerEl;_footerEl;static get observedAttributes(){return[`title`,`description`,`sheet`,`hoverable`]}constructor(){super(),this._shadowDom=I(this,t);let e=L(this._shadowDom,`.ran-card`,()=>m().class(`ran-card`).attr(`part`,`card`).children(m().class(`ran-card-header`).attr(`part`,`header`).children(m().class(`ran-card-title-area`).children(m().class(`ran-card-title`).attr(`part`,`title`),m().class(`ran-card-description`).attr(`part`,`description`)),h().attr(`name`,`extra`).attr(`part`,`extra`)),m().class(`ran-card-body`).attr(`part`,`body`).children(h()),m().class(`ran-card-footer`).attr(`part`,`footer`).children(h().attr(`name`,`footer`))).build());this._headerEl=e.querySelector(`.ran-card-header`),this._titleEl=e.querySelector(`.ran-card-title`),this._descriptionEl=e.querySelector(`.ran-card-description`),this._footerEl=e.querySelector(`.ran-card-footer`),this._footerEl.style.display=`none`;let n=this._footerEl.querySelector(`slot[name="footer"]`);n.addEventListener(`slotchange`,()=>{this._footerEl.style.display=n.assignedElements().length>0?``:`none`})}get title(){return R(this,`title`)}set title(e){z(this,`title`,e)}get description(){return R(this,`description`)}set description(e){z(this,`description`,e)}get sheet(){return R(this,`sheet`)}set sheet(e){z(this,`sheet`,e)}get hoverable(){return this.hasAttribute(`hoverable`)}set hoverable(e){e?this.setAttribute(`hoverable`,``):this.removeAttribute(`hoverable`)}_syncTitle(){this._titleEl.textContent=this.getAttribute(`title`)??``}_syncDescription(){this._descriptionEl.textContent=this.getAttribute(`description`)??``}connectedCallback(){this._syncTitle(),this._syncDescription(),B(this,this._shadowDom,`sheet`,null,this.sheet)}attributeChangedCallback(e,t,n){t!==n&&(e===`title`&&this._syncTitle(),e===`description`&&this._syncDescription(),e===`sheet`&&B(this,this._shadowDom,e,t,n))}};return O(`r-card`,V),e.Card=V,e.default=V,e})({});
|
|
1
|
+
var ranui_card=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}:host{display:var(--ran-card-display,block);box-sizing:border-box;min-height:var(--ran-card-min-height,0)}:host([hoverable]:hover) .ran-card{border-color:var(--ran-card-hover-border-color,var(--ran-color-border-hover,#c9c9c9));box-shadow:var(--ran-card-hover-shadow,var(--ran-shadow-elevated,0 1px 2px #0000000a))}.ran-card{align-content:start;gap:var(--ran-card-gap,14px);min-width:0;height:100%;padding:var(--ran-card-padding,16px);border-width:var(--ran-skin-border-width,1px);border-style:var(--ran-skin-border-style,solid);border-color:var(--ran-card-border-color,var(--ran-color-border,#eaeaea));border-radius:var(--ran-card-radius,var(--ran-radius-md));background:var(--ran-card-background,var(--ran-color-bg));box-shadow:var(--ran-card-shadow,none);box-sizing:border-box;display:grid}.ran-card-header{justify-content:space-between;align-items:flex-start;gap:14px;display:flex}.ran-card-title-area{flex:1;min-width:0}.ran-card-title{color:var(--ran-card-title-color,var(--ran-color-text));font-size:var(--ran-card-title-font-size,16px);font-weight:var(--ran-card-title-font-weight,600);margin:0;line-height:1.3}.ran-card-title:empty{display:none}.ran-card-description{color:var(--ran-card-description-color,var(--ran-color-text-secondary));font-size:var(--ran-card-description-font-size,14px);margin:4px 0 0;line-height:1.5}.ran-card-description:empty{display:none}.ran-card-body,.ran-card-footer{min-width:0}:host(:not([title]):not([description])) .ran-card-header{display:none}`,n=typeof document>`u`;function r(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function i(e){return r(e)}var a=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,o=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},s=(e,t,n)=>{for(let r of e)a(r)&&(o(r,t)&&n.push(r),s(r.childrenList,t,n))},c=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?r(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}},l=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new c)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new u(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${i(t)}"`).join(``),a=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),o=a?` style="${i(a)}"`:``,s=``;return this.shadowRoot&&(s+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?s+=this._innerHTML:s+=this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof c,e.serialize())).join(``):s+=r(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!s?`<${t}${n}${o} />`:`<${t}${n}${o}>${s}</${t}>`}},u=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${r(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof c,e.serialize())).join(``)}</template>`}},d=class e{el;constructor(e){this.el=n?new l(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return n?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let r=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(r(t)):e.concat(t),[]);return r(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?n?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new f(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},f=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof d?this.root.appendChild(e.build()):typeof e==`string`?n?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},p=e=>new d(e),m=()=>p(`div`),h=()=>p(`slot`),g=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},_=(e=8)=>Math.random().toString(36).substring(2,e+2),v=e=>typeof e==`function`,y=12e4,b=`__ranuts_bridge__`,x=`default`,S=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},C=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=x){this.targetOrigin=t,this.channel=n,this.senderId=_(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,S.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:b,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(v(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=_(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},y),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{S.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new C(n,t,r);if(e||=_(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new g;var w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],T=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new T(w[0],3609767458),new T(w[1],602891725),new T(w[2],3964484399),new T(w[3],2173295548),new T(w[4],4081628472),new T(w[5],3053834265),new T(w[6],2937671579),new T(w[7],3664609560),new T(w[8],2734883394),new T(w[9],1164996542),new T(w[10],1323610764),new T(w[11],3590304994),new T(w[12],4068182383),new T(w[13],991336113),new T(w[14],633803317),new T(w[15],3479774868),new T(w[16],2666613458),new T(w[17],944711139),new T(w[18],2341262773),new T(w[19],2007800933),new T(w[20],1495990901),new T(w[21],1856431235),new T(w[22],3175218132),new T(w[23],2198950837),new T(w[24],3999719339),new T(w[25],766784016),new T(w[26],2566594879),new T(w[27],3203337956),new T(w[28],1034457026),new T(w[29],2466948901),new T(w[30],3758326383),new T(w[31],168717936),new T(w[32],1188179964),new T(w[33],1546045734),new T(w[34],1522805485),new T(w[35],2643833823),new T(w[36],2343527390),new T(w[37],1014477480),new T(w[38],1206759142),new T(w[39],344077627),new T(w[40],1290863460),new T(w[41],3158454273),new T(w[42],3505952657),new T(w[43],106217008),new T(w[44],3606008344),new T(w[45],1432725776),new T(w[46],1467031594),new T(w[47],851169720),new T(w[48],3100823752),new T(w[49],1363258195),new T(w[50],3750685593),new T(w[51],3785050280),new T(w[52],3318307427),new T(w[53],3812723403),new T(w[54],2003034995),new T(w[55],3602036899),new T(w[56],1575990012),new T(w[57],1125592928),new T(w[58],2716904306),new T(w[59],442776044),new T(w[60],593698344),new T(w[61],3733110249),new T(w[62],2999351573),new T(w[63],3815920427),new T(3391569614,3928383900),new T(3515267271,566280711),new T(3940187606,3454069534),new T(4118630271,4000239992),new T(116418474,1914138554),new T(174292421,2731055270),new T(289380356,3203993006),new T(460393269,320620315),new T(685471733,587496836),new T(852142971,1086792851),new T(1017036298,365543100),new T(1126000580,2618297676),new T(1288033470,3409855158),new T(1501505948,4234509866),new T(1607167915,987167468),new T(1816402316,1246189591),new T(0,1),new T(0,32898),new T(2147483648,32906),new T(2147483648,2147516416),new T(0,32907),new T(0,2147483649),new T(2147483648,2147516545),new T(2147483648,32777),new T(0,138),new T(0,136),new T(0,2147516425),new T(0,2147483658),new T(0,2147516555),new T(2147483648,139),new T(2147483648,32905),new T(2147483648,32771),new T(2147483648,32770),new T(2147483648,128),new T(0,32778),new T(2147483648,2147483658),new T(2147483648,2147516545),new T(2147483648,32896),new T(0,2147483649),new T(2147483648,2147516424);var E=new Map([[100,`Continue`],[101,`Switching Protocols`],[102,`Processing`],[103,`Early Hints`],[200,`OK`],[201,`Created`],[202,`Accepted`],[203,`Non-Authoritative Information`],[204,`No Content`],[205,`Reset Content`],[206,`Partial Content`],[207,`Multi-Status`],[208,`Already Reported`],[226,`IM Used`],[300,`Multiple Choices`],[301,`Moved Permanently`],[302,`Found`],[303,`See Other`],[304,`Not Modified`],[305,`Use Proxy`],[307,`Temporary Redirect`],[308,`Permanent Redirect`],[400,`Bad Request`],[401,`Unauthorized`],[402,`Payment Required`],[403,`Forbidden`],[404,`Not Found`],[405,`Method Not Allowed`],[406,`Not Acceptable`],[407,`Proxy Authentication Required`],[408,`Request Timeout`],[409,`Conflict`],[410,`Gone`],[411,`Length Required`],[412,`Precondition Failed`],[413,`Payload Too Large`],[414,`URI Too Long`],[415,`Unsupported Media Type`],[416,`Range Not Satisfiable`],[417,`Expectation Failed`],[418,`I'm a Teapot`],[421,`Misdirected Request`],[422,`Unprocessable Entity`],[423,`Locked`],[424,`Failed Dependency`],[425,`Too Early`],[426,`Upgrade Required`],[428,`Precondition Required`],[429,`Too Many Requests`],[431,`Request Header Fields Too Large`],[451,`Unavailable For Legal Reasons`],[500,`Internal Server Error`],[501,`Not Implemented`],[502,`Bad Gateway`],[503,`Service Unavailable`],[504,`Gateway Timeout`],[505,`HTTP Version Not Supported`],[506,`Variant Also Negotiates`],[507,`Insufficient Storage`],[508,`Loop Detected`],[509,`Bandwidth Limit Exceeded`],[510,`Not Extended`],[511,`Network Authentication Required`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(E),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(E);var D=new Map;function O(e,t){n?(D.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var k=typeof document<`u`?HTMLElement:l,A=new Map,j=new Map,M=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!A.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),A.set(t,e)}let n=A.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},N=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!j.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),j.set(t,e)}let n=j.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},P=new WeakMap,F=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,I=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||P.get(e)||e.attachShadow(n);return P.set(e,r),M(r,t?`${t}\n${F}`:F),r},L=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},R=(e,t,n=``)=>e.getAttribute(t)??n,z=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},B=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&N(t,a)},V=class extends k{_shadowDom;_titleEl;_descriptionEl;_headerEl;_footerEl;static get observedAttributes(){return[`title`,`description`,`sheet`,`hoverable`]}constructor(){super(),this._shadowDom=I(this,t);let e=L(this._shadowDom,`.ran-card`,()=>m().class(`ran-card`).attr(`part`,`card`).children(m().class(`ran-card-header`).attr(`part`,`header`).children(m().class(`ran-card-title-area`).children(m().class(`ran-card-title`).attr(`part`,`title`),m().class(`ran-card-description`).attr(`part`,`description`)),h().attr(`name`,`extra`).attr(`part`,`extra`)),m().class(`ran-card-body`).attr(`part`,`body`).children(h()),m().class(`ran-card-footer`).attr(`part`,`footer`).children(h().attr(`name`,`footer`))).build());this._headerEl=e.querySelector(`.ran-card-header`),this._titleEl=e.querySelector(`.ran-card-title`),this._descriptionEl=e.querySelector(`.ran-card-description`),this._footerEl=e.querySelector(`.ran-card-footer`),this._footerEl.style.display=`none`;let n=this._footerEl.querySelector(`slot[name="footer"]`);n.addEventListener(`slotchange`,()=>{this._footerEl.style.display=n.assignedElements().length>0?``:`none`})}get title(){return R(this,`title`)}set title(e){z(this,`title`,e)}get description(){return R(this,`description`)}set description(e){z(this,`description`,e)}get sheet(){return R(this,`sheet`)}set sheet(e){z(this,`sheet`,e)}get hoverable(){return this.hasAttribute(`hoverable`)}set hoverable(e){e?this.setAttribute(`hoverable`,``):this.removeAttribute(`hoverable`)}_syncTitle(){this._titleEl.textContent=this.getAttribute(`title`)??``}_syncDescription(){this._descriptionEl.textContent=this.getAttribute(`description`)??``}connectedCallback(){this._syncTitle(),this._syncDescription(),B(this,this._shadowDom,`sheet`,null,this.sheet)}attributeChangedCallback(e,t,n){t!==n&&(e===`title`&&this._syncTitle(),e===`description`&&this._syncDescription(),e===`sheet`&&B(this,this._shadowDom,e,t,n))}};return O(`r-card`,V),e.Card=V,e.default=V,e})({});
|