@tempots/beatui 0.93.0 → 0.95.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/{ar-8Cko5i-Z.js → ar-B4jDJwHQ.js} +2 -1
- package/dist/{ar-D2DjoXta.cjs → ar-BVXPzVJB.cjs} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-Rt0WDKAe.js → auth-divider-BPwKk8MW.js} +7 -7
- package/dist/{auth-divider-C3E16pml.cjs → auth-divider-BgaQ8ifw.cjs} +1 -1
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +5 -5
- package/dist/{de-Cdf3432J.cjs → de-BdfPZskW.cjs} +1 -1
- package/dist/{de-Bt-d2iKj.js → de-Dd33yWzb.js} +2 -1
- package/dist/{deep-merge-CoLO4id0.js → deep-merge-C8dSqIXI.js} +4 -4
- package/dist/{deep-merge-Blrucd-E.cjs → deep-merge-ChJQbUKq.cjs} +1 -1
- package/dist/{duration-input-DrVonjKK.js → duration-input-DFZwkg6M.js} +4 -4
- package/dist/{duration-input-47x7nbGh.cjs → duration-input-IuFWywO5.cjs} +1 -1
- package/dist/{editor-toolbar-group-DhKJdqER.cjs → editor-toolbar-group-BCBfu8pG.cjs} +1 -1
- package/dist/{editor-toolbar-group-CzdBZ1yr.js → editor-toolbar-group-DiJFgGcI.js} +2 -2
- package/dist/{es-6fFPkKHL.cjs → es-C8TpneCm.cjs} +1 -1
- package/dist/{es-2llfNFX2.js → es-jHMT3_7O.js} +2 -1
- package/dist/{fa-GXyNzAXz.cjs → fa-BXnP4pbN.cjs} +1 -1
- package/dist/{fa-CQVIBjKP.js → fa-eX3_BAZR.js} +2 -1
- package/dist/{fr-CC3smTlW.js → fr-Bj-GjMJm.js} +2 -1
- package/dist/{fr-C6EYTwSH.cjs → fr-HJDhGjI2.cjs} +1 -1
- package/dist/{he-CJUgxvi8.cjs → he-C6nEVZhN.cjs} +1 -1
- package/dist/{he-CZilsN75.js → he-DYgmPPkG.js} +2 -1
- package/dist/{hi-CAZjwGv-.js → hi-CgYLonE9.js} +2 -1
- package/dist/{hi-DqIR4VtX.cjs → hi-DMVSXAJt.cjs} +1 -1
- package/dist/{index-BOC0cVoY.cjs → index-D_zOXmU5.cjs} +2 -2
- package/dist/{index-DJ9YIJcG.js → index-vowHNIPH.js} +5 -5
- package/dist/{index-BFzxpY7y.js → index-yOU4Ceaq.js} +1 -1
- package/dist/{index-B-cwxUsP.cjs → index-zQ3IYJFH.cjs} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +19 -19
- package/dist/{input-container-DiYEl_y8.cjs → input-container-BWYHj0Iq.cjs} +1 -1
- package/dist/{input-container-9r1F3KuX.js → input-container-DMoVdH6E.js} +1 -1
- package/dist/{it-D6RXFIL6.js → it-CO2BPqah.js} +2 -1
- package/dist/{it-BvHsJ7fH.cjs → it-DhfVcjKb.cjs} +1 -1
- package/dist/{ja-D7zsz4Ij.js → ja-BrzwjH8T.js} +3 -2
- package/dist/{ja-B2gP7OHY.cjs → ja-Bt6fGS_Q.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +10 -10
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +5 -5
- package/dist/{ko-taN2Npr4.js → ko-D-lJ4wYQ.js} +4 -3
- package/dist/{ko-BddhddIA.cjs → ko-DfAaBGrz.cjs} +1 -1
- package/dist/lexical/index.cjs.js +30 -30
- package/dist/lexical/index.es.js +5002 -4766
- package/dist/{modal-DUlqGUW7.cjs → modal-CiGmgsOI.cjs} +1 -1
- package/dist/{modal-ZitwUeXx.js → modal-CwZuWiSK.js} +3 -3
- package/dist/{nl-COrtZUnH.cjs → nl-CNWBQjK5.cjs} +1 -1
- package/dist/{nl-CRC6r4Q4.js → nl-ClsworIe.js} +2 -1
- package/dist/{notice-DAVOTnfA.cjs → notice-CPZQuxcA.cjs} +1 -1
- package/dist/{notice-E_p2hg1G.js → notice-D7hYFM5A.js} +4 -4
- package/dist/{oneof-branch-detection-D6Xa8qNR.cjs → oneof-branch-detection-BFxukD63.cjs} +1 -1
- package/dist/{oneof-branch-detection-DCPwyutI.js → oneof-branch-detection-izpPjBCR.js} +1 -1
- package/dist/{pl-BHI4zBgV.cjs → pl-CqHTeu3-.cjs} +1 -1
- package/dist/{pl-C6qNs0Lq.js → pl-WTwLAxnV.js} +2 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-BGzC9MhU.cjs → pt-BQmsiqbo.cjs} +1 -1
- package/dist/{pt-CcWPLqBh.js → pt-CgkjJnsG.js} +2 -1
- package/dist/{ru-CXeFbIPb.cjs → ru-CG56A2To.cjs} +1 -1
- package/dist/{ru-Dt9-9m0E.js → ru-CtgH7OY9.js} +2 -1
- package/dist/{text-input-BgPx8BbG.js → text-input-BLupB3cU.js} +1 -1
- package/dist/{text-input-DUnhBUd6.cjs → text-input-M6WBhhVj.cjs} +1 -1
- package/dist/{toolbar-DKOh_gbA.js → toolbar-Be1eU0qU.js} +1 -1
- package/dist/{toolbar-Dkc2y1dI.cjs → toolbar-WWv5kcYG.cjs} +1 -1
- package/dist/{tr-CDTWeRY0.js → tr-D1O1vEmr.js} +4 -3
- package/dist/{tr-CdOtQAtA.cjs → tr-DE7_VtKu.cjs} +1 -1
- package/dist/{translations-BdCtLBZt.cjs → translations-DBxIjvWR.cjs} +1 -1
- package/dist/{translations-CiBhB2FV.js → translations-DyCmyLE_.js} +59 -58
- package/dist/translations-OOsMRpX9.cjs +1 -0
- package/dist/{translations-NBY7SubC.js → translations-yu4gNqlP.js} +1 -1
- package/dist/types/beatui-i18n/default.d.ts +1 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +1 -0
- package/dist/types/beatui-i18n/translations.d.ts +1 -0
- package/dist/types/components/lexical/toolbar/toolbar-registry.d.ts +2 -1
- package/dist/types/lexical/index.d.ts +2 -2
- package/dist/types/lexical/plugins/element-style.d.ts +28 -0
- package/dist/types/lexical/plugins/index.d.ts +2 -2
- package/dist/types/lexical/plugins/text.d.ts +5 -0
- package/dist/types/lexical/types.d.ts +126 -5
- package/dist/types/lexical-i18n/default.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ar.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/de.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/en.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/es.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fa.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/fr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/he.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/hi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/it.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ja.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ko.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/nl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pl.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/pt.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ru.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/tr.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/ur.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/vi.d.ts +1 -0
- package/dist/types/lexical-i18n/locales/zh.d.ts +1 -0
- package/dist/{ur-CLrK5FPQ.js → ur-BcuB7IqE.js} +2 -1
- package/dist/{ur-C7itXvnC.cjs → ur-ZJgsSpG2.cjs} +1 -1
- package/dist/{use-form-BQRVnIp9.js → use-form-CfxvyTfd.js} +2 -2
- package/dist/{use-form-DTyNw0kM.cjs → use-form-ClA0ZRco.cjs} +1 -1
- package/dist/{vi-CQrUWB3y.cjs → vi-BOgLRkuK.cjs} +1 -1
- package/dist/{vi-B1_QDUQJ.js → vi-D0rQ3dIx.js} +2 -1
- package/dist/{widget-customization-C-fSx3RB.js → widget-customization-CLZNGavL.js} +5 -5
- package/dist/{widget-customization-xEBfEPhQ.cjs → widget-customization-DtEEo35Y.cjs} +1 -1
- package/dist/{zh-DWswYYTS.cjs → zh-BTZ8OZ4H.cjs} +1 -1
- package/dist/{zh-rDtQ92Pp.js → zh-DoYqiZO1.js} +2 -1
- package/package.json +9 -9
- package/dist/translations-Cy9hoMGV.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as i } from "./translations-
|
|
1
|
+
import { f as i } from "./translations-DyCmyLE_.js";
|
|
2
2
|
const d = {
|
|
3
3
|
loadingExtended: "لوڈ ہو رہا ہے، براہ کرم انتظار کریں",
|
|
4
4
|
loadingShort: "لوڈ ہو رہا ہے...",
|
|
@@ -113,6 +113,7 @@ const d = {
|
|
|
113
113
|
lexical: {
|
|
114
114
|
fontFamily: "فونٹ فیملی",
|
|
115
115
|
fontSize: "فونٹ سائز",
|
|
116
|
+
lineHeight: "لائن کی اونچائی",
|
|
116
117
|
fontColor: "فونٹ رنگ",
|
|
117
118
|
highlightColor: "ہائی لائٹ رنگ",
|
|
118
119
|
backgroundColor: "پس منظر رنگ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-OOsMRpX9.cjs"),r={loadingExtended:"لوڈ ہو رہا ہے، براہ کرم انتظار کریں",loadingShort:"لوڈ ہو رہا ہے...",locale:"زبان",iconDescription:"آئیکن",loadingIcon:"لوڈنگ آئیکن",failedToLoadIcon:"آئیکن لوڈ کرنے میں ناکام",editLabel:"ترمیم",selectOne:"ایک منتخب کریں",selectNone:"کوئی نہیں",selectMany:"متعدد منتخب کریں",noResults:"کوئی نتیجہ نہیں",passwordPlaceholderText:"خفیہ پاس ورڈ",togglePasswordVisibility:"پاس ورڈ کی مرئیت تبدیل کریں",toggleMenu:"مینو ٹوگل کریں",toggleAside:"سائیڈ پینل ٹوگل کریں",mainNavigation:"بنیادی نیویگیشن",sidebar:"سائیڈ بار",closeDrawer:"دراز بند کریں",closeModal:"ماڈل بند کریں",confirm:"تصدیق",cancel:"منسوخ",addLabel:"شامل کریں",removeItem:"آئٹم ہٹائیں",currentLocale:"اردو",ar:"عربی",de:"جرمن",en:"انگریزی",es:"ہسپانوی",fr:"فرانسیسی",he:"عبرانی",hi:"ہندی",it:"اطالوی",ja:"جاپانی",ko:"کوریائی",nl:"ڈچ",pl:"پولش",pt:"پرتگالی",ru:"روسی",tr:"ترکی",vi:"ویتنامی",zh:"چینی",fa:"فارسی",ur:"اردو",emailPlaceholderText:"اپنا ای میل داخل کریں",incrementValue:"قدر اضافہ کریں",decrementValue:"قدر کم کریں",dropZoneInstructions:e=>e?"منتخب کرنے کے لیے کلک کریں یا فائلیں یہاں گھسیٹیں، یا فائل منتخب کرنے کے لیے Enter یا Space دبائیں":"فائلیں یہاں گھسیٹیں",fileSizeUnits:["بائٹس","KB","MB","GB","TB"],removeFile:"فائل حذف کریں",clearAllFiles:"تمام فائلیں صاف کریں",clearValue:"قدر صاف کریں",unknownType:"نامعلوم قسم",filesInputInstructions:(e,o,n)=>{let l=e==null||e>1?"منتخب کرنے کے لیے کلک کریں یا فائلیں یہاں گھسیٹیں":"منتخب کرنے کے لیے کلک کریں یا فائل یہاں گھسیٹیں";if(e||o){const t=[];if(e!=null&&e>1&&t.push(`زیادہ سے زیادہ ${e} فائلیں`),o&&n){const i=a.formatFileSize(o,{units:n});t.push(`ہر ایک زیادہ سے زیادہ ${i}`)}t.length>0&&(l+=` (${t.join("، ")})`)}return l},paginationLabel:"صفحہ بندی",firstPage:"پہلا صفحہ",previousPage:"پچھلا صفحہ",nextPage:"اگلا صفحہ",lastPage:"آخری صفحہ",breadcrumbs:"بریڈ کرمبز",commandPalette:"کمانڈ پیلیٹ",typeACommand:"کمانڈ ٹائپ کریں...",noResultsFound:"کوئی نتیجہ نہیں ملا",noMatchingCommands:"کوئی مماثل کمانڈ نہیں ملی",appearanceSystem:"سسٹم",appearanceLight:"ہلکا",appearanceDark:"گہرا",ok:"OK",changeTypeConfirmation:"قسم تبدیل کرنے سے موجودہ قدر صاف ہو جائے گی۔ جاری رکھیں؟",notifications:"اطلاعات",markAllAsRead:"سب کو پڑھا ہوا نشان زد کریں",noNotifications:"کوئی اطلاع نہیں",schemaConflictsDetected:"اسکیما تنازعات کا پتا چلا",schemaViolationsDetected:"اسکیما خلاف ورزیوں کا پتا چلا",properties:"خصوصیات",uploading:"اپ لوڈ ہو رہا ہے...",dropFilesOrBrowse:"فائلیں یہاں چھوڑیں یا براؤز کرنے کے لیے کلک کریں",acceptedTypes:e=>`قابل قبول اقسام: ${e}`,enterUrlPrompt:"URL درج کریں:",exceeded:"(حد سے تجاوز)",pdfPreview:"PDF پیش نظارہ",lexical:{fontFamily:"فونٹ فیملی",fontSize:"فونٹ سائز",lineHeight:"لائن کی اونچائی",fontColor:"فونٹ رنگ",highlightColor:"ہائی لائٹ رنگ",backgroundColor:"پس منظر رنگ",bold:"بولڈ",italic:"ترچھا",underline:"خط کشیدہ",strikethrough:"کٹا ہوا",code:"کوڈ",clearFormatting:"فارمیٹنگ صاف کریں",normal:"عام",heading:e=>`سرخی ${e}`,bulletList:"بلٹ فہرست",orderedList:"نمبر شدہ فہرست",checkList:"چیک فہرست",indent:"اندر کریں",outdent:"باہر کریں",blockquote:"اقتباس",codeBlock:"کوڈ بلاک",horizontalRule:"افقی لکیر",insertTable:"ٹیبل داخل کریں",link:"لنک",undo:"واپس",redo:"دوبارہ",cut:"کاٹیں",copy:"نقل",paste:"چسپاں",defaultOption:"پہلے سے طے شدہ",slashCommands:"سلیش کمانڈز",noCommandsFound:"کوئی کمانڈ نہیں ملی",changeBlockType:"بلاک کی قسم تبدیل کریں",blockTypes:"بلاک کی اقسام",enterUrl:"URL درج کریں:",tableActions:"Table actions",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table"},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,o)=>`Page ${e} is out of range (1-${o})`,renderFailed:"Failed to render PDF page"}};exports.default=r;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Use as q, coalesce as G, aria as V, attr as c, on as E, html as m, Value as C, Empty as T, computedOf as k, When as A, dataAttr as P, TextNode as J, prop as w, Fragment as $, emitValueAsNumber as Q, emitValue as X } from "@tempots/dom";
|
|
2
|
-
import { B as Y, I as z } from "./translations-
|
|
3
|
-
import { B as Z, I as ee } from "./input-container-
|
|
2
|
+
import { B as Y, I as z } from "./translations-DyCmyLE_.js";
|
|
3
|
+
import { B as Z, I as ee } from "./input-container-DMoVdH6E.js";
|
|
4
4
|
import { M as te, L as se, i as g } from "./stack-Bm-UZosx.js";
|
|
5
5
|
import { s as j } from "./session-id-3KiilioY.js";
|
|
6
6
|
const S = (s, e) => s === e || s !== s && e !== e;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("@tempots/dom"),E=require("./translations-Cy9hoMGV.cjs"),j=require("./input-container-DiYEl_y8.cjs"),f=require("./stack-4VUGISn6.cjs"),_=require("./session-id-B5lJMzbB.cjs"),D=(n,e)=>n===e||n!==n&&e!==e;function G({size:n="sm",icon:e="line-md:close",disabled:s,roundedness:i="full",color:r="base",onClick:l,label:o},...a){return t.Use(E.BeatUII18n,c=>{const d=t.coalesce(o,c.$.closeModal);return j.Button({variant:"text",size:n,roundedness:i,disabled:s,color:r,onClick:l},t.attr.title(d),t.aria.label(d),...a,E.Icon({icon:e,size:n??"sm"}))})}const J=n=>{const{value:e,onBlur:s,onChange:i,onInput:r,placeholder:l,disabled:o,id:a,checkedIcon:c,uncheckedIcon:d,iconSize:u="lg"}=n,p=a??_.sessionId("checkbox"),g=`${p}-label`,y=()=>{if(t.Value.get(o??!1))return;const h=t.Value.get(e);i?.(!h),r?.(!h)},m=h=>{t.Value.get(o??!1)||(h.key===" "||h.key==="Enter")&&(h.preventDefault(),y())};return j.InputContainer({baseContainer:!0,growInput:!1,...n,input:t.html.span(t.attr.class("bc-checkbox-input"),t.html.span(t.attr.class("bc-checkbox-input__checkbox"),t.attr.class(t.Value.map(e,h=>h?"bc-checkbox-input__checkbox--checked":"bc-checkbox-input__checkbox--unchecked")),t.attr.class(t.Value.map(o??!1,h=>h?"bc-checkbox-input__checkbox--disabled":"")),t.attr.id(p),t.attr.role("checkbox"),t.attr.tabindex(t.Value.map(o??!1,h=>h?-1:0)),t.aria.checked(e),t.aria.disabled(o),l!=null?t.aria.labelledby(g):t.Empty,t.on.keydown(m),s!=null?t.on.blur(s):t.Empty,E.Icon({icon:t.computedOf(e,c,d)((h,v,w)=>h?v??"akar-icons/check-box-fill":w??"akar-icons/box"),accessibility:"decorative",size:u})),l!=null?t.html.label(t.attr.class("bc-checkbox-input__label"),t.attr.id(g),t.attr.for(p),f.MutedLabel(l)):t.Empty)},t.on.click(y))},P=t.html.span(t.attr.class("bc-input-wrapper__required")," *");function Q(n){const e=["bc-input-wrapper"];return n!=="vertical"&&e.push(`bc-input-wrapper--${n}`),e.join(" ")}function X(n,e){const s=["bc-input-wrapper__label-text"];return n?s.push("bc-input-wrapper__label-text--error"):e?s.push("bc-input-wrapper__label-text--disabled"):s.push("bc-input-wrapper__label-text--default"),s.join(" ")}function Y(n,e){if(n==="horizontal-fixed"&&e!=null)return`--input-wrapper-label-width: ${e}`}const M=({fullWidth:n=!1,required:e,label:s,labelChildren:i,context:r,description:l,content:o,error:a,labelFor:c,hasError:d,disabled:u,layout:p,labelWidth:g},...y)=>{const m=d??a!=null,h=u??!1,v=p??"vertical",w=_.sessionId("input-wrapper"),I=l?`${w}-description`:void 0,V=a!=null?`${w}-error`:void 0,B=t.computedOf(v)(b=>b!=="vertical"),K=t.computedOf(v,g??void 0)((b,C)=>Y(b,C));return t.html.div(t.attr.class(t.Value.map(v,b=>Q(b))),t.attr.class(t.Value.map(n,b=>b?"bc-input-wrapper--full-width":"")),t.attr.style(K),s!=null||r!=null?t.html.div(t.attr.class("bc-input-wrapper__header"),t.html.div(t.attr.class("bc-input-wrapper__label-section"),t.html.label(t.attr.class("bc-input-wrapper__label"),c!=null?t.attr.for(c):t.Empty,t.html.span(t.attr.class(t.computedOf(m,h)((b,C)=>X(b??!1,C??!1))),s),s!=null&&e?P:t.Empty),t.When(t.computedOf(B,l)((b,C)=>b&&C!=null),()=>t.html.div(t.attr.class("bc-input-wrapper__description bc-input-wrapper__description--under-label"),t.attr.id(I),l))),r!=null?f.Label(r):t.Empty,i):t.Empty,t.html.div(t.attr.class("bc-input-wrapper__content"),[I,V].filter(Boolean).length>0?t.dataAttr.describedby([I,V].filter(Boolean).join(" ")):t.Empty,e?t.dataAttr.required("true"):t.Empty,t.When(m,()=>t.dataAttr.invalid("true")),o),t.When(t.computedOf(B,l)((b,C)=>!b&&C!=null),()=>t.html.div(t.attr.class("bc-input-wrapper__description"),t.attr.id(I),l)),t.When(m,()=>t.html.div(t.attr.class("bc-input-wrapper__error"),t.attr.id(V),t.aria.live("polite"),t.attr.role("alert"),a)),...y)},H=((n,e)=>()=>{n.markTouched(),e?.()}),O=(n,e)=>s=>{n.change(s),e?.(s)};function x(n,e){const{controller:s,onBlur:i,onChange:r,id:l,triggerOn:o,...a}=e;return n({id:l??s.name,disabled:s.disabled,value:s.signal,hasError:s.errorVisible,name:s.name,...a,onInput:o==="input"?O(s,r):void 0,onChange:o!=="input"?O(s,r):void 0,onBlur:H(s,i)})}function Z(n,{id:e,labelFor:s,...i},...r){const l=e??i.controller.name??_.sessionId("control"),o=s??l;return M({...i,hasError:i.controller.errorVisible,error:t.TextNode(i.controller.error.map(a=>a??"")),labelFor:o,content:x(a=>n({...a,id:l}),i)},...r)}function F(n,e){const{toInput:s,fromInput:i,controller:r,...l}=e,o=r.transform(s,i);return x(n,{...l,controller:o})}function ee(n,{id:e,labelFor:s,...i},...r){const l=e??i.controller.name??_.sessionId("control");return M({...i,labelFor:s??l,content:F(n,{...i,id:l})},...r)}function te(n){return n.split(".").map(s=>{const i=s.match(/^\[(\d+)\]$/);return i?Number(i[1]):s})}function $(n){return typeof n=="number"?`[${n}]`:`.${n}`}function W(n){if(n.length===0)return"";const[e,...s]=n;return[typeof e=="number"?`[${e}]`:e,...s.map($)].join("")}const se={valid:f.i.valid,invalid(n){return f.i.invalid({message:n})},invalidFields(n){const e={};for(const[s,i]of Object.entries(n))e[s]=typeof i=="string"?{message:i}:i;return f.i.invalid({dependencies:e})},fromError(n){return f.i.invalid(n)}};function T(n){return function(s){if(s.type==="valid")return s;let i=s.error;for(const r of n)if(i=i?.dependencies?.[r],i==null)return f.i.valid;return f.i.invalid(i)}}class k{path;change;signal;status;error;hasError;touched;errorVisible;dirty;dependencyErrors;#e={disabled:t.prop(!1),touched:t.prop(!1)};#s;#t=t.prop(void 0);parent;disabled;#n=[];disabledOrHasErrors;constructor(e,s,i,r,l,o=D){this.path=e,this.change=s,this.signal=i,this.status=r,this.#s=o,this.#t.set(i.value),this.error=r.map(a=>a?.type==="invalid"?a.error?.message:void 0),this.hasError=this.error.map(a=>a!=null),this.touched=this.#e.touched,l.validationMode?this.errorVisible=t.computedOf(this.hasError,this.touched,l.validationMode)((a,c,d)=>d==="eager"?!!a:!!a&&!!c):this.errorVisible=t.computedOf(this.hasError,this.touched)((a,c)=>!!a&&!!c),this.dirty=t.computedOf(this.signal,this.#t)((a,c)=>!this.#s(a,c)),this.dependencyErrors=r.map(a=>a?.type==="invalid"?a.error?.dependencies:void 0),this.parent=l,this.disabled=t.computedOf(this.#e.disabled,l.disabled)((a,c)=>a||c),this.disabledOrHasErrors=t.computedOf(this.disabled,this.hasError)((a,c)=>a||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 W(this.path)}onDispose=e=>{this.#n.push(e)};dispose=()=>{for(const e of this.#n)try{e()}catch(s){console.error("Error in dispose callback:",s)}this.#n.length=0};setDisabled=e=>{this.#e.disabled.set(e)};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.signal.value)};reset=()=>{this.change(this.#t.value)};array=(e=D)=>new q(this.path,this.change,this.signal,this.status,this.parent,e);object=(e=D)=>new N(this.path,this.change,this.signal,this.status,this.parent,e);transform=(e,s,i=[],r=D)=>new k([...this.path,...i],l=>this.change(s(l)),this.signal.map(e,r),this.status.map(T(i)),this.parent,r);asyncTransform=(e,s,i,r=[],l=D)=>new k([...this.path,...r],o=>{s(o).then(a=>this.change(a))},this.signal.mapAsync(e,i,void 0,l),this.status.map(T(r)),this.parent,l)}class N extends k{#e=new Map;#s=new Map;#t=new Map;#n=t.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=t.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let e=!1;for(const s of this.#s.values())if(s){e=!0;break}this.#n.set(this.touched.value||e)};constructor(e,s,i,r,l,o){super(e,s,i.map(c=>c??{},o),r,l,o),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const a=this.signal.on(()=>this.#a());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.#s.clear(),this.#n.dispose();for(const c of this.#i.values())c();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),a()})}field=e=>{if(this.#e.has(e))return this.#e.get(e);const s=async o=>{this.change({...this.signal.value,[e]:o})},i=new k([...this.path,e],s,this.signal.map(o=>o[e]),this.status.map(T([e])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e.set(e,i);const r=i.touched.on(o=>{this.#s.set(e,o),this.#l()});this.#t.set(e,r);const l=i.dirty.on(o=>{this.#r.set(e,o),this.#a()});return this.#i.set(e,l),i};markAllTouched=()=>{this.markTouched();const e=this.signal.value;for(const s of Object.keys(e))this.field(s).markTouched();for(const s of this.#e.values())s.markTouched()};markAllPristine=()=>{this.markPristine();const e=this.signal.value;for(const s of Object.keys(e))this.field(s).markPristine?.();for(const s of this.#e.values())s.markPristine?.()};#a=()=>{let e=!1;for(const s of this.#r.values())if(s){e=!0;break}this.#o.set(this.dirty.value||e)}}class q extends k{#e=new Array;length;#s=new Map;#t=new Map;#n=t.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=t.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let e=!1;for(const s of this.#s.values())if(s){e=!0;break}this.#n.set(this.touched.value||e)};constructor(e,s,i,r,l,o){const a=i.map(u=>u??[],o);super(e,s,a,r,l,o);const c=a.on(u=>{const p=this.#e.length-u.length;p>0&&(this.#e.splice(u.length,p).forEach((g,y)=>{const m=u.length+y;g.dispose(),this.#t.get(m)?.(),this.#t.delete(m),this.#s.delete(m),this.#i.get(m)?.(),this.#i.delete(m),this.#r.delete(m)}),this.#l(),this.#a())});this.length=a.map(u=>u.length),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const d=this.signal.on(()=>this.#a());this.onDispose(()=>{for(const u of this.#e)u.dispose();this.length.dispose(),this.#e.length=0,c(),a.dispose();for(const u of this.#t.values())u();this.#t.clear(),this.#s.clear(),this.#n.dispose();for(const u of this.#i.values())u();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),d()})}item=e=>{if(this.#e[e])return this.#e[e];const s=async o=>{const a=this.signal.value.slice();a[e]=o,this.change(a)},i=new k([...this.path,e],s,this.signal.map(o=>o[e]),this.status.map(T([e])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e[e]=i;const r=i.touched.on(o=>{this.#s.set(e,o),this.#l()});this.#t.set(e,r);const l=i.dirty.on(o=>{this.#r.set(e,o),this.#a()});return this.#i.set(e,l),i};push=(...e)=>{this.change([...this.signal.value,...e])};pop=()=>{this.splice(this.signal.value.length-1,1)};shift=()=>{this.splice(0,1)};unshift=(...e)=>{this.change([...e,...this.signal.value])};removeAt=e=>{this.splice(e,1)};splice=(e,s)=>{const i=this.signal.value.slice();i.splice(e,s),this.change(i)};move=(e,s,i=1)=>{if(i<1||e===s)return;const r=this.signal.value.slice(),l=r.splice(e,i);r.splice(s,0,...l),this.change(r)};markAllTouched=()=>{this.markTouched();const e=this.signal.value.length;for(let s=0;s<e;s++)this.item(s).markTouched()};markAllPristine=()=>{this.markPristine();const e=this.signal.value.length;for(let s=0;s<e;s++)this.item(s).markPristine?.()};#a=()=>{let e=!1;for(const s of this.#r.values())if(s){e=!0;break}this.#o.set(this.dirty.value||e)}}function z(n){function e(s){return typeof s=="number"?s:s.toString()}return n.map(s=>typeof s=="object"&&s.key!=null?e(s.key):e(s))}function L(n){const e=n.filter(r=>r.path==null||r.path.length===0).map(r=>r.message),s=n.filter(r=>r.path!=null&&r.path.length>0).reduce((r,l)=>{const o=z(l.path),a=o.pop();let c=r;for(const d of o)c.dependencies==null&&(c.dependencies={}),c.dependencies[d]==null&&(c.dependencies[d]={}),c=c.dependencies[d];return c.dependencies==null&&(c.dependencies={}),c.dependencies[a]={message:l.message},r},{}),i=e.join(`
|
|
1
|
+
"use strict";const t=require("@tempots/dom"),E=require("./translations-OOsMRpX9.cjs"),j=require("./input-container-BWYHj0Iq.cjs"),f=require("./stack-4VUGISn6.cjs"),_=require("./session-id-B5lJMzbB.cjs"),D=(n,e)=>n===e||n!==n&&e!==e;function G({size:n="sm",icon:e="line-md:close",disabled:s,roundedness:i="full",color:r="base",onClick:l,label:o},...a){return t.Use(E.BeatUII18n,c=>{const d=t.coalesce(o,c.$.closeModal);return j.Button({variant:"text",size:n,roundedness:i,disabled:s,color:r,onClick:l},t.attr.title(d),t.aria.label(d),...a,E.Icon({icon:e,size:n??"sm"}))})}const J=n=>{const{value:e,onBlur:s,onChange:i,onInput:r,placeholder:l,disabled:o,id:a,checkedIcon:c,uncheckedIcon:d,iconSize:u="lg"}=n,p=a??_.sessionId("checkbox"),g=`${p}-label`,y=()=>{if(t.Value.get(o??!1))return;const h=t.Value.get(e);i?.(!h),r?.(!h)},m=h=>{t.Value.get(o??!1)||(h.key===" "||h.key==="Enter")&&(h.preventDefault(),y())};return j.InputContainer({baseContainer:!0,growInput:!1,...n,input:t.html.span(t.attr.class("bc-checkbox-input"),t.html.span(t.attr.class("bc-checkbox-input__checkbox"),t.attr.class(t.Value.map(e,h=>h?"bc-checkbox-input__checkbox--checked":"bc-checkbox-input__checkbox--unchecked")),t.attr.class(t.Value.map(o??!1,h=>h?"bc-checkbox-input__checkbox--disabled":"")),t.attr.id(p),t.attr.role("checkbox"),t.attr.tabindex(t.Value.map(o??!1,h=>h?-1:0)),t.aria.checked(e),t.aria.disabled(o),l!=null?t.aria.labelledby(g):t.Empty,t.on.keydown(m),s!=null?t.on.blur(s):t.Empty,E.Icon({icon:t.computedOf(e,c,d)((h,v,w)=>h?v??"akar-icons/check-box-fill":w??"akar-icons/box"),accessibility:"decorative",size:u})),l!=null?t.html.label(t.attr.class("bc-checkbox-input__label"),t.attr.id(g),t.attr.for(p),f.MutedLabel(l)):t.Empty)},t.on.click(y))},P=t.html.span(t.attr.class("bc-input-wrapper__required")," *");function Q(n){const e=["bc-input-wrapper"];return n!=="vertical"&&e.push(`bc-input-wrapper--${n}`),e.join(" ")}function X(n,e){const s=["bc-input-wrapper__label-text"];return n?s.push("bc-input-wrapper__label-text--error"):e?s.push("bc-input-wrapper__label-text--disabled"):s.push("bc-input-wrapper__label-text--default"),s.join(" ")}function Y(n,e){if(n==="horizontal-fixed"&&e!=null)return`--input-wrapper-label-width: ${e}`}const M=({fullWidth:n=!1,required:e,label:s,labelChildren:i,context:r,description:l,content:o,error:a,labelFor:c,hasError:d,disabled:u,layout:p,labelWidth:g},...y)=>{const m=d??a!=null,h=u??!1,v=p??"vertical",w=_.sessionId("input-wrapper"),I=l?`${w}-description`:void 0,V=a!=null?`${w}-error`:void 0,B=t.computedOf(v)(b=>b!=="vertical"),K=t.computedOf(v,g??void 0)((b,C)=>Y(b,C));return t.html.div(t.attr.class(t.Value.map(v,b=>Q(b))),t.attr.class(t.Value.map(n,b=>b?"bc-input-wrapper--full-width":"")),t.attr.style(K),s!=null||r!=null?t.html.div(t.attr.class("bc-input-wrapper__header"),t.html.div(t.attr.class("bc-input-wrapper__label-section"),t.html.label(t.attr.class("bc-input-wrapper__label"),c!=null?t.attr.for(c):t.Empty,t.html.span(t.attr.class(t.computedOf(m,h)((b,C)=>X(b??!1,C??!1))),s),s!=null&&e?P:t.Empty),t.When(t.computedOf(B,l)((b,C)=>b&&C!=null),()=>t.html.div(t.attr.class("bc-input-wrapper__description bc-input-wrapper__description--under-label"),t.attr.id(I),l))),r!=null?f.Label(r):t.Empty,i):t.Empty,t.html.div(t.attr.class("bc-input-wrapper__content"),[I,V].filter(Boolean).length>0?t.dataAttr.describedby([I,V].filter(Boolean).join(" ")):t.Empty,e?t.dataAttr.required("true"):t.Empty,t.When(m,()=>t.dataAttr.invalid("true")),o),t.When(t.computedOf(B,l)((b,C)=>!b&&C!=null),()=>t.html.div(t.attr.class("bc-input-wrapper__description"),t.attr.id(I),l)),t.When(m,()=>t.html.div(t.attr.class("bc-input-wrapper__error"),t.attr.id(V),t.aria.live("polite"),t.attr.role("alert"),a)),...y)},H=((n,e)=>()=>{n.markTouched(),e?.()}),O=(n,e)=>s=>{n.change(s),e?.(s)};function x(n,e){const{controller:s,onBlur:i,onChange:r,id:l,triggerOn:o,...a}=e;return n({id:l??s.name,disabled:s.disabled,value:s.signal,hasError:s.errorVisible,name:s.name,...a,onInput:o==="input"?O(s,r):void 0,onChange:o!=="input"?O(s,r):void 0,onBlur:H(s,i)})}function Z(n,{id:e,labelFor:s,...i},...r){const l=e??i.controller.name??_.sessionId("control"),o=s??l;return M({...i,hasError:i.controller.errorVisible,error:t.TextNode(i.controller.error.map(a=>a??"")),labelFor:o,content:x(a=>n({...a,id:l}),i)},...r)}function F(n,e){const{toInput:s,fromInput:i,controller:r,...l}=e,o=r.transform(s,i);return x(n,{...l,controller:o})}function ee(n,{id:e,labelFor:s,...i},...r){const l=e??i.controller.name??_.sessionId("control");return M({...i,labelFor:s??l,content:F(n,{...i,id:l})},...r)}function te(n){return n.split(".").map(s=>{const i=s.match(/^\[(\d+)\]$/);return i?Number(i[1]):s})}function $(n){return typeof n=="number"?`[${n}]`:`.${n}`}function W(n){if(n.length===0)return"";const[e,...s]=n;return[typeof e=="number"?`[${e}]`:e,...s.map($)].join("")}const se={valid:f.i.valid,invalid(n){return f.i.invalid({message:n})},invalidFields(n){const e={};for(const[s,i]of Object.entries(n))e[s]=typeof i=="string"?{message:i}:i;return f.i.invalid({dependencies:e})},fromError(n){return f.i.invalid(n)}};function T(n){return function(s){if(s.type==="valid")return s;let i=s.error;for(const r of n)if(i=i?.dependencies?.[r],i==null)return f.i.valid;return f.i.invalid(i)}}class k{path;change;signal;status;error;hasError;touched;errorVisible;dirty;dependencyErrors;#e={disabled:t.prop(!1),touched:t.prop(!1)};#s;#t=t.prop(void 0);parent;disabled;#n=[];disabledOrHasErrors;constructor(e,s,i,r,l,o=D){this.path=e,this.change=s,this.signal=i,this.status=r,this.#s=o,this.#t.set(i.value),this.error=r.map(a=>a?.type==="invalid"?a.error?.message:void 0),this.hasError=this.error.map(a=>a!=null),this.touched=this.#e.touched,l.validationMode?this.errorVisible=t.computedOf(this.hasError,this.touched,l.validationMode)((a,c,d)=>d==="eager"?!!a:!!a&&!!c):this.errorVisible=t.computedOf(this.hasError,this.touched)((a,c)=>!!a&&!!c),this.dirty=t.computedOf(this.signal,this.#t)((a,c)=>!this.#s(a,c)),this.dependencyErrors=r.map(a=>a?.type==="invalid"?a.error?.dependencies:void 0),this.parent=l,this.disabled=t.computedOf(this.#e.disabled,l.disabled)((a,c)=>a||c),this.disabledOrHasErrors=t.computedOf(this.disabled,this.hasError)((a,c)=>a||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 W(this.path)}onDispose=e=>{this.#n.push(e)};dispose=()=>{for(const e of this.#n)try{e()}catch(s){console.error("Error in dispose callback:",s)}this.#n.length=0};setDisabled=e=>{this.#e.disabled.set(e)};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.signal.value)};reset=()=>{this.change(this.#t.value)};array=(e=D)=>new q(this.path,this.change,this.signal,this.status,this.parent,e);object=(e=D)=>new N(this.path,this.change,this.signal,this.status,this.parent,e);transform=(e,s,i=[],r=D)=>new k([...this.path,...i],l=>this.change(s(l)),this.signal.map(e,r),this.status.map(T(i)),this.parent,r);asyncTransform=(e,s,i,r=[],l=D)=>new k([...this.path,...r],o=>{s(o).then(a=>this.change(a))},this.signal.mapAsync(e,i,void 0,l),this.status.map(T(r)),this.parent,l)}class N extends k{#e=new Map;#s=new Map;#t=new Map;#n=t.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=t.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let e=!1;for(const s of this.#s.values())if(s){e=!0;break}this.#n.set(this.touched.value||e)};constructor(e,s,i,r,l,o){super(e,s,i.map(c=>c??{},o),r,l,o),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const a=this.signal.on(()=>this.#a());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.#s.clear(),this.#n.dispose();for(const c of this.#i.values())c();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),a()})}field=e=>{if(this.#e.has(e))return this.#e.get(e);const s=async o=>{this.change({...this.signal.value,[e]:o})},i=new k([...this.path,e],s,this.signal.map(o=>o[e]),this.status.map(T([e])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e.set(e,i);const r=i.touched.on(o=>{this.#s.set(e,o),this.#l()});this.#t.set(e,r);const l=i.dirty.on(o=>{this.#r.set(e,o),this.#a()});return this.#i.set(e,l),i};markAllTouched=()=>{this.markTouched();const e=this.signal.value;for(const s of Object.keys(e))this.field(s).markTouched();for(const s of this.#e.values())s.markTouched()};markAllPristine=()=>{this.markPristine();const e=this.signal.value;for(const s of Object.keys(e))this.field(s).markPristine?.();for(const s of this.#e.values())s.markPristine?.()};#a=()=>{let e=!1;for(const s of this.#r.values())if(s){e=!0;break}this.#o.set(this.dirty.value||e)}}class q extends k{#e=new Array;length;#s=new Map;#t=new Map;#n=t.prop(!1);touchedDeep=this.#n;#r=new Map;#i=new Map;#o=t.prop(!1);dirtyDeep=this.#o;#c;#h;#l=()=>{let e=!1;for(const s of this.#s.values())if(s){e=!0;break}this.#n.set(this.touched.value||e)};constructor(e,s,i,r,l,o){const a=i.map(u=>u??[],o);super(e,s,a,r,l,o);const c=a.on(u=>{const p=this.#e.length-u.length;p>0&&(this.#e.splice(u.length,p).forEach((g,y)=>{const m=u.length+y;g.dispose(),this.#t.get(m)?.(),this.#t.delete(m),this.#s.delete(m),this.#i.get(m)?.(),this.#i.delete(m),this.#r.delete(m)}),this.#l(),this.#a())});this.length=a.map(u=>u.length),this.#c=this.touched.on(()=>{this.#l()}),this.#h=this.dirty.on(()=>{this.#a()});const d=this.signal.on(()=>this.#a());this.onDispose(()=>{for(const u of this.#e)u.dispose();this.length.dispose(),this.#e.length=0,c(),a.dispose();for(const u of this.#t.values())u();this.#t.clear(),this.#s.clear(),this.#n.dispose();for(const u of this.#i.values())u();this.#i.clear(),this.#r.clear(),this.#o.dispose(),this.#c(),this.#h(),d()})}item=e=>{if(this.#e[e])return this.#e[e];const s=async o=>{const a=this.signal.value.slice();a[e]=o,this.change(a)},i=new k([...this.path,e],s,this.signal.map(o=>o[e]),this.status.map(T([e])),{disabled:this.disabled,validationMode:this.parent.validationMode});this.#e[e]=i;const r=i.touched.on(o=>{this.#s.set(e,o),this.#l()});this.#t.set(e,r);const l=i.dirty.on(o=>{this.#r.set(e,o),this.#a()});return this.#i.set(e,l),i};push=(...e)=>{this.change([...this.signal.value,...e])};pop=()=>{this.splice(this.signal.value.length-1,1)};shift=()=>{this.splice(0,1)};unshift=(...e)=>{this.change([...e,...this.signal.value])};removeAt=e=>{this.splice(e,1)};splice=(e,s)=>{const i=this.signal.value.slice();i.splice(e,s),this.change(i)};move=(e,s,i=1)=>{if(i<1||e===s)return;const r=this.signal.value.slice(),l=r.splice(e,i);r.splice(s,0,...l),this.change(r)};markAllTouched=()=>{this.markTouched();const e=this.signal.value.length;for(let s=0;s<e;s++)this.item(s).markTouched()};markAllPristine=()=>{this.markPristine();const e=this.signal.value.length;for(let s=0;s<e;s++)this.item(s).markPristine?.()};#a=()=>{let e=!1;for(const s of this.#r.values())if(s){e=!0;break}this.#o.set(this.dirty.value||e)}}function z(n){function e(s){return typeof s=="number"?s:s.toString()}return n.map(s=>typeof s=="object"&&s.key!=null?e(s.key):e(s))}function L(n){const e=n.filter(r=>r.path==null||r.path.length===0).map(r=>r.message),s=n.filter(r=>r.path!=null&&r.path.length>0).reduce((r,l)=>{const o=z(l.path),a=o.pop();let c=r;for(const d of o)c.dependencies==null&&(c.dependencies={}),c.dependencies[d]==null&&(c.dependencies[d]={}),c=c.dependencies[d];return c.dependencies==null&&(c.dependencies={}),c.dependencies[a]={message:l.message},r},{}),i=e.join(`
|
|
2
2
|
`);return{...s,message:i!=""?i:void 0}}function R({initialValue:n,onChange:e,validate:s,equals:i,validationMode:r,validateDebounceMs:l}){const o=t.Value.deriveProp(n),a=t.prop(f.i.valid),c=t.prop(!1),d=t.prop(r??"onTouched"),u=h=>{a.set(h)};let p;const g=async h=>{if(s!=null){const v=await s(h);u(v)}},y=async h=>{o.set(h),e?.(h);const v=d.value;if(s!=null){if(v==="onSubmit")return;const w=l??0;w>0?(p&&clearTimeout(p),p=setTimeout(()=>{g(h)},w)):await g(h)}},m=new k([],y,o,a,{disabled:c,validationMode:d},i??D);return m.onDispose(()=>{c.dispose(),o.dispose(),a.dispose(),d.dispose(),p&&clearTimeout(p)}),{controller:m,setStatus:u}}function A(n){return t.Fragment(t.attr.disabled(n.disabled),t.attr.name(n.name))}function ne(n,{triggerOn:e="change"}={}){return t.Fragment(A(n),t.attr.value(n.signal),(e==="input"?t.on.input:t.on.change)(t.emitValue(n.change)))}function ie(n,{triggerOn:e="change"}={}){return t.Fragment(A(n),t.attr.valueAsNumber(n.signal),(e==="input"?t.on.input:t.on.change)(t.emitValueAsNumber(n.change)))}function S(n){return n.issues!=null?f.i.invalid(L(n.issues)):f.i.valid}async function re({task:n,errorMessage:e,errorPath:s=["root"],validation:i}){try{const r=await n();return i!=null?i(r):f.i.valid}catch(r){const l=e??(r instanceof Error?r.message:"Operation failed");return s.length===1&&s[0]==="root"?f.i.invalid({message:l}):f.i.invalid({dependencies:U(s,l)})}}function U(n,e){if(n.length===1)return{[n[0]]:{message:e}};const[s,...i]=n;return{[s]:{dependencies:U(i,e)}}}function ae({initialValue:n={},schema:e,onSubmit:s=async()=>f.i.valid,validationMode:i,validateDebounceMs:r}){const{controller:l,setStatus:o}=R({initialValue:n,validationMode:i??"onTouched",validateDebounceMs:r,validate:(i??"onTouched")==="onSubmit"||e==null?void 0:async u=>S(await e["~standard"].validate(u))}),a=t.prop(!1),c=l.object();return c.onDispose(()=>a.dispose()),{controller:c,setStatus:o,submit:async u=>{if(a.set(!0),u?.preventDefault(),c.markAllTouched(),e!=null){const g=c.signal.value,y=S(await e["~standard"].validate(g));if(o(y),y.type==="invalid"){a.set(!1);return}}const p=await s(c.signal.value);a.set(!1),p.type==="invalid"&&o(p)},submitting:a}}exports.ArrayController=q;exports.BaseControl=x;exports.BaseMappedControl=F;exports.CheckboxInput=J;exports.CloseButton=G;exports.Control=Z;exports.Controller=k;exports.ControllerValidation=se;exports.InputWrapper=M;exports.MappedControl=ee;exports.O=D;exports.ObjectController=N;exports.RequiredSymbol=P;exports.connectCommonAttributes=A;exports.connectNumberInput=ie;exports.connectStringInput=ne;exports.convertStandardSchemaIssues=L;exports.convertStandardSchemaPathToPath=z;exports.makeMapValidation=T;exports.makeOnBlurHandler=H;exports.makeOnChangeHandler=O;exports.parsePath=te;exports.pathToString=W;exports.standardSchemaResultToValidation=S;exports.taskToValidation=re;exports.useController=R;exports.useForm=ae;exports.wrapSegment=$;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-OOsMRpX9.cjs"),l={loadingExtended:"Đang tải, vui lòng đợi",loadingShort:"Đang tải...",locale:"Ngôn ngữ",iconDescription:"Biểu tượng",loadingIcon:"Biểu tượng tải",failedToLoadIcon:"Không thể tải biểu tượng",editLabel:"Chỉnh sửa",selectOne:"Chọn một",selectNone:"Không có",selectMany:"Chọn nhiều",noResults:"Không có kết quả",passwordPlaceholderText:"Mật khẩu bí mật",togglePasswordVisibility:"Chuyển đổi hiển thị mật khẩu",toggleMenu:"Chuyển đổi menu",toggleAside:"Chuyển đổi bảng bên",mainNavigation:"Điều hướng chính",sidebar:"Thanh bên",closeDrawer:"Đóng ngăn kéo",closeModal:"Đóng modal",confirm:"Xác nhận",cancel:"Hủy",addLabel:"Thêm",removeItem:"Xóa mục",currentLocale:"Tiếng Việt",ar:"Tiếng Ả Rập",de:"Tiếng Đức",en:"Tiếng Anh",es:"Tiếng Tây Ban Nha",fr:"Tiếng Pháp",hi:"Tiếng Hindi",it:"Tiếng Ý",ja:"Tiếng Nhật",ko:"Tiếng Hàn",nl:"Tiếng Hà Lan",pl:"Tiếng Ba Lan",pt:"Tiếng Bồ Đào Nha",ru:"Tiếng Nga",tr:"Tiếng Thổ Nhĩ Kỳ",vi:"Tiếng Việt",zh:"Tiếng Trung",he:"Tiếng Do Thái",fa:"Tiếng Ba Tư",ur:"Tiếng Urdu",emailPlaceholderText:"Nhập email của bạn",incrementValue:"Tăng giá trị",decrementValue:"Giảm giá trị",dropZoneInstructions:n=>n?"Nhấp để chọn hoặc kéo tệp vào đây, hoặc nhấn Enter hoặc Space để mở trình chọn tệp":"Kéo tệp vào đây",fileSizeUnits:["Byte","KB","MB","GB","TB"],removeFile:"Xóa tệp",clearAllFiles:"Xóa tất cả tệp",clearValue:"Xóa giá trị",unknownType:"Loại không xác định",filesInputInstructions:(n,e,i)=>{let o=n==null||n>1?"Nhấp để chọn hoặc kéo tệp vào đây":"Nhấp để chọn hoặc kéo một tệp vào đây";if(n||e){const t=[];if(n!=null&&n>1&&t.push(`tối đa ${n} tệp`),e&&i){const h=a.formatFileSize(e,{units:i});t.push(`mỗi tệp tối đa ${h}`)}t.length>0&&(o+=` (${t.join(", ")})`)}return o},paginationLabel:"Phân trang",firstPage:"Trang đầu",previousPage:"Trang trước",nextPage:"Trang tiếp",lastPage:"Trang cuối",breadcrumbs:"Thanh điều hướng",commandPalette:"Bảng lệnh",typeACommand:"Nhập lệnh...",noResultsFound:"Không tìm thấy kết quả",noMatchingCommands:"Không có lệnh phù hợp",appearanceSystem:"Hệ thống",appearanceLight:"Sáng",appearanceDark:"Tối",ok:"OK",changeTypeConfirmation:"Thay đổi loại sẽ xóa giá trị hiện tại. Tiếp tục?",notifications:"Thông báo",markAllAsRead:"Đánh dấu tất cả đã đọc",noNotifications:"Không có thông báo",schemaConflictsDetected:"Phát hiện xung đột lược đồ",schemaViolationsDetected:"Phát hiện vi phạm lược đồ",properties:"Thuộc tính",uploading:"Đang tải lên...",dropFilesOrBrowse:"Kéo thả tệp vào đây hoặc nhấp để duyệt",acceptedTypes:n=>`Loại tệp được chấp nhận: ${n}`,enterUrlPrompt:"Nhập URL:",exceeded:"(vượt quá)",pdfPreview:"Xem trước PDF",lexical:{fontFamily:"Phông chữ",fontSize:"Cỡ chữ",lineHeight:"Chiều cao dòng",fontColor:"Màu chữ",highlightColor:"Màu đánh dấu",backgroundColor:"Màu nền",bold:"Đậm",italic:"Nghiêng",underline:"Gạch chân",strikethrough:"Gạch ngang",code:"Mã",clearFormatting:"Xóa định dạng",normal:"Bình thường",heading:n=>`Tiêu đề ${n}`,bulletList:"Danh sách dấu đầu dòng",orderedList:"Danh sách đánh số",checkList:"Danh sách kiểm tra",indent:"Thụt lề",outdent:"Giảm thụt lề",blockquote:"Trích dẫn",codeBlock:"Khối mã",horizontalRule:"Đường kẻ ngang",insertTable:"Chèn bảng",link:"Liên kết",undo:"Hoàn tác",redo:"Làm lại",cut:"Cắt",copy:"Sao chép",paste:"Dán",defaultOption:"Mặc định",slashCommands:"Lệnh gạch chéo",noCommandsFound:"Không tìm thấy lệnh",changeBlockType:"Đổi loại khối",blockTypes:"Loại khối",enterUrl:"Nhập URL:",tableActions:"Table actions",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table"},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:n=>`Heading ${n}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Đang tải PDF...",loadFailed:"Không thể tải PDF",invalidPdf:"Tệp PDF không hợp lệ",pageOutOfRange:(n,e)=>`Trang ${n} nằm ngoài phạm vi (1-${e})`,renderFailed:"Không thể hiển thị trang PDF"}};exports.default=l;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as a } from "./translations-
|
|
1
|
+
import { f as a } from "./translations-DyCmyLE_.js";
|
|
2
2
|
const c = {
|
|
3
3
|
loadingExtended: "Đang tải, vui lòng đợi",
|
|
4
4
|
loadingShort: "Đang tải...",
|
|
@@ -113,6 +113,7 @@ const c = {
|
|
|
113
113
|
lexical: {
|
|
114
114
|
fontFamily: "Phông chữ",
|
|
115
115
|
fontSize: "Cỡ chữ",
|
|
116
|
+
lineHeight: "Chiều cao dòng",
|
|
116
117
|
fontColor: "Màu chữ",
|
|
117
118
|
highlightColor: "Màu đánh dấu",
|
|
118
119
|
backgroundColor: "Màu nền",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Value as p, prop as rt, computedOf as D, html as _, attr as u, svg as tt, svgAttr as Y, Empty as A, on as M, When as W, Fragment as j, aria as N, emitValue as Z, Use as lt, input as ot, emitValueAsNullableDate as et, emitValueAsNullableDateTime as nt, Repeat as ut, style as pt, emit as dt, emitValueAsNumber as V } from "@tempots/dom";
|
|
2
|
-
import { F as ht, N as z, T as gt, U as ft, a as mt } from "./deep-merge-
|
|
2
|
+
import { F as ht, N as z, T as gt, U as ft, a as mt } from "./deep-merge-C8dSqIXI.js";
|
|
3
3
|
import { $ as bt } from "./string-DYyMxBl-.js";
|
|
4
|
-
import { I as E } from "./input-container-
|
|
5
|
-
import { C as U, T as wt } from "./text-input-
|
|
6
|
-
import { B as yt, I as q, b as st, a as It } from "./translations-
|
|
4
|
+
import { I as E } from "./input-container-DMoVdH6E.js";
|
|
5
|
+
import { C as U, T as wt } from "./text-input-BLupB3cU.js";
|
|
6
|
+
import { B as yt, I as q, b as st, a as It } from "./translations-DyCmyLE_.js";
|
|
7
7
|
import { AutoSelect as Mt } from "@tempots/ui";
|
|
8
|
-
import { E as $t, P as xt } from "./notice-
|
|
8
|
+
import { E as $t, P as xt } from "./notice-D7hYFM5A.js";
|
|
9
9
|
import { s as _t } from "./session-id-3KiilioY.js";
|
|
10
10
|
import { r as kt } from "./utils-DEbsp9Q9.js";
|
|
11
11
|
function it(t) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@tempots/dom"),k=require("./deep-merge-Blrucd-E.cjs"),ct=require("./string-B9vVyfq3.cjs"),D=require("./input-container-DiYEl_y8.cjs"),S=require("./text-input-DUnhBUd6.cjs"),N=require("./translations-Cy9hoMGV.cjs"),ut=require("@tempots/ui"),z=require("./notice-DAVOTnfA.cjs"),pt=require("./session-id-B5lJMzbB.cjs"),dt=require("./utils-DIUEhA-Z.cjs");function q(e){if(typeof e!="string")return!1;const n=e.startsWith("#")?e.slice(1):e;return/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(n)}function X(e){if(typeof e!="string")return!1;const n=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=255&&i>=0&&i<=255&&c>=0&&c<=255}function Y(e){if(typeof e!="string")return!1;const n=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r,l]=s,i=parseInt(a,10),c=parseInt(o,10),u=parseInt(r,10),p=parseFloat(l);return i>=0&&i<=255&&c>=0&&c<=255&&u>=0&&u<=255&&p>=0&&p<=1}function G(e){if(typeof e!="string")return!1;const n=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=360&&i>=0&&i<=100&&c>=0&&c<=100}function gt(e){return q(e)||X(e)||Y(e)||G(e)}function K(e){if(!q(e))return null;let n=e.startsWith("#")?e.slice(1):e;return n.length===3&&(n=n.split("").map(s=>s+s).join("")),`#${n.toLowerCase()}`}function W(e,n,s){const a=o=>{const r=Math.round(Math.max(0,Math.min(255,o))).toString(16);return r.length===1?"0"+r:r};return`#${a(e)}${a(n)}${a(s)}`}function E(e){const n=K(e);if(!n)return null;const s=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return s?{r:parseInt(s[1],16),g:parseInt(s[2],16),b:parseInt(s[3],16)}:null}function ht(e,n){const s=E(e),a=E(n);if(!s||!a)return null;const o=(u,p,h)=>{const[m,g,f]=[u,p,h].map(I=>(I=I/255,I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4)));return .2126*m+.7152*g+.0722*f},r=o(s.r,s.g,s.b),l=o(a.r,a.g,a.b),i=Math.max(r,l),c=Math.min(r,l);return(i+.05)/(c+.05)}function Q(e){if(!e)return[0,0,0,1];const s=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(s){const u=s[1];if(u.length===8){const p=parseInt(u.slice(0,2),16),h=parseInt(u.slice(2,4),16),m=parseInt(u.slice(4,6),16),g=parseInt(u.slice(6,8),16)/255;return[p,h,m,g]}if(u.length===6)return[parseInt(u.slice(0,2),16),parseInt(u.slice(2,4),16),parseInt(u.slice(4,6),16),1];if(u.length===4){const p=parseInt(u[0]+u[0],16),h=parseInt(u[1]+u[1],16),m=parseInt(u[2]+u[2],16),g=parseInt(u[3]+u[3],16)/255;return[p,h,m,g]}if(u.length===3){const p=parseInt(u[0]+u[0],16),h=parseInt(u[1]+u[1],16),m=parseInt(u[2]+u[2],16);return[p,h,m,1]}}const a=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(a)return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];const o=e.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(o)return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),1];const r=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(r){const u=parseFloat(r[1]),p=parseFloat(r[2]),h=parseFloat(r[3]),m=r[4]!=null?parseFloat(r[4]):1,[g,f,I]=j(u,p/100,h/100);return[g,f,I,m]}const l=e.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(l){const u=parseFloat(l[1]),p=parseFloat(l[2])/100,h=parseFloat(l[3])/100,m=l[4]!=null?parseFloat(l[4]):1,[g,f,I]=tt(u,p,h);return[g,f,I,m]}const i=e.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(i){const u=i[1],p=parseFloat(i[2]),h=parseFloat(i[3]),m=i[4]!=null?parseFloat(i[4]):1,g=u.endsWith("%")?Math.max(0,Math.min(1,parseFloat(u)/100)):Math.max(0,Math.min(1,parseFloat(u))),[f,I,V]=nt(g,p,h);return[f,I,V,m]}const c=E(e);return c?[c.r,c.g,c.b,1]:[0,0,0,1]}function Z(e,n,s,a){return`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(s)}, ${Math.max(0,Math.min(1,Math.round(a*100)/100))})`}function J(e){let n=e+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function j(e,n,s){e=(e%360+360)%360;const a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(e/60%2-1)),r=s-a/2;let l,i,c;return 0<=e&&e<60?[l,i,c]=[a,o,0]:60<=e&&e<120?[l,i,c]=[o,a,0]:120<=e&&e<180?[l,i,c]=[0,a,o]:180<=e&&e<240?[l,i,c]=[0,o,a]:240<=e&&e<300?[l,i,c]=[o,0,a]:[l,i,c]=[a,0,o],[Math.round((l+r)*255),Math.round((i+r)*255),Math.round((c+r)*255)]}function tt(e,n,s){e=(e%360+360)%360;const a=n+s;a>1&&(n/=a,s/=a);const[o,r,l]=j(e,1,.5).map(h=>h/255),i=1-n-s,c=o*i+n,u=r*i+n,p=l*i+n;return[Math.round(c*255),Math.round(u*255),Math.round(p*255)]}function H(e,n,s){e/=255,n/=255,s/=255;const a=Math.max(e,n,s),o=Math.min(e,n,s);let r=0,l=0;const i=(a+o)/2,c=a-o;if(c!==0){switch(l=i>.5?c/(2-a-o):c/(a+o),a){case e:r=(n-s)/c+(n<s?6:0);break;case n:r=(s-e)/c+2;break;default:r=(e-n)/c+4}r*=60}return[Math.round(r),Math.round(l*100),Math.round(i*100)]}function et(e,n,s){const[a]=H(e,n,s),o=e/255,r=n/255,l=s/255,i=Math.min(o,r,l),c=1-Math.max(o,r,l);return[a,Math.round(i*100),Math.round(c*100)]}function O(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function U(e){const n=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function nt(e,n,s){const a=s*Math.PI/180,o=Math.cos(a)*n,r=Math.sin(a)*n,l=e+.3963377774*o+.2158037573*r,i=e-.1055613458*o-.0638541728*r,c=e-.0894841775*o-1.291485548*r,u=l*l*l,p=i*i*i,h=c*c*c,m=4.0767416621*u-3.3077115913*p+.2309699292*h,g=-1.2684380046*u+2.6097574011*p-.3413193965*h,f=-.0041960863*u-.7034186147*p+1.707614701*h;return[U(m),U(g),U(f)]}function at(e,n,s){const a=O(e),o=O(n),r=O(s),l=.4122214708*a+.5363325363*o+.0514459929*r,i=.2119034982*a+.6806995451*o+.1073969566*r,c=.0883024619*a+.2817188376*o+.6299787005*r,u=Math.cbrt(l),p=Math.cbrt(i),h=Math.cbrt(c),m=.2104542553*u+.793617785*p-.0040720468*h,g=1.9779984951*u-2.428592205*p+.4505937099*h,f=.0259040371*u+.7827717662*p-.808675766*h,I=Math.sqrt(g*g+f*f);let V=Math.atan2(f,g)*180/Math.PI;return V<0&&(V+=360),[m,I,V]}function R(e,n,s,a,o,r){switch(o){case"hex":if(r){const l=c=>c.toString(16).padStart(2,"0"),i=Math.max(0,Math.min(255,Math.round(a*255)));return`#${l(e)}${l(n)}${l(s)}${l(i)}`}return W(e,n,s);case"rgb":return`rgb(${e}, ${n}, ${s})`;case"rgba":return`rgba(${e}, ${n}, ${s}, ${Math.round(a*100)/100})`;case"hsl":{const[l,i,c]=H(e,n,s);return`hsl(${l}, ${i}%, ${c}%)`}case"hsla":{const[l,i,c]=H(e,n,s);return`hsla(${l}, ${i}%, ${c}%, ${Math.round(a*100)/100})`}case"hwb":{const[l,i,c]=et(e,n,s);return a<1?`hwb(${l} ${i}% ${c}% / ${Math.round(a*100)/100})`:`hwb(${l} ${i}% ${c}%)`}case"oklch":{const[l,i,c]=at(e,n,s),u=(Math.round(l*1e3)/1e3).toFixed(3),p=(Math.round(i*1e3)/1e3).toFixed(3),h=(Math.round(c*10)/10).toFixed(1),m=Math.round(a*100)/100;return r||a<1?`oklch(${u} ${p} ${h} / ${m})`:`oklch(${u} ${p} ${h})`}}}function v(e,n){return n?e==="rgb"?"rgba":e==="hsl"?"hsla":e:e==="rgba"?"rgb":e==="hsla"?"hsl":e}async function rt(e){return new Promise((n,s)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const o=a.result;n(o.split(",")[1])},a.onerror=o=>s(o)})}function mt(e){return Promise.all(e.map(rt))}function ft(e){if(e.length>=4){if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71)return"image/png";if(e[0]===255&&e[1]===216)return"image/jpeg";if(e[0]===71&&e[1]===73&&e[2]===70)return"image/gif";if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e.length>=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(e.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function bt(e){const n=ct.$t(e??""),s=n.length,a=new Uint8Array(s);for(let o=0;o<s;o++)a[o]=n.charCodeAt(o);return a}function st(e){const{value:n,onChange:s,onInput:a,...o}=e,r=new Map,l=t.Value.toSignal(n).map(p=>p.map((h,m)=>{const g=r.get(h),f=bt(h??""),I=g?.type||ft(f),V=g?.name??`file-${m}`,y=f.buffer.slice(f.byteOffset,f.byteOffset+f.byteLength),$=new Blob([y],{type:I});return new File([$],V,{type:I})})),i=p=>h=>{p&&mt(h).then(m=>{for(const[g,f]of m.entries())r.set(f,{name:h[g].name,type:h[g].type});p(m)})},c=i(s),u=i(a);return k.FilesInput({...o,value:l,onChange:c,onInput:u})}function yt(e){const{value:n,onInput:s,onChange:a,...o}=e;return st({...o,maxFiles:1,value:t.Value.map(n,r=>r==null?[]:[r]),onChange:r=>{a?.(r[0])},onInput:r=>{s?.(r[0])}})}function It(e,n){const[s,a,o]=e,r=s<<16^a<<8^o,l=J(r),i=6+Math.floor(l()*5),c=.18+l()*.06,u=[];for(let g=0;g<i;g++){const f=g/i*Math.PI*2,I=n*(1+(l()*2-1)*c),V=Math.cos(f)*I,y=Math.sin(f)*I;u.push({x:V,y})}const p=(u[0].x+u[i-1].x)/2,h=(u[0].y+u[i-1].y)/2;let m=`M ${p.toFixed(3)} ${h.toFixed(3)}`;for(let g=0;g<i;g++){const f=u[g],I=u[(g+1)%i],V=(f.x+I.x)/2,y=(f.y+I.y)/2;m+=` Q ${f.x.toFixed(3)} ${f.y.toFixed(3)} ${V.toFixed(3)} ${y.toFixed(3)}`}return m+=" Z",m}const wt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,displayValue:r,size:l,withAlpha:i}=e,c=t.Value.map(l??32,d=>d),u=t.Value.map(n,d=>Q(d??"#000000")),p=t.Value.map(u,([d,w,M])=>[d,w,M]),h=t.Value.map(u,([,,,d])=>d),m=t.prop(t.Value.get(h)??1),g=t.Value.map(i??!1,d=>d),f=t.Value.map(e.colorTextFormat??"rgb",d=>d),I=t.computedOf(p,m,f,g)(([d,w,M],_,A,T)=>R(d,w,M,_??1,v(A,T),T)),V=t.Value.map(e.colorTextFormat??"hex",d=>d),y=t.Value.map(c,d=>`${-d/2} ${-d/2} ${d} ${d}`),$=t.computedOf(p,c)((d,w)=>It(d,w/2)),b=t.computedOf(p,m,g)(([d,w,M],_,A)=>A||_<1?Z(d,w,M,_):W(d,w,M)),C=t.html.div(t.attr.class("bc-color-swatch-input__control"),t.attr.class(t.Value.map(g,d=>d?"bc-color-swatch-input__control--alpha":"")),t.attr.style(t.computedOf(c)(d=>`min-width:${d+2}px;height:${d+2}px`)),t.svg.svg(t.attr.class("bc-color-swatch-input__svg"),t.svgAttr.viewBox(y),t.svg.path(t.svgAttr.d($),t.svgAttr.fill(b))),t.html.input(t.attr.type("color"),S.CommonInputAttributes(e),t.attr.value(t.Value.map(p,([d,w,M])=>W(d,w,M))),t.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),s!=null?t.on.blur(s):t.Empty,a!=null?t.on.change(d=>{const w=d.target.value;if(!a)return;const{r:M,g:_,b:A}=E(w)??{r:0,g:0,b:0},T=t.Value.get(m)??1,F=v(t.Value.get(V),t.Value.get(g)),L=R(M,_,A,T,F,t.Value.get(g));a(L)}):t.Empty,o!=null?t.on.input(d=>{const w=d.target.value;if(!o)return;const{r:M,g:_,b:A}=E(w)??{r:0,g:0,b:0},T=t.Value.get(m)??1,F=v(t.Value.get(V),t.Value.get(g)),L=R(M,_,A,T,F,t.Value.get(g));o(L)}):t.Empty)),x=t.When(g,()=>t.html.input(t.attr.type("range"),t.attr.class("bc-color-swatch-input__alpha"),t.attr.min(0),t.attr.max(1),t.attr.step(.01),t.attr.value(t.Value.map(m,d=>String(d??1))),t.attr.disabled(e.disabled),t.on.input(d=>{const w=parseFloat(d.target.value);m.set(w);const[M,_,A]=t.Value.get(p),T=v(t.Value.get(V),t.Value.get(g)),F=R(M,_,A,w,T,t.Value.get(g));o?.(F)}),t.on.change(d=>{const w=parseFloat(d.target.value);m.set(w);const[M,_,A]=t.Value.get(p),T=v(t.Value.get(V),t.Value.get(g)),F=R(M,_,A,w,T,t.Value.get(g));a?.(F)})));return D.InputContainer({baseContainer:!0,...e,growInput:!1,input:C,after:t.Fragment(t.When(r??!1,()=>t.html.span(t.attr.class("bc-color-swatch-input__rgb"),I)),x,e.after)})},P=e=>typeof e=="string"&&e.trim()===""?null:e,ot=e=>e??"";function B(e){return n=>{const{value:s,onBlur:a,onChange:o,onInput:r,after:l,disabled:i,...c}=n,u=k.NullableResetAfter(s,i,o??r);return e({...c,disabled:i,value:t.Value.map(s,ot),onChange:o!=null?p=>o(P(p)):void 0,onInput:r!=null?p=>r(P(p)):void 0,onBlur:a,after:l!=null?t.Fragment(u,l):u})}}const Vt=({startEditing:e,value:n,onChange:s,placeholder:a,disabled:o})=>{const r=t.Value.deriveProp(e??!1),l=t.prop(!1),i=t.Value.map(o??!1,c=>c);return t.html.div(t.attr.class("bc-editable-text"),t.attr.class(t.Value.map(i,c=>c?"bc-editable-text--disabled":"")),t.aria.disabled(i),t.When(r,()=>t.html.input(t.attr.placeholder(a),t.attr.value(n),t.attr.class("bc-editable-text__input"),ut.AutoSelect(),t.on.keydown(c=>{c.key==="Enter"?r.set(!1):c.key==="Escape"&&(l.set(!0),r.set(!1))}),t.on.blur(t.emitValue(c=>{if(r.set(!1),l.value){l.set(!1);return}s(c)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(i)||r.set(!0)}),t.attr.class("bc-editable-text__display"),t.When(t.Value.map(n,c=>c!=null&&c.trim()!==""),()=>t.html.span(t.attr.class("bc-editable-text__text"),n),()=>t.html.span(t.attr.class("bc-editable-text__placeholder"),a)),t.When(t.Value.map(i,c=>!c),()=>t.html.button(t.attr.type("button"),t.attr.class("bc-editable-text__edit-button"),t.Use(N.BeatUII18n,c=>t.aria.label(c.$.editLabel)),t.on.click(()=>r.set(!0)),N.Icon({icon:"line-md/pencil",color:"neutral"}))))))},Mt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=k.NullableResetAfter(n,l,a??o);return D.InputContainer({...e,input:t.input.date(S.CommonInputAttributes(e),t.attr.valueAsDate(n),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDate(o)):t.Empty),after:r!=null?t.Fragment(i,r):i})},$t=e=>{const n=e.getFullYear(),s=e.getMonth()+1,a=e.getDate(),o=e.getHours(),r=e.getMinutes(),l=e.getSeconds();return`${n}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},xt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=t.Value.map(n,u=>u!=null?$t(u):null),c=k.NullableResetAfter(n,l,a??o);return D.InputContainer({...e,input:t.input["datetime-local"](S.CommonInputAttributes(e),t.attr.value(t.Value.map(i,u=>u??null)),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDateTime(o)):t.Empty),after:r!=null?t.Fragment(c,r):c})},_t=B(z.EmailInput),Ct=B(S.TextInput),At=B(z.PasswordInput),Tt=B(k.TextArea),kt=({value:e,onChange:n,onInput:s,onBlur:a,offLabel:o,onLabel:r,disabled:l=!1,size:i="md",id:c,color:u="primary",tabIndex:p=0,matchInputHeight:h=!0})=>{const m=c??pt.sessionId("switch");function g(y,$){const b=["bc-switch",`bc-switch--size-${$}`,`bc-switch--${$}`];return h&&b.push("bc-switch--match-input"),y&&b.push("bc-switch--disabled"),b.join(" ")}function f(y){const $=y??"primary",b=new Map,C=N.backgroundValue($,"solid","light"),x=N.backgroundValue($,"solid","dark");return b.set("--switch-track-on-bg",C.backgroundColor),b.set("--switch-track-on-label",C.textColor),b.set("--switch-track-on-bg-dark",x.backgroundColor),b.set("--switch-track-on-label-dark",x.textColor),b.set("--switch-track-on-border-dark",N.borderColorValue($,"dark")),Array.from(b.entries()).map(([d,w])=>`${d}: ${w}`).join("; ")}const I=()=>{t.Value.get(l)||(n?.(!t.Value.get(e)),s?.(!t.Value.get(e)))},V=y=>{t.Value.get(l)||(y.key===" "||y.key==="Enter")&&(y.preventDefault(),I())};return t.html.div(t.attr.class(t.computedOf(l??!1,i)((y,$)=>g(y??!1,$??"md"))),t.attr.style(t.computedOf(u)(y=>f(y))),t.attr.id(m),t.attr.role("switch"),t.attr.tabindex(t.computedOf(l??!1,p)((y,$)=>y?-1:$??0)),t.aria.checked(e),t.aria.disabled(l),t.on.click(I),t.on.keydown(V),a!=null?t.on.blur(a):null,t.html.div(t.attr.class("bc-switch__track"),t.attr.class(t.Value.map(e,y=>y?"bc-switch__track--on":"bc-switch__track--off")),o!=null?t.html.div(t.aria.hidden(!0),t.attr.class("bc-switch__track-label bc-switch__track-label--off"),t.attr.class(t.Value.map(e,y=>y?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),o):null,r!=null?t.html.div(t.attr.class("bc-switch__track-label bc-switch__track-label--on"),t.attr.class(t.Value.map(e,y=>y?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),r):null,t.html.div(t.attr.class("bc-switch__thumb"),t.attr.class(t.Value.map(e,y=>y?"bc-switch__thumb--on":"bc-switch__thumb--off")))))},Ft=B(k.UUIDInput),Nt="line-md:star-alt-filled",St="line-md:star-alt",lt=e=>{const{value:n,onChange:s,onInput:a,disabled:o,max:r=5,fullColor:l="yellow",emptyColor:i="neutral",fullIcon:c=Nt,emptyIcon:u=St,size:p="md",onBlur:h,rounding:m=1}=e,g=()=>{const b=t.Value.get(m);return b>0?b:1},f=b=>Math.min(Math.max(b,0),t.Value.get(r)),I=(b,C)=>{if(t.Value.get(o??!1))return;const d=b.currentTarget.getBoundingClientRect(),w=(b.clientX-d.left)/d.width,M=C-1+w,_=g(),A=Math.ceil(M/_)*_,T=f(A);s?.(T),a?.(T)},V=b=>{if(t.Value.get(o??!1))return;const C=g(),x=t.Value.get(n)??0;let d;switch(b.key){case"ArrowRight":case"ArrowUp":d=f(x+C);break;case"ArrowLeft":case"ArrowDown":d=f(x-C);break;case"Home":d=0;break;case"End":d=t.Value.get(r);break;default:return}b.preventDefault(),s?.(d),a?.(d)},y=t.Value.map(p,b=>`bc-icon--${b}`),$=({index:b,counter:C})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(y),N.Icon({icon:u,size:p,color:i,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(y),t.style.width(t.Value.map(n,x=>{const d=Math.floor(x);return d>b?"100%":d<b?"0%":`${(x-b)*100}%`})),N.Icon({icon:c,size:p,color:l,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))),t.on.click(t.emit(x=>I(x,C),{preventDefault:!0,stopPropagation:!0})));return D.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...e,input:t.html.div(S.CommonInputAttributes(e),t.attr.class("bc-rating-input"),t.attr.role("slider"),t.attr.tabindex(t.Value.map(o??!1,b=>b?-1:0)),t.aria.disabled(o??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(r,b=>b??0)),t.aria.valuenow(t.Value.map(n,b=>b??0)),t.aria.valuetext(t.computedOf(n,r)((b,C)=>{const x=b??0,d=C??0;return`${String(x)} / ${String(d)}`})),t.on.keydown(V),h!=null?t.on.blur(h):null,t.Repeat(r,$))})},Rt=e=>{const{value:n,onChange:s,onInput:a,onBlur:o,after:r,disabled:l,...i}=e,c=k.NullableResetAfter(n,l,s??a);return lt({...i,value:t.Value.map(n,u=>u??0),onChange:s,onInput:a,onBlur:o,after:r!=null?t.Fragment(c,r):c})},vt=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e;return D.InputContainer({...e,focusableSelector:'input[type="range"]',input:t.html.input(t.attr.type("range"),S.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(l)):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(i)):t.Empty)})},Et=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e,c=t.Value.map(n,p=>{if(p!=null)return p;const h=a!=null?t.Value.get(a):void 0;return typeof h=="number"?h:0}),u=k.NullableResetAfter(n,e.disabled,l??i);return D.InputContainer({...e,focusableSelector:'input[type="range"]',after:u,input:t.html.input(t.attr.type("range"),S.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(c),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(p=>{l(p)})):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(p=>{i(p)})):t.Empty)})},Dt=B(k.UrlInput);class it{widgets=new Map;typeMapping=new Map;register(n,s){if(this.widgets.set(n,s),s.supportedTypes)for(const a of s.supportedTypes)this.typeMapping.has(a)||this.typeMapping.set(a,[]),this.typeMapping.get(a).push(n),this.typeMapping.get(a).sort((o,r)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(r)?.priority||0)-l})}unregister(n){const s=this.widgets.get(n);if(s&&(this.widgets.delete(n),s.supportedTypes))for(const a of s.supportedTypes){const o=this.typeMapping.get(a);if(o){const r=o.indexOf(n);r>=0&&o.splice(r,1),o.length===0&&this.typeMapping.delete(a)}}}get(n){return this.widgets.get(n)}getAll(){return new Map(this.widgets)}getForType(n){return(this.typeMapping.get(n)||[]).map(a=>this.widgets.get(a)).filter(Boolean)}findBestWidget(n){const s=dt.resolveWidget(n.definition,n.name);if(s?.widget){const o=this.widgets.get(s.widget);if(o)return{name:s.widget,registration:o,resolved:s}}const a=[];for(const[o,r]of this.widgets.entries())if(r.matcher)try{r.matcher(n)&&a.push({name:o,registration:r,priority:r.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(a.length>0){a.sort((r,l)=>l.priority-r.priority);const o=a[0];return{name:o.name,registration:o.registration,resolved:{widget:o.name,source:"heuristics"}}}if(typeof n.definition=="object"&&n.definition.type){const o=Array.isArray(n.definition.type)?n.definition.type[0]:n.definition.type,r=this.getForType(o);if(r.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:r[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Bt=new it;function Ot(e,n,s){return{factory:n,matcher:a=>{const r=a.definition["x:ui"];return r===e||typeof r=="object"&&r!==null&&r.widget===e},displayName:s?.displayName??e,priority:s?.priority??100,...s}}function Ut(e,n,s){return{factory:n,matcher:a=>a.definition.format===e,displayName:s?.displayName??`${e} widget`,priority:s?.priority??75,...s}}function Wt(e,n,s,a){return{factory:s,matcher:o=>{const r=o.definition;return r.type===e&&r.format===n},displayName:a?.displayName??`${e}:${n} widget`,priority:a?.priority??80,...a}}function Ht(e){const n=e?.logPrefix??"WIDGET_DIAG",s=e?.filterFn??(()=>!0);return{factory:()=>null,displayName:"Diagnostic Widget (never matches)",priority:-1e3,matcher:a=>{if(!s(a))return!1;const o=a.definition,r={name:a.name,path:a.path.map(String),type:o?.type,hasRegistry:a.widgetRegistry!==void 0,definition:o};return console.log(`[${n}] name="${r.name??"ROOT"}" path=[${r.path.join(", ")}] type="${r.type??"unknown"}" hasRegistry=${r.hasRegistry}`),e?.onProcess?.(r),!1}}}exports.Base64Input=yt;exports.Base64sInput=st;exports.ColorSwatchInput=wt;exports.EditableText=Vt;exports.NullableDateInput=Mt;exports.NullableDateTimeInput=xt;exports.NullableEmailInput=_t;exports.NullablePasswordInput=At;exports.NullableRatingInput=Rt;exports.NullableSliderInput=Et;exports.NullableTextArea=Tt;exports.NullableTextInput=Ct;exports.NullableUUIDInput=Ft;exports.NullableUrlInput=Dt;exports.RatingInput=lt;exports.SliderInput=vt;exports.Switch=kt;exports.WidgetRegistry=it;exports.createDiagnosticWidget=Ht;exports.emptyToNull=P;exports.fileToBase64=rt;exports.forFormat=Ut;exports.forTypeAndFormat=Wt;exports.forXUI=Ot;exports.formatColor=R;exports.getContrastRatio=ht;exports.globalWidgetRegistry=Bt;exports.hexToRgb=E;exports.hslToRgb=j;exports.hwbToRgb=tt;exports.isValidColor=gt;exports.isValidHexColor=q;exports.isValidHslColor=G;exports.isValidRgbColor=X;exports.isValidRgbaColor=Y;exports.linearToSrgb=U;exports.mulberry32=J;exports.normalizeHexColor=K;exports.nullToEmpty=ot;exports.oklchToRgb=nt;exports.parseAnyColor=Q;exports.resolveEffectiveFormat=v;exports.rgbToHex=W;exports.rgbToHsl=H;exports.rgbToHwb=et;exports.rgbToOklch=at;exports.srgbToLinear=O;exports.toRgbaString=Z;
|
|
1
|
+
"use strict";const t=require("@tempots/dom"),k=require("./deep-merge-ChJQbUKq.cjs"),ct=require("./string-B9vVyfq3.cjs"),D=require("./input-container-BWYHj0Iq.cjs"),S=require("./text-input-M6WBhhVj.cjs"),N=require("./translations-OOsMRpX9.cjs"),ut=require("@tempots/ui"),z=require("./notice-CPZQuxcA.cjs"),pt=require("./session-id-B5lJMzbB.cjs"),dt=require("./utils-DIUEhA-Z.cjs");function q(e){if(typeof e!="string")return!1;const n=e.startsWith("#")?e.slice(1):e;return/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(n)}function X(e){if(typeof e!="string")return!1;const n=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=255&&i>=0&&i<=255&&c>=0&&c<=255}function Y(e){if(typeof e!="string")return!1;const n=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r,l]=s,i=parseInt(a,10),c=parseInt(o,10),u=parseInt(r,10),p=parseFloat(l);return i>=0&&i<=255&&c>=0&&c<=255&&u>=0&&u<=255&&p>=0&&p<=1}function G(e){if(typeof e!="string")return!1;const n=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i,s=e.match(n);if(!s)return!1;const[,a,o,r]=s,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(r,10);return l>=0&&l<=360&&i>=0&&i<=100&&c>=0&&c<=100}function gt(e){return q(e)||X(e)||Y(e)||G(e)}function K(e){if(!q(e))return null;let n=e.startsWith("#")?e.slice(1):e;return n.length===3&&(n=n.split("").map(s=>s+s).join("")),`#${n.toLowerCase()}`}function W(e,n,s){const a=o=>{const r=Math.round(Math.max(0,Math.min(255,o))).toString(16);return r.length===1?"0"+r:r};return`#${a(e)}${a(n)}${a(s)}`}function E(e){const n=K(e);if(!n)return null;const s=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return s?{r:parseInt(s[1],16),g:parseInt(s[2],16),b:parseInt(s[3],16)}:null}function ht(e,n){const s=E(e),a=E(n);if(!s||!a)return null;const o=(u,p,h)=>{const[m,g,f]=[u,p,h].map(I=>(I=I/255,I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4)));return .2126*m+.7152*g+.0722*f},r=o(s.r,s.g,s.b),l=o(a.r,a.g,a.b),i=Math.max(r,l),c=Math.min(r,l);return(i+.05)/(c+.05)}function Q(e){if(!e)return[0,0,0,1];const s=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(s){const u=s[1];if(u.length===8){const p=parseInt(u.slice(0,2),16),h=parseInt(u.slice(2,4),16),m=parseInt(u.slice(4,6),16),g=parseInt(u.slice(6,8),16)/255;return[p,h,m,g]}if(u.length===6)return[parseInt(u.slice(0,2),16),parseInt(u.slice(2,4),16),parseInt(u.slice(4,6),16),1];if(u.length===4){const p=parseInt(u[0]+u[0],16),h=parseInt(u[1]+u[1],16),m=parseInt(u[2]+u[2],16),g=parseInt(u[3]+u[3],16)/255;return[p,h,m,g]}if(u.length===3){const p=parseInt(u[0]+u[0],16),h=parseInt(u[1]+u[1],16),m=parseInt(u[2]+u[2],16);return[p,h,m,1]}}const a=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i);if(a)return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];const o=e.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(o)return[parseInt(o[1],10),parseInt(o[2],10),parseInt(o[3],10),1];const r=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(r){const u=parseFloat(r[1]),p=parseFloat(r[2]),h=parseFloat(r[3]),m=r[4]!=null?parseFloat(r[4]):1,[g,f,I]=j(u,p/100,h/100);return[g,f,I,m]}const l=e.match(/^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(l){const u=parseFloat(l[1]),p=parseFloat(l[2])/100,h=parseFloat(l[3])/100,m=l[4]!=null?parseFloat(l[4]):1,[g,f,I]=tt(u,p,h);return[g,f,I,m]}const i=e.match(/^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(i){const u=i[1],p=parseFloat(i[2]),h=parseFloat(i[3]),m=i[4]!=null?parseFloat(i[4]):1,g=u.endsWith("%")?Math.max(0,Math.min(1,parseFloat(u)/100)):Math.max(0,Math.min(1,parseFloat(u))),[f,I,V]=nt(g,p,h);return[f,I,V,m]}const c=E(e);return c?[c.r,c.g,c.b,1]:[0,0,0,1]}function Z(e,n,s,a){return`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(s)}, ${Math.max(0,Math.min(1,Math.round(a*100)/100))})`}function J(e){let n=e+1831565813;return function(){return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function j(e,n,s){e=(e%360+360)%360;const a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(e/60%2-1)),r=s-a/2;let l,i,c;return 0<=e&&e<60?[l,i,c]=[a,o,0]:60<=e&&e<120?[l,i,c]=[o,a,0]:120<=e&&e<180?[l,i,c]=[0,a,o]:180<=e&&e<240?[l,i,c]=[0,o,a]:240<=e&&e<300?[l,i,c]=[o,0,a]:[l,i,c]=[a,0,o],[Math.round((l+r)*255),Math.round((i+r)*255),Math.round((c+r)*255)]}function tt(e,n,s){e=(e%360+360)%360;const a=n+s;a>1&&(n/=a,s/=a);const[o,r,l]=j(e,1,.5).map(h=>h/255),i=1-n-s,c=o*i+n,u=r*i+n,p=l*i+n;return[Math.round(c*255),Math.round(u*255),Math.round(p*255)]}function H(e,n,s){e/=255,n/=255,s/=255;const a=Math.max(e,n,s),o=Math.min(e,n,s);let r=0,l=0;const i=(a+o)/2,c=a-o;if(c!==0){switch(l=i>.5?c/(2-a-o):c/(a+o),a){case e:r=(n-s)/c+(n<s?6:0);break;case n:r=(s-e)/c+2;break;default:r=(e-n)/c+4}r*=60}return[Math.round(r),Math.round(l*100),Math.round(i*100)]}function et(e,n,s){const[a]=H(e,n,s),o=e/255,r=n/255,l=s/255,i=Math.min(o,r,l),c=1-Math.max(o,r,l);return[a,Math.round(i*100),Math.round(c*100)]}function O(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function U(e){const n=e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055;return Math.round(Math.max(0,Math.min(1,n))*255)}function nt(e,n,s){const a=s*Math.PI/180,o=Math.cos(a)*n,r=Math.sin(a)*n,l=e+.3963377774*o+.2158037573*r,i=e-.1055613458*o-.0638541728*r,c=e-.0894841775*o-1.291485548*r,u=l*l*l,p=i*i*i,h=c*c*c,m=4.0767416621*u-3.3077115913*p+.2309699292*h,g=-1.2684380046*u+2.6097574011*p-.3413193965*h,f=-.0041960863*u-.7034186147*p+1.707614701*h;return[U(m),U(g),U(f)]}function at(e,n,s){const a=O(e),o=O(n),r=O(s),l=.4122214708*a+.5363325363*o+.0514459929*r,i=.2119034982*a+.6806995451*o+.1073969566*r,c=.0883024619*a+.2817188376*o+.6299787005*r,u=Math.cbrt(l),p=Math.cbrt(i),h=Math.cbrt(c),m=.2104542553*u+.793617785*p-.0040720468*h,g=1.9779984951*u-2.428592205*p+.4505937099*h,f=.0259040371*u+.7827717662*p-.808675766*h,I=Math.sqrt(g*g+f*f);let V=Math.atan2(f,g)*180/Math.PI;return V<0&&(V+=360),[m,I,V]}function R(e,n,s,a,o,r){switch(o){case"hex":if(r){const l=c=>c.toString(16).padStart(2,"0"),i=Math.max(0,Math.min(255,Math.round(a*255)));return`#${l(e)}${l(n)}${l(s)}${l(i)}`}return W(e,n,s);case"rgb":return`rgb(${e}, ${n}, ${s})`;case"rgba":return`rgba(${e}, ${n}, ${s}, ${Math.round(a*100)/100})`;case"hsl":{const[l,i,c]=H(e,n,s);return`hsl(${l}, ${i}%, ${c}%)`}case"hsla":{const[l,i,c]=H(e,n,s);return`hsla(${l}, ${i}%, ${c}%, ${Math.round(a*100)/100})`}case"hwb":{const[l,i,c]=et(e,n,s);return a<1?`hwb(${l} ${i}% ${c}% / ${Math.round(a*100)/100})`:`hwb(${l} ${i}% ${c}%)`}case"oklch":{const[l,i,c]=at(e,n,s),u=(Math.round(l*1e3)/1e3).toFixed(3),p=(Math.round(i*1e3)/1e3).toFixed(3),h=(Math.round(c*10)/10).toFixed(1),m=Math.round(a*100)/100;return r||a<1?`oklch(${u} ${p} ${h} / ${m})`:`oklch(${u} ${p} ${h})`}}}function v(e,n){return n?e==="rgb"?"rgba":e==="hsl"?"hsla":e:e==="rgba"?"rgb":e==="hsla"?"hsl":e}async function rt(e){return new Promise((n,s)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const o=a.result;n(o.split(",")[1])},a.onerror=o=>s(o)})}function mt(e){return Promise.all(e.map(rt))}function ft(e){if(e.length>=4){if(e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71)return"image/png";if(e[0]===255&&e[1]===216)return"image/jpeg";if(e[0]===71&&e[1]===73&&e[2]===70)return"image/gif";if(e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e.length>=12&&e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80)return"image/webp"}try{if(new TextDecoder("utf-8").decode(e.slice(0,256)).includes("<svg"))return"image/svg+xml"}catch{}return"application/octet-stream"}function bt(e){const n=ct.$t(e??""),s=n.length,a=new Uint8Array(s);for(let o=0;o<s;o++)a[o]=n.charCodeAt(o);return a}function st(e){const{value:n,onChange:s,onInput:a,...o}=e,r=new Map,l=t.Value.toSignal(n).map(p=>p.map((h,m)=>{const g=r.get(h),f=bt(h??""),I=g?.type||ft(f),V=g?.name??`file-${m}`,y=f.buffer.slice(f.byteOffset,f.byteOffset+f.byteLength),$=new Blob([y],{type:I});return new File([$],V,{type:I})})),i=p=>h=>{p&&mt(h).then(m=>{for(const[g,f]of m.entries())r.set(f,{name:h[g].name,type:h[g].type});p(m)})},c=i(s),u=i(a);return k.FilesInput({...o,value:l,onChange:c,onInput:u})}function yt(e){const{value:n,onInput:s,onChange:a,...o}=e;return st({...o,maxFiles:1,value:t.Value.map(n,r=>r==null?[]:[r]),onChange:r=>{a?.(r[0])},onInput:r=>{s?.(r[0])}})}function It(e,n){const[s,a,o]=e,r=s<<16^a<<8^o,l=J(r),i=6+Math.floor(l()*5),c=.18+l()*.06,u=[];for(let g=0;g<i;g++){const f=g/i*Math.PI*2,I=n*(1+(l()*2-1)*c),V=Math.cos(f)*I,y=Math.sin(f)*I;u.push({x:V,y})}const p=(u[0].x+u[i-1].x)/2,h=(u[0].y+u[i-1].y)/2;let m=`M ${p.toFixed(3)} ${h.toFixed(3)}`;for(let g=0;g<i;g++){const f=u[g],I=u[(g+1)%i],V=(f.x+I.x)/2,y=(f.y+I.y)/2;m+=` Q ${f.x.toFixed(3)} ${f.y.toFixed(3)} ${V.toFixed(3)} ${y.toFixed(3)}`}return m+=" Z",m}const wt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,displayValue:r,size:l,withAlpha:i}=e,c=t.Value.map(l??32,d=>d),u=t.Value.map(n,d=>Q(d??"#000000")),p=t.Value.map(u,([d,w,M])=>[d,w,M]),h=t.Value.map(u,([,,,d])=>d),m=t.prop(t.Value.get(h)??1),g=t.Value.map(i??!1,d=>d),f=t.Value.map(e.colorTextFormat??"rgb",d=>d),I=t.computedOf(p,m,f,g)(([d,w,M],_,A,T)=>R(d,w,M,_??1,v(A,T),T)),V=t.Value.map(e.colorTextFormat??"hex",d=>d),y=t.Value.map(c,d=>`${-d/2} ${-d/2} ${d} ${d}`),$=t.computedOf(p,c)((d,w)=>It(d,w/2)),b=t.computedOf(p,m,g)(([d,w,M],_,A)=>A||_<1?Z(d,w,M,_):W(d,w,M)),C=t.html.div(t.attr.class("bc-color-swatch-input__control"),t.attr.class(t.Value.map(g,d=>d?"bc-color-swatch-input__control--alpha":"")),t.attr.style(t.computedOf(c)(d=>`min-width:${d+2}px;height:${d+2}px`)),t.svg.svg(t.attr.class("bc-color-swatch-input__svg"),t.svgAttr.viewBox(y),t.svg.path(t.svgAttr.d($),t.svgAttr.fill(b))),t.html.input(t.attr.type("color"),S.CommonInputAttributes(e),t.attr.value(t.Value.map(p,([d,w,M])=>W(d,w,M))),t.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),s!=null?t.on.blur(s):t.Empty,a!=null?t.on.change(d=>{const w=d.target.value;if(!a)return;const{r:M,g:_,b:A}=E(w)??{r:0,g:0,b:0},T=t.Value.get(m)??1,F=v(t.Value.get(V),t.Value.get(g)),L=R(M,_,A,T,F,t.Value.get(g));a(L)}):t.Empty,o!=null?t.on.input(d=>{const w=d.target.value;if(!o)return;const{r:M,g:_,b:A}=E(w)??{r:0,g:0,b:0},T=t.Value.get(m)??1,F=v(t.Value.get(V),t.Value.get(g)),L=R(M,_,A,T,F,t.Value.get(g));o(L)}):t.Empty)),x=t.When(g,()=>t.html.input(t.attr.type("range"),t.attr.class("bc-color-swatch-input__alpha"),t.attr.min(0),t.attr.max(1),t.attr.step(.01),t.attr.value(t.Value.map(m,d=>String(d??1))),t.attr.disabled(e.disabled),t.on.input(d=>{const w=parseFloat(d.target.value);m.set(w);const[M,_,A]=t.Value.get(p),T=v(t.Value.get(V),t.Value.get(g)),F=R(M,_,A,w,T,t.Value.get(g));o?.(F)}),t.on.change(d=>{const w=parseFloat(d.target.value);m.set(w);const[M,_,A]=t.Value.get(p),T=v(t.Value.get(V),t.Value.get(g)),F=R(M,_,A,w,T,t.Value.get(g));a?.(F)})));return D.InputContainer({baseContainer:!0,...e,growInput:!1,input:C,after:t.Fragment(t.When(r??!1,()=>t.html.span(t.attr.class("bc-color-swatch-input__rgb"),I)),x,e.after)})},P=e=>typeof e=="string"&&e.trim()===""?null:e,ot=e=>e??"";function B(e){return n=>{const{value:s,onBlur:a,onChange:o,onInput:r,after:l,disabled:i,...c}=n,u=k.NullableResetAfter(s,i,o??r);return e({...c,disabled:i,value:t.Value.map(s,ot),onChange:o!=null?p=>o(P(p)):void 0,onInput:r!=null?p=>r(P(p)):void 0,onBlur:a,after:l!=null?t.Fragment(u,l):u})}}const Vt=({startEditing:e,value:n,onChange:s,placeholder:a,disabled:o})=>{const r=t.Value.deriveProp(e??!1),l=t.prop(!1),i=t.Value.map(o??!1,c=>c);return t.html.div(t.attr.class("bc-editable-text"),t.attr.class(t.Value.map(i,c=>c?"bc-editable-text--disabled":"")),t.aria.disabled(i),t.When(r,()=>t.html.input(t.attr.placeholder(a),t.attr.value(n),t.attr.class("bc-editable-text__input"),ut.AutoSelect(),t.on.keydown(c=>{c.key==="Enter"?r.set(!1):c.key==="Escape"&&(l.set(!0),r.set(!1))}),t.on.blur(t.emitValue(c=>{if(r.set(!1),l.value){l.set(!1);return}s(c)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(i)||r.set(!0)}),t.attr.class("bc-editable-text__display"),t.When(t.Value.map(n,c=>c!=null&&c.trim()!==""),()=>t.html.span(t.attr.class("bc-editable-text__text"),n),()=>t.html.span(t.attr.class("bc-editable-text__placeholder"),a)),t.When(t.Value.map(i,c=>!c),()=>t.html.button(t.attr.type("button"),t.attr.class("bc-editable-text__edit-button"),t.Use(N.BeatUII18n,c=>t.aria.label(c.$.editLabel)),t.on.click(()=>r.set(!0)),N.Icon({icon:"line-md/pencil",color:"neutral"}))))))},Mt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=k.NullableResetAfter(n,l,a??o);return D.InputContainer({...e,input:t.input.date(S.CommonInputAttributes(e),t.attr.valueAsDate(n),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDate(o)):t.Empty),after:r!=null?t.Fragment(i,r):i})},$t=e=>{const n=e.getFullYear(),s=e.getMonth()+1,a=e.getDate(),o=e.getHours(),r=e.getMinutes(),l=e.getSeconds();return`${n}-${s.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},xt=e=>{const{value:n,onBlur:s,onChange:a,onInput:o,after:r,disabled:l}=e,i=t.Value.map(n,u=>u!=null?$t(u):null),c=k.NullableResetAfter(n,l,a??o);return D.InputContainer({...e,input:t.input["datetime-local"](S.CommonInputAttributes(e),t.attr.value(t.Value.map(i,u=>u??null)),t.attr.class("bc-input"),s!=null?t.on.blur(t.emitValue(s)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDateTime(o)):t.Empty),after:r!=null?t.Fragment(c,r):c})},_t=B(z.EmailInput),Ct=B(S.TextInput),At=B(z.PasswordInput),Tt=B(k.TextArea),kt=({value:e,onChange:n,onInput:s,onBlur:a,offLabel:o,onLabel:r,disabled:l=!1,size:i="md",id:c,color:u="primary",tabIndex:p=0,matchInputHeight:h=!0})=>{const m=c??pt.sessionId("switch");function g(y,$){const b=["bc-switch",`bc-switch--size-${$}`,`bc-switch--${$}`];return h&&b.push("bc-switch--match-input"),y&&b.push("bc-switch--disabled"),b.join(" ")}function f(y){const $=y??"primary",b=new Map,C=N.backgroundValue($,"solid","light"),x=N.backgroundValue($,"solid","dark");return b.set("--switch-track-on-bg",C.backgroundColor),b.set("--switch-track-on-label",C.textColor),b.set("--switch-track-on-bg-dark",x.backgroundColor),b.set("--switch-track-on-label-dark",x.textColor),b.set("--switch-track-on-border-dark",N.borderColorValue($,"dark")),Array.from(b.entries()).map(([d,w])=>`${d}: ${w}`).join("; ")}const I=()=>{t.Value.get(l)||(n?.(!t.Value.get(e)),s?.(!t.Value.get(e)))},V=y=>{t.Value.get(l)||(y.key===" "||y.key==="Enter")&&(y.preventDefault(),I())};return t.html.div(t.attr.class(t.computedOf(l??!1,i)((y,$)=>g(y??!1,$??"md"))),t.attr.style(t.computedOf(u)(y=>f(y))),t.attr.id(m),t.attr.role("switch"),t.attr.tabindex(t.computedOf(l??!1,p)((y,$)=>y?-1:$??0)),t.aria.checked(e),t.aria.disabled(l),t.on.click(I),t.on.keydown(V),a!=null?t.on.blur(a):null,t.html.div(t.attr.class("bc-switch__track"),t.attr.class(t.Value.map(e,y=>y?"bc-switch__track--on":"bc-switch__track--off")),o!=null?t.html.div(t.aria.hidden(!0),t.attr.class("bc-switch__track-label bc-switch__track-label--off"),t.attr.class(t.Value.map(e,y=>y?"bc-switch__track-label--hidden":"bc-switch__track-label--visible")),o):null,r!=null?t.html.div(t.attr.class("bc-switch__track-label bc-switch__track-label--on"),t.attr.class(t.Value.map(e,y=>y?"bc-switch__track-label--visible":"bc-switch__track-label--hidden")),r):null,t.html.div(t.attr.class("bc-switch__thumb"),t.attr.class(t.Value.map(e,y=>y?"bc-switch__thumb--on":"bc-switch__thumb--off")))))},Ft=B(k.UUIDInput),Nt="line-md:star-alt-filled",St="line-md:star-alt",lt=e=>{const{value:n,onChange:s,onInput:a,disabled:o,max:r=5,fullColor:l="yellow",emptyColor:i="neutral",fullIcon:c=Nt,emptyIcon:u=St,size:p="md",onBlur:h,rounding:m=1}=e,g=()=>{const b=t.Value.get(m);return b>0?b:1},f=b=>Math.min(Math.max(b,0),t.Value.get(r)),I=(b,C)=>{if(t.Value.get(o??!1))return;const d=b.currentTarget.getBoundingClientRect(),w=(b.clientX-d.left)/d.width,M=C-1+w,_=g(),A=Math.ceil(M/_)*_,T=f(A);s?.(T),a?.(T)},V=b=>{if(t.Value.get(o??!1))return;const C=g(),x=t.Value.get(n)??0;let d;switch(b.key){case"ArrowRight":case"ArrowUp":d=f(x+C);break;case"ArrowLeft":case"ArrowDown":d=f(x-C);break;case"Home":d=0;break;case"End":d=t.Value.get(r);break;default:return}b.preventDefault(),s?.(d),a?.(d)},y=t.Value.map(p,b=>`bc-icon--${b}`),$=({index:b,counter:C})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(y),N.Icon({icon:u,size:p,color:i,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(y),t.style.width(t.Value.map(n,x=>{const d=Math.floor(x);return d>b?"100%":d<b?"0%":`${(x-b)*100}%`})),N.Icon({icon:c,size:p,color:l,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))),t.on.click(t.emit(x=>I(x,C),{preventDefault:!0,stopPropagation:!0})));return D.InputContainer({baseContainer:!0,growInput:!1,focusableSelector:'[role="slider"]',...e,input:t.html.div(S.CommonInputAttributes(e),t.attr.class("bc-rating-input"),t.attr.role("slider"),t.attr.tabindex(t.Value.map(o??!1,b=>b?-1:0)),t.aria.disabled(o??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(r,b=>b??0)),t.aria.valuenow(t.Value.map(n,b=>b??0)),t.aria.valuetext(t.computedOf(n,r)((b,C)=>{const x=b??0,d=C??0;return`${String(x)} / ${String(d)}`})),t.on.keydown(V),h!=null?t.on.blur(h):null,t.Repeat(r,$))})},Rt=e=>{const{value:n,onChange:s,onInput:a,onBlur:o,after:r,disabled:l,...i}=e,c=k.NullableResetAfter(n,l,s??a);return lt({...i,value:t.Value.map(n,u=>u??0),onChange:s,onInput:a,onBlur:o,after:r!=null?t.Fragment(c,r):c})},vt=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e;return D.InputContainer({...e,focusableSelector:'input[type="range"]',input:t.html.input(t.attr.type("range"),S.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(l)):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(i)):t.Empty)})},Et=e=>{const{value:n,step:s,min:a,max:o,onBlur:r,onChange:l,onInput:i}=e,c=t.Value.map(n,p=>{if(p!=null)return p;const h=a!=null?t.Value.get(a):void 0;return typeof h=="number"?h:0}),u=k.NullableResetAfter(n,e.disabled,l??i);return D.InputContainer({...e,focusableSelector:'input[type="range"]',after:u,input:t.html.input(t.attr.type("range"),S.CommonInputAttributes(e),t.attr.min(a),t.attr.max(o),t.attr.step(s),t.attr.valueAsNumber(c),t.attr.class("bc-input bc-slider-input"),r!=null?t.on.blur(t.emitValueAsNumber(r)):t.Empty,l!=null?t.on.change(t.emitValueAsNumber(p=>{l(p)})):t.Empty,i!=null?t.on.input(t.emitValueAsNumber(p=>{i(p)})):t.Empty)})},Dt=B(k.UrlInput);class it{widgets=new Map;typeMapping=new Map;register(n,s){if(this.widgets.set(n,s),s.supportedTypes)for(const a of s.supportedTypes)this.typeMapping.has(a)||this.typeMapping.set(a,[]),this.typeMapping.get(a).push(n),this.typeMapping.get(a).sort((o,r)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(r)?.priority||0)-l})}unregister(n){const s=this.widgets.get(n);if(s&&(this.widgets.delete(n),s.supportedTypes))for(const a of s.supportedTypes){const o=this.typeMapping.get(a);if(o){const r=o.indexOf(n);r>=0&&o.splice(r,1),o.length===0&&this.typeMapping.delete(a)}}}get(n){return this.widgets.get(n)}getAll(){return new Map(this.widgets)}getForType(n){return(this.typeMapping.get(n)||[]).map(a=>this.widgets.get(a)).filter(Boolean)}findBestWidget(n){const s=dt.resolveWidget(n.definition,n.name);if(s?.widget){const o=this.widgets.get(s.widget);if(o)return{name:s.widget,registration:o,resolved:s}}const a=[];for(const[o,r]of this.widgets.entries())if(r.matcher)try{r.matcher(n)&&a.push({name:o,registration:r,priority:r.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(a.length>0){a.sort((r,l)=>l.priority-r.priority);const o=a[0];return{name:o.name,registration:o.registration,resolved:{widget:o.name,source:"heuristics"}}}if(typeof n.definition=="object"&&n.definition.type){const o=Array.isArray(n.definition.type)?n.definition.type[0]:n.definition.type,r=this.getForType(o);if(r.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:r[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Bt=new it;function Ot(e,n,s){return{factory:n,matcher:a=>{const r=a.definition["x:ui"];return r===e||typeof r=="object"&&r!==null&&r.widget===e},displayName:s?.displayName??e,priority:s?.priority??100,...s}}function Ut(e,n,s){return{factory:n,matcher:a=>a.definition.format===e,displayName:s?.displayName??`${e} widget`,priority:s?.priority??75,...s}}function Wt(e,n,s,a){return{factory:s,matcher:o=>{const r=o.definition;return r.type===e&&r.format===n},displayName:a?.displayName??`${e}:${n} widget`,priority:a?.priority??80,...a}}function Ht(e){const n=e?.logPrefix??"WIDGET_DIAG",s=e?.filterFn??(()=>!0);return{factory:()=>null,displayName:"Diagnostic Widget (never matches)",priority:-1e3,matcher:a=>{if(!s(a))return!1;const o=a.definition,r={name:a.name,path:a.path.map(String),type:o?.type,hasRegistry:a.widgetRegistry!==void 0,definition:o};return console.log(`[${n}] name="${r.name??"ROOT"}" path=[${r.path.join(", ")}] type="${r.type??"unknown"}" hasRegistry=${r.hasRegistry}`),e?.onProcess?.(r),!1}}}exports.Base64Input=yt;exports.Base64sInput=st;exports.ColorSwatchInput=wt;exports.EditableText=Vt;exports.NullableDateInput=Mt;exports.NullableDateTimeInput=xt;exports.NullableEmailInput=_t;exports.NullablePasswordInput=At;exports.NullableRatingInput=Rt;exports.NullableSliderInput=Et;exports.NullableTextArea=Tt;exports.NullableTextInput=Ct;exports.NullableUUIDInput=Ft;exports.NullableUrlInput=Dt;exports.RatingInput=lt;exports.SliderInput=vt;exports.Switch=kt;exports.WidgetRegistry=it;exports.createDiagnosticWidget=Ht;exports.emptyToNull=P;exports.fileToBase64=rt;exports.forFormat=Ut;exports.forTypeAndFormat=Wt;exports.forXUI=Ot;exports.formatColor=R;exports.getContrastRatio=ht;exports.globalWidgetRegistry=Bt;exports.hexToRgb=E;exports.hslToRgb=j;exports.hwbToRgb=tt;exports.isValidColor=gt;exports.isValidHexColor=q;exports.isValidHslColor=G;exports.isValidRgbColor=X;exports.isValidRgbaColor=Y;exports.linearToSrgb=U;exports.mulberry32=J;exports.normalizeHexColor=K;exports.nullToEmpty=ot;exports.oklchToRgb=nt;exports.parseAnyColor=Q;exports.resolveEffectiveFormat=v;exports.rgbToHex=W;exports.rgbToHsl=H;exports.rgbToHwb=et;exports.rgbToOklch=at;exports.srgbToLinear=O;exports.toRgbaString=Z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-OOsMRpX9.cjs"),r={loadingExtended:"正在加载,请稍候",loadingShort:"加载中...",locale:"语言",iconDescription:"图标",loadingIcon:"加载图标",failedToLoadIcon:"图标加载失败",editLabel:"编辑",selectOne:"选择一个",selectNone:"无",selectMany:"选择多个",noResults:"无结果",passwordPlaceholderText:"密码",togglePasswordVisibility:"切换密码可见性",toggleMenu:"切换菜单",toggleAside:"切换侧边栏",mainNavigation:"主导航",sidebar:"侧边栏",closeDrawer:"关闭抽屉",closeModal:"关闭模态框",confirm:"确认",cancel:"取消",addLabel:"添加",removeItem:"删除项目",currentLocale:"简体中文",ar:"阿拉伯语",de:"德语",en:"英语",es:"西班牙语",fr:"法语",hi:" Hindi",it:"意大利语",ja:"日语",ko:"韩语",nl:"荷兰语",pl:"波兰语",pt:"葡萄牙语",ru:"俄语",tr:"土耳其语",vi:"越南语",zh:"简体中文",he:"希伯来语",fa:"波斯语",ur:"乌尔都语",emailPlaceholderText:"请输入邮箱",incrementValue:"增加值",decrementValue:"减少值",dropZoneInstructions:e=>e?"点击选择或将文件拖拽到此处,或按 Enter 或空格键打开文件选择器":"将文件拖拽到此处",fileSizeUnits:["字节","KB","MB","GB","TB"],removeFile:"删除文件",clearAllFiles:"清除所有文件",clearValue:"清除值",unknownType:"未知类型",filesInputInstructions:(e,o,n)=>{let l=(e==null||e>1,"点击选择或将文件拖拽到此处");if(e||o){const t=[];if(e!=null&&e>1&&t.push(`最多${e}个文件`),o&&n){const i=a.formatFileSize(o,{units:n});t.push(`每个最大${i}`)}t.length>0&&(l+=` (${t.join(",")})`)}return l},paginationLabel:"分页",firstPage:"第一页",previousPage:"上一页",nextPage:"下一页",lastPage:"最后一页",breadcrumbs:"面包屑导航",commandPalette:"命令面板",typeACommand:"输入命令...",noResultsFound:"未找到结果",noMatchingCommands:"没有匹配的命令",appearanceSystem:"跟随系统",appearanceLight:"浅色",appearanceDark:"深色",ok:"OK",changeTypeConfirmation:"更改类型将清除当前值。是否继续?",notifications:"通知",markAllAsRead:"全部标为已读",noNotifications:"没有通知",schemaConflictsDetected:"检测到架构冲突",schemaViolationsDetected:"检测到架构违规",properties:"属性",uploading:"上传中...",dropFilesOrBrowse:"将文件拖放到此处或点击浏览",acceptedTypes:e=>`支持的类型:${e}`,enterUrlPrompt:"请输入网址:",exceeded:"(已超出)",pdfPreview:"PDF 预览",lexical:{fontFamily:"字体",fontSize:"字号",lineHeight:"行高",fontColor:"字体颜色",highlightColor:"高亮颜色",backgroundColor:"背景颜色",bold:"粗体",italic:"斜体",underline:"下划线",strikethrough:"删除线",code:"代码",clearFormatting:"清除格式",normal:"正文",heading:e=>`标题 ${e}`,bulletList:"无序列表",orderedList:"有序列表",checkList:"任务列表",indent:"增加缩进",outdent:"减少缩进",blockquote:"引用",codeBlock:"代码块",horizontalRule:"水平分割线",insertTable:"插入表格",link:"链接",undo:"撤销",redo:"重做",cut:"剪切",copy:"复制",paste:"粘贴",defaultOption:"默认",slashCommands:"斜杠命令",noCommandsFound:"未找到命令",changeBlockType:"更改块类型",blockTypes:"块类型",enterUrl:"输入网址:",tableActions:"Table actions",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table"},prosemirror:{bold:"Bold",italic:"Italic",code:"Code",link:"Link",removeLink:"Remove Link",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"正在加载PDF...",loadFailed:"加载PDF失败",invalidPdf:"无效的PDF文件",pageOutOfRange:(e,o)=>`页面 ${e} 超出范围 (1-${o})`,renderFailed:"渲染PDF页面失败"}};exports.default=r;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as a } from "./translations-
|
|
1
|
+
import { f as a } from "./translations-DyCmyLE_.js";
|
|
2
2
|
const d = {
|
|
3
3
|
loadingExtended: "正在加载,请稍候",
|
|
4
4
|
loadingShort: "加载中...",
|
|
@@ -113,6 +113,7 @@ const d = {
|
|
|
113
113
|
lexical: {
|
|
114
114
|
fontFamily: "字体",
|
|
115
115
|
fontSize: "字号",
|
|
116
|
+
lineHeight: "行高",
|
|
116
117
|
fontColor: "字体颜色",
|
|
117
118
|
highlightColor: "高亮颜色",
|
|
118
119
|
backgroundColor: "背景颜色",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempots/beatui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.95.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -138,11 +138,11 @@
|
|
|
138
138
|
"registry": "https://registry.npmjs.org/"
|
|
139
139
|
},
|
|
140
140
|
"peerDependencies": {
|
|
141
|
-
"@tempots/core": "^3.0.
|
|
142
|
-
"@tempots/dom": "^37.0.
|
|
143
|
-
"@tempots/render": "^0.0.
|
|
141
|
+
"@tempots/core": "^3.0.1",
|
|
142
|
+
"@tempots/dom": "^37.0.4",
|
|
143
|
+
"@tempots/render": "^0.0.5",
|
|
144
144
|
"@tempots/std": "~0.26.1",
|
|
145
|
-
"@tempots/ui": "^16.0.
|
|
145
|
+
"@tempots/ui": "^16.0.1",
|
|
146
146
|
"better-auth": ">=1.0.0"
|
|
147
147
|
},
|
|
148
148
|
"peerDependenciesMeta": {
|
|
@@ -152,12 +152,12 @@
|
|
|
152
152
|
},
|
|
153
153
|
"devDependencies": {
|
|
154
154
|
"@eslint/js": "^10.0.1",
|
|
155
|
-
"@tempots/core": "^3.0.
|
|
156
|
-
"@tempots/dom": "^37.0.
|
|
155
|
+
"@tempots/core": "^3.0.1",
|
|
156
|
+
"@tempots/dom": "^37.0.4",
|
|
157
157
|
"@tempots/eslint-plugin": "0.13.1",
|
|
158
|
-
"@tempots/render": "^0.0.
|
|
158
|
+
"@tempots/render": "^0.0.5",
|
|
159
159
|
"@tempots/std": "~0.26.1",
|
|
160
|
-
"@tempots/ui": "^16.0.
|
|
160
|
+
"@tempots/ui": "^16.0.1",
|
|
161
161
|
"@testing-library/dom": "10.4.1",
|
|
162
162
|
"@types/markdown-it": "^14.1.2",
|
|
163
163
|
"@types/node": "25.2.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("@tempots/dom"),C=require("@tempots/ui"),y=require("./colors-BI0YhONJ.cjs");function w(e,{units:t=["B","KB","MB","GB","TB"],decimalPlaces:o=0,locale:l}={}){if(e===0||e===0n)return new Intl.NumberFormat(l,{style:"unit",unit:"byte",unitDisplay:"short",maximumFractionDigits:0}).format(0).replace("byte",t[0]);let n,r;if(typeof e=="bigint"){let s=e<0n?-e:e;for(n=0;s>=1024n&&n<t.length-1;)s=s/1024n,n++;r=Number(e)/Math.pow(1024,n)}else n=Math.floor(Math.log(Math.abs(e))/Math.log(1024)),n=Math.min(n,t.length-1),r=e/Math.pow(1024,n);return new Intl.NumberFormat(l,{style:"unit",unit:"byte",unitDisplay:"short",minimumFractionDigits:n===0?0:o,maximumFractionDigits:n===0?0:o}).format(r).replace("byte",t[n])}const T={loadingExtended:"Loading, please wait",loadingShort:"Loading...",locale:"Locale",iconDescription:"Icon",loadingIcon:"Loading icon",failedToLoadIcon:"Failed to load icon",editLabel:"Edit",selectOne:"Select one",selectNone:"None",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,o)=>{let l=e==null||e>1?"Click to choose or drag files here":"Click to choose or drag a file here";if(e||t){const n=[];if(e!=null&&e>1&&n.push(`up to ${e} files`),t&&o){const r=w(t,{units:o});n.push(`max ${r} each`)}n.length>0&&(l+=` (${n.join(", ")})`)}return l},paginationLabel:"Pagination",firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",breadcrumbs:"Breadcrumbs",commandPalette:"Command palette",typeACommand:"Type a command...",noResultsFound:"No results found",noMatchingCommands:"No matching commands",appearanceSystem:"System",appearanceLight:"Light",appearanceDark:"Dark",ok:"OK",changeTypeConfirmation:"Changing type will clear the current value. Continue?",notifications:"Notifications",markAllAsRead:"Mark all as read",noNotifications:"No notifications",schemaConflictsDetected:"Schema Conflicts Detected",schemaViolationsDetected:"Schema Violations Detected",properties:"Properties",uploading:"Uploading...",dropFilesOrBrowse:"Drop files here or click to browse",acceptedTypes:e=>`Accepted types: ${e}`,enterUrlPrompt:"Enter URL:",exceeded:"(exceeded)",pdfPreview:"PDF Preview",lexical:{fontFamily:"Font Family",fontSize:"Font Size",fontColor:"Font Color",highlightColor:"Highlight Color",backgroundColor:"Background Color",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",code:"Code",clearFormatting:"Clear Formatting",normal:"Normal",heading:e=>`Heading ${e}`,bulletList:"Bullet List",orderedList:"Ordered List",checkList:"Check List",indent:"Indent",outdent:"Outdent",blockquote:"Blockquote",codeBlock:"Code Block",horizontalRule:"Horizontal Rule",insertTable:"Insert Table",link:"Link",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste",defaultOption:"Default",slashCommands:"Slash commands",noCommandsFound:"No commands found",changeBlockType:"Change block type",blockTypes:"Block types",enterUrl:"Enter URL:",tableActions:"Table actions",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table"},prosemirror:{bold:"Bold",italic:"Italic",code:"Inline code",link:"Insert link",removeLink:"Remove link",heading:e=>`Heading ${e}`,bulletList:"Bullet list",orderedList:"Ordered list",blockquote:"Blockquote",codeBlock:"Code block",horizontalRule:"Horizontal rule",linkUrlPlaceholder:"https://example.com"},pdfPageViewer:{loading:"Loading PDF...",loadFailed:"Failed to load PDF",invalidPdf:"Invalid PDF file",pageOutOfRange:(e,t)=>`Page ${e} is out of range (1-${t})`,renderFailed:"Failed to render PDF page"}},f=T,p="en",M=new Set(["ar","he","fa","ur","ps","sd","ku","dv","yi","ji","iw","in"]);function v(e){if(!e)return"ltr";const t=e.split(/[-_]/)[0].toLowerCase();return M.has(t)?"rtl":"ltr"}function I(e,t){return e==="auto"?v(t):e}function O(e){return`b-${e}`}function V(e){return v(e)==="rtl"}function N(e){return e==="ltr"?"rtl":"ltr"}const L={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 $(e,t){return L[t][e]}const x={mark:a.makeProviderMark("Locale"),create:e=>{const t=a.localStorageProp({defaultValue:navigator.language??"en-US",key:"beatui-locale"}),o=a.localStorageProp({defaultValue:"auto",key:"beatui-direction-preference"}),l=a.computedOf(t,o)((r,i)=>I(i,r));return{value:{locale:t,setLocale:r=>t.set(r),direction:l,directionPreference:o,setDirectionPreference:r=>o.set(r)},dispose:()=>{t.dispose(),o.dispose(),l.dispose()}}}},{variants:A,special:U,overrides:k}=y.backgroundConfig;function d(e,t){switch(e){case"white":return"var(--color-white)";case"black":return"var(--color-black)";case"transparent":return"transparent";default:return y.getColorVar(e,t)}}function D(e,t){const o=U[e];if(!o)return;if(t==="light")return o;const l=k[e];return l?l[t]:o}function E(e,t,o){const l=k[e];if(l){const r=l[o];if(r)return{backgroundColor:r.backgroundColor,textColor:r.color}}if(t==="solid"){const r=D(e,o);if(r)return{backgroundColor:r.backgroundColor,textColor:r.color}}const n=A[t][o];return{backgroundColor:d(e,n.bgShade),textColor:n.textColor}}const j={light:{shade:700,textColor:"var(--color-white)"},dark:{shade:500,textColor:"var(--text-inverted-dark)"}},_={light:{shade:200,textColor:"var(--text-normal-light)"},dark:{shade:700,textColor:"var(--text-normal-dark)"}},z={light:{shade:400,textColor:"var(--text-normal-light)"},dark:{shade:600,textColor:"var(--text-normal-dark)"}};function H(e,t,o){const l=k[e];if(l){const r=l[o];if(r)return{backgroundColor:r.backgroundColor,textColor:r.color}}if(t==="solid"){const r=D(e,o);if(r)return{backgroundColor:r.backgroundColor,textColor:r.color};const i=j[o];return{backgroundColor:d(e,i.shade),textColor:i.textColor}}const n=t==="light"?_[o]:z[o];return{backgroundColor:d(e,n.shade),textColor:n.textColor}}function G(e,t){const o=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 d(e,o)}}function K(e,t){return e==="white"?"var(--color-white)":e==="black"?"var(--color-black)":e==="transparent"?"inherit":d(e,t==="light"?800:200)}function P(e,t,o){return t==="soft"?d(e,o==="light"?300:700):d(e,o==="light"?500:600)}const W="bui-icons",g=new Map,b=(()=>{try{return typeof indexedDB<"u"&&indexedDB!==null}catch{return!1}})();function Y(){return b?new Promise((e,t)=>{const o=indexedDB.open(W,1);o.onupgradeneeded=function(l){const n=l.target.result;n.objectStoreNames.contains("icons")||n.createObjectStore("icons")},o.onsuccess=function(){e(o.result)},o.onerror=function(){t(o.error)}}):Promise.reject(new Error("IndexedDB not available"))}const m=b?Y():null;async function B(e,t){try{if(m){const o=await m;return new Promise((l,n)=>{const r=o.transaction("icons","readwrite");r.objectStore("icons").put(t,e),r.oncomplete=()=>l(),r.onerror=n})}else g.set(e,t)}catch{g.set(e,t)}}async function S(e){try{if(m){const t=await m;return new Promise((o,l)=>{const i=t.transaction("icons","readonly").objectStore("icons").get(e);i.onsuccess=function(){o(i.result)},i.onerror=l})}else return g.get(e)||null}catch{return g.get(e)||null}}async function J(e){const t=`https://api.iconify.design/${e}.svg`;return fetch(t).then(o=>{if(o.status===200)return o.text();throw new Error(`Failed to load icon: ${e}`)})}async function Q(e){const t=e.replace(":","/"),o=await S(t);if(o)return o;const l=await J(t);return await B(t,l),l}function Z(e){return["bc-icon",`bc-icon--${e}`].join(" ")}function X(e,t="solid"){if(!e)return"";const o=P(e,t,"light"),l=P(e,t,"dark");return`--icon-color: ${o}; --icon-color-dark: ${l}`}function ee({icon:e,size:t="md",color:o,title:l,accessibility:n="auto",tone:r="solid"},...i){const u=a.computedOf(n,l)((s,c)=>s==="decorative"?!1:s==="informative"?!0:c!=null&&c!=="");return a.Use(R,s=>a.html.span(a.attr.class(a.computedOf(t,o)(c=>Z(c??"md"))),a.attr.style(a.computedOf(o,r)((c,h)=>X(c??void 0,h??"solid"))),a.When(u,()=>a.Fragment(a.attr.role("img"),a.aria.label(a.coalesce(l,s.$.iconDescription))),()=>a.aria.hidden(!0)),C.WhenInViewport({once:!0},()=>C.Query({request:e,load:({request:c})=>Q(c),convertError:String,success:({value:c})=>a.html.span(a.style.width("100%"),a.style.height("100%"),a.attr.innerHTML(c)),pending:()=>a.html.span(a.attr.class("animate-spin"),a.When(u,()=>a.Fragment(a.attr.role("img"),a.aria.label(s.$.loadingIcon)),()=>a.aria.hidden(!0)),"↻"),failure:({error:c})=>a.html.span(a.attr.title(c),a.attr.class("text-red-500"),a.When(u,()=>a.Fragment(a.attr.role("img"),a.aria.label(s.$.failedToLoadIcon)),()=>a.aria.hidden(!0)),"🚫")})),...i))}function te(e){const t=e.split("-"),o=[e];return t.length>1&&o.push(t[0]),o}function F({locale:e,defaultLocale:t="en-US",defaultMessages:o,localeLoader:l}){const n=a.prop(t),r=a.prop(o),i=e.on(async u=>{if(u===n.value)return;n.set(u);const s=te(u);for(const c of s)try{const h=await l(c);if(typeof h.default=="object"&&Object.keys(h).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(u===n.value){r.set(h);return}}catch{continue}console.warn(`No locale found for "${e.value}", using fallback`),u===n.value&&r.set(o)});return{dispose:()=>{i(),n.dispose(),r.dispose()},t:r}}function q({defaultLocale:e,defaultMessages:t,localeLoader:o,providerName:l="I18nProvider"}){return{mark:a.makeProviderMark(l),create:(n,r)=>{const{value:{locale:i}}=r.getProvider(x.mark),{t:u,dispose:s}=F({locale:i,defaultMessages:t,defaultLocale:e,localeLoader:o});return{value:u,dispose:s}}}}const oe=Object.assign({"./locales/ar.ts":()=>Promise.resolve().then(()=>require("./ar-D2DjoXta.cjs")).then(e=>e.default),"./locales/de.ts":()=>Promise.resolve().then(()=>require("./de-Cdf3432J.cjs")).then(e=>e.default),"./locales/es.ts":()=>Promise.resolve().then(()=>require("./es-6fFPkKHL.cjs")).then(e=>e.default),"./locales/fa.ts":()=>Promise.resolve().then(()=>require("./fa-GXyNzAXz.cjs")).then(e=>e.default),"./locales/fr.ts":()=>Promise.resolve().then(()=>require("./fr-C6EYTwSH.cjs")).then(e=>e.default),"./locales/he.ts":()=>Promise.resolve().then(()=>require("./he-CJUgxvi8.cjs")).then(e=>e.default),"./locales/hi.ts":()=>Promise.resolve().then(()=>require("./hi-DqIR4VtX.cjs")).then(e=>e.default),"./locales/it.ts":()=>Promise.resolve().then(()=>require("./it-BvHsJ7fH.cjs")).then(e=>e.default),"./locales/ja.ts":()=>Promise.resolve().then(()=>require("./ja-B2gP7OHY.cjs")).then(e=>e.default),"./locales/ko.ts":()=>Promise.resolve().then(()=>require("./ko-BddhddIA.cjs")).then(e=>e.default),"./locales/nl.ts":()=>Promise.resolve().then(()=>require("./nl-COrtZUnH.cjs")).then(e=>e.default),"./locales/pl.ts":()=>Promise.resolve().then(()=>require("./pl-BHI4zBgV.cjs")).then(e=>e.default),"./locales/pt.ts":()=>Promise.resolve().then(()=>require("./pt-BGzC9MhU.cjs")).then(e=>e.default),"./locales/ru.ts":()=>Promise.resolve().then(()=>require("./ru-CXeFbIPb.cjs")).then(e=>e.default),"./locales/tr.ts":()=>Promise.resolve().then(()=>require("./tr-CdOtQAtA.cjs")).then(e=>e.default),"./locales/ur.ts":()=>Promise.resolve().then(()=>require("./ur-C7itXvnC.cjs")).then(e=>e.default),"./locales/vi.ts":()=>Promise.resolve().then(()=>require("./vi-CQrUWB3y.cjs")).then(e=>e.default),"./locales/zh.ts":()=>Promise.resolve().then(()=>require("./zh-DWswYYTS.cjs")).then(e=>e.default)}),R=q({defaultLocale:p,defaultMessages:f,localeLoader:async e=>{if(e===p)return f;const t=oe[`./locales/${e}.ts`];return t?await t():f},providerName:"BeatUII18n"});exports.BeatUII18n=R;exports.Icon=ee;exports.LOGICAL_PROPERTY_MAP=L;exports.Locale=x;exports.backgroundValue=E;exports.borderColorValue=G;exports.defaultLocale=p;exports.defaultMessages=f;exports.formatFileSize=w;exports.getDirectionClassName=O;exports.getDirectionFromLocale=v;exports.getIconLocally=S;exports.getOppositeDirection=N;exports.getPhysicalProperty=$;exports.hoverBackgroundValue=H;exports.isIndexedDBAvailable=b;exports.isRTLLocale=V;exports.makeI18nProvider=q;exports.makeMessages=F;exports.resolveDirection=I;exports.storeIconLocally=B;exports.textColorValue=K;
|