@tempots/beatui 0.87.2 → 0.87.4
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/{ar-DjMvIww5.js → ar-Dn7AkNO5.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-BIefTDoO.js → auth-divider-BZPM2Xd3.js} +101 -103
- package/dist/{auth-divider-V_Se6Qhe.cjs → auth-divider-Cj-xJxF_.cjs} +1 -1
- package/dist/beatui.css +23 -0
- package/dist/beatui.tailwind.css +23 -0
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +12 -12
- package/dist/{colors-BmLYKmoH.js → colors-CatA-RXf.js} +9 -9
- package/dist/{de-wChFYqM4.js → de-QYhBiWv7.js} +1 -1
- package/dist/deep-merge-BmxkFFi1.cjs +1 -0
- package/dist/{deep-merge-BRqRzEQs.js → deep-merge-D076XcC5.js} +152 -156
- package/dist/{duration-input-BDEb1Bb7.js → duration-input-6RN16H08.js} +5 -5
- package/dist/{duration-input-BtFL5Vjx.cjs → duration-input-CJU-yeKk.cjs} +1 -1
- package/dist/{editor-toolbar-group-CwCCGzEC.js → editor-toolbar-group-DRCbXeQP.js} +6 -3
- package/dist/{es-CmPF3IGl.js → es-Ba31pZAd.js} +1 -1
- package/dist/{fa-D696e75R.js → fa-DvLjl_Ha.js} +1 -1
- package/dist/{fr-B0jeX1Hx.js → fr-D64yBpAp.js} +1 -1
- package/dist/{he-SgAsIYJA.js → he-DHZGEQ7C.js} +1 -1
- package/dist/{hi-s9oiIihq.js → hi-CeAXVCvp.js} +1 -1
- package/dist/{index-CaWDj1Vg.cjs → index-BIGCKfNz.cjs} +10 -10
- package/dist/{index-DdqGL9Jk.js → index-BTITknMc.js} +701 -684
- package/dist/{index-qa82MK4Z.cjs → index-Bso_SkEn.cjs} +1 -1
- package/dist/{index-B0t-nt7i.js → index-DWDC-qRY.js} +4 -4
- package/dist/{index-D2_J_-XS.js → index-rHnH2IGb.js} +77 -77
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +1015 -1018
- package/dist/{index.esm-ChUrm4xR.js → index.esm-By0m3ki1.js} +3 -3
- package/dist/{input-container-DhUiLmXE.js → input-container-BTyCOubf.js} +1 -1
- package/dist/{it-Dc4IMciD.js → it-Im0KgKWL.js} +1 -1
- package/dist/{ja-D2t2g5xj.js → ja-lliCbC19.js} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +97 -103
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +15 -15
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +349 -351
- package/dist/{ko-BRylA5JZ.js → ko-B9W4RBBs.js} +1 -1
- package/dist/lexical/index.cjs.js +5 -12
- package/dist/lexical/index.es.js +54 -84
- package/dist/{menu-Ui4lUPHM.js → menu-CV85y3Xf.js} +1 -1
- package/dist/{modal-Dkje8L_l.js → modal-CD3DwAlD.js} +5 -5
- package/dist/{modal-Coenk8Fy.cjs → modal-jJMS0ZlW.cjs} +1 -1
- package/dist/monaco/index.es.js +1 -1
- package/dist/{nl-Dh7LUWAn.js → nl-ba5SyHsw.js} +1 -1
- package/dist/notice-9lpZ-VDn.cjs +1 -0
- package/dist/{notice-BmkckDsD.js → notice-Cc26kgiB.js} +26 -28
- package/dist/{oneof-branch-detection-Vov_e3kI.cjs → oneof-branch-detection-BsGhMslW.cjs} +6 -6
- package/dist/{oneof-branch-detection-BED_n2MT.js → oneof-branch-detection-DiAtgGQH.js} +1740 -1734
- package/dist/{pl-XEG-p1Q9.js → pl-DCiJAZWC.js} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-DYsDA2sZ.js → pt-Df5bAGWA.js} +1 -1
- package/dist/{ru-BTKBykp-.js → ru-Dg-c670Y.js} +1 -1
- package/dist/stack-4VUGISn6.cjs +1 -0
- package/dist/{stack-BJgsPJ9A.js → stack-Bm-UZosx.js} +145 -139
- package/dist/tailwind/preset.es.js +2 -2
- package/dist/tailwind/vite-plugin.es.js +1 -1
- package/dist/{text-input-BZmAB3_o.js → text-input-Cux5iiUC.js} +5 -5
- package/dist/{theme-BzpMLdvH.js → theme-kQZEeusG.js} +4 -4
- package/dist/{toolbar-Pdj-F80l.js → toolbar-DYmKrtic.js} +1 -1
- package/dist/{tr-Cp8ZCUic.js → tr-Dhpiq0u_.js} +1 -1
- package/dist/{translations-BGblCUBj.js → translations-BLlzvZgw.js} +30 -30
- package/dist/{translations-jUYta1_1.js → translations-COSDzhvR.js} +1 -1
- package/dist/types/auth-i18n/translations.d.ts +2 -2
- package/dist/types/beatui-i18n/translations.d.ts +2 -2
- package/dist/types/better-auth/components/authenticated.d.ts +2 -2
- package/dist/types/better-auth/components/better-auth-container.d.ts +1 -1
- package/dist/types/better-auth/i18n/translations.d.ts +2 -2
- package/dist/types/better-auth/provider.d.ts +2 -2
- package/dist/types/components/auth/auth-container.d.ts +1 -1
- package/dist/types/components/auth/auth-email-prop.d.ts +1 -1
- package/dist/types/components/beatui.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/content/native-pdf-preview.d.ts +1 -1
- package/dist/types/components/content/pdfjs-preview.d.ts +1 -1
- package/dist/types/components/data/icon.d.ts +1 -1
- package/dist/types/components/data/page-drop-zone.d.ts +1 -1
- package/dist/types/components/data/unstyled-drop-zone.d.ts +1 -1
- package/dist/types/components/editor-toolbar/editor-toolbar-button.d.ts +1 -1
- package/dist/types/components/editor-toolbar/editor-toolbar-group.d.ts +1 -1
- package/dist/types/components/form/control/control.d.ts +2 -2
- package/dist/types/components/form/control/ensure-control.d.ts +1 -1
- package/dist/types/components/form/control/list-control.d.ts +1 -1
- package/dist/types/components/form/controller/color-controller.d.ts +4 -4
- package/dist/types/components/form/input/appearance-selector.d.ts +2 -2
- package/dist/types/components/form/input/base64-input.d.ts +1 -1
- package/dist/types/components/form/input/base64s-input.d.ts +1 -1
- package/dist/types/components/form/input/combobox-tags-input.d.ts +1 -1
- package/dist/types/components/form/input/email-input.d.ts +1 -1
- package/dist/types/components/form/input/file-input.d.ts +1 -1
- package/dist/types/components/form/input/files-input.d.ts +1 -1
- package/dist/types/components/form/input/input-options.d.ts +1 -1
- package/dist/types/components/form/input/list-input.d.ts +1 -1
- package/dist/types/components/form/input/nullable-base64-input.d.ts +1 -1
- package/dist/types/components/form/input/nullable-plain-date-input.d.ts +12 -12
- package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +12 -12
- package/dist/types/components/form/input/nullable-plain-time-input.d.ts +12 -12
- package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +12 -12
- package/dist/types/components/form/input/password-input.d.ts +1 -1
- package/dist/types/components/form/input/plain-date-input.d.ts +12 -12
- package/dist/types/components/form/input/plain-date-time-input.d.ts +12 -12
- package/dist/types/components/form/input/plain-time-input.d.ts +12 -12
- package/dist/types/components/form/input/plain-year-month-input.d.ts +12 -12
- package/dist/types/components/form/input/select-tags-input.d.ts +3 -3
- package/dist/types/components/form/use-form.d.ts +3 -3
- package/dist/types/components/i18n/locale-direction.d.ts +1 -1
- package/dist/types/components/i18n/locale-selector.d.ts +1 -1
- package/dist/types/components/i18n/locale.d.ts +1 -1
- package/dist/types/components/i18n/make-i18nprovider.d.ts +2 -2
- package/dist/types/components/layout/app-shell.d.ts +1 -1
- package/dist/types/components/lexical/code/language-selector.d.ts +1 -1
- package/dist/types/components/lexical/floating/block-handle.d.ts +1 -1
- package/dist/types/components/lexical/floating/floating-toolbar.d.ts +1 -1
- package/dist/types/components/lexical/floating/slash-command-palette.d.ts +1 -1
- package/dist/types/components/lexical/table/table-controls.d.ts +1 -1
- package/dist/types/components/lexical/toolbar/lexical-toolbar.d.ts +1 -1
- package/dist/types/components/lexical/toolbar/toolbar-helpers.d.ts +2 -2
- package/dist/types/components/media/pdf-page-viewer.d.ts +1 -1
- package/dist/types/components/misc/notification-provider.d.ts +2 -2
- package/dist/types/components/navigation/link/button-link.d.ts +1 -1
- package/dist/types/components/navigation/link/link.d.ts +1 -1
- package/dist/types/components/navigation/link/navigation-link.d.ts +1 -1
- package/dist/types/components/navigation/pagination.d.ts +1 -1
- package/dist/types/components/navigation/sidebar/sidebar.d.ts +2 -2
- package/dist/types/components/navigation/toolbar/toolbar.d.ts +1 -1
- package/dist/types/components/prosemirror/link-control.d.ts +1 -1
- package/dist/types/components/prosemirror/prosemirror-toolbar.d.ts +1 -1
- package/dist/types/components/prosemirror/utils.d.ts +2 -2
- package/dist/types/components/theme/theme.d.ts +2 -2
- package/dist/types/i18n/translate.d.ts +1 -1
- package/dist/types/utils/delay-signal.d.ts +1 -1
- package/dist/types/utils/use-animated-toggle.d.ts +22 -22
- package/dist/{ur-DkIYJxsF.js → ur-Lr1p8f9y.js} +1 -1
- package/dist/{use-animated-toggle-89fKlXxy.js → use-animated-toggle-C7PTmnZi.js} +7 -7
- package/dist/{use-form-BSvvERhX.js → use-form-BfzX3bwL.js} +13 -13
- package/dist/{use-form-B_mCauP0.cjs → use-form-i97PToWB.cjs} +1 -1
- package/dist/{vi-DKw6PBja.js → vi-jozfaxSj.js} +1 -1
- package/dist/widget-customization-BZqPoojo.cjs +1 -0
- package/dist/{widget-customization-DFr3ycD7.js → widget-customization-fMNSVtuP.js} +29 -29
- package/dist/{zh-CaKHseXJ.js → zh-BBYKq49d.js} +1 -1
- package/package.json +35 -31
- package/dist/deep-merge-CvN7Xvd1.cjs +0 -1
- package/dist/notice-DMK7dx9a.cjs +0 -1
- package/dist/stack-DcZ_u50f.cjs +0 -1
- package/dist/widget-customization-BASfRpF7.cjs +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { prop as b, computedOf as B, makeProviderMark as U, When as y, Unless as C, Use as S, html as r, attr as l, Ensure as g, OneOfValue as D, Fragment as E, NotEmpty as O, ForEach as
|
|
2
|
-
import {
|
|
3
|
-
import { m as N } from "../translations-
|
|
4
|
-
import { N as v, P as V, E as x } from "../notice-
|
|
5
|
-
import { S as P } from "../stack-
|
|
6
|
-
import { B as k } from "../input-container-
|
|
7
|
-
import { T as I } from "../text-input-
|
|
1
|
+
import { prop as b, computedOf as B, makeProviderMark as U, When as y, Unless as C, Use as S, html as r, attr as l, Ensure as g, OneOfValue as D, Fragment as E, NotEmpty as O, ForEach as A, on as L } from "@tempots/dom";
|
|
2
|
+
import { b as M, d as T } from "../auth-divider-BZPM2Xd3.js";
|
|
3
|
+
import { m as N } from "../translations-BLlzvZgw.js";
|
|
4
|
+
import { N as v, P as V, E as x } from "../notice-Cc26kgiB.js";
|
|
5
|
+
import { S as P } from "../stack-Bm-UZosx.js";
|
|
6
|
+
import { B as k } from "../input-container-BTyCOubf.js";
|
|
7
|
+
import { T as I } from "../text-input-Cux5iiUC.js";
|
|
8
8
|
function F(t, e) {
|
|
9
9
|
return t.error ? (e.onError?.({
|
|
10
10
|
message: t.error.message,
|
|
@@ -220,11 +220,11 @@ const J = {
|
|
|
220
220
|
passkeyCancelButton: "Cancel",
|
|
221
221
|
passkeyNamePlaceholder: "Passkey name (optional)",
|
|
222
222
|
passkeyUnnamed: "Unnamed passkey"
|
|
223
|
-
}, $ = J,
|
|
224
|
-
defaultLocale:
|
|
223
|
+
}, $ = J, R = "en", K = /* @__PURE__ */ Object.assign({}), _ = N({
|
|
224
|
+
defaultLocale: R,
|
|
225
225
|
defaultMessages: $,
|
|
226
226
|
localeLoader: async (t) => {
|
|
227
|
-
if (t ===
|
|
227
|
+
if (t === R) return $;
|
|
228
228
|
const e = K[`./locales/${t}.ts`];
|
|
229
229
|
return e ? await e() : $;
|
|
230
230
|
},
|
|
@@ -308,7 +308,7 @@ function le({
|
|
|
308
308
|
() => r.div(
|
|
309
309
|
l.class("bc-two-factor__backup-codes"),
|
|
310
310
|
r.p(i.$.twoFactorBackupCodesDescription),
|
|
311
|
-
r.ul(
|
|
311
|
+
r.ul(A(o, (s) => r.li(s)))
|
|
312
312
|
)
|
|
313
313
|
),
|
|
314
314
|
r.form(
|
|
@@ -617,7 +617,7 @@ function fe({
|
|
|
617
617
|
// Passkey list
|
|
618
618
|
r.div(
|
|
619
619
|
l.class("bc-passkey-list"),
|
|
620
|
-
|
|
620
|
+
A(e, (p) => {
|
|
621
621
|
const i = b(!1), s = b(p.$.name?.value ?? "");
|
|
622
622
|
return r.div(
|
|
623
623
|
l.class("bc-passkey-item"),
|
|
@@ -516,19 +516,19 @@ export {
|
|
|
516
516
|
w as a,
|
|
517
517
|
E as b,
|
|
518
518
|
s as c,
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
519
|
+
v as d,
|
|
520
|
+
m as e,
|
|
521
|
+
g as f,
|
|
522
522
|
x as g,
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
523
|
+
b as h,
|
|
524
|
+
S as i,
|
|
525
|
+
i as j,
|
|
526
526
|
f as k,
|
|
527
527
|
k as l,
|
|
528
|
-
|
|
528
|
+
u as m,
|
|
529
529
|
p as n,
|
|
530
|
-
|
|
530
|
+
y as o,
|
|
531
531
|
d as r,
|
|
532
532
|
n as s,
|
|
533
|
-
|
|
533
|
+
C as t
|
|
534
534
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("@tempots/dom"),C=require("./translations-gVgMyNno.cjs"),yt=require("./colors-BI0YhONJ.cjs"),It=require("./timer-BJHOsuS6.cjs"),Vt=require("@tempots/ui"),M=require("./input-container-B31Seozh.cjs"),$=require("./use-form-i97PToWB.cjs"),z=require("./text-input-w0eVcqk5.cjs"),at=require("./stack-4VUGISn6.cjs");let H=null;async function q(){const n=globalThis;return n.Temporal?n.Temporal:(H||(H=Promise.resolve().then(()=>require("./index.esm-C6lZ02yY.cjs")).then(e=>{const l=e.Temporal;return n.Temporal||(n.Temporal=l),l})),H)}const st=(n,e)=>e?t.Task(q,{then:n,pending:e.pending,error:e.error}):t.Task(q,n);function j({onChange:n,value:e,accept:l="*/*",enableClick:r=!0,content:o,disabled:m=!1,allowMultiple:a}){return t.Use(C.BeatUII18n,h=>{const p=t.Value.deriveProp(e??[]),b=t.prop(!1),f=c=>{c.preventDefault(),c.stopPropagation(),b.value=!0},d=c=>{c.preventDefault(),c.stopPropagation(),(!c.currentTarget||!c.currentTarget.contains(c.relatedTarget))&&(b.value=!1)},v=c=>{c.preventDefault(),c.stopPropagation(),b.value=!1;const g=Array.from(c.dataTransfer?.files||[]);g.length>0&&(p.value=g,n(g,"dragdrop"))},s=c=>{t.Value.get(r)&&c.currentTarget.querySelector('input[type="file"]')?.click()};let u=null;const V=()=>{if(u==null)return;const c=Array.from(u.files??[]);c.length>0&&(p.value=c,n(c,"click")),u.value=""},_=c=>{t.Value.get(r)&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),s(c))};return t.html.div(t.attr.role("button"),t.attr.tabindex(t.Value.map(r,c=>c?0:-1)),t.attr.style("position: relative;"),t.on.dragover(f),t.on.dragleave(d),t.on.drop(v),t.on.click(s),t.on.keydown(_),t.html.input(t.attr.type("file"),t.attr.disabled(m),t.attr.accept(l),t.attr.multiple(a),t.attr.style("position: absolute; left: -9999px; opacity: 0; pointer-events: none;"),t.on.change(V),t.WithElement(c=>(u=c,p.on(g=>{const k=globalThis.DataTransfer;if(k!=null){const w=new k;g.forEach(O=>w.items.add(O)),c.files=w.files}}),t.Empty))),t.aria.label(t.bind(h.$.dropZoneInstructions)(r)),o({files:p,clear:()=>p.value=[],change:p.set}))})}function Ct(n,e){return n.length===e.length&&n.every((l,r)=>l===e[r])}function wt(n,e,l){const r=["bc-segmented-input",`bc-segmented-input--size-${n}`];return l==="squared"&&r.push("bc-segmented-input--squared"),e&&r.push("bc-segmented-input--disabled"),r.join(" ")}function _t(n){if(n==null)return"";const e=new Map,l=C.backgroundValue(n,"solid","light"),r=C.backgroundValue(n,"solid","dark");return e.set("--si-indicator-bg",l.backgroundColor),e.set("--si-active-text",l.textColor),e.set("--si-indicator-bg-dark",r.backgroundColor),e.set("--si-active-text-dark",r.textColor),Array.from(e.entries()).map(([o,m])=>`${o}: ${m}`).join("; ")}function kt({options:n,value:e,onChange:l,size:r="md",disabled:o=!1,variant:m="pill",color:a},...h){const p=yt.l(n).map(([b,f])=>({key:b,label:f}));return t.WithElement(()=>{const b=Object.fromEntries(p.map((d,v)=>[d.key,v])),f=t.prop(p.map(()=>({left:0,width:0})),Ct);return t.html.div(t.attr.class(t.computedOf(r,o,m)((d,v,s)=>wt(d??"md",v??!1,s??"pill"))),t.attr.style(a!=null?t.Value.map(a,d=>_t(d)):""),t.html.div(t.attr.class("bc-segmented-input__container"),t.html.div(t.attr.class("bc-segmented-input__indicator"),t.style.width(t.computedOf(e,f)((d,v)=>{const{width:s}=v[b[d]??0];return`${s}px`})),t.style.left(t.computedOf(e,f)((d,v)=>{const{left:s}=v[b[d]??0];return`${s}px`}))),p.map(({label:d,key:v},s)=>t.html.button(t.attr.type("button"),t.on.click(u=>{u.preventDefault(),t.Value.get(o)||l?.(v)}),t.attr.disabled(o),t.attr.class("bc-segmented-input__segment"),t.attr.class(t.Value.map(e,u=>u===v?"bc-segmented-input__segment--active":"bc-segmented-input__segment--inactive")),Vt.ElementRect(u=>{function V(){f.update(c=>{const g=[...c];return g[s]={width:u.value.width,left:u.value.localLeft},g})}const _=It.g(V);return t.OnDispose(_,u.on(V))}),d))),...h)})}function Dt(n){const e=n.type.toLowerCase();return e.startsWith("image/")&&(e.includes("jpeg")||e.includes("jpg")||e.includes("png")||e.includes("gif")||e.includes("webp")||e.includes("svg"))}function Et(n){const e=n.type.toLowerCase();return e.startsWith("image/")?"vscode-icons:file-type-image":e.startsWith("video/")?"vscode-icons:file-type-video":e.startsWith("audio/")?"vscode-icons:file-type-audio":e.includes("pdf")?"vscode-icons:file-type-pdf2":e.includes("word")||e.includes("document")?"vscode-icons:file-type-word":e.includes("excel")||e.includes("spreadsheet")?"vscode-icons:file-type-excel":e.includes("powerpoint")||e.includes("presentation")?"vscode-icons:file-type-powerpoint":e.includes("zip")||e.includes("archive")?"vscode-icons:file-type-zip":e.includes("text")?"vscode-icons:file-type-text":e.includes("json")?"vscode-icons:file-type-json-official":e.includes("csv")?"vscode-icons:file-type-csv":e.includes("xml")?"vscode-icons:file-type-xml":e.includes("yaml")?"vscode-icons:file-type-yaml-official":"vscode-icons:file-type-binary"}function Y(n){return t.When(n.map(Dt),()=>{const e=t.prop(null);return n.on(l=>{e.value&&URL.revokeObjectURL(e.value);const r=URL.createObjectURL(l);e.value=r}),t.html.div(t.OnDispose(()=>{e.value&&URL.revokeObjectURL(e.value)}),t.attr.class("bc-file-input__thumbnail-container"),t.html.img(t.attr.src(e),t.attr.alt(n.map(l=>l.name)),t.attr.class("bc-file-input__thumbnail")))},()=>C.Icon({icon:n.map(Et)}))}const Ut=(n,...e)=>{const{value:l=t.prop([]),accept:r="*/*",maxFiles:o,maxFileSize:m,onChange:a,onBlur:h,disabled:p,hasError:b,mode:f="default",showFileList:d=!0,...v}=n,s=l,u=t.Value.map(f,I=>I==="input"),V=t.Value.map(f,I=>I==="compact"),_=I=>{let i=I;if(o!=null){const x=t.Value.get(o);i=i.slice(0,x)}if(m){const x=t.Value.get(m);i=i.filter(D=>D.size<=x)}a?.(i)},c=I=>{const x=s.value.filter((D,E)=>E!==I);a?.(x)},g=()=>{a?.([])},k=({files:I,clear:i,change:x})=>t.Use(C.BeatUII18n,D=>t.html.div(t.attr.class("bc-file-input__drop-zone"),t.html.div(t.attr.class("bc-file-input__drop-zone-content bc-file-input__drop-zone-content--empty"),C.Icon({icon:"mdi:cloud-upload-outline",size:"xl"}),t.html.div(t.attr.class("bc-file-input__drop-zone-text"),t.bind(D.$.filesInputInstructions)(o,m,D.$.fileSizeUnits.value))))),w=({files:I})=>t.Use(C.BeatUII18n,i=>t.html.div(t.attr.class("bc-file-input__compact-drop-zone"),t.When(I.map(x=>x.length>0),()=>t.html.div(t.attr.class("bc-file-input__compact-file-list"),t.ForEach(I,(x,D)=>{const E=D.index;return t.html.div(t.attr.class("bc-file-input__compact-file-item"),t.html.div(t.attr.class("bc-file-input__compact-file-icon"),Y(x)),t.html.div(t.attr.class("bc-file-input__compact-file-info"),t.html.div(t.attr.class("bc-file-input__compact-file-name"),t.attr.title(x.$.name),x.$.name),t.html.div(t.attr.class("bc-file-input__compact-file-meta"),t.computedOf(x.$.size,i.$.fileSizeUnits)((y,U)=>C.formatFileSize(y,{units:U}))," • ",t.computedOf(x.$.type,i.$.unknownType)((y,U)=>y||U))),$.CloseButton({size:"sm",label:i.$.removeFile,disabled:p,onClick:()=>c(E)},t.attr.class("bc-file-input__compact-remove-button")))})),()=>t.html.div(t.attr.class("bc-file-input__compact-placeholder"),C.Icon({icon:"mdi:cloud-upload-outline",size:"lg"}),t.html.div(t.attr.class("bc-file-input__compact-placeholder-text"),t.bind(i.$.filesInputInstructions)(o,m,i.$.fileSizeUnits.value)))))),O=({files:I})=>t.Use(C.BeatUII18n,i=>t.html.div(t.attr.class("bc-file-input__compact-input"),t.When(I.map(x=>x.length>0),()=>t.html.span(t.attr.class("bc-file-input__compact-value"),t.ForEach(I,x=>t.html.span(t.attr.class("bc-file-input__compact-value-item"),Y(x),t.html.span(t.attr.class("bc-file-input__compact-value-item-name"),x.$.name)))),()=>t.html.span(t.attr.class("bc-file-input__compact-placeholder"),C.Icon({icon:"mdi:cloud-upload-outline",size:"md"})," ",t.bind(i.$.filesInputInstructions)(o,m,i.$.fileSizeUnits.value)))));return t.Use(C.BeatUII18n,I=>M.InputContainer({baseContainer:t.Value.map(u,i=>!i),disabled:p,hasError:b,after:t.When(u,()=>t.When(s.map(({length:i})=>i>0),()=>$.CloseButton({size:"sm",label:I.$.clearAllFiles,disabled:p,onClick:g},t.attr.class("bc-file-input__compact-clear")))),...v,input:t.When(u,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--input"),j({value:s,accept:r,enableClick:!0,allowMultiple:t.Value.map(o??1/0,i=>i>1),disabled:p,onChange:_,content:O})),()=>t.When(V,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--compact"),j({value:s,accept:r,enableClick:!0,allowMultiple:t.Value.map(o??1/0,i=>i>1),disabled:p,onChange:_,content:w})),()=>t.html.div(t.attr.class("bc-file-input"),j({value:s,accept:r,enableClick:!0,allowMultiple:t.Value.map(o??1/0,i=>i>1),disabled:p,onChange:_,content:k}),t.When(d,()=>t.NotEmpty(s,()=>t.Fragment(t.html.div(t.attr.class("bc-file-input__file-list"),t.ForEach(s,(i,x)=>{const D=x.index;return t.html.div(t.attr.class("bc-file-input__file-item"),t.html.div(t.attr.class("bc-file-input__file-icon"),Y(i)),t.html.div(t.attr.class("bc-file-input__file-info"),t.html.div(t.attr.class("bc-file-input__file-name"),t.attr.title(i.$.name),i.$.name),t.html.div(t.attr.class("bc-file-input__file-meta"),t.computedOf(i.$.size,I.$.fileSizeUnits)((E,y)=>C.formatFileSize(E,{units:y}))," • ",t.computedOf(i.$.type,I.$.unknownType)((E,y)=>E||y))),$.CloseButton({size:"sm",label:I.$.removeFile,disabled:p,onClick:()=>c(D)},t.attr.class("bc-file-input__remove-button")))})),t.When(s.map(({length:i})=>i>1),()=>t.html.div(t.attr.class("bc-file-input__clear-all-button-container"),t.html.button(t.attr.type("button"),t.attr.class("bc-file-input__clear-all-button"),t.attr.disabled(p),I.$.clearAllFiles,t.on.click(i=>{i.preventDefault(),i.stopPropagation(),g()}))))))))))},...e))},J="$$tts-exp-",it=(n,e)=>t.WithElement(l=>{const r=`${J}${n}`;return t.OnDispose(t.Value.on(e,o=>Reflect.set(l,r,o)))}),Ot=(n,e)=>{const l=`${J}${n}`;return r=>{e(Reflect.get(r.target,l))}},ut=(n,e)=>{const l=`${J}${n}`;return r=>{const o=r.target,m=o.selectedIndex,a=o.options[m];e(Reflect.get(a,l))}};function G(...n){return t.html.div(t.attr.class("bc-group"),...n)}const ct=(n,e,l)=>t.Ensure(n,r=>t.OneOfType(r,{value:o=>{const m=t.computedOf(o,l)((a,h)=>e(a.value,h));return t.html.option(t.attr.selected(m),it("value",o.$.value),o.$.label)},group:o=>t.html.optgroup(t.attr.label(o.$.group),t.ForEach(o.$.options,m=>ct(m,e,l))),break:()=>t.html.hr()})),pt=n=>{const{value:e,onBlur:l,onChange:r,options:o,unselectedLabel:m,equality:a=(b,f)=>b===f,after:h}=n;let p;return M.InputContainer({...n,after:t.Fragment(M.InputIcon({icon:"ph:caret-down-bold",color:"neutral",size:"sm"}),h),input:t.html.select(t.WithElement(b=>{p=b;const f=new MutationObserver(d=>{const{removedNodes:v}=d[0];v.length>0&&(p.selectedIndex=0)});return f.observe(b,{childList:!0}),t.OnDispose(()=>f.disconnect())}),z.CommonInputAttributes(n),t.attr.class("bc-native-select bc-input"),t.Use(C.BeatUII18n,b=>t.html.option(t.attr.hidden("hidden"),t.coalesce(m,b.$.selectOne))),t.ForEach(o,b=>ct(b,a,e)),l!=null?t.on.blur(l):t.Empty,r!=null?t.on.change(ut("value",b=>r(b))):t.Empty)},t.on.click(()=>{if(p?.focus(),typeof p?.showPicker=="function")try{p.showPicker()}catch{}}))};function ft(n){const{controller:e,onChange:l,onBlur:r,...o}=n;return pt({...o,value:e.signal,onChange:$.makeOnChangeHandler(e,l),onBlur:$.makeOnBlurHandler(e,r)})}function $t(n){return $.InputWrapper({...n,content:ft(n)})}function dt(n,e,l){const r=n.length.map(o=>o);return t.Repeat(r,o=>{const m=n.item(o.index),a=[];return t.Fragment(t.OnDispose(()=>{a.forEach(h=>h())}),e({list:n,item:m,position:o,remove:()=>n.removeAt(o.index),move:h=>{switch(h){case"up":if(o.index===0)return;n.move(o.index,o.index-1);break;case"down":if(o.index===n.length.value-1)return;n.move(o.index,o.index+1);break;case"first":n.move(o.index,0);break;case"last":n.move(o.index,n.length.value-1)}},canMove:h=>{const p=(()=>{switch(h){case"up":return t.signal(o.index>0);case"down":return n.length.map(b=>o.index<b-1)}})();return a.push(()=>p.dispose()),p},cannotMove:h=>{const p=(()=>{switch(h){case"up":return t.signal(o.index===0);case"down":return n.length.map(b=>o.index===b-1)}})();return a.push(()=>p.dispose()),p}}))},l)}const et={9:{pattern:/^[0-9]$/},A:{pattern:/^[A-Za-z]$/,transform:n=>n.toUpperCase()},"*":{pattern:/^.$/}},Bt=n=>n instanceof RegExp;function mt(n,e,l){if(n==null)return[];const r=l?{...et,...e}:e??et,o=(a,h)=>{const p=r[h];p?a.push({type:"pattern",name:h,...p}):a.push({type:"literal",char:h})},m=[];if(typeof n=="string"){for(const a of n)o(m,a);return m}for(const a of n)if(typeof a=="string")if(a.length<=1)o(m,a);else for(const h of a)o(m,h);else Bt(a)?m.push({type:"pattern",pattern:a}):typeof a=="object"&&a&&m.push(a);return m}function Mt(n,e){return l=>{switch(n){case"digits":return/[0-9]/.test(l);case"letters":return/[A-Za-z]/.test(l);case"alphanumeric":return/[A-Za-z0-9]/.test(l);case"custom":return e?.(l)??!0;default:return!0}}}function nt(n,e,l,r,o,m){const a={raw:n,previousConformed:e,cursor:o??n.length,completed:!1},h=r.definitions??{},p=typeof l=="function"?l(n,a):l,b=mt(p,h,r.useDefaultDefinitions??!0),f=Mt(r.allowMode,r.allow),d=new Set;for(const y of b)y.type==="literal"&&d.add(y.char);if(r.prefix)for(const y of r.prefix)d.add(y);if(r.suffix)for(const y of r.suffix)d.add(y);const v=Array.from(n).filter(y=>f(y)&&!d.has(y));if(v.length===0)return{value:"",cursor:0,completed:!1};const s=[],u=[];let V=0,_=0,c=0,g=-1;for(const y of b){if(y.type==="literal"){s.push(y.char),u.push({kind:"literal",filled:!0});continue}_+=y.optional?0:1;const U=v[V];if(U==null)break;if(y.type==="any"){c++,s.push(y.transform?y.transform(U):U),u.push({kind:"slot",filled:!0}),g=u.length-1,V++;continue}if(y.type==="pattern")if(y.pattern.test(U)){c++;const T=y.transform?y.transform(U):U;s.push(T),u.push({kind:"slot",filled:!0}),g=u.length-1,V++}else{V++;continue}}const k=s.join(""),w=(r.prefix??"")+k+(r.suffix??"");let I=(r.prefix??"").length;if(g>=0){let y=g+1;if((m?.policy??"smart")!=="sticky")for(;y<u.length&&u[y].kind==="literal";)y++;I+=y}const i=r.completion?.mode==="min"?(r.completion.minChars??0)<=c:r.completion?.mode==="custom"?!!r.completion.isComplete?.(w):_>0&&c>=_,x=r.pipe?.(w,{...a,completed:i});let D,E=I;return x===!1?(D=e,E=e.length):typeof x=="string"?(D=x,E=x.length):typeof x=="object"&&x?(D=x.value,E=x.cursor??x.value.length):D=w,{value:D,cursor:E,completed:i}}function Tt(n,e){const l=e?.strategy??"none";return l==="custom"&&e?.unmask?e.unmask(n):l==="strip"?n.replace(/[^A-Za-z0-9]/g,""):n}const X=n=>{const{value:e,onBlur:l,onChange:r,onInput:o,onAccept:m,onComplete:a,mask:h,definitions:p,useDefaultDefinitions:b,extraLiterals:f,prefix:d,suffix:v,autofix:s,pipe:u,completion:V,unmask:_,allowMode:c,allow:g,placeholder:k,placeholderOptions:w}=n,O=t.computedOf(e,h,p,b,f,d,v,s,V,_,c,k,w)((i,x,D,E,y,U,T,N,W,L,A,R,S)=>x?nt(i??"","",x,{definitions:D??{},useDefaultDefinitions:E??!0,extraLiterals:y??[],autofix:N??"none",completion:W??{mode:"mask"},pipe:u??(B=>B),unmask:L??{strategy:"none"},allowMode:A??"all",allow:g,prefix:U,suffix:T}).value:i??""),I=(i,x)=>{const D=i.value??"",E=t.Value.get(e)??"",y=h!=null?t.Value.get(h):null,U=p!=null?t.Value.get(p):void 0,T=b!=null?t.Value.get(b):void 0,N=f!=null?t.Value.get(f):void 0,W=s!=null?t.Value.get(s):void 0,L=V!=null?t.Value.get(V):void 0,A=_!=null?t.Value.get(_):void 0,R=c!=null?t.Value.get(c):void 0,S=d!=null?t.Value.get(d):void 0,B=v!=null?t.Value.get(v):void 0,{value:F,cursor:Z,completed:K}=y?nt(D,E,y,{definitions:U??{},useDefaultDefinitions:T??!0,extraLiterals:N??[],autofix:W??"none",completion:L??{mode:"mask"},pipe:u??(xt=>xt),unmask:A??{strategy:"none"},allowMode:R??"all",allow:g,prefix:S,suffix:B},i.selectionStart??D.length,n.cursor?t.Value.get(n.cursor):void 0):{value:D,cursor:D.length,completed:!0};if(F!==D){i.value=F;try{i.setSelectionRange(Z,Z)}catch{}}const tt=Tt(F,A);m?.({raw:tt,conformed:F,completed:K,cursor:Z}),x==="input"?o?.(F):(r?.(F),K&&a?.({raw:tt,conformed:F}))};return M.InputContainer({...n,input:t.input.text(z.CommonInputAttributes(n),t.attr.value(O),t.attr.class("bc-input"),l!=null?t.on.blur(l):t.Empty,t.WithElement(i=>i instanceof HTMLInputElement?t.Fragment(t.on.input(()=>I(i,"input")),t.on.change(()=>I(i,"change")),t.on.keydown(x=>{if(x.key!=="Backspace"||!(n.cursor?t.Value.get(n.cursor)?.backspaceRubberBand??!0:!0))return;const E=i.selectionStart??0,y=i.selectionEnd??E;if(E!==y||E<=0)return;const U=i.value??"",T=h!=null?t.Value.get(h):null;if(!T)return;const N=p!=null?t.Value.get(p):void 0,W=b!=null?t.Value.get(b):!0,L=d!=null?t.Value.get(d):void 0,A=v!=null?t.Value.get(v):void 0,R=mt(typeof T=="function"?T(U,{raw:U,previousConformed:U,cursor:E,completed:!1}):T,N??{},W??!0),S=new Set;for(const B of R)B.type==="literal"&&S.add(B.char);if(L)for(const B of L)S.add(B);if(A)for(const B of A)S.add(B);if(S.has(U[E-1])){let B=E-1;for(;B>=0&&S.has(U[B]);)B--;B>=0&&(x.preventDefault(),x.stopPropagation(),i.value=U.slice(0,B)+U.slice(B+1),I(i,"input"))}})):t.Empty))})};function Q(n,e,l){const r=t.Value.map(n,a=>a!=null),o=t.computedOf(r,e??!1)((a,h)=>!a||h),m=C.defaultMessages.clearValue;return t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__reset"),t.aria.label(m),t.attr.title(m),t.attr.disabled(o),C.Icon({icon:"mdi:close",size:"sm"}),t.on.click(a=>{a.stopPropagation(),l?.(null)}))}const St=n=>{const{value:e,onBlur:l,onChange:r,onInput:o,rows:m}=n;return M.InputContainer({baseContainer:!0,...n,input:t.html.textarea(t.attr.class(t.computedOf(n.size??"md")(a=>M.generateInputContainerInputClasses(!1,a??"md"))),z.CommonInputAttributes(n),t.attr.rows(m??3),t.attr.value(e),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,r!=null?t.on.change(t.emitValue(r)):t.Empty,o!=null?t.on.input(t.emitValue(o)):t.Empty)})},At=n=>{const{value:e,step:l,min:r,max:o,onBlur:m,onChange:a,onInput:h,after:p}=n,b=v=>{const s=r!=null?t.Value.get(r):void 0,u=o!=null?t.Value.get(o):void 0;return s!=null&&v<s?s:u!=null&&v>u?u:v},f=l!=null?t.Use(C.BeatUII18n,v=>{const s=t.computedOf(e,r)((c,g)=>g==null?!0:(c??0)>g),u=t.computedOf(e,o)((c,g)=>g==null?!0:(c??0)<g),V=c=>{const g=t.Value.get(e)??0,k=t.Value.get(l),w=c?.shiftKey?10:1,O=g-k*w,I=r!=null?t.Value.get(r):void 0;if(I!=null&&O<I)return;const i=b(O);i!==g&&a&&a(i)},_=c=>{const g=t.Value.get(e)??0,k=t.Value.get(l),w=c?.shiftKey?10:1,O=g+k*w,I=o!=null?t.Value.get(o):void 0;if(I!=null&&O>I)return;const i=b(O);i!==g&&a&&a(i)};return at.Stack(t.attr.class("bc-number-input-steppers"),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(u,n.disabled??!1)((c,g)=>!c||g)),t.on.click(c=>_(c)),t.aria.label(v.$.incrementValue),C.Icon({icon:"line-md:plus",size:"xs"})),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"),t.attr.disabled(t.computedOf(s,n.disabled??!1)((c,g)=>!c||g)),t.on.click(c=>V(c)),t.aria.label(v.$.decrementValue),C.Icon({icon:"line-md:minus",size:"xs"})))}):null,d=p!=null&&f!=null?t.Fragment(f,p):p??f;return M.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,o!=null?t.attr.max(o):t.Empty,z.CommonInputAttributes(n),t.attr.valueAsNumber(e),t.attr.step(l),t.attr.class("bc-input bc-number-input"),m!=null?t.on.blur(t.emitValue(m)):t.Empty,a!=null?t.on.change(t.emitValueAsNumber(a)):t.Empty,h!=null?t.on.input(t.emitValueAsNumber(h)):t.Empty,l!=null?t.on.wheel(v=>{v.preventDefault();const s=t.Value.get(e)??0,u=t.Value.get(l),V=v.shiftKey?10:1,_=v.deltaY<0?u*V:-u*V,c=b(s+_);c!==s&&a&&a(c)}):t.Empty),after:d})},lt=n=>{if(n==null||n==="")return null;const e=Number(n);return Number.isNaN(e)?null:e},Ft=n=>{const{value:e,step:l,min:r,max:o,onBlur:m,onChange:a,onInput:h,after:p}=n,b=s=>{const u=r!=null?t.Value.get(r):void 0,V=o!=null?t.Value.get(o):void 0;return u!=null&&s<u?u:V!=null&&s>V?V:s},f=(()=>{if(l==null)return null;const s=t.computedOf(e,r)((g,k)=>{const w=g??0;return k==null?!0:w>k}),u=t.computedOf(e,o)((g,k)=>{const w=g??0;return k==null?!0:w<k}),V=g=>{const k=t.Value.get(e)??0,w=t.Value.get(l),O=g?.shiftKey?10:1,I=k-w*O,i=r!=null?t.Value.get(r):void 0;if(i!=null&&I<i)return;const x=b(I);x!==k&&a&&a(x)},_=g=>{const k=t.Value.get(e)??0,w=t.Value.get(l),O=g?.shiftKey?10:1,I=k+w*O,i=o!=null?t.Value.get(o):void 0;if(i!=null&&I>i)return;const x=b(I);x!==k&&a&&a(x)};return((g,k)=>at.Stack(t.attr.class("bc-number-input-steppers"),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(u,n.disabled??!1)((w,O)=>!w||O)),t.on.click(w=>_(w)),t.aria.label(g),C.Icon({icon:"line-md:plus",size:"xs"})),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"),t.attr.disabled(t.computedOf(s,n.disabled??!1)((w,O)=>!w||O)),t.on.click(w=>V(w)),t.aria.label(k),C.Icon({icon:"line-md:minus",size:"xs"}))))(C.defaultMessages.incrementValue,C.defaultMessages.decrementValue)})(),d=Q(e,n.disabled,a??h),v=p!=null&&f!=null?t.Fragment(f,d,p):p!=null?t.Fragment(d,p):f!=null?t.Fragment(f,d):d;return M.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,o!=null?t.attr.max(o):t.Empty,z.CommonInputAttributes(n),t.attr.value(t.Value.map(e,s=>s==null?"":String(s))),t.attr.step(l),t.attr.class("bc-input bc-number-input"),m!=null?t.on.blur(t.emitValue(m)):t.Empty,a!=null?t.on.change(t.emitValue(s=>{const u=lt(s);a(u)})):t.Empty,h!=null?t.on.input(t.emitValue(s=>{const u=lt(s);h(u)})):t.Empty,l!=null?t.on.wheel(s=>{s.preventDefault();const u=t.Value.get(e)??0,V=t.Value.get(l),_=s.shiftKey?10:1,c=s.deltaY<0?V*_:-V*_,g=b(u+c);g!==u&&a&&a(g)}):t.Empty),after:v})},zt=n=>{const e={type:"pattern",pattern:/[0-9A-Fa-f]/,transform:r=>r.toLowerCase()};return X({...n,mask:[e,e,e,e,e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,e,e,e,e,e,e,e,e],placeholder:n.placeholder??"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"})},Lt=/^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i,Nt=/^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;function ht(n){return{mask:null,allowMode:"custom",allow:e=>/[0-9ptwdhms]/i.test(e),pipe:e=>{const l=e.toUpperCase();return l.length===0?l:!l.startsWith("P")||!Lt.test(l)?!1:l},completion:{mode:"custom",isComplete:e=>{const l=e.toUpperCase();if(!Nt.test(l))return!1;try{return n(l),!0}catch{return!1}}}}}const rt=(n,e)=>{if(n==null)return null;try{return n.Duration.from(e)}catch{return null}},Wt=n=>{const{value:e,onChange:l,onInput:r,after:o,disabled:m,onBlur:a}=n,h=()=>{const f=Q(e,m,l??r);return o!=null?t.Fragment(f,o):f},p=n.placeholder!=null?t.Empty:t.attr.placeholder("P0DT0H0M0S");return st(f=>X({...n,value:t.Value.map(e,d=>d?.toString()??""),onChange:l?d=>l(d===""?null:f.Duration.from(d)):void 0,onInput:void 0,...ht(f.Duration.from),placeholder:"P0DT0H0M0S",after:h()}),{pending:()=>{const f=d=>v=>{const u=v.currentTarget?.value??"";if(u===""){d(null);return}const V=globalThis.Temporal,_=rt(V,u);if(_!=null){d(_);return}q().then(c=>{const g=rt(c,u);g!=null&&d(g)}).catch(()=>{})};return M.InputContainer({...n,input:t.input.text(z.CommonInputAttributes(n),t.attr.value(t.Value.map(e,d=>d?.toString()??"")),t.attr.class("bc-input"),p,a!=null?t.on.blur(()=>a()):t.Empty,l!=null?t.on.change(f(l)):t.Empty,r!=null?t.on.input(f(r)):t.Empty),after:h()})}})},Rt=n=>{const{value:e,onBlur:l,onChange:r,onInput:o}=n;return M.InputContainer({...n,input:t.input.url(z.CommonInputAttributes(n),t.attr.value(e),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,r!=null?t.on.change(t.emitValue(r)):t.Empty,o!=null?t.on.input(t.emitValue(o)):t.Empty)})};function bt(n,e){const{onMove:l,cannotMoveUp:r,cannotMoveDown:o,onRemove:m,showMove:a=!0,showRemove:h=!0,removeDisabled:p,showMoveButtons:b=!0,layout:f="aside"}=n,d=t.Value.toSignal(f).map(u=>u==="aside"),v=t.When(a,()=>t.html.div(t.attr.class("bc-list-item-controls__move"),M.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>l("up"),disabled:r},t.Use(C.BeatUII18n,u=>C.Icon({size:"xs",icon:"line-md:arrow-up",title:u.$.incrementValue}))),M.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>l("down"),disabled:o},t.Use(C.BeatUII18n,u=>C.Icon({size:"xs",icon:"line-md:arrow-down",title:u.$.decrementValue}))))),s=t.When(h,()=>t.Use(C.BeatUII18n,u=>$.CloseButton({size:"xs",label:t.Value.map(u.$.removeItem,V=>V.toLowerCase()),color:"danger",disabled:p,onClick:m})));return t.When(d,()=>t.html.div(t.attr.class("bc-list-item-controls bc-list-item-controls--aside"),t.html.div(t.attr.class("bc-list-item-controls__content"),e),t.html.div(t.attr.class("bc-list-item-controls__actions"),t.When(b,()=>v),s)),()=>t.html.div(t.attr.class("bc-list-item-controls bc-list-item-controls--below"),t.html.div(t.attr.class("bc-list-item-controls__content"),e),t.html.div(t.attr.class("bc-list-item-controls__actions"),t.When(b,()=>v,()=>t.html.div()),s)))}const gt=n=>{const{controller:e,element:l,separator:r,showMove:o=!0,showRemove:m=!0,showAdd:a=!0,createItem:h,addLabel:p,controlsLayout:b="aside",removeDisabled:f,addDisabled:d}=n,v=t.When(t.computedOf(a,h)((s,u)=>s&&u!=null),()=>G(t.attr.class("bc-group--gap-2 bc-group--align-center bc-group--justify-center"),M.Button({size:"sm",variant:"filled",onClick:()=>e.push(h()),disabled:t.computedOf(e.disabled,d??!1)((s,u)=>s||u)},t.Use(C.BeatUII18n,s=>G(t.attr.class("bc-group--gap-2"),C.Icon({icon:"line-md:plus"}),p??s.$.addLabel)))));return t.Fragment(dt(e,s=>bt({onMove:s.move,cannotMoveUp:s.cannotMove("up"),cannotMoveDown:s.cannotMove("down"),onRemove:s.remove,showMove:o,showRemove:m,removeDisabled:f,showMoveButtons:e.signal.map(u=>u.length>1),layout:b},l(s)),r),v)},Pt=(n,...e)=>{const{controller:l,element:r,separator:o,showMove:m,showRemove:a,showAdd:h,createItem:p,addLabel:b,controlsLayout:f,removeDisabled:d,addDisabled:v,...s}=n;return $.InputWrapper({...s,content:gt({controller:l,element:r,separator:o,showMove:m,showRemove:a,showAdd:h,createItem:p,addLabel:b,controlsLayout:f,removeDisabled:d,addDisabled:v})},...e)};class jt extends $.Controller{branches;activeBranch;#e;#t=new Map;constructor(e,l,r,o,m,a,h=$.O){super(e,l,r,o,m,h),this.branches=a;const p=f=>{for(const d of a)if(d.detect(f))return d.key;return a[0]?.key??"unknown"};this.activeBranch=r.map(p,$.O);const b=f=>{if(this.#t.has(f))return this.#t.get(f);const d=a.find(s=>s.key===f);if(!d)throw new Error(`Unknown branch: ${f}`);const v=new $.Controller([...e,f],s=>{this.change(s)},this.signal.map(s=>d.detect(s)?s:d.defaultValue(),h),o.map($.makeMapValidation([f])),{disabled:this.disabled,validationMode:this.parent.validationMode},h);return this.#t.set(f,v),v};this.#e=this.activeBranch.map(f=>b(f),$.O),this.onDispose(()=>{for(const f of this.#t.values())f.dispose();this.#t.clear(),this.activeBranch.dispose(),this.#e.dispose()})}get activeController(){return t.Value.get(this.#e)}getBranchController(e){const l=this.branches.find(o=>o.key===e);if(!l)throw new Error(`Unknown branch: ${e}`);if(this.#t.has(e))return this.#t.get(e);const r=new $.Controller([...this.path,e],o=>{this.change(o)},this.signal.map(o=>l.detect(o)?o:l.defaultValue(),$.O),this.status.map($.makeMapValidation([e])),{disabled:this.disabled,validationMode:this.parent.validationMode},$.O);return this.#t.set(e,r),r}switchToBranch(e,l=!1){const r=this.branches.find(a=>a.key===e);if(!r)throw new Error(`Unknown branch: ${e}`);const o=t.Value.get(this.signal);if(r.detect(o))return!0;if(r.convert){const a=r.convert(o);if(a.ok)return this.change(a.value),!0}if(l&&typeof window=="object"&&typeof window.confirm=="function"&&!window.confirm(C.defaultMessages.changeTypeConfirmation))return!1;const m=r.defaultValue();return this.change(m),!0}get activeBranchDefinition(){const e=t.Value.get(this.activeBranch);return this.branches.find(l=>l.key===e)}}function qt(n){return n.transform(e=>e??null,e=>e??void 0)}function Zt(n){return n.transform(e=>e??"",e=>e===""?void 0:e)}function Ht(n){return n.transform(e=>e??void 0,e=>e??null)}function P(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.prototype.toString.call(n)==="[object Object]"}function vt(n,e){if(e==null)return ot(n);if(n==null)return e;if(P(n)&&P(e)){const l={...e};for(const r of Object.keys(n))l[r]===void 0?l[r]=ot(n[r]):P(n[r])&&P(l[r])&&(l[r]=vt(n[r],l[r]));return l}return e}function ot(n){return typeof structuredClone=="function"?structuredClone(n):JSON.parse(JSON.stringify(n))}exports.BaseListControl=gt;exports.BaseNativeSelectControl=ft;exports.Expando=it;exports.FilesInput=Ut;exports.Group=G;exports.ListControl=Pt;exports.ListInput=dt;exports.ListItemControls=bt;exports.MaskInput=X;exports.NativeSelect=pt;exports.NativeSelectControl=$t;exports.NullableDurationInput=Wt;exports.NullableNumberInput=Ft;exports.NullableResetAfter=Q;exports.NumberInput=At;exports.SegmentedInput=kt;exports.TextArea=St;exports.UUIDInput=zt;exports.UnionController=jt;exports.UnstyledDropZone=j;exports.UrlInput=Rt;exports.WithTemporal=st;exports.deepMergeDefaults=vt;exports.durationMaskConfig=ht;exports.emitExpando=Ot;exports.emitOptionExpando=ut;exports.ensureTemporal=q;exports.transformEmptyStringToUndefined=Zt;exports.transformNullToUndefined=qt;exports.transformUndefinedToNull=Ht;
|