@esri/calcite-components 5.1.0-next.52 → 5.1.0-next.53

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 (152) hide show
  1. package/dist/cdn/{IGWRKE4T.js → 2NNRJTQ3.js} +1 -1
  2. package/dist/cdn/{AQJ7OEUY.js → 2VFFQBRM.js} +1 -1
  3. package/dist/cdn/{OLZJ7MYZ.js → 374BVOQW.js} +1 -1
  4. package/dist/cdn/{QU433RO3.js → 3C3ZPDYP.js} +1 -1
  5. package/dist/cdn/{42WINDGY.js → 3R6YKVGT.js} +1 -1
  6. package/dist/cdn/{RQLTHDZV.js → 3VHKPO2P.js} +1 -1
  7. package/dist/cdn/{2I2RAVTX.js → 46NKKCSK.js} +1 -1
  8. package/dist/cdn/{HOR2KBM5.js → 52ZZNTUN.js} +1 -1
  9. package/dist/cdn/{7LDJP6HZ.js → 5GQVDBDB.js} +1 -1
  10. package/dist/cdn/{K5KGLZR3.js → 5NGMYY26.js} +1 -1
  11. package/dist/cdn/{GXU75OWY.js → 5SVZLVMH.js} +1 -1
  12. package/dist/cdn/{DUALO3AB.js → 6E2D3DUD.js} +1 -1
  13. package/dist/cdn/{XTDXJGII.js → 6G54JNZ3.js} +1 -1
  14. package/dist/cdn/{JXCA7WFB.js → 6MNWSHJ2.js} +1 -1
  15. package/dist/cdn/{HRJGO4SI.js → 6P7QJ4OD.js} +1 -1
  16. package/dist/cdn/{INU5CIUJ.js → 6VOREOHN.js} +1 -1
  17. package/dist/cdn/{ZU3QDTLN.js → 7ARUHJIG.js} +1 -1
  18. package/dist/cdn/{GGNGZB3P.js → 7HZB4NYI.js} +1 -1
  19. package/dist/cdn/{T6UKBG2V.js → 7NI5WUF3.js} +1 -1
  20. package/dist/cdn/{PCUJYOPJ.js → 7P64IPQZ.js} +1 -1
  21. package/dist/cdn/{OUTLU75A.js → 7U3I7VRF.js} +1 -1
  22. package/dist/cdn/{A3IMFQJ3.js → AOREK7XG.js} +1 -1
  23. package/dist/cdn/{PVLDZUQW.js → AQB4NRJ6.js} +1 -1
  24. package/dist/cdn/{UJX4WIGC.js → AX7IKIXB.js} +1 -1
  25. package/dist/cdn/{IYUKVFCK.js → B55L2WAB.js} +1 -1
  26. package/dist/cdn/{7GLQ3BIA.js → BE7EEFQ3.js} +1 -1
  27. package/dist/cdn/{HDCTPG3W.js → BJY3GM77.js} +1 -1
  28. package/dist/cdn/{FOCO4B2I.js → BMJZRWPQ.js} +1 -1
  29. package/dist/cdn/{F7YMQYQ7.js → BTJXCIJF.js} +1 -1
  30. package/dist/cdn/{WWVBR3H5.js → BUYT2OB4.js} +1 -1
  31. package/dist/cdn/{Z6NONZDA.js → CCDFL6R7.js} +1 -1
  32. package/dist/cdn/{Y7KV5WJH.js → CMDW563I.js} +1 -1
  33. package/dist/cdn/{DWZDD2J2.js → COIF2UAL.js} +1 -1
  34. package/dist/cdn/{XBQ4JC2O.js → CW5DSGCU.js} +1 -1
  35. package/dist/cdn/{FFTJXX3S.js → DBMOHP75.js} +1 -1
  36. package/dist/cdn/{GW6AQOGM.js → DT26BBAC.js} +1 -1
  37. package/dist/cdn/{4DXIVGBF.js → DZLM5KCC.js} +1 -1
  38. package/dist/cdn/{57674VTD.js → DZNJ47YX.js} +1 -1
  39. package/dist/cdn/{64SYBTWP.js → EJUBVZVG.js} +1 -1
  40. package/dist/cdn/{J7SMVIGE.js → ELGTRNFS.js} +1 -1
  41. package/dist/cdn/{JN66UG3X.js → EQPMYOET.js} +1 -1
  42. package/dist/cdn/{JTFWEILS.js → F4YFAW3E.js} +1 -1
  43. package/dist/cdn/{P3NFYL7S.js → FLS2RIBD.js} +1 -1
  44. package/dist/cdn/{MMV4JRFL.js → FMYXWCIG.js} +1 -1
  45. package/dist/cdn/{RN2XNPSP.js → G5ZTMQIQ.js} +1 -1
  46. package/dist/cdn/{RUXRS4F5.js → G7NS66JL.js} +1 -1
  47. package/dist/cdn/{57I6EGGZ.js → GBBBONE4.js} +1 -1
  48. package/dist/cdn/{2OIO35MZ.js → GM4IXLKU.js} +1 -1
  49. package/dist/cdn/{PE3RHM5F.js → GMFFXYYG.js} +1 -1
  50. package/dist/cdn/{YJF6FY53.js → GNOGZAA3.js} +1 -1
  51. package/dist/cdn/{44FM6IN7.js → H74DQJ5F.js} +1 -1
  52. package/dist/cdn/{57RSFB25.js → I4UCJQSK.js} +1 -1
  53. package/dist/cdn/{ETUQ2WX4.js → IQOUDTMQ.js} +1 -1
  54. package/dist/cdn/{F4CYA44H.js → IYDA2M2N.js} +1 -1
  55. package/dist/cdn/{NGYNBOEA.js → J47CBEIO.js} +1 -1
  56. package/dist/cdn/{NB557EPM.js → JGLBWEES.js} +1 -1
  57. package/dist/cdn/{VILMXJDE.js → JMR6BPUR.js} +1 -1
  58. package/dist/cdn/{KKDLOFLH.js → JZUVLVC3.js} +1 -1
  59. package/dist/cdn/{MNVVLPUD.js → K6LR7A3G.js} +1 -1
  60. package/dist/cdn/{LZO5WQFT.js → KEGLBRYW.js} +1 -1
  61. package/dist/cdn/{KC5YLSJL.js → KIVCCNSA.js} +1 -1
  62. package/dist/cdn/{3L56MF4R.js → KMRVKC2B.js} +1 -1
  63. package/dist/cdn/{TZXSLIRP.js → L7VRUUJ5.js} +1 -1
  64. package/dist/cdn/{I5TF2Y4L.js → L7WEEHWA.js} +1 -1
  65. package/dist/cdn/{6EJKMTAK.js → LQ2L5WDO.js} +1 -1
  66. package/dist/cdn/{CLF453MS.js → LU3AN5PO.js} +1 -1
  67. package/dist/cdn/{SELNEZH2.js → MB3SHKVV.js} +1 -1
  68. package/dist/cdn/{XGLRJ7V7.js → MKHCIJUO.js} +1 -1
  69. package/dist/cdn/{B3O2WK4H.js → MMXNR5RX.js} +1 -1
  70. package/dist/cdn/{TGUDLWN4.js → MOK6MFBM.js} +1 -1
  71. package/dist/cdn/{KEB3VFAO.js → N73KWKN3.js} +1 -1
  72. package/dist/cdn/{2S7NPLRD.js → NGYBT3KZ.js} +1 -1
  73. package/dist/cdn/{YRJCKJRZ.js → NUSST644.js} +1 -1
  74. package/dist/cdn/{SNIJFAXF.js → NUW2SVAZ.js} +1 -1
  75. package/dist/cdn/{4ARSDOF2.js → NXNHPGTQ.js} +1 -1
  76. package/dist/cdn/{R4MIPDZD.js → OGYP4PT3.js} +1 -1
  77. package/dist/cdn/{VE7RW5OY.js → OH2HEEFB.js} +1 -1
  78. package/dist/cdn/{NF7KYVPE.js → OKMZYNYT.js} +1 -1
  79. package/dist/cdn/{7LPIGOLI.js → OMJD4F3K.js} +1 -1
  80. package/dist/cdn/{273Z4GGH.js → OSG4TJAG.js} +1 -1
  81. package/dist/cdn/{QJQN3MBL.js → OUOS6BJZ.js} +1 -1
  82. package/dist/cdn/{XCI7IP4U.js → OZRCBV7E.js} +1 -1
  83. package/dist/cdn/{G57Q5KHZ.js → P2WOGWXH.js} +1 -1
  84. package/dist/cdn/{WAFYQ7C3.js → P56VBKLA.js} +1 -1
  85. package/dist/cdn/{ZWMLY4HG.js → P6DAEHHY.js} +1 -1
  86. package/dist/cdn/{A673JVSA.js → PAIESPRF.js} +1 -1
  87. package/dist/cdn/{UDGWSLPU.js → PF62P6EA.js} +1 -1
  88. package/dist/cdn/{V33ZP7DY.js → PFZ2Y2IO.js} +1 -1
  89. package/dist/cdn/{FJFVUT3R.js → PJIRZ5JN.js} +1 -1
  90. package/dist/cdn/{OOEPPBXM.js → PV4NC3RW.js} +1 -1
  91. package/dist/cdn/{XCUGUD4Q.js → QJ6JEAFQ.js} +1 -1
  92. package/dist/cdn/{ALIXXROM.js → QNF3JMOQ.js} +1 -1
  93. package/dist/cdn/{OTICUWBZ.js → R67UKCVU.js} +1 -1
  94. package/dist/cdn/{ZWPGE7UW.js → R6UGDU2R.js} +1 -1
  95. package/dist/cdn/{URUJPX6O.js → RQP3QJZI.js} +1 -1
  96. package/dist/cdn/{RINPUL5L.js → RVDBHDXS.js} +1 -1
  97. package/dist/cdn/{EVSDMBGN.js → RYI46JK6.js} +1 -1
  98. package/dist/cdn/{ZIWS2E5B.js → S4O5SCPG.js} +1 -1
  99. package/dist/cdn/{F4HZEVHH.js → S5CHO4U4.js} +1 -1
  100. package/dist/cdn/{TD4WAJAP.js → SEOCJRMP.js} +1 -1
  101. package/dist/cdn/{23WUMAS4.js → SH5OX57L.js} +1 -1
  102. package/dist/cdn/{DAZN5DI4.js → SHNVFDYZ.js} +1 -1
  103. package/dist/cdn/{O6U273J2.js → SJ2QKTB2.js} +1 -1
  104. package/dist/cdn/{OBFZWREG.js → SKNYDJDG.js} +1 -1
  105. package/dist/cdn/{ZMQPZ4SM.js → SZKYMSWE.js} +1 -1
  106. package/dist/cdn/{VMXPCKPN.js → T3SBFTTU.js} +1 -1
  107. package/dist/cdn/{7FBHPUO5.js → TG3SE24X.js} +1 -1
  108. package/dist/cdn/{76MHN7V2.js → TG44VRS3.js} +1 -1
  109. package/dist/cdn/{7AWWLHJ6.js → TGFI5Y54.js} +1 -1
  110. package/dist/cdn/{QFBASS3W.js → TMF6RUSK.js} +1 -1
  111. package/dist/cdn/{WZQMZY5I.js → TOJO3DZJ.js} +1 -1
  112. package/dist/cdn/{3CP56APJ.js → TQSBMZUH.js} +1 -1
  113. package/dist/cdn/{BAL4PDWM.js → UPMXPJRW.js} +1 -1
  114. package/dist/cdn/{YGYL4XMJ.js → UWICRJQO.js} +1 -1
  115. package/dist/cdn/{OQQJRXFJ.js → UYLTPVFT.js} +1 -1
  116. package/dist/cdn/{L2BTO77P.js → VFFODXE5.js} +1 -1
  117. package/dist/cdn/{3LCUAV2J.js → VGIY62WD.js} +1 -1
  118. package/dist/cdn/{5S6OP6HT.js → VKN6JJHH.js} +1 -1
  119. package/dist/cdn/{THN4PT7B.js → VXD77BNL.js} +1 -1
  120. package/dist/cdn/{ULBKKOQK.js → W4U75XMI.js} +1 -1
  121. package/dist/cdn/{5IKT4REZ.js → WG4Y2YXD.js} +1 -1
  122. package/dist/cdn/{AAZ63DDH.js → WU2FYJPY.js} +1 -1
  123. package/dist/cdn/{NXB3FRVS.js → X2VMJBUA.js} +1 -1
  124. package/dist/cdn/X3KQ4SRN.js +4 -0
  125. package/dist/cdn/{GA4ZVTQS.js → X3X7MERT.js} +1 -1
  126. package/dist/cdn/{UI6SYU7R.js → X4R2U7OM.js} +1 -1
  127. package/dist/cdn/{VKAQZHF4.js → XBBOJCAG.js} +1 -1
  128. package/dist/cdn/{WJF6EPCD.js → XD3JL5DR.js} +1 -1
  129. package/dist/cdn/{2RES3CEJ.js → XNHSUYWZ.js} +1 -1
  130. package/dist/cdn/{FZFYK4YW.js → XVE4JN3H.js} +1 -1
  131. package/dist/cdn/{76CDECCH.js → XW3IP2CH.js} +1 -1
  132. package/dist/cdn/{NL5P6QIL.js → Y5EX4HUW.js} +1 -1
  133. package/dist/cdn/{ZNQYJ3F6.js → YBTRE55X.js} +1 -1
  134. package/dist/cdn/{ZGQKLZNW.js → YGSUEQMS.js} +1 -1
  135. package/dist/cdn/{CIVFTKSR.js → YONIKQC3.js} +1 -1
  136. package/dist/cdn/{SS32IDBY.js → YRBYKWDO.js} +1 -1
  137. package/dist/cdn/{6MCCH36T.js → YZ6XKB4F.js} +1 -1
  138. package/dist/cdn/{DSEQOKDE.js → YZIPHHRW.js} +1 -1
  139. package/dist/cdn/{WSQ4PXI6.js → Z7XEAFTW.js} +1 -1
  140. package/dist/cdn/{VPRGNGZX.js → ZELB53ZU.js} +1 -1
  141. package/dist/cdn/{6ZF5OGYU.js → ZER7OLYY.js} +1 -1
  142. package/dist/cdn/{4OMECTGO.js → ZFSMJ5LH.js} +1 -1
  143. package/dist/cdn/{O74CSENQ.js → ZO3LKLON.js} +1 -1
  144. package/dist/cdn/index.js +1 -1
  145. package/dist/chunks/runtime.js +4 -4
  146. package/dist/components/calcite-combobox/customElement.js +1 -1
  147. package/dist/components/calcite-dialog/customElement.js +1 -1
  148. package/dist/docs/api.json +1 -1
  149. package/dist/docs/docs.json +1 -1
  150. package/dist/docs/web-types.json +1 -1
  151. package/package.json +3 -3
  152. package/dist/cdn/JAF6FNAT.js +0 -4
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as Dt}from"./AP2LDRUV.js";import{N as Lt}from"./KC5YLSJL.js";var vt=["top","right","bottom","left"],Mt=["start","end"],bt=vt.reduce((t,e)=>t.concat(e,e+"-"+Mt[0],e+"-"+Mt[1]),[]),j=Math.min,V=Math.max,rt=Math.round,ct=Math.floor,F=t=>({x:t,y:t}),Re={left:"right",right:"left",bottom:"top",top:"bottom"};function ut(t,e,n){return V(t,j(e,n))}function X(t,e){return typeof t=="function"?t(e):t}function B(t){return t.split("-")[0]}function N(t){return t.split("-")[1]}function At(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}function z(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function mt(t){return At(z(t))}function Ot(t,e,n){n===void 0&&(n=!1);let o=N(t),i=mt(t),r=dt(i),s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=st(s)),[s,st(s)]}function kt(t){let e=st(t);return[it(t),e,it(e)]}function it(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var Ft=["left","right"],Nt=["right","left"],Se=["top","bottom"],Pe=["bottom","top"];function Ce(t,e,n){switch(t){case"top":case"bottom":return n?e?Nt:Ft:e?Ft:Nt;case"left":case"right":return e?Se:Pe;default:return[]}}function Bt(t,e,n,o){let i=N(t),r=Ce(B(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(it)))),r}function st(t){let e=B(t);return Re[e]+t.slice(e.length)}function Ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Rt(t){return typeof t!="number"?Ee(t):{top:t,right:t,bottom:t,left:t}}function K(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Wt(t,e,n){let{reference:o,floating:i}=t,r=z(e),s=mt(e),c=dt(s),l=B(e),f=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2,a;switch(l){case"top":a={x:d,y:o.y-i.height};break;case"bottom":a={x:d,y:o.y+o.height};break;case"right":a={x:o.x+o.width,y:u};break;case"left":a={x:o.x-i.width,y:u};break;default:a={x:o.x,y:o.y}}switch(N(e)){case"start":a[s]-=m*(n&&f?-1:1);break;case"end":a[s]+=m*(n&&f?-1:1);break}return a}async function _t(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:s,elements:c,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:a=0}=X(e,t),g=Rt(a),w=c[m?u==="floating"?"reference":"floating":u],h=K(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(w)))==null||n?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:d,strategy:l})),x=u==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,y=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),v=await(r.isElement==null?void 0:r.isElement(y))?await(r.getScale==null?void 0:r.getScale(y))||{x:1,y:1}:{x:1,y:1},b=K(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:y,strategy:l}):x);return{top:(h.top-b.top+g.top)/v.y,bottom:(b.bottom-h.bottom+g.bottom)/v.y,left:(h.left-b.left+g.left)/v.x,right:(b.right-h.right+g.right)/v.x}}var Te=50,Vt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:_t},l=await(s.isRTL==null?void 0:s.isRTL(e)),f=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=Wt(f,o,l),m=o,a=0,g={};for(let p=0;p<r.length;p++){let w=r[p];if(!w)continue;let{name:h,fn:x}=w,{x:y,y:v,data:b,reset:A}=await x({x:d,y:u,initialPlacement:o,placement:m,strategy:i,middlewareData:g,rects:f,platform:c,elements:{reference:t,floating:e}});d=y??d,u=v??u,g[h]={...g[h],...b},A&&a<Te&&(a++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(f=A.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):A.rects),{x:d,y:u}=Wt(f,m,l)),p=-1)}return{x:d,y:u,placement:m,strategy:i,middlewareData:g}},zt=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:l}=e,{element:f,padding:d=0}=X(t,e)||{};if(f==null)return{};let u=Rt(d),m={x:n,y:o},a=mt(i),g=dt(a),p=await s.getDimensions(f),w=a==="y",h=w?"top":"left",x=w?"bottom":"right",y=w?"clientHeight":"clientWidth",v=r.reference[g]+r.reference[a]-m[a]-r.floating[g],b=m[a]-r.reference[a],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f)),R=A?A[y]:0;(!R||!await(s.isElement==null?void 0:s.isElement(A)))&&(R=c.floating[y]||r.floating[g]);let $=v/2-b/2,C=R/2-p[g]/2-1,O=j(u[h],C),L=j(u[x],C),H=O,Y=R-p[g]-L,S=R/2-p[g]/2+$,q=ut(H,S,Y),_=!l.arrow&&N(i)!=null&&S!==q&&r.reference[g]/2-(S<H?O:L)-p[g]/2<0,D=_?S<H?S-H:S-Y:0;return{[a]:m[a]+D,data:{[a]:q,centerOffset:S-q-D,..._&&{alignmentOffset:D}},reset:_}}});function Le(t,e,n){return(t?[...n.filter(i=>N(i)===t),...n.filter(i=>N(i)!==t)]:n.filter(i=>B(i)===i)).filter(i=>t?N(i)===t||(e?it(i)!==i:!1):!0)}var Ut=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;let{rects:r,middlewareData:s,placement:c,platform:l,elements:f}=e,{crossAxis:d=!1,alignment:u,allowedPlacements:m=bt,autoAlignment:a=!0,...g}=X(t,e),p=u!==void 0||m===bt?Le(u||null,a,m):m,w=await l.detectOverflow(e,g),h=((n=s.autoPlacement)==null?void 0:n.index)||0,x=p[h];if(x==null)return{};let y=Ot(x,r,await(l.isRTL==null?void 0:l.isRTL(f.floating)));if(c!==x)return{reset:{placement:p[0]}};let v=[w[B(x)],w[y[0]],w[y[1]]],b=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:x,overflows:v}],A=p[h+1];if(A)return{data:{index:h+1,overflows:b},reset:{placement:A}};let R=b.map(O=>{let L=N(O.placement);return[O.placement,L&&d?O.overflows.slice(0,2).reduce((H,Y)=>H+Y,0):O.overflows[0],O.overflows]}).sort((O,L)=>O[1]-L[1]),C=((i=R.filter(O=>O[2].slice(0,N(O[0])?2:3).every(L=>L<=0))[0])==null?void 0:i[0])||R[0][0];return C!==c?{data:{index:h+1,overflows:b},reset:{placement:C}}:{}}}},It=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:l,elements:f}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:a="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...w}=X(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};let h=B(i),x=z(c),y=B(c)===c,v=await(l.isRTL==null?void 0:l.isRTL(f.floating)),b=m||(y||!p?[st(c)]:kt(c)),A=g!=="none";!m&&A&&b.push(...Bt(c,p,g,v));let R=[c,...b],$=await l.detectOverflow(e,w),C=[],O=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&C.push($[h]),u){let S=Ot(i,s,v);C.push($[S[0]],$[S[1]])}if(O=[...O,{placement:i,overflows:C}],!C.every(S=>S<=0)){var L,H;let S=(((L=r.flip)==null?void 0:L.index)||0)+1,q=R[S];if(q&&(!(u==="alignment"?x!==z(q):!1)||O.every(M=>z(M.placement)===x?M.overflows[0]>0:!0)))return{data:{index:S,overflows:O},reset:{placement:q}};let _=(H=O.filter(D=>D.overflows[0]<=0).sort((D,M)=>D.overflows[1]-M.overflows[1])[0])==null?void 0:H.placement;if(!_)switch(a){case"bestFit":{var Y;let D=(Y=O.filter(M=>{if(A){let I=z(M.placement);return I===x||I==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(I=>I>0).reduce((I,Oe)=>I+Oe,0)]).sort((M,I)=>M[1]-I[1])[0])==null?void 0:Y[0];D&&(_=D);break}case"initialPlacement":_=c;break}if(i!==_)return{reset:{placement:_}}}return{}}}};function $t(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ht(t){return vt.some(e=>t[e]>=0)}var jt=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:o}=e,{strategy:i="referenceHidden",...r}=X(t,e);switch(i){case"referenceHidden":{let s=await o.detectOverflow(e,{...r,elementContext:"reference"}),c=$t(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ht(c)}}}case"escaped":{let s=await o.detectOverflow(e,{...r,altBoundary:!0}),c=$t(s,n.floating);return{data:{escapedOffsets:c,escaped:Ht(c)}}}default:return{}}}}};var De=new Set(["left","top"]);async function Me(t,e){let{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=B(n),c=N(n),l=z(n)==="y",f=De.has(s)?-1:1,d=r&&l?-1:1,u=X(e,t),{mainAxis:m,crossAxis:a,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof g=="number"&&(a=c==="end"?g*-1:g),l?{x:a*d,y:m*f}:{x:m*f,y:a*d}}var Xt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:i,y:r,placement:s,middlewareData:c}=e,l=await Me(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Yt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:h=>{let{x,y}=h;return{x,y}}},...f}=X(t,e),d={x:n,y:o},u=await r.detectOverflow(e,f),m=z(B(i)),a=At(m),g=d[a],p=d[m];if(s){let h=a==="y"?"top":"left",x=a==="y"?"bottom":"right",y=g+u[h],v=g-u[x];g=ut(y,g,v)}if(c){let h=m==="y"?"top":"left",x=m==="y"?"bottom":"right",y=p+u[h],v=p-u[x];p=ut(y,p,v)}let w=l.fn({...e,[a]:g,[m]:p});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[a]:s,[m]:c}}}}}};function gt(){return typeof window<"u"}function J(t){return Kt(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function k(t){var e;return(e=(Kt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Kt(t){return gt()?t instanceof Node||t instanceof P(t).Node:!1}function E(t){return gt()?t instanceof Element||t instanceof P(t).Element:!1}function W(t){return gt()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function qt(t){return!gt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}function et(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=T(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function Gt(t){return/^(table|td|th)$/.test(J(t))}function lt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Fe=/transform|translate|scale|rotate|perspective|filter/,Ne=/paint|layout|strict|content/,G=t=>!!t&&t!=="none",St;function nt(t){let e=E(t)?T(t):t;return G(e.transform)||G(e.translate)||G(e.scale)||G(e.rotate)||G(e.perspective)||!ht()&&(G(e.backdropFilter)||G(e.filter))||Fe.test(e.willChange||"")||Ne.test(e.contain||"")}function Jt(t){let e=U(t);for(;W(e)&&!Q(e);){if(nt(e))return e;if(lt(e))return null;e=U(e)}return null}function ht(){return St==null&&(St=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),St}function Q(t){return/^(html|body|#document)$/.test(J(t))}function T(t){return P(t).getComputedStyle(t)}function at(t){return E(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function U(t){if(J(t)==="html")return t;let e=t.assignedSlot||t.parentNode||qt(t)&&t.host||k(t);return qt(e)?e.host:e}function Qt(t){let e=U(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&et(e)?e:Qt(e)}function tt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Qt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=P(i);if(r){let c=pt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],c&&n?tt(c):[])}else return e.concat(i,tt(i,[],n))}function pt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ne(t){let e=T(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=W(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=rt(n)!==r||rt(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Ct(t){return E(t)?t:t.contextElement}function ot(t){let e=Ct(t);if(!W(e))return F(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=ne(e),s=(r?rt(n.width):n.width)/o,c=(r?rt(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var ke=F(0);function oe(t){let e=P(t);return!ht()||!e.visualViewport?ke:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Be(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function Z(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=Ct(t),s=F(1);e&&(o?E(o)&&(s=ot(o)):s=ot(t));let c=Be(r,n,o)?oe(r):F(0),l=(i.left+c.x)/s.x,f=(i.top+c.y)/s.y,d=i.width/s.x,u=i.height/s.y;if(r){let m=P(r),a=o&&E(o)?P(o):o,g=m,p=pt(g);for(;p&&o&&a!==g;){let w=ot(p),h=p.getBoundingClientRect(),x=T(p),y=h.left+(p.clientLeft+parseFloat(x.paddingLeft))*w.x,v=h.top+(p.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,f*=w.y,d*=w.x,u*=w.y,l+=y,f+=v,g=P(p),p=pt(g)}}return K({width:d,height:u,x:l,y:f})}function wt(t,e){let n=at(t).scrollLeft;return e?e.left+n:Z(k(t)).left+n}function ie(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-wt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function We(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",s=k(o),c=e?lt(e.floating):!1;if(o===s||c&&r)return n;let l={scrollLeft:0,scrollTop:0},f=F(1),d=F(0),u=W(o);if((u||!u&&!r)&&((J(o)!=="body"||et(s))&&(l=at(o)),u)){let a=Z(o);f=ot(o),d.x=a.x+o.clientLeft,d.y=a.y+o.clientTop}let m=s&&!u&&!r?ie(s,l):F(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+d.x+m.x,y:n.y*f.y-l.scrollTop*f.y+d.y+m.y}}function $e(t){return Array.from(t.getClientRects())}function He(t){let e=k(t),n=at(t),o=t.ownerDocument.body,i=V(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=V(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+wt(t),c=-n.scrollTop;return T(o).direction==="rtl"&&(s+=V(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}var Zt=25;function _e(t,e){let n=P(t),o=k(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,c=0,l=0;if(i){r=i.width,s=i.height;let d=ht();(!d||d&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}let f=wt(o);if(f<=0){let d=o.ownerDocument,u=d.body,m=getComputedStyle(u),a=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(o.clientWidth-u.clientWidth-a);g<=Zt&&(r-=g)}else f<=Zt&&(r+=f);return{width:r,height:s,x:c,y:l}}function Ve(t,e){let n=Z(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=W(t)?ot(t):F(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=i*r.x,f=o*r.y;return{width:s,height:c,x:l,y:f}}function te(t,e,n){let o;if(e==="viewport")o=_e(t,n);else if(e==="document")o=He(k(t));else if(E(e))o=Ve(e,n);else{let i=oe(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return K(o)}function se(t,e){let n=U(t);return n===e||!E(n)||Q(n)?!1:T(n).position==="fixed"||se(n,e)}function ze(t,e){let n=e.get(t);if(n)return n;let o=tt(t,[],!1).filter(c=>E(c)&&J(c)!=="body"),i=null,r=T(t).position==="fixed",s=r?U(t):t;for(;E(s)&&!Q(s);){let c=T(s),l=nt(s);!l&&c.position==="fixed"&&(i=null),(r?!l&&!i:!l&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||et(s)&&!l&&se(t,s))?o=o.filter(d=>d!==s):i=c,s=U(s)}return e.set(t,o),o}function Ue(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,s=[...n==="clippingAncestors"?lt(e)?[]:ze(e,this._c):[].concat(n),o],c=te(e,s[0],i),l=c.top,f=c.right,d=c.bottom,u=c.left;for(let m=1;m<s.length;m++){let a=te(e,s[m],i);l=V(a.top,l),f=j(a.right,f),d=j(a.bottom,d),u=V(a.left,u)}return{width:f-u,height:d-l,x:u,y:l}}function Ie(t){let{width:e,height:n}=ne(t);return{width:e,height:n}}function je(t,e,n){let o=W(e),i=k(e),r=n==="fixed",s=Z(t,!0,r,e),c={scrollLeft:0,scrollTop:0},l=F(0);function f(){l.x=wt(i)}if(o||!o&&!r)if((J(e)!=="body"||et(i))&&(c=at(e)),o){let a=Z(e,!0,r,e);l.x=a.x+e.clientLeft,l.y=a.y+e.clientTop}else i&&f();r&&!o&&i&&f();let d=i&&!o&&!r?ie(i,c):F(0),u=s.left+c.scrollLeft-l.x-d.x,m=s.top+c.scrollTop-l.y-d.y;return{x:u,y:m,width:s.width,height:s.height}}function Pt(t){return T(t).position==="static"}function ee(t,e){if(!W(t)||T(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return k(t)===n&&(n=n.ownerDocument.body),n}function re(t,e){let n=P(t);if(lt(t))return n;if(!W(t)){let i=U(t);for(;i&&!Q(i);){if(E(i)&&!Pt(i))return i;i=U(i)}return n}let o=ee(t,e);for(;o&&Gt(o)&&Pt(o);)o=ee(o,e);return o&&Q(o)&&Pt(o)&&!nt(o)?n:o||Jt(t)||n}var Xe=async function(t){let e=this.getOffsetParent||re,n=this.getDimensions,o=await n(t.floating);return{reference:je(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ye(t){return T(t).direction==="rtl"}var xt={convertOffsetParentRelativeRectToViewportRelativeRect:We,getDocumentElement:k,getClippingRect:Ue,getOffsetParent:re,getElementRects:Xe,getClientRects:$e,getDimensions:Ie,getScale:ot,isElement:E,isRTL:Ye};function ce(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qe(t,e){let n=null,o,i=k(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),r();let f=t.getBoundingClientRect(),{left:d,top:u,width:m,height:a}=f;if(c||e(),!m||!a)return;let g=ct(u),p=ct(i.clientWidth-(d+m)),w=ct(i.clientHeight-(u+a)),h=ct(d),y={rootMargin:-g+"px "+-p+"px "+-w+"px "+-h+"px",threshold:V(0,j(1,l))||1},v=!0;function b(A){let R=A[0].intersectionRatio;if(R!==l){if(!v)return s();R?s(!1,R):o=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!ce(f,t.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(b,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,y)}n.observe(t)}return s(!0),r}function le(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=Ct(t),d=i||r?[...f?tt(f):[],...e?tt(e):[]]:[];d.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),r&&h.addEventListener("resize",n)});let u=f&&c?qe(f,n):null,m=-1,a=null;s&&(a=new ResizeObserver(h=>{let[x]=h;x&&x.target===f&&a&&e&&(a.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=a)==null||y.observe(e)})),n()}),f&&!l&&a.observe(f),e&&a.observe(e));let g,p=l?Z(t):null;l&&w();function w(){let h=Z(t);p&&!ce(p,h)&&n(),p=h,g=requestAnimationFrame(w)}return n(),()=>{var h;d.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),u?.(),(h=a)==null||h.disconnect(),a=null,l&&cancelAnimationFrame(g)}}var ae=Xt,fe=Ut,ue=Yt,Et=It;var de=jt,me=zt;var ge=(t,e,n)=>{let o=new Map,i={platform:xt,...n},r={...i.platform,_c:o};return Vt(t,e,{...i,platform:r})};function he(t){return Ke(t)}function Tt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Ke(t){for(let e=t;e;e=Tt(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=Tt(t);e;e=Tt(e)){if(!(e instanceof Element))continue;let n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||nt(n)||e.tagName==="BODY"))return e}return null}(function(){if(!!1){let e=xt.getOffsetParent;xt.getOffsetParent=n=>e(n,he)}})();function pe(t){let e=window.devicePixelRatio||1;return Math.round(t*e)/e}var ve=(async(t,{arrowEl:e,direction:n,flipDisabled:o,flipPlacements:i,floatingEl:r,offsetDistance:s,offsetSkidding:c,overlayPositioning:l="absolute",placement:f,referenceEl:d,type:u})=>{if(!d||!r)return;let m=n==="rtl",{x:a,y:g,placement:p,strategy:w,middlewareData:h}=await ge(d,r,{strategy:l,placement:f==="auto"||f==="auto-start"||f==="auto-end"?void 0:we(f,m),middleware:Je({placement:f,flipDisabled:o,flipPlacements:i?.map(b=>we(b,m)),offsetDistance:s,offsetSkidding:c,arrowEl:e,type:u})});if(e&&h.arrow){let{x:b,y:A}=h.arrow,R=p.split("-")[0],$=b!=null?"left":"top",C=tn[R],O={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=R==="left"||R==="right"?"horizontal":"vertical"),Object.assign(e.style,{...O,[$]:`${$=="left"?b:A}px`,[R]:"100%",transform:C})}let y=h.hide?.referenceHidden?"hidden":null,v=y?"none":null;r.setAttribute(Ge,p),Object.assign(r.style,{pointerEvents:v,position:w,transform:`translate(${pe(a)}px,${pe(g)}px)`,visibility:y})}),Ge="data-placement",be=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],On="bottom-start",Rn="bottom-end",Sn={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function Je({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:r,type:s}){let c=[ue(),de()];return s==="menu"&&c.push(Et({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})),c.push(ae({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})),t==="auto"||t==="auto-start"||t==="auto-end"?c.push(fe({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(Et(n?{fallbackPlacements:n}:{})),r&&c.push(me({element:r})),c}function Qe(t){return be.includes(t)}function Pn(t,e){let n=t.filter(Qe);return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${be.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function we(t,e=!1){let n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function Cn(t,e,n=!1){if(!t.open||!e.floatingEl||!e.referenceEl)return;if(Object.assign(e.floatingEl.style,{display:"block",inset:"unset",left:"0",position:e.overlayPositioning??"absolute",top:"0"}),!ft.get(t))return Ae(t);await(n?Ze(t):ve)(t,e)}function Ze(t){let e=yt.get(t);return e||(e=Dt(ve,Lt.reposition,{edges:["leading","trailing"]}),yt.set(t,e),e)}var tn={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},ft=new WeakMap,yt=new WeakMap;async function Ae(t){let{referenceEl:e,floatingEl:n}=t;if(!n.isConnected)return;let o=le;ft.set(t,{state:"pending"});let i,r=o(e,n,()=>{let s=t.reposition();i||(i=s)});return ft.set(t,{state:"active",cleanUp:r}),i}function en(t){let{floatingEl:e}=t;e&&Object.assign(e.style,{display:"",left:"",pointerEvents:"",position:"",top:"",transform:"",visibility:""})}async function En(t){let{floatingEl:e,referenceEl:n}=t;if(en(t),nn(t),!(!e||!n||!t.open))return Ae(t)}function nn(t){let e=ft.get(t);e?.state==="active"&&e.cleanUp(),ft.delete(t),yt.get(t)?.cancel(),yt.delete(t)}var xe=4,Tn=Math.ceil(Math.hypot(xe,xe));export{On as a,Rn as b,Sn as c,Pn as d,Cn as e,en as f,En as g,nn as h,Tn as i};
2
+ import{a as Dt}from"./AP2LDRUV.js";import{N as Lt}from"./KIVCCNSA.js";var vt=["top","right","bottom","left"],Mt=["start","end"],bt=vt.reduce((t,e)=>t.concat(e,e+"-"+Mt[0],e+"-"+Mt[1]),[]),j=Math.min,V=Math.max,rt=Math.round,ct=Math.floor,F=t=>({x:t,y:t}),Re={left:"right",right:"left",bottom:"top",top:"bottom"};function ut(t,e,n){return V(t,j(e,n))}function X(t,e){return typeof t=="function"?t(e):t}function B(t){return t.split("-")[0]}function N(t){return t.split("-")[1]}function At(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}function z(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function mt(t){return At(z(t))}function Ot(t,e,n){n===void 0&&(n=!1);let o=N(t),i=mt(t),r=dt(i),s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=st(s)),[s,st(s)]}function kt(t){let e=st(t);return[it(t),e,it(e)]}function it(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var Ft=["left","right"],Nt=["right","left"],Se=["top","bottom"],Pe=["bottom","top"];function Ce(t,e,n){switch(t){case"top":case"bottom":return n?e?Nt:Ft:e?Ft:Nt;case"left":case"right":return e?Se:Pe;default:return[]}}function Bt(t,e,n,o){let i=N(t),r=Ce(B(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(it)))),r}function st(t){let e=B(t);return Re[e]+t.slice(e.length)}function Ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Rt(t){return typeof t!="number"?Ee(t):{top:t,right:t,bottom:t,left:t}}function K(t){let{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Wt(t,e,n){let{reference:o,floating:i}=t,r=z(e),s=mt(e),c=dt(s),l=B(e),f=r==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2,a;switch(l){case"top":a={x:d,y:o.y-i.height};break;case"bottom":a={x:d,y:o.y+o.height};break;case"right":a={x:o.x+o.width,y:u};break;case"left":a={x:o.x-i.width,y:u};break;default:a={x:o.x,y:o.y}}switch(N(e)){case"start":a[s]-=m*(n&&f?-1:1);break;case"end":a[s]+=m*(n&&f?-1:1);break}return a}async function _t(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:s,elements:c,strategy:l}=t,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:a=0}=X(e,t),g=Rt(a),w=c[m?u==="floating"?"reference":"floating":u],h=K(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(w)))==null||n?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:f,rootBoundary:d,strategy:l})),x=u==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,y=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),v=await(r.isElement==null?void 0:r.isElement(y))?await(r.getScale==null?void 0:r.getScale(y))||{x:1,y:1}:{x:1,y:1},b=K(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:y,strategy:l}):x);return{top:(h.top-b.top+g.top)/v.y,bottom:(b.bottom-h.bottom+g.bottom)/v.y,left:(h.left-b.left+g.left)/v.x,right:(b.right-h.right+g.right)/v.x}}var Te=50,Vt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:_t},l=await(s.isRTL==null?void 0:s.isRTL(e)),f=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=Wt(f,o,l),m=o,a=0,g={};for(let p=0;p<r.length;p++){let w=r[p];if(!w)continue;let{name:h,fn:x}=w,{x:y,y:v,data:b,reset:A}=await x({x:d,y:u,initialPlacement:o,placement:m,strategy:i,middlewareData:g,rects:f,platform:c,elements:{reference:t,floating:e}});d=y??d,u=v??u,g[h]={...g[h],...b},A&&a<Te&&(a++,typeof A=="object"&&(A.placement&&(m=A.placement),A.rects&&(f=A.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):A.rects),{x:d,y:u}=Wt(f,m,l)),p=-1)}return{x:d,y:u,placement:m,strategy:i,middlewareData:g}},zt=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:l}=e,{element:f,padding:d=0}=X(t,e)||{};if(f==null)return{};let u=Rt(d),m={x:n,y:o},a=mt(i),g=dt(a),p=await s.getDimensions(f),w=a==="y",h=w?"top":"left",x=w?"bottom":"right",y=w?"clientHeight":"clientWidth",v=r.reference[g]+r.reference[a]-m[a]-r.floating[g],b=m[a]-r.reference[a],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f)),R=A?A[y]:0;(!R||!await(s.isElement==null?void 0:s.isElement(A)))&&(R=c.floating[y]||r.floating[g]);let $=v/2-b/2,C=R/2-p[g]/2-1,O=j(u[h],C),L=j(u[x],C),H=O,Y=R-p[g]-L,S=R/2-p[g]/2+$,q=ut(H,S,Y),_=!l.arrow&&N(i)!=null&&S!==q&&r.reference[g]/2-(S<H?O:L)-p[g]/2<0,D=_?S<H?S-H:S-Y:0;return{[a]:m[a]+D,data:{[a]:q,centerOffset:S-q-D,..._&&{alignmentOffset:D}},reset:_}}});function Le(t,e,n){return(t?[...n.filter(i=>N(i)===t),...n.filter(i=>N(i)!==t)]:n.filter(i=>B(i)===i)).filter(i=>t?N(i)===t||(e?it(i)!==i:!1):!0)}var Ut=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;let{rects:r,middlewareData:s,placement:c,platform:l,elements:f}=e,{crossAxis:d=!1,alignment:u,allowedPlacements:m=bt,autoAlignment:a=!0,...g}=X(t,e),p=u!==void 0||m===bt?Le(u||null,a,m):m,w=await l.detectOverflow(e,g),h=((n=s.autoPlacement)==null?void 0:n.index)||0,x=p[h];if(x==null)return{};let y=Ot(x,r,await(l.isRTL==null?void 0:l.isRTL(f.floating)));if(c!==x)return{reset:{placement:p[0]}};let v=[w[B(x)],w[y[0]],w[y[1]]],b=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:x,overflows:v}],A=p[h+1];if(A)return{data:{index:h+1,overflows:b},reset:{placement:A}};let R=b.map(O=>{let L=N(O.placement);return[O.placement,L&&d?O.overflows.slice(0,2).reduce((H,Y)=>H+Y,0):O.overflows[0],O.overflows]}).sort((O,L)=>O[1]-L[1]),C=((i=R.filter(O=>O[2].slice(0,N(O[0])?2:3).every(L=>L<=0))[0])==null?void 0:i[0])||R[0][0];return C!==c?{data:{index:h+1,overflows:b},reset:{placement:C}}:{}}}},It=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:l,elements:f}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:a="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...w}=X(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};let h=B(i),x=z(c),y=B(c)===c,v=await(l.isRTL==null?void 0:l.isRTL(f.floating)),b=m||(y||!p?[st(c)]:kt(c)),A=g!=="none";!m&&A&&b.push(...Bt(c,p,g,v));let R=[c,...b],$=await l.detectOverflow(e,w),C=[],O=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&C.push($[h]),u){let S=Ot(i,s,v);C.push($[S[0]],$[S[1]])}if(O=[...O,{placement:i,overflows:C}],!C.every(S=>S<=0)){var L,H;let S=(((L=r.flip)==null?void 0:L.index)||0)+1,q=R[S];if(q&&(!(u==="alignment"?x!==z(q):!1)||O.every(M=>z(M.placement)===x?M.overflows[0]>0:!0)))return{data:{index:S,overflows:O},reset:{placement:q}};let _=(H=O.filter(D=>D.overflows[0]<=0).sort((D,M)=>D.overflows[1]-M.overflows[1])[0])==null?void 0:H.placement;if(!_)switch(a){case"bestFit":{var Y;let D=(Y=O.filter(M=>{if(A){let I=z(M.placement);return I===x||I==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(I=>I>0).reduce((I,Oe)=>I+Oe,0)]).sort((M,I)=>M[1]-I[1])[0])==null?void 0:Y[0];D&&(_=D);break}case"initialPlacement":_=c;break}if(i!==_)return{reset:{placement:_}}}return{}}}};function $t(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ht(t){return vt.some(e=>t[e]>=0)}var jt=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n,platform:o}=e,{strategy:i="referenceHidden",...r}=X(t,e);switch(i){case"referenceHidden":{let s=await o.detectOverflow(e,{...r,elementContext:"reference"}),c=$t(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ht(c)}}}case"escaped":{let s=await o.detectOverflow(e,{...r,altBoundary:!0}),c=$t(s,n.floating);return{data:{escapedOffsets:c,escaped:Ht(c)}}}default:return{}}}}};var De=new Set(["left","top"]);async function Me(t,e){let{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=B(n),c=N(n),l=z(n)==="y",f=De.has(s)?-1:1,d=r&&l?-1:1,u=X(e,t),{mainAxis:m,crossAxis:a,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof g=="number"&&(a=c==="end"?g*-1:g),l?{x:a*d,y:m*f}:{x:m*f,y:a*d}}var Xt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;let{x:i,y:r,placement:s,middlewareData:c}=e,l=await Me(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Yt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:h=>{let{x,y}=h;return{x,y}}},...f}=X(t,e),d={x:n,y:o},u=await r.detectOverflow(e,f),m=z(B(i)),a=At(m),g=d[a],p=d[m];if(s){let h=a==="y"?"top":"left",x=a==="y"?"bottom":"right",y=g+u[h],v=g-u[x];g=ut(y,g,v)}if(c){let h=m==="y"?"top":"left",x=m==="y"?"bottom":"right",y=p+u[h],v=p-u[x];p=ut(y,p,v)}let w=l.fn({...e,[a]:g,[m]:p});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[a]:s,[m]:c}}}}}};function gt(){return typeof window<"u"}function J(t){return Kt(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function k(t){var e;return(e=(Kt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Kt(t){return gt()?t instanceof Node||t instanceof P(t).Node:!1}function E(t){return gt()?t instanceof Element||t instanceof P(t).Element:!1}function W(t){return gt()?t instanceof HTMLElement||t instanceof P(t).HTMLElement:!1}function qt(t){return!gt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}function et(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=T(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function Gt(t){return/^(table|td|th)$/.test(J(t))}function lt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Fe=/transform|translate|scale|rotate|perspective|filter/,Ne=/paint|layout|strict|content/,G=t=>!!t&&t!=="none",St;function nt(t){let e=E(t)?T(t):t;return G(e.transform)||G(e.translate)||G(e.scale)||G(e.rotate)||G(e.perspective)||!ht()&&(G(e.backdropFilter)||G(e.filter))||Fe.test(e.willChange||"")||Ne.test(e.contain||"")}function Jt(t){let e=U(t);for(;W(e)&&!Q(e);){if(nt(e))return e;if(lt(e))return null;e=U(e)}return null}function ht(){return St==null&&(St=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),St}function Q(t){return/^(html|body|#document)$/.test(J(t))}function T(t){return P(t).getComputedStyle(t)}function at(t){return E(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function U(t){if(J(t)==="html")return t;let e=t.assignedSlot||t.parentNode||qt(t)&&t.host||k(t);return qt(e)?e.host:e}function Qt(t){let e=U(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&et(e)?e:Qt(e)}function tt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Qt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=P(i);if(r){let c=pt(s);return e.concat(s,s.visualViewport||[],et(i)?i:[],c&&n?tt(c):[])}else return e.concat(i,tt(i,[],n))}function pt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ne(t){let e=T(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=W(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=rt(n)!==r||rt(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Ct(t){return E(t)?t:t.contextElement}function ot(t){let e=Ct(t);if(!W(e))return F(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:r}=ne(e),s=(r?rt(n.width):n.width)/o,c=(r?rt(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var ke=F(0);function oe(t){let e=P(t);return!ht()||!e.visualViewport?ke:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Be(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function Z(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),r=Ct(t),s=F(1);e&&(o?E(o)&&(s=ot(o)):s=ot(t));let c=Be(r,n,o)?oe(r):F(0),l=(i.left+c.x)/s.x,f=(i.top+c.y)/s.y,d=i.width/s.x,u=i.height/s.y;if(r){let m=P(r),a=o&&E(o)?P(o):o,g=m,p=pt(g);for(;p&&o&&a!==g;){let w=ot(p),h=p.getBoundingClientRect(),x=T(p),y=h.left+(p.clientLeft+parseFloat(x.paddingLeft))*w.x,v=h.top+(p.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,f*=w.y,d*=w.x,u*=w.y,l+=y,f+=v,g=P(p),p=pt(g)}}return K({width:d,height:u,x:l,y:f})}function wt(t,e){let n=at(t).scrollLeft;return e?e.left+n:Z(k(t)).left+n}function ie(t,e){let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-wt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function We(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t,r=i==="fixed",s=k(o),c=e?lt(e.floating):!1;if(o===s||c&&r)return n;let l={scrollLeft:0,scrollTop:0},f=F(1),d=F(0),u=W(o);if((u||!u&&!r)&&((J(o)!=="body"||et(s))&&(l=at(o)),u)){let a=Z(o);f=ot(o),d.x=a.x+o.clientLeft,d.y=a.y+o.clientTop}let m=s&&!u&&!r?ie(s,l):F(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+d.x+m.x,y:n.y*f.y-l.scrollTop*f.y+d.y+m.y}}function $e(t){return Array.from(t.getClientRects())}function He(t){let e=k(t),n=at(t),o=t.ownerDocument.body,i=V(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=V(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+wt(t),c=-n.scrollTop;return T(o).direction==="rtl"&&(s+=V(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}var Zt=25;function _e(t,e){let n=P(t),o=k(t),i=n.visualViewport,r=o.clientWidth,s=o.clientHeight,c=0,l=0;if(i){r=i.width,s=i.height;let d=ht();(!d||d&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}let f=wt(o);if(f<=0){let d=o.ownerDocument,u=d.body,m=getComputedStyle(u),a=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(o.clientWidth-u.clientWidth-a);g<=Zt&&(r-=g)}else f<=Zt&&(r+=f);return{width:r,height:s,x:c,y:l}}function Ve(t,e){let n=Z(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=W(t)?ot(t):F(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=i*r.x,f=o*r.y;return{width:s,height:c,x:l,y:f}}function te(t,e,n){let o;if(e==="viewport")o=_e(t,n);else if(e==="document")o=He(k(t));else if(E(e))o=Ve(e,n);else{let i=oe(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return K(o)}function se(t,e){let n=U(t);return n===e||!E(n)||Q(n)?!1:T(n).position==="fixed"||se(n,e)}function ze(t,e){let n=e.get(t);if(n)return n;let o=tt(t,[],!1).filter(c=>E(c)&&J(c)!=="body"),i=null,r=T(t).position==="fixed",s=r?U(t):t;for(;E(s)&&!Q(s);){let c=T(s),l=nt(s);!l&&c.position==="fixed"&&(i=null),(r?!l&&!i:!l&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||et(s)&&!l&&se(t,s))?o=o.filter(d=>d!==s):i=c,s=U(s)}return e.set(t,o),o}function Ue(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,s=[...n==="clippingAncestors"?lt(e)?[]:ze(e,this._c):[].concat(n),o],c=te(e,s[0],i),l=c.top,f=c.right,d=c.bottom,u=c.left;for(let m=1;m<s.length;m++){let a=te(e,s[m],i);l=V(a.top,l),f=j(a.right,f),d=j(a.bottom,d),u=V(a.left,u)}return{width:f-u,height:d-l,x:u,y:l}}function Ie(t){let{width:e,height:n}=ne(t);return{width:e,height:n}}function je(t,e,n){let o=W(e),i=k(e),r=n==="fixed",s=Z(t,!0,r,e),c={scrollLeft:0,scrollTop:0},l=F(0);function f(){l.x=wt(i)}if(o||!o&&!r)if((J(e)!=="body"||et(i))&&(c=at(e)),o){let a=Z(e,!0,r,e);l.x=a.x+e.clientLeft,l.y=a.y+e.clientTop}else i&&f();r&&!o&&i&&f();let d=i&&!o&&!r?ie(i,c):F(0),u=s.left+c.scrollLeft-l.x-d.x,m=s.top+c.scrollTop-l.y-d.y;return{x:u,y:m,width:s.width,height:s.height}}function Pt(t){return T(t).position==="static"}function ee(t,e){if(!W(t)||T(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return k(t)===n&&(n=n.ownerDocument.body),n}function re(t,e){let n=P(t);if(lt(t))return n;if(!W(t)){let i=U(t);for(;i&&!Q(i);){if(E(i)&&!Pt(i))return i;i=U(i)}return n}let o=ee(t,e);for(;o&&Gt(o)&&Pt(o);)o=ee(o,e);return o&&Q(o)&&Pt(o)&&!nt(o)?n:o||Jt(t)||n}var Xe=async function(t){let e=this.getOffsetParent||re,n=this.getDimensions,o=await n(t.floating);return{reference:je(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ye(t){return T(t).direction==="rtl"}var xt={convertOffsetParentRelativeRectToViewportRelativeRect:We,getDocumentElement:k,getClippingRect:Ue,getOffsetParent:re,getElementRects:Xe,getClientRects:$e,getDimensions:Ie,getScale:ot,isElement:E,isRTL:Ye};function ce(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qe(t,e){let n=null,o,i=k(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),r();let f=t.getBoundingClientRect(),{left:d,top:u,width:m,height:a}=f;if(c||e(),!m||!a)return;let g=ct(u),p=ct(i.clientWidth-(d+m)),w=ct(i.clientHeight-(u+a)),h=ct(d),y={rootMargin:-g+"px "+-p+"px "+-w+"px "+-h+"px",threshold:V(0,j(1,l))||1},v=!0;function b(A){let R=A[0].intersectionRatio;if(R!==l){if(!v)return s();R?s(!1,R):o=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!ce(f,t.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(b,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,y)}n.observe(t)}return s(!0),r}function le(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=Ct(t),d=i||r?[...f?tt(f):[],...e?tt(e):[]]:[];d.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),r&&h.addEventListener("resize",n)});let u=f&&c?qe(f,n):null,m=-1,a=null;s&&(a=new ResizeObserver(h=>{let[x]=h;x&&x.target===f&&a&&e&&(a.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=a)==null||y.observe(e)})),n()}),f&&!l&&a.observe(f),e&&a.observe(e));let g,p=l?Z(t):null;l&&w();function w(){let h=Z(t);p&&!ce(p,h)&&n(),p=h,g=requestAnimationFrame(w)}return n(),()=>{var h;d.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),u?.(),(h=a)==null||h.disconnect(),a=null,l&&cancelAnimationFrame(g)}}var ae=Xt,fe=Ut,ue=Yt,Et=It;var de=jt,me=zt;var ge=(t,e,n)=>{let o=new Map,i={platform:xt,...n},r={...i.platform,_c:o};return Vt(t,e,{...i,platform:r})};function he(t){return Ke(t)}function Tt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Ke(t){for(let e=t;e;e=Tt(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=Tt(t);e;e=Tt(e)){if(!(e instanceof Element))continue;let n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||nt(n)||e.tagName==="BODY"))return e}return null}(function(){if(!!1){let e=xt.getOffsetParent;xt.getOffsetParent=n=>e(n,he)}})();function pe(t){let e=window.devicePixelRatio||1;return Math.round(t*e)/e}var ve=(async(t,{arrowEl:e,direction:n,flipDisabled:o,flipPlacements:i,floatingEl:r,offsetDistance:s,offsetSkidding:c,overlayPositioning:l="absolute",placement:f,referenceEl:d,type:u})=>{if(!d||!r)return;let m=n==="rtl",{x:a,y:g,placement:p,strategy:w,middlewareData:h}=await ge(d,r,{strategy:l,placement:f==="auto"||f==="auto-start"||f==="auto-end"?void 0:we(f,m),middleware:Je({placement:f,flipDisabled:o,flipPlacements:i?.map(b=>we(b,m)),offsetDistance:s,offsetSkidding:c,arrowEl:e,type:u})});if(e&&h.arrow){let{x:b,y:A}=h.arrow,R=p.split("-")[0],$=b!=null?"left":"top",C=tn[R],O={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=R==="left"||R==="right"?"horizontal":"vertical"),Object.assign(e.style,{...O,[$]:`${$=="left"?b:A}px`,[R]:"100%",transform:C})}let y=h.hide?.referenceHidden?"hidden":null,v=y?"none":null;r.setAttribute(Ge,p),Object.assign(r.style,{pointerEvents:v,position:w,transform:`translate(${pe(a)}px,${pe(g)}px)`,visibility:y})}),Ge="data-placement",be=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],On="bottom-start",Rn="bottom-end",Sn={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function Je({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:r,type:s}){let c=[ue(),de()];return s==="menu"&&c.push(Et({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})),c.push(ae({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})),t==="auto"||t==="auto-start"||t==="auto-end"?c.push(fe({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(Et(n?{fallbackPlacements:n}:{})),r&&c.push(me({element:r})),c}function Qe(t){return be.includes(t)}function Pn(t,e){let n=t.filter(Qe);return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${be.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function we(t,e=!1){let n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function Cn(t,e,n=!1){if(!t.open||!e.floatingEl||!e.referenceEl)return;if(Object.assign(e.floatingEl.style,{display:"block",inset:"unset",left:"0",position:e.overlayPositioning??"absolute",top:"0"}),!ft.get(t))return Ae(t);await(n?Ze(t):ve)(t,e)}function Ze(t){let e=yt.get(t);return e||(e=Dt(ve,Lt.reposition,{edges:["leading","trailing"]}),yt.set(t,e),e)}var tn={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},ft=new WeakMap,yt=new WeakMap;async function Ae(t){let{referenceEl:e,floatingEl:n}=t;if(!n.isConnected)return;let o=le;ft.set(t,{state:"pending"});let i,r=o(e,n,()=>{let s=t.reposition();i||(i=s)});return ft.set(t,{state:"active",cleanUp:r}),i}function en(t){let{floatingEl:e}=t;e&&Object.assign(e.style,{display:"",left:"",pointerEvents:"",position:"",top:"",transform:"",visibility:""})}async function En(t){let{floatingEl:e,referenceEl:n}=t;if(en(t),nn(t),!(!e||!n||!t.open))return Ae(t)}function nn(t){let e=ft.get(t);e?.state==="active"&&e.cleanUp(),ft.delete(t),yt.get(t)?.cancel(),yt.delete(t)}var xe=4,Tn=Math.ceil(Math.hypot(xe,xe));export{On as a,Rn as b,Sn as c,Pn as d,Cn as e,en as f,En as g,nn as h,Tn as i};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as b,b as v,j as l,m as F,n as C,q as w}from"./THN4PT7B.js";import"./WSQ4PXI6.js";import{a as H}from"./FOCO4B2I.js";import"./YGX7CUXN.js";import"./LZO5WQFT.js";import{F as R,G as A,H as u,S as I,g as x,h as g,p as f}from"./KC5YLSJL.js";var h={calendar:"calendar",calendarContainer:"calendar-container",calendarStart:"calendar--start",currentDay:"current-day",dayContainer:"day-container",insideRangeHover:"inside-range--hover",month:"month",noncurrent:"noncurrent",outsideRangeHover:"outside-range--hover",weekDays:"week-days",weekHeader:"week-header",weekHeaderContainer:"week-header-container"},Y=x`:host([hidden]){display:none}[hidden]{display:none}.calendar-container{display:flex;inline-size:100%}:host([range][layout=vertical]) .calendar-container{flex-direction:column}.calendar{inline-size:100%}.week-header-container{display:flex;block-size:16px;padding-inline:var(--calcite-spacing-sm);padding-block:var(--calcite-spacing-md)}.week-header{display:flex;align-items:center;justify-content:center;text-align:center;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);font-weight:var(--calcite-font-weight-bold);inline-size:14.2857142857%;color:var(--calcite-date-picker-week-header-text-color, var(--calcite-color-text-2))}.day-container{display:flex;inline-size:100%;min-inline-size:0px;justify-content:center}.day-container calcite-date-picker-day{inline-size:100%}.week-days{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:1fr;padding-inline:var(--calcite-spacing-sm);padding-block-end:var(--calcite-spacing-sm)}.month-header{display:flex;inline-size:100%;justify-content:space-between}.month{display:flex;inline-size:100%;flex-direction:column;justify-content:space-between}.day{font-size:var(--calcite-font-size)}:host([scale=s]) .week-days{padding-inline:var(--calcite-spacing-xs);padding-block-end:var(--calcite-spacing-xs)}:host([scale=s]) .week-header-container{padding-inline:var(--calcite-spacing-xs);padding-block:var(--calcite-spacing-sm)}:host([scale=s]) .day{font-size:var(--calcite-font-size-sm)}:host([scale=l]) .week-header{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base)}:host([scale=l]) .week-days{padding-inline:var(--calcite-spacing-md);padding-block-end:var(--calcite-spacing-md)}:host([scale=l]) .week-header-container{padding-inline:var(--calcite-spacing-md);padding-block:var(--calcite-spacing-md-plus)}:host([scale=l]) .day{font-size:var(--calcite-font-size-md)}.calendar--start{border-width:0px;border-style:solid;border-color:var(--calcite-date-picker-range-calendar-divider-color, var(--calcite-color-border-1))}:host([range][layout=horizontal][calendars="2"]) .calendar--start{border-inline-end-width:var(--calcite-border-width-sm)}:host([range][layout=vertical][calendars="2"]) .calendar--start{border-block-end-width:var(--calcite-border-width-sm)}.noncurrent{pointer-events:none;opacity:0}`,p=7,M=6,P=42,S=class extends A{constructor(){super(),this.storeDayRef=e=>{e?.active&&this.activeFocus&&e.setFocus()},this.activeDate=new Date,this.calendars=2,this.range=!1,this.calciteInternalDatePickerDayHover=f({cancelable:!1}),this.calciteInternalDatePickerDaySelect=f({cancelable:!1}),this.calciteInternalDatePickerMonthActiveDateChange=f({cancelable:!1}),this.calciteInternalDatePickerMonthChange=f({cancelable:!1}),this.calciteInternalDatePickerMonthMouseOut=f({cancelable:!1}),this.listen("pointerout",this.pointerOutHandler),this.listen("focusout",this.disableActiveFocus)}static{this.properties={focusedDate:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],calendars:[11,{},{type:Number,reflect:!0}],dateTimeFormat:[0,{},{attribute:!1}],endDate:[0,{},{attribute:!1}],headingLevel:[11,{},{type:Number,reflect:!0}],hoverRange:[0,{},{attribute:!1}],layout:[3,{},{reflect:!0}],localeData:[0,{},{attribute:!1}],max:[0,{},{attribute:!1}],messages:[0,{},{attribute:!1}],min:[0,{},{attribute:!1}],monthStyle:1,range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selectedDate:[0,{},{attribute:!1}],startDate:[0,{},{attribute:!1}]}}static{this.styles=Y}load(){this.focusedDate=this.selectedDate||this.activeDate}willUpdate(e){e.has("activeDate")&&this.updateFocusedDateWithActive(this.activeDate),e.has("selectedDate")&&(this.focusedDate=this.selectedDate)}updateFocusedDateWithActive(e){this.selectedDate||(this.focusedDate=b(e,this.min,this.max)?e:v(e,this.min,this.max))}keyDownHandler(e){if(e.defaultPrevented)return;let a=this.el.dir==="rtl",t=e.target.value;switch(e.key){case"ArrowUp":e.preventDefault(),this.addDays(-7,t);break;case"ArrowRight":e.preventDefault(),this.addDays(a?-1:1,t);break;case"ArrowDown":e.preventDefault(),this.addDays(7,t);break;case"ArrowLeft":e.preventDefault(),this.addDays(a?1:-1,t);break;case"PageUp":e.preventDefault(),this.addMonths(-1,t);break;case"PageDown":e.preventDefault(),this.addMonths(1,t);break;case"Home":e.preventDefault(),this.activeDate.setDate(1),this.addDays(0,t);break;case"End":e.preventDefault(),this.activeDate.setDate(new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+1,0).getDate()),this.addDays(0,t);break;case"Enter":case" ":e.preventDefault();break;case"Tab":this.activeFocus=!1}}disableActiveFocus(){this.activeFocus=!1}pointerOutHandler(){this.calciteInternalDatePickerMonthMouseOut.emit()}addMonths(e,a){let t=new Date(a);t.setMonth(a.getMonth()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}addDays(e=0,a){let t=new Date(a);t.setDate(a.getDate()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}getPreviousMonthDays(e,a,t){let s=new Date(a,e,0),i=s.getDate(),n=s.getDay(),o=[];if(n===(t+M)%p)return o;if(n===t)return[i];for(let r=(p+n-t)%p;r>=0;r--)o.push(i-r);return o}getCurrentMonthDays(e,a){let t=new Date(a,e+1,0).getDate(),s=[];for(let i=0;i<t;i++)s.push(i+1);return s}getNextMonthDays(e,a,t){let s=new Date(a,e+1,0).getDay(),i=[];if(s===(t+M)%p)return i;for(let n=0;n<(M-(s-t))%p;n++)i.push(n+1);return i}betweenSelectedRange(e){return!!(this.startDate&&this.endDate&&e>this.startDate&&e<this.endDate&&!this.isRangeHover(e))}isSelected(e){return!!(l(e,this.selectedDate)||this.startDate&&l(e,this.startDate)||this.endDate&&l(e,this.endDate))}isStartOfRange(e){return!!(this.startDate&&!l(this.startDate,this.endDate)&&l(this.startDate,e)&&!this.isEndOfRange(e))}isEndOfRange(e){return!!(this.endDate&&!l(this.startDate,this.endDate)&&l(this.endDate,e)||!this.endDate&&this.hoverRange&&l(this.startDate,this.hoverRange.end)&&l(e,this.hoverRange.end))}dayHover(e){let a=e.target;a.disabled?this.calciteInternalDatePickerMonthMouseOut.emit():this.calciteInternalDatePickerDayHover.emit(a.value),e.stopPropagation()}daySelect(e){let a=e.target;this.activeFocus=!1,this.calciteInternalDatePickerDaySelect.emit(a.value),e.stopPropagation()}isFocusedOnStart(){return this.hoverRange?.focused==="start"}isHoverInRange(){if(!this.hoverRange||!this.startDate)return!1;let{start:e,end:a}=this.hoverRange,t=this.isFocusedOnStart(),s=this.startDate&&a>this.startDate,i=this.endDate&&a<this.endDate,n=this.startDate&&e>this.startDate,o=this.endDate&&e<this.endDate,r=!t&&this.startDate&&s&&(!this.endDate||i),D=t&&this.startDate&&n&&o;return r||D}isRangeHover(e){if(!this.hoverRange)return!1;let{start:a,end:t}=this.hoverRange,s=this.isFocusedOnStart(),i=this.isHoverInRange(),n=e>a&&e<this.startDate,o=e<t&&e>this.endDate,r=e>t&&e<this.endDate,D=e<a&&e>this.startDate,y=e<t&&e>this.startDate,c=e>a&&e<this.endDate,d=this.startDate&&this.endDate;if(i){if(d)return s?e<this.endDate&&(D||n):r||o;if(this.startDate&&!this.endDate)return s?n:y;if(!this.startDate&&this.endDate)return s?c:o}else if(d)return s?n:o}getDays(e,a,t,s="start"){let i=this.activeDate.getMonth(),n=i+1;i=s==="end"?n:i;let o=0,r=()=>o++%7,D=this.activeDate.getFullYear();return[...e.map(c=>({active:!1,day:c,dayInWeek:r(),date:new Date(D,i-1,c)})),...a.map(c=>{let d=new Date(D,i,c),m=l(d,new Date);return{active:this.focusedDate&&this.focusedDate!==this.startDate&&this.focusedDate!==this.endDate?l(d,this.focusedDate):l(d,this.startDate)||l(d,this.endDate),currentMonth:!0,currentDay:m,day:c,dayInWeek:r(),date:d}}),...t.map(c=>({active:!1,day:c,dayInWeek:r(),date:new Date(D,n,c)}))]}monthHeaderSelectChange(e){let a=new Date(e.detail),t=e.target;this.updateFocusableDate(a),e.stopPropagation(),this.calciteInternalDatePickerMonthChange.emit({date:a,position:t.position})}updateFocusableDate(e){!this.selectedDate||!this.range?this.focusedDate=this.getFirstValidDateOfMonth(e):this.selectedDate&&this.range&&(!w(this.startDate,e)||!w(this.endDate,e))&&(this.focusedDate=this.getFirstValidDateOfMonth(e))}getFirstValidDateOfMonth(e){return e.getDate()===1?e:F(e,this.min,this.max)}render(){let e=this.activeDate.getMonth(),a=this.activeDate.getFullYear(),t=this.localeData.weekStart%7,{abbreviated:s,short:i,narrow:n}=this.localeData.days,o=this.scale==="s"?n||i||s:i||s||n,r=[...o.slice(t,7),...o.slice(0,t)],D=this.getCurrentMonthDays(e,a),y=this.getPreviousMonthDays(e,a,t),c=this.getNextMonthDays(e,a,t),d=D.length+y.length+c.length;if(d<P){let N=c.length?c[c.length-1]:0;for(let k=1;k<=P-d;k++)c.push(N+k)}let m=e+1,$=this.getPreviousMonthDays(m,a,t),E=this.getCurrentMonthDays(m,a),z=this.getNextMonthDays(m,a,t),O=this.getDays(y,D,c),B=this.getDays($,E,z,"end");return g`<div class=${u({[h.calendarContainer]:!0})} role=grid>${this.renderCalendar(r,O)}${this.range&&this.calendars===2&&this.renderCalendar(r,B,!0)||""}</div>`}renderDateDay({active:e,currentMonth:a,currentDay:t,date:s,day:i,dayInWeek:n},o){let r=b(s,this.min,this.max);return H(o,g`<div class=${u({[h.dayContainer]:!0})} role=gridcell><calcite-date-picker-day .active=${e} class=${u({[h.currentDay]:t,[h.insideRangeHover]:this.isHoverInRange(),[h.outsideRangeHover]:!this.isHoverInRange(),[h.noncurrent]:this.range&&this.calendars===2&&!a})} .currentMonth=${a} .dateTimeFormat=${this.dateTimeFormat} .day=${i} .disabled=${!r} .endOfRange=${this.isEndOfRange(s)} .highlighted=${this.betweenSelectedRange(s)} @calciteInternalDayHover=${this.dayHover} @calciteInternalDaySelect=${this.daySelect} .range=${!!this.startDate&&!!this.endDate&&!l(this.startDate,this.endDate)} .rangeEdge=${n===0?"start":n===6?"end":void 0} .rangeHover=${r&&this.isRangeHover(s)} .scale=${this.scale} .selected=${this.isSelected(s)} .startOfRange=${this.isStartOfRange(s)} .value=${s} ${R(this.storeDayRef)}></calcite-date-picker-day></div>`)}renderCalendar(e,a,t=!1){return g`<div class=${u({[h.calendar]:!0,[h.calendarStart]:!t})}><calcite-date-picker-month-header .activeDate=${t?C(this.activeDate):this.activeDate} .headingLevel=${this.headingLevel} .localeData=${this.localeData} .max=${this.max} .messages=${this.messages} .min=${this.min} .monthStyle=${this.monthStyle} @calciteInternalDatePickerMonthHeaderSelectChange=${this.monthHeaderSelectChange} .position=${t?"end":this.range&&this.calendars===2?"start":null} .scale=${this.scale} .selectedDate=${this.selectedDate}></calcite-date-picker-month-header>${this.renderMonthCalendar(e,a,t)}</div>`}renderMonthCalendar(e,a,t=!1){return g`<div class=${u({[h.month]:!0})} @keydown=${this.keyDownHandler}><div class=${u({[h.weekHeaderContainer]:!0})} role=row>${e.map(i=>g`<span class=${u({[h.weekHeader]:!0})} role=columnheader>${i}</span>`)}</div><div class=${u({[h.weekDays]:!0})} role=row>${a.map((i,n)=>this.renderDateDay(i,t?50+n:n))}</div></div>`}};I("calcite-date-picker-month",S);export{S as DatePickerMonth};
2
+ import{a as b,b as v,j as l,m as F,n as C,q as w}from"./VXD77BNL.js";import"./Z7XEAFTW.js";import{a as H}from"./BMJZRWPQ.js";import"./YGX7CUXN.js";import"./KEGLBRYW.js";import{F as R,G as A,H as u,S as I,g as x,h as g,p as f}from"./KIVCCNSA.js";var h={calendar:"calendar",calendarContainer:"calendar-container",calendarStart:"calendar--start",currentDay:"current-day",dayContainer:"day-container",insideRangeHover:"inside-range--hover",month:"month",noncurrent:"noncurrent",outsideRangeHover:"outside-range--hover",weekDays:"week-days",weekHeader:"week-header",weekHeaderContainer:"week-header-container"},Y=x`:host([hidden]){display:none}[hidden]{display:none}.calendar-container{display:flex;inline-size:100%}:host([range][layout=vertical]) .calendar-container{flex-direction:column}.calendar{inline-size:100%}.week-header-container{display:flex;block-size:16px;padding-inline:var(--calcite-spacing-sm);padding-block:var(--calcite-spacing-md)}.week-header{display:flex;align-items:center;justify-content:center;text-align:center;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);font-weight:var(--calcite-font-weight-bold);inline-size:14.2857142857%;color:var(--calcite-date-picker-week-header-text-color, var(--calcite-color-text-2))}.day-container{display:flex;inline-size:100%;min-inline-size:0px;justify-content:center}.day-container calcite-date-picker-day{inline-size:100%}.week-days{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:1fr;padding-inline:var(--calcite-spacing-sm);padding-block-end:var(--calcite-spacing-sm)}.month-header{display:flex;inline-size:100%;justify-content:space-between}.month{display:flex;inline-size:100%;flex-direction:column;justify-content:space-between}.day{font-size:var(--calcite-font-size)}:host([scale=s]) .week-days{padding-inline:var(--calcite-spacing-xs);padding-block-end:var(--calcite-spacing-xs)}:host([scale=s]) .week-header-container{padding-inline:var(--calcite-spacing-xs);padding-block:var(--calcite-spacing-sm)}:host([scale=s]) .day{font-size:var(--calcite-font-size-sm)}:host([scale=l]) .week-header{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base)}:host([scale=l]) .week-days{padding-inline:var(--calcite-spacing-md);padding-block-end:var(--calcite-spacing-md)}:host([scale=l]) .week-header-container{padding-inline:var(--calcite-spacing-md);padding-block:var(--calcite-spacing-md-plus)}:host([scale=l]) .day{font-size:var(--calcite-font-size-md)}.calendar--start{border-width:0px;border-style:solid;border-color:var(--calcite-date-picker-range-calendar-divider-color, var(--calcite-color-border-1))}:host([range][layout=horizontal][calendars="2"]) .calendar--start{border-inline-end-width:var(--calcite-border-width-sm)}:host([range][layout=vertical][calendars="2"]) .calendar--start{border-block-end-width:var(--calcite-border-width-sm)}.noncurrent{pointer-events:none;opacity:0}`,p=7,M=6,P=42,S=class extends A{constructor(){super(),this.storeDayRef=e=>{e?.active&&this.activeFocus&&e.setFocus()},this.activeDate=new Date,this.calendars=2,this.range=!1,this.calciteInternalDatePickerDayHover=f({cancelable:!1}),this.calciteInternalDatePickerDaySelect=f({cancelable:!1}),this.calciteInternalDatePickerMonthActiveDateChange=f({cancelable:!1}),this.calciteInternalDatePickerMonthChange=f({cancelable:!1}),this.calciteInternalDatePickerMonthMouseOut=f({cancelable:!1}),this.listen("pointerout",this.pointerOutHandler),this.listen("focusout",this.disableActiveFocus)}static{this.properties={focusedDate:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],calendars:[11,{},{type:Number,reflect:!0}],dateTimeFormat:[0,{},{attribute:!1}],endDate:[0,{},{attribute:!1}],headingLevel:[11,{},{type:Number,reflect:!0}],hoverRange:[0,{},{attribute:!1}],layout:[3,{},{reflect:!0}],localeData:[0,{},{attribute:!1}],max:[0,{},{attribute:!1}],messages:[0,{},{attribute:!1}],min:[0,{},{attribute:!1}],monthStyle:1,range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selectedDate:[0,{},{attribute:!1}],startDate:[0,{},{attribute:!1}]}}static{this.styles=Y}load(){this.focusedDate=this.selectedDate||this.activeDate}willUpdate(e){e.has("activeDate")&&this.updateFocusedDateWithActive(this.activeDate),e.has("selectedDate")&&(this.focusedDate=this.selectedDate)}updateFocusedDateWithActive(e){this.selectedDate||(this.focusedDate=b(e,this.min,this.max)?e:v(e,this.min,this.max))}keyDownHandler(e){if(e.defaultPrevented)return;let a=this.el.dir==="rtl",t=e.target.value;switch(e.key){case"ArrowUp":e.preventDefault(),this.addDays(-7,t);break;case"ArrowRight":e.preventDefault(),this.addDays(a?-1:1,t);break;case"ArrowDown":e.preventDefault(),this.addDays(7,t);break;case"ArrowLeft":e.preventDefault(),this.addDays(a?1:-1,t);break;case"PageUp":e.preventDefault(),this.addMonths(-1,t);break;case"PageDown":e.preventDefault(),this.addMonths(1,t);break;case"Home":e.preventDefault(),this.activeDate.setDate(1),this.addDays(0,t);break;case"End":e.preventDefault(),this.activeDate.setDate(new Date(this.activeDate.getFullYear(),this.activeDate.getMonth()+1,0).getDate()),this.addDays(0,t);break;case"Enter":case" ":e.preventDefault();break;case"Tab":this.activeFocus=!1}}disableActiveFocus(){this.activeFocus=!1}pointerOutHandler(){this.calciteInternalDatePickerMonthMouseOut.emit()}addMonths(e,a){let t=new Date(a);t.setMonth(a.getMonth()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}addDays(e=0,a){let t=new Date(a);t.setDate(a.getDate()+e),this.calciteInternalDatePickerMonthActiveDateChange.emit(v(t,this.min,this.max)),this.focusedDate=v(t,this.min,this.max),this.activeFocus=!0,this.calciteInternalDatePickerDayHover.emit(t)}getPreviousMonthDays(e,a,t){let s=new Date(a,e,0),i=s.getDate(),n=s.getDay(),o=[];if(n===(t+M)%p)return o;if(n===t)return[i];for(let r=(p+n-t)%p;r>=0;r--)o.push(i-r);return o}getCurrentMonthDays(e,a){let t=new Date(a,e+1,0).getDate(),s=[];for(let i=0;i<t;i++)s.push(i+1);return s}getNextMonthDays(e,a,t){let s=new Date(a,e+1,0).getDay(),i=[];if(s===(t+M)%p)return i;for(let n=0;n<(M-(s-t))%p;n++)i.push(n+1);return i}betweenSelectedRange(e){return!!(this.startDate&&this.endDate&&e>this.startDate&&e<this.endDate&&!this.isRangeHover(e))}isSelected(e){return!!(l(e,this.selectedDate)||this.startDate&&l(e,this.startDate)||this.endDate&&l(e,this.endDate))}isStartOfRange(e){return!!(this.startDate&&!l(this.startDate,this.endDate)&&l(this.startDate,e)&&!this.isEndOfRange(e))}isEndOfRange(e){return!!(this.endDate&&!l(this.startDate,this.endDate)&&l(this.endDate,e)||!this.endDate&&this.hoverRange&&l(this.startDate,this.hoverRange.end)&&l(e,this.hoverRange.end))}dayHover(e){let a=e.target;a.disabled?this.calciteInternalDatePickerMonthMouseOut.emit():this.calciteInternalDatePickerDayHover.emit(a.value),e.stopPropagation()}daySelect(e){let a=e.target;this.activeFocus=!1,this.calciteInternalDatePickerDaySelect.emit(a.value),e.stopPropagation()}isFocusedOnStart(){return this.hoverRange?.focused==="start"}isHoverInRange(){if(!this.hoverRange||!this.startDate)return!1;let{start:e,end:a}=this.hoverRange,t=this.isFocusedOnStart(),s=this.startDate&&a>this.startDate,i=this.endDate&&a<this.endDate,n=this.startDate&&e>this.startDate,o=this.endDate&&e<this.endDate,r=!t&&this.startDate&&s&&(!this.endDate||i),D=t&&this.startDate&&n&&o;return r||D}isRangeHover(e){if(!this.hoverRange)return!1;let{start:a,end:t}=this.hoverRange,s=this.isFocusedOnStart(),i=this.isHoverInRange(),n=e>a&&e<this.startDate,o=e<t&&e>this.endDate,r=e>t&&e<this.endDate,D=e<a&&e>this.startDate,y=e<t&&e>this.startDate,c=e>a&&e<this.endDate,d=this.startDate&&this.endDate;if(i){if(d)return s?e<this.endDate&&(D||n):r||o;if(this.startDate&&!this.endDate)return s?n:y;if(!this.startDate&&this.endDate)return s?c:o}else if(d)return s?n:o}getDays(e,a,t,s="start"){let i=this.activeDate.getMonth(),n=i+1;i=s==="end"?n:i;let o=0,r=()=>o++%7,D=this.activeDate.getFullYear();return[...e.map(c=>({active:!1,day:c,dayInWeek:r(),date:new Date(D,i-1,c)})),...a.map(c=>{let d=new Date(D,i,c),m=l(d,new Date);return{active:this.focusedDate&&this.focusedDate!==this.startDate&&this.focusedDate!==this.endDate?l(d,this.focusedDate):l(d,this.startDate)||l(d,this.endDate),currentMonth:!0,currentDay:m,day:c,dayInWeek:r(),date:d}}),...t.map(c=>({active:!1,day:c,dayInWeek:r(),date:new Date(D,n,c)}))]}monthHeaderSelectChange(e){let a=new Date(e.detail),t=e.target;this.updateFocusableDate(a),e.stopPropagation(),this.calciteInternalDatePickerMonthChange.emit({date:a,position:t.position})}updateFocusableDate(e){!this.selectedDate||!this.range?this.focusedDate=this.getFirstValidDateOfMonth(e):this.selectedDate&&this.range&&(!w(this.startDate,e)||!w(this.endDate,e))&&(this.focusedDate=this.getFirstValidDateOfMonth(e))}getFirstValidDateOfMonth(e){return e.getDate()===1?e:F(e,this.min,this.max)}render(){let e=this.activeDate.getMonth(),a=this.activeDate.getFullYear(),t=this.localeData.weekStart%7,{abbreviated:s,short:i,narrow:n}=this.localeData.days,o=this.scale==="s"?n||i||s:i||s||n,r=[...o.slice(t,7),...o.slice(0,t)],D=this.getCurrentMonthDays(e,a),y=this.getPreviousMonthDays(e,a,t),c=this.getNextMonthDays(e,a,t),d=D.length+y.length+c.length;if(d<P){let N=c.length?c[c.length-1]:0;for(let k=1;k<=P-d;k++)c.push(N+k)}let m=e+1,$=this.getPreviousMonthDays(m,a,t),E=this.getCurrentMonthDays(m,a),z=this.getNextMonthDays(m,a,t),O=this.getDays(y,D,c),B=this.getDays($,E,z,"end");return g`<div class=${u({[h.calendarContainer]:!0})} role=grid>${this.renderCalendar(r,O)}${this.range&&this.calendars===2&&this.renderCalendar(r,B,!0)||""}</div>`}renderDateDay({active:e,currentMonth:a,currentDay:t,date:s,day:i,dayInWeek:n},o){let r=b(s,this.min,this.max);return H(o,g`<div class=${u({[h.dayContainer]:!0})} role=gridcell><calcite-date-picker-day .active=${e} class=${u({[h.currentDay]:t,[h.insideRangeHover]:this.isHoverInRange(),[h.outsideRangeHover]:!this.isHoverInRange(),[h.noncurrent]:this.range&&this.calendars===2&&!a})} .currentMonth=${a} .dateTimeFormat=${this.dateTimeFormat} .day=${i} .disabled=${!r} .endOfRange=${this.isEndOfRange(s)} .highlighted=${this.betweenSelectedRange(s)} @calciteInternalDayHover=${this.dayHover} @calciteInternalDaySelect=${this.daySelect} .range=${!!this.startDate&&!!this.endDate&&!l(this.startDate,this.endDate)} .rangeEdge=${n===0?"start":n===6?"end":void 0} .rangeHover=${r&&this.isRangeHover(s)} .scale=${this.scale} .selected=${this.isSelected(s)} .startOfRange=${this.isStartOfRange(s)} .value=${s} ${R(this.storeDayRef)}></calcite-date-picker-day></div>`)}renderCalendar(e,a,t=!1){return g`<div class=${u({[h.calendar]:!0,[h.calendarStart]:!t})}><calcite-date-picker-month-header .activeDate=${t?C(this.activeDate):this.activeDate} .headingLevel=${this.headingLevel} .localeData=${this.localeData} .max=${this.max} .messages=${this.messages} .min=${this.min} .monthStyle=${this.monthStyle} @calciteInternalDatePickerMonthHeaderSelectChange=${this.monthHeaderSelectChange} .position=${t?"end":this.range&&this.calendars===2?"start":null} .scale=${this.scale} .selectedDate=${this.selectedDate}></calcite-date-picker-month-header>${this.renderMonthCalendar(e,a,t)}</div>`}renderMonthCalendar(e,a,t=!1){return g`<div class=${u({[h.month]:!0})} @keydown=${this.keyDownHandler}><div class=${u({[h.weekHeaderContainer]:!0})} role=row>${e.map(i=>g`<span class=${u({[h.weekHeader]:!0})} role=columnheader>${i}</span>`)}</div><div class=${u({[h.weekDays]:!0})} role=row>${a.map((i,n)=>this.renderDateDay(i,t?50+n:n))}</div></div>`}};I("calcite-date-picker-month",S);export{S as DatePickerMonth};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as D}from"./FZFYK4YW.js";import{a as P}from"./RQLTHDZV.js";import{b as I}from"./IGWRKE4T.js";import{a as z}from"./ETUQ2WX4.js";import{a as O}from"./ZNQYJ3F6.js";import"./ULBKKOQK.js";import{a as w}from"./HDCTPG3W.js";import{a as h}from"./FOCO4B2I.js";import"./AP2LDRUV.js";import{a as m}from"./J7SMVIGE.js";import{a as B}from"./64SYBTWP.js";import{a as E}from"./ZGQKLZNW.js";import{a as p}from"./WGGFNK4Z.js";import"./R4MIPDZD.js";import"./LZO5WQFT.js";import{t as r,u as H}from"./JTFWEILS.js";import"./OAOQ5BXS.js";import{F as S,G as C,H as a,S as y,g as x,h as n,l as f,p as c}from"./KC5YLSJL.js";var s={content:"content",toggle:"toggle",header:"header"},t={actionsEnd:"actions-end",container:"container",content:"content",contentEnd:"content-end",contentStart:"content-start",description:"description",header:"header",headerContainer:"header-container",headerHasContent:"header--has-content",headerDraggable:"header--draggable",heading:"heading",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",iconEndContainer:"icon-end-container",invalid:"invalid",statusIcon:"status-icon",title:"title",toggle:"toggle",toggleIcon:"toggle-icon",valid:"valid"},g={actionsEnd:"actions-end",contentEnd:"content-end",contentStart:"content-start",headerMenuActions:"header-menu-actions"},u={expanded:"chevron-up",collapsed:"chevron-down",valid:"check-circle",invalid:"exclamation-mark-triangle"},X=x`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host([scale=s]) .header{gap:var(--calcite-spacing-sm)}:host([scale=s]) .icon-end-container{gap:var(--calcite-spacing-sm);padding-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .heading{font-size:var(--calcite-font-size-sm)}:host([scale=s]) .description{font-size:var(--calcite-font-size-xs)}:host([scale=s]){--calcite-internal-block-actions-spacing: var(--calcite-spacing-xxs);--calcite-internal-block-header-content-padding: var(--calcite-spacing-sm);--calcite-internal-block-padding-block: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-xxs)) );--calcite-internal-block-padding-inline: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-sm)) )}:host([scale=m]) .header{gap:var(--calcite-spacing-md)}:host([scale=m]) .icon-end-container{gap:var(--calcite-spacing-md);padding-inline-end:var(--calcite-spacing-md)}:host([scale=m]) .heading{font-size:var(--calcite-font-size)}:host([scale=m]) .description{font-size:var(--calcite-font-size-sm)}:host([scale=m]){--calcite-internal-block-actions-spacing: var(--calcite-spacing-xxs);--calcite-internal-block-header-content-padding: var(--calcite-spacing-md);--calcite-internal-block-padding-block: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-sm)) );--calcite-internal-block-padding-inline: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-md)) )}:host([scale=l]) .header{gap:var(--calcite-spacing-lg)}:host([scale=l]) .icon-end-container{gap:var(--calcite-spacing-lg);padding-inline-end:var(--calcite-spacing-lg)}:host([scale=l]) .heading{font-size:var(--calcite-font-size-md)}:host([scale=l]) .description{font-size:var(--calcite-font-size)}:host([scale=l]){--calcite-internal-block-actions-spacing: var(--calcite-spacing-xs);--calcite-internal-block-header-content-padding: var(--calcite-spacing-lg);--calcite-internal-block-padding-block: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-md)) );--calcite-internal-block-padding-inline: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-lg)) )}:host{display:flex;flex-shrink:0;flex-grow:0;flex-direction:column;border-width:0px;border-block-end-width:1px;border-style:solid;padding:0;transition-property:margin;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.215,.44,.42,.88);flex-basis:auto;border-color:var(--calcite-block-border-color, var(--calcite-color-border-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.header{justify-content:flex-start}.header--has-content{padding:var(--calcite-internal-block-header-content-padding)}.header--draggable{padding-inline-start:var(--calcite-spacing-xxs)}.header,.toggle{grid-area:header}.header-container{display:grid;align-items:stretch;grid-template:auto/auto 1fr auto auto auto auto;grid-template-areas:"handle header icon-end menu actions-end"}.icon--start,.icon--end{color:var(--calcite-block-icon-color, var(--calcite-color-text-3))}.actions-end{align-items:center;display:flex;gap:var(--calcite-internal-block-actions-spacing);grid-area:actions-end;padding-block:var(--calcite-internal-block-actions-spacing);padding-inline-end:var(--calcite-internal-block-actions-spacing)}.toggle{margin:0;display:flex;cursor:pointer;flex-wrap:nowrap;align-items:center;justify-content:space-between;border-style:none;padding:0;outline-color:transparent;font-family:inherit;text-align:initial;background-color:var(--calcite-block-header-background-color, transparent)}.toggle:hover{background-color:var(--calcite-block-header-background-color-hover, var(--calcite-color-foreground-2))}.toggle:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.toggle:active{background-color:var(--calcite-block-header-background-color-press, var(--calcite-color-foreground-3))}calcite-loader[inline]{align-self:center}calcite-sort-handle{align-self:center;grid-area:handle;margin-block:var(--calcite-internal-block-actions-spacing);padding-inline-start:var(--calcite-spacing-xxs)}.title{display:flex;flex-direction:column}.header .title .heading{padding:0;word-wrap:break-word;word-break:break-word;color:var(--calcite-block-heading-text-color, var(--calcite-color-text-1));font-weight:var(--calcite-font-weight-normal);line-height:var(--calcite-font-line-height-relative-snug)}.description{padding:0;word-wrap:break-word;word-break:break-word;color:var(--calcite-block-description-text-color, var(--calcite-color-text-3));font-weight:var(--calcite-font-weight-regular);line-height:var(--calcite-font-line-height-relative-snug)}.icon{display:flex}.status-icon.valid{color:var(--calcite-color-status-success)}.status-icon.invalid{color:var(--calcite-color-status-danger)}@keyframes spin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.icon-end-container{display:flex;align-items:center;grid-area:icon-end}.toggle-icon{align-self:center;justify-self:end;transition-property:color;transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.4,0,.2,1);color:var(--calcite-block-icon-color, var(--calcite-color-text-3))}.toggle:hover .toggle-icon{color:var(--calcite-block-icon-color-hover, var(--calcite-color-text-1))}.container{position:relative;display:flex;block-size:100%;flex-direction:column}.content{position:relative;min-block-size:0px;flex:1 1 0%;opacity:0;padding-block:var(--calcite-internal-block-padding-block);padding-inline:var(--calcite-internal-block-padding-inline);transition:opacity var(--calcite-internal-animation-timing-slow) ease-in-out}.content-end,.content-start{display:flex;align-items:center;color:var(--calcite-block-text-color, var(--calcite-color-text-3))}calcite-action-menu{align-self:center;grid-area:menu;margin-inline-end:var(--calcite-internal-block-actions-spacing)}:host([expanded]){margin-block:.5rem}:host([expanded]) .header .title .heading{color:var(--calcite-block-heading-text-color, var(--calcite-block-heading-text-color-press, var(--calcite-color-text-1)));font-weight:var(--calcite-font-weight-medium)}:host([expanded]) .description{color:var(--calcite-block-description-text-color, var(--calcite-color-text-2))}:host([expanded]) .icon--start,:host([expanded]) .icon--end{color:var(--calcite-block-icon-color, var(--calcite-color-text-1))}:host([expanded]) .content{opacity:1}@starting-style{:host([expanded]){margin-block-start:0;opacity:0}}:host([expanded][scale=s]){margin-block:var(--calcite-spacing-xxs)}:host([expanded][scale=l]){margin-block:var(--calcite-spacing-md)}:host([hidden]){display:none}[hidden]{display:none}`,v=class extends C{constructor(){super(...arguments),this.transitionProp="margin-top",this.blockSectionChildren=[],this.messages=B(),this.focusSetter=E()(this),this.interactiveContainer=w(this),this.hasContentEnd=!1,this.hasContentStart=!1,this.hasEndActions=!1,this.hasMenuActions=!1,this.collapsible=!1,this.disabled=!1,this.dragDisabled=!1,this.dragHandle=!1,this.expanded=!1,this.loading=!1,this.menuPlacement=I,this.addToItems=[],this.moveToItems=[],this.sortDisabled=!1,this.overlayPositioning="absolute",this.scale="m",this.setPosition=null,this.setSize=null,this.sortHandleOpen=!1,this.topLayerDisabled=!1,this.calciteBlockBeforeClose=c({cancelable:!1}),this.calciteBlockBeforeOpen=c({cancelable:!1}),this.calciteBlockClose=c({cancelable:!1}),this.calciteBlockCollapse=c({cancelable:!1}),this.calciteBlockExpand=c({cancelable:!1}),this.calciteBlockOpen=c({cancelable:!1}),this.calciteBlockSortHandleBeforeClose=c({cancelable:!1}),this.calciteBlockSortHandleBeforeOpen=c({cancelable:!1}),this.calciteBlockSortHandleClose=c({cancelable:!1}),this.calciteBlockSortHandleOpen=c({cancelable:!1}),this.calciteBlockToggle=c({cancelable:!1}),this.calciteInternalBlockUpdateSortMenuItems=c({cancelable:!1})}static{this.properties={hasContentEnd:[16,{},{state:!0}],hasContentStart:[16,{},{state:!0}],hasEndActions:[16,{},{state:!0}],hasMenuActions:[16,{},{state:!0}],collapsible:[7,{},{reflect:!0,type:Boolean}],description:1,disabled:[7,{},{reflect:!0,type:Boolean}],dragDisabled:[7,{},{reflect:!0,type:Boolean}],dragHandle:[7,{},{reflect:!0,type:Boolean}],expanded:[7,{},{reflect:!0,type:Boolean}],heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],iconEnd:[3,{type:String},{reflect:!0}],iconFlipRtl:[3,{},{reflect:!0}],iconStart:[3,{type:String},{reflect:!0}],loading:[7,{},{reflect:!0,type:Boolean}],label:1,menuFlipPlacements:[0,{},{attribute:!1}],menuPlacement:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],addToItems:[0,{},{attribute:!1}],moveToItems:[0,{},{attribute:!1}],sortDisabled:[5,{},{type:Boolean}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}],setPosition:[9,{},{type:Number}],setSize:[9,{},{type:Number}],sortHandleOpen:[7,{},{reflect:!0,type:Boolean}],status:[3,{},{reflect:!0}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=[D,X,P]}get open(){return this.expanded}set open(e){m.deprecated("property",{component:this,name:"open",removalVersion:5,suggested:"expanded"}),this.expanded=e}async setFocus(e){return this.focusSetter(()=>this.el,e)}connectedCallback(){super.connectedCallback(),this.transitionEl=this.el}load(){!this.heading&&!this.label&&m.warn(`${this.el.tagName} is missing both heading & label. Please provide a heading or label for the component to be accessible.`)}willUpdate(e){e.has("expanded")&&(this.hasUpdated||this.expanded!==!1)&&z(this),e.has("sortHandleOpen")&&(this.hasUpdated||this.sortHandleOpen!==!1)&&this.sortHandleOpenHandler(),e.has("expanded")&&this.hasUpdated&&(this.expanded?this.calciteBlockExpand.emit():this.calciteBlockCollapse.emit()),e.has("scale")&&this.hasUpdated&&this.updateBlockSectionScale()}onBeforeOpen(){this.calciteBlockBeforeOpen.emit()}onOpen(){this.calciteBlockOpen.emit()}onBeforeClose(){this.calciteBlockBeforeClose.emit()}onClose(){this.calciteBlockClose.emit()}sortHandleOpenHandler(){this.sortHandleEl&&(this.sortHandleEl.open=this.sortHandleOpen)}setSortHandleEl(e){this.sortHandleEl=e,this.sortHandleOpenHandler()}handleSortHandleBeforeOpen(e){e.stopPropagation(),this.calciteBlockSortHandleBeforeOpen.emit()}handleSortHandleBeforeClose(e){e.stopPropagation(),this.calciteBlockSortHandleBeforeClose.emit()}handleSortHandleClose(e){e.stopPropagation(),this.sortHandleOpen=!1,this.calciteBlockSortHandleClose.emit()}handleSortHandleOpen(e){e.stopPropagation(),this.sortHandleOpen=!0,this.calciteBlockSortHandleOpen.emit()}onHeaderClick(){this.expanded=!this.expanded,this.calciteBlockToggle.emit()}menuActionsSlotChangeHandler(e){this.hasMenuActions=r(e)}actionsEndSlotChangeHandler(e){this.hasEndActions=r(e)}handleContentEndSlotChange(e){this.hasContentEnd=r(e)}handleContentStartSlotChange(e){this.hasContentStart=r(e)}handleDefaultSlotChange(e){this.blockSectionChildren=H(e,"calcite-block-section"),this.updateBlockSectionScale()}updateBlockSectionScale(){this.blockSectionChildren.forEach(e=>{e.scale=this.scale})}renderScrim(){let{loading:e}=this,l=n`<slot @slotchange=${this.handleDefaultSlotChange}></slot>`;return[e?n`<calcite-scrim .loading=${e}></calcite-scrim>`:null,l]}renderLoaderStatusIcon(){let{loading:e,messages:l,status:i}=this;return e?h("loader",n`<div class=${a(t.icon)}><calcite-loader inline .label=${l.loading} .scale=${this.scale}></calcite-loader></div>`):i?h("status-icon",n`<div class=${a(t.icon)}><calcite-icon class=${a({[t.statusIcon]:!0,[t.valid]:i=="valid",[t.invalid]:i=="invalid"})} .icon=${u[i]} .scale=${p(this.scale)}></calcite-icon></div>`):null}renderActionsEnd(){return n`<div class=${a(t.actionsEnd)} .hidden=${!this.hasEndActions}><slot name=${g.actionsEnd} @slotchange=${this.actionsEndSlotChangeHandler}></slot></div>`}renderContentEnd(){return n`<div class=${a({[t.iconEndContainer]:!this.iconEnd&&!this.collapsible})} .hidden=${!this.hasContentEnd}><div class=${a(t.contentEnd)}><slot name=${g.contentEnd} @slotchange=${this.handleContentEndSlotChange}></slot></div></div>`}renderContentStart(){return n`<div class=${a(t.contentStart)} .hidden=${!this.hasContentStart}><slot name=${g.contentStart} @slotchange=${this.handleContentStartSlotChange}></slot></div>`}renderTitle(){let{heading:e,headingLevel:l,description:i}=this;return e||i?n`<div class=${a(t.title)}>${O({class:t.heading,level:l,children:e})}${i?n`<div class=${a(t.description)}>${i}</div>`:null}</div>`:null}renderIcon(e){let{iconFlipRtl:l}=this,i=l==="both"||e==="start"?l==="start":l==="end",o=e==="start"?this.iconStart:this.iconEnd,d=e==="start"?t.iconStart:t.iconEnd;if(o)return h(o,n`<calcite-icon class=${a(d)} .flipRtl=${i} .icon=${o} .scale=${p(this.scale)}></calcite-icon>`)}render(){let{collapsible:e,loading:l,expanded:i,label:o,heading:d,messages:b,description:A,menuFlipPlacements:T,menuPlacement:L,moveToItems:M,addToItems:F,setPosition:N,setSize:U,dragDisabled:R,sortDisabled:j,iconEnd:k,hasContentEnd:V,hasContentStart:G,iconStart:q}=this,J=i?b.collapse:b.expand,K=!!(d||A||V||G||q||l||status),$=n`<header class=${a({[t.header]:!0,[t.headerHasContent]:K,[t.headerDraggable]:this.dragHandle})} id=${s.header}>${this.renderIcon("start")}${this.renderContentStart()}${this.renderLoaderStatusIcon()}${this.renderTitle()}</header>`,Q=i?u.expanded:u.collapsed,W=n`<div class=${a(t.headerContainer)}>${this.dragHandle?n`<calcite-sort-handle .addToItems=${F} .disabled=${R} .label=${d||o} .moveToItems=${M} @calciteSortHandleBeforeClose=${this.handleSortHandleBeforeClose} @calciteSortHandleBeforeOpen=${this.handleSortHandleBeforeOpen} @calciteSortHandleClose=${this.handleSortHandleClose} @calciteSortHandleOpen=${this.handleSortHandleOpen} overlay-positioning=fixed .scale=${this.scale} .setPosition=${N} .setSize=${U} .sortDisabled=${j} .topLayerDisabled=${this.topLayerDisabled} ${S(this.setSortHandleEl)}></calcite-sort-handle>`:null}${e?n`<button aria-controls=${s.content} aria-describedby=${s.header} .ariaExpanded=${e?i:null} class=${a(t.toggle)} id=${s.toggle} @click=${this.onHeaderClick} title=${J??f}>${$}<div class=${a(t.iconEndContainer)}>${this.renderContentEnd()}${this.renderIcon("end")}<calcite-icon class=${a(t.toggleIcon)} .icon=${Q} .scale=${p(this.scale)}></calcite-icon></div></button>`:$}${k&&!e?n`<div class=${a(t.iconEndContainer)}>${this.renderContentEnd()}${this.renderIcon("end")}</div>`:!k&&!e?this.renderContentEnd():null}<calcite-action-menu .flipPlacements=${T??["top","bottom"]} .hidden=${!this.hasMenuActions} .label=${b.options} .overlayPositioning=${this.overlayPositioning} .placement=${L} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled}><slot name=${g.headerMenuActions} @slotchange=${this.menuActionsSlotChangeHandler}></slot></calcite-action-menu>${this.renderActionsEnd()}</div>`;return this.interactiveContainer({disabled:this.disabled,children:n`<article aria-label=${o??f} .ariaBusy=${l} class=${a({[t.container]:!0})}>${W}<section aria-labelledby=${s.toggle} class=${a(t.content)} .hidden=${!i} id=${s.content}>${this.renderScrim()}</section></article>`})}};y("calcite-block",v);export{v as Block};
2
+ import{a as D}from"./XVE4JN3H.js";import{a as P}from"./3VHKPO2P.js";import{b as I}from"./2NNRJTQ3.js";import{a as z}from"./IQOUDTMQ.js";import{a as O}from"./YBTRE55X.js";import"./W4U75XMI.js";import{a as w}from"./BJY3GM77.js";import{a as h}from"./BMJZRWPQ.js";import"./AP2LDRUV.js";import{a as m}from"./ELGTRNFS.js";import{a as B}from"./EJUBVZVG.js";import{a as E}from"./YGSUEQMS.js";import{a as p}from"./WGGFNK4Z.js";import"./OGYP4PT3.js";import"./KEGLBRYW.js";import{t as r,u as H}from"./F4YFAW3E.js";import"./OAOQ5BXS.js";import{F as S,G as C,H as a,S as y,g as x,h as n,l as f,p as c}from"./KIVCCNSA.js";var s={content:"content",toggle:"toggle",header:"header"},t={actionsEnd:"actions-end",container:"container",content:"content",contentEnd:"content-end",contentStart:"content-start",description:"description",header:"header",headerContainer:"header-container",headerHasContent:"header--has-content",headerDraggable:"header--draggable",heading:"heading",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",iconEndContainer:"icon-end-container",invalid:"invalid",statusIcon:"status-icon",title:"title",toggle:"toggle",toggleIcon:"toggle-icon",valid:"valid"},g={actionsEnd:"actions-end",contentEnd:"content-end",contentStart:"content-start",headerMenuActions:"header-menu-actions"},u={expanded:"chevron-up",collapsed:"chevron-down",valid:"check-circle",invalid:"exclamation-mark-triangle"},X=x`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host([scale=s]) .header{gap:var(--calcite-spacing-sm)}:host([scale=s]) .icon-end-container{gap:var(--calcite-spacing-sm);padding-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .heading{font-size:var(--calcite-font-size-sm)}:host([scale=s]) .description{font-size:var(--calcite-font-size-xs)}:host([scale=s]){--calcite-internal-block-actions-spacing: var(--calcite-spacing-xxs);--calcite-internal-block-header-content-padding: var(--calcite-spacing-sm);--calcite-internal-block-padding-block: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-xxs)) );--calcite-internal-block-padding-inline: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-sm)) )}:host([scale=m]) .header{gap:var(--calcite-spacing-md)}:host([scale=m]) .icon-end-container{gap:var(--calcite-spacing-md);padding-inline-end:var(--calcite-spacing-md)}:host([scale=m]) .heading{font-size:var(--calcite-font-size)}:host([scale=m]) .description{font-size:var(--calcite-font-size-sm)}:host([scale=m]){--calcite-internal-block-actions-spacing: var(--calcite-spacing-xxs);--calcite-internal-block-header-content-padding: var(--calcite-spacing-md);--calcite-internal-block-padding-block: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-sm)) );--calcite-internal-block-padding-inline: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-md)) )}:host([scale=l]) .header{gap:var(--calcite-spacing-lg)}:host([scale=l]) .icon-end-container{gap:var(--calcite-spacing-lg);padding-inline-end:var(--calcite-spacing-lg)}:host([scale=l]) .heading{font-size:var(--calcite-font-size-md)}:host([scale=l]) .description{font-size:var(--calcite-font-size)}:host([scale=l]){--calcite-internal-block-actions-spacing: var(--calcite-spacing-xs);--calcite-internal-block-header-content-padding: var(--calcite-spacing-lg);--calcite-internal-block-padding-block: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-md)) );--calcite-internal-block-padding-inline: var( --calcite-block-content-space, var(--calcite-block-padding, var(--calcite-spacing-lg)) )}:host{display:flex;flex-shrink:0;flex-grow:0;flex-direction:column;border-width:0px;border-block-end-width:1px;border-style:solid;padding:0;transition-property:margin;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.215,.44,.42,.88);flex-basis:auto;border-color:var(--calcite-block-border-color, var(--calcite-color-border-3))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.header{justify-content:flex-start}.header--has-content{padding:var(--calcite-internal-block-header-content-padding)}.header--draggable{padding-inline-start:var(--calcite-spacing-xxs)}.header,.toggle{grid-area:header}.header-container{display:grid;align-items:stretch;grid-template:auto/auto 1fr auto auto auto auto;grid-template-areas:"handle header icon-end menu actions-end"}.icon--start,.icon--end{color:var(--calcite-block-icon-color, var(--calcite-color-text-3))}.actions-end{align-items:center;display:flex;gap:var(--calcite-internal-block-actions-spacing);grid-area:actions-end;padding-block:var(--calcite-internal-block-actions-spacing);padding-inline-end:var(--calcite-internal-block-actions-spacing)}.toggle{margin:0;display:flex;cursor:pointer;flex-wrap:nowrap;align-items:center;justify-content:space-between;border-style:none;padding:0;outline-color:transparent;font-family:inherit;text-align:initial;background-color:var(--calcite-block-header-background-color, transparent)}.toggle:hover{background-color:var(--calcite-block-header-background-color-hover, var(--calcite-color-foreground-2))}.toggle:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.toggle:active{background-color:var(--calcite-block-header-background-color-press, var(--calcite-color-foreground-3))}calcite-loader[inline]{align-self:center}calcite-sort-handle{align-self:center;grid-area:handle;margin-block:var(--calcite-internal-block-actions-spacing);padding-inline-start:var(--calcite-spacing-xxs)}.title{display:flex;flex-direction:column}.header .title .heading{padding:0;word-wrap:break-word;word-break:break-word;color:var(--calcite-block-heading-text-color, var(--calcite-color-text-1));font-weight:var(--calcite-font-weight-normal);line-height:var(--calcite-font-line-height-relative-snug)}.description{padding:0;word-wrap:break-word;word-break:break-word;color:var(--calcite-block-description-text-color, var(--calcite-color-text-3));font-weight:var(--calcite-font-weight-regular);line-height:var(--calcite-font-line-height-relative-snug)}.icon{display:flex}.status-icon.valid{color:var(--calcite-color-status-success)}.status-icon.invalid{color:var(--calcite-color-status-danger)}@keyframes spin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.icon-end-container{display:flex;align-items:center;grid-area:icon-end}.toggle-icon{align-self:center;justify-self:end;transition-property:color;transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.4,0,.2,1);color:var(--calcite-block-icon-color, var(--calcite-color-text-3))}.toggle:hover .toggle-icon{color:var(--calcite-block-icon-color-hover, var(--calcite-color-text-1))}.container{position:relative;display:flex;block-size:100%;flex-direction:column}.content{position:relative;min-block-size:0px;flex:1 1 0%;opacity:0;padding-block:var(--calcite-internal-block-padding-block);padding-inline:var(--calcite-internal-block-padding-inline);transition:opacity var(--calcite-internal-animation-timing-slow) ease-in-out}.content-end,.content-start{display:flex;align-items:center;color:var(--calcite-block-text-color, var(--calcite-color-text-3))}calcite-action-menu{align-self:center;grid-area:menu;margin-inline-end:var(--calcite-internal-block-actions-spacing)}:host([expanded]){margin-block:.5rem}:host([expanded]) .header .title .heading{color:var(--calcite-block-heading-text-color, var(--calcite-block-heading-text-color-press, var(--calcite-color-text-1)));font-weight:var(--calcite-font-weight-medium)}:host([expanded]) .description{color:var(--calcite-block-description-text-color, var(--calcite-color-text-2))}:host([expanded]) .icon--start,:host([expanded]) .icon--end{color:var(--calcite-block-icon-color, var(--calcite-color-text-1))}:host([expanded]) .content{opacity:1}@starting-style{:host([expanded]){margin-block-start:0;opacity:0}}:host([expanded][scale=s]){margin-block:var(--calcite-spacing-xxs)}:host([expanded][scale=l]){margin-block:var(--calcite-spacing-md)}:host([hidden]){display:none}[hidden]{display:none}`,v=class extends C{constructor(){super(...arguments),this.transitionProp="margin-top",this.blockSectionChildren=[],this.messages=B(),this.focusSetter=E()(this),this.interactiveContainer=w(this),this.hasContentEnd=!1,this.hasContentStart=!1,this.hasEndActions=!1,this.hasMenuActions=!1,this.collapsible=!1,this.disabled=!1,this.dragDisabled=!1,this.dragHandle=!1,this.expanded=!1,this.loading=!1,this.menuPlacement=I,this.addToItems=[],this.moveToItems=[],this.sortDisabled=!1,this.overlayPositioning="absolute",this.scale="m",this.setPosition=null,this.setSize=null,this.sortHandleOpen=!1,this.topLayerDisabled=!1,this.calciteBlockBeforeClose=c({cancelable:!1}),this.calciteBlockBeforeOpen=c({cancelable:!1}),this.calciteBlockClose=c({cancelable:!1}),this.calciteBlockCollapse=c({cancelable:!1}),this.calciteBlockExpand=c({cancelable:!1}),this.calciteBlockOpen=c({cancelable:!1}),this.calciteBlockSortHandleBeforeClose=c({cancelable:!1}),this.calciteBlockSortHandleBeforeOpen=c({cancelable:!1}),this.calciteBlockSortHandleClose=c({cancelable:!1}),this.calciteBlockSortHandleOpen=c({cancelable:!1}),this.calciteBlockToggle=c({cancelable:!1}),this.calciteInternalBlockUpdateSortMenuItems=c({cancelable:!1})}static{this.properties={hasContentEnd:[16,{},{state:!0}],hasContentStart:[16,{},{state:!0}],hasEndActions:[16,{},{state:!0}],hasMenuActions:[16,{},{state:!0}],collapsible:[7,{},{reflect:!0,type:Boolean}],description:1,disabled:[7,{},{reflect:!0,type:Boolean}],dragDisabled:[7,{},{reflect:!0,type:Boolean}],dragHandle:[7,{},{reflect:!0,type:Boolean}],expanded:[7,{},{reflect:!0,type:Boolean}],heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],iconEnd:[3,{type:String},{reflect:!0}],iconFlipRtl:[3,{},{reflect:!0}],iconStart:[3,{type:String},{reflect:!0}],loading:[7,{},{reflect:!0,type:Boolean}],label:1,menuFlipPlacements:[0,{},{attribute:!1}],menuPlacement:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],addToItems:[0,{},{attribute:!1}],moveToItems:[0,{},{attribute:!1}],sortDisabled:[5,{},{type:Boolean}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}],setPosition:[9,{},{type:Number}],setSize:[9,{},{type:Number}],sortHandleOpen:[7,{},{reflect:!0,type:Boolean}],status:[3,{},{reflect:!0}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=[D,X,P]}get open(){return this.expanded}set open(e){m.deprecated("property",{component:this,name:"open",removalVersion:5,suggested:"expanded"}),this.expanded=e}async setFocus(e){return this.focusSetter(()=>this.el,e)}connectedCallback(){super.connectedCallback(),this.transitionEl=this.el}load(){!this.heading&&!this.label&&m.warn(`${this.el.tagName} is missing both heading & label. Please provide a heading or label for the component to be accessible.`)}willUpdate(e){e.has("expanded")&&(this.hasUpdated||this.expanded!==!1)&&z(this),e.has("sortHandleOpen")&&(this.hasUpdated||this.sortHandleOpen!==!1)&&this.sortHandleOpenHandler(),e.has("expanded")&&this.hasUpdated&&(this.expanded?this.calciteBlockExpand.emit():this.calciteBlockCollapse.emit()),e.has("scale")&&this.hasUpdated&&this.updateBlockSectionScale()}onBeforeOpen(){this.calciteBlockBeforeOpen.emit()}onOpen(){this.calciteBlockOpen.emit()}onBeforeClose(){this.calciteBlockBeforeClose.emit()}onClose(){this.calciteBlockClose.emit()}sortHandleOpenHandler(){this.sortHandleEl&&(this.sortHandleEl.open=this.sortHandleOpen)}setSortHandleEl(e){this.sortHandleEl=e,this.sortHandleOpenHandler()}handleSortHandleBeforeOpen(e){e.stopPropagation(),this.calciteBlockSortHandleBeforeOpen.emit()}handleSortHandleBeforeClose(e){e.stopPropagation(),this.calciteBlockSortHandleBeforeClose.emit()}handleSortHandleClose(e){e.stopPropagation(),this.sortHandleOpen=!1,this.calciteBlockSortHandleClose.emit()}handleSortHandleOpen(e){e.stopPropagation(),this.sortHandleOpen=!0,this.calciteBlockSortHandleOpen.emit()}onHeaderClick(){this.expanded=!this.expanded,this.calciteBlockToggle.emit()}menuActionsSlotChangeHandler(e){this.hasMenuActions=r(e)}actionsEndSlotChangeHandler(e){this.hasEndActions=r(e)}handleContentEndSlotChange(e){this.hasContentEnd=r(e)}handleContentStartSlotChange(e){this.hasContentStart=r(e)}handleDefaultSlotChange(e){this.blockSectionChildren=H(e,"calcite-block-section"),this.updateBlockSectionScale()}updateBlockSectionScale(){this.blockSectionChildren.forEach(e=>{e.scale=this.scale})}renderScrim(){let{loading:e}=this,l=n`<slot @slotchange=${this.handleDefaultSlotChange}></slot>`;return[e?n`<calcite-scrim .loading=${e}></calcite-scrim>`:null,l]}renderLoaderStatusIcon(){let{loading:e,messages:l,status:i}=this;return e?h("loader",n`<div class=${a(t.icon)}><calcite-loader inline .label=${l.loading} .scale=${this.scale}></calcite-loader></div>`):i?h("status-icon",n`<div class=${a(t.icon)}><calcite-icon class=${a({[t.statusIcon]:!0,[t.valid]:i=="valid",[t.invalid]:i=="invalid"})} .icon=${u[i]} .scale=${p(this.scale)}></calcite-icon></div>`):null}renderActionsEnd(){return n`<div class=${a(t.actionsEnd)} .hidden=${!this.hasEndActions}><slot name=${g.actionsEnd} @slotchange=${this.actionsEndSlotChangeHandler}></slot></div>`}renderContentEnd(){return n`<div class=${a({[t.iconEndContainer]:!this.iconEnd&&!this.collapsible})} .hidden=${!this.hasContentEnd}><div class=${a(t.contentEnd)}><slot name=${g.contentEnd} @slotchange=${this.handleContentEndSlotChange}></slot></div></div>`}renderContentStart(){return n`<div class=${a(t.contentStart)} .hidden=${!this.hasContentStart}><slot name=${g.contentStart} @slotchange=${this.handleContentStartSlotChange}></slot></div>`}renderTitle(){let{heading:e,headingLevel:l,description:i}=this;return e||i?n`<div class=${a(t.title)}>${O({class:t.heading,level:l,children:e})}${i?n`<div class=${a(t.description)}>${i}</div>`:null}</div>`:null}renderIcon(e){let{iconFlipRtl:l}=this,i=l==="both"||e==="start"?l==="start":l==="end",o=e==="start"?this.iconStart:this.iconEnd,d=e==="start"?t.iconStart:t.iconEnd;if(o)return h(o,n`<calcite-icon class=${a(d)} .flipRtl=${i} .icon=${o} .scale=${p(this.scale)}></calcite-icon>`)}render(){let{collapsible:e,loading:l,expanded:i,label:o,heading:d,messages:b,description:A,menuFlipPlacements:T,menuPlacement:L,moveToItems:M,addToItems:F,setPosition:N,setSize:U,dragDisabled:R,sortDisabled:j,iconEnd:k,hasContentEnd:V,hasContentStart:G,iconStart:q}=this,J=i?b.collapse:b.expand,K=!!(d||A||V||G||q||l||status),$=n`<header class=${a({[t.header]:!0,[t.headerHasContent]:K,[t.headerDraggable]:this.dragHandle})} id=${s.header}>${this.renderIcon("start")}${this.renderContentStart()}${this.renderLoaderStatusIcon()}${this.renderTitle()}</header>`,Q=i?u.expanded:u.collapsed,W=n`<div class=${a(t.headerContainer)}>${this.dragHandle?n`<calcite-sort-handle .addToItems=${F} .disabled=${R} .label=${d||o} .moveToItems=${M} @calciteSortHandleBeforeClose=${this.handleSortHandleBeforeClose} @calciteSortHandleBeforeOpen=${this.handleSortHandleBeforeOpen} @calciteSortHandleClose=${this.handleSortHandleClose} @calciteSortHandleOpen=${this.handleSortHandleOpen} overlay-positioning=fixed .scale=${this.scale} .setPosition=${N} .setSize=${U} .sortDisabled=${j} .topLayerDisabled=${this.topLayerDisabled} ${S(this.setSortHandleEl)}></calcite-sort-handle>`:null}${e?n`<button aria-controls=${s.content} aria-describedby=${s.header} .ariaExpanded=${e?i:null} class=${a(t.toggle)} id=${s.toggle} @click=${this.onHeaderClick} title=${J??f}>${$}<div class=${a(t.iconEndContainer)}>${this.renderContentEnd()}${this.renderIcon("end")}<calcite-icon class=${a(t.toggleIcon)} .icon=${Q} .scale=${p(this.scale)}></calcite-icon></div></button>`:$}${k&&!e?n`<div class=${a(t.iconEndContainer)}>${this.renderContentEnd()}${this.renderIcon("end")}</div>`:!k&&!e?this.renderContentEnd():null}<calcite-action-menu .flipPlacements=${T??["top","bottom"]} .hidden=${!this.hasMenuActions} .label=${b.options} .overlayPositioning=${this.overlayPositioning} .placement=${L} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled}><slot name=${g.headerMenuActions} @slotchange=${this.menuActionsSlotChangeHandler}></slot></calcite-action-menu>${this.renderActionsEnd()}</div>`;return this.interactiveContainer({disabled:this.disabled,children:n`<article aria-label=${o??f} .ariaBusy=${l} class=${a({[t.container]:!0})}>${W}<section aria-labelledby=${s.toggle} class=${a(t.content)} .hidden=${!i} id=${s.content}>${this.renderScrim()}</section></article>`})}};y("calcite-block",v);export{v as Block};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{u as f,v as g}from"./JTFWEILS.js";import"./OAOQ5BXS.js";import{E as b,F as h,G as p,H as m,S as u,g as d,h as n}from"./KC5YLSJL.js";var v={section:"section"},x={titleGroup:"title-group"},y=d`:host{display:flex;flex-direction:column;background-color:var(--calcite-tab-background-color, var(--calcite-color-transparent))}:host([bordered]){box-shadow:inset 0 1px 0 var(--calcite-tab-border-color, var(--calcite-color-border-1));background-color:var(--calcite-tab-background-color, var(--calcite-color-foreground-1))}:host([bordered]) section{border-color:var(--calcite-tab-border-color, var(--calcite-color-border-1));border-style:solid}section{display:flex;flex-grow:1;overflow:hidden;border-width:1px;border-block-start-style:solid;border-block-start-color:var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered][position=bottom]){box-shadow:inset 0 1px 0 var(--calcite-tab-border-color, var(--calcite-color-border-1)),inset 0 -1px 0 var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered]:not([position=bottom])) ::slotted(calcite-tab-nav){margin-block-end:-1px}:host([position=bottom]){flex-direction:column-reverse}:host([position=bottom]) section{flex-direction:column-reverse;border-block-start-width:0px;border-block-end-width:1px}:host([bordered][scale=s]) section{padding:.75rem}:host([bordered][scale=m]) section{padding:.5rem}:host([bordered][scale=l]) section{padding:1rem}:host([position=bottom]:not([bordered])) section{border-block-end-style:solid;border-block-end-color:var(--calcite-tab-border-color, var(--calcite-color-border-1))}@media(forced-colors:active){:host([bordered]) section{border-block-start-width:0px;border-block-end-width:1px}:host([position=bottom][bordered]) section{border-block-start-width:1px;border-block-end-width:0px}}:host([hidden]){display:none}[hidden]{display:none}`,c=class extends p{constructor(){super(),this.slotRef=b(),this.tabs=[],this.titles=[],this.bordered=!1,this.layout="inline",this.position="top",this.scale="m",this.listen("calciteInternalTabNavSlotChange",this.calciteInternalTabNavSlotChangeHandler)}static{this.properties={tabs:[16,{},{state:!0}],titles:[16,{},{state:!0}],bordered:[5,{},{type:Boolean}],layout:[3,{},{reflect:!0}],position:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}]}}static{this.styles=y}connectedCallback(){super.connectedCallback(),this.updateItems()}load(){this.updateItems()}willUpdate(e){(e.has("position")&&(this.hasUpdated||this.position!=="top")||e.has("scale")&&(this.hasUpdated||this.scale!=="m"))&&this.updateItems(),(e.has("titles")||e.has("tabs"))&&this.hasUpdated&&this.titles?.length>0&&this.tabs?.length>0&&(this.updateAriaSettings(),this.updateItems())}calciteInternalTabNavSlotChangeHandler(e){e.stopPropagation(),e.detail.length!==this.titles.length&&(this.titles=e.detail)}defaultSlotChangeHandler(e){this.tabs=f(e,"calcite-tab")}async updateAriaSettings(){if(await this.componentOnReady(),!this.slotRef.value)return;let e,s,o=g(this.slotRef.value,"calcite-tab");if(o.some(t=>t.tab)||this.titles.some(t=>t.tab))e=o.sort((t,a)=>t.tab.localeCompare(a.tab)).map(t=>t.id),s=this.titles.sort((t,a)=>t.tab.localeCompare(a.tab)).map(t=>t.id);else{let t=await Promise.all(o.map(r=>r.getTabIndex())),a=await Promise.all(this.titles.map(r=>r.getTabIndex()));e=t.reduce((r,i,l)=>(r[i]=o[l].id,r),[]),s=a.reduce((r,i,l)=>(r[i]=this.titles[l].id,r),[])}o.forEach(t=>t._updateAriaInfo(e,s)),this.titles.forEach(t=>t._updateAriaInfo(e,s))}updateItems(){let{position:e,scale:s}=this,o=this.el.querySelector("calcite-tab-nav");o&&(o.position=e,o.scale=s),Array.from(this.el.querySelectorAll("calcite-tab")).forEach(t=>{t.parentElement===this.el&&(t.scale=s)}),Array.from(this.el.querySelectorAll("calcite-tab-nav > calcite-tab-title")).forEach(t=>{t.position=e,t.scale=s})}render(){return n`<slot name=${x.titleGroup}></slot><section class=${m(v.section)}><slot @slotchange=${this.defaultSlotChangeHandler} ${h(this.slotRef)}></slot></section>`}};u("calcite-tabs",c);export{c as Tabs};
2
+ import{u as f,v as g}from"./F4YFAW3E.js";import"./OAOQ5BXS.js";import{E as b,F as h,G as p,H as m,S as u,g as d,h as n}from"./KIVCCNSA.js";var v={section:"section"},x={titleGroup:"title-group"},y=d`:host{display:flex;flex-direction:column;background-color:var(--calcite-tab-background-color, var(--calcite-color-transparent))}:host([bordered]){box-shadow:inset 0 1px 0 var(--calcite-tab-border-color, var(--calcite-color-border-1));background-color:var(--calcite-tab-background-color, var(--calcite-color-foreground-1))}:host([bordered]) section{border-color:var(--calcite-tab-border-color, var(--calcite-color-border-1));border-style:solid}section{display:flex;flex-grow:1;overflow:hidden;border-width:1px;border-block-start-style:solid;border-block-start-color:var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered][position=bottom]){box-shadow:inset 0 1px 0 var(--calcite-tab-border-color, var(--calcite-color-border-1)),inset 0 -1px 0 var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered]:not([position=bottom])) ::slotted(calcite-tab-nav){margin-block-end:-1px}:host([position=bottom]){flex-direction:column-reverse}:host([position=bottom]) section{flex-direction:column-reverse;border-block-start-width:0px;border-block-end-width:1px}:host([bordered][scale=s]) section{padding:.75rem}:host([bordered][scale=m]) section{padding:.5rem}:host([bordered][scale=l]) section{padding:1rem}:host([position=bottom]:not([bordered])) section{border-block-end-style:solid;border-block-end-color:var(--calcite-tab-border-color, var(--calcite-color-border-1))}@media(forced-colors:active){:host([bordered]) section{border-block-start-width:0px;border-block-end-width:1px}:host([position=bottom][bordered]) section{border-block-start-width:1px;border-block-end-width:0px}}:host([hidden]){display:none}[hidden]{display:none}`,c=class extends p{constructor(){super(),this.slotRef=b(),this.tabs=[],this.titles=[],this.bordered=!1,this.layout="inline",this.position="top",this.scale="m",this.listen("calciteInternalTabNavSlotChange",this.calciteInternalTabNavSlotChangeHandler)}static{this.properties={tabs:[16,{},{state:!0}],titles:[16,{},{state:!0}],bordered:[5,{},{type:Boolean}],layout:[3,{},{reflect:!0}],position:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}]}}static{this.styles=y}connectedCallback(){super.connectedCallback(),this.updateItems()}load(){this.updateItems()}willUpdate(e){(e.has("position")&&(this.hasUpdated||this.position!=="top")||e.has("scale")&&(this.hasUpdated||this.scale!=="m"))&&this.updateItems(),(e.has("titles")||e.has("tabs"))&&this.hasUpdated&&this.titles?.length>0&&this.tabs?.length>0&&(this.updateAriaSettings(),this.updateItems())}calciteInternalTabNavSlotChangeHandler(e){e.stopPropagation(),e.detail.length!==this.titles.length&&(this.titles=e.detail)}defaultSlotChangeHandler(e){this.tabs=f(e,"calcite-tab")}async updateAriaSettings(){if(await this.componentOnReady(),!this.slotRef.value)return;let e,s,o=g(this.slotRef.value,"calcite-tab");if(o.some(t=>t.tab)||this.titles.some(t=>t.tab))e=o.sort((t,a)=>t.tab.localeCompare(a.tab)).map(t=>t.id),s=this.titles.sort((t,a)=>t.tab.localeCompare(a.tab)).map(t=>t.id);else{let t=await Promise.all(o.map(r=>r.getTabIndex())),a=await Promise.all(this.titles.map(r=>r.getTabIndex()));e=t.reduce((r,i,l)=>(r[i]=o[l].id,r),[]),s=a.reduce((r,i,l)=>(r[i]=this.titles[l].id,r),[])}o.forEach(t=>t._updateAriaInfo(e,s)),this.titles.forEach(t=>t._updateAriaInfo(e,s))}updateItems(){let{position:e,scale:s}=this,o=this.el.querySelector("calcite-tab-nav");o&&(o.position=e,o.scale=s),Array.from(this.el.querySelectorAll("calcite-tab")).forEach(t=>{t.parentElement===this.el&&(t.scale=s)}),Array.from(this.el.querySelectorAll("calcite-tab-nav > calcite-tab-title")).forEach(t=>{t.position=e,t.scale=s})}render(){return n`<slot name=${x.titleGroup}></slot><section class=${m(v.section)}><slot @slotchange=${this.defaultSlotChangeHandler} ${h(this.slotRef)}></slot></section>`}};u("calcite-tabs",c);export{c as Tabs};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as W,b as F,c as z}from"./Y2OS6UOH.js";import{a as y}from"./FOCO4B2I.js";import{a as g}from"./ENDXE7YY.js";import{a as E}from"./64SYBTWP.js";import{e as k}from"./R4MIPDZD.js";import"./LZO5WQFT.js";import{l as B,n as p,y as O}from"./JTFWEILS.js";import"./OAOQ5BXS.js";import{F as w,G as C,H as b,M as x,S,g as I,h as u,p as T}from"./KC5YLSJL.js";var $={chevronRight:"chevron-right",chevronLeft:"chevron-left"},c={container:"container",scrollButton:"scroll-button",scrollButtonContainer:"scroll-button-container",scrollBackwardButton:"scroll-button--backward",scrollForwardButton:"scroll-button--forward",tabTitleSlotWrapper:"tab-titles-slot-wrapper",scale:h=>`scale-${h}`,position:h=>`position-${h}`},V=I`:host{position:relative;display:flex}:host([bordered]) .scroll-button--forward calcite-button{--calcite-internal-button-border-inline-end-color: var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered]) .scroll-button--backward calcite-button{--calcite-internal-button-border-inline-start-color: var( --calcite-tab-border-color, var(--calcite-color-border-1) )}.scale-s{--calcite-internal-tab-nav-button-width: 24px;min-block-size:1.5rem}.scale-m{--calcite-internal-tab-nav-button-width: 32px;min-block-size:2rem}.scale-l{--calcite-internal-tab-nav-button-width: 44px;min-block-size:2.75rem}.container::-webkit-scrollbar{display:none;-ms-overflow-style:none;scrollbar-width:none}:host([layout=center]) ::slotted(calcite-tab-title){display:flex;flex-grow:1;flex-shrink:0;min-inline-size:auto;white-space:nowrap}:host([layout=center]) ::slotted(calcite-tab-title[selected]){overflow:unset}:host(:not([bordered])) .scale-l{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xxl)}:host(:not([bordered])) .scale-m{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xl)}:host(:not([bordered])) .scale-s{--calcite-internal-tab-nav-gap: var(--calcite-spacing-lg)}:host(:not([bordered])) .tab-titles-slot-wrapper{gap:var(--calcite-internal-tab-nav-gap)}:host([layout=center]:not([bordered])) .tab-titles-slot-wrapper{padding-inline:var(--calcite-spacing-xl)}.tab-titles-slot-wrapper{flex:1 1 0%}.container,.tab-titles-slot-wrapper{display:flex;inline-size:100%;justify-content:flex-start;overflow:hidden;white-space:nowrap}.scroll-button{position:absolute;inset-block:0px}.scroll-button calcite-button{--calcite-button-text-color: var(--calcite-tab-text-color, var(--calcite-color-text-3));--calcite-button-background-color: var(--calcite-color-transparent);--calcite-offset-invert-focus: 1;block-size:var(--calcite-container-size-content-fluid)}.scroll-button-container{display:flex;inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);inset-inline-end:0;inline-size:calc(2 * var(--calcite-internal-tab-nav-button-width))}.scroll-button--forward{inset-inline-end:0;z-index:var(--calcite-z-index)}.scroll-button--backward{inset-inline-end:var(--calcite-internal-tab-nav-button-width);z-index:var(--calcite-z-index)}:host(:not([bordered])) .scroll-button--backward:before{background-color:var(--calcite-tab-border-color, var(--calcite-color-border-3));content:"";inline-size:var(--calcite-border-width-sm);inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);position:absolute;inset-inline-start:0}:host([hidden]){display:none}[hidden]{display:none}`,v=class extends C{constructor(){super(),this.direction=k(),this.effectiveDir="ltr",this.lastScrollWheelAxis="x",this.resizeObserver=g("resize",()=>{this.updateScrollingState()}),this.makeFirstVisibleTabClosable=!1,this.messages=E(),this.hasOverflowingEndTabTitle=!1,this.hasOverflowingStartTabTitle=!1,this.bordered=!1,this.layout="inline",this.position="bottom",this.scale="m",this.selectedTitle=null,this.calciteInternalTabChange=T({cancelable:!1}),this.calciteInternalTabNavSlotChange=T(),this.calciteTabChange=T({cancelable:!1}),this.listen("calciteInternalTabsFocusPrevious",this.focusPreviousTabHandler),this.listen("calciteInternalTabsFocusNext",this.focusNextTabHandler),this.listen("calciteInternalTabsFocusFirst",this.focusFirstTabHandler),this.listen("calciteInternalTabsFocusLast",this.focusLastTabHandler),this.listen("calciteInternalTabsActivate",this.internalActivateTabHandler),this.listen("calciteInternalTabsClose",this.internalCloseTabHandler),this.listen("calciteInternalTabTitleRegister",this.updateTabTitles),this.listenOn(document.body,"calciteInternalTabChange",this.globalInternalTabChangeHandler)}static{this.properties={hasOverflowingEndTabTitle:[16,{},{state:!0}],hasOverflowingStartTabTitle:[16,{},{state:!0}],selectedTabId:[16,{},{state:!0}],bordered:[7,{},{reflect:!0,type:Boolean}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:1,scale:1,selectedTitle:[0,{},{attribute:!1}],storageId:[3,{},{reflect:!0}],syncId:[3,{},{reflect:!0}]}}static{this.styles=V}connectedCallback(){super.connectedCallback(),this.parentTabsEl=this.el.closest("calcite-tabs"),this.resizeObserver?.observe(this.el)}async load(){let t=`calcite-tab-nav-${this.storageId}`;if(localStorage&&this.storageId&&localStorage.getItem(t)){let e=JSON.parse(localStorage.getItem(t));this.selectedTabId=e}}willUpdate(t){t.has("selectedTitle")&&(this.hasUpdated||this.selectedTitle!==null)&&this.calciteInternalTabChange.emit({tab:this.selectedTabId}),t.has("selectedTabId")&&this.selectedTabIdChanged();let{parentTabsEl:e}=this;this.layout=e?.layout,this.bordered=e?.bordered,this.effectiveDir=this.direction}loaded(){this.scrollTabTitleIntoView(this.selectedTitle,"instant"),this.tabTitles.length&&this.tabTitles.every(t=>!t.selected)&&!this.selectedTabId&&this.tabTitles[0].getTabIdentifier().then(t=>{this.calciteInternalTabChange.emit({tab:t})})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}get enabledTabTitles(){return p(this.el,"calcite-tab-title:not([disabled])").filter(t=>!t.closed)}get scrollerButtonWidth(){let{scale:t}=this;return parseInt(t==="s"?W:t==="m"?F:z)}get tabTitles(){return p(this.el,"calcite-tab-title")}focusPreviousTabHandler(t){this.handleTabFocus(t,t.target,"previous")}focusNextTabHandler(t){this.handleTabFocus(t,t.target,"next")}focusFirstTabHandler(t){this.handleTabFocus(t,t.target,"first")}focusLastTabHandler(t){this.handleTabFocus(t,t.target,"last")}internalActivateTabHandler(t){let e=t.target,i=this.selectedTitle;this.selectedTabId=t.detail.tab?t.detail.tab:this.getIndexOfTabTitle(e),t.stopPropagation(),this.selectedTitle=e,i?.id!==e.id&&t.detail.userTriggered&&this.calciteTabChange.emit(),this.scrollTabTitleIntoView(e)}scrollTabTitleIntoView(t,e="smooth"){t&&requestAnimationFrame(()=>{let i=this.tabTitleContainerEl;if(!i)return;let l=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=i.scrollLeft;if(a.left<l.left){let n=s+(a.left-l.left);i.scrollTo({left:n,behavior:e})}else if(a.right>l.right){let n=s+(a.right-l.right);i.scrollTo({left:n,behavior:e})}})}internalCloseTabHandler(t){let e=t.target;this.handleTabTitleClose(e),t.stopPropagation()}async updateTabTitles(t){t.target.selected&&(this.selectedTabId=t.detail,this.selectedTitle=await this.getTabTitleById(this.selectedTabId))}globalInternalTabChangeHandler(t){this.syncId&&t.target!==this.el&&t.target.syncId===this.syncId&&this.selectedTabId!==t.detail.tab&&(this.selectedTabId=t.detail.tab),t.stopPropagation()}async selectedTabIdChanged(){await this.componentOnReady(),localStorage&&this.storageId&&this.selectedTabId!==void 0&&this.selectedTabId!==null&&localStorage.setItem(`calcite-tab-nav-${this.storageId}`,JSON.stringify(this.selectedTabId)),this.calciteInternalTabChange.emit({tab:this.selectedTabId})}onTabTitleWheel(t){t.preventDefault();let{deltaX:e,deltaY:i}=t,l=Math.abs(e),a=Math.abs(i),s;l===a?s=this.lastScrollWheelAxis==="x"?e:i:l>a?(s=e,this.lastScrollWheelAxis="x"):(s=i,this.lastScrollWheelAxis="y");let n=(this.effectiveDir==="rtl"?-1:1)*s;t.currentTarget.scrollBy(n,0)}onSlotChange(){this.intersectionObserver?.disconnect();let t=this.tabTitles;t.forEach(l=>{this.intersectionObserver?.observe(l)});let e=this.getVisibleTabTitlesIndices(t);e.length>1&&this.makeFirstVisibleTabClosable&&(t[e[0]].closable=!0,this.makeFirstVisibleTabClosable=!1),this.calciteInternalTabNavSlotChange.emit(t)}setTabTitleContainerEl(t){this.tabTitleContainerEl=t,this.intersectionObserver?.disconnect(),t&&(this.intersectionObserver=g("intersection",()=>this.updateScrollingState(),{root:t,threshold:[0,.5,1]}))}updateScrollingState(){let t=this.tabTitleContainerEl;if(!t)return;let e,i,l=t.scrollLeft,a=t.clientWidth,s=t.scrollWidth;this.effectiveDir==="ltr"?(e=l>0,i=l+a<s):(e=l<0,i=l!==-(s-a)),this.hasOverflowingStartTabTitle=e,this.hasOverflowingEndTabTitle=i}scrollToTabTitles(t){requestAnimationFrame(()=>{let e=this.tabTitleContainerEl;if(!e)return;let i=e.getBoundingClientRect(),l=Array.from(this.el.querySelectorAll("calcite-tab-title")),{effectiveDir:a}=this;t==="forward"&&l.reverse();let s=null;l.forEach(o=>{let r=o.getBoundingClientRect(),f=i.x+i.width,d=r.x+r.width;t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?(r.x>f||d>f&&r.x>i.x)&&(s=o):(d<i.x||r.x<i.x&&d>i.x)&&(s=o)});let n;if(s){let o=2*this.scrollerButtonWidth,r=t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?-o:s.offsetWidth-(e.clientWidth+o);n=s.offsetLeft+r}else{let o=e.scrollLeft,r=i.width,d=e.scrollWidth-(r+Math.abs(o));d>0&&(n=o+(a==="ltr"?1:-1)*d)}e.scrollTo({left:n,behavior:"smooth"})})}scrollToNextTabTitles(){this.scrollToTabTitles("forward")}scrollToPreviousTabTitles(){this.scrollToTabTitles("backward")}handleTabFocus(t,e,i){let l=O(this.enabledTabTitles,e,i);this.scrollTabTitleIntoView(l,"instant"),t.stopPropagation()}getIndexOfTabTitle(t,e=this.tabTitles){return e.indexOf(t)}onTabTitleScroll(){this.updateScrollingState()}async getTabTitleById(t){return Promise.all(this.tabTitles.map(e=>e.getTabIdentifier())).then(e=>this.tabTitles[e.indexOf(t)])}getVisibleTabTitlesIndices(t){return t.reduce((e,i,l)=>i.closed?e:[...e,l],[])}handleTabTitleClose(t){let{tabTitles:e}=this,i=t.selected,l=this.getVisibleTabTitlesIndices(e),a=l.length;if(a===1&&e[l[0]].closable)this.makeFirstVisibleTabClosable=!0,e[l[0]].closable=!1,this.selectedTabId=l[0],i&&e[l[0]].activateTab();else if(a>1){let s=e.findIndex(o=>o===t),n=l.find(o=>o>s);this.selectedTabId===s&&(this.selectedTabId=n||a-1,e[this.selectedTabId].activateTab())}requestAnimationFrame(()=>{B(e[this.selectedTabId])})}render(){return this.el.role="tablist",u`<div class=${b({[c.container]:!0,[c.scale(this.scale)]:!0,[c.position(this.position)]:!0,[x.rtl]:this.effectiveDir==="rtl"})}><div class=${b({[c.tabTitleSlotWrapper]:!0})} @scroll=${this.onTabTitleScroll} @wheel=${this.onTabTitleWheel} ${w(this.setTabTitleContainerEl)}><slot @slotchange=${this.onSlotChange}></slot></div><div class=${b(c.scrollButtonContainer)} .hidden=${!this.hasOverflowingEndTabTitle&&!this.hasOverflowingStartTabTitle}>${this.renderScrollButton("start")}${this.renderScrollButton("end")}</div></div>`}renderScrollButton(t){let{messages:e,scale:i,hasOverflowingEndTabTitle:l,hasOverflowingStartTabTitle:a}=this,s=t==="end";return y(t,u`<div class=${b({[c.scrollButton]:!0,[c.scrollBackwardButton]:!s,[c.scrollForwardButton]:s})}><calcite-button .ariaLabel=${s?e.nextTabTitles:e.previousTabTitles} .disabled=${s?!l:!a} icon-flip-rtl=both .iconStart=${s?$.chevronRight:$.chevronLeft} kind=neutral @click=${s?this.scrollToNextTabTitles:this.scrollToPreviousTabTitles} .scale=${i} tabindex=-1></calcite-button></div>`)}};S("calcite-tab-nav",v);export{v as TabNav};
2
+ import{a as W,b as F,c as z}from"./Y2OS6UOH.js";import{a as y}from"./BMJZRWPQ.js";import{a as g}from"./ENDXE7YY.js";import{a as E}from"./EJUBVZVG.js";import{e as k}from"./OGYP4PT3.js";import"./KEGLBRYW.js";import{l as B,n as p,y as O}from"./F4YFAW3E.js";import"./OAOQ5BXS.js";import{F as w,G as C,H as b,M as x,S,g as I,h as u,p as T}from"./KIVCCNSA.js";var $={chevronRight:"chevron-right",chevronLeft:"chevron-left"},c={container:"container",scrollButton:"scroll-button",scrollButtonContainer:"scroll-button-container",scrollBackwardButton:"scroll-button--backward",scrollForwardButton:"scroll-button--forward",tabTitleSlotWrapper:"tab-titles-slot-wrapper",scale:h=>`scale-${h}`,position:h=>`position-${h}`},V=I`:host{position:relative;display:flex}:host([bordered]) .scroll-button--forward calcite-button{--calcite-internal-button-border-inline-end-color: var(--calcite-tab-border-color, var(--calcite-color-border-1))}:host([bordered]) .scroll-button--backward calcite-button{--calcite-internal-button-border-inline-start-color: var( --calcite-tab-border-color, var(--calcite-color-border-1) )}.scale-s{--calcite-internal-tab-nav-button-width: 24px;min-block-size:1.5rem}.scale-m{--calcite-internal-tab-nav-button-width: 32px;min-block-size:2rem}.scale-l{--calcite-internal-tab-nav-button-width: 44px;min-block-size:2.75rem}.container::-webkit-scrollbar{display:none;-ms-overflow-style:none;scrollbar-width:none}:host([layout=center]) ::slotted(calcite-tab-title){display:flex;flex-grow:1;flex-shrink:0;min-inline-size:auto;white-space:nowrap}:host([layout=center]) ::slotted(calcite-tab-title[selected]){overflow:unset}:host(:not([bordered])) .scale-l{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xxl)}:host(:not([bordered])) .scale-m{--calcite-internal-tab-nav-gap: var(--calcite-spacing-xl)}:host(:not([bordered])) .scale-s{--calcite-internal-tab-nav-gap: var(--calcite-spacing-lg)}:host(:not([bordered])) .tab-titles-slot-wrapper{gap:var(--calcite-internal-tab-nav-gap)}:host([layout=center]:not([bordered])) .tab-titles-slot-wrapper{padding-inline:var(--calcite-spacing-xl)}.tab-titles-slot-wrapper{flex:1 1 0%}.container,.tab-titles-slot-wrapper{display:flex;inline-size:100%;justify-content:flex-start;overflow:hidden;white-space:nowrap}.scroll-button{position:absolute;inset-block:0px}.scroll-button calcite-button{--calcite-button-text-color: var(--calcite-tab-text-color, var(--calcite-color-text-3));--calcite-button-background-color: var(--calcite-color-transparent);--calcite-offset-invert-focus: 1;block-size:var(--calcite-container-size-content-fluid)}.scroll-button-container{display:flex;inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);inset-inline-end:0;inline-size:calc(2 * var(--calcite-internal-tab-nav-button-width))}.scroll-button--forward{inset-inline-end:0;z-index:var(--calcite-z-index)}.scroll-button--backward{inset-inline-end:var(--calcite-internal-tab-nav-button-width);z-index:var(--calcite-z-index)}:host(:not([bordered])) .scroll-button--backward:before{background-color:var(--calcite-tab-border-color, var(--calcite-color-border-3));content:"";inline-size:var(--calcite-border-width-sm);inset-block-start:var(--calcite-border-width-md);inset-block-end:var(--calcite-border-width-md);position:absolute;inset-inline-start:0}:host([hidden]){display:none}[hidden]{display:none}`,v=class extends C{constructor(){super(),this.direction=k(),this.effectiveDir="ltr",this.lastScrollWheelAxis="x",this.resizeObserver=g("resize",()=>{this.updateScrollingState()}),this.makeFirstVisibleTabClosable=!1,this.messages=E(),this.hasOverflowingEndTabTitle=!1,this.hasOverflowingStartTabTitle=!1,this.bordered=!1,this.layout="inline",this.position="bottom",this.scale="m",this.selectedTitle=null,this.calciteInternalTabChange=T({cancelable:!1}),this.calciteInternalTabNavSlotChange=T(),this.calciteTabChange=T({cancelable:!1}),this.listen("calciteInternalTabsFocusPrevious",this.focusPreviousTabHandler),this.listen("calciteInternalTabsFocusNext",this.focusNextTabHandler),this.listen("calciteInternalTabsFocusFirst",this.focusFirstTabHandler),this.listen("calciteInternalTabsFocusLast",this.focusLastTabHandler),this.listen("calciteInternalTabsActivate",this.internalActivateTabHandler),this.listen("calciteInternalTabsClose",this.internalCloseTabHandler),this.listen("calciteInternalTabTitleRegister",this.updateTabTitles),this.listenOn(document.body,"calciteInternalTabChange",this.globalInternalTabChangeHandler)}static{this.properties={hasOverflowingEndTabTitle:[16,{},{state:!0}],hasOverflowingStartTabTitle:[16,{},{state:!0}],selectedTabId:[16,{},{state:!0}],bordered:[7,{},{reflect:!0,type:Boolean}],layout:[3,{},{reflect:!0}],messageOverrides:[0,{},{attribute:!1}],position:1,scale:1,selectedTitle:[0,{},{attribute:!1}],storageId:[3,{},{reflect:!0}],syncId:[3,{},{reflect:!0}]}}static{this.styles=V}connectedCallback(){super.connectedCallback(),this.parentTabsEl=this.el.closest("calcite-tabs"),this.resizeObserver?.observe(this.el)}async load(){let t=`calcite-tab-nav-${this.storageId}`;if(localStorage&&this.storageId&&localStorage.getItem(t)){let e=JSON.parse(localStorage.getItem(t));this.selectedTabId=e}}willUpdate(t){t.has("selectedTitle")&&(this.hasUpdated||this.selectedTitle!==null)&&this.calciteInternalTabChange.emit({tab:this.selectedTabId}),t.has("selectedTabId")&&this.selectedTabIdChanged();let{parentTabsEl:e}=this;this.layout=e?.layout,this.bordered=e?.bordered,this.effectiveDir=this.direction}loaded(){this.scrollTabTitleIntoView(this.selectedTitle,"instant"),this.tabTitles.length&&this.tabTitles.every(t=>!t.selected)&&!this.selectedTabId&&this.tabTitles[0].getTabIdentifier().then(t=>{this.calciteInternalTabChange.emit({tab:t})})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}get enabledTabTitles(){return p(this.el,"calcite-tab-title:not([disabled])").filter(t=>!t.closed)}get scrollerButtonWidth(){let{scale:t}=this;return parseInt(t==="s"?W:t==="m"?F:z)}get tabTitles(){return p(this.el,"calcite-tab-title")}focusPreviousTabHandler(t){this.handleTabFocus(t,t.target,"previous")}focusNextTabHandler(t){this.handleTabFocus(t,t.target,"next")}focusFirstTabHandler(t){this.handleTabFocus(t,t.target,"first")}focusLastTabHandler(t){this.handleTabFocus(t,t.target,"last")}internalActivateTabHandler(t){let e=t.target,i=this.selectedTitle;this.selectedTabId=t.detail.tab?t.detail.tab:this.getIndexOfTabTitle(e),t.stopPropagation(),this.selectedTitle=e,i?.id!==e.id&&t.detail.userTriggered&&this.calciteTabChange.emit(),this.scrollTabTitleIntoView(e)}scrollTabTitleIntoView(t,e="smooth"){t&&requestAnimationFrame(()=>{let i=this.tabTitleContainerEl;if(!i)return;let l=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=i.scrollLeft;if(a.left<l.left){let n=s+(a.left-l.left);i.scrollTo({left:n,behavior:e})}else if(a.right>l.right){let n=s+(a.right-l.right);i.scrollTo({left:n,behavior:e})}})}internalCloseTabHandler(t){let e=t.target;this.handleTabTitleClose(e),t.stopPropagation()}async updateTabTitles(t){t.target.selected&&(this.selectedTabId=t.detail,this.selectedTitle=await this.getTabTitleById(this.selectedTabId))}globalInternalTabChangeHandler(t){this.syncId&&t.target!==this.el&&t.target.syncId===this.syncId&&this.selectedTabId!==t.detail.tab&&(this.selectedTabId=t.detail.tab),t.stopPropagation()}async selectedTabIdChanged(){await this.componentOnReady(),localStorage&&this.storageId&&this.selectedTabId!==void 0&&this.selectedTabId!==null&&localStorage.setItem(`calcite-tab-nav-${this.storageId}`,JSON.stringify(this.selectedTabId)),this.calciteInternalTabChange.emit({tab:this.selectedTabId})}onTabTitleWheel(t){t.preventDefault();let{deltaX:e,deltaY:i}=t,l=Math.abs(e),a=Math.abs(i),s;l===a?s=this.lastScrollWheelAxis==="x"?e:i:l>a?(s=e,this.lastScrollWheelAxis="x"):(s=i,this.lastScrollWheelAxis="y");let n=(this.effectiveDir==="rtl"?-1:1)*s;t.currentTarget.scrollBy(n,0)}onSlotChange(){this.intersectionObserver?.disconnect();let t=this.tabTitles;t.forEach(l=>{this.intersectionObserver?.observe(l)});let e=this.getVisibleTabTitlesIndices(t);e.length>1&&this.makeFirstVisibleTabClosable&&(t[e[0]].closable=!0,this.makeFirstVisibleTabClosable=!1),this.calciteInternalTabNavSlotChange.emit(t)}setTabTitleContainerEl(t){this.tabTitleContainerEl=t,this.intersectionObserver?.disconnect(),t&&(this.intersectionObserver=g("intersection",()=>this.updateScrollingState(),{root:t,threshold:[0,.5,1]}))}updateScrollingState(){let t=this.tabTitleContainerEl;if(!t)return;let e,i,l=t.scrollLeft,a=t.clientWidth,s=t.scrollWidth;this.effectiveDir==="ltr"?(e=l>0,i=l+a<s):(e=l<0,i=l!==-(s-a)),this.hasOverflowingStartTabTitle=e,this.hasOverflowingEndTabTitle=i}scrollToTabTitles(t){requestAnimationFrame(()=>{let e=this.tabTitleContainerEl;if(!e)return;let i=e.getBoundingClientRect(),l=Array.from(this.el.querySelectorAll("calcite-tab-title")),{effectiveDir:a}=this;t==="forward"&&l.reverse();let s=null;l.forEach(o=>{let r=o.getBoundingClientRect(),f=i.x+i.width,d=r.x+r.width;t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?(r.x>f||d>f&&r.x>i.x)&&(s=o):(d<i.x||r.x<i.x&&d>i.x)&&(s=o)});let n;if(s){let o=2*this.scrollerButtonWidth,r=t==="forward"&&a==="ltr"||t==="backward"&&a==="rtl"?-o:s.offsetWidth-(e.clientWidth+o);n=s.offsetLeft+r}else{let o=e.scrollLeft,r=i.width,d=e.scrollWidth-(r+Math.abs(o));d>0&&(n=o+(a==="ltr"?1:-1)*d)}e.scrollTo({left:n,behavior:"smooth"})})}scrollToNextTabTitles(){this.scrollToTabTitles("forward")}scrollToPreviousTabTitles(){this.scrollToTabTitles("backward")}handleTabFocus(t,e,i){let l=O(this.enabledTabTitles,e,i);this.scrollTabTitleIntoView(l,"instant"),t.stopPropagation()}getIndexOfTabTitle(t,e=this.tabTitles){return e.indexOf(t)}onTabTitleScroll(){this.updateScrollingState()}async getTabTitleById(t){return Promise.all(this.tabTitles.map(e=>e.getTabIdentifier())).then(e=>this.tabTitles[e.indexOf(t)])}getVisibleTabTitlesIndices(t){return t.reduce((e,i,l)=>i.closed?e:[...e,l],[])}handleTabTitleClose(t){let{tabTitles:e}=this,i=t.selected,l=this.getVisibleTabTitlesIndices(e),a=l.length;if(a===1&&e[l[0]].closable)this.makeFirstVisibleTabClosable=!0,e[l[0]].closable=!1,this.selectedTabId=l[0],i&&e[l[0]].activateTab();else if(a>1){let s=e.findIndex(o=>o===t),n=l.find(o=>o>s);this.selectedTabId===s&&(this.selectedTabId=n||a-1,e[this.selectedTabId].activateTab())}requestAnimationFrame(()=>{B(e[this.selectedTabId])})}render(){return this.el.role="tablist",u`<div class=${b({[c.container]:!0,[c.scale(this.scale)]:!0,[c.position(this.position)]:!0,[x.rtl]:this.effectiveDir==="rtl"})}><div class=${b({[c.tabTitleSlotWrapper]:!0})} @scroll=${this.onTabTitleScroll} @wheel=${this.onTabTitleWheel} ${w(this.setTabTitleContainerEl)}><slot @slotchange=${this.onSlotChange}></slot></div><div class=${b(c.scrollButtonContainer)} .hidden=${!this.hasOverflowingEndTabTitle&&!this.hasOverflowingStartTabTitle}>${this.renderScrollButton("start")}${this.renderScrollButton("end")}</div></div>`}renderScrollButton(t){let{messages:e,scale:i,hasOverflowingEndTabTitle:l,hasOverflowingStartTabTitle:a}=this,s=t==="end";return y(t,u`<div class=${b({[c.scrollButton]:!0,[c.scrollBackwardButton]:!s,[c.scrollForwardButton]:s})}><calcite-button .ariaLabel=${s?e.nextTabTitles:e.previousTabTitles} .disabled=${s?!l:!a} icon-flip-rtl=both .iconStart=${s?$.chevronRight:$.chevronLeft} kind=neutral @click=${s?this.scrollToNextTabTitles:this.scrollToPreviousTabTitles} .scale=${i} tabindex=-1></calcite-button></div>`)}};S("calcite-tab-nav",v);export{v as TabNav};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{g as o}from"./KC5YLSJL.js";var r=o`:host(.calcite-sortable--chosen),:host(.calcite-sortable--drag),:host(.calcite-sortable--fallback),:host(.calcite-sortable--ghost){position:relative;overflow:hidden}:host(.calcite-sortable--ghost):before{content:"";position:absolute;inset-block:0px;inset-inline-start:0px;inset-inline-end:0px;z-index:var(--calcite-z-index);box-sizing:border-box;border-width:1px;border-style:dashed;border-color:var(--calcite-color-brand);background-color:var(--calcite-color-foreground-2)}:host(.calcite-sortable--drag){--tw-shadow: 0 6px 20px -4px rgba(0, 0, 0, .1), 0 4px 12px -2px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}`;export{r as a};
2
+ import{g as o}from"./KIVCCNSA.js";var r=o`:host(.calcite-sortable--chosen),:host(.calcite-sortable--drag),:host(.calcite-sortable--fallback),:host(.calcite-sortable--ghost){position:relative;overflow:hidden}:host(.calcite-sortable--ghost):before{content:"";position:absolute;inset-block:0px;inset-inline-start:0px;inset-inline-end:0px;z-index:var(--calcite-z-index);box-sizing:border-box;border-width:1px;border-style:dashed;border-color:var(--calcite-color-brand);background-color:var(--calcite-color-foreground-2)}:host(.calcite-sortable--drag){--tw-shadow: 0 6px 20px -4px rgba(0, 0, 0, .1), 0 4px 12px -2px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}`;export{r as a};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as p}from"./ELFVWG7H.js";import{j as b}from"./WSQ4PXI6.js";import"./CUJ2U3RS.js";import{a as d}from"./FOCO4B2I.js";import"./YGX7CUXN.js";import{a as E}from"./ENDXE7YY.js";import{a as L}from"./64SYBTWP.js";import{a as X}from"./ZGQKLZNW.js";import{a as u}from"./WGGFNK4Z.js";import"./R4MIPDZD.js";import"./LZO5WQFT.js";import"./JTFWEILS.js";import"./OAOQ5BXS.js";import{G as P,H as r,S as w,g as $,h,l as y,p as C}from"./KC5YLSJL.js";var s={list:"list",listItem:"list-item",hiddenItem:"hidden-item",page:"page",selected:"selected",chevron:"chevron",disabled:"disabled",ellipsis:"ellipsis"},f={next:"chevron-right",previous:"chevron-left",first:"chevron-start",last:"chevron-end"},O=$`:host{display:flex;writing-mode:horizontal-tb}.list{margin:0;display:flex;list-style-type:none;padding:0;column-gap:var(--calcite-spacing-base)}.list-item{margin:0;display:flex;padding:0}.hidden-item{display:none}:host([scale=s]) .chevron,:host([scale=s]) .page,:host([scale=s]) .ellipsis{block-size:1.5rem;padding-inline:.25rem;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);min-inline-size:1.5rem}:host([scale=m]) .chevron,:host([scale=m]) .page,:host([scale=m]) .ellipsis{block-size:2rem;padding-inline:.5rem;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);min-inline-size:2rem}:host([scale=l]) .chevron,:host([scale=l]) .page,:host([scale=l]) .ellipsis{block-size:2.75rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);min-inline-size:2.75rem}:host([scale=l]) .chevron{padding-inline:var(--calcite-space-sm-plus)}:host([scale=l]) .page,:host([scale=l]) .ellipsis{padding-inline:.75rem}:host button{outline-color:transparent}:host button:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.chevron,.page,.ellipsis{margin:0;box-sizing:border-box;display:flex;align-items:center;justify-content:center;border-style:none;--tw-border-opacity: 0;background-color:transparent;padding:0;vertical-align:baseline;font-family:inherit;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);color:var(--calcite-pagination-color, var(--calcite-color-text-3))}.chevron,.page{cursor:pointer;border-block:2px solid transparent}.chevron:hover,.page:hover{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1))}.chevron:active,.page:active{color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1))}.page:hover{border-block-end-color:var(--calcite-pagination-color-border-hover, var(--calcite-color-border-2))}.page:active{background-color:var(--calcite-pagination-background-color, var(--calcite-color-foreground-3))}.page.selected{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1));border-block-end-color:var(--calcite-pagination-color-border-active, var(--calcite-color-brand))}.page.selected:focus{border-block-end-width:var(--calcite-spacing-xxs);padding-block-start:var(--calcite-spacing-base)}.chevron:hover{background-color:var(--calcite-pagination-icon-color-background-hover, var(--calcite-color-foreground-2))}.chevron:active{background-color:var(--calcite-pagination-background-color, var(--calcite-color-foreground-3))}.chevron.disabled{pointer-events:none;background-color:transparent}.chevron.disabled>calcite-icon{opacity:var(--calcite-opacity-disabled)}:host([hidden]){display:none}[hidden]{display:none}`,I=2,M=2,m={large:11,medium:9,small:7,xsmall:5,xxsmall:1},x=class extends P{constructor(){super(...arguments),this.resizeHandler=({contentRect:{width:t}})=>this.setMaxItemsToBreakpoint(t),this.resizeObserver=E("resize",t=>t.forEach(this.resizeHandler)),this.messages=L(),this.focusSetter=X()(this),this.maxItems=m.xxsmall,this.groupSeparator=!1,this.pageSize=20,this.scale="m",this.startItem=1,this.totalItems=0,this.calcitePaginationChange=C({cancelable:!1})}static{this.properties={isXXSmall:[16,{},{state:!0}],lastStartItem:[16,{},{state:!0}],maxItems:[16,{},{state:!0}],totalPages:[16,{},{state:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],numberingSystem:1,pageSize:[11,{},{reflect:!0,type:Number}],scale:[3,{},{reflect:!0}],startItem:[11,{},{reflect:!0,type:Number}],totalItems:[11,{},{reflect:!0,type:Number}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=O}async goTo(t){switch(t){case"start":this.startItem=1;break;case"end":this.startItem=this.lastStartItem;break;default:t>=Math.ceil(this.totalPages)?this.startItem=this.lastStartItem:t<=0?this.startItem=1:this.startItem=(t-1)*this.pageSize+1}}async nextPage(){this.startItem=Math.min(this.lastStartItem,this.startItem+this.pageSize)}async previousPage(){this.startItem=Math.max(1,this.startItem-this.pageSize)}async setFocus(t){return this.focusSetter(()=>this.el,t)}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}async load(){this.handleTotalPages(),this.handleLastStartItemChange(),this.handleIsXXSmall()}willUpdate(t){(t.has("totalItems")&&(this.hasUpdated||this.totalItems!==0)||t.has("pageSize")&&(this.hasUpdated||this.pageSize!==20))&&this.handleTotalPages(),(t.has("totalItems")&&(this.hasUpdated||this.totalItems!==0)||t.has("pageSize")&&(this.hasUpdated||this.pageSize!==20)||t.has("totalPages"))&&this.handleLastStartItemChange(),t.has("maxItems")&&(this.hasUpdated||this.maxItems!==m.xxsmall)&&this.handleIsXXSmall(),t.has("messages")&&this.effectiveLocaleChange()}loaded(){this.setMaxItemsToBreakpoint(this.el.clientWidth)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}handleTotalPages(){this.pageSize=Math.max(1,this.pageSize),this.totalPages=Math.max(1,this.totalItems/this.pageSize)}effectiveLocaleChange(){b.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator}}handleLastStartItemChange(){let{totalItems:t,pageSize:e}=this;this.lastStartItem=Math.max(1,Math.floor((t-1)/e)*e+1)}handleIsXXSmall(){this.isXXSmall=this.maxItems===m.xxsmall}setMaxItemsToBreakpoint(t){if(!(!p||!t)){if(t>=p.width.medium){this.maxItems=m.large;return}if(t>=p.width.small){this.maxItems=m.medium;return}if(t>=p.width.xsmall){this.maxItems=m.small;return}if(t>=p.width.xxsmall){this.maxItems=m.xsmall;return}this.maxItems=m.xxsmall}}firstClicked(){this.startItem=1,this.emitUpdate()}lastClicked(){this.startItem=this.lastStartItem,this.emitUpdate()}async previousClicked(){await this.previousPage(),this.emitUpdate()}async nextClicked(){await this.nextPage(),this.emitUpdate()}showStartEllipsis(){return this.totalPages>this.maxItems&&Math.floor(this.startItem/this.pageSize)>this.maxItems-I-M}showEndEllipsis(){return this.totalPages>this.maxItems&&(this.totalItems-this.startItem)/this.pageSize>this.maxItems-I-(M-1)}emitUpdate(){this.calcitePaginationChange.emit()}handlePageClick(t){let e=t.target;this.startItem=parseInt(e.value),this.emitUpdate()}renderEllipsis(t){return d(t,h`<span class=${r(s.ellipsis)}>&hellip;</span>`)}renderItems(){let{totalItems:t,pageSize:e,startItem:i,maxItems:a,totalPages:l,lastStartItem:v,isXXSmall:U}=this,o=[];if(U)return o.push(this.renderPage(i)),o;let F=t>e,S=this.showStartEllipsis(),k=this.showEndEllipsis();F&&o.push(this.renderPage(1)),S&&o.push(this.renderEllipsis("start"));let n=a-I-(k?1:0)-(S?1:0),g,c;l-1<=n?(c=1+e,g=v-e):i/e<n?(c=1+e,g=1+n*e):i+n*e>=t?(c=v-n*e,g=v-e):(c=i-e*((n-1)/2),g=i+e*((n-1)/2));for(let z=0;z<n&&c<=g;z++)o.push(this.renderPage(c)),c=c+e;return k&&o.push(this.renderEllipsis("end")),o.push(this.renderPage(v)),o}renderPage(t){let{pageSize:e}=this,i=Math.floor(t/e)+(e===1?0:1);b.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};let a=b.localize(i.toString()),l=t===this.startItem;return h`<li class=${r(s.listItem)}><button .ariaCurrent=${l?"page":"false"} class=${r({[s.page]:!0,[s.selected]:l})} @click=${this.handlePageClick} value=${t??y}>${a}</button></li>`}renderPreviousChevron(){let{pageSize:t,startItem:e,messages:i}=this,a=t===1?e<=t:e<t;return d("previous",h`<button .ariaLabel=${i.previous} class=${r({[s.chevron]:!0,[s.disabled]:a})} .disabled=${a} @click=${this.previousClicked}><calcite-icon flip-rtl .icon=${f.previous} .scale=${u(this.scale)}></calcite-icon></button>`)}renderNextChevron(){let{totalItems:t,pageSize:e,startItem:i,messages:a}=this,l=i+e>t;return d("next-button",h`<button .ariaLabel=${a.next} class=${r({[s.chevron]:!0,[s.disabled]:l})} .disabled=${l} @click=${this.nextClicked}><calcite-icon flip-rtl .icon=${f.next} .scale=${u(this.scale)}></calcite-icon></button>`)}renderFirstChevron(){let{messages:t,startItem:e,isXXSmall:i}=this,a=e===1;return i?d("first-button",h`<button .ariaLabel=${t.first} class=${r({[s.chevron]:!0,[s.disabled]:a})} .disabled=${a} @click=${this.firstClicked}><calcite-icon flip-rtl .icon=${f.first} .scale=${u(this.scale)}></calcite-icon></button>`):null}renderLastChevron(){let{messages:t,startItem:e,isXXSmall:i,lastStartItem:a}=this,l=e===a;return i?d("last-button",h`<button .ariaLabel=${t.last} class=${r({[s.chevron]:!0,[s.disabled]:l})} .disabled=${l} @click=${this.lastClicked}><calcite-icon flip-rtl .icon=${f.last} .scale=${u(this.scale)}></calcite-icon></button>`):null}render(){let t=this.renderFirstChevron(),e=this.renderLastChevron();return h`<ul class=${r(s.list)}><li class=${r({[s.listItem]:!0,[s.hiddenItem]:!t})}>${t}</li><li class=${r(s.listItem)}>${this.renderPreviousChevron()}</li>${this.renderItems()}<li class=${r(s.listItem)}>${this.renderNextChevron()}</li><li class=${r({[s.listItem]:!0,[s.hiddenItem]:!e})}>${e}</li></ul>`}};w("calcite-pagination",x);export{x as Pagination};
2
+ import{a as p}from"./ELFVWG7H.js";import{j as b}from"./Z7XEAFTW.js";import"./CUJ2U3RS.js";import{a as d}from"./BMJZRWPQ.js";import"./YGX7CUXN.js";import{a as E}from"./ENDXE7YY.js";import{a as L}from"./EJUBVZVG.js";import{a as X}from"./YGSUEQMS.js";import{a as u}from"./WGGFNK4Z.js";import"./OGYP4PT3.js";import"./KEGLBRYW.js";import"./F4YFAW3E.js";import"./OAOQ5BXS.js";import{G as P,H as r,S as w,g as $,h,l as y,p as C}from"./KIVCCNSA.js";var s={list:"list",listItem:"list-item",hiddenItem:"hidden-item",page:"page",selected:"selected",chevron:"chevron",disabled:"disabled",ellipsis:"ellipsis"},f={next:"chevron-right",previous:"chevron-left",first:"chevron-start",last:"chevron-end"},O=$`:host{display:flex;writing-mode:horizontal-tb}.list{margin:0;display:flex;list-style-type:none;padding:0;column-gap:var(--calcite-spacing-base)}.list-item{margin:0;display:flex;padding:0}.hidden-item{display:none}:host([scale=s]) .chevron,:host([scale=s]) .page,:host([scale=s]) .ellipsis{block-size:1.5rem;padding-inline:.25rem;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);min-inline-size:1.5rem}:host([scale=m]) .chevron,:host([scale=m]) .page,:host([scale=m]) .ellipsis{block-size:2rem;padding-inline:.5rem;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);min-inline-size:2rem}:host([scale=l]) .chevron,:host([scale=l]) .page,:host([scale=l]) .ellipsis{block-size:2.75rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);min-inline-size:2.75rem}:host([scale=l]) .chevron{padding-inline:var(--calcite-space-sm-plus)}:host([scale=l]) .page,:host([scale=l]) .ellipsis{padding-inline:.75rem}:host button{outline-color:transparent}:host button:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.chevron,.page,.ellipsis{margin:0;box-sizing:border-box;display:flex;align-items:center;justify-content:center;border-style:none;--tw-border-opacity: 0;background-color:transparent;padding:0;vertical-align:baseline;font-family:inherit;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);color:var(--calcite-pagination-color, var(--calcite-color-text-3))}.chevron,.page{cursor:pointer;border-block:2px solid transparent}.chevron:hover,.page:hover{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1))}.chevron:active,.page:active{color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1))}.page:hover{border-block-end-color:var(--calcite-pagination-color-border-hover, var(--calcite-color-border-2))}.page:active{background-color:var(--calcite-pagination-background-color, var(--calcite-color-foreground-3))}.page.selected{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1));border-block-end-color:var(--calcite-pagination-color-border-active, var(--calcite-color-brand))}.page.selected:focus{border-block-end-width:var(--calcite-spacing-xxs);padding-block-start:var(--calcite-spacing-base)}.chevron:hover{background-color:var(--calcite-pagination-icon-color-background-hover, var(--calcite-color-foreground-2))}.chevron:active{background-color:var(--calcite-pagination-background-color, var(--calcite-color-foreground-3))}.chevron.disabled{pointer-events:none;background-color:transparent}.chevron.disabled>calcite-icon{opacity:var(--calcite-opacity-disabled)}:host([hidden]){display:none}[hidden]{display:none}`,I=2,M=2,m={large:11,medium:9,small:7,xsmall:5,xxsmall:1},x=class extends P{constructor(){super(...arguments),this.resizeHandler=({contentRect:{width:t}})=>this.setMaxItemsToBreakpoint(t),this.resizeObserver=E("resize",t=>t.forEach(this.resizeHandler)),this.messages=L(),this.focusSetter=X()(this),this.maxItems=m.xxsmall,this.groupSeparator=!1,this.pageSize=20,this.scale="m",this.startItem=1,this.totalItems=0,this.calcitePaginationChange=C({cancelable:!1})}static{this.properties={isXXSmall:[16,{},{state:!0}],lastStartItem:[16,{},{state:!0}],maxItems:[16,{},{state:!0}],totalPages:[16,{},{state:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],numberingSystem:1,pageSize:[11,{},{reflect:!0,type:Number}],scale:[3,{},{reflect:!0}],startItem:[11,{},{reflect:!0,type:Number}],totalItems:[11,{},{reflect:!0,type:Number}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=O}async goTo(t){switch(t){case"start":this.startItem=1;break;case"end":this.startItem=this.lastStartItem;break;default:t>=Math.ceil(this.totalPages)?this.startItem=this.lastStartItem:t<=0?this.startItem=1:this.startItem=(t-1)*this.pageSize+1}}async nextPage(){this.startItem=Math.min(this.lastStartItem,this.startItem+this.pageSize)}async previousPage(){this.startItem=Math.max(1,this.startItem-this.pageSize)}async setFocus(t){return this.focusSetter(()=>this.el,t)}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}async load(){this.handleTotalPages(),this.handleLastStartItemChange(),this.handleIsXXSmall()}willUpdate(t){(t.has("totalItems")&&(this.hasUpdated||this.totalItems!==0)||t.has("pageSize")&&(this.hasUpdated||this.pageSize!==20))&&this.handleTotalPages(),(t.has("totalItems")&&(this.hasUpdated||this.totalItems!==0)||t.has("pageSize")&&(this.hasUpdated||this.pageSize!==20)||t.has("totalPages"))&&this.handleLastStartItemChange(),t.has("maxItems")&&(this.hasUpdated||this.maxItems!==m.xxsmall)&&this.handleIsXXSmall(),t.has("messages")&&this.effectiveLocaleChange()}loaded(){this.setMaxItemsToBreakpoint(this.el.clientWidth)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}handleTotalPages(){this.pageSize=Math.max(1,this.pageSize),this.totalPages=Math.max(1,this.totalItems/this.pageSize)}effectiveLocaleChange(){b.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator}}handleLastStartItemChange(){let{totalItems:t,pageSize:e}=this;this.lastStartItem=Math.max(1,Math.floor((t-1)/e)*e+1)}handleIsXXSmall(){this.isXXSmall=this.maxItems===m.xxsmall}setMaxItemsToBreakpoint(t){if(!(!p||!t)){if(t>=p.width.medium){this.maxItems=m.large;return}if(t>=p.width.small){this.maxItems=m.medium;return}if(t>=p.width.xsmall){this.maxItems=m.small;return}if(t>=p.width.xxsmall){this.maxItems=m.xsmall;return}this.maxItems=m.xxsmall}}firstClicked(){this.startItem=1,this.emitUpdate()}lastClicked(){this.startItem=this.lastStartItem,this.emitUpdate()}async previousClicked(){await this.previousPage(),this.emitUpdate()}async nextClicked(){await this.nextPage(),this.emitUpdate()}showStartEllipsis(){return this.totalPages>this.maxItems&&Math.floor(this.startItem/this.pageSize)>this.maxItems-I-M}showEndEllipsis(){return this.totalPages>this.maxItems&&(this.totalItems-this.startItem)/this.pageSize>this.maxItems-I-(M-1)}emitUpdate(){this.calcitePaginationChange.emit()}handlePageClick(t){let e=t.target;this.startItem=parseInt(e.value),this.emitUpdate()}renderEllipsis(t){return d(t,h`<span class=${r(s.ellipsis)}>&hellip;</span>`)}renderItems(){let{totalItems:t,pageSize:e,startItem:i,maxItems:a,totalPages:l,lastStartItem:v,isXXSmall:U}=this,o=[];if(U)return o.push(this.renderPage(i)),o;let F=t>e,S=this.showStartEllipsis(),k=this.showEndEllipsis();F&&o.push(this.renderPage(1)),S&&o.push(this.renderEllipsis("start"));let n=a-I-(k?1:0)-(S?1:0),g,c;l-1<=n?(c=1+e,g=v-e):i/e<n?(c=1+e,g=1+n*e):i+n*e>=t?(c=v-n*e,g=v-e):(c=i-e*((n-1)/2),g=i+e*((n-1)/2));for(let z=0;z<n&&c<=g;z++)o.push(this.renderPage(c)),c=c+e;return k&&o.push(this.renderEllipsis("end")),o.push(this.renderPage(v)),o}renderPage(t){let{pageSize:e}=this,i=Math.floor(t/e)+(e===1?0:1);b.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};let a=b.localize(i.toString()),l=t===this.startItem;return h`<li class=${r(s.listItem)}><button .ariaCurrent=${l?"page":"false"} class=${r({[s.page]:!0,[s.selected]:l})} @click=${this.handlePageClick} value=${t??y}>${a}</button></li>`}renderPreviousChevron(){let{pageSize:t,startItem:e,messages:i}=this,a=t===1?e<=t:e<t;return d("previous",h`<button .ariaLabel=${i.previous} class=${r({[s.chevron]:!0,[s.disabled]:a})} .disabled=${a} @click=${this.previousClicked}><calcite-icon flip-rtl .icon=${f.previous} .scale=${u(this.scale)}></calcite-icon></button>`)}renderNextChevron(){let{totalItems:t,pageSize:e,startItem:i,messages:a}=this,l=i+e>t;return d("next-button",h`<button .ariaLabel=${a.next} class=${r({[s.chevron]:!0,[s.disabled]:l})} .disabled=${l} @click=${this.nextClicked}><calcite-icon flip-rtl .icon=${f.next} .scale=${u(this.scale)}></calcite-icon></button>`)}renderFirstChevron(){let{messages:t,startItem:e,isXXSmall:i}=this,a=e===1;return i?d("first-button",h`<button .ariaLabel=${t.first} class=${r({[s.chevron]:!0,[s.disabled]:a})} .disabled=${a} @click=${this.firstClicked}><calcite-icon flip-rtl .icon=${f.first} .scale=${u(this.scale)}></calcite-icon></button>`):null}renderLastChevron(){let{messages:t,startItem:e,isXXSmall:i,lastStartItem:a}=this,l=e===a;return i?d("last-button",h`<button .ariaLabel=${t.last} class=${r({[s.chevron]:!0,[s.disabled]:l})} .disabled=${l} @click=${this.lastClicked}><calcite-icon flip-rtl .icon=${f.last} .scale=${u(this.scale)}></calcite-icon></button>`):null}render(){let t=this.renderFirstChevron(),e=this.renderLastChevron();return h`<ul class=${r(s.list)}><li class=${r({[s.listItem]:!0,[s.hiddenItem]:!t})}>${t}</li><li class=${r(s.listItem)}>${this.renderPreviousChevron()}</li>${this.renderItems()}<li class=${r(s.listItem)}>${this.renderNextChevron()}</li><li class=${r({[s.listItem]:!0,[s.hiddenItem]:!e})}>${e}</li></ul>`}};w("calcite-pagination",x);export{x as Pagination};