@esri/calcite-components 5.2.0-next.74 → 5.2.0-next.75

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 (161) hide show
  1. package/dist/cdn/{DWW5PMJD.js → 2EVIVXPY.js} +1 -1
  2. package/dist/cdn/{GOTWZ25X.js → 2HNLPWAZ.js} +1 -1
  3. package/dist/cdn/{H4WXB64M.js → 2JON7V25.js} +1 -1
  4. package/dist/cdn/{IL33D4QU.js → 3ACOLSJX.js} +1 -1
  5. package/dist/cdn/{FRNLUR2Y.js → 3PDMOUMJ.js} +1 -1
  6. package/dist/cdn/{BA2BQEO5.js → 43HX7HK2.js} +1 -1
  7. package/dist/cdn/{CNCTYVCS.js → 4B4BJKV5.js} +1 -1
  8. package/dist/cdn/{H4B3NVIX.js → 4H6E3X4V.js} +1 -1
  9. package/dist/cdn/{5L7JJ2KU.js → 4Q2YPKWL.js} +1 -1
  10. package/dist/cdn/{2S3IMN3N.js → 4Z46HUN4.js} +1 -1
  11. package/dist/cdn/{YXLZYF22.js → 5CEAARGW.js} +1 -1
  12. package/dist/cdn/{GHMHWZWT.js → 5G3EOQAP.js} +1 -1
  13. package/dist/cdn/{LHH6X3FQ.js → 5M65CFLH.js} +1 -1
  14. package/dist/cdn/{GUI6HKBD.js → 5UMOVU64.js} +1 -1
  15. package/dist/cdn/{DDDQMJ2T.js → 6AWKEEOF.js} +1 -1
  16. package/dist/cdn/{BCJ3SNVI.js → 6FAJVSD4.js} +1 -1
  17. package/dist/cdn/{P5NISI5D.js → 6TXKNTJP.js} +1 -1
  18. package/dist/cdn/{QGS3ZXU3.js → 7SFPVGCD.js} +1 -1
  19. package/dist/cdn/{DRDW53GE.js → 7SSBLKFA.js} +1 -1
  20. package/dist/cdn/{62XFJ2TK.js → AEB4Z223.js} +1 -1
  21. package/dist/cdn/{GPTB6UFP.js → AEDC7G5P.js} +1 -1
  22. package/dist/cdn/{JEWSXZ45.js → AKJ5VALG.js} +1 -1
  23. package/dist/cdn/{4T3X6P5Q.js → AZ5ZWXXK.js} +1 -1
  24. package/dist/cdn/{MVOPPN4L.js → BKFLSVV4.js} +1 -1
  25. package/dist/cdn/{2DNBN6OP.js → BRUF7YDC.js} +1 -1
  26. package/dist/cdn/{GA5YV6AH.js → BX4EQI4L.js} +1 -1
  27. package/dist/cdn/{EXWFOSQQ.js → BZXAGXQF.js} +1 -1
  28. package/dist/cdn/{SVIZSNQN.js → CA2GGRFJ.js} +1 -1
  29. package/dist/cdn/{PQ7XQEBL.js → CIL7O6L3.js} +1 -1
  30. package/dist/cdn/{VCJMBJS4.js → CMB2V5X6.js} +1 -1
  31. package/dist/cdn/{R7ZTPARZ.js → CVTDVXWE.js} +1 -1
  32. package/dist/cdn/D7R7VXSW.js +2 -0
  33. package/dist/cdn/{2YD4FRGD.js → DGXBVQ2S.js} +1 -1
  34. package/dist/cdn/{NWFLKLKJ.js → DJSK2UFO.js} +1 -1
  35. package/dist/cdn/{UGMKFAHI.js → DOV6DBQM.js} +1 -1
  36. package/dist/cdn/{GZUPYOXJ.js → DXBCV4IS.js} +1 -1
  37. package/dist/cdn/{SHTPPQ5C.js → EF6OC5UR.js} +1 -1
  38. package/dist/cdn/{NHS2ZLE4.js → EFUMOZET.js} +1 -1
  39. package/dist/cdn/{5ZJYHYA3.js → ETFYJGST.js} +1 -1
  40. package/dist/cdn/{ZPJBEHMM.js → F5VR7FU6.js} +1 -1
  41. package/dist/cdn/{F5PZEOIW.js → FMIN4FXZ.js} +1 -1
  42. package/dist/cdn/{QPH5TUES.js → FOHVMKTS.js} +1 -1
  43. package/dist/cdn/{KFHRCNRP.js → FOMZG2UP.js} +1 -1
  44. package/dist/cdn/FWWS7ZQF.js +2 -0
  45. package/dist/cdn/{AISTEJ33.js → G64R54P5.js} +1 -1
  46. package/dist/cdn/{5H5WEST3.js → GBUMWAMI.js} +1 -1
  47. package/dist/cdn/{CHKW2BI3.js → GSCAQKUF.js} +1 -1
  48. package/dist/cdn/{F2OABFYE.js → GWODLNHO.js} +1 -1
  49. package/dist/cdn/{ZP3NIWHB.js → GXDN4MYU.js} +1 -1
  50. package/dist/cdn/{XCCJTYUC.js → HC7XTIHJ.js} +1 -1
  51. package/dist/cdn/{BMJANNS5.js → HICNQGNG.js} +1 -1
  52. package/dist/cdn/{P3OE6TQX.js → HVC2AYWQ.js} +1 -1
  53. package/dist/cdn/HX2PSDYI.js +2 -0
  54. package/dist/cdn/{5ILPV32R.js → I55LFKXN.js} +1 -1
  55. package/dist/cdn/{MTF3JNFW.js → I5K6EDCU.js} +1 -1
  56. package/dist/cdn/{5S26MQSY.js → I77BH2GV.js} +1 -1
  57. package/dist/cdn/{Y5KUWUOC.js → IBYTB33B.js} +1 -1
  58. package/dist/cdn/{VXMPWVJD.js → IGSMC35J.js} +1 -1
  59. package/dist/cdn/{XGVWY4HO.js → IQUNIZ2X.js} +1 -1
  60. package/dist/cdn/{3WBSERNO.js → ISN5KGTB.js} +1 -1
  61. package/dist/cdn/IU7DS3DV.js +2 -0
  62. package/dist/cdn/{36PA4H5Z.js → IWWJYWY5.js} +1 -1
  63. package/dist/cdn/{RQIS4D33.js → IZ3W6AJK.js} +1 -1
  64. package/dist/cdn/{VOTT45GP.js → J3BY5AI6.js} +1 -1
  65. package/dist/cdn/{LNPJKUQY.js → JBE7YDVT.js} +1 -1
  66. package/dist/cdn/{N4CFYV56.js → JBJEESIK.js} +1 -1
  67. package/dist/cdn/{JBDE5TI2.js → JIHLETWF.js} +1 -1
  68. package/dist/cdn/{RJUOXY72.js → JVYBHUAO.js} +1 -1
  69. package/dist/cdn/{G7WSKLO4.js → JXLVLVWY.js} +1 -1
  70. package/dist/cdn/{KHHDNGH6.js → KQAR33SR.js} +1 -1
  71. package/dist/cdn/KXJ7DTCZ.js +2 -0
  72. package/dist/cdn/{PLXVML3K.js → KYIA6VGH.js} +1 -1
  73. package/dist/cdn/{WAWC4FWJ.js → LJP2D2HY.js} +1 -1
  74. package/dist/cdn/{PAHBOZWM.js → LKMH2ETP.js} +1 -1
  75. package/dist/cdn/{WVGPIEYR.js → LSLJSKX3.js} +1 -1
  76. package/dist/cdn/{JTEP2OIU.js → M3CH5PK6.js} +1 -1
  77. package/dist/cdn/{QBEXD6JH.js → MB3FX7OZ.js} +1 -1
  78. package/dist/cdn/{S5KQWEU6.js → MCGGJUT4.js} +1 -1
  79. package/dist/cdn/{VWK6YJHE.js → MD3RQ5I2.js} +1 -1
  80. package/dist/cdn/{7FDNB4GD.js → MDB3SXD6.js} +1 -1
  81. package/dist/cdn/{E367SDJM.js → ME56NZHJ.js} +1 -1
  82. package/dist/cdn/{EJXANC4L.js → MIQP6HEK.js} +1 -1
  83. package/dist/cdn/{BMNYJPJO.js → MR7JIUCW.js} +1 -1
  84. package/dist/cdn/{AGMF22TB.js → MYU5YT5E.js} +1 -1
  85. package/dist/cdn/{K45ZDVD6.js → N6WG5R5S.js} +1 -1
  86. package/dist/cdn/{HQ5FKTGS.js → N7X4APJV.js} +1 -1
  87. package/dist/cdn/{B7MDF47F.js → NO7F4GKY.js} +1 -1
  88. package/dist/cdn/{GOQZOCS4.js → NPJL4MSJ.js} +1 -1
  89. package/dist/cdn/{WGWK3TWI.js → NPVTJ3JM.js} +1 -1
  90. package/dist/cdn/{47OZIMFV.js → NURDERM3.js} +1 -1
  91. package/dist/cdn/{WHZHMD2P.js → OBJT5ODS.js} +1 -1
  92. package/dist/cdn/{YIP6V7IE.js → OIIMG6T7.js} +1 -1
  93. package/dist/cdn/{NCMBLLMD.js → OSWIVMFU.js} +1 -1
  94. package/dist/cdn/{BC6CFM5J.js → OVD3IAAV.js} +1 -1
  95. package/dist/cdn/{W4CWUSUQ.js → P22VNKPY.js} +1 -1
  96. package/dist/cdn/{FRTL2ODS.js → P4UBML72.js} +1 -1
  97. package/dist/cdn/PC4LZZZM.js +2 -0
  98. package/dist/cdn/{SS5ORQKB.js → PW7YMRBF.js} +1 -1
  99. package/dist/cdn/{OHLS3VTG.js → PXUU3PWL.js} +1 -1
  100. package/dist/cdn/{TIIRYBMV.js → Q4MMPR4P.js} +1 -1
  101. package/dist/cdn/{334QKH24.js → Q7RRARYY.js} +1 -1
  102. package/dist/cdn/{KD4JCGVZ.js → QNGVIHP6.js} +1 -1
  103. package/dist/cdn/{T67ZDX74.js → RAA3PI43.js} +1 -1
  104. package/dist/cdn/{5A7NZWNB.js → RBO5QXOC.js} +1 -1
  105. package/dist/cdn/{NYL5ZTW5.js → RET2UHOB.js} +1 -1
  106. package/dist/cdn/{OBJLST55.js → RKI7SYTC.js} +1 -1
  107. package/dist/cdn/{ARGJ6OH5.js → RL6LR5RX.js} +1 -1
  108. package/dist/cdn/RNHHKZNH.js +2 -0
  109. package/dist/cdn/{C4JD266W.js → RQONITLI.js} +1 -1
  110. package/dist/cdn/{ETVBNO6K.js → RYQEEAQF.js} +1 -1
  111. package/dist/cdn/{4FQVFI5P.js → SABXQJA7.js} +1 -1
  112. package/dist/cdn/{UAOIUSIR.js → T5UPMLEC.js} +1 -1
  113. package/dist/cdn/{PUH5XOT6.js → TDHR3F7M.js} +1 -1
  114. package/dist/cdn/{DAOPIMWW.js → TLIBVBYQ.js} +1 -1
  115. package/dist/cdn/{EKCSZE3S.js → UAH66PZO.js} +1 -1
  116. package/dist/cdn/{HMGPPFBB.js → UDFJY3B5.js} +1 -1
  117. package/dist/cdn/{GS2QEDED.js → UJ7BSYGW.js} +1 -1
  118. package/dist/cdn/{BT5DZOUY.js → UJXQEJWS.js} +1 -1
  119. package/dist/cdn/{6ROEAFVO.js → VJKMBHLN.js} +1 -1
  120. package/dist/cdn/{KCRFHIFL.js → VJPUBMZS.js} +1 -1
  121. package/dist/cdn/{6MS3WR76.js → VLRX2MEB.js} +1 -1
  122. package/dist/cdn/VQUGMT54.js +2 -0
  123. package/dist/cdn/{FMDAA3ZV.js → W2ROLCMV.js} +1 -1
  124. package/dist/cdn/{7AOF7LH7.js → WPVOJ3GU.js} +1 -1
  125. package/dist/cdn/{LC34FAXS.js → WV6SHUD6.js} +1 -1
  126. package/dist/cdn/{H6BVR26I.js → WXBPLXQQ.js} +1 -1
  127. package/dist/cdn/{6Z64LBVB.js → XGJC7SXI.js} +1 -1
  128. package/dist/cdn/{EFHOM5XZ.js → XIIT6OKF.js} +1 -1
  129. package/dist/cdn/{QMIXYR3U.js → XPCQTWGI.js} +1 -1
  130. package/dist/cdn/{O4AWV2QM.js → XTO3FV4Q.js} +1 -1
  131. package/dist/cdn/{H25RQ4R2.js → Y47NEC7L.js} +1 -1
  132. package/dist/cdn/{VAIPDRFU.js → Y4B25ZAA.js} +1 -1
  133. package/dist/cdn/{SYXG6QEJ.js → Y6IWUBYT.js} +1 -1
  134. package/dist/cdn/{OOCY3YHE.js → YC7RH6YT.js} +1 -1
  135. package/dist/cdn/{5DBVFWEL.js → YDUTUT75.js} +1 -1
  136. package/dist/cdn/{3I3TVYSQ.js → YOSK7NP5.js} +1 -1
  137. package/dist/cdn/{ASVMMO27.js → Z5EPV3FM.js} +1 -1
  138. package/dist/cdn/{ULO5GKZ7.js → ZOFL5S4B.js} +1 -1
  139. package/dist/cdn/index.js +1 -1
  140. package/dist/chunks/runtime.js +3 -3
  141. package/dist/components/calcite-autocomplete/customElement.js +1 -1
  142. package/dist/components/calcite-filter/customElement.js +1 -1
  143. package/dist/components/calcite-input-date-picker/customElement.js +1 -1
  144. package/dist/components/calcite-input-time-picker/customElement.js +1 -1
  145. package/dist/components/calcite-progress/customElement.js +1 -1
  146. package/dist/components/calcite-segmented-control-item/customElement.js +1 -1
  147. package/dist/components/calcite-slider/customElement.js +1 -1
  148. package/dist/components/calcite-time-picker/customElement.js +1 -1
  149. package/dist/docs/api.json +1 -1
  150. package/dist/docs/docs.json +1 -1
  151. package/dist/docs/vscode.html-custom-data.json +1 -1
  152. package/dist/docs/web-types.json +1 -1
  153. package/package.json +2 -2
  154. package/dist/cdn/3H7QDXLA.js +0 -2
  155. package/dist/cdn/6OBQ7YDM.js +0 -2
  156. package/dist/cdn/7YVSA3CG.js +0 -2
  157. package/dist/cdn/BSGEMGN2.js +0 -2
  158. package/dist/cdn/CEH2WPNS.js +0 -2
  159. package/dist/cdn/H2MVFWOW.js +0 -2
  160. package/dist/cdn/QZJUWE7X.js +0 -2
  161. package/dist/cdn/SHX3RB7G.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as B,b as F}from"./4T3X6P5Q.js";import{a as P}from"./735UOYTJ.js";import{b as L}from"./B26JHK23.js";import{a as S}from"./36PA4H5Z.js";import{a as u,c as v,d as k,e as O,f as T,g as a,h as H}from"./5H5WEST3.js";import{a as C}from"./QEZ3GMQZ.js";import{a as A}from"./JTEP2OIU.js";import"./VXDPJESZ.js";import{a as m}from"./YP3AYJH3.js";import"./7VTO7SRW.js";import{a as d,b as p}from"./VI7SBYXT.js";import"./VUYX7MNO.js";import{a as x}from"./SS5ORQKB.js";import"./ZWPNZ5XW.js";import{e as D}from"./MTF3JNFW.js";import{G as f}from"./3QPETC2U.js";import{C as b,D as l,E as I,F as c,R as y,g as E,h,p as n}from"./C4JD266W.js";var M={trigger:"trigger"},w={content:"content",wrapper:"wrapper",triggerContainer:"trigger-container"},R=E`: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{display:inline-block}.wrapper{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.wrapper{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .wrapper{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.wrapper[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.wrapper:popover-open{display:block}.wrapper .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.wrapper .calcite-floating-ui-anim{box-shadow:var(--calcite-shadow-md)}.content{width:auto;overflow-y:auto;overflow-x:hidden;inline-size:var(--calcite-dropdown-width, var(--calcite-internal-dropdown-width));background-color:var(--calcite-dropdown-background-color, var(--calcite-color-foreground-1));max-block-size:var(--calcite-dropdown-max-height, 45vh)}.trigger-container{position:relative;display:flex;height:100%;flex:1 1 auto;overflow-wrap:break-word;word-break:break-word}.width-s{--calcite-internal-dropdown-width: 12rem}.width-m{--calcite-internal-dropdown-width: 14rem}.width-l{--calcite-internal-dropdown-width: 16rem}@media(forced-colors:active){:host([open]) .wrapper{border:var(--calcite-border-width-sm) solid canvasText}}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,U=F({click:!0,hover:!0}),g=class extends I{constructor(){super(),this.referenceElementController=B({manager:U})(this),this.direction=D(),this.focusLastDropdownItem=!1,this.activeItemIndex=-1,this.groups=[],this.items=[],this.mutationObserver=d("mutation",()=>this.updateItems()),this.transitionProp="opacity",this.resizeObserver=d("resize",e=>this.resizeObserverCallback(e)),this.triggerSlotRef=b(),this.onReferenceElementKeyDown=e=>this.keyDownHandler(e),this.focusSetter=x()(this),this.interactiveContainer=A(this),this.topLayer=S({target:()=>this.floatingEl})(this),this.closeOnSelectDisabled=!1,this.disabled=!1,this.maxItems=0,this.offsetDistance=0,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=u,this.scale="m",this.selectedItems=[],this.topLayerDisabled=!1,this.type="click",this.calciteDropdownBeforeClose=n({cancelable:!1}),this.calciteDropdownBeforeOpen=n({cancelable:!1}),this.calciteDropdownClose=n({cancelable:!1}),this.calciteDropdownOpen=n({cancelable:!1}),this.calciteDropdownSelect=n({cancelable:!1}),this.listenOn(window,"click",this.closeCalciteDropdownOnClick),this.listenOn(window,"calciteDropdownOpen",this.closeCalciteDropdownOnOpenEvent),this.listen("pointerenter",this.pointerEnterHandler),this.listen("pointerleave",this.pointerLeaveHandler),this.listen("calciteInternalDropdownItemSelect",this.handleItemSelect)}static{this.properties={activeDescendantElement:[16,{},{state:!0}],referenceEl:[16,{},{state:!0}],closeOnSelectDisabled:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],maxItems:[11,{},{reflect:!0,type:Number}],offsetDistance:[11,{},{type:Number,reflect:!0}],offsetSkidding:[11,{},{reflect:!0,type:Number}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],referenceElement:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],type:[3,{},{reflect:!0}],widthScale:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=R}get referenceElementType(){return this.referenceElement?this.type:void 0}get autoClose(){return!0}async reposition(e=!1){let{filteredFlipPlacements:t,floatingEl:i,offsetDistance:s,offsetSkidding:r,overlayPositioning:o,placement:$,referenceEl:z}=this;return O(this,{direction:this.direction,floatingEl:i,referenceEl:z,offsetDistance:s,offsetSkidding:r,overlayPositioning:o,placement:$,flipPlacements:t,type:"menu"},e)}async setFocus(e){return this.focusSetter(()=>this.referenceEl instanceof HTMLElement?this.referenceEl:this.floatingEl,e)}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.updateItems(),a(this)}willUpdate(e){e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.handleDisabledChange(this.disabled),e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("maxItems")&&this.hasUpdated&&this.setMaxScrollerHeight(),this.hasUpdated&&(e.has("offsetDistance")&&this.offsetDistance!==0||e.has("offsetSkidding")&&this.offsetSkidding!==0||e.has("overlayPositioning")&&this.overlayPositioning!=="absolute"||e.has("placement")&&this.placement!==u)&&this.reposition(!0),e.has("scale")&&(this.hasUpdated||this.scale!=="m")&&this.handlePropsChange(),e.has("referenceElement")&&!this.referenceElement&&this.open&&this.topLayer.hide()}updated(e){if(e.has("referenceEl")&&this.referenceElementType){let t=e.get("referenceEl");t instanceof HTMLElement&&(t.ariaActiveDescendantElement=null),this.syncActiveDescendantOwnerElement(),a(this)}}loaded(){this.updateSelectedItems(),a(this)}disconnectedCallback(){super.disconnectedCallback();let e=this.triggerSlotRef.value;e&&(e.ariaActiveDescendantElement=null),this.referenceEl instanceof HTMLElement&&(this.referenceEl.ariaActiveDescendantElement=null),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),H(this)}openHandler(){this.disabled||(C(this),this.reposition(!0))}handleDisabledChange(e){e||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupProps()}closeCalciteDropdownOnClick(e){this.referenceElementType||this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown()}closeCalciteDropdownOnOpenEvent(e){this.referenceElementType||e.composedPath().includes(this.el)||this.closeCalciteDropdown()}pointerEnterHandler(){this.referenceElementType||this.disabled||this.type!=="hover"||(this.open=!0)}pointerLeaveHandler(){this.referenceElementType||this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.hidden)}async handleItemSelect(e){this.updateSelectedItems(),this.syncActiveItemFromTraversableItems(),e.stopPropagation(),this.calciteDropdownSelect.emit(),await this.setFocus(),this.closeOnSelectDisabled||this.closeCalciteDropdown()}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?k(t,e):void 0}updateItems(){this.items=this.groups.map(e=>Array.from(e?.querySelectorAll("calcite-dropdown-item"))).reduce((e,t)=>[...e,...t],[]),this.updateSelectedItems(),this.syncActiveItemFromTraversableItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)}updateGroups(e){let t=e.target.assignedElements({flatten:!0}).filter(L);this.groups=t,this.updateItems(),this.updateGroupProps()}updateGroupProps(){this.groups.forEach((e,t)=>{e.scale=this.scale,e.position=t})}resizeObserverCallback(e){e.forEach(({target:t})=>{t===this.referenceEl?this.setDropdownWidth():t===this.scrollerEl&&this.setMaxScrollerHeight()})}setDropdownWidth(){let{referenceEl:e,scrollerEl:t}=this;!t||!(e instanceof HTMLElement)||(t.style.minWidth=`${e.clientWidth}px`)}setMaxScrollerHeight(){let{maxItems:e,items:t,scrollerEl:i}=this;if(!i)return;let s=t.length>=e&&e>0?this.getYDistanceFromScroller(t.at(e-1)):0;i.style.maxBlockSize=s>0?`${s}px`:"",this.reposition(!0)}setScrollerAndTransitionEl(e){p(this.resizeObserver,this.scrollerEl,e),this.scrollerEl=e,this.transitionEl=e}onBeforeOpen(){this.setInitialActiveItem(),this.calciteDropdownBeforeOpen.emit(),this.topLayer.show()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit(),this.syncActiveDescendantOwnerElement(),T(this),this.topLayer.hide()}setReferenceEl(e){let t=this.referenceEl instanceof HTMLElement?this.referenceEl:void 0,i=e instanceof HTMLElement?e:void 0;p(this.resizeObserver,t,i),!(this.referenceElementType||!i)&&(this.referenceEl=e,this.syncActiveDescendantOwnerElement(),a(this))}setFloatingEl(e){this.floatingEl=e,a(this)}handleTriggerSlotChange(){this.syncActiveDescendantOwnerElement()}keyDownHandler(e){if(!(this.referenceEl instanceof HTMLElement)||!e.composedPath().includes(this.referenceEl))return;let{defaultPrevented:t,key:i}=e;if(!t){if(this.open&&i==="Escape"){this.closeCalciteDropdown(),e.preventDefault();return}if(!this.open&&m(i)){this.open=!0,e.preventDefault();return}if(!this.open&&(i==="ArrowDown"||i==="ArrowUp")){e.preventDefault(),this.focusLastDropdownItem=i==="ArrowUp",this.open=!0;return}if(this.open){if(i==="Tab"){this.closeCalciteDropdown();return}if(i==="ArrowDown"){e.preventDefault(),this.navigateActiveItem("next");return}if(i==="ArrowUp"){e.preventDefault(),this.navigateActiveItem("previous");return}if(i==="Home"){e.preventDefault(),this.navigateActiveItem("first");return}if(i==="End"){e.preventDefault(),this.navigateActiveItem("last");return}m(i)&&(e.preventDefault(),this.activateActiveItem())}}}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getYDistanceFromScroller(e){let{scrollerEl:t}=this;return!e||!t?NaN:e.getBoundingClientRect().bottom-t.getBoundingClientRect().top+t.scrollTop}closeCalciteDropdown(){this.open=!1,this.setActiveItemByIndex(-1)}async setInitialActiveItem(){let e=this.getTraversableItems(),t=this.focusLastDropdownItem?e.at(-1):e[0];if(this.focusLastDropdownItem=!1,!t){this.setActiveItemByIndex(-1);return}let i=e.findIndex(s=>s===t);this.setActiveItemByIndex(i),await this.scrollActiveItemIntoView(t)}syncActiveItemFromTraversableItems(){let e=this.getTraversableItems();if(!e.length){this.setActiveItemByIndex(-1);return}if(this.activeItemIndex<0||this.activeItemIndex>=e.length){this.setActiveItemByIndex(0);return}this.updateActiveDescendantElement(e[this.activeItemIndex])}setActiveItemByIndex(e){this.activeItemIndex=e;let t=this.getTraversableItems(),i=e>=0?t[e]:null;this.updateActiveDescendantElement(i)}updateActiveDescendantElement(e){this.items.forEach(t=>{t.activeDescendant=t===e}),this.activeDescendantElement=e??void 0,this.syncActiveDescendantOwnerElement()}syncActiveDescendantOwnerElement(){let{referenceEl:e,referenceElementType:t}=this,i=this.triggerSlotRef.value,s=this.open?this.activeDescendantElement??null:null,r=e instanceof HTMLElement?e:null,o=!!t;i&&(i.ariaActiveDescendantElement=o?null:s),r&&(r.ariaActiveDescendantElement=o?s:null)}navigateActiveItem(e){let t=this.getTraversableItems();if(!t.length)return;let i=t.length,s=this.activeItemIndex;s<0||s>=i?s=e==="previous"||e==="last"?i-1:0:e==="next"?s=(s+1)%i:e==="previous"?s=(s-1+i)%i:e==="first"?s=0:e==="last"&&(s=i-1);let r=t[s];this.setActiveItemByIndex(s),this.scrollActiveItemIntoView(r)}async scrollActiveItemIntoView(e){e&&(await this.updateComplete,await f(),await f(),e.scrollIntoView({block:"nearest"}))}activateActiveItem(){let e=this.getTraversableItems(),t=e[this.activeItemIndex]||e[0];t&&(this.setActiveItemByIndex(e.findIndex(i=>i===t)),t.activateItem())}openHoverDropdown(){this.open||this.disabled||this.type!=="hover"||(this.open=!0)}closeHoverDropdown(e){if(!this.open||this.disabled||this.type!=="hover")return;let t=e.relatedTarget;t&&(this.el.contains(t)||this.referenceEl!=null&&this.referenceEl instanceof HTMLElement&&this.referenceEl.contains(t))||this.closeCalciteDropdown()}toggleClickDropdown(){this.disabled||this.type!=="click"||(this.open=!this.open)}render(){let{open:e}=this;return this.interactiveContainer({disabled:this.disabled,children:h`${this.referenceElementType?null:h`<div class=${c(w.triggerContainer)} @click=${this.toggleClickDropdown} @focusin=${this.openHoverDropdown} @focusout=${this.closeHoverDropdown} @keydown=${this.keyDownHandler} ${l(this.setReferenceEl)}><slot .ariaControlsElements=${this.scrollerEl?[this.scrollerEl]:void 0} .ariaExpanded=${e} aria-haspopup=menu name=${M.trigger} @slotchange=${this.handleTriggerSlotChange} ${l(this.triggerSlotRef)}></slot></div>`}<div class=${c({[w.wrapper]:!0,[P("width",this.width,this.widthScale)]:!!(this.width||this.widthScale)})} .inert=${!e} popover=manual ${l(this.setFloatingEl)}><div .ariaLabelledByElements=${this.referenceEl instanceof HTMLElement?[this.referenceEl]:void 0} class=${c({[w.content]:!0,[v.animation]:!0,[v.animationActive]:e})} role=menu ${l(this.setScrollerAndTransitionEl)}><slot @slotchange=${this.updateGroups}></slot></div></div>`})}};y("calcite-dropdown",g);export{g as Dropdown};
2
+ import{a as B,b as F}from"./AZ5ZWXXK.js";import{a as P}from"./735UOYTJ.js";import{b as L}from"./B26JHK23.js";import{a as S}from"./IWWJYWY5.js";import{a as u,c as v,d as k,e as O,f as T,g as a,h as H}from"./GBUMWAMI.js";import{a as C}from"./QEZ3GMQZ.js";import{a as A}from"./M3CH5PK6.js";import"./VXDPJESZ.js";import{a as m}from"./YP3AYJH3.js";import"./7VTO7SRW.js";import{a as d,b as p}from"./VI7SBYXT.js";import"./VUYX7MNO.js";import{a as x}from"./PW7YMRBF.js";import"./ZWPNZ5XW.js";import{e as D}from"./I5K6EDCU.js";import{G as f}from"./3QPETC2U.js";import{C as b,D as l,E as I,F as c,R as y,g as E,h,p as n}from"./RQONITLI.js";var M={trigger:"trigger"},w={content:"content",wrapper:"wrapper",triggerContainer:"trigger-container"},R=E`: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{display:inline-block}.wrapper{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.wrapper{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .wrapper{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.wrapper[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.wrapper:popover-open{display:block}.wrapper .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.wrapper .calcite-floating-ui-anim{box-shadow:var(--calcite-shadow-md)}.content{width:auto;overflow-y:auto;overflow-x:hidden;inline-size:var(--calcite-dropdown-width, var(--calcite-internal-dropdown-width));background-color:var(--calcite-dropdown-background-color, var(--calcite-color-foreground-1));max-block-size:var(--calcite-dropdown-max-height, 45vh)}.trigger-container{position:relative;display:flex;height:100%;flex:1 1 auto;overflow-wrap:break-word;word-break:break-word}.width-s{--calcite-internal-dropdown-width: 12rem}.width-m{--calcite-internal-dropdown-width: 14rem}.width-l{--calcite-internal-dropdown-width: 16rem}@media(forced-colors:active){:host([open]) .wrapper{border:var(--calcite-border-width-sm) solid canvasText}}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`,U=F({click:!0,hover:!0}),g=class extends I{constructor(){super(),this.referenceElementController=B({manager:U})(this),this.direction=D(),this.focusLastDropdownItem=!1,this.activeItemIndex=-1,this.groups=[],this.items=[],this.mutationObserver=d("mutation",()=>this.updateItems()),this.transitionProp="opacity",this.resizeObserver=d("resize",e=>this.resizeObserverCallback(e)),this.triggerSlotRef=b(),this.onReferenceElementKeyDown=e=>this.keyDownHandler(e),this.focusSetter=x()(this),this.interactiveContainer=A(this),this.topLayer=S({target:()=>this.floatingEl})(this),this.closeOnSelectDisabled=!1,this.disabled=!1,this.maxItems=0,this.offsetDistance=0,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=u,this.scale="m",this.selectedItems=[],this.topLayerDisabled=!1,this.type="click",this.calciteDropdownBeforeClose=n({cancelable:!1}),this.calciteDropdownBeforeOpen=n({cancelable:!1}),this.calciteDropdownClose=n({cancelable:!1}),this.calciteDropdownOpen=n({cancelable:!1}),this.calciteDropdownSelect=n({cancelable:!1}),this.listenOn(window,"click",this.closeCalciteDropdownOnClick),this.listenOn(window,"calciteDropdownOpen",this.closeCalciteDropdownOnOpenEvent),this.listen("pointerenter",this.pointerEnterHandler),this.listen("pointerleave",this.pointerLeaveHandler),this.listen("calciteInternalDropdownItemSelect",this.handleItemSelect)}static{this.properties={activeDescendantElement:[16,{},{state:!0}],referenceEl:[16,{},{state:!0}],closeOnSelectDisabled:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],flipPlacements:[0,{},{attribute:!1}],maxItems:[11,{},{reflect:!0,type:Number}],offsetDistance:[11,{},{type:Number,reflect:!0}],offsetSkidding:[11,{},{reflect:!0,type:Number}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],referenceElement:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],type:[3,{},{reflect:!0}],widthScale:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=R}get referenceElementType(){return this.referenceElement?this.type:void 0}get autoClose(){return!0}async reposition(e=!1){let{filteredFlipPlacements:t,floatingEl:i,offsetDistance:s,offsetSkidding:r,overlayPositioning:o,placement:$,referenceEl:z}=this;return O(this,{direction:this.direction,floatingEl:i,referenceEl:z,offsetDistance:s,offsetSkidding:r,overlayPositioning:o,placement:$,flipPlacements:t,type:"menu"},e)}async setFocus(e){return this.focusSetter(()=>this.referenceEl instanceof HTMLElement?this.referenceEl:this.floatingEl,e)}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.updateItems(),a(this)}willUpdate(e){e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.handleDisabledChange(this.disabled),e.has("flipPlacements")&&this.flipPlacementsHandler(),e.has("maxItems")&&this.hasUpdated&&this.setMaxScrollerHeight(),this.hasUpdated&&(e.has("offsetDistance")&&this.offsetDistance!==0||e.has("offsetSkidding")&&this.offsetSkidding!==0||e.has("overlayPositioning")&&this.overlayPositioning!=="absolute"||e.has("placement")&&this.placement!==u)&&this.reposition(!0),e.has("scale")&&(this.hasUpdated||this.scale!=="m")&&this.handlePropsChange(),e.has("referenceElement")&&!this.referenceElement&&this.open&&this.topLayer.hide()}updated(e){if(e.has("referenceEl")&&this.referenceElementType){let t=e.get("referenceEl");t instanceof HTMLElement&&(t.ariaActiveDescendantElement=null),this.syncActiveDescendantOwnerElement(),a(this)}}loaded(){this.updateSelectedItems(),a(this)}disconnectedCallback(){super.disconnectedCallback();let e=this.triggerSlotRef.value;e&&(e.ariaActiveDescendantElement=null),this.referenceEl instanceof HTMLElement&&(this.referenceEl.ariaActiveDescendantElement=null),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),H(this)}openHandler(){this.disabled||(C(this),this.reposition(!0))}handleDisabledChange(e){e||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupProps()}closeCalciteDropdownOnClick(e){this.referenceElementType||this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown()}closeCalciteDropdownOnOpenEvent(e){this.referenceElementType||e.composedPath().includes(this.el)||this.closeCalciteDropdown()}pointerEnterHandler(){this.referenceElementType||this.disabled||this.type!=="hover"||(this.open=!0)}pointerLeaveHandler(){this.referenceElementType||this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.hidden)}async handleItemSelect(e){this.updateSelectedItems(),this.syncActiveItemFromTraversableItems(),e.stopPropagation(),this.calciteDropdownSelect.emit(),await this.setFocus(),this.closeOnSelectDisabled||this.closeCalciteDropdown()}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?k(t,e):void 0}updateItems(){this.items=this.groups.map(e=>Array.from(e?.querySelectorAll("calcite-dropdown-item"))).reduce((e,t)=>[...e,...t],[]),this.updateSelectedItems(),this.syncActiveItemFromTraversableItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)}updateGroups(e){let t=e.target.assignedElements({flatten:!0}).filter(L);this.groups=t,this.updateItems(),this.updateGroupProps()}updateGroupProps(){this.groups.forEach((e,t)=>{e.scale=this.scale,e.position=t})}resizeObserverCallback(e){e.forEach(({target:t})=>{t===this.referenceEl?this.setDropdownWidth():t===this.scrollerEl&&this.setMaxScrollerHeight()})}setDropdownWidth(){let{referenceEl:e,scrollerEl:t}=this;!t||!(e instanceof HTMLElement)||(t.style.minWidth=`${e.clientWidth}px`)}setMaxScrollerHeight(){let{maxItems:e,items:t,scrollerEl:i}=this;if(!i)return;let s=t.length>=e&&e>0?this.getYDistanceFromScroller(t.at(e-1)):0;i.style.maxBlockSize=s>0?`${s}px`:"",this.reposition(!0)}setScrollerAndTransitionEl(e){p(this.resizeObserver,this.scrollerEl,e),this.scrollerEl=e,this.transitionEl=e}onBeforeOpen(){this.setInitialActiveItem(),this.calciteDropdownBeforeOpen.emit(),this.topLayer.show()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit(),this.syncActiveDescendantOwnerElement(),T(this),this.topLayer.hide()}setReferenceEl(e){let t=this.referenceEl instanceof HTMLElement?this.referenceEl:void 0,i=e instanceof HTMLElement?e:void 0;p(this.resizeObserver,t,i),!(this.referenceElementType||!i)&&(this.referenceEl=e,this.syncActiveDescendantOwnerElement(),a(this))}setFloatingEl(e){this.floatingEl=e,a(this)}handleTriggerSlotChange(){this.syncActiveDescendantOwnerElement()}keyDownHandler(e){if(!(this.referenceEl instanceof HTMLElement)||!e.composedPath().includes(this.referenceEl))return;let{defaultPrevented:t,key:i}=e;if(!t){if(this.open&&i==="Escape"){this.closeCalciteDropdown(),e.preventDefault();return}if(!this.open&&m(i)){this.open=!0,e.preventDefault();return}if(!this.open&&(i==="ArrowDown"||i==="ArrowUp")){e.preventDefault(),this.focusLastDropdownItem=i==="ArrowUp",this.open=!0;return}if(this.open){if(i==="Tab"){this.closeCalciteDropdown();return}if(i==="ArrowDown"){e.preventDefault(),this.navigateActiveItem("next");return}if(i==="ArrowUp"){e.preventDefault(),this.navigateActiveItem("previous");return}if(i==="Home"){e.preventDefault(),this.navigateActiveItem("first");return}if(i==="End"){e.preventDefault(),this.navigateActiveItem("last");return}m(i)&&(e.preventDefault(),this.activateActiveItem())}}}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getYDistanceFromScroller(e){let{scrollerEl:t}=this;return!e||!t?NaN:e.getBoundingClientRect().bottom-t.getBoundingClientRect().top+t.scrollTop}closeCalciteDropdown(){this.open=!1,this.setActiveItemByIndex(-1)}async setInitialActiveItem(){let e=this.getTraversableItems(),t=this.focusLastDropdownItem?e.at(-1):e[0];if(this.focusLastDropdownItem=!1,!t){this.setActiveItemByIndex(-1);return}let i=e.findIndex(s=>s===t);this.setActiveItemByIndex(i),await this.scrollActiveItemIntoView(t)}syncActiveItemFromTraversableItems(){let e=this.getTraversableItems();if(!e.length){this.setActiveItemByIndex(-1);return}if(this.activeItemIndex<0||this.activeItemIndex>=e.length){this.setActiveItemByIndex(0);return}this.updateActiveDescendantElement(e[this.activeItemIndex])}setActiveItemByIndex(e){this.activeItemIndex=e;let t=this.getTraversableItems(),i=e>=0?t[e]:null;this.updateActiveDescendantElement(i)}updateActiveDescendantElement(e){this.items.forEach(t=>{t.activeDescendant=t===e}),this.activeDescendantElement=e??void 0,this.syncActiveDescendantOwnerElement()}syncActiveDescendantOwnerElement(){let{referenceEl:e,referenceElementType:t}=this,i=this.triggerSlotRef.value,s=this.open?this.activeDescendantElement??null:null,r=e instanceof HTMLElement?e:null,o=!!t;i&&(i.ariaActiveDescendantElement=o?null:s),r&&(r.ariaActiveDescendantElement=o?s:null)}navigateActiveItem(e){let t=this.getTraversableItems();if(!t.length)return;let i=t.length,s=this.activeItemIndex;s<0||s>=i?s=e==="previous"||e==="last"?i-1:0:e==="next"?s=(s+1)%i:e==="previous"?s=(s-1+i)%i:e==="first"?s=0:e==="last"&&(s=i-1);let r=t[s];this.setActiveItemByIndex(s),this.scrollActiveItemIntoView(r)}async scrollActiveItemIntoView(e){e&&(await this.updateComplete,await f(),await f(),e.scrollIntoView({block:"nearest"}))}activateActiveItem(){let e=this.getTraversableItems(),t=e[this.activeItemIndex]||e[0];t&&(this.setActiveItemByIndex(e.findIndex(i=>i===t)),t.activateItem())}openHoverDropdown(){this.open||this.disabled||this.type!=="hover"||(this.open=!0)}closeHoverDropdown(e){if(!this.open||this.disabled||this.type!=="hover")return;let t=e.relatedTarget;t&&(this.el.contains(t)||this.referenceEl!=null&&this.referenceEl instanceof HTMLElement&&this.referenceEl.contains(t))||this.closeCalciteDropdown()}toggleClickDropdown(){this.disabled||this.type!=="click"||(this.open=!this.open)}render(){let{open:e}=this;return this.interactiveContainer({disabled:this.disabled,children:h`${this.referenceElementType?null:h`<div class=${c(w.triggerContainer)} @click=${this.toggleClickDropdown} @focusin=${this.openHoverDropdown} @focusout=${this.closeHoverDropdown} @keydown=${this.keyDownHandler} ${l(this.setReferenceEl)}><slot .ariaControlsElements=${this.scrollerEl?[this.scrollerEl]:void 0} .ariaExpanded=${e} aria-haspopup=menu name=${M.trigger} @slotchange=${this.handleTriggerSlotChange} ${l(this.triggerSlotRef)}></slot></div>`}<div class=${c({[w.wrapper]:!0,[P("width",this.width,this.widthScale)]:!!(this.width||this.widthScale)})} .inert=${!e} popover=manual ${l(this.setFloatingEl)}><div .ariaLabelledByElements=${this.referenceEl instanceof HTMLElement?[this.referenceEl]:void 0} class=${c({[w.content]:!0,[v.animation]:!0,[v.animationActive]:e})} role=menu ${l(this.setScrollerAndTransitionEl)}><slot @slotchange=${this.updateGroups}></slot></div></div>`})}};y("calcite-dropdown",g);export{g as Dropdown};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as Q}from"./YP3AYJH3.js";import{b as G}from"./7VTO7SRW.js";import{b as W}from"./MTF3JNFW.js";import{A as z,B as $,k as X,m as V}from"./3QPETC2U.js";import{O as U}from"./C4JD266W.js";var Le=i=>{let{manager:a}=i;return W((o,c)=>{let u,f,g=l=>!!(l&&o.referenceElementType),E=l=>{g(l)&&(a.registerElement(o,l),f=l)},h=l=>{g(l)&&(a.unregisterElement(o,l),f===l&&(f=void 0))},k=l=>{let{referenceElement:m,el:C}=l;return(typeof m=="string"?V(C,{id:m}):m)||void 0},v=(l=!0)=>{if(!o.referenceElementType)return;o.referenceEl=k(o);let{el:m,referenceElement:C,referenceEl:D}=o;l&&C&&!D&&U.warn(`${m.tagName}: reference-element id "${C}" was not found.`,{el:m})};c.onConnected(()=>{u=requestAnimationFrame(()=>{o.el.isConnected&&(v(o.manager.loadedCalled),E(o.referenceEl))})}),c.onLoaded(()=>{o.referenceElement&&!o.referenceEl&&v()}),c.onUpdate(l=>{o.hasUpdated&&(l.has("referenceElement")&&v(),l.has("referenceEl")?(h(l.get("referenceEl")),E(o.referenceEl)):(l.has("open")||l.has("triggerDisabled"))&&a.updateElement(o,o.referenceEl))}),c.onDisconnected(()=>{u!=null&&(cancelAnimationFrame(u),u=void 0),h(f)})})};function j(i,a){if(i===a)return!0;if(i.length!==a.length)return!1;let o=new Set(i),c=new Set(a);if(o.size!==c.size)return!1;for(let u of o)if(!c.has(u))return!1;return!0}var me=5,R=300,ge=R/3,ve=R*1.5;function Ee({startX:i,startY:a,endX:o,endY:c}){return Math.hypot(o-i,c-a)>me}var He=i=>{let a=new Map,o=new WeakMap,c=new WeakSet,u=new WeakMap,f=null,g=null,E=null,h=null,k=null,v=null,l=0,m=(e,t)=>{let n=e.find(s=>a.has(s));if(!n)return;let r=a.get(n);return t?r?.filter(s=>s.referenceElementType===t):r},C=(e,t)=>{let n=e.composedPath(),r=m(n,t);r?.forEach(s=>{s&&!s.triggerDisabled&&(s.open=!s.open)}),Array.from(a.values()).flat().filter(s=>!r?.includes(s)&&s.autoClose&&s.open&&!n.includes(s.el)).forEach(s=>s.open=!1)},D=e=>{$(e)||e.defaultPrevented||v&&Ee({endY:e.clientY,endX:e.clientX,startY:v.y,startX:v.x})||(v=null,C(e,"click"))},b=()=>{h!=null&&window.clearTimeout(h),h=null},A=()=>{E!=null&&window.clearTimeout(E),E=null},w=()=>{b(),A()},P=(e,t)=>!!(f?.some(n=>n?.open&&t.includes(n.el))||e?.some(n=>n?.open&&t.includes(n.el))),y=(e,t)=>{e?.forEach(n=>n.open=t),f=t?e:null},p=()=>{y(f,!1)},J=e=>{if(e.key==="Escape"&&!e.defaultPrevented){let t=f?.filter(n=>n?.open);if(t?.length){w(),p();let n=e.composedPath();t.some(r=>r.referenceEl instanceof Element&&n.includes(r.referenceEl)||n.includes(r.el))&&e.preventDefault()}}},Z=e=>{if(e.defaultPrevented)return;g=null;let t=e.composedPath(),n=m(t,"hover");if(P(n,t)){w();return}if(p(),!n?.length)return;w();let r=n.filter(d=>d.closeOnClick),s=n.filter(d=>!d.closeOnClick);r?.length&&(g=r,y(r,!1)),y(s,!0)},T=e=>{if(e.defaultPrevented||!z(e))return;let{clientX:t,clientY:n}=e;v={x:t,y:n}},ee=e=>{e.defaultPrevented||(e.key==="Escape"?ne():Q(e.key)&&C(e,"click"))},te=e=>{m(e.composedPath())?.forEach(n=>n.onReferenceElementKeyDown?.(e))},ne=()=>{Array.from(a.values()).flat().forEach(e=>e.open=!1)},S=e=>{j(e??[],f??[])||p()},re=e=>{h=window.setTimeout(()=>{h===null||!j(e??[],k??[])||(A(),S(e),y(e,!0))},f?.some(t=>t.open)?ge:R)},O=()=>{E=window.setTimeout(()=>{E!==null&&p()},ve)},x=e=>{if(e.defaultPrevented){p();return}let t=e.composedPath(),n=m(t,"hover");if(P(n,t)){w();return}n?.some(r=>g?.includes(r))||(n?.some(r=>k?.includes(r))||b(),k=n,n?.length?re(n):f?.some(r=>r?.open)&&O(),g=null)},M=()=>{p()},_=e=>{e.defaultPrevented||(w(),O())},B=e=>{i.click&&D(e),i.hover&&Z(e)},Y=e=>{te(e),i.click&&ee(e),i.hover&&J(e)},se=()=>{(i.click||i.hover)&&(window.addEventListener("click",B),window.addEventListener("keydown",Y)),i.click&&window.addEventListener("pointerdown",T),i.hover&&(window.addEventListener("pointermove",x),window.addEventListener("focusin",L),window.addEventListener("blur",M),document.addEventListener("pointerleave",_))},ie=()=>{(i.click||i.hover)&&(window.removeEventListener("click",B),window.removeEventListener("keydown",Y)),i.click&&window.removeEventListener("pointerdown",T),i.hover&&(window.removeEventListener("pointermove",x),window.removeEventListener("focusin",L),window.removeEventListener("blur",M),document.removeEventListener("pointerleave",_))},oe=(e,t)=>{w(),y(e,t)},K=e=>e instanceof Element?X(e):null,L=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=m(t,"hover");if(P(n,t)){w();return}n?.some(r=>g?.includes(r))||(g=null,S(n),n?.length&&oe(n,!0))},N=(e,t)=>{if(!("ariaExpanded"in e))return;let n=t.filter(r=>!r.triggerDisabled);if(n.length){e.ariaExpanded=G(n.some(r=>r.open)),c.add(e);return}c.has(e)&&(e.ariaExpanded=null,c.delete(e))},I=(e,t,n=!t.triggerDisabled)=>{if(!("ariaControlsElements"in e))return;let r=e.ariaControlsElements??[],s=r.includes(t.el),d=o.get(e);if(!n){if(!d?.has(t))return;let H=r.filter(fe=>fe!==t.el);e.ariaControlsElements=H.length>0?H:null,d?.delete(t);return}s||(e.ariaControlsElements=[...r,t.el],d?d.add(t):o.set(e,new WeakSet([t])))},q=(e,t)=>{!t||!e.referenceElementType||i.click&&(I(t,e),N(t,a.get(t)??[]))},le=e=>{e.addEventListener("focusin",L)},ae=e=>{e.removeEventListener("focusin",L)},de=e=>{let t=u.get(e),n=(typeof t=="number"?t:0)+1;n===1&&le(e),u.set(e,n)},ce=e=>{let t=u.get(e),n=typeof t=="number"?t:0,r=Math.max(0,n-1);if(n>0&&r===0){ae(e),u.delete(e);return}r>0&&u.set(e,r)},ue=(e,t)=>{if(!t||!e.referenceElementType)return;let n=a.get(t)??[];if(n.includes(e))return;if(i.hover&&"ariaDescribedByElements"in t){let s=t.ariaDescribedByElements??[];if(!s.includes(e.el)){let d=[...s,e.el];t.ariaDescribedByElements=d}}l++,a.set(t,[...n,e]);let r=i.hover?K(t):null;r&&de(r),l===1&&se(),q(e,t)},F=e=>{l--,e&&ce(e)};return{registerElement:ue,unregisterElement:(e,t)=>{if(!t||!e.referenceElementType)return;let n=i.hover?K(t):null,r=a.get(t)??[],s=r.filter(d=>d!==e);if(s.length>0?(a.set(t,s),s.length!==r.length&&F(n)):a.delete(t)&&F(n),l===0&&(ie(),w()),i.click&&(I(t,e,!1),N(t,s)),i.hover&&"ariaDescribedByElements"in t){let d=(t.ariaDescribedByElements??[]).filter(H=>H!==e.el);t.ariaDescribedByElements=d.length>0?d:null}},updateElement:q}};export{Le as a,He as b};
2
+ import{a as Q}from"./YP3AYJH3.js";import{b as G}from"./7VTO7SRW.js";import{b as W}from"./I5K6EDCU.js";import{A as z,B as $,k as X,m as V}from"./3QPETC2U.js";import{O as U}from"./RQONITLI.js";var Le=i=>{let{manager:a}=i;return W((o,c)=>{let u,f,g=l=>!!(l&&o.referenceElementType),E=l=>{g(l)&&(a.registerElement(o,l),f=l)},h=l=>{g(l)&&(a.unregisterElement(o,l),f===l&&(f=void 0))},k=l=>{let{referenceElement:m,el:C}=l;return(typeof m=="string"?V(C,{id:m}):m)||void 0},v=(l=!0)=>{if(!o.referenceElementType)return;o.referenceEl=k(o);let{el:m,referenceElement:C,referenceEl:D}=o;l&&C&&!D&&U.warn(`${m.tagName}: reference-element id "${C}" was not found.`,{el:m})};c.onConnected(()=>{u=requestAnimationFrame(()=>{o.el.isConnected&&(v(o.manager.loadedCalled),E(o.referenceEl))})}),c.onLoaded(()=>{o.referenceElement&&!o.referenceEl&&v()}),c.onUpdate(l=>{o.hasUpdated&&(l.has("referenceElement")&&v(),l.has("referenceEl")?(h(l.get("referenceEl")),E(o.referenceEl)):(l.has("open")||l.has("triggerDisabled"))&&a.updateElement(o,o.referenceEl))}),c.onDisconnected(()=>{u!=null&&(cancelAnimationFrame(u),u=void 0),h(f)})})};function j(i,a){if(i===a)return!0;if(i.length!==a.length)return!1;let o=new Set(i),c=new Set(a);if(o.size!==c.size)return!1;for(let u of o)if(!c.has(u))return!1;return!0}var me=5,R=300,ge=R/3,ve=R*1.5;function Ee({startX:i,startY:a,endX:o,endY:c}){return Math.hypot(o-i,c-a)>me}var He=i=>{let a=new Map,o=new WeakMap,c=new WeakSet,u=new WeakMap,f=null,g=null,E=null,h=null,k=null,v=null,l=0,m=(e,t)=>{let n=e.find(s=>a.has(s));if(!n)return;let r=a.get(n);return t?r?.filter(s=>s.referenceElementType===t):r},C=(e,t)=>{let n=e.composedPath(),r=m(n,t);r?.forEach(s=>{s&&!s.triggerDisabled&&(s.open=!s.open)}),Array.from(a.values()).flat().filter(s=>!r?.includes(s)&&s.autoClose&&s.open&&!n.includes(s.el)).forEach(s=>s.open=!1)},D=e=>{$(e)||e.defaultPrevented||v&&Ee({endY:e.clientY,endX:e.clientX,startY:v.y,startX:v.x})||(v=null,C(e,"click"))},b=()=>{h!=null&&window.clearTimeout(h),h=null},A=()=>{E!=null&&window.clearTimeout(E),E=null},w=()=>{b(),A()},P=(e,t)=>!!(f?.some(n=>n?.open&&t.includes(n.el))||e?.some(n=>n?.open&&t.includes(n.el))),y=(e,t)=>{e?.forEach(n=>n.open=t),f=t?e:null},p=()=>{y(f,!1)},J=e=>{if(e.key==="Escape"&&!e.defaultPrevented){let t=f?.filter(n=>n?.open);if(t?.length){w(),p();let n=e.composedPath();t.some(r=>r.referenceEl instanceof Element&&n.includes(r.referenceEl)||n.includes(r.el))&&e.preventDefault()}}},Z=e=>{if(e.defaultPrevented)return;g=null;let t=e.composedPath(),n=m(t,"hover");if(P(n,t)){w();return}if(p(),!n?.length)return;w();let r=n.filter(d=>d.closeOnClick),s=n.filter(d=>!d.closeOnClick);r?.length&&(g=r,y(r,!1)),y(s,!0)},T=e=>{if(e.defaultPrevented||!z(e))return;let{clientX:t,clientY:n}=e;v={x:t,y:n}},ee=e=>{e.defaultPrevented||(e.key==="Escape"?ne():Q(e.key)&&C(e,"click"))},te=e=>{m(e.composedPath())?.forEach(n=>n.onReferenceElementKeyDown?.(e))},ne=()=>{Array.from(a.values()).flat().forEach(e=>e.open=!1)},S=e=>{j(e??[],f??[])||p()},re=e=>{h=window.setTimeout(()=>{h===null||!j(e??[],k??[])||(A(),S(e),y(e,!0))},f?.some(t=>t.open)?ge:R)},O=()=>{E=window.setTimeout(()=>{E!==null&&p()},ve)},x=e=>{if(e.defaultPrevented){p();return}let t=e.composedPath(),n=m(t,"hover");if(P(n,t)){w();return}n?.some(r=>g?.includes(r))||(n?.some(r=>k?.includes(r))||b(),k=n,n?.length?re(n):f?.some(r=>r?.open)&&O(),g=null)},M=()=>{p()},_=e=>{e.defaultPrevented||(w(),O())},B=e=>{i.click&&D(e),i.hover&&Z(e)},Y=e=>{te(e),i.click&&ee(e),i.hover&&J(e)},se=()=>{(i.click||i.hover)&&(window.addEventListener("click",B),window.addEventListener("keydown",Y)),i.click&&window.addEventListener("pointerdown",T),i.hover&&(window.addEventListener("pointermove",x),window.addEventListener("focusin",L),window.addEventListener("blur",M),document.addEventListener("pointerleave",_))},ie=()=>{(i.click||i.hover)&&(window.removeEventListener("click",B),window.removeEventListener("keydown",Y)),i.click&&window.removeEventListener("pointerdown",T),i.hover&&(window.removeEventListener("pointermove",x),window.removeEventListener("focusin",L),window.removeEventListener("blur",M),document.removeEventListener("pointerleave",_))},oe=(e,t)=>{w(),y(e,t)},K=e=>e instanceof Element?X(e):null,L=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=m(t,"hover");if(P(n,t)){w();return}n?.some(r=>g?.includes(r))||(g=null,S(n),n?.length&&oe(n,!0))},N=(e,t)=>{if(!("ariaExpanded"in e))return;let n=t.filter(r=>!r.triggerDisabled);if(n.length){e.ariaExpanded=G(n.some(r=>r.open)),c.add(e);return}c.has(e)&&(e.ariaExpanded=null,c.delete(e))},I=(e,t,n=!t.triggerDisabled)=>{if(!("ariaControlsElements"in e))return;let r=e.ariaControlsElements??[],s=r.includes(t.el),d=o.get(e);if(!n){if(!d?.has(t))return;let H=r.filter(fe=>fe!==t.el);e.ariaControlsElements=H.length>0?H:null,d?.delete(t);return}s||(e.ariaControlsElements=[...r,t.el],d?d.add(t):o.set(e,new WeakSet([t])))},q=(e,t)=>{!t||!e.referenceElementType||i.click&&(I(t,e),N(t,a.get(t)??[]))},le=e=>{e.addEventListener("focusin",L)},ae=e=>{e.removeEventListener("focusin",L)},de=e=>{let t=u.get(e),n=(typeof t=="number"?t:0)+1;n===1&&le(e),u.set(e,n)},ce=e=>{let t=u.get(e),n=typeof t=="number"?t:0,r=Math.max(0,n-1);if(n>0&&r===0){ae(e),u.delete(e);return}r>0&&u.set(e,r)},ue=(e,t)=>{if(!t||!e.referenceElementType)return;let n=a.get(t)??[];if(n.includes(e))return;if(i.hover&&"ariaDescribedByElements"in t){let s=t.ariaDescribedByElements??[];if(!s.includes(e.el)){let d=[...s,e.el];t.ariaDescribedByElements=d}}l++,a.set(t,[...n,e]);let r=i.hover?K(t):null;r&&de(r),l===1&&se(),q(e,t)},F=e=>{l--,e&&ce(e)};return{registerElement:ue,unregisterElement:(e,t)=>{if(!t||!e.referenceElementType)return;let n=i.hover?K(t):null,r=a.get(t)??[],s=r.filter(d=>d!==e);if(s.length>0?(a.set(t,s),s.length!==r.length&&F(n)):a.delete(t)&&F(n),l===0&&(ie(),w()),i.click&&(I(t,e,!1),N(t,s)),i.hover&&"ariaDescribedByElements"in t){let d=(t.ariaDescribedByElements??[]).filter(H=>H!==e.el);t.ariaDescribedByElements=d.length>0?d:null}},updateElement:q}};export{Le as a,He as b};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{m as L}from"./MBM7UIXE.js";import{a as v}from"./EFHOM5XZ.js";import"./YP3AYJH3.js";import{a as T}from"./VI7SBYXT.js";import{a as M}from"./AISTEJ33.js";import"./MTF3JNFW.js";import{t as V}from"./3QPETC2U.js";import{C as u,D as m,E as k,F as b,G as p,R as C,g as z,h}from"./C4JD266W.js";var r={container:"container",fill:"fill",stepLine:"step-line",label:"label",labelHidden:"label-hidden",labelRange:"label-range",labelValue:"label-value",unitLabel:"unit-label",stepsVisible:"steps-visible",valueVisible:"value-visible",success:"fill-success",warning:"fill-warning",danger:"fill-danger"},N=z`: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([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host{display:flex;--calcite-internal-meter-space: var(--calcite-spacing-base);--calcite-internal-meter-height: var(--calcite-spacing-lg);--calcite-internal-meter-font-size: var(--calcite-font-size--1);--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-brand));--calcite-internal-meter-background-color: var(--calcite-meter-background-color, var(--calcite-color-foreground-2));--calcite-internal-meter-border-color: var(--calcite-meter-border-color, var(--calcite-color-border-2));--calcite-internal-meter-shadow: var(--calcite-meter-shadow, var(--calcite-shadow-none));--calcite-internal-meter-corner-radius: var(--calcite-meter-corner-radius, 9999px);--calcite-internal-meter-value-text-color: var(--calcite-meter-value-text-color, var(--calcite-color-text-1));--calcite-internal-meter-range-text-color: var(--calcite-meter-range-text-color, var(--calcite-color-text-3));--calcite-internal-meter-label-line-height: var(--calcite-font-line-height-base)}:host([scale=s]){--calcite-internal-meter-height: var(--calcite-spacing-md);--calcite-internal-meter-font-size: var(--calcite-font-size--2)}:host([scale=l]){--calcite-internal-meter-height: var(--calcite-spacing-xxl);--calcite-internal-meter-font-size: var(--calcite-font-size-0);--calcite-internal-meter-label-line-height: var(--calcite-font-line-height-md)}:host([appearance=solid]){--calcite-internal-meter-border-color: var(--calcite-color-foreground-3);--calcite-internal-meter-background-color: var(--calcite-color-foreground-3)}:host([appearance=outline]){--calcite-internal-meter-background-color: transparent}.fill{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-brand))}.fill-danger{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-danger))}.fill-success{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-success))}.fill-warning{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-warning))}.container{position:relative;display:flex;align-items:center;margin:0;inline-size:var(--calcite-container-size-content-fluid);block-size:var(--calcite-internal-meter-height);background-color:var(--calcite-internal-meter-background-color);border:var(--calcite-border-width-sm) solid var(--calcite-internal-meter-border-color);border-radius:var(--calcite-internal-meter-corner-radius);box-shadow:var(--calcite-internal-meter-shadow)}.value-visible{margin-block-start:var(--calcite-spacing-xxl)}.steps-visible{margin-block-end:var(--calcite-spacing-xxl)}.step-line{position:absolute;inset-block:0px;display:block;inline-size:var(--calcite-internal-meter-space);background-color:var(--calcite-internal-meter-border-color)}.label{position:absolute;display:flex;gap:var(--calcite-spacing-xxs);font-size:var(--calcite-internal-meter-font-size);line-height:var(--calcite-internal-meter-label-line-height)}.label-hidden{visibility:hidden;opacity:0}.label-value{inset-block-end:calc(100% + .5em);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-internal-meter-value-text-color)}.label-range{color:var(--calcite-internal-meter-range-text-color);inset-block-start:calc(100% + .5em)}.label-range .unit-label{font-weight:var(--calcite-font-weight-medium)}.fill{position:absolute;z-index:var(--calcite-z-index);display:block;transition-timing-function:cubic-bezier(.4,0,.2,1);inset-inline-start:var(--calcite-internal-meter-space);inset-block:var(--calcite-internal-meter-space);border-radius:var(--calcite-internal-meter-corner-radius);max-inline-size:calc(100% - var(--calcite-internal-meter-space) * 2);min-inline-size:calc(var(--calcite-internal-meter-height) - var(--calcite-internal-meter-space) * 2);background-color:var(--calcite-internal-meter-fill-color);transition-property:inline-size,background-color,box-shadow}.solid .fill{inset-block:0;inset-inline-start:0;max-inline-size:100%;min-inline-size:calc(var(--calcite-internal-meter-height));box-shadow:0 0 0 1px var(--calcite-internal-meter-fill-color)}`,y=class extends k{constructor(){super(...arguments),this.highLabelRef=u(),this.labelFlipMax=.8,this.labelFlipProximity=.15,this.lowLabelRef=u(),this.maxLabelRef=u(),this.maxPercent=100,this.messages=M({name:null}),this.meterContainerRef=u(),this.minLabelRef=u(),this.minPercent=0,this.resizeObserver=T("resize",()=>this.resizeHandler()),this.valueLabelRef=u(),this.currentPercent=0,this.highActive=!1,this.highPercent=100,this.lowActive=!1,this.lowPercent=0,this.appearance="outline-fill",this.disabled=!1,this.fillType="range",this.groupSeparator=!1,this.max=100,this.min=0,this.rangeLabelType="percent",this.rangeLabels=!1,this.scale="m",this.unitLabel="",this.valueLabel=!1,this.valueLabelType="percent"}static{this.properties={currentPercent:[16,{},{state:!0}],highActive:[16,{},{state:!0}],highPercent:[16,{},{state:!0}],lowActive:[16,{},{state:!0}],lowPercent:[16,{},{state:!0}],appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],fillType:[3,{},{reflect:!0}],form:[3,{},{reflect:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],high:[11,{},{reflect:!0,type:Number}],label:1,low:[11,{},{reflect:!0,type:Number}],max:[11,{},{reflect:!0,type:Number}],min:[11,{},{reflect:!0,type:Number}],name:[3,{},{reflect:!0}],numberingSystem:1,rangeLabelType:[3,{},{reflect:!0}],rangeLabels:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],unitLabel:1,value:[9,{},{type:Number}],valueLabel:[7,{},{reflect:!0,type:Boolean}],valueLabelType:[3,{},{reflect:!0}]}}static{this.styles=N}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}load(){this.calculateValues()}willUpdate(e){(e.has("min")&&(this.hasUpdated||this.min!==0)||e.has("max")&&(this.hasUpdated||this.max!==100)||e.has("low")||e.has("high")||e.has("value"))&&this.handleRangeChange(),(e.has("rangeLabels")&&(this.hasUpdated||this.rangeLabels!==!1)||e.has("rangeLabelType")&&(this.hasUpdated||this.rangeLabelType!=="percent")||e.has("unitLabel")&&(this.hasUpdated||this.unitLabel!=="")||e.has("valueLabel")&&(this.hasUpdated||this.valueLabel!==!1)||e.has("valueLabelType")&&(this.hasUpdated||this.valueLabelType!=="percent"))&&this.updateLabels()}loaded(){this.updateLabels()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}handleRangeChange(){this.calculateValues(),this.updateLabels()}resizeHandler(){this.updateLabels()}updateLabels(){this.determineValueLabelPosition(),this.determineVisibleLabels()}calculateValues(){let{min:e,max:l,low:t,high:a,value:i}=this,n=t===void 0?NaN:100*(t-e)/(l-e),s=a===void 0?NaN:100*(a-e)/(l-e),c=i===void 0?NaN:100*(i-e)/(l-e);(!t||t<e||a!==void 0&&t>a||t>l)&&(this.low=e),(!a||a>l||t!==void 0&&a<t||a<e)&&(this.high=l),i||(this.value=e),this.lowPercent=n,this.highPercent=s,this.currentPercent=i?c:0,this.lowActive=!!t&&t>e&&(!i||t>i)&&(!a||t<a),this.highActive=!!a&&e<=a&&a<l&&(!i||a>i)&&(!t||a>t)}formatLabel(e,l){if(l==="percent"){if(!this.percentFormatting){let t=this.messages._lang,a=new Intl.NumberFormat(t,{useGrouping:this.groupSeparator,style:"percent"});this.percentFormatting={formatter:a,locale:t}}return this.percentFormatting.formatter.format(e)}else return L.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},L.localize(e.toString())}getMeterKindCssClass(){let{low:e,high:l,min:t,max:a,value:i}=this,n=e||t,s=l||a,c=i!==void 0&&i>=n,d=i!==void 0&&i<n,f=i!==void 0&&i>=s,o=i!==void 0&&i<s;return!i||!e&&o||d?r.success:c&&o?r.warning:f?r.danger:r.success}intersects(e,l){return!!(e&&l&&V(e.getBoundingClientRect(),l.getBoundingClientRect()))}determineVisibleLabels(){if(!this.rangeLabels)return;let{minLabelRef:{value:e},lowLabelRef:{value:l},highLabelRef:{value:t},maxLabelRef:{value:a}}=this,i=this.intersects(t,a),n=this.intersects(l,t),s=this.intersects(l,a),c=this.intersects(e,t),d=this.intersects(e,l),f=this.intersects(e,a),o=r.labelHidden;l&&(d||s||n?l.classList.add(o):l.classList.remove(o)),t&&(c||s||i?t.classList.add(o):t.classList.remove(o)),e&&a&&(f?a.classList.add(o):a.classList.remove(o))}determineValueLabelPosition(){let{valueLabelRef:{value:e},meterContainerRef:{value:l},currentPercent:t}=this;if(!e||!l)return;let a=t>100?100:t>0?t:0,i=e.getBoundingClientRect().width,n=l.getBoundingClientRect().width,s=100*(i-0)/(n-0);a+s>=100?(e.style.insetInlineEnd="0%",e.style.removeProperty("inset-inline-start")):(e.style.insetInlineStart=`${a}% `,e.style.removeProperty("inset-inline-end"))}renderMeterFill(){let{currentPercent:e,fillType:l}=this,t=this.getMeterKindCssClass();return h`<div class=${b({[r.fill]:!0,[t]:l!=="single"})} style=${p({width:`${e}%`})}></div>`}renderRangeLine(e){let l={insetInlineStart:`${e}%`};return h`<div class=${b(r.stepLine)} style=${p(l)}></div>`}renderValueLabel(){let{currentPercent:e,valueLabelType:l,unitLabel:t,value:a}=this,i=this.formatLabel(l==="percent"?e/100:a||0,l);return v("low-label-line",h`<div class=${b({[r.label]:!0,[r.labelValue]:!0})} ${m(this.valueLabelRef)}>${i}${t&&l!=="percent"&&h`<span class=${b(r.unitLabel)}>${t}</span>`||""}</div>`)}renderMinLabel(){let{rangeLabelType:e,min:l,minPercent:t,unitLabel:a}=this,i={insetInlineStart:`${t}%`},n=this.formatLabel(e==="percent"?t:l,e);return v("min-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(i)} ${m(this.minLabelRef)}>${n}${a&&e!=="percent"&&h`<span class=${b(r.unitLabel)}>${a}</span>`||""}</div>`)}renderLowLabel(){let{rangeLabelType:e,low:l,lowPercent:t,highPercent:a,labelFlipProximity:i}=this,n=l?this.formatLabel(e==="percent"?t/100:l,e):"",s={insetInlineStart:`${t}%`},c={insetInlineEnd:`${100-t}%`},d=(a-t)/100<i?c:s;return v("low-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(d)} ${m(this.lowLabelRef)}>${n}</div>`)}renderHighLabel(){let{rangeLabelType:e,high:l,highPercent:t,labelFlipMax:a}=this,i=l?this.formatLabel(e==="percent"?t/100:l,e):"",n={insetInlineStart:`${t}%`},s={insetInlineEnd:`${100-t}%`},c=t/100>=a?s:n;return v("high-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(c)} ${m(this.highLabelRef)}>${i}</div>`)}renderMaxLabel(){let{rangeLabelType:e,max:l,maxPercent:t}=this,a={insetInlineEnd:`${100-t}%`},i=this.formatLabel(e==="percent"?t/100:l,e);return v("max-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(a)} ${m(this.maxLabelRef)}>${i}</div>`)}render(){let{appearance:e,currentPercent:l,highActive:t,highPercent:a,label:i,lowActive:n,lowPercent:s,max:c,maxPercent:d,min:f,minPercent:o,rangeLabels:g,rangeLabelType:x,unitLabel:w,value:$,valueLabel:P,valueLabelType:R}=this,S=this.formatLabel(l/100,"percent"),F=`${$} ${w}`;return h`<div .ariaLabel=${i} .ariaValueMax=${x==="percent"?d:c} .ariaValueMin=${x==="percent"?o:f} .ariaValueNow=${R==="percent"?l:$} .ariaValueText=${R==="percent"?S:w?F:void 0} class=${b({[r.container]:!0,[r.stepsVisible]:g,[r.valueVisible]:P,[e]:e!=="outline-fill"})} role=meter ${m(this.meterContainerRef)}>${this.renderMeterFill()}${P&&this.renderValueLabel()||""}${n&&this.renderRangeLine(s)||""}${t&&this.renderRangeLine(a)||""}${g&&this.renderMinLabel()||""}${g&&n&&this.renderLowLabel()||""}${g&&t&&this.renderHighLabel()||""}${g&&this.renderMaxLabel()||""}</div>`}};C("calcite-meter",y);export{y as Meter};
2
+ import{m as L}from"./MBM7UIXE.js";import{a as v}from"./XIIT6OKF.js";import"./YP3AYJH3.js";import{a as T}from"./VI7SBYXT.js";import{a as M}from"./G64R54P5.js";import"./I5K6EDCU.js";import{t as V}from"./3QPETC2U.js";import{C as u,D as m,E as k,F as b,G as p,R as C,g as z,h}from"./RQONITLI.js";var r={container:"container",fill:"fill",stepLine:"step-line",label:"label",labelHidden:"label-hidden",labelRange:"label-range",labelValue:"label-value",unitLabel:"unit-label",stepsVisible:"steps-visible",valueVisible:"value-visible",success:"fill-success",warning:"fill-warning",danger:"fill-danger"},N=z`: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([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host{display:flex;--calcite-internal-meter-space: var(--calcite-spacing-base);--calcite-internal-meter-height: var(--calcite-spacing-lg);--calcite-internal-meter-font-size: var(--calcite-font-size--1);--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-brand));--calcite-internal-meter-background-color: var(--calcite-meter-background-color, var(--calcite-color-foreground-2));--calcite-internal-meter-border-color: var(--calcite-meter-border-color, var(--calcite-color-border-2));--calcite-internal-meter-shadow: var(--calcite-meter-shadow, var(--calcite-shadow-none));--calcite-internal-meter-corner-radius: var(--calcite-meter-corner-radius, 9999px);--calcite-internal-meter-value-text-color: var(--calcite-meter-value-text-color, var(--calcite-color-text-1));--calcite-internal-meter-range-text-color: var(--calcite-meter-range-text-color, var(--calcite-color-text-3));--calcite-internal-meter-label-line-height: var(--calcite-font-line-height-base)}:host([scale=s]){--calcite-internal-meter-height: var(--calcite-spacing-md);--calcite-internal-meter-font-size: var(--calcite-font-size--2)}:host([scale=l]){--calcite-internal-meter-height: var(--calcite-spacing-xxl);--calcite-internal-meter-font-size: var(--calcite-font-size-0);--calcite-internal-meter-label-line-height: var(--calcite-font-line-height-md)}:host([appearance=solid]){--calcite-internal-meter-border-color: var(--calcite-color-foreground-3);--calcite-internal-meter-background-color: var(--calcite-color-foreground-3)}:host([appearance=outline]){--calcite-internal-meter-background-color: transparent}.fill{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-brand))}.fill-danger{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-danger))}.fill-success{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-success))}.fill-warning{--calcite-internal-meter-fill-color: var(--calcite-meter-fill-color, var(--calcite-color-status-warning))}.container{position:relative;display:flex;align-items:center;margin:0;inline-size:var(--calcite-container-size-content-fluid);block-size:var(--calcite-internal-meter-height);background-color:var(--calcite-internal-meter-background-color);border:var(--calcite-border-width-sm) solid var(--calcite-internal-meter-border-color);border-radius:var(--calcite-internal-meter-corner-radius);box-shadow:var(--calcite-internal-meter-shadow)}.value-visible{margin-block-start:var(--calcite-spacing-xxl)}.steps-visible{margin-block-end:var(--calcite-spacing-xxl)}.step-line{position:absolute;inset-block:0px;display:block;inline-size:var(--calcite-internal-meter-space);background-color:var(--calcite-internal-meter-border-color)}.label{position:absolute;display:flex;gap:var(--calcite-spacing-xxs);font-size:var(--calcite-internal-meter-font-size);line-height:var(--calcite-internal-meter-label-line-height)}.label-hidden{visibility:hidden;opacity:0}.label-value{inset-block-end:calc(100% + .5em);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-internal-meter-value-text-color)}.label-range{color:var(--calcite-internal-meter-range-text-color);inset-block-start:calc(100% + .5em)}.label-range .unit-label{font-weight:var(--calcite-font-weight-medium)}.fill{position:absolute;z-index:var(--calcite-z-index);display:block;transition-timing-function:cubic-bezier(.4,0,.2,1);inset-inline-start:var(--calcite-internal-meter-space);inset-block:var(--calcite-internal-meter-space);border-radius:var(--calcite-internal-meter-corner-radius);max-inline-size:calc(100% - var(--calcite-internal-meter-space) * 2);min-inline-size:calc(var(--calcite-internal-meter-height) - var(--calcite-internal-meter-space) * 2);background-color:var(--calcite-internal-meter-fill-color);transition-property:inline-size,background-color,box-shadow}.solid .fill{inset-block:0;inset-inline-start:0;max-inline-size:100%;min-inline-size:calc(var(--calcite-internal-meter-height));box-shadow:0 0 0 1px var(--calcite-internal-meter-fill-color)}`,y=class extends k{constructor(){super(...arguments),this.highLabelRef=u(),this.labelFlipMax=.8,this.labelFlipProximity=.15,this.lowLabelRef=u(),this.maxLabelRef=u(),this.maxPercent=100,this.messages=M({name:null}),this.meterContainerRef=u(),this.minLabelRef=u(),this.minPercent=0,this.resizeObserver=T("resize",()=>this.resizeHandler()),this.valueLabelRef=u(),this.currentPercent=0,this.highActive=!1,this.highPercent=100,this.lowActive=!1,this.lowPercent=0,this.appearance="outline-fill",this.disabled=!1,this.fillType="range",this.groupSeparator=!1,this.max=100,this.min=0,this.rangeLabelType="percent",this.rangeLabels=!1,this.scale="m",this.unitLabel="",this.valueLabel=!1,this.valueLabelType="percent"}static{this.properties={currentPercent:[16,{},{state:!0}],highActive:[16,{},{state:!0}],highPercent:[16,{},{state:!0}],lowActive:[16,{},{state:!0}],lowPercent:[16,{},{state:!0}],appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],fillType:[3,{},{reflect:!0}],form:[3,{},{reflect:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],high:[11,{},{reflect:!0,type:Number}],label:1,low:[11,{},{reflect:!0,type:Number}],max:[11,{},{reflect:!0,type:Number}],min:[11,{},{reflect:!0,type:Number}],name:[3,{},{reflect:!0}],numberingSystem:1,rangeLabelType:[3,{},{reflect:!0}],rangeLabels:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],unitLabel:1,value:[9,{},{type:Number}],valueLabel:[7,{},{reflect:!0,type:Boolean}],valueLabelType:[3,{},{reflect:!0}]}}static{this.styles=N}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}load(){this.calculateValues()}willUpdate(e){(e.has("min")&&(this.hasUpdated||this.min!==0)||e.has("max")&&(this.hasUpdated||this.max!==100)||e.has("low")||e.has("high")||e.has("value"))&&this.handleRangeChange(),(e.has("rangeLabels")&&(this.hasUpdated||this.rangeLabels!==!1)||e.has("rangeLabelType")&&(this.hasUpdated||this.rangeLabelType!=="percent")||e.has("unitLabel")&&(this.hasUpdated||this.unitLabel!=="")||e.has("valueLabel")&&(this.hasUpdated||this.valueLabel!==!1)||e.has("valueLabelType")&&(this.hasUpdated||this.valueLabelType!=="percent"))&&this.updateLabels()}loaded(){this.updateLabels()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}handleRangeChange(){this.calculateValues(),this.updateLabels()}resizeHandler(){this.updateLabels()}updateLabels(){this.determineValueLabelPosition(),this.determineVisibleLabels()}calculateValues(){let{min:e,max:l,low:t,high:a,value:i}=this,n=t===void 0?NaN:100*(t-e)/(l-e),s=a===void 0?NaN:100*(a-e)/(l-e),c=i===void 0?NaN:100*(i-e)/(l-e);(!t||t<e||a!==void 0&&t>a||t>l)&&(this.low=e),(!a||a>l||t!==void 0&&a<t||a<e)&&(this.high=l),i||(this.value=e),this.lowPercent=n,this.highPercent=s,this.currentPercent=i?c:0,this.lowActive=!!t&&t>e&&(!i||t>i)&&(!a||t<a),this.highActive=!!a&&e<=a&&a<l&&(!i||a>i)&&(!t||a>t)}formatLabel(e,l){if(l==="percent"){if(!this.percentFormatting){let t=this.messages._lang,a=new Intl.NumberFormat(t,{useGrouping:this.groupSeparator,style:"percent"});this.percentFormatting={formatter:a,locale:t}}return this.percentFormatting.formatter.format(e)}else return L.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},L.localize(e.toString())}getMeterKindCssClass(){let{low:e,high:l,min:t,max:a,value:i}=this,n=e||t,s=l||a,c=i!==void 0&&i>=n,d=i!==void 0&&i<n,f=i!==void 0&&i>=s,o=i!==void 0&&i<s;return!i||!e&&o||d?r.success:c&&o?r.warning:f?r.danger:r.success}intersects(e,l){return!!(e&&l&&V(e.getBoundingClientRect(),l.getBoundingClientRect()))}determineVisibleLabels(){if(!this.rangeLabels)return;let{minLabelRef:{value:e},lowLabelRef:{value:l},highLabelRef:{value:t},maxLabelRef:{value:a}}=this,i=this.intersects(t,a),n=this.intersects(l,t),s=this.intersects(l,a),c=this.intersects(e,t),d=this.intersects(e,l),f=this.intersects(e,a),o=r.labelHidden;l&&(d||s||n?l.classList.add(o):l.classList.remove(o)),t&&(c||s||i?t.classList.add(o):t.classList.remove(o)),e&&a&&(f?a.classList.add(o):a.classList.remove(o))}determineValueLabelPosition(){let{valueLabelRef:{value:e},meterContainerRef:{value:l},currentPercent:t}=this;if(!e||!l)return;let a=t>100?100:t>0?t:0,i=e.getBoundingClientRect().width,n=l.getBoundingClientRect().width,s=100*(i-0)/(n-0);a+s>=100?(e.style.insetInlineEnd="0%",e.style.removeProperty("inset-inline-start")):(e.style.insetInlineStart=`${a}% `,e.style.removeProperty("inset-inline-end"))}renderMeterFill(){let{currentPercent:e,fillType:l}=this,t=this.getMeterKindCssClass();return h`<div class=${b({[r.fill]:!0,[t]:l!=="single"})} style=${p({width:`${e}%`})}></div>`}renderRangeLine(e){let l={insetInlineStart:`${e}%`};return h`<div class=${b(r.stepLine)} style=${p(l)}></div>`}renderValueLabel(){let{currentPercent:e,valueLabelType:l,unitLabel:t,value:a}=this,i=this.formatLabel(l==="percent"?e/100:a||0,l);return v("low-label-line",h`<div class=${b({[r.label]:!0,[r.labelValue]:!0})} ${m(this.valueLabelRef)}>${i}${t&&l!=="percent"&&h`<span class=${b(r.unitLabel)}>${t}</span>`||""}</div>`)}renderMinLabel(){let{rangeLabelType:e,min:l,minPercent:t,unitLabel:a}=this,i={insetInlineStart:`${t}%`},n=this.formatLabel(e==="percent"?t:l,e);return v("min-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(i)} ${m(this.minLabelRef)}>${n}${a&&e!=="percent"&&h`<span class=${b(r.unitLabel)}>${a}</span>`||""}</div>`)}renderLowLabel(){let{rangeLabelType:e,low:l,lowPercent:t,highPercent:a,labelFlipProximity:i}=this,n=l?this.formatLabel(e==="percent"?t/100:l,e):"",s={insetInlineStart:`${t}%`},c={insetInlineEnd:`${100-t}%`},d=(a-t)/100<i?c:s;return v("low-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(d)} ${m(this.lowLabelRef)}>${n}</div>`)}renderHighLabel(){let{rangeLabelType:e,high:l,highPercent:t,labelFlipMax:a}=this,i=l?this.formatLabel(e==="percent"?t/100:l,e):"",n={insetInlineStart:`${t}%`},s={insetInlineEnd:`${100-t}%`},c=t/100>=a?s:n;return v("high-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(c)} ${m(this.highLabelRef)}>${i}</div>`)}renderMaxLabel(){let{rangeLabelType:e,max:l,maxPercent:t}=this,a={insetInlineEnd:`${100-t}%`},i=this.formatLabel(e==="percent"?t/100:l,e);return v("max-label-line",h`<div class=${b({[r.label]:!0,[r.labelRange]:!0})} style=${p(a)} ${m(this.maxLabelRef)}>${i}</div>`)}render(){let{appearance:e,currentPercent:l,highActive:t,highPercent:a,label:i,lowActive:n,lowPercent:s,max:c,maxPercent:d,min:f,minPercent:o,rangeLabels:g,rangeLabelType:x,unitLabel:w,value:$,valueLabel:P,valueLabelType:R}=this,S=this.formatLabel(l/100,"percent"),F=`${$} ${w}`;return h`<div .ariaLabel=${i} .ariaValueMax=${x==="percent"?d:c} .ariaValueMin=${x==="percent"?o:f} .ariaValueNow=${R==="percent"?l:$} .ariaValueText=${R==="percent"?S:w?F:void 0} class=${b({[r.container]:!0,[r.stepsVisible]:g,[r.valueVisible]:P,[e]:e!=="outline-fill"})} role=meter ${m(this.meterContainerRef)}>${this.renderMeterFill()}${P&&this.renderValueLabel()||""}${n&&this.renderRangeLine(s)||""}${t&&this.renderRangeLine(a)||""}${g&&this.renderMinLabel()||""}${g&&n&&this.renderLowLabel()||""}${g&&t&&this.renderHighLabel()||""}${g&&this.renderMaxLabel()||""}</div>`}};C("calcite-meter",y);export{y as Meter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as M,b as P,c as w,d as A}from"./YIP6V7IE.js";import{a as u,b as n,c as l,h as r,j as m,k as v,m as f,n as c,p as D}from"./RYA2FB6F.js";import{m as k,n as $}from"./MBM7UIXE.js";import{e as z}from"./VXDPJESZ.js";import"./YP3AYJH3.js";import{a as C}from"./AISTEJ33.js";import{a as b}from"./SS5ORQKB.js";import"./ZWPNZ5XW.js";import"./MTF3JNFW.js";import"./3QPETC2U.js";import{E as x,F as S,O as R,R as E,g as y,h as d,p as g}from"./C4JD266W.js";var F=2,O={dateStyle:"full"},B={container:"container"},I=y`: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{display:inline-block;inline-size:100%;overflow:visible;border-width:1px;border-style:solid;vertical-align:top;border-color:var(--calcite-date-picker-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-date-picker-corner-radius, var(--calcite-corner-radius))}:host([scale=s]){inline-size:236px;min-inline-size:216px;max-inline-size:380px}:host([scale=s][range][layout=horizontal][calendars="2"]){inline-size:480px;min-inline-size:432px;max-inline-size:772px}:host([scale=m]){inline-size:298px;min-inline-size:272px;max-inline-size:480px}:host([scale=m][layout=horizontal][range][calendars="2"]){inline-size:608px;min-inline-size:544px;max-inline-size:972px}:host([scale=l]){inline-size:334px;min-inline-size:320px;max-inline-size:600px}:host([scale=l][layout=horizontal][range][calendars="2"]){inline-size:684px;min-inline-size:640px;max-inline-size:1212px}.container{outline:2px solid transparent;outline-offset:2px}:host([hidden]){display:none}[hidden]{display:none}`,p=class extends x{constructor(){super(),this.rangeValueChangedByUser=!1,this.messages=C({blocking:!0}),this.focusSetter=b()(this),this.calendars=2,this.layout="horizontal",this.monthStyle="wide",this.proximitySelectionDisabled=!1,this.range=!1,this.scale="m",this.calciteDatePickerChange=g({cancelable:!1}),this.calciteDatePickerRangeChange=g({cancelable:!1}),this.listen("keydown",this.keyDownHandler)}static{this.properties={activeEndDate:[16,{},{state:!0}],activeStartDate:[16,{},{state:!0}],dateTimeFormat:[16,{},{state:!0}],hoverRange:[16,{},{state:!0}],localeData:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],activeRange:[3,{},{reflect:!0}],calendars:[11,{},{type:Number,reflect:!0}],headingLevel:[11,{},{type:Number,reflect:!0}],layout:[3,{},{reflect:!0}],max:[3,{},{reflect:!0}],maxAsDate:[0,{},{attribute:!1}],messageOverrides:[0,{},{attribute:!1}],min:[3,{},{reflect:!0}],minAsDate:[0,{},{attribute:!1}],monthStyle:1,numberingSystem:[3,{},{reflect:!0}],proximitySelectionDisabled:[7,{},{reflect:!0,type:Boolean}],range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],value:1,valueAsDate:[0,{},{attribute:!1}]}}static{this.styles=I}async reset(){this.resetActiveDates(),this.rangeValueChangedByUser=!1}async setFocus(t){return this.focusSetter(()=>this.el,t)}async load(){await this.loadLocaleData()}willUpdate(t){let e=t.get("valueAsDate"),a=this.valueAsDate,i=this.rangeValueChangedByUser&&!t.has("value")&&this.range&&z(e,a),s=t.has("value")&&t.has("valueAsDate");this.rangeValueChangedByUser&&!s&&!i&&(this.rangeValueChangedByUser=!1),t.has("value")&&this.valueHandler(this.value),t.has("valueAsDate")&&this.valueAsDateWatcher(this.valueAsDate),i&&(this.rangeValueChangedByUser=!1);let h=A(t,"min"),o=A(t,"max");h==="min"?this.minAsDate=this.min?l(this.min):void 0:h==="minAsDate"&&(this.minAsDate=l(r(this.minAsDate))),o==="max"?this.maxAsDate=this.max?l(this.max):void 0:o==="maxAsDate"&&(this.maxAsDate=l(r(this.maxAsDate))),(t.has("range")&&this.range||t.has("maxAsDate")||t.has("minAsDate"))&&this.setActiveStartAndEndDates(),t.has("activeDate")&&this.hasUpdated&&this.activeDateWatcher(this.activeDate),t.has("messages")&&this.hasUpdated&&this.loadLocaleData().catch(R.error)}activeDateWatcher(t){this.range&&(t?(this.activeStartDate=t,this.activeEndDate=c(this.activeStartDate)):this.resetActiveDates())}valueHandler(t){Array.isArray(t)?(this.valueAsDate=t.every(e=>e==="")?void 0:w(t),this.rangeValueChangedByUser||this.resetActiveDates()):t?this.valueAsDate=l(t):(this.valueAsDate=void 0,this.resetActiveDates())}valueAsDateWatcher(t){this.range&&Array.isArray(t)&&!this.rangeValueChangedByUser?this.setActiveStartAndEndDates():this.range||(t&&t!==this.activeDate?this.activeDate=t:t||this.resetActiveDates())}keyDownHandler(t){t.key==="Escape"&&this.resetActiveDates()}async loadLocaleData(){if(!1)return;let t=P(this.messages._lang);k.numberFormatOptions={numberingSystem:this.numberingSystem,locale:t,useGrouping:!1},this.localeData=await M(t),this.dateTimeFormat=$(t,O)}monthHeaderSelectChange(t){let e=new Date(t.detail.date),a=t.detail.position;this.range?a==="end"?(this.activeEndDate=e,this.activeStartDate=v(e)):(this.activeStartDate=e,this.activeEndDate=c(e)):this.activeDate=e,t.stopPropagation()}monthActiveDateChange(t){let e=new Date(t.detail);if(!this.range)this.activeDate=e;else{let a=e.getMonth(),i=a!==this.activeStartDate?.getMonth()&&(this.calendars===1||(this.activeStartDate?a!==c(this.activeStartDate).getMonth():!1));this.activeRange==="end"?(!this.activeEndDate||this.activeStartDate&&i)&&(this.activeEndDate=e,this.activeStartDate=v(e)):(this.activeStartDate&&i||!this.activeStartDate)&&(this.activeStartDate=e,this.activeEndDate=c(e))}t.stopPropagation()}monthHoverChange(t){if(!this.range){this.hoverRange=void 0;return}let{valueAsDate:e}=this,a=Array.isArray(e)?e[0]:void 0,i=Array.isArray(e)?e[1]:void 0,s=new Date(t.detail);if(this.hoverRange={focused:this.activeRange||"start",start:a,end:i},this.proximitySelectionDisabled)i&&a||!i&&a&&s>=a?(this.hoverRange.focused="end",this.hoverRange.end=s):!i&&a&&s<a?this.hoverRange={focused:"start",start:s,end:a}:this.hoverRange=void 0;else if(this.activeRange&&this.hoverRange)this.activeRange==="end"?(this.hoverRange.end=s,this.hoverRange.focused="end"):(this.hoverRange.start=s,this.hoverRange.focused="start");else if(a&&i){let h=Math.abs(D(s,a)),o=Math.abs(D(s,i));s>i?(this.hoverRange.end=s,this.hoverRange.focused="end"):s<a?(this.hoverRange.start=s,this.hoverRange.focused="start"):s>a&&s<i&&(h<o?(this.hoverRange.start=s,this.hoverRange.focused="start"):(this.hoverRange.end=s,this.hoverRange.focused="end"))}else a&&(s<a?this.hoverRange={focused:"start",start:s,end:a}:(this.hoverRange.end=s,this.hoverRange.focused="end"));t.stopPropagation()}monthMouseOutChange(t){this.hoverRange&&(this.hoverRange=void 0),t.stopPropagation()}resetActiveDates(){let{valueAsDate:t}=this;if(!Array.isArray(t)){if(t&&t!==this.activeDate)this.activeDate=new Date(t);else if(!t){this.activeDate=void 0;let e=this.getActiveDate(void 0,this.minAsDate,this.maxAsDate);this.range?(this.activeStartDate=e,this.activeEndDate=void 0):this.activeDate=e}}Array.isArray(t)&&(t[0]&&t[0]!==this.activeStartDate?this.activeStartDate=new Date(t[0]):t[0]||(this.activeStartDate=this.getActiveDate(void 0,this.minAsDate,this.maxAsDate)),t[1]&&t[1]!==this.activeEndDate?this.activeEndDate=new Date(t[1]):t[1]||(this.activeEndDate=void 0)),this.hoverRange=void 0}getEndDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0}setEndDate(t,e=!0){let a=this.getStartDate();this.rangeValueChangedByUser=!0,this.value=[r(a),r(t)],this.valueAsDate=[a,t],e&&this.calciteDatePickerRangeChange.emit()}getStartDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0}setStartDate(t,e=!0){let a=this.getEndDate();this.rangeValueChangedByUser=!0,this.value=[r(t),r(a)],this.valueAsDate=[t,a],e&&this.calciteDatePickerRangeChange.emit()}monthDateChange(t){let e=new Date(t.detail),a=r(e);if(!this.range&&a===r(this.valueAsDate))return;if(!this.range){this.value=a||"",this.valueAsDate=e||void 0,this.activeDate=e||void 0,this.calciteDatePickerChange.emit();return}let i=this.getStartDate(),s=this.getEndDate();if(!i||!s&&e<i)i&&this.setEndDate(new Date(i)),this.activeRange=="end"?this.setEndDate(e):this.setStartDate(e);else if(!s)this.setEndDate(e);else if(this.proximitySelectionDisabled)this.setStartDate(e,!1),this.setEndDate(void 0,!1),this.calciteDatePickerRangeChange.emit();else if(this.activeRange)this.activeRange=="end"?this.setEndDate(e):(e>s&&(this.setEndDate(void 0,!1),this.activeEndDate=void 0),this.setStartDate(e));else{let h=D(e,i),o=D(e,s);o===0||h<0?this.setStartDate(e):h===0||o<0?this.setEndDate(e):h<o?this.setStartDate(e):this.setEndDate(e)}t.stopPropagation(),this.calciteDatePickerChange.emit()}getActiveDate(t,e,a){let i=n(new Date,e,a);return n(this.activeDate,e,a)||t||(m(a,i)&&!this.range?f(i,e,a):i)}getActiveEndDate(t,e,a){return n(this.activeEndDate,e,a)||t||n(c(new Date),e,a)}setActiveStartAndEndDates(){if(this.range){let t=n(Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate),e=n(Array.isArray(this.valueAsDate)?this.valueAsDate[1]:void 0,this.minAsDate,this.maxAsDate);if(this.activeStartDate=this.getActiveDate(t,this.minAsDate,this.maxAsDate),this.activeEndDate=this.getActiveEndDate(e,this.minAsDate,this.maxAsDate),m(this.activeStartDate,this.activeEndDate)){let a=f(this.activeEndDate?v(this.activeEndDate):void 0,this.minAsDate,this.maxAsDate),i=this.activeEndDate?c(this.activeEndDate):void 0;u(a,this.minAsDate,this.maxAsDate)?this.activeStartDate=a:u(i,this.minAsDate,this.maxAsDate)&&(this.activeEndDate=i)}}}render(){let t=n(this.range&&Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate),e=this.getActiveDate(t,this.minAsDate,this.maxAsDate),a=this.range&&Array.isArray(this.valueAsDate)?n(this.valueAsDate[1],this.minAsDate,this.maxAsDate):void 0,i=this.range&&this.activeRange?this.activeRange==="start"?this.minAsDate:t:this.minAsDate,s=this.range?this.activeStartDate:e;return d`<div aria-hidden class=${S(B.container)} tabindex=-1>${this.renderMonth(s,this.maxAsDate,i,t,a)}</div>`}renderMonth(t,e,a,i,s){return d`<calcite-date-picker-month .activeDate=${t} .calendars=${this.calendars} .dateTimeFormat=${this.dateTimeFormat} .endDate=${this.range?s:void 0} .headingLevel=${this.headingLevel||F} .hoverRange=${this.hoverRange} .layout=${this.layout} .localeData=${this.localeData} .max=${e} .messages=${this.messages} .min=${a} .monthStyle=${this.monthStyle} @calciteInternalDatePickerDayHover=${this.monthHoverChange} @calciteInternalDatePickerDaySelect=${this.monthDateChange} @calciteInternalDatePickerMonthActiveDateChange=${this.monthActiveDateChange} @calciteInternalDatePickerMonthChange=${this.monthHeaderSelectChange} @calciteInternalDatePickerMonthMouseOut=${this.monthMouseOutChange} .range=${this.range} .scale=${this.scale} .selectedDate=${this.activeRange==="end"?s:i} .startDate=${this.range?i:void 0}></calcite-date-picker-month>`}};E("calcite-date-picker",p);export{p as DatePicker};
2
+ import{a as M,b as P,c as w,d as A}from"./OIIMG6T7.js";import{a as u,b as n,c as l,h as r,j as m,k as v,m as f,n as c,p as D}from"./RYA2FB6F.js";import{m as k,n as $}from"./MBM7UIXE.js";import{e as z}from"./VXDPJESZ.js";import"./YP3AYJH3.js";import{a as C}from"./G64R54P5.js";import{a as b}from"./PW7YMRBF.js";import"./ZWPNZ5XW.js";import"./I5K6EDCU.js";import"./3QPETC2U.js";import{E as x,F as S,O as R,R as E,g as y,h as d,p as g}from"./RQONITLI.js";var F=2,O={dateStyle:"full"},B={container:"container"},I=y`: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{display:inline-block;inline-size:100%;overflow:visible;border-width:1px;border-style:solid;vertical-align:top;border-color:var(--calcite-date-picker-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-date-picker-corner-radius, var(--calcite-corner-radius))}:host([scale=s]){inline-size:236px;min-inline-size:216px;max-inline-size:380px}:host([scale=s][range][layout=horizontal][calendars="2"]){inline-size:480px;min-inline-size:432px;max-inline-size:772px}:host([scale=m]){inline-size:298px;min-inline-size:272px;max-inline-size:480px}:host([scale=m][layout=horizontal][range][calendars="2"]){inline-size:608px;min-inline-size:544px;max-inline-size:972px}:host([scale=l]){inline-size:334px;min-inline-size:320px;max-inline-size:600px}:host([scale=l][layout=horizontal][range][calendars="2"]){inline-size:684px;min-inline-size:640px;max-inline-size:1212px}.container{outline:2px solid transparent;outline-offset:2px}:host([hidden]){display:none}[hidden]{display:none}`,p=class extends x{constructor(){super(),this.rangeValueChangedByUser=!1,this.messages=C({blocking:!0}),this.focusSetter=b()(this),this.calendars=2,this.layout="horizontal",this.monthStyle="wide",this.proximitySelectionDisabled=!1,this.range=!1,this.scale="m",this.calciteDatePickerChange=g({cancelable:!1}),this.calciteDatePickerRangeChange=g({cancelable:!1}),this.listen("keydown",this.keyDownHandler)}static{this.properties={activeEndDate:[16,{},{state:!0}],activeStartDate:[16,{},{state:!0}],dateTimeFormat:[16,{},{state:!0}],hoverRange:[16,{},{state:!0}],localeData:[16,{},{state:!0}],activeDate:[0,{},{attribute:!1}],activeRange:[3,{},{reflect:!0}],calendars:[11,{},{type:Number,reflect:!0}],headingLevel:[11,{},{type:Number,reflect:!0}],layout:[3,{},{reflect:!0}],max:[3,{},{reflect:!0}],maxAsDate:[0,{},{attribute:!1}],messageOverrides:[0,{},{attribute:!1}],min:[3,{},{reflect:!0}],minAsDate:[0,{},{attribute:!1}],monthStyle:1,numberingSystem:[3,{},{reflect:!0}],proximitySelectionDisabled:[7,{},{reflect:!0,type:Boolean}],range:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],value:1,valueAsDate:[0,{},{attribute:!1}]}}static{this.styles=I}async reset(){this.resetActiveDates(),this.rangeValueChangedByUser=!1}async setFocus(t){return this.focusSetter(()=>this.el,t)}async load(){await this.loadLocaleData()}willUpdate(t){let e=t.get("valueAsDate"),a=this.valueAsDate,i=this.rangeValueChangedByUser&&!t.has("value")&&this.range&&z(e,a),s=t.has("value")&&t.has("valueAsDate");this.rangeValueChangedByUser&&!s&&!i&&(this.rangeValueChangedByUser=!1),t.has("value")&&this.valueHandler(this.value),t.has("valueAsDate")&&this.valueAsDateWatcher(this.valueAsDate),i&&(this.rangeValueChangedByUser=!1);let h=A(t,"min"),o=A(t,"max");h==="min"?this.minAsDate=this.min?l(this.min):void 0:h==="minAsDate"&&(this.minAsDate=l(r(this.minAsDate))),o==="max"?this.maxAsDate=this.max?l(this.max):void 0:o==="maxAsDate"&&(this.maxAsDate=l(r(this.maxAsDate))),(t.has("range")&&this.range||t.has("maxAsDate")||t.has("minAsDate"))&&this.setActiveStartAndEndDates(),t.has("activeDate")&&this.hasUpdated&&this.activeDateWatcher(this.activeDate),t.has("messages")&&this.hasUpdated&&this.loadLocaleData().catch(R.error)}activeDateWatcher(t){this.range&&(t?(this.activeStartDate=t,this.activeEndDate=c(this.activeStartDate)):this.resetActiveDates())}valueHandler(t){Array.isArray(t)?(this.valueAsDate=t.every(e=>e==="")?void 0:w(t),this.rangeValueChangedByUser||this.resetActiveDates()):t?this.valueAsDate=l(t):(this.valueAsDate=void 0,this.resetActiveDates())}valueAsDateWatcher(t){this.range&&Array.isArray(t)&&!this.rangeValueChangedByUser?this.setActiveStartAndEndDates():this.range||(t&&t!==this.activeDate?this.activeDate=t:t||this.resetActiveDates())}keyDownHandler(t){t.key==="Escape"&&this.resetActiveDates()}async loadLocaleData(){if(!1)return;let t=P(this.messages._lang);k.numberFormatOptions={numberingSystem:this.numberingSystem,locale:t,useGrouping:!1},this.localeData=await M(t),this.dateTimeFormat=$(t,O)}monthHeaderSelectChange(t){let e=new Date(t.detail.date),a=t.detail.position;this.range?a==="end"?(this.activeEndDate=e,this.activeStartDate=v(e)):(this.activeStartDate=e,this.activeEndDate=c(e)):this.activeDate=e,t.stopPropagation()}monthActiveDateChange(t){let e=new Date(t.detail);if(!this.range)this.activeDate=e;else{let a=e.getMonth(),i=a!==this.activeStartDate?.getMonth()&&(this.calendars===1||(this.activeStartDate?a!==c(this.activeStartDate).getMonth():!1));this.activeRange==="end"?(!this.activeEndDate||this.activeStartDate&&i)&&(this.activeEndDate=e,this.activeStartDate=v(e)):(this.activeStartDate&&i||!this.activeStartDate)&&(this.activeStartDate=e,this.activeEndDate=c(e))}t.stopPropagation()}monthHoverChange(t){if(!this.range){this.hoverRange=void 0;return}let{valueAsDate:e}=this,a=Array.isArray(e)?e[0]:void 0,i=Array.isArray(e)?e[1]:void 0,s=new Date(t.detail);if(this.hoverRange={focused:this.activeRange||"start",start:a,end:i},this.proximitySelectionDisabled)i&&a||!i&&a&&s>=a?(this.hoverRange.focused="end",this.hoverRange.end=s):!i&&a&&s<a?this.hoverRange={focused:"start",start:s,end:a}:this.hoverRange=void 0;else if(this.activeRange&&this.hoverRange)this.activeRange==="end"?(this.hoverRange.end=s,this.hoverRange.focused="end"):(this.hoverRange.start=s,this.hoverRange.focused="start");else if(a&&i){let h=Math.abs(D(s,a)),o=Math.abs(D(s,i));s>i?(this.hoverRange.end=s,this.hoverRange.focused="end"):s<a?(this.hoverRange.start=s,this.hoverRange.focused="start"):s>a&&s<i&&(h<o?(this.hoverRange.start=s,this.hoverRange.focused="start"):(this.hoverRange.end=s,this.hoverRange.focused="end"))}else a&&(s<a?this.hoverRange={focused:"start",start:s,end:a}:(this.hoverRange.end=s,this.hoverRange.focused="end"));t.stopPropagation()}monthMouseOutChange(t){this.hoverRange&&(this.hoverRange=void 0),t.stopPropagation()}resetActiveDates(){let{valueAsDate:t}=this;if(!Array.isArray(t)){if(t&&t!==this.activeDate)this.activeDate=new Date(t);else if(!t){this.activeDate=void 0;let e=this.getActiveDate(void 0,this.minAsDate,this.maxAsDate);this.range?(this.activeStartDate=e,this.activeEndDate=void 0):this.activeDate=e}}Array.isArray(t)&&(t[0]&&t[0]!==this.activeStartDate?this.activeStartDate=new Date(t[0]):t[0]||(this.activeStartDate=this.getActiveDate(void 0,this.minAsDate,this.maxAsDate)),t[1]&&t[1]!==this.activeEndDate?this.activeEndDate=new Date(t[1]):t[1]||(this.activeEndDate=void 0)),this.hoverRange=void 0}getEndDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0}setEndDate(t,e=!0){let a=this.getStartDate();this.rangeValueChangedByUser=!0,this.value=[r(a),r(t)],this.valueAsDate=[a,t],e&&this.calciteDatePickerRangeChange.emit()}getStartDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0}setStartDate(t,e=!0){let a=this.getEndDate();this.rangeValueChangedByUser=!0,this.value=[r(t),r(a)],this.valueAsDate=[t,a],e&&this.calciteDatePickerRangeChange.emit()}monthDateChange(t){let e=new Date(t.detail),a=r(e);if(!this.range&&a===r(this.valueAsDate))return;if(!this.range){this.value=a||"",this.valueAsDate=e||void 0,this.activeDate=e||void 0,this.calciteDatePickerChange.emit();return}let i=this.getStartDate(),s=this.getEndDate();if(!i||!s&&e<i)i&&this.setEndDate(new Date(i)),this.activeRange=="end"?this.setEndDate(e):this.setStartDate(e);else if(!s)this.setEndDate(e);else if(this.proximitySelectionDisabled)this.setStartDate(e,!1),this.setEndDate(void 0,!1),this.calciteDatePickerRangeChange.emit();else if(this.activeRange)this.activeRange=="end"?this.setEndDate(e):(e>s&&(this.setEndDate(void 0,!1),this.activeEndDate=void 0),this.setStartDate(e));else{let h=D(e,i),o=D(e,s);o===0||h<0?this.setStartDate(e):h===0||o<0?this.setEndDate(e):h<o?this.setStartDate(e):this.setEndDate(e)}t.stopPropagation(),this.calciteDatePickerChange.emit()}getActiveDate(t,e,a){let i=n(new Date,e,a);return n(this.activeDate,e,a)||t||(m(a,i)&&!this.range?f(i,e,a):i)}getActiveEndDate(t,e,a){return n(this.activeEndDate,e,a)||t||n(c(new Date),e,a)}setActiveStartAndEndDates(){if(this.range){let t=n(Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate),e=n(Array.isArray(this.valueAsDate)?this.valueAsDate[1]:void 0,this.minAsDate,this.maxAsDate);if(this.activeStartDate=this.getActiveDate(t,this.minAsDate,this.maxAsDate),this.activeEndDate=this.getActiveEndDate(e,this.minAsDate,this.maxAsDate),m(this.activeStartDate,this.activeEndDate)){let a=f(this.activeEndDate?v(this.activeEndDate):void 0,this.minAsDate,this.maxAsDate),i=this.activeEndDate?c(this.activeEndDate):void 0;u(a,this.minAsDate,this.maxAsDate)?this.activeStartDate=a:u(i,this.minAsDate,this.maxAsDate)&&(this.activeEndDate=i)}}}render(){let t=n(this.range&&Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate),e=this.getActiveDate(t,this.minAsDate,this.maxAsDate),a=this.range&&Array.isArray(this.valueAsDate)?n(this.valueAsDate[1],this.minAsDate,this.maxAsDate):void 0,i=this.range&&this.activeRange?this.activeRange==="start"?this.minAsDate:t:this.minAsDate,s=this.range?this.activeStartDate:e;return d`<div aria-hidden class=${S(B.container)} tabindex=-1>${this.renderMonth(s,this.maxAsDate,i,t,a)}</div>`}renderMonth(t,e,a,i,s){return d`<calcite-date-picker-month .activeDate=${t} .calendars=${this.calendars} .dateTimeFormat=${this.dateTimeFormat} .endDate=${this.range?s:void 0} .headingLevel=${this.headingLevel||F} .hoverRange=${this.hoverRange} .layout=${this.layout} .localeData=${this.localeData} .max=${e} .messages=${this.messages} .min=${a} .monthStyle=${this.monthStyle} @calciteInternalDatePickerDayHover=${this.monthHoverChange} @calciteInternalDatePickerDaySelect=${this.monthDateChange} @calciteInternalDatePickerMonthActiveDateChange=${this.monthActiveDateChange} @calciteInternalDatePickerMonthChange=${this.monthHeaderSelectChange} @calciteInternalDatePickerMonthMouseOut=${this.monthMouseOutChange} .range=${this.range} .scale=${this.scale} .selectedDate=${this.activeRange==="end"?s:i} .startDate=${this.range?i:void 0}></calcite-date-picker-month>`}};E("calcite-date-picker",p);export{p as DatePicker};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{D as $,F as e,h as n,l as s}from"./C4JD266W.js";var a={container:"inline-edit--container",enableEditing:"enable-editing",confirmChanges:"confirm-changes",cancelEditing:"cancel-editing"},C=({cancelEditingLabel:t,confirmChangesLabel:i,inlineEditing:o,enableEditingLabel:c,enableEditingButtonRef:d,loading:l,onCancelEditing:p,onConfirmChanges:m,onEnableEditing:u,scale:r,showControls:g})=>n`<div class=${e(a.container)}>${!o&&n`<calcite-action .ariaLabel=${c} class=${e(a.enableEditing)} icon=pencil @click=${u} .scale=${r} .text=${c} title=${c??s} type=button ${$(d)}></calcite-action>`||""}${g&&[n`<calcite-action .ariaLabel=${i} class=${e(a.confirmChanges)} .disabled=${l} icon=check .loading=${l} @click=${m} .scale=${r} .text=${i} title=${i??s} type=button></calcite-action>`,n`<calcite-action .ariaLabel=${t} class=${e(a.cancelEditing)} .disabled=${l} icon=x @click=${p} .scale=${r} .text=${t} title=${t??s} type=button></calcite-action>`]||""}</div>`,h=class{constructor(i){this.options=i,this.valuePriorToEditing=""}enable(){this.valuePriorToEditing=this.options.getValue(),this.options.setInlineEditing(!0),requestAnimationFrame(()=>{this.options.setFocus()}),this.options.emitEnableEditingChange()}disable(){this.options.setInlineEditing(!1)}cancelEditing(){this.options.restoreValue(this.valuePriorToEditing),this.disable(),this.options.emitCancel(),this.options.emitEnableEditingChange()}async confirm(i,o){if(i){o?.(!0);try{await i()}finally{o?.(!1)}}this.options.commitValue(),this.disable(),this.options.emitConfirm(),this.options.emitEnableEditingChange()}},y={fromAttribute(t){return t===null?!1:t==="controls-disabled"?t:!0},toAttribute(t){return t===!1?null:t===!0?"":t}};export{a,C as b,h as c,y as d};
2
+ import{D as $,F as e,h as n,l as s}from"./RQONITLI.js";var a={container:"inline-edit--container",enableEditing:"enable-editing",confirmChanges:"confirm-changes",cancelEditing:"cancel-editing"},C=({cancelEditingLabel:t,confirmChangesLabel:i,inlineEditing:o,enableEditingLabel:c,enableEditingButtonRef:d,loading:l,onCancelEditing:p,onConfirmChanges:m,onEnableEditing:u,scale:r,showControls:g})=>n`<div class=${e(a.container)}>${!o&&n`<calcite-action .ariaLabel=${c} class=${e(a.enableEditing)} icon=pencil @click=${u} .scale=${r} .text=${c} title=${c??s} type=button ${$(d)}></calcite-action>`||""}${g&&[n`<calcite-action .ariaLabel=${i} class=${e(a.confirmChanges)} .disabled=${l} icon=check .loading=${l} @click=${m} .scale=${r} .text=${i} title=${i??s} type=button></calcite-action>`,n`<calcite-action .ariaLabel=${t} class=${e(a.cancelEditing)} .disabled=${l} icon=x @click=${p} .scale=${r} .text=${t} title=${t??s} type=button></calcite-action>`]||""}</div>`,h=class{constructor(i){this.options=i,this.valuePriorToEditing=""}enable(){this.valuePriorToEditing=this.options.getValue(),this.options.setInlineEditing(!0),requestAnimationFrame(()=>{this.options.setFocus()}),this.options.emitEnableEditingChange()}disable(){this.options.setInlineEditing(!1)}cancelEditing(){this.options.restoreValue(this.valuePriorToEditing),this.disable(),this.options.emitCancel(),this.options.emitEnableEditingChange()}async confirm(i,o){if(i){o?.(!0);try{await i()}finally{o?.(!1)}}this.options.commitValue(),this.disable(),this.options.emitConfirm(),this.options.emitEnableEditingChange()}},y={fromAttribute(t){return t===null?!1:t==="controls-disabled"?t:!0},toAttribute(t){return t===!1?null:t===!0?"":t}};export{a,C as b,h as c,y as d};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as O}from"./T6CCMW7H.js";import{a as S}from"./VI7SBYXT.js";import{E as X,F as x,H as i,R as N,g as G,h as z,i as v}from"./C4JD266W.js";function B(t,s,n){let r=s[0]-t[0],o=n[0]-s[0],$=s[1]-t[1],c=n[1]-s[1],h=$/Number(r||o<0&&0),a=c/Number(o||r<0&&0),e=(h*o+a*r)/(r+o);return(Math.sign(h)+Math.sign(a))*Math.min(Math.abs(h),Math.abs(a),.5*Math.abs(e))||0}function Y(t,s,n){let r=s[0]-t[0],o=s[1]-t[1];return r?(3*o/r-n)/2:n}function Z(t,s,n,r,o){let[$,c]=t,[h,a]=s,e=(h-$)/3,l=o([$+e,c+e*n]).join(","),d=o([h-e,a-e*r]).join(","),m=o([h,a]).join(",");return`C ${l} ${d} ${m}`}function H({width:t,height:s,min:n,max:r}){let o=r[0]-n[0],$=r[1]-n[1];return c=>{let h=(c[0]-n[0])/o*t,a=s-(c[1]-n[1])/$*s;return[h,a]}}function I(t){let[s,n]=t[0],r=[s,n],o=[s,n];return t.reduce(({min:$,max:c},[h,a])=>({min:[Math.min($[0],h),Math.min($[1],a)],max:[Math.max(c[0],h),Math.max(c[1],a)]}),{min:r,max:o})}function R({data:t,min:s,max:n,t:r}){if(t.length<3)return"";let[o,$]=r(t[0]),[c,h]=r(s),[a]=r(n),e,l,d,m=t.reduce((y,M,u)=>{if(l=t[u-2],d=t[u-1],u>1){let g=B(l,d,M),f=e===void 0?Y(l,d,g):e,L=Z(l,d,f,g,r);return e=g,`${y} ${L}`}return y},`M ${c},${h} L ${c},${$} L ${o},${$}`),w=t[t.length-1],k=Z(d,w,e,Y(d,w,e),r);return`${m} ${k} L ${a},${h} Z`}var E=G`:host{display:block;block-size:100%}.svg{fill:currentColor;stroke:transparent;margin:0;display:block;block-size:100%;inline-size:100%;padding:0}.svg .graph-path--highlight{fill:var(--calcite-graph-highlight-fill-color, var(--calcite-color-brand));opacity:.5}:host([hidden]){display:none}[hidden]{display:none}`,b={svg:"svg",graphPath:"graph-path",graphPathHighlight:"graph-path--highlight"},C="calcite-graph",p={host:t=>`${C}-${t}`,linearGradient:t=>`linear-gradient-${C}-${t}`,mask:(t,s)=>`${C}-${t}${s}`},P=class extends X{constructor(){super(...arguments),this.graphId=O(),this.resizeObserver=S("resize",()=>this.requestUpdate()),this.data=[]}static{this.properties={colorStops:[0,{},{attribute:!1}],data:[0,{},{attribute:!1}],highlightMax:[9,{},{type:Number}],highlightMin:[9,{},{type:Number}],max:[11,{},{reflect:!0,type:Number}],min:[11,{},{reflect:!0,type:Number}]}}static{this.styles=E}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}render(){let{data:s,colorStops:n,el:r,highlightMax:o,highlightMin:$,min:c,max:h}=this,a=this.graphId,{clientHeight:e,clientWidth:l}=r;if(!s||s.length===0)return z`<svg aria-hidden=true class=${x(b.svg)} height=${e??i} preserveAspectRatio=none viewBox=${`0 0 ${l} ${e}`} width=${l??i}></svg>`;let{min:d,max:m}=I(s),w=d,k=m;(c<d[0]||c>d[0])&&(w=[c,0]),(h>m[0]||h<m[0])&&(k=[h,m[1]]);let y=H({min:w,max:k,width:l,height:e}),M=R({data:s,min:d,max:m,t:y}),u=n?`url(#${p.linearGradient(a)})`:void 0;if($!==void 0&&o!==void 0){let[g]=y([$,k[1]]),[f]=y([o,k[1]]);return z`<svg aria-hidden=true class=${x(b.svg)} height=${e??i} preserveAspectRatio=none viewBox=${`0 0 ${l} ${e}`} width=${l??i}>${v`${n?v`<defs><linearGradient id=${p.linearGradient(a)??i} x1=0 x2=1 y1=0 y2=0>${n.map(({offset:L,color:j,opacity:A})=>v`<stop offset=${`${L*100}%`} stop-color=${j??i} stop-opacity=${A??i} />`)}</linearGradient></defs>`:null}<mask height=100% id=${p.mask(a,1)??i} width=100% x=0% y=0%><path d=${`
2
+ import{a as O}from"./T6CCMW7H.js";import{a as S}from"./VI7SBYXT.js";import{E as X,F as x,H as i,R as N,g as G,h as z,i as v}from"./RQONITLI.js";function B(t,s,n){let r=s[0]-t[0],o=n[0]-s[0],$=s[1]-t[1],c=n[1]-s[1],h=$/Number(r||o<0&&0),a=c/Number(o||r<0&&0),e=(h*o+a*r)/(r+o);return(Math.sign(h)+Math.sign(a))*Math.min(Math.abs(h),Math.abs(a),.5*Math.abs(e))||0}function Y(t,s,n){let r=s[0]-t[0],o=s[1]-t[1];return r?(3*o/r-n)/2:n}function Z(t,s,n,r,o){let[$,c]=t,[h,a]=s,e=(h-$)/3,l=o([$+e,c+e*n]).join(","),d=o([h-e,a-e*r]).join(","),m=o([h,a]).join(",");return`C ${l} ${d} ${m}`}function H({width:t,height:s,min:n,max:r}){let o=r[0]-n[0],$=r[1]-n[1];return c=>{let h=(c[0]-n[0])/o*t,a=s-(c[1]-n[1])/$*s;return[h,a]}}function I(t){let[s,n]=t[0],r=[s,n],o=[s,n];return t.reduce(({min:$,max:c},[h,a])=>({min:[Math.min($[0],h),Math.min($[1],a)],max:[Math.max(c[0],h),Math.max(c[1],a)]}),{min:r,max:o})}function R({data:t,min:s,max:n,t:r}){if(t.length<3)return"";let[o,$]=r(t[0]),[c,h]=r(s),[a]=r(n),e,l,d,m=t.reduce((y,M,u)=>{if(l=t[u-2],d=t[u-1],u>1){let g=B(l,d,M),f=e===void 0?Y(l,d,g):e,L=Z(l,d,f,g,r);return e=g,`${y} ${L}`}return y},`M ${c},${h} L ${c},${$} L ${o},${$}`),w=t[t.length-1],k=Z(d,w,e,Y(d,w,e),r);return`${m} ${k} L ${a},${h} Z`}var E=G`:host{display:block;block-size:100%}.svg{fill:currentColor;stroke:transparent;margin:0;display:block;block-size:100%;inline-size:100%;padding:0}.svg .graph-path--highlight{fill:var(--calcite-graph-highlight-fill-color, var(--calcite-color-brand));opacity:.5}:host([hidden]){display:none}[hidden]{display:none}`,b={svg:"svg",graphPath:"graph-path",graphPathHighlight:"graph-path--highlight"},C="calcite-graph",p={host:t=>`${C}-${t}`,linearGradient:t=>`linear-gradient-${C}-${t}`,mask:(t,s)=>`${C}-${t}${s}`},P=class extends X{constructor(){super(...arguments),this.graphId=O(),this.resizeObserver=S("resize",()=>this.requestUpdate()),this.data=[]}static{this.properties={colorStops:[0,{},{attribute:!1}],data:[0,{},{attribute:!1}],highlightMax:[9,{},{type:Number}],highlightMin:[9,{},{type:Number}],max:[11,{},{reflect:!0,type:Number}],min:[11,{},{reflect:!0,type:Number}]}}static{this.styles=E}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}render(){let{data:s,colorStops:n,el:r,highlightMax:o,highlightMin:$,min:c,max:h}=this,a=this.graphId,{clientHeight:e,clientWidth:l}=r;if(!s||s.length===0)return z`<svg aria-hidden=true class=${x(b.svg)} height=${e??i} preserveAspectRatio=none viewBox=${`0 0 ${l} ${e}`} width=${l??i}></svg>`;let{min:d,max:m}=I(s),w=d,k=m;(c<d[0]||c>d[0])&&(w=[c,0]),(h>m[0]||h<m[0])&&(k=[h,m[1]]);let y=H({min:w,max:k,width:l,height:e}),M=R({data:s,min:d,max:m,t:y}),u=n?`url(#${p.linearGradient(a)})`:void 0;if($!==void 0&&o!==void 0){let[g]=y([$,k[1]]),[f]=y([o,k[1]]);return z`<svg aria-hidden=true class=${x(b.svg)} height=${e??i} preserveAspectRatio=none viewBox=${`0 0 ${l} ${e}`} width=${l??i}>${v`${n?v`<defs><linearGradient id=${p.linearGradient(a)??i} x1=0 x2=1 y1=0 y2=0>${n.map(({offset:L,color:j,opacity:A})=>v`<stop offset=${`${L*100}%`} stop-color=${j??i} stop-opacity=${A??i} />`)}</linearGradient></defs>`:null}<mask height=100% id=${p.mask(a,1)??i} width=100% x=0% y=0%><path d=${`
3
3
  M 0,0
4
4
  L ${g-1},0
5
5
  L ${g-1},${e}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as n}from"./24ZPXFO2.js";import{c as g}from"./XX43OXTK.js";import{D as h,h as a,l as f}from"./C4JD266W.js";var u={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function L(e,c){return c||e.closest("calcite-shell-panel")?.position||"start"}function k({actions:e,expandables:c,expanded:o}){e.filter(t=>t.slot!==n.menuActions).forEach(t=>t.textEnabled=o),c.forEach(t=>t.expanded=o)}function B({el:e,expanded:c}){Array.from(e.querySelectorAll("calcite-action")).filter(o=>o.slot!==n.menuActions&&(o.closest("calcite-action-menu")?o.slot===g.trigger:!0)).forEach(o=>o.textEnabled=c),e.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=c)}var d=({tooltip:e,referenceElement:c,expanded:o,ref:t})=>(e&&(e.referenceElement=!o&&c?c:void 0),t&&t(c),c),P=({collapseText:e,collapseLabel:c,direction:o,expanded:t,expandText:m,expandLabel:$,toggle:v,el:S,position:A,tooltip:r,ref:E,scale:T})=>{let b=o==="rtl",l=t?e:m,p=t?c:$,i=[u.chevronsLeft,u.chevronsRight];b&&i.reverse();let s=L(S,A)==="end",x=s?i[1]:i[0],y=s?i[0]:i[1];return a`<calcite-action .aria=${{expanded:t}} .icon=${t?x:y} id=expand-toggle .label=${p} @click=${v} .scale=${T} .text=${l} .textEnabled=${t} title=${(!t&&!r?l:void 0)??f} ${h(C=>d({tooltip:r,referenceElement:C,expanded:t,ref:E}))}></calcite-action>`};export{k as a,B as b,P as c};
2
+ import{a as n}from"./24ZPXFO2.js";import{c as g}from"./XX43OXTK.js";import{D as h,h as a,l as f}from"./RQONITLI.js";var u={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function L(e,c){return c||e.closest("calcite-shell-panel")?.position||"start"}function k({actions:e,expandables:c,expanded:o}){e.filter(t=>t.slot!==n.menuActions).forEach(t=>t.textEnabled=o),c.forEach(t=>t.expanded=o)}function B({el:e,expanded:c}){Array.from(e.querySelectorAll("calcite-action")).filter(o=>o.slot!==n.menuActions&&(o.closest("calcite-action-menu")?o.slot===g.trigger:!0)).forEach(o=>o.textEnabled=c),e.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=c)}var d=({tooltip:e,referenceElement:c,expanded:o,ref:t})=>(e&&(e.referenceElement=!o&&c?c:void 0),t&&t(c),c),P=({collapseText:e,collapseLabel:c,direction:o,expanded:t,expandText:m,expandLabel:$,toggle:v,el:S,position:A,tooltip:r,ref:E,scale:T})=>{let b=o==="rtl",l=t?e:m,p=t?c:$,i=[u.chevronsLeft,u.chevronsRight];b&&i.reverse();let s=L(S,A)==="end",x=s?i[1]:i[0],y=s?i[0]:i[1];return a`<calcite-action .aria=${{expanded:t}} .icon=${t?x:y} id=expand-toggle .label=${p} @click=${v} .scale=${T} .text=${l} .textEnabled=${t} title=${(!t&&!r?l:void 0)??f} ${h(C=>d({tooltip:r,referenceElement:C,expanded:t,ref:E}))}></calcite-action>`};export{k as a,B as b,P as c};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as e}from"./5DJ4CKCP.js";import{a as u}from"./47OZIMFV.js";import"./GZUPYOXJ.js";import{a as s}from"./EFHOM5XZ.js";import"./VUYX7MNO.js";import{a as m}from"./SS5ORQKB.js";import"./ZWPNZ5XW.js";import"./MTF3JNFW.js";import"./3QPETC2U.js";import{E as p,F as t,H as n,R as f,g as h,h as i}from"./C4JD266W.js";var x=h`:host{display:inline-flex}:host([scale=s]){--calcite-internal-navigation-logo-padding-inline: var(--calcite-space-md);--calcite-internal-navigation-logo-image-size: 1.75rem;--calcite-internal-navigation-logo-heading-font-size: var(--calcite-font-size-relative-base);--calcite-internal-navigation-logo-heading-standalone-font-size: var(--calcite-font-size-1);--calcite-internal-navigation-logo-description-font-size: var(--calcite-font-size-relative-sm);--calcite-internal-navigation-logo-heading-line-height: var(--calcite-space-lg);--calcite-internal-navigation-logo-description-line-height: var(--calcite-space-lg)}:host([scale=m]){--calcite-internal-navigation-logo-padding-inline: var(--calcite-space-lg);--calcite-internal-navigation-logo-image-size: 1.75rem;--calcite-internal-navigation-logo-heading-font-size: var(--calcite-font-size-relative-md);--calcite-internal-navigation-logo-heading-standalone-font-size: var(--calcite-font-size-relative-xl);--calcite-internal-navigation-logo-description-font-size: var(--calcite-font-size-relative-base);--calcite-internal-navigation-logo-heading-line-height: var(--calcite-space-xl);--calcite-internal-navigation-logo-description-line-height: var(--calcite-space-lg)}:host([scale=l]){--calcite-internal-navigation-logo-padding-inline: var(--calcite-space-xl);--calcite-internal-navigation-logo-image-size: 2.75rem;--calcite-internal-navigation-logo-heading-font-size: var(--calcite-font-size-relative-xl);--calcite-internal-navigation-logo-heading-standalone-font-size: var(--calcite-font-size-relative-2xl);--calcite-internal-navigation-logo-description-font-size: var(--calcite-font-size-relative-lg);--calcite-internal-navigation-logo-heading-line-height: var(--calcite-space-2xl);--calcite-internal-navigation-logo-description-line-height: var(--calcite-space-2xl)}.container{margin:0;display:flex;align-items:center;justify-content:center;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);background-color:var(--calcite-navigation-background-color, var(--calcite-internal-navigation-logo-background-color, var(--calcite-color-foreground-1)));border-block-end:2px solid var(--calcite-color-transparent)}.container--link{cursor:pointer;text-decoration-line:none;outline-color:transparent}:host(:focus) .container--link{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))))}.image{block-size:var(--calcite-internal-navigation-logo-image-size)}.image,.icon{margin:0;display:flex;color:var(--calcite-navigation-logo-text-color, var(--calcite-icon-color, var(--calcite-internal-navigation-logo-text-color, var(--calcite-ui-icon-color, inherit))));padding-inline:var(--calcite-internal-navigation-logo-padding-inline)}.image~.icon{padding-inline-start:0px}.image~.text-container,.icon~.text-container{padding-inline-start:0px}:host([href]:hover),:host([href]:focus){--calcite-internal-navigation-logo-background-color: var(--calcite-color-foreground-2)}:host([href]:active){--calcite-internal-navigation-logo-background-color: var(--calcite-color-foreground-3)}:host([active]) .container{border-block-end-color:var(--calcite-navigation-accent-color, var(--calcite-color-brand))}:host([active]),:host([href]:active){--calcite-internal-navigation-logo-text-color: var(--calcite-color-brand)}.text-container{margin-block-start:.125rem;display:flex;flex-direction:column;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:start;padding-inline:var(--calcite-internal-navigation-logo-padding-inline)}.heading{margin-inline-start:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-navigation-logo-heading-text-color, var(--calcite-color-text-1));font-size:var(--calcite-internal-navigation-logo-heading-font-size);padding-block-start:var(--calcite-space-2xs);line-height:var(--calcite-internal-navigation-logo-heading-line-height)}.standalone{font-size:var(--calcite-internal-navigation-logo-heading-standalone-font-size);padding-block-start:0}.description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--calcite-color-text-2);color:var(--calcite-navigation-logo-text-color, var(--calcite-color-text-2));font-size:var(--calcite-internal-navigation-logo-description-font-size);line-height:var(--calcite-internal-navigation-logo-description-line-height)}:host([hidden]){display:none}[hidden]{display:none}`,g=class extends p{constructor(){super(...arguments),this.focusSetter=m()(this),this.active=!1,this.iconFlipRtl=!1,this.scale="m"}static{this.properties={active:[7,{},{reflect:!0,type:Boolean}],description:1,heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],href:[3,{},{reflect:!0}],icon:[3,{},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],label:1,rel:[3,{},{reflect:!0}],target:[3,{},{reflect:!0}],thumbnail:1,scale:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=x}async setFocus(a){return this.focusSetter(()=>this.href?this.el:void 0,a)}renderIcon(){return i`<calcite-icon class=${t(e.icon)} .flipRtl=${this.iconFlipRtl} .icon=${this.icon} .scale=${this.scale==="s"?"m":"l"}></calcite-icon>`}renderHeaderContent(){let{heading:a,headingLevel:o,description:l}=this,c=a?s(e.heading,u({class:{[e.heading]:!0,[e.standalone]:!this.description},level:o,children:a})):null,r=l?s(e.description,i`<span class=${t(e.description)}>${l}</span>`):null;return c||r?s(e.textContainer,i`<div class=${t(e.textContainer)}>${c}${r}</div>`):null}render(){let{icon:a,href:o,label:l,rel:c,target:r,thumbnail:d}=this,v=i`${d&&i`<img alt=${(l||"")??n} class=${t(e.image)} src=${d??n}>`||""}${a&&this.renderIcon()||""}${this.renderHeaderContent()}`;return o?i`<a class=${t({[e.container]:!0,[e.containerLink]:!0})} href=${o??n} rel=${c??n} target=${r??n}>${v}</a>`:i`<div class=${t(e.container)}>${v}</div>`}};f("calcite-navigation-logo",g);export{g as NavigationLogo};
2
+ import{a as e}from"./5DJ4CKCP.js";import{a as u}from"./NURDERM3.js";import"./DXBCV4IS.js";import{a as s}from"./XIIT6OKF.js";import"./VUYX7MNO.js";import{a as m}from"./PW7YMRBF.js";import"./ZWPNZ5XW.js";import"./I5K6EDCU.js";import"./3QPETC2U.js";import{E as p,F as t,H as n,R as f,g as h,h as i}from"./RQONITLI.js";var x=h`:host{display:inline-flex}:host([scale=s]){--calcite-internal-navigation-logo-padding-inline: var(--calcite-space-md);--calcite-internal-navigation-logo-image-size: 1.75rem;--calcite-internal-navigation-logo-heading-font-size: var(--calcite-font-size-relative-base);--calcite-internal-navigation-logo-heading-standalone-font-size: var(--calcite-font-size-1);--calcite-internal-navigation-logo-description-font-size: var(--calcite-font-size-relative-sm);--calcite-internal-navigation-logo-heading-line-height: var(--calcite-space-lg);--calcite-internal-navigation-logo-description-line-height: var(--calcite-space-lg)}:host([scale=m]){--calcite-internal-navigation-logo-padding-inline: var(--calcite-space-lg);--calcite-internal-navigation-logo-image-size: 1.75rem;--calcite-internal-navigation-logo-heading-font-size: var(--calcite-font-size-relative-md);--calcite-internal-navigation-logo-heading-standalone-font-size: var(--calcite-font-size-relative-xl);--calcite-internal-navigation-logo-description-font-size: var(--calcite-font-size-relative-base);--calcite-internal-navigation-logo-heading-line-height: var(--calcite-space-xl);--calcite-internal-navigation-logo-description-line-height: var(--calcite-space-lg)}:host([scale=l]){--calcite-internal-navigation-logo-padding-inline: var(--calcite-space-xl);--calcite-internal-navigation-logo-image-size: 2.75rem;--calcite-internal-navigation-logo-heading-font-size: var(--calcite-font-size-relative-xl);--calcite-internal-navigation-logo-heading-standalone-font-size: var(--calcite-font-size-relative-2xl);--calcite-internal-navigation-logo-description-font-size: var(--calcite-font-size-relative-lg);--calcite-internal-navigation-logo-heading-line-height: var(--calcite-space-2xl);--calcite-internal-navigation-logo-description-line-height: var(--calcite-space-2xl)}.container{margin:0;display:flex;align-items:center;justify-content:center;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);background-color:var(--calcite-navigation-background-color, var(--calcite-internal-navigation-logo-background-color, var(--calcite-color-foreground-1)));border-block-end:2px solid var(--calcite-color-transparent)}.container--link{cursor:pointer;text-decoration-line:none;outline-color:transparent}:host(:focus) .container--link{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))))}.image{block-size:var(--calcite-internal-navigation-logo-image-size)}.image,.icon{margin:0;display:flex;color:var(--calcite-navigation-logo-text-color, var(--calcite-icon-color, var(--calcite-internal-navigation-logo-text-color, var(--calcite-ui-icon-color, inherit))));padding-inline:var(--calcite-internal-navigation-logo-padding-inline)}.image~.icon{padding-inline-start:0px}.image~.text-container,.icon~.text-container{padding-inline-start:0px}:host([href]:hover),:host([href]:focus){--calcite-internal-navigation-logo-background-color: var(--calcite-color-foreground-2)}:host([href]:active){--calcite-internal-navigation-logo-background-color: var(--calcite-color-foreground-3)}:host([active]) .container{border-block-end-color:var(--calcite-navigation-accent-color, var(--calcite-color-brand))}:host([active]),:host([href]:active){--calcite-internal-navigation-logo-text-color: var(--calcite-color-brand)}.text-container{margin-block-start:.125rem;display:flex;flex-direction:column;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:start;padding-inline:var(--calcite-internal-navigation-logo-padding-inline)}.heading{margin-inline-start:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-navigation-logo-heading-text-color, var(--calcite-color-text-1));font-size:var(--calcite-internal-navigation-logo-heading-font-size);padding-block-start:var(--calcite-space-2xs);line-height:var(--calcite-internal-navigation-logo-heading-line-height)}.standalone{font-size:var(--calcite-internal-navigation-logo-heading-standalone-font-size);padding-block-start:0}.description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--calcite-color-text-2);color:var(--calcite-navigation-logo-text-color, var(--calcite-color-text-2));font-size:var(--calcite-internal-navigation-logo-description-font-size);line-height:var(--calcite-internal-navigation-logo-description-line-height)}:host([hidden]){display:none}[hidden]{display:none}`,g=class extends p{constructor(){super(...arguments),this.focusSetter=m()(this),this.active=!1,this.iconFlipRtl=!1,this.scale="m"}static{this.properties={active:[7,{},{reflect:!0,type:Boolean}],description:1,heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],href:[3,{},{reflect:!0}],icon:[3,{},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],label:1,rel:[3,{},{reflect:!0}],target:[3,{},{reflect:!0}],thumbnail:1,scale:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=x}async setFocus(a){return this.focusSetter(()=>this.href?this.el:void 0,a)}renderIcon(){return i`<calcite-icon class=${t(e.icon)} .flipRtl=${this.iconFlipRtl} .icon=${this.icon} .scale=${this.scale==="s"?"m":"l"}></calcite-icon>`}renderHeaderContent(){let{heading:a,headingLevel:o,description:l}=this,c=a?s(e.heading,u({class:{[e.heading]:!0,[e.standalone]:!this.description},level:o,children:a})):null,r=l?s(e.description,i`<span class=${t(e.description)}>${l}</span>`):null;return c||r?s(e.textContainer,i`<div class=${t(e.textContainer)}>${c}${r}</div>`):null}render(){let{icon:a,href:o,label:l,rel:c,target:r,thumbnail:d}=this,v=i`${d&&i`<img alt=${(l||"")??n} class=${t(e.image)} src=${d??n}>`||""}${a&&this.renderIcon()||""}${this.renderHeaderContent()}`;return o?i`<a class=${t({[e.container]:!0,[e.containerLink]:!0})} href=${o??n} rel=${c??n} target=${r??n}>${v}</a>`:i`<div class=${t(e.container)}>${v}</div>`}};f("calcite-navigation-logo",g);export{g as NavigationLogo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as Re}from"./ARGJ6OH5.js";import{a as ye}from"./4QWJ3PQW.js";import{b as _,c as Ve,d as Y,f as R,g as O,h as Z,i as Oe}from"./F7QRXMLE.js";import{a as B,b as G,d as r,e as h,f as q}from"./47B6Y2DM.js";import{d as U}from"./C4WP5EBM.js";import{a as Ie}from"./BT5DZOUY.js";import{b as T}from"./2LI2WSK2.js";import{a as we}from"./KHHDNGH6.js";import{c as Me}from"./5DBVFWEL.js";import{a as ve}from"./DKJI4BME.js";import{a as He}from"./DAOPIMWW.js";import{a as be}from"./36PA4H5Z.js";import{a as Le}from"./F2OABFYE.js";import{a as N,c as W,d as me,e as Ce,f as ge,g as V,h as Se}from"./5H5WEST3.js";import{a as fe}from"./QEZ3GMQZ.js";import{a as he}from"./JTEP2OIU.js";import{a as H}from"./EFHOM5XZ.js";import{a as xe}from"./G7WSKLO4.js";import{a as ue}from"./VXDPJESZ.js";import{a as pe}from"./T6CCMW7H.js";import{a as A,b as F}from"./VI7SBYXT.js";import{a as de}from"./AISTEJ33.js";import"./VUYX7MNO.js";import{a as se}from"./SS5ORQKB.js";import{a as z,b as E}from"./ZWPNZ5XW.js";import{e as re}from"./MTF3JNFW.js";import{i as w,l as P,p as ne}from"./3QPETC2U.js";import{B as te,C as M,D as S,E as oe,F as p,J as ie,L as ae,O as ce,R as le,g as ee,h as x,l as m,p as v}from"./C4JD266W.js";var k="48px";var Ae=ee`: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{position:relative;display:block}:host([scale=s]){font-size:var(--calcite-font-size-relative-sm);--calcite-internal-combobox-spacing-unit-l: .5rem;--calcite-internal-combobox-spacing-unit-s: .25rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-2xs);--calcite-internal-combobox-no-matches-spacing-unit-s: .25rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.25rem - 1px) ;--calcite-internal-close-size: 1rem}:host([scale=m]){font-size:var(--calcite-font-size-relative-base);--calcite-internal-combobox-spacing-unit-l: .75rem;--calcite-internal-combobox-spacing-unit-s: .5rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm);--calcite-internal-combobox-no-matches-spacing-unit-s: .375rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.5rem - 1px) ;--calcite-internal-close-size: 1.5rem}:host([scale=l]){font-size:var(--calcite-font-size-relative-md);--calcite-internal-combobox-spacing-unit-l: 1rem;--calcite-internal-combobox-spacing-unit-s: .75rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm-plus);--calcite-internal-combobox-no-matches-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-combobox-input-height: 1.5rem;--calcite-internal-combobox-input-margin-block: calc(var(--calcite-space-sm-plus) - 1px);--calcite-internal-close-size: 2rem}.wrapper{display:flex;border-width:1px;border-style:solid;outline-color:transparent;padding-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);border-radius:var(--calcite-combobox-corner-radius, var(--calcite-corner-radius));background-color:var(--calcite-combobox-input-background-color, var(--calcite-color-foreground-1));color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));border-color:var(--calcite-combobox-input-border-color, var(--calcite-color-border-input))}.wrapper:hover .icon{color:var(--calcite-combobox-icon-color-hover, var(--calcite-color-text-1))}:host(:focus-within) .wrapper,.wrapper--active{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))))}:host([read-only]) .wrapper{background-color:var(--calcite-color-background)}:host([read-only]) .label{font-weight:var(--calcite-font-weight-medium)}:host([status=invalid]) .wrapper{border-color:var(--calcite-color-status-danger)}:host([status=invalid]:focus-within) .wrapper{outline:var(--calcite-border-width-md) solid var(--calcite-color-status-danger);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.wrapper--single{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);cursor:pointer;flex-wrap:nowrap}.grid-input{position:relative;display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;gap:var(--calcite-internal-combobox-spacing-unit-s);margin-inline-end:var(--calcite-internal-combobox-spacing-unit-s)}.grid-input.selection-display--fit,.grid-input.selection-display--single{flex-wrap:nowrap;overflow:hidden}.input{flex-grow:1;appearance:none;overflow:hidden;text-overflow:ellipsis;border-style:none;background-color:transparent;padding:0;font-family:inherit;color:var(--calcite-color-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);inline-size:100%;margin-block-end:var(--calcite-internal-combobox-spacing-unit-s);min-inline-size:4.8125rem}.input:focus{outline:2px solid transparent;outline-offset:2px}.input:placeholder-shown{text-overflow:ellipsis}.input--single{padding:0;margin-block:var(--calcite-internal-combobox-input-margin-block)}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;width:0px;min-width:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.placeholder-icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.input-wrap{display:flex;flex-grow:1;align-items:center}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;max-width:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.icon-end,.icon-start{display:flex;cursor:pointer;align-items:center}.icon-end{flex:none}.icon-end .icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.floating-ui-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.floating-ui-container{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .floating-ui-container{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.floating-ui-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.floating-ui-container:popover-open{display:block}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.floating-ui-container .calcite-floating-ui-anim{box-shadow:var(--calcite-shadow-md)}@media(forced-colors:active){.wrapper,.floating-ui-container{border:1px solid canvasText}}.screen-readers-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.list-container{max-height:45vh;overflow-y:auto;inline-size:var(--calcite-dropdown-width, 100%);background-color:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1))}.list{margin:0;display:block;padding:0;line-height:var(--calcite-font-line-height-relative-snug)}.list--hide{height:0px;overflow:hidden}calcite-chip{--calcite-animation-timing: 0}.chip{margin-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);max-inline-size:100%}.chip--invisible{visibility:hidden;position:absolute}.item{display:block}.select-all{background-color:var(--calcite-combobox-item-background-color-active, var(--calcite-color-foreground-1));border-block-end-color:var(--calcite-combobox-divider-color, var(--calcite-combobox-item-border-color, var(--calcite-color-border-3)));border-block-end-style:solid;border-block-end-width:var(--calcite-border-width-sm);inset-block-start:0;position:sticky;z-index:var(--calcite-z-index-sticky)}.no-matches{padding-block:var(--calcite-internal-combobox-no-matches-spacing-unit-s);padding-inline:var(--calcite-internal-combobox-spacing-unit-l);color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));background:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1));cursor:pointer}.no-matches-placeholder{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3));cursor:default}.disabled{opacity:.5}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.clear-button--container{display:flex;cursor:pointer;align-items:center}.clear-button--container:hover calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color: var(--calcite-clear-button-icon-color-hover, var(--calcite-color-text-1))}.clear-button--container:active calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color-press, var(--calcite-color-text-1))}.clear-button--container calcite-action{--calcite-internal-action-height: 100%;--calcite-internal-action-padding-inline: var(--calcite-spacing-none);--calcite-internal-action-padding-block: var(--calcite-spacing-none);--calcite-action-background-color: var(--calcite-clear-button-background-color, var(--calcite-color-foreground-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color)}.clear-button--container calcite-action:hover{--calcite-action-background-color-hover: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-hover)}.clear-button--container calcite-action:active{--calcite-action-background-color-press: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-press)}:host([scale=s]) .clear-button--container{padding:var(--calcite-space-2xs)}:host([scale=m]) .clear-button--container{padding:var(--calcite-space-2xs);padding-inline-end:var(--calcite-space-sm)}:host([scale=l]) .clear-button--container{padding-inline-end:var(--calcite-space-sm-plus)}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}:host([hidden]){display:none}[hidden]{display:none}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-spacing-base)}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-xxs)}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-md)}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}::placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-input-placeholder-text-color, var(--calcite-color-text-3))}`,X=class extends oe{constructor(){super(),this.direction=re(),this.formSupport=Me({inputType:"text"})(this),this.selectAllComboboxItemRef=M(),this.allSelectedIndicatorChipRef=M(),this.data=[],this.cancelable=xe()(this),this.filterItems=(()=>{let e=(t,o)=>t&&o.some(({el:i})=>t===i);return ue((t,o=!1,i=!0)=>{let a=ye([...this.data,...this.groupData],t,this.effectiveFilterProps),c=this.getItemsAndGroups(),l=t==="";c.forEach(n=>{if(l){n.itemHidden=!1;return}let s=!e(n,a);n.itemHidden=s;let[C,d]=n.ancestors;(e(C,a)||e(d,a))&&(n.itemHidden=!1),s||n.ancestors.forEach(f=>f.itemHidden=!1)}),this.noMatchesFound=this.filteredItems.length===0&&!!this.filterText,this.filterTextMatchPattern=this.filterText?new RegExp(`(${T(this.filterText)})`,"i"):void 0,this.keyboardNavItems.forEach(n=>{n.filterTextMatchPattern=this.filterTextMatchPattern}),o&&(this.open=this.filterText.trim().length>0),i&&this.calciteComboboxFilterChange.emit()},ae.filter)})(),this._filterText="",this.getSelectedItems=()=>{if(!this.isMulti()){let e=this.allItems.find(({selected:t})=>t);return e?[e]:[]}return this.allItems.filter(e=>e.selected&&(this.selectionMode!=="ancestors"||!Y(e)))},this.groupData=[],this.groupItems=[],this.guid=pe(),this.ignoreSelectedEventsFlag=!1,this.internalValueChangeFlag=!1,this.previousAllSelected=!1,this.refreshingSelectionDisplay=!1,this.mutationObserver=A("mutation",()=>this.updateItems()),this.onLabelClick=()=>{this.setFocus()},this.transitionProp="opacity",this.resizeObserver=(()=>{let e=!1;return A("resize",()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1,this.setMaxScrollerHeight(),this.refreshSelectionDisplay()}))})})(),this.selectedIndicatorChipRef=M(),this.selectedChipCountRef=M(),this.clearButtonRef=M(),this._selectedItems=[],this.textInputRef=M(),this._value="",this.messages=de({blocking:!0}),this.focusSetter=se()(this),this.customChipAddHandler=()=>{this.addCustomChip(this.filterText,!0)},this.interactiveContainer=he(this),this.topLayer=be({target:()=>this.floatingEl})(this),this.activeChipIndex=-1,this.activeDescendant="",this.activeItemIndex=-1,this.compactSelectionDisplay=!1,this.deferFitChipCountRender=!1,this.selectedHiddenChipsCount=0,this.selectedVisibleChipsCount=0,this.fitUsingCompactCountLabel=!1,this.allItems=[],this.items=[],this.noMatchesFound=!1,this.clearDisabled=!1,this.disabled=!1,this.maxItems=0,this.open=!1,this.overlayPositioning="absolute",this.placeholderIconFlipRtl=!1,this.placement=N,this.readOnly=!1,this.required=!1,this.scale="m",this.selectAllEnabled=!1,this.selectionDisplay="all",this.selectionAppearance="icon",this.selectionMode="multiple",this.status="idle",this.topLayerDisabled=!1,this.calciteComboboxBeforeClose=v({cancelable:!1}),this.calciteComboboxBeforeOpen=v({cancelable:!1}),this.calciteComboboxChange=v({cancelable:!1}),this.calciteComboboxChipClose=v({cancelable:!1}),this.calciteComboboxClose=v({cancelable:!1}),this.calciteComboboxFilterChange=v({cancelable:!1}),this.calciteComboboxOpen=v({cancelable:!1}),He(this),this.listenOn(document,"click",this.documentClickHandler),this.listen("calciteComboboxItemChange",this.calciteComboboxItemChangeHandler),this.listen("calciteInternalComboboxItemChange",this.calciteInternalComboboxItemChangeHandler),this.listen("click",this.comboboxFocusHandler)}static{this.properties={activeChipIndex:[16,{},{state:!0}],activeDescendant:[16,{},{state:!0}],activeItemIndex:[16,{},{state:!0}],compactSelectionDisplay:[16,{},{state:!0}],deferFitChipCountRender:[16,{},{state:!0}],selectedHiddenChipsCount:[16,{},{state:!0}],selectedVisibleChipsCount:[16,{},{state:!0}],fitUsingCompactCountLabel:[16,{},{state:!0}],allItems:[16,{},{state:!0}],items:[16,{},{state:!0}],noMatchesFound:[16,{},{state:!0}],allowCustomValues:[7,{},{reflect:!0,type:Boolean}],clearDisabled:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],filterText:[3,{},{reflect:!0}],filterProps:[0,{},{attribute:!1}],filteredItems:[32,{},{attribute:!1,readOnly:!0}],flipPlacements:[0,{},{attribute:!1}],form:[3,{},{reflect:!0}],label:1,labelText:1,maxItems:[11,{},{reflect:!0,type:Number}],messageOverrides:[0,{},{attribute:!1}],name:[3,{},{reflect:!0}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placeholder:1,placeholderIcon:[3,{},{reflect:!0}],placeholderIconFlipRtl:[7,{},{reflect:!0,type:Boolean}],placement:[3,{},{reflect:!0}],readOnly:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selectAllEnabled:[7,{},{reflect:!0,type:Boolean}],selectedItems:[0,{},{attribute:!1}],selectionDisplay:[3,{},{reflect:!0}],selectionAppearance:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}],status:[3,{},{reflect:!0}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],validationIcon:[3,{converter:ie},{reflect:!0}],validationMessage:1,validity:[32,{},{readOnly:!0,attribute:!1}],value:1}}static{this.formAssociated=!0}static{this.styles=Ae}get effectiveFilterProps(){return this.filterProps?this.filterProps.filter(e=>e!=="el"):["description","label","metadata","shortHeading"]}get showingInlineIcon(){let{placeholderIcon:e,selectionMode:t,selectedItems:o,open:i}=this,a=o[0],c=a?.icon,l=R(t);return!i&&a?!!c&&l:!!e&&(!a||l)}get allSelected(){let e=this.allItems.filter(t=>!t.disabled);return e.length>0&&e.every(t=>t.selected)}get hasDisabledSelected(){return this.allItems.some(e=>e.disabled&&e.selected)}get indeterminate(){let e=this.selectedItems.length>0||this.hasDisabledSelected;return this.selectAllEnabled?!this.allSelected&&e:this.selectedItems.length>0&&!this.allSelected}get keyboardNavItems(){let{selectAllComboboxItemRef:e}=this,t=this.filteredItems.filter(o=>!o.disabled);return e.value?[e.value,...t]:t}get filterText(){return this._filterText}set filterText(e){let t=this._filterText;e!==t&&(this._filterText=e,this.filterTextChange(e))}get filteredItems(){return this.items.filter(e=>!E(e))}get selectedItems(){return this._selectedItems}set selectedItems(e){let t=this._selectedItems;e!==t&&(this._selectedItems=e,this.selectedItemsHandler())}get value(){return this._value}set value(e){let t=this._value;e!==t&&(this._value=e,this.valueHandler(e))}async reposition(e=!1){let{floatingEl:t,referenceEl:o,placement:i,overlayPositioning:a,filteredFlipPlacements:c}=this;return Ce(this,{direction:this.direction,floatingEl:t,referenceEl:o,overlayPositioning:a,placement:i,flipPlacements:c,type:"menu"},e)}async setFocus(e){return this.focusSetter(()=>(this.activeChipIndex=-1,this.activeItemIndex=-1,this.textInputRef.value),e)}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),V(this),this.cancelable.add(this.filterItems)}async load(){this.handleSelectionModeWarning()}willUpdate(e){e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.handleDisabledChange(this.disabled),e.has("maxItems")&&(this.hasUpdated||this.maxItems!==0)&&this.setMaxScrollerHeight(),(e.has("overlayPositioning")&&(this.hasUpdated||this.overlayPositioning!=="absolute")||e.has("placement")&&(this.hasUpdated||this.placement!==N))&&this.reposition(!0),(e.has("selectionMode")||e.has("scale")||e.has("selectionAppearance"))&&this.updateItems(),e.has("flipPlacements")&&this.flipPlacementsHandler()}loaded(){V(this),this.updateItems(),this.filterItems(this.filterText,!1,!1)}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),Se(this)}emitComboboxChange(){this.calciteComboboxChange.emit()}filterTextChange(e){this.updateActiveItemIndex(-1),this.filterItems(e,!0)}openHandler(){this.disabled||fe(this)}handleDisabledChange(e){e||(this.open=!1)}valueHandler(e){this.internalValueChangeFlag||(this.items.forEach(t=>{t.selected=Array.isArray(e)?e.includes(t.value):e===t.value}),this.updateItems())}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}selectedItemsHandler(){let e=this.previousAllSelected,t=this.allSelected;if(this.previousAllSelected=t,this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1,this.selectionDisplay==="fit"&&this.isMulti()){let o=e&&!t;e&&!t&&(this.selectedHiddenChipsCount=0,this.selectedItems.forEach(i=>{let a=this.referenceEl?.querySelector(`#${h.chip(i.guid)}`);a&&this.showChip(a)})),this.updateComplete.then(async()=>{o&&await this.updateComplete,await this.refreshSelectionDisplay(),this.fitFollowUpRefreshPromise&&await this.fitFollowUpRefreshPromise,this.deferFitChipCountRender=!1})}}async documentClickHandler(e){this.disabled||e.composedPath().includes(this.el)||(await this.componentOnReady(),!this.allowCustomValues&&this.filterText&&(this.clearInputValue(),this.filterItems(""),this.updateActiveItemIndex(-1)),this.allowCustomValues&&this.filterText.trim().length&&this.addCustomChip(this.filterText),this.open=!1)}handleSelectAll(e){e&&(this.toggleSelectAll(),this.selectionDisplay!=="fit"&&this.allSelected&&this.selectedItems.forEach(t=>{let o=this.referenceEl.querySelector(`#${h.chip(t.guid)}`);o&&this.hideChip(o)}))}updateSelectedItems(){this.selectedItems=this.getOrderedSelectedItems(this.getSelectedItems())}calciteComboboxItemChangeHandler(e){if(this.ignoreSelectedEventsFlag)return;let t=e.target,o=e.composedPath().includes(this.selectAllComboboxItemRef.value);this.selectAllEnabled&&this.handleSelectAll(o);let i=this.keyboardNavItems.indexOf(o?this.selectAllComboboxItemRef.value:t);this.updateActiveItemIndex(i),this.toggleSelection(t,t.selected)}calciteInternalComboboxItemChangeHandler(e){e.stopPropagation(),this.hasUpdated&&this.updateItems()}clearValue(){let e=this.items.filter(t=>t.selected&&!t.disabled);e.length&&(this.ignoreSelectedEventsFlag=!0,e.forEach(t=>t.selected=!1),this.ignoreSelectedEventsFlag=!1,this.updateSelectedItems(),this.emitComboboxChange()),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems(""),this.setFocus()}clearInputValue(){this.textInputRef.value&&(this.textInputRef.value.value=""),this.filterText=""}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?me(t,e):void 0}getValue(){let e=this.getOrderedSelectedValues(this.selectedItems.map(t=>t.value?.toString()));return e.length?e.length>1?e:e[0]:""}getOrderedSelectedValues(e){if(!this.isMulti())return e;let t=Array.isArray(this.value)?this.value:this.value?[this.value]:[];return Oe(e,t)}getOrderedSelectedItems(e){return this.isMulti()?Z(e,this.selectedItems):e}comboboxInViewport(){let e=this.el.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.right<=(window.innerWidth||document.documentElement.clientWidth)&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)}toggleSelectAll(){let e=!this.allSelected;this.allItems.forEach(t=>{t.disabled||(t.selected=e)}),this.updateSelectedItems(),this.emitComboboxChange()}hasHiddenSelectedFitChips(){if(this.selectionDisplay!=="fit"||!this.isMulti())return!1;let e=this.selectedChipCountRef.value;return!!e&&!e.classList.contains(r.chipInvisible)}keyDownHandler(e){if(this.readOnly)return;let{key:t}=e;switch(t){case"Tab":this.activeChipIndex=-1,this.activeItemIndex=-1,this.allowCustomValues&&this.filterText?(this.addCustomChip(this.filterText,!0),e.preventDefault()):this.open?(this.open=!1,e.preventDefault()):!this.allowCustomValues&&this.filterText&&(this.clearInputValue(),this.filterItems(""),this.updateActiveItemIndex(-1));break;case"ArrowLeft":(this.activeChipIndex!==-1||this.textInputRef.value?.selectionStart===0)&&(this.previousChip(),e.preventDefault());break;case"ArrowRight":this.activeChipIndex!==-1&&(this.nextChip(),e.preventDefault());break;case"ArrowUp":this.keyboardNavItems.length&&(e.preventDefault(),this.open&&this.shiftActiveItemIndex(-1),this.scrollToActiveOrSelectedItem(),this.comboboxInViewport()||this.el.scrollIntoView()),this.scrollToActiveOrSelectedItem();break;case"ArrowDown":this.keyboardNavItems.length&&(e.preventDefault(),this.open?this.shiftActiveItemIndex(1):(this.open=!0,this.ensureRecentSelectedItemIsActive()),this.scrollToActiveOrSelectedItem(),this.comboboxInViewport()||this.el.scrollIntoView());break;case" ":!this.textInputRef.value?.value&&!e.defaultPrevented&&(!this.open&&this.keyboardNavItems.length&&(this.open=!0,this.ensureRecentSelectedItemIsActive()),e.preventDefault());break;case"Home":if(!this.open)return;e.preventDefault(),this.updateActiveItemIndex(0),this.scrollToActiveOrSelectedItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"End":if(!this.open)return;e.preventDefault(),this.updateActiveItemIndex(this.filteredItems.length-1),this.scrollToActiveOrSelectedItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"Escape":if(this.open){this.open=!1,e.preventDefault();break}this.clearDisabled||(this.textInputRef.value.value.length>0?(this.resetText(),e.preventDefault()):this.selectedItems.length>0&&this.selectionMode!=="single-persist"&&(this.clearValue(),e.preventDefault()));break;case"Enter":this.open&&this.activeItemIndex>-1?(this.keyboardNavItems[this.activeItemIndex].toggleSelection(),e.preventDefault()):this.activeChipIndex>-1?(this.removeActiveChip(e.target),e.preventDefault()):this.allowCustomValues&&this.filterText?(this.addCustomChip(this.filterText,!0),e.preventDefault()):!e.defaultPrevented&&this.formSupport.active&&(e.preventDefault(),this.formSupport.requestSubmit());break;case"Delete":case"Backspace":{let i=this.hasHiddenSelectedFitChips()&&this.activeChipIndex===-1;if(this.selectionDisplay==="single"||i)return;let c=e.composedPath().find(U);this.activeChipIndex>-1&&c?(e.preventDefault(),this.removeActiveChip(c)):!this.filterText&&this.isMulti()&&(e.preventDefault(),this.removeLastChip());break}}}onBeforeOpen(){this.topLayer.show(),this.reposition(),this.calciteComboboxBeforeOpen.emit(),setTimeout(()=>this.scrollToActiveOrSelectedItem(this.activeItemIndex<0),0)}onOpen(){this.calciteComboboxOpen.emit()}onBeforeClose(){this.calciteComboboxBeforeClose.emit()}onClose(){this.calciteComboboxClose.emit(),ge(this),this.topLayer.hide()}async setMaxScrollerHeight(){let{listContainerEl:e,open:t,referenceEl:o}=this;if(!e||!t||!o)return;let i=this.getMaxScrollerHeight();e.style.maxBlockSize=i>0?`${i}px`:"",e.style.inlineSize=`${o.clientWidth}px`}calciteChipCloseHandler(e){this.open=!1;let t=this.items.find(o=>o===e);t&&this.toggleSelection(t,!1),this.calciteComboboxChipClose.emit()}clickHandler(e){if(this.readOnly)return;let t=e.composedPath();if(t.some(i=>U(i))){this.open=!1,e.preventDefault();return}let o=this.clearButtonRef.value;if(o&&t.includes(o)){this.clearValue(),e.preventDefault();return}this.open=!this.open,this.ensureRecentSelectedItemIsActive()}ensureRecentSelectedItemIsActive(){let{activeItemIndex:e,selectedItems:t,keyboardNavItems:o}=this;if(e>-1&&o[e]){this.updateActiveItemIndex(e);return}let i=t[t.length-1],a=i?o.indexOf(i):o.length?0:-1;this.updateActiveItemIndex(a>-1?a:o.length?0:-1)}hideChip(e){e.classList.add(r.chipInvisible)}showChip(e){e.classList.remove(r.chipInvisible)}refreshChipDisplay({chipEls:e,availableHorizontalChipElSpace:t,chipContainerElGap:o,hideSelectedChips:i}){let a=e.filter(d=>d.selected),c=a.filter(d=>!d.disabled),l=a.filter(d=>d.disabled),n=d=>{let f=w(d),u=d.getBoundingClientRect().width;return Number.isFinite(f)&&f>0?f:u};if(a.forEach(d=>n(d)),e.forEach(d=>{this.hideChip(d)}),i)return;let s=d=>{let f=0;return d.forEach(u=>{let b=n(u);b&&b<=t&&(t-=b+o,this.showChip(u),f++)}),f};s(c)<=1&&s(l)}async refreshSelectionDisplay(e=!0){if(this.refreshingSelectionDisplay)return;if(this.refreshingSelectionDisplay=!0,await this.componentOnReady(),R(this.selectionMode)){this.refreshingSelectionDisplay=!1;return}let{allSelectedIndicatorChipRef:t,chipContainerEl:o,selectionDisplay:i,placeholder:a,selectedIndicatorChipRef:c,textInputRef:l}=this;if(!l.value||!o){this.refreshingSelectionDisplay=!1;return}let n=parseInt(getComputedStyle(o).gap,10),s=w(o),{fontSize:C,fontFamily:d,minInlineSize:f}=getComputedStyle(l.value),u=.55,b=parseFloat(f)||parseInt(k,10),g=P(a,`${C} ${d}`),L=g>0?g:Math.max(b,Math.round((a?.length||0)*(parseFloat(C)||parseInt(k,10))*u)),$=Math.max(b,L),D=(i==="fit"?$:L)+n,ke=w(t.value),j=w(c.value),Be=Math.max(ke,j);if(this.setCompactSelectionDisplay({chipContainerElGap:n,chipContainerElWidth:s,inputWidth:D,largestSelectedIndicatorChipWidth:Be}),i!=="fit"&&this.allSelected&&this.selectAllEnabled&&this.selectedItems.forEach(y=>{let I=this.referenceEl?.querySelector(`#${h.chip(y.guid)}`);I&&this.hideChip(I)}),this.indeterminate&&this.selectedItems.forEach(y=>{let I=this.referenceEl?.querySelector(`#${h.chip(y.guid)}`);I&&this.showChip(I)}),i==="fit"){let y=Array.from(this.renderRoot.querySelectorAll("calcite-chip")).filter(J=>{let K=J.value,De=K!=null&&`${K}`!="";return J.disabled||De}),{hiddenChipIndicatorWidth:I,hideSelectedChips:Q,reservedPlaceholderInputWidth:Ge}=this.getFitCompactDisplayState({chipContainerElGap:n,chipContainerElWidth:s,inputMinWidth:b,placeholderWidth:L,selectedIndicatorChipElWidth:j});this.fitUsingCompactCountLabel=Q;let Ye=Math.round(s-(I+n+Ge+n));this.refreshChipDisplay({availableHorizontalChipElSpace:Ye,chipContainerElGap:n,chipEls:y,hideSelectedChips:Q});let $e=this.selectedHiddenChipsCount;this.syncChipVisibilityCounts(y),$e!==this.selectedHiddenChipsCount&&e&&(this.fitFollowUpRefreshPromise=this.updateComplete.then(()=>this.refreshSelectionDisplay(!1)).then(()=>{this.fitFollowUpRefreshPromise=void 0}))}this.refreshingSelectionDisplay=!1}setFloatingEl(e){this.floatingEl=e,V(this)}shouldUseFitCompactDisplay({chipContainerElGap:e,chipContainerElWidth:t,hiddenChipIndicatorWidth:o,inputMinWidth:i,placeholderWidth:a,reservedPlaceholderInputWidth:c}){let l=Math.round(t-(o+e+c+e));return a>i*2&&l<=0}getFitCompactDisplayState({chipContainerElGap:e,chipContainerElWidth:t,inputMinWidth:o,placeholderWidth:i,selectedIndicatorChipElWidth:a}){let c=w(this.selectedChipCountRef.value),l=this.deferFitChipCountRender||this.selectedHiddenChipsCount<=0?0:c||a,n=Math.max(o,i),s=this.shouldUseFitCompactDisplay({chipContainerElGap:e,chipContainerElWidth:t,hiddenChipIndicatorWidth:l,inputMinWidth:o,placeholderWidth:i,reservedPlaceholderInputWidth:n});return{hiddenChipIndicatorWidth:l,hideSelectedChips:s,reservedPlaceholderInputWidth:n}}setCompactSelectionDisplay({chipContainerElGap:e,chipContainerElWidth:t,inputWidth:o,largestSelectedIndicatorChipWidth:i}){let a=Math.round(i+e+o);(!this.maxCompactBreakpoint||this.maxCompactBreakpoint<a)&&(this.maxCompactBreakpoint=a),this.compactSelectionDisplay=t<this.maxCompactBreakpoint}setContainerEl(e){F(this.resizeObserver,this.listContainerEl,e),this.listContainerEl=e,this.transitionEl=e}setChipContainerEl(e){F(this.resizeObserver,this.chipContainerEl,e),this.chipContainerEl=e}setReferenceEl(e){this.referenceEl=e,V(this)}syncChipVisibilityCounts(e){let t=0,o=0;e.forEach(a=>{a.selected&&(o++,a.classList.contains(r.chipInvisible)||t++)}),t!==this.selectedVisibleChipsCount&&(this.selectedVisibleChipsCount=t);let i=Math.max(0,o-t);i!==this.selectedHiddenChipsCount&&(this.selectedHiddenChipsCount=i)}getMaxScrollerHeight(){let t=this.getItemsAndGroups(!0).filter(c=>!E(c)),{maxItems:o}=this,i=0,a=0;return t.length>=o&&t.forEach(c=>{if(i<o){let l=this.calculateScrollerHeight(c);a+=l,i+=1}}),a}calculateScrollerHeight(e){if(!e)return 0;let t=e.getBoundingClientRect().height,o=`:scope > ${B}, :scope > ${G}`,i=Array.from(e.querySelectorAll(o)).reduce((a,c)=>a+c.getBoundingClientRect().height,0);return t-i}inputHandler(e){let t=e.target.value;this.filterText=t}getItemsAndGroups(e=!1){return e?Array.from(this.el.querySelectorAll(`${B}, ${G}`)):[...this.groupItems,...this.items]}toggleSelection(e,t){!e||this.selectionMode==="single-persist"&&e.selected&&e.value===this.value&&!t||(this.selectionDisplay==="fit"&&this.isMulti()&&(this.deferFitChipCountRender=!0),this.isMulti()?this.handleMultiSelection(e,t):this.handleSingleSelection(e,t))}handleMultiSelection(e,t){e.selected=t,this.updateAncestors(e),this.updateSelectedItems(),this.emitComboboxChange(),this.resetText(),this.filterItems("")}handleSingleSelection(e,t){this.ignoreSelectedEventsFlag=!0,this.items.forEach(o=>o.selected=o===e?t:!1),this.ignoreSelectedEventsFlag=!1,this.updateSelectedItems(),this.emitComboboxChange(),this.textInputRef.value&&(this.textInputRef.value.value=O(e)),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems("")}updateAncestors(e){if(this.selectionMode!=="ancestors")return;let t=_(e),o=Ve(e);e.selected?t.forEach(i=>{i.disabled||(i.selected=!0)}):([...o].forEach(i=>{i.disabled||(i.selected=!1)}),[...t].forEach(i=>{Y(i)||(i.selected=!1)}))}updateItems(){this.allItems=this.getItems(!0),this.items=this.allItems.filter(e=>!e.disabled),this.groupItems=this.getGroupItems(),this.data=this.getData(),this.groupData=this.getGroupData(),this.updateItemProps(),this.updateSelectedItems(),this.previousAllSelected=this.allSelected}updateItemProps(){this.allItems.forEach(e=>{e.selectionMode=this.selectionMode,e.selectionAppearance=this.selectionAppearance,e.scale=this.scale}),this.groupItems.forEach((e,t)=>(e.scale=this.scale,e.position=t)),this.allowCustomValues||this.setMaxScrollerHeight(),this.groupItems.forEach((e,t,o)=>{t===0&&(e.afterEmptyGroup=!1);let i=o[t+1];i&&(i.afterEmptyGroup=e.children.length===0)})}getData(){return this.items.map(e=>({description:e.description,filterDisabled:e.filterDisabled,label:e.heading,metadata:e.metadata,shortHeading:e.shortHeading,el:e}))}getGroupData(){return this.groupItems.map(e=>({label:e.label,el:e}))}resetText(){this.textInputRef.value&&(this.textInputRef.value.value=""),this.filterText=""}getItems(e=!1){return Array.from(this.el.querySelectorAll(B)).filter(o=>e||!o.disabled)}getGroupItems(){return Array.from(this.el.querySelectorAll(G))}addCustomChip(e,t){let o=this.items.find(i=>i.heading===e);if(o)this.toggleSelection(o,!0);else{let i=document.createElement("calcite-combobox-item");i.value=e,i.heading=e,this.el.prepend(i),this.updateItems(),this.toggleSelection(i,!0),this.open=!0,t&&this.setFocus()}}removeActiveChip(e){let t=this.selectedItems[this.activeChipIndex];t&&!t.disabled&&`${h.chip(t.guid)}`===e.id&&this.toggleSelection(t,!1),this.setFocus()}removeLastChip(){let e=this.selectedItems.findLast(t=>!t.disabled);e&&(this.toggleSelection(e,!1),this.setFocus())}previousChip(){let e=this.selectedItems.length-1,t=this.activeChipIndex;this.activeChipIndex=t===-1?e:Math.max(t-1,0),this.updateActiveItemIndex(-1),this.focusChip()}nextChip(){let e=this.selectedItems.length-1,t=this.activeChipIndex+1;t>e?(this.activeChipIndex=-1,ne(this.textInputRef.value)):(this.activeChipIndex=t,this.focusChip()),this.updateActiveItemIndex(-1)}focusChip(){let e=this.selectedItems[this.activeChipIndex]?.guid;(e?this.referenceEl?.querySelector(`#${h.chip(e)}`):void 0)?.setFocus()}scrollToActiveOrSelectedItem(e=!1){let t=e&&this.selectedItems?.length?this.selectedItems[0]:this.keyboardNavItems[this.activeItemIndex],o=this.listContainerEl;if(!t||!o)return;t.scrollIntoView({block:"nearest"});let a=this.selectAllComboboxItemRef.value?.offsetHeight||0,c=t.getBoundingClientRect(),l=o.getBoundingClientRect();c.top<l.top+a&&(o.scrollTop-=l.top+a-c.top)}shiftActiveItemIndex(e){let{length:t}=this.keyboardNavItems,o=(this.activeItemIndex+t+e)%t;this.updateActiveItemIndex(o),this.scrollToActiveOrSelectedItem()}updateActiveItemIndex(e){this.activeItemIndex=e;let t="";this.keyboardNavItems.forEach((o,i)=>{i===e?(o.active=!0,t=`${h.item(o.guid)}`):o.active=!1}),this.activeDescendant=t,this.activeItemIndex>-1&&(this.activeChipIndex=-1)}isMulti(){return!R(this.selectionMode)}comboboxFocusHandler(){this.disabled||(this.activeChipIndex=-1,this.textInputRef.value?.focus(),this.open&&this.selectionDisplay==="fit"&&this.isMulti()&&this.refreshSelectionDisplay())}createScreenReaderItem({ariaLabel:e,ariaSelected:t,id:o,textContent:i}){return x`<li aria-label=${e??m} aria-selected=${t??m} id=${o??m} role=option tabindex=-1>${i}</li>`}handleSelectionModeWarning(){this.selectionMode==="single-persist"&&this.clearDisabled&&ce.warn('clearDisabled is ignored when selection-mode is set to "single-persist"')}getDescriptionMessage(){let e=Array.isArray(this.value)?this.value.join(", "):this.value;return this.readOnly?this.messages.nonEditable.replace("{value}",`${e}`):e}getChipLabel(e,t){return t?[...[..._(e)].reverse(),e].map(i=>O(i)).join(" / "):O(e)}renderChip({activeChipIndex:e,disabled:t,index:o,item:i,messages:a,readOnly:c,scale:l,isAncestors:n}){let s=this.getChipLabel(i,n);return H(i.guid||i.value||s,x`<calcite-chip .appearance=${c?"outline":"solid"} class=${p({[r.chip]:!0,[r.disabled]:t})} .closable=${!t&&!c} data-testid=${`${t?"disabled-chip":"chip"}-${o}`} .disabled=${t} .icon=${i.icon} .iconFlipRtl=${i.iconFlipRtl} id=${(!t&&i.guid?`${h.chip(i.guid)}`:void 0)??m} .label=${s} .messageOverrides=${t?void 0:{dismissLabel:a.removeTag.replace("{value}",`${s}`)}} @calciteChipClose=${t?void 0:()=>this.calciteChipCloseHandler(i)} @focusin=${t?void 0:()=>this.activeChipIndex=o} .scale=${l} .selected=${i.selected} .tabIndex=${!t&&e===o?0:-1} title=${s??m} .value=${i.value}>${s}</calcite-chip>`)}renderChipCount(e,t){let o=this.fitUsingCompactCountLabel?`${e}`:this.messages.disabledSelectedCount.replace("{count}",`${e}`)??`+${e}`;return x`<calcite-chip appearance=solid class=${p({[r.chip]:!0})} data-testid=selected-chip-count id=selected-chip-count .label=${o} .scale=${t} tabindex=-1 title=${o??m} ${S(this.selectedChipCountRef)}>${o}</calcite-chip>`}renderChips(){let{activeChipIndex:e,readOnly:t,scale:o,selectionDisplay:i,selectionMode:a,messages:c}=this,l=[],n=a==="ancestors",s=this.selectAllEnabled&&this.allSelected,C=i==="all";if(s)return null;let d=0,f=0;if(C){let u=this.allItems.filter(g=>g.selected&&(!n||!Y(g)));Z(u,this.selectedItems).forEach(g=>{if(g.disabled){l.push(this.renderChip({activeChipIndex:e,disabled:!0,index:f++,item:g,messages:c,readOnly:t,scale:o,isAncestors:n}));return}l.push(this.renderChip({activeChipIndex:e,disabled:!1,index:d++,item:g,messages:c,readOnly:t,scale:o,isAncestors:n}))})}else s||this.selectedItems.forEach(u=>{l.push(this.renderChip({activeChipIndex:e,disabled:u.disabled,index:d++,item:u,messages:c,readOnly:t,scale:o,isAncestors:n}))});if(i==="fit"){let u=this.selectedHiddenChipsCount,b=this.selectedVisibleChipsCount===0?this.selectedItems.length:u;u>0&&!this.deferFitChipCountRender&&l.push(this.renderChipCount(b,o))}return l.length?l:null}renderAllSelectedIndicatorChip(){let{allSelectedIndicatorChipRef:e,compactSelectionDisplay:t,scale:o,selectedVisibleChipsCount:i}=this,a=!1;if(this.selectionDisplay==="fit"&&this.textInputRef.value&&this.chipContainerEl){let s=parseInt(getComputedStyle(this.chipContainerEl).gap,10),C=w(this.chipContainerEl),{fontSize:d,fontFamily:f,minInlineSize:u}=getComputedStyle(this.textInputRef.value),b=.55,g=parseFloat(u)||parseInt(k,10),L=P(this.placeholder,`${d} ${f}`),$=L>0?L:Math.max(g,Math.round((this.placeholder?.length||0)*(parseFloat(d)||parseInt(k,10))*b)),D=w(this.selectedIndicatorChipRef.value);a=this.getFitCompactDisplayState({chipContainerElGap:s,chipContainerElWidth:C,inputMinWidth:g,placeholderWidth:$,selectedIndicatorChipElWidth:D}).hideSelectedChips}let l=t||a?this.messages.all:this.messages.allSelected,n=this.allSelected&&(this.selectionDisplay==="single"||!i||this.selectionDisplay==="all");return x`<calcite-chip class=${p({[r.chip]:!0,[r.chipInvisible]:!n,[r.allSelected]:!0})} data-testid=all-selected-indicator-chip .label=${l} .scale=${o} title=${l??m} value ${S(e)}>${l}</calcite-chip>`}renderSelectedIndicatorChip(){let{compactSelectionDisplay:e,selectionDisplay:t,scale:o,selectedIndicatorChipRef:i}=this,a=!1,c,l=this.getSelectedItems().length;return e?a=!0:t==="single"&&(this.allSelected?a=!0:l>0?a=!1:a=!0,c=`${l} ${this.messages.selected}`),x`<calcite-chip class=${p({[r.chip]:!0,[r.chipInvisible]:a})} .label=${c} .scale=${o} title=${c??m} value ${S(i)}>${c}</calcite-chip>`}renderSelectedIndicatorChipCompact(){let{compactSelectionDisplay:e,selectionDisplay:t,scale:o}=this,i=!1,a,c=this.getSelectedItems().length;return e?this.allSelected?i=!0:t==="single"&&(i=!(c>0),a=`${c}`):i=!0,x`<calcite-chip class=${p({[r.chip]:!0,[r.chipInvisible]:i})} .label=${a} .scale=${o} title=${a??m} value>${a}</calcite-chip>`}renderInput(){let{guid:e,disabled:t,placeholder:o,selectionMode:i,selectedItems:a,open:c}=this,l=R(i),n=a[0],s=!c&&l&&!!n&&!this.filterText;return x`<span class=${p({[r.inputWrap]:!0,[r.inputWrapSingle]:l})}>${s&&H("label",x`<span class=${p({[r.label]:!0,[r.labelIcon]:!!n?.icon})}>${O(n)}</span>`)||""}${H("input",x`<input aria-activedescendant=${this.activeDescendant??m} aria-controls=${`${h.listbox(e)}`} aria-errormessage=${h.validationMessage} aria-owns=${`${h.listbox(e)}`} aria-autocomplete=list .ariaDescription=${this.getDescriptionMessage()} .ariaExpanded=${c} aria-haspopup=listbox .ariaInvalid=${this.status==="invalid"} .ariaLabel=${ve(this)} class=${p({[r.input]:!0,[r.inputSingle]:!0,[r.inputHidden]:s,[r.inputIcon]:this.showingInlineIcon&&!!this.placeholderIcon})} data-testid=input .disabled=${t} .id=${`${h.input(e)}`} @focus=${this.comboboxFocusHandler} @input=${this.inputHandler} placeholder=${o??m} .readOnly=${this.readOnly} .required=${this.required} role=combobox .tabIndex=${this.activeChipIndex===-1?0:-1} type=text .value=${te(this.filterText??"")} ${S(this.textInputRef)}>`)}</span>`}renderListBoxOptions(){let e=this.keyboardNavItems.map(t=>this.createScreenReaderItem({ariaLabel:t.label,ariaSelected:t.selected,id:`${h.item(t.guid)}`,textContent:t.heading}));if(this.selectAllEnabled&&this.selectionMode!=="single"&&this.selectionMode!=="single-persist"){let t=this.createScreenReaderItem({ariaLabel:this.messages.selectAll,ariaSelected:this.allSelected,textContent:this.messages.selectAll});t&&e.unshift(t)}return e}renderFloatingUIContainer(){let{messages:e,setFloatingEl:t,setContainerEl:o,open:i,scale:a}=this,c={[r.listContainer]:!0,[W.animation]:!0,[W.animationActive]:i},l=(this.filterText&&e.add.replace("{text}",`${this.filterText}`))??"";return x`<div aria-hidden=true class=${p(r.floatingUIContainer)} popover=manual ${S(t)}><div class=${p(c)} ${S(o)}><ul class=${p({[r.list]:!0,[r.listHide]:!i})}>${this.selectAllEnabled&&this.selectionMode!=="single"&&this.selectionMode!=="single-persist"&&x`<calcite-combobox-item class=${p(r.selectAll)} data-testid=select-all-item .heading=${e.selectAll} .id=${`${this.guid}-select-all-enabled-interactive`} .indeterminate=${this.indeterminate} .label=${e.selectAll} .scale=${a} .selected=${this.allSelected} tabindex=-1 value=select-all ${S(this.selectAllComboboxItemRef)}></calcite-combobox-item>`||""}<slot></slot>${this.noMatchesFound&&(this.allowCustomValues?x`<li aria-label=${l??m} class=${p(r.noMatches)} @click=${this.customChipAddHandler} role=option tabindex=0>${Le({text:l,pattern:new RegExp(`(${T(this.filterText)})`,"i")})}</li>`:x`<li class=${p({[r.noMatchesPlaceholder]:!0,[r.noMatches]:!0})}>${e.noMatches}</li>`)||""}</ul></div></div>`}renderSelectedOrPlaceholderIcon(){let{open:e,placeholderIcon:t,placeholderIconFlipRtl:o,selectedItems:i}=this,a=i[0],c=a?.icon,l=t&&(e||!a);return this.showingInlineIcon&&H("selected-placeholder-icon",x`<span class=${p(r.iconStart)}><calcite-icon class=${p({[r.selectedIcon]:!l,[r.placeholderIcon]:l})} .flipRtl=${l?o:a.iconFlipRtl} .icon=${l?t:c} .scale=${z(this.scale)}></calcite-icon></span>`)||""}renderChevronIcon(){let{open:e}=this;return H("chevron",x`<span class=${p(r.iconEnd)}><calcite-icon class=${p(r.icon)} .icon=${e?q.chevronUp:q.chevronDown} .scale=${z(this.scale)}></calcite-icon></span>`)}render(){let{selectionDisplay:e,guid:t,label:o,open:i,readOnly:a}=this,c=R(this.selectionMode),l=e==="all",n=e==="single",s=!c&&e==="fit",C=!c&&!l,d=C&&!s,f=this.items.some(b=>b.selected&&!b.disabled),u=!this.clearDisabled&&this.selectionMode!=="single-persist"&&!!this.value?.length&&f;return this.interactiveContainer({disabled:this.disabled,children:x`${this.labelText&&we({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<div aria-live=polite class=${p({[r.wrapper]:!0,[r.wrapperSingle]:c||!this.selectedItems.length,[r.wrapperActive]:i})} @click=${this.clickHandler} @keydown=${this.keyDownHandler} ${S(this.setReferenceEl)}>${this.renderSelectedOrPlaceholderIcon()}${H("grid",x`<div class=${p({[r.gridInput]:!0,[r.selectionDisplayFit]:s,[r.selectionDisplaySingle]:n})} ${S(this.setChipContainerEl)}>${!c&&!n&&this.renderChips()||""}${!c&&!n&&this.selectAllEnabled&&l&&this.renderAllSelectedIndicatorChip()||""}${d&&this.renderSelectedIndicatorChip()||""}${d&&this.renderSelectedIndicatorChipCompact()||""}${C&&this.renderAllSelectedIndicatorChip()||""}<label class=${p(r.screenReadersOnly)} .htmlFor=${`${h.input(t)}`} .id=${`${h.label(t)}`}>${o}</label>${this.renderInput()}</div>`)}${!a&&u?Re({ariaLabel:this.messages.clear,disabled:this.disabled,ref:this.clearButtonRef,scale:this.scale,title:this.messages.clear}):null}${!a&&this.renderChevronIcon()||""}</div><ul aria-labelledby=${`${h.label(t)}`} aria-multiselectable=true class=${p(r.screenReadersOnly)} .id=${`${h.listbox(t)}`} role=listbox tabindex=-1>${this.renderListBoxOptions()}</ul>${this.renderFloatingUIContainer()}${this.validationMessage&&this.status==="invalid"?Ie({icon:this.validationIcon,id:h.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null}`})}};le("calcite-combobox",X);export{X as Combobox};
2
+ import{a as Re}from"./RL6LR5RX.js";import{a as ye}from"./4QWJ3PQW.js";import{b as _,c as Ve,d as Y,f as R,g as O,h as Z,i as Oe}from"./F7QRXMLE.js";import{a as B,b as G,d as r,e as h,f as q}from"./47B6Y2DM.js";import{d as U}from"./C4WP5EBM.js";import{a as Ie}from"./UJXQEJWS.js";import{b as T}from"./2LI2WSK2.js";import{a as we}from"./KQAR33SR.js";import{c as Me}from"./YDUTUT75.js";import{a as ve}from"./DKJI4BME.js";import{a as He}from"./TLIBVBYQ.js";import{a as be}from"./IWWJYWY5.js";import{a as Le}from"./GWODLNHO.js";import{a as N,c as W,d as me,e as Ce,f as ge,g as V,h as Se}from"./GBUMWAMI.js";import{a as fe}from"./QEZ3GMQZ.js";import{a as he}from"./M3CH5PK6.js";import{a as H}from"./XIIT6OKF.js";import{a as xe}from"./JXLVLVWY.js";import{a as ue}from"./VXDPJESZ.js";import{a as pe}from"./T6CCMW7H.js";import{a as A,b as F}from"./VI7SBYXT.js";import{a as de}from"./G64R54P5.js";import"./VUYX7MNO.js";import{a as se}from"./PW7YMRBF.js";import{a as z,b as E}from"./ZWPNZ5XW.js";import{e as re}from"./I5K6EDCU.js";import{i as w,l as P,p as ne}from"./3QPETC2U.js";import{B as te,C as M,D as S,E as oe,F as p,J as ie,L as ae,O as ce,R as le,g as ee,h as x,l as m,p as v}from"./RQONITLI.js";var k="48px";var Ae=ee`: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{position:relative;display:block}:host([scale=s]){font-size:var(--calcite-font-size-relative-sm);--calcite-internal-combobox-spacing-unit-l: .5rem;--calcite-internal-combobox-spacing-unit-s: .25rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-2xs);--calcite-internal-combobox-no-matches-spacing-unit-s: .25rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.25rem - 1px) ;--calcite-internal-close-size: 1rem}:host([scale=m]){font-size:var(--calcite-font-size-relative-base);--calcite-internal-combobox-spacing-unit-l: .75rem;--calcite-internal-combobox-spacing-unit-s: .5rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm);--calcite-internal-combobox-no-matches-spacing-unit-s: .375rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.5rem - 1px) ;--calcite-internal-close-size: 1.5rem}:host([scale=l]){font-size:var(--calcite-font-size-relative-md);--calcite-internal-combobox-spacing-unit-l: 1rem;--calcite-internal-combobox-spacing-unit-s: .75rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm-plus);--calcite-internal-combobox-no-matches-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-combobox-input-height: 1.5rem;--calcite-internal-combobox-input-margin-block: calc(var(--calcite-space-sm-plus) - 1px);--calcite-internal-close-size: 2rem}.wrapper{display:flex;border-width:1px;border-style:solid;outline-color:transparent;padding-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);border-radius:var(--calcite-combobox-corner-radius, var(--calcite-corner-radius));background-color:var(--calcite-combobox-input-background-color, var(--calcite-color-foreground-1));color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));border-color:var(--calcite-combobox-input-border-color, var(--calcite-color-border-input))}.wrapper:hover .icon{color:var(--calcite-combobox-icon-color-hover, var(--calcite-color-text-1))}:host(:focus-within) .wrapper,.wrapper--active{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))))}:host([read-only]) .wrapper{background-color:var(--calcite-color-background)}:host([read-only]) .label{font-weight:var(--calcite-font-weight-medium)}:host([status=invalid]) .wrapper{border-color:var(--calcite-color-status-danger)}:host([status=invalid]:focus-within) .wrapper{outline:var(--calcite-border-width-md) solid var(--calcite-color-status-danger);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.wrapper--single{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);cursor:pointer;flex-wrap:nowrap}.grid-input{position:relative;display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;gap:var(--calcite-internal-combobox-spacing-unit-s);margin-inline-end:var(--calcite-internal-combobox-spacing-unit-s)}.grid-input.selection-display--fit,.grid-input.selection-display--single{flex-wrap:nowrap;overflow:hidden}.input{flex-grow:1;appearance:none;overflow:hidden;text-overflow:ellipsis;border-style:none;background-color:transparent;padding:0;font-family:inherit;color:var(--calcite-color-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);inline-size:100%;margin-block-end:var(--calcite-internal-combobox-spacing-unit-s);min-inline-size:4.8125rem}.input:focus{outline:2px solid transparent;outline-offset:2px}.input:placeholder-shown{text-overflow:ellipsis}.input--single{padding:0;margin-block:var(--calcite-internal-combobox-input-margin-block)}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;width:0px;min-width:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.placeholder-icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.input-wrap{display:flex;flex-grow:1;align-items:center}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;max-width:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.icon-end,.icon-start{display:flex;cursor:pointer;align-items:center}.icon-end{flex:none}.icon-end .icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.floating-ui-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.floating-ui-container{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .floating-ui-container{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.floating-ui-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.floating-ui-container:popover-open{display:block}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.floating-ui-container .calcite-floating-ui-anim{box-shadow:var(--calcite-shadow-md)}@media(forced-colors:active){.wrapper,.floating-ui-container{border:1px solid canvasText}}.screen-readers-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.list-container{max-height:45vh;overflow-y:auto;inline-size:var(--calcite-dropdown-width, 100%);background-color:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1))}.list{margin:0;display:block;padding:0;line-height:var(--calcite-font-line-height-relative-snug)}.list--hide{height:0px;overflow:hidden}calcite-chip{--calcite-animation-timing: 0}.chip{margin-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);max-inline-size:100%}.chip--invisible{visibility:hidden;position:absolute}.item{display:block}.select-all{background-color:var(--calcite-combobox-item-background-color-active, var(--calcite-color-foreground-1));border-block-end-color:var(--calcite-combobox-divider-color, var(--calcite-combobox-item-border-color, var(--calcite-color-border-3)));border-block-end-style:solid;border-block-end-width:var(--calcite-border-width-sm);inset-block-start:0;position:sticky;z-index:var(--calcite-z-index-sticky)}.no-matches{padding-block:var(--calcite-internal-combobox-no-matches-spacing-unit-s);padding-inline:var(--calcite-internal-combobox-spacing-unit-l);color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));background:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1));cursor:pointer}.no-matches-placeholder{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3));cursor:default}.disabled{opacity:.5}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.clear-button--container{display:flex;cursor:pointer;align-items:center}.clear-button--container:hover calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color: var(--calcite-clear-button-icon-color-hover, var(--calcite-color-text-1))}.clear-button--container:active calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color-press, var(--calcite-color-text-1))}.clear-button--container calcite-action{--calcite-internal-action-height: 100%;--calcite-internal-action-padding-inline: var(--calcite-spacing-none);--calcite-internal-action-padding-block: var(--calcite-spacing-none);--calcite-action-background-color: var(--calcite-clear-button-background-color, var(--calcite-color-foreground-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color)}.clear-button--container calcite-action:hover{--calcite-action-background-color-hover: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-hover)}.clear-button--container calcite-action:active{--calcite-action-background-color-press: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-press)}:host([scale=s]) .clear-button--container{padding:var(--calcite-space-2xs)}:host([scale=m]) .clear-button--container{padding:var(--calcite-space-2xs);padding-inline-end:var(--calcite-space-sm)}:host([scale=l]) .clear-button--container{padding-inline-end:var(--calcite-space-sm-plus)}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}:host([hidden]){display:none}[hidden]{display:none}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-spacing-base)}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-xxs)}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-md)}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}::placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-input-placeholder-text-color, var(--calcite-color-text-3))}`,X=class extends oe{constructor(){super(),this.direction=re(),this.formSupport=Me({inputType:"text"})(this),this.selectAllComboboxItemRef=M(),this.allSelectedIndicatorChipRef=M(),this.data=[],this.cancelable=xe()(this),this.filterItems=(()=>{let e=(t,o)=>t&&o.some(({el:i})=>t===i);return ue((t,o=!1,i=!0)=>{let a=ye([...this.data,...this.groupData],t,this.effectiveFilterProps),c=this.getItemsAndGroups(),l=t==="";c.forEach(n=>{if(l){n.itemHidden=!1;return}let s=!e(n,a);n.itemHidden=s;let[C,d]=n.ancestors;(e(C,a)||e(d,a))&&(n.itemHidden=!1),s||n.ancestors.forEach(f=>f.itemHidden=!1)}),this.noMatchesFound=this.filteredItems.length===0&&!!this.filterText,this.filterTextMatchPattern=this.filterText?new RegExp(`(${T(this.filterText)})`,"i"):void 0,this.keyboardNavItems.forEach(n=>{n.filterTextMatchPattern=this.filterTextMatchPattern}),o&&(this.open=this.filterText.trim().length>0),i&&this.calciteComboboxFilterChange.emit()},ae.filter)})(),this._filterText="",this.getSelectedItems=()=>{if(!this.isMulti()){let e=this.allItems.find(({selected:t})=>t);return e?[e]:[]}return this.allItems.filter(e=>e.selected&&(this.selectionMode!=="ancestors"||!Y(e)))},this.groupData=[],this.groupItems=[],this.guid=pe(),this.ignoreSelectedEventsFlag=!1,this.internalValueChangeFlag=!1,this.previousAllSelected=!1,this.refreshingSelectionDisplay=!1,this.mutationObserver=A("mutation",()=>this.updateItems()),this.onLabelClick=()=>{this.setFocus()},this.transitionProp="opacity",this.resizeObserver=(()=>{let e=!1;return A("resize",()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1,this.setMaxScrollerHeight(),this.refreshSelectionDisplay()}))})})(),this.selectedIndicatorChipRef=M(),this.selectedChipCountRef=M(),this.clearButtonRef=M(),this._selectedItems=[],this.textInputRef=M(),this._value="",this.messages=de({blocking:!0}),this.focusSetter=se()(this),this.customChipAddHandler=()=>{this.addCustomChip(this.filterText,!0)},this.interactiveContainer=he(this),this.topLayer=be({target:()=>this.floatingEl})(this),this.activeChipIndex=-1,this.activeDescendant="",this.activeItemIndex=-1,this.compactSelectionDisplay=!1,this.deferFitChipCountRender=!1,this.selectedHiddenChipsCount=0,this.selectedVisibleChipsCount=0,this.fitUsingCompactCountLabel=!1,this.allItems=[],this.items=[],this.noMatchesFound=!1,this.clearDisabled=!1,this.disabled=!1,this.maxItems=0,this.open=!1,this.overlayPositioning="absolute",this.placeholderIconFlipRtl=!1,this.placement=N,this.readOnly=!1,this.required=!1,this.scale="m",this.selectAllEnabled=!1,this.selectionDisplay="all",this.selectionAppearance="icon",this.selectionMode="multiple",this.status="idle",this.topLayerDisabled=!1,this.calciteComboboxBeforeClose=v({cancelable:!1}),this.calciteComboboxBeforeOpen=v({cancelable:!1}),this.calciteComboboxChange=v({cancelable:!1}),this.calciteComboboxChipClose=v({cancelable:!1}),this.calciteComboboxClose=v({cancelable:!1}),this.calciteComboboxFilterChange=v({cancelable:!1}),this.calciteComboboxOpen=v({cancelable:!1}),He(this),this.listenOn(document,"click",this.documentClickHandler),this.listen("calciteComboboxItemChange",this.calciteComboboxItemChangeHandler),this.listen("calciteInternalComboboxItemChange",this.calciteInternalComboboxItemChangeHandler),this.listen("click",this.comboboxFocusHandler)}static{this.properties={activeChipIndex:[16,{},{state:!0}],activeDescendant:[16,{},{state:!0}],activeItemIndex:[16,{},{state:!0}],compactSelectionDisplay:[16,{},{state:!0}],deferFitChipCountRender:[16,{},{state:!0}],selectedHiddenChipsCount:[16,{},{state:!0}],selectedVisibleChipsCount:[16,{},{state:!0}],fitUsingCompactCountLabel:[16,{},{state:!0}],allItems:[16,{},{state:!0}],items:[16,{},{state:!0}],noMatchesFound:[16,{},{state:!0}],allowCustomValues:[7,{},{reflect:!0,type:Boolean}],clearDisabled:[7,{},{reflect:!0,type:Boolean}],disabled:[7,{},{reflect:!0,type:Boolean}],filterText:[3,{},{reflect:!0}],filterProps:[0,{},{attribute:!1}],filteredItems:[32,{},{attribute:!1,readOnly:!0}],flipPlacements:[0,{},{attribute:!1}],form:[3,{},{reflect:!0}],label:1,labelText:1,maxItems:[11,{},{reflect:!0,type:Number}],messageOverrides:[0,{},{attribute:!1}],name:[3,{},{reflect:!0}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placeholder:1,placeholderIcon:[3,{},{reflect:!0}],placeholderIconFlipRtl:[7,{},{reflect:!0,type:Boolean}],placement:[3,{},{reflect:!0}],readOnly:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selectAllEnabled:[7,{},{reflect:!0,type:Boolean}],selectedItems:[0,{},{attribute:!1}],selectionDisplay:[3,{},{reflect:!0}],selectionAppearance:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}],status:[3,{},{reflect:!0}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}],validationIcon:[3,{converter:ie},{reflect:!0}],validationMessage:1,validity:[32,{},{readOnly:!0,attribute:!1}],value:1}}static{this.formAssociated=!0}static{this.styles=Ae}get effectiveFilterProps(){return this.filterProps?this.filterProps.filter(e=>e!=="el"):["description","label","metadata","shortHeading"]}get showingInlineIcon(){let{placeholderIcon:e,selectionMode:t,selectedItems:o,open:i}=this,a=o[0],c=a?.icon,l=R(t);return!i&&a?!!c&&l:!!e&&(!a||l)}get allSelected(){let e=this.allItems.filter(t=>!t.disabled);return e.length>0&&e.every(t=>t.selected)}get hasDisabledSelected(){return this.allItems.some(e=>e.disabled&&e.selected)}get indeterminate(){let e=this.selectedItems.length>0||this.hasDisabledSelected;return this.selectAllEnabled?!this.allSelected&&e:this.selectedItems.length>0&&!this.allSelected}get keyboardNavItems(){let{selectAllComboboxItemRef:e}=this,t=this.filteredItems.filter(o=>!o.disabled);return e.value?[e.value,...t]:t}get filterText(){return this._filterText}set filterText(e){let t=this._filterText;e!==t&&(this._filterText=e,this.filterTextChange(e))}get filteredItems(){return this.items.filter(e=>!E(e))}get selectedItems(){return this._selectedItems}set selectedItems(e){let t=this._selectedItems;e!==t&&(this._selectedItems=e,this.selectedItemsHandler())}get value(){return this._value}set value(e){let t=this._value;e!==t&&(this._value=e,this.valueHandler(e))}async reposition(e=!1){let{floatingEl:t,referenceEl:o,placement:i,overlayPositioning:a,filteredFlipPlacements:c}=this;return Ce(this,{direction:this.direction,floatingEl:t,referenceEl:o,overlayPositioning:a,placement:i,flipPlacements:c,type:"menu"},e)}async setFocus(e){return this.focusSetter(()=>(this.activeChipIndex=-1,this.activeItemIndex=-1,this.textInputRef.value),e)}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),V(this),this.cancelable.add(this.filterItems)}async load(){this.handleSelectionModeWarning()}willUpdate(e){e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),e.has("disabled")&&(this.hasUpdated||this.disabled!==!1)&&this.handleDisabledChange(this.disabled),e.has("maxItems")&&(this.hasUpdated||this.maxItems!==0)&&this.setMaxScrollerHeight(),(e.has("overlayPositioning")&&(this.hasUpdated||this.overlayPositioning!=="absolute")||e.has("placement")&&(this.hasUpdated||this.placement!==N))&&this.reposition(!0),(e.has("selectionMode")||e.has("scale")||e.has("selectionAppearance"))&&this.updateItems(),e.has("flipPlacements")&&this.flipPlacementsHandler()}loaded(){V(this),this.updateItems(),this.filterItems(this.filterText,!1,!1)}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),Se(this)}emitComboboxChange(){this.calciteComboboxChange.emit()}filterTextChange(e){this.updateActiveItemIndex(-1),this.filterItems(e,!0)}openHandler(){this.disabled||fe(this)}handleDisabledChange(e){e||(this.open=!1)}valueHandler(e){this.internalValueChangeFlag||(this.items.forEach(t=>{t.selected=Array.isArray(e)?e.includes(t.value):e===t.value}),this.updateItems())}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}selectedItemsHandler(){let e=this.previousAllSelected,t=this.allSelected;if(this.previousAllSelected=t,this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1,this.selectionDisplay==="fit"&&this.isMulti()){let o=e&&!t;e&&!t&&(this.selectedHiddenChipsCount=0,this.selectedItems.forEach(i=>{let a=this.referenceEl?.querySelector(`#${h.chip(i.guid)}`);a&&this.showChip(a)})),this.updateComplete.then(async()=>{o&&await this.updateComplete,await this.refreshSelectionDisplay(),this.fitFollowUpRefreshPromise&&await this.fitFollowUpRefreshPromise,this.deferFitChipCountRender=!1})}}async documentClickHandler(e){this.disabled||e.composedPath().includes(this.el)||(await this.componentOnReady(),!this.allowCustomValues&&this.filterText&&(this.clearInputValue(),this.filterItems(""),this.updateActiveItemIndex(-1)),this.allowCustomValues&&this.filterText.trim().length&&this.addCustomChip(this.filterText),this.open=!1)}handleSelectAll(e){e&&(this.toggleSelectAll(),this.selectionDisplay!=="fit"&&this.allSelected&&this.selectedItems.forEach(t=>{let o=this.referenceEl.querySelector(`#${h.chip(t.guid)}`);o&&this.hideChip(o)}))}updateSelectedItems(){this.selectedItems=this.getOrderedSelectedItems(this.getSelectedItems())}calciteComboboxItemChangeHandler(e){if(this.ignoreSelectedEventsFlag)return;let t=e.target,o=e.composedPath().includes(this.selectAllComboboxItemRef.value);this.selectAllEnabled&&this.handleSelectAll(o);let i=this.keyboardNavItems.indexOf(o?this.selectAllComboboxItemRef.value:t);this.updateActiveItemIndex(i),this.toggleSelection(t,t.selected)}calciteInternalComboboxItemChangeHandler(e){e.stopPropagation(),this.hasUpdated&&this.updateItems()}clearValue(){let e=this.items.filter(t=>t.selected&&!t.disabled);e.length&&(this.ignoreSelectedEventsFlag=!0,e.forEach(t=>t.selected=!1),this.ignoreSelectedEventsFlag=!1,this.updateSelectedItems(),this.emitComboboxChange()),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems(""),this.setFocus()}clearInputValue(){this.textInputRef.value&&(this.textInputRef.value.value=""),this.filterText=""}setFilteredPlacements(){let{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?me(t,e):void 0}getValue(){let e=this.getOrderedSelectedValues(this.selectedItems.map(t=>t.value?.toString()));return e.length?e.length>1?e:e[0]:""}getOrderedSelectedValues(e){if(!this.isMulti())return e;let t=Array.isArray(this.value)?this.value:this.value?[this.value]:[];return Oe(e,t)}getOrderedSelectedItems(e){return this.isMulti()?Z(e,this.selectedItems):e}comboboxInViewport(){let e=this.el.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.right<=(window.innerWidth||document.documentElement.clientWidth)&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)}toggleSelectAll(){let e=!this.allSelected;this.allItems.forEach(t=>{t.disabled||(t.selected=e)}),this.updateSelectedItems(),this.emitComboboxChange()}hasHiddenSelectedFitChips(){if(this.selectionDisplay!=="fit"||!this.isMulti())return!1;let e=this.selectedChipCountRef.value;return!!e&&!e.classList.contains(r.chipInvisible)}keyDownHandler(e){if(this.readOnly)return;let{key:t}=e;switch(t){case"Tab":this.activeChipIndex=-1,this.activeItemIndex=-1,this.allowCustomValues&&this.filterText?(this.addCustomChip(this.filterText,!0),e.preventDefault()):this.open?(this.open=!1,e.preventDefault()):!this.allowCustomValues&&this.filterText&&(this.clearInputValue(),this.filterItems(""),this.updateActiveItemIndex(-1));break;case"ArrowLeft":(this.activeChipIndex!==-1||this.textInputRef.value?.selectionStart===0)&&(this.previousChip(),e.preventDefault());break;case"ArrowRight":this.activeChipIndex!==-1&&(this.nextChip(),e.preventDefault());break;case"ArrowUp":this.keyboardNavItems.length&&(e.preventDefault(),this.open&&this.shiftActiveItemIndex(-1),this.scrollToActiveOrSelectedItem(),this.comboboxInViewport()||this.el.scrollIntoView()),this.scrollToActiveOrSelectedItem();break;case"ArrowDown":this.keyboardNavItems.length&&(e.preventDefault(),this.open?this.shiftActiveItemIndex(1):(this.open=!0,this.ensureRecentSelectedItemIsActive()),this.scrollToActiveOrSelectedItem(),this.comboboxInViewport()||this.el.scrollIntoView());break;case" ":!this.textInputRef.value?.value&&!e.defaultPrevented&&(!this.open&&this.keyboardNavItems.length&&(this.open=!0,this.ensureRecentSelectedItemIsActive()),e.preventDefault());break;case"Home":if(!this.open)return;e.preventDefault(),this.updateActiveItemIndex(0),this.scrollToActiveOrSelectedItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"End":if(!this.open)return;e.preventDefault(),this.updateActiveItemIndex(this.filteredItems.length-1),this.scrollToActiveOrSelectedItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"Escape":if(this.open){this.open=!1,e.preventDefault();break}this.clearDisabled||(this.textInputRef.value.value.length>0?(this.resetText(),e.preventDefault()):this.selectedItems.length>0&&this.selectionMode!=="single-persist"&&(this.clearValue(),e.preventDefault()));break;case"Enter":this.open&&this.activeItemIndex>-1?(this.keyboardNavItems[this.activeItemIndex].toggleSelection(),e.preventDefault()):this.activeChipIndex>-1?(this.removeActiveChip(e.target),e.preventDefault()):this.allowCustomValues&&this.filterText?(this.addCustomChip(this.filterText,!0),e.preventDefault()):!e.defaultPrevented&&this.formSupport.active&&(e.preventDefault(),this.formSupport.requestSubmit());break;case"Delete":case"Backspace":{let i=this.hasHiddenSelectedFitChips()&&this.activeChipIndex===-1;if(this.selectionDisplay==="single"||i)return;let c=e.composedPath().find(U);this.activeChipIndex>-1&&c?(e.preventDefault(),this.removeActiveChip(c)):!this.filterText&&this.isMulti()&&(e.preventDefault(),this.removeLastChip());break}}}onBeforeOpen(){this.topLayer.show(),this.reposition(),this.calciteComboboxBeforeOpen.emit(),setTimeout(()=>this.scrollToActiveOrSelectedItem(this.activeItemIndex<0),0)}onOpen(){this.calciteComboboxOpen.emit()}onBeforeClose(){this.calciteComboboxBeforeClose.emit()}onClose(){this.calciteComboboxClose.emit(),ge(this),this.topLayer.hide()}async setMaxScrollerHeight(){let{listContainerEl:e,open:t,referenceEl:o}=this;if(!e||!t||!o)return;let i=this.getMaxScrollerHeight();e.style.maxBlockSize=i>0?`${i}px`:"",e.style.inlineSize=`${o.clientWidth}px`}calciteChipCloseHandler(e){this.open=!1;let t=this.items.find(o=>o===e);t&&this.toggleSelection(t,!1),this.calciteComboboxChipClose.emit()}clickHandler(e){if(this.readOnly)return;let t=e.composedPath();if(t.some(i=>U(i))){this.open=!1,e.preventDefault();return}let o=this.clearButtonRef.value;if(o&&t.includes(o)){this.clearValue(),e.preventDefault();return}this.open=!this.open,this.ensureRecentSelectedItemIsActive()}ensureRecentSelectedItemIsActive(){let{activeItemIndex:e,selectedItems:t,keyboardNavItems:o}=this;if(e>-1&&o[e]){this.updateActiveItemIndex(e);return}let i=t[t.length-1],a=i?o.indexOf(i):o.length?0:-1;this.updateActiveItemIndex(a>-1?a:o.length?0:-1)}hideChip(e){e.classList.add(r.chipInvisible)}showChip(e){e.classList.remove(r.chipInvisible)}refreshChipDisplay({chipEls:e,availableHorizontalChipElSpace:t,chipContainerElGap:o,hideSelectedChips:i}){let a=e.filter(d=>d.selected),c=a.filter(d=>!d.disabled),l=a.filter(d=>d.disabled),n=d=>{let f=w(d),u=d.getBoundingClientRect().width;return Number.isFinite(f)&&f>0?f:u};if(a.forEach(d=>n(d)),e.forEach(d=>{this.hideChip(d)}),i)return;let s=d=>{let f=0;return d.forEach(u=>{let b=n(u);b&&b<=t&&(t-=b+o,this.showChip(u),f++)}),f};s(c)<=1&&s(l)}async refreshSelectionDisplay(e=!0){if(this.refreshingSelectionDisplay)return;if(this.refreshingSelectionDisplay=!0,await this.componentOnReady(),R(this.selectionMode)){this.refreshingSelectionDisplay=!1;return}let{allSelectedIndicatorChipRef:t,chipContainerEl:o,selectionDisplay:i,placeholder:a,selectedIndicatorChipRef:c,textInputRef:l}=this;if(!l.value||!o){this.refreshingSelectionDisplay=!1;return}let n=parseInt(getComputedStyle(o).gap,10),s=w(o),{fontSize:C,fontFamily:d,minInlineSize:f}=getComputedStyle(l.value),u=.55,b=parseFloat(f)||parseInt(k,10),g=P(a,`${C} ${d}`),L=g>0?g:Math.max(b,Math.round((a?.length||0)*(parseFloat(C)||parseInt(k,10))*u)),$=Math.max(b,L),D=(i==="fit"?$:L)+n,ke=w(t.value),j=w(c.value),Be=Math.max(ke,j);if(this.setCompactSelectionDisplay({chipContainerElGap:n,chipContainerElWidth:s,inputWidth:D,largestSelectedIndicatorChipWidth:Be}),i!=="fit"&&this.allSelected&&this.selectAllEnabled&&this.selectedItems.forEach(y=>{let I=this.referenceEl?.querySelector(`#${h.chip(y.guid)}`);I&&this.hideChip(I)}),this.indeterminate&&this.selectedItems.forEach(y=>{let I=this.referenceEl?.querySelector(`#${h.chip(y.guid)}`);I&&this.showChip(I)}),i==="fit"){let y=Array.from(this.renderRoot.querySelectorAll("calcite-chip")).filter(J=>{let K=J.value,De=K!=null&&`${K}`!="";return J.disabled||De}),{hiddenChipIndicatorWidth:I,hideSelectedChips:Q,reservedPlaceholderInputWidth:Ge}=this.getFitCompactDisplayState({chipContainerElGap:n,chipContainerElWidth:s,inputMinWidth:b,placeholderWidth:L,selectedIndicatorChipElWidth:j});this.fitUsingCompactCountLabel=Q;let Ye=Math.round(s-(I+n+Ge+n));this.refreshChipDisplay({availableHorizontalChipElSpace:Ye,chipContainerElGap:n,chipEls:y,hideSelectedChips:Q});let $e=this.selectedHiddenChipsCount;this.syncChipVisibilityCounts(y),$e!==this.selectedHiddenChipsCount&&e&&(this.fitFollowUpRefreshPromise=this.updateComplete.then(()=>this.refreshSelectionDisplay(!1)).then(()=>{this.fitFollowUpRefreshPromise=void 0}))}this.refreshingSelectionDisplay=!1}setFloatingEl(e){this.floatingEl=e,V(this)}shouldUseFitCompactDisplay({chipContainerElGap:e,chipContainerElWidth:t,hiddenChipIndicatorWidth:o,inputMinWidth:i,placeholderWidth:a,reservedPlaceholderInputWidth:c}){let l=Math.round(t-(o+e+c+e));return a>i*2&&l<=0}getFitCompactDisplayState({chipContainerElGap:e,chipContainerElWidth:t,inputMinWidth:o,placeholderWidth:i,selectedIndicatorChipElWidth:a}){let c=w(this.selectedChipCountRef.value),l=this.deferFitChipCountRender||this.selectedHiddenChipsCount<=0?0:c||a,n=Math.max(o,i),s=this.shouldUseFitCompactDisplay({chipContainerElGap:e,chipContainerElWidth:t,hiddenChipIndicatorWidth:l,inputMinWidth:o,placeholderWidth:i,reservedPlaceholderInputWidth:n});return{hiddenChipIndicatorWidth:l,hideSelectedChips:s,reservedPlaceholderInputWidth:n}}setCompactSelectionDisplay({chipContainerElGap:e,chipContainerElWidth:t,inputWidth:o,largestSelectedIndicatorChipWidth:i}){let a=Math.round(i+e+o);(!this.maxCompactBreakpoint||this.maxCompactBreakpoint<a)&&(this.maxCompactBreakpoint=a),this.compactSelectionDisplay=t<this.maxCompactBreakpoint}setContainerEl(e){F(this.resizeObserver,this.listContainerEl,e),this.listContainerEl=e,this.transitionEl=e}setChipContainerEl(e){F(this.resizeObserver,this.chipContainerEl,e),this.chipContainerEl=e}setReferenceEl(e){this.referenceEl=e,V(this)}syncChipVisibilityCounts(e){let t=0,o=0;e.forEach(a=>{a.selected&&(o++,a.classList.contains(r.chipInvisible)||t++)}),t!==this.selectedVisibleChipsCount&&(this.selectedVisibleChipsCount=t);let i=Math.max(0,o-t);i!==this.selectedHiddenChipsCount&&(this.selectedHiddenChipsCount=i)}getMaxScrollerHeight(){let t=this.getItemsAndGroups(!0).filter(c=>!E(c)),{maxItems:o}=this,i=0,a=0;return t.length>=o&&t.forEach(c=>{if(i<o){let l=this.calculateScrollerHeight(c);a+=l,i+=1}}),a}calculateScrollerHeight(e){if(!e)return 0;let t=e.getBoundingClientRect().height,o=`:scope > ${B}, :scope > ${G}`,i=Array.from(e.querySelectorAll(o)).reduce((a,c)=>a+c.getBoundingClientRect().height,0);return t-i}inputHandler(e){let t=e.target.value;this.filterText=t}getItemsAndGroups(e=!1){return e?Array.from(this.el.querySelectorAll(`${B}, ${G}`)):[...this.groupItems,...this.items]}toggleSelection(e,t){!e||this.selectionMode==="single-persist"&&e.selected&&e.value===this.value&&!t||(this.selectionDisplay==="fit"&&this.isMulti()&&(this.deferFitChipCountRender=!0),this.isMulti()?this.handleMultiSelection(e,t):this.handleSingleSelection(e,t))}handleMultiSelection(e,t){e.selected=t,this.updateAncestors(e),this.updateSelectedItems(),this.emitComboboxChange(),this.resetText(),this.filterItems("")}handleSingleSelection(e,t){this.ignoreSelectedEventsFlag=!0,this.items.forEach(o=>o.selected=o===e?t:!1),this.ignoreSelectedEventsFlag=!1,this.updateSelectedItems(),this.emitComboboxChange(),this.textInputRef.value&&(this.textInputRef.value.value=O(e)),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems("")}updateAncestors(e){if(this.selectionMode!=="ancestors")return;let t=_(e),o=Ve(e);e.selected?t.forEach(i=>{i.disabled||(i.selected=!0)}):([...o].forEach(i=>{i.disabled||(i.selected=!1)}),[...t].forEach(i=>{Y(i)||(i.selected=!1)}))}updateItems(){this.allItems=this.getItems(!0),this.items=this.allItems.filter(e=>!e.disabled),this.groupItems=this.getGroupItems(),this.data=this.getData(),this.groupData=this.getGroupData(),this.updateItemProps(),this.updateSelectedItems(),this.previousAllSelected=this.allSelected}updateItemProps(){this.allItems.forEach(e=>{e.selectionMode=this.selectionMode,e.selectionAppearance=this.selectionAppearance,e.scale=this.scale}),this.groupItems.forEach((e,t)=>(e.scale=this.scale,e.position=t)),this.allowCustomValues||this.setMaxScrollerHeight(),this.groupItems.forEach((e,t,o)=>{t===0&&(e.afterEmptyGroup=!1);let i=o[t+1];i&&(i.afterEmptyGroup=e.children.length===0)})}getData(){return this.items.map(e=>({description:e.description,filterDisabled:e.filterDisabled,label:e.heading,metadata:e.metadata,shortHeading:e.shortHeading,el:e}))}getGroupData(){return this.groupItems.map(e=>({label:e.label,el:e}))}resetText(){this.textInputRef.value&&(this.textInputRef.value.value=""),this.filterText=""}getItems(e=!1){return Array.from(this.el.querySelectorAll(B)).filter(o=>e||!o.disabled)}getGroupItems(){return Array.from(this.el.querySelectorAll(G))}addCustomChip(e,t){let o=this.items.find(i=>i.heading===e);if(o)this.toggleSelection(o,!0);else{let i=document.createElement("calcite-combobox-item");i.value=e,i.heading=e,this.el.prepend(i),this.updateItems(),this.toggleSelection(i,!0),this.open=!0,t&&this.setFocus()}}removeActiveChip(e){let t=this.selectedItems[this.activeChipIndex];t&&!t.disabled&&`${h.chip(t.guid)}`===e.id&&this.toggleSelection(t,!1),this.setFocus()}removeLastChip(){let e=this.selectedItems.findLast(t=>!t.disabled);e&&(this.toggleSelection(e,!1),this.setFocus())}previousChip(){let e=this.selectedItems.length-1,t=this.activeChipIndex;this.activeChipIndex=t===-1?e:Math.max(t-1,0),this.updateActiveItemIndex(-1),this.focusChip()}nextChip(){let e=this.selectedItems.length-1,t=this.activeChipIndex+1;t>e?(this.activeChipIndex=-1,ne(this.textInputRef.value)):(this.activeChipIndex=t,this.focusChip()),this.updateActiveItemIndex(-1)}focusChip(){let e=this.selectedItems[this.activeChipIndex]?.guid;(e?this.referenceEl?.querySelector(`#${h.chip(e)}`):void 0)?.setFocus()}scrollToActiveOrSelectedItem(e=!1){let t=e&&this.selectedItems?.length?this.selectedItems[0]:this.keyboardNavItems[this.activeItemIndex],o=this.listContainerEl;if(!t||!o)return;t.scrollIntoView({block:"nearest"});let a=this.selectAllComboboxItemRef.value?.offsetHeight||0,c=t.getBoundingClientRect(),l=o.getBoundingClientRect();c.top<l.top+a&&(o.scrollTop-=l.top+a-c.top)}shiftActiveItemIndex(e){let{length:t}=this.keyboardNavItems,o=(this.activeItemIndex+t+e)%t;this.updateActiveItemIndex(o),this.scrollToActiveOrSelectedItem()}updateActiveItemIndex(e){this.activeItemIndex=e;let t="";this.keyboardNavItems.forEach((o,i)=>{i===e?(o.active=!0,t=`${h.item(o.guid)}`):o.active=!1}),this.activeDescendant=t,this.activeItemIndex>-1&&(this.activeChipIndex=-1)}isMulti(){return!R(this.selectionMode)}comboboxFocusHandler(){this.disabled||(this.activeChipIndex=-1,this.textInputRef.value?.focus(),this.open&&this.selectionDisplay==="fit"&&this.isMulti()&&this.refreshSelectionDisplay())}createScreenReaderItem({ariaLabel:e,ariaSelected:t,id:o,textContent:i}){return x`<li aria-label=${e??m} aria-selected=${t??m} id=${o??m} role=option tabindex=-1>${i}</li>`}handleSelectionModeWarning(){this.selectionMode==="single-persist"&&this.clearDisabled&&ce.warn('clearDisabled is ignored when selection-mode is set to "single-persist"')}getDescriptionMessage(){let e=Array.isArray(this.value)?this.value.join(", "):this.value;return this.readOnly?this.messages.nonEditable.replace("{value}",`${e}`):e}getChipLabel(e,t){return t?[...[..._(e)].reverse(),e].map(i=>O(i)).join(" / "):O(e)}renderChip({activeChipIndex:e,disabled:t,index:o,item:i,messages:a,readOnly:c,scale:l,isAncestors:n}){let s=this.getChipLabel(i,n);return H(i.guid||i.value||s,x`<calcite-chip .appearance=${c?"outline":"solid"} class=${p({[r.chip]:!0,[r.disabled]:t})} .closable=${!t&&!c} data-testid=${`${t?"disabled-chip":"chip"}-${o}`} .disabled=${t} .icon=${i.icon} .iconFlipRtl=${i.iconFlipRtl} id=${(!t&&i.guid?`${h.chip(i.guid)}`:void 0)??m} .label=${s} .messageOverrides=${t?void 0:{dismissLabel:a.removeTag.replace("{value}",`${s}`)}} @calciteChipClose=${t?void 0:()=>this.calciteChipCloseHandler(i)} @focusin=${t?void 0:()=>this.activeChipIndex=o} .scale=${l} .selected=${i.selected} .tabIndex=${!t&&e===o?0:-1} title=${s??m} .value=${i.value}>${s}</calcite-chip>`)}renderChipCount(e,t){let o=this.fitUsingCompactCountLabel?`${e}`:this.messages.disabledSelectedCount.replace("{count}",`${e}`)??`+${e}`;return x`<calcite-chip appearance=solid class=${p({[r.chip]:!0})} data-testid=selected-chip-count id=selected-chip-count .label=${o} .scale=${t} tabindex=-1 title=${o??m} ${S(this.selectedChipCountRef)}>${o}</calcite-chip>`}renderChips(){let{activeChipIndex:e,readOnly:t,scale:o,selectionDisplay:i,selectionMode:a,messages:c}=this,l=[],n=a==="ancestors",s=this.selectAllEnabled&&this.allSelected,C=i==="all";if(s)return null;let d=0,f=0;if(C){let u=this.allItems.filter(g=>g.selected&&(!n||!Y(g)));Z(u,this.selectedItems).forEach(g=>{if(g.disabled){l.push(this.renderChip({activeChipIndex:e,disabled:!0,index:f++,item:g,messages:c,readOnly:t,scale:o,isAncestors:n}));return}l.push(this.renderChip({activeChipIndex:e,disabled:!1,index:d++,item:g,messages:c,readOnly:t,scale:o,isAncestors:n}))})}else s||this.selectedItems.forEach(u=>{l.push(this.renderChip({activeChipIndex:e,disabled:u.disabled,index:d++,item:u,messages:c,readOnly:t,scale:o,isAncestors:n}))});if(i==="fit"){let u=this.selectedHiddenChipsCount,b=this.selectedVisibleChipsCount===0?this.selectedItems.length:u;u>0&&!this.deferFitChipCountRender&&l.push(this.renderChipCount(b,o))}return l.length?l:null}renderAllSelectedIndicatorChip(){let{allSelectedIndicatorChipRef:e,compactSelectionDisplay:t,scale:o,selectedVisibleChipsCount:i}=this,a=!1;if(this.selectionDisplay==="fit"&&this.textInputRef.value&&this.chipContainerEl){let s=parseInt(getComputedStyle(this.chipContainerEl).gap,10),C=w(this.chipContainerEl),{fontSize:d,fontFamily:f,minInlineSize:u}=getComputedStyle(this.textInputRef.value),b=.55,g=parseFloat(u)||parseInt(k,10),L=P(this.placeholder,`${d} ${f}`),$=L>0?L:Math.max(g,Math.round((this.placeholder?.length||0)*(parseFloat(d)||parseInt(k,10))*b)),D=w(this.selectedIndicatorChipRef.value);a=this.getFitCompactDisplayState({chipContainerElGap:s,chipContainerElWidth:C,inputMinWidth:g,placeholderWidth:$,selectedIndicatorChipElWidth:D}).hideSelectedChips}let l=t||a?this.messages.all:this.messages.allSelected,n=this.allSelected&&(this.selectionDisplay==="single"||!i||this.selectionDisplay==="all");return x`<calcite-chip class=${p({[r.chip]:!0,[r.chipInvisible]:!n,[r.allSelected]:!0})} data-testid=all-selected-indicator-chip .label=${l} .scale=${o} title=${l??m} value ${S(e)}>${l}</calcite-chip>`}renderSelectedIndicatorChip(){let{compactSelectionDisplay:e,selectionDisplay:t,scale:o,selectedIndicatorChipRef:i}=this,a=!1,c,l=this.getSelectedItems().length;return e?a=!0:t==="single"&&(this.allSelected?a=!0:l>0?a=!1:a=!0,c=`${l} ${this.messages.selected}`),x`<calcite-chip class=${p({[r.chip]:!0,[r.chipInvisible]:a})} .label=${c} .scale=${o} title=${c??m} value ${S(i)}>${c}</calcite-chip>`}renderSelectedIndicatorChipCompact(){let{compactSelectionDisplay:e,selectionDisplay:t,scale:o}=this,i=!1,a,c=this.getSelectedItems().length;return e?this.allSelected?i=!0:t==="single"&&(i=!(c>0),a=`${c}`):i=!0,x`<calcite-chip class=${p({[r.chip]:!0,[r.chipInvisible]:i})} .label=${a} .scale=${o} title=${a??m} value>${a}</calcite-chip>`}renderInput(){let{guid:e,disabled:t,placeholder:o,selectionMode:i,selectedItems:a,open:c}=this,l=R(i),n=a[0],s=!c&&l&&!!n&&!this.filterText;return x`<span class=${p({[r.inputWrap]:!0,[r.inputWrapSingle]:l})}>${s&&H("label",x`<span class=${p({[r.label]:!0,[r.labelIcon]:!!n?.icon})}>${O(n)}</span>`)||""}${H("input",x`<input aria-activedescendant=${this.activeDescendant??m} aria-controls=${`${h.listbox(e)}`} aria-errormessage=${h.validationMessage} aria-owns=${`${h.listbox(e)}`} aria-autocomplete=list .ariaDescription=${this.getDescriptionMessage()} .ariaExpanded=${c} aria-haspopup=listbox .ariaInvalid=${this.status==="invalid"} .ariaLabel=${ve(this)} class=${p({[r.input]:!0,[r.inputSingle]:!0,[r.inputHidden]:s,[r.inputIcon]:this.showingInlineIcon&&!!this.placeholderIcon})} data-testid=input .disabled=${t} .id=${`${h.input(e)}`} @focus=${this.comboboxFocusHandler} @input=${this.inputHandler} placeholder=${o??m} .readOnly=${this.readOnly} .required=${this.required} role=combobox .tabIndex=${this.activeChipIndex===-1?0:-1} type=text .value=${te(this.filterText??"")} ${S(this.textInputRef)}>`)}</span>`}renderListBoxOptions(){let e=this.keyboardNavItems.map(t=>this.createScreenReaderItem({ariaLabel:t.label,ariaSelected:t.selected,id:`${h.item(t.guid)}`,textContent:t.heading}));if(this.selectAllEnabled&&this.selectionMode!=="single"&&this.selectionMode!=="single-persist"){let t=this.createScreenReaderItem({ariaLabel:this.messages.selectAll,ariaSelected:this.allSelected,textContent:this.messages.selectAll});t&&e.unshift(t)}return e}renderFloatingUIContainer(){let{messages:e,setFloatingEl:t,setContainerEl:o,open:i,scale:a}=this,c={[r.listContainer]:!0,[W.animation]:!0,[W.animationActive]:i},l=(this.filterText&&e.add.replace("{text}",`${this.filterText}`))??"";return x`<div aria-hidden=true class=${p(r.floatingUIContainer)} popover=manual ${S(t)}><div class=${p(c)} ${S(o)}><ul class=${p({[r.list]:!0,[r.listHide]:!i})}>${this.selectAllEnabled&&this.selectionMode!=="single"&&this.selectionMode!=="single-persist"&&x`<calcite-combobox-item class=${p(r.selectAll)} data-testid=select-all-item .heading=${e.selectAll} .id=${`${this.guid}-select-all-enabled-interactive`} .indeterminate=${this.indeterminate} .label=${e.selectAll} .scale=${a} .selected=${this.allSelected} tabindex=-1 value=select-all ${S(this.selectAllComboboxItemRef)}></calcite-combobox-item>`||""}<slot></slot>${this.noMatchesFound&&(this.allowCustomValues?x`<li aria-label=${l??m} class=${p(r.noMatches)} @click=${this.customChipAddHandler} role=option tabindex=0>${Le({text:l,pattern:new RegExp(`(${T(this.filterText)})`,"i")})}</li>`:x`<li class=${p({[r.noMatchesPlaceholder]:!0,[r.noMatches]:!0})}>${e.noMatches}</li>`)||""}</ul></div></div>`}renderSelectedOrPlaceholderIcon(){let{open:e,placeholderIcon:t,placeholderIconFlipRtl:o,selectedItems:i}=this,a=i[0],c=a?.icon,l=t&&(e||!a);return this.showingInlineIcon&&H("selected-placeholder-icon",x`<span class=${p(r.iconStart)}><calcite-icon class=${p({[r.selectedIcon]:!l,[r.placeholderIcon]:l})} .flipRtl=${l?o:a.iconFlipRtl} .icon=${l?t:c} .scale=${z(this.scale)}></calcite-icon></span>`)||""}renderChevronIcon(){let{open:e}=this;return H("chevron",x`<span class=${p(r.iconEnd)}><calcite-icon class=${p(r.icon)} .icon=${e?q.chevronUp:q.chevronDown} .scale=${z(this.scale)}></calcite-icon></span>`)}render(){let{selectionDisplay:e,guid:t,label:o,open:i,readOnly:a}=this,c=R(this.selectionMode),l=e==="all",n=e==="single",s=!c&&e==="fit",C=!c&&!l,d=C&&!s,f=this.items.some(b=>b.selected&&!b.disabled),u=!this.clearDisabled&&this.selectionMode!=="single-persist"&&!!this.value?.length&&f;return this.interactiveContainer({disabled:this.disabled,children:x`${this.labelText&&we({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<div aria-live=polite class=${p({[r.wrapper]:!0,[r.wrapperSingle]:c||!this.selectedItems.length,[r.wrapperActive]:i})} @click=${this.clickHandler} @keydown=${this.keyDownHandler} ${S(this.setReferenceEl)}>${this.renderSelectedOrPlaceholderIcon()}${H("grid",x`<div class=${p({[r.gridInput]:!0,[r.selectionDisplayFit]:s,[r.selectionDisplaySingle]:n})} ${S(this.setChipContainerEl)}>${!c&&!n&&this.renderChips()||""}${!c&&!n&&this.selectAllEnabled&&l&&this.renderAllSelectedIndicatorChip()||""}${d&&this.renderSelectedIndicatorChip()||""}${d&&this.renderSelectedIndicatorChipCompact()||""}${C&&this.renderAllSelectedIndicatorChip()||""}<label class=${p(r.screenReadersOnly)} .htmlFor=${`${h.input(t)}`} .id=${`${h.label(t)}`}>${o}</label>${this.renderInput()}</div>`)}${!a&&u?Re({ariaLabel:this.messages.clear,disabled:this.disabled,ref:this.clearButtonRef,scale:this.scale,title:this.messages.clear}):null}${!a&&this.renderChevronIcon()||""}</div><ul aria-labelledby=${`${h.label(t)}`} aria-multiselectable=true class=${p(r.screenReadersOnly)} .id=${`${h.listbox(t)}`} role=listbox tabindex=-1>${this.renderListBoxOptions()}</ul>${this.renderFloatingUIContainer()}${this.validationMessage&&this.status==="invalid"?Ie({icon:this.validationIcon,id:h.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null}`})}};le("calcite-combobox",X);export{X as Combobox};