@tempots/beatui 0.90.0 → 0.91.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.
Files changed (104) hide show
  1. package/dist/{ar-MUKILk4c.js → ar-8Cko5i-Z.js} +18 -10
  2. package/dist/{ar-CBrjAlIY.cjs → ar-D2DjoXta.cjs} +1 -1
  3. package/dist/auth/index.cjs.js +1 -1
  4. package/dist/auth/index.es.js +1 -1
  5. package/dist/{auth-divider-DvVmqjnk.js → auth-divider-B4n8lGx5.js} +7 -7
  6. package/dist/{auth-divider-Cj-xJxF_.cjs → auth-divider-VzrKnv2d.cjs} +1 -1
  7. package/dist/beatui.css +31 -28
  8. package/dist/beatui.tailwind.css +31 -28
  9. package/dist/better-auth/index.cjs.js +1 -1
  10. package/dist/better-auth/index.es.js +5 -5
  11. package/dist/{de-CEsW1rVX.js → de-Bt-d2iKj.js} +12 -4
  12. package/dist/{de-CrBw41po.cjs → de-Cdf3432J.cjs} +1 -1
  13. package/dist/{deep-merge-OvVqSLSN.js → deep-merge-BdRgguFO.js} +38 -38
  14. package/dist/deep-merge-CI1g9sjh.cjs +1 -0
  15. package/dist/{duration-input-BCXujp0V.js → duration-input-BZhzeELL.js} +4 -4
  16. package/dist/{duration-input-MJz6UO6E.cjs → duration-input-a1fCTfKl.cjs} +1 -1
  17. package/dist/{editor-toolbar-group-Cnta0SOa.js → editor-toolbar-group-CzdBZ1yr.js} +2 -2
  18. package/dist/{editor-toolbar-group-BgWLVgMZ.cjs → editor-toolbar-group-DhKJdqER.cjs} +1 -1
  19. package/dist/{es-ChP-aFwC.js → es-2llfNFX2.js} +10 -2
  20. package/dist/{es-Ca5xT3NE.cjs → es-6fFPkKHL.cjs} +1 -1
  21. package/dist/{fa-CNsrlIqh.js → fa-CQVIBjKP.js} +18 -10
  22. package/dist/{fa-DhZJYuC6.cjs → fa-GXyNzAXz.cjs} +1 -1
  23. package/dist/{fr-1nSKSIlw.cjs → fr-C6EYTwSH.cjs} +1 -1
  24. package/dist/{fr-DgEFKpML.js → fr-CC3smTlW.js} +19 -11
  25. package/dist/{he-DhcurPt5.cjs → he-CJUgxvi8.cjs} +1 -1
  26. package/dist/{he-B4TqfISZ.js → he-CZilsN75.js} +16 -8
  27. package/dist/{hi-TSoDsngT.js → hi-CAZjwGv-.js} +16 -8
  28. package/dist/{hi-CxsIxbfM.cjs → hi-DqIR4VtX.cjs} +1 -1
  29. package/dist/{index-D4ZFV8Rs.cjs → index-B-cwxUsP.cjs} +1 -1
  30. package/dist/{index-DOc1_-Nm.js → index-BFzxpY7y.js} +1 -1
  31. package/dist/{index-D3QVPAme.cjs → index-BOC0cVoY.cjs} +2 -2
  32. package/dist/{index-D_aTUfqS.js → index-DJ9YIJcG.js} +6 -6
  33. package/dist/index.cjs.js +2 -2
  34. package/dist/index.es.js +1847 -1822
  35. package/dist/{input-container-BBWCDGTv.js → input-container-9r1F3KuX.js} +1 -1
  36. package/dist/{input-container-B31Seozh.cjs → input-container-DiYEl_y8.cjs} +1 -1
  37. package/dist/{it-D_IcaYxp.cjs → it-BvHsJ7fH.cjs} +1 -1
  38. package/dist/{it-BrbebXg4.js → it-D6RXFIL6.js} +19 -11
  39. package/dist/{ja-CMGqpPo7.cjs → ja-B2gP7OHY.cjs} +1 -1
  40. package/dist/{ja-DcfOktrV.js → ja-D7zsz4Ij.js} +15 -7
  41. package/dist/json-schema/index.cjs.js +1 -1
  42. package/dist/json-schema/index.es.js +11 -12
  43. package/dist/json-schema-display/index.cjs.js +1 -1
  44. package/dist/json-schema-display/index.es.js +1 -1
  45. package/dist/json-structure/index.cjs.js +1 -1
  46. package/dist/json-structure/index.es.js +6 -6
  47. package/dist/{ko-BPl5rP97.cjs → ko-BddhddIA.cjs} +1 -1
  48. package/dist/{ko-73e6t369.js → ko-taN2Npr4.js} +12 -4
  49. package/dist/lexical/index.cjs.js +30 -30
  50. package/dist/lexical/index.es.js +5741 -5527
  51. package/dist/lexical.css +31 -28
  52. package/dist/{modal-jJMS0ZlW.cjs → modal-C-d5Btti.cjs} +1 -1
  53. package/dist/{modal-BBJWY7NB.js → modal-DTz98Dk7.js} +3 -3
  54. package/dist/{nl-BSfaHFt0.cjs → nl-COrtZUnH.cjs} +1 -1
  55. package/dist/{nl-Bq-1-ulc.js → nl-CRC6r4Q4.js} +22 -14
  56. package/dist/{notice-9lpZ-VDn.cjs → notice-BDTfBGtx.cjs} +1 -1
  57. package/dist/{notice-AUVH8Lho.js → notice-CZuh-h6a.js} +4 -4
  58. package/dist/{oneof-branch-detection-BsGhMslW.cjs → oneof-branch-detection-D6Xa8qNR.cjs} +1 -1
  59. package/dist/{oneof-branch-detection-BQnRjp9P.js → oneof-branch-detection-DCPwyutI.js} +1 -1
  60. package/dist/{pl-D-O4sCnr.cjs → pl-BHI4zBgV.cjs} +1 -1
  61. package/dist/{pl-Du9-VCfW.js → pl-C6qNs0Lq.js} +19 -11
  62. package/dist/prosemirror/index.cjs.js +1 -1
  63. package/dist/prosemirror/index.es.js +1 -1
  64. package/dist/{pt-chEEYLlt.cjs → pt-BGzC9MhU.cjs} +1 -1
  65. package/dist/{pt-B2UqqSAB.js → pt-CcWPLqBh.js} +20 -12
  66. package/dist/{ru-B46hVpFF.cjs → ru-CXeFbIPb.cjs} +1 -1
  67. package/dist/{ru-DiWa2inw.js → ru-Dt9-9m0E.js} +20 -12
  68. package/dist/tailwind/vite-plugin.es.js +0 -1
  69. package/dist/{text-input-6FD7p7hN.js → text-input-BgPx8BbG.js} +1 -1
  70. package/dist/{text-input-w0eVcqk5.cjs → text-input-DUnhBUd6.cjs} +1 -1
  71. package/dist/{toolbar-Cr0JGj5h.js → toolbar-DKOh_gbA.js} +1 -1
  72. package/dist/{toolbar-BR8In7O0.cjs → toolbar-Dkc2y1dI.cjs} +1 -1
  73. package/dist/{tr-Culcm2Zb.js → tr-CDTWeRY0.js} +14 -6
  74. package/dist/{tr-CaMaflJL.cjs → tr-CdOtQAtA.cjs} +1 -1
  75. package/dist/{translations-CZ0KOii3.cjs → translations-BdCtLBZt.cjs} +1 -1
  76. package/dist/{translations-uEUkO6gJ.js → translations-CiBhB2FV.js} +135 -127
  77. package/dist/translations-Cy9hoMGV.cjs +1 -0
  78. package/dist/{translations-Cttn6w0G.js → translations-NBY7SubC.js} +1 -1
  79. package/dist/types/beatui-i18n/default.d.ts +8 -0
  80. package/dist/types/beatui-i18n/locales/en.d.ts +8 -0
  81. package/dist/types/beatui-i18n/translations.d.ts +8 -0
  82. package/dist/types/components/form/input/index.d.ts +2 -0
  83. package/dist/types/components/form/input/nullable-color-input.d.ts +31 -0
  84. package/dist/types/components/form/input/nullable-color-swatch-input.d.ts +39 -0
  85. package/dist/types/components/lexical/table/table-controls.d.ts +3 -1
  86. package/dist/types/components/lexical/toolbar/index.d.ts +1 -0
  87. package/dist/types/components/lexical/toolbar/toolbar-registry.d.ts +16 -0
  88. package/dist/types/lexical/index.d.ts +2 -1
  89. package/dist/types/lexical/plugins/element-style.d.ts +29 -0
  90. package/dist/types/lexical/plugins/index.d.ts +1 -0
  91. package/dist/types/lexical/types.d.ts +43 -2
  92. package/dist/{ur-CvGP14xo.cjs → ur-C7itXvnC.cjs} +1 -1
  93. package/dist/{ur-Deb-uH6b.js → ur-CLrK5FPQ.js} +16 -8
  94. package/dist/{use-form-lg6-7Brc.js → use-form-Cd8YFWaN.js} +3 -3
  95. package/dist/{use-form-i97PToWB.cjs → use-form-DQVN_Zjb.cjs} +2 -2
  96. package/dist/{vi-CUsCVh3n.js → vi-B1_QDUQJ.js} +21 -13
  97. package/dist/{vi-Df4WZe9y.cjs → vi-CQrUWB3y.cjs} +1 -1
  98. package/dist/{widget-customization-CDD72zYs.js → widget-customization-BY4Ox_4e.js} +25 -25
  99. package/dist/{widget-customization-BLvD4Lqt.cjs → widget-customization-eyQ2pxvu.cjs} +1 -1
  100. package/dist/{zh-C5a9NGFW.cjs → zh-DWswYYTS.cjs} +1 -1
  101. package/dist/{zh-Dil2Jft8.js → zh-rDtQ92Pp.js} +12 -4
  102. package/package.json +1 -1
  103. package/dist/deep-merge-Dgy9xj6w.cjs +0 -1
  104. package/dist/translations-gVgMyNno.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";const t=require("@tempots/dom"),k=require("./deep-merge-Dgy9xj6w.cjs"),ct=require("./string-B9vVyfq3.cjs"),D=require("./input-container-B31Seozh.cjs"),S=require("./text-input-w0eVcqk5.cjs"),N=require("./translations-gVgMyNno.cjs"),ut=require("@tempots/ui"),z=require("./notice-9lpZ-VDn.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,r=e.match(n);if(!r)return!1;const[,a,o,s]=r,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(s,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,r=e.match(n);if(!r)return!1;const[,a,o,s,l]=r,i=parseInt(a,10),c=parseInt(o,10),u=parseInt(s,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,r=e.match(n);if(!r)return!1;const[,a,o,s]=r,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(s,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(r=>r+r).join("")),`#${n.toLowerCase()}`}function W(e,n,r){const a=o=>{const s=Math.round(Math.max(0,Math.min(255,o))).toString(16);return s.length===1?"0"+s:s};return`#${a(e)}${a(n)}${a(r)}`}function E(e){const n=K(e);if(!n)return null;const r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null}function ht(e,n){const r=E(e),a=E(n);if(!r||!a)return null;const o=(u,p,h)=>{const[m,d,b]=[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*d+.0722*b},s=o(r.r,r.g,r.b),l=o(a.r,a.g,a.b),i=Math.max(s,l),c=Math.min(s,l);return(i+.05)/(c+.05)}function Q(e){if(!e)return[0,0,0,1];const r=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(r){const u=r[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),d=parseInt(u.slice(6,8),16)/255;return[p,h,m,d]}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),d=parseInt(u[3]+u[3],16)/255;return[p,h,m,d]}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 s=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(s){const u=parseFloat(s[1]),p=parseFloat(s[2]),h=parseFloat(s[3]),m=s[4]!=null?parseFloat(s[4]):1,[d,b,I]=j(u,p/100,h/100);return[d,b,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,[d,b,I]=tt(u,p,h);return[d,b,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,d=u.endsWith("%")?Math.max(0,Math.min(1,parseFloat(u)/100)):Math.max(0,Math.min(1,parseFloat(u))),[b,I,V]=nt(d,p,h);return[b,I,V,m]}const c=E(e);return c?[c.r,c.g,c.b,1]:[0,0,0,1]}function Z(e,n,r,a){return`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${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,r){e=(e%360+360)%360;const a=(1-Math.abs(2*r-1))*n,o=a*(1-Math.abs(e/60%2-1)),s=r-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+s)*255),Math.round((i+s)*255),Math.round((c+s)*255)]}function tt(e,n,r){e=(e%360+360)%360;const a=n+r;a>1&&(n/=a,r/=a);const[o,s,l]=j(e,1,.5).map(h=>h/255),i=1-n-r,c=o*i+n,u=s*i+n,p=l*i+n;return[Math.round(c*255),Math.round(u*255),Math.round(p*255)]}function H(e,n,r){e/=255,n/=255,r/=255;const a=Math.max(e,n,r),o=Math.min(e,n,r);let s=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:s=(n-r)/c+(n<r?6:0);break;case n:s=(r-e)/c+2;break;default:s=(e-n)/c+4}s*=60}return[Math.round(s),Math.round(l*100),Math.round(i*100)]}function et(e,n,r){const[a]=H(e,n,r),o=e/255,s=n/255,l=r/255,i=Math.min(o,s,l),c=1-Math.max(o,s,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,r){const a=r*Math.PI/180,o=Math.cos(a)*n,s=Math.sin(a)*n,l=e+.3963377774*o+.2158037573*s,i=e-.1055613458*o-.0638541728*s,c=e-.0894841775*o-1.291485548*s,u=l*l*l,p=i*i*i,h=c*c*c,m=4.0767416621*u-3.3077115913*p+.2309699292*h,d=-1.2684380046*u+2.6097574011*p-.3413193965*h,b=-.0041960863*u-.7034186147*p+1.707614701*h;return[U(m),U(d),U(b)]}function at(e,n,r){const a=O(e),o=O(n),s=O(r),l=.4122214708*a+.5363325363*o+.0514459929*s,i=.2119034982*a+.6806995451*o+.1073969566*s,c=.0883024619*a+.2817188376*o+.6299787005*s,u=Math.cbrt(l),p=Math.cbrt(i),h=Math.cbrt(c),m=.2104542553*u+.793617785*p-.0040720468*h,d=1.9779984951*u-2.428592205*p+.4505937099*h,b=.0259040371*u+.7827717662*p-.808675766*h,I=Math.sqrt(d*d+b*b);let V=Math.atan2(b,d)*180/Math.PI;return V<0&&(V+=360),[m,I,V]}function R(e,n,r,a,o,s){switch(o){case"hex":if(s){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(r)}${l(i)}`}return W(e,n,r);case"rgb":return`rgb(${e}, ${n}, ${r})`;case"rgba":return`rgba(${e}, ${n}, ${r}, ${Math.round(a*100)/100})`;case"hsl":{const[l,i,c]=H(e,n,r);return`hsl(${l}, ${i}%, ${c}%)`}case"hsla":{const[l,i,c]=H(e,n,r);return`hsla(${l}, ${i}%, ${c}%, ${Math.round(a*100)/100})`}case"hwb":{const[l,i,c]=et(e,n,r);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,r),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 s||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,r)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const o=a.result;n(o.split(",")[1])},a.onerror=o=>r(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??""),r=n.length,a=new Uint8Array(r);for(let o=0;o<r;o++)a[o]=n.charCodeAt(o);return a}function st(e){const{value:n,onChange:r,onInput:a,...o}=e,s=new Map,l=t.Value.toSignal(n).map(p=>p.map((h,m)=>{const d=s.get(h),b=bt(h??""),I=d?.type||ft(b),V=d?.name??`file-${m}`,y=b.buffer.slice(b.byteOffset,b.byteOffset+b.byteLength),f=new Blob([y],{type:I});return new File([f],V,{type:I})})),i=p=>h=>{p&&mt(h).then(m=>{for(const[d,b]of m.entries())s.set(b,{name:h[d].name,type:h[d].type});p(m)})},c=i(r),u=i(a);return k.FilesInput({...o,value:l,onChange:c,onInput:u})}function yt(e){const{value:n,onInput:r,onChange:a,...o}=e;return st({...o,maxFiles:1,value:t.Value.map(n,s=>s==null?[]:[s]),onChange:s=>{a?.(s[0])},onInput:s=>{r?.(s[0])}})}function It(e,n){const[r,a,o]=e,s=r<<16^a<<8^o,l=J(s),i=6+Math.floor(l()*5),c=.18+l()*.06,u=[];for(let d=0;d<i;d++){const b=d/i*Math.PI*2,I=n*(1+(l()*2-1)*c),V=Math.cos(b)*I,y=Math.sin(b)*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 d=0;d<i;d++){const b=u[d],I=u[(d+1)%i],V=(b.x+I.x)/2,y=(b.y+I.y)/2;m+=` Q ${b.x.toFixed(3)} ${b.y.toFixed(3)} ${V.toFixed(3)} ${y.toFixed(3)}`}return m+=" Z",m}const wt=e=>{const{value:n,onBlur:r,onChange:a,onInput:o,displayValue:s,size:l,withAlpha:i}=e,c=t.Value.map(l??32,g=>g),u=t.Value.map(n,g=>Q(g??"#000000")),p=t.Value.map(u,([g,w,$])=>[g,w,$]),h=t.Value.map(u,([,,,g])=>g),m=t.prop(t.Value.get(h)??1),d=t.Value.map(i??!1,g=>g),b=t.Value.map(e.colorTextFormat??"rgb",g=>g),I=t.computedOf(p,m,b,d)(([g,w,$],C,A,T)=>R(g,w,$,C??1,v(A,T),T)),V=t.Value.map(e.colorTextFormat??"hex",g=>g),y=t.Value.map(c,g=>`${-g/2} ${-g/2} ${g} ${g}`),f=t.computedOf(p,c)((g,w)=>It(g,w/2)),M=t.computedOf(p,m,d)(([g,w,$],C,A)=>A||C<1?Z(g,w,$,C):W(g,w,$)),_=t.html.div(t.attr.class("bc-color-swatch-input__control"),t.attr.class(t.Value.map(d,g=>g?"bc-color-swatch-input__control--alpha":"")),t.attr.style(t.computedOf(c)(g=>`min-width:${g+2}px;height:${g+2}px`)),t.svg.svg(t.attr.class("bc-color-swatch-input__svg"),t.svgAttr.viewBox(y),t.svg.path(t.svgAttr.d(f),t.svgAttr.fill(M))),t.html.input(t.attr.type("color"),S.CommonInputAttributes(e),t.attr.value(t.Value.map(p,([g,w,$])=>W(g,w,$))),t.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),r!=null?t.on.blur(r):t.Empty,a!=null?t.on.change(g=>{const w=g.target.value;if(!a)return;const{r:$,g:C,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(d)),L=R($,C,A,T,F,t.Value.get(d));a(L)}):t.Empty,o!=null?t.on.input(g=>{const w=g.target.value;if(!o)return;const{r:$,g:C,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(d)),L=R($,C,A,T,F,t.Value.get(d));o(L)}):t.Empty)),x=t.When(d,()=>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,g=>String(g??1))),t.attr.disabled(e.disabled),t.on.input(g=>{const w=parseFloat(g.target.value);m.set(w);const[$,C,A]=t.Value.get(p),T=v(t.Value.get(V),t.Value.get(d)),F=R($,C,A,w,T,t.Value.get(d));o?.(F)}),t.on.change(g=>{const w=parseFloat(g.target.value);m.set(w);const[$,C,A]=t.Value.get(p),T=v(t.Value.get(V),t.Value.get(d)),F=R($,C,A,w,T,t.Value.get(d));a?.(F)})));return D.InputContainer({baseContainer:!0,...e,growInput:!1,input:_,after:t.Fragment(t.When(s??!1,()=>t.html.span(t.attr.class("bc-color-swatch-input__rgb"),I)),x,e.after)})},Vt=({startEditing:e,value:n,onChange:r,placeholder:a,disabled:o})=>{const s=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(s,()=>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"?s.set(!1):c.key==="Escape"&&(l.set(!0),s.set(!1))}),t.on.blur(t.emitValue(c=>{if(s.set(!1),l.value){l.set(!1);return}r(c)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(i)||s.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(()=>s.set(!0)),N.Icon({icon:"line-md/pencil",color:"neutral"}))))))},Mt=e=>{const{value:n,onBlur:r,onChange:a,onInput:o,after:s,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"),r!=null?t.on.blur(t.emitValue(r)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDate(o)):t.Empty),after:s!=null?t.Fragment(i,s):i})},$t=e=>{const n=e.getFullYear(),r=e.getMonth()+1,a=e.getDate(),o=e.getHours(),s=e.getMinutes(),l=e.getSeconds();return`${n}-${r.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},xt=e=>{const{value:n,onBlur:r,onChange:a,onInput:o,after:s,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"),r!=null?t.on.blur(t.emitValue(r)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDateTime(o)):t.Empty),after:s!=null?t.Fragment(c,s):c})},P=e=>typeof e=="string"&&e.trim()===""?null:e,ot=e=>e??"";function B(e){return n=>{const{value:r,onBlur:a,onChange:o,onInput:s,after:l,disabled:i,...c}=n,u=k.NullableResetAfter(r,i,o??s);return e({...c,disabled:i,value:t.Value.map(r,ot),onChange:o!=null?p=>o(P(p)):void 0,onInput:s!=null?p=>s(P(p)):void 0,onBlur:a,after:l!=null?t.Fragment(u,l):u})}}const _t=B(z.EmailInput),Ct=B(S.TextInput),At=B(z.PasswordInput),Tt=B(k.TextArea),kt=({value:e,onChange:n,onInput:r,onBlur:a,offLabel:o,onLabel:s,disabled:l=!1,size:i="md",id:c,color:u="primary",tabIndex:p=0,matchInputHeight:h=!0})=>{const m=c??pt.sessionId("switch");function d(y,f){const M=["bc-switch",`bc-switch--size-${f}`,`bc-switch--${f}`];return h&&M.push("bc-switch--match-input"),y&&M.push("bc-switch--disabled"),M.join(" ")}function b(y){const f=y??"primary",M=new Map,_=N.backgroundValue(f,"solid","light"),x=N.backgroundValue(f,"solid","dark");return M.set("--switch-track-on-bg",_.backgroundColor),M.set("--switch-track-on-label",_.textColor),M.set("--switch-track-on-bg-dark",x.backgroundColor),M.set("--switch-track-on-label-dark",x.textColor),M.set("--switch-track-on-border-dark",N.borderColorValue(f,"dark")),Array.from(M.entries()).map(([g,w])=>`${g}: ${w}`).join("; ")}const I=()=>{t.Value.get(l)||(n?.(!t.Value.get(e)),r?.(!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,f)=>d(y??!1,f??"md"))),t.attr.style(t.computedOf(u)(y=>b(y))),t.attr.id(m),t.attr.role("switch"),t.attr.tabindex(t.computedOf(l??!1,p)((y,f)=>y?-1:f??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,s!=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")),s):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:r,disabled:a,max:o=5,fullColor:s="yellow",emptyColor:l="neutral",fullIcon:i=Nt,emptyIcon:c=St,size:u="md",onBlur:p,rounding:h=1}=e,m=()=>{const f=t.Value.get(h);return f>0?f:1},d=f=>Math.min(Math.max(f,0),t.Value.get(o)),b=(f,M)=>{if(t.Value.get(a??!1))return;const x=f.currentTarget.getBoundingClientRect(),g=(f.clientX-x.left)/x.width,w=M-1+g,$=m(),C=Math.ceil(w/$)*$,A=d(C);r?.(A)},I=f=>{if(t.Value.get(a??!1))return;const M=m(),_=t.Value.get(n)??0;let x;switch(f.key){case"ArrowRight":case"ArrowUp":x=d(_+M);break;case"ArrowLeft":case"ArrowDown":x=d(_-M);break;case"Home":x=0;break;case"End":x=t.Value.get(o);break;default:return}f.preventDefault(),r?.(x)},V=t.Value.map(u,f=>`bc-icon--${f}`),y=({index:f,counter:M})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(V),N.Icon({icon:c,size:u,color:l,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(V),t.style.width(t.Value.map(n,_=>{const x=Math.floor(_);return x>f?"100%":x<f?"0%":`${(_-f)*100}%`})),N.Icon({icon:i,size:u,color:s,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))),t.on.click(t.emit(_=>b(_,M),{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(a??!1,f=>f?-1:0)),t.aria.disabled(a??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(o,f=>f??0)),t.aria.valuenow(t.Value.map(n,f=>f??0)),t.aria.valuetext(t.computedOf(n,o)((f,M)=>{const _=f??0,x=M??0;return`${String(_)} / ${String(x)}`})),t.on.keydown(I),p!=null?t.on.blur(p):null,t.Repeat(o,y))})},Rt=e=>{const{value:n,onChange:r,onInput:a,onBlur:o,after:s,disabled:l,...i}=e,c=k.NullableResetAfter(n,l,r??a);return lt({...i,value:t.Value.map(n,u=>u??0),onChange:r,onInput:a,onBlur:o,after:s!=null?t.Fragment(c,s):c})},vt=e=>{const{value:n,step:r,min:a,max:o,onBlur:s,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(r),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),s!=null?t.on.blur(t.emitValueAsNumber(s)):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:r,min:a,max:o,onBlur:s,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(r),t.attr.valueAsNumber(c),t.attr.class("bc-input bc-slider-input"),s!=null?t.on.blur(t.emitValueAsNumber(s)):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,r){if(this.widgets.set(n,r),r.supportedTypes)for(const a of r.supportedTypes)this.typeMapping.has(a)||this.typeMapping.set(a,[]),this.typeMapping.get(a).push(n),this.typeMapping.get(a).sort((o,s)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(s)?.priority||0)-l})}unregister(n){const r=this.widgets.get(n);if(r&&(this.widgets.delete(n),r.supportedTypes))for(const a of r.supportedTypes){const o=this.typeMapping.get(a);if(o){const s=o.indexOf(n);s>=0&&o.splice(s,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 r=dt.resolveWidget(n.definition,n.name);if(r?.widget){const o=this.widgets.get(r.widget);if(o)return{name:r.widget,registration:o,resolved:r}}const a=[];for(const[o,s]of this.widgets.entries())if(s.matcher)try{s.matcher(n)&&a.push({name:o,registration:s,priority:s.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(a.length>0){a.sort((s,l)=>l.priority-s.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,s=this.getForType(o);if(s.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:s[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Bt=new it;function Ot(e,n,r){return{factory:n,matcher:a=>{const s=a.definition["x:ui"];return s===e||typeof s=="object"&&s!==null&&s.widget===e},displayName:r?.displayName??e,priority:r?.priority??100,...r}}function Ut(e,n,r){return{factory:n,matcher:a=>a.definition.format===e,displayName:r?.displayName??`${e} widget`,priority:r?.priority??75,...r}}function Wt(e,n,r,a){return{factory:r,matcher:o=>{const s=o.definition;return s.type===e&&s.format===n},displayName:a?.displayName??`${e}:${n} widget`,priority:a?.priority??80,...a}}function Ht(e){const n=e?.logPrefix??"WIDGET_DIAG",r=e?.filterFn??(()=>!0);return{factory:()=>null,displayName:"Diagnostic Widget (never matches)",priority:-1e3,matcher:a=>{if(!r(a))return!1;const o=a.definition,s={name:a.name,path:a.path.map(String),type:o?.type,hasRegistry:a.widgetRegistry!==void 0,definition:o};return console.log(`[${n}] name="${s.name??"ROOT"}" path=[${s.path.join(", ")}] type="${s.type??"unknown"}" hasRegistry=${s.hasRegistry}`),e?.onProcess?.(s),!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-CI1g9sjh.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-BDTfBGtx.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,r=e.match(n);if(!r)return!1;const[,a,o,s]=r,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(s,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,r=e.match(n);if(!r)return!1;const[,a,o,s,l]=r,i=parseInt(a,10),c=parseInt(o,10),u=parseInt(s,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,r=e.match(n);if(!r)return!1;const[,a,o,s]=r,l=parseInt(a,10),i=parseInt(o,10),c=parseInt(s,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(r=>r+r).join("")),`#${n.toLowerCase()}`}function W(e,n,r){const a=o=>{const s=Math.round(Math.max(0,Math.min(255,o))).toString(16);return s.length===1?"0"+s:s};return`#${a(e)}${a(n)}${a(r)}`}function E(e){const n=K(e);if(!n)return null;const r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null}function ht(e,n){const r=E(e),a=E(n);if(!r||!a)return null;const o=(u,p,h)=>{const[m,d,b]=[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*d+.0722*b},s=o(r.r,r.g,r.b),l=o(a.r,a.g,a.b),i=Math.max(s,l),c=Math.min(s,l);return(i+.05)/(c+.05)}function Q(e){if(!e)return[0,0,0,1];const r=e.trim().match(/^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/);if(r){const u=r[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),d=parseInt(u.slice(6,8),16)/255;return[p,h,m,d]}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),d=parseInt(u[3]+u[3],16)/255;return[p,h,m,d]}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 s=e.match(/^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i);if(s){const u=parseFloat(s[1]),p=parseFloat(s[2]),h=parseFloat(s[3]),m=s[4]!=null?parseFloat(s[4]):1,[d,b,I]=j(u,p/100,h/100);return[d,b,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,[d,b,I]=tt(u,p,h);return[d,b,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,d=u.endsWith("%")?Math.max(0,Math.min(1,parseFloat(u)/100)):Math.max(0,Math.min(1,parseFloat(u))),[b,I,V]=nt(d,p,h);return[b,I,V,m]}const c=E(e);return c?[c.r,c.g,c.b,1]:[0,0,0,1]}function Z(e,n,r,a){return`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${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,r){e=(e%360+360)%360;const a=(1-Math.abs(2*r-1))*n,o=a*(1-Math.abs(e/60%2-1)),s=r-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+s)*255),Math.round((i+s)*255),Math.round((c+s)*255)]}function tt(e,n,r){e=(e%360+360)%360;const a=n+r;a>1&&(n/=a,r/=a);const[o,s,l]=j(e,1,.5).map(h=>h/255),i=1-n-r,c=o*i+n,u=s*i+n,p=l*i+n;return[Math.round(c*255),Math.round(u*255),Math.round(p*255)]}function H(e,n,r){e/=255,n/=255,r/=255;const a=Math.max(e,n,r),o=Math.min(e,n,r);let s=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:s=(n-r)/c+(n<r?6:0);break;case n:s=(r-e)/c+2;break;default:s=(e-n)/c+4}s*=60}return[Math.round(s),Math.round(l*100),Math.round(i*100)]}function et(e,n,r){const[a]=H(e,n,r),o=e/255,s=n/255,l=r/255,i=Math.min(o,s,l),c=1-Math.max(o,s,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,r){const a=r*Math.PI/180,o=Math.cos(a)*n,s=Math.sin(a)*n,l=e+.3963377774*o+.2158037573*s,i=e-.1055613458*o-.0638541728*s,c=e-.0894841775*o-1.291485548*s,u=l*l*l,p=i*i*i,h=c*c*c,m=4.0767416621*u-3.3077115913*p+.2309699292*h,d=-1.2684380046*u+2.6097574011*p-.3413193965*h,b=-.0041960863*u-.7034186147*p+1.707614701*h;return[U(m),U(d),U(b)]}function at(e,n,r){const a=O(e),o=O(n),s=O(r),l=.4122214708*a+.5363325363*o+.0514459929*s,i=.2119034982*a+.6806995451*o+.1073969566*s,c=.0883024619*a+.2817188376*o+.6299787005*s,u=Math.cbrt(l),p=Math.cbrt(i),h=Math.cbrt(c),m=.2104542553*u+.793617785*p-.0040720468*h,d=1.9779984951*u-2.428592205*p+.4505937099*h,b=.0259040371*u+.7827717662*p-.808675766*h,I=Math.sqrt(d*d+b*b);let V=Math.atan2(b,d)*180/Math.PI;return V<0&&(V+=360),[m,I,V]}function R(e,n,r,a,o,s){switch(o){case"hex":if(s){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(r)}${l(i)}`}return W(e,n,r);case"rgb":return`rgb(${e}, ${n}, ${r})`;case"rgba":return`rgba(${e}, ${n}, ${r}, ${Math.round(a*100)/100})`;case"hsl":{const[l,i,c]=H(e,n,r);return`hsl(${l}, ${i}%, ${c}%)`}case"hsla":{const[l,i,c]=H(e,n,r);return`hsla(${l}, ${i}%, ${c}%, ${Math.round(a*100)/100})`}case"hwb":{const[l,i,c]=et(e,n,r);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,r),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 s||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,r)=>{const a=new FileReader;a.readAsDataURL(e),a.onload=()=>{const o=a.result;n(o.split(",")[1])},a.onerror=o=>r(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??""),r=n.length,a=new Uint8Array(r);for(let o=0;o<r;o++)a[o]=n.charCodeAt(o);return a}function st(e){const{value:n,onChange:r,onInput:a,...o}=e,s=new Map,l=t.Value.toSignal(n).map(p=>p.map((h,m)=>{const d=s.get(h),b=bt(h??""),I=d?.type||ft(b),V=d?.name??`file-${m}`,y=b.buffer.slice(b.byteOffset,b.byteOffset+b.byteLength),f=new Blob([y],{type:I});return new File([f],V,{type:I})})),i=p=>h=>{p&&mt(h).then(m=>{for(const[d,b]of m.entries())s.set(b,{name:h[d].name,type:h[d].type});p(m)})},c=i(r),u=i(a);return k.FilesInput({...o,value:l,onChange:c,onInput:u})}function yt(e){const{value:n,onInput:r,onChange:a,...o}=e;return st({...o,maxFiles:1,value:t.Value.map(n,s=>s==null?[]:[s]),onChange:s=>{a?.(s[0])},onInput:s=>{r?.(s[0])}})}function It(e,n){const[r,a,o]=e,s=r<<16^a<<8^o,l=J(s),i=6+Math.floor(l()*5),c=.18+l()*.06,u=[];for(let d=0;d<i;d++){const b=d/i*Math.PI*2,I=n*(1+(l()*2-1)*c),V=Math.cos(b)*I,y=Math.sin(b)*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 d=0;d<i;d++){const b=u[d],I=u[(d+1)%i],V=(b.x+I.x)/2,y=(b.y+I.y)/2;m+=` Q ${b.x.toFixed(3)} ${b.y.toFixed(3)} ${V.toFixed(3)} ${y.toFixed(3)}`}return m+=" Z",m}const wt=e=>{const{value:n,onBlur:r,onChange:a,onInput:o,displayValue:s,size:l,withAlpha:i}=e,c=t.Value.map(l??32,g=>g),u=t.Value.map(n,g=>Q(g??"#000000")),p=t.Value.map(u,([g,w,$])=>[g,w,$]),h=t.Value.map(u,([,,,g])=>g),m=t.prop(t.Value.get(h)??1),d=t.Value.map(i??!1,g=>g),b=t.Value.map(e.colorTextFormat??"rgb",g=>g),I=t.computedOf(p,m,b,d)(([g,w,$],C,A,T)=>R(g,w,$,C??1,v(A,T),T)),V=t.Value.map(e.colorTextFormat??"hex",g=>g),y=t.Value.map(c,g=>`${-g/2} ${-g/2} ${g} ${g}`),f=t.computedOf(p,c)((g,w)=>It(g,w/2)),M=t.computedOf(p,m,d)(([g,w,$],C,A)=>A||C<1?Z(g,w,$,C):W(g,w,$)),_=t.html.div(t.attr.class("bc-color-swatch-input__control"),t.attr.class(t.Value.map(d,g=>g?"bc-color-swatch-input__control--alpha":"")),t.attr.style(t.computedOf(c)(g=>`min-width:${g+2}px;height:${g+2}px`)),t.svg.svg(t.attr.class("bc-color-swatch-input__svg"),t.svgAttr.viewBox(y),t.svg.path(t.svgAttr.d(f),t.svgAttr.fill(M))),t.html.input(t.attr.type("color"),S.CommonInputAttributes(e),t.attr.value(t.Value.map(p,([g,w,$])=>W(g,w,$))),t.attr.class("bc-input bc-color-swatch-input bc-color-swatch-input__native"),r!=null?t.on.blur(r):t.Empty,a!=null?t.on.change(g=>{const w=g.target.value;if(!a)return;const{r:$,g:C,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(d)),L=R($,C,A,T,F,t.Value.get(d));a(L)}):t.Empty,o!=null?t.on.input(g=>{const w=g.target.value;if(!o)return;const{r:$,g:C,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(d)),L=R($,C,A,T,F,t.Value.get(d));o(L)}):t.Empty)),x=t.When(d,()=>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,g=>String(g??1))),t.attr.disabled(e.disabled),t.on.input(g=>{const w=parseFloat(g.target.value);m.set(w);const[$,C,A]=t.Value.get(p),T=v(t.Value.get(V),t.Value.get(d)),F=R($,C,A,w,T,t.Value.get(d));o?.(F)}),t.on.change(g=>{const w=parseFloat(g.target.value);m.set(w);const[$,C,A]=t.Value.get(p),T=v(t.Value.get(V),t.Value.get(d)),F=R($,C,A,w,T,t.Value.get(d));a?.(F)})));return D.InputContainer({baseContainer:!0,...e,growInput:!1,input:_,after:t.Fragment(t.When(s??!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:r,onBlur:a,onChange:o,onInput:s,after:l,disabled:i,...c}=n,u=k.NullableResetAfter(r,i,o??s);return e({...c,disabled:i,value:t.Value.map(r,ot),onChange:o!=null?p=>o(P(p)):void 0,onInput:s!=null?p=>s(P(p)):void 0,onBlur:a,after:l!=null?t.Fragment(u,l):u})}}const Vt=({startEditing:e,value:n,onChange:r,placeholder:a,disabled:o})=>{const s=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(s,()=>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"?s.set(!1):c.key==="Escape"&&(l.set(!0),s.set(!1))}),t.on.blur(t.emitValue(c=>{if(s.set(!1),l.value){l.set(!1);return}r(c)}))),()=>t.html.span(t.on.click(()=>{t.Value.get(i)||s.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(()=>s.set(!0)),N.Icon({icon:"line-md/pencil",color:"neutral"}))))))},Mt=e=>{const{value:n,onBlur:r,onChange:a,onInput:o,after:s,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"),r!=null?t.on.blur(t.emitValue(r)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDate(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDate(o)):t.Empty),after:s!=null?t.Fragment(i,s):i})},$t=e=>{const n=e.getFullYear(),r=e.getMonth()+1,a=e.getDate(),o=e.getHours(),s=e.getMinutes(),l=e.getSeconds();return`${n}-${r.toString().padStart(2,"0")}-${a.toString().padStart(2,"0")}T${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`},xt=e=>{const{value:n,onBlur:r,onChange:a,onInput:o,after:s,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"),r!=null?t.on.blur(t.emitValue(r)):t.Empty,a!=null?t.on.change(t.emitValueAsNullableDateTime(a)):t.Empty,o!=null?t.on.input(t.emitValueAsNullableDateTime(o)):t.Empty),after:s!=null?t.Fragment(c,s):c})},_t=B(z.EmailInput),Ct=B(S.TextInput),At=B(z.PasswordInput),Tt=B(k.TextArea),kt=({value:e,onChange:n,onInput:r,onBlur:a,offLabel:o,onLabel:s,disabled:l=!1,size:i="md",id:c,color:u="primary",tabIndex:p=0,matchInputHeight:h=!0})=>{const m=c??pt.sessionId("switch");function d(y,f){const M=["bc-switch",`bc-switch--size-${f}`,`bc-switch--${f}`];return h&&M.push("bc-switch--match-input"),y&&M.push("bc-switch--disabled"),M.join(" ")}function b(y){const f=y??"primary",M=new Map,_=N.backgroundValue(f,"solid","light"),x=N.backgroundValue(f,"solid","dark");return M.set("--switch-track-on-bg",_.backgroundColor),M.set("--switch-track-on-label",_.textColor),M.set("--switch-track-on-bg-dark",x.backgroundColor),M.set("--switch-track-on-label-dark",x.textColor),M.set("--switch-track-on-border-dark",N.borderColorValue(f,"dark")),Array.from(M.entries()).map(([g,w])=>`${g}: ${w}`).join("; ")}const I=()=>{t.Value.get(l)||(n?.(!t.Value.get(e)),r?.(!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,f)=>d(y??!1,f??"md"))),t.attr.style(t.computedOf(u)(y=>b(y))),t.attr.id(m),t.attr.role("switch"),t.attr.tabindex(t.computedOf(l??!1,p)((y,f)=>y?-1:f??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,s!=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")),s):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:r,disabled:a,max:o=5,fullColor:s="yellow",emptyColor:l="neutral",fullIcon:i=Nt,emptyIcon:c=St,size:u="md",onBlur:p,rounding:h=1}=e,m=()=>{const f=t.Value.get(h);return f>0?f:1},d=f=>Math.min(Math.max(f,0),t.Value.get(o)),b=(f,M)=>{if(t.Value.get(a??!1))return;const x=f.currentTarget.getBoundingClientRect(),g=(f.clientX-x.left)/x.width,w=M-1+g,$=m(),C=Math.ceil(w/$)*$,A=d(C);r?.(A)},I=f=>{if(t.Value.get(a??!1))return;const M=m(),_=t.Value.get(n)??0;let x;switch(f.key){case"ArrowRight":case"ArrowUp":x=d(_+M);break;case"ArrowLeft":case"ArrowDown":x=d(_-M);break;case"Home":x=0;break;case"End":x=t.Value.get(o);break;default:return}f.preventDefault(),r?.(x)},V=t.Value.map(u,f=>`bc-icon--${f}`),y=({index:f,counter:M})=>t.html.span(t.attr.class("bc-rating-input__icon-container"),t.attr.class(V),N.Icon({icon:c,size:u,color:l,tone:"soft"},t.attr.class("bc-rating-input__icon-empty")),t.html.span(t.attr.class("bc-rating-input__icon-clipper"),t.attr.class(V),t.style.width(t.Value.map(n,_=>{const x=Math.floor(_);return x>f?"100%":x<f?"0%":`${(_-f)*100}%`})),N.Icon({icon:i,size:u,color:s,tone:"soft"},t.attr.class("bc-rating-input__icon-full"))),t.on.click(t.emit(_=>b(_,M),{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(a??!1,f=>f?-1:0)),t.aria.disabled(a??!1),t.aria.valuemin(0),t.aria.valuemax(t.Value.map(o,f=>f??0)),t.aria.valuenow(t.Value.map(n,f=>f??0)),t.aria.valuetext(t.computedOf(n,o)((f,M)=>{const _=f??0,x=M??0;return`${String(_)} / ${String(x)}`})),t.on.keydown(I),p!=null?t.on.blur(p):null,t.Repeat(o,y))})},Rt=e=>{const{value:n,onChange:r,onInput:a,onBlur:o,after:s,disabled:l,...i}=e,c=k.NullableResetAfter(n,l,r??a);return lt({...i,value:t.Value.map(n,u=>u??0),onChange:r,onInput:a,onBlur:o,after:s!=null?t.Fragment(c,s):c})},vt=e=>{const{value:n,step:r,min:a,max:o,onBlur:s,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(r),t.attr.valueAsNumber(n),t.attr.class("bc-input bc-slider-input"),s!=null?t.on.blur(t.emitValueAsNumber(s)):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:r,min:a,max:o,onBlur:s,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(r),t.attr.valueAsNumber(c),t.attr.class("bc-input bc-slider-input"),s!=null?t.on.blur(t.emitValueAsNumber(s)):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,r){if(this.widgets.set(n,r),r.supportedTypes)for(const a of r.supportedTypes)this.typeMapping.has(a)||this.typeMapping.set(a,[]),this.typeMapping.get(a).push(n),this.typeMapping.get(a).sort((o,s)=>{const l=this.widgets.get(o)?.priority||0;return(this.widgets.get(s)?.priority||0)-l})}unregister(n){const r=this.widgets.get(n);if(r&&(this.widgets.delete(n),r.supportedTypes))for(const a of r.supportedTypes){const o=this.typeMapping.get(a);if(o){const s=o.indexOf(n);s>=0&&o.splice(s,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 r=dt.resolveWidget(n.definition,n.name);if(r?.widget){const o=this.widgets.get(r.widget);if(o)return{name:r.widget,registration:o,resolved:r}}const a=[];for(const[o,s]of this.widgets.entries())if(s.matcher)try{s.matcher(n)&&a.push({name:o,registration:s,priority:s.priority??0})}catch(l){console.warn(`Error in matcher for widget "${o}":`,l)}if(a.length>0){a.sort((s,l)=>l.priority-s.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,s=this.getForType(o);if(s.length>0){const l=this.typeMapping.get(o)[0];return{name:l,registration:s[0],resolved:{widget:l,source:"type-fallback"}}}}return null}}const Bt=new it;function Ot(e,n,r){return{factory:n,matcher:a=>{const s=a.definition["x:ui"];return s===e||typeof s=="object"&&s!==null&&s.widget===e},displayName:r?.displayName??e,priority:r?.priority??100,...r}}function Ut(e,n,r){return{factory:n,matcher:a=>a.definition.format===e,displayName:r?.displayName??`${e} widget`,priority:r?.priority??75,...r}}function Wt(e,n,r,a){return{factory:r,matcher:o=>{const s=o.definition;return s.type===e&&s.format===n},displayName:a?.displayName??`${e}:${n} widget`,priority:a?.priority??80,...a}}function Ht(e){const n=e?.logPrefix??"WIDGET_DIAG",r=e?.filterFn??(()=>!0);return{factory:()=>null,displayName:"Diagnostic Widget (never matches)",priority:-1e3,matcher:a=>{if(!r(a))return!1;const o=a.definition,s={name:a.name,path:a.path.map(String),type:o?.type,hasRegistry:a.widgetRegistry!==void 0,definition:o};return console.log(`[${n}] name="${s.name??"ROOT"}" path=[${s.path.join(", ")}] type="${s.type??"unknown"}" hasRegistry=${s.hasRegistry}`),e?.onProcess?.(s),!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-gVgMyNno.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:"字号",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:"输入网址:"},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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./translations-Cy9hoMGV.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:"字号",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 i } from "./translations-uEUkO6gJ.js";
1
+ import { f as a } from "./translations-CiBhB2FV.js";
2
2
  const d = {
3
3
  loadingExtended: "正在加载,请稍候",
4
4
  loadingShort: "加载中...",
@@ -63,10 +63,10 @@ const d = {
63
63
  if (e || o) {
64
64
  const t = [];
65
65
  if (e != null && e > 1 && t.push(`最多${e}个文件`), o && n) {
66
- const a = i(o, {
66
+ const i = a(o, {
67
67
  units: n
68
68
  });
69
- t.push(`每个最大${a}`);
69
+ t.push(`每个最大${i}`);
70
70
  }
71
71
  t.length > 0 && (l += ` (${t.join(",")})`);
72
72
  }
@@ -144,7 +144,15 @@ const d = {
144
144
  noCommandsFound: "未找到命令",
145
145
  changeBlockType: "更改块类型",
146
146
  blockTypes: "块类型",
147
- enterUrl: "输入网址:"
147
+ enterUrl: "输入网址:",
148
+ tableActions: "Table actions",
149
+ insertRowAbove: "Insert row above",
150
+ insertRowBelow: "Insert row below",
151
+ insertColumnLeft: "Insert column left",
152
+ insertColumnRight: "Insert column right",
153
+ deleteRow: "Delete row",
154
+ deleteColumn: "Delete column",
155
+ deleteTable: "Delete table"
148
156
  },
149
157
  // prosemirror
150
158
  prosemirror: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/beatui",
3
- "version": "0.90.0",
3
+ "version": "0.91.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
@@ -1 +0,0 @@
1
- "use strict";const t=require("@tempots/dom"),w=require("./translations-gVgMyNno.cjs"),It=require("./colors-BI0YhONJ.cjs"),Vt=require("./timer-BJHOsuS6.cjs"),Ct=require("@tempots/ui"),B=require("./input-container-B31Seozh.cjs"),M=require("./use-form-i97PToWB.cjs"),L=require("./text-input-w0eVcqk5.cjs"),st=require("./stack-4VUGISn6.cjs");let Y=null;async function Z(){const n=globalThis;return n.Temporal?n.Temporal:(Y||(Y=Promise.resolve().then(()=>require("./index.esm-C6lZ02yY.cjs")).then(e=>{const l=e.Temporal;return n.Temporal||(n.Temporal=l),l})),Y)}const it=(n,e)=>e?t.Task(Z,{then:n,pending:e.pending,error:e.error}):t.Task(Z,n);function q({onChange:n,value:e,accept:l="*/*",enableClick:r=!0,content:o,disabled:m=!1,allowMultiple:a}){return t.Use(w.BeatUII18n,h=>{const p=t.Value.deriveProp(e??[]),b=t.prop(!1),f=c=>{c.preventDefault(),c.stopPropagation(),b.value=!0},d=c=>{c.preventDefault(),c.stopPropagation(),(!c.currentTarget||!c.currentTarget.contains(c.relatedTarget))&&(b.value=!1)},v=c=>{c.preventDefault(),c.stopPropagation(),b.value=!1;const g=Array.from(c.dataTransfer?.files||[]);g.length>0&&(p.value=g,n(g,"dragdrop"))},s=c=>{t.Value.get(r)&&c.currentTarget.querySelector('input[type="file"]')?.click()};let u=null;const V=()=>{if(u==null)return;const c=Array.from(u.files??[]);c.length>0&&(p.value=c,n(c,"click")),u.value=""},k=c=>{t.Value.get(r)&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),s(c))};return t.html.div(t.attr.role("button"),t.attr.tabindex(t.Value.map(r,c=>c?0:-1)),t.attr.style("position: relative;"),t.on.dragover(f),t.on.dragleave(d),t.on.drop(v),t.on.click(s),t.on.keydown(k),t.html.input(t.attr.type("file"),t.attr.disabled(m),t.attr.accept(l),t.attr.multiple(a),t.attr.style("position: absolute; left: -9999px; opacity: 0; pointer-events: none;"),t.on.change(V),t.WithElement(c=>(u=c,p.on(g=>{const _=globalThis.DataTransfer;if(_!=null){const C=new _;g.forEach(O=>C.items.add(O)),c.files=C.files}}),t.Empty))),t.aria.label(t.bind(h.$.dropZoneInstructions)(r)),o({files:p,clear:()=>p.value=[],change:p.set}))})}function wt(n,e){return n.length===e.length&&n.every((l,r)=>l===e[r])}function _t(n,e,l){const r=["bc-segmented-input",`bc-segmented-input--size-${n}`];return l==="squared"&&r.push("bc-segmented-input--squared"),e&&r.push("bc-segmented-input--disabled"),r.join(" ")}function kt(n){if(n==null)return"";const e=new Map,l=w.backgroundValue(n,"solid","light"),r=w.backgroundValue(n,"solid","dark");return e.set("--si-indicator-bg",l.backgroundColor),e.set("--si-active-text",l.textColor),e.set("--si-indicator-bg-dark",r.backgroundColor),e.set("--si-active-text-dark",r.textColor),Array.from(e.entries()).map(([o,m])=>`${o}: ${m}`).join("; ")}function Dt({options:n,value:e,onChange:l,size:r="md",disabled:o=!1,variant:m="pill",color:a},...h){const p=It.l(n).map(([b,f])=>({key:b,label:f}));return t.WithElement(()=>{const b=Object.fromEntries(p.map((d,v)=>[d.key,v])),f=t.prop(p.map(()=>({left:0,width:0})),wt);return t.html.div(t.attr.class(t.computedOf(r,o,m)((d,v,s)=>_t(d??"md",v??!1,s??"pill"))),t.attr.style(a!=null?t.Value.map(a,d=>kt(d)):""),t.html.div(t.attr.class("bc-segmented-input__container"),t.html.div(t.attr.class("bc-segmented-input__indicator"),t.style.width(t.computedOf(e,f)((d,v)=>{const{width:s}=v[b[d]??0];return`${s}px`})),t.style.left(t.computedOf(e,f)((d,v)=>{const{left:s}=v[b[d]??0];return`${s}px`}))),p.map(({label:d,key:v},s)=>t.html.button(t.attr.type("button"),t.on.click(u=>{u.preventDefault(),t.Value.get(o)||l?.(v)}),t.attr.disabled(o),t.attr.class("bc-segmented-input__segment"),t.attr.class(t.Value.map(e,u=>u===v?"bc-segmented-input__segment--active":"bc-segmented-input__segment--inactive")),Ct.ElementRect(u=>{function V(){f.update(c=>{const g=[...c];return g[s]={width:u.value.width,left:u.value.localLeft},g})}const k=Vt.g(V);return t.OnDispose(k,u.on(V))}),d))),...h)})}function Et(n){const e=n.type.toLowerCase();return e.startsWith("image/")&&(e.includes("jpeg")||e.includes("jpg")||e.includes("png")||e.includes("gif")||e.includes("webp")||e.includes("svg"))}function Ut(n){const e=n.type.toLowerCase();return e.startsWith("image/")?"vscode-icons:file-type-image":e.startsWith("video/")?"vscode-icons:file-type-video":e.startsWith("audio/")?"vscode-icons:file-type-audio":e.includes("pdf")?"vscode-icons:file-type-pdf2":e.includes("word")||e.includes("document")?"vscode-icons:file-type-word":e.includes("excel")||e.includes("spreadsheet")?"vscode-icons:file-type-excel":e.includes("powerpoint")||e.includes("presentation")?"vscode-icons:file-type-powerpoint":e.includes("zip")||e.includes("archive")?"vscode-icons:file-type-zip":e.includes("text")?"vscode-icons:file-type-text":e.includes("json")?"vscode-icons:file-type-json-official":e.includes("csv")?"vscode-icons:file-type-csv":e.includes("xml")?"vscode-icons:file-type-xml":e.includes("yaml")?"vscode-icons:file-type-yaml-official":"vscode-icons:file-type-binary"}function G(n){return t.When(n.map(Et),()=>{const e=t.prop(null);return n.on(l=>{e.value&&URL.revokeObjectURL(e.value);const r=URL.createObjectURL(l);e.value=r}),t.html.div(t.OnDispose(()=>{e.value&&URL.revokeObjectURL(e.value)}),t.attr.class("bc-file-input__thumbnail-container"),t.html.img(t.attr.src(e),t.attr.alt(n.map(l=>l.name)),t.attr.class("bc-file-input__thumbnail")))},()=>w.Icon({icon:n.map(Ut)}))}const Ot=(n,...e)=>{const{value:l=t.prop([]),accept:r="*/*",maxFiles:o,maxFileSize:m,onChange:a,onBlur:h,disabled:p,hasError:b,mode:f="default",showFileList:d=!0,...v}=n,s=l,u=t.Value.map(f,I=>I==="input"),V=t.Value.map(f,I=>I==="compact"),k=I=>{let i=I;if(o!=null){const x=t.Value.get(o);i=i.slice(0,x)}if(m){const x=t.Value.get(m);i=i.filter(D=>D.size<=x)}a?.(i)},c=I=>{const x=s.value.filter((D,E)=>E!==I);a?.(x)},g=()=>{a?.([])},_=({files:I,clear:i,change:x})=>t.Use(w.BeatUII18n,D=>t.html.div(t.attr.class("bc-file-input__drop-zone"),t.html.div(t.attr.class("bc-file-input__drop-zone-content bc-file-input__drop-zone-content--empty"),w.Icon({icon:"mdi:cloud-upload-outline",size:"xl"}),t.html.div(t.attr.class("bc-file-input__drop-zone-text"),t.bind(D.$.filesInputInstructions)(o,m,D.$.fileSizeUnits.value))))),C=({files:I})=>t.Use(w.BeatUII18n,i=>t.html.div(t.attr.class("bc-file-input__compact-drop-zone"),t.When(I.map(x=>x.length>0),()=>t.html.div(t.attr.class("bc-file-input__compact-file-list"),t.ForEach(I,(x,D)=>{const E=D.index;return t.html.div(t.attr.class("bc-file-input__compact-file-item"),t.html.div(t.attr.class("bc-file-input__compact-file-icon"),G(x)),t.html.div(t.attr.class("bc-file-input__compact-file-info"),t.html.div(t.attr.class("bc-file-input__compact-file-name"),t.attr.title(x.$.name),x.$.name),t.html.div(t.attr.class("bc-file-input__compact-file-meta"),t.computedOf(x.$.size,i.$.fileSizeUnits)((y,U)=>w.formatFileSize(y,{units:U}))," • ",t.computedOf(x.$.type,i.$.unknownType)((y,U)=>y||U))),M.CloseButton({size:"sm",label:i.$.removeFile,disabled:p,onClick:()=>c(E)},t.attr.class("bc-file-input__compact-remove-button")))})),()=>t.html.div(t.attr.class("bc-file-input__compact-placeholder"),w.Icon({icon:"mdi:cloud-upload-outline",size:"lg"}),t.html.div(t.attr.class("bc-file-input__compact-placeholder-text"),t.bind(i.$.filesInputInstructions)(o,m,i.$.fileSizeUnits.value)))))),O=({files:I})=>t.Use(w.BeatUII18n,i=>t.html.div(t.attr.class("bc-file-input__compact-input"),t.When(I.map(x=>x.length>0),()=>t.html.span(t.attr.class("bc-file-input__compact-value"),t.ForEach(I,x=>t.html.span(t.attr.class("bc-file-input__compact-value-item"),G(x),t.html.span(t.attr.class("bc-file-input__compact-value-item-name"),x.$.name)))),()=>t.html.span(t.attr.class("bc-file-input__compact-placeholder"),w.Icon({icon:"mdi:cloud-upload-outline",size:"md"})," ",t.bind(i.$.filesInputInstructions)(o,m,i.$.fileSizeUnits.value)))));return t.Use(w.BeatUII18n,I=>B.InputContainer({baseContainer:t.Value.map(u,i=>!i),disabled:p,hasError:b,after:t.When(u,()=>t.When(s.map(({length:i})=>i>0),()=>M.CloseButton({size:"sm",label:I.$.clearAllFiles,disabled:p,onClick:g},t.attr.class("bc-file-input__compact-clear")))),...v,input:t.When(u,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--input"),q({value:s,accept:r,enableClick:!0,allowMultiple:t.Value.map(o??1/0,i=>i>1),disabled:p,onChange:k,content:O})),()=>t.When(V,()=>t.html.div(t.attr.class("bc-file-input bc-file-input--compact"),q({value:s,accept:r,enableClick:!0,allowMultiple:t.Value.map(o??1/0,i=>i>1),disabled:p,onChange:k,content:C})),()=>t.html.div(t.attr.class("bc-file-input"),q({value:s,accept:r,enableClick:!0,allowMultiple:t.Value.map(o??1/0,i=>i>1),disabled:p,onChange:k,content:_}),t.When(d,()=>t.NotEmpty(s,()=>t.Fragment(t.html.div(t.attr.class("bc-file-input__file-list"),t.ForEach(s,(i,x)=>{const D=x.index;return t.html.div(t.attr.class("bc-file-input__file-item"),t.html.div(t.attr.class("bc-file-input__file-icon"),G(i)),t.html.div(t.attr.class("bc-file-input__file-info"),t.html.div(t.attr.class("bc-file-input__file-name"),t.attr.title(i.$.name),i.$.name),t.html.div(t.attr.class("bc-file-input__file-meta"),t.computedOf(i.$.size,I.$.fileSizeUnits)((E,y)=>w.formatFileSize(E,{units:y}))," • ",t.computedOf(i.$.type,I.$.unknownType)((E,y)=>E||y))),M.CloseButton({size:"sm",label:I.$.removeFile,disabled:p,onClick:()=>c(D)},t.attr.class("bc-file-input__remove-button")))})),t.When(s.map(({length:i})=>i>1),()=>t.html.div(t.attr.class("bc-file-input__clear-all-button-container"),t.html.button(t.attr.type("button"),t.attr.class("bc-file-input__clear-all-button"),t.attr.disabled(p),I.$.clearAllFiles,t.on.click(i=>{i.preventDefault(),i.stopPropagation(),g()}))))))))))},...e))},X="$$tts-exp-",ut=(n,e)=>t.WithElement(l=>{const r=`${X}${n}`;return t.OnDispose(t.Value.on(e,o=>Reflect.set(l,r,o)))}),Mt=(n,e)=>{const l=`${X}${n}`;return r=>{e(Reflect.get(r.target,l))}},ct=(n,e)=>{const l=`${X}${n}`;return r=>{const o=r.target,m=o.selectedIndex,a=o.options[m];e(Reflect.get(a,l))}};function J(...n){return t.html.div(t.attr.class("bc-group"),...n)}const pt=(n,e,l)=>t.Ensure(n,r=>t.OneOfType(r,{value:o=>{const m=t.computedOf(o,l)((a,h)=>e(a.value,h));return t.html.option(t.attr.selected(m),ut("value",o.$.value),o.$.label)},group:o=>t.html.optgroup(t.attr.label(o.$.group),t.ForEach(o.$.options,m=>pt(m,e,l))),break:()=>t.html.hr()})),ft=n=>{const{value:e,onBlur:l,onChange:r,options:o,unselectedLabel:m,equality:a=(b,f)=>b===f,after:h}=n;let p;return B.InputContainer({...n,after:t.Fragment(B.InputIcon({icon:"ph:caret-down-bold",color:"neutral",size:"sm"}),h),input:t.html.select(t.WithElement(b=>{p=b;const f=new MutationObserver(d=>{const{removedNodes:v}=d[0];v.length>0&&(p.selectedIndex=0)});return f.observe(b,{childList:!0}),t.OnDispose(()=>f.disconnect())}),L.CommonInputAttributes(n),t.attr.class("bc-native-select bc-input"),t.Use(w.BeatUII18n,b=>t.html.option(t.attr.hidden("hidden"),t.coalesce(m,b.$.selectOne))),t.ForEach(o,b=>pt(b,a,e)),l!=null?t.on.blur(l):t.Empty,r!=null?t.on.change(ct("value",b=>r(b))):t.Empty)},t.on.click(()=>{if(p?.focus(),typeof p?.showPicker=="function")try{p.showPicker()}catch{}}))};function dt(n){const{controller:e,onChange:l,onBlur:r,...o}=n;return ft({...o,value:e.signal,onChange:M.makeOnChangeHandler(e,l),onBlur:M.makeOnBlurHandler(e,r)})}function $t(n){return M.InputWrapper({...n,content:dt(n)})}function mt(n,e,l){const r=n.length.map(o=>o);return t.Repeat(r,o=>{const m=n.item(o.index),a=[];return t.Fragment(t.OnDispose(()=>{a.forEach(h=>h())}),e({list:n,item:m,position:o,remove:()=>n.removeAt(o.index),move:h=>{switch(h){case"up":if(o.index===0)return;n.move(o.index,o.index-1);break;case"down":if(o.index===n.length.value-1)return;n.move(o.index,o.index+1);break;case"first":n.move(o.index,0);break;case"last":n.move(o.index,n.length.value-1)}},canMove:h=>{const p=(()=>{switch(h){case"up":return t.signal(o.index>0);case"down":return n.length.map(b=>o.index<b-1)}})();return a.push(()=>p.dispose()),p},cannotMove:h=>{const p=(()=>{switch(h){case"up":return t.signal(o.index===0);case"down":return n.length.map(b=>o.index===b-1)}})();return a.push(()=>p.dispose()),p}}))},l)}const nt={9:{pattern:/^[0-9]$/},A:{pattern:/^[A-Za-z]$/,transform:n=>n.toUpperCase()},"*":{pattern:/^.$/}},Bt=n=>n instanceof RegExp;function ht(n,e,l){if(n==null)return[];const r=l?{...nt,...e}:e??nt,o=(a,h)=>{const p=r[h];p?a.push({type:"pattern",name:h,...p}):a.push({type:"literal",char:h})},m=[];if(typeof n=="string"){for(const a of n)o(m,a);return m}for(const a of n)if(typeof a=="string")if(a.length<=1)o(m,a);else for(const h of a)o(m,h);else Bt(a)?m.push({type:"pattern",pattern:a}):typeof a=="object"&&a&&m.push(a);return m}function St(n,e){return l=>{switch(n){case"digits":return/[0-9]/.test(l);case"letters":return/[A-Za-z]/.test(l);case"alphanumeric":return/[A-Za-z0-9]/.test(l);case"custom":return e?.(l)??!0;default:return!0}}}function lt(n,e,l,r,o,m){const a={raw:n,previousConformed:e,cursor:o??n.length,completed:!1},h=r.definitions??{},p=typeof l=="function"?l(n,a):l,b=ht(p,h,r.useDefaultDefinitions??!0),f=St(r.allowMode,r.allow),d=new Set;for(const y of b)y.type==="literal"&&d.add(y.char);if(r.prefix)for(const y of r.prefix)d.add(y);if(r.suffix)for(const y of r.suffix)d.add(y);const v=Array.from(n).filter(y=>f(y)&&!d.has(y));if(v.length===0)return{value:"",cursor:0,completed:!1};const s=[],u=[];let V=0,k=0,c=0,g=-1;for(const y of b){if(y.type==="literal"){s.push(y.char),u.push({kind:"literal",filled:!0});continue}k+=y.optional?0:1;const U=v[V];if(U==null)break;if(y.type==="any"){c++,s.push(y.transform?y.transform(U):U),u.push({kind:"slot",filled:!0}),g=u.length-1,V++;continue}if(y.type==="pattern")if(y.pattern.test(U)){c++;const S=y.transform?y.transform(U):U;s.push(S),u.push({kind:"slot",filled:!0}),g=u.length-1,V++}else{V++;continue}}const _=s.join(""),C=(r.prefix??"")+_+(r.suffix??"");let I=(r.prefix??"").length;if(g>=0){let y=g+1;if((m?.policy??"smart")!=="sticky")for(;y<u.length&&u[y].kind==="literal";)y++;I+=y}const i=r.completion?.mode==="min"?(r.completion.minChars??0)<=c:r.completion?.mode==="custom"?!!r.completion.isComplete?.(C):k>0&&c>=k,x=r.pipe?.(C,{...a,completed:i});let D,E=I;return x===!1?(D=e,E=e.length):typeof x=="string"?(D=x,E=x.length):typeof x=="object"&&x?(D=x.value,E=x.cursor??x.value.length):D=C,{value:D,cursor:E,completed:i}}function Tt(n,e){const l=e?.strategy??"none";return l==="custom"&&e?.unmask?e.unmask(n):l==="strip"?n.replace(/[^A-Za-z0-9]/g,""):n}const Q=n=>{const{value:e,onBlur:l,onChange:r,onInput:o,onAccept:m,onComplete:a,mask:h,definitions:p,useDefaultDefinitions:b,extraLiterals:f,prefix:d,suffix:v,autofix:s,pipe:u,completion:V,unmask:k,allowMode:c,allow:g,placeholder:_,placeholderOptions:C}=n,O=t.computedOf(e,h,p,b,f,d,v,s,V,k,c,_,C)((i,x,D,E,y,U,S,W,R,N,A,P,T)=>x?lt(i??"","",x,{definitions:D??{},useDefaultDefinitions:E??!0,extraLiterals:y??[],autofix:W??"none",completion:R??{mode:"mask"},pipe:u??($=>$),unmask:N??{strategy:"none"},allowMode:A??"all",allow:g,prefix:U,suffix:S}).value:i??""),I=(i,x)=>{const D=i.value??"",E=t.Value.get(e)??"",y=h!=null?t.Value.get(h):null,U=p!=null?t.Value.get(p):void 0,S=b!=null?t.Value.get(b):void 0,W=f!=null?t.Value.get(f):void 0,R=s!=null?t.Value.get(s):void 0,N=V!=null?t.Value.get(V):void 0,A=k!=null?t.Value.get(k):void 0,P=c!=null?t.Value.get(c):void 0,T=d!=null?t.Value.get(d):void 0,$=v!=null?t.Value.get(v):void 0,{value:F,cursor:H,completed:tt}=y?lt(D,E,y,{definitions:U??{},useDefaultDefinitions:S??!0,extraLiterals:W??[],autofix:R??"none",completion:N??{mode:"mask"},pipe:u??(yt=>yt),unmask:A??{strategy:"none"},allowMode:P??"all",allow:g,prefix:T,suffix:$},i.selectionStart??D.length,n.cursor?t.Value.get(n.cursor):void 0):{value:D,cursor:D.length,completed:!0};if(F!==D){i.value=F;try{i.setSelectionRange(H,H)}catch{}}const et=Tt(F,A);m?.({raw:et,conformed:F,completed:tt,cursor:H}),x==="input"?o?.(F):(r?.(F),tt&&a?.({raw:et,conformed:F}))};return B.InputContainer({...n,input:t.input.text(L.CommonInputAttributes(n),t.attr.value(O),t.attr.class("bc-input"),l!=null?t.on.blur(l):t.Empty,t.WithElement(i=>i instanceof HTMLInputElement?t.Fragment(t.on.input(()=>I(i,"input")),t.on.change(()=>I(i,"change")),t.on.keydown(x=>{if(x.key!=="Backspace"||!(n.cursor?t.Value.get(n.cursor)?.backspaceRubberBand??!0:!0))return;const E=i.selectionStart??0,y=i.selectionEnd??E;if(E!==y||E<=0)return;const U=i.value??"",S=h!=null?t.Value.get(h):null;if(!S)return;const W=p!=null?t.Value.get(p):void 0,R=b!=null?t.Value.get(b):!0,N=d!=null?t.Value.get(d):void 0,A=v!=null?t.Value.get(v):void 0,P=ht(typeof S=="function"?S(U,{raw:U,previousConformed:U,cursor:E,completed:!1}):S,W??{},R??!0),T=new Set;for(const $ of P)$.type==="literal"&&T.add($.char);if(N)for(const $ of N)T.add($);if(A)for(const $ of A)T.add($);if(T.has(U[E-1])){let $=E-1;for(;$>=0&&T.has(U[$]);)$--;$>=0&&(x.preventDefault(),x.stopPropagation(),i.value=U.slice(0,$)+U.slice($+1),I(i,"input"))}})):t.Empty))})};function K(n,e,l){const r=t.Value.map(n,a=>a!=null),o=t.computedOf(r,e??!1)((a,h)=>!a||h),m=w.defaultMessages.clearValue;return t.html.button(t.attr.type("button"),t.attr.class("bc-input-container__reset"),t.aria.label(m),t.attr.title(m),t.attr.disabled(o),w.Icon({icon:"mdi:close",size:"sm"}),t.on.click(a=>{a.stopPropagation(),l?.(null)}))}const At=n=>{const{value:e,onBlur:l,onChange:r,onInput:o,rows:m}=n;return B.InputContainer({baseContainer:!0,...n,input:t.html.textarea(t.attr.class(t.computedOf(n.size??"md")(a=>B.generateInputContainerInputClasses(!1,a??"md"))),L.CommonInputAttributes(n),t.attr.rows(m??3),t.attr.value(e),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,r!=null?t.on.change(t.emitValue(r)):t.Empty,o!=null?t.on.input(t.emitValue(o)):t.Empty)})};function Ft(n){const e=String(n),l=e.indexOf(".");return l===-1?0:e.length-l-1}function z(n,e){const l=Ft(e);if(l===0)return Math.round(n);const r=Math.pow(10,l);return Math.round(n*r)/r}const zt=n=>{const{value:e,step:l,min:r,max:o,onBlur:m,onChange:a,onInput:h,after:p}=n,b=v=>{const s=r!=null?t.Value.get(r):void 0,u=o!=null?t.Value.get(o):void 0;return s!=null&&v<s?s:u!=null&&v>u?u:v},f=l!=null?t.Use(w.BeatUII18n,v=>{const s=t.computedOf(e,r)((c,g)=>g==null?!0:(c??0)>g),u=t.computedOf(e,o)((c,g)=>g==null?!0:(c??0)<g),V=c=>{const g=t.Value.get(e)??0,_=t.Value.get(l),C=c?.shiftKey?10:1,O=z(g-_*C,_),I=r!=null?t.Value.get(r):void 0;if(I!=null&&O<I)return;const i=b(O);i!==g&&a&&a(i)},k=c=>{const g=t.Value.get(e)??0,_=t.Value.get(l),C=c?.shiftKey?10:1,O=z(g+_*C,_),I=o!=null?t.Value.get(o):void 0;if(I!=null&&O>I)return;const i=b(O);i!==g&&a&&a(i)};return st.Stack(t.attr.class("bc-number-input-steppers"),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(u,n.disabled??!1)((c,g)=>!c||g)),t.on.click(c=>k(c)),t.aria.label(v.$.incrementValue),w.Icon({icon:"line-md:plus",size:"xs"})),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"),t.attr.disabled(t.computedOf(s,n.disabled??!1)((c,g)=>!c||g)),t.on.click(c=>V(c)),t.aria.label(v.$.decrementValue),w.Icon({icon:"line-md:minus",size:"xs"})))}):null,d=p!=null&&f!=null?t.Fragment(f,p):p??f;return B.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,o!=null?t.attr.max(o):t.Empty,L.CommonInputAttributes(n),t.attr.valueAsNumber(e),t.attr.step(l),t.attr.class("bc-input bc-number-input"),m!=null?t.on.blur(t.emitValue(m)):t.Empty,a!=null?t.on.change(t.emitValueAsNumber(a)):t.Empty,h!=null?t.on.input(t.emitValueAsNumber(h)):t.Empty,l!=null?t.on.wheel(v=>{v.preventDefault();const s=t.Value.get(e)??0,u=t.Value.get(l),V=v.shiftKey?10:1,k=v.deltaY<0?u*V:-u*V,c=b(z(s+k,u));c!==s&&a&&a(c)}):t.Empty),after:d})},rt=n=>{if(n==null||n==="")return null;const e=Number(n);return Number.isNaN(e)?null:e},Lt=n=>{const{value:e,step:l,min:r,max:o,onBlur:m,onChange:a,onInput:h,after:p}=n,b=s=>{const u=r!=null?t.Value.get(r):void 0,V=o!=null?t.Value.get(o):void 0;return u!=null&&s<u?u:V!=null&&s>V?V:s},f=(()=>{if(l==null)return null;const s=t.computedOf(e,r)((g,_)=>{const C=g??0;return _==null?!0:C>_}),u=t.computedOf(e,o)((g,_)=>{const C=g??0;return _==null?!0:C<_}),V=g=>{const _=t.Value.get(e)??0,C=t.Value.get(l),O=g?.shiftKey?10:1,I=z(_-C*O,C),i=r!=null?t.Value.get(r):void 0;if(i!=null&&I<i)return;const x=b(I);x!==_&&a&&a(x)},k=g=>{const _=t.Value.get(e)??0,C=t.Value.get(l),O=g?.shiftKey?10:1,I=z(_+C*O,C),i=o!=null?t.Value.get(o):void 0;if(i!=null&&I>i)return;const x=b(I);x!==_&&a&&a(x)};return((g,_)=>st.Stack(t.attr.class("bc-number-input-steppers"),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"),t.attr.disabled(t.computedOf(u,n.disabled??!1)((C,O)=>!C||O)),t.on.click(C=>k(C)),t.aria.label(g),w.Icon({icon:"line-md:plus",size:"xs"})),t.html.button(t.attr.type("button"),t.attr.class("bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"),t.attr.disabled(t.computedOf(s,n.disabled??!1)((C,O)=>!C||O)),t.on.click(C=>V(C)),t.aria.label(_),w.Icon({icon:"line-md:minus",size:"xs"}))))(w.defaultMessages.incrementValue,w.defaultMessages.decrementValue)})(),d=K(e,n.disabled,a??h),v=p!=null&&f!=null?t.Fragment(f,d,p):p!=null?t.Fragment(d,p):f!=null?t.Fragment(f,d):d;return B.InputContainer({...n,input:t.input.number(r!=null?t.attr.min(r):t.Empty,o!=null?t.attr.max(o):t.Empty,L.CommonInputAttributes(n),t.attr.value(t.Value.map(e,s=>s==null?"":String(s))),t.attr.step(l),t.attr.class("bc-input bc-number-input"),m!=null?t.on.blur(t.emitValue(m)):t.Empty,a!=null?t.on.change(t.emitValue(s=>{const u=rt(s);a(u)})):t.Empty,h!=null?t.on.input(t.emitValue(s=>{const u=rt(s);h(u)})):t.Empty,l!=null?t.on.wheel(s=>{s.preventDefault();const u=t.Value.get(e)??0,V=t.Value.get(l),k=s.shiftKey?10:1,c=s.deltaY<0?V*k:-V*k,g=b(z(u+c,V));g!==u&&a&&a(g)}):t.Empty),after:v})},Nt=n=>{const e={type:"pattern",pattern:/[0-9A-Fa-f]/,transform:r=>r.toLowerCase()};return Q({...n,mask:[e,e,e,e,e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,"-",e,e,e,e,e,e,e,e,e,e,e,e],placeholder:n.placeholder??"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"})},Wt=/^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i,Rt=/^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;function bt(n){return{mask:null,allowMode:"custom",allow:e=>/[0-9ptwdhms]/i.test(e),pipe:e=>{const l=e.toUpperCase();return l.length===0?l:!l.startsWith("P")||!Wt.test(l)?!1:l},completion:{mode:"custom",isComplete:e=>{const l=e.toUpperCase();if(!Rt.test(l))return!1;try{return n(l),!0}catch{return!1}}}}}const ot=(n,e)=>{if(n==null)return null;try{return n.Duration.from(e)}catch{return null}},Pt=n=>{const{value:e,onChange:l,onInput:r,after:o,disabled:m,onBlur:a}=n,h=()=>{const f=K(e,m,l??r);return o!=null?t.Fragment(f,o):f},p=n.placeholder!=null?t.Empty:t.attr.placeholder("P0DT0H0M0S");return it(f=>Q({...n,value:t.Value.map(e,d=>d?.toString()??""),onChange:l?d=>l(d===""?null:f.Duration.from(d)):void 0,onInput:void 0,...bt(f.Duration.from),placeholder:"P0DT0H0M0S",after:h()}),{pending:()=>{const f=d=>v=>{const u=v.currentTarget?.value??"";if(u===""){d(null);return}const V=globalThis.Temporal,k=ot(V,u);if(k!=null){d(k);return}Z().then(c=>{const g=ot(c,u);g!=null&&d(g)}).catch(()=>{})};return B.InputContainer({...n,input:t.input.text(L.CommonInputAttributes(n),t.attr.value(t.Value.map(e,d=>d?.toString()??"")),t.attr.class("bc-input"),p,a!=null?t.on.blur(()=>a()):t.Empty,l!=null?t.on.change(f(l)):t.Empty,r!=null?t.on.input(f(r)):t.Empty),after:h()})}})},jt=n=>{const{value:e,onBlur:l,onChange:r,onInput:o}=n;return B.InputContainer({...n,input:t.input.url(L.CommonInputAttributes(n),t.attr.value(e),t.attr.class("bc-input"),l!=null?t.on.blur(t.emitValue(l)):t.Empty,r!=null?t.on.change(t.emitValue(r)):t.Empty,o!=null?t.on.input(t.emitValue(o)):t.Empty)})};function gt(n,e){const{onMove:l,cannotMoveUp:r,cannotMoveDown:o,onRemove:m,showMove:a=!0,showRemove:h=!0,removeDisabled:p,showMoveButtons:b=!0,layout:f="aside"}=n,d=t.Value.toSignal(f).map(u=>u==="aside"),v=t.When(a,()=>t.html.div(t.attr.class("bc-list-item-controls__move"),B.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>l("up"),disabled:r},t.Use(w.BeatUII18n,u=>w.Icon({size:"xs",icon:"line-md:arrow-up",title:u.$.incrementValue}))),B.Button({size:"xs",roundedness:"full",variant:"text",onClick:()=>l("down"),disabled:o},t.Use(w.BeatUII18n,u=>w.Icon({size:"xs",icon:"line-md:arrow-down",title:u.$.decrementValue}))))),s=t.When(h,()=>t.Use(w.BeatUII18n,u=>M.CloseButton({size:"xs",label:t.Value.map(u.$.removeItem,V=>V.toLowerCase()),color:"danger",disabled:p,onClick:m})));return t.When(d,()=>t.html.div(t.attr.class("bc-list-item-controls bc-list-item-controls--aside"),t.html.div(t.attr.class("bc-list-item-controls__content"),e),t.html.div(t.attr.class("bc-list-item-controls__actions"),t.When(b,()=>v),s)),()=>t.html.div(t.attr.class("bc-list-item-controls bc-list-item-controls--below"),t.html.div(t.attr.class("bc-list-item-controls__content"),e),t.html.div(t.attr.class("bc-list-item-controls__actions"),t.When(b,()=>v,()=>t.html.div()),s)))}const vt=n=>{const{controller:e,element:l,separator:r,showMove:o=!0,showRemove:m=!0,showAdd:a=!0,createItem:h,addLabel:p,controlsLayout:b="aside",removeDisabled:f,addDisabled:d}=n,v=t.When(t.computedOf(a,h)((s,u)=>s&&u!=null),()=>J(t.attr.class("bc-group--gap-2 bc-group--align-center bc-group--justify-center"),B.Button({size:"sm",variant:"filled",onClick:()=>e.push(h()),disabled:t.computedOf(e.disabled,d??!1)((s,u)=>s||u)},t.Use(w.BeatUII18n,s=>J(t.attr.class("bc-group--gap-2"),w.Icon({icon:"line-md:plus"}),p??s.$.addLabel)))));return t.Fragment(mt(e,s=>gt({onMove:s.move,cannotMoveUp:s.cannotMove("up"),cannotMoveDown:s.cannotMove("down"),onRemove:s.remove,showMove:o,showRemove:m,removeDisabled:f,showMoveButtons:e.signal.map(u=>u.length>1),layout:b},l(s)),r),v)},qt=(n,...e)=>{const{controller:l,element:r,separator:o,showMove:m,showRemove:a,showAdd:h,createItem:p,addLabel:b,controlsLayout:f,removeDisabled:d,addDisabled:v,...s}=n;return M.InputWrapper({...s,content:vt({controller:l,element:r,separator:o,showMove:m,showRemove:a,showAdd:h,createItem:p,addLabel:b,controlsLayout:f,removeDisabled:d,addDisabled:v})},...e)};class Zt extends M.Controller{branches;activeBranch;#e;#t=new Map;constructor(e,l,r,o,m,a,h=M.O){super(e,l,r,o,m,h),this.branches=a;const p=f=>{for(const d of a)if(d.detect(f))return d.key;return a[0]?.key??"unknown"};this.activeBranch=r.map(p,M.O);const b=f=>{if(this.#t.has(f))return this.#t.get(f);const d=a.find(s=>s.key===f);if(!d)throw new Error(`Unknown branch: ${f}`);const v=new M.Controller([...e,f],s=>{this.change(s)},this.signal.map(s=>d.detect(s)?s:d.defaultValue(),h),o.map(M.makeMapValidation([f])),{disabled:this.disabled,validationMode:this.parent.validationMode},h);return this.#t.set(f,v),v};this.#e=this.activeBranch.map(f=>b(f),M.O),this.onDispose(()=>{for(const f of this.#t.values())f.dispose();this.#t.clear(),this.activeBranch.dispose(),this.#e.dispose()})}get activeController(){return t.Value.get(this.#e)}getBranchController(e){const l=this.branches.find(o=>o.key===e);if(!l)throw new Error(`Unknown branch: ${e}`);if(this.#t.has(e))return this.#t.get(e);const r=new M.Controller([...this.path,e],o=>{this.change(o)},this.signal.map(o=>l.detect(o)?o:l.defaultValue(),M.O),this.status.map(M.makeMapValidation([e])),{disabled:this.disabled,validationMode:this.parent.validationMode},M.O);return this.#t.set(e,r),r}switchToBranch(e,l=!1){const r=this.branches.find(a=>a.key===e);if(!r)throw new Error(`Unknown branch: ${e}`);const o=t.Value.get(this.signal);if(r.detect(o))return!0;if(r.convert){const a=r.convert(o);if(a.ok)return this.change(a.value),!0}if(l&&typeof window=="object"&&typeof window.confirm=="function"&&!window.confirm(w.defaultMessages.changeTypeConfirmation))return!1;const m=r.defaultValue();return this.change(m),!0}get activeBranchDefinition(){const e=t.Value.get(this.activeBranch);return this.branches.find(l=>l.key===e)}}function Ht(n){return n.transform(e=>e??null,e=>e??void 0)}function Yt(n){return n.transform(e=>e??"",e=>e===""?void 0:e)}function Gt(n){return n.transform(e=>e??void 0,e=>e??null)}function j(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.prototype.toString.call(n)==="[object Object]"}function xt(n,e){if(e==null)return at(n);if(n==null)return e;if(j(n)&&j(e)){const l={...e};for(const r of Object.keys(n))l[r]===void 0?l[r]=at(n[r]):j(n[r])&&j(l[r])&&(l[r]=xt(n[r],l[r]));return l}return e}function at(n){return typeof structuredClone=="function"?structuredClone(n):JSON.parse(JSON.stringify(n))}exports.BaseListControl=vt;exports.BaseNativeSelectControl=dt;exports.Expando=ut;exports.FilesInput=Ot;exports.Group=J;exports.ListControl=qt;exports.ListInput=mt;exports.ListItemControls=gt;exports.MaskInput=Q;exports.NativeSelect=ft;exports.NativeSelectControl=$t;exports.NullableDurationInput=Pt;exports.NullableNumberInput=Lt;exports.NullableResetAfter=K;exports.NumberInput=zt;exports.SegmentedInput=Dt;exports.TextArea=At;exports.UUIDInput=Nt;exports.UnionController=Zt;exports.UnstyledDropZone=q;exports.UrlInput=jt;exports.WithTemporal=it;exports.deepMergeDefaults=xt;exports.durationMaskConfig=bt;exports.emitExpando=Mt;exports.emitOptionExpando=ct;exports.ensureTemporal=Z;exports.roundToStep=z;exports.transformEmptyStringToUndefined=Yt;exports.transformNullToUndefined=Ht;exports.transformUndefinedToNull=Gt;
@@ -1 +0,0 @@
1
- "use strict";const a=require("@tempots/dom"),C=require("@tempots/ui"),y=require("./colors-BI0YhONJ.cjs");function I(e,{units:t=["B","KB","MB","GB","TB"],decimalPlaces:o=0,locale:i}={}){if(e===0||e===0n)return new Intl.NumberFormat(i,{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(i,{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 i=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=I(t,{units:o});n.push(`max ${r} each`)}n.length>0&&(i+=` (${n.join(", ")})`)}return i},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:"},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,m="en",O=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 O.has(t)?"rtl":"ltr"}function L(e,t){return e==="auto"?v(t):e}function R(e){return`b-${e}`}function V(e){return v(e)==="rtl"}function N(e){return e==="ltr"?"rtl":"ltr"}const w={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 w[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"}),i=a.computedOf(t,o)((r,l)=>L(l,r));return{value:{locale:t,setLocale:r=>t.set(r),direction:i,directionPreference:o,setDirectionPreference:r=>o.set(r)},dispose:()=>{t.dispose(),o.dispose(),i.dispose()}}}},{variants:U,special:A,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=A[e];if(!o)return;if(t==="light")return o;const i=k[e];return i?i[t]:o}function E(e,t,o){const i=k[e];if(i){const r=i[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=U[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 i=k[e];if(i){const r=i[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 l=j[o];return{backgroundColor:d(e,l.shade),textColor:l.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(i){const n=i.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 p=b?Y():null;async function B(e,t){try{if(p){const o=await p;return new Promise((i,n)=>{const r=o.transaction("icons","readwrite");r.objectStore("icons").put(t,e),r.oncomplete=()=>i(),r.onerror=n})}else g.set(e,t)}catch{g.set(e,t)}}async function S(e){try{if(p){const t=await p;return new Promise((o,i)=>{const l=t.transaction("icons","readonly").objectStore("icons").get(e);l.onsuccess=function(){o(l.result)},l.onerror=i})}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 i=await J(t);return await B(t,i),i}function Z(e){return["bc-icon",`bc-icon--${e}`].join(" ")}function X(e,t="solid"){if(!e)return"";const o=P(e,t,"light"),i=P(e,t,"dark");return`--icon-color: ${o}; --icon-color-dark: ${i}`}function ee({icon:e,size:t="md",color:o,title:i,accessibility:n="auto",tone:r="solid"},...l){const u=a.computedOf(n,i)((s,c)=>s==="decorative"?!1:s==="informative"?!0:c!=null&&c!=="");return a.Use(M,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(i,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)),"🚫")})),...l))}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:i}){const n=a.prop(t),r=a.prop(o),l=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 i(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:()=>{l(),n.dispose(),r.dispose()},t:r}}function q({defaultLocale:e,defaultMessages:t,localeLoader:o,providerName:i="I18nProvider"}){return{mark:a.makeProviderMark(i),create:(n,r)=>{const{value:{locale:l}}=r.getProvider(x.mark),{t:u,dispose:s}=F({locale:l,defaultMessages:t,defaultLocale:e,localeLoader:o});return{value:u,dispose:s}}}}const oe=Object.assign({"./locales/ar.ts":()=>Promise.resolve().then(()=>require("./ar-CBrjAlIY.cjs")).then(e=>e.default),"./locales/de.ts":()=>Promise.resolve().then(()=>require("./de-CrBw41po.cjs")).then(e=>e.default),"./locales/es.ts":()=>Promise.resolve().then(()=>require("./es-Ca5xT3NE.cjs")).then(e=>e.default),"./locales/fa.ts":()=>Promise.resolve().then(()=>require("./fa-DhZJYuC6.cjs")).then(e=>e.default),"./locales/fr.ts":()=>Promise.resolve().then(()=>require("./fr-1nSKSIlw.cjs")).then(e=>e.default),"./locales/he.ts":()=>Promise.resolve().then(()=>require("./he-DhcurPt5.cjs")).then(e=>e.default),"./locales/hi.ts":()=>Promise.resolve().then(()=>require("./hi-CxsIxbfM.cjs")).then(e=>e.default),"./locales/it.ts":()=>Promise.resolve().then(()=>require("./it-D_IcaYxp.cjs")).then(e=>e.default),"./locales/ja.ts":()=>Promise.resolve().then(()=>require("./ja-CMGqpPo7.cjs")).then(e=>e.default),"./locales/ko.ts":()=>Promise.resolve().then(()=>require("./ko-BPl5rP97.cjs")).then(e=>e.default),"./locales/nl.ts":()=>Promise.resolve().then(()=>require("./nl-BSfaHFt0.cjs")).then(e=>e.default),"./locales/pl.ts":()=>Promise.resolve().then(()=>require("./pl-D-O4sCnr.cjs")).then(e=>e.default),"./locales/pt.ts":()=>Promise.resolve().then(()=>require("./pt-chEEYLlt.cjs")).then(e=>e.default),"./locales/ru.ts":()=>Promise.resolve().then(()=>require("./ru-B46hVpFF.cjs")).then(e=>e.default),"./locales/tr.ts":()=>Promise.resolve().then(()=>require("./tr-CaMaflJL.cjs")).then(e=>e.default),"./locales/ur.ts":()=>Promise.resolve().then(()=>require("./ur-CvGP14xo.cjs")).then(e=>e.default),"./locales/vi.ts":()=>Promise.resolve().then(()=>require("./vi-Df4WZe9y.cjs")).then(e=>e.default),"./locales/zh.ts":()=>Promise.resolve().then(()=>require("./zh-C5a9NGFW.cjs")).then(e=>e.default)}),M=q({defaultLocale:m,defaultMessages:f,localeLoader:async e=>{if(e===m)return f;const t=oe[`./locales/${e}.ts`];return t?await t():f},providerName:"BeatUII18n"});exports.BeatUII18n=M;exports.Icon=ee;exports.LOGICAL_PROPERTY_MAP=w;exports.Locale=x;exports.backgroundValue=E;exports.borderColorValue=G;exports.defaultLocale=m;exports.defaultMessages=f;exports.formatFileSize=I;exports.getDirectionClassName=R;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=L;exports.storeIconLocally=B;exports.textColorValue=K;