@vanelsas/baredom 3.0.0 → 3.1.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 (126) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/custom-elements.json +3393 -2954
  3. package/dist/baredom.d.ts +86 -86
  4. package/dist/base.js +533 -524
  5. package/dist/integrity.json +103 -103
  6. package/dist/x-alert.js +16 -16
  7. package/dist/x-avatar-group.js +9 -9
  8. package/dist/x-avatar.js +14 -14
  9. package/dist/x-badge.js +9 -9
  10. package/dist/x-bento-grid.js +5 -5
  11. package/dist/x-bento-item.js +4 -4
  12. package/dist/x-breadcrumbs.js +14 -13
  13. package/dist/x-button.js +1 -1
  14. package/dist/x-cancel-dialogue.js +14 -13
  15. package/dist/x-card.d.ts +1 -1
  16. package/dist/x-card.js +7 -7
  17. package/dist/x-carousel.d.ts +3 -0
  18. package/dist/x-carousel.js +35 -33
  19. package/dist/x-chart.js +47 -47
  20. package/dist/x-checkbox.js +1 -1
  21. package/dist/x-chip.js +1 -1
  22. package/dist/x-collapse.d.ts +1 -0
  23. package/dist/x-collapse.js +11 -10
  24. package/dist/x-color-picker.js +46 -45
  25. package/dist/x-combobox.d.ts +2 -0
  26. package/dist/x-combobox.js +30 -26
  27. package/dist/x-command-palette.d.ts +3 -0
  28. package/dist/x-command-palette.js +28 -26
  29. package/dist/x-confetti.js +24 -24
  30. package/dist/x-container.js +5 -6
  31. package/dist/x-context-menu.d.ts +4 -0
  32. package/dist/x-context-menu.js +21 -20
  33. package/dist/x-copy.js +20 -20
  34. package/dist/x-currency-field.d.ts +2 -0
  35. package/dist/x-currency-field.js +24 -23
  36. package/dist/x-date-picker.d.ts +3 -0
  37. package/dist/x-date-picker.js +42 -42
  38. package/dist/x-divider.js +10 -9
  39. package/dist/x-drawer.js +11 -10
  40. package/dist/x-dropdown.d.ts +3 -0
  41. package/dist/x-dropdown.js +12 -11
  42. package/dist/x-fieldset.js +6 -5
  43. package/dist/x-file-download.js +7 -7
  44. package/dist/x-file-upload.d.ts +2 -0
  45. package/dist/x-file-upload.js +23 -22
  46. package/dist/x-form-field.js +15 -15
  47. package/dist/x-form.d.ts +4 -0
  48. package/dist/x-form.js +10 -9
  49. package/dist/x-gaussian-blur.js +13 -12
  50. package/dist/x-grid.js +6 -7
  51. package/dist/x-i18n-provider.js +7 -7
  52. package/dist/x-i18n.js +4 -4
  53. package/dist/x-icon.js +7 -7
  54. package/dist/x-image.js +17 -17
  55. package/dist/x-kbd.js +16 -16
  56. package/dist/x-kinetic-canvas.js +26 -25
  57. package/dist/x-kinetic-font.js +27 -27
  58. package/dist/x-kinetic-typography.js +35 -33
  59. package/dist/x-liquid-dock.js +34 -38
  60. package/dist/x-liquid-fill.js +42 -45
  61. package/dist/x-liquid-glass.js +41 -47
  62. package/dist/x-menu-item.js +8 -8
  63. package/dist/x-menu.js +10 -11
  64. package/dist/x-metaball-cursor.js +23 -26
  65. package/dist/x-modal.js +12 -11
  66. package/dist/x-morph-stack.d.ts +4 -0
  67. package/dist/x-morph-stack.js +37 -37
  68. package/dist/x-multi-combobox.js +36 -36
  69. package/dist/x-navbar.js +15 -12
  70. package/dist/x-neural-glow.js +30 -33
  71. package/dist/x-notification-center.d.ts +2 -0
  72. package/dist/x-notification-center.js +9 -9
  73. package/dist/x-organic-divider.js +18 -17
  74. package/dist/x-organic-progress.js +35 -37
  75. package/dist/x-organic-shape.js +14 -13
  76. package/dist/x-otp-input.js +22 -22
  77. package/dist/x-pagination.js +14 -15
  78. package/dist/x-particle-button.js +51 -51
  79. package/dist/x-popover.d.ts +3 -0
  80. package/dist/x-popover.js +27 -25
  81. package/dist/x-progress-circle.d.ts +3 -0
  82. package/dist/x-progress-circle.js +9 -9
  83. package/dist/x-progress.js +8 -10
  84. package/dist/x-proximity-list.js +20 -20
  85. package/dist/x-radio.js +11 -11
  86. package/dist/x-ripple-effect.js +10 -11
  87. package/dist/x-scroll-parallax.js +17 -18
  88. package/dist/x-scroll-stack.js +16 -17
  89. package/dist/x-scroll-story.js +33 -34
  90. package/dist/x-scroll-timeline.js +46 -45
  91. package/dist/x-scroll.d.ts +3 -0
  92. package/dist/x-scroll.js +38 -40
  93. package/dist/x-search-field.d.ts +2 -0
  94. package/dist/x-search-field.js +1 -1
  95. package/dist/x-select.js +1 -1
  96. package/dist/x-sidebar.js +18 -17
  97. package/dist/x-skeleton-group.js +12 -12
  98. package/dist/x-skeleton.js +1 -1
  99. package/dist/x-slider.js +16 -15
  100. package/dist/x-soft-body.js +20 -22
  101. package/dist/x-spacer.js +4 -4
  102. package/dist/x-spinner.js +4 -4
  103. package/dist/x-splash.js +12 -13
  104. package/dist/x-spotlight-card.js +12 -12
  105. package/dist/x-stat.js +10 -10
  106. package/dist/x-stepper.js +13 -14
  107. package/dist/x-switch.js +11 -10
  108. package/dist/x-tab.js +7 -7
  109. package/dist/x-table-cell.js +21 -20
  110. package/dist/x-table-row.js +8 -8
  111. package/dist/x-table.d.ts +32 -32
  112. package/dist/x-table.js +13 -12
  113. package/dist/x-tabs.js +11 -11
  114. package/dist/x-text-area.js +19 -19
  115. package/dist/x-theme.js +25 -25
  116. package/dist/x-timeline-item.js +20 -20
  117. package/dist/x-timeline.js +8 -8
  118. package/dist/x-toast.d.ts +1 -0
  119. package/dist/x-toast.js +22 -22
  120. package/dist/x-toaster.js +7 -8
  121. package/dist/x-tooltip.d.ts +2 -0
  122. package/dist/x-tooltip.js +12 -12
  123. package/dist/x-trace-history.js +120 -117
  124. package/dist/x-typography.js +9 -9
  125. package/dist/x-welcome-tour.js +63 -61
  126. package/package.json +4 -2
@@ -16,6 +16,10 @@ export interface XContextMenu extends HTMLElement {
16
16
  placement: string;
17
17
  offset: string;
18
18
  zIndex: string;
19
+ openAt(x: number, y: number): void;
20
+ toggleAt(x: number, y: number): void;
21
+ openForElement(anchor: Record<string, any>): void;
22
+ close(): void;
19
23
 
20
24
  addEventListener<K extends keyof XContextMenuEventMap>(
21
25
  type: K,
@@ -1,21 +1,22 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var $8=function(a){return $APP.n(a)?a.shadowRoot.querySelector("[part\x3dpanel]"):null},a9=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:b):b},hla=function(a){return $APP.A.j(a,"bottom-start")?"top-start":$APP.A.j(a,"bottom-end")?"top-end":$APP.A.j(a,"top-start")?"bottom-start":$APP.A.j(a,"top-end")?"bottom-end":$APP.A.j(a,"right-start")?"left-start":$APP.A.j(a,"left-start")?"right-start":a},ila=function(a,b,c,d){var e=$APP.G(c);c=$APP.C(e,$APP.aq);var f=$APP.C(e,
3
- $APP.$p),h=$APP.C(e,$APP.nl);e=$APP.C(e,$APP.ol);var l=$APP.G(d);d=$APP.C(l,$APP.nl);l=$APP.C(l,$APP.ol);switch(a){case "bottom-start":return new $APP.O(null,2,[$APP.aq,c,$APP.$p,f+e+b],null);case "bottom-end":return new $APP.O(null,2,[$APP.aq,c+h-d,$APP.$p,f+e+b],null);case "top-start":return new $APP.O(null,2,[$APP.aq,c,$APP.$p,f-l-b],null);case "top-end":return new $APP.O(null,2,[$APP.aq,c+h-d,$APP.$p,f-l-b],null);case "right-start":return new $APP.O(null,2,[$APP.aq,c+h+b,$APP.$p,f],null);case "left-start":return new $APP.O(null,
4
- 2,[$APP.aq,c-d-b,$APP.$p,f],null);default:return new $APP.O(null,2,[$APP.aq,c,$APP.$p,f+e+b],null)}},b9=function(a,b,c,d,e){function f(x){var z=ila(x,b,c,d);z=$APP.G(z);var B=$APP.C(z,$APP.aq),E=$APP.C(z,$APP.$p);z=B>=8&&B+m<=h-8;var H=E>=8&&E+q<=l-8;B=$APP.Hl.j($APP.Gl.j(B,8),h-m-8);E=$APP.Hl.j($APP.Gl.j(E,8),l-q-8);return new $APP.O(null,5,[$APP.aq,B,$APP.$p,E,$APP.Em,x,$APP.lq,z&&H,$APP.Io,$APP.Gl.j(40,l-E-8)],null)}e=$APP.G(e);var h=$APP.C(e,$APP.nl),l=$APP.C(e,$APP.ol);e=$APP.G(d);var m=$APP.C(e,
5
- $APP.nl),q=$APP.C(e,$APP.ol),r=f(a),v=f(hla(a));return $APP.n(function(){var x=$APP.lq.i(r);return $APP.n(x)?x:$APP.p($APP.lq.i(v))}())?r:v},f9=function(a){a=new $APP.O(null,5,[$APP.Qm,$APP.n(a.hasAttribute("open"))?a.getAttribute("open"):null,$APP.vi,$APP.n(a.hasAttribute("disabled"))?a.getAttribute("disabled"):null,$APP.sr,a.getAttribute("placement"),c9,a.getAttribute("offset"),d9,a.getAttribute("z-index")],null);var b=$APP.G(a),c=$APP.C(b,$APP.Qm),d=$APP.C(b,$APP.vi),e=$APP.C(b,$APP.sr);a=$APP.C(b,
6
- c9);b=$APP.C(b,d9);c=$APP.ii(c);d=$APP.ii(d);e=typeof e==="string"&&$APP.$c(jla,e)?e:"bottom-start";return new $APP.O(null,5,[$APP.Zq,c,$APP.Bi,d,$APP.Vn,e,$APP.Bm,a9(a,8),e9,a9(b,1E3)],null)},g9=function(a){return $APP.zc(a.querySelectorAll("[role\x3dmenuitem]:not([disabled]):not([aria-disabled\x3dtrue])"))},h9=function(a){return $APP.n(a)?a.focus():null},i9=function(a,b){a=$APP.Wi(a,":host{color-scheme:light dark;--x-context-menu-bg:var(--x-color-bg,rgba(255,255,255,0.97));--x-context-menu-border:var(--x-color-border,rgba(0,0,0,0.1));--x-context-menu-shadow:var(--x-shadow-lg,0 8px 32px rgba(0,0,0,0.14),0 2px 8px rgba(0,0,0,0.08));--x-context-menu-radius:var(--x-radius-md,10px);--x-context-menu-item-hover:rgba(0,0,0,0.05);--x-context-menu-item-active:rgba(0,0,0,0.09);--x-context-menu-item-fg:var(--x-color-text,rgba(0,0,0,0.87));--x-context-menu-separator:var(--x-color-border,rgba(0,0,0,0.1));}@media(prefers-color-scheme:dark){:host{--x-context-menu-bg:var(--x-color-bg,#1e293b);--x-context-menu-border:var(--x-color-border,rgba(255,255,255,0.12));--x-context-menu-shadow:var(--x-shadow-lg,0 8px 32px rgba(0,0,0,0.7),0 2px 8px rgba(0,0,0,0.4));--x-context-menu-item-hover:rgba(255,255,255,0.08);--x-context-menu-item-active:rgba(255,255,255,0.14);--x-context-menu-item-fg:var(--x-color-text,rgba(255,255,255,0.9));--x-context-menu-separator:var(--x-color-border,rgba(255,255,255,0.12));}}[part\x3dpanel]{position:absolute;min-width:160px;max-width:calc(100vw - 1rem);border-radius:var(--x-context-menu-radius);background:var(--x-context-menu-bg);border:1px solid var(--x-context-menu-border);box-shadow:var(--x-context-menu-shadow);padding:4px 0;overflow:auto;pointer-events:auto;outline:none;@media(prefers-reduced-motion:no-preference){transition:opacity 120ms ease,transform 120ms ease;}}[role\x3dmenuitem]{color:var(--x-context-menu-item-fg);}[role\x3dmenuitem]:hover{background:var(--x-context-menu-item-hover);}",
7
- b);b=document.createElement("div");b.setAttribute("part","panel");b.setAttribute("role","menu");b.setAttribute("tabindex","-1");a.shadowRoot.appendChild(b);return a},j9=function(a,b,c,d){var e=$APP.G(d);d=$APP.C(e,e9);e=$APP.C(e,$APP.Io);a.style.zIndex=""+$APP.V.i(d);a=$8(a);$APP.n(a)&&(a.style.left=""+$APP.V.i(b)+"px",a.style.top=""+$APP.V.i(c)+"px",a.style.maxHeight=""+$APP.V.i(e)+"px")},k9=function(a,b){a=$APP.t($APP.zc(a.children));for(var c=null,d=0,e=0;;)if(e<d){var f=c.F(null,e);b.appendChild(f.cloneNode(!0));
8
- e+=1}else if(a=$APP.t(a))c=a,$APP.Wc(c)?(a=$APP.Ab(c),d=$APP.Bb(c),c=a,f=$APP.y(a),a=d,d=f):(f=$APP.u(c),b.appendChild(f.cloneNode(!0)),a=$APP.w(c),c=null,d=0),e=0;else break},m9=function(a,b){function c(e){e.stopPropagation();e=e.target.closest("[role\x3dmenuitem]");return $APP.n(e)?($APP.Nh(a,"x-context-menu-select",{item:e}),l9.j?l9.j(a,"select"):l9.call(null,a,"select")):null}var d=$8(b);$APP.Xi(b,b,"keydown",function(e){var f=e.key,h=b.shadowRoot.activeElement;return $APP.A.j(f,"Tab")?l9.j?l9.j(a,
9
- "keyboard"):l9.call(null,a,"keyboard"):$APP.A.j(f,"ArrowDown")?(e.preventDefault(),$APP.n(h)?(e=g9(d),h=$APP.fd(e).indexOf(h),h=$APP.Gc(e,$APP.qd(h+1,$APP.y(e)),null),h=h9(h)):h=h9($APP.u(g9(d))),h):$APP.A.j(f,"ArrowUp")?(e.preventDefault(),$APP.n(h)?(e=g9(d),f=$APP.y(e),h=$APP.fd(e).indexOf(h),h=$APP.Gc(e,$APP.qd(h+(f-1),f),null),h=h9(h)):h=h9($APP.u(g9(d))),h):($APP.A.j(f,"Enter")||$APP.A.j(f," "))&&$APP.n(h)?(e.preventDefault(),h.click()):null},!0);$APP.n(d)&&$APP.Xi(b,d,"click",c,!1)},n9=function(a){function b(d){var e=
10
- $APP.k(a,"__xContextMenuLayer");if($APP.n(e)){var f=$8(e);d=d.composedPath();d=$APP.ge(function(h){return h===f},$APP.zc(d));return $APP.n($APP.n(f)?$APP.p(d):f)?l9.j?l9.j(a,"backdrop"):l9.call(null,a,"backdrop"):null}return null}function c(d){return $APP.A.j(d.key,"Escape")?(d.preventDefault(),l9.j?l9.j(a,"keyboard"):l9.call(null,a,"keyboard")):null}setTimeout(function(){if($APP.n(a.hasAttribute("open")))document.addEventListener("keydown",c),document.addEventListener("click",b),a.__xContextMenuDocH=
11
- {keydown:c,click:b};else return null},0)},l9=function(a,b){if($APP.n(a.hasAttribute("open"))&&$APP.Ph(a,"x-context-menu-close-request",{reason:b})){var c=$APP.k(a,"__xContextMenuDocH");$APP.n(c)&&(document.removeEventListener("keydown",$APP.k(c,"keydown")),document.removeEventListener("click",$APP.k(c,"click")),a.__xContextMenuDocH=null);$APP.T(a,"open");$APP.Yi($APP.k(a,"__xContextMenuLayer"));a.__xContextMenuLayer=null;return $APP.Nh(a,"x-context-menu-close",{reason:b})}return null},o9=function(a,
12
- b,c,d){if($APP.n(a.hasAttribute("disabled")))return null;if($APP.Ph(a,"x-context-menu-open-request",{reason:d})){var e=f9(a);e=$APP.G(e);var f=$APP.C(e,$APP.Vn),h=$APP.C(e,$APP.Bm),l=$APP.C(e,e9),m=window.innerWidth,q=window.innerHeight,r=new $APP.O(null,4,[$APP.aq,b,$APP.$p,c,$APP.nl,1,$APP.ol,1],null);b=b9(f,h,r,new $APP.O(null,2,[$APP.nl,200,$APP.ol,300],null),new $APP.O(null,2,[$APP.nl,m,$APP.ol,q],null));var v=i9(a,l);k9(a,$8(v));m9(a,v);j9(v,$APP.aq.i(b),$APP.$p.i(b),$APP.Dk.m(b,e9,l));$APP.S(a,
13
- "open","");a.__xContextMenuLayer=v;n9(a);requestAnimationFrame(function(){var x=$8(v);if($APP.n(x)){var z=b9(f,h,r,new $APP.O(null,2,[$APP.nl,x.offsetWidth,$APP.ol,x.offsetHeight],null),new $APP.O(null,2,[$APP.nl,m,$APP.ol,q],null));j9(v,$APP.aq.i(z),$APP.$p.i(z),$APP.Dk.m(z,e9,l));return h9($APP.u(g9(x)))}return null});return $APP.Nh(a,"x-context-menu-open",{reason:d})}return null},kla=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;b=b.getBoundingClientRect();var c=f9(a);c=$APP.G(c);
14
- var d=$APP.C(c,$APP.Vn),e=$APP.C(c,$APP.Bm),f=$APP.C(c,e9),h=window.innerWidth,l=window.innerHeight,m=new $APP.O(null,4,[$APP.aq,b.left,$APP.$p,b.top,$APP.nl,b.width,$APP.ol,b.height],null);if($APP.Ph(a,"x-context-menu-open-request",{reason:"programmatic"})){b=b9(d,e,m,new $APP.O(null,2,[$APP.nl,200,$APP.ol,300],null),new $APP.O(null,2,[$APP.nl,h,$APP.ol,l],null));var q=i9(a,f);k9(a,$8(q));m9(a,q);j9(q,$APP.aq.i(b),$APP.$p.i(b),$APP.Dk.m(b,e9,f));$APP.S(a,"open","");a.__xContextMenuLayer=q;n9(a);
15
- requestAnimationFrame(function(){var r=$8(q);if($APP.n(r)){var v=b9(d,e,m,new $APP.O(null,2,[$APP.nl,r.offsetWidth,$APP.ol,r.offsetHeight],null),new $APP.O(null,2,[$APP.nl,h,$APP.ol,l],null));j9(q,$APP.aq.i(v),$APP.$p.i(v),$APP.Dk.m(v,e9,f));return h9($APP.u(g9(r)))}return null});return $APP.Nh(a,"x-context-menu-open",{reason:"programmatic"})}return null},lla=function(a){if(!$APP.n($APP.k(a,"__xContextMenuRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("slot");
16
- c.textContent=":host{display:contents;}slot{display:none;}";b.appendChild(c);b.appendChild(d);c={};c.root=b;c.slot=d;a.__xContextMenuRefs=c}return $APP.n(a.hasAttribute("open"))?$APP.T(a,"open"):null},mla=function(a){var b=$APP.k(a,"__xContextMenuLayer");if($APP.n(b))$APP.Yi(b),a.__xContextMenuLayer=null;else return null},nla=function(a,b){if($APP.A.j(b,"open")){if($APP.n(a.hasAttribute("open")))return null;b=$APP.k(a,"__xContextMenuLayer");if($APP.n(b)){$APP.Yi(b);a.__xContextMenuLayer=null;return}}return null},
17
- ola=function(a){a.openAt=function(b,c){return o9(this,b,c,"programmatic")};a.toggleAt=function(b,c){return $APP.n(this.hasAttribute("open"))?l9(this,"toggle"):o9(this,b,c,"toggle")};a.openForElement=function(b){return kla(this,b)};return a.close=function(){return l9(this,"programmatic")}},qla=function(a){$APP.Zh(a,pla);return ola(a)},p9=function(){return $APP.Ah("x-context-menu",new $APP.O(null,5,[$APP.qh,rla,$APP.oh,lla,$APP.lh,mla,$APP.kh,nla,$APP.ph,qla],null))},d9=new $APP.F(null,"z-index-raw",
18
- "z-index-raw",-1179679257),e9=new $APP.F(null,"z-index","z-index",1892827090),c9=new $APP.F(null,"offset-raw","offset-raw",-1418404095);var rla=["open","disabled","placement","offset","z-index"],jla=new $APP.pg(null,new $APP.O(null,6,["right-start",null,"bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null,"left-start",null],null),null),pla=new $APP.O(null,5,[$APP.wq,new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"open"],null),$APP.ck,new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"disabled"],null),$APP.Vn,new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"placement"],null),$APP.Bm,new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"offset"],null),
19
- new $APP.F(null,"zIndex","zIndex",-1588341609),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"z-index"],null)],null);
20
- $APP.ce(["x-context-menu-open-request",new $APP.O(null,2,[$APP.Aq,!0,$APP.U,new $APP.O(null,1,[$APP.Ym,$APP.X],null)],null),"x-context-menu-open",new $APP.O(null,2,[$APP.Aq,!1,$APP.U,new $APP.O(null,1,[$APP.Ym,$APP.X],null)],null),"x-context-menu-close-request",new $APP.O(null,2,[$APP.Aq,!0,$APP.U,new $APP.O(null,1,[$APP.Ym,$APP.X],null)],null),"x-context-menu-close",new $APP.O(null,2,[$APP.Aq,!1,$APP.U,new $APP.O(null,1,[$APP.Ym,$APP.X],null)],null),"x-context-menu-select",new $APP.O(null,2,[$APP.Aq,
21
- !1,$APP.U,new $APP.O(null,1,[$APP.wo,$APP.Ap],null)],null)]);$APP.ha("baredom.exports.x_context_menu.init",p9);export const init=p9;
2
+ var W8=function(a){return $APP.n(a)?a.shadowRoot.querySelector("[part\x3dpanel]"):null},X8=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:b):b},Gna=function(a){return $APP.y.j(a,"bottom-start")?"top-start":$APP.y.j(a,"bottom-end")?"top-end":$APP.y.j(a,"top-start")?"bottom-start":$APP.y.j(a,"top-end")?"bottom-end":$APP.y.j(a,"right-start")?"left-start":$APP.y.j(a,"left-start")?"right-start":a},Hna=function(a,b,c,d){var e=$APP.H(c);c=$APP.C(e,$APP.mr);var f=$APP.C(e,
3
+ $APP.lr),h=$APP.C(e,$APP.Vl);e=$APP.C(e,$APP.Wl);var k=$APP.H(d);d=$APP.C(k,$APP.Vl);k=$APP.C(k,$APP.Wl);switch(a){case "bottom-start":return new $APP.N(null,2,[$APP.mr,c,$APP.lr,f+e+b],null);case "bottom-end":return new $APP.N(null,2,[$APP.mr,c+h-d,$APP.lr,f+e+b],null);case "top-start":return new $APP.N(null,2,[$APP.mr,c,$APP.lr,f-k-b],null);case "top-end":return new $APP.N(null,2,[$APP.mr,c+h-d,$APP.lr,f-k-b],null);case "right-start":return new $APP.N(null,2,[$APP.mr,c+h+b,$APP.lr,f],null);case "left-start":return new $APP.N(null,
4
+ 2,[$APP.mr,c-d-b,$APP.lr,f],null);default:return new $APP.N(null,2,[$APP.mr,c,$APP.lr,f+e+b],null)}},Ina=function(a,b,c,d){function e(z){var A=Hna(z,b,c,d);A=$APP.H(A);var D=$APP.C(A,$APP.mr),G=$APP.C(A,$APP.lr);A=D>=8&&D+m<=h-8;var J=G>=8&&G+q<=k-8;D=$APP.Hm.j($APP.Gm.j(D,8),h-m-8);G=$APP.Hm.j($APP.Gm.j(G,8),k-q-8);return new $APP.N(null,5,[$APP.mr,D,$APP.lr,G,$APP.En,z,$APP.xr,A&&J,$APP.$p,$APP.Gm.j(40,k-G-8)],null)}var f=$APP.H(new $APP.N(null,2,[$APP.Vl,window.innerWidth,$APP.Wl,window.innerHeight],
5
+ null)),h=$APP.C(f,$APP.Vl),k=$APP.C(f,$APP.Wl);f=$APP.H(d);var m=$APP.C(f,$APP.Vl),q=$APP.C(f,$APP.Wl),u=e(a),x=e(Gna(a));return $APP.n(function(){var z=$APP.xr.i(u);return $APP.n(z)?z:$APP.p($APP.xr.i(x))}())?u:x},a9=function(a){a=new $APP.N(null,5,[$APP.Rn,$APP.n(a.hasAttribute("open"))?a.getAttribute("open"):null,$APP.Wi,$APP.n(a.hasAttribute("disabled"))?a.getAttribute("disabled"):null,$APP.Gs,a.getAttribute("placement"),Y8,a.getAttribute("offset"),Z8,a.getAttribute("z-index")],null);var b=$APP.H(a),
6
+ c=$APP.C(b,$APP.Rn),d=$APP.C(b,$APP.Wi),e=$APP.C(b,$APP.Gs);a=$APP.C(b,Y8);b=$APP.C(b,Z8);c=$APP.Uh(c);d=$APP.Uh(d);e=typeof e==="string"&&$APP.$c(Jna,e)?e:"bottom-start";return new $APP.N(null,5,[$APP.ls,c,$APP.cj,d,$APP.Yo,e,$APP.Bn,X8(a,8),$8,X8(b,1E3)],null)},b9=function(a){return $APP.Ac(a.querySelectorAll("[role\x3dmenuitem]:not([disabled]):not([aria-disabled\x3dtrue])"))},c9=function(a){return $APP.n(a)?a.focus():null},Kna=function(a,b){a=$APP.uj(a,":host{color-scheme:light dark;--x-context-menu-bg:var(--x-color-bg,rgba(255,255,255,0.97));--x-context-menu-border:var(--x-color-border,rgba(0,0,0,0.1));--x-context-menu-shadow:var(--x-shadow-lg,0 8px 32px rgba(0,0,0,0.14),0 2px 8px rgba(0,0,0,0.08));--x-context-menu-radius:var(--x-radius-md,10px);--x-context-menu-item-hover:rgba(0,0,0,0.05);--x-context-menu-item-active:rgba(0,0,0,0.09);--x-context-menu-item-fg:var(--x-color-text,rgba(0,0,0,0.87));--x-context-menu-separator:var(--x-color-border,rgba(0,0,0,0.1));}@media(prefers-color-scheme:dark){:host{--x-context-menu-bg:var(--x-color-bg,#1e293b);--x-context-menu-border:var(--x-color-border,rgba(255,255,255,0.12));--x-context-menu-shadow:var(--x-shadow-lg,0 8px 32px rgba(0,0,0,0.7),0 2px 8px rgba(0,0,0,0.4));--x-context-menu-item-hover:rgba(255,255,255,0.08);--x-context-menu-item-active:rgba(255,255,255,0.14);--x-context-menu-item-fg:var(--x-color-text,rgba(255,255,255,0.9));--x-context-menu-separator:var(--x-color-border,rgba(255,255,255,0.12));}}[part\x3dpanel]{position:absolute;min-width:160px;max-width:calc(100vw - 1rem);border-radius:var(--x-context-menu-radius);background:var(--x-context-menu-bg);border:1px solid var(--x-context-menu-border);box-shadow:var(--x-context-menu-shadow);padding:4px 0;overflow:auto;pointer-events:auto;outline:none;@media(prefers-reduced-motion:no-preference){transition:opacity 120ms ease,transform 120ms ease;}}[role\x3dmenuitem]{color:var(--x-context-menu-item-fg);}[role\x3dmenuitem]:hover{background:var(--x-context-menu-item-hover);}",
7
+ b);b=document.createElement("div");$APP.T(b,"part","panel");$APP.T(b,"role","menu");$APP.T(b,"tabindex","-1");a.shadowRoot.appendChild(b);return a},Lna=function(a,b){a=$APP.r($APP.Ac(a.children));for(var c=null,d=0,e=0;;)if(e<d){var f=c.F(null,e);b.appendChild(f.cloneNode(!0));e+=1}else if(a=$APP.r(a))c=a,$APP.Wc(c)?(a=$APP.Cb(c),d=$APP.Db(c),c=a,f=$APP.w(a),a=d,d=f):(f=$APP.t(c),b.appendChild(f.cloneNode(!0)),a=$APP.v(c),c=null,d=0),e=0;else break},d9=function(a,b,c,d,e,f){d=Ina(c,d,b,e);b=$APP.mr.i(d);
8
+ c=$APP.lr.i(d);f=$APP.Vk.m(d,$8,f);d=$APP.H(f);f=$APP.C(d,$8);d=$APP.C(d,$APP.$p);a.style.zIndex=""+$APP.P.i(f);a=W8(a);$APP.n(a)&&(a.style.left=""+$APP.P.i(b)+"px",a.style.top=""+$APP.P.i(c)+"px",a.style.maxHeight=""+$APP.P.i(d)+"px")},Mna=function(a,b){function c(e){e.stopPropagation();e=e.target.closest("[role\x3dmenuitem]");return $APP.n(e)?($APP.pi(a,"x-context-menu-select",{item:e}),e9.j?e9.j(a,"select"):e9.call(null,a,"select")):null}var d=W8(b);$APP.vj(b,b,"keydown",function(e){var f=e.key,
9
+ h=b.shadowRoot.activeElement;return $APP.y.j(f,"Tab")?e9.j?e9.j(a,"keyboard"):e9.call(null,a,"keyboard"):$APP.y.j(f,"ArrowDown")?(e.preventDefault(),$APP.n(h)?(e=b9(d),h=$APP.dd(e).indexOf(h),h=$APP.B(e,$APP.qd(h+1,$APP.w(e)),null),h=c9(h)):h=c9($APP.t(b9(d))),h):$APP.y.j(f,"ArrowUp")?(e.preventDefault(),$APP.n(h)?(e=b9(d),f=$APP.w(e),h=$APP.dd(e).indexOf(h),h=$APP.B(e,$APP.qd(h+(f-1),f),null),h=c9(h)):h=c9($APP.t(b9(d))),h):($APP.y.j(f,"Enter")||$APP.y.j(f," "))&&$APP.n(h)?(e.preventDefault(),h.click()):
10
+ null},!0);$APP.n(d)&&$APP.vj(b,d,"click",c,!1)},Nna=function(a){function b(d){var e=$APP.l(a,"__xContextMenuLayer");if($APP.n(e)){var f=W8(e);d=d.composedPath();d=$APP.fe(function(h){return h===f},$APP.Ac(d));return $APP.n($APP.n(f)?$APP.p(d):f)?e9.j?e9.j(a,"backdrop"):e9.call(null,a,"backdrop"):null}return null}function c(d){return $APP.y.j(d.key,"Escape")?(d.preventDefault(),e9.j?e9.j(a,"keyboard"):e9.call(null,a,"keyboard")):null}$APP.yj(a,"__xContextMenuDocDeferral",function(){return $APP.n(a.hasAttribute("open"))?
11
+ (document.addEventListener("keydown",c),document.addEventListener("click",b),$APP.R(a,"__xContextMenuDocH",{keydown:c,click:b})):null})},f9=function(a){$APP.xj(a,"__xContextMenuDocDeferral");var b=$APP.l(a,"__xContextMenuDocH");$APP.n(b)&&(document.removeEventListener("keydown",$APP.l(b,"keydown")),document.removeEventListener("click",$APP.l(b,"click")),$APP.R(a,"__xContextMenuDocH",null))},e9=function(a,b){return $APP.n(a.hasAttribute("open"))&&$APP.ri(a,"x-context-menu-close-request",{reason:b})?
12
+ (f9(a),$APP.U(a,"open"),$APP.wj($APP.l(a,"__xContextMenuLayer")),$APP.R(a,"__xContextMenuLayer",null),$APP.R(a,"__xContextMenuAnchor",null),$APP.R(a,"__xContextMenuModel",null),$APP.pi(a,"x-context-menu-close",{reason:b})):null},g9=function(a,b,c){if($APP.n(a.hasAttribute("disabled")))return null;$APP.n($APP.l(a,"__xContextMenuLayer"))&&e9(a,"programmatic");if($APP.ri(a,"x-context-menu-open-request",{reason:c})){var d=a9(a);d=$APP.H(d);var e=$APP.C(d,$APP.Yo),f=$APP.C(d,$APP.Bn),h=$APP.C(d,$8),k=
13
+ Kna(a,h);Lna(a,W8(k));Mna(a,k);d9(k,b,e,f,new $APP.N(null,2,[$APP.Vl,200,$APP.Wl,300],null),h);$APP.T(a,"open","");$APP.R(a,"__xContextMenuLayer",k);$APP.R(a,"__xContextMenuAnchor",b);$APP.R(a,"__xContextMenuModel",d);Nna(a);requestAnimationFrame(function(){var m=W8(k);$APP.n(m)&&d9(k,b,e,f,new $APP.N(null,2,[$APP.Vl,m.offsetWidth,$APP.Wl,m.offsetHeight],null),h);return $APP.n(m)?c9($APP.t(b9(m))):null});return $APP.pi(a,"x-context-menu-open",{reason:c})}return null},Ona=function(a){if(!$APP.fi(a,
14
+ "__xContextMenuInitialized")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("slot");c.textContent=":host{display:contents;}slot{display:none;}";b.appendChild(c);b.appendChild(d);$APP.R(a,"__xContextMenuInitialized",!0)}return $APP.n(a.hasAttribute("open"))?$APP.U(a,"open"):null},Pna=function(a){f9(a);var b=$APP.l(a,"__xContextMenuLayer");return $APP.n(b)?($APP.wj(b),$APP.R(a,"__xContextMenuLayer",null),$APP.R(a,"__xContextMenuAnchor",null),$APP.R(a,
15
+ "__xContextMenuModel",null)):null},Qna=function(a,b,c,d){if($APP.I(c,d))if($APP.y.j(b,"open")&&$APP.p(a.hasAttribute("open"))){if(b=$APP.l(a,"__xContextMenuLayer"),$APP.n(b))return f9(a),$APP.wj(b),$APP.R(a,"__xContextMenuLayer",null),$APP.R(a,"__xContextMenuAnchor",null),$APP.R(a,"__xContextMenuModel",null)}else if(c=$APP.l(a,"__xContextMenuLayer"),b=$APP.n(c)?$APP.y.j(b,"placement")||$APP.y.j(b,"offset")||$APP.y.j(b,"z-index"):c,$APP.n(b)&&(b=a9(a),$APP.I(b,$APP.l(a,"__xContextMenuModel")))){c=
16
+ $APP.l(a,"__xContextMenuLayer");if($APP.n(c)&&(d=$APP.l(a,"__xContextMenuAnchor"),$APP.n(d))){var e=a9(a),f=$APP.H(e);e=$APP.C(f,$APP.Yo);var h=$APP.C(f,$APP.Bn);f=$APP.C(f,$8);var k=W8(c);d9(c,d,e,h,$APP.n(k)?new $APP.N(null,2,[$APP.Vl,k.offsetWidth,$APP.Wl,k.offsetHeight],null):new $APP.N(null,2,[$APP.Vl,200,$APP.Wl,300],null),f)}return $APP.R(a,"__xContextMenuModel",b)}return null},Rna=function(a){Object.defineProperty(a,"openAt",{value:function(b,c){return g9(this,new $APP.N(null,4,[$APP.mr,b,
17
+ $APP.lr,c,$APP.Vl,1,$APP.Wl,1],null),"programmatic")},writable:!0,configurable:!0});Object.defineProperty(a,"toggleAt",{value:function(b,c){return $APP.n(this.hasAttribute("open"))?e9(this,"toggle"):g9(this,new $APP.N(null,4,[$APP.mr,b,$APP.lr,c,$APP.Vl,1,$APP.Wl,1],null),"toggle")},writable:!0,configurable:!0});Object.defineProperty(a,"openForElement",{value:function(b){b=b.getBoundingClientRect();return g9(this,new $APP.N(null,4,[$APP.mr,b.left,$APP.lr,b.top,$APP.Vl,b.width,$APP.Wl,b.height],null),
18
+ "programmatic")},writable:!0,configurable:!0});return Object.defineProperty(a,"close",{value:function(){return e9(this,"programmatic")},writable:!0,configurable:!0})},Tna=function(a){$APP.Ei(a,Sna);return Rna(a)},h9=function(){return $APP.Kh("x-context-menu",new $APP.N(null,5,[$APP.Bh,Una,$APP.zh,Ona,$APP.qh,Pna,$APP.ph,Qna,$APP.Ah,Tna],null))},Z8=new $APP.F(null,"z-index-raw","z-index-raw",-1179679257),$8=new $APP.F(null,"z-index","z-index",1892827090),Y8=new $APP.F(null,"offset-raw","offset-raw",
19
+ -1418404095);var Una=["open","disabled","placement","offset","z-index"],Jna=new $APP.rg(null,new $APP.N(null,6,["right-start",null,"bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null,"left-start",null],null),null),Sna=new $APP.N(null,5,[$APP.Ir,new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"open"],null),$APP.Hk,new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"disabled"],null),$APP.Yo,new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"placement"],null),$APP.Bn,new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"offset"],null),
20
+ new $APP.F(null,"zIndex","zIndex",-1588341609),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"z-index"],null)],null);
21
+ $APP.be(["x-context-menu-open-request",new $APP.N(null,2,[$APP.Mr,!0,$APP.V,new $APP.N(null,1,[$APP.$n,$APP.Y],null)],null),"x-context-menu-open",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,1,[$APP.$n,$APP.Y],null)],null),"x-context-menu-close-request",new $APP.N(null,2,[$APP.Mr,!0,$APP.V,new $APP.N(null,1,[$APP.$n,$APP.Y],null)],null),"x-context-menu-close",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,1,[$APP.$n,$APP.Y],null)],null),"x-context-menu-select",new $APP.N(null,2,[$APP.Mr,
22
+ !1,$APP.V,new $APP.N(null,1,[$APP.Op,$APP.Mq],null)],null)]);$APP.fa("baredom.exports.x_context_menu.init",h9);export const init=h9;
package/dist/x-copy.js CHANGED
@@ -1,22 +1,22 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var IK=function(a){return a==null?!0:$APP.A.j(a,"false")?!1:$APP.A.j(a,"0")?!1:!0},JK=function(a){return typeof a==="string"&&$APP.I(a,"")?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:1200):1200},KK=function(a){return Math.min(1E4,Math.max(100,a))},YK=function(a){var b=$APP.G(a);a=$APP.C(b,LK);var c=$APP.C(b,MK),d=$APP.C(b,NK),e=$APP.C(b,$APP.dm),f=$APP.C(b,$APP.Op),h=$APP.C(b,OK),l=$APP.C(b,PK),m=$APP.C(b,$APP.vi),q=$APP.C(b,QK);b=$APP.C(b,RK);return $APP.Wf([SK,$APP.Gn,TK,UK,VK,$APP.nm,WK,$APP.Bi,
3
- XK,$APP.Rp],[IK(b),$APP.A.j(f,"html")?"html":"text",typeof l==="string"&&$APP.I(l.trim(),"")?l.trim():null,typeof a==="string"&&$APP.I(a.trim(),"")?a.trim():null,KK(JK(c)),typeof d==="string"&&$APP.I(d.trim(),"")?d.trim():null,function(){var r;if(r=typeof h==="string")r=(r=$APP.I(h,""))?h:r;return $APP.n(r)?r:"Copy failed"}(),$APP.D(m),function(){var r;if(r=typeof q==="string")r=(r=$APP.I(q,""))?q:r;return $APP.n(r)?r:"Copied"}(),typeof e==="string"&&$APP.I(e.trim(),"")?e.trim():null])},ZK=function(a){var b=
4
- $APP.G(a);a=$APP.C(b,$APP.Rp);var c=$APP.C(b,$APP.nm),d=$APP.C(b,TK);b=$APP.C(b,$APP.Gn);return{text:$APP.n(a)?a:"",mode:$APP.n(b)?b:"text",from:$APP.n(c)?c:null,fromAttr:$APP.n(d)?d:null}},$K=function(a){var b=$APP.k(a,"__xCopyRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("span"),e=document.createElement("button"),f=document.createElement("slot"),h=document.createElement("span"),l=document.createElement("slot"),m=document.createElement("span");
2
+ var RM=function(a){return a==null?!0:$APP.y.j(a,"false")?!1:$APP.y.j(a,"0")?!1:!0},SM=function(a){return typeof a==="string"&&$APP.I(a,"")?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:1200):1200},TM=function(a){return Math.min(1E4,Math.max(100,a))},gN=function(a){var b=$APP.H(a);a=$APP.C(b,UM);var c=$APP.C(b,VM),d=$APP.C(b,WM),e=$APP.C(b,$APP.an),f=$APP.C(b,$APP.$q),h=$APP.C(b,XM),k=$APP.C(b,YM),m=$APP.C(b,$APP.Wi),q=$APP.C(b,ZM);b=$APP.C(b,$M);return $APP.Yf([aN,$APP.Jo,bN,cN,dN,$APP.mn,eN,$APP.cj,
3
+ fN,$APP.cr],[RM(b),$APP.y.j(f,"html")?"html":"text",typeof k==="string"&&$APP.I(k.trim(),"")?k.trim():null,typeof a==="string"&&$APP.I(a.trim(),"")?a.trim():null,TM(SM(c)),typeof d==="string"&&$APP.I(d.trim(),"")?d.trim():null,function(){var u;if(u=typeof h==="string")u=(u=$APP.I(h,""))?h:u;return $APP.n(u)?u:"Copy failed"}(),$APP.E(m),function(){var u;if(u=typeof q==="string")u=(u=$APP.I(q,""))?q:u;return $APP.n(u)?u:"Copied"}(),typeof e==="string"&&$APP.I(e.trim(),"")?e.trim():null])},hN=function(a){var b=
4
+ $APP.H(a);a=$APP.C(b,$APP.cr);var c=$APP.C(b,$APP.mn),d=$APP.C(b,bN);b=$APP.C(b,$APP.Jo);return{text:$APP.n(a)?a:"",mode:$APP.n(b)?b:"text",from:$APP.n(c)?c:null,fromAttr:$APP.n(d)?d:null}},iN=function(a){var b=$APP.l(a,"__xCopyRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("span"),e=document.createElement("button"),f=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("slot"),m=document.createElement("span");
5
5
  c.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-copy-tooltip-bg:var(--x-color-bg,#1e293b);--x-copy-tooltip-fg:var(--x-color-text,#f8fafc);--x-copy-tooltip-success-bg:var(--x-color-primary,#15803d);--x-copy-tooltip-success-fg:#ffffff;--x-copy-tooltip-error-bg:var(--x-color-danger,#b91c1c);--x-copy-tooltip-error-fg:#fef2f2;--x-copy-tooltip-radius:var(--x-radius-md,6px);--x-copy-tooltip-padding:4px 8px;--x-copy-tooltip-font-size:var(--x-font-size-sm,0.8125rem);--x-copy-tooltip-z:100;}@media (prefers-color-scheme:dark){:host{--x-copy-tooltip-bg:var(--x-color-bg,#0f172a);--x-copy-tooltip-fg:var(--x-color-text,#e2e8f0);--x-copy-tooltip-success-bg:var(--x-color-primary,#166534);--x-copy-tooltip-success-fg:#ffffff;--x-copy-tooltip-error-bg:var(--x-color-danger,#991b1b);--x-copy-tooltip-error-fg:#fee2e2;}}[part\x3dwrap]{display:inline-flex;align-items:center;justify-content:center;}[part\x3dtrigger]{all:unset;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-sizing:border-box;}[part\x3dtrigger]:focus-visible{outline:2px solid currentColor;outline-offset:2px;}:host([disabled]) [part\x3dtrigger]{opacity:0.55;pointer-events:none;cursor:default;}[part\x3dtooltip]{display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);white-space:nowrap;background:var(--x-copy-tooltip-bg);color:var(--x-copy-tooltip-fg);border-radius:var(--x-copy-tooltip-radius);padding:var(--x-copy-tooltip-padding);font-size:var(--x-copy-tooltip-font-size);z-index:var(--x-copy-tooltip-z);pointer-events:none;}:host([data-tooltip-open]) [part\x3dtooltip]{display:block;}:host([data-tooltip-kind\x3dsuccess]) [part\x3dtooltip]{background:var(--x-copy-tooltip-success-bg);color:var(--x-copy-tooltip-success-fg);}:host([data-tooltip-kind\x3derror]) [part\x3dtooltip]{background:var(--x-copy-tooltip-error-bg);color:var(--x-copy-tooltip-error-fg);}@media (prefers-reduced-motion:reduce){[part\x3dtrigger]{transition:none;}}";
6
- d.setAttribute("part","wrap");e.setAttribute("part","trigger");e.setAttribute("type","button");e.appendChild(f);h.setAttribute("part","tooltip");h.setAttribute("role","status");h.setAttribute("aria-live","polite");l.setAttribute("name","tooltip");m.setAttribute("part","tooltip-text");h.appendChild(l);h.appendChild(m);d.appendChild(e);d.appendChild(h);b.appendChild(c);b.appendChild(d);a.__xCopyRefs={root:b,wrap:d,trigger:e,tooltip:h,tooltipSlot:l,tooltipText:m};return $APP.k(a,"__xCopyRefs")},aL=function(a){return YK($APP.Wf([NK,
7
- $APP.dm,$APP.Op,OK,PK,$APP.vi,QK,RK,LK,MK],[a.getAttribute("from"),a.getAttribute("text"),a.getAttribute("mode"),a.getAttribute("error-message"),a.getAttribute("from-attr"),a.hasAttribute("disabled"),a.getAttribute("success-message"),a.getAttribute("show-tooltip"),a.getAttribute("hotkey"),a.getAttribute("tooltip-ms")]))},bL=function(a){var b=$APP.k(a,"__xCopyTextValue");if(typeof b==="string")return b;b=a.getAttribute("text");if(typeof b==="string"&&$APP.I(b,""))return b;b=a.getAttribute("from");
8
- return typeof b==="string"&&$APP.I(b,"")&&(b=document.querySelector(b),$APP.n(b))?(a=a.getAttribute("from-attr"),a=typeof a==="string"&&$APP.I(a,"")?b.getAttribute(a):b.textContent,$APP.n(a)?a:""):""},cL=function(a){var b=bL(a),c=function(){var d=a.getAttribute("mode");return $APP.n(d)?d:"text"}();return new Promise(function(d,e){if($APP.A.j(c,"html")){if($APP.n(function(){var h=navigator.clipboard;return $APP.n(h)?window.ClipboardItem:h}()))return navigator.clipboard.write($APP.$l(new $APP.M(null,
9
- 1,5,$APP.N,[new ClipboardItem({"text/html":new Blob([b],{type:"text/html"}),"text/plain":new Blob([b],{type:"text/plain"})})],null))).then(function(){return d.i?d.i(b):d.call(null,b)}).catch(function(h){return e.i?e.i(h):e.call(null,h)});try{var f=document.createElement("textarea");f.value=b;document.body.appendChild(f);f.select();document.execCommand("copy");f.remove();return d.i?d.i(b):d.call(null,b)}catch(h){if(h instanceof Error)return f=h,e.i?e.i(f):e.call(null,f);throw h;}}else{if($APP.n(navigator.clipboard))return navigator.clipboard.writeText(b).then(function(){return d.i?
10
- d.i(b):d.call(null,b)}).catch(function(h){try{return document.execCommand("copy"),d.i?d.i(b):d.call(null,b)}catch(l){if(l instanceof Error)return e.i?e.i(h):e.call(null,h);throw l;}});try{return f=document.createElement("textarea"),f.value=b,f.style.position="fixed",f.style.opacity="0",document.body.appendChild(f),f.select(),document.execCommand("copy"),f.remove(),d.i?d.i(b):d.call(null,b)}catch(h){if(h instanceof Error)return f=h,e.i?e.i(f):e.call(null,f);throw h;}}})},dL=function(a,b,c,d){var e=
11
- $APP.k(a,"__xCopyRefs");if($APP.n(e)){var f=$APP.k(a,"__xCopyTid");$APP.n(f)&&(clearTimeout(f),a.__xCopyTid=null);$APP.S(a,"data-tooltip-open","");$APP.S(a,"data-tooltip-kind",b);$APP.k(e,"tooltipText").textContent=c;$APP.ja(a,"__xCopyTid",setTimeout(function(){a.__xCopyTid=null;$APP.T(a,"data-tooltip-open");$APP.T(a,"data-tooltip-kind");var h=$APP.k(a,"__xCopyRefs");$APP.n(h)&&($APP.k(h,"tooltipText").textContent="");return null},d))}},eL=function(a){if($APP.n(a.hasAttribute("disabled")))return Promise.resolve(null);
12
- var b=aL(a),c=ZK(b);return $APP.Ph(a,"x-copy-request",c)?cL(a).then(function(d){$APP.Nh(a,"x-copy-success",{text:$APP.n(d)?d:""});$APP.n(SK.i(b))&&dL(a,"success",XK.i(b),VK.i(b));return d}).catch(function(d){$APP.Nh(a,"x-copy-error",{error:""+$APP.V.i(d)});$APP.n(SK.i(b))&&dL(a,"error",WK.i(b),VK.i(b));return Promise.reject(d)}):Promise.resolve(null)},fL=function(a,b){if(typeof b==="string"&&$APP.I(b,"")){var c=b.toLowerCase().split("+");b=$APP.Dc(c);var d=$APP.D($APP.ge(function(h){return $APP.A.j(h,
13
- "ctrl")},c)),e=$APP.D($APP.ge(function(h){return $APP.A.j(h,"shift")},c)),f=$APP.D($APP.ge(function(h){return $APP.A.j(h,"alt")},c));c=$APP.D($APP.ge(function(h){return $APP.A.j(h,"meta")},c));return $APP.A.j(a.key.toLowerCase(),b)&&$APP.A.j(d,a.ctrlKey)&&$APP.A.j(e,a.shiftKey)&&$APP.A.j(f,a.altKey)&&$APP.A.j(c,a.metaKey)}return null},gL=function(a){function b(e){var f=a.getAttribute("hotkey");return $APP.n(fL(e,f))?(e.preventDefault(),eL(a)):null}function c(){return eL(a)}var d=$K(a);$APP.k(d,"trigger").addEventListener("click",
14
- c);document.addEventListener("keydown",b);$APP.ja(a,"__xCopyHandlers",{click:c,keydown:b})},hL=function(a){var b=$APP.k(a,"__xCopyTid");$APP.n(b)&&(clearTimeout(b),a.__xCopyTid=null);b=$APP.k(a,"__xCopyHandlers");var c=$APP.k(a,"__xCopyRefs");if($APP.n($APP.n(b)?c:b)){c=$APP.k(c,"trigger");var d=$APP.k(b,"click");b=$APP.k(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}a.__xCopyHandlers=null},iL=function(a){var b=$K(a),c=a.hasAttribute("disabled");
15
- $APP.k(b,"trigger").disabled=$APP.D(c);$APP.n(c)?$APP.S(a,"aria-disabled","true"):$APP.T(a,"aria-disabled")},jL=function(a){$K(a);hL(a);gL(a);iL(a);return null},kL=function(a){hL(a);return null},lL=function(a,b,c,d){$APP.I(c,d)&&iL(a);return null},mL=function(a){$APP.Uh(a,"text","text");$APP.Uh(a,"from","from");$APP.Uh(a,"fromAttr","from-attr");$APP.Uh(a,"mode","mode");$APP.Uh(a,"successMessage","success-message");$APP.Uh(a,"errorMessage","error-message");$APP.Uh(a,"hotkey","hotkey");$APP.Sh(a,"disabled",
16
- "disabled");Object.defineProperty(a,"showTooltip",{get:function(){return IK(this.getAttribute("show-tooltip"))},set:function(b){return $APP.n(b)?this.setAttribute("show-tooltip","true"):this.setAttribute("show-tooltip","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"tooltipMs",{get:function(){return JK(this.getAttribute("tooltip-ms"))},set:function(b){return b==null?this.removeAttribute("tooltip-ms"):this.setAttribute("tooltip-ms",""+$APP.V.i(b|0))},enumerable:!0,configurable:!0});
17
- Object.defineProperty(a,"textValue",{get:function(){return $APP.k(this,"__xCopyTextValue")},set:function(b){this.__xCopyTextValue=typeof b==="string"?b:void 0},enumerable:!0,configurable:!0});return Object.defineProperty(a,"copy",{value:function(){return eL(this)},enumerable:!0,configurable:!0,writable:!0})},oL=function(){return $APP.Ah("x-copy",new $APP.O(null,5,[$APP.qh,nL,$APP.oh,jL,$APP.lh,kL,$APP.kh,lL,$APP.ph,mL],null))},SK=new $APP.F(null,"show-tooltip?","show-tooltip?",-1214081087),MK=new $APP.F(null,
18
- "tooltip-ms-raw","tooltip-ms-raw",-1973326401),XK=new $APP.F(null,"success-message","success-message",-96541601),OK=new $APP.F(null,"error-message-raw","error-message-raw",1910536231),UK=new $APP.F(null,"hotkey","hotkey",-329017295),WK=new $APP.F(null,"error-message","error-message",1756021561),pL=new $APP.F(null,"fromAttr","fromAttr",-1768252533),PK=new $APP.F(null,"from-attr-raw","from-attr-raw",761657416),VK=new $APP.F(null,"tooltip-ms","tooltip-ms",1062450417),QK=new $APP.F(null,"success-message-raw",
19
- "success-message-raw",388691116),NK=new $APP.F(null,"from-raw","from-raw",-44462428),TK=new $APP.F(null,"from-attr","from-attr",1217901743),LK=new $APP.F(null,"hotkey-raw","hotkey-raw",1972404222),RK=new $APP.F(null,"show-tooltip-raw","show-tooltip-raw",453600717);var nL="text from from-attr mode disabled show-tooltip tooltip-ms success-message error-message hotkey".split(" ");
20
- $APP.Wf([new $APP.F(null,"errorMessage","errorMessage",982744869),$APP.ck,new $APP.F(null,"textValue","textValue",-598870870),$APP.Gn,pL,new $APP.F(null,"tooltipMs","tooltipMs",1056463375),UK,$APP.nm,new $APP.F(null,"showTooltip","showTooltip",482349691),new $APP.F(null,"successMessage","successMessage",-789572803),$APP.Rp],[new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"error-message"],null),new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"disabled"],null),new $APP.O(null,3,[$APP.Q,$APP.X,$APP.W,null,new $APP.F(null,
21
- "note","note",1426297904),"property-only override"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"mode"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"from-attr"],null),new $APP.O(null,2,[$APP.Q,$APP.Y,$APP.W,"tooltip-ms"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"hotkey"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"from"],null),new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"show-tooltip"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"success-message"],null),new $APP.O(null,2,[$APP.Q,$APP.X,
22
- $APP.W,"text"],null)]);$APP.ce(["x-copy-request",new $APP.O(null,2,[$APP.Aq,!0,$APP.U,new $APP.O(null,4,[$APP.Rp,$APP.X,$APP.Gn,$APP.X,$APP.nm,$APP.X,pL,$APP.X],null)],null),"x-copy-success",new $APP.O(null,2,[$APP.Aq,!1,$APP.U,new $APP.O(null,1,[$APP.Rp,$APP.X],null)],null),"x-copy-error",new $APP.O(null,2,[$APP.Aq,!1,$APP.U,new $APP.O(null,1,[$APP.Nm,$APP.X],null)],null)]);$APP.ha("baredom.exports.x_copy.init",oL);export const init=oL;
6
+ $APP.T(d,"part","wrap");$APP.T(e,"part","trigger");$APP.T(e,"type","button");e.appendChild(f);$APP.T(h,"part","tooltip");$APP.T(h,"role","status");$APP.T(h,"aria-live","polite");$APP.T(k,"name","tooltip");$APP.T(m,"part","tooltip-text");h.appendChild(k);h.appendChild(m);d.appendChild(e);d.appendChild(h);b.appendChild(c);b.appendChild(d);$APP.R(a,"__xCopyRefs",{root:b,wrap:d,trigger:e,tooltip:h,tooltipSlot:k,tooltipText:m});return $APP.l(a,"__xCopyRefs")},jN=function(a){return gN($APP.Yf([WM,$APP.an,
7
+ $APP.$q,XM,YM,$APP.Wi,ZM,$M,UM,VM],[a.getAttribute("from"),a.getAttribute("text"),a.getAttribute("mode"),a.getAttribute("error-message"),a.getAttribute("from-attr"),a.hasAttribute("disabled"),a.getAttribute("success-message"),a.getAttribute("show-tooltip"),a.getAttribute("hotkey"),a.getAttribute("tooltip-ms")]))},kN=function(a){var b=$APP.l(a,"__xCopyTextValue");if(typeof b==="string")return b;b=a.getAttribute("text");if(typeof b==="string"&&$APP.I(b,""))return b;b=a.getAttribute("from");return typeof b===
8
+ "string"&&$APP.I(b,"")&&(b=document.querySelector(b),$APP.n(b))?(a=a.getAttribute("from-attr"),a=typeof a==="string"&&$APP.I(a,"")?b.getAttribute(a):b.textContent,$APP.n(a)?a:""):""},lN=function(a){var b=document.createElement("textarea");b.value=a;b.style.position="fixed";b.style.opacity="0";document.body.appendChild(b);b.select();document.execCommand("copy");b.remove()},mN=function(a){var b={};b["text/html"]=new Blob([a],{type:"text/html"});b["text/plain"]=new Blob([a],{type:"text/plain"});return b},
9
+ nN=function(a){return $APP.n(function(){var b=navigator.clipboard;return $APP.n(b)?window.ClipboardItem:b}())?navigator.clipboard.write($APP.Xm(new $APP.K(null,1,5,$APP.M,[new ClipboardItem(mN(a))],null))).then(function(){return a}):new Promise(function(b,c){try{return lN(a),b.i?b.i(a):b.call(null,a)}catch(d){if(d instanceof Error)return b=d,c.i?c.i(b):c.call(null,b);throw d;}})},oN=function(a){return $APP.n(navigator.clipboard)?navigator.clipboard.writeText(a).then(function(){return a}).catch(function(b){return new Promise(function(c,
10
+ d){try{return lN(a),c.i?c.i(a):c.call(null,a)}catch(e){if(e instanceof Error)return d.i?d.i(b):d.call(null,b);throw e;}})}):new Promise(function(b,c){try{return lN(a),b.i?b.i(a):b.call(null,a)}catch(d){if(d instanceof Error)return b=d,c.i?c.i(b):c.call(null,b);throw d;}})},pN=function(a){var b=kN(a);a=a.getAttribute("mode");return $APP.y.j($APP.n(a)?a:"text","html")?nN(b):oN(b)},qN=function(a,b,c,d){var e=$APP.l(a,"__xCopyRefs");if($APP.n(e)){var f=$APP.l(a,"__xCopyTid");$APP.n(f)&&(clearTimeout(f),
11
+ $APP.R(a,"__xCopyTid",null));$APP.T(a,"data-tooltip-open","");$APP.T(a,"data-tooltip-kind",b);$APP.l(e,"tooltipText").textContent=c;$APP.R(a,"__xCopyTid",setTimeout(function(){$APP.R(a,"__xCopyTid",null);$APP.U(a,"data-tooltip-open");$APP.U(a,"data-tooltip-kind");var h=$APP.l(a,"__xCopyRefs");return $APP.n(h)?$APP.l(h,"tooltipText").textContent="":null},d))}},rN=function(a){if($APP.n(a.hasAttribute("disabled")))return Promise.resolve(null);var b=jN(a),c=hN(b);return $APP.ri(a,"x-copy-request",c)?
12
+ pN(a).then(function(d){$APP.pi(a,"x-copy-success",{text:$APP.n(d)?d:""});$APP.n(aN.i(b))&&qN(a,"success",fN.i(b),dN.i(b));return d}).catch(function(d){$APP.pi(a,"x-copy-error",{error:""+$APP.P.i(d)});$APP.n(aN.i(b))&&qN(a,"error",eN.i(b),dN.i(b));return Promise.reject(d)}):Promise.resolve(null)},sN=function(a,b){if(typeof b==="string"&&$APP.I(b,"")){var c=b.toLowerCase().split("+");b=$APP.Ec(c);var d=$APP.E($APP.fe(function(h){return $APP.y.j(h,"ctrl")},c)),e=$APP.E($APP.fe(function(h){return $APP.y.j(h,
13
+ "shift")},c)),f=$APP.E($APP.fe(function(h){return $APP.y.j(h,"alt")},c));c=$APP.E($APP.fe(function(h){return $APP.y.j(h,"meta")},c));return $APP.y.j(a.key.toLowerCase(),b)&&$APP.y.j(d,a.ctrlKey)&&$APP.y.j(e,a.shiftKey)&&$APP.y.j(f,a.altKey)&&$APP.y.j(c,a.metaKey)}return null},tN=function(a){function b(e){var f=a.getAttribute("hotkey");return $APP.n(sN(e,f))?(e.preventDefault(),rN(a)):null}function c(){return rN(a)}var d=iN(a);$APP.l(d,"trigger").addEventListener("click",c);document.addEventListener("keydown",
14
+ b);$APP.R(a,"__xCopyHandlers",{click:c,keydown:b})},uN=function(a){var b=$APP.l(a,"__xCopyTid");$APP.n(b)&&(clearTimeout(b),$APP.R(a,"__xCopyTid",null));b=$APP.l(a,"__xCopyHandlers");var c=$APP.l(a,"__xCopyRefs");if($APP.n($APP.n(b)?c:b)){c=$APP.l(c,"trigger");var d=$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.n(d)&&c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}return $APP.R(a,"__xCopyHandlers",null)},vN=function(a){if($APP.n($APP.l(a,"__xCopyRefs"))){var b=
15
+ jN(a);if($APP.I($APP.l(a,"__xCopyModel"),b)){var c=iN(a);c=$APP.l(c,"trigger");var d=$APP.cj.i(b);c.disabled=$APP.E(d);$APP.n(d)?$APP.T(a,"aria-disabled","true"):$APP.U(a,"aria-disabled");a=$APP.R(a,"__xCopyModel",b)}else a=null;return a}return null},wN=function(a){iN(a);uN(a);tN(a);return vN(a)},xN=function(a){return uN(a)},yN=function(a,b,c,d){return $APP.I(c,d)?vN(a):null},zN=function(a){$APP.yi(a,"text","text");$APP.yi(a,"from","from");$APP.yi(a,"fromAttr","from-attr");$APP.yi(a,"mode","mode");
16
+ $APP.yi(a,"successMessage","success-message");$APP.yi(a,"errorMessage","error-message");$APP.yi(a,"hotkey","hotkey");$APP.ui(a,"disabled","disabled");Object.defineProperty(a,"showTooltip",{get:function(){return RM(this.getAttribute("show-tooltip"))},set:function(b){return $APP.n(b)?$APP.T(this,"show-tooltip","true"):$APP.T(this,"show-tooltip","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"tooltipMs",{get:function(){return SM(this.getAttribute("tooltip-ms"))},set:function(b){return b==
17
+ null?$APP.U(this,"tooltip-ms"):$APP.T(this,"tooltip-ms",""+$APP.P.i(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"textValue",{get:function(){return $APP.l(this,"__xCopyTextValue")},set:function(b){return typeof b==="string"?$APP.R(this,"__xCopyTextValue",b):$APP.R(this,"__xCopyTextValue")},enumerable:!0,configurable:!0});return Object.defineProperty(a,"copy",{value:function(){return rN(this)},enumerable:!0,configurable:!0,writable:!0})},BN=function(){return $APP.Kh("x-copy",new $APP.N(null,
18
+ 5,[$APP.Bh,AN,$APP.zh,wN,$APP.qh,xN,$APP.ph,yN,$APP.Ah,zN],null))},aN=new $APP.F(null,"show-tooltip?","show-tooltip?",-1214081087),VM=new $APP.F(null,"tooltip-ms-raw","tooltip-ms-raw",-1973326401),fN=new $APP.F(null,"success-message","success-message",-96541601),XM=new $APP.F(null,"error-message-raw","error-message-raw",1910536231),cN=new $APP.F(null,"hotkey","hotkey",-329017295),eN=new $APP.F(null,"error-message","error-message",1756021561),CN=new $APP.F(null,"fromAttr","fromAttr",-1768252533),YM=
19
+ new $APP.F(null,"from-attr-raw","from-attr-raw",761657416),dN=new $APP.F(null,"tooltip-ms","tooltip-ms",1062450417),ZM=new $APP.F(null,"success-message-raw","success-message-raw",388691116),WM=new $APP.F(null,"from-raw","from-raw",-44462428),bN=new $APP.F(null,"from-attr","from-attr",1217901743),UM=new $APP.F(null,"hotkey-raw","hotkey-raw",1972404222),$M=new $APP.F(null,"show-tooltip-raw","show-tooltip-raw",453600717);var AN="text from from-attr mode disabled show-tooltip tooltip-ms success-message error-message hotkey".split(" ");
20
+ $APP.Yf([new $APP.F(null,"errorMessage","errorMessage",982744869),$APP.Hk,new $APP.F(null,"textValue","textValue",-598870870),$APP.Jo,CN,new $APP.F(null,"tooltipMs","tooltipMs",1056463375),cN,$APP.mn,new $APP.F(null,"showTooltip","showTooltip",482349691),new $APP.F(null,"successMessage","successMessage",-789572803),$APP.cr],[new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"error-message"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"disabled"],null),new $APP.N(null,3,[$APP.O,$APP.Y,$APP.W,null,new $APP.F(null,
21
+ "note","note",1426297904),"property-only override"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"mode"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"from-attr"],null),new $APP.N(null,2,[$APP.O,$APP.Z,$APP.W,"tooltip-ms"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"hotkey"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"from"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"show-tooltip"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"success-message"],null),new $APP.N(null,2,[$APP.O,$APP.Y,
22
+ $APP.W,"text"],null)]);$APP.be(["x-copy-request",new $APP.N(null,2,[$APP.Mr,!0,$APP.V,new $APP.N(null,4,[$APP.cr,$APP.Y,$APP.Jo,$APP.Y,$APP.mn,$APP.Y,CN,$APP.Y],null)],null),"x-copy-success",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,1,[$APP.cr,$APP.Y],null)],null),"x-copy-error",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,1,[$APP.On,$APP.Y],null)],null)]);$APP.fa("baredom.exports.x_copy.init",BN);export const init=BN;
@@ -22,6 +22,8 @@ export interface XCurrencyField extends HTMLElement {
22
22
  label: string;
23
23
  error: string;
24
24
  required: boolean;
25
+ checkValidity(): boolean;
26
+ reportValidity(): boolean;
25
27
 
26
28
  addEventListener<K extends keyof XCurrencyFieldEventMap>(
27
29
  type: K,
@@ -1,24 +1,25 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var h_=function(a){a=(""+$APP.V.i($APP.n(a)?a:"")).trim().toUpperCase();return $APP.A.j(a,"")?"USD":a},Qda=function(a,b){try{var c=(new Intl.NumberFormat($APP.A.j(b,"")?"en-US":b,{style:"currency",currency:a})).formatToParts(0),d=$APP.ge(function(e){return $APP.A.j("currency",e.type)?e.value:null},$APP.zc(c));return $APP.n(d)?d:a}catch(e){return a}},i_=function(a,b){var c=parseFloat(a);if($APP.n(isNaN(c)))return a;try{return(new Intl.NumberFormat($APP.A.j(b,"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},
3
- Rda=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("label"),f=document.createElement("div"),h=document.createElement("span"),l=document.createElement("input"),m=document.createElement("span"),q=document.createElement("span");c.textContent=":host{display:block;color-scheme:light dark;--x-currency-field-bg:var(--x-color-surface,#ffffff);--x-currency-field-color:var(--x-color-text,#111827);--x-currency-field-border:1px solid var(--x-color-border,#d1d5db);--x-currency-field-border-radius:var(--x-radius-md,6px);--x-currency-field-focus-ring-color:var(--x-color-primary,#2563eb);--x-currency-field-symbol-color:var(--x-color-text-muted,#6b7280);--x-currency-field-label-color:var(--x-color-text-muted,#374151);--x-currency-field-hint-color:var(--x-color-text-muted,#6b7280);--x-currency-field-error-color:var(--x-color-danger,#dc2626);--x-currency-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-currency-field-bg:var(--x-color-surface-hover,#1f2937);--x-currency-field-color:var(--x-color-text,#f9fafb);--x-currency-field-border:1px solid var(--x-color-border,#4b5563);--x-currency-field-focus-ring-color:var(--x-color-primary,#3b82f6);--x-currency-field-symbol-color:var(--x-color-text-muted,#9ca3af);--x-currency-field-label-color:var(--x-color-text-muted,#d1d5db);--x-currency-field-hint-color:var(--x-color-text-muted,#9ca3af);--x-currency-field-error-color:var(--x-color-danger,#f87171);}}[part\x3dfield]{display:flex;flex-direction:column;gap:0.25rem;}[part\x3dlabel]{display:block;font-size:0.875rem;font-weight:500;color:var(--x-currency-field-label-color);}.label-hidden{display:none;}[part\x3dinput-wrapper]{display:flex;align-items:center;background:var(--x-currency-field-bg);border:var(--x-currency-field-border);border-radius:var(--x-currency-field-border-radius);transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dinput-wrapper]:focus-within{border-color:var(--x-currency-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-focus-ring-color) 20%,transparent);}:host([data-invalid]) [part\x3dinput-wrapper]{border-color:var(--x-currency-field-error-color);}:host([data-invalid]) [part\x3dinput-wrapper]:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-error-color) 20%,transparent);}[part\x3dsymbol]{flex-shrink:0;padding:0.5rem 0 0.5rem 0.75rem;font-size:1rem;color:var(--x-currency-field-symbol-color);user-select:none;pointer-events:none;}[part\x3dinput]{flex:1;min-width:0;padding:0.5rem 0.75rem;background:transparent;color:var(--x-currency-field-color);border:none;outline:none;font-size:1rem;line-height:1.5;font-family:inherit;}[part\x3dinput]:disabled{opacity:1;cursor:not-allowed;}:host([disabled]) [part\x3dinput-wrapper]{opacity:var(--x-currency-field-disabled-opacity);cursor:not-allowed;}[part\x3dhint]{display:block;font-size:0.8125rem;color:var(--x-currency-field-hint-color);}.hint-hidden{display:none;}[part\x3derror]{display:block;font-size:0.8125rem;color:var(--x-currency-field-error-color);}.error-hidden{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput-wrapper]{transition:none;}}";
4
- $APP.S(d,"part","field");$APP.S(e,"part","label");$APP.S(e,"id","label");$APP.S(e,"for","input");$APP.S(f,"part","input-wrapper");$APP.S(h,"part","symbol");$APP.S(h,"aria-hidden","true");$APP.S(l,"part","input");$APP.S(l,"id","input");$APP.S(l,"inputmode","decimal");$APP.S(l,"aria-labelledby","label");$APP.S(m,"part","hint");$APP.S(m,"id","hint");$APP.S(m,"aria-live","polite");$APP.S(q,"part","error");$APP.S(q,"id","error");$APP.S(q,"role","alert");$APP.S(q,"aria-live","assertive");f.appendChild(h);
5
- f.appendChild(l);d.appendChild(e);d.appendChild(f);d.appendChild(m);d.appendChild(q);b.appendChild(c);b.appendChild(d);a.__xCurrencyFieldRefs={field:d,label:e,wrapper:f,symbol:h,input:l,hint:m,error:q}},j_=function(a,b,c,d){var e=a.hasAttribute("error");var f=a.getAttribute("error");f=$APP.n(f)?f:"";var h=a.hasAttribute("required"),l=a.getAttribute("min"),m=a.getAttribute("max");a=parseFloat(d);var q=$APP.p(isNaN(a));l=$APP.n(l)?parseFloat(l):null;m=$APP.n(m)?parseFloat(m):null;return $APP.n(e)?b.setValidity({customError:!0},
6
- f,c):$APP.n($APP.n(h)?$APP.A.j(d,""):h)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):$APP.I(d,"")&&!q?b.setValidity({badInput:!0},"Please enter a valid number.",c):$APP.n(q?$APP.n(l)?$APP.p(isNaN(l))&&a<l:l:q)?b.setValidity({rangeUnderflow:!0},"Value must be at least "+$APP.V.i(l)+".",c):$APP.n(q?$APP.n(m)?$APP.p(isNaN(m))&&a>m:m:q)?b.setValidity({rangeOverflow:!0},"Value must be at most "+$APP.V.i(m)+".",c):b.setValidity({},"",c)},o_=function(a){var b=$APP.k(a,"__xCurrencyFieldRefs");
7
- if($APP.n(b)){var c=$APP.k(b,"label"),d=$APP.k(b,"symbol"),e=$APP.k(b,"input"),f=$APP.k(b,"hint");b=$APP.k(b,"error");var h=$APP.Wf([$APP.ui,k_,$APP.ri,$APP.Sm,$APP.hn,$APP.vi,l_,$APP.wi,$APP.mp,$APP.xj,$APP.si,m_,$APP.ti],[a.getAttribute("label"),a.getAttribute("currency"),a.getAttribute("name"),a.getAttribute("error"),a.getAttribute("hint"),a.hasAttribute("disabled"),a.getAttribute("min"),a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("locale"),
8
- a.getAttribute("placeholder")]);var l=$APP.G(h);h=$APP.C(l,$APP.ti);var m=$APP.C(l,$APP.ui),q=$APP.C(l,k_),r=$APP.C(l,$APP.ri),v=$APP.C(l,$APP.Sm),x=$APP.C(l,$APP.hn),z=$APP.C(l,$APP.vi),B=$APP.C(l,l_),E=$APP.C(l,$APP.wi),H=$APP.C(l,$APP.mp),K=$APP.C(l,$APP.xj),J=$APP.C(l,$APP.si);l=$APP.C(l,m_);var P=$APP.n(v)?v:"",ea=$APP.n(x)?x:"",la=$APP.n(m)?m:"";h=$APP.Wf([$APP.lo,$APP.Ci,$APP.Cj,$APP.Ai,$APP.Dm,$APP.or,$APP.zi,$APP.Eh,$APP.Sp,$APP.np,$APP.nq,n_,$APP.hp,$APP.Z,$APP.Nm,$APP.Bi],[$APP.n(B)?B:
9
- "",$APP.D(E),$APP.D(K),$APP.n(h)?h:"",typeof x==="string"&&$APP.I(x,""),$APP.n(l)?l:"",$APP.n(r)?r:"",$APP.n(J)?J:"",typeof m==="string"&&$APP.I(m,""),typeof v==="string"&&$APP.I(v,""),ea,h_(q),$APP.n(H)?H:"",la,P,$APP.D(z)]);m=$APP.np.i(h);$APP.n(m)?q=null:(v=$APP.G(h),q=$APP.C(v,$APP.Eh),r=$APP.C(v,$APP.lo),v=$APP.C(v,$APP.hp),x=parseFloat(q),z=$APP.I(q,"")&&$APP.p(isNaN(x)),B=$APP.I(r,"")?parseFloat(r):null,E=$APP.I(v,"")?parseFloat(v):null,q=$APP.I(q,"")&&!z?"Please enter a valid number.":$APP.n(z?
10
- $APP.n(B)?$APP.p(isNaN(B))&&x<B:B:z)?"Value must be at least "+$APP.V.i(r)+".":$APP.n(z?$APP.n(E)?$APP.p(isNaN(E))&&x>E:E:z)?"Value must be at most "+$APP.V.i(v)+".":"");r=q;q=$APP.n(m)?m:$APP.I($APP.n(r)?r:"","");m=$APP.n(m)?$APP.Nm.i(h):$APP.n(r)?r:"";r=$APP.Dm.i(h);v=$APP.Sp.i(h);z=n_.i(h);x=$APP.or.i(h);d.textContent=Qda(z,x);e.name=$APP.zi.i(h);e.placeholder=$APP.Ai.i(h);e.disabled=$APP.Bi.i(h);e.readOnly=$APP.Cj.i(h);e.required=$APP.Ci.i(h);$APP.S(e,"aria-required",$APP.n($APP.Ci.i(h))?"true":
11
- "false");$APP.S(e,"aria-invalid",$APP.n(q)?"true":"false");d=$APP.n($APP.n(r)?q:r)?"hint error":$APP.n(r)?"hint":$APP.n(q)?"error":null;$APP.n(d)?$APP.S(e,"aria-describedby",d):$APP.T(e,"aria-describedby");$APP.A.j(e,a.shadowRoot.activeElement)||(d=$APP.Eh.i(h),e.value=$APP.A.j(d,"")?"":i_(d,x));c.textContent=$APP.Z.i(h);$APP.n(v)?c.classList.remove("label-hidden"):c.classList.add("label-hidden");f.textContent=$APP.nq.i(h);$APP.n(r)?f.classList.remove("hint-hidden"):f.classList.add("hint-hidden");
12
- b.textContent=m;$APP.n(q)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");$APP.Ih(a,"data-invalid",q);c=$APP.k(a,"__xCurrencyFieldInternals");$APP.n(c)?(f=a.getAttribute("value"),a=j_(a,c,e,$APP.n(f)?f:"")):a=null;return a}return null},Sda=function(a){return function(){var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=a.getAttribute("value");return b.value=$APP.n(c)?c:""}return null}},Tda=function(a){return function(){var b=$APP.k(a,"__xCurrencyFieldRefs");
13
- if($APP.n(b)){b=$APP.k(b,"input");var c=b.value,d=function(){var f=a.getAttribute("value");return $APP.n(f)?f:""}(),e=function(){var f=a.getAttribute("name");return $APP.n(f)?f:""}();return $APP.Ph(a,"x-currency-field-change-request",{name:e,value:c,previousValue:d})?(d=$APP.k(a,"__xCurrencyFieldInternals"),$APP.n(d)&&(d.setFormValue(c),j_(a,d,b,c)),$APP.Nh(a,"x-currency-field-input",{name:e,value:c})):b.value=d}return null}},Uda=function(a){return function(){var b=$APP.k(a,"__xCurrencyFieldRefs");
14
- if($APP.n(b)){b=$APP.k(b,"input");var c=b.value,d=parseFloat(c);c=$APP.n(isNaN(d))?c:""+$APP.V.i(d);var e=function(){var f=a.getAttribute("value");return $APP.n(f)?f:""}();d=function(){var f=a.getAttribute("name");return $APP.n(f)?f:""}();return $APP.Ph(a,"x-currency-field-change-request",{name:d,value:c,previousValue:e})?($APP.S(a,"value",c),e=$APP.k(a,"__xCurrencyFieldInternals"),$APP.n(e)&&(e.setFormValue(c),j_(a,e,b,c)),$APP.Nh(a,"x-currency-field-change",{name:d,value:c})):b.value=e}return null}},
15
- Vda=function(a){var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=Sda(a),d=Tda(a),e=Uda(a);b.addEventListener("focus",c);b.addEventListener("input",d);b.addEventListener("change",e);a.__xCurrencyFieldHandlers={focus:c,input:d,change:e}}},p_=function(a){var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.k(a,"__xCurrencyFieldHandlers");if($APP.n(c)){b=$APP.k(b,"input");b.removeEventListener("focus",$APP.k(c,"focus"));b.removeEventListener("input",$APP.k(c,"input"));
16
- b.removeEventListener("change",$APP.k(c,"change"));a.__xCurrencyFieldHandlers=null;return}}return null},Wda=function(a,b){$APP.Ih(a,"disabled",$APP.D(b));return o_(a)},Xda=function(a){$APP.T(a,"value");var b=$APP.k(a,"__xCurrencyFieldRefs");$APP.n(b)&&($APP.k(b,"input").value="");b=$APP.k(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue("");return o_(a)},Yda=function(a){$APP.n($APP.k(a,"__xCurrencyFieldRefs"))||(Rda(a),$APP.n(a.attachInternals)&&$APP.ja(a,"__xCurrencyFieldInternals",a.attachInternals()));
17
- p_(a);var b=$APP.k(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=a.getAttribute("value");h_(a.getAttribute("currency"));var d=function(){var e=a.getAttribute("locale");return $APP.n(e)?e:""}();$APP.n(c)&&(b.value=i_(c,d))}b=$APP.k(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue(function(){var e=a.getAttribute("value");return $APP.n(e)?e:""}());Vda(a);return o_(a)},Zda=function(a){return p_(a)},$da=function(a,b,c,d){$APP.A.j(b,"value")&&(b=$APP.k(a,"__xCurrencyFieldRefs"),
18
- $APP.n(b)&&(b=$APP.k(b,"input"),$APP.A.j(b,a.shadowRoot.activeElement)||(h_(a.getAttribute("currency")),c=a.getAttribute("locale"),c=$APP.n(c)?c:"",b.value=d==null||$APP.A.j(d,"")?"":i_(d,c))));return o_(a)},aea=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.I(b)?""+$APP.V.i(b):"";$APP.S(this,"value",b);var c=$APP.k(this,"__xCurrencyFieldRefs");if($APP.n(c)){c=$APP.k(c,
19
- "input");h_(this.getAttribute("currency"));var d=this.getAttribute("locale");d=$APP.n(d)?d:"";return $APP.A.j(c,this.shadowRoot.activeElement)?null:c.value=$APP.A.j(b,"")?"":i_(b,d)}return null}})},bea=function(a){aea(a);$APP.Th(a,"name","name","");$APP.Th(a,"currency","currency","");$APP.Th(a,"locale","locale","");$APP.Th(a,"min","min","");$APP.Th(a,"max","max","");$APP.Th(a,"placeholder","placeholder","");$APP.Th(a,"label","label","");$APP.Th(a,"hint","hint","");$APP.Th(a,"error","error","");$APP.Sh(a,
20
- "disabled","disabled");$APP.Sh(a,"readOnly","readonly");$APP.Sh(a,"required","required");a.checkValidity=function(){var b=$APP.k(this,"__xCurrencyFieldInternals");return $APP.n(b)?b.checkValidity():!0};return a.reportValidity=function(){var b=$APP.k(this,"__xCurrencyFieldInternals");return $APP.n(b)?b.reportValidity():!0}},q_=function(){return $APP.Ah("x-currency-field",new $APP.O(null,8,[$APP.qh,cea,$APP.oh,Yda,$APP.lh,Zda,$APP.kh,$da,$APP.mh,!0,$APP.jh,Wda,$APP.ih,Xda,$APP.ph,bea],null))},l_=new $APP.F(null,
21
- "min-raw","min-raw",183137548),n_=new $APP.F(null,"currency","currency",-898327568),m_=new $APP.F(null,"locale-raw","locale-raw",385401846),k_=new $APP.F(null,"currency-raw","currency-raw",1169887491);var cea="name value currency locale min max placeholder label hint error disabled required readonly".split(" ");
22
- $APP.Wf([$APP.lo,$APP.Ai,$APP.ck,$APP.or,$APP.zi,$APP.Eh,$APP.nq,n_,$APP.Cq,$APP.hp,$APP.Z,$APP.Nm,$APP.Ho],[new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"min"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"placeholder"],null),new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"disabled"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"locale"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"name"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"value"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"hint"],null),
23
- new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"currency"],null),new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"readonly"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"max"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"label"],null),new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"error"],null),new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"required"],null)]);
24
- $APP.ce(["x-currency-field-change-request",new $APP.O(null,2,[$APP.Aq,!0,$APP.U,new $APP.O(null,3,[$APP.zi,$APP.X,$APP.Eh,$APP.X,$APP.dp,$APP.X],null)],null),"x-currency-field-input",new $APP.O(null,2,[$APP.Aq,!1,$APP.U,new $APP.O(null,2,[$APP.zi,$APP.X,$APP.Eh,$APP.X],null)],null),"x-currency-field-change",new $APP.O(null,2,[$APP.Aq,!1,$APP.U,new $APP.O(null,2,[$APP.zi,$APP.X,$APP.Eh,$APP.X],null)],null)]);$APP.ha("baredom.exports.x_currency_field.init",q_);export const init=q_;
2
+ var QZ=function(a){a=(""+$APP.P.i($APP.n(a)?a:"")).trim().toUpperCase();return $APP.y.j(a,"")?"USD":a},rga=function(a,b){try{var c=(new Intl.NumberFormat($APP.y.j(b,"")?"en-US":b,{style:"currency",currency:a})).formatToParts(0),d=$APP.fe(function(e){return $APP.y.j("currency",e.type)?e.value:null},$APP.Ac(c));return $APP.n(d)?d:a}catch(e){return a}},RZ=function(a,b){var c=parseFloat(a);if($APP.n(isNaN(c)))return a;try{return(new Intl.NumberFormat($APP.y.j(b,"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},
3
+ sga=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("label"),f=document.createElement("div"),h=document.createElement("span"),k=document.createElement("input"),m=document.createElement("span"),q=document.createElement("span"),u={};c.textContent=":host{display:block;color-scheme:light dark;--x-currency-field-bg:var(--x-color-surface,#ffffff);--x-currency-field-color:var(--x-color-text,#111827);--x-currency-field-border:1px solid var(--x-color-border,#d1d5db);--x-currency-field-border-radius:var(--x-radius-md,6px);--x-currency-field-focus-ring-color:var(--x-color-primary,#2563eb);--x-currency-field-symbol-color:var(--x-color-text-muted,#6b7280);--x-currency-field-label-color:var(--x-color-text-muted,#374151);--x-currency-field-hint-color:var(--x-color-text-muted,#6b7280);--x-currency-field-error-color:var(--x-color-danger,#dc2626);--x-currency-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-currency-field-bg:var(--x-color-surface-hover,#1f2937);--x-currency-field-color:var(--x-color-text,#f9fafb);--x-currency-field-border:1px solid var(--x-color-border,#4b5563);--x-currency-field-focus-ring-color:var(--x-color-primary,#3b82f6);--x-currency-field-symbol-color:var(--x-color-text-muted,#9ca3af);--x-currency-field-label-color:var(--x-color-text-muted,#d1d5db);--x-currency-field-hint-color:var(--x-color-text-muted,#9ca3af);--x-currency-field-error-color:var(--x-color-danger,#f87171);}}[part\x3dfield]{display:flex;flex-direction:column;gap:0.25rem;}[part\x3dlabel]{display:block;font-size:0.875rem;font-weight:500;color:var(--x-currency-field-label-color);}.label-hidden{display:none;}[part\x3dinput-wrapper]{display:flex;align-items:center;background:var(--x-currency-field-bg);border:var(--x-currency-field-border);border-radius:var(--x-currency-field-border-radius);transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dinput-wrapper]:focus-within{border-color:var(--x-currency-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-focus-ring-color) 20%,transparent);}:host([data-invalid]) [part\x3dinput-wrapper]{border-color:var(--x-currency-field-error-color);}:host([data-invalid]) [part\x3dinput-wrapper]:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-error-color) 20%,transparent);}[part\x3dsymbol]{flex-shrink:0;padding:0.5rem 0 0.5rem 0.75rem;font-size:1rem;color:var(--x-currency-field-symbol-color);user-select:none;pointer-events:none;}[part\x3dinput]{flex:1;min-width:0;padding:0.5rem 0.75rem;background:transparent;color:var(--x-currency-field-color);border:none;outline:none;font-size:1rem;line-height:1.5;font-family:inherit;}[part\x3dinput]:disabled{opacity:1;cursor:not-allowed;}:host([disabled]) [part\x3dinput-wrapper]{opacity:var(--x-currency-field-disabled-opacity);cursor:not-allowed;}[part\x3dhint]{display:block;font-size:0.8125rem;color:var(--x-currency-field-hint-color);}.hint-hidden{display:none;}[part\x3derror]{display:block;font-size:0.8125rem;color:var(--x-currency-field-error-color);}.error-hidden{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput-wrapper]{transition:none;}}";
4
+ $APP.T(d,"part","field");$APP.T(e,"part","label");$APP.T(e,"id","label");$APP.T(e,"for","input");$APP.T(f,"part","input-wrapper");$APP.T(h,"part","symbol");$APP.T(h,"aria-hidden","true");$APP.T(k,"part","input");$APP.T(k,"id","input");$APP.T(k,"inputmode","decimal");$APP.T(k,"aria-labelledby","label");$APP.T(m,"part","hint");$APP.T(m,"id","hint");$APP.T(m,"aria-live","polite");$APP.T(q,"part","error");$APP.T(q,"id","error");$APP.T(q,"role","alert");$APP.T(q,"aria-live","assertive");f.appendChild(h);
5
+ f.appendChild(k);d.appendChild(e);d.appendChild(f);d.appendChild(m);d.appendChild(q);b.appendChild(c);b.appendChild(d);u.field=d;u.label=e;u.wrapper=f;u.symbol=h;u.input=k;u.hint=m;u.error=q;$APP.R(a,"__xCurrencyFieldRefs",u)},SZ=function(a,b,c,d){var e=a.hasAttribute("error");var f=a.getAttribute("error");f=$APP.n(f)?f:"";var h=a.hasAttribute("required"),k=a.getAttribute("min"),m=a.getAttribute("max");a=parseFloat(d);var q=$APP.p(isNaN(a));k=$APP.n(k)?parseFloat(k):null;m=$APP.n(m)?parseFloat(m):
6
+ null;$APP.n(e)?b.setValidity({customError:!0},f,c):$APP.n($APP.n(h)?$APP.y.j(d,""):h)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):$APP.I(d,"")&&!q?b.setValidity({badInput:!0},"Please enter a valid number.",c):$APP.n(q?$APP.n(k)?$APP.p(isNaN(k))&&a<k:k:q)?b.setValidity({rangeUnderflow:!0},"Value must be at least "+$APP.P.i(k)+".",c):$APP.n(q?$APP.n(m)?$APP.p(isNaN(m))&&a>m:m:q)?b.setValidity({rangeOverflow:!0},"Value must be at most "+$APP.P.i(m)+".",c):b.setValidity({},"",c)},
7
+ TZ=function(a,b,c,d){a.textContent=b;$APP.n(c)?a.classList.remove(d):a.classList.add(d)},ZZ=function(a){if($APP.n($APP.l(a,"__xCurrencyFieldRefs"))){var b=$APP.Yf([$APP.Vi,UZ,$APP.Si,$APP.Un,$APP.ko,$APP.Wi,VZ,$APP.Xi,$APP.yq,$APP.hk,$APP.Ti,WZ,$APP.Ui],[a.getAttribute("label"),a.getAttribute("currency"),a.getAttribute("name"),a.getAttribute("error"),a.getAttribute("hint"),a.hasAttribute("disabled"),a.getAttribute("min"),a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),
8
+ a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var c=$APP.H(b);b=$APP.C(c,$APP.Ui);var d=$APP.C(c,$APP.Vi),e=$APP.C(c,UZ),f=$APP.C(c,$APP.Si),h=$APP.C(c,$APP.Un),k=$APP.C(c,$APP.ko),m=$APP.C(c,$APP.Wi),q=$APP.C(c,VZ),u=$APP.C(c,$APP.Xi),x=$APP.C(c,$APP.yq),z=$APP.C(c,$APP.hk),A=$APP.C(c,$APP.Ti);c=$APP.C(c,WZ);var D=$APP.n(h)?h:"",G=$APP.n(k)?k:"",J=$APP.n(d)?d:"";b=$APP.Yf([$APP.Dp,$APP.dj,$APP.mk,$APP.aj,$APP.Dn,$APP.Cs,$APP.$i,$APP.ei,$APP.dr,$APP.zq,$APP.zr,XZ,
9
+ $APP.sq,$APP.bj,$APP.On,$APP.cj],[$APP.n(q)?q:"",$APP.E(u),$APP.E(z),$APP.n(b)?b:"",typeof k==="string"&&$APP.I(k,""),$APP.n(c)?c:"",$APP.n(f)?f:"",$APP.n(A)?A:"",typeof d==="string"&&$APP.I(d,""),typeof h==="string"&&$APP.I(h,""),G,QZ(e),$APP.n(x)?x:"",J,D,$APP.E(m)]);$APP.I($APP.l(a,"__xCurrencyFieldModel"),b)?(f=$APP.l(a,"__xCurrencyFieldRefs"),$APP.n(f)?(h=$APP.l(f,"label"),q=$APP.l(f,"symbol"),d=$APP.l(f,"input"),e=$APP.l(f,"hint"),f=$APP.l(f,"error"),u=$APP.H(b),k=$APP.C(u,$APP.zq),m=$APP.C(u,
10
+ $APP.On),$APP.n(k)?u=null:(z=$APP.H(u),u=$APP.C(z,$APP.ei),x=$APP.C(z,$APP.Dp),z=$APP.C(z,$APP.sq),A=parseFloat(u),c=$APP.I(u,"")&&$APP.p(isNaN(A)),D=$APP.I(x,"")?parseFloat(x):null,G=$APP.I(z,"")?parseFloat(z):null,u=$APP.I(u,"")&&!c?"Please enter a valid number.":$APP.n(c?$APP.n(D)?$APP.p(isNaN(D))&&A<D:D:c)?"Value must be at least "+$APP.P.i(x)+".":$APP.n(c?$APP.n(G)?$APP.p(isNaN(G))&&A>G:G:c)?"Value must be at most "+$APP.P.i(z)+".":""),k=new $APP.N(null,2,[$APP.zq,$APP.n(k)?k:$APP.I($APP.n(u)?
11
+ u:"",""),YZ,$APP.n(k)?m:$APP.n(u)?u:""],null),m=$APP.H(k),k=$APP.C(m,$APP.zq),m=$APP.C(m,YZ),x=$APP.H(b),u=$APP.C(x,XZ),x=$APP.C(x,$APP.Cs),q.textContent=rga(u,x),A=$APP.H(b),q=$APP.C(A,$APP.$i),u=$APP.C(A,$APP.aj),x=$APP.C(A,$APP.cj),z=$APP.C(A,$APP.mk),A=$APP.C(A,$APP.dj),d.name=q,d.placeholder=u,d.disabled=x,d.readOnly=z,d.required=A,$APP.T(d,"aria-required",$APP.n($APP.dj.i(b))?"true":"false"),$APP.T(d,"aria-invalid",$APP.n(k)?"true":"false"),q=$APP.H(b),q=$APP.C(q,$APP.Dn),q=$APP.n($APP.n(q)?
12
+ k:q)?"hint error":$APP.n(q)?"hint":$APP.n(k)?"error":null,$APP.n(q)?$APP.T(d,"aria-describedby",q):$APP.U(d,"aria-describedby"),u=$APP.H(b),q=$APP.C(u,$APP.ei),$APP.C(u,XZ),u=$APP.C(u,$APP.Cs),$APP.y.j(d,a.shadowRoot.activeElement)||(d.value=$APP.y.j(q,"")?"":RZ(q,u)),u=$APP.H(b),q=$APP.C(u,$APP.bj),u=$APP.C(u,$APP.dr),TZ(h,q,u,"label-hidden"),q=$APP.H(b),h=$APP.C(q,$APP.zr),q=$APP.C(q,$APP.Dn),TZ(e,h,q,"hint-hidden"),TZ(f,m,k,"error-hidden"),$APP.ki(a,"data-invalid",k),e=$APP.l(a,"__xCurrencyFieldInternals"),
13
+ $APP.n(e)&&(f=a.getAttribute("value"),SZ(a,e,d,$APP.n(f)?f:"")),a=$APP.R(a,"__xCurrencyFieldModel",b)):a=null):a=null;return a}return null},tga=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value,d=function(){var f=a.getAttribute("value");return $APP.n(f)?f:""}(),e=function(){var f=a.getAttribute("name");return $APP.n(f)?f:""}();return $APP.ri(a,"x-currency-field-change-request",{name:e,value:c,previousValue:d})?(d=$APP.l(a,"__xCurrencyFieldInternals"),
14
+ $APP.n(d)&&(d.setFormValue(c),SZ(a,d,b,c)),$APP.pi(a,"x-currency-field-input",{name:e,value:c})):b.value=d}return null},uga=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value,d=parseFloat(c);c=$APP.n(isNaN(d))?c:""+$APP.P.i(d);var e=function(){var f=a.getAttribute("value");return $APP.n(f)?f:""}();d=function(){var f=a.getAttribute("name");return $APP.n(f)?f:""}();return $APP.ri(a,"x-currency-field-change-request",{name:d,value:c,previousValue:e})?($APP.T(a,
15
+ "value",c),e=$APP.l(a,"__xCurrencyFieldInternals"),$APP.n(e)&&(e.setFormValue(c),SZ(a,e,b,c)),$APP.pi(a,"x-currency-field-change",{name:d,value:c})):b.value=e}return null},vga=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=function(){var h=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(h)){h=$APP.l(h,"input");var k=a.getAttribute("value");h=h.value=$APP.n(k)?k:""}else h=null;return h},d=function(){return tga(a)},e=function(){return uga(a)},f={};b.addEventListener("focus",
16
+ c);b.addEventListener("input",d);b.addEventListener("change",e);f.focus=c;f.input=d;f.change=e;$APP.R(a,"__xCurrencyFieldHandlers",f)}},$Z=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.l(a,"__xCurrencyFieldHandlers");if($APP.n(c))return b=$APP.l(b,"input"),b.removeEventListener("focus",$APP.l(c,"focus")),b.removeEventListener("input",$APP.l(c,"input")),b.removeEventListener("change",$APP.l(c,"change")),$APP.R(a,"__xCurrencyFieldHandlers",null)}return null},wga=function(a,
17
+ b){$APP.ki(a,"disabled",$APP.E(b));return ZZ(a)},xga=function(a){$APP.U(a,"value");var b=$APP.l(a,"__xCurrencyFieldRefs");$APP.n(b)&&($APP.l(b,"input").value="");b=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue("");return ZZ(a)},yga=function(a){$APP.n($APP.l(a,"__xCurrencyFieldRefs"))||(sga(a),$APP.n(a.attachInternals)&&$APP.R(a,"__xCurrencyFieldInternals",a.attachInternals()));$Z(a);var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");
18
+ QZ(a.getAttribute("currency"));var d=function(){var e=a.getAttribute("locale");return $APP.n(e)?e:""}();$APP.n(c)&&(b.value=RZ(c,d))}b=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue(function(){var e=a.getAttribute("value");return $APP.n(e)?e:""}());vga(a);return ZZ(a)},zga=function(a){return $Z(a)},Aga=function(a,b,c,d){return $APP.I(c,d)?($APP.y.j(b,"value")&&(b=$APP.l(a,"__xCurrencyFieldRefs"),$APP.n(b)&&(b=$APP.l(b,"input"),$APP.y.j(b,a.shadowRoot.activeElement)||(QZ(a.getAttribute("currency")),
19
+ c=a.getAttribute("locale"),c=$APP.n(c)?c:"",b.value=d==null||$APP.y.j(d,"")?"":RZ(d,c)))),ZZ(a)):null},Bga=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.I(b)?""+$APP.P.i(b):"";$APP.T(this,"value",b);var c=$APP.l(this,"__xCurrencyFieldRefs");if($APP.n(c)){c=$APP.l(c,"input");QZ(this.getAttribute("currency"));var d=this.getAttribute("locale");d=$APP.n(d)?d:"";return $APP.y.j(c,
20
+ this.shadowRoot.activeElement)?null:c.value=$APP.y.j(b,"")?"":RZ(b,d)}return null}})},Cga=function(a){Object.defineProperty(a,"checkValidity",{value:function(){var b=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(b)?b.checkValidity():!0},writable:!0,configurable:!0});return Object.defineProperty(a,"reportValidity",{value:function(){var b=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(b)?b.reportValidity():!0},writable:!0,configurable:!0})},Dga=function(a){Bga(a);$APP.xi(a,"name","name",
21
+ "");$APP.xi(a,"currency","currency","");$APP.xi(a,"locale","locale","");$APP.xi(a,"min","min","");$APP.xi(a,"max","max","");$APP.xi(a,"placeholder","placeholder","");$APP.xi(a,"label","label","");$APP.xi(a,"hint","hint","");$APP.xi(a,"error","error","");$APP.ui(a,"disabled","disabled");$APP.ui(a,"readOnly","readonly");$APP.ui(a,"required","required");return Cga(a)},a_=function(){return $APP.Kh("x-currency-field",new $APP.N(null,8,[$APP.Bh,Ega,$APP.zh,yga,$APP.qh,zga,$APP.ph,Aga,$APP.rh,!0,$APP.oh,
22
+ wga,$APP.nh,xga,$APP.Ah,Dga],null))},VZ=new $APP.F(null,"min-raw","min-raw",183137548),XZ=new $APP.F(null,"currency","currency",-898327568),YZ=new $APP.F(null,"display-error","display-error",-179691836),WZ=new $APP.F(null,"locale-raw","locale-raw",385401846),UZ=new $APP.F(null,"currency-raw","currency-raw",1169887491);var Ega="name value currency locale min max placeholder label hint error disabled required readonly".split(" ");
23
+ $APP.Yf([$APP.Dp,$APP.aj,$APP.Hk,$APP.Cs,$APP.$i,$APP.ei,$APP.zr,XZ,$APP.Or,$APP.sq,$APP.bj,$APP.On,$APP.Zp],[new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"min"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"placeholder"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"disabled"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"locale"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"name"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"value"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"hint"],null),
24
+ new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"currency"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"readonly"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"max"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"label"],null),new $APP.N(null,2,[$APP.O,$APP.Y,$APP.W,"error"],null),new $APP.N(null,2,[$APP.O,$APP.Ci,$APP.W,"required"],null)]);
25
+ $APP.be(["x-currency-field-change-request",new $APP.N(null,2,[$APP.Mr,!0,$APP.V,new $APP.N(null,3,[$APP.$i,$APP.Y,$APP.ei,$APP.Y,$APP.oq,$APP.Y],null)],null),"x-currency-field-input",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,2,[$APP.$i,$APP.Y,$APP.ei,$APP.Y],null)],null),"x-currency-field-change",new $APP.N(null,2,[$APP.Mr,!1,$APP.V,new $APP.N(null,2,[$APP.$i,$APP.Y,$APP.ei,$APP.Y],null)],null)]);$APP.fa("baredom.exports.x_currency_field.init",a_);export const init=a_;
@@ -17,6 +17,9 @@ export interface XDatePicker extends HTMLElement {
17
17
  readOnly: boolean;
18
18
  required: boolean;
19
19
  open: boolean;
20
+ focus(): void;
21
+ commit(): void;
22
+ clear(): void;
20
23
 
21
24
  addEventListener<K extends keyof XDatePickerEventMap>(
22
25
  type: K,