@tempots/beatui 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2019-7ojCcWUJ.cjs → 2019-BZdoHGOO.cjs} +1 -1
- package/dist/{2019-JwkYbae8.js → 2019-Bt_x1Mqh.js} +2 -2
- package/dist/{2020-BLYgDBO4.cjs → 2020-Bk0sGwzQ.cjs} +1 -1
- package/dist/{2020-kK0rQWn9.js → 2020-C2Ifu6RV.js} +2 -2
- package/dist/ar-CNSt2O6X.cjs +1 -0
- package/dist/{ar-BgrUqaxG.js → ar-CxLxXsxZ.js} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +547 -529
- package/dist/de-BlQbCGWj.cjs +1 -0
- package/dist/{de-D_sdCcAw.js → de-C7iv8rS5.js} +1 -1
- package/dist/es-Chf24sm_.cjs +1 -0
- package/dist/{es-DczvLqEV.js → es-DyivIdRS.js} +1 -1
- package/dist/fa-DPDyDuq_.cjs +1 -0
- package/dist/{fa-DhPP5Tgo.js → fa-T2168lXR.js} +1 -1
- package/dist/fr-BnxbTKeV.cjs +1 -0
- package/dist/{fr-D3WwoeQg.js → fr-ehNjmGC4.js} +1 -1
- package/dist/he-B9YZGENc.cjs +1 -0
- package/dist/{he-CFhi-6Rs.js → he-TD57Y17Z.js} +1 -1
- package/dist/{hi-Cqy8JcS7.js → hi-B4NbRIf5.js} +1 -1
- package/dist/hi-ZyCUnzwK.cjs +1 -0
- package/dist/{index-BeoVum6H.js → index-C494pbos.js} +1 -1
- package/dist/{index-D1rYqvi5.cjs → index-CZn1Pgwz.cjs} +4 -4
- package/dist/{index-CgH6d8ie.cjs → index-DN_efvsJ.cjs} +1 -1
- package/dist/{index-DYmfX0jE.js → index-DvqD_Y1P.js} +481 -481
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +187 -186
- package/dist/it-C5sp2CZC.cjs +1 -0
- package/dist/{it-CtMArqSp.js → it-D3x9ILJi.js} +1 -1
- package/dist/ja-31clSGC3.cjs +1 -0
- package/dist/{ja-UFqZT78C.js → ja-BSfyBDbo.js} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-B5LB1_X_.js → ko-DNahUn8W.js} +1 -1
- package/dist/ko-j4lOKHLl.cjs +1 -0
- package/dist/{modal-C2Aa-aVN.js → modal-5GSPw0e_.js} +1 -1
- package/dist/modal-CMuvQ7U-.cjs +1 -0
- package/dist/{nl-DCfHVqzQ.js → nl-DxveNtuq.js} +1 -1
- package/dist/nl-gQLaSMRt.cjs +1 -0
- package/dist/{translations-DpZ-btu9.cjs → notice-DTflcSdc.cjs} +2 -2
- package/dist/{translations-GO9sIajX.js → notice-DuvHeGyh.js} +476 -376
- package/dist/pl-BQTsowH4.cjs +1 -0
- package/dist/{pl-UcTv39q1.js → pl-DuKW800E.js} +1 -1
- package/dist/pt-DB-njyTA.cjs +1 -0
- package/dist/{pt-CXsgmVtb.js → pt-DPt1NyaL.js} +1 -1
- package/dist/ru-CIXDYJrr.cjs +1 -0
- package/dist/{ru-C0MvZW2g.js → ru-DwiRelVA.js} +1 -1
- package/dist/{tr-CIIkc1uL.js → tr-DQIURNMa.js} +1 -1
- package/dist/tr-Dx_9vMU9.cjs +1 -0
- package/dist/{translations-CB6iJ1Rn.js → translations-D4pKsgdi.js} +1 -1
- package/dist/translations-YkLfpjMl.cjs +1 -0
- package/dist/types/components/form/control/list-control.d.ts +4 -2
- package/dist/{ur-Cpx9oyTV.js → ur-ChuKCUVI.js} +1 -1
- package/dist/ur-DpGDKEUr.cjs +1 -0
- package/dist/{notice-c9Vbv45l.js → utils-CBZohCZi.js} +937 -1002
- package/dist/utils-Dz1qVHrn.cjs +1 -0
- package/dist/{vi-D24AUQ01.js → vi-CJ3gBepb.js} +1 -1
- package/dist/vi-CjpgcyEa.cjs +1 -0
- package/dist/zh-CLb0vdcx.cjs +1 -0
- package/dist/{zh-25YFRjoV.js → zh-DBCCiN2o.js} +1 -1
- package/package.json +1 -1
- package/dist/ar-BAb4yHZS.cjs +0 -1
- package/dist/de-Dn2CdXgD.cjs +0 -1
- package/dist/es-CEPxKSog.cjs +0 -1
- package/dist/fa-NvkKjIQ6.cjs +0 -1
- package/dist/fr-cR59lx1A.cjs +0 -1
- package/dist/he-CxSHPJMg.cjs +0 -1
- package/dist/hi-DLnz3lCX.cjs +0 -1
- package/dist/it-C7Kv6j-_.cjs +0 -1
- package/dist/ja-BPL80aw5.cjs +0 -1
- package/dist/ko-Cmt_34Xp.cjs +0 -1
- package/dist/modal-UsqvSvHy.cjs +0 -1
- package/dist/nl-B-WL9SX2.cjs +0 -1
- package/dist/notice-C7I6EmRh.cjs +0 -1
- package/dist/pl-TGqkSi2w.cjs +0 -1
- package/dist/pt-Ua_e-1JE.cjs +0 -1
- package/dist/ru-9YWCN6fR.cjs +0 -1
- package/dist/tr-D70Oy8aN.cjs +0 -1
- package/dist/translations-NYxsXjMT.cjs +0 -1
- package/dist/ur-DmxXuJ9O.cjs +0 -1
- package/dist/vi-Cboo_ueb.cjs +0 -1
- package/dist/zh-BXivX7rD.cjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const r=require("@tempots/dom"),$=require("@tempots/ui"),Q=require("./colors-Qc1mmmfr.cjs");function F(e,{units:t=["B","KB","MB","GB","TB"],decimalPlaces:n=0,locale:s}={}){if(e===0||e===0n)return new Intl.NumberFormat(s,{style:"unit",unit:"byte",unitDisplay:"short",maximumFractionDigits:0}).format(0).replace("byte",t[0]);let a,o;if(typeof e=="bigint"){let c=e<0n?-e:e;for(a=0;c>=1024n&&a<t.length-1;)c=c/1024n,a++;o=Number(e)/Math.pow(1024,a)}else a=Math.floor(Math.log(Math.abs(e))/Math.log(1024)),a=Math.min(a,t.length-1),o=e/Math.pow(1024,a);return new Intl.NumberFormat(s,{style:"unit",unit:"byte",unitDisplay:"short",minimumFractionDigits:a===0?0:n,maximumFractionDigits:a===0?0:n}).format(o).replace("byte",t[a])}const Y=new Map;function R(e){const t=Y.get(e)??0;return Y.set(e,t+1),`${e}-${t}`}const v={notAsked:{type:"NotAsked"},loading(e=void 0){return{type:"Loading",previousValue:e}},success(e){return{type:"AsyncSuccess",value:e}},failure(e){return{type:"AsyncFailure",error:e}},isSuccess(e){return e.type==="AsyncSuccess"},isFailure(e){return e.type==="AsyncFailure"},isNotAsked(e){return e.type==="NotAsked"},isLoading(e){return e.type==="Loading"},getOrElse(e,t){return v.isSuccess(e)?e.value:t},getOrElseLazy(e,t){return v.isSuccess(e)?e.value:t()},getOrNull(e){return v.isSuccess(e)?e.value:null},getOrUndefined(e){return v.isSuccess(e)?e.value:void 0},getUnsafe:e=>{if(v.isSuccess(e))return e.value;throw v.isFailure(e)?e.error:new Error("Cannot get value from a not-asked or loading result")},match:(e,{success:t,failure:n,loading:s,notAsked:a=s})=>v.isSuccess(e)?t(e.value):v.isFailure(e)?n(e.error):v.isNotAsked(e)?a():s(e.previousValue),whenSuccess:(e,t)=>(v.isSuccess(e)&&t(e.value),e),whenFailure:(e,t)=>(v.isFailure(e)&&t(e.error),e),equals:(e,t,n={valueEquals:(s,a)=>s===a,errorEquals:(s,a)=>s===a})=>e.type==="AsyncSuccess"&&t.type==="AsyncSuccess"?n.valueEquals(e.value,t.value):e.type==="AsyncFailure"&&t.type==="AsyncFailure"?n.errorEquals(e.error,t.error):e.type==="Loading"&&t.type==="Loading"?n.valueEquals(e.previousValue,t.previousValue):e.type==="NotAsked"&&t.type==="NotAsked",all:e=>{const t=[];for(const n of e)if(v.isSuccess(n))t.push(n.value);else return n;return v.success(t)},ofPromise:async e=>{try{const t=await e;return v.success(t)}catch(t){return v.failure(t instanceof Error?t:new Error(String(t)))}}},E=(e,t)=>e===t||e!==e&&t!==t,y={valid:{type:"valid"},invalid(e){return{type:"invalid",error:e}},isValid(e){return e.type==="valid"},isInvalid(e){return e.type==="invalid"},match:(e,t,n)=>y.isValid(e)?t():n(e.error),toResult:(e,t)=>y.match(e,()=>m.success(t),n=>m.failure(n)),whenValid:(e,t)=>(y.isValid(e)&&t(),e),whenInvalid:(e,t)=>(y.isInvalid(e)&&t(e.error),e)},m={success(e){return{type:"Success",value:e}},failure(e){return{type:"Failure",error:e}},map:(e,t)=>e.type==="Success"?m.success(t(e.value)):e,flatMap:(e,t)=>e.type==="Success"?t(e.value):e,toAsync(e){return m.match(e,t=>v.success(t),t=>v.failure(t))},toValidation(e){return m.match(e,()=>y.valid,t=>y.invalid(t))},isSuccess(e){return e.type==="Success"},isFailure(e){return e.type==="Failure"},getOrElse(e,t){return m.isSuccess(e)?e.value:t},getOrElseLazy(e,t){return m.isSuccess(e)?e.value:t()},getOrNull(e){return m.isSuccess(e)?e.value:null},getOrUndefined(e){return m.isSuccess(e)?e.value:void 0},getUnsafe:e=>{if(m.isSuccess(e))return e.value;throw e.error},match:(e,t,n)=>m.isSuccess(e)?t(e.value):n(e.error),whenSuccess:(e,t)=>(m.isSuccess(e)&&t(e.value),e),whenFailure:(e,t)=>(m.isFailure(e)&&t(e.error),e),combine:(e,t,n,s)=>m.match(e,a=>m.match(t,o=>m.success(n(a,o)),o=>m.failure(o)),a=>m.match(t,o=>m.failure(a),o=>m.failure(s(a,o)))),equals:(e,t,n={valueEquals:(s,a)=>s===a,errorEquals:(s,a)=>s===a})=>e.type==="Success"&&t.type==="Success"?n.valueEquals(e.value,t.value):e.type==="Failure"&&t.type==="Failure"?n.errorEquals(e.error,t.error):!1,all:e=>{const t=[];for(const n of e)if(m.isSuccess(n))t.push(n.value);else return n;return m.success(t)}},Z={loadingExtended:"Loading, please wait",loadingShort:"Loading...",locale:"Locale",iconDescription:"Icon",loadingIcon:"Loading icon",failedToLoadIcon:"Failed to load icon",editLabel:"Edit",selectOne:"Select one",selectMany:"Select many",noResults:"No results",passwordPlaceholderText:"Secret Password",togglePasswordVisibility:"Toggle password visibility",toggleMenu:"Toggle menu",toggleAside:"Toggle aside",mainNavigation:"Main navigation",sidebar:"Sidebar",closeDrawer:"Close drawer",closeModal:"Close modal",confirm:"Confirm",cancel:"Cancel",addLabel:"Add",removeItem:"Remove item",currentLocale:"English",ar:"Arabic",de:"German",en:"English",es:"Spanish",fr:"French",hi:"Hindi",it:"Italian",ja:"Japanese",ko:"Korean",nl:"Dutch",pl:"Polish",pt:"Portuguese",ru:"Russian",tr:"Turkish",vi:"Vietnamese",zh:"Chinese",he:"Hebrew",fa:"Persian",ur:"Urdu",emailPlaceholderText:"Enter your email",incrementValue:"Increment value",decrementValue:"Decrement value",dropZoneInstructions:e=>e?"Click to choose or drag files here, or press Enter or Space to open file selector":"Drag files here",fileSizeUnits:["Bytes","KB","MB","GB","TB"],removeFile:"Remove file",clearAllFiles:"Clear all files",clearValue:"Reset",unknownType:"Unknown type",filesInputInstructions:(e,t,n)=>{let s=e==null||e>1?"Click to choose or drag files here":"Click to choose or drag a file here";if(e||t){const a=[];if(e!=null&&e>1&&a.push(`up to ${e} files`),t&&n){const o=F(t,{units:n});a.push(`max ${o} each`)}a.length>0&&(s+=` (${a.join(", ")})`)}else if(t&&n){const a=F(t,{units:n});s+=` (max ${a})`}return s}},Ee=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"})),X=Z,ee="en",te=(e,t,n)=>{const s=e[t];return s?typeof s=="function"?s():Promise.resolve(s):new Promise((a,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},Ve=new Set(["ar","he","fa","ur","ps","sd","ku","dv","yi","ji","iw","in"]);function W(e){if(!e)return"ltr";const t=e.split(/[-_]/)[0].toLowerCase();return Ve.has(t)?"rtl":"ltr"}function re(e,t){return e==="auto"?W(t):e}function Oe(e){return`b-${e}`}function _e(e){return W(e)==="rtl"}function Le(e){return e==="ltr"?"rtl":"ltr"}const ne={ltr:{"inline-start":"left","inline-end":"right","block-start":"top","block-end":"bottom"},rtl:{"inline-start":"right","inline-end":"left","block-start":"top","block-end":"bottom"}};function Te(e,t){return ne[t][e]}const se={mark:r.makeProviderMark("Locale"),create:e=>{const t=r.localStorageProp({defaultValue:navigator.language??"en-US",key:"beatui-locale"}),n=r.localStorageProp({defaultValue:"auto",key:"beatui-direction-preference"}),s=r.computedOf(t,n)((o,i)=>re(i,o));return{value:{locale:t,setLocale:o=>t.set(o),direction:s,directionPreference:n,setDirectionPreference:o=>n.set(o)},dispose:()=>{t.dispose(),n.dispose(),s.dispose()}}}},{variants:Me,special:Ae,overrides:H}=Q.backgroundConfig;function V(e,t){switch(e){case"white":return"var(--color-white)";case"black":return"var(--color-black)";case"transparent":return"transparent";default:return Q.getColorVar(e,t)}}function ae(e,t){const n=Ae[e];if(!n)return;if(t==="light")return n;const s=H[e];return s?s[t]:n}function D(e,t,n){const s=H[e];if(s){const o=s[n];if(o)return{backgroundColor:o.backgroundColor,textColor:o.color}}if(t==="solid"){const o=ae(e,n);if(o)return{backgroundColor:o.backgroundColor,textColor:o.color}}const a=Me[t][n];return{backgroundColor:V(e,a.bgShade),textColor:a.textColor}}const Be={light:{shade:600,textColor:"var(--color-white)"},dark:{shade:600,textColor:"var(--text-inverted-dark)"}},qe={light:{shade:300,textColor:"var(--text-normal-light)"},dark:{shade:700,textColor:"var(--text-normal-dark)"}},$e={light:{shade:400,textColor:"var(--text-normal-light)"},dark:{shade:600,textColor:"var(--text-normal-dark)"}};function x(e,t,n){const s=H[e];if(s){const o=s[n];if(o)return{backgroundColor:o.backgroundColor,textColor:o.color}}if(t==="solid"){const o=ae(e,n);if(o)return{backgroundColor:o.backgroundColor,textColor:o.color};const i=Be[n];return{backgroundColor:V(e,i.shade),textColor:i.textColor}}const a=t==="light"?qe[n]:$e[n];return{backgroundColor:V(e,a.shade),textColor:a.textColor}}function j(e,t){const n=t==="light"?500:600;switch(e){case"white":return t==="light"?"var(--text-inverse-light)":"var(--text-inverted-dark)";case"black":return"var(--color-black)";case"transparent":return"transparent";default:return V(e,n)}}function P(e,t){return e==="white"?"var(--color-white)":e==="black"?"var(--color-black)":e==="transparent"?"inherit":V(e,t==="light"?800:200)}function J(e,t,n){return t==="soft"?V(e,n==="light"?300:700):V(e,n==="light"?500:600)}const Fe="bui-icons",M=new Map,U=(()=>{try{return typeof indexedDB<"u"&&indexedDB!==null}catch{return!1}})();function je(){return U?new Promise((e,t)=>{const n=indexedDB.open(Fe,1);n.onupgradeneeded=function(s){const a=s.target.result;a.objectStoreNames.contains("icons")||a.createObjectStore("icons")},n.onsuccess=function(){e(n.result)},n.onerror=function(){t(n.error)}}):Promise.reject(new Error("IndexedDB not available"))}const A=U?je():null;function oe(e,t){return new Promise(async(n,s)=>{try{if(A){const o=(await A).transaction("icons","readwrite");o.objectStore("icons").put(t,e),o.oncomplete=n,o.onerror=s}else M.set(e,t),n(void 0)}catch{M.set(e,t),n(void 0)}})}function ie(e){return new Promise(async(t,n)=>{try{if(A){const i=(await A).transaction("icons","readonly").objectStore("icons").get(e);i.onsuccess=function(){t(i.result)},i.onerror=n}else t(M.get(e)||null)}catch{t(M.get(e)||null)}})}async function Ne(e){const t=`https://api.iconify.design/${e}.svg`;return fetch(t).then(n=>{if(n.status===200)return n.text();throw new Error(`Failed to load icon: ${e}`)})}async function Re(e){const t=e.replace(":","/"),n=await ie(t);if(n)return n;const s=await Ne(t);return await oe(t,s),s}function We(e){return["bc-icon",`bc-icon--${e}`].join(" ")}function He(e,t="solid"){if(!e)return"";const n=J(e,t,"light"),s=J(e,t,"dark");return`--icon-color: ${n}; --icon-color-dark: ${s}`}function O({icon:e,size:t="md",color:n,title:s,accessibility:a="auto",tone:o="solid"},...i){const l=r.computedOf(a,s)((c,d)=>c==="decorative"?!1:c==="informative"?!0:d!=null&&d!=="");return r.Use(_,c=>r.html.span(r.attr.class(r.computedOf(t,n)(d=>We(d??"md"))),r.attr.style(r.computedOf(n,o)((d,u)=>He(d??void 0,u??"solid"))),r.When(l,()=>r.Fragment(r.attr.role("img"),r.aria.label(r.coalesce(s,c.$.iconDescription))),()=>r.aria.hidden(!0)),$.WhenInViewport({once:!0},()=>$.Query({request:e,load:({request:d})=>Re(d),convertError:String,success:({value:d})=>r.html.span(r.style.width("100%"),r.style.height("100%"),r.attr.innerHTML(d)),pending:()=>r.html.span(r.attr.class("animate-spin"),r.When(l,()=>r.Fragment(r.attr.role("img"),r.aria.label(c.$.loadingIcon)),()=>r.aria.hidden(!0)),"↻"),failure:({error:d})=>r.html.span(r.attr.title(d),r.attr.class("text-red-500"),r.When(l,()=>r.Fragment(r.attr.role("img"),r.aria.label(c.$.failedToLoadIcon)),()=>r.aria.hidden(!0)),"🚫")})),...i))}function le(e,t,n){const s=["bc-button",`bc-button--size-${e}`,`bc-control--padding-${e}`,`bc-control--rounded-${t}`];return n&&s.push("bc-button--loading"),s.join(" ")}function ce(e,t,n){const s=new Map;s.set("--button-text-shadow","var(--text-shadow-none)"),s.set("--button-text-shadow-dark","var(--text-shadow-none)");const a=(o,i,l,c)=>{n||(s.set("--button-bg-hover",o),s.set("--button-text-hover",l),s.set("--button-bg-hover-dark",i),s.set("--button-text-hover-dark",c))};switch(e){case"filled":{const o=D(t,"solid","light"),i=D(t,"solid","dark");s.set("--button-bg",o.backgroundColor),s.set("--button-text",o.textColor),s.set("--button-bg-dark",i.backgroundColor),s.set("--button-text-dark",i.textColor),s.set("--button-text-shadow","var(--text-shadow-button-filled, var(--text-shadow-sm))"),s.set("--button-text-shadow-dark","var(--text-shadow-button-filled, var(--text-shadow-sm))");const l=x(t,"solid","light"),c=x(t,"solid","dark");a(l.backgroundColor,c.backgroundColor,l.textColor,c.textColor);break}case"light":{const o=D(t,"light","light"),i=D(t,"light","dark");s.set("--button-bg",o.backgroundColor),s.set("--button-text",o.textColor),s.set("--button-bg-dark",i.backgroundColor),s.set("--button-text-dark",i.textColor);const l=x(t,"light","light"),c=x(t,"light","dark");a(l.backgroundColor,c.backgroundColor,l.textColor,c.textColor);break}case"outline":{s.set("--button-bg","transparent"),s.set("--button-bg-dark","transparent"),s.set("--button-border",j(t,"light")),s.set("--button-border-dark",j(t,"dark")),s.set("--button-text",P(t,"light")),s.set("--button-text-dark",P(t,"dark")),s.set("--button-text-shadow","var(--text-shadow-button-light, var(--text-shadow-xs))"),s.set("--button-text-shadow-dark","var(--text-shadow-button-light, var(--text-shadow-xs))");const o=x(t,"light","light"),i=x(t,"light","dark");a(o.backgroundColor,i.backgroundColor,o.textColor,i.textColor);break}case"default":{const o=D("neutral","light","light"),i=D("neutral","light","dark");s.set("--button-bg",o.backgroundColor),s.set("--button-text",P(t,"light")),s.set("--button-bg-dark",i.backgroundColor),s.set("--button-text-dark",P(t,"dark")),s.set("--button-text-shadow","var(--text-shadow-button-default, var(--text-shadow-2xs))"),s.set("--button-text-shadow-dark","var(--text-shadow-button-default, var(--text-shadow-2xs))");const l=x("base","light","light"),c=x("base","light","dark");a(l.backgroundColor,c.backgroundColor,s.get("--button-text")??o.textColor,s.get("--button-text-dark")??i.textColor);break}case"text":{s.set("--button-bg","transparent"),s.set("--button-bg-dark","transparent"),s.set("--button-text",P(t,"light")),s.set("--button-text-dark",P(t,"dark")),n||s.set("--button-hover-decoration","underline");break}}return Array.from(s.entries()).map(([o,i])=>`${o}: ${i}`).join("; ")}function ue({type:e="button",disabled:t,loading:n,variant:s="filled",size:a="md",color:o="base",roundedness:i="sm",onClick:l=()=>{}},...c){const d=r.prop(null);return r.Use(_,u=>r.html.button(r.attr.type(e),r.attr.disabled(r.computedOf(t,n)((h,f)=>h||f)),r.aria.busy(n??!1),r.When(n??!1,()=>r.aria.label(u.$.loadingExtended)),r.attr.class(r.computedOf(a,i,n)((h,f,b)=>le(h??"md",f??"sm",b))),r.attr.style(r.computedOf(s,o,t)((h,f,b)=>ce(h??"filled",f??"base",b))),r.When(n??!1,()=>r.Fragment(r.style.width(d.map(h=>h==null?"":`${h.width}px`)),r.style.height(d.map(h=>h==null?"":`${h.height}px`)),O({icon:"line-md:loading-twotone-loop",size:a??"md"}),r.html.span(r.attr.class("sr-only"),r.aria.live("polite"),u.$.loadingExtended)),()=>r.Fragment(r.on.click(l),...c)),r.When(n!=null,()=>$.ElementRect(h=>r.OnDispose(h.on(f=>{r.Value.get(n??!1)||d.set(f)}))))))}function Ue({size:e="sm",icon:t="line-md:close",disabled:n,roundedness:s="full",color:a="base",onClick:o,label:i},...l){return r.Use(_,c=>{const d=r.coalesce(i,c.$.closeModal);return ue({variant:"text",size:e,roundedness:s,disabled:n,color:a,onClick:o},r.attr.title(d),r.aria.label(d),...l,O({icon:t,size:e??"sm"}))})}function ze(e,t,n){const s=[e?"bc-base-input-container":"bc-input-container"];return t?s.push(e?"bc-base-input-container--disabled":"bc-input-container--disabled"):s.push(e?"bc-base-input-container--default":"bc-input-container--default"),n&&s.push("bc-input-container--error"),s.join(" ")}const T=({baseContainer:e,disabled:t,input:n,before:s,after:a,hasError:o,focusableSelector:i="input, select, textarea",growInput:l=!0},...c)=>{const d=r.Value.map(t??!1,u=>u);return r.html.div(r.WithElement(u=>{const h=()=>{u.querySelector(i)?.focus()};return u.addEventListener("click",h),r.OnDispose(()=>u.removeEventListener("click",h))}),r.attr.class(r.computedOf(e,d,o??!1)((u,h,f)=>ze(u??!1,h??!1,f??!1))),s!=null?r.html.span(r.attr.class("bc-input-container__before"),s):null,r.html.div(r.attr.class("bc-input-container__input"),r.attr.class(r.Value.map(l,u=>u?"bc-input-container__input--grow":"")),n),a!=null?r.html.span(r.attr.class("bc-input-container__after"),a):null,...c)};function B(e){return`bc-label bc-label--${e}`}const Ge=(...e)=>r.html.span(r.attr.class(B("emphasis")),...e),de=(...e)=>r.html.span(r.attr.class(B("default")),...e),he=(...e)=>r.html.span(r.attr.class(B("muted")),...e),Ke=(...e)=>r.html.span(r.attr.class(B("danger")),...e),Ye=e=>{const{value:t,onBlur:n,onChange:s,placeholder:a,disabled:o,id:i,checkedIcon:l,uncheckedIcon:c,iconSize:d="lg"}=e,u=i??R("checkbox"),h=`${u}-label`,f=()=>{if(r.Value.get(o??!1))return;const p=r.Value.get(t);s?.(!p)},b=p=>{r.Value.get(o??!1)||(p.key===" "||p.key==="Enter")&&(p.preventDefault(),f())};return T({baseContainer:!0,growInput:!1,...e,input:r.html.span(r.attr.class("bc-checkbox-input"),r.html.span(r.attr.class("bc-checkbox-input__checkbox"),r.attr.class(r.Value.map(t,p=>p?"bc-checkbox-input__checkbox--checked":"bc-checkbox-input__checkbox--unchecked")),r.attr.class(r.Value.map(o??!1,p=>p?"bc-checkbox-input__checkbox--disabled":"")),r.attr.id(u),r.attr.role("checkbox"),r.attr.tabindex(r.Value.map(o??!1,p=>p?-1:0)),r.aria.checked(t),r.aria.disabled(o),a!=null?r.aria.labelledby(h):r.Empty,r.on.keydown(b),n!=null?r.on.blur(n):r.Empty,O({icon:r.computedOf(t,l,c)((p,g,k)=>p?g??"akar-icons/check-box-fill":k??"akar-icons/box"),accessibility:"decorative",size:d})),a!=null?r.html.label(r.attr.class("bc-checkbox-input__label"),r.attr.id(h),r.attr.for(u),he(a)):r.Empty)},r.on.click(f))},q=({autocomplete:e,autofocus:t,class:n,disabled:s,name:a,placeholder:o,id:i,required:l,hasError:c})=>r.Fragment(r.attr.autocomplete(e),r.attr.autofocus(t),r.attr.class(n),r.attr.disabled(s),r.attr.name(a??i),r.attr.placeholder(o),r.attr.id(i),r.aria.required(l),c!=null?r.aria.invalid(c??!1):null),pe=r.html.span(r.attr.class("bc-input-wrapper__required")," *");function Je(e){const t=["bc-input-wrapper"];return e&&t.push("bc-input-wrapper--horizontal"),t.join(" ")}function Qe(e,t){const n=["bc-input-wrapper__label-text"];return e?n.push("bc-input-wrapper__label-text--error"):t?n.push("bc-input-wrapper__label-text--disabled"):n.push("bc-input-wrapper__label-text--default"),n.join(" ")}const z=({required:e,label:t,labelChildren:n,context:s,description:a,content:o,error:i,labelFor:l,hasError:c,disabled:d,horizontal:u},...h)=>{const f=c??i!=null,b=d??!1,p=u??!1,g=R("input-wrapper"),k=a?`${g}-description`:void 0,C=i!=null?`${g}-error`:void 0;return r.html.div(r.attr.class(r.Value.map(p,w=>Je(w))),t!=null||s!=null?r.html.div(r.attr.class("bc-input-wrapper__header"),r.html.div(r.attr.class("bc-input-wrapper__label-section"),r.html.label(r.attr.class("bc-input-wrapper__label"),l!=null?r.attr.for(l):r.Empty,r.html.span(r.attr.class(r.computedOf(f,b)((w,I)=>Qe(w??!1,I??!1))),t),t!=null&&e?pe:r.Empty),r.When(r.computedOf(p,a)((w,I)=>w&&I!=null),()=>r.html.div(r.attr.class("bc-input-wrapper__description bc-input-wrapper__description--under-label"),r.attr.id(k),a))),s!=null?de(s):r.Empty,n):r.Empty,r.html.div(r.attr.class("bc-input-wrapper__content"),[k,C].filter(Boolean).length>0?r.dataAttr.describedby([k,C].filter(Boolean).join(" ")):r.Empty,e?r.dataAttr.required("true"):r.Empty,r.When(f,()=>r.dataAttr.invalid("true")),o),r.When(r.computedOf(p,a)((w,I)=>!w&&I!=null),()=>r.html.div(r.attr.class("bc-input-wrapper__description"),r.attr.id(k),a)),i!=null?r.When(f,()=>r.html.div(r.attr.class("bc-input-wrapper__error"),r.attr.id(C),r.aria.live("polite"),r.attr.role("alert"),i)):null,...h)};function Ze(...e){return r.html.div(r.attr.class("bc-stack"),...e)}const Xe=e=>{const t={name:"email",autocomplete:"email",...e},{value:n,before:s,onBlur:a,onChange:o,onInput:i,placeholder:l}=t,c=s??O({icon:"line-md:email",size:"sm",color:"neutral"});return r.Use(_,d=>T({...e,before:c,input:r.input.email(q(t),r.attr.placeholder(r.coalesce(l,d.$.emailPlaceholderText)),r.attr.value(n),r.attr.class("bc-input"),a!=null?r.on.blur(r.emitValue(a)):r.Empty,o!=null?r.on.change(r.emitValue(o)):r.Empty,i!=null?r.on.input(r.emitValue(i)):r.Empty)}))},et=e=>{const{value:t,onBlur:n,onChange:s,onInput:a}=e;return T({...e,input:r.input.text(q(e),r.attr.value(t),r.attr.class("bc-input"),n!=null?r.on.blur(r.emitValue(n)):r.Empty,s!=null?r.on.change(r.emitValue(s)):r.Empty,a!=null?r.on.input(r.emitValue(a)):r.Empty)})},tt=e=>{const{value:t,onBlur:n,onChange:s,onInput:a,before:o,after:i,hasError:l,disabled:c,autocomplete:d,placeholder:u,...h}=e,f={name:"password",disabled:c,...h},b=r.prop(!0),p=r.computedOf(b,d)((g,k)=>g?k??"current-password":"off");return r.Use(_,g=>{const k=r.computedOf(g.$.passwordPlaceholderText,b,u)((w,I,Pe)=>I?"•••••••••••••••":Pe??w),C=r.html.button(r.attr.class("bc-input-container__password-toggle"),r.aria.label(g.$.togglePasswordVisibility),r.on.click(()=>b.update(w=>!w)),r.When(b,()=>O({icon:"line-md:watch"}),()=>O({icon:"line-md:watch-off"})));return T({before:o,disabled:c,hasError:l,input:r.html.input(q({...f,autocomplete:p,placeholder:k}),r.When(b,()=>r.Fragment(r.attr.type("password")),()=>r.Fragment(r.attr.type("text"))),r.attr.class("bc-input"),r.attr.value(t),n!=null?r.on.blur(r.emitValue(n)):r.Empty,s!=null?r.on.change(r.emitValue(s)):r.Empty,a!=null?r.on.input(r.emitValue(a)):r.Empty),after:i!=null?r.Fragment(C,i):C})})},fe=(e,t)=>()=>{e.markTouched(),t?.()},me=(e,t)=>n=>{e.change(n),t?.(n)};function G(e,t){const{controller:n,onBlur:s,onChange:a,...o}=t;return e({id:n.name,disabled:n.disabled,value:n.value,hasError:n.errorVisible,...o,onChange:me(n,a),onBlur:fe(n,s)})}function rt(e,t,...n){return z({...t,content:G(e,t)},...n)}function be(e,t){const{toInput:n,fromInput:s,controller:a,...o}=t,i=a.transform(n,s);return G(e,{...o,controller:i})}function nt(e,t,...n){return z({...t,content:be(e,t)},...n)}function st(e){return e.split(".").map(n=>{const s=n.match(/^\[(\d+)\]$/);return s?Number(s[1]):n})}function ge(e){return typeof e=="number"?`[${e}]`:`.${e}`}function ve(e){if(e.length===0)return"";const[t,...n]=e;return[typeof t=="number"?`[${t}]`:t,...n.map(ge)].join("")}function L(e){return function(n){if(n.type==="valid")return n;let s=n.error;for(const a of e)if(s=s?.dependencies?.[a],s==null)return y.valid;return y.invalid(s)}}class S{path;change;value;status;error;hasError;touched;errorVisible;dirty;dependencyErrors;#e={disabled:r.prop(!1),touched:r.prop(!1)};#r;#t=r.prop(void 0);parent;disabled;#n=[];disabledOrHasErrors;constructor(t,n,s,a,o,i=E){this.path=t,this.change=n,this.value=s,this.status=a,this.#r=i,this.#t.set(s.value),this.error=a.map(l=>l?.type==="invalid"?l.error?.message:void 0),this.hasError=this.error.map(l=>l!=null),this.touched=this.#e.touched,o.validationMode?this.errorVisible=r.computedOf(this.hasError,this.touched,o.validationMode)((l,c,d)=>d==="continuous"?!!l:!!l&&!!c):this.errorVisible=r.computedOf(this.hasError,this.touched)((l,c)=>!!l&&!!c),this.dirty=r.computedOf(this.value,this.#t)((l,c)=>!this.#r(l,c)),this.dependencyErrors=a.map(l=>l?.type==="invalid"?l.error?.dependencies:void 0),this.parent=o,this.disabled=r.computedOf(this.#e.disabled,o.disabled)((l,c)=>l||c),this.disabledOrHasErrors=r.computedOf(this.disabled,this.hasError)((l,c)=>l||c),this.onDispose(()=>{this.#e.disabled.dispose(),this.#e.touched.dispose(),this.disabled.dispose(),this.error.dispose(),this.errorVisible.dispose(),this.dirty.dispose(),this.#t.dispose(),this.dependencyErrors.dispose(),this.disabledOrHasErrors.dispose()})}get name(){return ve(this.path)}onDispose=t=>{this.#n.push(t)};dispose=()=>{for(const t of this.#n)try{t()}catch(n){console.error("Error in dispose callback:",n)}this.#n.length=0};setDisabled=t=>{this.#e.disabled.set(t)};disable=()=>this.setDisabled(!0);enable=()=>this.setDisabled(!1);markTouched=()=>{this.#e.touched.set(!0)};resetTouched=()=>{this.#e.touched.set(!1)};markPristine=()=>{this.#t.set(this.value.value)};reset=()=>{this.change(this.#t.value)};array=(t=E)=>new ke(this.path,this.change,this.value,this.status,this.parent,t);object=(t=E)=>new ye(this.path,this.change,this.value,this.status,this.parent,t);transform=(t,n,s=[],a=E)=>new S([...this.path,...s],o=>this.change(n(o)),this.value.map(t,a),this.status.map(L(s)),this.parent,a);asyncTransform=(t,n,s,a=[],o=E)=>new S([...this.path,...a],i=>{n(i).then(l=>this.change(l))},this.value.mapAsync(t,s,void 0,o),this.status.map(L(a)),this.parent,o)}class ye extends S{#e=new Map;#r=new Map;#t=new Map;#n=r.prop(!1);touchedDeep=this.#n;#a=new Map;#s=new Map;#i=r.prop(!1);dirtyDeep=this.#i;#c;#u;#l=()=>{let t=!1;for(const n of this.#r.values())if(n){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,n,s,a,o,i){super(t,n,s.map(c=>c??{},i),a,o,i),this.#c=this.touched.on(()=>{this.#l()}),this.#u=this.dirty.on(()=>{this.#o()});const l=this.value.on(()=>this.#o());this.onDispose(()=>{for(const c of this.#e.values())c.dispose();this.#e.clear();for(const c of this.#t.values())c();this.#t.clear(),this.#r.clear(),this.#n.dispose();for(const c of this.#s.values())c();this.#s.clear(),this.#a.clear(),this.#i.dispose(),this.#c(),this.#u(),l()})}field=t=>{if(this.#e.has(t))return this.#e.get(t);const n=async i=>{this.change({...this.value.value,[t]:i})},s=new S([...this.path,t],n,this.value.map(i=>i[t]),this.status.map(L([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e.set(t,s);const a=s.touched.on(i=>{this.#r.set(t,i),this.#l()});this.#t.set(t,a);const o=s.dirty.on(i=>{this.#a.set(t,i),this.#o()});return this.#s.set(t,o),s};markAllTouched=()=>{this.markTouched();const t=this.value.value;for(const n of Object.keys(t))this.field(n).markTouched();for(const n of this.#e.values())n.markTouched()};markAllPristine=()=>{this.markPristine();const t=this.value.value;for(const n of Object.keys(t))this.field(n).markPristine?.();for(const n of this.#e.values())n.markPristine?.()};#o=()=>{let t=!1;for(const n of this.#a.values())if(n){t=!0;break}this.#i.set(this.dirty.value||t)}}class ke extends S{#e=new Array;length;#r=new Map;#t=new Map;#n=r.prop(!1);touchedDeep=this.#n;#a=new Map;#s=new Map;#i=r.prop(!1);dirtyDeep=this.#i;#c;#u;#l=()=>{let t=!1;for(const n of this.#r.values())if(n){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,n,s,a,o,i){const l=s.map(u=>u??[],i);super(t,n,l,a,o,i);const c=l.on(u=>{const h=this.#e.length-u.length;h>0&&(this.#e.splice(u.length,h).forEach((f,b)=>{const p=u.length+b;f.dispose(),this.#t.get(p)?.(),this.#t.delete(p),this.#r.delete(p),this.#s.get(p)?.(),this.#s.delete(p),this.#a.delete(p)}),this.#l(),this.#o())});this.length=l.map(u=>u.length),this.#c=this.touched.on(()=>{this.#l()}),this.#u=this.dirty.on(()=>{this.#o()});const d=this.value.on(()=>this.#o());this.onDispose(()=>{for(const u of this.#e)u.dispose();this.length.dispose(),this.#e.length=0,c(),l.dispose();for(const u of this.#t.values())u();this.#t.clear(),this.#r.clear(),this.#n.dispose();for(const u of this.#s.values())u();this.#s.clear(),this.#a.clear(),this.#i.dispose(),this.#c(),this.#u(),d()})}item=t=>{if(this.#e[t])return this.#e[t];const n=async i=>{const l=this.value.value.slice();l[t]=i,this.change(l)},s=new S([...this.path,t],n,this.value.map(i=>i[t]),this.status.map(L([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e[t]=s;const a=s.touched.on(i=>{this.#r.set(t,i),this.#l()});this.#t.set(t,a);const o=s.dirty.on(i=>{this.#a.set(t,i),this.#o()});return this.#s.set(t,o),s};push=(...t)=>{this.change([...this.value.value,...t])};pop=()=>{this.splice(this.value.value.length-1,1)};shift=()=>{this.splice(0,1)};unshift=(...t)=>{this.change([...t,...this.value.value])};removeAt=t=>{this.splice(t,1)};splice=(t,n)=>{const s=this.value.value.slice();s.splice(t,n),this.change(s)};move=(t,n,s=1)=>{if(s<1||t===n)return;const a=this.value.value.slice(),o=a.splice(t,s);a.splice(n,0,...o),this.change(a)};markAllTouched=()=>{this.markTouched();const t=this.value.value.length;for(let n=0;n<t;n++)this.item(n).markTouched()};markAllPristine=()=>{this.markPristine();const t=this.value.value.length;for(let n=0;n<t;n++)this.item(n).markPristine?.()};#o=()=>{let t=!1;for(const n of this.#a.values())if(n){t=!0;break}this.#i.set(this.dirty.value||t)}}function we(e){function t(n){return typeof n=="number"?n:n.toString()}return e.map(n=>typeof n=="object"&&n.key!=null?t(n.key):t(n))}function Ce(e){const t=e.filter(a=>a.path==null||a.path.length===0).map(a=>a.message),n=e.filter(a=>a.path!=null&&a.path.length>0).reduce((a,o)=>{const i=we(o.path),l=i.pop();let c=a;for(const d of i)c.dependencies==null&&(c.dependencies={}),c.dependencies[d]==null&&(c.dependencies[d]={}),c=c.dependencies[d];return c.dependencies==null&&(c.dependencies={}),c.dependencies[l]={message:o.message},a},{}),s=t.join(`
|
|
2
|
-
`);return{...n,message:s!=""?s:void 0}}function
|
|
1
|
+
"use strict";const r=require("@tempots/dom"),q=require("@tempots/ui"),Q=require("./colors-Qc1mmmfr.cjs");function F(e,{units:t=["B","KB","MB","GB","TB"],decimalPlaces:n=0,locale:s}={}){if(e===0||e===0n)return new Intl.NumberFormat(s,{style:"unit",unit:"byte",unitDisplay:"short",maximumFractionDigits:0}).format(0).replace("byte",t[0]);let a,o;if(typeof e=="bigint"){let c=e<0n?-e:e;for(a=0;c>=1024n&&a<t.length-1;)c=c/1024n,a++;o=Number(e)/Math.pow(1024,a)}else a=Math.floor(Math.log(Math.abs(e))/Math.log(1024)),a=Math.min(a,t.length-1),o=e/Math.pow(1024,a);return new Intl.NumberFormat(s,{style:"unit",unit:"byte",unitDisplay:"short",minimumFractionDigits:a===0?0:n,maximumFractionDigits:a===0?0:n}).format(o).replace("byte",t[a])}const Y=new Map;function R(e){const t=Y.get(e)??0;return Y.set(e,t+1),`${e}-${t}`}const y={notAsked:{type:"NotAsked"},loading(e=void 0){return{type:"Loading",previousValue:e}},success(e){return{type:"AsyncSuccess",value:e}},failure(e){return{type:"AsyncFailure",error:e}},isSuccess(e){return e.type==="AsyncSuccess"},isFailure(e){return e.type==="AsyncFailure"},isNotAsked(e){return e.type==="NotAsked"},isLoading(e){return e.type==="Loading"},getOrElse(e,t){return y.isSuccess(e)?e.value:t},getOrElseLazy(e,t){return y.isSuccess(e)?e.value:t()},getOrNull(e){return y.isSuccess(e)?e.value:null},getOrUndefined(e){return y.isSuccess(e)?e.value:void 0},getUnsafe:e=>{if(y.isSuccess(e))return e.value;throw y.isFailure(e)?e.error:new Error("Cannot get value from a not-asked or loading result")},match:(e,{success:t,failure:n,loading:s,notAsked:a=s})=>y.isSuccess(e)?t(e.value):y.isFailure(e)?n(e.error):y.isNotAsked(e)?a():s(e.previousValue),whenSuccess:(e,t)=>(y.isSuccess(e)&&t(e.value),e),whenFailure:(e,t)=>(y.isFailure(e)&&t(e.error),e),equals:(e,t,n={valueEquals:(s,a)=>s===a,errorEquals:(s,a)=>s===a})=>e.type==="AsyncSuccess"&&t.type==="AsyncSuccess"?n.valueEquals(e.value,t.value):e.type==="AsyncFailure"&&t.type==="AsyncFailure"?n.errorEquals(e.error,t.error):e.type==="Loading"&&t.type==="Loading"?n.valueEquals(e.previousValue,t.previousValue):e.type==="NotAsked"&&t.type==="NotAsked",all:e=>{const t=[];for(const n of e)if(y.isSuccess(n))t.push(n.value);else return n;return y.success(t)},ofPromise:async e=>{try{const t=await e;return y.success(t)}catch(t){return y.failure(t instanceof Error?t:new Error(String(t)))}}},P=(e,t)=>e===t||e!==e&&t!==t,k={valid:{type:"valid"},invalid(e){return{type:"invalid",error:e}},isValid(e){return e.type==="valid"},isInvalid(e){return e.type==="invalid"},match:(e,t,n)=>k.isValid(e)?t():n(e.error),toResult:(e,t)=>k.match(e,()=>v.success(t),n=>v.failure(n)),whenValid:(e,t)=>(k.isValid(e)&&t(),e),whenInvalid:(e,t)=>(k.isInvalid(e)&&t(e.error),e)},v={success(e){return{type:"Success",value:e}},failure(e){return{type:"Failure",error:e}},map:(e,t)=>e.type==="Success"?v.success(t(e.value)):e,flatMap:(e,t)=>e.type==="Success"?t(e.value):e,toAsync(e){return v.match(e,t=>y.success(t),t=>y.failure(t))},toValidation(e){return v.match(e,()=>k.valid,t=>k.invalid(t))},isSuccess(e){return e.type==="Success"},isFailure(e){return e.type==="Failure"},getOrElse(e,t){return v.isSuccess(e)?e.value:t},getOrElseLazy(e,t){return v.isSuccess(e)?e.value:t()},getOrNull(e){return v.isSuccess(e)?e.value:null},getOrUndefined(e){return v.isSuccess(e)?e.value:void 0},getUnsafe:e=>{if(v.isSuccess(e))return e.value;throw e.error},match:(e,t,n)=>v.isSuccess(e)?t(e.value):n(e.error),whenSuccess:(e,t)=>(v.isSuccess(e)&&t(e.value),e),whenFailure:(e,t)=>(v.isFailure(e)&&t(e.error),e),combine:(e,t,n,s)=>v.match(e,a=>v.match(t,o=>v.success(n(a,o)),o=>v.failure(o)),a=>v.match(t,o=>v.failure(a),o=>v.failure(s(a,o)))),equals:(e,t,n={valueEquals:(s,a)=>s===a,errorEquals:(s,a)=>s===a})=>e.type==="Success"&&t.type==="Success"?n.valueEquals(e.value,t.value):e.type==="Failure"&&t.type==="Failure"?n.errorEquals(e.error,t.error):!1,all:e=>{const t=[];for(const n of e)if(v.isSuccess(n))t.push(n.value);else return n;return v.success(t)}},Z={loadingExtended:"Loading, please wait",loadingShort:"Loading...",locale:"Locale",iconDescription:"Icon",loadingIcon:"Loading icon",failedToLoadIcon:"Failed to load icon",editLabel:"Edit",selectOne:"Select one",selectMany:"Select many",noResults:"No results",passwordPlaceholderText:"Secret Password",togglePasswordVisibility:"Toggle password visibility",toggleMenu:"Toggle menu",toggleAside:"Toggle aside",mainNavigation:"Main navigation",sidebar:"Sidebar",closeDrawer:"Close drawer",closeModal:"Close modal",confirm:"Confirm",cancel:"Cancel",addLabel:"Add",removeItem:"Remove item",currentLocale:"English",ar:"Arabic",de:"German",en:"English",es:"Spanish",fr:"French",hi:"Hindi",it:"Italian",ja:"Japanese",ko:"Korean",nl:"Dutch",pl:"Polish",pt:"Portuguese",ru:"Russian",tr:"Turkish",vi:"Vietnamese",zh:"Chinese",he:"Hebrew",fa:"Persian",ur:"Urdu",emailPlaceholderText:"Enter your email",incrementValue:"Increment value",decrementValue:"Decrement value",dropZoneInstructions:e=>e?"Click to choose or drag files here, or press Enter or Space to open file selector":"Drag files here",fileSizeUnits:["Bytes","KB","MB","GB","TB"],removeFile:"Remove file",clearAllFiles:"Clear all files",clearValue:"Reset",unknownType:"Unknown type",filesInputInstructions:(e,t,n)=>{let s=e==null||e>1?"Click to choose or drag files here":"Click to choose or drag a file here";if(e||t){const a=[];if(e!=null&&e>1&&a.push(`up to ${e} files`),t&&n){const o=F(t,{units:n});a.push(`max ${o} each`)}a.length>0&&(s+=` (${a.join(", ")})`)}else if(t&&n){const a=F(t,{units:n});s+=` (max ${a})`}return s}},Pe=Object.freeze(Object.defineProperty({__proto__:null,default:Z},Symbol.toStringTag,{value:"Module"})),X=Z,ee="en",te=(e,t,n)=>{const s=e[t];return s?typeof s=="function"?s():Promise.resolve(s):new Promise((a,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},_e=new Set(["ar","he","fa","ur","ps","sd","ku","dv","yi","ji","iw","in"]);function W(e){if(!e)return"ltr";const t=e.split(/[-_]/)[0].toLowerCase();return _e.has(t)?"rtl":"ltr"}function re(e,t){return e==="auto"?W(t):e}function Oe(e){return`b-${e}`}function Te(e){return W(e)==="rtl"}function Le(e){return e==="ltr"?"rtl":"ltr"}const ne={ltr:{"inline-start":"left","inline-end":"right","block-start":"top","block-end":"bottom"},rtl:{"inline-start":"right","inline-end":"left","block-start":"top","block-end":"bottom"}};function Me(e,t){return ne[t][e]}const se={mark:r.makeProviderMark("Locale"),create:e=>{const t=r.localStorageProp({defaultValue:navigator.language??"en-US",key:"beatui-locale"}),n=r.localStorageProp({defaultValue:"auto",key:"beatui-direction-preference"}),s=r.computedOf(t,n)((o,i)=>re(i,o));return{value:{locale:t,setLocale:o=>t.set(o),direction:s,directionPreference:n,setDirectionPreference:o=>n.set(o)},dispose:()=>{t.dispose(),n.dispose(),s.dispose()}}}},{variants:Ae,special:Be,overrides:U}=Q.backgroundConfig;function _(e,t){switch(e){case"white":return"var(--color-white)";case"black":return"var(--color-black)";case"transparent":return"transparent";default:return Q.getColorVar(e,t)}}function ae(e,t){const n=Be[e];if(!n)return;if(t==="light")return n;const s=U[e];return s?s[t]:n}function E(e,t,n){const s=U[e];if(s){const o=s[n];if(o)return{backgroundColor:o.backgroundColor,textColor:o.color}}if(t==="solid"){const o=ae(e,n);if(o)return{backgroundColor:o.backgroundColor,textColor:o.color}}const a=Ae[t][n];return{backgroundColor:_(e,a.bgShade),textColor:a.textColor}}const $e={light:{shade:600,textColor:"var(--color-white)"},dark:{shade:600,textColor:"var(--text-inverted-dark)"}},qe={light:{shade:300,textColor:"var(--text-normal-light)"},dark:{shade:700,textColor:"var(--text-normal-dark)"}},Fe={light:{shade:400,textColor:"var(--text-normal-light)"},dark:{shade:600,textColor:"var(--text-normal-dark)"}};function S(e,t,n){const s=U[e];if(s){const o=s[n];if(o)return{backgroundColor:o.backgroundColor,textColor:o.color}}if(t==="solid"){const o=ae(e,n);if(o)return{backgroundColor:o.backgroundColor,textColor:o.color};const i=$e[n];return{backgroundColor:_(e,i.shade),textColor:i.textColor}}const a=t==="light"?qe[n]:Fe[n];return{backgroundColor:_(e,a.shade),textColor:a.textColor}}function j(e,t){const n=t==="light"?500:600;switch(e){case"white":return t==="light"?"var(--text-inverse-light)":"var(--text-inverted-dark)";case"black":return"var(--color-black)";case"transparent":return"transparent";default:return _(e,n)}}function V(e,t){return e==="white"?"var(--color-white)":e==="black"?"var(--color-black)":e==="transparent"?"inherit":_(e,t==="light"?800:200)}function J(e,t,n){return t==="soft"?_(e,n==="light"?300:700):_(e,n==="light"?500:600)}const je="bui-icons",M=new Map,H=(()=>{try{return typeof indexedDB<"u"&&indexedDB!==null}catch{return!1}})();function Ne(){return H?new Promise((e,t)=>{const n=indexedDB.open(je,1);n.onupgradeneeded=function(s){const a=s.target.result;a.objectStoreNames.contains("icons")||a.createObjectStore("icons")},n.onsuccess=function(){e(n.result)},n.onerror=function(){t(n.error)}}):Promise.reject(new Error("IndexedDB not available"))}const A=H?Ne():null;function oe(e,t){return new Promise(async(n,s)=>{try{if(A){const o=(await A).transaction("icons","readwrite");o.objectStore("icons").put(t,e),o.oncomplete=n,o.onerror=s}else M.set(e,t),n(void 0)}catch{M.set(e,t),n(void 0)}})}function ie(e){return new Promise(async(t,n)=>{try{if(A){const i=(await A).transaction("icons","readonly").objectStore("icons").get(e);i.onsuccess=function(){t(i.result)},i.onerror=n}else t(M.get(e)||null)}catch{t(M.get(e)||null)}})}async function Re(e){const t=`https://api.iconify.design/${e}.svg`;return fetch(t).then(n=>{if(n.status===200)return n.text();throw new Error(`Failed to load icon: ${e}`)})}async function We(e){const t=e.replace(":","/"),n=await ie(t);if(n)return n;const s=await Re(t);return await oe(t,s),s}function Ue(e){return["bc-icon",`bc-icon--${e}`].join(" ")}function He(e,t="solid"){if(!e)return"";const n=J(e,t,"light"),s=J(e,t,"dark");return`--icon-color: ${n}; --icon-color-dark: ${s}`}function D({icon:e,size:t="md",color:n,title:s,accessibility:a="auto",tone:o="solid"},...i){const l=r.computedOf(a,s)((c,d)=>c==="decorative"?!1:c==="informative"?!0:d!=null&&d!=="");return r.Use(O,c=>r.html.span(r.attr.class(r.computedOf(t,n)(d=>Ue(d??"md"))),r.attr.style(r.computedOf(n,o)((d,u)=>He(d??void 0,u??"solid"))),r.When(l,()=>r.Fragment(r.attr.role("img"),r.aria.label(r.coalesce(s,c.$.iconDescription))),()=>r.aria.hidden(!0)),q.WhenInViewport({once:!0},()=>q.Query({request:e,load:({request:d})=>We(d),convertError:String,success:({value:d})=>r.html.span(r.style.width("100%"),r.style.height("100%"),r.attr.innerHTML(d)),pending:()=>r.html.span(r.attr.class("animate-spin"),r.When(l,()=>r.Fragment(r.attr.role("img"),r.aria.label(c.$.loadingIcon)),()=>r.aria.hidden(!0)),"↻"),failure:({error:d})=>r.html.span(r.attr.title(d),r.attr.class("text-red-500"),r.When(l,()=>r.Fragment(r.attr.role("img"),r.aria.label(c.$.failedToLoadIcon)),()=>r.aria.hidden(!0)),"🚫")})),...i))}function le(e,t,n){const s=["bc-button",`bc-button--size-${e}`,`bc-control--padding-${e}`,`bc-control--rounded-${t}`];return n&&s.push("bc-button--loading"),s.join(" ")}function ce(e,t,n){const s=new Map;s.set("--button-text-shadow","var(--text-shadow-none)"),s.set("--button-text-shadow-dark","var(--text-shadow-none)");const a=(o,i,l,c)=>{n||(s.set("--button-bg-hover",o),s.set("--button-text-hover",l),s.set("--button-bg-hover-dark",i),s.set("--button-text-hover-dark",c))};switch(e){case"filled":{const o=E(t,"solid","light"),i=E(t,"solid","dark");s.set("--button-bg",o.backgroundColor),s.set("--button-text",o.textColor),s.set("--button-bg-dark",i.backgroundColor),s.set("--button-text-dark",i.textColor),s.set("--button-text-shadow","var(--text-shadow-button-filled, var(--text-shadow-sm))"),s.set("--button-text-shadow-dark","var(--text-shadow-button-filled, var(--text-shadow-sm))");const l=S(t,"solid","light"),c=S(t,"solid","dark");a(l.backgroundColor,c.backgroundColor,l.textColor,c.textColor);break}case"light":{const o=E(t,"light","light"),i=E(t,"light","dark");s.set("--button-bg",o.backgroundColor),s.set("--button-text",o.textColor),s.set("--button-bg-dark",i.backgroundColor),s.set("--button-text-dark",i.textColor);const l=S(t,"light","light"),c=S(t,"light","dark");a(l.backgroundColor,c.backgroundColor,l.textColor,c.textColor);break}case"outline":{s.set("--button-bg","transparent"),s.set("--button-bg-dark","transparent"),s.set("--button-border",j(t,"light")),s.set("--button-border-dark",j(t,"dark")),s.set("--button-text",V(t,"light")),s.set("--button-text-dark",V(t,"dark")),s.set("--button-text-shadow","var(--text-shadow-button-light, var(--text-shadow-xs))"),s.set("--button-text-shadow-dark","var(--text-shadow-button-light, var(--text-shadow-xs))");const o=S(t,"light","light"),i=S(t,"light","dark");a(o.backgroundColor,i.backgroundColor,o.textColor,i.textColor);break}case"default":{const o=E("neutral","light","light"),i=E("neutral","light","dark");s.set("--button-bg",o.backgroundColor),s.set("--button-text",V(t,"light")),s.set("--button-bg-dark",i.backgroundColor),s.set("--button-text-dark",V(t,"dark")),s.set("--button-text-shadow","var(--text-shadow-button-default, var(--text-shadow-2xs))"),s.set("--button-text-shadow-dark","var(--text-shadow-button-default, var(--text-shadow-2xs))");const l=S("base","light","light"),c=S("base","light","dark");a(l.backgroundColor,c.backgroundColor,s.get("--button-text")??o.textColor,s.get("--button-text-dark")??i.textColor);break}case"text":{s.set("--button-bg","transparent"),s.set("--button-bg-dark","transparent"),s.set("--button-text",V(t,"light")),s.set("--button-text-dark",V(t,"dark")),n||s.set("--button-hover-decoration","underline");break}}return Array.from(s.entries()).map(([o,i])=>`${o}: ${i}`).join("; ")}function ue({type:e="button",disabled:t,loading:n,variant:s="filled",size:a="md",color:o="base",roundedness:i="sm",onClick:l=()=>{}},...c){const d=r.prop(null);return r.Use(O,u=>r.html.button(r.attr.type(e),r.attr.disabled(r.computedOf(t,n)((h,f)=>h||f)),r.aria.busy(n??!1),r.When(n??!1,()=>r.aria.label(u.$.loadingExtended)),r.attr.class(r.computedOf(a,i,n)((h,f,g)=>le(h??"md",f??"sm",g))),r.attr.style(r.computedOf(s,o,t)((h,f,g)=>ce(h??"filled",f??"base",g))),r.When(n??!1,()=>r.Fragment(r.style.width(d.map(h=>h==null?"":`${h.width}px`)),r.style.height(d.map(h=>h==null?"":`${h.height}px`)),D({icon:"line-md:loading-twotone-loop",size:a??"md"}),r.html.span(r.attr.class("sr-only"),r.aria.live("polite"),u.$.loadingExtended)),()=>r.Fragment(r.on.click(l),...c)),r.When(n!=null,()=>q.ElementRect(h=>r.OnDispose(h.on(f=>{r.Value.get(n??!1)||d.set(f)}))))))}function de({size:e="sm",icon:t="line-md:close",disabled:n,roundedness:s="full",color:a="base",onClick:o,label:i},...l){return r.Use(O,c=>{const d=r.coalesce(i,c.$.closeModal);return ue({variant:"text",size:e,roundedness:s,disabled:n,color:a,onClick:o},r.attr.title(d),r.aria.label(d),...l,D({icon:t,size:e??"sm"}))})}function ze(e,t,n){const s=[e?"bc-base-input-container":"bc-input-container"];return t?s.push(e?"bc-base-input-container--disabled":"bc-input-container--disabled"):s.push(e?"bc-base-input-container--default":"bc-input-container--default"),n&&s.push("bc-input-container--error"),s.join(" ")}const L=({baseContainer:e,disabled:t,input:n,before:s,after:a,hasError:o,focusableSelector:i="input, select, textarea",growInput:l=!0},...c)=>{const d=r.Value.map(t??!1,u=>u);return r.html.div(r.WithElement(u=>{const h=()=>{u.querySelector(i)?.focus()};return u.addEventListener("click",h),r.OnDispose(()=>u.removeEventListener("click",h))}),r.attr.class(r.computedOf(e,d,o??!1)((u,h,f)=>ze(u??!1,h??!1,f??!1))),s!=null?r.html.span(r.attr.class("bc-input-container__before"),s):null,r.html.div(r.attr.class("bc-input-container__input"),r.attr.class(r.Value.map(l,u=>u?"bc-input-container__input--grow":"")),n),a!=null?r.html.span(r.attr.class("bc-input-container__after"),a):null,...c)};function B(e){return`bc-label bc-label--${e}`}const Ge=(...e)=>r.html.span(r.attr.class(B("emphasis")),...e),he=(...e)=>r.html.span(r.attr.class(B("default")),...e),pe=(...e)=>r.html.span(r.attr.class(B("muted")),...e),Ke=(...e)=>r.html.span(r.attr.class(B("danger")),...e),Ye=e=>{const{value:t,onBlur:n,onChange:s,placeholder:a,disabled:o,id:i,checkedIcon:l,uncheckedIcon:c,iconSize:d="lg"}=e,u=i??R("checkbox"),h=`${u}-label`,f=()=>{if(r.Value.get(o??!1))return;const p=r.Value.get(t);s?.(!p)},g=p=>{r.Value.get(o??!1)||(p.key===" "||p.key==="Enter")&&(p.preventDefault(),f())};return L({baseContainer:!0,growInput:!1,...e,input:r.html.span(r.attr.class("bc-checkbox-input"),r.html.span(r.attr.class("bc-checkbox-input__checkbox"),r.attr.class(r.Value.map(t,p=>p?"bc-checkbox-input__checkbox--checked":"bc-checkbox-input__checkbox--unchecked")),r.attr.class(r.Value.map(o??!1,p=>p?"bc-checkbox-input__checkbox--disabled":"")),r.attr.id(u),r.attr.role("checkbox"),r.attr.tabindex(r.Value.map(o??!1,p=>p?-1:0)),r.aria.checked(t),r.aria.disabled(o),a!=null?r.aria.labelledby(h):r.Empty,r.on.keydown(g),n!=null?r.on.blur(n):r.Empty,D({icon:r.computedOf(t,l,c)((p,m,b)=>p?m??"akar-icons/check-box-fill":b??"akar-icons/box"),accessibility:"decorative",size:d})),a!=null?r.html.label(r.attr.class("bc-checkbox-input__label"),r.attr.id(h),r.attr.for(u),pe(a)):r.Empty)},r.on.click(f))},$=({autocomplete:e,autofocus:t,class:n,disabled:s,name:a,placeholder:o,id:i,required:l,hasError:c})=>r.Fragment(r.attr.autocomplete(e),r.attr.autofocus(t),r.attr.class(n),r.attr.disabled(s),r.attr.name(a??i),r.attr.placeholder(o),r.attr.id(i),r.aria.required(l),c!=null?r.aria.invalid(c??!1):null),me=r.html.span(r.attr.class("bc-input-wrapper__required")," *");function Je(e){const t=["bc-input-wrapper"];return e&&t.push("bc-input-wrapper--horizontal"),t.join(" ")}function Qe(e,t){const n=["bc-input-wrapper__label-text"];return e?n.push("bc-input-wrapper__label-text--error"):t?n.push("bc-input-wrapper__label-text--disabled"):n.push("bc-input-wrapper__label-text--default"),n.join(" ")}const z=({required:e,label:t,labelChildren:n,context:s,description:a,content:o,error:i,labelFor:l,hasError:c,disabled:d,horizontal:u},...h)=>{const f=c??i!=null,g=d??!1,p=u??!1,m=R("input-wrapper"),b=a?`${m}-description`:void 0,w=i!=null?`${m}-error`:void 0;return r.html.div(r.attr.class(r.Value.map(p,C=>Je(C))),t!=null||s!=null?r.html.div(r.attr.class("bc-input-wrapper__header"),r.html.div(r.attr.class("bc-input-wrapper__label-section"),r.html.label(r.attr.class("bc-input-wrapper__label"),l!=null?r.attr.for(l):r.Empty,r.html.span(r.attr.class(r.computedOf(f,g)((C,x)=>Qe(C??!1,x??!1))),t),t!=null&&e?me:r.Empty),r.When(r.computedOf(p,a)((C,x)=>C&&x!=null),()=>r.html.div(r.attr.class("bc-input-wrapper__description bc-input-wrapper__description--under-label"),r.attr.id(b),a))),s!=null?he(s):r.Empty,n):r.Empty,r.html.div(r.attr.class("bc-input-wrapper__content"),[b,w].filter(Boolean).length>0?r.dataAttr.describedby([b,w].filter(Boolean).join(" ")):r.Empty,e?r.dataAttr.required("true"):r.Empty,r.When(f,()=>r.dataAttr.invalid("true")),o),r.When(r.computedOf(p,a)((C,x)=>!C&&x!=null),()=>r.html.div(r.attr.class("bc-input-wrapper__description"),r.attr.id(b),a)),i!=null?r.When(f,()=>r.html.div(r.attr.class("bc-input-wrapper__error"),r.attr.id(w),r.aria.live("polite"),r.attr.role("alert"),i)):null,...h)};function Ze(...e){return r.html.div(r.attr.class("bc-stack"),...e)}const Xe=e=>{const t={name:"email",autocomplete:"email",...e},{value:n,before:s,onBlur:a,onChange:o,onInput:i,placeholder:l}=t,c=s??D({icon:"line-md:email",size:"sm",color:"neutral"});return r.Use(O,d=>L({...e,before:c,input:r.input.email($(t),r.attr.placeholder(r.coalesce(l,d.$.emailPlaceholderText)),r.attr.value(n),r.attr.class("bc-input"),a!=null?r.on.blur(r.emitValue(a)):r.Empty,o!=null?r.on.change(r.emitValue(o)):r.Empty,i!=null?r.on.input(r.emitValue(i)):r.Empty)}))},et=e=>{const{value:t,onBlur:n,onChange:s,onInput:a}=e;return L({...e,input:r.input.text($(e),r.attr.value(t),r.attr.class("bc-input"),n!=null?r.on.blur(r.emitValue(n)):r.Empty,s!=null?r.on.change(r.emitValue(s)):r.Empty,a!=null?r.on.input(r.emitValue(a)):r.Empty)})},tt=e=>{const{value:t,onBlur:n,onChange:s,onInput:a,before:o,after:i,hasError:l,disabled:c,autocomplete:d,placeholder:u,...h}=e,f={name:"password",disabled:c,...h},g=r.prop(!0),p=r.computedOf(g,d)((m,b)=>m?b??"current-password":"off");return r.Use(O,m=>{const b=r.computedOf(m.$.passwordPlaceholderText,g,u)((C,x,Ve)=>x?"•••••••••••••••":Ve??C),w=r.html.button(r.attr.class("bc-input-container__password-toggle"),r.aria.label(m.$.togglePasswordVisibility),r.on.click(()=>g.update(C=>!C)),r.When(g,()=>D({icon:"line-md:watch"}),()=>D({icon:"line-md:watch-off"})));return L({before:o,disabled:c,hasError:l,input:r.html.input($({...f,autocomplete:p,placeholder:b}),r.When(g,()=>r.Fragment(r.attr.type("password")),()=>r.Fragment(r.attr.type("text"))),r.attr.class("bc-input"),r.attr.value(t),n!=null?r.on.blur(r.emitValue(n)):r.Empty,s!=null?r.on.change(r.emitValue(s)):r.Empty,a!=null?r.on.input(r.emitValue(a)):r.Empty),after:i!=null?r.Fragment(w,i):w})})},fe=(e,t)=>()=>{e.markTouched(),t?.()},be=(e,t)=>n=>{e.change(n),t?.(n)};function G(e,t){const{controller:n,onBlur:s,onChange:a,...o}=t;return e({id:n.name,disabled:n.disabled,value:n.value,hasError:n.errorVisible,...o,onChange:be(n,a),onBlur:fe(n,s)})}function rt(e,t,...n){return z({...t,content:G(e,t)},...n)}function ge(e,t){const{toInput:n,fromInput:s,controller:a,...o}=t,i=a.transform(n,s);return G(e,{...o,controller:i})}function nt(e,t,...n){return z({...t,content:ge(e,t)},...n)}function st(e){return e.split(".").map(n=>{const s=n.match(/^\[(\d+)\]$/);return s?Number(s[1]):n})}function ve(e){return typeof e=="number"?`[${e}]`:`.${e}`}function ye(e){if(e.length===0)return"";const[t,...n]=e;return[typeof t=="number"?`[${t}]`:t,...n.map(ve)].join("")}function T(e){return function(n){if(n.type==="valid")return n;let s=n.error;for(const a of e)if(s=s?.dependencies?.[a],s==null)return k.valid;return k.invalid(s)}}class I{path;change;value;status;error;hasError;touched;errorVisible;dirty;dependencyErrors;#e={disabled:r.prop(!1),touched:r.prop(!1)};#r;#t=r.prop(void 0);parent;disabled;#n=[];disabledOrHasErrors;constructor(t,n,s,a,o,i=P){this.path=t,this.change=n,this.value=s,this.status=a,this.#r=i,this.#t.set(s.value),this.error=a.map(l=>l?.type==="invalid"?l.error?.message:void 0),this.hasError=this.error.map(l=>l!=null),this.touched=this.#e.touched,o.validationMode?this.errorVisible=r.computedOf(this.hasError,this.touched,o.validationMode)((l,c,d)=>d==="continuous"?!!l:!!l&&!!c):this.errorVisible=r.computedOf(this.hasError,this.touched)((l,c)=>!!l&&!!c),this.dirty=r.computedOf(this.value,this.#t)((l,c)=>!this.#r(l,c)),this.dependencyErrors=a.map(l=>l?.type==="invalid"?l.error?.dependencies:void 0),this.parent=o,this.disabled=r.computedOf(this.#e.disabled,o.disabled)((l,c)=>l||c),this.disabledOrHasErrors=r.computedOf(this.disabled,this.hasError)((l,c)=>l||c),this.onDispose(()=>{this.#e.disabled.dispose(),this.#e.touched.dispose(),this.disabled.dispose(),this.error.dispose(),this.errorVisible.dispose(),this.dirty.dispose(),this.#t.dispose(),this.dependencyErrors.dispose(),this.disabledOrHasErrors.dispose()})}get name(){return ye(this.path)}onDispose=t=>{this.#n.push(t)};dispose=()=>{for(const t of this.#n)try{t()}catch(n){console.error("Error in dispose callback:",n)}this.#n.length=0};setDisabled=t=>{this.#e.disabled.set(t)};disable=()=>this.setDisabled(!0);enable=()=>this.setDisabled(!1);markTouched=()=>{this.#e.touched.set(!0)};resetTouched=()=>{this.#e.touched.set(!1)};markPristine=()=>{this.#t.set(this.value.value)};reset=()=>{this.change(this.#t.value)};array=(t=P)=>new we(this.path,this.change,this.value,this.status,this.parent,t);object=(t=P)=>new ke(this.path,this.change,this.value,this.status,this.parent,t);transform=(t,n,s=[],a=P)=>new I([...this.path,...s],o=>this.change(n(o)),this.value.map(t,a),this.status.map(T(s)),this.parent,a);asyncTransform=(t,n,s,a=[],o=P)=>new I([...this.path,...a],i=>{n(i).then(l=>this.change(l))},this.value.mapAsync(t,s,void 0,o),this.status.map(T(a)),this.parent,o)}class ke extends I{#e=new Map;#r=new Map;#t=new Map;#n=r.prop(!1);touchedDeep=this.#n;#a=new Map;#s=new Map;#i=r.prop(!1);dirtyDeep=this.#i;#c;#u;#l=()=>{let t=!1;for(const n of this.#r.values())if(n){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,n,s,a,o,i){super(t,n,s.map(c=>c??{},i),a,o,i),this.#c=this.touched.on(()=>{this.#l()}),this.#u=this.dirty.on(()=>{this.#o()});const l=this.value.on(()=>this.#o());this.onDispose(()=>{for(const c of this.#e.values())c.dispose();this.#e.clear();for(const c of this.#t.values())c();this.#t.clear(),this.#r.clear(),this.#n.dispose();for(const c of this.#s.values())c();this.#s.clear(),this.#a.clear(),this.#i.dispose(),this.#c(),this.#u(),l()})}field=t=>{if(this.#e.has(t))return this.#e.get(t);const n=async i=>{this.change({...this.value.value,[t]:i})},s=new I([...this.path,t],n,this.value.map(i=>i[t]),this.status.map(T([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e.set(t,s);const a=s.touched.on(i=>{this.#r.set(t,i),this.#l()});this.#t.set(t,a);const o=s.dirty.on(i=>{this.#a.set(t,i),this.#o()});return this.#s.set(t,o),s};markAllTouched=()=>{this.markTouched();const t=this.value.value;for(const n of Object.keys(t))this.field(n).markTouched();for(const n of this.#e.values())n.markTouched()};markAllPristine=()=>{this.markPristine();const t=this.value.value;for(const n of Object.keys(t))this.field(n).markPristine?.();for(const n of this.#e.values())n.markPristine?.()};#o=()=>{let t=!1;for(const n of this.#a.values())if(n){t=!0;break}this.#i.set(this.dirty.value||t)}}class we extends I{#e=new Array;length;#r=new Map;#t=new Map;#n=r.prop(!1);touchedDeep=this.#n;#a=new Map;#s=new Map;#i=r.prop(!1);dirtyDeep=this.#i;#c;#u;#l=()=>{let t=!1;for(const n of this.#r.values())if(n){t=!0;break}this.#n.set(this.touched.value||t)};constructor(t,n,s,a,o,i){const l=s.map(u=>u??[],i);super(t,n,l,a,o,i);const c=l.on(u=>{const h=this.#e.length-u.length;h>0&&(this.#e.splice(u.length,h).forEach((f,g)=>{const p=u.length+g;f.dispose(),this.#t.get(p)?.(),this.#t.delete(p),this.#r.delete(p),this.#s.get(p)?.(),this.#s.delete(p),this.#a.delete(p)}),this.#l(),this.#o())});this.length=l.map(u=>u.length),this.#c=this.touched.on(()=>{this.#l()}),this.#u=this.dirty.on(()=>{this.#o()});const d=this.value.on(()=>this.#o());this.onDispose(()=>{for(const u of this.#e)u.dispose();this.length.dispose(),this.#e.length=0,c(),l.dispose();for(const u of this.#t.values())u();this.#t.clear(),this.#r.clear(),this.#n.dispose();for(const u of this.#s.values())u();this.#s.clear(),this.#a.clear(),this.#i.dispose(),this.#c(),this.#u(),d()})}item=t=>{if(this.#e[t])return this.#e[t];const n=async i=>{const l=this.value.value.slice();l[t]=i,this.change(l)},s=new I([...this.path,t],n,this.value.map(i=>i[t]),this.status.map(T([t])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e[t]=s;const a=s.touched.on(i=>{this.#r.set(t,i),this.#l()});this.#t.set(t,a);const o=s.dirty.on(i=>{this.#a.set(t,i),this.#o()});return this.#s.set(t,o),s};push=(...t)=>{this.change([...this.value.value,...t])};pop=()=>{this.splice(this.value.value.length-1,1)};shift=()=>{this.splice(0,1)};unshift=(...t)=>{this.change([...t,...this.value.value])};removeAt=t=>{this.splice(t,1)};splice=(t,n)=>{const s=this.value.value.slice();s.splice(t,n),this.change(s)};move=(t,n,s=1)=>{if(s<1||t===n)return;const a=this.value.value.slice(),o=a.splice(t,s);a.splice(n,0,...o),this.change(a)};markAllTouched=()=>{this.markTouched();const t=this.value.value.length;for(let n=0;n<t;n++)this.item(n).markTouched()};markAllPristine=()=>{this.markPristine();const t=this.value.value.length;for(let n=0;n<t;n++)this.item(n).markPristine?.()};#o=()=>{let t=!1;for(const n of this.#a.values())if(n){t=!0;break}this.#i.set(this.dirty.value||t)}}function Ce(e){function t(n){return typeof n=="number"?n:n.toString()}return e.map(n=>typeof n=="object"&&n.key!=null?t(n.key):t(n))}function xe(e){const t=e.filter(a=>a.path==null||a.path.length===0).map(a=>a.message),n=e.filter(a=>a.path!=null&&a.path.length>0).reduce((a,o)=>{const i=Ce(o.path),l=i.pop();let c=a;for(const d of i)c.dependencies==null&&(c.dependencies={}),c.dependencies[d]==null&&(c.dependencies[d]={}),c=c.dependencies[d];return c.dependencies==null&&(c.dependencies={}),c.dependencies[l]={message:o.message},a},{}),s=t.join(`
|
|
2
|
+
`);return{...n,message:s!=""?s:void 0}}function Se({initialValue:e,onChange:t,validate:n,equals:s,validationMode:a,validateDebounceMs:o}){const i=r.Value.deriveProp(e),l=r.prop(k.valid),c=r.prop(!1),d=r.prop(a??"touchedOrSubmit"),u=m=>{l.set(m)};let h;const f=async m=>{if(n!=null){const b=await n(m);u(b)}},g=async m=>{i.set(m),t?.(m);const b=d.value;if(n!=null){if(b==="onSubmit")return;const w=o??0;w>0?(h&&clearTimeout(h),h=setTimeout(()=>{f(m)},w)):await f(m)}},p=new I([],g,i,l,{disabled:c,validationMode:d},s??P);return p.onDispose(()=>{c.dispose(),i.dispose(),l.dispose(),d.dispose(),h&&clearTimeout(h)}),{controller:p,setStatus:u}}function K(e){return r.Fragment(r.attr.disabled(e.disabled),r.attr.name(e.name))}function at(e,{triggerOn:t="change"}={}){return r.Fragment(K(e),r.attr.value(e.value),(t==="input"?r.on.input:r.on.change)(r.emitValue(e.change)))}function ot(e,{triggerOn:t="change"}={}){return r.Fragment(K(e),r.attr.valueAsNumber(e.value),(t==="input"?r.on.input:r.on.change)(r.emitValueAsNumber(e.change)))}function N(e){return e.issues!=null?k.invalid(xe(e.issues)):k.valid}async function it({task:e,errorMessage:t,errorPath:n=["root"],validation:s}){try{const a=await e();return console.log(s),s!=null?(console.log("Applying validation"),s(a)):(console.log("No validation"),k.valid)}catch(a){console.log("Error",a);const o=t??(a instanceof Error?a.message:"Operation failed");return n.length===1&&n[0]==="root"?k.invalid({message:o}):k.invalid({dependencies:Ie(n,o)})}}function Ie(e,t){if(e.length===1)return{[e[0]]:{message:t}};const[n,...s]=e;return{[n]:{dependencies:Ie(s,t)}}}function lt({initialValue:e={},schema:t,onSubmit:n=async()=>k.valid,validationMode:s,validateDebounceMs:a}){const{controller:o,setStatus:i}=Se({initialValue:e,validationMode:s??"touchedOrSubmit",validateDebounceMs:a,validate:(s??"touchedOrSubmit")==="onSubmit"?void 0:async u=>N(await t["~standard"].validate(u))}),l=r.prop(!1),c=o.object();return c.onDispose(l.dispose),{controller:c,setStatus:i,submit:async u=>{if(l.set(!0),u?.preventDefault(),c.markAllTouched(),(s??"touchedOrSubmit")==="onSubmit"){const f=c.value.value,g=N(await t["~standard"].validate(f));if(i(g),g.type==="invalid"){l.set(!1);return}}const h=await n(c.value.value);l.set(!1),h.type==="invalid"&&i(h)},submitting:l}}function ct(e){const t=e.split("-"),n=[e];return t.length>1&&n.push(t[0]),n}function De({locale:e,defaultLocale:t="en-US",defaultMessages:n,localeLoader:s}){const a=r.prop(t),o=r.prop(n),i=e.on(async l=>{if(l===a.value)return;a.set(l);const c=ct(l);for(const d of c)try{const u=await s(d);if(typeof u.default=="object"&&Object.keys(u).length===1){console.error("It appears that you are trying to load a translation module without referencing the default export. Please use `(await import(...)).default` in your loader function.");return}if(l===a.value){o.set(u);return}}catch{continue}console.warn(`No locale found for "${e.value}", using fallback`),l===a.value&&o.set(n)});return{dispose:()=>{i(),a.dispose(),o.dispose()},t:o}}function Ee({defaultLocale:e,defaultMessages:t,localeLoader:n,providerName:s="I18nProvider"}){return{mark:r.makeProviderMark(s),create:(a,o)=>{const{value:{locale:i}}=o.getProvider(se.mark),{t:l,dispose:c}=De({locale:i,defaultMessages:t,defaultLocale:e,localeLoader:n});return{value:l,dispose:c}}}}const O=Ee({defaultLocale:ee,defaultMessages:X,localeLoader:async e=>(await te(Object.assign({"./locales/ar.ts":()=>Promise.resolve().then(()=>require("./ar-CNSt2O6X.cjs")),"./locales/de.ts":()=>Promise.resolve().then(()=>require("./de-BlQbCGWj.cjs")),"./locales/en.ts":()=>Promise.resolve().then(()=>Pe),"./locales/es.ts":()=>Promise.resolve().then(()=>require("./es-Chf24sm_.cjs")),"./locales/fa.ts":()=>Promise.resolve().then(()=>require("./fa-DPDyDuq_.cjs")),"./locales/fr.ts":()=>Promise.resolve().then(()=>require("./fr-BnxbTKeV.cjs")),"./locales/he.ts":()=>Promise.resolve().then(()=>require("./he-B9YZGENc.cjs")),"./locales/hi.ts":()=>Promise.resolve().then(()=>require("./hi-ZyCUnzwK.cjs")),"./locales/it.ts":()=>Promise.resolve().then(()=>require("./it-C5sp2CZC.cjs")),"./locales/ja.ts":()=>Promise.resolve().then(()=>require("./ja-31clSGC3.cjs")),"./locales/ko.ts":()=>Promise.resolve().then(()=>require("./ko-j4lOKHLl.cjs")),"./locales/nl.ts":()=>Promise.resolve().then(()=>require("./nl-gQLaSMRt.cjs")),"./locales/pl.ts":()=>Promise.resolve().then(()=>require("./pl-BQTsowH4.cjs")),"./locales/pt.ts":()=>Promise.resolve().then(()=>require("./pt-DB-njyTA.cjs")),"./locales/ru.ts":()=>Promise.resolve().then(()=>require("./ru-CIXDYJrr.cjs")),"./locales/tr.ts":()=>Promise.resolve().then(()=>require("./tr-Dx_9vMU9.cjs")),"./locales/ur.ts":()=>Promise.resolve().then(()=>require("./ur-DpGDKEUr.cjs")),"./locales/vi.ts":()=>Promise.resolve().then(()=>require("./vi-CjpgcyEa.cjs")),"./locales/zh.ts":()=>Promise.resolve().then(()=>require("./zh-CLb0vdcx.cjs"))}),`./locales/${e}.ts`,3)).default,providerName:"BeatUII18n"});function ut(e){switch(e){case"success":return"material-symbols:check-circle-outline";case"warning":return"material-symbols:warning-outline";case"danger":return"material-symbols:error-outline";case"info":default:return"material-symbols:info-outline"}}function dt(e){switch(e){case"success":return"success";case"warning":return"warning";case"danger":return"danger";case"info":default:return"info"}}function ht(e,t,n,s){const a=["bc-notice",`bc-notice--${e}`,`bc-notice--tone-${t}`];return n&&a.push("bc-notice--dismissible"),s&&s.length>0&&a.push(s),a.join(" ")}function pt({variant:e="info",tone:t="subtle",role:n,title:s,icon:a,closable:o=!1,onDismiss:i,class:l},...c){const d=r.Value.map(o,m=>!!m||i!=null),u=r.Value.map(e,m=>m??"info"),h=r.Value.map(t,m=>m??"subtle"),f=r.computedOf(n,u)((m,b)=>m??(b==="danger"?"alert":"status")),g=r.prop(!0),p=r.Use(O,m=>r.html.div(r.attr.class(r.computedOf(u,h,d,l)((b,w,C,x)=>ht(b,w,C,x))),r.attr.role(r.Value.map(f,b=>b)),r.Unless(r.Value.map(a,b=>b===!1),()=>r.html.div(r.attr.class("bc-notice__icon"),D({icon:r.computedOf(a,u)((b,w)=>b===void 0?ut(w):String(b)),size:"md",color:r.Value.map(u,dt)}))),r.html.div(r.attr.class("bc-notice__body"),r.Ensure(s,b=>r.html.div(r.attr.class("bc-notice__title"),b)),r.html.div(r.attr.class("bc-notice__content"),...c)),r.When(d,()=>de({size:"xs",label:m.$.closeModal,onClick:()=>{g.set(!1),i?.()}}))));return r.When(g,()=>p)}exports.ArrayController=we;exports.BaseControl=G;exports.BaseMappedControl=ge;exports.BeatUII18n=O;exports.Button=ue;exports.CheckboxInput=Ye;exports.CloseButton=de;exports.CommonInputAttributes=$;exports.Control=rt;exports.Controller=I;exports.DangerLabel=Ke;exports.EmailInput=Xe;exports.EmphasisLabel=Ge;exports.Icon=D;exports.InputContainer=L;exports.InputWrapper=z;exports.LOGICAL_PROPERTY_MAP=ne;exports.Label=he;exports.Locale=se;exports.MappedControl=nt;exports.MutedLabel=pe;exports.Notice=pt;exports.O=P;exports.ObjectController=ke;exports.PasswordInput=tt;exports.RequiredSymbol=me;exports.Stack=Ze;exports.TextInput=et;exports.__variableDynamicImportRuntimeHelper=te;exports.a=k;exports.backgroundValue=E;exports.borderColorValue=j;exports.connectCommonAttributes=K;exports.connectNumberInput=ot;exports.connectStringInput=at;exports.convertStandardSchemaIssues=xe;exports.convertStandardSchemaPathToPath=Ce;exports.defaultLocale=ee;exports.defaultMessages=X;exports.formatFileSize=F;exports.generateButtonClasses=le;exports.generateButtonStyles=ce;exports.getDirectionClassName=Oe;exports.getDirectionFromLocale=W;exports.getIconLocally=ie;exports.getOppositeDirection=Le;exports.getPhysicalProperty=Me;exports.hoverBackgroundValue=S;exports.isIndexedDBAvailable=H;exports.isRTLLocale=Te;exports.makeI18nProvider=Ee;exports.makeMapValidation=T;exports.makeMessages=De;exports.makeOnBlurHandler=fe;exports.makeOnChangeHandler=be;exports.parsePath=st;exports.pathToString=ye;exports.resolveDirection=re;exports.sessionId=R;exports.standardSchemaResultToValidation=N;exports.storeIconLocally=oe;exports.taskToValidation=it;exports.textColorValue=V;exports.useController=Se;exports.useForm=lt;exports.wrapSegment=ve;
|