@tempots/beatui 0.78.0 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +68 -68
- package/dist/beatui.css +127 -7
- package/dist/beatui.tailwind.css +127 -7
- package/dist/{deep-merge-Cjm-tFVT.js → deep-merge-Bsqkvp9-.js} +2 -2
- package/dist/{deep-merge-BoJqJNah.cjs → deep-merge-cQgRrtGF.cjs} +1 -1
- package/dist/{duration-input-DfdE7_V9.js → duration-input-DcZf0Dyd.js} +2 -2
- package/dist/{duration-input-COTlyMwv.cjs → duration-input-Dt6riwzu.cjs} +1 -1
- package/dist/hls.light.min-Bhrf47iR.cjs +27 -0
- package/dist/{hls.light.min-BHW1Af0w.js → hls.light.min-C6VwviEa.js} +1095 -1087
- package/dist/{index-ByWYsYVI.cjs → index-BGwNJNop.cjs} +19 -19
- package/dist/{index-DKl26ILa.js → index-CCMjK4fD.js} +1 -1
- package/dist/{index-D5kPtj3r.cjs → index-CdVc1Y2V.cjs} +1 -1
- package/dist/{index-BSl-AmDV.js → index-Dbu1ZPpw.js} +1095 -1044
- package/dist/{index-wPyoqxuj.js → index-DiEcd7ZV.js} +2 -6
- package/dist/{index-Ck1DAzZ9.js → index-mPVib4v9.js} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +12 -12
- package/dist/index.esm-C6lZ02yY.cjs +1 -0
- package/dist/{index.esm-DPNh6inz.js → index.esm-ChUrm4xR.js} +80 -80
- package/dist/json-schema/index.cjs.js +8 -8
- package/dist/json-schema/index.es.js +5056 -5000
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +3 -3
- package/dist/markdown/index.es.js +1 -1
- package/dist/{modal-CwDATZfz.cjs → modal-D3NQ6ZgO.cjs} +1 -1
- package/dist/{modal-CkcwBTk2.js → modal-oWbT46Rc.js} +1 -1
- package/dist/monaco/index.cjs.js +2 -2
- package/dist/monaco/index.es.js +6 -8
- package/dist/{notice-CQ1Vx-z1.js → notice-C0Brmeyi.js} +1 -1
- package/dist/{notice-Bs90dF7k.cjs → notice-DYBLXglS.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{use-form-D3EXhCfe.js → use-form-DMiCxK26.js} +2 -2
- package/dist/{use-form-C5eF9ALX.cjs → use-form-pSErMD6z.cjs} +1 -1
- package/dist/{widget-customization-Czt9chmX.cjs → widget-customization-WNWmH_gX.cjs} +1 -1
- package/dist/{widget-customization-BB1gYtwq.js → widget-customization-nxbAoCx5.js} +3 -3
- package/package.json +10 -10
- package/dist/hls.light.min-D3hUMpII.cjs +0 -27
- package/dist/index.esm-DJRz9AE-.cjs +0 -1
package/dist/beatui.tailwind.css
CHANGED
|
@@ -1485,7 +1485,7 @@ a:focus-visible {
|
|
|
1485
1485
|
justify-content: center;
|
|
1486
1486
|
background-color: var(--color-white);
|
|
1487
1487
|
border-radius: var(--radius-full);
|
|
1488
|
-
padding: calc(var(--spacing-base) *
|
|
1488
|
+
padding: calc(var(--spacing-base) * 1);
|
|
1489
1489
|
}
|
|
1490
1490
|
|
|
1491
1491
|
.b-dark .bc-social-login-button__icon {
|
|
@@ -1509,24 +1509,144 @@ a:focus-visible {
|
|
|
1509
1509
|
padding-inline: calc(var(--spacing-base) * 4);
|
|
1510
1510
|
}
|
|
1511
1511
|
|
|
1512
|
+
/* Provider-specific icon backgrounds and colors */
|
|
1513
|
+
|
|
1514
|
+
/* Google - colorful logo needs white background */
|
|
1512
1515
|
.bc-social-login-button--google .bc-social-login-button__icon {
|
|
1513
1516
|
background-color: var(--color-white);
|
|
1514
1517
|
}
|
|
1515
1518
|
|
|
1519
|
+
/* GitHub - black icon needs contrasting background */
|
|
1516
1520
|
.bc-social-login-button--github .bc-social-login-button__icon {
|
|
1517
|
-
background-color: var(--color-
|
|
1521
|
+
background-color: var(--color-white);
|
|
1518
1522
|
}
|
|
1519
1523
|
|
|
1520
|
-
|
|
1521
|
-
|
|
1524
|
+
/* Apple - black icon needs contrasting background */
|
|
1525
|
+
.bc-social-login-button--apple .bc-social-login-button__icon {
|
|
1526
|
+
background-color: var(--color-white);
|
|
1522
1527
|
}
|
|
1523
1528
|
|
|
1524
|
-
|
|
1529
|
+
/* X (Twitter rebrand) - black icon needs contrasting background */
|
|
1530
|
+
.bc-social-login-button--x .bc-social-login-button__icon {
|
|
1531
|
+
background-color: var(--color-white);
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
/* Microsoft - colorful logo needs white background */
|
|
1535
|
+
.bc-social-login-button--microsoft .bc-social-login-button__icon {
|
|
1536
|
+
background-color: var(--color-white);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
/* Steam - dark icon needs contrasting background */
|
|
1540
|
+
.bc-social-login-button--steam .bc-social-login-button__icon {
|
|
1541
|
+
background-color: var(--color-white);
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
/* Epic Games - simple-icons, dark icon on white background */
|
|
1545
|
+
.bc-social-login-button--epic .bc-social-login-button__icon {
|
|
1546
|
+
background-color: var(--color-white);
|
|
1547
|
+
}
|
|
1548
|
+
.bc-social-login-button--epic .bc-social-login-button__icon-inner {
|
|
1549
|
+
color: var(--color-black);
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
/* PlayStation - simple-icons, blue icon on white background */
|
|
1553
|
+
.bc-social-login-button--playstation .bc-social-login-button__icon {
|
|
1554
|
+
background-color: var(--color-white);
|
|
1555
|
+
}
|
|
1556
|
+
.bc-social-login-button--playstation .bc-social-login-button__icon-inner {
|
|
1557
|
+
color: #003791;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
/* Xbox - simple-icons, green icon on white background */
|
|
1561
|
+
.bc-social-login-button--xbox .bc-social-login-button__icon {
|
|
1562
|
+
background-color: var(--color-white);
|
|
1563
|
+
}
|
|
1564
|
+
.bc-social-login-button--xbox .bc-social-login-button__icon-inner {
|
|
1565
|
+
color: #107c10;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
/* TikTok - has dark elements that need contrasting background */
|
|
1569
|
+
.bc-social-login-button--tiktok .bc-social-login-button__icon {
|
|
1570
|
+
background-color: var(--color-white);
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
/* Snapchat - simple-icons, yellow icon on black background */
|
|
1574
|
+
.bc-social-login-button--snapchat .bc-social-login-button__icon {
|
|
1525
1575
|
background-color: var(--color-black);
|
|
1526
1576
|
}
|
|
1577
|
+
.bc-social-login-button--snapchat .bc-social-login-button__icon-inner {
|
|
1578
|
+
color: #fffc00;
|
|
1579
|
+
}
|
|
1527
1580
|
|
|
1528
|
-
|
|
1529
|
-
|
|
1581
|
+
/* Amazon - simple-icons, orange icon on white background */
|
|
1582
|
+
.bc-social-login-button--amazon .bc-social-login-button__icon {
|
|
1583
|
+
background-color: var(--color-white);
|
|
1584
|
+
}
|
|
1585
|
+
.bc-social-login-button--amazon .bc-social-login-button__icon-inner {
|
|
1586
|
+
color: #ff9900;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
/* WeChat - simple-icons, green icon on white background */
|
|
1590
|
+
.bc-social-login-button--wechat .bc-social-login-button__icon {
|
|
1591
|
+
background-color: var(--color-white);
|
|
1592
|
+
}
|
|
1593
|
+
.bc-social-login-button--wechat .bc-social-login-button__icon-inner {
|
|
1594
|
+
color: #07c160;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
/* Yahoo - purple icon needs white background for visibility */
|
|
1598
|
+
.bc-social-login-button--yahoo .bc-social-login-button__icon {
|
|
1599
|
+
background-color: var(--color-white);
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
/* PayPal - blue icon needs white background */
|
|
1603
|
+
.bc-social-login-button--paypal .bc-social-login-button__icon {
|
|
1604
|
+
background-color: var(--color-white);
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
/* Facebook - blue logo needs white background */
|
|
1608
|
+
.bc-social-login-button--facebook .bc-social-login-button__icon {
|
|
1609
|
+
background-color: var(--color-white);
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
/* Twitter - blue bird needs white background */
|
|
1613
|
+
.bc-social-login-button--twitter .bc-social-login-button__icon {
|
|
1614
|
+
background-color: var(--color-white);
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
/* Discord - purple icon works on white background */
|
|
1618
|
+
.bc-social-login-button--discord .bc-social-login-button__icon {
|
|
1619
|
+
background-color: var(--color-white);
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
/* LinkedIn - blue icon needs white background */
|
|
1623
|
+
.bc-social-login-button--linkedin .bc-social-login-button__icon {
|
|
1624
|
+
background-color: var(--color-white);
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
/* Instagram - gradient icon needs white background */
|
|
1628
|
+
.bc-social-login-button--instagram .bc-social-login-button__icon {
|
|
1629
|
+
background-color: var(--color-white);
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
/* Reddit - orange icon needs white background */
|
|
1633
|
+
.bc-social-login-button--reddit .bc-social-login-button__icon {
|
|
1634
|
+
background-color: var(--color-white);
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
/* Pinterest - red icon needs white background */
|
|
1638
|
+
.bc-social-login-button--pinterest .bc-social-login-button__icon {
|
|
1639
|
+
background-color: var(--color-white);
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
/* Twitch - purple icon needs white background */
|
|
1643
|
+
.bc-social-login-button--twitch .bc-social-login-button__icon {
|
|
1644
|
+
background-color: var(--color-white);
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
/* WhatsApp - green icon needs white background */
|
|
1648
|
+
.bc-social-login-button--whatsapp .bc-social-login-button__icon {
|
|
1649
|
+
background-color: var(--color-white);
|
|
1530
1650
|
}
|
|
1531
1651
|
|
|
1532
1652
|
/* Badge Component */
|
|
@@ -3,7 +3,7 @@ import { l as Pe } from "./colors-DPo9GEJR.js";
|
|
|
3
3
|
import { g as We } from "./timer-Rd2sKnvH.js";
|
|
4
4
|
import { ElementRect as Ze } from "@tempots/ui";
|
|
5
5
|
import { a as N, b as W, f as $e, c as O, C as Y, I as He, g as ge, h as Ye, B as pe } from "./translations-BEMKy6-W.js";
|
|
6
|
-
import { C as ce, m as qe, c as Ge, I as Ae, S as ee, d as fe, O as Q, e as De } from "./use-form-
|
|
6
|
+
import { C as ce, m as qe, c as Ge, I as Ae, S as ee, d as fe, O as Q, e as De } from "./use-form-DMiCxK26.js";
|
|
7
7
|
class Je extends Error {
|
|
8
8
|
constructor(e = "Missing implementation") {
|
|
9
9
|
super(e), this.name = "MissingImplementationError";
|
|
@@ -1178,7 +1178,7 @@ const Tt = (t) => {
|
|
|
1178
1178
|
let be = null;
|
|
1179
1179
|
async function he() {
|
|
1180
1180
|
const t = globalThis;
|
|
1181
|
-
return t.Temporal ? t.Temporal : (be || (be = import("./index.esm-
|
|
1181
|
+
return t.Temporal ? t.Temporal : (be || (be = import("./index.esm-ChUrm4xR.js").then((e) => {
|
|
1182
1182
|
const n = e.Temporal;
|
|
1183
1183
|
return t.Temporal || (t.Temporal = n), n;
|
|
1184
1184
|
})), be);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@tempots/dom"),gt=require("./colors-B2yrgHSW.cjs"),bt=require("./timer-BJHOsuS6.cjs"),vt=require("@tempots/ui"),v=require("./translations-eUtMHN9s.cjs"),$=require("./use-form-C5eF9ALX.cjs");class xt extends Error{constructor(e="Missing implementation"){super(e),this.name="MissingImplementationError"}}const yt=n=>It(n).split("_").join(" "),It=n=>(n=n.replace(/::/g,"/"),n=n.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2"),n=n.replace(/([a-z\d])([A-Z])/g,"$1_$2"),n=n.replace(/-/g,"_"),n.toLowerCase()),Vt=n=>n.substring(0,1).toUpperCase()+n.substring(1),wt=n=>{if(typeof Buffer<"u")return Buffer.from(n,"base64").toString("utf8");if(typeof atob<"u")return atob(n);throw new xt("No implementation found for base64 decoding")};function P({onChange:n,value:e,accept:l="*/*",enableClick:r=!0,content:a,disabled:h=!1,allowMultiple:o}){return t.Use(v.BeatUII18n,d=>{const p=t.Value.deriveProp(e??[]),m=t.prop(!1),u=i=>{i.preventDefault(),i.stopPropagation(),m.value=!0},g=i=>{i.preventDefault(),i.stopPropagation(),(!i.currentTarget||!i.currentTarget.contains(i.relatedTarget))&&(m.value=!1)},I=i=>{i.preventDefault(),i.stopPropagation(),m.value=!1;const f=Array.from(i.dataTransfer?.files||[]);f.length>0&&(p.value=f,n(f,"dragdrop"))},c=i=>{t.Value.get(r)&&i.currentTarget.querySelector('input[type="file"]')?.click()};let b=null;const x=()=>{if(b==null)return;const i=Array.from(b.files??[]);i.length>0&&(p.value=i,n(i,"click")),b.value=""},C=i=>{t.Value.get(r)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),c(i))};return t.html.div(t.attr.role("button"),t.attr.tabindex(t.Value.map(r,i=>i?0:-1)),t.attr.style("position: relative;"),t.on.dragover(u),t.on.dragleave(g),t.on.drop(I),t.on.click(c),t.on.keydown(C),t.html.input(t.attr.type("file"),t.attr.disabled(h),t.attr.accept(l),t.attr.multiple(o),t.attr.style("position: absolute; left: -9999px; opacity: 0; pointer-events: none;"),t.on.change(x),t.WithElement(i=>(b=i,p.on(f=>{const _=globalThis.DataTransfer;if(_!=null){const k=new _;f.forEach(O=>k.items.add(O)),i.files=k.files}}),t.Empty))),t.aria.label(t.bind(d.$.dropZoneInstructions)(r)),a({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 _t(n,e){const l=["bc-segmented-input",`bc-segmented-input--size-${n}`];return e&&l.push("bc-segmented-input--disabled"),l.join(" ")}function kt({options:n,value:e,onChange:l,size:r="md",disabled:a=!1},...h){const o=gt.l(n).map(([d,p])=>({key:d,label:p}));return t.WithElement(()=>{const d=Object.fromEntries(o.map((m,u)=>[m.key,u])),p=t.prop(o.map(()=>({left:0,width:0})),Ct);return t.html.div(t.attr.class(t.computedOf(r,a)((m,u)=>_t(m??"md",u??!1))),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,p)((m,u)=>{const{width:g}=u[d[m]??0];return`${g}px`})),t.style.left(t.computedOf(e,p)((m,u)=>{const{left:g}=u[d[m]??0];return`${g}px`}))),o.map(({label:m,key:u},g)=>t.html.button(t.attr.type("button"),t.on.click(I=>{I.preventDefault(),t.Value.get(a)||l?.(u)}),t.attr.disabled(a),t.attr.class("bc-segmented-input__segment"),t.attr.class(t.Value.map(e,I=>I===u?"bc-segmented-input__segment--active":"bc-segmented-input__segment--inactive")),vt.ElementRect(I=>{function c(){p.update(x=>{const C=[...x];return C[g]={width:I.value.width,left:I.value.localLeft},C})}const b=bt.g(c);return t.OnDispose(b,I.on(c))}),m))),...h)})}function Et(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 Dt(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 q(n){return t.When(n.map(Et),()=>{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")))},()=>v.Icon({icon:n.map(Dt)}))}const Ut=(n,...e)=>{const{value:l=t.prop([]),accept:r="*/*",maxFiles:a,maxFileSize:h,onChange:o,onBlur:d,disabled:p,hasError:m,mode:u="default",showFileList:g=!0,...I}=n,c=l,b=t.Value.map(u,w=>w==="input"),x=t.Value.map(u,w=>w==="compact"),C=w=>{let s=w;if(a!=null){const y=t.Value.get(a);s=s.slice(0,y)}if(h){const y=t.Value.get(h);s=s.filter(E=>E.size<=y)}o?.(s)},i=w=>{const y=c.value.filter((E,D)=>D!==w);o?.(y)},f=()=>{o?.([])},_=({files:w,clear:s,change:y})=>t.Use(v.BeatUII18n,E=>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"),v.Icon({icon:"mdi:cloud-upload-outline",size:"xl"}),t.html.div(t.attr.class("bc-file-input__drop-zone-text"),t.bind(E.$.filesInputInstructions)(a,h,E.$.fileSizeUnits.value))))),k=({files:w})=>t.Use(v.BeatUII18n,s=>t.html.div(t.attr.class("bc-file-input__compact-drop-zone"),t.When(w.map(y=>y.length>0),()=>t.html.div(t.attr.class("bc-file-input__compact-file-list"),t.ForEach(w,(y,E)=>{const D=E.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"),q(y)),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(y.$.name),y.$.name),t.html.div(t.attr.class("bc-file-input__compact-file-meta"),t.computedOf(y.$.size,s.$.fileSizeUnits)((V,U)=>v.formatFileSize(V,{units:U}))," • ",t.computedOf(y.$.type,s.$.unknownType)((V,U)=>V||U))),$.CloseButton({size:"sm",label:s.$.removeFile,disabled:p,onClick:()=>i(D)},t.attr.class("bc-file-input__compact-remove-button")))})),()=>t.html.div(t.attr.class("bc-file-input__compact-placeholder"),v.Icon({icon:"mdi:cloud-upload-outline",size:"lg"}),t.html.div(t.attr.class("bc-file-input__compact-placeholder-text"),t.bind(s.$.filesInputInstructions)(a,h,s.$.fileSizeUnits.value)))))),O=({files:w})=>t.Use(v.BeatUII18n,s=>t.html.div(t.attr.class("bc-file-input__compact-input"),t.When(w.map(y=>y.length>0),()=>t.html.span(t.attr.class("bc-file-input__compact-value"),t.ForEach(w,y=>t.html.span(t.attr.class("bc-file-input__compact-value-item"),q(y),t.html.span(t.attr.class("bc-file-input__compact-value-item-name"),y.$.name)))),()=>t.html.span(t.attr.class("bc-file-input__compact-placeholder"),v.Icon({icon:"mdi:cloud-upload-outline",size:"md"})," ",t.bind(s.$.filesInputInstructions)(a,h,s.$.fileSizeUnits.value)))));return t.Use(v.BeatUII18n,w=>v.InputContainer({baseContainer:t.Value.map(b,s=>!s),disabled:p,hasError:m,after:t.When(b,()=>t.When(c.map(({length:s})=>s>0),()=>$.CloseButton({size:"sm",label:w.$.clearAllFiles,disabled:p,onClick:f},t.attr.class("bc-file-input__compact-clear")))),...I,input:t.When(b,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--input"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:O})),()=>t.When(x,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--compact"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:k})),()=>t.html.div(t.attr.class("bc-file-input"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:_}),t.When(g,()=>t.NotEmpty(c,()=>t.Fragment(t.html.div(t.attr.class("bc-file-input__file-list"),t.ForEach(c,(s,y)=>{const E=y.index;return t.html.div(t.attr.class("bc-file-input__file-item"),t.html.div(t.attr.class("bc-file-input__file-icon"),q(s)),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(s.$.name),s.$.name),t.html.div(t.attr.class("bc-file-input__file-meta"),t.computedOf(s.$.size,w.$.fileSizeUnits)((D,V)=>v.formatFileSize(D,{units:V}))," • ",t.computedOf(s.$.type,w.$.unknownType)((D,V)=>D||V))),$.CloseButton({size:"sm",label:w.$.removeFile,disabled:p,onClick:()=>i(E)},t.attr.class("bc-file-input__remove-button")))})),t.When(c.map(({length:s})=>s>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),w.$.clearAllFiles,t.on.click(s=>{s.preventDefault(),s.stopPropagation(),f()}))))))))))},...e))},Y="$$tts-exp-",rt=(n,e)=>t.WithElement(l=>{const r=`${Y}${n}`;return t.OnDispose(t.Value.on(e,a=>Reflect.set(l,r,a)))}),$t=(n,e)=>{const l=`${Y}${n}`;return r=>{e(Reflect.get(r.target,l))}},at=(n,e)=>{const l=`${Y}${n}`;return r=>{const a=r.target,h=a.selectedIndex,o=a.options[h];e(Reflect.get(o,l))}};function N(...n){return t.html.div(t.attr.class("bc-group"),...n)}const ot=(n,e,l)=>t.Ensure(n,r=>t.OneOfType(r,{value:a=>{const h=t.computedOf(a,l)((o,d)=>e(o.value,d));return t.html.option(t.attr.selected(h),rt("value",a.$.value),a.$.label)},group:a=>t.html.optgroup(t.attr.label(a.$.group),t.ForEach(a.$.options,h=>ot(h,e,l))),break:()=>t.html.hr()})),st=n=>{const{value:e,onBlur:l,onChange:r,options:a,unselectedLabel:h,equality:o=(m,u)=>m===u,after:d}=n;let p;return v.InputContainer({...n,after:t.Fragment(v.InputIcon({icon:"ph:caret-down-bold",color:"neutral",size:"sm"}),d),input:t.html.select(t.WithElement(m=>{p=m;const u=new MutationObserver(g=>{const{removedNodes:I}=g[0];I.length>0&&(p.selectedIndex=0)});return u.observe(m,{childList:!0}),t.OnDispose(()=>u.disconnect())}),v.CommonInputAttributes(n),t.attr.class("bc-native-select bc-input"),t.Use(v.BeatUII18n,m=>t.html.option(t.attr.hidden("hidden"),t.coalesce(h,m.$.selectOne))),t.ForEach(a,m=>ot(m,o,e)),l!=null?t.on.blur(l):t.Empty,r!=null?t.on.change(at("value",m=>r(m))):t.Empty)},t.on.click(()=>{if(p?.focus(),typeof p?.showPicker=="function")try{p.showPicker()}catch{}}))};function it(n){const{controller:e,onChange:l,onBlur:r,...a}=n;return st({...a,value:e.signal,onChange:$.makeOnChangeHandler(e,l),onBlur:$.makeOnBlurHandler(e,r)})}function Ot(n){return $.InputWrapper({...n,content:it(n)})}function ut(n,e,l){const r=n.length.map(a=>a);return t.Fragment(t.Repeat(r,a=>{const h=n.item(a.index),o=[];return t.Fragment(t.OnDispose(()=>{o.forEach(d=>d())}),e({list:n,item:h,position:a,remove:()=>n.removeAt(a.index),move:d=>{switch(d){case"up":if(a.index===0)return;n.move(a.index,a.index-1);break;case"down":if(a.index===n.length.value-1)return;n.move(a.index,a.index+1);break;case"first":n.move(a.index,0);break;case"last":n.move(a.index,n.length.value-1)}},canMove:d=>{const p=(()=>{switch(d){case"up":return t.signal(a.index>0);case"down":return n.length.map(m=>a.index<m-1)}})();return o.push(()=>p.dispose()),p},cannotMove:d=>{const p=(()=>{switch(d){case"up":return t.signal(a.index===0);case"down":return n.length.map(m=>a.index===m-1)}})();return o.push(()=>p.dispose()),p}}))},l))}const K={9:{pattern:/^[0-9]$/},A:{pattern:/^[A-Za-z]$/,transform:n=>n.toUpperCase()},"*":{pattern:/^.$/}},Bt=n=>n instanceof RegExp;function ct(n,e,l){if(n==null)return[];const r=l?{...K,...e}:e??K,a=(o,d)=>{const p=r[d];p?o.push({type:"pattern",name:d,...p}):o.push({type:"literal",char:d})},h=[];if(typeof n=="string"){for(const o of n)a(h,o);return h}for(const o of n)if(typeof o=="string")if(o.length<=1)a(h,o);else for(const d of o)a(h,d);else Bt(o)?h.push({type:"pattern",pattern:o}):typeof o=="object"&&o&&h.push(o);return h}function St(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 tt(n,e,l,r,a,h){const o={raw:n,previousConformed:e,cursor:a??n.length,completed:!1},d=r.definitions??{},p=typeof l=="function"?l(n,o):l,m=ct(p,d,r.useDefaultDefinitions??!0),u=St(r.allowMode,r.allow),g=new Set;for(const V of m)V.type==="literal"&&g.add(V.char);if(r.prefix)for(const V of r.prefix)g.add(V);if(r.suffix)for(const V of r.suffix)g.add(V);const I=Array.from(n).filter(V=>u(V)&&!g.has(V));if(I.length===0)return{value:"",cursor:0,completed:!1};const c=[],b=[];let x=0,C=0,i=0,f=-1;for(const V of m){if(V.type==="literal"){c.push(V.char),b.push({kind:"literal",filled:!0});continue}C+=V.optional?0:1;const U=I[x];if(U==null)break;if(V.type==="any"){i++,c.push(V.transform?V.transform(U):U),b.push({kind:"slot",filled:!0}),f=b.length-1,x++;continue}if(V.type==="pattern")if(V.pattern.test(U)){i++;const S=V.transform?V.transform(U):U;c.push(S),b.push({kind:"slot",filled:!0}),f=b.length-1,x++}else{x++;continue}}const _=c.join(""),k=(r.prefix??"")+_+(r.suffix??"");let w=(r.prefix??"").length;if(f>=0){let V=f+1;if((h?.policy??"smart")!=="sticky")for(;V<b.length&&b[V].kind==="literal";)V++;w+=V}const s=r.completion?.mode==="min"?(r.completion.minChars??0)<=i:r.completion?.mode==="custom"?!!r.completion.isComplete?.(k):C>0&&i>=C,y=r.pipe?.(k,{...o,completed:s});let E,D=w;return y===!1?(E=e,D=e.length):typeof y=="string"?(E=y,D=y.length):typeof y=="object"&&y?(E=y.value,D=y.cursor??y.value.length):E=k,{value:E,cursor:D,completed:s}}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 G=n=>{const{value:e,onBlur:l,onChange:r,onInput:a,onAccept:h,onComplete:o,mask:d,definitions:p,useDefaultDefinitions:m,extraLiterals:u,prefix:g,suffix:I,autofix:c,pipe:b,completion:x,unmask:C,allowMode:i,allow:f,placeholder:_,placeholderOptions:k}=n,O=t.computedOf(e,d,p,m,u,g,I,c,x,C,i,_,k)((s,y,E,D,V,U,S,M,L,z,A,W,T)=>y?tt(s??"","",y,{definitions:E??{},useDefaultDefinitions:D??!0,extraLiterals:V??[],autofix:M??"none",completion:L??{mode:"mask"},pipe:b??(B=>B),unmask:z??{strategy:"none"},allowMode:A??"all",allow:f,prefix:U,suffix:S}).value:s??""),w=(s,y)=>{const E=s.value??"",D=t.Value.get(e)??"",V=d!=null?t.Value.get(d):null,U=p!=null?t.Value.get(p):void 0,S=m!=null?t.Value.get(m):void 0,M=u!=null?t.Value.get(u):void 0,L=c!=null?t.Value.get(c):void 0,z=x!=null?t.Value.get(x):void 0,A=C!=null?t.Value.get(C):void 0,W=i!=null?t.Value.get(i):void 0,T=g!=null?t.Value.get(g):void 0,B=I!=null?t.Value.get(I):void 0,{value:F,cursor:Z,completed:X}=V?tt(E,D,V,{definitions:U??{},useDefaultDefinitions:S??!0,extraLiterals:M??[],autofix:L??"none",completion:z??{mode:"mask"},pipe:b??(ht=>ht),unmask:A??{strategy:"none"},allowMode:W??"all",allow:f,prefix:T,suffix:B},s.selectionStart??E.length,n.cursor?t.Value.get(n.cursor):void 0):{value:E,cursor:E.length,completed:!0};if(F!==E){s.value=F;try{s.setSelectionRange(Z,Z)}catch{}}const Q=Tt(F,A);h?.({raw:Q,conformed:F,completed:X,cursor:Z}),y==="input"?a?.(F):(r?.(F),X&&o?.({raw:Q,conformed:F}))};return t.Fragment(v.InputContainer({...n,input:t.input.text(v.CommonInputAttributes(n),t.attr.value(O),t.attr.class("bc-input"),l!=null?t.on.blur(l):t.Empty,t.WithElement(s=>s instanceof HTMLInputElement?t.Fragment(t.on.input(()=>w(s,"input")),t.on.change(()=>w(s,"change")),t.on.keydown(y=>{if(y.key!=="Backspace"||!(n.cursor?t.Value.get(n.cursor)?.backspaceRubberBand??!0:!0))return;const D=s.selectionStart??0,V=s.selectionEnd??D;if(D!==V||D<=0)return;const U=s.value??"",S=d!=null?t.Value.get(d):null;if(!S)return;const M=p!=null?t.Value.get(p):void 0,L=m!=null?t.Value.get(m):!0,z=g!=null?t.Value.get(g):void 0,A=I!=null?t.Value.get(I):void 0,W=ct(typeof S=="function"?S(U,{raw:U,previousConformed:U,cursor:D,completed:!1}):S,M??{},L??!0),T=new Set;for(const B of W)B.type==="literal"&&T.add(B.char);if(z)for(const B of z)T.add(B);if(A)for(const B of A)T.add(B);if(T.has(U[D-1])){let B=D-1;for(;B>=0&&T.has(U[B]);)B--;B>=0&&(y.preventDefault(),y.stopPropagation(),s.value=U.slice(0,B)+U.slice(B+1),w(s,"input"))}})):t.Empty))}))};function J(n,e,l){const r=t.Value.map(n,o=>o!=null),a=t.computedOf(r,e??!1)((o,d)=>!o||d),h=v.defaultMessages.clearValue;return t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__reset"),t.aria.label(h),t.attr.title(h),t.attr.disabled(a),v.Icon({icon:"mdi:close",size:"sm"}),t.on.click(o=>{o.stopPropagation(),l?.(null)}))}const At=n=>{const{value:e,onBlur:l,onChange:r,onInput:a,rows:h}=n;return v.InputContainer({baseContainer:!0,...n,input:t.html.textarea(t.attr.class(t.computedOf(n.size??"md")(o=>v.generateInputContainerInputClasses(!1,o??"md"))),v.CommonInputAttributes(n),t.attr.rows(h??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,a!=null?t.on.input(t.emitValue(a)):t.Empty)})},Ft=n=>{const{value:e,step:l,min:r,max:a,onBlur:h,onChange:o,onInput:d,after:p}=n,m=I=>{const c=r!=null?t.Value.get(r):void 0,b=a!=null?t.Value.get(a):void 0;return c!=null&&I<c?c:b!=null&&I>b?b:I},u=l!=null?t.Use(v.BeatUII18n,I=>{const c=t.computedOf(e,r)((i,f)=>f==null?!0:(i??0)>f),b=t.computedOf(e,a)((i,f)=>f==null?!0:(i??0)<f),x=i=>{const f=t.Value.get(e)??0,_=t.Value.get(l),k=i?.shiftKey?10:1,O=f-_*k,w=r!=null?t.Value.get(r):void 0;if(w!=null&&O<w)return;const s=m(O);s!==f&&o&&o(s)},C=i=>{const f=t.Value.get(e)??0,_=t.Value.get(l),k=i?.shiftKey?10:1,O=f+_*k,w=a!=null?t.Value.get(a):void 0;if(w!=null&&O>w)return;const s=m(O);s!==f&&o&&o(s)};return $.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(b,n.disabled??!1)((i,f)=>!i||f)),t.on.click(i=>C(i)),t.aria.label(I.$.incrementValue),v.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(c,n.disabled??!1)((i,f)=>!i||f)),t.on.click(i=>x(i)),t.aria.label(I.$.decrementValue),v.Icon({icon:"line-md:minus",size:"xs"})))}):null,g=p!=null&&u!=null?t.Fragment(u,p):p??u;return v.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,a!=null?t.attr.max(a):t.Empty,v.CommonInputAttributes(n),t.attr.valueAsNumber(e),t.attr.step(l),t.attr.class("bc-input bc-number-input"),h!=null?t.on.blur(t.emitValue(h)):t.Empty,o!=null?t.on.change(t.emitValueAsNumber(o)):t.Empty,d!=null?t.on.input(t.emitValueAsNumber(d)):t.Empty,l!=null?t.on.wheel(I=>{I.preventDefault();const c=t.Value.get(e)??0,b=t.Value.get(l),x=I.shiftKey?10:1,C=I.deltaY<0?b*x:-b*x,i=m(c+C);i!==c&&o&&o(i)}):t.Empty),after:g})},et=n=>{if(n==null||n==="")return null;const e=Number(n);return Number.isNaN(e)?null:e},zt=n=>{const{value:e,step:l,min:r,max:a,onBlur:h,onChange:o,onInput:d,after:p}=n,m=c=>{const b=r!=null?t.Value.get(r):void 0,x=a!=null?t.Value.get(a):void 0;return b!=null&&c<b?b:x!=null&&c>x?x:c},u=(()=>{if(l==null)return null;const c=t.computedOf(e,r)((f,_)=>{const k=f??0;return _==null?!0:k>_}),b=t.computedOf(e,a)((f,_)=>{const k=f??0;return _==null?!0:k<_}),x=f=>{const _=t.Value.get(e)??0,k=t.Value.get(l),O=f?.shiftKey?10:1,w=_-k*O,s=r!=null?t.Value.get(r):void 0;if(s!=null&&w<s)return;const y=m(w);y!==_&&o&&o(y)},C=f=>{const _=t.Value.get(e)??0,k=t.Value.get(l),O=f?.shiftKey?10:1,w=_+k*O,s=a!=null?t.Value.get(a):void 0;if(s!=null&&w>s)return;const y=m(w);y!==_&&o&&o(y)};return((f,_)=>$.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(b,n.disabled??!1)((k,O)=>!k||O)),t.on.click(k=>C(k)),t.aria.label(f),v.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(c,n.disabled??!1)((k,O)=>!k||O)),t.on.click(k=>x(k)),t.aria.label(_),v.Icon({icon:"line-md:minus",size:"xs"}))))(v.defaultMessages.incrementValue,v.defaultMessages.decrementValue)})(),g=J(e,n.disabled,o??d),I=p!=null&&u!=null?t.Fragment(u,g,p):p!=null?t.Fragment(g,p):u!=null?t.Fragment(u,g):g;return v.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,a!=null?t.attr.max(a):t.Empty,v.CommonInputAttributes(n),t.attr.value(t.Value.map(e,c=>c==null?"":String(c))),t.attr.step(l),t.attr.class("bc-input bc-number-input"),h!=null?t.on.blur(t.emitValue(h)):t.Empty,o!=null?t.on.change(t.emitValue(c=>{const b=et(c);o(b)})):t.Empty,d!=null?t.on.input(t.emitValue(c=>{const b=et(c);d(b)})):t.Empty,l!=null?t.on.wheel(c=>{c.preventDefault();const b=t.Value.get(e)??0,x=t.Value.get(l),C=c.shiftKey?10:1,i=c.deltaY<0?x*C:-x*C,f=m(b+i);f!==b&&o&&o(f)}):t.Empty),after:I})},Mt=n=>{const e={type:"pattern",pattern:/[0-9A-Fa-f]/,transform:r=>r.toLowerCase()};return G({...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"})};let H=null;async function j(){const n=globalThis;return n.Temporal?n.Temporal:(H||(H=Promise.resolve().then(()=>require("./index.esm-DJRz9AE-.cjs")).then(e=>{const l=e.Temporal;return n.Temporal||(n.Temporal=l),l})),H)}const pt=(n,e)=>e?t.Task(j,{then:n,pending:e.pending,error:e.error}):t.Task(j,n),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 ft(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 nt=(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:a,disabled:h,onBlur:o}=n,d=()=>{const u=J(e,h,l??r);return a!=null?t.Fragment(u,a):u},p=n.placeholder!=null?t.Empty:t.attr.placeholder("P0DT0H0M0S");return pt(u=>G({...n,value:t.Value.map(e,g=>g?.toString()??""),onChange:l?g=>l(g===""?null:u.Duration.from(g)):void 0,onInput:void 0,...ft(u.Duration.from),placeholder:"P0DT0H0M0S",after:d()}),{pending:()=>{const u=g=>I=>{const b=I.currentTarget?.value??"";if(b===""){g(null);return}const x=globalThis.Temporal,C=nt(x,b);if(C!=null){g(C);return}j().then(i=>{const f=nt(i,b);f!=null&&g(f)}).catch(()=>{})};return v.InputContainer({...n,input:t.input.text(v.CommonInputAttributes(n),t.attr.value(t.Value.map(e,g=>g?.toString()??"")),t.attr.class("bc-input"),p,o!=null?t.on.blur(()=>o()):t.Empty,l!=null?t.on.change(u(l)):t.Empty,r!=null?t.on.input(u(r)):t.Empty),after:d()})}})},Rt=n=>{const{value:e,onBlur:l,onChange:r,onInput:a}=n;return v.InputContainer({...n,input:t.input.url(v.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,a!=null?t.on.input(t.emitValue(a)):t.Empty)})},dt=n=>{const{controller:e,element:l,separator:r,showMove:a=!0,showRemove:h=!0,showAdd:o=!0,createItem:d,addLabel:p,controlsLayout:m="aside",removeDisabled:u,addDisabled:g}=n,I=t.Value.toSignal(m).map(x=>x==="aside"),c=x=>{const C=t.When(a??!1,()=>t.html.div(t.attr.class("bc-group--align-center"),t.attr.class(I.map(f=>f?"bc-group--direction-column bc-group--gap-1":"bc-group--direction-row bc-group--gap-1")),v.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>x.move("up"),disabled:x.cannotMove("up")},t.Use(v.BeatUII18n,f=>v.Icon({size:"xs",icon:"line-md:arrow-up",title:f.$.incrementValue}))),v.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>x.move("down"),disabled:x.cannotMove("down")},t.Use(v.BeatUII18n,f=>v.Icon({size:"xs",icon:"line-md:arrow-down",title:f.$.decrementValue}))))),i=t.When(h,()=>t.Use(v.BeatUII18n,f=>$.CloseButton({size:"xs",label:t.Value.map(f.$.removeItem,_=>_.toLowerCase()),color:"danger",disabled:u,onClick:x.remove})));return f=>t.When(I,()=>N(t.attr.class("bc-group--gap-1 bc-group--align-center"),$.Stack(t.attr.class("bc-stack--grow"),f),$.Stack(t.attr.class("bc-stack--align-center"),t.When(e.signal.map(_=>_.length>1),()=>C),i)),()=>$.Stack(t.attr.class("bc-stack--gap-2"),f,N(t.attr.class("bc-group--gap-2 bc-group--justify-between"),t.When(e.signal.map(_=>_.length>1),()=>C,()=>t.html.div()),i)))},b=t.When(t.computedOf(o,d)((x,C)=>x&&C!=null),()=>N(t.attr.class("bc-group--gap-2 bc-group--align-center bc-group--justify-center"),v.Button({size:"sm",variant:"filled",onClick:()=>e.push(d()),disabled:t.computedOf(e.disabled,g??!1)((x,C)=>x||C)},t.Use(v.BeatUII18n,x=>N(t.attr.class("bc-group--gap-2"),v.Icon({icon:"line-md:plus"}),p??x.$.addLabel)))));return t.Fragment(ut(e,x=>c(x)(l(x)),r),b)},Pt=(n,...e)=>{const{controller:l,element:r,separator:a,showMove:h,showRemove:o,showAdd:d,createItem:p,addLabel:m,controlsLayout:u,removeDisabled:g,addDisabled:I,...c}=n;return $.InputWrapper({...c,content:dt({controller:l,element:r,separator:a,showMove:h,showRemove:o,showAdd:d,createItem:p,addLabel:m,controlsLayout:u,removeDisabled:g,addDisabled:I})},...e)};class jt extends $.Controller{branches;activeBranch;#e;#t=new Map;constructor(e,l,r,a,h,o,d=$.O){super(e,l,r,a,h,d),this.branches=o;const p=u=>{for(const g of o)if(g.detect(u))return g.key;return o[0]?.key??"unknown"};this.activeBranch=r.map(p,$.O);const m=u=>{if(this.#t.has(u))return this.#t.get(u);const g=o.find(c=>c.key===u);if(!g)throw new Error(`Unknown branch: ${u}`);const I=new $.Controller([...e,u],c=>{this.change(c)},this.signal.map(c=>g.detect(c)?c:g.defaultValue(),d),a.map($.makeMapValidation([u])),{disabled:this.disabled,validationMode:this.parent.validationMode},d);return this.#t.set(u,I),I};this.#e=this.activeBranch.map(u=>m(u),$.O),this.onDispose(()=>{for(const u of this.#t.values())u.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(a=>a.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],a=>{this.change(a)},this.signal.map(a=>l.detect(a)?a: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(o=>o.key===e);if(!r)throw new Error(`Unknown branch: ${e}`);const a=t.Value.get(this.signal);if(r.detect(a))return!0;if(r.convert){const o=r.convert(a);if(o.ok)return this.change(o.value),!0}if(l&&typeof window=="object"&&typeof window.confirm=="function"&&!window.confirm("Changing type will clear the current value. Continue?"))return!1;const h=r.defaultValue();return this.change(h),!0}get activeBranchDefinition(){const e=t.Value.get(this.activeBranch);return this.branches.find(l=>l.key===e)}}function Zt(n){return n.transform(e=>e??null,e=>e??void 0)}function qt(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 R(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.prototype.toString.call(n)==="[object Object]"}function mt(n,e){if(e==null)return lt(n);if(n==null)return e;if(R(n)&&R(e)){const l={...e};for(const r of Object.keys(n))l[r]===void 0?l[r]=lt(n[r]):R(n[r])&&R(l[r])&&(l[r]=mt(n[r],l[r]));return l}return e}function lt(n){return typeof structuredClone=="function"?structuredClone(n):JSON.parse(JSON.stringify(n))}exports.$t=wt;exports.BaseListControl=dt;exports.BaseNativeSelectControl=it;exports.Expando=rt;exports.FilesInput=Ut;exports.Group=N;exports.ListControl=Pt;exports.ListInput=ut;exports.MaskInput=G;exports.NativeSelect=st;exports.NativeSelectControl=Ot;exports.NullableDurationInput=Wt;exports.NullableNumberInput=zt;exports.NullableResetAfter=J;exports.NumberInput=Ft;exports.SegmentedInput=kt;exports.TextArea=At;exports.UUIDInput=Mt;exports.UnionController=jt;exports.UnstyledDropZone=P;exports.UrlInput=Rt;exports.WithTemporal=pt;exports._t=Vt;exports.deepMergeDefaults=mt;exports.durationMaskConfig=ft;exports.emitExpando=$t;exports.emitOptionExpando=at;exports.ensureTemporal=j;exports.gt=yt;exports.transformEmptyStringToUndefined=qt;exports.transformNullToUndefined=Zt;exports.transformUndefinedToNull=Ht;
|
|
1
|
+
"use strict";const t=require("@tempots/dom"),gt=require("./colors-B2yrgHSW.cjs"),bt=require("./timer-BJHOsuS6.cjs"),vt=require("@tempots/ui"),v=require("./translations-eUtMHN9s.cjs"),$=require("./use-form-pSErMD6z.cjs");class xt extends Error{constructor(e="Missing implementation"){super(e),this.name="MissingImplementationError"}}const yt=n=>It(n).split("_").join(" "),It=n=>(n=n.replace(/::/g,"/"),n=n.replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2"),n=n.replace(/([a-z\d])([A-Z])/g,"$1_$2"),n=n.replace(/-/g,"_"),n.toLowerCase()),Vt=n=>n.substring(0,1).toUpperCase()+n.substring(1),wt=n=>{if(typeof Buffer<"u")return Buffer.from(n,"base64").toString("utf8");if(typeof atob<"u")return atob(n);throw new xt("No implementation found for base64 decoding")};function P({onChange:n,value:e,accept:l="*/*",enableClick:r=!0,content:a,disabled:h=!1,allowMultiple:o}){return t.Use(v.BeatUII18n,d=>{const p=t.Value.deriveProp(e??[]),m=t.prop(!1),u=i=>{i.preventDefault(),i.stopPropagation(),m.value=!0},g=i=>{i.preventDefault(),i.stopPropagation(),(!i.currentTarget||!i.currentTarget.contains(i.relatedTarget))&&(m.value=!1)},I=i=>{i.preventDefault(),i.stopPropagation(),m.value=!1;const f=Array.from(i.dataTransfer?.files||[]);f.length>0&&(p.value=f,n(f,"dragdrop"))},c=i=>{t.Value.get(r)&&i.currentTarget.querySelector('input[type="file"]')?.click()};let b=null;const x=()=>{if(b==null)return;const i=Array.from(b.files??[]);i.length>0&&(p.value=i,n(i,"click")),b.value=""},C=i=>{t.Value.get(r)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),c(i))};return t.html.div(t.attr.role("button"),t.attr.tabindex(t.Value.map(r,i=>i?0:-1)),t.attr.style("position: relative;"),t.on.dragover(u),t.on.dragleave(g),t.on.drop(I),t.on.click(c),t.on.keydown(C),t.html.input(t.attr.type("file"),t.attr.disabled(h),t.attr.accept(l),t.attr.multiple(o),t.attr.style("position: absolute; left: -9999px; opacity: 0; pointer-events: none;"),t.on.change(x),t.WithElement(i=>(b=i,p.on(f=>{const _=globalThis.DataTransfer;if(_!=null){const k=new _;f.forEach(O=>k.items.add(O)),i.files=k.files}}),t.Empty))),t.aria.label(t.bind(d.$.dropZoneInstructions)(r)),a({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 _t(n,e){const l=["bc-segmented-input",`bc-segmented-input--size-${n}`];return e&&l.push("bc-segmented-input--disabled"),l.join(" ")}function kt({options:n,value:e,onChange:l,size:r="md",disabled:a=!1},...h){const o=gt.l(n).map(([d,p])=>({key:d,label:p}));return t.WithElement(()=>{const d=Object.fromEntries(o.map((m,u)=>[m.key,u])),p=t.prop(o.map(()=>({left:0,width:0})),Ct);return t.html.div(t.attr.class(t.computedOf(r,a)((m,u)=>_t(m??"md",u??!1))),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,p)((m,u)=>{const{width:g}=u[d[m]??0];return`${g}px`})),t.style.left(t.computedOf(e,p)((m,u)=>{const{left:g}=u[d[m]??0];return`${g}px`}))),o.map(({label:m,key:u},g)=>t.html.button(t.attr.type("button"),t.on.click(I=>{I.preventDefault(),t.Value.get(a)||l?.(u)}),t.attr.disabled(a),t.attr.class("bc-segmented-input__segment"),t.attr.class(t.Value.map(e,I=>I===u?"bc-segmented-input__segment--active":"bc-segmented-input__segment--inactive")),vt.ElementRect(I=>{function c(){p.update(x=>{const C=[...x];return C[g]={width:I.value.width,left:I.value.localLeft},C})}const b=bt.g(c);return t.OnDispose(b,I.on(c))}),m))),...h)})}function Et(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 Dt(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 q(n){return t.When(n.map(Et),()=>{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")))},()=>v.Icon({icon:n.map(Dt)}))}const Ut=(n,...e)=>{const{value:l=t.prop([]),accept:r="*/*",maxFiles:a,maxFileSize:h,onChange:o,onBlur:d,disabled:p,hasError:m,mode:u="default",showFileList:g=!0,...I}=n,c=l,b=t.Value.map(u,w=>w==="input"),x=t.Value.map(u,w=>w==="compact"),C=w=>{let s=w;if(a!=null){const y=t.Value.get(a);s=s.slice(0,y)}if(h){const y=t.Value.get(h);s=s.filter(E=>E.size<=y)}o?.(s)},i=w=>{const y=c.value.filter((E,D)=>D!==w);o?.(y)},f=()=>{o?.([])},_=({files:w,clear:s,change:y})=>t.Use(v.BeatUII18n,E=>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"),v.Icon({icon:"mdi:cloud-upload-outline",size:"xl"}),t.html.div(t.attr.class("bc-file-input__drop-zone-text"),t.bind(E.$.filesInputInstructions)(a,h,E.$.fileSizeUnits.value))))),k=({files:w})=>t.Use(v.BeatUII18n,s=>t.html.div(t.attr.class("bc-file-input__compact-drop-zone"),t.When(w.map(y=>y.length>0),()=>t.html.div(t.attr.class("bc-file-input__compact-file-list"),t.ForEach(w,(y,E)=>{const D=E.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"),q(y)),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(y.$.name),y.$.name),t.html.div(t.attr.class("bc-file-input__compact-file-meta"),t.computedOf(y.$.size,s.$.fileSizeUnits)((V,U)=>v.formatFileSize(V,{units:U}))," • ",t.computedOf(y.$.type,s.$.unknownType)((V,U)=>V||U))),$.CloseButton({size:"sm",label:s.$.removeFile,disabled:p,onClick:()=>i(D)},t.attr.class("bc-file-input__compact-remove-button")))})),()=>t.html.div(t.attr.class("bc-file-input__compact-placeholder"),v.Icon({icon:"mdi:cloud-upload-outline",size:"lg"}),t.html.div(t.attr.class("bc-file-input__compact-placeholder-text"),t.bind(s.$.filesInputInstructions)(a,h,s.$.fileSizeUnits.value)))))),O=({files:w})=>t.Use(v.BeatUII18n,s=>t.html.div(t.attr.class("bc-file-input__compact-input"),t.When(w.map(y=>y.length>0),()=>t.html.span(t.attr.class("bc-file-input__compact-value"),t.ForEach(w,y=>t.html.span(t.attr.class("bc-file-input__compact-value-item"),q(y),t.html.span(t.attr.class("bc-file-input__compact-value-item-name"),y.$.name)))),()=>t.html.span(t.attr.class("bc-file-input__compact-placeholder"),v.Icon({icon:"mdi:cloud-upload-outline",size:"md"})," ",t.bind(s.$.filesInputInstructions)(a,h,s.$.fileSizeUnits.value)))));return t.Use(v.BeatUII18n,w=>v.InputContainer({baseContainer:t.Value.map(b,s=>!s),disabled:p,hasError:m,after:t.When(b,()=>t.When(c.map(({length:s})=>s>0),()=>$.CloseButton({size:"sm",label:w.$.clearAllFiles,disabled:p,onClick:f},t.attr.class("bc-file-input__compact-clear")))),...I,input:t.When(b,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--input"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:O})),()=>t.When(x,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--compact"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:k})),()=>t.html.div(t.attr.class("bc-file-input"),P({value:c,accept:r,enableClick:!0,allowMultiple:t.Value.map(a??1/0,s=>s>1),disabled:p,onChange:C,content:_}),t.When(g,()=>t.NotEmpty(c,()=>t.Fragment(t.html.div(t.attr.class("bc-file-input__file-list"),t.ForEach(c,(s,y)=>{const E=y.index;return t.html.div(t.attr.class("bc-file-input__file-item"),t.html.div(t.attr.class("bc-file-input__file-icon"),q(s)),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(s.$.name),s.$.name),t.html.div(t.attr.class("bc-file-input__file-meta"),t.computedOf(s.$.size,w.$.fileSizeUnits)((D,V)=>v.formatFileSize(D,{units:V}))," • ",t.computedOf(s.$.type,w.$.unknownType)((D,V)=>D||V))),$.CloseButton({size:"sm",label:w.$.removeFile,disabled:p,onClick:()=>i(E)},t.attr.class("bc-file-input__remove-button")))})),t.When(c.map(({length:s})=>s>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),w.$.clearAllFiles,t.on.click(s=>{s.preventDefault(),s.stopPropagation(),f()}))))))))))},...e))},Y="$$tts-exp-",rt=(n,e)=>t.WithElement(l=>{const r=`${Y}${n}`;return t.OnDispose(t.Value.on(e,a=>Reflect.set(l,r,a)))}),$t=(n,e)=>{const l=`${Y}${n}`;return r=>{e(Reflect.get(r.target,l))}},at=(n,e)=>{const l=`${Y}${n}`;return r=>{const a=r.target,h=a.selectedIndex,o=a.options[h];e(Reflect.get(o,l))}};function N(...n){return t.html.div(t.attr.class("bc-group"),...n)}const ot=(n,e,l)=>t.Ensure(n,r=>t.OneOfType(r,{value:a=>{const h=t.computedOf(a,l)((o,d)=>e(o.value,d));return t.html.option(t.attr.selected(h),rt("value",a.$.value),a.$.label)},group:a=>t.html.optgroup(t.attr.label(a.$.group),t.ForEach(a.$.options,h=>ot(h,e,l))),break:()=>t.html.hr()})),st=n=>{const{value:e,onBlur:l,onChange:r,options:a,unselectedLabel:h,equality:o=(m,u)=>m===u,after:d}=n;let p;return v.InputContainer({...n,after:t.Fragment(v.InputIcon({icon:"ph:caret-down-bold",color:"neutral",size:"sm"}),d),input:t.html.select(t.WithElement(m=>{p=m;const u=new MutationObserver(g=>{const{removedNodes:I}=g[0];I.length>0&&(p.selectedIndex=0)});return u.observe(m,{childList:!0}),t.OnDispose(()=>u.disconnect())}),v.CommonInputAttributes(n),t.attr.class("bc-native-select bc-input"),t.Use(v.BeatUII18n,m=>t.html.option(t.attr.hidden("hidden"),t.coalesce(h,m.$.selectOne))),t.ForEach(a,m=>ot(m,o,e)),l!=null?t.on.blur(l):t.Empty,r!=null?t.on.change(at("value",m=>r(m))):t.Empty)},t.on.click(()=>{if(p?.focus(),typeof p?.showPicker=="function")try{p.showPicker()}catch{}}))};function it(n){const{controller:e,onChange:l,onBlur:r,...a}=n;return st({...a,value:e.signal,onChange:$.makeOnChangeHandler(e,l),onBlur:$.makeOnBlurHandler(e,r)})}function Ot(n){return $.InputWrapper({...n,content:it(n)})}function ut(n,e,l){const r=n.length.map(a=>a);return t.Fragment(t.Repeat(r,a=>{const h=n.item(a.index),o=[];return t.Fragment(t.OnDispose(()=>{o.forEach(d=>d())}),e({list:n,item:h,position:a,remove:()=>n.removeAt(a.index),move:d=>{switch(d){case"up":if(a.index===0)return;n.move(a.index,a.index-1);break;case"down":if(a.index===n.length.value-1)return;n.move(a.index,a.index+1);break;case"first":n.move(a.index,0);break;case"last":n.move(a.index,n.length.value-1)}},canMove:d=>{const p=(()=>{switch(d){case"up":return t.signal(a.index>0);case"down":return n.length.map(m=>a.index<m-1)}})();return o.push(()=>p.dispose()),p},cannotMove:d=>{const p=(()=>{switch(d){case"up":return t.signal(a.index===0);case"down":return n.length.map(m=>a.index===m-1)}})();return o.push(()=>p.dispose()),p}}))},l))}const K={9:{pattern:/^[0-9]$/},A:{pattern:/^[A-Za-z]$/,transform:n=>n.toUpperCase()},"*":{pattern:/^.$/}},Bt=n=>n instanceof RegExp;function ct(n,e,l){if(n==null)return[];const r=l?{...K,...e}:e??K,a=(o,d)=>{const p=r[d];p?o.push({type:"pattern",name:d,...p}):o.push({type:"literal",char:d})},h=[];if(typeof n=="string"){for(const o of n)a(h,o);return h}for(const o of n)if(typeof o=="string")if(o.length<=1)a(h,o);else for(const d of o)a(h,d);else Bt(o)?h.push({type:"pattern",pattern:o}):typeof o=="object"&&o&&h.push(o);return h}function St(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 tt(n,e,l,r,a,h){const o={raw:n,previousConformed:e,cursor:a??n.length,completed:!1},d=r.definitions??{},p=typeof l=="function"?l(n,o):l,m=ct(p,d,r.useDefaultDefinitions??!0),u=St(r.allowMode,r.allow),g=new Set;for(const V of m)V.type==="literal"&&g.add(V.char);if(r.prefix)for(const V of r.prefix)g.add(V);if(r.suffix)for(const V of r.suffix)g.add(V);const I=Array.from(n).filter(V=>u(V)&&!g.has(V));if(I.length===0)return{value:"",cursor:0,completed:!1};const c=[],b=[];let x=0,C=0,i=0,f=-1;for(const V of m){if(V.type==="literal"){c.push(V.char),b.push({kind:"literal",filled:!0});continue}C+=V.optional?0:1;const U=I[x];if(U==null)break;if(V.type==="any"){i++,c.push(V.transform?V.transform(U):U),b.push({kind:"slot",filled:!0}),f=b.length-1,x++;continue}if(V.type==="pattern")if(V.pattern.test(U)){i++;const S=V.transform?V.transform(U):U;c.push(S),b.push({kind:"slot",filled:!0}),f=b.length-1,x++}else{x++;continue}}const _=c.join(""),k=(r.prefix??"")+_+(r.suffix??"");let w=(r.prefix??"").length;if(f>=0){let V=f+1;if((h?.policy??"smart")!=="sticky")for(;V<b.length&&b[V].kind==="literal";)V++;w+=V}const s=r.completion?.mode==="min"?(r.completion.minChars??0)<=i:r.completion?.mode==="custom"?!!r.completion.isComplete?.(k):C>0&&i>=C,y=r.pipe?.(k,{...o,completed:s});let E,D=w;return y===!1?(E=e,D=e.length):typeof y=="string"?(E=y,D=y.length):typeof y=="object"&&y?(E=y.value,D=y.cursor??y.value.length):E=k,{value:E,cursor:D,completed:s}}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 G=n=>{const{value:e,onBlur:l,onChange:r,onInput:a,onAccept:h,onComplete:o,mask:d,definitions:p,useDefaultDefinitions:m,extraLiterals:u,prefix:g,suffix:I,autofix:c,pipe:b,completion:x,unmask:C,allowMode:i,allow:f,placeholder:_,placeholderOptions:k}=n,O=t.computedOf(e,d,p,m,u,g,I,c,x,C,i,_,k)((s,y,E,D,V,U,S,M,L,z,A,W,T)=>y?tt(s??"","",y,{definitions:E??{},useDefaultDefinitions:D??!0,extraLiterals:V??[],autofix:M??"none",completion:L??{mode:"mask"},pipe:b??(B=>B),unmask:z??{strategy:"none"},allowMode:A??"all",allow:f,prefix:U,suffix:S}).value:s??""),w=(s,y)=>{const E=s.value??"",D=t.Value.get(e)??"",V=d!=null?t.Value.get(d):null,U=p!=null?t.Value.get(p):void 0,S=m!=null?t.Value.get(m):void 0,M=u!=null?t.Value.get(u):void 0,L=c!=null?t.Value.get(c):void 0,z=x!=null?t.Value.get(x):void 0,A=C!=null?t.Value.get(C):void 0,W=i!=null?t.Value.get(i):void 0,T=g!=null?t.Value.get(g):void 0,B=I!=null?t.Value.get(I):void 0,{value:F,cursor:Z,completed:X}=V?tt(E,D,V,{definitions:U??{},useDefaultDefinitions:S??!0,extraLiterals:M??[],autofix:L??"none",completion:z??{mode:"mask"},pipe:b??(ht=>ht),unmask:A??{strategy:"none"},allowMode:W??"all",allow:f,prefix:T,suffix:B},s.selectionStart??E.length,n.cursor?t.Value.get(n.cursor):void 0):{value:E,cursor:E.length,completed:!0};if(F!==E){s.value=F;try{s.setSelectionRange(Z,Z)}catch{}}const Q=Tt(F,A);h?.({raw:Q,conformed:F,completed:X,cursor:Z}),y==="input"?a?.(F):(r?.(F),X&&o?.({raw:Q,conformed:F}))};return t.Fragment(v.InputContainer({...n,input:t.input.text(v.CommonInputAttributes(n),t.attr.value(O),t.attr.class("bc-input"),l!=null?t.on.blur(l):t.Empty,t.WithElement(s=>s instanceof HTMLInputElement?t.Fragment(t.on.input(()=>w(s,"input")),t.on.change(()=>w(s,"change")),t.on.keydown(y=>{if(y.key!=="Backspace"||!(n.cursor?t.Value.get(n.cursor)?.backspaceRubberBand??!0:!0))return;const D=s.selectionStart??0,V=s.selectionEnd??D;if(D!==V||D<=0)return;const U=s.value??"",S=d!=null?t.Value.get(d):null;if(!S)return;const M=p!=null?t.Value.get(p):void 0,L=m!=null?t.Value.get(m):!0,z=g!=null?t.Value.get(g):void 0,A=I!=null?t.Value.get(I):void 0,W=ct(typeof S=="function"?S(U,{raw:U,previousConformed:U,cursor:D,completed:!1}):S,M??{},L??!0),T=new Set;for(const B of W)B.type==="literal"&&T.add(B.char);if(z)for(const B of z)T.add(B);if(A)for(const B of A)T.add(B);if(T.has(U[D-1])){let B=D-1;for(;B>=0&&T.has(U[B]);)B--;B>=0&&(y.preventDefault(),y.stopPropagation(),s.value=U.slice(0,B)+U.slice(B+1),w(s,"input"))}})):t.Empty))}))};function J(n,e,l){const r=t.Value.map(n,o=>o!=null),a=t.computedOf(r,e??!1)((o,d)=>!o||d),h=v.defaultMessages.clearValue;return t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__reset"),t.aria.label(h),t.attr.title(h),t.attr.disabled(a),v.Icon({icon:"mdi:close",size:"sm"}),t.on.click(o=>{o.stopPropagation(),l?.(null)}))}const At=n=>{const{value:e,onBlur:l,onChange:r,onInput:a,rows:h}=n;return v.InputContainer({baseContainer:!0,...n,input:t.html.textarea(t.attr.class(t.computedOf(n.size??"md")(o=>v.generateInputContainerInputClasses(!1,o??"md"))),v.CommonInputAttributes(n),t.attr.rows(h??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,a!=null?t.on.input(t.emitValue(a)):t.Empty)})},Ft=n=>{const{value:e,step:l,min:r,max:a,onBlur:h,onChange:o,onInput:d,after:p}=n,m=I=>{const c=r!=null?t.Value.get(r):void 0,b=a!=null?t.Value.get(a):void 0;return c!=null&&I<c?c:b!=null&&I>b?b:I},u=l!=null?t.Use(v.BeatUII18n,I=>{const c=t.computedOf(e,r)((i,f)=>f==null?!0:(i??0)>f),b=t.computedOf(e,a)((i,f)=>f==null?!0:(i??0)<f),x=i=>{const f=t.Value.get(e)??0,_=t.Value.get(l),k=i?.shiftKey?10:1,O=f-_*k,w=r!=null?t.Value.get(r):void 0;if(w!=null&&O<w)return;const s=m(O);s!==f&&o&&o(s)},C=i=>{const f=t.Value.get(e)??0,_=t.Value.get(l),k=i?.shiftKey?10:1,O=f+_*k,w=a!=null?t.Value.get(a):void 0;if(w!=null&&O>w)return;const s=m(O);s!==f&&o&&o(s)};return $.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(b,n.disabled??!1)((i,f)=>!i||f)),t.on.click(i=>C(i)),t.aria.label(I.$.incrementValue),v.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(c,n.disabled??!1)((i,f)=>!i||f)),t.on.click(i=>x(i)),t.aria.label(I.$.decrementValue),v.Icon({icon:"line-md:minus",size:"xs"})))}):null,g=p!=null&&u!=null?t.Fragment(u,p):p??u;return v.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,a!=null?t.attr.max(a):t.Empty,v.CommonInputAttributes(n),t.attr.valueAsNumber(e),t.attr.step(l),t.attr.class("bc-input bc-number-input"),h!=null?t.on.blur(t.emitValue(h)):t.Empty,o!=null?t.on.change(t.emitValueAsNumber(o)):t.Empty,d!=null?t.on.input(t.emitValueAsNumber(d)):t.Empty,l!=null?t.on.wheel(I=>{I.preventDefault();const c=t.Value.get(e)??0,b=t.Value.get(l),x=I.shiftKey?10:1,C=I.deltaY<0?b*x:-b*x,i=m(c+C);i!==c&&o&&o(i)}):t.Empty),after:g})},et=n=>{if(n==null||n==="")return null;const e=Number(n);return Number.isNaN(e)?null:e},zt=n=>{const{value:e,step:l,min:r,max:a,onBlur:h,onChange:o,onInput:d,after:p}=n,m=c=>{const b=r!=null?t.Value.get(r):void 0,x=a!=null?t.Value.get(a):void 0;return b!=null&&c<b?b:x!=null&&c>x?x:c},u=(()=>{if(l==null)return null;const c=t.computedOf(e,r)((f,_)=>{const k=f??0;return _==null?!0:k>_}),b=t.computedOf(e,a)((f,_)=>{const k=f??0;return _==null?!0:k<_}),x=f=>{const _=t.Value.get(e)??0,k=t.Value.get(l),O=f?.shiftKey?10:1,w=_-k*O,s=r!=null?t.Value.get(r):void 0;if(s!=null&&w<s)return;const y=m(w);y!==_&&o&&o(y)},C=f=>{const _=t.Value.get(e)??0,k=t.Value.get(l),O=f?.shiftKey?10:1,w=_+k*O,s=a!=null?t.Value.get(a):void 0;if(s!=null&&w>s)return;const y=m(w);y!==_&&o&&o(y)};return((f,_)=>$.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(b,n.disabled??!1)((k,O)=>!k||O)),t.on.click(k=>C(k)),t.aria.label(f),v.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(c,n.disabled??!1)((k,O)=>!k||O)),t.on.click(k=>x(k)),t.aria.label(_),v.Icon({icon:"line-md:minus",size:"xs"}))))(v.defaultMessages.incrementValue,v.defaultMessages.decrementValue)})(),g=J(e,n.disabled,o??d),I=p!=null&&u!=null?t.Fragment(u,g,p):p!=null?t.Fragment(g,p):u!=null?t.Fragment(u,g):g;return v.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,a!=null?t.attr.max(a):t.Empty,v.CommonInputAttributes(n),t.attr.value(t.Value.map(e,c=>c==null?"":String(c))),t.attr.step(l),t.attr.class("bc-input bc-number-input"),h!=null?t.on.blur(t.emitValue(h)):t.Empty,o!=null?t.on.change(t.emitValue(c=>{const b=et(c);o(b)})):t.Empty,d!=null?t.on.input(t.emitValue(c=>{const b=et(c);d(b)})):t.Empty,l!=null?t.on.wheel(c=>{c.preventDefault();const b=t.Value.get(e)??0,x=t.Value.get(l),C=c.shiftKey?10:1,i=c.deltaY<0?x*C:-x*C,f=m(b+i);f!==b&&o&&o(f)}):t.Empty),after:I})},Mt=n=>{const e={type:"pattern",pattern:/[0-9A-Fa-f]/,transform:r=>r.toLowerCase()};return G({...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"})};let H=null;async function j(){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 pt=(n,e)=>e?t.Task(j,{then:n,pending:e.pending,error:e.error}):t.Task(j,n),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 ft(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 nt=(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:a,disabled:h,onBlur:o}=n,d=()=>{const u=J(e,h,l??r);return a!=null?t.Fragment(u,a):u},p=n.placeholder!=null?t.Empty:t.attr.placeholder("P0DT0H0M0S");return pt(u=>G({...n,value:t.Value.map(e,g=>g?.toString()??""),onChange:l?g=>l(g===""?null:u.Duration.from(g)):void 0,onInput:void 0,...ft(u.Duration.from),placeholder:"P0DT0H0M0S",after:d()}),{pending:()=>{const u=g=>I=>{const b=I.currentTarget?.value??"";if(b===""){g(null);return}const x=globalThis.Temporal,C=nt(x,b);if(C!=null){g(C);return}j().then(i=>{const f=nt(i,b);f!=null&&g(f)}).catch(()=>{})};return v.InputContainer({...n,input:t.input.text(v.CommonInputAttributes(n),t.attr.value(t.Value.map(e,g=>g?.toString()??"")),t.attr.class("bc-input"),p,o!=null?t.on.blur(()=>o()):t.Empty,l!=null?t.on.change(u(l)):t.Empty,r!=null?t.on.input(u(r)):t.Empty),after:d()})}})},Rt=n=>{const{value:e,onBlur:l,onChange:r,onInput:a}=n;return v.InputContainer({...n,input:t.input.url(v.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,a!=null?t.on.input(t.emitValue(a)):t.Empty)})},dt=n=>{const{controller:e,element:l,separator:r,showMove:a=!0,showRemove:h=!0,showAdd:o=!0,createItem:d,addLabel:p,controlsLayout:m="aside",removeDisabled:u,addDisabled:g}=n,I=t.Value.toSignal(m).map(x=>x==="aside"),c=x=>{const C=t.When(a??!1,()=>t.html.div(t.attr.class("bc-group--align-center"),t.attr.class(I.map(f=>f?"bc-group--direction-column bc-group--gap-1":"bc-group--direction-row bc-group--gap-1")),v.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>x.move("up"),disabled:x.cannotMove("up")},t.Use(v.BeatUII18n,f=>v.Icon({size:"xs",icon:"line-md:arrow-up",title:f.$.incrementValue}))),v.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>x.move("down"),disabled:x.cannotMove("down")},t.Use(v.BeatUII18n,f=>v.Icon({size:"xs",icon:"line-md:arrow-down",title:f.$.decrementValue}))))),i=t.When(h,()=>t.Use(v.BeatUII18n,f=>$.CloseButton({size:"xs",label:t.Value.map(f.$.removeItem,_=>_.toLowerCase()),color:"danger",disabled:u,onClick:x.remove})));return f=>t.When(I,()=>N(t.attr.class("bc-group--gap-1 bc-group--align-center"),$.Stack(t.attr.class("bc-stack--grow"),f),$.Stack(t.attr.class("bc-stack--align-center"),t.When(e.signal.map(_=>_.length>1),()=>C),i)),()=>$.Stack(t.attr.class("bc-stack--gap-2"),f,N(t.attr.class("bc-group--gap-2 bc-group--justify-between"),t.When(e.signal.map(_=>_.length>1),()=>C,()=>t.html.div()),i)))},b=t.When(t.computedOf(o,d)((x,C)=>x&&C!=null),()=>N(t.attr.class("bc-group--gap-2 bc-group--align-center bc-group--justify-center"),v.Button({size:"sm",variant:"filled",onClick:()=>e.push(d()),disabled:t.computedOf(e.disabled,g??!1)((x,C)=>x||C)},t.Use(v.BeatUII18n,x=>N(t.attr.class("bc-group--gap-2"),v.Icon({icon:"line-md:plus"}),p??x.$.addLabel)))));return t.Fragment(ut(e,x=>c(x)(l(x)),r),b)},Pt=(n,...e)=>{const{controller:l,element:r,separator:a,showMove:h,showRemove:o,showAdd:d,createItem:p,addLabel:m,controlsLayout:u,removeDisabled:g,addDisabled:I,...c}=n;return $.InputWrapper({...c,content:dt({controller:l,element:r,separator:a,showMove:h,showRemove:o,showAdd:d,createItem:p,addLabel:m,controlsLayout:u,removeDisabled:g,addDisabled:I})},...e)};class jt extends $.Controller{branches;activeBranch;#e;#t=new Map;constructor(e,l,r,a,h,o,d=$.O){super(e,l,r,a,h,d),this.branches=o;const p=u=>{for(const g of o)if(g.detect(u))return g.key;return o[0]?.key??"unknown"};this.activeBranch=r.map(p,$.O);const m=u=>{if(this.#t.has(u))return this.#t.get(u);const g=o.find(c=>c.key===u);if(!g)throw new Error(`Unknown branch: ${u}`);const I=new $.Controller([...e,u],c=>{this.change(c)},this.signal.map(c=>g.detect(c)?c:g.defaultValue(),d),a.map($.makeMapValidation([u])),{disabled:this.disabled,validationMode:this.parent.validationMode},d);return this.#t.set(u,I),I};this.#e=this.activeBranch.map(u=>m(u),$.O),this.onDispose(()=>{for(const u of this.#t.values())u.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(a=>a.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],a=>{this.change(a)},this.signal.map(a=>l.detect(a)?a: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(o=>o.key===e);if(!r)throw new Error(`Unknown branch: ${e}`);const a=t.Value.get(this.signal);if(r.detect(a))return!0;if(r.convert){const o=r.convert(a);if(o.ok)return this.change(o.value),!0}if(l&&typeof window=="object"&&typeof window.confirm=="function"&&!window.confirm("Changing type will clear the current value. Continue?"))return!1;const h=r.defaultValue();return this.change(h),!0}get activeBranchDefinition(){const e=t.Value.get(this.activeBranch);return this.branches.find(l=>l.key===e)}}function Zt(n){return n.transform(e=>e??null,e=>e??void 0)}function qt(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 R(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.prototype.toString.call(n)==="[object Object]"}function mt(n,e){if(e==null)return lt(n);if(n==null)return e;if(R(n)&&R(e)){const l={...e};for(const r of Object.keys(n))l[r]===void 0?l[r]=lt(n[r]):R(n[r])&&R(l[r])&&(l[r]=mt(n[r],l[r]));return l}return e}function lt(n){return typeof structuredClone=="function"?structuredClone(n):JSON.parse(JSON.stringify(n))}exports.$t=wt;exports.BaseListControl=dt;exports.BaseNativeSelectControl=it;exports.Expando=rt;exports.FilesInput=Ut;exports.Group=N;exports.ListControl=Pt;exports.ListInput=ut;exports.MaskInput=G;exports.NativeSelect=st;exports.NativeSelectControl=Ot;exports.NullableDurationInput=Wt;exports.NullableNumberInput=zt;exports.NullableResetAfter=J;exports.NumberInput=Ft;exports.SegmentedInput=kt;exports.TextArea=At;exports.UUIDInput=Mt;exports.UnionController=jt;exports.UnstyledDropZone=P;exports.UrlInput=Rt;exports.WithTemporal=pt;exports._t=Vt;exports.deepMergeDefaults=mt;exports.durationMaskConfig=ft;exports.emitExpando=$t;exports.emitOptionExpando=at;exports.ensureTemporal=j;exports.gt=yt;exports.transformEmptyStringToUndefined=qt;exports.transformNullToUndefined=Zt;exports.transformUndefinedToNull=Ht;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Value as i, Use as H, computedOf as S, html as k, attr as o, on as T, aria as F, Fragment as B, input as R, Empty as N, emitValue as x } from "@tempots/dom";
|
|
2
|
-
import { F as X, M as A, N as j, W as $, d as Y } from "./deep-merge-
|
|
2
|
+
import { F as X, M as A, N as j, W as $, d as Y } from "./deep-merge-Bsqkvp9-.js";
|
|
3
3
|
import { a as q, c as M, b as G, C as L } from "./translations-BEMKy6-W.js";
|
|
4
|
-
import { S as Q } from "./use-form-
|
|
4
|
+
import { S as Q } from "./use-form-DMiCxK26.js";
|
|
5
5
|
const en = (n) => {
|
|
6
6
|
const {
|
|
7
7
|
value: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@tempots/dom"),V=require("./deep-merge-
|
|
1
|
+
"use strict";const t=require("@tempots/dom"),V=require("./deep-merge-cQgRrtGF.cjs"),T=require("./translations-eUtMHN9s.cjs"),A=require("./use-form-pSErMD6z.cjs"),E=n=>{const{value:e,onInput:c,onChange:i,...u}=n;return V.FilesInput({...u,maxFiles:1,value:t.Value.map(e,a=>a==null?[]:[a]),onChange:a=>{i?.(a[0])},onInput:a=>{c?.(a[0])}})},x=n=>{try{return BigInt(n)}catch{return null}},q=n=>{const{value:e,step:c,min:i,max:u,onChange:a,onInput:d,after:I}=n,f=m=>{const r=i!=null?t.Value.get(i):void 0,s=u!=null?t.Value.get(u):void 0;return r!=null&&m<r?r:s!=null&&m>s?s:m},g=c!=null?t.Use(T.BeatUII18n,m=>{const r=t.computedOf(e,i)((o,l)=>l==null?!0:(o??0n)>l),s=t.computedOf(e,u)((o,l)=>l==null?!0:(o??0n)<l),h=(o,l)=>{const b=t.Value.get(e)??0n,v=t.Value.get(c),k=l?.shiftKey?10n:1n,C=b+v*k*o,y=i!=null?t.Value.get(i):void 0,S=u!=null?t.Value.get(u):void 0;if(o<0n&&y!=null&&C<y||o>0n&&S!=null&&C>S)return;const D=f(C);D!==b&&a&&a(D)};return A.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(s,n.disabled??!1)((o,l)=>!o||l)),t.on.click(o=>h(1n,o)),t.aria.label(m.$.incrementValue),T.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(r,n.disabled??!1)((o,l)=>!o||l)),t.on.click(o=>h(-1n,o)),t.aria.label(m.$.decrementValue),T.Icon({icon:"line-md:minus",size:"xs"})))}):null,p=I!=null&&g!=null?t.Fragment(g,I):I??g,B=a?m=>{const r=x(m);r!=null&&a(f(r))}:void 0,O=d?m=>{const r=x(m);r!=null&&d(f(r))}:void 0;return V.MaskInput({...n,value:t.Value.map(e,m=>m.toString()),onChange:B,onInput:O,after:p,mask:null,allowMode:"digits",class:"bc-number-input"})},M=n=>{if(n==null||n==="")return null;try{return BigInt(n)}catch{return null}},w=n=>{const{value:e,step:c,min:i,max:u,onChange:a,onInput:d,after:I}=n,f=r=>{const s=i!=null?t.Value.get(i):void 0,h=u!=null?t.Value.get(u):void 0;return s!=null&&r<s?s:h!=null&&r>h?h:r},g=c!=null?t.Use(T.BeatUII18n,r=>{const s=t.computedOf(e,i)((l,b)=>{const v=l??0n;return b==null?!0:v>b}),h=t.computedOf(e,u)((l,b)=>{const v=l??0n;return b==null?!0:v<b}),o=(l,b)=>{const v=t.Value.get(e)??0n,k=t.Value.get(c),C=b?.shiftKey?10n:1n,y=v+k*C*l,S=i!=null?t.Value.get(i):void 0,D=u!=null?t.Value.get(u):void 0;if(l<0n&&S!=null&&y<S||l>0n&&D!=null&&y>D)return;const F=f(y);F!==v&&a&&a(F)};return A.Stack(t.attr.class("bc-number-input-steppers"),t.attr.type("button"),t.html.button(t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(h,n.disabled??!1)((l,b)=>!l||b)),t.on.click(l=>o(1n,l)),t.aria.label(r.$.incrementValue),T.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)((l,b)=>!l||b)),t.on.click(l=>o(-1n,l)),t.aria.label(r.$.decrementValue),T.Icon({icon:"line-md:minus",size:"xs"})))}):null,p=V.NullableResetAfter(e,n.disabled,a??d),B=I!=null&&g!=null?t.Fragment(g,p,I):I!=null?t.Fragment(p,I):g!=null?t.Fragment(g,p):p,O=a?r=>{const s=M(r);a(s===null?null:f(s))}:void 0,m=d?r=>{const s=M(r);d(s===null?null:f(s))}:void 0;return V.MaskInput({...n,value:t.Value.map(e,r=>r==null?"":r.toString()),onChange:O,onInput:m,after:B,mask:null,allowMode:"digits",class:"bc-number-input"})};function P(n){return e=>{const{value:c,onBlur:i,onChange:u}=e;return V.WithTemporal(a=>T.InputContainer({...e,input:t.input[n.inputType](T.CommonInputAttributes(e),t.attr.value(t.Value.map(c,n.valueToString)),t.attr.class("bc-input"),i!=null?t.on.blur(t.emitValue(i)):t.Empty,u!=null?t.on.change(t.emitValue(d=>u(n.parseValue(a,d)))):t.Empty)}))}}function N(n){return e=>{const{value:c,onBlur:i,onChange:u,onInput:a,after:d,disabled:I}=e,f=V.NullableResetAfter(c,I,u??a);return V.WithTemporal(g=>T.InputContainer({...e,input:t.input[n.inputType](T.CommonInputAttributes(e),t.attr.value(t.Value.map(c,p=>p==null?"":n.valueToString(p))),t.attr.class("bc-input"),i!=null?t.on.blur(t.emitValue(i)):t.Empty,u!=null?t.on.change(t.emitValue(p=>u(p===""?null:n.parseValue(g,p)))):t.Empty,a!=null?t.on.input(t.emitValue(p=>a(p===""?null:n.parseValue(g,p)))):t.Empty),after:d!=null?t.Fragment(f,d):f}))}}const z=P({inputType:"date",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainDate.from(e)}),U=N({inputType:"date",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainDate.from(e)}),$=P({inputType:"time",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainTime.from(e)}),W=N({inputType:"time",valueToString:n=>n.toString(),parseValue:(n,e)=>n.PlainTime.from(e)}),J=P({inputType:"datetime-local",valueToString:n=>n.toJSON(),parseValue:(n,e)=>n.PlainDateTime.from(e)}),K=N({inputType:"datetime-local",valueToString:n=>n.toJSON(),parseValue:(n,e)=>n.PlainDateTime.from(e)}),R=n=>{const{value:e,onChange:c}=n;return V.WithTemporal(i=>V.MaskInput({...n,value:t.Value.map(e,u=>u.toString()),onChange:c?u=>c(i.Duration.from(u)):void 0,onInput:void 0,...V.durationMaskConfig(i.Duration.from),placeholder:"P0DT0H0M0S"}))};exports.BigintInput=q;exports.DurationInput=R;exports.FileInput=E;exports.NullableBigintInput=w;exports.NullablePlainDateInput=U;exports.NullablePlainDateTimeInput=K;exports.NullablePlainTimeInput=W;exports.PlainDateInput=z;exports.PlainDateTimeInput=J;exports.PlainTimeInput=$;exports.createNullableTemporalInput=N;exports.createTemporalInput=P;
|