@pg-labs-incubator/cobweb 0.0.5 → 0.0.7

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 (137) hide show
  1. package/package.json +7 -4
  2. package/src/action/button.yaml +9 -0
  3. package/target/esbuild/action/action.css +1 -1
  4. package/target/esbuild/action/base.jsx +1 -1
  5. package/target/esbuild/action/button.jsx +6 -4
  6. package/target/esbuild/action/fab-menu-context.jsx +1 -1
  7. package/target/esbuild/action/fab-menu.jsx +3 -3
  8. package/target/esbuild/action/fab.jsx +3 -3
  9. package/target/esbuild/action/group.jsx +7 -7
  10. package/target/esbuild/action/icon-button.jsx +3 -3
  11. package/target/esbuild/action/index.jsx +1 -1
  12. package/target/esbuild/action/progress-button.css +1 -0
  13. package/target/esbuild/action/progress-button.jsx +4 -0
  14. package/target/esbuild/action/split-button.jsx +4 -4
  15. package/target/esbuild/color/contrast.jsx +1 -1
  16. package/target/esbuild/color/dynamic.jsx +1 -1
  17. package/target/esbuild/color/hct.jsx +1 -1
  18. package/target/esbuild/color/index.jsx +1 -1
  19. package/target/esbuild/color/palette.jsx +1 -1
  20. package/target/esbuild/color/scheme.jsx +1 -1
  21. package/target/esbuild/color/temperature.jsx +1 -1
  22. package/target/esbuild/container/card.jsx +1 -1
  23. package/target/esbuild/container/elevation-shadow.jsx +1 -1
  24. package/target/esbuild/container/index.jsx +1 -1
  25. package/target/esbuild/dom/client.jsx +1 -1
  26. package/target/esbuild/dom/index.jsx +1 -1
  27. package/target/esbuild/dom/server.jsx +1 -1
  28. package/target/esbuild/dom/types.jsx +1 -1
  29. package/target/esbuild/feedback/badge.jsx +6 -6
  30. package/target/esbuild/feedback/focus.jsx +1 -1
  31. package/target/esbuild/feedback/index.jsx +1 -1
  32. package/target/esbuild/feedback/loading.jsx +3 -3
  33. package/target/esbuild/feedback/observe.jsx +1 -1
  34. package/target/esbuild/feedback/progress.jsx +9 -9
  35. package/target/esbuild/feedback/snackbar.jsx +6 -6
  36. package/target/esbuild/feedback/tooltip.jsx +6 -6
  37. package/target/esbuild/icon/icon.jsx +1 -1
  38. package/target/esbuild/icon/index.jsx +1 -1
  39. package/target/esbuild/index.jsx +1 -1
  40. package/target/esbuild/input/autocomplete.jsx +2 -2
  41. package/target/esbuild/input/base.jsx +2 -2
  42. package/target/esbuild/input/date-picker.jsx +19 -19
  43. package/target/esbuild/input/date-time.jsx +3 -3
  44. package/target/esbuild/input/index.jsx +1 -1
  45. package/target/esbuild/input/paired-input.jsx +1 -1
  46. package/target/esbuild/input/picker-dialog.jsx +3 -3
  47. package/target/esbuild/input/select.jsx +4 -4
  48. package/target/esbuild/input/slider.jsx +7 -7
  49. package/target/esbuild/input/text-field.jsx +4 -4
  50. package/target/esbuild/input/time-picker.jsx +5 -5
  51. package/target/esbuild/motion/follow-height.jsx +1 -0
  52. package/target/esbuild/motion/frame.jsx +1 -1
  53. package/target/esbuild/motion/index.jsx +1 -1
  54. package/target/esbuild/motion/material.jsx +1 -1
  55. package/target/esbuild/motion/motion.jsx +1 -1
  56. package/target/esbuild/motion/spring.jsx +1 -1
  57. package/target/esbuild/motion/transition.jsx +1 -1
  58. package/target/esbuild/motion/velocity.jsx +1 -1
  59. package/target/esbuild/navigation/app-bar.jsx +8 -8
  60. package/target/esbuild/navigation/base.jsx +1 -1
  61. package/target/esbuild/navigation/drawer.jsx +7 -7
  62. package/target/esbuild/navigation/index.jsx +1 -1
  63. package/target/esbuild/navigation/navigation.jsx +12 -12
  64. package/target/esbuild/navigation/scroll.jsx +1 -1
  65. package/target/esbuild/navigation/search.jsx +4 -4
  66. package/target/esbuild/navigation/tabs.jsx +3 -3
  67. package/target/esbuild/navigation/toolbar.jsx +3 -3
  68. package/target/esbuild/selection/base.jsx +1 -1
  69. package/target/esbuild/selection/checkbox.jsx +4 -4
  70. package/target/esbuild/selection/chip.jsx +5 -5
  71. package/target/esbuild/selection/index.jsx +1 -1
  72. package/target/esbuild/selection/radio.jsx +3 -3
  73. package/target/esbuild/selection/segmented.jsx +4 -4
  74. package/target/esbuild/selection/switch.jsx +3 -3
  75. package/target/esbuild/shape/corner-rounding.jsx +1 -1
  76. package/target/esbuild/shape/cubic.jsx +1 -1
  77. package/target/esbuild/shape/index.jsx +1 -1
  78. package/target/esbuild/shape/material-shapes.jsx +1 -1
  79. package/target/esbuild/shape/morph.jsx +1 -1
  80. package/target/esbuild/shape/path.jsx +1 -1
  81. package/target/esbuild/shape/point.jsx +1 -1
  82. package/target/esbuild/shape/rounded-polygon.jsx +1 -1
  83. package/target/esbuild/shape/shapes.jsx +1 -1
  84. package/target/esbuild/spacing/index.jsx +1 -1
  85. package/target/esbuild/state/component.jsx +1 -1
  86. package/target/esbuild/state/controller.jsx +1 -1
  87. package/target/esbuild/state/index.jsx +1 -1
  88. package/target/esbuild/state/ripple.jsx +1 -1
  89. package/target/esbuild/state/state.jsx +1 -1
  90. package/target/esbuild/state/style.jsx +1 -1
  91. package/target/esbuild/surface/carousel-layout.jsx +1 -1
  92. package/target/esbuild/surface/carousel.jsx +2 -2
  93. package/target/esbuild/surface/dialog.jsx +5 -5
  94. package/target/esbuild/surface/divider.jsx +1 -1
  95. package/target/esbuild/surface/drag.jsx +1 -1
  96. package/target/esbuild/surface/gestures.jsx +3 -3
  97. package/target/esbuild/surface/index.jsx +1 -1
  98. package/target/esbuild/surface/interactive.jsx +1 -1
  99. package/target/esbuild/surface/list-patterns.jsx +3 -3
  100. package/target/esbuild/surface/list.jsx +2 -2
  101. package/target/esbuild/surface/menu.jsx +3 -3
  102. package/target/esbuild/surface/scaffold.jsx +7 -7
  103. package/target/esbuild/surface/sheet.jsx +5 -5
  104. package/target/esbuild/surface/side-sheet.jsx +2 -2
  105. package/target/esbuild/surface/slots.jsx +1 -1
  106. package/target/esbuild/surface/surface.jsx +1 -1
  107. package/target/esbuild/text/index.jsx +1 -1
  108. package/target/esbuild/text/text.jsx +2 -2
  109. package/target/esbuild/text/typography.jsx +1 -1
  110. package/target/esbuild/text/visually-hidden.css +1 -0
  111. package/target/esbuild/text/visually-hidden.jsx +1 -0
  112. package/target/esbuild/util/box-side.jsx +1 -1
  113. package/target/esbuild/util/debug.jsx +1 -1
  114. package/target/esbuild/util/dom.jsx +1 -1
  115. package/target/esbuild/util/environment.jsx +1 -0
  116. package/target/esbuild/util/event.jsx +1 -1
  117. package/target/esbuild/util/index.jsx +1 -1
  118. package/target/esbuild/util/preconditions.jsx +1 -1
  119. package/target/esbuild/util/reactive.jsx +1 -1
  120. package/target/node/color.js +1 -0
  121. package/target/node/shape.js +1 -0
  122. package/target/tsc/action/base.d.ts +27 -8
  123. package/target/tsc/action/index.d.ts +3 -1
  124. package/target/tsc/action/progress-button.css.d.ts +3 -0
  125. package/target/tsc/action/progress-button.d.ts +46 -0
  126. package/target/tsc/motion/follow-height.d.ts +51 -0
  127. package/target/tsc/motion/index.d.ts +7 -3
  128. package/target/tsc/motion/spring.d.ts +3 -3
  129. package/target/tsc/shape/index.d.ts +1 -1
  130. package/target/tsc/shape/material-shapes.d.ts +56 -0
  131. package/target/tsc/shape/path.d.ts +16 -0
  132. package/target/tsc/text/index.d.ts +5 -2
  133. package/target/tsc/text/visually-hidden.css.d.ts +3 -0
  134. package/target/tsc/text/visually-hidden.d.ts +33 -0
  135. package/target/tsc/util/environment.d.ts +14 -0
  136. package/target/tsc/util/index.d.ts +2 -1
  137. package/target/tsc/util/preconditions.d.ts +0 -14
@@ -1 +1 @@
1
- const P=.008856451679035631,d=24389/27,B=1.02117770275752,V=.9863077294280124,j=.9339605082802299,R=.3884814537800353,g=29.980997194447333,L=1.0169191804458755,X=1.3173270022537198,K=.759112960023724,W=.8834525670408592,Y=1.1319226830134397,$=5,k=8,A=z(0,256),J=z(.5,255),Q=new Float64Array(3),Z=new Float64Array(3),D=new Float64Array(3);function v(n){const t=n/255;return t<=.040449936?t/12.92*100:Math.pow((t+.055)/1.055,2.4)*100}function z(n,t){const r=new Float64Array(t);for(let e=0;e<t;e++)r[e]=v(n+e);return r}function T(n){const t=n/100;return(t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055)*255}function y(n){return o0(0,255,Math.round(T(n)))}function G(n,t,r){return(4278190080|y(n)<<16|y(t)<<8|y(r))>>>0}function x(n){return n>P?Math.pow(n,1/3):(d*n+16)/116}function n0(n){const t=n*n*n;return t>P?t:(116*n-16)/d}function U(n){return n<0?-1:n===0?0:1}function N(n){const t=Math.pow(Math.abs(n),.42);return U(n)*400*t/(t+27.13)}function C(n){const t=Math.abs(n);return U(n)*Math.pow(Math.max(0,27.13*t/(400-t)),1/.42)}function w(n,t,r){const e=N(.001200833568784504*n+.002389694492170889*t+.0002795742885861124*r),o=N(.0005891086651375999*n+.0029785502573438758*t+.0003270666104008398*r),u=N(.00010146692491640572*n+.0005364214359186694*t+.0032979401770712076*r);return Math.atan2((e+o-2*u)/9,(11*e-12*o+u)/11)}function H(n){return(n+Math.PI*8)%(Math.PI*2)}function F(n,t,r){return H(t-n)<H(r-n)}function t0(n,t){const r=D,e=t%4<=1?0:100,o=t%2===0?0:100;let u;return t<4?(u=(n-e*.7152-o*.0722)/.2126,r[0]=u,r[1]=e,r[2]=o):t<8?(u=(n-o*.2126-e*.0722)/.7152,r[0]=o,r[1]=u,r[2]=e):(u=(n-e*.2126-o*.7152)/.0722,r[0]=e,r[1]=o,r[2]=u),u>=0&&u<=100}function r0(n,t,r){const e=3846.153846153846*(.25*(Math.cos(n+2)+3.8))*L,o=Math.sin(n),u=Math.cos(n);let s=Math.sqrt(r)*11;for(let i=0;;i++){const l=s/100,a=t===0||s===0?0:t/Math.sqrt(l),c=Math.pow(a*Y,1/.9),b=g*Math.pow(l,K)/L,f=23*(b+.305)*c/(23*e+11*c*u+108*c*o),h=f*u,E=f*o,M=C((460*b+451*h+288*E)/1403),S=C((460*b-891*h-261*E)/1403),p=C((460*b-220*h-6300*E)/1403),m=1373.2198709594231*M-1100.4251190754821*S-7.278681089101213*p,I=-271.815969077903*M+559.6580465940733*S-32.46047482791194*p,O=1.9622899599665666*M-57.173814538844006*S+308.7233197812385*p;if(m<0||I<0||O<0)return 0;const _=.2126*m+.7152*I+.0722*O;if(_<=0)return 0;if(i===$-1||Math.abs(_-r)<.002)return m>100.01||I>100.01||O>100.01?0:G(m,I,O);s-=(_-r)*s/(2*_)}}function e0(n,t){const r=Q,e=Z,o=D;let u=0,s=0,i=!1,l=!1;for(let a=0;a<12;a++){if(!t0(t,a))continue;const c=w(o[0],o[1],o[2]);i?(!l||F(u,c,s))&&(l=!0,F(u,n,c)?(e.set(o),s=c):(r.set(o),u=c)):(r.set(o),e.set(o),u=c,s=c,i=!0)}for(let a=0;a<3;a++){const c=r[a],b=e[a];if(c===b)continue;let f=c<b?Math.floor(T(c)-.5):Math.ceil(T(c)-.5),h=c<b?Math.ceil(T(b)-.5):Math.floor(T(b)-.5);for(let E=0;E<k&&Math.abs(h-f)>1;E++){const M=Math.floor((f+h)/2),S=(J[M]-r[a])/(e[a]-r[a]);for(let m=0;m<3;m++)o[m]=r[m]+(e[m]-r[m])*S;const p=w(o[0],o[1],o[2]);F(u,n,p)?(e.set(o),h=M):(r.set(o),u=p,f=M)}}return G((r[0]+e[0])/2,(r[1]+e[1])/2,(r[2]+e[2])/2)}function o0(n,t,r){return r<n?n:r>t?t:r}function q(n){const t=n%360;return t<0?t+360:t}function u0(n){return 100*n0((n+16)/116)}function a0(n){return x(n/100)*116-16}function b0(n){const t=A[n>>16&255],r=A[n>>8&255],e=A[n&255],o=x((.41233895*t+.35762064*r+.18051042*e)/95.047),u=x((.2126*t+.7152*r+.0722*e)/100),s=x((.01932141*t+.11916382*r+.95034478*e)/108.883);return[116*u-16,500*(o-u),200*(u-s)]}function c0(n){const t=A[n>>16&255],r=A[n>>8&255],e=A[n&255],o=.41233895*t+.35762064*r+.18051042*e,u=.2126*t+.7152*r+.0722*e,s=.01932141*t+.11916382*r+.95034478*e,i=N(R*(B*(.401288*o+.650173*u-.051461*s))/100),l=N(R*(V*(-.250268*o+1.204414*u+.045854*s))/100),a=N(R*(j*(-.002079*o+.048952*u+.953127*s))/100),c=(11*i-12*l+a)/11,b=(i+l-2*a)/9,f=q(Math.atan2(b,c)*180/Math.PI),h=100*Math.pow((40*i+20*l+a)/20*L/g,X),E=.25*(Math.cos((f<20.14?f+360:f)*Math.PI/180+2)+3.8),M=5e4/13*E*L*Math.sqrt(c*c+b*b)/((20*i+20*l+21*a)/20+.305);return{argb:n,hue:f,chroma:Math.pow(M,.9)*W*Math.sqrt(h/100),tone:116*x(u/100)-16}}function s0(n,t,r){const e=u0(r);if(t<1e-4||r<1e-4||r>99.9999){const s=y(e);return(4278190080|s<<16|s<<8|s)>>>0}const o=q(n)/180*Math.PI,u=r0(o,t,e);return u!==0?u:e0(o,e)}function f0(n,t,r){return c0(s0(n,t,r))}function m0(n){return`#${(n&16777215).toString(16).padStart(6,"0")}`}export{s0 as argbOfHct,o0 as clamp,c0 as hctOfArgb,m0 as hexOfArgb,b0 as labOfArgb,a0 as lstarOfY,q as sanitizeDegrees,f0 as solveHct,u0 as yOfLstar};
1
+ const P=0.008856451679035631,d=24389/27,B=1.02117770275752,V=0.9863077294280124,j=0.9339605082802299,R=0.3884814537800353,g=29.980997194447333,L=1.0169191804458755,X=1.3173270022537198,K=0.759112960023724,W=0.8834525670408592,Y=1.1319226830134397,$=5,k=8,A=/* @__PURE__ */z(0,256),J=/* @__PURE__ */z(0.5,255),Q=/* @__PURE__ */new Float64Array(3),Z=/* @__PURE__ */new Float64Array(3),D=/* @__PURE__ */new Float64Array(3);function v(n){const t=n/255;return t<=0.040449936?t/12.92*100:Math.pow((t+0.055)/1.055,2.4)*100;}function z(n,t){const r=new Float64Array(t);for(let e=0;e<t;e++)r[e]=v(n+e);return r;}function T(n){const t=n/100;return(t<=31308e-7?t*12.92:1.055*Math.pow(t,1/2.4)-0.055)*255;}function y(n){return o0(0,255,Math.round(T(n)));}function G(n,t,r){return(4278190080|y(n)<<16|y(t)<<8|y(r))>>>0;}function x(n){return n>P?Math.pow(n,1/3):(d*n+16)/116;}function n0(n){const t=n*n*n;return t>P?t:(116*n-16)/d;}function U(n){return n<0?-1:n===0?0:1;}function N(n){const t=Math.pow(Math.abs(n),0.42);return U(n)*400*t/(t+27.13);}function C(n){const t=Math.abs(n);return U(n)*Math.pow(Math.max(0,27.13*t/(400-t)),1/0.42);}function w(n,t,r){const e=N(0.001200833568784504*n+0.002389694492170889*t+2795742885861124e-19*r),o=N(5891086651375999e-19*n+0.0029785502573438758*t+3270666104008398e-19*r),u=N(10146692491640572e-20*n+5364214359186694e-19*t+0.0032979401770712076*r);return Math.atan2((e+o-2*u)/9,(11*e-12*o+u)/11);}function H(n){return(n+Math.PI*8)%(Math.PI*2);}function F(n,t,r){return H(t-n)<H(r-n);}function t0(n,t){const r=D,e=t%4<=1?0:100,o=t%2===0?0:100;let u;return t<4?(u=(n-e*0.7152-o*0.0722)/0.2126,r[0]=u,r[1]=e,r[2]=o):t<8?(u=(n-o*0.2126-e*0.0722)/0.7152,r[0]=o,r[1]=u,r[2]=e):(u=(n-e*0.2126-o*0.7152)/0.0722,r[0]=e,r[1]=o,r[2]=u),u>=0&&u<=100;}function r0(n,t,r){const e=3846.153846153846*(0.25*(Math.cos(n+2)+3.8))*L,o=Math.sin(n),u=Math.cos(n);let s=Math.sqrt(r)*11;for(let i=0;;i++){const l=s/100,a=t===0||s===0?0:t/Math.sqrt(l),c=Math.pow(a*Y,1/0.9),b=g*Math.pow(l,K)/L,f=23*(b+0.305)*c/(23*e+11*c*u+108*c*o),h=f*u,E=f*o,M=C((460*b+451*h+288*E)/1403),S=C((460*b-891*h-261*E)/1403),p=C((460*b-220*h-6300*E)/1403),m=1373.2198709594231*M-1100.4251190754821*S-7.278681089101213*p,I=-271.815969077903*M+559.6580465940733*S-32.46047482791194*p,O=1.9622899599665666*M-57.173814538844006*S+308.7233197812385*p;if(m<0||I<0||O<0)return 0;const _=0.2126*m+0.7152*I+0.0722*O;if(_<=0)return 0;if(i===$-1||Math.abs(_-r)<2e-3)return m>100.01||I>100.01||O>100.01?0:G(m,I,O);s-=(_-r)*s/(2*_);}}function e0(n,t){const r=Q,e=Z,o=D;let u=0,s=0,i=!1,l=!1;for(let a=0;a<12;a++){if(!t0(t,a))continue;const c=w(o[0],o[1],o[2]);i?(!l||F(u,c,s))&&(l=!0,F(u,n,c)?(e.set(o),s=c):(r.set(o),u=c)):(r.set(o),e.set(o),u=c,s=c,i=!0);}for(let a=0;a<3;a++){const c=r[a],b=e[a];if(c===b)continue;let f=c<b?Math.floor(T(c)-0.5):Math.ceil(T(c)-0.5),h=c<b?Math.ceil(T(b)-0.5):Math.floor(T(b)-0.5);for(let E=0;E<k&&Math.abs(h-f)>1;E++){const M=Math.floor((f+h)/2),S=(J[M]-r[a])/(e[a]-r[a]);for(let m=0;m<3;m++)o[m]=r[m]+(e[m]-r[m])*S;const p=w(o[0],o[1],o[2]);F(u,n,p)?(e.set(o),h=M):(r.set(o),u=p,f=M);}}return G((r[0]+e[0])/2,(r[1]+e[1])/2,(r[2]+e[2])/2);}function o0(n,t,r){return r<n?n:r>t?t:r;}function q(n){const t=n%360;return t<0?t+360:t;}function u0(n){return 100*n0((n+16)/116);}function a0(n){return x(n/100)*116-16;}function b0(n){const t=A[n>>16&255],r=A[n>>8&255],e=A[n&255],o=x((0.41233895*t+0.35762064*r+0.18051042*e)/95.047),u=x((0.2126*t+0.7152*r+0.0722*e)/100),s=x((0.01932141*t+0.11916382*r+0.95034478*e)/108.883);return[116*u-16,500*(o-u),200*(u-s)];}function c0(n){const t=A[n>>16&255],r=A[n>>8&255],e=A[n&255],o=0.41233895*t+0.35762064*r+0.18051042*e,u=0.2126*t+0.7152*r+0.0722*e,s=0.01932141*t+0.11916382*r+0.95034478*e,i=N(R*(B*(0.401288*o+0.650173*u-0.051461*s))/100),l=N(R*(V*(-0.250268*o+1.204414*u+0.045854*s))/100),a=N(R*(j*(-2079e-6*o+0.048952*u+0.953127*s))/100),c=(11*i-12*l+a)/11,b=(i+l-2*a)/9,f=q(Math.atan2(b,c)*180/Math.PI),h=100*Math.pow((40*i+20*l+a)/20*L/g,X),E=0.25*(Math.cos((f<20.14?f+360:f)*Math.PI/180+2)+3.8),M=5e4/13*E*L*Math.sqrt(c*c+b*b)/((20*i+20*l+21*a)/20+0.305);return{argb:n,hue:f,chroma:Math.pow(M,0.9)*W*Math.sqrt(h/100),tone:116*x(u/100)-16};}function s0(n,t,r){const e=u0(r);if(t<1e-4||r<1e-4||r>99.9999){const s=y(e);return(4278190080|s<<16|s<<8|s)>>>0;}const o=q(n)/180*Math.PI,u=r0(o,t,e);return u!==0?u:e0(o,e);}function f0(n,t,r){return c0(s0(n,t,r));}function m0(n){return`#${(n&16777215).toString(16).padStart(6,"0")}`;}export{s0 as argbOfHct,o0 as clamp,c0 as hctOfArgb,m0 as hexOfArgb,b0 as labOfArgb,a0 as lstarOfY,q as sanitizeDegrees,f0 as solveHct,u0 as yOfLstar};
@@ -1 +1 @@
1
- import{COLOR_SCHEME_CSS_ROLES as r,COLOR_SCHEME_ROLE_MAPPINGS as l,applyColorScheme as C,createColorScheme as S,removeColorScheme as c}from"./scheme";export{r as COLOR_SCHEME_CSS_ROLES,l as COLOR_SCHEME_ROLE_MAPPINGS,C as applyColorScheme,S as createColorScheme,c as removeColorScheme};
1
+ import{COLOR_SCHEME_CSS_ROLES as r,COLOR_SCHEME_ROLE_MAPPINGS as l,applyColorScheme as C,createColorScheme as S,removeColorScheme as c}from"./scheme";export{r as COLOR_SCHEME_CSS_ROLES,l as COLOR_SCHEME_ROLE_MAPPINGS,C as applyColorScheme,S as createColorScheme,c as removeColorScheme};
@@ -1 +1 @@
1
- import{argbOfHct as e,solveHct as a}from"./hct";function c(t){return t>=105&&t<125}function m(t,r,f){if(f!==99||!c(t))return e(t,r,f);const u=e(t,r,98),i=e(t,r,100);let o=4278190080;for(const n of[16,8,0])o|=Math.round(((u>>n&255)+(i>>n&255))/2)<<n;return o>>>0}function s(t){const r=Math.round(t.hue);return r>=90&&r<=111&&Math.round(t.chroma)>16&&Math.round(t.tone)<65}function d(t){return s(t)?a(t.hue,t.chroma,70):t}export{m as argbOfPalette,d as fixDislikedColor,c as isYellowHue};
1
+ import{argbOfHct as e,solveHct as a}from"./hct";function c(t){return t>=105&&t<125;}function m(t,r,f){if(f!==99||!c(t))return e(t,r,f);const u=e(t,r,98),i=e(t,r,100);let o=4278190080;for(const n of[16,8,0])o|=Math.round(((u>>n&255)+(i>>n&255))/2)<<n;return o>>>0;}function s(t){const r=Math.round(t.hue);return r>=90&&r<=111&&Math.round(t.chroma)>16&&Math.round(t.tone)<65;}function d(t){return s(t)?a(t.hue,t.chroma,70):t;}export{m as argbOfPalette,d as fixDislikedColor,c as isYellowHue};
@@ -1 +1 @@
1
- import{argbOfRole as R,newDynamicScheme as x}from"./dynamic";import{hexOfArgb as S}from"./hct";const h=Object.freeze([{role:"primary",cssRole:"primary-fill"},{role:"onPrimary",cssRole:"primary-onFill"},{role:"primaryContainer",cssRole:"primary-container"},{role:"onPrimaryContainer",cssRole:"primary-onContainer"},{role:"inversePrimary",cssRole:"primary-inverseFill"},{role:"primaryFixed",cssRole:"primary-fixedFill"},{role:"primaryFixedDim",cssRole:"primary-fixedFillDim"},{role:"onPrimaryFixed",cssRole:"primary-onFixedFill"},{role:"onPrimaryFixedVariant",cssRole:"primary-onFixedFillVariant"},{role:"secondary",cssRole:"secondary-fill"},{role:"onSecondary",cssRole:"secondary-onFill"},{role:"secondaryContainer",cssRole:"secondary-container"},{role:"onSecondaryContainer",cssRole:"secondary-onContainer"},{role:"secondaryFixed",cssRole:"secondary-fixedFill"},{role:"secondaryFixedDim",cssRole:"secondary-fixedFillDim"},{role:"onSecondaryFixed",cssRole:"secondary-onFixedFill"},{role:"onSecondaryFixedVariant",cssRole:"secondary-onFixedFillVariant"},{role:"tertiary",cssRole:"tertiary-fill"},{role:"onTertiary",cssRole:"tertiary-onFill"},{role:"tertiaryContainer",cssRole:"tertiary-container"},{role:"onTertiaryContainer",cssRole:"tertiary-onContainer"},{role:"tertiaryFixed",cssRole:"tertiary-fixedFill"},{role:"tertiaryFixedDim",cssRole:"tertiary-fixedFillDim"},{role:"onTertiaryFixed",cssRole:"tertiary-onFixedFill"},{role:"onTertiaryFixedVariant",cssRole:"tertiary-onFixedFillVariant"},{role:"error",cssRole:"error-fill"},{role:"onError",cssRole:"error-onFill"},{role:"errorContainer",cssRole:"error-container"},{role:"onErrorContainer",cssRole:"error-onContainer"},{role:"background",cssRole:"background"},{role:"onBackground",cssRole:"onBackground"},{role:"surface",cssRole:"surface-fill"},{role:"onSurface",cssRole:"surface-onFill"},{role:"surfaceVariant",cssRole:"surface-fillVariant"},{role:"onSurfaceVariant",cssRole:"surface-onFillVariant"},{role:"surfaceTint",cssRole:"surface-tint"},{role:"inverseSurface",cssRole:"surface-inverseFill"},{role:"inverseOnSurface",cssRole:"surface-inverseOnFill"},{role:"surfaceBright",cssRole:"surface-fillBright"},{role:"surfaceDim",cssRole:"surface-fillDim"},{role:"surfaceContainer",cssRole:"surface-container"},{role:"surfaceContainerHigh",cssRole:"surface-containerHigh"},{role:"surfaceContainerHighest",cssRole:"surface-containerHighest"},{role:"surfaceContainerLow",cssRole:"surface-containerLow"},{role:"surfaceContainerLowest",cssRole:"surface-containerLowest"},{role:"outline",cssRole:"outline"},{role:"outlineVariant",cssRole:"outlineVariant"},{role:"scrim",cssRole:"scrim"},{role:"shadow",cssRole:"shadow"}].map(e=>Object.freeze(e))),T=Object.freeze(h.map(({cssRole:e})=>e)),F=new Set(["tonalSpot","expressive","vibrant","fidelity","content","monochrome","neutral","rainbow","fruitSalad"]),g=/^(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,y=new WeakMap;function b(e){if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("sourceColor must be a CSS hexadecimal color or ARGB number");if(!Number.isInteger(e)||e<0||e>4294967295)throw new RangeError("sourceColor ARGB number must be an integer in [0, 0xffffffff]");return e>>>0}const o=typeof e=="string"?e.trim().replace(/^#/,""):"";if(!g.test(o))throw new TypeError("sourceColor must be a CSS hexadecimal color or ARGB number");const a=o.length<=4?o.replace(/./g,"$&$&"):o;return((a.length===8?parseInt(a.slice(6),16):255)<<24|parseInt(a.slice(0,6),16))>>>0}function v(e,o,a){const r=e===void 0?{}:typeof e=="string"?{mode:e}:typeof e=="boolean"?{isDark:e}:e;if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("color-scheme options must be an object");if(r.isDark!==void 0&&typeof r.isDark!="boolean")throw new TypeError("isDark must be a boolean");const l=r.isDark===void 0?r.mode??"light":r.isDark?"dark":"light",n=o??r.contrastLevel??0,t=a??r.variant??"tonalSpot",i=r.specVersion??"2025";if(r.mode!==void 0&&r.mode!==l)throw new RangeError("mode and isDark select different color-scheme modes");if(l!=="light"&&l!=="dark")throw new TypeError("mode must be 'light' or 'dark'");if(!Number.isFinite(n)||n<-1||n>1)throw new RangeError("contrastLevel must be a finite number in [-1, 1]");if(!F.has(t))throw new TypeError("variant is not a supported Material 3 color style");if(i!=="2021"&&i!=="2025")throw new TypeError("specVersion must be '2021' or '2025'");return{mode:l,contrastLevel:n,variant:t,specVersion:i}}function D(e,o,a,r){const l=b(e),n=v(o,a,r),t=x(l,n.variant,n.mode==="dark",n.contrastLevel,n.specVersion),i={},c={},s={},d={};let C="";for(const{role:m,cssRole:f}of h){const p=R(t,m),u=S(p);i[m]=p,c[m]=u,s[f]=u,d[`--cw-Color-${f}`]=u,C+=`--cw-Color-${f}:${u};`}return Object.freeze({...c,specVersion:t.specVersion,sourceColor:S(l),sourceColorArgb:l,mode:n.mode,isDark:n.mode==="dark",contrastLevel:n.contrastLevel,variant:n.variant,argb:Object.freeze(i),values:Object.freeze(s),variables:Object.freeze(d),cssText:`${C}color-scheme:${n.mode}`})}function V(e,o){const{style:a}=e;for(const[r,l]of o.properties)a.getPropertyValue(r)!==l.applied||a.getPropertyPriority(r)!==""||(l.value===""?a.removeProperty(r):a.setProperty(r,l.value,l.priority));y.delete(e)}function E(e,o){if(typeof e?.style?.setProperty!="function")throw new TypeError("target must be an Element with inline CSS styles");if(typeof o?.variables!="object"||typeof o.cssText!="string")throw new TypeError("scheme must be a color scheme created by createColorScheme");const{style:a}=e,r=y.get(e),l=new Map,n={properties:l},t=[...Object.entries(o.variables),["color-scheme",o.mode]];for(const[i,c]of t){const s=r?.properties.get(i),d=s!==void 0&&a.getPropertyValue(i)===s.applied&&a.getPropertyPriority(i)==="";l.set(i,{value:d?s.value:a.getPropertyValue(i),priority:d?s.priority:a.getPropertyPriority(i),applied:c}),a.setProperty(i,c)}return y.set(e,n),()=>{y.get(e)===n&&V(e,n)}}function k(e){const o=y.get(e);o!==void 0&&V(e,o)}export{T as COLOR_SCHEME_CSS_ROLES,h as COLOR_SCHEME_ROLE_MAPPINGS,E as applyColorScheme,D as createColorScheme,k as removeColorScheme};
1
+ import{argbOfRole as R,newDynamicScheme as x}from"./dynamic";import{hexOfArgb as S}from"./hct";const h=Object.freeze([{role:"primary",cssRole:"primary-fill"},{role:"onPrimary",cssRole:"primary-onFill"},{role:"primaryContainer",cssRole:"primary-container"},{role:"onPrimaryContainer",cssRole:"primary-onContainer"},{role:"inversePrimary",cssRole:"primary-inverseFill"},{role:"primaryFixed",cssRole:"primary-fixedFill"},{role:"primaryFixedDim",cssRole:"primary-fixedFillDim"},{role:"onPrimaryFixed",cssRole:"primary-onFixedFill"},{role:"onPrimaryFixedVariant",cssRole:"primary-onFixedFillVariant"},{role:"secondary",cssRole:"secondary-fill"},{role:"onSecondary",cssRole:"secondary-onFill"},{role:"secondaryContainer",cssRole:"secondary-container"},{role:"onSecondaryContainer",cssRole:"secondary-onContainer"},{role:"secondaryFixed",cssRole:"secondary-fixedFill"},{role:"secondaryFixedDim",cssRole:"secondary-fixedFillDim"},{role:"onSecondaryFixed",cssRole:"secondary-onFixedFill"},{role:"onSecondaryFixedVariant",cssRole:"secondary-onFixedFillVariant"},{role:"tertiary",cssRole:"tertiary-fill"},{role:"onTertiary",cssRole:"tertiary-onFill"},{role:"tertiaryContainer",cssRole:"tertiary-container"},{role:"onTertiaryContainer",cssRole:"tertiary-onContainer"},{role:"tertiaryFixed",cssRole:"tertiary-fixedFill"},{role:"tertiaryFixedDim",cssRole:"tertiary-fixedFillDim"},{role:"onTertiaryFixed",cssRole:"tertiary-onFixedFill"},{role:"onTertiaryFixedVariant",cssRole:"tertiary-onFixedFillVariant"},{role:"error",cssRole:"error-fill"},{role:"onError",cssRole:"error-onFill"},{role:"errorContainer",cssRole:"error-container"},{role:"onErrorContainer",cssRole:"error-onContainer"},{role:"background",cssRole:"background"},{role:"onBackground",cssRole:"onBackground"},{role:"surface",cssRole:"surface-fill"},{role:"onSurface",cssRole:"surface-onFill"},{role:"surfaceVariant",cssRole:"surface-fillVariant"},{role:"onSurfaceVariant",cssRole:"surface-onFillVariant"},{role:"surfaceTint",cssRole:"surface-tint"},{role:"inverseSurface",cssRole:"surface-inverseFill"},{role:"inverseOnSurface",cssRole:"surface-inverseOnFill"},{role:"surfaceBright",cssRole:"surface-fillBright"},{role:"surfaceDim",cssRole:"surface-fillDim"},{role:"surfaceContainer",cssRole:"surface-container"},{role:"surfaceContainerHigh",cssRole:"surface-containerHigh"},{role:"surfaceContainerHighest",cssRole:"surface-containerHighest"},{role:"surfaceContainerLow",cssRole:"surface-containerLow"},{role:"surfaceContainerLowest",cssRole:"surface-containerLowest"},{role:"outline",cssRole:"outline"},{role:"outlineVariant",cssRole:"outlineVariant"},{role:"scrim",cssRole:"scrim"},{role:"shadow",cssRole:"shadow"}].map(e=>Object.freeze(e))),T=Object.freeze(h.map(({cssRole:e})=>e)),F=/* @__PURE__ */new Set(["tonalSpot","expressive","vibrant","fidelity","content","monochrome","neutral","rainbow","fruitSalad"]),g=/^(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,y=/* @__PURE__ */new WeakMap();function b(e){if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("sourceColor must be a CSS hexadecimal color or ARGB number");if(!Number.isInteger(e)||e<0||e>4294967295)throw new RangeError("sourceColor ARGB number must be an integer in [0, 0xffffffff]");return e>>>0;}const o=typeof e=="string"?e.trim().replace(/^#/,""):"";if(!g.test(o))throw new TypeError("sourceColor must be a CSS hexadecimal color or ARGB number");const a=o.length<=4?o.replace(/./g,"$&$&"):o;return((a.length===8?parseInt(a.slice(6),16):255)<<24|parseInt(a.slice(0,6),16))>>>0;}function v(e,o,a){const r=e===void 0?{}:typeof e=="string"?{mode:e}:typeof e=="boolean"?{isDark:e}:e;if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("color-scheme options must be an object");if(r.isDark!==void 0&&typeof r.isDark!="boolean")throw new TypeError("isDark must be a boolean");const l=r.isDark===void 0?r.mode??"light":r.isDark?"dark":"light",n=o??r.contrastLevel??0,t=a??r.variant??"tonalSpot",i=r.specVersion??"2025";if(r.mode!==void 0&&r.mode!==l)throw new RangeError("mode and isDark select different color-scheme modes");if(l!=="light"&&l!=="dark")throw new TypeError("mode must be 'light' or 'dark'");if(!Number.isFinite(n)||n<-1||n>1)throw new RangeError("contrastLevel must be a finite number in [-1, 1]");if(!F.has(t))throw new TypeError("variant is not a supported Material 3 color style");if(i!=="2021"&&i!=="2025")throw new TypeError("specVersion must be '2021' or '2025'");return{mode:l,contrastLevel:n,variant:t,specVersion:i};}function D(e,o,a,r){const l=b(e),n=v(o,a,r),t=x(l,n.variant,n.mode==="dark",n.contrastLevel,n.specVersion),i={},c={},s={},d={};let C="";for(const{role:m,cssRole:f}of h){const p=R(t,m),u=S(p);i[m]=p,c[m]=u,s[f]=u,d[`--cw-Color-${f}`]=u,C+=`--cw-Color-${f}:${u};`;}return Object.freeze({...c,specVersion:t.specVersion,sourceColor:S(l),sourceColorArgb:l,mode:n.mode,isDark:n.mode==="dark",contrastLevel:n.contrastLevel,variant:n.variant,argb:Object.freeze(i),values:Object.freeze(s),variables:Object.freeze(d),cssText:`${C}color-scheme:${n.mode}`});}function V(e,o){const{style:a}=e;for(const[r,l]of o.properties)a.getPropertyValue(r)!==l.applied||a.getPropertyPriority(r)!==""||(l.value===""?a.removeProperty(r):a.setProperty(r,l.value,l.priority));y.delete(e);}function E(e,o){if(typeof e?.style?.setProperty!="function")throw new TypeError("target must be an Element with inline CSS styles");if(typeof o?.variables!="object"||typeof o.cssText!="string")throw new TypeError("scheme must be a color scheme created by createColorScheme");const{style:a}=e,r=y.get(e),l=/* @__PURE__ */new Map(),n={properties:l},t=[...Object.entries(o.variables),["color-scheme",o.mode]];for(const[i,c]of t){const s=r?.properties.get(i),d=s!==void 0&&a.getPropertyValue(i)===s.applied&&a.getPropertyPriority(i)==="";l.set(i,{value:d?s.value:a.getPropertyValue(i),priority:d?s.priority:a.getPropertyPriority(i),applied:c}),a.setProperty(i,c);}return y.set(e,n),()=>{y.get(e)===n&&V(e,n);};}function k(e){const o=y.get(e);o!==void 0&&V(e,o);}export{T as COLOR_SCHEME_CSS_ROLES,h as COLOR_SCHEME_ROLE_MAPPINGS,E as applyColorScheme,D as createColorScheme,k as removeColorScheme};
@@ -1 +1 @@
1
- import{argbOfHct as W,hctOfArgb as A,labOfArgb as x,sanitizeDegrees as b}from"./hct";const l=361;function E(r){const[,t,e]=x(r),o=b(Math.atan2(e,t)*180/Math.PI),a=Math.sqrt(t*t+e*e);return-.5+.02*Math.pow(a,1.07)*Math.cos(b(o-50)*Math.PI/180)}function g(r){const t=new Uint32Array(l),e=new Float64Array(l+1);let o=0,a=0;for(let n=0;n<l;n++)t[n]=W(n,r.chroma,r.tone);for(let n=0;n<=l;n++){const c=E(n<l?t[n]:r.argb);e[n]=c,c<e[o]&&(o=n),c>=e[a]&&(a=n)}return{source:r,colors:t,temperatures:e,coldest:o,warmest:a}}function h(r,t){return t<l?A(r.colors[t]):r.source}function m(r,t){const{temperatures:e,coldest:o,warmest:a}=r,n=e[a]-e[o];return n===0?.5:(e[t]-e[o])/n}function y(r,t,e){return t<e?t<=r&&r<=e:t<=r||r<=e}function I(r){const t=g(r),e=Math.round(r.hue);let o=m(t,e),a=0;for(let s=1;s<360;s++){const u=m(t,(e+s)%360);a+=Math.abs(u-o),o=u}const n=a/6;let c=0;o=m(t,e);for(let s=1;;s++){const u=(e+s)%360,f=m(t,u);if(c+=Math.abs(f-o),c>=n)return h(t,u);o=f}}function U(r){const t=g(r),{temperatures:e,coldest:o,warmest:a}=t,n=h(t,o).hue,c=h(t,a).hue,s=y(r.hue,n,c),u=s?c:n,f=s?n:c,O=1-m(t,l);let p=Math.round(r.hue),H=1e3;for(let i=0;i<=360;i++){const d=b(u+i);if(!y(d,u,f))continue;const M=Math.round(d),w=Math.abs(O-(e[M]-e[o])/(e[a]-e[o]));w<H&&(H=w,p=M)}return h(t,p)}export{I as analogousColorOf,U as complementaryColorOf};
1
+ import{argbOfHct as W,hctOfArgb as A,labOfArgb as x,sanitizeDegrees as b}from"./hct";const l=361;function E(r){const[,t,e]=x(r),o=b(Math.atan2(e,t)*180/Math.PI),a=Math.sqrt(t*t+e*e);return-0.5+0.02*Math.pow(a,1.07)*Math.cos(b(o-50)*Math.PI/180);}function g(r){const t=new Uint32Array(l),e=new Float64Array(l+1);let o=0,a=0;for(let n=0;n<l;n++)t[n]=W(n,r.chroma,r.tone);for(let n=0;n<=l;n++){const c=E(n<l?t[n]:r.argb);e[n]=c,c<e[o]&&(o=n),c>=e[a]&&(a=n);}return{source:r,colors:t,temperatures:e,coldest:o,warmest:a};}function h(r,t){return t<l?A(r.colors[t]):r.source;}function m(r,t){const{temperatures:e,coldest:o,warmest:a}=r,n=e[a]-e[o];return n===0?0.5:(e[t]-e[o])/n;}function y(r,t,e){return t<e?t<=r&&r<=e:t<=r||r<=e;}function I(r){const t=g(r),e=Math.round(r.hue);let o=m(t,e),a=0;for(let s=1;s<360;s++){const u=m(t,(e+s)%360);a+=Math.abs(u-o),o=u;}const n=a/6;let c=0;o=m(t,e);for(let s=1;;s++){const u=(e+s)%360,f=m(t,u);if(c+=Math.abs(f-o),c>=n)return h(t,u);o=f;}}function U(r){const t=g(r),{temperatures:e,coldest:o,warmest:a}=t,n=h(t,o).hue,c=h(t,a).hue,s=y(r.hue,n,c),u=s?c:n,f=s?n:c,O=1-m(t,l);let p=Math.round(r.hue),H=1e3;for(let i=0;i<=360;i++){const d=b(u+i);if(!y(d,u,f))continue;const M=Math.round(d),w=Math.abs(O-(e[M]-e[o])/(e[a]-e[o]));w<H&&(H=w,p=M);}return h(t,p);}export{I as analogousColorOf,U as complementaryColorOf};
@@ -1 +1 @@
1
- import{insert as E}from"solid-js/web";import{DragState as m,FocusState as C,HoverState as v,PressState as g,defineInteractableComponent as S}from"../state";import{deferAfterDelegatedCancellation as a}from"../util";import"./elevation-shadow.css";import"./card.css";const L=C|v|g,u="cw-Card-disabled",i="_cw-Card-pressable",r=new WeakSet;function s(t){return`_cw-Card-${t??"filled"}`}function o(t){return t.matches(":focus")&&t.classList.contains(i)}function b(t){const e=t.currentTarget;t.target===e&&(t.key===" "?a(t,e,()=>{o(e)&&r.add(e)}):t.key==="Enter"&&!t.repeat&&a(t,e,()=>{o(e)&&e.click()}))}function c(t){const e=t.currentTarget;t.key!==" "||!r.delete(e)||t.target!==e||a(t,e,()=>{o(e)&&e.click()})}function p(t){r.delete(t.currentTarget)}function f(t){t.preventDefault(),t.stopImmediatePropagation()}function y(t,e){e?(t.addEventListener("keydown",b),t.addEventListener("keyup",c),t.addEventListener("blur",p)):(t.removeEventListener("keydown",b),t.removeEventListener("keyup",c),t.removeEventListener("blur",p),r.delete(t))}const x=S(()=>(t,e)=><div{...t}aria-disabled={e.disabled?"true":void 0}classList={{...t.classList,[u]:e.disabled,[i]:(e.pressable||e.button)&&!e.disabled,[s(e.design)]:!0,"cw-Card":!0,"cw-elevationShadow":!0}}role={e.button?"button":void 0}tabindex={e.button?e.disabled?void 0:e.tabIndex??0:e.tabIndex}/>,t=>class extends t{constructor(e){super(e,{baseInteractionCssClassName:"cw-Card",styleElementIsFunction:!0})}onEvent(e){this.props.disabled!==!0&&super.onEvent(e)}applyComponentProps(){const e=super.readProps(["button","design","disabled","draggable","pressable","tabIndex"]),n=this.functionElement;if(e.designChanged&&(super.setClass(s(e.designPrevious),!1),super.setClass(s(e.design),!0)),e.disabledChanged&&(super.setAttribute("aria-disabled",e.disabled?"true":void 0),super.setClass(u,e.disabled??!1),e.disabled?n.addEventListener("click",f,!0):n.removeEventListener("click",f,!0)),e.buttonChanged||e.disabledChanged||e.draggableChanged||e.pressableChanged){const d=!e.disabled,l=d&&(e.pressable||e.button)===!0;super.setClass(i,l),super.setAttribute("role",e.button?"button":void 0),super.setEnabledInteractionStates((l?L:0)|(d&&e.draggable?m:0)),y(n,d&&e.button===!0),e.tabIndexChanged=!0}e.tabIndexChanged&&super.setAttribute("tabindex",e.button?e.disabled?void 0:e.tabIndex??0:e.tabIndex)}render(e){const n=<div class="cw-Card cw-elevationShadow"/>;return E(n,e),n}});export{x as Card};
1
+ import{insert as E}from"solid-js/web";import{DragState as m,FocusState as C,HoverState as v,PressState as g,defineInteractableComponent as S}from"../state";import{deferAfterDelegatedCancellation as a}from"../util";import"./elevation-shadow.css";import"./card.css";const L=C|v|g,u="cw-Card-disabled",i="_cw-Card-pressable",r=/* @__PURE__ */new WeakSet();function s(t){return`_cw-Card-${t??"filled"}`;}function o(t){return t.matches(":focus")&&t.classList.contains(i);}function b(t){const e=t.currentTarget;t.target===e&&(t.key===" "?a(t,e,()=>{o(e)&&r.add(e);}):t.key==="Enter"&&!t.repeat&&a(t,e,()=>{o(e)&&e.click();}));}function c(t){const e=t.currentTarget;t.key!==" "||!r.delete(e)||t.target!==e||a(t,e,()=>{o(e)&&e.click();});}function p(t){r.delete(t.currentTarget);}function f(t){t.preventDefault(),t.stopImmediatePropagation();}function y(t,e){e?(t.addEventListener("keydown",b),t.addEventListener("keyup",c),t.addEventListener("blur",p)):(t.removeEventListener("keydown",b),t.removeEventListener("keyup",c),t.removeEventListener("blur",p),r.delete(t));}const x=/* @__PURE__ */S(()=>(t,e)=><div{...t}aria-disabled={e.disabled?"true":void 0}classList={{...t.classList,[u]:e.disabled,[i]:(e.pressable||e.button)&&!e.disabled,[s(e.design)]:!0,"cw-Card":!0,"cw-elevationShadow":!0}}role={e.button?"button":void 0}tabindex={e.button?e.disabled?void 0:e.tabIndex??0:e.tabIndex}/>,t=>class extends t{constructor(e){super(e,{baseInteractionCssClassName:"cw-Card",styleElementIsFunction:!0});}onEvent(e){this.props.disabled!==!0&&super.onEvent(e);}applyComponentProps(){const e=super.readProps(["button","design","disabled","draggable","pressable","tabIndex"]),n=this.functionElement;if(e.designChanged&&(super.setClass(s(e.designPrevious),!1),super.setClass(s(e.design),!0)),e.disabledChanged&&(super.setAttribute("aria-disabled",e.disabled?"true":void 0),super.setClass(u,e.disabled??!1),e.disabled?n.addEventListener("click",f,!0):n.removeEventListener("click",f,!0)),e.buttonChanged||e.disabledChanged||e.draggableChanged||e.pressableChanged){const d=!e.disabled,l=d&&(e.pressable||e.button)===!0;super.setClass(i,l),super.setAttribute("role",e.button?"button":void 0),super.setEnabledInteractionStates((l?L:0)|(d&&e.draggable?m:0)),y(n,d&&e.button===!0),e.tabIndexChanged=!0;}e.tabIndexChanged&&super.setAttribute("tabindex",e.button?e.disabled?void 0:e.tabIndex??0:e.tabIndex);}render(e){const n=<div class="cw-Card cw-elevationShadow"/>;return E(n,e),n;}});export{x as Card};
@@ -1 +1 @@
1
- import"./elevation-shadow.css";const o="cw-elevationShadow";export{o as ELEVATION_SHADOW_CSS_CLASS};
1
+ import"./elevation-shadow.css";const o="cw-elevationShadow";export{o as ELEVATION_SHADOW_CSS_CLASS};
@@ -1 +1 @@
1
- import{Card as p}from"./card";import{ELEVATION_SHADOW_CSS_CLASS as e}from"./elevation-shadow";export{p as Card,e as ELEVATION_SHADOW_CSS_CLASS};
1
+ import{Card as p}from"./card";import{ELEVATION_SHADOW_CSS_CLASS as e}from"./elevation-shadow";export{p as Card,e as ELEVATION_SHADOW_CSS_CLASS};
@@ -1 +1 @@
1
- import{$PROXY as A,createRenderEffect as m,getOwner as y,onCleanup as K,runWithOwner as L,untrack as P}from"solid-js";import{DelegatedEvents as O,assign as E,delegateEvents as I}from"solid-js/web";import{assertDebug as r,attributeValueOf as S,checkArgument as M,checkBrowser as x,checkState as N,consumeProps as a,isPropReactive as X,setAttribute as d}from"../util";import{elementPropsKeyOfEvent as J}from"./types";const p=Symbol(),u=Symbol(),j="http://www.w3.org/1999/xhtml",T="http://www.w3.org/1998/Math/MathML",R="http://www.w3.org/2000/svg",g=/[\t\n\f\r ]+/;function b(o){const t=[];if(o===void 0)return t;for(const[n,e]of Object.entries(o))typeof n=="string"&&n!==""&&e===!0&&t.push(n);return t}function v(o){return typeof o=="object"&&o!==null&&A in o}function C(o){return typeof o=="object"&&o!==null&&o.nodeType===Node.ELEMENT_NODE}function w(o){return o.namespaceURI===R}function H(o){return o.namespaceURI===j||o.namespaceURI===T||o.namespaceURI===R}function f(o,t,n){if(!g.test(t)){t!==""&&o.toggle(t,n);return}for(const e of t.split(g))e!==""&&o.toggle(e,n)}function U(o){return Object.keys(o).map(t=>t.slice(2).toLowerCase()).filter(t=>O.has(t))}function F(o){const t=this.ownerDocument;t!==document&&I([o.type],t)}function k(o,t,n,e){return Array.isArray(e)&&(e=e[e.length-1]),e===void 0?null:(M(o==="function"&&C(e)||o==="style"&&C(e)&&H(e),"not a valid element"),N(!t||n===null||n===e,`static ${o} element already resolved`),e)}class D{static _create(t,n){const e=a(n,["children"],["controllerRef"]),s=new t(n);y()!==null&&K(()=>s.onControllerCleanup()),s.#x(),e.controllerRef?.(s);const i=s.isFunctionElementStyle()?void 0:c=>s.#p(c),l=s.render("children"in e?e.children:()=>s.props.children,i);if(typeof l!="function")return s.#s|=4,i===void 0&&(s.#s|=2),s.#h(l),s.#d(),l;i===void 0&&(s.#s&=-3);let h=(()=>{const c=y();return()=>{s.#i!==null&&(h=void 0,L(c,()=>s.#d()))}})();return(()=>{const c=l();return s.#h(c),h?.(),c})}props;#u;#s;#i;#e;#t;#o;#n;#c;#r;#f;#a;constructor(t,n){x(),this.props=t,this.#u=null,this.#s=0,this.#i=null,this.#e=null,this.#t=null,this.#o=null,this.#n=null,this.#c=null,this.#r=null,this.#f=null,this.#a=null,n?.styleElementIsFunction&&(this.#s|=1),n?.functionElementIsStatic&&(this.#s|=2)}onControllerCleanup(){}#m(t){const n=this.#u;if(n===null)return u;const e=n.get(t);return e===void 0?u:e===u?void 0:e}#y(t,n){const e=this.#u;n===void 0&&(n=u),e===null?this.#u=new Map([[t,n]]):e.set(t,n)}readProp(t,n){const e=this.#m(t);if(n)return[e===p?this.props[t]:e===u?void 0:e,!1];const s=this.props[t];return e===p||e!==u&&e===s?[s,!1]:(this.#y(t,e===u&&!X(this.props,t)?p:s),[s,!0,e===u?void 0:e])}readProps(t,n){const e={};for(const s of t)[e[s],e[`${s}Changed`],e[`${s}Previous`]]=this.readProp(s,n);return e}consumeProps(t,n){return a(this.props,t,n)}get styleElement(){return this.#i}get functionElement(){return this.#o}#l(t){return(this.#s&t)===t}isFunctionElementStatic(){return this.#l(2)}isStyleElementStatic(){return this.#l(4)}isFunctionElementStyle(){return this.#l(1)}setStyle(t,n){typeof n=="number"&&(n=n.toString());const e=this.#i,s=this.#e;if(e===null){n===void 0?s?.delete(t):s===null?this.#e=new Map([[t,n]]):(r(s instanceof Map),s.set(t,n));return}r(s===null||s instanceof Set),n===void 0?(e.style.removeProperty(t),s?.delete(t)):(this.isStyleElementStatic()?r(this.#e===null):s===null?this.#e=new Set([t]):s.add(t),e.style.setProperty(t,n))}setClass(t,n){const e=this.#i?.classList;let s,i;if(typeof n!="boolean")s=t,i=n,M(s!==i),i===""&&(i=void 0);else if(e===void 0||!this.isStyleElementStatic())s=t,i=n?t:void 0;else{f(e,t,n);return}this.#t===null&&(this.#t=new Map);const l=this.#t.get(s);i!==void 0?(this.#t.set(s,i),e!==void 0&&(l!==void 0&&f(e,l,!1),f(e,i,!0))):l!==void 0&&(this.#t.delete(s),e!==void 0&&f(e,l,!1))}setAttribute(t,n){const e=this.#o,s=this.#n;if(e===null){if(n==null){s?.delete(t);return}s===null?this.#n=new Map([[t,S(t,n)]]):(r(s instanceof Map),s.set(t,S(t,n)));return}r(s===null||s instanceof Set),n==null?(s?.delete(t),e.removeAttribute(t)):(this.isFunctionElementStatic()?r(this.#n===null):s===null?this.#n=new Set([t]):s.add(t),d(e,t,n))}#P(){if(this.#l(16))return;const t=b(this.props.classList),n=new Set(this.#f);for(const e of t)n.delete(e)||this.setClass(e,!0);for(const e of n)this.setClass(e,!1);this.#f=t.length!==0?t:null}#E(){if(this.#l(8))return;const t=this.props.style,n=this.#a,e=new Map;for(const s in t){const i=t[s];i!=null&&e.set(s,i.toString())}for(const s of n?.keys()??[])e.has(s)||this.setStyle(s);for(const[s,i]of e)n?.get(s)!==i&&this.setStyle(s,i);this.#a=e.size!==0?e:null}#S(){this.#E(),this.#P()}#g(){const t=this.#c;if(t!==null)for(const n of t){const[e,s]=this.readProp(n);s&&this.setAttribute(n.slice(5),e)}}applyComponentProps(){}#d(){this.#l(24)||m(t=>(t.#S(),t),this),m(t=>(t.#g(),t.applyComponentProps(),t),this)}onStyleElementChanged(t){r(t!==this.styleElement)}onFunctionElementChanged(t){r(t!==this.functionElement)}#b(){"ref"in this.props&&P(()=>{const{ref:t}=this.isFunctionElementStatic()?a(this.props,[],["ref"]):this.props;typeof t=="function"&&t(this.#o)})}#v(t){const n=this.#r,e=this.#o;if(n===null)return;const s=U(n);if(t!==null){E(t,{},w(t),!0,{...n},!0);for(const i of s)t.removeEventListener(i,F)}if(e!==null){E(e,n,w(e),!0,{},!0);for(const i of s)e.addEventListener(i,F)}this.isFunctionElementStatic()&&(this.#r=null)}#C(t){const n=this.#n;if(n!==null){r(n instanceof Set),this.#n=new Map;for(const e of n)this.#n.set(e,t.getAttribute(e))}}#p(t){const n=this.#o,e=k("function",this.isFunctionElementStatic(),n,t);if(n===e)return;if(r(!this.isFunctionElementStyle()||this.#i===e),this.onFunctionElementChanged(e),this.#o=e,this.#b(),this.#v(n),e===null){this.#C(n);return}const s=this.#n;if(s instanceof Set){r(n!==null);for(const i of s)d(e,i,n.getAttribute(i))}else if(s instanceof Map){r(n===null),this.#n=this.isFunctionElementStatic()?null:new Set(s.keys());for(const[i,l]of s.entries())d(e,i,l)}}#w(t){const n=this.#e;if(n!==null){r(n instanceof Set),this.#e=new Map;for(const e of n)this.#e.set(e,t.style.getPropertyValue(e))}}#h(t){const n=this.#i,e=k("style",this.isStyleElementStatic(),n,t);if(n===e)return;if(this.onStyleElementChanged(e),this.#i=e,this.isFunctionElementStyle()&&this.#p(t),e===null){this.#w(n);return}if(this.#t!==null&&this.#t.size!==0){for(const i of this.#t.values())f(e.classList,i,!0);if(this.isStyleElementStatic()){for(const[i,l]of this.#t.entries())i===l&&this.#t.delete(i);this.#t.size===0&&(this.#t=null)}}const s=this.#e;if(s instanceof Set){r(n!==null);for(const i of s)e.style.setProperty(i,n.style.getPropertyValue(i))}else if(s instanceof Map){r(n===null),this.#e=null;for(const[i,l]of s.entries())this.setStyle(i,l)}}#F(t,n){if(n.length!==0){this.#r={};for(const e of n){const s=J(e);this.#r[s]=t[e]}}}#k(t,n){for(const e of n)e in t&&(n.delete(e),this.setAttribute(e.slice(5),t[e]));n.size!==0&&(this.#c=[...n.values()])}#D(t){const n=[];(t.class??"")!==""&&n.push(t.class),"classList"in t&&!v(t.classList)&&(this.#s|=16,n.push(...b(t.classList))),n.length!==0&&(r(this.#t===null),this.#t=new Map(n.map(e=>[e,e])))}#M(t){if(!("style"in t))return;const n=t.style;if(!v(n)&&(this.#s|=8,n!==void 0)){r(this.#e===null),this.#e=new Map;for(const[e,s]of Object.entries(n))typeof e=="string"&&(typeof s=="string"||typeof s=="number")&&this.#e.set(e,s.toString())}}#x(){const[t,n]=P(()=>{const s=new Set,i=[];for(const l in this.props)l.startsWith("attr:")?s.add(l):l.startsWith("event:")&&i.push(l);return[s,i]}),e=a(this.props,["classList","style",...t.values()],["class",...n.values()]);this.#M(e),this.#D(e),this.#k(e,t),this.#F(e,n)}}function G(o){return x(),D._create.bind(null,o(D))}export{D as DomController,G as defineClientDomComponent};
1
+ import{$PROXY as A,createRenderEffect as m,getOwner as y,onCleanup as K,runWithOwner as L,untrack as P}from"solid-js";import{DelegatedEvents as O,assign as E,delegateEvents as I}from"solid-js/web";import{assertDebug as r,attributeValueOf as S,checkArgument as M,checkBrowser as x,checkState as N,consumeProps as a,isPropReactive as X,setAttribute as d}from"../util";import{elementPropsKeyOfEvent as J}from"./types";const p=Symbol(),u=Symbol(),j="http://www.w3.org/1999/xhtml",T="http://www.w3.org/1998/Math/MathML",R="http://www.w3.org/2000/svg",g=/[\t\n\f\r ]+/;function b(o){const t=[];if(o===void 0)return t;for(const[n,e]of Object.entries(o))typeof n=="string"&&n!==""&&e===!0&&t.push(n);return t;}function v(o){return typeof o=="object"&&o!==null&&A in o;}function C(o){return typeof o=="object"&&o!==null&&o.nodeType===Node.ELEMENT_NODE;}function w(o){return o.namespaceURI===R;}function H(o){return o.namespaceURI===j||o.namespaceURI===T||o.namespaceURI===R;}function f(o,t,n){if(!g.test(t)){t!==""&&o.toggle(t,n);return;}for(const e of t.split(g))e!==""&&o.toggle(e,n);}function U(o){return Object.keys(o).map(t=>t.slice(2).toLowerCase()).filter(t=>O.has(t));}function F(o){const t=this.ownerDocument;t!==document&&I([o.type],t);}function k(o,t,n,e){return Array.isArray(e)&&(e=e[e.length-1]),e===void 0?null:(M(o==="function"&&C(e)||o==="style"&&C(e)&&H(e),"not a valid element"),N(!t||n===null||n===e,`static ${o} element already resolved`),e);}class D{static _create(t,n){const e=a(n,["children"],["controllerRef"]),s=new t(n);y()!==null&&K(()=>s.onControllerCleanup()),s.#x(),e.controllerRef?.(s);const i=s.isFunctionElementStyle()?void 0:c=>s.#p(c),l=s.render("children"in e?e.children:()=>s.props.children,i);if(typeof l!="function")return s.#s|=4,i===void 0&&(s.#s|=2),s.#h(l),s.#d(),l;i===void 0&&(s.#s&=-3);let h=(()=>{const c=y();return()=>{s.#i!==null&&(h=void 0,L(c,()=>s.#d()));};})();return()=>{const c=l();return s.#h(c),h?.(),c;};}props;#u;#s;#i;#e;#t;#o;#n;#c;#r;#f;#a;constructor(t,n){x(),this.props=t,this.#u=null,this.#s=0,this.#i=null,this.#e=null,this.#t=null,this.#o=null,this.#n=null,this.#c=null,this.#r=null,this.#f=null,this.#a=null,n?.styleElementIsFunction&&(this.#s|=1),n?.functionElementIsStatic&&(this.#s|=2);}onControllerCleanup(){}#m(t){const n=this.#u;if(n===null)return u;const e=n.get(t);return(e===void 0?u:e===u?void 0:e);}#y(t,n){const e=this.#u;n===void 0&&(n=u),e===null?this.#u=/* @__PURE__ */new Map([[t,n]]):e.set(t,n);}readProp(t,n){const e=this.#m(t);if(n)return[e===p?this.props[t]:e===u?void 0:e,!1];const s=this.props[t];return e===p||e!==u&&e===s?[s,!1]:(this.#y(t,e===u&&!X(this.props,t)?p:s),[s,!0,e===u?void 0:e]);}readProps(t,n){const e={};for(const s of t)[e[s],e[`${s}Changed`],e[`${s}Previous`]]=this.readProp(s,n);return e;}consumeProps(t,n){return a(this.props,t,n);}get styleElement(){return this.#i;}get functionElement(){return this.#o;}#l(t){return(this.#s&t)===t;}isFunctionElementStatic(){return this.#l(2);}isStyleElementStatic(){return this.#l(4);}isFunctionElementStyle(){return this.#l(1);}setStyle(t,n){typeof n=="number"&&(n=n.toString());const e=this.#i,s=this.#e;if(e===null){n===void 0?s?.delete(t):s===null?this.#e=/* @__PURE__ */new Map([[t,n]]):(r(s instanceof Map),s.set(t,n));return;}r(s===null||s instanceof Set),n===void 0?(e.style.removeProperty(t),s?.delete(t)):(this.isStyleElementStatic()?r(this.#e===null):s===null?this.#e=/* @__PURE__ */new Set([t]):s.add(t),e.style.setProperty(t,n));}setClass(t,n){const e=this.#i?.classList;let s,i;if(typeof n!="boolean")s=t,i=n,M(s!==i),i===""&&(i=void 0);else if(e===void 0||!this.isStyleElementStatic())s=t,i=n?t:void 0;else{f(e,t,n);return;}this.#t===null&&(this.#t=/* @__PURE__ */new Map());const l=this.#t.get(s);i!==void 0?(this.#t.set(s,i),e!==void 0&&(l!==void 0&&f(e,l,!1),f(e,i,!0))):l!==void 0&&(this.#t.delete(s),e!==void 0&&f(e,l,!1));}setAttribute(t,n){const e=this.#o,s=this.#n;if(e===null){if(n==null){s?.delete(t);return;}s===null?this.#n=/* @__PURE__ */new Map([[t,S(t,n)]]):(r(s instanceof Map),s.set(t,S(t,n)));return;}r(s===null||s instanceof Set),n==null?(s?.delete(t),e.removeAttribute(t)):(this.isFunctionElementStatic()?r(this.#n===null):s===null?this.#n=/* @__PURE__ */new Set([t]):s.add(t),d(e,t,n));}#P(){if(this.#l(16))return;const t=b(this.props.classList),n=new Set(this.#f);for(const e of t)n.delete(e)||this.setClass(e,!0);for(const e of n)this.setClass(e,!1);this.#f=t.length!==0?t:null;}#E(){if(this.#l(8))return;const t=this.props.style,n=this.#a,e=/* @__PURE__ */new Map();for(const s in t){const i=t[s];i!=null&&e.set(s,i.toString());}for(const s of n?.keys()??[])e.has(s)||this.setStyle(s);for(const[s,i]of e)n?.get(s)!==i&&this.setStyle(s,i);this.#a=e.size!==0?e:null;}#S(){this.#E(),this.#P();}#g(){const t=this.#c;if(t!==null)for(const n of t){const[e,s]=this.readProp(n);s&&this.setAttribute(n.slice(5),e);}}applyComponentProps(){}#d(){this.#l(24)||m(t=>(t.#S(),t),this),m(t=>(t.#g(),t.applyComponentProps(),t),this);}onStyleElementChanged(t){r(t!==this.styleElement);}onFunctionElementChanged(t){r(t!==this.functionElement);}#b(){"ref"in this.props&&P(()=>{const{ref:t}=this.isFunctionElementStatic()?a(this.props,[],["ref"]):this.props;typeof t=="function"&&t(this.#o);});}#v(t){const n=this.#r,e=this.#o;if(n===null)return;const s=U(n);if(t!==null){E(t,{},w(t),!0,{...n},!0);for(const i of s)t.removeEventListener(i,F);}if(e!==null){E(e,n,w(e),!0,{},!0);for(const i of s)e.addEventListener(i,F);}this.isFunctionElementStatic()&&(this.#r=null);}#C(t){const n=this.#n;if(n!==null){r(n instanceof Set),this.#n=/* @__PURE__ */new Map();for(const e of n)this.#n.set(e,t.getAttribute(e));}}#p(t){const n=this.#o,e=k("function",this.isFunctionElementStatic(),n,t);if(n===e)return;if(r(!this.isFunctionElementStyle()||this.#i===e),this.onFunctionElementChanged(e),this.#o=e,this.#b(),this.#v(n),e===null){this.#C(n);return;}const s=this.#n;if(s instanceof Set){r(n!==null);for(const i of s)d(e,i,n.getAttribute(i));}else if(s instanceof Map){r(n===null),this.#n=this.isFunctionElementStatic()?null:new Set(s.keys());for(const[i,l]of s.entries())d(e,i,l);}}#w(t){const n=this.#e;if(n!==null){r(n instanceof Set),this.#e=/* @__PURE__ */new Map();for(const e of n)this.#e.set(e,t.style.getPropertyValue(e));}}#h(t){const n=this.#i,e=k("style",this.isStyleElementStatic(),n,t);if(n===e)return;if(this.onStyleElementChanged(e),this.#i=e,this.isFunctionElementStyle()&&this.#p(t),e===null){this.#w(n);return;}if(this.#t!==null&&this.#t.size!==0){for(const i of this.#t.values())f(e.classList,i,!0);if(this.isStyleElementStatic()){for(const[i,l]of this.#t.entries())i===l&&this.#t.delete(i);this.#t.size===0&&(this.#t=null);}}const s=this.#e;if(s instanceof Set){r(n!==null);for(const i of s)e.style.setProperty(i,n.style.getPropertyValue(i));}else if(s instanceof Map){r(n===null),this.#e=null;for(const[i,l]of s.entries())this.setStyle(i,l);}}#F(t,n){if(n.length!==0){this.#r={};for(const e of n){const s=J(e);this.#r[s]=t[e];}}}#k(t,n){for(const e of n)e in t&&(n.delete(e),this.setAttribute(e.slice(5),t[e]));n.size!==0&&(this.#c=[...n.values()]);}#D(t){const n=[];(t.class??"")!==""&&n.push(t.class),"classList"in t&&!v(t.classList)&&(this.#s|=16,n.push(...b(t.classList))),n.length!==0&&(r(this.#t===null),this.#t=new Map(n.map(e=>[e,e])));}#M(t){if(!("style"in t))return;const n=t.style;if(!v(n)&&(this.#s|=8,n!==void 0)){r(this.#e===null),this.#e=/* @__PURE__ */new Map();for(const[e,s]of Object.entries(n))typeof e=="string"&&(typeof s=="string"||typeof s=="number")&&this.#e.set(e,s.toString());}}#x(){const[t,n]=P(()=>{const s=/* @__PURE__ */new Set(),i=[];for(const l in this.props)l.startsWith("attr:")?s.add(l):l.startsWith("event:")&&i.push(l);return[s,i];}),e=a(this.props,["classList","style",...t.values()],["class",...n.values()]);this.#M(e),this.#D(e),this.#k(e,t),this.#F(e,n);}}function G(o){return x(),D._create.bind(null,o(D));}export{D as DomController,G as defineClientDomComponent};
@@ -1 +1 @@
1
- import{isServer as r}from"solid-js/web";import{defineClientDomComponent as t}from"./client";import{defineServerDomComponent as m}from"./server";const l=r?o=>m(o):(o,e)=>t(e);export{l as defineDomComponent};
1
+ import{isServer as r}from"solid-js/web";import{defineClientDomComponent as t}from"./client";import{defineServerDomComponent as m}from"./server";const l=r?o=>m(o):(o,e)=>t(e);export{l as defineDomComponent};
@@ -1 +1 @@
1
- import{untrack as u}from"solid-js";import{Properties as P}from"solid-js/web";import{attributeValueOf as l,checkServer as c}from"../util";import{elementPropsKeyOfEvent as d}from"./types";function a(e){if(typeof e=="string")return e.startsWith("attr:")?e.slice(5):e.startsWith("event:")?d(e):["children","class","classList","ref","style"].includes(e)?e:void 0}function D(e,n){const o=typeof n=="boolean"?l(e,n):n;return typeof n!="boolean"?n:o===null?void 0:o===""&&P.has(e)?!0:o}function p(e,n,o){let t=!1,r;Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get(){return t||(r=o(),t=!0),r},set(s){r=s,t=!0}})}function x(e){c();const n=e();return o=>{const t={},r={};for(const s in o){const f=s,i=a(f),m=()=>u(()=>o[f]);i===void 0?p(r,s,m):s.startsWith("attr:")?p(t,i,()=>D(i,m())):p(t,i,m)}return n(t,r)}}export{x as defineServerDomComponent};
1
+ import{untrack as u}from"solid-js";import{Properties as P}from"solid-js/web";import{attributeValueOf as l,checkServer as c}from"../util";import{elementPropsKeyOfEvent as d}from"./types";function a(e){if(typeof e=="string")return e.startsWith("attr:")?e.slice(5):e.startsWith("event:")?d(e):["children","class","classList","ref","style"].includes(e)?e:void 0;}function D(e,n){const o=typeof n=="boolean"?l(e,n):n;return typeof n!="boolean"?n:o===null?void 0:o===""&&P.has(e)?!0:o;}function p(e,n,o){let t=!1,r;Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get(){return t||(r=o(),t=!0),r;},set(s){r=s,t=!0;}});}function x(e){c();const n=e();return o=>{const t={},r={};for(const s in o){const f=s,i=a(f),m=()=>u(()=>o[f]);i===void 0?p(r,s,m):s.startsWith("attr:")?p(t,i,()=>D(i,m())):p(t,i,m);}return n(t,r);};}export{x as defineServerDomComponent};
@@ -1 +1 @@
1
- function n(t){const e=t.slice(6);return`on${e.charAt(0).toUpperCase()}${e.slice(1)}`}export{n as elementPropsKeyOfEvent};
1
+ function n(t){const e=t.slice(6);return`on${e.charAt(0).toUpperCase()}${e.slice(1)}`;}export{n as elementPropsKeyOfEvent};
@@ -1,15 +1,15 @@
1
- import{Show as B,children as S}from"solid-js";import{insert as r}from"solid-js/web";import{defineDomComponent as p}from"..";import{FOCUSABLE_SELECTORS as E}from"./focus";import"./feedback.css";const o="cw-Badge",d="cw-Badge-small",C=E.map(t=>`.cw-BadgedBox-content ${t}`).join(","),x={attributeFilter:["contenteditable","disabled","href","tabindex","type"],attributes:!0,childList:!0,subtree:!0};let v=0;function a(t,e,n){return n||t===void 0?"":typeof t=="number"&&e!==void 0&&e>=0&&t>e?`${e}+`:String(t)}function l(t){return t===void 0?void 0:`_cw-Badge-${t}`}function u(t,e){return{hidden:t===""&&!e?"true":void 0,role:t===""&&e?"img":void 0}}function c(t,e){return t!=null&&`${t}`!=""||e!=null&&`${e}`!=""}const L=p(()=>(t,e)=>{const n=a(e.value,e.max,e.small===!0),s=u(n,c(t["aria-label"],t["aria-labelledby"])),i=l(e.color);return<span aria-hidden={s.hidden}role={s.role}{...t}classList={{...t.classList,...i===void 0?void 0:{[i]:!0},[o]:!0,[d]:n===""}}>
1
+ import{Show as B,children as S}from"solid-js";import{insert as r}from"solid-js/web";import{defineDomComponent as p}from"..";import{FOCUSABLE_SELECTORS as E}from"./focus";import"./feedback.css";const o="cw-Badge",d="cw-Badge-small",C=E.map(t=>`.cw-BadgedBox-content ${t}`).join(","),x={attributeFilter:["contenteditable","disabled","href","tabindex","type"],attributes:!0,childList:!0,subtree:!0};let v=0;function a(t,e,n){return n||t===void 0?"":typeof t=="number"&&e!==void 0&&e>=0&&t>e?`${e}+`:String(t);}function l(t){return t===void 0?void 0:`_cw-Badge-${t}`;}function u(t,e){return{hidden:t===""&&!e?"true":void 0,role:t===""&&e?"img":void 0};}function c(t,e){return t!=null&&`${t}`!=""||e!=null&&`${e}`!="";}const L=/* @__PURE__ */p(()=>(t,e)=>{const n=a(e.value,e.max,e.small===!0),s=u(n,c(t["aria-label"],t["aria-labelledby"])),i=l(e.color);return<span aria-hidden={s.hidden}role={s.role}{...t}classList={{...t.classList,...(i===void 0?void 0:{[i]:!0}),[o]:!0,[d]:n===""}}>
2
2
  <span class="cw-Badge-label">{n}</span>
3
- </span>},t=>class extends t{#e;#n;#t;#s;#i;constructor(e){super(e,{styleElementIsFunction:!0}),this.#e=null,this.#n="attr:aria-hidden"in e,this.#t="attr:role"in e,this.#s=void 0,this.#i=!1}applyComponentProps(){const e=super.readProps(["attr:aria-label","attr:aria-labelledby","color","max","small","value"]),n=a(e.value,e.max,e.small===!0),s=c(e["attr:aria-label"],e["attr:aria-labelledby"]);if(e.colorChanged&&super.setClass("color",l(e.color)),n!==this.#s&&(this.#e!==null&&this.#e.textContent!==n&&(this.#e.textContent=n),super.setClass(d,n==="")),n!==this.#s||s!==this.#i){const i=u(n,s);this.#n||super.setAttribute("aria-hidden",i.hidden),this.#t||super.setAttribute("role",i.role)}this.#s=n,this.#i=s}render(){const e=<span class={o}>
3
+ </span>;},t=>class extends t{#e;#n;#t;#s;#i;constructor(e){super(e,{styleElementIsFunction:!0}),this.#e=null,this.#n="attr:aria-hidden"in e,this.#t="attr:role"in e,this.#s=void 0,this.#i=!1;}applyComponentProps(){const e=super.readProps(["attr:aria-label","attr:aria-labelledby","color","max","small","value"]),n=a(e.value,e.max,e.small===!0),s=c(e["attr:aria-label"],e["attr:aria-labelledby"]);if(e.colorChanged&&super.setClass("color",l(e.color)),n!==this.#s&&(this.#e!==null&&this.#e.textContent!==n&&(this.#e.textContent=n),super.setClass(d,n==="")),n!==this.#s||s!==this.#i){const i=u(n,s);this.#n||super.setAttribute("aria-hidden",i.hidden),this.#t||super.setAttribute("role",i.role);}this.#s=n,this.#i=s;}render(){const e=<span class={o}>
4
4
  <span class="cw-Badge-label"/>
5
- </span>;return this.#e=e.firstElementChild,e}});function m(t){return<B when={t.value!==void 0||t.small===!0}>
5
+ </span>;return this.#e=e.firstElementChild,e;}});function m(t){return<B when={t.value!==void 0||t.small===!0}>
6
6
  <L color={t.color}max={t.max}small={t.small}value={t.value}/>
7
- </B>}const D=p(()=>(t,e)=><span{...t}classList={{...t.classList,"cw-BadgedBox":!0}}>
7
+ </B>;}const D=/* @__PURE__ */p(()=>(t,e)=><span{...t}classList={{...t.classList,"cw-BadgedBox":!0}}>
8
8
  <span class="cw-BadgedBox-content">{t.children}</span>
9
9
  <span class="cw-BadgedBox-badge">
10
10
  {"badge"in e?e.badge:m(e)}
11
11
  </span>
12
- </span>,t=>class extends t{#e;#n;#t;constructor(e){super(e,{styleElementIsFunction:!0}),this.#e=`cw-BadgedBox-badge-${v++}`,this.#n=null,this.#t=void 0}onStyleElementChanged(e){super.onStyleElementChanged(e),this.#i(),this.#r(null),e!==null&&(e.ownerDocument.defaultView?.queueMicrotask??queueMicrotask)(()=>{this.styleElement===e&&this.#s(e)})}onControllerCleanup(){this.#i(),this.#r(null),super.onControllerCleanup()}#s(e){const n=e.ownerDocument.defaultView,s=()=>{this.#r(e.querySelector(C))};s(),n!==null&&(this.#t=new n.MutationObserver(s),this.#t.observe(e.firstElementChild,x))}#i(){this.#t?.disconnect(),this.#t=void 0}#r(e){const n=this.#n;if(n!==e){if(n!==null){const s=(n.getAttribute("aria-describedby")??"").split(/\s+/u).filter(i=>i!==""&&i!==this.#e);s.length===0?n.removeAttribute("aria-describedby"):n.setAttribute("aria-describedby",s.join(" "))}if(this.#n=e,e!==null){const s=(e.getAttribute("aria-describedby")??"").split(/\s+/u).filter(i=>i!=="");e.setAttribute("aria-describedby",[...s,this.#e].join(" "))}}}render(e){const n=<span class="cw-BadgedBox">
12
+ </span>,t=>class extends t{#e;#n;#t;constructor(e){super(e,{styleElementIsFunction:!0}),this.#e=`cw-BadgedBox-badge-${v++}`,this.#n=null,this.#t=void 0;}onStyleElementChanged(e){super.onStyleElementChanged(e),this.#i(),this.#r(null),e!==null&&(e.ownerDocument.defaultView?.queueMicrotask??queueMicrotask)(()=>{this.styleElement===e&&this.#s(e);});}onControllerCleanup(){this.#i(),this.#r(null),super.onControllerCleanup();}#s(e){const n=e.ownerDocument.defaultView,s=()=>{this.#r(e.querySelector(C));};s(),n!==null&&(this.#t=new n.MutationObserver(s),this.#t.observe(e.firstElementChild,x));}#i(){this.#t?.disconnect(),this.#t=void 0;}#r(e){const n=this.#n;if(n!==e){if(n!==null){const s=(n.getAttribute("aria-describedby")??"").split(/\s+/u).filter(i=>i!==""&&i!==this.#e);s.length===0?n.removeAttribute("aria-describedby"):n.setAttribute("aria-describedby",s.join(" "));}if(this.#n=e,e!==null){const s=(e.getAttribute("aria-describedby")??"").split(/\s+/u).filter(i=>i!=="");e.setAttribute("aria-describedby",[...s,this.#e].join(" "));}}}render(e){const n=<span class="cw-BadgedBox">
13
13
  <span class="cw-BadgedBox-content"/>
14
14
  <span class="cw-BadgedBox-badge"/>
15
- </span>,s=n.lastElementChild;return r(n.firstElementChild,e),s.id=this.#e,r(s,"badge"in this.props?S(()=>this.props.badge):m(this.props)),n}});export{L as Badge,D as BadgedBox};
15
+ </span>,s=n.lastElementChild;return r(n.firstElementChild,e),s.id=this.#e,r(s,"badge"in this.props?S(()=>this.props.badge):m(this.props)),n;}});export{L as Badge,D as BadgedBox};
@@ -1 +1 @@
1
- const n=["a[href]","button:not([disabled])","input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","[contenteditable]:not([contenteditable=false])","[tabindex]:not([tabindex='-1'])"];function o(t){const e=t.getRootNode().activeElement??null;return e!==null&&t.contains(e)}export{n as FOCUSABLE_SELECTORS,o as isFocusWithin};
1
+ const n=["a[href]","button:not([disabled])","input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","[contenteditable]:not([contenteditable=false])","[tabindex]:not([tabindex='-1'])"];function o(t){const e=t.getRootNode().activeElement??null;return e!==null&&t.contains(e);}export{n as FOCUSABLE_SELECTORS,o as isFocusWithin};
@@ -1 +1 @@
1
- import{Badge as t,BadgedBox as e}from"./badge";import{ContainedLoadingIndicator as i,ContainedLoadingIndicatorController as s,LoadingIndicator as p,LoadingIndicatorController as c}from"./loading";import{CircularProgressIndicator as d,CircularWavyProgressIndicator as g,LinearProgressIndicator as P,LinearWavyProgressIndicator as C}from"./progress";import{Snackbar as b,SnackbarController as m,SnackbarHost as k,SnackbarHostController as x,SnackbarQueue as T,createSnackbarQueue as S}from"./snackbar";import{PlainTooltip as y,PlainTooltipController as L,RichTooltip as u,RichTooltipController as B,TooltipController as R}from"./tooltip";import"./feedback.css";export{t as Badge,e as BadgedBox,d as CircularProgressIndicator,g as CircularWavyProgressIndicator,i as ContainedLoadingIndicator,s as ContainedLoadingIndicatorController,P as LinearProgressIndicator,C as LinearWavyProgressIndicator,p as LoadingIndicator,c as LoadingIndicatorController,y as PlainTooltip,L as PlainTooltipController,u as RichTooltip,B as RichTooltipController,b as Snackbar,m as SnackbarController,k as SnackbarHost,x as SnackbarHostController,T as SnackbarQueue,R as TooltipController,S as createSnackbarQueue};
1
+ import{Badge as t,BadgedBox as e}from"./badge";import{ContainedLoadingIndicator as i,ContainedLoadingIndicatorController as s,LoadingIndicator as p,LoadingIndicatorController as c}from"./loading";import{CircularProgressIndicator as d,CircularWavyProgressIndicator as g,LinearProgressIndicator as P,LinearWavyProgressIndicator as C}from"./progress";import{Snackbar as b,SnackbarController as m,SnackbarHost as k,SnackbarHostController as x,SnackbarQueue as T,createSnackbarQueue as S}from"./snackbar";import{PlainTooltip as y,PlainTooltipController as L,RichTooltip as u,RichTooltipController as B,TooltipController as R}from"./tooltip";import"./feedback.css";export{t as Badge,e as BadgedBox,d as CircularProgressIndicator,g as CircularWavyProgressIndicator,i as ContainedLoadingIndicator,s as ContainedLoadingIndicatorController,P as LinearProgressIndicator,C as LinearWavyProgressIndicator,p as LoadingIndicator,c as LoadingIndicatorController,y as PlainTooltip,L as PlainTooltipController,u as RichTooltip,B as RichTooltipController,b as Snackbar,m as SnackbarController,k as SnackbarHost,x as SnackbarHostController,T as SnackbarQueue,R as TooltipController,S as createSnackbarQueue};
@@ -1,7 +1,7 @@
1
- import{defineDomComponent as v}from"..";import{DomController as G}from"../dom/client";import{applySpringMotion as V,subscribeMotionFrames as k}from"../motion";import{MaterialShapes as u,Morph as C,Path as E,Point as H,cubicsToPath as U,formatPathCoordinate as p}from"../shape";import{checkArgument as B}from"../util";import{observeVisibility as X,whenInDocument as z}from"./observe";import"./feedback.css";const J=38/48,b=650,Y=297,f=.6,Q=200,W=4666,y=90,j=-180,K=50,Z=1,ee=.001,ne=250,g="Loading",te="--_cw-LoadingIndicator-value",I="rotate",ie="(prefers-reduced-motion: reduce)",l="cw-LoadingIndicator",P="cw-ContainedLoadingIndicator",oe=`${l} ${P}`,O=["error","primary","secondary","surface","tertiary"],re={},L=new WeakMap;function c(t,e){return t!==void 0&&Number.isFinite(t)?t:e}function _(t){const e=c(t.min,0),n=Math.max(e,c(t.max,1)),i=Math.min(n,Math.max(e,c(t.value,e)));return{min:e,max:n,value:i,ratio:n===e?0:(i-e)/(n-e),indeterminate:t.indeterminate===!0||t.value===void 0}}function ae(t){let e=1;for(const n of t){const i=n.calculateBounds(),o=n.calculateMaxBounds();e=Math.min(e,Math.max((i[2]-i[0])/(o[2]-o[0]),(i[3]-i[1])/(o[3]-o[1])))}return e*J}function M(t,e){const n=t.map(o=>o.normalized()),i=[];for(let o=1;o<n.length;o++)i.push(new C(n[o-1],n[o]));return e&&i.push(new C(n[n.length-1],n[0])),{morphs:i,scale:ae(t)}}function A(t,e){let n=t===void 0?re:L.get(t);return n===void 0&&(B(t.length>=2,"a loading indicator requires at least two polygons"),n={},L.set(t,n)),e?(n.circular??=M(t??[u.SoftBurst,u.Cookie9Sided,u.Pentagon,u.Pill,u.Sunny,u.Cookie4Sided,u.Oval],!0),n.circular):(n.open??=M(t??[u.Circle.transformed((i,o)=>new H(i,o).rotate(18)),u.SoftBurst],!1),n.open)}function se(t){const e=Math.sqrt(Q),n=e*Math.sqrt(1-f**2),i=t/1e3;return 1-Math.exp(-f*e*i)*(Math.cos(n*i)+f*e/n*Math.sin(n*i))}function h(t,e){const n=t.morphs,i=n.length*e;return{morph:n[Math.min(n.length-1,Math.floor(i))],progress:e===1?1:i%1,rotation:e*j}}function S(t,e){const n=t.morphs,i=Math.floor(e/b),o=e-i*b,r=o<Y,s=r?i:i+1,d=r?se(o):0;return{morph:n[s%n.length],progress:d,rotation:(s+1)*y+d*y+e/W*360}}function x(t,e,n){const i=t.morph.asCubics(t.progress),o=p(e);let r=1/0,s=1/0,d=-1/0,m=-1/0;for(const $ of i){const a=$.points;r=Math.min(r,a[0],a[2],a[4],a[6]),s=Math.min(s,a[1],a[3],a[5],a[7]),d=Math.max(d,a[0],a[2],a[4],a[6]),m=Math.max(m,a[1],a[3],a[5],a[7])}return{d:U(i,n).toSvgPathData(),transform:`matrix(${o} 0 0 ${o} ${p(.5-e*(r+d)/2)} ${p(.5-e*(s+m)/2)})`}}function D(t){return t!==void 0&&O.includes(t)?`_cw-ContainedLoadingIndicator-${t}`:void 0}function R(t){return t===void 0||O.includes(t)?void 0:t}function T(t){return typeof t=="number"?`${Math.max(0,c(t,0))}px`:t}function w(t){return t!==void 0&&Number.isFinite(t)&&t>0?`${t}px`:void 0}function N(t,e,n){return<svg aria-hidden="true"viewBox="0 0 1 1">
1
+ import{defineDomComponent as v}from"..";import{DomController as G}from"../dom/client";import{applySpringMotion as V,subscribeMotionFrames as k}from"../motion";import{Morph as S,Path as E,Point as H,cubicsToPath as U,formatPathCoordinate as m}from"../shape";import{circleShape as B,cookie4SidedShape as X,cookie9SidedShape as z,ovalShape as J,pentagonShape as Y,pillShape as Q,softBurstShape as b,sunnyShape as W}from"../shape/material-shapes";import{checkArgument as j}from"../util";import{observeVisibility as K,whenInDocument as Z}from"./observe";import"./feedback.css";const ee=38/48,y=650,ne=297,p=0.6,te=200,ie=4666,C=90,oe=-180,re=50,ae=1,se=1e-3,de=250,f="Loading",ue="--_cw-LoadingIndicator-value",I="rotate",le="(prefers-reduced-motion: reduce)",u="cw-LoadingIndicator",P="cw-ContainedLoadingIndicator",ce=`${u} ${P}`,_=["error","primary","secondary","surface","tertiary"],he={},L=/* @__PURE__ */new WeakMap();function l(t,e){return t!==void 0&&Number.isFinite(t)?t:e;}function O(t){const e=l(t.min,0),n=Math.max(e,l(t.max,1)),i=Math.min(n,Math.max(e,l(t.value,e)));return{min:e,max:n,value:i,ratio:n===e?0:(i-e)/(n-e),indeterminate:t.indeterminate===!0||t.value===void 0};}function me(t){let e=1;for(const n of t){const i=n.calculateBounds(),o=n.calculateMaxBounds();e=Math.min(e,Math.max((i[2]-i[0])/(o[2]-o[0]),(i[3]-i[1])/(o[3]-o[1])));}return e*ee;}function M(t,e){const n=t.map(o=>o.normalized()),i=[];for(let o=1;o<n.length;o++)i.push(new S(n[o-1],n[o]));return e&&i.push(new S(n[n.length-1],n[0])),{morphs:i,scale:me(t)};}function A(t,e){let n=t===void 0?he:L.get(t);return n===void 0&&(j(t.length>=2,"a loading indicator requires at least two polygons"),n={},L.set(t,n)),e?(n.circular??=M(t??[b(),z(),Y(),Q(),W(),X(),J()],!0),n.circular):(n.open??=M(t??[B().transformed((i,o)=>new H(i,o).rotate(18)),b()],!1),n.open);}function pe(t){const e=Math.sqrt(te),n=e*Math.sqrt(1-p**2),i=t/1e3;return 1-Math.exp(-p*e*i)*(Math.cos(n*i)+p*e/n*Math.sin(n*i));}function c(t,e){const n=t.morphs,i=n.length*e;return{morph:n[Math.min(n.length-1,Math.floor(i))],progress:e===1?1:i%1,rotation:e*oe};}function g(t,e){const n=t.morphs,i=Math.floor(e/y),o=e-i*y,r=o<ne,s=r?i:i+1,d=r?pe(o):0;return{morph:n[s%n.length],progress:d,rotation:(s+1)*C+d*C+e/ie*360};}function x(t,e,n){const i=t.morph.asCubics(t.progress),o=m(e);let r=1/0,s=1/0,d=-1/0,h=-1/0;for(const $ of i){const a=$.points;r=Math.min(r,a[0],a[2],a[4],a[6]),s=Math.min(s,a[1],a[3],a[5],a[7]),d=Math.max(d,a[0],a[2],a[4],a[6]),h=Math.max(h,a[1],a[3],a[5],a[7]);}return{d:U(i,n).toSvgPathData(),transform:`matrix(${o} 0 0 ${o} ${m(0.5-e*(r+d)/2)} ${m(0.5-e*(s+h)/2)})`};}function D(t){return t!==void 0&&_.includes(t)?`_cw-ContainedLoadingIndicator-${t}`:void 0;}function R(t){return t===void 0||_.includes(t)?void 0:t;}function T(t){return typeof t=="number"?`${Math.max(0,l(t,0))}px`:t;}function w(t){return t!==void 0&&Number.isFinite(t)&&t>0?`${t}px`:void 0;}function N(t,e,n){return<svg aria-hidden="true"viewBox="0 0 1 1">
2
2
  <g class="_cw-LoadingIndicator-rotation"style={n===void 0?void 0:{[I]:n}}>
3
3
  <path class="cw-LoadingIndicator-shape"d={t}transform={e}/>
4
4
  </g>
5
- </svg>}function q(t,e,n){const i=_(e),o=A(e.polygons,i.indeterminate),r=i.indeterminate?S(o,0):h(o,i.ratio),s=x(r,o.scale,new E),d=n?D(e.containerColor):void 0;return<div role="progressbar"{...t}aria-label={"aria-label"in t?t["aria-label"]:e.label??g}aria-valuemax={i.indeterminate?void 0:i.max}aria-valuemin={i.indeterminate?void 0:i.min}aria-valuenow={i.indeterminate?void 0:i.value}classList={{...t.classList,...d===void 0?void 0:{[d]:!0},...e.color===void 0?void 0:{[`_cw-LoadingIndicator-${e.color}`]:!0},[P]:n,[l]:!0,[`${l}-determinate`]:!i.indeterminate,[`${l}-indeterminate`]:i.indeterminate}}style={{...t.style,"--_cw-ContainedLoadingIndicator-containerColor":n?R(e.containerColor):void 0,"--_cw-ContainedLoadingIndicator-containerShape":n?T(e.containerShape):void 0,"--cw-Feedback-loading-size":w(e.size)}}>{N(s.d,s.transform,`${r.rotation}deg`)}</div>}class F extends G{#y;#L;#M;#m;#p;#f;#g;#a;#S;#i;#n;#s;#t;#d;#e;#u;#l;#o;#c;#C;constructor(e,n=!1){super(e,{styleElementIsFunction:!0}),this.#y=n,this.#L="attr:aria-label"in e,this.#M=new E,this.#m=null,this.#p=null,this.#f="",this.#g="",this.#a=void 0,this.#S=0,this.#i=null,this.#n=null,this.#s=0,this.#t=void 0,this.#d=-1/0,this.#e=void 0,this.#u=!0,this.#l=!1,this.#o=void 0,this.#c=[],this.#C=!1}applyComponentProps(){const e=super.readProps(["color","indeterminate","label","max","min","paused","polygons","size","value"]);e.colorChanged&&super.setClass("color",e.color===void 0?void 0:`_cw-LoadingIndicator-${e.color}`),e.sizeChanged&&super.setStyle("--cw-Feedback-loading-size",w(e.size)),e.labelChanged&&!this.#L&&super.setAttribute("aria-label",e.label??g),(e.indeterminateChanged||e.maxChanged||e.minChanged||e.polygonsChanged||e.valueChanged)&&this.#E(_(e),e.polygons,e.polygonsChanged),this.#r()}#E(e,n,i){const o=this.#i,r=this.#b();if(this.#i=e,super.setClass(`${l}-determinate`,!e.indeterminate),super.setClass(`${l}-indeterminate`,e.indeterminate),super.setAttribute("aria-valuemax",e.indeterminate?void 0:e.max),super.setAttribute("aria-valuemin",e.indeterminate?void 0:e.min),super.setAttribute("aria-valuenow",e.indeterminate?void 0:e.value),!i&&o?.indeterminate===e.indeterminate){e.indeterminate||this.#I(r,e.ratio);return}this.#n=A(n,e.indeterminate),this.#a=void 0,this.#s=0,this.#t=void 0,this.#d=-1/0,this.#e?.cancel(),this.#e=void 0,this.#h(e.indeterminate?S(this.#n,0):h(this.#n,e.ratio))}#I(e,n){const i=this.styleElement;i!==null&&(this.#e===void 0?this.#e=V(i,te,e,n,{damping:Z,stiffness:K,threshold:ee}):this.#e.retarget(n))}#b(){return Math.min(1,Math.max(0,this.#e?.value??this.#i?.ratio??0))}#r(){const e=this.styleElement?.ownerDocument.defaultView??null,n=this.#i;if(e!==null&&this.#u&&(this.#e?.playState==="running"||n?.indeterminate===!0&&!this.#l&&super.readProp("paused",!0)[0]!==!0)){this.#o??=k(e,o=>this.#P(o));return}this.#o?.(),this.#o=void 0,this.#t=void 0,n?.indeterminate===!1&&this.#n!==null&&this.#h(h(this.#n,this.#b()))}#P(e){const n=this.#i,i=this.#n;if(!(n===null||i===null)){if(!n.indeterminate){this.#h(h(i,this.#b())),this.#e?.playState!=="running"&&this.#r();return}this.#t!==void 0&&e-this.#t<=ne&&(this.#s+=Math.max(0,e-this.#t)),this.#t=e,this.#h(S(i,this.#s))}}#h(e){const n=this.#m,i=this.#p,o=this.#i?.indeterminate===!0?this.#d=Math.max(this.#d,e.rotation):e.rotation;if(n===null||i===null||(i.style.setProperty(I,`${o}deg`),e.morph===this.#a&&e.progress===this.#S))return;const r=x(e,this.#n.scale,this.#M);this.#a=e.morph,this.#S=e.progress,r.d!==this.#f&&(this.#f=r.d,n.setAttribute("d",r.d)),r.transform!==this.#g&&(this.#g=r.transform,n.setAttribute("transform",r.transform))}onStyleElementChanged(e){super.onStyleElementChanged(e),this.#v(),e!==null&&z(e,n=>{!this.#C&&this.styleElement===e&&this.#O(e,n)})}onControllerCleanup(){this.#C=!0,this.#v(),this.#e?.cancel(),super.onControllerCleanup()}#O(e,n){const i=n.matchMedia(ie),o=()=>{this.#l=i.matches,this.#r()},r=X(e,s=>{this.#u=s,this.#r()});this.#l=i.matches,this.#u=!0,i.addEventListener("change",o),this.#c.push(()=>i.removeEventListener("change",o)),r!==void 0&&this.#c.push(r),this.#r()}#v(){this.#o?.(),this.#o=void 0,this.#t=void 0;for(const e of this.#c.splice(0))e()}render(){const e=<div aria-label={g}class={this.#y?oe:l}role="progressbar">
5
+ </svg>;}function q(t,e,n){const i=O(e),o=A(e.polygons,i.indeterminate),r=i.indeterminate?g(o,0):c(o,i.ratio),s=x(r,o.scale,new E()),d=n?D(e.containerColor):void 0;return<div role="progressbar"{...t}aria-label={"aria-label"in t?t["aria-label"]:e.label??f}aria-valuemax={i.indeterminate?void 0:i.max}aria-valuemin={i.indeterminate?void 0:i.min}aria-valuenow={i.indeterminate?void 0:i.value}classList={{...t.classList,...(d===void 0?void 0:{[d]:!0}),...(e.color===void 0?void 0:{[`_cw-LoadingIndicator-${e.color}`]:!0}),[P]:n,[u]:!0,[`${u}-determinate`]:!i.indeterminate,[`${u}-indeterminate`]:i.indeterminate}}style={{...t.style,"--_cw-ContainedLoadingIndicator-containerColor":n?R(e.containerColor):void 0,"--_cw-ContainedLoadingIndicator-containerShape":n?T(e.containerShape):void 0,"--cw-Feedback-loading-size":w(e.size)}}>{N(s.d,s.transform,`${r.rotation}deg`)}</div>;}class F extends G{#C;#L;#M;#m;#p;#f;#g;#a;#S;#i;#n;#s;#t;#d;#e;#u;#l;#o;#c;#b;constructor(e,n=!1){super(e,{styleElementIsFunction:!0}),this.#C=n,this.#L="attr:aria-label"in e,this.#M=new E(),this.#m=null,this.#p=null,this.#f="",this.#g="",this.#a=void 0,this.#S=0,this.#i=null,this.#n=null,this.#s=0,this.#t=void 0,this.#d=-1/0,this.#e=void 0,this.#u=!0,this.#l=!1,this.#o=void 0,this.#c=[],this.#b=!1;}applyComponentProps(){const e=super.readProps(["color","indeterminate","label","max","min","paused","polygons","size","value"]);e.colorChanged&&super.setClass("color",e.color===void 0?void 0:`_cw-LoadingIndicator-${e.color}`),e.sizeChanged&&super.setStyle("--cw-Feedback-loading-size",w(e.size)),e.labelChanged&&!this.#L&&super.setAttribute("aria-label",e.label??f),(e.indeterminateChanged||e.maxChanged||e.minChanged||e.polygonsChanged||e.valueChanged)&&this.#E(O(e),e.polygons,e.polygonsChanged),this.#r();}#E(e,n,i){const o=this.#i,r=this.#y();if(this.#i=e,super.setClass(`${u}-determinate`,!e.indeterminate),super.setClass(`${u}-indeterminate`,e.indeterminate),super.setAttribute("aria-valuemax",e.indeterminate?void 0:e.max),super.setAttribute("aria-valuemin",e.indeterminate?void 0:e.min),super.setAttribute("aria-valuenow",e.indeterminate?void 0:e.value),!i&&o?.indeterminate===e.indeterminate){e.indeterminate||this.#I(r,e.ratio);return;}this.#n=A(n,e.indeterminate),this.#a=void 0,this.#s=0,this.#t=void 0,this.#d=-1/0,this.#e?.cancel(),this.#e=void 0,this.#h(e.indeterminate?g(this.#n,0):c(this.#n,e.ratio));}#I(e,n){const i=this.styleElement;i!==null&&(this.#e===void 0?this.#e=V(i,ue,e,n,{damping:ae,stiffness:re,threshold:se}):this.#e.retarget(n));}#y(){return Math.min(1,Math.max(0,this.#e?.value??this.#i?.ratio??0));}#r(){const e=this.styleElement?.ownerDocument.defaultView??null,n=this.#i;if(e!==null&&this.#u&&(this.#e?.playState==="running"||n?.indeterminate===!0&&!this.#l&&super.readProp("paused",!0)[0]!==!0)){this.#o??=k(e,o=>this.#P(o));return;}this.#o?.(),this.#o=void 0,this.#t=void 0,n?.indeterminate===!1&&this.#n!==null&&this.#h(c(this.#n,this.#y()));}#P(e){const n=this.#i,i=this.#n;if(!(n===null||i===null)){if(!n.indeterminate){this.#h(c(i,this.#y())),this.#e?.playState!=="running"&&this.#r();return;}this.#t!==void 0&&e-this.#t<=de&&(this.#s+=Math.max(0,e-this.#t)),this.#t=e,this.#h(g(i,this.#s));}}#h(e){const n=this.#m,i=this.#p,o=this.#i?.indeterminate===!0?this.#d=Math.max(this.#d,e.rotation):e.rotation;if(n===null||i===null||(i.style.setProperty(I,`${o}deg`),e.morph===this.#a&&e.progress===this.#S))return;const r=x(e,this.#n.scale,this.#M);this.#a=e.morph,this.#S=e.progress,r.d!==this.#f&&(this.#f=r.d,n.setAttribute("d",r.d)),r.transform!==this.#g&&(this.#g=r.transform,n.setAttribute("transform",r.transform));}onStyleElementChanged(e){super.onStyleElementChanged(e),this.#v(),e!==null&&Z(e,n=>{!this.#b&&this.styleElement===e&&this.#_(e,n);});}onControllerCleanup(){this.#b=!0,this.#v(),this.#e?.cancel(),super.onControllerCleanup();}#_(e,n){const i=n.matchMedia(le),o=()=>{this.#l=i.matches,this.#r();},r=K(e,s=>{this.#u=s,this.#r();});this.#l=i.matches,this.#u=!0,i.addEventListener("change",o),this.#c.push(()=>i.removeEventListener("change",o)),r!==void 0&&this.#c.push(r),this.#r();}#v(){this.#o?.(),this.#o=void 0,this.#t=void 0;for(const e of this.#c.splice(0))e();}render(){const e=<div aria-label={f}class={this.#C?ce:u}role="progressbar">
6
6
  {N()}
7
- </div>;return this.#m=e.querySelector("path"),this.#p=e.querySelector("g"),e}}const ge=v(()=>(t,e)=>q(t,e,!1),()=>F);class de extends F{constructor(e){super(e,!0)}applyComponentProps(){const e=super.readProps(["containerColor","containerShape"]);super.applyComponentProps(),e.containerColorChanged&&(super.setClass("containerColor",D(e.containerColor)),super.setStyle("--_cw-ContainedLoadingIndicator-containerColor",R(e.containerColor))),e.containerShapeChanged&&super.setStyle("--_cw-ContainedLoadingIndicator-containerShape",T(e.containerShape))}}const Se=v(()=>(t,e)=>q(t,e,!0),()=>de);export{Se as ContainedLoadingIndicator,de as ContainedLoadingIndicatorController,ge as LoadingIndicator,F as LoadingIndicatorController};
7
+ </div>;return this.#m=e.querySelector("path"),this.#p=e.querySelector("g"),e;}}const Ee=/* @__PURE__ */v(()=>(t,e)=>q(t,e,!1),()=>F);class fe extends F{constructor(e){super(e,!0);}applyComponentProps(){const e=super.readProps(["containerColor","containerShape"]);super.applyComponentProps(),e.containerColorChanged&&(super.setClass("containerColor",D(e.containerColor)),super.setStyle("--_cw-ContainedLoadingIndicator-containerColor",R(e.containerColor))),e.containerShapeChanged&&super.setStyle("--_cw-ContainedLoadingIndicator-containerShape",T(e.containerShape));}}const Ie=/* @__PURE__ */v(()=>(t,e)=>q(t,e,!0),()=>fe);export{Ie as ContainedLoadingIndicator,fe as ContainedLoadingIndicatorController,Ee as LoadingIndicator,F as LoadingIndicatorController};
@@ -1 +1 @@
1
- const u=new WeakMap,v=new WeakMap,f=new WeakMap,l=["opacity","scale"];function O(t,r){const n=t.getAnimations().filter(e=>l.includes(e.transitionProperty));n.length===0?r():Promise.allSettled(n.map(e=>e.finished)).then(r)}function w(t,r){const n=t.ownerDocument.defaultView;if(n!==null){r(n);return}queueMicrotask(()=>{const e=t.ownerDocument.defaultView;e!==null&&r(e)})}function p(t,r){const n=t.ownerDocument.defaultView;let e=n===null?void 0:u.get(n);if(!(n===null||typeof n.IntersectionObserver!="function")){if(e===void 0){const o=new Map;e={observer:new n.IntersectionObserver(i=>{for(const s of i)o.get(s.target)?.(s.isIntersecting)}),listeners:o},u.set(n,e)}return e.listeners.set(t,r),e.observer.observe(t),b(e,t,r)}}function E(t,r){const n=t.ownerDocument.defaultView;let e=n===null?void 0:v.get(n);if(!(n===null||typeof n.ResizeObserver!="function")){if(e===void 0){const o=new Map;e={observer:new n.ResizeObserver(i=>{for(const s of i)o.get(s.target)?.(s.contentBoxSize[0]?.inlineSize??s.contentRect.width)}),listeners:o},v.set(n,e)}return e.listeners.set(t,r),e.observer.observe(t),b(e,t,r)}}function M(t,r,n){const e=t.ownerDocument.defaultView;let o=e===null?void 0:f.get(e);if(!(e===null||typeof e.MutationObserver!="function")){if(o===void 0){const i=new Map;o={observer:new e.MutationObserver(s=>{const d=new Set;for(const a of s)d.add(c(i,a.target));for(const a of d)a?.()}),listeners:i,options:new Map},f.set(e,o)}return o.listeners.set(t,n),o.options.set(t,r),o.observer.observe(t,r),()=>{const i=o;if(i.listeners.get(t)===n){i.listeners.delete(t),i.options.delete(t),i.observer.disconnect();for(const[s,d]of i.options)i.observer.observe(s,d)}}}}function c(t,r){for(let n=r;n!==null;n=n.parentNode){const e=t.get(n);if(e!==void 0)return e}}function b(t,r,n){return()=>{t.listeners.get(r)===n&&(t.listeners.delete(r),t.observer.unobserve(r))}}export{E as observeInlineSize,M as observeMutations,p as observeVisibility,O as whenExitMotionFinished,w as whenInDocument};
1
+ const u=/* @__PURE__ */new WeakMap(),v=/* @__PURE__ */new WeakMap(),f=/* @__PURE__ */new WeakMap(),l=["opacity","scale"];function O(t,r){const n=t.getAnimations().filter(e=>l.includes(e.transitionProperty));n.length===0?r():Promise.allSettled(n.map(e=>e.finished)).then(r);}function w(t,r){const n=t.ownerDocument.defaultView;if(n!==null){r(n);return;}queueMicrotask(()=>{const e=t.ownerDocument.defaultView;e!==null&&r(e);});}function p(t,r){const n=t.ownerDocument.defaultView;let e=n===null?void 0:u.get(n);if(!(n===null||typeof n.IntersectionObserver!="function")){if(e===void 0){const o=/* @__PURE__ */new Map();e={observer:new n.IntersectionObserver(i=>{for(const s of i)o.get(s.target)?.(s.isIntersecting);}),listeners:o},u.set(n,e);}return e.listeners.set(t,r),e.observer.observe(t),b(e,t,r);}}function E(t,r){const n=t.ownerDocument.defaultView;let e=n===null?void 0:v.get(n);if(!(n===null||typeof n.ResizeObserver!="function")){if(e===void 0){const o=/* @__PURE__ */new Map();e={observer:new n.ResizeObserver(i=>{for(const s of i)o.get(s.target)?.(s.contentBoxSize[0]?.inlineSize??s.contentRect.width);}),listeners:o},v.set(n,e);}return e.listeners.set(t,r),e.observer.observe(t),b(e,t,r);}}function M(t,r,n){const e=t.ownerDocument.defaultView;let o=e===null?void 0:f.get(e);if(!(e===null||typeof e.MutationObserver!="function")){if(o===void 0){const i=/* @__PURE__ */new Map();o={observer:new e.MutationObserver(s=>{const d=/* @__PURE__ */new Set();for(const a of s)d.add(c(i,a.target));for(const a of d)a?.();}),listeners:i,options:/* @__PURE__ */new Map()},f.set(e,o);}return o.listeners.set(t,n),o.options.set(t,r),o.observer.observe(t,r),()=>{const i=o;if(i.listeners.get(t)===n){i.listeners.delete(t),i.options.delete(t),i.observer.disconnect();for(const[s,d]of i.options)i.observer.observe(s,d);}};}}function c(t,r){for(let n=r;n!==null;n=n.parentNode){const e=t.get(n);if(e!==void 0)return e;}}function b(t,r,n){return()=>{t.listeners.get(r)===n&&(t.listeners.delete(r),t.observer.unobserve(r));};}export{E as observeInlineSize,M as observeMutations,p as observeVisibility,O as whenExitMotionFinished,w as whenInDocument};
@@ -1,11 +1,11 @@
1
- import{defineDomComponent as P}from"..";import{DomController as re}from"../dom/client";import{CornerRounding as z,Morph as te,Path as ne,Shapes as x,morphToPath as se}from"../shape";import{observeInlineSize as oe,observeVisibility as ie,whenInDocument as ae}from"./observe";import"./feedback.css";const y=4,de=4,b=3,ce=40,ue=20,M=240,D=40,le=48,pe=4,me=4,ge=15,Pe=5,he=16,R=[.1,.95],k=4,p="cw-Progress",fe="cw-Progress-determinate",ve="cw-Progress-indeterminate",Se="_cw-Progress-paused",h="_cw-Progress-waving",T="_cw-Progress-flattening",O="cw-LinearProgressIndicator",N="cw-LinearWavyProgressIndicator",G="cw-CircularProgressIndicator",V="cw-CircularWavyProgressIndicator",c=new Map;function d(r,e){return r!==void 0&&Number.isFinite(r)?r:e}function a(r,e){return r!==void 0&&Number.isFinite(r)&&r>0?r:e}function u(r){return`${r}px`}function $(r){return r===void 0?void 0:`${r}s`}function l(r){const e=d(r.min,0),t=Math.max(e,d(r.max,1)),n=Math.min(t,Math.max(e,d(r.value,e)));return{min:e,max:t,value:n,ratio:t===e?0:(n-e)/(t-e),indeterminate:r.indeterminate===!0||r.value===void 0}}function X(r){return r===void 0?void 0:`_cw-Progress-${r}`}function H(r){return r.indeterminate?ve:fe}function J(r,e){return r!==void 0?Math.min(1,Math.max(0,d(r,0))):e.indeterminate||e.ratio>R[0]&&e.ratio<R[1]?1:0}function U(r,e,t){const n=e===void 0?t:d(e,0);return n>0?r/n:void 0}function I(r,e){return Math.max(k,a(r,e.indeterminate?ue:ce))}function j(r,e,t,n){const s=e/2,o=Math.floor((Math.max(0,r)+2*e)/s),i=t/2+b,m=2*b*n,L=new ne().moveTo(0,i);for(let g=0;g<o;g++){const _=g*s,W=_+s,A=i+(g%2===0?m:-m)*2/3;L.cubicTo(_+s/3,A,W-s/3,A,W,i)}return{d:L.toSvgPathData(),length:o*s}}function f(r,e){const t=e/2/(r-e);return`${-t} ${-t} ${1+2*t} ${1+2*t}`}function w(r,e){return Math.min(r/2,a(e,pe))}function E(r,e,t,n){return{"--_cw-Progress-circularGap":`${(Math.max(0,d(t,me))+e)/(Math.PI*(n?r-e:r))}`,"--_cw-Progress-size":u(r),"--_cw-Progress-strokeWidth":`${e/(r-e)}`}}function Ce(r,e,t){return Math.max(Pe,Math.round(Math.PI*(r-e)/t))}function be(r){let e=c.get(r);return e===void 0?(e=new te(x.circle(r).normalized(),x.star(r,1,.75,new z(.35,.4),new z(.5)).normalized()),c.size>=he&&c.delete(c.keys().next().value)):c.delete(r),c.set(r,e),e}function B(r,e){return se(be(r),e,{repeatPath:!0,startAngle:270}).toSvgPathData()}function F(){return<div class="cw-Progress-track">
1
+ import{defineDomComponent as P}from"..";import{DomController as re}from"../dom/client";import{CornerRounding as z,Morph as te,Path as ne,Shapes as x,morphToPath as se}from"../shape";import{observeInlineSize as oe,observeVisibility as ie,whenInDocument as ae}from"./observe";import"./feedback.css";const y=4,de=4,b=3,ce=40,ue=20,M=240,D=40,le=48,pe=4,me=4,ge=15,Pe=5,he=16,R=[0.1,0.95],k=4,p="cw-Progress",fe="cw-Progress-determinate",ve="cw-Progress-indeterminate",Se="_cw-Progress-paused",h="_cw-Progress-waving",T="_cw-Progress-flattening",O="cw-LinearProgressIndicator",N="cw-LinearWavyProgressIndicator",G="cw-CircularProgressIndicator",V="cw-CircularWavyProgressIndicator",c=/* @__PURE__ */new Map();function d(r,e){return r!==void 0&&Number.isFinite(r)?r:e;}function a(r,e){return r!==void 0&&Number.isFinite(r)&&r>0?r:e;}function u(r){return`${r}px`;}function $(r){return r===void 0?void 0:`${r}s`;}function l(r){const e=d(r.min,0),t=Math.max(e,d(r.max,1)),n=Math.min(t,Math.max(e,d(r.value,e)));return{min:e,max:t,value:n,ratio:t===e?0:(n-e)/(t-e),indeterminate:r.indeterminate===!0||r.value===void 0};}function X(r){return r===void 0?void 0:`_cw-Progress-${r}`;}function H(r){return r.indeterminate?ve:fe;}function J(r,e){return r!==void 0?Math.min(1,Math.max(0,d(r,0))):e.indeterminate||e.ratio>R[0]&&e.ratio<R[1]?1:0;}function U(r,e,t){const n=e===void 0?t:d(e,0);return n>0?r/n:void 0;}function I(r,e){return Math.max(k,a(r,e.indeterminate?ue:ce));}function j(r,e,t,n){const s=e/2,o=Math.floor((Math.max(0,r)+2*e)/s),i=t/2+b,m=2*b*n,L=new ne().moveTo(0,i);for(let g=0;g<o;g++){const _=g*s,W=_+s,A=i+(g%2===0?m:-m)*2/3;L.cubicTo(_+s/3,A,W-s/3,A,W,i);}return{d:L.toSvgPathData(),length:o*s};}function f(r,e){const t=e/2/(r-e);return`${-t} ${-t} ${1+2*t} ${1+2*t}`;}function w(r,e){return Math.min(r/2,a(e,pe));}function E(r,e,t,n){return{"--_cw-Progress-circularGap":`${(Math.max(0,d(t,me))+e)/(Math.PI*(n?r-e:r))}`,"--_cw-Progress-size":u(r),"--_cw-Progress-strokeWidth":`${e/(r-e)}`};}function Ce(r,e,t){return Math.max(Pe,Math.round(Math.PI*(r-e)/t));}function be(r){let e=c.get(r);return e===void 0?(e=new te(x.circle(r).normalized(),x.star(r,1,0.75,new z(0.35,0.4),new z(0.5)).normalized()),c.size>=he&&c.delete(c.keys().next().value)):c.delete(r),c.set(r,e),e;}function B(r,e){return se(be(r),e,{repeatPath:!0,startAngle:270}).toSvgPathData();}function F(){return<div class="cw-Progress-track">
2
2
  <span class="_cw-Progress-trackStart"/>
3
3
  <span class="_cw-Progress-trackMiddle"/>
4
4
  <span class="_cw-Progress-trackEnd"/>
5
5
  <span class="cw-LinearProgressIndicator-secondaryIndicator"/>
6
6
  <span class="cw-LinearProgressIndicator-indicator"/>
7
7
  <span class="cw-Progress-stopIndicator"/>
8
- </div>}function Z(r,e){return<div class="cw-Progress-track">
8
+ </div>;}function Z(r,e){return<div class="cw-Progress-track">
9
9
  <span class="_cw-Progress-trackStart"/>
10
10
  <span class="_cw-Progress-trackMiddle"/>
11
11
  <span class="_cw-Progress-trackEnd"/>
@@ -14,22 +14,22 @@ import{defineDomComponent as P}from"..";import{DomController as re}from"../dom/c
14
14
  <path class="cw-LinearWavyProgressIndicator-indicator"d={r}pathLength={e}/>
15
15
  </svg>
16
16
  <span class="cw-Progress-stopIndicator"/>
17
- </div>}function q(r){return<svg aria-hidden="true"viewBox={r}>
17
+ </div>;}function q(r){return<svg aria-hidden="true"viewBox={r}>
18
18
  <g class="_cw-Progress-rotation">
19
19
  <circle class="cw-CircularProgressIndicator-track"cx="0.5"cy="0.5"pathLength="1"r="0.5"transform="rotate(-90 0.5 0.5)"/>
20
20
  <circle class="cw-CircularProgressIndicator-indicator"cx="0.5"cy="0.5"pathLength="1"r="0.5"transform="rotate(-90 0.5 0.5)"/>
21
21
  </g>
22
- </svg>}function Y(r,e){return<svg aria-hidden="true"viewBox={r}>
22
+ </svg>;}function Y(r,e){return<svg aria-hidden="true"viewBox={r}>
23
23
  <g class="_cw-Progress-rotation">
24
24
  <circle class="cw-CircularWavyProgressIndicator-track"cx="0.5"cy="0.5"pathLength="1"r="0.5"transform="rotate(-90 0.5 0.5)"/>
25
25
  <path class="cw-CircularWavyProgressIndicator-indicator"d={e}pathLength="2"/>
26
26
  </g>
27
- </svg>}function v(r,e,t,n,s){const o=l(e),i=X(e.color);return<div{...r}aria-label={e.label??r["aria-label"]}aria-valuemax={o.max}aria-valuemin={o.min}aria-valuenow={o.indeterminate?void 0:o.value}classList={{...r.classList,...t,...i===void 0?void 0:{[i]:!0},[p]:!0,[H(o)]:!0}}role="progressbar"style={{...r.style,...n,"--cw-Progress-value":o.indeterminate?void 0:`${o.ratio}`}}>{s()}</div>}class S extends re{#e;#t;#n;constructor(e){super(e,{styleElementIsFunction:!0}),this.#e=null,this.#t=[],this.#n=!1}get progressState(){return this.#e??l({})}applyComponentProps(){const e=super.readProps(["color","indeterminate","label","max","min","value"]),t=e.indeterminateChanged||e.maxChanged||e.minChanged||e.valueChanged;if(e.colorChanged&&super.setClass("color",X(e.color)),e.labelChanged&&(e.label!==void 0||e.labelPrevious!==void 0)&&super.setAttribute("aria-label",e.label),t){const n=l(e);this.#e=n,super.setClass("state",H(n)),super.setStyle("--cw-Progress-value",n.indeterminate?void 0:n.ratio),super.setAttribute("aria-valuemax",n.max),super.setAttribute("aria-valuemin",n.min),super.setAttribute("aria-valuenow",n.indeterminate?void 0:n.value)}this.applyIndicatorProps(this.progressState,t)}observe(e){const t=ie(e,n=>{super.setClass(Se,!n)});return t===void 0?[]:[t]}onStyleElementChanged(e){super.onStyleElementChanged(e),this.#r(),e!==null&&ae(e,()=>{!this.#n&&this.styleElement===e&&(this.#t=this.observe(e))})}onControllerCleanup(){this.#n=!0,this.#r(),super.onControllerCleanup()}#r(){for(const e of this.#t.splice(0))e()}}function C(r){const e=r.stopSize;return{"--_cw-Progress-gap":u(Math.max(0,d(r.gapSize,de))),"--_cw-Progress-thickness":u(a(r.size,y)),"--cw-Feedback-progress-stopSize":e===void 0?void 0:u(Math.max(0,d(e,0)))}}class ye extends S{applyIndicatorProps(){const e=super.readProps(["gapSize","size","stopSize"]);if(e.gapSizeChanged||e.sizeChanged||e.stopSizeChanged)for(const[t,n]of Object.entries(C(e)))super.setStyle(t,n)}render(){return<div class={`${p} ${O}`}role="progressbar">
27
+ </svg>;}function v(r,e,t,n,s){const o=l(e),i=X(e.color);return<div{...r}aria-label={e.label??r["aria-label"]}aria-valuemax={o.max}aria-valuemin={o.min}aria-valuenow={o.indeterminate?void 0:o.value}classList={{...r.classList,...t,...(i===void 0?void 0:{[i]:!0}),[p]:!0,[H(o)]:!0}}role="progressbar"style={{...r.style,...n,"--cw-Progress-value":o.indeterminate?void 0:`${o.ratio}`}}>{s()}</div>;}class S extends re{#e;#t;#n;constructor(e){super(e,{styleElementIsFunction:!0}),this.#e=null,this.#t=[],this.#n=!1;}get progressState(){return this.#e??l({});}applyComponentProps(){const e=super.readProps(["color","indeterminate","label","max","min","value"]),t=e.indeterminateChanged||e.maxChanged||e.minChanged||e.valueChanged;if(e.colorChanged&&super.setClass("color",X(e.color)),e.labelChanged&&(e.label!==void 0||e.labelPrevious!==void 0)&&super.setAttribute("aria-label",e.label),t){const n=l(e);this.#e=n,super.setClass("state",H(n)),super.setStyle("--cw-Progress-value",n.indeterminate?void 0:n.ratio),super.setAttribute("aria-valuemax",n.max),super.setAttribute("aria-valuemin",n.min),super.setAttribute("aria-valuenow",n.indeterminate?void 0:n.value);}this.applyIndicatorProps(this.progressState,t);}observe(e){const t=ie(e,n=>{super.setClass(Se,!n);});return t===void 0?[]:[t];}onStyleElementChanged(e){super.onStyleElementChanged(e),this.#r(),e!==null&&ae(e,()=>{!this.#n&&this.styleElement===e&&(this.#t=this.observe(e));});}onControllerCleanup(){this.#n=!0,this.#r(),super.onControllerCleanup();}#r(){for(const e of this.#t.splice(0))e();}}function C(r){const e=r.stopSize;return{"--_cw-Progress-gap":u(Math.max(0,d(r.gapSize,de))),"--_cw-Progress-thickness":u(a(r.size,y)),"--cw-Feedback-progress-stopSize":e===void 0?void 0:u(Math.max(0,d(e,0)))};}class ye extends S{applyIndicatorProps(){const e=super.readProps(["gapSize","size","stopSize"]);if(e.gapSizeChanged||e.sizeChanged||e.stopSizeChanged)for(const[t,n]of Object.entries(C(e)))super.setStyle(t,n);}render(){return<div class={`${p} ${O}`}role="progressbar">
28
28
  {F()}
29
- </div>}}const De=P(()=>(r,e)=>v(r,e,{[O]:!0},C(e),F),()=>ye);function K(r,e){const t=I(r.wavelength,e),n=U(t,r.waveSpeed,t);return{amplitude:J(r.amplitude,e),style:{"--_cw-LinearWavyProgressIndicator-amplitude":u(b),"--_cw-LinearWavyProgressIndicator-wavelength":u(t),"--_cw-Progress-phaseDuration":$(n)}}}class Ie extends S{#e;#t;#n;#r;constructor(e){super(e),this.#e=[],this.#t=void 0,this.#n="",this.#r=void 0}applyIndicatorProps(e,t){const n=super.readProps(["amplitude","gapSize","size","stopSize","waveSpeed","wavelength"]);if(n.gapSizeChanged||n.sizeChanged||n.stopSizeChanged)for(const[s,o]of Object.entries(C(n)))super.setStyle(s,o);if(t||n.amplitudeChanged||n.sizeChanged||n.waveSpeedChanged||n.wavelengthChanged){const s=K(n,e);this.#r!==void 0&&s.amplitude!==this.#r&&super.setClass(T,s.amplitude<this.#r),this.#r=s.amplitude,super.setClass(h,s.amplitude>0);for(const[o,i]of Object.entries(s.style))super.setStyle(o,i);this.#s()}}observe(e){const t=oe(e,n=>{this.#t=n,this.#s()});return t===void 0?super.observe(e):[...super.observe(e),t]}#s(){const e=j(this.#t??M,I(super.readProp("wavelength",!0)[0],this.progressState),a(super.readProp("size",!0)[0],y),this.#r??0);if(e.d!==this.#n){this.#n=e.d;for(const t of this.#e)t.setAttribute("d",e.d),t.setAttribute("pathLength",`${e.length}`)}}render(){const e=<div class={`${p} ${N}`}role="progressbar">
29
+ </div>;}}const De=/* @__PURE__ */P(()=>(r,e)=>v(r,e,{[O]:!0},C(e),F),()=>ye);function K(r,e){const t=I(r.wavelength,e),n=U(t,r.waveSpeed,t);return{amplitude:J(r.amplitude,e),style:{"--_cw-LinearWavyProgressIndicator-amplitude":u(b),"--_cw-LinearWavyProgressIndicator-wavelength":u(t),"--_cw-Progress-phaseDuration":$(n)}};}class Ie extends S{#e;#t;#n;#r;constructor(e){super(e),this.#e=[],this.#t=void 0,this.#n="",this.#r=void 0;}applyIndicatorProps(e,t){const n=super.readProps(["amplitude","gapSize","size","stopSize","waveSpeed","wavelength"]);if(n.gapSizeChanged||n.sizeChanged||n.stopSizeChanged)for(const[s,o]of Object.entries(C(n)))super.setStyle(s,o);if(t||n.amplitudeChanged||n.sizeChanged||n.waveSpeedChanged||n.wavelengthChanged){const s=K(n,e);this.#r!==void 0&&s.amplitude!==this.#r&&super.setClass(T,s.amplitude<this.#r),this.#r=s.amplitude,super.setClass(h,s.amplitude>0);for(const[o,i]of Object.entries(s.style))super.setStyle(o,i);this.#s();}}observe(e){const t=oe(e,n=>{this.#t=n,this.#s();});return t===void 0?super.observe(e):[...super.observe(e),t];}#s(){const e=j(this.#t??M,I(super.readProp("wavelength",!0)[0],this.progressState),a(super.readProp("size",!0)[0],y),this.#r??0);if(e.d!==this.#n){this.#n=e.d;for(const t of this.#e)t.setAttribute("d",e.d),t.setAttribute("pathLength",`${e.length}`);}}render(){const e=<div class={`${p} ${N}`}role="progressbar">
30
30
  {Z()}
31
- </div>;return this.#e=Array.from(e.querySelectorAll("path")),e}}function we(r,e){const t=l(e),n=K(e,t),s=j(M,I(e.wavelength,t),a(e.size,y),n.amplitude);return v(r,e,{[N]:!0,[h]:n.amplitude>0},{...C(e),...n.style},()=>Z(s.d,s.length))}const ke=P(()=>we,()=>Ie);class Ee extends S{#e;constructor(e){super(e),this.#e=null}applyIndicatorProps(){const e=super.readProps(["gapSize","size","strokeWidth"]);if(e.gapSizeChanged||e.sizeChanged||e.strokeWidthChanged){const t=a(e.size,D),n=w(t,e.strokeWidth),s=E(t,n,e.gapSize,!1);for(const[o,i]of Object.entries(s))super.setStyle(o,i);this.#e?.setAttribute("viewBox",f(t,n))}}render(){const e=<div class={`${p} ${G}`}role="progressbar">
31
+ </div>;return this.#e=Array.from(e.querySelectorAll("path")),e;}}function we(r,e){const t=l(e),n=K(e,t),s=j(M,I(e.wavelength,t),a(e.size,y),n.amplitude);return v(r,e,{[N]:!0,[h]:n.amplitude>0},{...C(e),...n.style},()=>Z(s.d,s.length));}const ke=/* @__PURE__ */P(()=>we,()=>Ie);class Ee extends S{#e;constructor(e){super(e),this.#e=null;}applyIndicatorProps(){const e=super.readProps(["gapSize","size","strokeWidth"]);if(e.gapSizeChanged||e.sizeChanged||e.strokeWidthChanged){const t=a(e.size,D),n=w(t,e.strokeWidth),s=E(t,n,e.gapSize,!1);for(const[o,i]of Object.entries(s))super.setStyle(o,i);this.#e?.setAttribute("viewBox",f(t,n));}}render(){const e=<div class={`${p} ${G}`}role="progressbar">
32
32
  {q()}
33
- </div>;return this.#e=e.querySelector("svg"),e}}function Le(r,e){const t=a(e.size,D),n=w(t,e.strokeWidth);return v(r,e,{[G]:!0},E(t,n,e.gapSize,!1),()=>q(f(t,n)))}const Te=P(()=>Le,()=>Ee);function Q(r,e){const t=a(r.size,le),n=w(t,r.strokeWidth),s=Math.max(k,a(r.wavelength,ge)),o=Ce(t,n,s);return{size:t,strokeWidth:n,amplitude:J(r.amplitude,e),vertexCount:o,cycle:U(o*s,r.waveSpeed,s)}}function ee(r,e){return{...E(r.size,r.strokeWidth,e,!0),"--_cw-Progress-phaseDuration":$(r.cycle)}}class _e extends S{#e;#t;#n;#r;constructor(e){super(e),this.#e=null,this.#t=null,this.#n="",this.#r=void 0}applyIndicatorProps(e,t){const n=super.readProps(["amplitude","gapSize","size","strokeWidth","waveSpeed","wavelength"]);if(!t&&!n.amplitudeChanged&&!n.gapSizeChanged&&!n.sizeChanged&&!n.strokeWidthChanged&&!n.waveSpeedChanged&&!n.wavelengthChanged)return;const s=Q(n,e),o=B(s.vertexCount,s.amplitude);this.#r!==void 0&&s.amplitude!==this.#r&&super.setClass(T,s.amplitude<this.#r),this.#r=s.amplitude,super.setClass(h,s.amplitude>0);for(const[i,m]of Object.entries(ee(s,n.gapSize)))super.setStyle(i,m);this.#e?.setAttribute("viewBox",f(s.size,s.strokeWidth)),o!==this.#n&&(this.#n=o,this.#t?.setAttribute("d",o))}render(){const e=<div class={`${p} ${V}`}role="progressbar">
33
+ </div>;return this.#e=e.querySelector("svg"),e;}}function Le(r,e){const t=a(e.size,D),n=w(t,e.strokeWidth);return v(r,e,{[G]:!0},E(t,n,e.gapSize,!1),()=>q(f(t,n)));}const Te=/* @__PURE__ */P(()=>Le,()=>Ee);function Q(r,e){const t=a(r.size,le),n=w(t,r.strokeWidth),s=Math.max(k,a(r.wavelength,ge)),o=Ce(t,n,s);return{size:t,strokeWidth:n,amplitude:J(r.amplitude,e),vertexCount:o,cycle:U(o*s,r.waveSpeed,s)};}function ee(r,e){return{...E(r.size,r.strokeWidth,e,!0),"--_cw-Progress-phaseDuration":$(r.cycle)};}class _e extends S{#e;#t;#n;#r;constructor(e){super(e),this.#e=null,this.#t=null,this.#n="",this.#r=void 0;}applyIndicatorProps(e,t){const n=super.readProps(["amplitude","gapSize","size","strokeWidth","waveSpeed","wavelength"]);if(!t&&!n.amplitudeChanged&&!n.gapSizeChanged&&!n.sizeChanged&&!n.strokeWidthChanged&&!n.waveSpeedChanged&&!n.wavelengthChanged)return;const s=Q(n,e),o=B(s.vertexCount,s.amplitude);this.#r!==void 0&&s.amplitude!==this.#r&&super.setClass(T,s.amplitude<this.#r),this.#r=s.amplitude,super.setClass(h,s.amplitude>0);for(const[i,m]of Object.entries(ee(s,n.gapSize)))super.setStyle(i,m);this.#e?.setAttribute("viewBox",f(s.size,s.strokeWidth)),o!==this.#n&&(this.#n=o,this.#t?.setAttribute("d",o));}render(){const e=<div class={`${p} ${V}`}role="progressbar">
34
34
  {Y()}
35
- </div>;return this.#e=e.querySelector("svg"),this.#t=e.querySelector("path"),e}}function We(r,e){const t=Q(e,l(e));return v(r,e,{[V]:!0,[h]:t.amplitude>0},ee(t,e.gapSize),()=>Y(f(t.size,t.strokeWidth),B(t.vertexCount,t.amplitude)))}const Oe=P(()=>We,()=>_e);export{Te as CircularProgressIndicator,Oe as CircularWavyProgressIndicator,De as LinearProgressIndicator,ke as LinearWavyProgressIndicator};
35
+ </div>;return this.#e=e.querySelector("svg"),this.#t=e.querySelector("path"),e;}}function We(r,e){const t=Q(e,l(e));return v(r,e,{[V]:!0,[h]:t.amplitude>0},ee(t,e.gapSize),()=>Y(f(t.size,t.strokeWidth),B(t.vertexCount,t.amplitude)));}const Oe=/* @__PURE__ */P(()=>We,()=>_e);export{Te as CircularProgressIndicator,Oe as CircularWavyProgressIndicator,De as LinearProgressIndicator,ke as LinearWavyProgressIndicator};
@@ -1,23 +1,23 @@
1
- import{For as X,Show as S,createSignal as w,children as I,untrack as k}from"solid-js";import{insert as v}from"solid-js/web";import{defineDomComponent as D}from"..";import{Button as Q,IconButton as F}from"../action";import{ELEVATION_SHADOW_CSS_CLASS as A}from"../container/elevation-shadow";import{DomController as H}from"../dom/client";import{isFocusWithin as V}from"./focus";import{whenExitMotionFinished as O}from"./observe";import"../container/elevation-shadow.css";import"./feedback.css";const W=4e3,K=100,N="Dismiss",M="cw-Snackbar",R="cw-Snackbar-open",C="_cw-Snackbar-closing",_="_cw-Snackbar-actionOnNewLine",L=new WeakMap,g=new WeakMap;function U(s,e){return s!==void 0&&Number.isFinite(s)?Math.max(0,s):e?0:W}function B(s,e){let n=L.get(s);const t=s.defaultView,i={};t===null||s.body===null||e===""||(n===void 0&&(n=s.createElement("div"),n.className="_cw-Snackbar-announcer",n.setAttribute("aria-atomic","true"),n.setAttribute("aria-live","polite"),n.setAttribute("role","status"),L.set(s,n)),n.isConnected||s.body.append(n),n.textContent="",g.set(n,i),t.setTimeout(()=>{g.get(n)===i&&(n.textContent=e)},K))}function j(s){return Array.from(s.querySelectorAll(".cw-Snackbar-message, .cw-Snackbar-action"),e=>e.textContent?.trim()??"").filter(e=>e!=="").join(" ")}function $(s){return typeof s=="object"&&s!==null&&"message"in s}class z{#s;#e;#n;#t;constructor(){this.#s=new Set,this.#e=[],this.#n=null,this.#t=1}get current(){return this.#n}get pendingCount(){return this.#e.length}subscribe(e){return this.#s.add(e),()=>this.#s.delete(e)}enqueue(e,n={}){const t=$(e)?e:{...n,message:e},i=t.id??`cw-snackbar-${this.#t++}`,o={...t,id:i},J=o.dedupeKey??i,E=(this.#n===null?this.#e:[this.#n,...this.#e]).find(y=>(y.dedupeKey??y.id)===J);return E!==void 0?E.id:(this.#n===null?this.#n=o:this.#e.push(o),this.#i(),o.id)}dismiss(e,n="programmatic"){const t=this.#e.findIndex(o=>o.id===e),i=this.#n;return i!==null&&(e===void 0||i.id===e)?(this.#n=this.#e.shift()??null,this.#i(n,i.id),!0):t<0?!1:(this.#e.splice(t,1),this.#i(n,e),!0)}clear(){const e=this.#n;e===null&&this.#e.length===0||(this.#n=null,this.#e.length=0,this.#i(e===null?void 0:"programmatic",e?.id))}#i(e,n){for(const t of this.#s)t(e,n)}}function le(){return new z}function x(s){return[<S when={s.action()!==void 0||s.actionLabel()!==void 0}>
1
+ import{For as X,Show as S,createSignal as w,children as I,untrack as k}from"solid-js";import{insert as v}from"solid-js/web";import{defineDomComponent as D}from"..";import{Button as Q,IconButton as F}from"../action";import{ELEVATION_SHADOW_CSS_CLASS as A}from"../container/elevation-shadow";import{DomController as H}from"../dom/client";import{isFocusWithin as V}from"./focus";import{whenExitMotionFinished as O}from"./observe";import"../container/elevation-shadow.css";import"./feedback.css";const W=4e3,K=100,N="Dismiss",M="cw-Snackbar",R="cw-Snackbar-open",C="_cw-Snackbar-closing",_="_cw-Snackbar-actionOnNewLine",L=/* @__PURE__ */new WeakMap(),g=/* @__PURE__ */new WeakMap();function U(s,e){return s!==void 0&&Number.isFinite(s)?Math.max(0,s):e?0:W;}function B(s,e){let n=L.get(s);const t=s.defaultView,i={};t===null||s.body===null||e===""||(n===void 0&&(n=s.createElement("div"),n.className="_cw-Snackbar-announcer",n.setAttribute("aria-atomic","true"),n.setAttribute("aria-live","polite"),n.setAttribute("role","status"),L.set(s,n)),n.isConnected||s.body.append(n),n.textContent="",g.set(n,i),t.setTimeout(()=>{g.get(n)===i&&(n.textContent=e);},K));}function j(s){return Array.from(s.querySelectorAll(".cw-Snackbar-message, .cw-Snackbar-action"),e=>e.textContent?.trim()??"").filter(e=>e!=="").join(" ");}function $(s){return typeof s=="object"&&s!==null&&"message"in s;}class z{#s;#e;#n;#t;constructor(){this.#s=/* @__PURE__ */new Set(),this.#e=[],this.#n=null,this.#t=1;}get current(){return this.#n;}get pendingCount(){return this.#e.length;}subscribe(e){return this.#s.add(e),()=>this.#s.delete(e);}enqueue(e,n={}){const t=$(e)?e:{...n,message:e},i=t.id??`cw-snackbar-${this.#t++}`,o={...t,id:i},J=o.dedupeKey??i,E=(this.#n===null?this.#e:[this.#n,...this.#e]).find(y=>(y.dedupeKey??y.id)===J);return E!==void 0?E.id:(this.#n===null?this.#n=o:this.#e.push(o),this.#i(),o.id);}dismiss(e,n="programmatic"){const t=this.#e.findIndex(o=>o.id===e),i=this.#n;return i!==null&&(e===void 0||i.id===e)?(this.#n=this.#e.shift()??null,this.#i(n,i.id),!0):t<0?!1:(this.#e.splice(t,1),this.#i(n,e),!0);}clear(){const e=this.#n;e===null&&this.#e.length===0||(this.#n=null,this.#e.length=0,this.#i(e===null?void 0:"programmatic",e?.id));}#i(e,n){for(const t of this.#s)t(e,n);}}function le(){return new z();}function x(s){return[<S when={s.action()!==void 0||s.actionLabel()!==void 0}>
2
2
  <Q class="cw-Snackbar-action"size="sm"variant="text"onClick={s.onAction}>{s.action()??s.actionLabel()}</Q>
3
3
  </S>,<S when={s.dismissible()}>
4
4
  <F attr:aria-label={s.dismissLabel()}class="cw-Snackbar-dismiss"name="close"size="sm"onClick={s.onDismiss}/>
5
- </S>]}class G extends H{#s;#e;#n;#t;#i;#r;#a;#u;#d;#h;#p;#b;#m;#c;constructor(e){super(e,{styleElementIsFunction:!0}),this.#s="open"in e,this.#e=null,this.#n=!1,this.#t=!1,this.#i=!1,this.#r=!1,this.#a=0,this.#u=0,this.#d=void 0,this.#h=void 0,this.#p=0,this.#b=!1,this.#m=0,this.#c=!1}applyComponentProps(){const e=super.readProps(["actionLabel","actionOnNewLine","duration","open","pauseOnHover","request"]),n=e.request,t=this.#e?.()!==void 0||(n?.actionLabel??e.actionLabel)!==void 0,i=e.requestChanged&&e.requestPrevious!==void 0&&n!==void 0;if((e.actionOnNewLineChanged||e.requestChanged)&&super.setClass(_,(n?.actionOnNewLine??e.actionOnNewLine)===!0),i&&this.#t&&(this.#o(),k(()=>this.props.onDismiss?.("replacement",void 0,this))),e.durationChanged||e.requestChanged||t!==this.#n){const o=U(n?.duration??e.duration,t);this.#n=t,o!==this.#a&&(this.#o(),this.#a=o,this.#u=o,this.#l())}(e.pauseOnHoverChanged||e.requestChanged)&&!this.#S()&&this.#c&&(this.#c=!1,this.#l()),(e.openChanged||e.requestChanged)&&this.#f(this.#s?e.open!==!1:i||!this.#i,i)}dismiss(e,n="programmatic"){!this.#t||this.#i||this.#r||(this.#i=!0,this.#o(),this.#s||this.#f(!1,!1),k(()=>{this.props.onOpenChange?.(!1,e,n),this.props.onDismiss?.(n,e,this)}))}#f(e,n){const t=this.styleElement,i=!e&&this.#t&&t?.isConnected===!0;e===this.#t&&!n||(this.#t=e,e&&(this.#i=!1),this.#u=this.#a,this.#m++,super.setClass(C,i),super.setClass(R,e),super.setAttribute("hidden",!e),super.setAttribute("inert",!e),this.#o(),i&&this.#y(t),!(!e||t===null)&&(this.#l(),queueMicrotask(()=>{this.#t&&!this.#r&&this.styleElement===t&&B(t.ownerDocument,j(t))})))}#y(e){const n=this.#m;O(e,()=>{n===this.#m&&super.setClass(C,!1)})}#S(){return(super.readProp("request",!0)[0]?.pauseOnHover??super.readProp("pauseOnHover",!0)[0])!==!1}#l(){const e=this.styleElement?.ownerDocument.defaultView;this.#o(),!(this.#r||!this.#t||this.#i||this.#c||this.#a===0||e===null||e===void 0)&&(this.#h=e,this.#p=e.performance.now(),this.#d=e.setTimeout(()=>{this.#d=void 0,this.#u=0,this.dismiss(void 0,"timeout")},this.#u))}#o(){const e=this.#h;this.#d===void 0||e===void 0||(e.clearTimeout(this.#d),this.#u=Math.max(0,this.#u-(e.performance.now()-this.#p)),this.#d=void 0,this.#h=void 0)}#k(){const e=this.styleElement,n=this.#S()&&(this.#b||e!==null&&V(e));n!==this.#c&&(this.#c=n,n?this.#o():this.#l())}#C=e=>{(this.props.request?.onAction??this.props.onAction)?.(e,this),e.defaultPrevented||this.dismiss(e,"action")};#L=e=>this.dismiss(e,"dismiss");#g=e=>{e.key!=="Escape"||e.defaultPrevented||!this.#t||(e.preventDefault(),this.dismiss(e,"escape"))};#v=e=>{this.#b=e.type==="pointerenter",this.#k()};#E=()=>{(this.styleElement?.ownerDocument.defaultView?.queueMicrotask??queueMicrotask)(()=>this.#k())};onStyleElementChanged(e){super.onStyleElementChanged(e),this.#o(),e!==null&&(e.ownerDocument.defaultView?.queueMicrotask??queueMicrotask)(()=>{this.styleElement===e&&this.#l()})}onControllerCleanup(){this.#r=!0,this.#o(),super.onControllerCleanup()}render(e){const n=<div class={`${M} ${A}`}hidden inert>
5
+ </S>];}class G extends H{#s;#e;#n;#t;#i;#r;#a;#u;#d;#h;#p;#b;#m;#c;constructor(e){super(e,{styleElementIsFunction:!0}),this.#s="open"in e,this.#e=null,this.#n=!1,this.#t=!1,this.#i=!1,this.#r=!1,this.#a=0,this.#u=0,this.#d=void 0,this.#h=void 0,this.#p=0,this.#b=!1,this.#m=0,this.#c=!1;}applyComponentProps(){const e=super.readProps(["actionLabel","actionOnNewLine","duration","open","pauseOnHover","request"]),n=e.request,t=this.#e?.()!==void 0||(n?.actionLabel??e.actionLabel)!==void 0,i=e.requestChanged&&e.requestPrevious!==void 0&&n!==void 0;if((e.actionOnNewLineChanged||e.requestChanged)&&super.setClass(_,(n?.actionOnNewLine??e.actionOnNewLine)===!0),i&&this.#t&&(this.#o(),k(()=>this.props.onDismiss?.("replacement",void 0,this))),e.durationChanged||e.requestChanged||t!==this.#n){const o=U(n?.duration??e.duration,t);this.#n=t,o!==this.#a&&(this.#o(),this.#a=o,this.#u=o,this.#l());}(e.pauseOnHoverChanged||e.requestChanged)&&!this.#S()&&this.#c&&(this.#c=!1,this.#l()),(e.openChanged||e.requestChanged)&&this.#f(this.#s?e.open!==!1:i||!this.#i,i);}dismiss(e,n="programmatic"){!this.#t||this.#i||this.#r||(this.#i=!0,this.#o(),this.#s||this.#f(!1,!1),k(()=>{this.props.onOpenChange?.(!1,e,n),this.props.onDismiss?.(n,e,this);}));}#f(e,n){const t=this.styleElement,i=!e&&this.#t&&t?.isConnected===!0;e===this.#t&&!n||(this.#t=e,e&&(this.#i=!1),this.#u=this.#a,this.#m++,super.setClass(C,i),super.setClass(R,e),super.setAttribute("hidden",!e),super.setAttribute("inert",!e),this.#o(),i&&this.#y(t),!(!e||t===null)&&(this.#l(),queueMicrotask(()=>{this.#t&&!this.#r&&this.styleElement===t&&B(t.ownerDocument,j(t));})));}#y(e){const n=this.#m;O(e,()=>{n===this.#m&&super.setClass(C,!1);});}#S(){return(super.readProp("request",!0)[0]?.pauseOnHover??super.readProp("pauseOnHover",!0)[0])!==!1;}#l(){const e=this.styleElement?.ownerDocument.defaultView;this.#o(),!(this.#r||!this.#t||this.#i||this.#c||this.#a===0||e===null||e===void 0)&&(this.#h=e,this.#p=e.performance.now(),this.#d=e.setTimeout(()=>{this.#d=void 0,this.#u=0,this.dismiss(void 0,"timeout");},this.#u));}#o(){const e=this.#h;this.#d===void 0||e===void 0||(e.clearTimeout(this.#d),this.#u=Math.max(0,this.#u-(e.performance.now()-this.#p)),this.#d=void 0,this.#h=void 0);}#k(){const e=this.styleElement,n=this.#S()&&(this.#b||e!==null&&V(e));n!==this.#c&&(this.#c=n,n?this.#o():this.#l());}#C=e=>{(this.props.request?.onAction??this.props.onAction)?.(e,this),e.defaultPrevented||this.dismiss(e,"action");};#L=e=>this.dismiss(e,"dismiss");#g=e=>{e.key!=="Escape"||e.defaultPrevented||!this.#t||(e.preventDefault(),this.dismiss(e,"escape"));};#v=e=>{this.#b=e.type==="pointerenter",this.#k();};#E=()=>{(this.styleElement?.ownerDocument.defaultView?.queueMicrotask??queueMicrotask)(()=>this.#k());};onStyleElementChanged(e){super.onStyleElementChanged(e),this.#o(),e!==null&&(e.ownerDocument.defaultView?.queueMicrotask??queueMicrotask)(()=>{this.styleElement===e&&this.#l();});}onControllerCleanup(){this.#r=!0,this.#o(),super.onControllerCleanup();}render(e){const n=<div class={`${M} ${A}`}hidden inert>
6
6
  <div class="cw-Snackbar-message"/>
7
7
  <div class="cw-Snackbar-actions"/>
8
- </div>,t=()=>this.props.request;return v(n.firstElementChild,()=>t()?.message??this.props.message??e),this.#e=I(()=>t()?.action??this.props.action),v(n.lastElementChild,x({action:this.#e,actionLabel:()=>t()?.actionLabel??this.props.actionLabel,dismissible:()=>(t()?.dismissible??this.props.dismissible)===!0,dismissLabel:()=>t()?.dismissLabel??this.props.dismissLabel??N,onAction:this.#C,onDismiss:this.#L})),n.addEventListener("keydown",this.#g),n.addEventListener("pointerenter",this.#v),n.addEventListener("pointerleave",this.#v),n.addEventListener("focusin",this.#E),n.addEventListener("focusout",this.#E),n}}function Y(s,e){const n=e.request,t=e.open!==!1,i=(n?.actionOnNewLine??e.actionOnNewLine)===!0;return<div{...s}classList={{...s.classList,[_]:i,[A]:!0,[R]:t,[M]:!0}}hidden={!t}inert={!t}>
8
+ </div>,t=()=>this.props.request;return v(n.firstElementChild,()=>t()?.message??this.props.message??e),this.#e=I(()=>t()?.action??this.props.action),v(n.lastElementChild,x({action:this.#e,actionLabel:()=>t()?.actionLabel??this.props.actionLabel,dismissible:()=>(t()?.dismissible??this.props.dismissible)===!0,dismissLabel:()=>t()?.dismissLabel??this.props.dismissLabel??N,onAction:this.#C,onDismiss:this.#L})),n.addEventListener("keydown",this.#g),n.addEventListener("pointerenter",this.#v),n.addEventListener("pointerleave",this.#v),n.addEventListener("focusin",this.#E),n.addEventListener("focusout",this.#E),n;}}function Y(s,e){const n=e.request,t=e.open!==!1,i=(n?.actionOnNewLine??e.actionOnNewLine)===!0;return<div{...s}classList={{...s.classList,[_]:i,[A]:!0,[R]:t,[M]:!0}}hidden={!t}inert={!t}>
9
9
  <div class="cw-Snackbar-message">
10
10
  {n?.message??e.message??s.children}
11
11
  </div>
12
12
  <div class="cw-Snackbar-actions">
13
13
  {x({action:()=>n?.action??e.action,actionLabel:()=>n?.actionLabel??e.actionLabel,dismissible:()=>(n?.dismissible??e.dismissible)===!0,dismissLabel:()=>n?.dismissLabel??e.dismissLabel??N})}
14
14
  </div>
15
- </div>}const P=D(()=>Y,()=>G);function q(s){const[e,n]=w(!0);return{request:s,open:e,setOpen:n}}function T(s){return`_cw-SnackbarHost-${s??"bottom"}`}class Z extends H{#s;#e;#n;#t;constructor(e){const n=k(()=>e.queue.current),[t,i]=w(n===null?[]:[q(n)]);super(e,{styleElementIsFunction:!0}),this.#s=t,this.#e=i,this.#n=null,this.#t=void 0}applyComponentProps(){const e=super.readProps(["position","queue"]);e.positionChanged&&super.setClass("position",T(e.position)),e.queueChanged&&(this.#t?.(),this.#n=e.queue,this.#t=e.queue.subscribe(this.#a),this.#i(e.queue.current))}#i(e){const t=this.#s().at(-1);t?.request===e&&t.open()||(t?.open()===!0&&this.#r(t),e!==null&&this.#e([...this.#s(),q(e)]))}#r(e){const n=e.controller?.styleElement,t=()=>{e.open()||this.#e(this.#s().filter(i=>i!==e))};if(e.setOpen(!1),n==null){t();return}(n.ownerDocument.defaultView?.queueMicrotask??queueMicrotask)(()=>{O(n,t)})}#a=(e,n)=>{const t=this.#s().at(-1);e!==void 0&&t!==void 0&&t.request.id===n&&t.controller?.dismiss(void 0,e),this.#i(this.#n?.current??null)};onControllerCleanup(){this.#t?.(),this.#t=void 0,super.onControllerCleanup()}render(){const e=<div class="cw-SnackbarHost">
15
+ </div>;}const P=/* @__PURE__ */D(()=>Y,()=>G);function q(s){const[e,n]=w(!0);return{request:s,open:e,setOpen:n};}function T(s){return`_cw-SnackbarHost-${s??"bottom"}`;}class Z extends H{#s;#e;#n;#t;constructor(e){const n=k(()=>e.queue.current),[t,i]=w(n===null?[]:[q(n)]);super(e,{styleElementIsFunction:!0}),this.#s=t,this.#e=i,this.#n=null,this.#t=void 0;}applyComponentProps(){const e=super.readProps(["position","queue"]);e.positionChanged&&super.setClass("position",T(e.position)),e.queueChanged&&(this.#t?.(),this.#n=e.queue,this.#t=e.queue.subscribe(this.#a),this.#i(e.queue.current));}#i(e){const t=this.#s().at(-1);t?.request===e&&t.open()||(t?.open()===!0&&this.#r(t),e!==null&&this.#e([...this.#s(),q(e)]));}#r(e){const n=e.controller?.styleElement,t=()=>{e.open()||this.#e(this.#s().filter(i=>i!==e));};if(e.setOpen(!1),n==null){t();return;}(n.ownerDocument.defaultView?.queueMicrotask??queueMicrotask)(()=>{O(n,t);});}#a=(e,n)=>{const t=this.#s().at(-1);e!==void 0&&t!==void 0&&t.request.id===n&&t.controller?.dismiss(void 0,e),this.#i(this.#n?.current??null);};onControllerCleanup(){this.#t?.(),this.#t=void 0,super.onControllerCleanup();}render(){const e=<div class="cw-SnackbarHost">
16
16
  <div class="cw-SnackbarHost-content"/>
17
- </div>;return v(e.firstElementChild,<X each={this.#s()}>{n=><P controllerRef={t=>n.controller=t}open={n.open()}request={n.request}onDismiss={(t,i,o)=>{this.props.onDismiss?.(t,i,o),this.#n?.dismiss(n.request.id,t)}}/>}</X>),e}}const he=D(()=>(s,e)=><div{...s}classList={{...s.classList,[T(e.position)]:!0,"cw-SnackbarHost":!0}}>
17
+ </div>;return v(e.firstElementChild,<X each={this.#s()}>{n=><P controllerRef={t=>n.controller=t}open={n.open()}request={n.request}onDismiss={(t,i,o)=>{this.props.onDismiss?.(t,i,o),this.#n?.dismiss(n.request.id,t);}}/>}</X>),e;}}const he=/* @__PURE__ */D(()=>(s,e)=><div{...s}classList={{...s.classList,[T(e.position)]:!0,"cw-SnackbarHost":!0}}>
18
18
  <div class="cw-SnackbarHost-content">
19
19
  <S when={e.queue.current}>
20
20
  {n=><P open request={n()}/>}
21
21
  </S>
22
22
  </div>
23
- </div>,()=>Z);export{P as Snackbar,G as SnackbarController,he as SnackbarHost,Z as SnackbarHostController,z as SnackbarQueue,le as createSnackbarQueue};
23
+ </div>,()=>Z);export{P as Snackbar,G as SnackbarController,he as SnackbarHost,Z as SnackbarHostController,z as SnackbarQueue,le as createSnackbarQueue};
@@ -1,18 +1,18 @@
1
- import{Show as V,children as j,createSignal as x,createUniqueId as M,getListener as O,untrack as a}from"solid-js";import{insert as T}from"solid-js/web";import{defineDomComponent as H}from"..";import{ELEVATION_SHADOW_CSS_CLASS as F}from"../container/elevation-shadow";import{DomController as G}from"../dom/client";import{resolveSurfaceSlots as _}from"../surface/slots";import{isLeaveWithin as U}from"../util/event";import{FOCUSABLE_SELECTORS as q,isFocusWithin as A}from"./focus";import{observeMutations as z,whenExitMotionFinished as Y,whenInDocument as K}from"./observe";import"../container/elevation-shadow.css";import"./feedback.css";const Q=500,Z=1500,ee=500,te=8,ie=4,g=8,X="Tooltip",W=["aria-controls","aria-describedby","aria-expanded","aria-haspopup"],ne=[...q,"[role=button]"].join(","),se={attributeFilter:["contenteditable","disabled","href","tabindex","type"],attributes:!0,childList:!0,subtree:!0},R="_cw-Tooltip-closing",w="_cw-Tooltip-caret",y=new WeakMap;function I(o,e){return o===void 0||!Number.isFinite(o)?e:Math.max(0,o)}function k(o){return W.includes(o)}function C(o,e,t){return Math.max(e,Math.min(o,t))}function D(o,e){return Number.parseFloat(o.getPropertyValue(e))||0}function S(o){return Array.isArray(o)?o.some(S):o!=null&&o!==!1&&o!==""}function L(o){return o==null?void 0:`${o}`}function E(o,e,t){t===null?o.removeAttribute(e):o.setAttribute(e,t)}function J(o,e,t){const i=Object.create(null);return Object.defineProperties(i,{open:{configurable:!0,enumerable:!1,get:e},popupId:{configurable:!0,enumerable:!1,get:t}}),Object.setPrototypeOf(o,i)}class N extends G{#n;#P;#q;#de;#z;#c;#le;#t;#i;#s;#f;#O;#x;#r;#b;#R;#m;#g;#v;#T;#Y;#K;#e;#y;#I;#o;#h;#D;#A;#a;#d;#Q;#Z;#E;#u;#w;#H;#F;#he;#ee;#ue;#_;#pe;constructor(e,t){const i=a(()=>e.id)??M(),n=a(()=>e.disabled===!0),s=a(()=>e.open===!0)&&!n,[d,r]=x(s),[c,l]=x(n),[p,h]=x(i),f=new Map;super(e);for(const u of Object.keys(e))if(u.startsWith("attr:aria-")){const m=u.slice(5);f.set(m,a(()=>e[u]))}this.#n=t,this.#P=i,this.#q="open"in e,this.#de="trigger"in e,this.#z="attr:tabindex"in e,this.#c=[...f.keys()],this.#le=f,this.#t=null,this.#i=null,this.#s=null,this.#f=a(()=>e.trigger!==void 0),this.#O=new Set,this.#x=new Map,this.#r=new Map,this.#b=null,this.#R=null,this.#m=void 0,this.#g=void 0,this.#v=void 0,this.#T=void 0,this.#Y=0,this.#K=0,this.#e=s,this.#y=!1,this.#I=0,this.#o=!1,this.#h=!1,this.#D=!1,this.#A=!1,this.#a=void 0,this.#d=!1,this.#Q=0,this.#Z=0,this.#E=void 0,this.#u=void 0,this.#w=void 0,this.#H=null,this.#F=c,this.#he=l,this.#ee=d,this.#ue=r,this.#_=p,this.#pe=h}get persistent(){return!1}applyComponentProps(){const e=super.readProps(["caret","disabled","id","open","placement","trigger"]);if(this.#f=e.trigger!==void 0,e.disabledChanged&&(this.#he(e.disabled===!0),e.disabled===!0&&this.#p()),e.caretChanged&&this.#i?.classList.toggle(w,e.caret===!0),e.idChanged){const t=e.id??this.#P;this.#pe(t),this.#i?.setAttribute("id",t)}(e.openChanged||e.disabledChanged)&&this.#ce(this.#q?e.open===!0:this.#e,!1),this.#i!==null&&this.applyPopupName(this.#i),this.#C(),this.#e&&e.placementChanged&&this.#ae()}applyPopupName(e){}onFunctionElementChanged(e){const t=e;super.onFunctionElementChanged(e),this.#t!==t&&this.#fe(this.#t),this.#t=t,this.#Ce(),this.#m?.(),this.#m=void 0,t!==null&&K(t,()=>{!this.#o&&this.#t===t&&(this.#m=z(t,se,()=>this.#C()))}),this.#C()}onStyleElementChanged(e){super.onStyleElementChanged(e),(e===null||this.#T!==e.ownerDocument.defaultView)&&this.#p()}onControllerCleanup(){this.#Oe(),super.onControllerCleanup()}#te(e){const t=`attr:${e}`;if(this.#c.includes(e))return L(t in this.props?this.props[t]:this.#le.get(e))}#ie(e){const t=this.#i?.id??this.#P;return this.#c.includes(e)?this.#te(e):a(()=>this.props.disabled===!0)?void 0:e==="aria-describedby"?t:this.#n?e==="aria-controls"?t:e==="aria-expanded"?`${this.#e}`:"dialog":void 0}#Le(){const e=n=>O()===this.#H?a(n):n(),t=(n,s)=>({enumerable:!0,get:()=>(e(s),e(this.#F),this.#ie(n))}),i={};Object.defineProperties(i,{"aria-controls":t("aria-controls",this.#_),"aria-describedby":t("aria-describedby",this.#_),"aria-expanded":t("aria-expanded",this.#ee),"aria-haspopup":t("aria-haspopup",this.#F),tabIndex:{enumerable:!0,get:()=>e(this.#F)?void 0:0}});for(const n of this.#c)k(n)||Object.defineProperty(i,n,{enumerable:!0,get:()=>this.#te(n)});return J(i,()=>e(this.#ee),()=>e(this.#_))}renderTrigger(e){const t=this.#Le();return j(()=>{const i=this.#de?this.props.trigger:void 0;if(i===void 0)return e;this.#H=O();try{return i(t)}finally{this.#H=null}})}setPopup(e){this.#i=e,e.id=a(()=>this.props.id)??this.#P,e.classList.toggle(w,a(()=>this.props.caret)===!0),e.addEventListener("pointerenter",this.#W),e.addEventListener("pointerleave",this.#J),e.addEventListener("focusin",this.#N),e.addEventListener("focusout",this.#$)}#ce(e,t){const i=this.#i,n=a(()=>this.props.disabled===!0),s=e&&!n,d=s&&this.#y,r=!s&&i!==null&&A(i);if(!this.#o){if(this.#y=!1,!s&&this.#e&&(this.#h=this.#oe()),this.#I++,this.#p(),this.#e=s,s&&this.#a!==void 0&&(this.#d=!0),this.#ue(s),super.setClass(`${this.#n?"cw-RichTooltip":"cw-PlainTooltip"}-open`,s),i!==null&&(i.classList.toggle(R,!s&&i.matches(":popover-open")),i.inert=!s,i.hidden=!s,s?i.removeAttribute("aria-hidden"):i.setAttribute("aria-hidden","true")),this.#C(),this.#re(),r&&this.#s?.focus({preventScroll:!0}),d&&i!==null)for(const c of y.get(i.ownerDocument)??[])c!==this.#l&&c();t&&a(()=>this.props.onOpenChange?.(s))}}#L(e){if(!(this.#o||e&&a(()=>this.props.disabled===!0))){if(e&&this.#e&&this.#a!==void 0&&(this.#d=!0),e===this.#e){e||(this.#y=!1);return}this.#y=e,this.#q?(this.#p(),a(()=>this.props.onOpenChange?.(e))):this.#ce(e,!0)}}#C(){const e=this.#t,t=e?.querySelector(ne)??null,i=t??e,n=this.#f||!this.#z;if(e===null){this.#se();return}if(t!==null){for(const s of W)e.getAttribute(s)===this.#ie(s)&&e.removeAttribute(s);n&&e.removeAttribute("tabindex")}else n&&(a(()=>this.props.disabled===!0)?this.#z||e.removeAttribute("tabindex"):e.getAttribute("tabindex")!=="0"&&(e.tabIndex=0));i!==this.#s&&(this.#se(),this.#s=i),this.#Se(i),this.#Pe(),this.#Ae()}#Se(e){if(!this.#f||e===this.#t){this.#ne();return}if(e!==this.#b){const t=e.getAttribute("tabindex");this.#ne(),this.#b=e,this.#R=t==="0"?null:t}a(()=>this.props.disabled===!0)?e.removeAttribute("tabindex"):e.getAttribute("tabindex")!=="0"&&e.setAttribute("tabindex","0")}#ne(){this.#b!==null&&E(this.#b,"tabindex",this.#R),this.#b=null,this.#R=null}#Pe(){const e=this.#t,t=this.#s;if(!(e===null||t===null))for(const i of this.#c){const n=this.#te(i);if(t===e){n===void 0?e.removeAttribute(i):e.setAttribute(i,n);continue}e.removeAttribute(i),this.#xe(t,i,n)}}#xe(e,t,i){if(i===void 0){this.#r.has(t)&&(E(e,t,this.#r.get(t)),this.#r.delete(t));return}if(!this.#r.has(t)){const n=e.getAttribute(t);this.#r.set(t,this.#f&&k(t)&&n===this.#ie(t)?null:n)}e.setAttribute(t,i)}#Ae(){const e=this.#s,t=this.#i?.id??this.#P;if(e!==null){if(a(()=>this.props.disabled===!0)){for(const[i,n]of this.#x)E(e,i,n);return}this.#n&&(this.#X(e,"aria-controls",t),this.#X(e,"aria-expanded",`${this.#e}`),this.#X(e,"aria-haspopup","dialog")),this.#X(e,"aria-describedby",t)}}#X(e,t,i){if(!this.#c.includes(t)){if(!this.#O.has(t)){if(!this.#f&&e.hasAttribute(t))return;this.#O.add(t),this.#x.set(t,e.getAttribute(t))}e.setAttribute(t,i)}}#se(){const e=this.#s;if(e!==null){for(const[t,i]of this.#x)E(e,t,i);for(const[t,i]of this.#r)E(e,t,i)}this.#O.clear(),this.#x.clear(),this.#r.clear(),this.#ne(),this.#s=null}#Ce(){const e=this.#t;e!==null&&(e.addEventListener("pointerenter",this.#W),e.addEventListener("pointerleave",this.#J),e.addEventListener("focusin",this.#N),e.addEventListener("focusout",this.#$),e.addEventListener("pointerdown",this.#ge),e.addEventListener("pointermove",this.#ve),e.addEventListener("pointerup",this.#S),e.addEventListener("pointercancel",this.#S),e.addEventListener("click",this.#Te,!0),e.addEventListener("contextmenu",this.#ye))}#fe(e){e!==null&&(e.removeEventListener("pointerenter",this.#W),e.removeEventListener("pointerleave",this.#J),e.removeEventListener("focusin",this.#N),e.removeEventListener("focusout",this.#$),e.removeEventListener("pointerdown",this.#ge),e.removeEventListener("pointermove",this.#ve),e.removeEventListener("pointerup",this.#S),e.removeEventListener("pointercancel",this.#S),e.removeEventListener("click",this.#Te,!0),e.removeEventListener("contextmenu",this.#ye))}#W=e=>{e.pointerType!=="touch"&&(e.currentTarget===this.#t?this.#D=!0:this.#A=!0,this.#h=!1,this.#U(),this.#e||this.#V())};#J=e=>{if(e.pointerType==="touch"){this.#S(e);return}U(e,e.currentTarget)||(e.currentTarget===this.#t?this.#D=!1:this.#A=!1,this.#B()||this.#j())};#N=e=>{const i=e.target?.matches(":focus-visible")===!0;this.#h||(this.#C(),this.#U(),!this.#e&&e.currentTarget===this.#t&&i&&this.#V())};#$=()=>{(this.#M()?.queueMicrotask??queueMicrotask)(()=>{this.#o||(this.#oe()||(this.#h=!1),this.#B()||this.#j())})};#be=e=>{const t=this.#i?.ownerDocument,i=t===void 0?void 0:y.get(t);e.key!=="Escape"||!this.#e||i!==void 0&&[...i].at(-1)!==this.#l||(e.preventDefault(),e.stopImmediatePropagation(),this.#l())};#l=()=>{this.#p(),this.#L(!1)};#me=e=>{const t=e.composedPath();!t.includes(this.#t)&&!t.includes(this.#i)&&this.#l()};#B(){return this.persistent||this.#D||this.#A||this.#a!==void 0||!this.#h&&this.#oe()}#oe(){return this.#t!==null&&A(this.#t)||this.#i!==null&&A(this.#i)}#ge=e=>{this.#d=!1,!(e.pointerType!=="touch"||!e.isPrimary||a(()=>this.props.disabled===!0))&&(this.#h=!0,this.#a=e.pointerId,this.#Q=e.clientX,this.#Z=e.clientY,this.#V(ee))};#ve=e=>{e.pointerId===this.#a&&Math.hypot(e.clientX-this.#Q,e.clientY-this.#Z)>te&&this.#S(e)};#S=e=>{e.pointerId===this.#a&&(this.#a=void 0,this.#G(),e.type==="pointerup"?this.#e&&this.#j():(this.#d=!1,this.#l()))};#Te=e=>{const t=this.#d;if(this.#d=!1,t&&(e.detail>0||e.pointerType==="touch")){e.preventDefault(),e.stopImmediatePropagation();return}if(this.persistent&&!this.#e){this.#p(),this.#L(!0);return}this.#l()};#ye=e=>{this.#d&&e.preventDefault()};#re(){const e=this.#i,t=e?.ownerDocument.defaultView??null;if(e!==null){if(!this.#e){this.#ke(),this.#Me(e);return}if(!e.isConnected){queueMicrotask(()=>{this.#e&&e.isConnected&&this.#re()});return}if(!e.matches(":popover-open"))try{e.showPopover()}catch{return}if(this.#E===void 0&&t!==null){const i=y.get(t.document)??new Set;this.#E=t,i.add(this.#l),y.set(t.document,i),t.addEventListener("resize",this.#k),t.document.addEventListener("scroll",this.#k,!0),t.document.addEventListener("keydown",this.#be,!0),t.document.addEventListener("pointerdown",this.#me,!0),this.#w=new t.ResizeObserver(this.#k),this.#w.observe(e),this.#s!==null&&this.#w.observe(this.#s)}this.#ae()}}#ke(){const e=this.#E;e!==void 0&&(e.removeEventListener("resize",this.#k),e.document.removeEventListener("scroll",this.#k,!0),e.document.removeEventListener("keydown",this.#be,!0),e.document.removeEventListener("pointerdown",this.#me,!0),y.get(e.document)?.delete(this.#l),this.#u!==void 0&&e.cancelAnimationFrame(this.#u)),this.#u=void 0,this.#E=void 0,this.#A=!1,this.#w?.disconnect(),this.#w=void 0}#Me(e){const t=++this.#I,i=()=>{if(!(t!==this.#I||this.#e)){e.classList.remove(R);try{e.matches(":popover-open")&&e.hidePopover()}catch{}}};this.#o?i():Y(e,i)}#k=()=>{const e=this.#E;this.#u!==void 0||e===void 0||(this.#u=e.requestAnimationFrame(()=>{this.#u=void 0,this.#ae()}))};#ae(){const e=this.#i,t=this.#s??this.#t,i=e?.ownerDocument.defaultView??null;if(!this.#e||e===null||t===null||i===null)return;const n=t.getBoundingClientRect(),s={height:e.offsetHeight,width:e.offsetWidth},d=i.getComputedStyle(e),r=e.classList.contains(w),c=r?D(d,"--cw-Feedback-tooltip-caretHeight"):0,l=ie+c,p=a(()=>this.props.placement)??"top",h=p==="top"||p==="bottom";let f,u,m;if(h){const v=n.top-s.height-l,b=n.bottom+l,P=b+s.height>i.innerHeight-g;f=p==="top"&&v<g?"bottom":p==="bottom"&&P?"top":p,u=n.left+(n.width-s.width)/2,m=f==="top"?v:b}else{const v=i.getComputedStyle(t).direction==="rtl";let b=p==="end"!==v;u=b?n.right+l:n.left-s.width-l,(u<g||u+s.width>i.innerWidth-g)&&(b=!b,u=b?n.right+l:n.left-s.width-l),f=b?"right":"left",m=n.top+(n.height-s.height)/2}if(u=C(u,g,i.innerWidth-s.width-g),m=C(m,g,i.innerHeight-s.height-g),e.dataset.placement=f,e.style.left=`${u}px`,e.style.top=`${m}px`,r){const v=D(d,"--cw-Feedback-tooltip-caretWidth")/2,b=h?n.left+n.width/2-u:n.top+n.height/2-m,P=h?s.width:s.height;e.style.setProperty("--_cw-Tooltip-caretOffset",`${C(b,v,P-v)}px`)}}#V(e){const t=this.#M(),i=e??I(a(()=>this.props.showDelay),Q);if(!(this.#o||a(()=>this.props.disabled===!0))){if(this.#G(),i===0||t===void 0){this.#L(!0);return}this.#Ee(t,i),this.#g=t.setTimeout(()=>{const n=this.#we(t);if(this.#g=void 0,this.#M()!==t){this.#V(n);return}this.#L(!0)},i)}}#j(e){const t=this.#M(),i=e??I(a(()=>this.props.hideDelay),Z);if(this.#G(),this.#U(),this.#y=!1,!(this.#o||!this.#e||this.#B())){if(i===0||t===void 0){this.#L(!1);return}this.#Ee(t,i),this.#v=t.setTimeout(()=>{const n=this.#we(t);if(this.#v=void 0,this.#M()!==t){this.#j(n);return}this.#B()||this.#L(!1)},i)}}#Ee(e,t){this.#T=e,this.#Y=e.performance.now(),this.#K=t}#we(e){return Math.max(0,this.#K-(e.performance.now()-this.#Y))}#G(){this.#g!==void 0&&(this.#T?.clearTimeout(this.#g),this.#g=void 0)}#U(){this.#v!==void 0&&(this.#T?.clearTimeout(this.#v),this.#v=void 0)}#p(){this.#G(),this.#U(),this.#T=void 0}#M(){return(this.#t?.ownerDocument??this.#i?.ownerDocument??this.styleElement?.ownerDocument)?.defaultView??void 0}#Oe(){const e=this.#i;this.#o=!0,this.#e=!1,this.#re(),this.#p(),this.#m?.(),this.#m=void 0,this.#se(),this.#fe(this.#t),e!==null&&(e.removeEventListener("pointerenter",this.#W),e.removeEventListener("pointerleave",this.#J),e.removeEventListener("focusin",this.#N),e.removeEventListener("focusout",this.#$))}}function oe(o,e,t,i,n){const s=(r,c)=>r in i?L(i[r]):n?void 0:c,d={"aria-controls":s("aria-controls",t?o:void 0),"aria-describedby":s("aria-describedby",o),"aria-expanded":s("aria-expanded",t?`${e}`:void 0),"aria-haspopup":s("aria-haspopup",t?"dialog":void 0),tabIndex:n?void 0:0};for(const r of Object.keys(i))r.startsWith("aria-")&&!k(r)&&(d[r]=L(i[r]));return J(d,()=>e,()=>o)}function $(o,e,t,i,n){const s=e.disabled===!0,d=e.trigger,r=o,c=d===void 0&&!s&&!("tabindex"in r),l=(h,f)=>d!==void 0?void 0:h in r?L(r[h]):s?void 0:f,p={};for(const h of Object.keys(r))!["children","class","classList","ref","style"].includes(h)&&(d===void 0||!h.startsWith("aria-"))&&(p[h]=r[h]);return{attributes:{...p,"aria-controls":n?l("aria-controls",t):void 0,"aria-describedby":l("aria-describedby",t),"aria-expanded":n?l("aria-expanded",`${i}`):void 0,"aria-haspopup":n?l("aria-haspopup","dialog"):void 0,class:n?"cw-RichTooltip-trigger":"cw-PlainTooltip-trigger",tabIndex:c?0:void 0},content:()=>d===void 0?o.children:d(oe(t,i,n,r,s))}}function B(o){return<V when={S(o())}>
1
+ import{Show as V,children as j,createSignal as x,createUniqueId as M,getListener as O,untrack as a}from"solid-js";import{insert as T}from"solid-js/web";import{defineDomComponent as H}from"..";import{ELEVATION_SHADOW_CSS_CLASS as F}from"../container/elevation-shadow";import{DomController as G}from"../dom/client";import{resolveSurfaceSlots as _}from"../surface/slots";import{isLeaveWithin as U}from"../util/event";import{FOCUSABLE_SELECTORS as q,isFocusWithin as A}from"./focus";import{observeMutations as z,whenExitMotionFinished as Y,whenInDocument as K}from"./observe";import"../container/elevation-shadow.css";import"./feedback.css";const Q=500,Z=1500,ee=500,te=8,ie=4,g=8,X="Tooltip",W=["aria-controls","aria-describedby","aria-expanded","aria-haspopup"],ne=[...q,"[role=button]"].join(","),se={attributeFilter:["contenteditable","disabled","href","tabindex","type"],attributes:!0,childList:!0,subtree:!0},R="_cw-Tooltip-closing",w="_cw-Tooltip-caret",y=/* @__PURE__ */new WeakMap();function I(o,e){return o===void 0||!Number.isFinite(o)?e:Math.max(0,o);}function k(o){return W.includes(o);}function C(o,e,t){return Math.max(e,Math.min(o,t));}function D(o,e){return Number.parseFloat(o.getPropertyValue(e))||0;}function S(o){return Array.isArray(o)?o.some(S):o!=null&&o!==!1&&o!=="";}function L(o){return o==null?void 0:`${o}`;}function E(o,e,t){t===null?o.removeAttribute(e):o.setAttribute(e,t);}function J(o,e,t){const i=/* @__PURE__ */Object.create(null);return Object.defineProperties(i,{open:{configurable:!0,enumerable:!1,get:e},popupId:{configurable:!0,enumerable:!1,get:t}}),Object.setPrototypeOf(o,i);}class N extends G{#n;#P;#q;#de;#z;#c;#le;#t;#i;#s;#f;#O;#x;#r;#b;#R;#m;#g;#v;#T;#Y;#K;#e;#y;#I;#o;#h;#D;#A;#a;#d;#Q;#Z;#E;#u;#w;#H;#F;#he;#ee;#ue;#_;#pe;constructor(e,t){const i=a(()=>e.id)??M(),n=a(()=>e.disabled===!0),s=a(()=>e.open===!0)&&!n,[d,r]=x(s),[c,l]=x(n),[p,h]=x(i),f=/* @__PURE__ */new Map();super(e);for(const u of Object.keys(e))if(u.startsWith("attr:aria-")){const m=u.slice(5);f.set(m,a(()=>e[u]));}this.#n=t,this.#P=i,this.#q="open"in e,this.#de="trigger"in e,this.#z="attr:tabindex"in e,this.#c=[...f.keys()],this.#le=f,this.#t=null,this.#i=null,this.#s=null,this.#f=a(()=>e.trigger!==void 0),this.#O=/* @__PURE__ */new Set(),this.#x=/* @__PURE__ */new Map(),this.#r=/* @__PURE__ */new Map(),this.#b=null,this.#R=null,this.#m=void 0,this.#g=void 0,this.#v=void 0,this.#T=void 0,this.#Y=0,this.#K=0,this.#e=s,this.#y=!1,this.#I=0,this.#o=!1,this.#h=!1,this.#D=!1,this.#A=!1,this.#a=void 0,this.#d=!1,this.#Q=0,this.#Z=0,this.#E=void 0,this.#u=void 0,this.#w=void 0,this.#H=null,this.#F=c,this.#he=l,this.#ee=d,this.#ue=r,this.#_=p,this.#pe=h;}get persistent(){return!1;}applyComponentProps(){const e=super.readProps(["caret","disabled","id","open","placement","trigger"]);if(this.#f=e.trigger!==void 0,e.disabledChanged&&(this.#he(e.disabled===!0),e.disabled===!0&&this.#p()),e.caretChanged&&this.#i?.classList.toggle(w,e.caret===!0),e.idChanged){const t=e.id??this.#P;this.#pe(t),this.#i?.setAttribute("id",t);}(e.openChanged||e.disabledChanged)&&this.#ce(this.#q?e.open===!0:this.#e,!1),this.#i!==null&&this.applyPopupName(this.#i),this.#C(),this.#e&&e.placementChanged&&this.#ae();}applyPopupName(e){}onFunctionElementChanged(e){const t=e;super.onFunctionElementChanged(e),this.#t!==t&&this.#fe(this.#t),this.#t=t,this.#Ce(),this.#m?.(),this.#m=void 0,t!==null&&K(t,()=>{!this.#o&&this.#t===t&&(this.#m=z(t,se,()=>this.#C()));}),this.#C();}onStyleElementChanged(e){super.onStyleElementChanged(e),(e===null||this.#T!==e.ownerDocument.defaultView)&&this.#p();}onControllerCleanup(){this.#Oe(),super.onControllerCleanup();}#te(e){const t=`attr:${e}`;if(this.#c.includes(e))return L(t in this.props?this.props[t]:this.#le.get(e));}#ie(e){const t=this.#i?.id??this.#P;return this.#c.includes(e)?this.#te(e):a(()=>this.props.disabled===!0)?void 0:e==="aria-describedby"?t:this.#n?e==="aria-controls"?t:e==="aria-expanded"?`${this.#e}`:"dialog":void 0;}#Le(){const e=n=>O()===this.#H?a(n):n(),t=(n,s)=>({enumerable:!0,get:()=>(e(s),e(this.#F),this.#ie(n))}),i={};Object.defineProperties(i,{"aria-controls":t("aria-controls",this.#_),"aria-describedby":t("aria-describedby",this.#_),"aria-expanded":t("aria-expanded",this.#ee),"aria-haspopup":t("aria-haspopup",this.#F),tabIndex:{enumerable:!0,get:()=>e(this.#F)?void 0:0}});for(const n of this.#c)k(n)||Object.defineProperty(i,n,{enumerable:!0,get:()=>this.#te(n)});return J(i,()=>e(this.#ee),()=>e(this.#_));}renderTrigger(e){const t=this.#Le();return j(()=>{const i=this.#de?this.props.trigger:void 0;if(i===void 0)return e;this.#H=O();try{return i(t);}finally{this.#H=null;}});}setPopup(e){this.#i=e,e.id=a(()=>this.props.id)??this.#P,e.classList.toggle(w,a(()=>this.props.caret)===!0),e.addEventListener("pointerenter",this.#W),e.addEventListener("pointerleave",this.#J),e.addEventListener("focusin",this.#N),e.addEventListener("focusout",this.#$);}#ce(e,t){const i=this.#i,n=a(()=>this.props.disabled===!0),s=e&&!n,d=s&&this.#y,r=!s&&i!==null&&A(i);if(!this.#o){if(this.#y=!1,!s&&this.#e&&(this.#h=this.#oe()),this.#I++,this.#p(),this.#e=s,s&&this.#a!==void 0&&(this.#d=!0),this.#ue(s),super.setClass(`${this.#n?"cw-RichTooltip":"cw-PlainTooltip"}-open`,s),i!==null&&(i.classList.toggle(R,!s&&i.matches(":popover-open")),i.inert=!s,i.hidden=!s,s?i.removeAttribute("aria-hidden"):i.setAttribute("aria-hidden","true")),this.#C(),this.#re(),r&&this.#s?.focus({preventScroll:!0}),d&&i!==null)for(const c of y.get(i.ownerDocument)??[])c!==this.#l&&c();t&&a(()=>this.props.onOpenChange?.(s));}}#L(e){if(!(this.#o||e&&a(()=>this.props.disabled===!0))){if(e&&this.#e&&this.#a!==void 0&&(this.#d=!0),e===this.#e){e||(this.#y=!1);return;}this.#y=e,this.#q?(this.#p(),a(()=>this.props.onOpenChange?.(e))):this.#ce(e,!0);}}#C(){const e=this.#t,t=e?.querySelector(ne)??null,i=t??e,n=this.#f||!this.#z;if(e===null){this.#se();return;}if(t!==null){for(const s of W)e.getAttribute(s)===this.#ie(s)&&e.removeAttribute(s);n&&e.removeAttribute("tabindex");}else n&&(a(()=>this.props.disabled===!0)?this.#z||e.removeAttribute("tabindex"):e.getAttribute("tabindex")!=="0"&&(e.tabIndex=0));i!==this.#s&&(this.#se(),this.#s=i),this.#Se(i),this.#Pe(),this.#Ae();}#Se(e){if(!this.#f||e===this.#t){this.#ne();return;}if(e!==this.#b){const t=e.getAttribute("tabindex");this.#ne(),this.#b=e,this.#R=t==="0"?null:t;}a(()=>this.props.disabled===!0)?e.removeAttribute("tabindex"):e.getAttribute("tabindex")!=="0"&&e.setAttribute("tabindex","0");}#ne(){this.#b!==null&&E(this.#b,"tabindex",this.#R),this.#b=null,this.#R=null;}#Pe(){const e=this.#t,t=this.#s;if(!(e===null||t===null))for(const i of this.#c){const n=this.#te(i);if(t===e){n===void 0?e.removeAttribute(i):e.setAttribute(i,n);continue;}e.removeAttribute(i),this.#xe(t,i,n);}}#xe(e,t,i){if(i===void 0){this.#r.has(t)&&(E(e,t,this.#r.get(t)),this.#r.delete(t));return;}if(!this.#r.has(t)){const n=e.getAttribute(t);this.#r.set(t,this.#f&&k(t)&&n===this.#ie(t)?null:n);}e.setAttribute(t,i);}#Ae(){const e=this.#s,t=this.#i?.id??this.#P;if(e!==null){if(a(()=>this.props.disabled===!0)){for(const[i,n]of this.#x)E(e,i,n);return;}this.#n&&(this.#X(e,"aria-controls",t),this.#X(e,"aria-expanded",`${this.#e}`),this.#X(e,"aria-haspopup","dialog")),this.#X(e,"aria-describedby",t);}}#X(e,t,i){if(!this.#c.includes(t)){if(!this.#O.has(t)){if(!this.#f&&e.hasAttribute(t))return;this.#O.add(t),this.#x.set(t,e.getAttribute(t));}e.setAttribute(t,i);}}#se(){const e=this.#s;if(e!==null){for(const[t,i]of this.#x)E(e,t,i);for(const[t,i]of this.#r)E(e,t,i);}this.#O.clear(),this.#x.clear(),this.#r.clear(),this.#ne(),this.#s=null;}#Ce(){const e=this.#t;e!==null&&(e.addEventListener("pointerenter",this.#W),e.addEventListener("pointerleave",this.#J),e.addEventListener("focusin",this.#N),e.addEventListener("focusout",this.#$),e.addEventListener("pointerdown",this.#ge),e.addEventListener("pointermove",this.#ve),e.addEventListener("pointerup",this.#S),e.addEventListener("pointercancel",this.#S),e.addEventListener("click",this.#Te,!0),e.addEventListener("contextmenu",this.#ye));}#fe(e){e!==null&&(e.removeEventListener("pointerenter",this.#W),e.removeEventListener("pointerleave",this.#J),e.removeEventListener("focusin",this.#N),e.removeEventListener("focusout",this.#$),e.removeEventListener("pointerdown",this.#ge),e.removeEventListener("pointermove",this.#ve),e.removeEventListener("pointerup",this.#S),e.removeEventListener("pointercancel",this.#S),e.removeEventListener("click",this.#Te,!0),e.removeEventListener("contextmenu",this.#ye));}#W=e=>{e.pointerType!=="touch"&&(e.currentTarget===this.#t?this.#D=!0:this.#A=!0,this.#h=!1,this.#U(),this.#e||this.#V());};#J=e=>{if(e.pointerType==="touch"){this.#S(e);return;}U(e,e.currentTarget)||(e.currentTarget===this.#t?this.#D=!1:this.#A=!1,this.#B()||this.#j());};#N=e=>{const i=e.target?.matches(":focus-visible")===!0;this.#h||(this.#C(),this.#U(),!this.#e&&e.currentTarget===this.#t&&i&&this.#V());};#$=()=>{(this.#M()?.queueMicrotask??queueMicrotask)(()=>{this.#o||(this.#oe()||(this.#h=!1),this.#B()||this.#j());});};#be=e=>{const t=this.#i?.ownerDocument,i=t===void 0?void 0:y.get(t);e.key!=="Escape"||!this.#e||i!==void 0&&[...i].at(-1)!==this.#l||(e.preventDefault(),e.stopImmediatePropagation(),this.#l());};#l=()=>{this.#p(),this.#L(!1);};#me=e=>{const t=e.composedPath();!t.includes(this.#t)&&!t.includes(this.#i)&&this.#l();};#B(){return this.persistent||this.#D||this.#A||this.#a!==void 0||!this.#h&&this.#oe();}#oe(){return this.#t!==null&&A(this.#t)||this.#i!==null&&A(this.#i);}#ge=e=>{this.#d=!1,!(e.pointerType!=="touch"||!e.isPrimary||a(()=>this.props.disabled===!0))&&(this.#h=!0,this.#a=e.pointerId,this.#Q=e.clientX,this.#Z=e.clientY,this.#V(ee));};#ve=e=>{e.pointerId===this.#a&&Math.hypot(e.clientX-this.#Q,e.clientY-this.#Z)>te&&this.#S(e);};#S=e=>{e.pointerId===this.#a&&(this.#a=void 0,this.#G(),e.type==="pointerup"?this.#e&&this.#j():(this.#d=!1,this.#l()));};#Te=e=>{const t=this.#d;if(this.#d=!1,t&&(e.detail>0||e.pointerType==="touch")){e.preventDefault(),e.stopImmediatePropagation();return;}if(this.persistent&&!this.#e){this.#p(),this.#L(!0);return;}this.#l();};#ye=e=>{this.#d&&e.preventDefault();};#re(){const e=this.#i,t=e?.ownerDocument.defaultView??null;if(e!==null){if(!this.#e){this.#ke(),this.#Me(e);return;}if(!e.isConnected){queueMicrotask(()=>{this.#e&&e.isConnected&&this.#re();});return;}if(!e.matches(":popover-open"))try{e.showPopover();}catch{return;}if(this.#E===void 0&&t!==null){const i=y.get(t.document)??/* @__PURE__ */new Set();this.#E=t,i.add(this.#l),y.set(t.document,i),t.addEventListener("resize",this.#k),t.document.addEventListener("scroll",this.#k,!0),t.document.addEventListener("keydown",this.#be,!0),t.document.addEventListener("pointerdown",this.#me,!0),this.#w=new t.ResizeObserver(this.#k),this.#w.observe(e),this.#s!==null&&this.#w.observe(this.#s);}this.#ae();}}#ke(){const e=this.#E;e!==void 0&&(e.removeEventListener("resize",this.#k),e.document.removeEventListener("scroll",this.#k,!0),e.document.removeEventListener("keydown",this.#be,!0),e.document.removeEventListener("pointerdown",this.#me,!0),y.get(e.document)?.delete(this.#l),this.#u!==void 0&&e.cancelAnimationFrame(this.#u)),this.#u=void 0,this.#E=void 0,this.#A=!1,this.#w?.disconnect(),this.#w=void 0;}#Me(e){const t=++this.#I,i=()=>{if(!(t!==this.#I||this.#e)){e.classList.remove(R);try{e.matches(":popover-open")&&e.hidePopover();}catch{}}};this.#o?i():Y(e,i);}#k=()=>{const e=this.#E;this.#u!==void 0||e===void 0||(this.#u=e.requestAnimationFrame(()=>{this.#u=void 0,this.#ae();}));};#ae(){const e=this.#i,t=this.#s??this.#t,i=e?.ownerDocument.defaultView??null;if(!this.#e||e===null||t===null||i===null)return;const n=t.getBoundingClientRect(),s={height:e.offsetHeight,width:e.offsetWidth},d=i.getComputedStyle(e),r=e.classList.contains(w),c=r?D(d,"--cw-Feedback-tooltip-caretHeight"):0,l=ie+c,p=a(()=>this.props.placement)??"top",h=p==="top"||p==="bottom";let f,u,m;if(h){const v=n.top-s.height-l,b=n.bottom+l,P=b+s.height>i.innerHeight-g;f=p==="top"&&v<g?"bottom":p==="bottom"&&P?"top":p,u=n.left+(n.width-s.width)/2,m=f==="top"?v:b;}else{const v=i.getComputedStyle(t).direction==="rtl";let b=p==="end"!==v;u=b?n.right+l:n.left-s.width-l,(u<g||u+s.width>i.innerWidth-g)&&(b=!b,u=b?n.right+l:n.left-s.width-l),f=b?"right":"left",m=n.top+(n.height-s.height)/2;}if(u=C(u,g,i.innerWidth-s.width-g),m=C(m,g,i.innerHeight-s.height-g),e.dataset.placement=f,e.style.left=`${u}px`,e.style.top=`${m}px`,r){const v=D(d,"--cw-Feedback-tooltip-caretWidth")/2,b=h?n.left+n.width/2-u:n.top+n.height/2-m,P=h?s.width:s.height;e.style.setProperty("--_cw-Tooltip-caretOffset",`${C(b,v,P-v)}px`);}}#V(e){const t=this.#M(),i=e??I(a(()=>this.props.showDelay),Q);if(!(this.#o||a(()=>this.props.disabled===!0))){if(this.#G(),i===0||t===void 0){this.#L(!0);return;}this.#Ee(t,i),this.#g=t.setTimeout(()=>{const n=this.#we(t);if(this.#g=void 0,this.#M()!==t){this.#V(n);return;}this.#L(!0);},i);}}#j(e){const t=this.#M(),i=e??I(a(()=>this.props.hideDelay),Z);if(this.#G(),this.#U(),this.#y=!1,!(this.#o||!this.#e||this.#B())){if(i===0||t===void 0){this.#L(!1);return;}this.#Ee(t,i),this.#v=t.setTimeout(()=>{const n=this.#we(t);if(this.#v=void 0,this.#M()!==t){this.#j(n);return;}this.#B()||this.#L(!1);},i);}}#Ee(e,t){this.#T=e,this.#Y=e.performance.now(),this.#K=t;}#we(e){return Math.max(0,this.#K-(e.performance.now()-this.#Y));}#G(){this.#g!==void 0&&(this.#T?.clearTimeout(this.#g),this.#g=void 0);}#U(){this.#v!==void 0&&(this.#T?.clearTimeout(this.#v),this.#v=void 0);}#p(){this.#G(),this.#U(),this.#T=void 0;}#M(){return(this.#t?.ownerDocument??this.#i?.ownerDocument??this.styleElement?.ownerDocument)?.defaultView??void 0;}#Oe(){const e=this.#i;this.#o=!0,this.#e=!1,this.#re(),this.#p(),this.#m?.(),this.#m=void 0,this.#se(),this.#fe(this.#t),e!==null&&(e.removeEventListener("pointerenter",this.#W),e.removeEventListener("pointerleave",this.#J),e.removeEventListener("focusin",this.#N),e.removeEventListener("focusout",this.#$));}}function oe(o,e,t,i,n){const s=(r,c)=>r in i?L(i[r]):n?void 0:c,d={"aria-controls":s("aria-controls",t?o:void 0),"aria-describedby":s("aria-describedby",o),"aria-expanded":s("aria-expanded",t?`${e}`:void 0),"aria-haspopup":s("aria-haspopup",t?"dialog":void 0),tabIndex:n?void 0:0};for(const r of Object.keys(i))r.startsWith("aria-")&&!k(r)&&(d[r]=L(i[r]));return J(d,()=>e,()=>o);}function $(o,e,t,i,n){const s=e.disabled===!0,d=e.trigger,r=o,c=d===void 0&&!s&&!("tabindex"in r),l=(h,f)=>d!==void 0?void 0:h in r?L(r[h]):s?void 0:f,p={};for(const h of Object.keys(r))!["children","class","classList","ref","style"].includes(h)&&(d===void 0||!h.startsWith("aria-"))&&(p[h]=r[h]);return{attributes:{...p,"aria-controls":n?l("aria-controls",t):void 0,"aria-describedby":l("aria-describedby",t),"aria-expanded":n?l("aria-expanded",`${i}`):void 0,"aria-haspopup":n?l("aria-haspopup","dialog"):void 0,class:n?"cw-RichTooltip-trigger":"cw-PlainTooltip-trigger",tabIndex:c?0:void 0},content:()=>d===void 0?o.children:d(oe(t,i,n,r,s))};}function B(o){return<V when={S(o())}>
2
2
  <span class="cw-RichTooltip-action">{o()}</span>
3
- </V>}class re extends N{constructor(e){super(e,!1)}render(e,t){const i=<span class="cw-PlainTooltip">
3
+ </V>;}class re extends N{constructor(e){super(e,!1);}render(e,t){const i=<span class="cw-PlainTooltip">
4
4
  <span class="cw-PlainTooltip-trigger"/>
5
5
  <span aria-hidden="true"class="cw-PlainTooltip-popup"hidden popover="manual"role="tooltip"/>
6
- </span>,n=i.firstElementChild,s=i.lastElementChild;return T(n,this.renderTrigger(e)),T(s,()=>this.props.content),this.setPopup(s),t?.(n),i}}const ae=H(()=>(o,e)=>{const t=e.id??M(),i=e.open===!0&&e.disabled!==!0,n=$(o,e,t,i,!1);return<span class={o.class}classList={{...o.classList,"cw-PlainTooltip":!0,"cw-PlainTooltip-open":i}}style={o.style}>
6
+ </span>,n=i.firstElementChild,s=i.lastElementChild;return T(n,this.renderTrigger(e)),T(s,()=>this.props.content),this.setPopup(s),t?.(n),i;}}const ae=/* @__PURE__ */H(()=>(o,e)=>{const t=e.id??M(),i=e.open===!0&&e.disabled!==!0,n=$(o,e,t,i,!1);return<span class={o.class}classList={{...o.classList,"cw-PlainTooltip":!0,"cw-PlainTooltip-open":i}}style={o.style}>
7
7
  <span{...n.attributes}>{n.content()}</span>
8
8
  <span aria-hidden={i?void 0:"true"}class="cw-PlainTooltip-popup"classList={{[w]:e.caret===!0}}hidden={!i}id={t}popover="manual"role="tooltip">{e.content}</span>
9
- </span>},()=>re),Ee=o=>ae(_(o,["children","content"]));class de extends N{#n;constructor(e){super(e,!0),this.#n=null}get persistent(){return super.readProp("persistent",!0)[0]===!0}applyComponentProps(){super.readProp("persistent"),super.applyComponentProps()}applyPopupName(e){const t=super.readProps(["popupLabel","title"]),i=S(t.title),n=`${e.id}-title`;i?(e.setAttribute("aria-labelledby",n),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),e.setAttribute("aria-label",t.popupLabel??X)),this.#n!==null&&(this.#n.id=n,i?this.#n.removeAttribute("aria-hidden"):this.#n.setAttribute("aria-hidden","true"))}render(e,t){const i=<span class="cw-RichTooltip">
9
+ </span>;},()=>re),Ee=o=>ae(_(o,["children","content"]));class de extends N{#n;constructor(e){super(e,!0),this.#n=null;}get persistent(){return super.readProp("persistent",!0)[0]===!0;}applyComponentProps(){super.readProp("persistent"),super.applyComponentProps();}applyPopupName(e){const t=super.readProps(["popupLabel","title"]),i=S(t.title),n=`${e.id}-title`;i?(e.setAttribute("aria-labelledby",n),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),e.setAttribute("aria-label",t.popupLabel??X)),this.#n!==null&&(this.#n.id=n,i?this.#n.removeAttribute("aria-hidden"):this.#n.setAttribute("aria-hidden","true"));}render(e,t){const i=<span class="cw-RichTooltip">
10
10
  <span class="cw-RichTooltip-trigger"/>
11
11
  <span aria-hidden="true"class={`cw-RichTooltip-popup ${F}`}hidden popover="manual"role="dialog"tabindex="-1">
12
12
  <span class="cw-RichTooltip-title"/>
13
13
  <span class="cw-RichTooltip-supportingText"/>
14
14
  </span>
15
- </span>,n=i.firstElementChild,s=i.lastElementChild;return this.#n=s.firstElementChild,T(n,this.renderTrigger(e)),T(this.#n,()=>this.props.title),T(s.lastElementChild,()=>this.props.supportingText??this.props.content),T(s,B(()=>this.props.action),null),this.setPopup(s),t?.(n),i}}const le=H(()=>(o,e)=>{const t=e.id??M(),i=e.open===!0&&e.disabled!==!0,n=S(e.title),s=$(o,e,t,i,!0);return<span class={o.class}classList={{...o.classList,"cw-RichTooltip":!0,"cw-RichTooltip-open":i}}style={o.style}>
15
+ </span>,n=i.firstElementChild,s=i.lastElementChild;return this.#n=s.firstElementChild,T(n,this.renderTrigger(e)),T(this.#n,()=>this.props.title),T(s.lastElementChild,()=>this.props.supportingText??this.props.content),T(s,B(()=>this.props.action),null),this.setPopup(s),t?.(n),i;}}const le=/* @__PURE__ */H(()=>(o,e)=>{const t=e.id??M(),i=e.open===!0&&e.disabled!==!0,n=S(e.title),s=$(o,e,t,i,!0);return<span class={o.class}classList={{...o.classList,"cw-RichTooltip":!0,"cw-RichTooltip-open":i}}style={o.style}>
16
16
  <span{...s.attributes}>{s.content()}</span>
17
17
  <span aria-hidden={i?void 0:"true"}aria-label={n?void 0:e.popupLabel??X}aria-labelledby={n?`${t}-title`:void 0}class={`cw-RichTooltip-popup ${F}`}classList={{[w]:e.caret===!0}}hidden={!i}id={t}popover="manual"role="dialog"tabindex="-1">
18
18
  <span aria-hidden={n?void 0:"true"}class="cw-RichTooltip-title"id={`${t}-title`}>{e.title}</span>
@@ -21,4 +21,4 @@ import{Show as V,children as j,createSignal as x,createUniqueId as M,getListener
21
21
  </span>
22
22
  {B(()=>e.action)}
23
23
  </span>
24
- </span>},()=>de),we=o=>le(_(o,["action","children","content","supportingText","title"]));export{Ee as PlainTooltip,re as PlainTooltipController,we as RichTooltip,de as RichTooltipController,N as TooltipController};
24
+ </span>;},()=>de),we=o=>le(_(o,["action","children","content","supportingText","title"]));export{Ee as PlainTooltip,re as PlainTooltipController,we as RichTooltip,de as RichTooltipController,N as TooltipController};