@expressivecss/expressive 0.12.0 → 0.14.1
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.
- package/CHANGELOG.md +339 -1
- package/README.md +38 -1
- package/dist/css/expressive.css +5342 -105
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/fonts/material-symbols-outlined.woff2 +0 -0
- package/dist/fonts/material-symbols-rounded.woff2 +0 -0
- package/dist/fonts/material-symbols-sharp.woff2 +0 -0
- package/dist/js/chunks/chunk-3DHK5CZU.mjs +105 -0
- package/dist/js/chunks/chunk-3DHK5CZU.mjs.map +7 -0
- package/dist/js/chunks/{chunk-HB6IW7QQ.mjs → chunk-3GVFZ4XO.mjs} +3 -3
- package/dist/js/chunks/{chunk-HLDXZ7XB.mjs → chunk-4HZMB7LI.mjs} +22 -8
- package/dist/js/chunks/chunk-4HZMB7LI.mjs.map +7 -0
- package/dist/js/chunks/chunk-4KMNFIFZ.mjs +270 -0
- package/dist/js/chunks/chunk-4KMNFIFZ.mjs.map +7 -0
- package/dist/js/chunks/chunk-4TKTLGEM.mjs +262 -0
- package/dist/js/chunks/chunk-4TKTLGEM.mjs.map +7 -0
- package/dist/js/chunks/{chunk-3VOK6J7U.mjs → chunk-5BKHWHYY.mjs} +13 -6
- package/dist/js/chunks/chunk-5BKHWHYY.mjs.map +7 -0
- package/dist/js/chunks/{chunk-H2WA4XHH.mjs → chunk-5HQSGDZ5.mjs} +16 -7
- package/dist/js/chunks/chunk-5HQSGDZ5.mjs.map +7 -0
- package/dist/js/chunks/{chunk-LWBQIX5J.mjs → chunk-A7ALMYUR.mjs} +41 -44
- package/dist/js/chunks/chunk-A7ALMYUR.mjs.map +7 -0
- package/dist/js/chunks/chunk-BG6ZRB5H.mjs +154 -0
- package/dist/js/chunks/chunk-BG6ZRB5H.mjs.map +7 -0
- package/dist/js/chunks/{chunk-DLWYKFEI.mjs → chunk-CUQPB25U.mjs} +3 -3
- package/dist/js/chunks/{chunk-6WLSDZ4O.mjs → chunk-DAIU5SLG.mjs} +2 -2
- package/dist/js/chunks/chunk-FS7XY3HT.mjs +124 -0
- package/dist/js/chunks/chunk-FS7XY3HT.mjs.map +7 -0
- package/dist/js/chunks/{chunk-WJXDBPXQ.mjs → chunk-GIW4K4SE.mjs} +8 -12
- package/dist/js/chunks/chunk-GIW4K4SE.mjs.map +7 -0
- package/dist/js/chunks/chunk-GUB3TNO2.mjs +164 -0
- package/dist/js/chunks/chunk-GUB3TNO2.mjs.map +7 -0
- package/dist/js/chunks/chunk-GVGT6MIU.mjs +47 -0
- package/dist/js/chunks/chunk-GVGT6MIU.mjs.map +7 -0
- package/dist/js/chunks/{chunk-HNFSMIBY.mjs → chunk-GZKEFWPM.mjs} +83 -22
- package/dist/js/chunks/chunk-GZKEFWPM.mjs.map +7 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs +48 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs.map +7 -0
- package/dist/js/chunks/chunk-ILP3PDTL.mjs +187 -0
- package/dist/js/chunks/chunk-ILP3PDTL.mjs.map +7 -0
- package/dist/js/chunks/{chunk-YSBCHYXP.mjs → chunk-JIDMQGK6.mjs} +118 -13
- package/dist/js/chunks/chunk-JIDMQGK6.mjs.map +7 -0
- package/dist/js/chunks/chunk-KBNN3QDH.mjs +7 -0
- package/dist/js/chunks/chunk-KBNN3QDH.mjs.map +7 -0
- package/dist/js/chunks/{chunk-NNYP33NB.mjs → chunk-KHV6DZXX.mjs} +5 -4
- package/dist/js/chunks/chunk-KHV6DZXX.mjs.map +7 -0
- package/dist/js/chunks/{chunk-RFZZCYVU.mjs → chunk-KY6U46SM.mjs} +3 -3
- package/dist/js/chunks/{chunk-CKQP6P76.mjs → chunk-LRZMJZ3T.mjs} +4 -3
- package/dist/js/chunks/chunk-LRZMJZ3T.mjs.map +7 -0
- package/dist/js/chunks/{chunk-6OMRGML6.mjs → chunk-MNPROCZF.mjs} +4 -4
- package/dist/js/chunks/{chunk-6OMRGML6.mjs.map → chunk-MNPROCZF.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-QV2JAWIZ.mjs → chunk-MZ6Z24BX.mjs} +3 -2
- package/dist/js/chunks/{chunk-QV2JAWIZ.mjs.map → chunk-MZ6Z24BX.mjs.map} +2 -2
- package/dist/js/chunks/chunk-NS2UMNZV.mjs +292 -0
- package/dist/js/chunks/chunk-NS2UMNZV.mjs.map +7 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs +406 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-UBLRRJ7N.mjs → chunk-PM655FXL.mjs} +2 -2
- package/dist/js/chunks/{chunk-IFXVDDDH.mjs → chunk-QERLECVU.mjs} +3 -3
- package/dist/js/chunks/{chunk-GZWPXXY6.mjs → chunk-QJABDLSD.mjs} +5 -2
- package/dist/js/chunks/chunk-QJABDLSD.mjs.map +7 -0
- package/dist/js/chunks/chunk-RHRQKTTX.mjs +139 -0
- package/dist/js/chunks/chunk-RHRQKTTX.mjs.map +7 -0
- package/dist/js/chunks/{chunk-UNEMYWEW.mjs → chunk-S3XDFGSZ.mjs} +2 -2
- package/dist/js/chunks/chunk-SPETGK25.mjs +59 -0
- package/dist/js/chunks/chunk-SPETGK25.mjs.map +7 -0
- package/dist/js/chunks/chunk-TBM3FT7G.mjs +398 -0
- package/dist/js/chunks/chunk-TBM3FT7G.mjs.map +7 -0
- package/dist/js/chunks/chunk-UEXCIMJZ.mjs +214 -0
- package/dist/js/chunks/chunk-UEXCIMJZ.mjs.map +7 -0
- package/dist/js/chunks/chunk-VGZSAFTX.mjs +173 -0
- package/dist/js/chunks/chunk-VGZSAFTX.mjs.map +7 -0
- package/dist/js/chunks/{chunk-UAEAQBRC.mjs → chunk-X7OCHZVF.mjs} +2 -2
- package/dist/js/chunks/{chunk-EC63CHXU.mjs → chunk-YMSXJON6.mjs} +7 -6
- package/dist/js/chunks/chunk-YMSXJON6.mjs.map +7 -0
- package/dist/js/chunks/{chunk-QVVEWBOF.mjs → chunk-Z2NRKI7R.mjs} +2 -2
- package/dist/js/chunks/{chunk-PIJ2TAR3.mjs → chunk-ZAS25YFD.mjs} +2 -2
- package/dist/js/chunks/chunk-ZKZKNSLC.mjs +1 -0
- package/dist/js/expressive.cjs +3113 -148
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +3113 -148
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +11 -11
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +95 -35
- package/dist/js/expressive.mjs.map +1 -1
- package/dist/js/internal/behaviors/bottomSheets.mjs +3 -3
- package/dist/js/internal/behaviors/dialogs.mjs +2 -2
- package/dist/js/internal/behaviors/forms.mjs +2 -2
- package/dist/js/internal/behaviors/sheetDrag.mjs +2 -2
- package/dist/js/internal/behaviors/sideSheets.mjs +3 -3
- package/dist/js/internal/components/autocomplete.mjs +3 -3
- package/dist/js/internal/components/barChart.mjs +10 -0
- package/dist/js/internal/components/barChart.mjs.map +7 -0
- package/dist/js/internal/components/buttons.mjs +2 -2
- package/dist/js/internal/components/cards.mjs +2 -2
- package/dist/js/internal/components/carousel.mjs +2 -2
- package/dist/js/internal/components/chips.mjs +4 -4
- package/dist/js/internal/components/columnChart.mjs +9 -0
- package/dist/js/internal/components/columnChart.mjs.map +7 -0
- package/dist/js/internal/components/commandPalette.mjs +9 -0
- package/dist/js/internal/components/commandPalette.mjs.map +7 -0
- package/dist/js/internal/components/confetti.mjs +8 -0
- package/dist/js/internal/components/confetti.mjs.map +7 -0
- package/dist/js/internal/components/datepicker.mjs +5 -5
- package/dist/js/internal/components/expandingCard.mjs +2 -2
- package/dist/js/internal/components/heatmapChart.mjs +9 -0
- package/dist/js/internal/components/heatmapChart.mjs.map +7 -0
- package/dist/js/internal/components/index.mjs +88 -28
- package/dist/js/internal/components/lightbox.mjs +2 -2
- package/dist/js/internal/components/lineChart.mjs +12 -0
- package/dist/js/internal/components/lineChart.mjs.map +7 -0
- package/dist/js/internal/components/mapView.mjs +9 -0
- package/dist/js/internal/components/mapView.mjs.map +7 -0
- package/dist/js/internal/components/menu.mjs +2 -2
- package/dist/js/internal/components/messageScroller.mjs +9 -0
- package/dist/js/internal/components/messageScroller.mjs.map +7 -0
- package/dist/js/internal/components/mixedChart.mjs +10 -0
- package/dist/js/internal/components/mixedChart.mjs.map +7 -0
- package/dist/js/internal/components/particles.mjs +8 -0
- package/dist/js/internal/components/particles.mjs.map +7 -0
- package/dist/js/internal/components/pieChart.mjs +9 -0
- package/dist/js/internal/components/pieChart.mjs.map +7 -0
- package/dist/js/internal/components/questionnaire.mjs +9 -0
- package/dist/js/internal/components/questionnaire.mjs.map +7 -0
- package/dist/js/internal/components/radarChart.mjs +9 -0
- package/dist/js/internal/components/radarChart.mjs.map +7 -0
- package/dist/js/internal/components/radialChart.mjs +9 -0
- package/dist/js/internal/components/radialChart.mjs.map +7 -0
- package/dist/js/internal/components/registry.mjs +35 -20
- package/dist/js/internal/components/richTextEditor.mjs +9 -0
- package/dist/js/internal/components/richTextEditor.mjs.map +7 -0
- package/dist/js/internal/components/scrollspy.mjs +1 -1
- package/dist/js/internal/components/select.mjs +3 -3
- package/dist/js/internal/components/slider.mjs +2 -2
- package/dist/js/internal/components/snackbar.mjs +2 -2
- package/dist/js/internal/components/tabs.mjs +3 -3
- package/dist/js/internal/components/timepicker.mjs +3 -3
- package/dist/js/internal/components/tooltip.mjs +2 -2
- package/dist/js/internal/core/utils.mjs +1 -1
- package/dist/js/internal/plugins/dockedDisplayPlugin.mjs +2 -2
- package/dist/js/modular.mjs +95 -35
- package/dist/types/behaviors/forms.d.ts +27 -0
- package/dist/types/components/barChart.d.ts +24 -0
- package/dist/types/components/carousel.d.ts +2 -0
- package/dist/types/components/columnChart.d.ts +21 -0
- package/dist/types/components/commandPalette.d.ts +96 -0
- package/dist/types/components/confetti.d.ts +103 -0
- package/dist/types/components/datepicker.d.ts +2 -0
- package/dist/types/components/heatmapChart.d.ts +49 -0
- package/dist/types/components/index.d.ts +15 -0
- package/dist/types/components/lineChart.d.ts +134 -0
- package/dist/types/components/mapView.d.ts +151 -0
- package/dist/types/components/menu.d.ts +31 -0
- package/dist/types/components/messageScroller.d.ts +111 -0
- package/dist/types/components/mixedChart.d.ts +25 -0
- package/dist/types/components/particles.d.ts +72 -0
- package/dist/types/components/pieChart.d.ts +43 -0
- package/dist/types/components/questionnaire.d.ts +96 -0
- package/dist/types/components/radarChart.d.ts +39 -0
- package/dist/types/components/radialChart.d.ts +45 -0
- package/dist/types/components/registry.d.ts +52 -0
- package/dist/types/components/richTextEditor.d.ts +71 -0
- package/dist/types/components/slider.d.ts +1 -1
- package/dist/types/components/snackbar.d.ts +2 -0
- package/dist/types/components/tabs.d.ts +1 -1
- package/dist/types/modular.d.ts +10 -1
- package/dist/types/plugins/dockedDisplayPlugin.d.ts +3 -3
- package/package.json +5 -1
- package/src/sass/README.md +3 -6
- package/src/sass/abstracts/_index.scss +1 -1
- package/src/sass/abstracts/_mixins.scss +226 -0
- package/src/sass/abstracts/_variables.scss +14 -0
- package/src/sass/base/_typography.scss +45 -0
- package/src/sass/components/_accordion.scss +161 -0
- package/src/sass/components/_aura.scss +119 -0
- package/src/sass/components/_avatar.scss +86 -0
- package/src/sass/components/_bar-chart.scss +285 -0
- package/src/sass/components/_bottom-sheet.scss +1 -0
- package/src/sass/components/_button-groups.scss +13 -3
- package/src/sass/components/_buttons.scss +1 -1
- package/src/sass/components/_cards.scss +16 -13
- package/src/sass/components/_column-chart.scss +134 -0
- package/src/sass/components/_command-palette.scss +140 -0
- package/src/sass/components/_confetti.scss +14 -0
- package/src/sass/components/_countdown.scss +89 -0
- package/src/sass/components/_data-table.scss +188 -0
- package/src/sass/components/_dialog.scss +1 -0
- package/src/sass/components/_empty-state.scss +78 -0
- package/src/sass/components/_expanding-card.scss +3 -0
- package/src/sass/components/_heatmap-chart.scss +156 -0
- package/src/sass/components/_index.scss +30 -0
- package/src/sass/components/_kpi.scss +162 -0
- package/src/sass/components/_line-chart.scss +102 -0
- package/src/sass/components/_map.scss +188 -0
- package/src/sass/components/_marquee.scss +111 -0
- package/src/sass/components/_menu.scss +10 -0
- package/src/sass/components/_message-scroller.scss +66 -0
- package/src/sass/components/_message.scss +202 -0
- package/src/sass/components/_mixed-chart.scss +157 -0
- package/src/sass/components/_navigation-bar.scss +1 -0
- package/src/sass/components/_navigation-rail.scss +9 -0
- package/src/sass/components/_particles.scss +14 -0
- package/src/sass/components/_pie-chart.scss +203 -0
- package/src/sass/components/_popover.scss +112 -0
- package/src/sass/components/_questionnaire.scss +144 -0
- package/src/sass/components/_radar-chart.scss +205 -0
- package/src/sass/components/_radial-chart.scss +174 -0
- package/src/sass/components/_rich-text-editor.scss +99 -0
- package/src/sass/components/_search.scss +1 -0
- package/src/sass/components/_side-sheet.scss +1 -0
- package/src/sass/components/_skeleton.scss +81 -0
- package/src/sass/components/_snackbar.scss +1 -0
- package/src/sass/components/_stat.scss +86 -0
- package/src/sass/components/_stepper.scss +190 -0
- package/src/sass/components/_table_of_contents.scss +3 -1
- package/src/sass/components/_timeline.scss +114 -0
- package/src/sass/components/_toolbar.scss +1 -0
- package/src/sass/components/_tooltip.scss +2 -0
- package/src/sass/components/_tree.scss +139 -0
- package/src/sass/components/forms/_checkboxes.scss +7 -2
- package/src/sass/components/forms/_drop-zone.scss +128 -0
- package/src/sass/components/forms/_index.scss +2 -0
- package/src/sass/components/forms/_input-fields.scss +133 -2
- package/src/sass/components/forms/_rating.scss +165 -0
- package/src/sass/tokens/_reference.scss +3 -15
- package/src/sass/utilities/_index.scss +2 -0
- package/src/sass/utilities/_scroll-area.scss +35 -0
- package/src/sass/utilities/_shapes.scss +164 -0
- package/dist/js/chunks/chunk-3VOK6J7U.mjs.map +0 -7
- package/dist/js/chunks/chunk-CKQP6P76.mjs.map +0 -7
- package/dist/js/chunks/chunk-EC63CHXU.mjs.map +0 -7
- package/dist/js/chunks/chunk-G3I5H2U3.mjs +0 -7
- package/dist/js/chunks/chunk-G3I5H2U3.mjs.map +0 -7
- package/dist/js/chunks/chunk-GZWPXXY6.mjs.map +0 -7
- package/dist/js/chunks/chunk-H2WA4XHH.mjs.map +0 -7
- package/dist/js/chunks/chunk-HLDXZ7XB.mjs.map +0 -7
- package/dist/js/chunks/chunk-HNFSMIBY.mjs.map +0 -7
- package/dist/js/chunks/chunk-LWBQIX5J.mjs.map +0 -7
- package/dist/js/chunks/chunk-NNYP33NB.mjs.map +0 -7
- package/dist/js/chunks/chunk-PSSHQWCX.mjs +0 -100
- package/dist/js/chunks/chunk-PSSHQWCX.mjs.map +0 -7
- package/dist/js/chunks/chunk-WJXDBPXQ.mjs.map +0 -7
- package/dist/js/chunks/chunk-WWPAPHMA.mjs +0 -1
- package/dist/js/chunks/chunk-YSBCHYXP.mjs.map +0 -7
- /package/dist/js/chunks/{chunk-HB6IW7QQ.mjs.map → chunk-3GVFZ4XO.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-DLWYKFEI.mjs.map → chunk-CUQPB25U.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-6WLSDZ4O.mjs.map → chunk-DAIU5SLG.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-RFZZCYVU.mjs.map → chunk-KY6U46SM.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-UBLRRJ7N.mjs.map → chunk-PM655FXL.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-IFXVDDDH.mjs.map → chunk-QERLECVU.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-UNEMYWEW.mjs.map → chunk-S3XDFGSZ.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-UAEAQBRC.mjs.map → chunk-X7OCHZVF.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-QVVEWBOF.mjs.map → chunk-Z2NRKI7R.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-PIJ2TAR3.mjs.map → chunk-ZAS25YFD.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-WWPAPHMA.mjs.map → chunk-ZKZKNSLC.mjs.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var Expressive=(()=>{var ut=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var qt=Object.prototype.hasOwnProperty;var $t=(d,o)=>{for(var t in o)ut(d,t,{get:o[t],enumerable:!0})},Kt=(d,o,t,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Vt(o))!qt.call(d,i)&&i!==t&&ut(d,i,{get:()=>o[i],enumerable:!(e=Ft(o,i))||e.enumerable});return d};var zt=d=>Kt(ut({},"__esModule",{value:!0}),d);var Te={};$t(Te,{AppBar:()=>Y,AutoInit:()=>It,Autocomplete:()=>P,BottomSheets:()=>K,ButtonGroup:()=>j,Cards:()=>B,Carousel:()=>F,CharacterCounter:()=>lt,Chips:()=>W,Datepicker:()=>Z,Dialogs:()=>$,ExpandingCard:()=>N,FloatingActionButton:()=>G,FormSelect:()=>k,Forms:()=>U,Lightbox:()=>Q,Menu:()=>H,NavigationRail:()=>tt,Range:()=>V,ScrollSpy:()=>J,SideSheets:()=>z,Slider:()=>V,Snackbar:()=>ht,Tabs:()=>et,Timepicker:()=>it,Tooltip:()=>st,version:()=>Le});var S=class S{static onDocumentReady(o){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",o,{once:!0}):o())}static guid(){return globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}static portalRoot(o){let t=o.getRootNode();return t.host?t:document.body}static getElementById(o,t){let e=o.getRootNode();return e.getElementById?e.getElementById(t):document.getElementById(t)}static checkWithinContainer(o,t,e){let i={top:!1,right:!1,bottom:!1,left:!1},s=o.getBoundingClientRect(),n=o===document.body?Math.max(s.bottom,window.innerHeight):s.bottom,a=o.scrollLeft,h=o.scrollTop,c=t.left-a,l=t.top-h;return(c<s.left+e||c<e)&&(i.left=!0),(c+t.width>s.right-e||c+t.width>window.innerWidth-e)&&(i.right=!0),(l<s.top+e||l<e)&&(i.top=!0),(l+t.height>n-e||l+t.height>window.innerHeight-e)&&(i.bottom=!0),i}static checkPossibleAlignments(o,t,e,i){let s={top:!0,right:!0,bottom:!0,left:!0,spaceOnTop:null,spaceOnRight:null,spaceOnBottom:null,spaceOnLeft:null},n=getComputedStyle(t).overflow==="visible",a=t.getBoundingClientRect(),h=Math.min(a.height,window.innerHeight),c=Math.min(a.width,window.innerWidth),l=o.getBoundingClientRect(),r=t.scrollLeft,p=t.scrollTop,m=e.left-r,v=e.top-p,E=e.top+l.height-p;return s.spaceOnRight=n?window.innerWidth-(l.left+e.width):c-(m+e.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=n?l.right-e.width:m-e.width+l.width,s.spaceOnLeft<0&&(s.right=!1),s.spaceOnBottom=n?window.innerHeight-(l.top+e.height+i):h-(v+e.height+i),s.spaceOnBottom<0&&(s.top=!1),s.spaceOnTop=n?l.bottom-(e.height+i):E-(e.height-i),s.spaceOnTop<0&&(s.bottom=!1),s}static getIdFromTrigger(o){let t=o.dataset.target;return t||(t=o.getAttribute("href"),t?t.slice(1):"")}static getDocumentScrollTop(){return window.scrollY}static getDocumentScrollLeft(){return window.scrollX}static throttle(o,t){let e=null,i=null,s=0;return(...n)=>{let a=Date.now(),h=t-(a-s);h<=0?(clearTimeout(e),e=null,s=a,i=null,o(...n)):e?i=n:(i=n,e=setTimeout(()=>{s=Date.now(),e=null,o(...i??[]),i=null},h))}}static createConfirmationContainer(o,t,e,i,s){let n=document.createElement("div");n.classList.add("confirmation-btns"),o.append(n),this.createButton(n,e,["btn-cancel"],!0,s),this.createButton(n,t,["btn-confirm"],!0,i)}static createButton(o,t,e=[],i=!0,s=null){e=e.concat(["text"]);let n=document.createElement("button");n.className=e.join(" "),n.style.visibility=i?"visible":"hidden",n.type="button",n.tabIndex=i?0:-1,n.innerText=t,typeof s=="function"&&n.addEventListener("click",s),o.append(n)}static _setAbsolutePosition(o,t,e,i,s,n="center"){let a=o.offsetHeight,h=o.offsetWidth,c=t.offsetHeight,l=t.offsetWidth,r=o.getBoundingClientRect(),p=0,m=0,v=r.top+S.getDocumentScrollTop(),E=r.left+S.getDocumentScrollLeft();e==="top"?(v+=-c-i,n==="center"&&(E+=h/2-l/2),m=-s):e==="right"?(v+=a/2-c/2,E=h+i,p=s):e==="left"?(v+=a/2-c/2,E=-l-i,p=-s):(v+=a+i,n==="center"&&(E+=h/2-l/2),m=s),n==="right"&&(E+=h-l-i);let b=S._repositionWithinScreen(E,v,l,c,i,s,n),y=t.offsetParent;if(y&&(y!==document.body||getComputedStyle(y).position!=="static")){let I=y.getBoundingClientRect(),A=y===document.scrollingElement;b.x-=I.left+S.getDocumentScrollLeft()+y.clientLeft-(A?0:y.scrollLeft),b.y-=I.top+S.getDocumentScrollTop()+y.clientTop-(A?0:y.scrollTop)}return t.style.top=b.y+"px",t.style.left=b.x+"px",{x:p,y:m}}static _repositionWithinScreen(o,t,e,i,s,n,a){let h=S.getDocumentScrollLeft(),c=S.getDocumentScrollTop(),l=o-h,r=t-c,p={left:l,top:r,width:e,height:i},m;a==="left"||a=="center"?m=s+n:a==="right"&&(m=s-n);let v=S.checkWithinContainer(document.body,p,m);return v.left?l=m:v.right&&(l-=l+e-window.innerWidth),v.top?r=m:v.bottom&&(r-=r+i-window.innerHeight),{x:l+h,y:r+c}}};S.keys={TAB:"Tab",ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",DELETE:"Delete"};var u=S;var _=class{constructor(o,t,e){o instanceof HTMLElement||console.error(Error(o+" is not an HTML Element"));let i=e.getInstance(o);i&&i.destroy(),this.el=o}static init(o,t,e){let i=null;if(o instanceof Element)i=new e(o,t);else if(o){i=[];for(let s=0;s<o.length;s++)i.push(new e(o[s],t))}return i}static get defaults(){return{}}static getInstance(o){throw new Error("This method must be implemented.")}destroy(){throw new Error("This method must be implemented.")}};var Ut={onOpen:null,onClose:null},mt='article:has(> aside[id]:not([id=""])):not(:has(> aside ~ aside)):has(> button.card-reveal-trigger[type="button"], > :not(aside) button.card-reveal-trigger[type="button"])',pt="card-reveal-initialized";function Yt(d){if(d.getAttribute("aria-label")?.trim())return!0;let t=d.getAttribute("aria-labelledby");if(t&&t.trim().split(/\s+/).map(s=>d.ownerDocument.getElementById(s)?.textContent??"").join(" ").trim())return!0;let e=d.cloneNode(!0);return e.querySelectorAll('[aria-hidden="true"]').forEach(i=>i.remove()),!!e.textContent?.trim()}function Et(d,o,t){return d.closest("article")===o&&!t.contains(d)&&!d.disabled&&d.getAttribute("aria-disabled")!=="true"&&Yt(d)}function ft(d){if(d.tagName!=="ARTICLE")return!1;let o=d.querySelectorAll(":scope > aside");return o.length!==1||!o[0].id?!1:Array.from(d.querySelectorAll('button.card-reveal-trigger[type="button"]')).some(t=>Et(t,d,o[0]))}var B=class d extends _{constructor(t,e={}){super(t,e,d);this.isOpen=!1;this._ownsRevealInitializedClass=!1;this._initialAriaControls=new Map;this._lastActivator=null;this._setupEventHandlers=()=>{this._activators.forEach(t=>{t.addEventListener("click",this._handleClickInteraction)}),this.el.addEventListener("keydown",this._handleKeydownEvent)};this._removeEventHandlers=()=>{this._activators.forEach(t=>{t.removeEventListener("click",this._handleClickInteraction)}),this.el.removeEventListener("keydown",this._handleKeydownEvent)};this._handleClickInteraction=t=>{this._lastActivator=t.currentTarget,this._handleRevealEvent()};this._handleKeydownEvent=t=>{(t.target instanceof Element?t.target.closest("article"):null)!==this.el||t.key!=="Escape"||!this.isOpen||(t.preventDefault(),this.close())};this._handleRevealEvent=()=>{this.isOpen?this.close():this.open()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.classList.add("open"),this.cardReveal.inert=!1,this._activators.forEach(t=>t.ariaExpanded="true"),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.cardReveal)return;let t=this.cardReveal.contains(document.activeElement);this.isOpen=!1,this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._activators.forEach(e=>e.ariaExpanded="false"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el),t&&(this._lastActivator??this._activators[0])?.focus()};this.el.Expressive_Cards=this,this.options={...d.defaults,...e};let i=this.el.querySelectorAll(":scope > aside"),s=i.length===1?i[0]:null,n=s?Array.from(this.el.querySelectorAll('button.card-reveal-trigger[type="button"]')).filter(a=>Et(a,this.el,s)):[];this.cardReveal=s?.id&&n.length>0?s:null,this._activators=this.cardReveal?n:[],this.cardReveal&&(this._ownsRevealInitializedClass=!this.el.classList.contains(pt),this.el.classList.add(pt),this._activators.forEach(a=>{this._initialAriaControls.set(a,a.getAttribute("aria-controls")),a.ariaExpanded="false",a.setAttribute("aria-controls",this.cardReveal.id)}),this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._setupEventHandlers())}static get defaults(){return Ut}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Cards}destroy(){this._removeEventHandlers(),this.cardReveal&&(this.cardReveal.classList.remove("open"),this.cardReveal.inert=!1,this._ownsRevealInitializedClass&&this.el.classList.remove(pt)),this._activators.forEach(t=>{t.removeAttribute("aria-expanded");let e=this._initialAriaControls.get(t);e===null?t.removeAttribute("aria-controls"):e!==void 0&&t.setAttribute("aria-controls",e)}),this.isOpen=!1,this._activators=[],this._initialAriaControls.clear(),this._lastActivator=null,this.el.Expressive_Cards=void 0}static Init(){u.onDocumentReady(()=>{Array.from(document.querySelectorAll(mt)).filter(ft).forEach(e=>{e&&e.Expressive_Cards==null&&this.init(e)})})}};var Gt={onOpen:null,onClose:null},vt="article.expanding-card:has(> dialog.expanding-card-dialog)",N=class d extends _{constructor(t,e){super(t,e,d);this.isOpen=!1;this.closeGeneration=0;this._setupEventHandlers=()=>{this.trigger?.addEventListener("click",this.open),this.trigger?.addEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.addEventListener("click",this.close),this.dialog?.addEventListener("cancel",this._handleCancel),this.dialog?.addEventListener("close",this._handleNativeClose)};this._removeEventHandlers=()=>{this.trigger?.removeEventListener("click",this.open),this.trigger?.removeEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.removeEventListener("click",this.close),this.dialog?.removeEventListener("cancel",this._handleCancel),this.dialog?.removeEventListener("close",this._handleNativeClose)};this._handleTriggerKeypress=t=>{(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this.open())};this._handleCancel=t=>{t.preventDefault(),this.close()};this._handleNativeClose=()=>{this.dialog.open||(this.closeGeneration++,this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"))};this._setTransitionOrigin=()=>{if(!this.dialog)return;let t=this.el.getBoundingClientRect(),i=this.el.querySelector(":scope > figure, :scope > img")?.getBoundingClientRect();this.dialog.style.setProperty("--md-comp-expanding-card-from-top",`${Math.max(0,t.top)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-right",`${Math.max(0,window.innerWidth-t.right)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-bottom",`${Math.max(0,window.innerHeight-t.bottom)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-left",`${Math.max(0,t.left)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-media-height",`${Math.max(0,i?.height??0)}px`)};this.open=()=>{this.isOpen||!this.dialog||!this.trigger||(this.closeGeneration++,this._setTransitionOrigin(),this.isOpen=!0,this.trigger.ariaExpanded="true",this.dialog.ariaExpanded="true",this.dialog.showModal(),this.dialog.offsetWidth,this.dialog.classList.add("expanded"),this.closeButton?.focus(),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.dialog||!this.trigger)return;let t=++this.closeGeneration;this._setTransitionOrigin(),this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el);let e=()=>{t!==this.closeGeneration||this.isOpen||!this.dialog.open||(this.dialog.close(),this.dialog.isConnected&&this.trigger.isConnected&&this.trigger.focus())},s=window.matchMedia("(prefers-reduced-motion: reduce)").matches?[]:(this.dialog.getAnimations?.()??[]).filter(n=>n.transitionProperty==="clip-path");s.length===0?e():Promise.allSettled(s.map(n=>n.finished)).then(e)};this.el.Expressive_ExpandingCard=this,this.options={...d.defaults,...e},this.dialog=this.el.querySelector(":scope > dialog.expanding-card-dialog"),this.trigger=this.el.querySelector(":scope > .expanding-card-trigger, :scope > figure > .expanding-card-trigger"),this.closeButton=this.dialog?.querySelector(".expanding-card-close")??null,this.trigger&&this.dialog&&(this.trigger.ariaExpanded="false",this.dialog.id&&this.trigger.setAttribute("aria-controls",this.dialog.id),this.trigger.matches("a[href], button, input, select, textarea")||(this.trigger.tabIndex=0,this.trigger.setAttribute("role","button")),this.dialog.ariaExpanded="false",this._setupEventHandlers())}static get defaults(){return Gt}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ExpandingCard}destroy(){this._removeEventHandlers(),this.closeGeneration++,this.isOpen=!1,this.trigger&&(this.trigger.ariaExpanded="false"),this.dialog&&(this.dialog.ariaExpanded="false"),this.dialog?.classList.remove("expanded"),this.dialog?.open&&this.dialog.close(),this.el.Expressive_ExpandingCard=void 0}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(vt).forEach(t=>{t&&t.Expressive_ExpandingCard==null&&this.init(t)})})}};var yt=112,jt=280,Xt={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!1,closeOnClick:!0,hover:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},gt=" ",R=class R extends _{constructor(t,e){super(t,e,R);this._pendingTimers=new Set;this._transition=0;this._menuClickTargets=new WeakMap;this._handleClick=t=>{t.preventDefault(),this.isOpen?this.close():this.open()};this._handleMouseEnter=()=>{this.open()};this._handleMouseLeave=t=>{let e=t.relatedTarget;if(!e){this.close();return}let i=!!(this.menuEl&&e&&this.menuEl.contains(e)),s=!1,n=e.closest(".menu-trigger");n&&n.Expressive_Menu&&n.Expressive_Menu.isOpen&&(s=!0),!s&&!i&&this.close()};this._handleDocumentClick=t=>{let e=t.composedPath(),i=this._menuClickTargets.get(t);this._menuClickTargets.delete(t);let s=i??(e[0]||t.target),n=!!i||e.includes(this.menuEl)||this.menuEl?.contains(s);this._isSubmenuTriggerClick(s)||(this.options.closeOnClick&&n&&!this.isTouchMoving?this.close():n||this._schedule(()=>{this.isOpen&&this.close()},0),this.isTouchMoving=!1)};this._handleTriggerKeydown=t=>{(t.key===gt||t.key===u.keys.ENTER||t.key===u.keys.ARROW_DOWN||t.key===u.keys.ARROW_UP)&&!this.isOpen&&(t.preventDefault(),this.open())};this._handleDocumentTouchmove=t=>{let e=t.target;(t.composedPath().includes(this.menuEl)||this.menuEl?.contains(e))&&(this.isTouchMoving=!0)};this._handleMenuClick=t=>{let e=t.target;this._menuClickTargets.set(t,e);let i=e.closest("li");if(i?.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),t.stopPropagation();return}if(i&&this._isSubmenuTriggerClick(e)){t.preventDefault(),t.stopPropagation(),this._toggleSubmenu(i);return}i&&typeof this.options.onItemClick=="function"&&this.options.onItemClick.call(this,i)};this._handleSubmenuAlign=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("li");i?.querySelector(":scope > menu")&&this.menuEl?.contains(i)&&this._alignSubmenu(i)};this._handleMenuKeydown=t=>{if(!this.isOpen||t.ctrlKey||t.metaKey||t.altKey||t.isComposing)return;let e=this._containingSubmenu(t)??this.menuEl,i=getComputedStyle(e).direction==="rtl",s=i?u.keys.ARROW_LEFT:u.keys.ARROW_RIGHT,n=i?u.keys.ARROW_RIGHT:u.keys.ARROW_LEFT;[s,n,u.keys.ARROW_UP,u.keys.ARROW_DOWN,u.keys.ESC,u.keys.TAB].includes(t.key)&&(clearTimeout(this.filterTimeout),this._resetFilterQuery());let a=t.key===u.keys.ARROW_DOWN||t.key===u.keys.ARROW_UP;if(t.key===u.keys.TAB)t.preventDefault(),this.close();else if(t.key===s){let c=this._focusedRow(t);if(c?.querySelector(":scope > menu")&&!c.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),c.classList.add("open"),this._alignSubmenu(c),this._syncSubmenuAria(c,!0);let l=Array.from(c.querySelector(":scope > menu").children).find(r=>r instanceof HTMLElement&&r.tabIndex!==-1);l&&this._focusRow(l)}}else if(t.key===n){let c=this._containingSubmenu(t);if(c){t.preventDefault();let l=c.parentElement;l.classList.remove("open","submenu-start"),this._syncSubmenuAria(l,!1),this._focusRow(l)}}else if(a&&this.isOpen){t.preventDefault();let c=t.key===u.keys.ARROW_DOWN?1:-1,l=this._focusedRow(t),r=l?Array.from(e.children).indexOf(l):this.focusedIndex,p=!1;do if(r=r+c,e.children[r]&&e.children[r].tabIndex!==-1){p=!0;break}while(r<e.children.length&&r>=0);if(p){this.focusedIndex>=0&&e.children[this.focusedIndex]?.classList.remove("active");let m=e.children[r];m.classList.add("active"),this._focusRow(m)}}else if((t.key===u.keys.ENTER||t.key===gt)&&this.isOpen){let c=this._focusedRow(t);if(t.preventDefault(),c?.matches('.disabled, [aria-disabled="true"]'))return;if(c?.querySelector(":scope > menu")){this._toggleSubmenu(c);return}let l=c??this.menuEl.children[this.focusedIndex],r=l?.querySelector(":scope > a, :scope > button");r?r.click():l instanceof HTMLElement&&l.click()}else if(t.key===u.keys.ESC&&this.isOpen){t.preventDefault();let c=this._containingSubmenu(t)?.parentElement??Array.from(this.menuEl.querySelectorAll("li.open")).reverse()[0];c?(c.classList.remove("open","submenu-start"),this._syncSubmenuAria(c,!1),this._focusRow(c)):this.close()}let h=t.key.toLowerCase();if(t.key.length===1&&t.key!==gt&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.isComposing){this.filterQuery.push(h);let c=this.filterQuery.join(""),l=Array.from(e.querySelectorAll(":scope > li")).find(r=>r.tabIndex!==-1&&!r.matches('.disabled, [aria-disabled="true"]')&&Array.from(r.childNodes).filter(p=>!(p instanceof Element&&p.matches("menu"))).map(p=>p.textContent).join("").trim().toLowerCase().startsWith(c));l&&this._focusRow(l),clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)}};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this.open=()=>{if(this.isOpen||this.el.Expressive_Menu!==this)return;let t=this._clearPendingTimers();this.isOpen=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t===this._transition&&(this._resetMenuStyles(),this.menuEl.style.display="block",this._restoreInert(),this._placeMenu(),this._schedule(()=>this._setupTemporaryEventHandlers(),0),this._animateIn(),this.el.ariaExpanded="true")};this.close=()=>{if(!this.isOpen)return;let t=this._clearPendingTimers(),e=this.menuEl.getRootNode(),i=e.activeElement;this.isOpen=!1,this.menuEl.setAttribute("inert",""),clearTimeout(this.filterTimeout),this._resetFilterQuery(),this.focusedIndex=-1,this._closeSubmenus(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._transition&&(this._animateOut(),this._removeTemporaryEventHandlers(),this.el.ariaExpanded="false",this.options.autoFocus&&this.menuEl.contains(i)&&(e.activeElement===i||this.el.ownerDocument.activeElement===this.el.ownerDocument.body)&&this.el.focus())};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};this.el.Expressive_Menu=this,R._menus.push(this),this.id=u.getIdFromTrigger(t),this.menuEl=u.getElementById(t,this.id),this._originalInert=this.menuEl?.getAttribute("inert")??null,this.options={...R.defaults,...e},this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this.el.ariaExpanded="false",this.el.hasAttribute("aria-haspopup")||this.el.setAttribute("aria-haspopup","menu"),this.id&&!this.el.hasAttribute("aria-controls")&&this.el.setAttribute("aria-controls",this.id),this._moveMenuToElement(),this._setupAccessibility(),this._makeMenuFocusable(),this._setupSubmenus(),this._setupEventHandlers()}static get defaults(){return Xt}static init(t,e={}){return super.init(t,e,R)}static getInstance(t){return t.Expressive_Menu}destroy(){this._clearPendingTimers(),this.isOpen=!1,this.el.ariaExpanded="false",clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._restoreInert(),this._removeEventHandlers(),this._removeTemporaryEventHandlers();let t=R._menus.indexOf(this);t>=0&&R._menus.splice(t,1),this.el.Expressive_Menu=void 0}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.addEventListener("click",this._handleMenuClick),this.menuEl?.querySelector(":scope > li > menu")&&this.menuEl.addEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.menuEl.addEventListener("mouseleave",this._handleMouseLeave)):this.el.addEventListener("click",this._handleClick)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.removeEventListener("click",this._handleMenuClick),this.menuEl?.removeEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.menuEl?.removeEventListener("mouseleave",this._handleMouseLeave)):this.el.removeEventListener("click",this._handleClick)}_setupTemporaryEventHandlers(){document.body.addEventListener("click",this._handleDocumentClick),this.menuEl?.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),document.body.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),this.menuEl?.addEventListener("keydown",this._handleMenuKeydown),window.addEventListener("resize",this._handleWindowResize)}_removeTemporaryEventHandlers(){document.body.removeEventListener("click",this._handleDocumentClick),this.menuEl?.removeEventListener("touchmove",this._handleDocumentTouchmove),document.body.removeEventListener("touchmove",this._handleDocumentTouchmove),this.menuEl?.removeEventListener("keydown",this._handleMenuKeydown),window.removeEventListener("resize",this._handleWindowResize)}_setupAccessibility(){if(!this.menuEl)return;this.menuEl.hasAttribute("role")||this.menuEl.setAttribute("role","menu"),[this.menuEl,...this.menuEl.querySelectorAll("menu")].forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","menu"),e.getAttribute("role")==="menu"&&e.querySelectorAll(":scope > li").forEach(i=>{if(i.classList.contains("divider")){i.hasAttribute("role")||i.setAttribute("role","separator");return}if(i.classList.contains("gap")){i.setAttribute("aria-hidden","true");return}if(i.classList.contains("label")||i.classList.contains("optgroup")){i.hasAttribute("role")||i.setAttribute("role","presentation");return}i.hasAttribute("role")||i.setAttribute("role","menuitem"),i.classList.contains("disabled")&&!i.hasAttribute("aria-disabled")&&i.setAttribute("aria-disabled","true")})})}_isSubmenuTriggerClick(t){if(!this.menuEl)return!1;let e=t.closest("li");if(!e||!this.menuEl.contains(e))return!1;let i=e.querySelector(":scope > menu");return i?!i.contains(t):!1}_setupSubmenus(){this.menuEl?.querySelectorAll("li").forEach(t=>{if(!t.querySelector(":scope > menu"))return;let e=t.querySelector(":scope > a, :scope > button, :scope > span")??t;e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","false")})}_toggleSubmenu(t){let e=!t.classList.contains("open");t.parentElement?.querySelectorAll(":scope > li.open").forEach(i=>{i!==t&&(i.classList.remove("open","submenu-start"),this._syncSubmenuAria(i,!1))}),t.classList.toggle("open",e),e&&this._alignSubmenu(t),this._syncSubmenuAria(t,e)}_syncSubmenuAria(t,e){(t.querySelector(":scope > a, :scope > button, :scope > span")??t).setAttribute("aria-expanded",e?"true":"false")}_alignSubmenu(t){let e=t.querySelector(":scope > menu");if(!e)return;t.classList.remove("submenu-start");let i=e.getBoundingClientRect();(i.left<8||i.right>window.innerWidth-8)&&t.classList.add("submenu-start")}_closeSubmenus(){this.menuEl?.querySelectorAll("li.open").forEach(t=>{t.classList.remove("open","submenu-start"),this._syncSubmenuAria(t,!1)})}_containingSubmenu(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li > menu");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_focusedRow(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_restoreInert(){this._originalInert===null?this.menuEl?.removeAttribute("inert"):this.menuEl?.setAttribute("inert",this._originalInert)}_focusRow(t){this.focusedIndex=Array.from(t.parentElement.children).indexOf(t),t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest",inline:"nearest"})}_resetMenuStyles(){this.menuEl.style.display="",this._resetMenuPositioningStyles(),this.menuEl.style.transform="",this.menuEl.style.opacity=""}_resetMenuPositioningStyles(){this.menuEl.style.width="",this.menuEl.style.height="",this.menuEl.style.left="",this.menuEl.style.top="",this.menuEl.style.transformOrigin=""}_moveMenuToElement(t=null){if(this.options.container){this.options.container.append(this.menuEl);return}if(t){t.contains(this.menuEl)||t.append(this.menuEl);return}this.el.after(this.menuEl)}_makeMenuFocusable(){this.menuEl&&(this.menuEl.popover="",this.menuEl.tabIndex=-1,this.menuEl.querySelectorAll(":scope li, :scope > hr").forEach(t=>{if(t instanceof HTMLHRElement||t.classList.contains("divider")||t.classList.contains("gap")||t.classList.contains("label")||t.classList.contains("optgroup")){t.setAttribute("tabindex","-1");return}t.getAttribute("tabindex")||t.setAttribute("tabindex","0")}))}_focusInitialItem(){if(!this.menuEl||!this.options.autoFocus)return;let t=Array.from(this.menuEl.children).find(e=>e instanceof HTMLElement&&e.tabIndex!==-1);t&&(this.focusedIndex=Array.from(this.menuEl.children).indexOf(t),t.focus({preventScroll:!0}))}_focusFocusedItem(){this.focusedIndex>=0&&this.focusedIndex<this.menuEl.children.length&&this.options.autoFocus&&(this.menuEl.children[this.focusedIndex].focus({preventScroll:!0}),this.menuEl.children[this.focusedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}_getMenuPosition(t){let e=this.el.getBoundingClientRect(),i=this.menuEl.getBoundingClientRect(),s=i.height,n=i.width,a=e.left-i.left,h=e.top-i.top,c={left:a,top:h,height:s,width:n},l=u.checkPossibleAlignments(this.el,t,c,this.options.coverTrigger?0:e.height),r="top",p=this.options.alignment;if(h+=this.options.coverTrigger?0:e.height,this.isScrollable=!1,l.top||(l.bottom?(r="bottom",this.options.coverTrigger||(h-=e.height)):(this.isScrollable=!0,s-=20,l.spaceOnTop>l.spaceOnBottom?(r="bottom",s+=l.spaceOnTop,h-=this.options.coverTrigger?l.spaceOnTop-20:l.spaceOnTop-20+e.height):s+=l.spaceOnBottom)),!l[p]){let m=p==="left"?"right":"left";l[m]?p=m:l.spaceOnLeft>l.spaceOnRight?(p="right",n+=l.spaceOnLeft,a-=l.spaceOnLeft):(p="left",n+=l.spaceOnRight)}return r==="bottom"&&(h=h-i.height+(this.options.coverTrigger?e.height:0)),p==="right"&&(a=a-i.width+e.width),{x:a,y:h,verticalAlignment:r,horizontalAlignment:p,height:s,width:n}}_schedule(t,e){let i=setTimeout(()=>{this._pendingTimers.delete(i),t()},e);this._pendingTimers.add(i)}_clearPendingTimers(){for(let t of this._pendingTimers)clearTimeout(t);return this._pendingTimers.clear(),++this._transition}_animateIn(){let t=this._transition,e=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this.menuEl.style.transition=`opacity ${e}ms ease, transform ${e}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),this._schedule(()=>{this._focusInitialItem(),t===this._transition&&typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},e)}_animateOut(){let t=this.options.outDuration;this.menuEl.style.transition=`opacity ${t}ms ease, transform ${t}ms ease`,this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this._resetMenuStyles(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_getClosestAncestor(t,e){let i=t.parentNode;for(;i!=null&&i!==document;){if(i.nodeType===Node.ELEMENT_NODE&&e(i))return i;i=i.parentNode??i.host}return null}_placeMenu(){let t=this._getClosestAncestor(this.menuEl,a=>!["HTML","BODY"].includes(a.tagName)&&getComputedStyle(a).overflow!=="visible");if(!t){let a=this.menuEl.offsetParent?this.menuEl.offsetParent:this.menuEl.parentNode;t=a.host??a}getComputedStyle(t).position==="static"&&(t.style.position="relative");let e=this.menuEl.getBoundingClientRect().width,i=this.el.getBoundingClientRect().width,s=this.options.constrainWidth&&i>=yt?i:Math.min(jt,Math.max(yt,e));this.menuEl.style.width=s+"px";let n=this._getMenuPosition(t);this.menuEl.style.left=n.x+"px",this.menuEl.style.top=n.y+"px",this.menuEl.style.height=n.height+"px",this.menuEl.style.width=n.width+"px",this.menuEl.style.transformOrigin=`${n.horizontalAlignment==="left"?"0":"100%"} ${n.verticalAlignment==="top"?"0":"100%"}`}};R._menus=[];var H=R;var Zt={i18n:{loading:"Loading results.",noResults:"No results.",results:d=>`${d} ${d===1?"result":"results"} available.`,selected:d=>`${d} ${d===1?"item":"items"} selected.`},data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,isMultiSelect:!1,onSearch:(d,o)=>{let t=d.toLocaleLowerCase(),e=o.options.data;o.setMenuItems(e.filter(i=>i.id.toString().toLocaleLowerCase().includes(t)||i.text?.toLocaleLowerCase().includes(t))),o.options.data=e},maxMenuHeight:"300px",allowUnsafeHTML:!1,selected:[]},D=class D extends _{constructor(t,e){super(t,e,D);this._handleInputBlur=()=>{this._pointerDown||(this.close(),this._resetAutocomplete())};this._handleInputKeyup=()=>{D._keydown=!1};this._handleInput=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this.oldVal!==t&&this.el.matches(":focus-visible")&&this.open(),this._inputChangeDetection(t)};this._handleInputFocus=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=t=>{!this.options.isMultiSelect&&this.selectedValues.length&&this.el.value!==(this.selectedValues[0].text||String(this.selectedValues[0].id))&&(this.selectedValues=[]),this.oldVal!==t&&(this._setStatusLoading(),this.options.onSearch(this.el.value,this)),!this.options.isMultiSelect&&this.el.value.length===0&&(this.selectedValues=[],this._triggerChanged()),this.oldVal=t};this._handleInputKeydown=t=>{if(D._keydown=!0,t.key===u.keys.ESC||t.key==="Tab"){this.close(),this._resetCurrentElementPosition();return}let e=this.container.querySelectorAll("li").length;if(t.key===u.keys.ENTER&&this.activeIndex>=0){let i=this.container.querySelectorAll("li")[this.activeIndex];i&&(this.selectOption(i.getAttribute("data-id")),t.preventDefault());return}(t.key===u.keys.ARROW_UP||t.key===u.keys.ARROW_DOWN)&&(t.preventDefault(),t.key===u.keys.ARROW_UP&&this.activeIndex>0&&this.activeIndex--,t.key===u.keys.ARROW_DOWN&&this.activeIndex<e-1&&this.activeIndex++,this._setActive(null),this.activeIndex>=0&&(this._setActive(this.container.querySelectorAll("li")[this.activeIndex]),this.container.children[this.activeIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})))};this._handleInputClick=()=>{this.open()};this._handleContainerPointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0))};this._handleContainerPointerUp=()=>{this._pointerDown=!1};this.open=()=>{let t=this.el.value.toLocaleLowerCase();this._resetAutocomplete(),t.length>=this.options.minLength&&(this._renderMenu(),this._announce(this.menuItems.length?this.options.i18n.results(this.menuItems.length):this.options.i18n.noResults)),this.menu.isOpen?this.menu.recalculateDimensions():(this._openTimer!==void 0&&clearTimeout(this._openTimer),this._openTimer=setTimeout(()=>{this._openTimer=void 0,this.menu.open()},0))};this.close=()=>{this._announcer&&(this._announcer.textContent=""),this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this.isOpen=!1,this.menu.close()};this.el.Expressive_Autocomplete=this,this.options={...D.defaults,...e,i18n:{...D.defaults.i18n,...e?.i18n}},this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="",this.selectedValues=this.options.selected.map(i=>this.options.data.find(s=>s.id===i)??{id:i}),this.menuItems=this.options.data||[],this.$active=null,this._pointerDown=!1,this._setupMenu(),this._setupEventHandlers()}_setActive(t){this.$active?.classList.remove("active"),this.$active=t,t?(t.classList.add("active"),this.el.setAttribute("aria-activedescendant",t.id)):this.el.removeAttribute("aria-activedescendant")}static get defaults(){return Zt}static init(t,e={}){return super.init(t,e,D)}static getInstance(t){return t.Expressive_Autocomplete}static _loadingIndicator(){if(!D._loadingTemplate){let t=document.createElement("template");t.innerHTML=`<div style="height:100%;width:50px;"><svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
|
|
1
|
+
var Expressive=(()=>{var Ft=Object.defineProperty;var Ce=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var ke=(d,n)=>{for(var t in n)Ft(d,t,{get:n[t],enumerable:!0})},Se=(d,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of we(n))!Ie.call(d,i)&&i!==t&&Ft(d,i,{get:()=>n[i],enumerable:!(e=Ce(n,i))||e.enumerable});return d};var Ae=d=>Se(Ft({},"__esModule",{value:!0}),d);var Ai={};ke(Ai,{AppBar:()=>it,AutoInit:()=>ve,Autocomplete:()=>$,BarChart:()=>ct,BottomSheets:()=>J,ButtonGroup:()=>nt,Cards:()=>z,Carousel:()=>Y,CharacterCounter:()=>St,Chips:()=>U,ColumnChart:()=>W,CommandPalette:()=>at,Confetti:()=>ot,Datepicker:()=>vt,Dialogs:()=>Q,ExpandingCard:()=>K,FloatingActionButton:()=>st,FormSelect:()=>P,Forms:()=>et,HeatmapChart:()=>dt,Lightbox:()=>_t,LineChart:()=>S,MapView:()=>Pt,Menu:()=>F,MessageScroller:()=>gt,MixedChart:()=>mt,NavigationRail:()=>bt,Particles:()=>rt,PieChart:()=>ht,Questionnaire:()=>lt,RadarChart:()=>ut,RadialChart:()=>pt,Range:()=>X,RichTextEditor:()=>Dt,ScrollSpy:()=>Et,SideSheets:()=>tt,Slider:()=>X,Snackbar:()=>Rt,Tabs:()=>yt,Timepicker:()=>Lt,Tooltip:()=>Tt,version:()=>Si});var R=class R{static onDocumentReady(n){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n())}static guid(){return globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}static portalRoot(n){let t=n.getRootNode();return t.host?t:document.body}static getElementById(n,t){let e=n.getRootNode();return e.getElementById?e.getElementById(t):document.getElementById(t)}static checkWithinContainer(n,t,e){let i={top:!1,right:!1,bottom:!1,left:!1},s=n.getBoundingClientRect(),o=n===document.body?Math.max(s.bottom,window.innerHeight):s.bottom,r=n.scrollLeft,a=n.scrollTop,c=t.left-r,h=t.top-a;return(c<s.left+e||c<e)&&(i.left=!0),(c+t.width>s.right-e||c+t.width>window.innerWidth-e)&&(i.right=!0),(h<s.top+e||h<e)&&(i.top=!0),(h+t.height>o-e||h+t.height>window.innerHeight-e)&&(i.bottom=!0),i}static checkPossibleAlignments(n,t,e,i){let s={top:!0,right:!0,bottom:!0,left:!0,spaceOnTop:null,spaceOnRight:null,spaceOnBottom:null,spaceOnLeft:null},o=getComputedStyle(t).overflow==="visible",r=t.getBoundingClientRect(),a=Math.min(r.height,window.innerHeight),c=Math.min(r.width,window.innerWidth),h=n.getBoundingClientRect(),l=t.scrollLeft,u=t.scrollTop,f=e.left-l,m=e.top-u,v=e.top+h.height-u;return s.spaceOnRight=o?window.innerWidth-(h.left+e.width):c-(f+e.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=o?h.right-e.width:f-e.width+h.width,s.spaceOnLeft<0&&(s.right=!1),s.spaceOnBottom=o?window.innerHeight-(h.top+e.height+i):a-(m+e.height+i),s.spaceOnBottom<0&&(s.top=!1),s.spaceOnTop=o?h.bottom-(e.height+i):v-(e.height-i),s.spaceOnTop<0&&(s.bottom=!1),s}static getIdFromTrigger(n){let t=n.dataset.target;return t||(t=n.getAttribute("href"),t?t.slice(1):"")}static getDocumentScrollTop(){return window.scrollY}static getDocumentScrollLeft(){return window.scrollX}static throttle(n,t){let e=null,i=null,s=-1/0;return(...o)=>{let r=performance.now(),a=t-(r-s);a<=0?(clearTimeout(e),e=null,s=r,i=null,n(...o)):e?i=o:(i=o,e=setTimeout(()=>{s=performance.now(),e=null,n(...i??[]),i=null},a))}}static createConfirmationContainer(n,t,e,i,s){let o=document.createElement("div");o.classList.add("confirmation-btns"),n.append(o),this.createButton(o,e,["btn-cancel"],!0,s),this.createButton(o,t,["btn-confirm"],!0,i)}static createButton(n,t,e=[],i=!0,s=null){e=e.concat(["text"]);let o=document.createElement("button");o.className=e.join(" "),o.style.visibility=i?"visible":"hidden",o.type="button",o.tabIndex=i?0:-1,o.innerText=t,typeof s=="function"&&o.addEventListener("click",s),n.append(o)}static _setAbsolutePosition(n,t,e,i,s,o="center"){let r=n.offsetHeight,a=n.offsetWidth,c=t.offsetHeight,h=t.offsetWidth,l=n.getBoundingClientRect(),u=0,f=0,m=l.top+R.getDocumentScrollTop(),v=l.left+R.getDocumentScrollLeft();e==="top"?(m+=-c-i,o==="center"&&(v+=a/2-h/2),f=-s):e==="right"?(m+=r/2-c/2,v=a+i,u=s):e==="left"?(m+=r/2-c/2,v=-h-i,u=-s):(m+=r+i,o==="center"&&(v+=a/2-h/2),f=s),o==="right"&&(v+=a-h-i);let g=R._repositionWithinScreen(v,m,h,c,i,s,o),E=t.offsetParent;if(E&&(E!==document.body||getComputedStyle(E).position!=="static")){let L=E.getBoundingClientRect(),M=E===document.scrollingElement;g.x-=L.left+R.getDocumentScrollLeft()+E.clientLeft-(M?0:E.scrollLeft),g.y-=L.top+R.getDocumentScrollTop()+E.clientTop-(M?0:E.scrollTop)}return t.style.top=g.y+"px",t.style.left=g.x+"px",{x:u,y:f}}static _repositionWithinScreen(n,t,e,i,s,o,r){let a=R.getDocumentScrollLeft(),c=R.getDocumentScrollTop(),h=n-a,l=t-c,u={left:h,top:l,width:e,height:i},f;r==="left"||r=="center"?f=s+o:r==="right"&&(f=s-o);let m=R.checkWithinContainer(document.body,u,f);return m.left?h=f:m.right&&(h-=h+e-window.innerWidth),m.top?l=f:m.bottom&&(l-=l+i-window.innerHeight),{x:h+a,y:l+c}}};R.keys={TAB:"Tab",ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",DELETE:"Delete"};var p=R;var b=class{constructor(n,t,e){n instanceof HTMLElement||console.error(Error(n+" is not an HTML Element"));let i=e.getInstance(n);i&&i.destroy(),this.el=n}static init(n,t,e){let i=null;if(n instanceof Element)i=new e(n,t);else if(n){i=[];for(let s=0;s<n.length;s++)i.push(new e(n[s],t))}return i}static get defaults(){return{}}static getInstance(n){throw new Error("This method must be implemented.")}destroy(){throw new Error("This method must be implemented.")}};var Oe={onOpen:null,onClose:null},$t='article:has(> aside[id]:not([id=""])):not(:has(> aside ~ aside)):has(> button.card-reveal-trigger[type="button"], > :not(aside) button.card-reveal-trigger[type="button"])',Wt="card-reveal-initialized";function He(d){if(d.getAttribute("aria-label")?.trim())return!0;let t=d.getAttribute("aria-labelledby");if(t&&t.trim().split(/\s+/).map(s=>d.ownerDocument.getElementById(s)?.textContent??"").join(" ").trim())return!0;let e=d.cloneNode(!0);return e.querySelectorAll('[aria-hidden="true"]').forEach(i=>i.remove()),!!e.textContent?.trim()}function Ut(d,n,t){return d.closest("article")===n&&!t.contains(d)&&!d.disabled&&d.getAttribute("aria-disabled")!=="true"&&He(d)}function Vt(d){if(d.tagName!=="ARTICLE")return!1;let n=d.querySelectorAll(":scope > aside");return n.length!==1||!n[0].id?!1:Array.from(d.querySelectorAll('button.card-reveal-trigger[type="button"]')).some(t=>Ut(t,d,n[0]))}var z=class d extends b{constructor(t,e={}){super(t,e,d);this.isOpen=!1;this._ownsRevealInitializedClass=!1;this._initialAriaControls=new Map;this._lastActivator=null;this._setupEventHandlers=()=>{this._activators.forEach(t=>{t.addEventListener("click",this._handleClickInteraction)}),this.el.addEventListener("keydown",this._handleKeydownEvent)};this._removeEventHandlers=()=>{this._activators.forEach(t=>{t.removeEventListener("click",this._handleClickInteraction)}),this.el.removeEventListener("keydown",this._handleKeydownEvent)};this._handleClickInteraction=t=>{this._lastActivator=t.currentTarget,this._handleRevealEvent()};this._handleKeydownEvent=t=>{(t.target instanceof Element?t.target.closest("article"):null)!==this.el||t.key!=="Escape"||!this.isOpen||(t.preventDefault(),this.close())};this._handleRevealEvent=()=>{this.isOpen?this.close():this.open()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.classList.add("open"),this.cardReveal.inert=!1,this._activators.forEach(t=>t.ariaExpanded="true"),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.cardReveal)return;let t=this.cardReveal.contains(document.activeElement);this.isOpen=!1,this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._activators.forEach(e=>e.ariaExpanded="false"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el),t&&(this._lastActivator??this._activators[0])?.focus()};this.el.Expressive_Cards=this,this.options={...d.defaults,...e};let i=this.el.querySelectorAll(":scope > aside"),s=i.length===1?i[0]:null,o=s?Array.from(this.el.querySelectorAll('button.card-reveal-trigger[type="button"]')).filter(r=>Ut(r,this.el,s)):[];this.cardReveal=s?.id&&o.length>0?s:null,this._activators=this.cardReveal?o:[],this.cardReveal&&(this._ownsRevealInitializedClass=!this.el.classList.contains(Wt),this.el.classList.add(Wt),this._activators.forEach(r=>{this._initialAriaControls.set(r,r.getAttribute("aria-controls")),r.ariaExpanded="false",r.setAttribute("aria-controls",this.cardReveal.id)}),this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._setupEventHandlers())}static get defaults(){return Oe}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Cards}destroy(){this._removeEventHandlers(),this.cardReveal&&(this.cardReveal.classList.remove("open"),this.cardReveal.inert=!1,this._ownsRevealInitializedClass&&this.el.classList.remove(Wt)),this._activators.forEach(t=>{t.removeAttribute("aria-expanded");let e=this._initialAriaControls.get(t);e===null?t.removeAttribute("aria-controls"):e!==void 0&&t.setAttribute("aria-controls",e)}),this.isOpen=!1,this._activators=[],this._initialAriaControls.clear(),this._lastActivator=null,this.el.Expressive_Cards=void 0}static Init(){p.onDocumentReady(()=>{Array.from(document.querySelectorAll($t)).filter(Vt).forEach(e=>{e&&e.Expressive_Cards==null&&this.init(e)})})}};var De={onOpen:null,onClose:null},qt="article.expanding-card:has(> dialog.expanding-card-dialog)",K=class d extends b{constructor(t,e){super(t,e,d);this.isOpen=!1;this.closeGeneration=0;this._setupEventHandlers=()=>{this.trigger?.addEventListener("click",this.open),this.trigger?.addEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.addEventListener("click",this.close),this.dialog?.addEventListener("cancel",this._handleCancel),this.dialog?.addEventListener("close",this._handleNativeClose)};this._removeEventHandlers=()=>{this.trigger?.removeEventListener("click",this.open),this.trigger?.removeEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.removeEventListener("click",this.close),this.dialog?.removeEventListener("cancel",this._handleCancel),this.dialog?.removeEventListener("close",this._handleNativeClose)};this._handleTriggerKeypress=t=>{(t.key===p.keys.ENTER||t.key===" ")&&(t.preventDefault(),this.open())};this._handleCancel=t=>{t.preventDefault(),this.close()};this._handleNativeClose=()=>{this.dialog.open||(this.closeGeneration++,this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"))};this._setTransitionOrigin=()=>{if(!this.dialog)return;let t=this.el.getBoundingClientRect(),i=this.el.querySelector(":scope > figure, :scope > img")?.getBoundingClientRect();this.dialog.style.setProperty("--md-comp-expanding-card-from-top",`${Math.max(0,t.top)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-right",`${Math.max(0,window.innerWidth-t.right)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-bottom",`${Math.max(0,window.innerHeight-t.bottom)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-left",`${Math.max(0,t.left)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-media-height",`${Math.max(0,i?.height??0)}px`)};this.open=()=>{this.isOpen||!this.dialog||!this.trigger||(this.closeGeneration++,this._setTransitionOrigin(),this.isOpen=!0,this.trigger.ariaExpanded="true",this.dialog.ariaExpanded="true",this.dialog.showModal(),this.dialog.offsetWidth,this.dialog.classList.add("expanded"),this.closeButton?.focus(),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.dialog||!this.trigger)return;let t=++this.closeGeneration;this._setTransitionOrigin(),this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el);let e=()=>{t!==this.closeGeneration||this.isOpen||!this.dialog.open||(this.dialog.close(),this.dialog.isConnected&&this.trigger.isConnected&&this.trigger.focus())},s=window.matchMedia("(prefers-reduced-motion: reduce)").matches?[]:(this.dialog.getAnimations?.()??[]).filter(o=>o.transitionProperty==="clip-path");s.length===0?e():Promise.allSettled(s.map(o=>o.finished)).then(e)};this.el.Expressive_ExpandingCard=this,this.options={...d.defaults,...e},this.dialog=this.el.querySelector(":scope > dialog.expanding-card-dialog"),this.trigger=this.el.querySelector(":scope > .expanding-card-trigger, :scope > figure > .expanding-card-trigger"),this.closeButton=this.dialog?.querySelector(".expanding-card-close")??null,this.trigger&&this.dialog&&(this.trigger.ariaExpanded="false",this.dialog.id&&this.trigger.setAttribute("aria-controls",this.dialog.id),this.trigger.matches("a[href], button, input, select, textarea")||(this.trigger.tabIndex=0,this.trigger.setAttribute("role","button")),this.dialog.ariaExpanded="false",this._setupEventHandlers())}static get defaults(){return De}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ExpandingCard}destroy(){this._removeEventHandlers(),this.closeGeneration++,this.isOpen=!1,this.trigger&&(this.trigger.ariaExpanded="false"),this.dialog&&(this.dialog.ariaExpanded="false"),this.dialog?.classList.remove("expanded"),this.dialog?.open&&this.dialog.close(),this.el.Expressive_ExpandingCard=void 0}static Init(){p.onDocumentReady(()=>{document.querySelectorAll(qt).forEach(t=>{t&&t.Expressive_ExpandingCard==null&&this.init(t)})})}};var Yt=112,Pe=280,Re={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!1,closeOnClick:!0,hover:!1,contextMenu:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},zt=" ",N=class N extends b{constructor(t,e){super(t,e,N);this._pendingTimers=new Set;this._transition=0;this._menuClickTargets=new WeakMap;this._contextPoint=null;this._contextReturn=null;this._handleContextMenu=t=>{if(t.defaultPrevented){this.close();return}let e=t.composedPath();if(N._menus.some(o=>o!==this&&o.isOpen&&e.includes(o.menuEl)))return;if(t.preventDefault(),!this.isOpen){let o=this.el.getRootNode();this._contextReturn=o.activeElement instanceof HTMLElement?o.activeElement:null}let i=this.el.getBoundingClientRect(),s=(t.clientX!==0||t.clientY!==0)&&t.clientX>=i.left&&t.clientX<=i.right&&t.clientY>=i.top&&t.clientY<=i.bottom;this._contextPoint=s?{x:t.clientX,y:t.clientY}:null,this.isOpen?this.recalculateDimensions():this.open()};this._handleDocumentContextMenu=t=>{let e=t.composedPath();if(e.includes(this.menuEl)){t.preventDefault();return}e.includes(this.el)||this.close()};this._handleClick=t=>{t.preventDefault(),this.isOpen?this.close():this.open()};this._handleMouseEnter=()=>{this.open()};this._handleMouseLeave=t=>{let e=t.relatedTarget;if(!e){this.close();return}let i=!!(this.menuEl&&e&&this.menuEl.contains(e)),s=!1,o=e.closest(".menu-trigger");o&&o.Expressive_Menu&&o.Expressive_Menu.isOpen&&(s=!0),!s&&!i&&this.close()};this._handleDocumentClick=t=>{let e=t.composedPath(),i=this._menuClickTargets.get(t);this._menuClickTargets.delete(t);let s=i??(e[0]||t.target),o=!!i||e.includes(this.menuEl)||this.menuEl?.contains(s);this._isSubmenuTriggerClick(s)||(this.options.closeOnClick&&o&&!this.isTouchMoving?this.close():o||this._schedule(()=>{this.isOpen&&this.close()},0),this.isTouchMoving=!1)};this._handleTriggerKeydown=t=>{if(this.options.contextMenu)return;(t.key===zt||t.key===p.keys.ENTER||t.key===p.keys.ARROW_DOWN||t.key===p.keys.ARROW_UP)&&!this.isOpen&&(t.preventDefault(),this.open())};this._handleDocumentTouchmove=t=>{let e=t.target;(t.composedPath().includes(this.menuEl)||this.menuEl?.contains(e))&&(this.isTouchMoving=!0)};this._handleMenuClick=t=>{let e=t.target;this._menuClickTargets.set(t,e);let i=e.closest("li");if(i?.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),t.stopPropagation();return}if(i&&this._isSubmenuTriggerClick(e)){t.preventDefault(),t.stopPropagation(),this._toggleSubmenu(i);return}i&&typeof this.options.onItemClick=="function"&&this.options.onItemClick.call(this,i)};this._handleSubmenuAlign=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("li");i?.querySelector(":scope > menu")&&this.menuEl?.contains(i)&&this._alignSubmenu(i)};this._handleMenuKeydown=t=>{if(!this.isOpen||t.ctrlKey||t.metaKey||t.altKey||t.isComposing)return;let e=this._containingSubmenu(t)??this.menuEl,i=getComputedStyle(e).direction==="rtl",s=i?p.keys.ARROW_LEFT:p.keys.ARROW_RIGHT,o=i?p.keys.ARROW_RIGHT:p.keys.ARROW_LEFT;[s,o,p.keys.ARROW_UP,p.keys.ARROW_DOWN,p.keys.ESC,p.keys.TAB].includes(t.key)&&(clearTimeout(this.filterTimeout),this._resetFilterQuery());let r=t.key===p.keys.ARROW_DOWN||t.key===p.keys.ARROW_UP;if(t.key===p.keys.TAB)t.preventDefault(),this.close();else if(t.key===s){let c=this._focusedRow(t);if(c?.querySelector(":scope > menu")&&!c.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),c.classList.add("open"),this._alignSubmenu(c),this._syncSubmenuAria(c,!0);let h=Array.from(c.querySelector(":scope > menu").children).find(l=>l instanceof HTMLElement&&l.tabIndex!==-1);h&&this._focusRow(h)}}else if(t.key===o){let c=this._containingSubmenu(t);if(c){t.preventDefault();let h=c.parentElement;h.classList.remove("open","submenu-start"),this._syncSubmenuAria(h,!1),this._focusRow(h)}}else if(r&&this.isOpen){t.preventDefault();let c=t.key===p.keys.ARROW_DOWN?1:-1,h=this._focusedRow(t),l=h?Array.from(e.children).indexOf(h):this.focusedIndex,u=!1;do if(l=l+c,e.children[l]&&e.children[l].tabIndex!==-1){u=!0;break}while(l<e.children.length&&l>=0);if(u){this.focusedIndex>=0&&e.children[this.focusedIndex]?.classList.remove("active");let f=e.children[l];f.classList.add("active"),this._focusRow(f)}}else if((t.key===p.keys.ENTER||t.key===zt)&&this.isOpen){let c=this._focusedRow(t);if(t.preventDefault(),c?.matches('.disabled, [aria-disabled="true"]'))return;if(c?.querySelector(":scope > menu")){this._toggleSubmenu(c);return}let h=c??this.menuEl.children[this.focusedIndex],l=h?.querySelector(":scope > a, :scope > button");l?l.click():h instanceof HTMLElement&&h.click()}else if(t.key===p.keys.ESC&&this.isOpen){t.preventDefault();let c=this._containingSubmenu(t)?.parentElement??Array.from(this.menuEl.querySelectorAll("li.open")).reverse()[0];c?(c.classList.remove("open","submenu-start"),this._syncSubmenuAria(c,!1),this._focusRow(c)):this.close()}let a=t.key.toLowerCase();if(t.key.length===1&&t.key!==zt&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.isComposing){this.filterQuery.push(a);let c=this.filterQuery.join(""),h=Array.from(e.querySelectorAll(":scope > li")).find(l=>l.tabIndex!==-1&&!l.matches('.disabled, [aria-disabled="true"]')&&Array.from(l.childNodes).filter(u=>!(u instanceof Element&&u.matches("menu"))).map(u=>u.textContent).join("").trim().toLowerCase().startsWith(c));h&&this._focusRow(h),clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)}};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this.open=()=>{if(this.isOpen||this.el.Expressive_Menu!==this)return;let t=this._clearPendingTimers();this.isOpen=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t===this._transition&&(this._resetMenuStyles(),this.menuEl.style.display="block",this._restoreInert(),this._placeMenu(),this._schedule(()=>this._setupTemporaryEventHandlers(),0),this._animateIn(),this._setExpanded(!0))};this.close=()=>{if(!this.isOpen)return;let t=this._clearPendingTimers(),e=this.menuEl.getRootNode(),i=e.activeElement;if(this.isOpen=!1,this.menuEl.setAttribute("inert",""),clearTimeout(this.filterTimeout),this._resetFilterQuery(),this.focusedIndex=-1,this._closeSubmenus(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._transition){if(this._animateOut(),this._removeTemporaryEventHandlers(),this._setExpanded(!1),this.options.autoFocus&&this.menuEl.contains(i)&&(e.activeElement===i||this.el.ownerDocument.activeElement===this.el.ownerDocument.body)){let s=this._contextReturn;(s?.isConnected&&s!==this.el.ownerDocument.body?s:this.el).focus()}this._contextReturn=null,this._contextPoint=null}};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};this.el.Expressive_Menu=this,N._menus.push(this),this.id=p.getIdFromTrigger(t),this.menuEl=p.getElementById(t,this.id),this._originalInert=this.menuEl?.getAttribute("inert")??null,this.options={...N.defaults,contextMenu:t.hasAttribute("data-context-menu"),...e},this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this.options.contextMenu||(this.el.ariaExpanded="false",this.el.hasAttribute("aria-haspopup")||this.el.setAttribute("aria-haspopup","menu"),this.id&&!this.el.hasAttribute("aria-controls")&&this.el.setAttribute("aria-controls",this.id)),this._moveMenuToElement(),this._setupAccessibility(),this._makeMenuFocusable(),this._setupSubmenus(),this._setupEventHandlers()}static get defaults(){return Re}static init(t,e={}){return super.init(t,e,N)}static getInstance(t){return t.Expressive_Menu}destroy(){this._clearPendingTimers(),this.isOpen=!1,this._setExpanded(!1),clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._restoreInert(),this._removeEventHandlers(),this._removeTemporaryEventHandlers();let t=N._menus.indexOf(this);t>=0&&N._menus.splice(t,1),this.el.Expressive_Menu=void 0}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.addEventListener("click",this._handleMenuClick),this.menuEl?.querySelector(":scope > li > menu")&&this.menuEl.addEventListener("mouseover",this._handleSubmenuAlign),this.options.contextMenu?this.el.addEventListener("contextmenu",this._handleContextMenu):this.options.hover?(this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.menuEl.addEventListener("mouseleave",this._handleMouseLeave)):this.el.addEventListener("click",this._handleClick)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.removeEventListener("click",this._handleMenuClick),this.menuEl?.removeEventListener("mouseover",this._handleSubmenuAlign),this.options.contextMenu?this.el.removeEventListener("contextmenu",this._handleContextMenu):this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.menuEl?.removeEventListener("mouseleave",this._handleMouseLeave)):this.el.removeEventListener("click",this._handleClick)}_setupTemporaryEventHandlers(){document.body.addEventListener("click",this._handleDocumentClick),this.menuEl?.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),document.body.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),this.menuEl?.addEventListener("keydown",this._handleMenuKeydown),window.addEventListener("resize",this._handleWindowResize),this.options.contextMenu&&document.addEventListener("contextmenu",this._handleDocumentContextMenu)}_removeTemporaryEventHandlers(){document.body.removeEventListener("click",this._handleDocumentClick),this.menuEl?.removeEventListener("touchmove",this._handleDocumentTouchmove),document.body.removeEventListener("touchmove",this._handleDocumentTouchmove),this.menuEl?.removeEventListener("keydown",this._handleMenuKeydown),window.removeEventListener("resize",this._handleWindowResize),document.removeEventListener("contextmenu",this._handleDocumentContextMenu)}_setupAccessibility(){if(!this.menuEl)return;this.menuEl.hasAttribute("role")||this.menuEl.setAttribute("role","menu"),[this.menuEl,...this.menuEl.querySelectorAll("menu")].forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","menu"),e.getAttribute("role")==="menu"&&e.querySelectorAll(":scope > li").forEach(i=>{if(i.classList.contains("divider")){i.hasAttribute("role")||i.setAttribute("role","separator");return}if(i.classList.contains("gap")){i.setAttribute("aria-hidden","true");return}if(i.classList.contains("label")||i.classList.contains("optgroup")){i.hasAttribute("role")||i.setAttribute("role","presentation");return}i.hasAttribute("role")||i.setAttribute("role","menuitem"),i.classList.contains("disabled")&&!i.hasAttribute("aria-disabled")&&i.setAttribute("aria-disabled","true")})})}_isSubmenuTriggerClick(t){if(!this.menuEl)return!1;let e=t.closest("li");if(!e||!this.menuEl.contains(e))return!1;let i=e.querySelector(":scope > menu");return i?!i.contains(t):!1}_setupSubmenus(){this.menuEl?.querySelectorAll("li").forEach(t=>{if(!t.querySelector(":scope > menu"))return;let e=t.querySelector(":scope > a, :scope > button, :scope > span")??t;e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","false")})}_toggleSubmenu(t){let e=!t.classList.contains("open");t.parentElement?.querySelectorAll(":scope > li.open").forEach(i=>{i!==t&&(i.classList.remove("open","submenu-start"),this._syncSubmenuAria(i,!1))}),t.classList.toggle("open",e),e&&this._alignSubmenu(t),this._syncSubmenuAria(t,e)}_syncSubmenuAria(t,e){(t.querySelector(":scope > a, :scope > button, :scope > span")??t).setAttribute("aria-expanded",e?"true":"false")}_alignSubmenu(t){let e=t.querySelector(":scope > menu");if(!e)return;t.classList.remove("submenu-start");let i=e.getBoundingClientRect();(i.left<8||i.right>window.innerWidth-8)&&t.classList.add("submenu-start")}_closeSubmenus(){this.menuEl?.querySelectorAll("li.open").forEach(t=>{t.classList.remove("open","submenu-start"),this._syncSubmenuAria(t,!1)})}_containingSubmenu(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li > menu");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_focusedRow(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_restoreInert(){this._originalInert===null?this.menuEl?.removeAttribute("inert"):this.menuEl?.setAttribute("inert",this._originalInert)}_focusRow(t){this.focusedIndex=Array.from(t.parentElement.children).indexOf(t),t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest",inline:"nearest"})}_resetMenuStyles(){this.menuEl&&(this.menuEl.style.display="",this._resetMenuPositioningStyles(),this.menuEl.style.transform="",this.menuEl.style.opacity="")}_resetMenuPositioningStyles(){this.menuEl.style.width="",this.menuEl.style.height="",this.menuEl.style.left="",this.menuEl.style.top="",this.menuEl.style.transformOrigin=""}_moveMenuToElement(t=null){if(this.options.container){this.options.container.append(this.menuEl);return}if(t){t.contains(this.menuEl)||t.append(this.menuEl);return}this.el.after(this.menuEl)}_makeMenuFocusable(){this.menuEl&&(this.menuEl.popover="",this.menuEl.tabIndex=-1,this.menuEl.querySelectorAll(":scope li, :scope > hr").forEach(t=>{if(t instanceof HTMLHRElement||t.classList.contains("divider")||t.classList.contains("gap")||t.classList.contains("label")||t.classList.contains("optgroup")){t.setAttribute("tabindex","-1");return}t.getAttribute("tabindex")||t.setAttribute("tabindex","0")}))}_focusInitialItem(){if(!this.menuEl||!this.options.autoFocus)return;let t=Array.from(this.menuEl.children).find(e=>e instanceof HTMLElement&&e.tabIndex!==-1);t&&(this.focusedIndex=Array.from(this.menuEl.children).indexOf(t),t.focus({preventScroll:!0}))}_focusFocusedItem(){this.focusedIndex>=0&&this.focusedIndex<this.menuEl.children.length&&this.options.autoFocus&&(this.menuEl.children[this.focusedIndex].focus({preventScroll:!0}),this.menuEl.children[this.focusedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}_getMenuPosition(t){let e=this.el.getBoundingClientRect(),i=this.menuEl.getBoundingClientRect(),s=i.height,o=i.width,r=e.left-i.left,a=e.top-i.top,c={left:r,top:a,height:s,width:o},h=p.checkPossibleAlignments(this.el,t,c,this.options.coverTrigger?0:e.height),l="top",u=this.options.alignment;if(a+=this.options.coverTrigger?0:e.height,this.isScrollable=!1,h.top||(h.bottom?(l="bottom",this.options.coverTrigger||(a-=e.height)):(this.isScrollable=!0,s-=20,h.spaceOnTop>h.spaceOnBottom?(l="bottom",s+=h.spaceOnTop,a-=this.options.coverTrigger?h.spaceOnTop-20:h.spaceOnTop-20+e.height):s+=h.spaceOnBottom)),!h[u]){let f=u==="left"?"right":"left";h[f]?u=f:h.spaceOnLeft>h.spaceOnRight?(u="right",o+=h.spaceOnLeft,r-=h.spaceOnLeft):(u="left",o+=h.spaceOnRight)}return l==="bottom"&&(a=a-i.height+(this.options.coverTrigger?e.height:0)),u==="right"&&(r=r-i.width+e.width),{x:r,y:a,verticalAlignment:l,horizontalAlignment:u,height:s,width:o}}_schedule(t,e){let i=setTimeout(()=>{this._pendingTimers.delete(i),t()},e);this._pendingTimers.add(i)}_clearPendingTimers(){for(let t of this._pendingTimers)clearTimeout(t);return this._pendingTimers.clear(),++this._transition}_animateIn(){let t=this._transition,e=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this.menuEl.style.transition=`opacity ${e}ms ease, transform ${e}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),this._schedule(()=>{this._focusInitialItem(),t===this._transition&&typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},e)}_animateOut(){let t=this.options.outDuration;this.menuEl.style.transition=`opacity ${t}ms ease, transform ${t}ms ease`,this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this._resetMenuStyles(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_getClosestAncestor(t,e){let i=t.parentNode;for(;i!=null&&i!==document;){if(i.nodeType===Node.ELEMENT_NODE&&e(i))return i;i=i.parentNode??i.host}return null}_placeMenu(){let t=this._getClosestAncestor(this.menuEl,r=>!["HTML","BODY"].includes(r.tagName)&&getComputedStyle(r).overflow!=="visible");if(!t){let r=this.menuEl.offsetParent?this.menuEl.offsetParent:this.menuEl.parentNode;t=r.host??r}getComputedStyle(t).position==="static"&&(t.style.position="relative");let e=this.menuEl.getBoundingClientRect().width,i=this.el.getBoundingClientRect().width,s=this.options.constrainWidth&&!this.options.contextMenu&&i>=Yt?i:Math.min(Pe,Math.max(Yt,e));if(this.menuEl.style.width=s+"px",this.options.contextMenu){this._placeMenuAtPoint(this._contextPoint??this._regionCorner(),t);return}let o=this._getMenuPosition(t);this.menuEl.style.left=o.x+"px",this.menuEl.style.top=o.y+"px",this.menuEl.style.height=o.height+"px",this.menuEl.style.width=o.width+"px",this.menuEl.style.transformOrigin=`${o.horizontalAlignment==="left"?"0":"100%"} ${o.verticalAlignment==="top"?"0":"100%"}`}_regionCorner(){let t=this.el.getBoundingClientRect();return{x:getComputedStyle(this.el).direction==="rtl"?t.right:t.left,y:t.bottom}}_placeMenuAtPoint({x:t,y:e},i){let{transform:s,transition:o}=this.menuEl.style;this.menuEl.style.transition="none",this.menuEl.style.transform="none";let r=this.menuEl.getBoundingClientRect();this.menuEl.style.transform=s,this.menuEl.style.transition=o;let a={left:0,top:0,right:window.innerWidth,bottom:window.innerHeight};if(i&&getComputedStyle(i).overflow!=="visible"){let M=i.getBoundingClientRect();a={left:Math.max(a.left,M.left),top:Math.max(a.top,M.top),right:Math.min(a.right,M.right),bottom:Math.min(a.bottom,M.bottom)}}let c=r.width,h=Math.min(r.height,a.bottom-a.top);this.isScrollable=h<r.height,this.isScrollable&&(this.menuEl.style.height=h+"px");let l=getComputedStyle(this.el).direction==="rtl",u=t+c<=a.right,f=t-c>=a.left,m=l?f||!u:!u&&f,v=e+h>a.bottom&&e-h>=a.top,g=(M,T,Z)=>Math.max(T,Math.min(M,Z)),E=g(m?t-c:t,a.left,a.right-c),L=g(v?e-h:e,a.top,a.bottom-h);this.menuEl.style.left=E-r.left+"px",this.menuEl.style.top=L-r.top+"px",this.menuEl.style.transformOrigin=`${m?"100%":"0"} ${v?"100%":"0"}`}_setExpanded(t){this.options.contextMenu||(this.el.ariaExpanded=String(t))}};N._menus=[];var F=N;var Be={i18n:{loading:"Loading results.",noResults:"No results.",results:d=>`${d} ${d===1?"result":"results"} available.`,selected:d=>`${d} ${d===1?"item":"items"} selected.`},data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,isMultiSelect:!1,onSearch:(d,n)=>{let t=d.toLocaleLowerCase(),e=n.options.data;n.setMenuItems(e.filter(i=>i.id.toString().toLocaleLowerCase().includes(t)||i.text?.toLocaleLowerCase().includes(t))),n.options.data=e},maxMenuHeight:"300px",allowUnsafeHTML:!1,selected:[]},H=class H extends b{constructor(t,e){super(t,e,H);this._handleInputBlur=()=>{this._pointerDown||(this.close(),this._resetAutocomplete())};this._handleInputKeyup=()=>{H._keydown=!1};this._handleInput=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this.oldVal!==t&&(this._resetCurrentElementPosition(),this.el.matches(":focus-visible")&&(!this.menu.isOpen||t.length<this.options.minLength)&&this.open()),this._inputChangeDetection(t)};this._handleInputFocus=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=t=>{!this.options.isMultiSelect&&this.selectedValues.length&&this.el.value!==(this.selectedValues[0].text||String(this.selectedValues[0].id))&&(this.selectedValues=[]),this.oldVal!==t&&(this._setStatusLoading(),this.options.onSearch(this.el.value,this)),!this.options.isMultiSelect&&this.el.value.length===0&&(this.selectedValues=[],this._triggerChanged()),this.oldVal=t};this._handleInputKeydown=t=>{if(H._keydown=!0,t.key===p.keys.ESC||t.key==="Tab"){this.close(),this._resetCurrentElementPosition();return}let e=this.container.querySelectorAll("li").length;if(t.key===p.keys.ENTER&&this.activeIndex>=0){let i=this.container.querySelectorAll("li")[this.activeIndex];i&&(this.selectOption(i.getAttribute("data-id")),t.preventDefault());return}(t.key===p.keys.ARROW_UP||t.key===p.keys.ARROW_DOWN)&&(t.preventDefault(),t.key===p.keys.ARROW_UP&&this.activeIndex>0&&this.activeIndex--,t.key===p.keys.ARROW_DOWN&&this.activeIndex<e-1&&this.activeIndex++,this._setActive(null),this.activeIndex>=0&&(this._setActive(this.container.querySelectorAll("li")[this.activeIndex]),this.container.children[this.activeIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})))};this._handleInputClick=()=>{this.open()};this._handleContainerPointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0))};this._handleContainerPointerUp=()=>{this._pointerDown=!1};this.open=()=>{let t=this.el.value.toLocaleLowerCase();this._resetAutocomplete(),t.length>=this.options.minLength&&(this._renderMenu(),this._announce(this.menuItems.length?this.options.i18n.results(this.menuItems.length):this.options.i18n.noResults)),this.menu.isOpen?this.menu.recalculateDimensions():(this._openTimer!==void 0&&clearTimeout(this._openTimer),this._openTimer=setTimeout(()=>{this._openTimer=void 0,this.menu.open()},0))};this.close=()=>{this._announcer&&(this._announcer.textContent=""),this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this.isOpen=!1,this.menu.close()};this.el.Expressive_Autocomplete=this,this.options={...H.defaults,...e,i18n:{...H.defaults.i18n,...e?.i18n}},this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="",this.selectedValues=this.options.selected.map(i=>this.options.data.find(s=>s.id===i)??{id:i}),this.menuItems=this.options.data||[],this.$active=null,this._pointerDown=!1,this._setupMenu(),this._setupEventHandlers()}_setActive(t){this.$active?.classList.remove("active"),this.$active=t,t?(t.classList.add("active"),this.el.setAttribute("aria-activedescendant",t.id)):this.el.removeAttribute("aria-activedescendant")}static get defaults(){return Be}static init(t,e={}){return super.init(t,e,H)}static getInstance(t){return t.Expressive_Autocomplete}static _loadingIndicator(){if(!H._loadingTemplate){let t=document.createElement("template");t.innerHTML=`<div style="height:100%;width:50px;"><svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
|
|
2
2
|
<circle fill="#888c" stroke="none" cx="6" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1"/></circle>
|
|
3
3
|
<circle fill="#888c" stroke="none" cx="26" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.2"/></circle>
|
|
4
4
|
<circle fill="#888c" stroke="none" cx="46" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3"/></circle>
|
|
5
|
-
</svg></div>`,D._loadingTemplate=t.content.firstElementChild}return D._loadingTemplate.cloneNode(!0)}destroy(){this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._removeEventHandlers(),this.menu.destroy(),this.isOpen=!1,this._removeMenu(),this._statusInfo.remove(),this._announcer.remove(),this.el.Expressive_Autocomplete=void 0}_setupEventHandlers(){this.el.addEventListener("blur",this._handleInputBlur),this.el.addEventListener("input",this._handleInput),this.el.addEventListener("keyup",this._handleInputKeyup),this.el.addEventListener("focus",this._handleInputFocus),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("click",this._handleInputClick),this.container.addEventListener("pointerdown",this._handleContainerPointerDown),this.container.addEventListener("pointerup",this._handleContainerPointerUp),this.container.addEventListener("pointercancel",this._handleContainerPointerUp)}_removeEventHandlers(){this.el.removeEventListener("blur",this._handleInputBlur),this.el.removeEventListener("input",this._handleInput),this.el.removeEventListener("keyup",this._handleInputKeyup),this.el.removeEventListener("focus",this._handleInputFocus),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("click",this._handleInputClick),this.container.removeEventListener("pointerdown",this._handleContainerPointerDown),this.container.removeEventListener("pointerup",this._handleContainerPointerUp),this.container.removeEventListener("pointercancel",this._handleContainerPointerUp)}_setupMenu(){this.container=document.createElement("menu"),this.container.style.maxHeight=this.options.maxMenuHeight,this.container.id=`autocomplete-options-${u.guid()}`,this.container.classList.add("autocomplete-content"),this.container.ariaExpanded="true",this.container.setAttribute("role","listbox"),this.el.setAttribute("role","combobox"),this.el.setAttribute("aria-autocomplete","list"),this.el.setAttribute("aria-controls",this.container.id),this.el.setAttribute("data-target",this.container.id),this.menuItems.forEach(h=>{let c=this._createMenuItem(h);this.container.append(c)}),this.el.parentElement.appendChild(this.container);let t={...D.defaults.menuOptions,...this.options.menuOptions},e=t.onOpenStart,i=t.onCloseStart;t.onOpenStart=h=>{this.isOpen=!0,typeof e=="function"&&e.call(this.menu,h)},t.onCloseStart=h=>{this.isOpen=!1,typeof i=="function"&&i.call(this.menu,h)};let s=t.onItemClick;t.onItemClick=h=>{if(!h)return;let c=h.getAttribute("data-id");this.selectOption(c),typeof s=="function"&&s.call(this.menu,h)},this.menu=H.init(this.el,t),this.el.setAttribute("aria-haspopup","listbox");let n=this.el.parentElement.querySelector("label");n&&this.el.after(n),this.el.removeEventListener("click",this.menu._handleClick),this.options.isMultiSelect||this._refreshInputText(),this.el.value&&this.selectOption(this.el.value);let a=document.createElement("div");a.classList.add("status-info"),a.setAttribute("aria-hidden","true"),a.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(a),this._statusInfo=a,this._announcer=document.createElement("div"),this._announcer.classList.add("autocomplete-status"),this._announcer.setAttribute("role","status"),this._announcer.setAttribute("aria-live","polite"),this._announcer.setAttribute("aria-atomic","true"),this.el.parentElement.appendChild(this._announcer),this._updateSelectedInfo()}_removeMenu(){this.container.ariaExpanded="false",this.container.parentNode.removeChild(this.container)}_resetCurrentElementPosition(){this.activeIndex=-1,this._setActive(null)}_resetAutocomplete(){this.container.replaceChildren(),this._resetCurrentElementPosition(),this.oldVal=null,this._pointerDown=!1}_highlightPartialText(t,e){let i=e.toLocaleLowerCase().indexOf(""+t.toLocaleLowerCase()),s=i+t.length-1;return i==-1||s==-1?[e,"",""]:[e.slice(0,i),e.slice(i,s+1),e.slice(s+1)]}_createMenuItem(t){let e=document.createElement("li");e.id=`autocomplete-option-${u.guid()}`,e.setAttribute("role","option");let i=this.selectedValues.some(l=>l.id===t.id);if(e.setAttribute("aria-selected",i?"true":"false"),e.setAttribute("data-id",t.id),e.setAttribute("style","display:grid; grid-auto-flow: column; user-select: none; align-items: center;"),e.tabIndex=-1,this.options.isMultiSelect){let l=document.createElement("div");l.classList.add("item-selection"),l.style.textAlign="center";let r=document.createElement("input");r.type="checkbox",r.tabIndex=-1,r.checked=i;let p=document.createElement("span");p.style.paddingLeft="21px",l.append(r,p),e.appendChild(l)}if(t.image){let l=document.createElement("img");l.classList.add("circle"),l.src=t.image,e.appendChild(l)}let s=this.el.value.toLocaleLowerCase(),n=this._highlightPartialText(s,(t.text||t.id).toString()),a=document.createElement("div");if(a.setAttribute("style","line-height:1.2;font-weight:500;"),this.options.allowUnsafeHTML)a.innerHTML=n[0]+'<span class="highlight">'+n[1]+"</span>"+n[2];else if(a.appendChild(document.createTextNode(n[0])),n[1]){let l=document.createElement("span");l.textContent=n[1],l.classList.add("highlight"),a.appendChild(l),a.appendChild(document.createTextNode(n[2]))}let h=document.createElement("div");if(h.classList.add("item-text"),h.setAttribute("style","padding:5px;overflow:hidden;"),e.appendChild(h),e.querySelector(".item-text").appendChild(a),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let l=document.createElement("small");l.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),l.innerText=t.description,e.querySelector(".item-text").appendChild(l)}let c=()=>this.options.isMultiSelect?t.image?"40px min-content auto":"40px auto":t.image?"min-content auto":"auto";return e.style.gridTemplateColumns=c(),e}_renderMenu(){this._resetAutocomplete(),this.menuItems.length===0&&(this.menuItems=this.selectedValues);for(let t=0;t<this.menuItems.length;t++){let e=this._createMenuItem(this.menuItems[t]);this.container.append(e)}}_setStatusLoading(){let t=this._statusInfo;t&&t.replaceChildren(D._loadingIndicator()),this._announce(this.options.i18n.loading)}_announce(t){if(!this._announcer)return;let e=this.el.matches(":focus")&&this.el.value.length>=this.options.minLength?t:"";this._announcer.textContent!==e&&(this._announcer.textContent=e)}_updateSelectedInfo(){let t=this._statusInfo;t&&(this.options.isMultiSelect?t.textContent=this.selectedValues.length.toString():t.replaceChildren())}_refreshInputText(){if(this.selectedValues.length===1){let t=this.selectedValues[0];this.el.value=t.text||t.id}}_triggerChanged(){this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0})),typeof this.options.onAutocomplete=="function"&&this.options.onAutocomplete.call(this,this.selectedValues)}setMenuItems(t,e=null,i=!0){if(this.el.Expressive_Autocomplete!==this)return;let s=t.length;this.menuItems=t,this.options.data=t,e&&(this.selectedValues=this.menuItems.filter(n=>e.indexOf(n.id)!==-1)),this.options.isMultiSelect?this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._announce(i?s?this.options.i18n.results(s):this.options.i18n.noResults:""),this._triggerChanged()}selectOption(t){let e=this.menuItems.find(i=>i.id==t);e&&(this.options.isMultiSelect?(this.selectedValues.filter(i=>i.id===e.id).length>=1?this.selectedValues=this.selectedValues.filter(i=>i.id!==e.id):this.selectedValues.push(e),this._renderMenu(),this.el.focus()):(this.selectedValues=[e],this._refreshInputText(),this._resetAutocomplete(),this.close()),this._updateSelectedInfo(),this.options.isMultiSelect&&this._announce(this.options.i18n.selected(this.selectedValues.length)),this._triggerChanged())}};D._loadingTemplate=null;var P=D;var Qt={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-symbols",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,allowUserInput:!1,i18n:{remove:"Remove"},onChipAdd:null,onChipSelect:null,onChipDelete:null},w=class w extends _{constructor(t,e){super(t,e,w);this._handleChipClick=t=>{let e=t.target.closest(".chip"),i=!!t.target.closest(".close");if(e){let s=this._chips.indexOf(e);if(s<0)return;i?this._deleteChip(s,"input"):this.selectChip(s)}else this._input.focus()};this._handleInputFocus=()=>{this.el.classList.add("focus")};this._handleInputBlur=()=>{this.el.classList.remove("focus")};this._handleInputKeydown=t=>{if(w._keydown=!0,t.key===u.keys.ENTER){if(this.hasAutocomplete&&this.autocomplete?.isOpen&&this.autocomplete.container.querySelector('[role="option"]'))return;t.preventDefault(),(!this.hasAutocomplete||this.hasAutocomplete&&!this.options.autocompleteOnly)&&this.addChip({id:this._input.value}),this._input.value=""}else(t.key===u.keys.BACKSPACE||t.key===u.keys.ARROW_LEFT)&&this._input.value===""&&this.chipsData.length&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))};this.el.Expressive_Chips=this,this.options={...w.defaults,...e},e?.i18n&&(this.options.i18n={...w.defaults.i18n,...e.i18n}),this.el.classList.add("chips"),this.chipsData=[],this._chips=[],this.options.data.length&&(this.chipsData=this.options.data,this._renderChips()),this.options.allowUserInput&&(this.el.classList.add("field"),this._setupInput(),this._setupEventHandlers(),this.el.append(this._input)),this._setupLabel()}_setSelected(t){this._selectedChip?.classList.remove("selected"),this._selectedChip=t,t?.classList.add("selected")}static get defaults(){return Qt}static init(t,e={}){return super.init(t,e,w)}static getInstance(t){return t.Expressive_Chips}getData(){return this.chipsData}destroy(){this.autocomplete&&P.getInstance(this._input)===this.autocomplete&&this.autocomplete.destroy(),this.options.allowUserInput&&this._removeEventHandlers(),this._chips.forEach(t=>t.remove()),this._chips=[],this.el.Expressive_Chips=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleChipClick),this.el.addEventListener("keydown",w._handleChipsKeydown),this.el.addEventListener("keyup",w._handleChipsKeyup),this.el.addEventListener("blur",w._handleChipsBlur,!0),this._input.addEventListener("focus",this._handleInputFocus),this._input.addEventListener("blur",this._handleInputBlur),this._input.addEventListener("keydown",this._handleInputKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleChipClick),this.el.removeEventListener("keydown",w._handleChipsKeydown),this.el.removeEventListener("keyup",w._handleChipsKeyup),this.el.removeEventListener("blur",w._handleChipsBlur,!0),this._input.removeEventListener("focus",this._handleInputFocus),this._input.removeEventListener("blur",this._handleInputBlur),this._input.removeEventListener("keydown",this._handleInputKeydown)}static _handleChipsKeydown(t){w._keydown=!0;let e=t.target.closest(".chips"),i=t.target&&e,s=t.target.tagName;if(s==="INPUT"||s==="TEXTAREA"||!i)return;let n=e.Expressive_Chips;if(n){if(t.key===u.keys.BACKSPACE||t.key===u.keys.DELETE){let a=n._chips.indexOf(t.target.closest(".chip"));if(a<0)return;t.preventDefault(),n._deleteChip(a,"previous")}else if(t.key===u.keys.ARROW_LEFT){if(n._selectedChip){let a=n._chips.indexOf(n._selectedChip)-1;if(a<0)return;n.selectChip(a)}}else if(t.key===u.keys.ARROW_RIGHT&&n._selectedChip){let a=n._chips.indexOf(n._selectedChip)+1;a>=n.chipsData.length?(n._setSelected(null),n._input.focus()):n.selectChip(a)}}}static _handleChipsKeyup(){w._keydown=!1}static _handleChipsBlur(t){if(!w._keydown&&document.hidden){let i=t.target.closest(".chips")?.Expressive_Chips;i&&i._setSelected(null)}}_renderChip(t){if(!t.id&&t.id!==0)return;let e=t.text||t.id,i=document.createElement("span");if(i.classList.add("chip"),i.innerText=e,t.image){let s=document.createElement("img");s.setAttribute("src",t.image),i.insertBefore(s,i.firstChild)}if(this.options.allowUserInput){let s=document.createElement("button");s.type="button",s.classList.add("close"),s.setAttribute("aria-label",`${this.options.i18n.remove} ${e}`);let n=document.createElement("span");n.classList.add(this.options.closeIconClass),n.setAttribute("aria-hidden","true"),n.innerText="close",s.appendChild(n),i.appendChild(s)}return i}_renderChips(){this._chips=[];for(let t=0;t<this.chipsData.length;t++){let e=this._renderChip(this.chipsData[t]);this.el.appendChild(e),this._chips.push(e)}}_setupAutocomplete(){this.options.autocompleteOptions.onAutocomplete=t=>{w.getInstance(this.el)===this&&t.length>0&&(this.addChip({id:t[0].id,text:t[0].text,image:t[0].image}),this._input.value="",this._input.focus())},this.autocomplete=P.init(this._input,this.options.autocompleteOptions)}_setupInput(){this._input=this.el.querySelector("input"),this._input||(this._input=document.createElement("input"),this.el.append(this._input)),this._input.classList.add("input"),this.hasAutocomplete=Object.keys(this.options.autocompleteOptions).length>0,this.hasAutocomplete&&this._setupAutocomplete(),this._setPlaceholder(),this._input.getAttribute("id")||this._input.setAttribute("id",u.guid())}_setupLabel(){this._label=this.el.querySelector("label"),this._label&&this._input&&this._label.setAttribute("for",this._input.getAttribute("id"))}_setPlaceholder(){this._input&&(this.chipsData!==void 0&&!this.chipsData.length&&this.options.placeholder?this._input.placeholder=this.options.placeholder:(this.chipsData===void 0||this.chipsData.length)&&this.options.secondaryPlaceholder&&(this._input.placeholder=this.options.secondaryPlaceholder))}_isValidAndNotExist(t){let e=!!t.id||t.id===0,i=!this.chipsData.some(s=>s.id==t.id);return e&&i}addChip(t){if(!this._isValidAndNotExist(t)||this.chipsData.length>=this.options.limit)return;let e=this._renderChip(t);this._chips.push(e),this.chipsData.push(t),this._input?this._input.before(e):this.el.append(e),this._setPlaceholder(),typeof this.options.onChipAdd=="function"&&this.options.onChipAdd(this.el,e)}deleteChip(t){let e=this.el.getRootNode();this._deleteChip(t,this._chips[t]?.contains(e.activeElement)?"input":null)}_deleteChip(t,e){let i=this._chips[t];if(!i)return;this._selectedChip===i&&this._setSelected(null),i.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder();let s=[],n=this.el.getRootNode();for(;n;)s.push({root:n,element:n.activeElement}),n="host"in n?n.host.getRootNode():null;typeof this.options.onChipDelete=="function"&&this.options.onChipDelete(this.el,i),!(!e||s.some(({root:a,element:h})=>a.activeElement!==h)||this.el.Expressive_Chips!==this)&&(e==="previous"&&this._chips.length?this.selectChip(Math.max(t-1,0)):(this._setSelected(null),this._input?.focus()))}selectChip(t){let e=this._chips[t];e&&(this._setSelected(e),e.querySelector(".close")?.focus(),typeof this.options.onChipSelect=="function"&&this.options.onChipSelect(this.el,e))}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(".chips").forEach(e=>{e.addEventListener("click",i=>{if(!e.Expressive_Chips&&i.target.closest(".close")){let s=i.target.closest(".chip");s&&s.remove()}})})})}};w._keydown=!1;var W=w;var Jt={},at=new WeakMap,V=class d extends _{constructor(t,e){super(t,e,d);this._resizeObserver=null;this._handleRangeChange=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0,this.el.classList.add("active"),this._clampDual(),this._sync(),this.thumb.classList.add("active")))};this._handleRangeInputOrMove=t=>{(t.type==="input"||this._pointerDown)&&(this._clampDual(),this._sync(),this.thumb.classList.add("active"))};this._handleRangePointerUp=t=>{t.isPrimary&&(this._pointerDown=!1,this.el.classList.remove("active"))};this._handleRangeRelease=()=>{this._pointerDown||this.thumb.classList.remove("active")};this.el.Expressive_Slider=this,this.options={...d.defaults,...e},this._pointerDown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers(),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._sync()),this._resizeObserver.observe(this.el))}static get defaults(){return Jt}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Slider}destroy(){this._resizeObserver?.disconnect(),this._removeEventHandlers(),this._removeThumb(),this.el.Expressive_Slider=void 0;let t=this._host();for(let e of[this.el,t]){for(let i in at.get(e))e.style.setProperty(i,at.get(e)[i]);at.delete(e)}t?.querySelectorAll('input[type="range"]').forEach(e=>e.Expressive_Slider?._sync())}_set(t,e,i){let s=at.get(t)??{};at.set(t,s),s[e]??(s[e]=t.style.getPropertyValue(e)),t.style.setProperty(e,i)}_setupEventHandlers(){this.el.addEventListener("change",this._handleRangeChange),this.el.addEventListener("pointerdown",this._handleRangePointerDown),this.el.addEventListener("input",this._handleRangeInputOrMove),this.el.addEventListener("pointermove",this._handleRangeInputOrMove,{passive:!0}),this.el.addEventListener("pointerup",this._handleRangePointerUp),this.el.addEventListener("pointercancel",this._handleRangePointerUp),this.el.addEventListener("blur",this._handleRangeRelease),this.el.addEventListener("mouseout",this._handleRangeRelease)}_removeEventHandlers(){this.el.removeEventListener("change",this._handleRangeChange),this.el.removeEventListener("pointerdown",this._handleRangePointerDown),this.el.removeEventListener("input",this._handleRangeInputOrMove),this.el.removeEventListener("pointermove",this._handleRangeInputOrMove),this.el.removeEventListener("pointerup",this._handleRangePointerUp),this.el.removeEventListener("pointercancel",this._handleRangePointerUp),this.el.removeEventListener("blur",this._handleRangeRelease),this.el.removeEventListener("mouseout",this._handleRangeRelease)}_setupThumb(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),this.thumb.classList.add("thumb"),this.value.classList.add("value"),this.thumb.append(this.value),this.el.after(this.thumb)}_removeThumb(){this.thumb.remove()}_isVertical(){return!!this.el.closest(".vertical")}_host(){return this.el.closest(".slider, .range, .range-field, label")}_clampDual(){let e=this._host()?.querySelectorAll('input[type="range"]');if(!e||e.length!==2)return;let i=e[0],s=e[1];this.el===i&&+i.value>+s.value&&(i.value=s.value),this.el===s&&+s.value<+i.value&&(s.value=i.value)}_fraction(t){let e=parseFloat(t.max),i=Number.isNaN(e)?100:e,s=parseFloat(t.min)||0,n=parseFloat(t.value)||0;return i===s?0:(n-s)/(i-s)}_sync(){let t=this._fraction(this.el),e=`${t*100}%`,i=this.el.offsetLeft,s=this.el.offsetTop,n=this.el.offsetWidth,a=this.el.offsetHeight,h=getComputedStyle(this.el),c=h.direction==="rtl",l=this._isVertical(),r=parseFloat(h.getPropertyValue("--md-comp-slider-handle-width"))||4,p=l?a:n,m=r/2+t*(p-r);this._set(this.el,"--md-comp-slider-active-fraction",e),this._set(this.el,"--md-comp-slider-active-position",`${m}px`);let v=this._host(),E=v?.querySelectorAll('input[type="range"]');if(v&&E&&E.length===2){let b=Array.from(E).map(y=>this._fraction(y));this._set(v,"--md-comp-slider-start-fraction",`${Math.min(...b)*100}%`),this._set(v,"--md-comp-slider-end-fraction",`${Math.max(...b)*100}%`),this._set(v,"--md-comp-slider-start-position",`${r/2+Math.min(...b)*(p-r)}px`),this._set(v,"--md-comp-slider-end-position",`${r/2+Math.max(...b)*(p-r)}px`)}if(v?.classList.contains("stops")){let b=parseFloat(this.el.max),y=Number.isNaN(b)?100:b,I=parseFloat(this.el.min)||0,A=parseFloat(this.el.step),M=A>0&&Number.isFinite(A)&&y>I;this._set(v,"--md-comp-slider-stop-count",M?String(Math.floor((y-I)/A+1e-9)+1):""),this._set(v,"--md-comp-slider-stop-spacing",M?`${(p-r)*A/(y-I)}px`:""),E?.length===1&&(this._set(v,"--md-comp-slider-active-position",`${m}px`),this._set(v,"--md-comp-slider-track-center",`${s+a/2}px`))}this.value.textContent=this.el.value,l?(this.thumb.style.left=`${i+n/2}px`,this.thumb.style.top=`${s+a-m}px`):(this.thumb.style.left=`${i+(c?n-m:m)}px`,this.thumb.style.top=`${s}px`)}static Init(){u.onDocumentReady(()=>{d.init(document.querySelectorAll("input[type=range]"),{})})}};var C=class C{static Init(){u.onDocumentReady(()=>{document.addEventListener("pointerdown",C._onPointerDown,{passive:!0}),document.addEventListener("pointerup",C._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",C._onPointerCancel,{passive:!0})})}static _onPointerDown(o){if(!C._isPrimaryPress(o)){C._down=null;return}let t=C._backdropDialog(o);if(!t||!C._lightDismissible(t)||!C._outside(o,t)){C._down=null;return}C._down={dialog:t,pointerId:o.pointerId}}static _onPointerUp(o){let t=C._down;C._down=null,!(!t||t.pointerId!==o.pointerId)&&o.isPrimary&&(!t.dialog.isConnected||!t.dialog.open||C._lightDismissible(t.dialog)&&C._backdropDialog(o)===t.dialog&&C._outside(o,t.dialog)&&t.dialog.close())}static _onPointerCancel(){C._down=null}static _backdropDialog(o){let t=o.target;return!(t instanceof HTMLDialogElement)||!t.open?null:t}static _outside(o,t){let e=t.getBoundingClientRect();return o.clientX<e.left||o.clientX>e.right||o.clientY<e.top||o.clientY>e.bottom}static _isPrimaryPress(o){return o.isPrimary?o.pointerType!=="mouse"||o.button===0:!1}static _lightDismissible(o){let t=C._closedBy(o);return!(t==="none"||t==="closerequest"||t==="any"&&"closedBy"in HTMLDialogElement.prototype)}static _closedBy(o){let t=o.getAttribute("closedby");return t==="any"||t==="closerequest"||t==="none"?t:null}};C._down=null;var $=C;var bt=96,Lt=.5,te=100,ee=4;function rt(d){let o=l=>d.axis==="x"?l.clientX:l.clientY,t,e=null,i=l=>{if(!(l instanceof Element))return null;let r=l.closest(d.selector);return r instanceof HTMLDialogElement?r:null},s=l=>{l.style.transition="",l.style.setProperty(d.property,"0px")},n=l=>{if(!l.isPrimary||l.pointerType==="mouse"&&l.button!==0)return;c(),d.onPress?.();let r=i(l.target);if(!r?.open){e=null;return}if(!d.inHandle(l,r)){e=null;return}r.style.transition="none",e={dialog:r,pointerId:l.pointerId,direction:d.direction(r),start:o(l),last:o(l),lastT:Date.now(),velocity:0,shift:0},t.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open"],attributeOldValue:!0})},a=l=>{if(!e||e.pointerId!==l.pointerId)return;if(!e.dialog.open||!e.dialog.isConnected){c();return}let r=o(l)-e.start;if(e.shift=e.direction===1?Math.max(0,r):Math.min(0,r),o(l)!==e.last){let p=Date.now();e.velocity=(o(l)-e.last)/Math.max(1,p-e.lastT),e.last=o(l),e.lastT=p}e.dialog.style.setProperty(d.property,`${e.shift}px`)},h=l=>{let r=e;if(!r||r.pointerId!==l.pointerId)return;if(!r.dialog.open||!r.dialog.isConnected){c();return}a(l),e=null,t.disconnect(),r.dialog.style.transition="";let p=Date.now()-r.lastT<te?r.velocity:0,m=Math.abs(r.shift)>ee;d.onRelease?.(m),m&&(r.direction===1?r.shift>bt||p>Lt:r.shift<-bt||p<-Lt)&&r.dialog.open&&r.dialog.close(),r.dialog.style.setProperty(d.property,"0px")},c=l=>{if(l&&e?.pointerId!==l.pointerId)return;t.disconnect(),d.onRelease?.(!1);let r=e;e=null,r&&s(r.dialog)};u.onDocumentReady(()=>{t=new MutationObserver(l=>{let r=e?.dialog;r&&(!r.open||!r.isConnected||l.some(p=>p.type==="attributes"&&p.target===r&&p.oldValue===null||[...p.removedNodes].some(m=>m.contains(r))))&&c()}),document.addEventListener("pointerdown",n,{passive:!0}),document.addEventListener("pointermove",a,{passive:!0}),document.addEventListener("pointerup",h,{passive:!0}),document.addEventListener("pointercancel",c,{passive:!0})})}var Tt="dialog.bottom-sheet, dialog.bottom",q=class q{static Init(){rt({selector:Tt,axis:"y",property:"--md-comp-bottom-sheet-shift",direction:()=>1,inHandle:(o,t)=>{let e=o.target;if(e instanceof Element&&e.closest(".handle"))return!0;let i=t.getBoundingClientRect();return o.clientY>=i.top&&o.clientY<=i.top+48},onPress:()=>{q._dragged=!1},onRelease:o=>{q._dragged=o}}),u.onDocumentReady(()=>{document.addEventListener("click",q._onClick)})}static _onClick(o){let t=o.target;if(!(t instanceof Element))return;let e=t.closest(".handle, .drag-handle");if(!(e instanceof HTMLButtonElement)||o.detail!==0&&q._dragged)return;let i=e.closest(Tt);i instanceof HTMLDialogElement&&i.open&&i.close()}};q._dragged=!1;var K=q;var ie=d=>d.classList.contains("left")||d.classList.contains("left-sheet")||d.classList.contains("start"),Mt=d=>ie(d)!==(getComputedStyle(d).direction==="rtl"),z=class{static Init(){rt({selector:"dialog.side-sheet, dialog.right, dialog.right-sheet, dialog.left, dialog.left-sheet",axis:"x",property:"--md-comp-side-sheet-shift",direction:o=>Mt(o)?-1:1,inHandle:(o,t)=>{let e=o.target;if(e instanceof Element&&e.closest("header"))return!0;let i=t.getBoundingClientRect();return Mt(t)?o.clientX>=i.right-24&&o.clientX<=i.right:o.clientX>=i.left&&o.clientX<=i.left+24}})}};var U=class d{static validateField(o){if(!o){console.error("No text field element found");return}let t=o.getAttribute("data-length")!==null,e=parseInt(o.getAttribute("data-length")),i=o.value.length;i===0&&o.validity.badInput===!1&&!o.required&&o.classList.contains("validate")?o.classList.remove("invalid"):o.classList.contains("validate")&&(o.validity.valid&&t&&i<=e||o.validity.valid&&!t?o.classList.remove("invalid"):o.classList.add("invalid"))}static textareaAutoResize(o){let t=o;if(!t)return;t.hasAttribute("original-height")||t.setAttribute("original-height",t.getBoundingClientRect().height.toString());let e=parseInt(t.getAttribute("original-height"));if(isNaN(e))return;t.style.height="auto";let i=t.offsetHeight-t.clientHeight,s=t.scrollHeight+i;t.style.height=Math.max(e,s)+"px"}static Init(){u.onDocumentReady(()=>{document.addEventListener("change",o=>{let t=o.target;t instanceof HTMLInputElement&&d.validateField(t)}),document.addEventListener("keyup",o=>{let t=o.target;t instanceof HTMLInputElement&&["radio","checkbox"].includes(t.type)&&o.key===u.keys.TAB&&(t.classList.add("tabbed"),t.addEventListener("blur",()=>t.classList.remove("tabbed"),{once:!0}))}),document.querySelectorAll(".expressive-textarea").forEach(o=>{d.InitTextarea(o)}),document.querySelectorAll('.file-field input[type="file"]').forEach(o=>{d.InitFileInputPath(o)})})}static InitTextarea(o){o.setAttribute("original-height",o.getBoundingClientRect().height.toString()),d.textareaAutoResize(o),o.addEventListener("input",t=>d.textareaAutoResize(t.target))}static InitFileInputPath(o){o.addEventListener("change",()=>{let e=o.closest(".file-field").querySelector("input.file-path"),i=o.files,s=[];for(let n=0;n<i.length;n++)s.push(i[n].name);e.value=s.join(", "),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))})}};var se={},Y=class d extends _{constructor(t,e){super(t,e,d);this._observer=null;this._sentinel=null;this._input=null;this._view=null;this._searchOpen=!1;this._onIntersect=t=>{let e=t[0];e&&this.el.classList.toggle("collapsed",!e.isIntersecting&&e.boundingClientRect.top<this.el.getBoundingClientRect().top)};this._onSearchViewClose=()=>{this._searchOpen=this._view.open};this._onSearchFocus=()=>{if(!(!this._view||this._searchOpen)){if(this._view instanceof HTMLDialogElement){this._searchOpen=!0,this._view.open||this._view.showModal();return}this._view.hidden=!1,this._input?.setAttribute("aria-expanded","true")}};this.el.Expressive_AppBar=this,this.options={...d.defaults,...e},this._setupCollapse(),this._setupSearch()}static get defaults(){return se}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_AppBar}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._input?.removeEventListener("focus",this._onSearchFocus),this._input?.removeEventListener("click",this._onSearchFocus),this._view?.removeEventListener("close",this._onSearchViewClose),this.el.classList.remove("collapsed"),this.el.Expressive_AppBar=void 0}_setupCollapse(){!this.el.classList.contains("medium")&&!this.el.classList.contains("large")||typeof IntersectionObserver>"u"||(this._sentinel=document.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="display:block;height:0;position:relative;top:-64px;pointer-events:none;visibility:hidden",this.el.insertAdjacentElement("afterend",this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel))}_setupSearch(){if(this._input=this.el.querySelector('input[type="search"]'),!this._input)return;let t=this._input.getAttribute("aria-controls");t&&(this._view=document.getElementById(t)),this._view||(this._view=this.el.querySelector(".search-view")),this._view&&(this._input.addEventListener("focus",this._onSearchFocus),this._input.addEventListener("click",this._onSearchFocus),this._view instanceof HTMLDialogElement&&this._view.addEventListener("close",this._onSearchViewClose))}};var ne={},G=class d extends _{constructor(t,e){super(t,e,d);this.open=()=>{this.isOpen||(this.isOpen=!0,this._list&&(this._list.inert=!1),this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{if(!this.isOpen)return;let t=this.el.getRootNode().activeElement;t&&this._list?.contains(t)&&this._anchor?.focus(),this._list&&(this._list.inert=!0),this.isOpen=!1,this.el.classList.remove("active"),this._anchor?.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._handleDocumentClick),document.removeEventListener("keydown",this._handleDocumentKeydown)};this._handleFABClick=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("a, button");!i||i.matches(':disabled, [aria-disabled="true"]')||(i===this._anchor?this._toggle():this._list?.contains(i)&&this.close())};this._handleAnchorKeydown=t=>{(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{t.key===u.keys.ESC&&!t.defaultPrevented&&this.close()};this._handleDocumentClick=t=>{t.composedPath().includes(this.el)||this.close()};this.el.Expressive_FloatingActionButton=this,this.options={...d.defaults,...e},this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this._list=this.el.querySelector(":scope > ul, :scope > menu"),this._listWasInert=this._list?.inert??!1,this.el.classList.remove("active"),this._list&&(this._list.inert=!0),this._anchor?.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&(this._anchor.tabIndex<0&&(this._anchor.tabIndex=0),this._anchor.addEventListener("keydown",this._handleAnchorKeydown)),this.el.addEventListener("click",this._handleFABClick)}static get defaults(){return ne}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FloatingActionButton}destroy(){this.close(),this._list&&(this._list.inert=this._listWasInert),this.el.removeEventListener("click",this._handleFABClick),this._anchor?.removeEventListener("keydown",this._handleAnchorKeydown),this.el.Expressive_FloatingActionButton=void 0}_toggle(){this.isOpen?this.close():this.open()}};var oe={},ae=new Set(["single","multiple"]),Ct="button-group-pressed",re=.15,j=class d extends _{constructor(t,e={}){super(t,e,d);this._pressedStyles=new Map;this._releaseStyles=new Map;this._releaseTimer=null;this._originalPressed=new Map;this._activeItem=null;this._handleClick=t=>{if(!this._selectionMode)return;let e=this._itemFromEvent(t);if(!(e instanceof HTMLButtonElement)||this._isDisabled(e))return;this._rememberPressed(e);let i=e.getAttribute("aria-pressed")!=="true",s=this._toggleItems.filter(n=>n.getAttribute("aria-pressed")==="true").length;!i&&this.el.hasAttribute("data-selection-required")&&s===1||(this._selectionMode==="single"&&i&&this._toggleItems.forEach(n=>{this._rememberPressed(n),n.setAttribute("aria-pressed","false")}),e.setAttribute("aria-pressed",i?"true":"false"))};this._handlePointerDown=t=>{if(t.button!==0)return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyDown=t=>{if(t.repeat||t.key!==" "&&t.key!=="Enter")return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyUp=t=>{(t.key===" "||t.key==="Enter")&&this._resetPress()};this._handleFocusOut=t=>{t.target===this._activeItem&&this._resetPress()};this._resetPress=()=>{if(this._activeItem?.classList.remove(Ct),this._activeItem=null,!!this._pressedStyles.size){this._finishRelease(),this._releaseStyles=new Map(this._pressedStyles);for(let[t,e]of this._releaseStyles)t.style.width=`${e.baseWidth}px`;this._pressedStyles.clear(),this._releaseTimer=window.setTimeout(this._finishRelease,200)}};this._finishRelease=()=>{this._releaseTimer!==null&&window.clearTimeout(this._releaseTimer),this._releaseTimer=null;for(let[t,e]of this._releaseStyles)t.style.width=e.width;this._releaseStyles.clear()};this.el.Expressive_ButtonGroup=this,this.options={...d.defaults,...e},this._selectionMode&&(this._normalizeSelection(),this.el.addEventListener("click",this._handleClick,!0)),this.el.addEventListener("pointerdown",this._handlePointerDown),this.el.addEventListener("keydown",this._handleKeyDown),this.el.addEventListener("focusout",this._handleFocusOut),document.addEventListener("pointerup",this._resetPress),document.addEventListener("pointercancel",this._resetPress),document.addEventListener("keyup",this._handleKeyUp),window.addEventListener("blur",this._resetPress)}static get defaults(){return oe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ButtonGroup}destroy(){this._resetPress(),this._finishRelease(),this.el.removeEventListener("click",this._handleClick,!0),this.el.removeEventListener("pointerdown",this._handlePointerDown),this.el.removeEventListener("keydown",this._handleKeyDown),this.el.removeEventListener("focusout",this._handleFocusOut),document.removeEventListener("pointerup",this._resetPress),document.removeEventListener("pointercancel",this._resetPress),document.removeEventListener("keyup",this._handleKeyUp),window.removeEventListener("blur",this._resetPress);for(let[t,e]of this._originalPressed)e===null?t.removeAttribute("aria-pressed"):t.setAttribute("aria-pressed",e);this._originalPressed.clear(),this.el.Expressive_ButtonGroup=void 0}get _selectionMode(){let t=this.el.dataset.selection;return ae.has(t)?t:null}get _items(){return Array.from(this.el.children).filter(t=>t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement&&t.classList.contains("button"))}get _toggleItems(){return this._items.filter(t=>t instanceof HTMLButtonElement)}_normalizeSelection(){let t=this._toggleItems;t.forEach(e=>{this._rememberPressed(e),["true","false"].includes(e.getAttribute("aria-pressed")||"")||e.setAttribute("aria-pressed","false")}),this._selectionMode==="single"&&t.filter(i=>i.getAttribute("aria-pressed")==="true").slice(1).forEach(i=>i.setAttribute("aria-pressed","false")),this.el.hasAttribute("data-selection-required")&&!t.some(e=>e.getAttribute("aria-pressed")==="true")&&t.find(e=>!this._isDisabled(e))?.setAttribute("aria-pressed","true")}_itemFromEvent(t){if(!(t.target instanceof Element))return null;let e=t.target.closest("button, a.button");return e instanceof HTMLElement&&e.parentElement===this.el?e:null}_isDisabled(t){return t instanceof HTMLButtonElement&&t.disabled||t.getAttribute("aria-disabled")==="true"||t.classList.contains("disabled")}_rememberPressed(t){this._originalPressed.has(t)||this._originalPressed.set(t,t.getAttribute("aria-pressed"))}_startPress(t){if(this._activeItem)return;this._finishRelease();let e=this._items,i=e.indexOf(t);if(i<0||(this._activeItem=t,t.classList.add(Ct),this.el.classList.contains("connected")||e.length<2))return;let s=e.map(m=>m.getBoundingClientRect()),n=s[i].width;if(n<=0)return;let a=Number.parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-button-group-pressed-item-width-multiplier")),h=Number.isFinite(a)?a:.15,c=n*h,l=[i-1,i+1].filter(m=>m>=0&&m<e.length),r=new Map;if(l.length===1){let m=l[0];r.set(m,Math.min(c,this._compressionCapacity(e[m],s[m])))}else{let m=c/2;for(let E of l)r.set(E,Math.min(m,this._compressionCapacity(e[E],s[E])));let v=c-[...r.values()].reduce((E,b)=>E+b,0);for(let E of l){if(v<=0)break;let b=this._compressionCapacity(e[E],s[E])-r.get(E),y=Math.min(v,b);r.set(E,r.get(E)+y),v-=y}}let p=[...r.values()].reduce((m,v)=>m+v,0);p<=0||(e.forEach((m,v)=>{this._pressedStyles.set(m,{width:m.style.width,baseWidth:s[v].width}),m.style.width=`${s[v].width}px`}),this.el.offsetWidth,e.forEach((m,v)=>{let E=v===i?p:-(r.get(v)||0);m.style.width=`${s[v].width+E}px`}))}_compressionCapacity(t,e){let i=t.classList.contains("icon-button")?e.width*(1-re):e.height;return Math.max(0,e.width-i)}};var le={duration:200,fullWidth:!1,indicators:!1,noWrap:!1,interval:0,height:null,onCycleTo:null,i18n:{carousel:"Carousel",item:"Item",of:"of",indicators:"Slides",slide:"Slide"}},x=class x extends _{constructor(t,e){super(t,e,x);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._alignAfterResize=!1;this._trackRaf=null;this._started=!1;this._vertical=!1;this._resizeObserver=null;this._resizeTimeout=null;this._usesWindowResize=!1;this._dragPointerId=null;this._dragStartX=0;this._dragStartY=0;this._dragStartScroll=0;this._suppressClick=!1;this._suppressClickTimeout=null;this._generatedContainerRole=!1;this._generatedContainerLabel=!1;this._generatedContainerDescription=!1;this._generatedWideLayout=!1;this._generatedFixedHeight=!1;this._authoredInlineHeight=null;this._autoAdvanceTimer=null;this._autoAdvances=!1;this._autoPaused=!1;this._hovered=!1;this._focused=!1;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._generatedItemTabIndexes=new Set;this._generatedItemLabels=new Set;this._generatedItemDescriptions=new Set;this._generatedItemSizes=new Set;this._authoredItemSizes=new Set;this._itemA11yOriginal=new Map;this._handleThrottledResize=()=>{!this._started||this._resizeTimeout!==null||(this._handleResize(),this._resizeTimeout=setTimeout(()=>{this._resizeTimeout=null,this._handleResize()},200))};this._handleAutoAdvanceState=t=>{t.type==="mouseenter"?this._hovered=!0:t.type==="mouseleave"?this._hovered=!1:t.type==="focusin"?this._focused=!0:t.type==="focusout"&&(this._focused=this.el.contains(t.relatedTarget)),this._syncAutoAdvance()};this._handleMotionChange=()=>{this._syncAutoAdvance(),this._motion.matches&&this._scrollToIndex(this.center,!1),this._updateParallax()};this._tick=()=>{this._autoAdvanceTimer=null,this._advance(),this._syncAutoAdvance()};this._advance=()=>{let t=this.center+1;if(t<this.count){this.set(t);return}if(this.options.noWrap){this._autoAdvances=!1,this._syncAutoAdvance();return}this.set(0)};this._handleNativeScroll=()=>{this._alignAfterResize=!1,this._finishScroll()};this._handleTrackPointerDown=t=>{this._handleNativeScroll(),!(t.pointerType!=="mouse"||t.button!==0)&&(this.pressed=!0,this.dragged=!1,this._suppressClick=!1,this._dragPointerId=t.pointerId,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._dragStartScroll=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft)};this._handleTrackPointerMove=t=>{if(!this.pressed||t.pointerId!==this._dragPointerId)return;let e=t.clientX-this._dragStartX,i=t.clientY-this._dragStartY,s=this._vertical?i:e,n=this._vertical?e:i;if(!this.dragged){if(Math.abs(s)<6||Math.abs(s)<=Math.abs(n))return;this.dragged=!0,this.el.classList.add("dragging");try{this._scroller.setPointerCapture(t.pointerId)}catch{}}this._vertical?this._scroller.scrollTop=this._dragStartScroll-i:this._scroller.scrollLeft=this._dragStartScroll-e,t.preventDefault()};this._handleTrackPointerUp=t=>{if(!(!this.pressed||t.pointerId!==this._dragPointerId)){this.pressed=!1,this._dragPointerId=null,this.el.classList.remove("dragging");try{this._scroller.releasePointerCapture(t.pointerId)}catch{}this.dragged&&(this._suppressClick=!0,window.clearTimeout(this._suppressClickTimeout),this._suppressClickTimeout=setTimeout(()=>{this._suppressClick=!1},0),this._syncActive(this._nearestIndex(),!0))}};this._handleTrackClick=t=>{this._suppressClick&&(this._suppressClick=!1,t.preventDefault(),t.stopImmediatePropagation())};this._handleTrackDragStart=t=>{t.target.closest("a, img, picture, video")&&t.preventDefault()};this._handleItemResize=t=>{this._alignAfterResize&&!this.pressed&&t.propertyName==="flex-basis"&&this.images.includes(t.target)&&this._scrollToIndex(this.center,!1)};this._handleIndicatorClick=t=>{t.stopPropagation();let e=t.target.closest(".indicator-item");if(!e||!this._indicators.contains(e))return;let i=[...this._indicators.children].indexOf(e);i<0||this._cycleTo(i)};this._handleKeydown=t=>{let e=t.target;if(e.isContentEditable||e.closest("input, textarea, select"))return;let i=getComputedStyle(this._scroller).direction==="rtl",s=this._vertical?t.key==="ArrowDown":t.key===(i?u.keys.ARROW_LEFT:u.keys.ARROW_RIGHT),n=this._vertical?t.key==="ArrowUp":t.key===(i?u.keys.ARROW_RIGHT:u.keys.ARROW_LEFT);t.key==="Home"?(t.preventDefault(),this.set(0),this._focusItem(0)):t.key==="End"?(t.preventDefault(),this.set(this.count-1),this._focusItem(this.count-1)):s?(t.preventDefault(),this.next(),this._focusItem(this.center)):n&&(t.preventDefault(),this.prev(),this._focusItem(this.center))};this._handleTrackScroll=()=>{this.el.classList.contains("scrolling")||this.el.classList.add("scrolling"),window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=setTimeout(()=>this.el.classList.remove("scrolling"),120),this._trackRaf===null&&(this._trackRaf=requestAnimationFrame(()=>{if(this._trackRaf=null,this._updateParallax(),this._ignoreScroll)return;let t=this._nearestIndex();t!==this.center&&this._syncActive(t,this.dragged)}))};this._handleResize=()=>{!this._started||!this.images.length||(this._syncAdaptiveMode(),this._syncLayoutRoles(this.center),this.pressed||this._scrollToIndex(this.center,!1),this._updateParallax())};this._finishScroll=()=>{this._ignoreScroll=!1,clearTimeout(this._scrollEndTimeout),this._scroller.removeEventListener("scrollend",this._handleScrollEnd)};this._handleScrollEnd=()=>{this._nearestIndex()===this.center&&!this.images.some(t=>t.getAnimations().some(e=>e.playState==="running"))&&this._finishScroll()};if(this.el.Expressive_Carousel=this,this.options={...x.defaults,...e},e?.i18n&&(this.options.i18n={...x.defaults.i18n,...e.i18n}),(this.options.fullWidth||this.el.classList.contains("flat"))&&(this.el.classList.add("flat"),this.options.fullWidth=!0),this._vertical=this.el.classList.contains("full-screen"),this.pressed=!1,this.dragged=!1,this.images=this._collectItems(),!this.images.length){console.error("Carousel: no .carousel-item elements to show");return}this.images.forEach(s=>{this._itemA11yOriginal.set(s,{ariaHidden:s.getAttribute("aria-hidden"),tabIndex:s.getAttribute("tabindex")}),s.hasAttribute("data-carousel-size")&&this._authoredItemSizes.add(s)}),this.hasMultipleSlides=this.images.length>1,this.showIndicators=this.options.indicators&&this.hasMultipleSlides,this.count=this.images.length,this._autoAdvances=this.options.interval>0&&this.hasMultipleSlides,this.images.forEach(s=>s.classList.add("carousel-item")),this.options.height!==null&&(this._generatedFixedHeight=!this.el.classList.contains("fixed-height"),this._authoredInlineHeight=this.el.style.getPropertyValue("--carousel-height")||null,this.el.classList.add("fixed-height"),this.el.style.setProperty("--carousel-height",`${this.options.height}px`)),this._wrapTrack(),this._syncAdaptiveMode(),this.showIndicators&&this._setupIndicators(),this._setupAccessibility(),this._setupEventHandlers(),this._started=!0;let i=Math.max(0,this.images.findIndex(s=>s.classList.contains("active")));this.center=i,this._syncActive(i,!1),this._updateParallax(),this._scrollToIndex(i,!1),this._syncAutoAdvance()}get _scroller(){return this._trackEl??this.el}static get defaults(){return le}static init(t,e={}){return super.init(t,e,x)}static getInstance(t){return t.Expressive_Carousel}destroy(){this._started&&this._teardown(),this.el.Expressive_Carousel=void 0}_collectItems(){let t=Array.from(this.el.children).filter(e=>e instanceof HTMLElement&&e.classList.contains("carousel-item"));return t.length?t:Array.from(this.el.children).filter(e=>!(e instanceof HTMLElement)||e.classList.contains("indicators")||e.classList.contains("carousel-fixed-item")?!1:e.tagName!=="NAV")}_setupAccessibility(){this.el.hasAttribute("role")||(this.el.setAttribute("role","region"),this._generatedContainerRole=!0),!this.el.hasAttribute("aria-label")&&!this.el.hasAttribute("aria-labelledby")&&(this.el.setAttribute("aria-label",this.options.i18n.carousel),this._generatedContainerLabel=!0),this.el.hasAttribute("aria-roledescription")||(this.el.setAttribute("aria-roledescription","carousel"),this._generatedContainerDescription=!0);let t='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';this.images.forEach((e,i)=>{if(e.hasAttribute("aria-roledescription")||(e.setAttribute("aria-roledescription","slide"),this._generatedItemDescriptions.add(e)),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")){let s=e.querySelector("img[alt]")?.getAttribute("alt")?.trim(),n=e.textContent?.replace(/\s+/g," ").trim(),a=s||n,h=`${this.options.i18n.item} ${i+1} ${this.options.i18n.of} ${this.count}`;e.setAttribute("aria-label",a?`${a}, ${h}`:h),this._generatedItemLabels.add(e)}!e.matches(t)&&!e.querySelector(t)&&(e.tabIndex=0,this._generatedItemTabIndexes.add(e))})}_setupIndicators(){let t=Array.from(this.el.children).find(e=>e instanceof HTMLElement&&e.classList.contains("indicators"));this._indicators=t??document.createElement("nav"),this._ownIndicators=!t,this._indicators.classList.add("indicators"),this._indicators.setAttribute("aria-label",this.options.i18n.indicators),this._indicators.replaceChildren(),this.images.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.classList.add("indicator-item"),i===0&&(s.classList.add("active"),s.setAttribute("aria-current","true")),s.setAttribute("aria-label",`${this.options.i18n.slide} ${i+1}`),this._indicators.appendChild(s)}),this._ownIndicators&&this.el.appendChild(this._indicators),this.el.querySelector(".carousel-fixed-item")?.classList.add("with-indicators")}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleKeydown),this._motion.addEventListener("change",this._handleMotionChange),this._autoAdvances&&(this.el.addEventListener("mouseenter",this._handleAutoAdvanceState),this.el.addEventListener("mouseleave",this._handleAutoAdvanceState),this.el.addEventListener("focusin",this._handleAutoAdvanceState),this.el.addEventListener("focusout",this._handleAutoAdvanceState),document.addEventListener("visibilitychange",this._handleAutoAdvanceState)),this.showIndicators&&this._indicators&&this._indicators.addEventListener("click",this._handleIndicatorClick),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._handleThrottledResize()),this._resizeObserver.observe(this.el)),this._usesWindowResize=!this._resizeObserver||this.el.classList.contains("full-screen"),this._usesWindowResize&&(x._live.add(this),x._resizeListening||(window.addEventListener("resize",x._onResize,{passive:!0}),x._resizeListening=!0)),this._scroller.addEventListener("scroll",this._handleTrackScroll,{passive:!0}),this._scroller.addEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.addEventListener("wheel",this._handleNativeScroll,{passive:!0}),document.addEventListener("pointermove",this._handleTrackPointerMove),document.addEventListener("pointerup",this._handleTrackPointerUp),document.addEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.addEventListener("click",this._handleTrackClick,!0),this._scroller.addEventListener("dragstart",this._handleTrackDragStart),this._scroller.addEventListener("transitionend",this._handleItemResize)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleKeydown),this._motion.removeEventListener("change",this._handleMotionChange),this.el.removeEventListener("mouseenter",this._handleAutoAdvanceState),this.el.removeEventListener("mouseleave",this._handleAutoAdvanceState),this.el.removeEventListener("focusin",this._handleAutoAdvanceState),this.el.removeEventListener("focusout",this._handleAutoAdvanceState),document.removeEventListener("visibilitychange",this._handleAutoAdvanceState),this._indicators&&this._indicators.removeEventListener("click",this._handleIndicatorClick),this._scroller.removeEventListener("scroll",this._handleTrackScroll),this._scroller.removeEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.removeEventListener("wheel",this._handleNativeScroll),document.removeEventListener("pointermove",this._handleTrackPointerMove),document.removeEventListener("pointerup",this._handleTrackPointerUp),document.removeEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.removeEventListener("click",this._handleTrackClick,!0),this._scroller.removeEventListener("dragstart",this._handleTrackDragStart),this._scroller.removeEventListener("transitionend",this._handleItemResize),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._usesWindowResize&&(x._live.delete(this),x._live.size===0&&x._resizeListening&&(window.removeEventListener("resize",x._onResize),x._resizeListening=!1))}_teardown(){this._started=!1,this._removeEventHandlers(),this._finishScroll(),this._autoAdvances=!1,this._syncAutoAdvance(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),window.clearTimeout(this._suppressClickTimeout),clearTimeout(this._resizeTimeout),this._ownIndicators&&this._indicators?.remove(),this._unwrapTrack(),this.images.forEach(t=>{t.style.removeProperty("--md-comp-carousel-item-parallax"),this._generatedItemLabels.has(t)&&t.removeAttribute("aria-label"),this._generatedItemDescriptions.has(t)&&t.removeAttribute("aria-roledescription"),this._generatedItemSizes.has(t)&&t.removeAttribute("data-carousel-size");let e=this._itemA11yOriginal.get(t);e?.ariaHidden===null?t.removeAttribute("aria-hidden"):e&&t.setAttribute("aria-hidden",e.ariaHidden),e?.tabIndex===null?t.removeAttribute("tabindex"):e&&t.setAttribute("tabindex",e.tabIndex)}),this._generatedContainerRole&&this.el.removeAttribute("role"),this._generatedContainerLabel&&this.el.removeAttribute("aria-label"),this._generatedContainerDescription&&this.el.removeAttribute("aria-roledescription"),this._generatedFixedHeight&&this.el.classList.remove("fixed-height"),this.options.height!==null&&(this._authoredInlineHeight===null?this.el.style.removeProperty("--carousel-height"):this.el.style.setProperty("--carousel-height",this._authoredInlineHeight)),this._generatedWideLayout&&this.el.classList.remove("multi-wide","multi-large","multi-extra-large","full-screen-horizontal")}_syncAutoAdvance(){let t=this._autoAdvances&&!this._autoPaused&&!this._hovered&&!this._focused&&!this._motion.matches&&!document.hidden;t&&this._autoAdvanceTimer===null?this._autoAdvanceTimer=setTimeout(this._tick,this.options.duration+this.options.interval):!t&&this._autoAdvanceTimer!==null&&(clearTimeout(this._autoAdvanceTimer),this._autoAdvanceTimer=null)}_paintIndicators(t){if(!this.showIndicators||!this._indicators)return;let e=(t%this.count+this.count)%this.count;this._indicators.querySelectorAll(".indicator-item").forEach((i,s)=>{let n=s===e;i.classList.toggle("active",n),n?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")})}_syncActive(t,e){let i=this.center;this.center=t,this.images.forEach((n,a)=>n.classList.toggle("active",a===t)),this._paintIndicators(t),this._syncLayoutRoles(t);let s=this.images[t];i!==t&&typeof this.options.onCycleTo=="function"&&this.options.onCycleTo.call(this,s,e),typeof this.oneTimeCallback=="function"&&(this.oneTimeCallback.call(this,s,e),this.oneTimeCallback=null)}_syncLayoutRoles(t){let e=(c,l)=>{this._authoredItemSizes.has(c)||(c.setAttribute("data-carousel-size",l),this._generatedItemSizes.add(c))};if(this.images.forEach(c=>e(c,"large")),this.el.classList.contains("flat")||this.el.classList.contains("uncontained")||this.el.classList.contains("full-screen")&&this._vertical)return;if(this.el.classList.contains("hero")||this.el.classList.contains("full-screen-horizontal")){let c=this.images[t+1];if(c&&e(c,"small"),this.el.classList.contains("center-aligned")){let l=this.images[t-1];l&&e(l,"small")}return}let i=this.el.clientWidth,s=i>=1600?4:i>=1200?3:i>=600?2:1,n=Math.min(s,Math.max(1,this.count-2));this.el.classList.remove("multi-wide","multi-large","multi-extra-large"),n===2?this.el.classList.add("multi-wide"):n===3?this.el.classList.add("multi-large"):n>=4&&this.el.classList.add("multi-extra-large"),this._generatedWideLayout=this._generatedWideLayout||n>1;for(let c=1;c<n;c+=1){let l=this.images[t+c];l&&e(l,"large")}let a=this.images[t+n],h=this.images[t+n+1];a&&e(a,"medium"),h&&e(h,"small")}_syncAdaptiveMode(){if(!this.el.classList.contains("full-screen"))return;let t=window.matchMedia("(orientation: landscape)").matches,e=this.el.clientWidth>=840||t,i=this._vertical;this._vertical=!e,this.el.classList.toggle("full-screen-horizontal",e),this._generatedWideLayout=this._generatedWideLayout||e,this._started&&i!==this._vertical&&this._scroller.scrollTo({left:0,top:0,behavior:"auto"})}_focusItem(t){let e=this.images[t];if(!e)return;((e.matches('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')?e:e.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??e).focus({preventScroll:!0})}_updateParallax(){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){this.images.forEach(s=>s.style.setProperty("--md-comp-carousel-item-parallax","0px"));return}let t=this._scroller.getBoundingClientRect(),e=this._vertical?t.top+t.height/2:t.left+t.width/2,i=Math.max(1,this._vertical?t.height:t.width);this.images.forEach(s=>{let n=s.getBoundingClientRect(),a=this._vertical?n.top+n.height/2:n.left+n.width/2,h=Math.max(-1,Math.min(1,(a-e)/i));s.style.setProperty("--md-comp-carousel-item-parallax",`${h*-24}px`)})}_wrapTrack(){let t=document.createElement("div");t.className="carousel-track",this.images[0].before(t),this.images.forEach(e=>t.appendChild(e)),this._trackEl=t}_unwrapTrack(){this._trackEl&&(this.images.forEach(t=>this.el.insertBefore(t,this._trackEl)),this._trackEl.remove(),this._trackEl=null)}_nearestIndex(){let t=this.el.classList.contains("center-aligned"),e=getComputedStyle(this._scroller),i=!this._vertical&&e.direction==="rtl",s=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,n=this._vertical?this._scroller.clientHeight:this._scroller.clientWidth,a=(this._vertical?this._scroller.scrollHeight:this._scroller.scrollWidth)-n,h=parseFloat(this._vertical?e.paddingBlockStart:e.paddingInlineStart)||0,c=this.center,l=1/0;return this.images.forEach((r,p)=>{let m=this._vertical?r.offsetTop:r.offsetLeft,v=this._vertical?r.offsetHeight:r.offsetWidth,E=t?m-(n-v)/2:m+(i?v-n+h:-h),b=Math.max(i?-a:0,Math.min(i?0:a,E)),y=Math.abs(b-s);(y<l||y===l&&p===this.center)&&(l=y,c=p)}),c}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;this._finishScroll();let s=this.el.classList.contains("center-aligned"),n=getComputedStyle(this._scroller),a=Number.parseFloat(n.paddingInlineStart)||0,h=Number.parseFloat(n.paddingBlockStart)||0,c=s?i.offsetLeft-(this._scroller.clientWidth-i.offsetWidth)/2:n.direction==="rtl"?i.offsetLeft+i.offsetWidth-this._scroller.clientWidth+a:i.offsetLeft-a,l=i.offsetTop-h;this._ignoreScroll=!0,this._scroller.scrollTo({left:this._vertical?0:c,top:this._vertical?l:0,behavior:e&&!this._motion.matches?"smooth":"instant"}),this._scroller.addEventListener("scrollend",this._handleScrollEnd),this._scrollEndTimeout=setTimeout(this._finishScroll,this.options.duration+350)}_cycleTo(t,e=null){this._alignAfterResize=!0,typeof e=="function"&&(this.oneTimeCallback=e),this._syncActive(t,!1),this._scrollToIndex(t)}pause(){this._autoPaused=!0,this._syncAutoAdvance()}start(){this._autoPaused=!1,this._syncAutoAdvance()}next(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center+t;e>=this.count||e<0||this._cycleTo(e)}prev(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center-t;e>=this.count||e<0||this._cycleTo(e)}set(t,e){(t===void 0||isNaN(t))&&(t=0),!(t>=this.count||t<0)&&this._cycleTo(t,e)}};x._live=new Set,x._resizeListening=!1,x._onResize=u.throttle(()=>{x._live.forEach(t=>t._handleResize())},200);var F=x;var he=Object.freeze({}),lt=class d extends _{constructor(t,e){super(t,{},d);this.updateCounter=()=>{let t=parseInt(this.el.getAttribute("maxlength")),e=this.el.value.length;this.isValidLength=e<=t;let i=e.toString();t&&(i+="/"+t,this._validateInput()),this.counterEl.textContent=i};this.el.Expressive_CharacterCounter=this,this.options={...d.defaults,...e},this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers()}static get defaults(){return he}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_CharacterCounter}destroy(){this._removeEventHandlers(),this.el.Expressive_CharacterCounter=void 0,this._removeCounter()}_setupEventHandlers(){this.el.addEventListener("focus",this.updateCounter,!0),this.el.addEventListener("input",this.updateCounter,!0)}_removeEventHandlers(){this.el.removeEventListener("focus",this.updateCounter,!0),this.el.removeEventListener("input",this.updateCounter,!0)}_setupCounter(){this.counterEl=document.createElement("span"),this.counterEl.classList.add("character-counter"),this.counterEl.setAttribute("aria-live","polite"),this.counterEl.setAttribute("aria-atomic","true"),this.counterEl.style.float="right",this.counterEl.style.fontSize="12px",this.counterEl.style.height="1",this.el.parentElement.appendChild(this.counterEl)}_removeCounter(){this.counterEl.remove()}_validateInput(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.el.classList.remove("invalid")):!this.isValidLength&&!this.isInvalid&&(this.isInvalid=!0,this.el.classList.remove("valid"),this.el.classList.add("invalid"))}};var ce={classes:"",menuOptions:{}},k=class d extends _{constructor(t,e){super(t,e,d);this._originalLabels=new Map;this._validationMessage=null;this._handleSelectChange=()=>{this._setValueToInput(),this._setSelectedStates(),this._syncValidationError()};this._handleInvalid=t=>{t.defaultPrevented||(this._validationMessage||(this._validationMessage=document.createElement("small"),this._validationMessage.id=this.input.id+"-error",this._validationMessage.className="supporting-text",this._validationMessage.style.color="var(--md-sys-color-error)",this.wrapper.append(this._validationMessage),this.input.setAttribute("aria-describedby",[this.input.getAttribute("aria-describedby"),this._validationMessage.id].filter(Boolean).join(" "))),this.input.ariaInvalid="true",this._syncValidationError())};this._handleNativeFocus=()=>queueMicrotask(()=>{d.getInstance(this.el)===this&&this.el.matches(":focus")&&this.input.focus()});this._handleReset=t=>{clearTimeout(this._resetTimer),this._resetTimer=setTimeout(()=>{t.defaultPrevented||(this._handleSelectChange(),this._clearValidationError())},0)};this._handleOptionKeydown=t=>{(t.key===" "||t.key==="Enter")&&this._handleOptionClick(t)};this._handleOptionClick=t=>{t.preventDefault();let e=t.target.closest("li");this._selectOptionElement(e),t.stopPropagation()};this._handleOptionFocus=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest('li[role="option"]');i?.id&&this.input.setAttribute("aria-activedescendant",i.id)};this._handleInputClick=()=>{this.menu&&this.menu.isOpen&&(this._setValueToInput(),this._setSelectedStates())};!this.el.classList.contains("browser-default")&&(this.el.Expressive_FormSelect=this,this.options={...d.defaults,...e},this.isMultiple=this.el.multiple,this.nativeTabIndex=this.el.tabIndex??-1,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._setupMenu(),this._setupEventHandlers())}static get defaults(){return ce}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FormSelect}destroy(){this._removeEventHandlers(),this._clearValidationError(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,this.el.Expressive_FormSelect=void 0}refresh(){if(!this.menuEl)return;this._bindForm();let t=this.menuEl.getRootNode(),e=this._values.find(i=>i.optionEl.contains(t.activeElement))?.el;this.input.disabled=this.el.matches(":disabled"),this.wrapper.classList.toggle("disabled",this.input.disabled),this.input.disabled?this.menu?.close():this.menu||this._initMenu(),this.input.removeAttribute("aria-activedescendant"),this._rebuildOptions(),this._handleSelectChange(),this.menu&&(this.menu.focusedIndex=-1),this.menu?.isOpen&&(this.menu.recalculateDimensions(),e&&(this._values.find(i=>i.el===e)?.optionEl??this.input).focus())}_setupEventHandlers(){this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange),this.el.addEventListener("invalid",this._handleInvalid),this.el.addEventListener("focus",this._handleNativeFocus),this.input.addEventListener("click",this._handleInputClick),this.menuEl.addEventListener("focusin",this._handleOptionFocus),this._bindForm()}_bindForm(){this._form?.removeEventListener("reset",this._handleReset),this._form=this.el.form,this._form?.addEventListener("reset",this._handleReset)}_removeEventHandlers(){this._removeOptionHandlers(),this.el.removeEventListener("change",this._handleSelectChange),this.el.removeEventListener("invalid",this._handleInvalid),this.el.removeEventListener("focus",this._handleNativeFocus),this.input?.removeEventListener("click",this._handleInputClick),this.menuEl?.removeEventListener("focusin",this._handleOptionFocus),this._form?.removeEventListener("reset",this._handleReset),clearTimeout(this._resetTimer)}_setupOptionHandlers(){this.menuEl.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.addEventListener("click",this._handleOptionClick),t.addEventListener("keydown",this._handleOptionKeydown)})}_removeOptionHandlers(){this.menuEl?.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.removeEventListener("click",this._handleOptionClick),t.removeEventListener("keydown",this._handleOptionKeydown)})}_syncValidationError(){this._validationMessage&&(this.el.willValidate&&!this.el.validity.valid?this._validationMessage.textContent=this.el.validationMessage:this._clearValidationError())}_clearValidationError(){if(!this._validationMessage)return;let t=this.input.getAttribute("aria-describedby")?.split(/\s+/).filter(e=>e!==this._validationMessage.id).join(" ");t?this.input.setAttribute("aria-describedby",t):this.input.removeAttribute("aria-describedby"),this.input.ariaInvalid=this.el.ariaInvalid,this._validationMessage.remove(),this._validationMessage=null}_arraysEqual(t,e){if(t===e)return!0;if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}_selectOptionElement(t){if(!this.el.matches(":disabled")){if(!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(a=>a.optionEl===t);if(!e||e.el.matches(":disabled"))return;let i=this.getSelectedValues();this.isMultiple?this._toggleEntryFromArray(e):(this._deselectAll(),this._selectValue(e)),this._handleSelectChange();let s=this.getSelectedValues();!this._arraysEqual(i,s)&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))}this.isMultiple||this.menu?.close()}}_setupMenu(){this.labelEl=this.el.labels?.[0]??null,Array.from(this.el.labels??[]).forEach(t=>{this._originalLabels.set(t,{for:t.getAttribute("for"),id:t.getAttribute("id")})}),this.labelEl&&!this.el.closest("label")&&(this._labelPlaceholder=document.createComment(""),this.labelEl.before(this._labelPlaceholder)),this._setupWrapper(),this._hideNativeSelect(),this.el.matches(":disabled")&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement("menu"),this.menuEl.id=`select-options-${u.guid()}`,this.menuEl.setAttribute("popover","auto"),this.menuEl.setAttribute("role","listbox"),this.menuEl.ariaMultiSelectable=this.isMultiple.toString(),this.isMultiple&&this.menuEl.classList.add("multiple-select-menu"),this._buildOptions(),this.wrapper.append(this.menuEl),this._buildInput(),this._buildCaret(),this._initMenu(),this._setSelectedStates(),this._labelPlaceholder&&this.input.after(this.labelEl)}_setupWrapper(){let t=this.el.parentElement;t&&t.matches(".field")&&!t.querySelector(":scope > .hide-select")&&!t.querySelector(":scope > input, :scope > textarea")?(this.wrapper=t,this._createdWrapper=!1):(this.wrapper=document.createElement("div"),this.wrapper.classList.add("field"),this._createdWrapper=!0,this.el.before(this.wrapper)),this.options.classes.length>0&&this.wrapper.classList.add(...this.options.classes.split(" ").filter(Boolean))}_hideNativeSelect(){let t=document.createElement("div");t.classList.add("hide-select"),t.ariaHidden="true",this.el.before(t),t.appendChild(this.el),this._createdWrapper&&this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+u.guid(),this.input.classList.add("menu-trigger","no-autoinit"),this.input.type="text",this.input.readOnly=!0,this.input.setAttribute("data-target",this.menuEl.id),this.input.ariaReadOnly="true",this.input.ariaRequired=this.el.hasAttribute("required").toString(),this.input.disabled=this.el.matches(":disabled"),this.input.setAttribute("tabindex",this.nativeTabIndex.toString());let t=this.el.attributes;for(let e=0;e<t.length;++e){let i=t[e];i.name.startsWith("aria-")&&this.input.setAttribute(i.name,i.value)}this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","listbox"),this.input.ariaExpanded="false",this.input.setAttribute("aria-controls",this.menuEl.id),this.input.placeholder=" ",this._originalLabels.forEach((e,i)=>{i.htmlFor=this.input.id}),this._labelPlaceholder&&this._originalLabels.size>1&&!this.input.getAttribute("aria-label")&&!this.input.getAttribute("aria-labelledby")&&this.input.setAttribute("aria-labelledby",Array.from(this._originalLabels.keys(),(e,i)=>(e.id||(e.id=`${this.input.id}-label-${i}`),e.id)).join(" ")),this.wrapper.prepend(this.input),this._setValueToInput()}_buildCaret(){let t=document.createElement("span");t.classList.add("caret"),t.setAttribute("aria-hidden","true"),this.wrapper.prepend(t)}_initMenu(){if(this.el.matches(":disabled"))return;let t={...this.options.menuOptions};t.coverTrigger=!1;let e=t.onOpenEnd,i=t.onCloseEnd;t.onOpenEnd=()=>{let s=this.menuEl.querySelector(".selected");if(s){if(this.menu.focusedIndex=[...s.parentNode.children].indexOf(s),this.menu._focusFocusedItem(),this.menu.isScrollable){let n=s.getBoundingClientRect().top-this.menuEl.getBoundingClientRect().top;n-=this.menuEl.clientHeight/2,this.menuEl.scrollTop=n}s.id&&this.input.setAttribute("aria-activedescendant",s.id)}this.input.ariaExpanded="true",e&&typeof e=="function"&&e.call(this.menu,this.el)},t.onCloseEnd=()=>{this.input.ariaExpanded="false",this.input.removeAttribute("aria-activedescendant"),i&&typeof i=="function"&&i.call(this.menu,this.el)},t.closeOnClick=!1,this.menu=H.init(this.input,t)}_nativeOptions(){return Array.from(this.el.children).filter(t=>["OPTION","OPTGROUP"].includes(t.tagName))}_buildOptions(){this.selectOptions=this._nativeOptions(),this._values=[],this.selectOptions.forEach(t=>{if(t.tagName==="OPTION"){let e=this._createAndAppendOptionWithIcon(t,this.isMultiple?"multiple":void 0);this._addOptionToValues(t,e)}else if(t.tagName==="OPTGROUP"){let e="opt-group-"+u.guid(),i=document.createElement("li");i.classList.add("optgroup"),i.tabIndex=-1,i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e);let s=document.createElement("span");s.id=e,s.setAttribute("role","presentation"),s.textContent=t.getAttribute("label")??"",i.replaceChildren(s),this.menuEl.append(i);let n=[];Array.from(t.children).filter(h=>h.tagName==="OPTION").forEach(h=>{let c=this._createAndAppendOptionWithIcon(h,"optgroup-option");n.push(c.id),this._addOptionToValues(h,c)}),i.setAttribute("aria-owns",n.join(" "))}})}_rebuildOptions(){this._removeOptionHandlers(),this.menuEl.replaceChildren(),this._buildOptions(),this._setupOptionHandlers(),this.menu?._makeMenuFocusable()}_addOptionToValues(t,e){this._values.push({el:t,optionEl:e})}_removeMenu(){this.wrapper?.querySelector(":scope > .caret")?.remove(),this.input?.remove(),this.menuEl?.remove();let t=this.el.parentElement;t?.classList.contains("hide-select")&&t.replaceWith(this.el),this._originalLabels.forEach((e,i)=>{for(let s of["for","id"])e[s]===null?i.removeAttribute(s):i.setAttribute(s,e[s])}),this._labelPlaceholder?.replaceWith(this.labelEl),this.wrapper&&(this._createdWrapper?this.wrapper.replaceWith(this.el):(this.wrapper.classList.remove("disabled"),this.options.classes.length>0&&this.wrapper.classList.remove(...this.options.classes.split(" ").filter(Boolean))))}_createAndAppendOptionWithIcon(t,e){let i=document.createElement("li");i.id="select-option-"+u.guid(),i.setAttribute("role","option"),i.tabIndex=0;let s=this.el.matches(":disabled")||t.matches(":disabled");s&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let n=t.textContent,a=document.createElement("span");if(this.isMultiple&&!s){let r=document.createElement("label"),p=document.createElement("input");p.type="checkbox",p.tabIndex=-1;let m=document.createElement("span");m.textContent=n,r.append(p,m),a.appendChild(r)}else a.textContent=n;i.appendChild(a);let h=t.getAttribute("data-icon"),c;if(h)try{let r=new URL(h,this.el.ownerDocument.baseURI);(["http:","https:","blob:"].includes(r.protocol)||/^data:image\/(?:avif|bmp|gif|jpeg|png|svg\+xml|webp|x-icon)(?:;|,)/i.test(r.href))&&(c=r)}catch{}let l=t.getAttribute("class")?.split(" ").filter(Boolean);if(c){let r=document.createElement("img");l?.length&&r.classList.add(...l),r.src=c.href,r.ariaHidden="true",i.prepend(r)}return this.menuEl.append(i),i}_selectValue(t){t.el.selected=!0,t.optionEl.classList.add("selected"),t.optionEl.ariaSelected="true";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!0)}_deselectValue(t){t.el.selected=!1,t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!1)}_deselectAll(){this._values.forEach(t=>this._deselectValue(t))}_isValueSelected(t){return t.el.selected}_toggleEntryFromArray(t){this._isValueSelected(t)?this._deselectValue(t):this._selectValue(t)}_getSelectedOptions(){return Array.prototype.filter.call(this.el.selectedOptions,t=>t)}_setValueToInput(){this.input.value=this._getSelectedOptions().map(t=>t.textContent.trim()).join(", ")}_setSelectedStates(){this._values.forEach(t=>{let e=t.el.selected,i=t.optionEl.querySelector('input[type="checkbox"]');i&&(i.checked=e),e?this._activateOption(this.menuEl,t.optionEl):(t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false")})}_activateOption(t,e){e&&(this.isMultiple||t.querySelectorAll("li.selected").forEach(i=>i.classList.remove("selected")),e.classList.add("selected"),e.ariaSelected="true")}getSelectedValues(){return this._getSelectedOptions().map(t=>t.value)}};var de={margin:5,transition:10,duration:250,align:"left"},X=class d{constructor(o,t,e){this._handleDocumentClick=o=>{this.visible&&!o.composedPath().includes(this.el)&&!o.composedPath().includes(this.container)&&this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{if(this.visible)return;this.visible=!0;let o=u._setAbsolutePosition(this.el,this.container,"bottom",this.options.margin,this.options.transition,this.options.align);this.container.style.visibility="visible",this.container.style.transition=`
|
|
5
|
+
</svg></div>`,H._loadingTemplate=t.content.firstElementChild}return H._loadingTemplate.cloneNode(!0)}destroy(){this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._removeEventHandlers(),this.menu.destroy(),this.isOpen=!1,this._removeMenu(),this._statusInfo.remove(),this._announcer.remove(),this.el.Expressive_Autocomplete=void 0}_setupEventHandlers(){this.el.addEventListener("blur",this._handleInputBlur),this.el.addEventListener("input",this._handleInput),this.el.addEventListener("keyup",this._handleInputKeyup),this.el.addEventListener("focus",this._handleInputFocus),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("click",this._handleInputClick),this.container.addEventListener("pointerdown",this._handleContainerPointerDown),this.container.addEventListener("pointerup",this._handleContainerPointerUp),this.container.addEventListener("pointercancel",this._handleContainerPointerUp)}_removeEventHandlers(){this.el.removeEventListener("blur",this._handleInputBlur),this.el.removeEventListener("input",this._handleInput),this.el.removeEventListener("keyup",this._handleInputKeyup),this.el.removeEventListener("focus",this._handleInputFocus),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("click",this._handleInputClick),this.container.removeEventListener("pointerdown",this._handleContainerPointerDown),this.container.removeEventListener("pointerup",this._handleContainerPointerUp),this.container.removeEventListener("pointercancel",this._handleContainerPointerUp)}_setupMenu(){this.container=document.createElement("menu"),this.container.style.maxHeight=this.options.maxMenuHeight,this.container.id=`autocomplete-options-${p.guid()}`,this.container.classList.add("autocomplete-content"),this.container.ariaExpanded="true",this.container.setAttribute("role","listbox"),this.el.setAttribute("role","combobox"),this.el.setAttribute("aria-autocomplete","list"),this.el.setAttribute("aria-controls",this.container.id),this.el.setAttribute("data-target",this.container.id),this.menuItems.forEach(a=>{let c=this._createMenuItem(a);this.container.append(c)}),this.el.parentElement.appendChild(this.container);let t={...H.defaults.menuOptions,...this.options.menuOptions},e=t.onOpenStart,i=t.onCloseStart;t.onOpenStart=a=>{this.isOpen=!0,typeof e=="function"&&e.call(this.menu,a)},t.onCloseStart=a=>{this.isOpen=!1,typeof i=="function"&&i.call(this.menu,a)};let s=t.onItemClick;t.onItemClick=a=>{if(!a)return;let c=a.getAttribute("data-id");this.selectOption(c),typeof s=="function"&&s.call(this.menu,a)},this.menu=F.init(this.el,t),this.el.setAttribute("aria-haspopup","listbox");let o=this.el.parentElement.querySelector("label");o&&this.el.after(o),this.el.removeEventListener("click",this.menu._handleClick),this.options.isMultiSelect||this._refreshInputText(),this.el.value&&this.selectOption(this.el.value);let r=document.createElement("div");r.classList.add("status-info"),r.setAttribute("aria-hidden","true"),r.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(r),this._statusInfo=r,this._announcer=document.createElement("div"),this._announcer.classList.add("autocomplete-status"),this._announcer.setAttribute("role","status"),this._announcer.setAttribute("aria-live","polite"),this._announcer.setAttribute("aria-atomic","true"),this.el.parentElement.appendChild(this._announcer),this._updateSelectedInfo()}_removeMenu(){this.container.ariaExpanded="false",this.container.parentNode.removeChild(this.container)}_resetCurrentElementPosition(){this.activeIndex=-1,this._setActive(null)}_resetAutocomplete(){this.container.replaceChildren(),this._resetCurrentElementPosition(),this.oldVal=null,this._pointerDown=!1}_highlightPartialText(t,e){let i=e.toLocaleLowerCase().indexOf(""+t.toLocaleLowerCase()),s=i+t.length-1;return i==-1||s==-1?[e,"",""]:[e.slice(0,i),e.slice(i,s+1),e.slice(s+1)]}_createMenuItem(t){let e=document.createElement("li");e.id=`autocomplete-option-${p.guid()}`,e.setAttribute("role","option");let i=this.selectedValues.some(l=>l.id===t.id);if(e.setAttribute("aria-selected",i?"true":"false"),e.setAttribute("data-id",t.id),e.setAttribute("style","display:grid; grid-auto-flow: column; user-select: none; align-items: center;"),e.tabIndex=-1,this.options.isMultiSelect){let l=document.createElement("div");l.classList.add("item-selection"),l.style.textAlign="center";let u=document.createElement("input");u.type="checkbox",u.tabIndex=-1,u.checked=i;let f=document.createElement("span");f.style.paddingLeft="21px",l.append(u,f),e.appendChild(l)}if(t.image){let l=document.createElement("img");l.classList.add("circle"),l.src=t.image,e.appendChild(l)}let s=this.el.value.toLocaleLowerCase(),o=(t.text||t.id).toString(),r=this._highlightPartialText(s,o),a=document.createElement("div");if(a.setAttribute("style","line-height:1.2;font-weight:500;"),this.options.allowUnsafeHTML){a.innerHTML=o;let l=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);for(let u=l.nextNode();u;u=l.nextNode()){let[f,m]=this._highlightPartialText(s,u.data);if(!m)continue;let v=u.splitText(f.length);v.splitText(m.length);let g=document.createElement("span");g.classList.add("highlight"),v.replaceWith(g),g.append(v);break}}else if(a.appendChild(document.createTextNode(r[0])),r[1]){let l=document.createElement("span");l.textContent=r[1],l.classList.add("highlight"),a.appendChild(l),a.appendChild(document.createTextNode(r[2]))}let c=document.createElement("div");if(c.classList.add("item-text"),c.setAttribute("style","padding:5px;overflow:hidden;"),e.appendChild(c),e.querySelector(".item-text").appendChild(a),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let l=document.createElement("small");l.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),l.innerText=t.description,e.querySelector(".item-text").appendChild(l)}let h=()=>this.options.isMultiSelect?t.image?"40px min-content auto":"40px auto":t.image?"min-content auto":"auto";return e.style.gridTemplateColumns=h(),e}_renderMenu(){this._resetAutocomplete(),this.menuItems.length===0&&(this.menuItems=this.selectedValues);for(let t=0;t<this.menuItems.length;t++){let e=this._createMenuItem(this.menuItems[t]);this.container.append(e)}}_setStatusLoading(){let t=this._statusInfo;t&&t.replaceChildren(H._loadingIndicator()),this._announce(this.options.i18n.loading)}_announce(t){if(!this._announcer)return;let e=this.el.matches(":focus")&&this.el.value.length>=this.options.minLength?t:"";this._announcer.textContent!==e&&(this._announcer.textContent=e)}_updateSelectedInfo(){let t=this._statusInfo;t&&(this.options.isMultiSelect?t.textContent=this.selectedValues.length.toString():t.replaceChildren())}_refreshInputText(){if(this.selectedValues.length===1){let t=this.selectedValues[0];this.el.value=t.text||t.id}}_triggerChanged(){this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0})),typeof this.options.onAutocomplete=="function"&&this.options.onAutocomplete.call(this,this.selectedValues)}setMenuItems(t,e=null,i=!0){if(this.el.Expressive_Autocomplete!==this)return;let s=t.length;this.menuItems=t,this.options.data=t,e&&(this.selectedValues=this.menuItems.filter(o=>e.indexOf(o.id)!==-1)),this.options.isMultiSelect?i||this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._announce(i?s?this.options.i18n.results(s):this.options.i18n.noResults:""),this._triggerChanged()}selectOption(t){let e=this.menuItems.find(i=>i.id==t);e&&(this.options.isMultiSelect?(this.selectedValues.filter(i=>i.id===e.id).length>=1?this.selectedValues=this.selectedValues.filter(i=>i.id!==e.id):this.selectedValues.push(e),this._renderMenu(),this.el.focus()):(this.selectedValues=[e],this._refreshInputText(),this._resetAutocomplete(),this.close()),this._updateSelectedInfo(),this.options.isMultiSelect&&this._announce(this.options.i18n.selected(this.selectedValues.length)),this._triggerChanged())}};H._loadingTemplate=null;var $=H;var Ne={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-symbols",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,allowUserInput:!1,i18n:{remove:"Remove"},onChipAdd:null,onChipSelect:null,onChipDelete:null},k=class k extends b{constructor(t,e){super(t,e,k);this._handleChipClick=t=>{let e=t.target.closest(".chip"),i=!!t.target.closest(".close");if(e){let s=this._chips.indexOf(e);if(s<0)return;i?this._deleteChip(s,"input"):this.selectChip(s)}else this._input.focus()};this._handleInputFocus=()=>{this.el.classList.add("focus")};this._handleInputBlur=()=>{this.el.classList.remove("focus")};this._handleInputKeydown=t=>{if(k._keydown=!0,t.key===p.keys.ENTER){if(this.hasAutocomplete&&this.autocomplete?.isOpen&&this.autocomplete.container.querySelector('[role="option"]'))return;t.preventDefault(),(!this.hasAutocomplete||this.hasAutocomplete&&!this.options.autocompleteOnly)&&this.addChip({id:this._input.value}),this._input.value=""}else(t.key===p.keys.BACKSPACE||t.key===p.keys.ARROW_LEFT)&&this._input.value===""&&this.chipsData.length&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))};this.el.Expressive_Chips=this,this.options={...k.defaults,...e},e?.i18n&&(this.options.i18n={...k.defaults.i18n,...e.i18n}),this.el.classList.add("chips"),this.chipsData=[],this._chips=[],this.options.data.length&&(this.chipsData=this.options.data,this._renderChips()),this.options.allowUserInput&&(this.el.classList.add("field"),this._setupInput(),this._setupEventHandlers(),this.el.append(this._input)),this._setupLabel()}_setSelected(t){this._selectedChip?.classList.remove("selected"),this._selectedChip=t,t?.classList.add("selected")}static get defaults(){return Ne}static init(t,e={}){return super.init(t,e,k)}static getInstance(t){return t.Expressive_Chips}getData(){return this.chipsData}destroy(){this.autocomplete&&$.getInstance(this._input)===this.autocomplete&&this.autocomplete.destroy(),this.options.allowUserInput&&this._removeEventHandlers(),this._chips.forEach(t=>t.remove()),this._chips=[],this.el.Expressive_Chips=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleChipClick),this.el.addEventListener("keydown",k._handleChipsKeydown),this.el.addEventListener("keyup",k._handleChipsKeyup),this.el.addEventListener("blur",k._handleChipsBlur,!0),this._input.addEventListener("focus",this._handleInputFocus),this._input.addEventListener("blur",this._handleInputBlur),this._input.addEventListener("keydown",this._handleInputKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleChipClick),this.el.removeEventListener("keydown",k._handleChipsKeydown),this.el.removeEventListener("keyup",k._handleChipsKeyup),this.el.removeEventListener("blur",k._handleChipsBlur,!0),this._input.removeEventListener("focus",this._handleInputFocus),this._input.removeEventListener("blur",this._handleInputBlur),this._input.removeEventListener("keydown",this._handleInputKeydown)}static _handleChipsKeydown(t){k._keydown=!0;let e=t.target.closest(".chips"),i=t.target&&e,s=t.target.tagName;if(s==="INPUT"||s==="TEXTAREA"||!i)return;let o=e.Expressive_Chips;if(o){if(t.key===p.keys.BACKSPACE||t.key===p.keys.DELETE){let r=o._chips.indexOf(t.target.closest(".chip"));if(r<0)return;t.preventDefault(),o._deleteChip(r,"previous")}else if(t.key===p.keys.ARROW_LEFT){if(o._selectedChip){let r=o._chips.indexOf(o._selectedChip)-1;if(r<0)return;o.selectChip(r)}}else if(t.key===p.keys.ARROW_RIGHT&&o._selectedChip){let r=o._chips.indexOf(o._selectedChip)+1;r>=o.chipsData.length?(o._setSelected(null),o._input.focus()):o.selectChip(r)}}}static _handleChipsKeyup(){k._keydown=!1}static _handleChipsBlur(t){if(!k._keydown&&document.hidden){let i=t.target.closest(".chips")?.Expressive_Chips;i&&i._setSelected(null)}}_renderChip(t){if(!t.id&&t.id!==0)return;let e=t.text||t.id,i=document.createElement("span");if(i.classList.add("chip"),i.innerText=e,t.image){let s=document.createElement("img");s.setAttribute("src",t.image),i.insertBefore(s,i.firstChild)}if(this.options.allowUserInput){let s=document.createElement("button");s.type="button",s.classList.add("close"),s.setAttribute("aria-label",`${this.options.i18n.remove} ${e}`);let o=document.createElement("span");o.classList.add(this.options.closeIconClass),o.setAttribute("aria-hidden","true"),o.innerText="close",s.appendChild(o),i.appendChild(s)}return i}_renderChips(){this._chips=[];for(let t=0;t<this.chipsData.length;t++){let e=this._renderChip(this.chipsData[t]);this.el.appendChild(e),this._chips.push(e)}}_setupAutocomplete(){this.options.autocompleteOptions.onAutocomplete=t=>{k.getInstance(this.el)===this&&t.length>0&&(this.addChip({id:t[0].id,text:t[0].text,image:t[0].image}),this._input.value="",this._input.focus())},this.autocomplete=$.init(this._input,this.options.autocompleteOptions)}_setupInput(){this._input=this.el.querySelector("input"),this._input||(this._input=document.createElement("input"),this.el.append(this._input)),this._input.classList.add("input"),this.hasAutocomplete=Object.keys(this.options.autocompleteOptions).length>0,this.hasAutocomplete&&this._setupAutocomplete(),this._setPlaceholder(),this._input.getAttribute("id")||this._input.setAttribute("id",p.guid())}_setupLabel(){this._label=this.el.querySelector("label"),this._label&&this._input&&this._label.setAttribute("for",this._input.getAttribute("id"))}_setPlaceholder(){this._input&&(this.chipsData!==void 0&&!this.chipsData.length&&this.options.placeholder?this._input.placeholder=this.options.placeholder:(this.chipsData===void 0||this.chipsData.length)&&this.options.secondaryPlaceholder&&(this._input.placeholder=this.options.secondaryPlaceholder))}_isValidAndNotExist(t){let e=!!t.id||t.id===0,i=!this.chipsData.some(s=>s.id==t.id);return e&&i}addChip(t){if(!this._isValidAndNotExist(t)||this.chipsData.length>=this.options.limit)return;let e=this._renderChip(t);this._chips.push(e),this.chipsData.push(t),this._input?this._input.before(e):this.el.append(e),this._setPlaceholder(),typeof this.options.onChipAdd=="function"&&this.options.onChipAdd(this.el,e)}deleteChip(t){let e=this.el.getRootNode();this._deleteChip(t,this._chips[t]?.contains(e.activeElement)?"input":null)}_deleteChip(t,e){let i=this._chips[t];if(!i)return;this._selectedChip===i&&this._setSelected(null),i.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder();let s=[],o=this.el.getRootNode();for(;o;)s.push({root:o,element:o.activeElement}),o="host"in o?o.host.getRootNode():null;typeof this.options.onChipDelete=="function"&&this.options.onChipDelete(this.el,i),!(!e||s.some(({root:r,element:a})=>r.activeElement!==a)||this.el.Expressive_Chips!==this)&&(e==="previous"&&this._chips.length?this.selectChip(Math.max(t-1,0)):(this._setSelected(null),this._input?.focus()))}selectChip(t){let e=this._chips[t];e&&(this._setSelected(e),e.querySelector(".close")?.focus(),typeof this.options.onChipSelect=="function"&&this.options.onChipSelect(this.el,e))}static Init(){p.onDocumentReady(()=>{document.querySelectorAll(".chips").forEach(e=>{e.addEventListener("click",i=>{if(!e.Expressive_Chips&&i.target.closest(".close")){let s=i.target.closest(".chip");s&&s.remove()}})})})}};k._keydown=!1;var U=k;var Fe={},wt=new WeakMap,X=class d extends b{constructor(t,e){super(t,e,d);this._resizeObserver=null;this._handleRangeChange=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0,this.el.classList.add("active"),this._clampDual(),this._sync(),this.thumb.classList.add("active")))};this._handleRangeInput=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerUp=t=>{t.isPrimary&&(this._pointerDown=!1,this.el.classList.remove("active"))};this._handleRangeRelease=()=>{this._pointerDown||this.thumb.classList.remove("active")};this.el.Expressive_Slider=this,this.options={...d.defaults,...e},this._pointerDown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers(),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._sync()),this._resizeObserver.observe(this.el))}static get defaults(){return Fe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Slider}destroy(){this._resizeObserver?.disconnect(),this._removeEventHandlers(),this._removeThumb(),this.el.Expressive_Slider=void 0;let t=this._host();for(let e of[this.el,t]){for(let i in wt.get(e))e.style.setProperty(i,wt.get(e)[i]);wt.delete(e)}t?.querySelectorAll('input[type="range"]').forEach(e=>e.Expressive_Slider?._sync())}_set(t,e,i){let s=wt.get(t)??{};wt.set(t,s),s[e]??(s[e]=t.style.getPropertyValue(e)),t.style.setProperty(e,i)}_setupEventHandlers(){this.el.addEventListener("change",this._handleRangeChange),this.el.addEventListener("pointerdown",this._handleRangePointerDown),this.el.addEventListener("input",this._handleRangeInput),this.el.addEventListener("pointerup",this._handleRangePointerUp),this.el.addEventListener("pointercancel",this._handleRangePointerUp),this.el.addEventListener("blur",this._handleRangeRelease),this.el.addEventListener("mouseout",this._handleRangeRelease)}_removeEventHandlers(){this.el.removeEventListener("change",this._handleRangeChange),this.el.removeEventListener("pointerdown",this._handleRangePointerDown),this.el.removeEventListener("input",this._handleRangeInput),this.el.removeEventListener("pointerup",this._handleRangePointerUp),this.el.removeEventListener("pointercancel",this._handleRangePointerUp),this.el.removeEventListener("blur",this._handleRangeRelease),this.el.removeEventListener("mouseout",this._handleRangeRelease)}_setupThumb(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),this.thumb.classList.add("thumb"),this.value.classList.add("value"),this.thumb.append(this.value),this.el.after(this.thumb)}_removeThumb(){this.thumb.remove()}_isVertical(){return!!this.el.closest(".vertical")}_host(){return this.el.closest(".slider, .range, .range-field, label")}_clampDual(){let e=this._host()?.querySelectorAll('input[type="range"]');if(!e||e.length!==2)return;let i=e[0],s=e[1];this.el===i&&+i.value>+s.value&&(i.value=s.value),this.el===s&&+s.value<+i.value&&(s.value=i.value)}_fraction(t){let e=parseFloat(t.max),i=Number.isNaN(e)?100:e,s=parseFloat(t.min)||0,o=parseFloat(t.value)||0;return i===s?0:(o-s)/(i-s)}_sync(){let t=this._fraction(this.el),e=`${t*100}%`,i=this.el.offsetLeft,s=this.el.offsetTop,o=this.el.offsetWidth,r=this.el.offsetHeight,a=getComputedStyle(this.el),c=a.direction==="rtl",h=this._isVertical(),l=parseFloat(a.getPropertyValue("--md-comp-slider-handle-width"))||4,u=h?r:o,f=l/2+t*(u-l);this._set(this.el,"--md-comp-slider-active-fraction",e),this._set(this.el,"--md-comp-slider-active-position",`${f}px`);let m=this._host(),v=m?.querySelectorAll('input[type="range"]');if(m&&v&&v.length===2){let g=Array.from(v).map(E=>this._fraction(E));this._set(m,"--md-comp-slider-start-fraction",`${Math.min(...g)*100}%`),this._set(m,"--md-comp-slider-end-fraction",`${Math.max(...g)*100}%`),this._set(m,"--md-comp-slider-start-position",`${l/2+Math.min(...g)*(u-l)}px`),this._set(m,"--md-comp-slider-end-position",`${l/2+Math.max(...g)*(u-l)}px`)}if(m?.classList.contains("stops")){let g=parseFloat(this.el.max),E=Number.isNaN(g)?100:g,L=parseFloat(this.el.min)||0,M=parseFloat(this.el.step),T=M>0&&Number.isFinite(M)&&E>L;this._set(m,"--md-comp-slider-stop-count",T?String(Math.floor((E-L)/M+1e-9)+1):""),this._set(m,"--md-comp-slider-stop-spacing",T?`${(u-l)*M/(E-L)}px`:""),v?.length===1&&(this._set(m,"--md-comp-slider-active-position",`${f}px`),this._set(m,"--md-comp-slider-track-center",`${s+r/2}px`))}this.value.textContent=this.el.value,h?(this.thumb.style.left=`${i+o/2}px`,this.thumb.style.top=`${s+r-f}px`):(this.thumb.style.left=`${i+(c?o-f:f)}px`,this.thumb.style.top=`${s}px`)}static Init(){p.onDocumentReady(()=>{d.init(document.querySelectorAll("input[type=range]"),{})})}};var w=class w{static Init(){p.onDocumentReady(()=>{document.addEventListener("pointerdown",w._onPointerDown,{passive:!0}),document.addEventListener("pointerup",w._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",w._onPointerCancel,{passive:!0})})}static _onPointerDown(n){if(!w._isPrimaryPress(n)){w._down=null;return}let t=w._backdropDialog(n);if(!t||!w._lightDismissible(t)||!w._outside(n,t)){w._down=null;return}w._down={dialog:t,pointerId:n.pointerId}}static _onPointerUp(n){let t=w._down;w._down=null,!(!t||t.pointerId!==n.pointerId)&&n.isPrimary&&(!t.dialog.isConnected||!t.dialog.open||w._lightDismissible(t.dialog)&&w._backdropDialog(n)===t.dialog&&w._outside(n,t.dialog)&&t.dialog.close())}static _onPointerCancel(){w._down=null}static _backdropDialog(n){let t=n.target;return!(t instanceof HTMLDialogElement)||!t.open?null:t}static _outside(n,t){let e=t.getBoundingClientRect();return n.clientX<e.left||n.clientX>e.right||n.clientY<e.top||n.clientY>e.bottom}static _isPrimaryPress(n){return n.isPrimary?n.pointerType!=="mouse"||n.button===0:!1}static _lightDismissible(n){let t=w._closedBy(n);return!(t==="none"||t==="closerequest"||t==="any"&&"closedBy"in HTMLDialogElement.prototype)}static _closedBy(n){let t=n.getAttribute("closedby");return t==="any"||t==="closerequest"||t==="none"?t:null}};w._down=null;var Q=w;var jt=96,Xt=.5,We=100,$e=4,Gt=new Set;function kt(d){if(Gt.has(d.selector))return;Gt.add(d.selector);let n=h=>d.axis==="x"?h.clientX:h.clientY,t,e=null,i=h=>{if(!(h instanceof Element))return null;let l=h.closest(d.selector);return l instanceof HTMLDialogElement?l:null},s=h=>{h.style.transition="",h.style.setProperty(d.property,"0px")},o=h=>{if(!h.isPrimary||h.pointerType==="mouse"&&h.button!==0)return;c(),d.onPress?.();let l=i(h.target);if(!l?.open){e=null;return}if(!d.inHandle(h,l)){e=null;return}l.style.transition="none",e={dialog:l,pointerId:h.pointerId,direction:d.direction(l),start:n(h),last:n(h),lastT:Date.now(),velocity:0,shift:0},t.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open"],attributeOldValue:!0})},r=h=>{if(!e||e.pointerId!==h.pointerId)return;if(!e.dialog.open||!e.dialog.isConnected){c();return}let l=n(h)-e.start;if(e.shift=e.direction===1?Math.max(0,l):Math.min(0,l),n(h)!==e.last){let u=Date.now();e.velocity=(n(h)-e.last)/Math.max(1,u-e.lastT),e.last=n(h),e.lastT=u}e.dialog.style.setProperty(d.property,`${e.shift}px`)},a=h=>{let l=e;if(!l||l.pointerId!==h.pointerId)return;if(!l.dialog.open||!l.dialog.isConnected){c();return}r(h),e=null,t.disconnect(),l.dialog.style.transition="";let u=Date.now()-l.lastT<We?l.velocity:0,f=Math.abs(l.shift)>$e;d.onRelease?.(f),f&&(l.direction===1?l.shift>jt||u>Xt:l.shift<-jt||u<-Xt)&&l.dialog.open&&l.dialog.close(),l.dialog.style.setProperty(d.property,"0px")},c=h=>{if(h&&e?.pointerId!==h.pointerId)return;t.disconnect(),d.onRelease?.(!1);let l=e;e=null,l&&s(l.dialog)};p.onDocumentReady(()=>{t=new MutationObserver(h=>{let l=e?.dialog;l&&(!l.open||!l.isConnected||h.some(u=>u.type==="attributes"&&u.target===l&&u.oldValue===null||[...u.removedNodes].some(f=>f.contains(l))))&&c()}),document.addEventListener("pointerdown",o,{passive:!0}),document.addEventListener("pointermove",r,{passive:!0}),document.addEventListener("pointerup",a,{passive:!0}),document.addEventListener("pointercancel",c,{passive:!0})})}var Zt="dialog.bottom-sheet, dialog.bottom",G=class G{static Init(){kt({selector:Zt,axis:"y",property:"--md-comp-bottom-sheet-shift",direction:()=>1,inHandle:(n,t)=>{let e=n.target;if(e instanceof Element&&e.closest(".handle"))return!0;let i=t.getBoundingClientRect();return n.clientY>=i.top&&n.clientY<=i.top+48},onPress:()=>{G._dragged=!1},onRelease:n=>{G._dragged=n}}),p.onDocumentReady(()=>{document.addEventListener("click",G._onClick)})}static _onClick(n){let t=n.target;if(!(t instanceof Element))return;let e=t.closest(".handle, .drag-handle");if(!(e instanceof HTMLButtonElement)||n.detail!==0&&G._dragged)return;let i=e.closest(Zt);i instanceof HTMLDialogElement&&i.open&&i.close()}};G._dragged=!1;var J=G;var Ve=d=>d.classList.contains("left")||d.classList.contains("left-sheet")||d.classList.contains("start"),Qt=d=>Ve(d)!==(getComputedStyle(d).direction==="rtl"),tt=class{static Init(){kt({selector:"dialog.side-sheet, dialog.right, dialog.right-sheet, dialog.left, dialog.left-sheet",axis:"x",property:"--md-comp-side-sheet-shift",direction:n=>Qt(n)?-1:1,inHandle:(n,t)=>{let e=n.target;if(e instanceof Element&&e.closest("header"))return!0;let i=t.getBoundingClientRect();return Qt(t)?n.clientX>=i.right-24&&n.clientX<=i.right:n.clientX>=i.left&&n.clientX<=i.left+24}})}};var O=class O{static validateField(n){if(!n){console.error("No text field element found");return}let t=n.getAttribute("data-length")!==null,e=parseInt(n.getAttribute("data-length")),i=n.value.length;i===0&&n.validity.badInput===!1&&!n.required&&n.classList.contains("validate")?n.classList.remove("invalid"):n.classList.contains("validate")&&(n.validity.valid&&t&&i<=e||n.validity.valid&&!t?n.classList.remove("invalid"):n.classList.add("invalid"))}static textareaAutoResize(n){let t=n;if(!t)return;t.hasAttribute("original-height")||t.setAttribute("original-height",t.getBoundingClientRect().height.toString());let e=parseInt(t.getAttribute("original-height"));if(isNaN(e))return;t.style.height="auto";let i=t.offsetHeight-t.clientHeight,s=t.scrollHeight+i;t.style.height=Math.max(e,s)+"px"}static Init(){O._initialized||(O._initialized=!0,p.onDocumentReady(()=>{document.addEventListener("change",n=>{let t=n.target;if(t instanceof HTMLInputElement&&t.type==="file"){let e=t.closest(".drop-zone");e&&O.listDropZoneFiles(e,t)}t instanceof HTMLInputElement&&O.validateField(t)}),document.addEventListener("keyup",n=>{let t=n.target;t instanceof HTMLInputElement&&["radio","checkbox"].includes(t.type)&&n.key===p.keys.TAB&&(t.classList.add("tabbed"),t.addEventListener("blur",()=>t.classList.remove("tabbed"),{once:!0}))}),document.addEventListener("click",O.togglePassword),document.addEventListener("submit",O.resetFormExtras,!0),document.addEventListener("reset",O.resetFormExtras,!0);for(let n of["dragenter","dragover","dragleave","drop"])document.addEventListener(n,O.markDropZone);document.querySelectorAll(".expressive-textarea").forEach(n=>{O.InitTextarea(n)}),document.querySelectorAll('.file-field input[type="file"]').forEach(n=>{O.InitFileInputPath(n)})}))}static togglePassword(n){let t=n.target.closest?.(".password-toggle"),e=t?.closest(".field")?.querySelector('input[type="password"], input[data-password]');if(!e)return;let i=e.type==="password";e.toggleAttribute("data-password",i),e.type=i?"text":"password",t.setAttribute("aria-pressed",String(i))}static resetFormExtras(n){let t=n.target;t instanceof HTMLFormElement&&(t.querySelectorAll("input[data-password]").forEach(e=>{e.removeAttribute("data-password"),e.type="password",e.closest(".field")?.querySelector(".password-toggle")?.setAttribute("aria-pressed","false")}),n.type==="reset"&&(t.querySelectorAll(".drop-zone-files").forEach(e=>e.replaceChildren()),t.querySelectorAll(".drop-zone.dragover").forEach(e=>e.classList.remove("dragover"))))}static markDropZone(n){let t=n.target;if(!(t instanceof HTMLInputElement)||t.type!=="file")return;let e=t.closest(".drop-zone");if(!e)return;let i=n.type==="dragenter"||n.type==="dragover";e.classList.toggle("dragover",i&&!t.disabled)}static listDropZoneFiles(n,t){let e=n.querySelector(".drop-zone-files");if(!e)return;let i=s=>{let[o,r]=s>=1e6?[s/1e6,"megabyte"]:s>=1e3?[s/1e3,"kilobyte"]:[s,"byte"];return new Intl.NumberFormat(void 0,{style:"unit",unit:r,maximumFractionDigits:1}).format(o)};e.replaceChildren(...Array.from(t.files??[],s=>{let o=document.createElement("li"),r=document.createElement("span"),a=document.createElement("span");return r.textContent=s.name,a.textContent=i(s.size),o.append(r,a),o}))}static InitTextarea(n){n.setAttribute("original-height",n.getBoundingClientRect().height.toString()),O.textareaAutoResize(n),n.addEventListener("input",t=>O.textareaAutoResize(t.target))}static InitFileInputPath(n){n.addEventListener("change",()=>{let e=n.closest(".file-field").querySelector("input.file-path"),i=n.files,s=[];for(let o=0;o<i.length;o++)s.push(i[o].name);e.value=s.join(", "),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))})}};O._initialized=!1;var et=O;var qe={},it=class d extends b{constructor(t,e){super(t,e,d);this._observer=null;this._sentinel=null;this._input=null;this._view=null;this._searchOpen=!1;this._onIntersect=t=>{let e=t[0];e&&this.el.classList.toggle("collapsed",!e.isIntersecting&&e.boundingClientRect.top<this.el.getBoundingClientRect().top)};this._onSearchViewClose=()=>{this._searchOpen=this._view.open};this._onSearchFocus=()=>{if(!(!this._view||this._searchOpen)){if(this._view instanceof HTMLDialogElement){this._searchOpen=!0,this._view.open||this._view.showModal();return}this._view.hidden=!1,this._input?.setAttribute("aria-expanded","true")}};this.el.Expressive_AppBar=this,this.options={...d.defaults,...e},this._setupCollapse(),this._setupSearch()}static get defaults(){return qe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_AppBar}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._input?.removeEventListener("focus",this._onSearchFocus),this._input?.removeEventListener("click",this._onSearchFocus),this._view?.removeEventListener("close",this._onSearchViewClose),this.el.classList.remove("collapsed"),this.el.Expressive_AppBar=void 0}_setupCollapse(){!this.el.classList.contains("medium")&&!this.el.classList.contains("large")||typeof IntersectionObserver>"u"||(this._sentinel=document.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="display:block;height:0;position:relative;top:-64px;pointer-events:none;visibility:hidden",this.el.insertAdjacentElement("afterend",this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel))}_setupSearch(){if(this._input=this.el.querySelector('input[type="search"]'),!this._input)return;let t=this._input.getAttribute("aria-controls");t&&(this._view=document.getElementById(t)),this._view||(this._view=this.el.querySelector(".search-view")),this._view&&(this._input.addEventListener("focus",this._onSearchFocus),this._input.addEventListener("click",this._onSearchFocus),this._view instanceof HTMLDialogElement&&this._view.addEventListener("close",this._onSearchViewClose))}};var ze={},st=class d extends b{constructor(t,e){super(t,e,d);this.open=()=>{this.isOpen||(this.isOpen=!0,this._list&&(this._list.inert=!1),this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{if(!this.isOpen)return;let t=this.el.getRootNode().activeElement;t&&this._list?.contains(t)&&this._anchor?.focus(),this._list&&(this._list.inert=!0),this.isOpen=!1,this.el.classList.remove("active"),this._anchor?.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._handleDocumentClick),document.removeEventListener("keydown",this._handleDocumentKeydown)};this._handleFABClick=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("a, button");!i||i.matches(':disabled, [aria-disabled="true"]')||(i===this._anchor?this._toggle():this._list?.contains(i)&&this.close())};this._handleAnchorKeydown=t=>{(t.key===p.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{t.key===p.keys.ESC&&!t.defaultPrevented&&this.close()};this._handleDocumentClick=t=>{t.composedPath().includes(this.el)||this.close()};this.el.Expressive_FloatingActionButton=this,this.options={...d.defaults,...e},this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this._list=this.el.querySelector(":scope > ul, :scope > menu"),this._listWasInert=this._list?.inert??!1,this.el.classList.remove("active"),this._list&&(this._list.inert=!0),this._anchor?.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&(this._anchor.tabIndex<0&&(this._anchor.tabIndex=0),this._anchor.addEventListener("keydown",this._handleAnchorKeydown)),this.el.addEventListener("click",this._handleFABClick)}static get defaults(){return ze}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FloatingActionButton}destroy(){this.close(),this._list&&(this._list.inert=this._listWasInert),this.el.removeEventListener("click",this._handleFABClick),this._anchor?.removeEventListener("keydown",this._handleAnchorKeydown),this.el.Expressive_FloatingActionButton=void 0}_toggle(){this.isOpen?this.close():this.open()}};var Ke={},Ue=new Set(["single","multiple"]),Jt="button-group-pressed",Ye=.15,nt=class d extends b{constructor(t,e={}){super(t,e,d);this._pressedStyles=new Map;this._releaseStyles=new Map;this._releaseTimer=null;this._originalPressed=new Map;this._activeItem=null;this._handleClick=t=>{if(!this._selectionMode)return;let e=this._itemFromEvent(t);if(!(e instanceof HTMLButtonElement)||this._isDisabled(e))return;this._rememberPressed(e);let i=e.getAttribute("aria-pressed")!=="true",s=this._toggleItems.filter(o=>o.getAttribute("aria-pressed")==="true").length;!i&&this.el.hasAttribute("data-selection-required")&&s===1||(this._selectionMode==="single"&&i&&this._toggleItems.forEach(o=>{this._rememberPressed(o),o.setAttribute("aria-pressed","false")}),e.setAttribute("aria-pressed",i?"true":"false"))};this._handlePointerDown=t=>{if(t.button!==0)return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyDown=t=>{if(t.repeat||t.key!==" "&&t.key!=="Enter")return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyUp=t=>{(t.key===" "||t.key==="Enter")&&this._resetPress()};this._handleFocusOut=t=>{t.target===this._activeItem&&this._resetPress()};this._resetPress=()=>{if(this._activeItem?.classList.remove(Jt),this._activeItem=null,!!this._pressedStyles.size){this._finishRelease(),this._releaseStyles=new Map(this._pressedStyles);for(let[t,e]of this._releaseStyles)t.style.width=`${e.baseWidth}px`;this._pressedStyles.clear(),this._releaseTimer=window.setTimeout(this._finishRelease,200)}};this._finishRelease=()=>{this._releaseTimer!==null&&window.clearTimeout(this._releaseTimer),this._releaseTimer=null;for(let[t,e]of this._releaseStyles)t.style.width=e.width;this._releaseStyles.clear()};this.el.Expressive_ButtonGroup=this,this.options={...d.defaults,...e},this._selectionMode&&(this._normalizeSelection(),this.el.addEventListener("click",this._handleClick,!0)),this.el.addEventListener("pointerdown",this._handlePointerDown),this.el.addEventListener("keydown",this._handleKeyDown),this.el.addEventListener("focusout",this._handleFocusOut),document.addEventListener("pointerup",this._resetPress),document.addEventListener("pointercancel",this._resetPress),document.addEventListener("keyup",this._handleKeyUp),window.addEventListener("blur",this._resetPress)}static get defaults(){return Ke}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ButtonGroup}destroy(){this._resetPress(),this._finishRelease(),this.el.removeEventListener("click",this._handleClick,!0),this.el.removeEventListener("pointerdown",this._handlePointerDown),this.el.removeEventListener("keydown",this._handleKeyDown),this.el.removeEventListener("focusout",this._handleFocusOut),document.removeEventListener("pointerup",this._resetPress),document.removeEventListener("pointercancel",this._resetPress),document.removeEventListener("keyup",this._handleKeyUp),window.removeEventListener("blur",this._resetPress);for(let[t,e]of this._originalPressed)e===null?t.removeAttribute("aria-pressed"):t.setAttribute("aria-pressed",e);this._originalPressed.clear(),this.el.Expressive_ButtonGroup=void 0}get _selectionMode(){let t=this.el.dataset.selection;return Ue.has(t)?t:null}get _items(){return Array.from(this.el.children).filter(t=>t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement&&t.classList.contains("button"))}get _toggleItems(){return this._items.filter(t=>t instanceof HTMLButtonElement)}_normalizeSelection(){let t=this._toggleItems;t.forEach(e=>{this._rememberPressed(e),["true","false"].includes(e.getAttribute("aria-pressed")||"")||e.setAttribute("aria-pressed","false")}),this._selectionMode==="single"&&t.filter(i=>i.getAttribute("aria-pressed")==="true").slice(1).forEach(i=>i.setAttribute("aria-pressed","false")),this.el.hasAttribute("data-selection-required")&&!t.some(e=>e.getAttribute("aria-pressed")==="true")&&t.find(e=>!this._isDisabled(e))?.setAttribute("aria-pressed","true")}_itemFromEvent(t){if(!(t.target instanceof Element))return null;let e=t.target.closest("button, a.button");return e instanceof HTMLElement&&e.parentElement===this.el?e:null}_isDisabled(t){return t instanceof HTMLButtonElement&&t.disabled||t.getAttribute("aria-disabled")==="true"||t.classList.contains("disabled")}_rememberPressed(t){this._originalPressed.has(t)||this._originalPressed.set(t,t.getAttribute("aria-pressed"))}_startPress(t){if(this._activeItem)return;this._finishRelease();let e=this._items,i=e.indexOf(t);if(i<0||(this._activeItem=t,t.classList.add(Jt),this.el.classList.contains("connected")||e.length<2))return;let s=e.map(f=>f.getBoundingClientRect()),o=s[i].width;if(o<=0)return;let r=Number.parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-button-group-pressed-item-width-multiplier")),a=Number.isFinite(r)?r:.15,c=o*a,h=[i-1,i+1].filter(f=>f>=0&&f<e.length),l=new Map;if(h.length===1){let f=h[0];l.set(f,Math.min(c,this._compressionCapacity(e[f],s[f])))}else{let f=c/2;for(let v of h)l.set(v,Math.min(f,this._compressionCapacity(e[v],s[v])));let m=c-[...l.values()].reduce((v,g)=>v+g,0);for(let v of h){if(m<=0)break;let g=this._compressionCapacity(e[v],s[v])-l.get(v),E=Math.min(m,g);l.set(v,l.get(v)+E),m-=E}}let u=[...l.values()].reduce((f,m)=>f+m,0);u<=0||(e.forEach((f,m)=>{this._pressedStyles.set(f,{width:f.style.width,baseWidth:s[m].width}),f.style.width=`${s[m].width}px`}),this.el.offsetWidth,e.forEach((f,m)=>{let v=m===i?u:-(l.get(m)||0);f.style.width=`${s[m].width+v}px`}))}_compressionCapacity(t,e){let i=t.classList.contains("icon-button")?e.width*(1-Ye):e.height;return Math.max(0,e.width-i)}};var je={duration:200,fullWidth:!1,indicators:!1,noWrap:!1,interval:0,height:null,onCycleTo:null,i18n:{carousel:"Carousel",item:"Item",of:"of",indicators:"Slides",slide:"Slide"}},I=class I extends b{constructor(t,e){super(t,e,I);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._alignAfterResize=!1;this._trackRaf=null;this._started=!1;this._vertical=!1;this._resizeObserver=null;this._resizeTimeout=null;this._usesWindowResize=!1;this._dragPointerId=null;this._dragStartX=0;this._dragStartY=0;this._dragStartScroll=0;this._suppressClick=!1;this._suppressClickTimeout=null;this._generatedContainerRole=!1;this._generatedContainerLabel=!1;this._generatedContainerDescription=!1;this._generatedWideLayout=!1;this._generatedFixedHeight=!1;this._authoredInlineHeight=null;this._autoAdvanceTimer=null;this._autoAdvances=!1;this._autoPaused=!1;this._hovered=!1;this._focused=!1;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._generatedItemTabIndexes=new Set;this._generatedItemLabels=new Set;this._generatedItemDescriptions=new Set;this._generatedItemSizes=new Set;this._authoredItemSizes=new Set;this._itemA11yOriginal=new Map;this._handleThrottledResize=()=>{!this._started||this._resizeTimeout!==null||(this._handleResize(),this._resizeTimeout=setTimeout(()=>{this._resizeTimeout=null,this._handleResize()},200))};this._handleAutoAdvanceState=t=>{t.type==="mouseenter"?this._hovered=!0:t.type==="mouseleave"?this._hovered=!1:t.type==="focusin"?this._focused=!0:t.type==="focusout"&&(this._focused=this.el.contains(t.relatedTarget)),this._syncAutoAdvance()};this._handleMotionChange=()=>{this._syncAutoAdvance(),this._motion.matches&&this._scrollToIndex(this.center,!1),this._updateParallax()};this._tick=()=>{this._autoAdvanceTimer=null,this._advance(),this._syncAutoAdvance()};this._advance=()=>{let t=this.center+1;if(t<this.count){this.set(t);return}if(this.options.noWrap){this._autoAdvances=!1,this._syncAutoAdvance();return}this.set(0)};this._handleNativeScroll=()=>{this._alignAfterResize=!1,this._finishScroll()};this._handleTrackPointerDown=t=>{this._handleNativeScroll(),!(t.pointerType!=="mouse"||t.button!==0)&&(this.pressed=!0,this.dragged=!1,this._suppressClick=!1,this._dragPointerId=t.pointerId,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._dragStartScroll=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,this._setDragListeners(!0))};this._handleTrackPointerMove=t=>{if(!this.pressed||t.pointerId!==this._dragPointerId)return;let e=t.clientX-this._dragStartX,i=t.clientY-this._dragStartY,s=this._vertical?i:e,o=this._vertical?e:i;if(!this.dragged){if(Math.abs(s)<6||Math.abs(s)<=Math.abs(o))return;this.dragged=!0,this.el.classList.add("dragging");try{this._scroller.setPointerCapture(t.pointerId)}catch{}}this._vertical?this._scroller.scrollTop=this._dragStartScroll-i:this._scroller.scrollLeft=this._dragStartScroll-e,t.preventDefault()};this._handleTrackPointerUp=t=>{if(!(!this.pressed||t.pointerId!==this._dragPointerId)){this.pressed=!1,this._dragPointerId=null,this._setDragListeners(!1),this.el.classList.remove("dragging");try{this._scroller.releasePointerCapture(t.pointerId)}catch{}this.dragged&&(this._suppressClick=!0,window.clearTimeout(this._suppressClickTimeout),this._suppressClickTimeout=setTimeout(()=>{this._suppressClick=!1},0),this._syncActive(this._nearestIndex(),!0))}};this._handleTrackClick=t=>{this._suppressClick&&(this._suppressClick=!1,t.preventDefault(),t.stopImmediatePropagation())};this._handleTrackDragStart=t=>{t.target.closest("a, img, picture, video")&&t.preventDefault()};this._handleItemResize=t=>{this._alignAfterResize&&!this.pressed&&t.propertyName==="flex-basis"&&this.images.includes(t.target)&&this._scrollToIndex(this.center,!1)};this._handleIndicatorClick=t=>{t.stopPropagation();let e=t.target.closest(".indicator-item");if(!e||!this._indicators.contains(e))return;let i=[...this._indicators.children].indexOf(e);i<0||this._cycleTo(i)};this._handleKeydown=t=>{let e=t.target;if(e.isContentEditable||e.closest("input, textarea, select"))return;let i=getComputedStyle(this._scroller).direction==="rtl",s=this._vertical?t.key==="ArrowDown":t.key===(i?p.keys.ARROW_LEFT:p.keys.ARROW_RIGHT),o=this._vertical?t.key==="ArrowUp":t.key===(i?p.keys.ARROW_RIGHT:p.keys.ARROW_LEFT);t.key==="Home"?(t.preventDefault(),this.set(0),this._focusItem(0)):t.key==="End"?(t.preventDefault(),this.set(this.count-1),this._focusItem(this.count-1)):s?(t.preventDefault(),this.next(),this._focusItem(this.center)):o&&(t.preventDefault(),this.prev(),this._focusItem(this.center))};this._handleTrackScroll=()=>{this.el.classList.contains("scrolling")||this.el.classList.add("scrolling"),window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=setTimeout(()=>this.el.classList.remove("scrolling"),120),this._trackRaf===null&&(this._trackRaf=requestAnimationFrame(()=>{this._trackRaf=null;let t=this._ignoreScroll?this.center:this._nearestIndex();this._updateParallax(),t!==this.center&&this._syncActive(t,this.dragged)}))};this._handleResize=()=>{!this._started||!this.images.length||(this._syncAdaptiveMode(),this._syncLayoutRoles(this.center),this.pressed||this._scrollToIndex(this.center,!1),this._updateParallax())};this._finishScroll=()=>{this._ignoreScroll=!1,this._scroller.style.scrollSnapType="",clearTimeout(this._scrollEndTimeout),this._scroller.removeEventListener("scrollend",this._handleScrollEnd)};this._handleScrollEnd=()=>{this._nearestIndex()===this.center&&!this.images.some(t=>t.getAnimations().some(e=>e.playState==="running"))&&this._finishScroll()};if(this.el.Expressive_Carousel=this,this.options={...I.defaults,...e},e?.i18n&&(this.options.i18n={...I.defaults.i18n,...e.i18n}),(this.options.fullWidth||this.el.classList.contains("flat"))&&(this.el.classList.add("flat"),this.options.fullWidth=!0),this._vertical=this.el.classList.contains("full-screen"),this.pressed=!1,this.dragged=!1,this.images=this._collectItems(),!this.images.length){console.error("Carousel: no .carousel-item elements to show");return}this.images.forEach(s=>{this._itemA11yOriginal.set(s,{ariaHidden:s.getAttribute("aria-hidden"),tabIndex:s.getAttribute("tabindex")}),s.hasAttribute("data-carousel-size")&&this._authoredItemSizes.add(s)}),this.hasMultipleSlides=this.images.length>1,this.showIndicators=this.options.indicators&&this.hasMultipleSlides,this.count=this.images.length,this._autoAdvances=this.options.interval>0&&this.hasMultipleSlides,this.images.forEach(s=>s.classList.add("carousel-item")),this.options.height!==null&&(this._generatedFixedHeight=!this.el.classList.contains("fixed-height"),this._authoredInlineHeight=this.el.style.getPropertyValue("--carousel-height")||null,this.el.classList.add("fixed-height"),this.el.style.setProperty("--carousel-height",`${this.options.height}px`)),this._wrapTrack(),this._syncAdaptiveMode(),this.showIndicators&&this._setupIndicators(),this._setupAccessibility(),this._setupEventHandlers(),this._started=!0;let i=Math.max(0,this.images.findIndex(s=>s.classList.contains("active")));this.center=i,this._syncActive(i,!1),this._updateParallax(),this._scrollToIndex(i,!1),this._syncAutoAdvance()}get _scroller(){return this._trackEl??this.el}static get defaults(){return je}static init(t,e={}){return super.init(t,e,I)}static getInstance(t){return t.Expressive_Carousel}destroy(){this._started&&this._teardown(),this.el.Expressive_Carousel=void 0}_collectItems(){let t=Array.from(this.el.children).filter(e=>e instanceof HTMLElement&&e.classList.contains("carousel-item"));return t.length?t:Array.from(this.el.children).filter(e=>!(e instanceof HTMLElement)||e.classList.contains("indicators")||e.classList.contains("carousel-fixed-item")?!1:e.tagName!=="NAV")}_setupAccessibility(){this.el.hasAttribute("role")||(this.el.setAttribute("role","region"),this._generatedContainerRole=!0),!this.el.hasAttribute("aria-label")&&!this.el.hasAttribute("aria-labelledby")&&(this.el.setAttribute("aria-label",this.options.i18n.carousel),this._generatedContainerLabel=!0),this.el.hasAttribute("aria-roledescription")||(this.el.setAttribute("aria-roledescription","carousel"),this._generatedContainerDescription=!0);let t='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';this.images.forEach((e,i)=>{if(e.hasAttribute("aria-roledescription")||(e.setAttribute("aria-roledescription","slide"),this._generatedItemDescriptions.add(e)),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")){let s=e.querySelector("img[alt]")?.getAttribute("alt")?.trim(),o=e.textContent?.replace(/\s+/g," ").trim(),r=s||o,a=`${this.options.i18n.item} ${i+1} ${this.options.i18n.of} ${this.count}`;e.setAttribute("aria-label",r?`${r}, ${a}`:a),this._generatedItemLabels.add(e)}!e.matches(t)&&!e.querySelector(t)&&(e.tabIndex=0,this._generatedItemTabIndexes.add(e))})}_setupIndicators(){let t=Array.from(this.el.children).find(e=>e instanceof HTMLElement&&e.classList.contains("indicators"));this._indicators=t??document.createElement("nav"),this._ownIndicators=!t,this._indicators.classList.add("indicators"),this._indicators.setAttribute("aria-label",this.options.i18n.indicators),this._indicators.replaceChildren(),this.images.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.classList.add("indicator-item"),i===0&&(s.classList.add("active"),s.setAttribute("aria-current","true")),s.setAttribute("aria-label",`${this.options.i18n.slide} ${i+1}`),this._indicators.appendChild(s)}),this._ownIndicators&&this.el.appendChild(this._indicators),this.el.querySelector(".carousel-fixed-item")?.classList.add("with-indicators")}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleKeydown),this._motion.addEventListener("change",this._handleMotionChange),this._autoAdvances&&(this.el.addEventListener("mouseenter",this._handleAutoAdvanceState),this.el.addEventListener("mouseleave",this._handleAutoAdvanceState),this.el.addEventListener("focusin",this._handleAutoAdvanceState),this.el.addEventListener("focusout",this._handleAutoAdvanceState),document.addEventListener("visibilitychange",this._handleAutoAdvanceState)),this.showIndicators&&this._indicators&&this._indicators.addEventListener("click",this._handleIndicatorClick),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._handleThrottledResize()),this._resizeObserver.observe(this.el)),this._usesWindowResize=!this._resizeObserver||this.el.classList.contains("full-screen"),this._usesWindowResize&&(I._live.add(this),I._resizeListening||(window.addEventListener("resize",I._onResize,{passive:!0}),I._resizeListening=!0)),this._scroller.addEventListener("scroll",this._handleTrackScroll,{passive:!0}),this._scroller.addEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.addEventListener("wheel",this._handleNativeScroll,{passive:!0}),this._scroller.addEventListener("click",this._handleTrackClick,!0),this._scroller.addEventListener("dragstart",this._handleTrackDragStart),this._scroller.addEventListener("transitionend",this._handleItemResize)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleKeydown),this._motion.removeEventListener("change",this._handleMotionChange),this.el.removeEventListener("mouseenter",this._handleAutoAdvanceState),this.el.removeEventListener("mouseleave",this._handleAutoAdvanceState),this.el.removeEventListener("focusin",this._handleAutoAdvanceState),this.el.removeEventListener("focusout",this._handleAutoAdvanceState),document.removeEventListener("visibilitychange",this._handleAutoAdvanceState),this._indicators&&this._indicators.removeEventListener("click",this._handleIndicatorClick),this._scroller.removeEventListener("scroll",this._handleTrackScroll),this._scroller.removeEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.removeEventListener("wheel",this._handleNativeScroll),this._setDragListeners(!1),this._scroller.removeEventListener("click",this._handleTrackClick,!0),this._scroller.removeEventListener("dragstart",this._handleTrackDragStart),this._scroller.removeEventListener("transitionend",this._handleItemResize),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._usesWindowResize&&(I._live.delete(this),I._live.size===0&&I._resizeListening&&(window.removeEventListener("resize",I._onResize),I._resizeListening=!1))}_teardown(){this._started=!1,this._removeEventHandlers(),this._finishScroll(),this._autoAdvances=!1,this._syncAutoAdvance(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),window.clearTimeout(this._suppressClickTimeout),clearTimeout(this._resizeTimeout),this._ownIndicators&&this._indicators?.remove(),this._unwrapTrack(),this.images.forEach(t=>{t.style.removeProperty("--md-comp-carousel-item-parallax"),this._generatedItemLabels.has(t)&&t.removeAttribute("aria-label"),this._generatedItemDescriptions.has(t)&&t.removeAttribute("aria-roledescription"),this._generatedItemSizes.has(t)&&t.removeAttribute("data-carousel-size");let e=this._itemA11yOriginal.get(t);e?.ariaHidden===null?t.removeAttribute("aria-hidden"):e&&t.setAttribute("aria-hidden",e.ariaHidden),e?.tabIndex===null?t.removeAttribute("tabindex"):e&&t.setAttribute("tabindex",e.tabIndex)}),this._generatedContainerRole&&this.el.removeAttribute("role"),this._generatedContainerLabel&&this.el.removeAttribute("aria-label"),this._generatedContainerDescription&&this.el.removeAttribute("aria-roledescription"),this._generatedFixedHeight&&this.el.classList.remove("fixed-height"),this.options.height!==null&&(this._authoredInlineHeight===null?this.el.style.removeProperty("--carousel-height"):this.el.style.setProperty("--carousel-height",this._authoredInlineHeight)),this._generatedWideLayout&&this.el.classList.remove("multi-wide","multi-large","multi-extra-large","full-screen-horizontal")}_syncAutoAdvance(){let t=this._autoAdvances&&!this._autoPaused&&!this._hovered&&!this._focused&&!this._motion.matches&&!document.hidden;t&&this._autoAdvanceTimer===null?this._autoAdvanceTimer=setTimeout(this._tick,this.options.duration+this.options.interval):!t&&this._autoAdvanceTimer!==null&&(clearTimeout(this._autoAdvanceTimer),this._autoAdvanceTimer=null)}_setDragListeners(t){let e=t?"addEventListener":"removeEventListener";document[e]("pointermove",this._handleTrackPointerMove),document[e]("pointerup",this._handleTrackPointerUp),document[e]("pointercancel",this._handleTrackPointerUp)}_paintIndicators(t){if(!this.showIndicators||!this._indicators)return;let e=(t%this.count+this.count)%this.count;this._indicators.querySelectorAll(".indicator-item").forEach((i,s)=>{let o=s===e;i.classList.toggle("active",o),o?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")})}_syncActive(t,e){let i=this.center;this.center=t,this.images.forEach((o,r)=>o.classList.toggle("active",r===t)),this._paintIndicators(t),this._syncLayoutRoles(t);let s=this.images[t];i!==t&&typeof this.options.onCycleTo=="function"&&this.options.onCycleTo.call(this,s,e),typeof this.oneTimeCallback=="function"&&(this.oneTimeCallback.call(this,s,e),this.oneTimeCallback=null)}_syncLayoutRoles(t){let e=this.images.map(()=>"large"),i=(s,o)=>{this.images[s]&&(e[s]=o)};if(!(this.el.classList.contains("flat")||this.el.classList.contains("uncontained")||this.el.classList.contains("full-screen")&&this._vertical))if(this.el.classList.contains("hero")||this.el.classList.contains("full-screen-horizontal"))i(t+1,"small"),this.el.classList.contains("center-aligned")&&i(t-1,"small");else{let s=this.el.clientWidth,o=s>=1600?4:s>=1200?3:s>=600?2:1,r=Math.min(o,Math.max(1,this.count-2));this.el.classList.remove("multi-wide","multi-large","multi-extra-large"),r===2?this.el.classList.add("multi-wide"):r===3?this.el.classList.add("multi-large"):r>=4&&this.el.classList.add("multi-extra-large"),this._generatedWideLayout=this._generatedWideLayout||r>1,i(t+r,"medium"),i(t+r+1,"small")}this.images.forEach((s,o)=>{this._authoredItemSizes.has(s)||(s.setAttribute("data-carousel-size",e[o]),this._generatedItemSizes.add(s))})}_syncAdaptiveMode(){if(!this.el.classList.contains("full-screen"))return;let t=window.matchMedia("(orientation: landscape)").matches,e=this.el.clientWidth>=840||t,i=this._vertical;this._vertical=!e,this.el.classList.toggle("full-screen-horizontal",e),this._generatedWideLayout=this._generatedWideLayout||e,this._started&&i!==this._vertical&&this._scroller.scrollTo({left:0,top:0,behavior:"auto"})}_focusItem(t){let e=this.images[t];if(!e)return;((e.matches('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')?e:e.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??e).focus({preventScroll:!0})}_updateParallax(){if(this._motion.matches){this.images.forEach(o=>o.style.setProperty("--md-comp-carousel-item-parallax","0px"));return}let t=this._scroller.getBoundingClientRect(),e=this._vertical?t.top+t.height/2:t.left+t.width/2,i=Math.max(1,this._vertical?t.height:t.width),s=this.images.map(o=>o.getBoundingClientRect());this.images.forEach((o,r)=>{let a=s[r],c=this._vertical?a.top+a.height/2:a.left+a.width/2,h=Math.max(-1,Math.min(1,(c-e)/i));o.style.setProperty("--md-comp-carousel-item-parallax",`${h*-24}px`)})}_wrapTrack(){let t=document.createElement("div");t.className="carousel-track",this.images[0].before(t),this.images.forEach(e=>t.appendChild(e)),this._trackEl=t}_unwrapTrack(){this._trackEl&&(this.images.forEach(t=>this.el.insertBefore(t,this._trackEl)),this._trackEl.remove(),this._trackEl=null)}_nearestIndex(){let t=this.el.classList.contains("center-aligned"),e=getComputedStyle(this._scroller),i=!this._vertical&&e.direction==="rtl",s=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,o=this._vertical?this._scroller.clientHeight:this._scroller.clientWidth,r=(this._vertical?this._scroller.scrollHeight:this._scroller.scrollWidth)-o,a=parseFloat(this._vertical?e.paddingBlockStart:e.paddingInlineStart)||0,c=this.center,h=1/0;return this.images.forEach((l,u)=>{let f=this._vertical?l.offsetTop:l.offsetLeft,m=this._vertical?l.offsetHeight:l.offsetWidth,v=t?f-(o-m)/2:f+(i?m-o+a:-a),g=Math.max(i?-r:0,Math.min(i?0:r,v)),E=Math.abs(g-s);(E<h||E===h&&u===this.center)&&(h=E,c=u)}),c}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;this._finishScroll();let s=this.el.classList.contains("center-aligned"),o=getComputedStyle(this._scroller),r=Number.parseFloat(o.paddingInlineStart)||0,a=Number.parseFloat(o.paddingBlockStart)||0,c=s?i.offsetLeft-(this._scroller.clientWidth-i.offsetWidth)/2:o.direction==="rtl"?i.offsetLeft+i.offsetWidth-this._scroller.clientWidth+r:i.offsetLeft-r,h=i.offsetTop-a;this._ignoreScroll=!0,this._scroller.style.scrollSnapType="none",this._scroller.scrollTo({left:this._vertical?0:c,top:this._vertical?h:0,behavior:e&&!this._motion.matches?"smooth":"instant"}),this._scroller.addEventListener("scrollend",this._handleScrollEnd),this._scrollEndTimeout=setTimeout(this._finishScroll,this.options.duration+350)}_cycleTo(t,e=null){this._alignAfterResize=!0,typeof e=="function"&&(this.oneTimeCallback=e),this._syncActive(t,!1),this._scrollToIndex(t)}pause(){this._autoPaused=!0,this._syncAutoAdvance()}start(){this._autoPaused=!1,this._syncAutoAdvance()}next(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center+t;e>=this.count||e<0||this._cycleTo(e)}prev(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center-t;e>=this.count||e<0||this._cycleTo(e)}set(t,e){(t===void 0||isNaN(t))&&(t=0),!(t>=this.count||t<0)&&this._cycleTo(t,e)}};I._live=new Set,I._resizeListening=!1,I._onResize=p.throttle(()=>{I._live.forEach(t=>t._handleResize())},200);var Y=I;var Xe=Object.freeze({}),St=class d extends b{constructor(t,e){super(t,{},d);this.updateCounter=()=>{let t=parseInt(this.el.getAttribute("maxlength")),e=this.el.value.length;this.isValidLength=e<=t;let i=e.toString();t&&(i+="/"+t,this._validateInput()),this.counterEl.textContent=i};this.el.Expressive_CharacterCounter=this,this.options={...d.defaults,...e},this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers()}static get defaults(){return Xe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_CharacterCounter}destroy(){this._removeEventHandlers(),this.el.Expressive_CharacterCounter=void 0,this._removeCounter()}_setupEventHandlers(){this.el.addEventListener("focus",this.updateCounter,!0),this.el.addEventListener("input",this.updateCounter,!0)}_removeEventHandlers(){this.el.removeEventListener("focus",this.updateCounter,!0),this.el.removeEventListener("input",this.updateCounter,!0)}_setupCounter(){this.counterEl=document.createElement("span"),this.counterEl.classList.add("character-counter"),this.counterEl.setAttribute("aria-live","polite"),this.counterEl.setAttribute("aria-atomic","true"),this.counterEl.style.float="right",this.counterEl.style.fontSize="12px",this.counterEl.style.height="1",this.el.parentElement.appendChild(this.counterEl)}_removeCounter(){this.counterEl.remove()}_validateInput(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.el.classList.remove("invalid")):!this.isValidLength&&!this.isInvalid&&(this.isInvalid=!0,this.el.classList.remove("valid"),this.el.classList.add("invalid"))}};var Ge={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,origin:{x:.5,y:.5},colors:[],shapes:["square","circle"],scalar:1,manualStart:!1},Ze=["primary","secondary","tertiary","primary-container","secondary-container","tertiary-container"],Qe=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],te=Math.PI/180,At=new Map,D=null,ot=class d extends b{constructor(t,e){super(t,e,d);this._onClick=()=>{this.fire()};this.el.Expressive_Confetti=this,this.options={...d.defaults,...e},t instanceof HTMLCanvasElement?this.options.manualStart||this.fire():t.addEventListener("click",this._onClick)}static get defaults(){return Ge}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Confetti}static fire(t={}){return Kt(ee,document.body,{...d.defaults,...t})}fire(t={}){let e={...this.options,...t};if(this.el instanceof HTMLCanvasElement){let s=this.el;return Kt(()=>s,s.parentElement??document.body,e)}let i=this.el.getBoundingClientRect();return e.origin={x:(i.left+i.width/2)/innerWidth,y:(i.top+i.height/2)/innerHeight},Kt(ee,this.el.parentElement??document.body,e)}destroy(){this.el.removeEventListener("click",this._onClick),this.el instanceof HTMLCanvasElement&&se(this.el),this.el.Expressive_Confetti=void 0}};function Kt(d,n,t){if(typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches)return Promise.resolve();let e=d(),i=At.get(e);if(!i){let l=e.getContext("2d");if(!l)return Promise.resolve();i={ctx:l,pieces:[],frame:0,last:0,done:[],overlay:e===D},At.set(e,i)}let{width:s,height:o}=ne(e),r=t.colors.length?t.colors:ti(n),a=(t.origin.x??.5)*s,c=(t.origin.y??.5)*o;for(let l=0;l<t.particleCount;l++)i.pieces.push({x:a,y:c,velocity:t.startVelocity*(.5+Math.random()),angle:-t.angle*te+(.5-Math.random())*t.spread*te,wobble:Math.random()*10,wobbleSpeed:.05+Math.random()*.05,tilt:(.25+Math.random()/2)*Math.PI,tick:0,color:r[l%r.length],shape:t.shapes[Math.floor(Math.random()*t.shapes.length)]??"square",options:t});let h=i;return h.frame||(h.frame=requestAnimationFrame(l=>{h.last=l,ie(e,h,l)})),new Promise(l=>h.done.push(l))}function ie(d,n,t){let e=Math.min((t-n.last)/16.666666666666668,4);n.last=t;let{width:i,height:s}=ne(d),{ctx:o}=n,r=d.width/(i||1);o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,d.width,d.height),n.pieces=n.pieces.filter(a=>{let c=a.options;if(a.x+=(Math.cos(a.angle)*a.velocity+c.drift)*e,a.y+=(Math.sin(a.angle)*a.velocity+c.gravity*3)*e,a.velocity*=c.decay**e,a.wobble+=a.wobbleSpeed*e,a.tilt+=.1*e,a.tick+=e,a.tick>=c.ticks)return!1;let h=8*c.scalar;return o.setTransform(r,0,0,r,0,0),o.translate(a.x+10*c.scalar*Math.cos(a.wobble),a.y+10*c.scalar*Math.sin(a.wobble)),o.rotate(a.tilt),o.scale(1,Math.cos(a.wobble)),o.globalAlpha=1-a.tick/c.ticks,o.fillStyle=a.color,o.beginPath(),a.shape==="circle"?o.arc(0,0,h/2,0,2*Math.PI):a.shape==="star"?Je(o,h*.75):o.rect(-h/2,-h/2,h,h),o.fill(),!0}),n.pieces.length?n.frame=requestAnimationFrame(a=>ie(d,n,a)):se(d)}function se(d){let n=At.get(d);if(n){cancelAnimationFrame(n.frame),At.delete(d),n.ctx.setTransform(1,0,0,1,0,0),n.ctx.clearRect(0,0,d.width,d.height),n.overlay&&(d.remove(),D=null);for(let t of n.done)t()}}function Je(d,n){for(let t=0;t<10;t++){let e=t*Math.PI/5-Math.PI/2,i=t%2?n/2:n;d.lineTo(Math.cos(e)*i,Math.sin(e)*i)}d.closePath()}function ne(d){let n=d.clientWidth,t=d.clientHeight,e=Math.round(n*devicePixelRatio),i=Math.round(t*devicePixelRatio);return(d.width!==e||d.height!==i)&&(d.width=e,d.height=i),{width:n,height:t}}function ee(){return D?.isConnected||(D=document.createElement("canvas"),D.className="confetti-overlay",D.setAttribute("aria-hidden","true"),Object.assign(D.style,{position:"fixed",inset:"0",width:"100%",height:"100%",margin:"0",padding:"0",border:"0",background:"transparent",pointerEvents:"none",zIndex:"10001"}),document.body.append(D),typeof D.showPopover=="function"&&(D.popover="manual",D.showPopover())),D}function ti(d){let n=document.createElement("span");n.hidden=!0,d.append(n);let t=getComputedStyle(n),e=Ze.filter(i=>t.getPropertyValue(`--md-sys-color-${i}`).trim()).map(i=>(n.style.color=`var(--md-sys-color-${i})`,getComputedStyle(n).color));return n.remove(),e.length?e:Qe}var ei={quantity:100,staticity:50,ease:50,size:.4,color:"",vx:0,vy:0},rt=class d extends b{constructor(t,e){super(t,e,d);this._particles=[];this._width=0;this._height=0;this._frame=0;this._last=0;this._mouse={x:0,y:0};this._still=!1;this._resizeObserver=null;this._visibility=null;this._onPointerMove=t=>{let e=this.el.getBoundingClientRect(),i=t.clientX-e.left-e.width/2,s=t.clientY-e.top-e.height/2;Math.abs(i)<e.width/2&&Math.abs(s)<e.height/2&&(this._mouse={x:i,y:s})};if(this.el.Expressive_Particles=this,this.options={...d.defaults,...e},this._ctx=this.el.getContext("2d"),!!this._ctx&&(this._style=getComputedStyle(this.el),this._still=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,this._reset(),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>{(this.el.clientWidth!==this._width||this.el.clientHeight!==this._height)&&this._reset()}),this._resizeObserver.observe(this.el)),!this._still)){if(typeof IntersectionObserver>"u"){this._start();return}this._visibility=new IntersectionObserver(([i])=>i.isIntersecting?this._start():this._stop()),this._visibility.observe(this.el)}}static get defaults(){return ei}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Particles}destroy(){this._stop(),this._resizeObserver?.disconnect(),this._visibility?.disconnect(),this._ctx&&(this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this.el.width,this.el.height)),this.el.Expressive_Particles=void 0}_start(){this._frame||(window.addEventListener("pointermove",this._onPointerMove,{passive:!0}),this._frame=requestAnimationFrame(t=>{this._last=t,this._draw(t)}))}_stop(){cancelAnimationFrame(this._frame),this._frame=0,window.removeEventListener("pointermove",this._onPointerMove)}_reset(){if(this._width=this.el.clientWidth,this._height=this.el.clientHeight,this.el.width=Math.round(this._width*devicePixelRatio),this.el.height=Math.round(this._height*devicePixelRatio),this._particles=Array.from({length:this.options.quantity},()=>this._particle()),this._still){for(let t of this._particles)t.alpha=t.targetAlpha;this._paint()}}_particle(){return{x:Math.floor(Math.random()*this._width),y:Math.floor(Math.random()*this._height),translateX:0,translateY:0,size:Math.floor(Math.random()*2)+this.options.size,alpha:0,targetAlpha:Math.round((Math.random()*.6+.1)*10)/10,dx:(Math.random()-.5)*.1,dy:(Math.random()-.5)*.1,magnetism:.1+Math.random()*4}}_draw(t){let e=Math.min((t-this._last)/16.666666666666668,4);this._last=t;let{staticity:i,ease:s,vx:o,vy:r}=this.options,a=Math.min(e/s,1);this._particles=this._particles.map(c=>{c.x+=(c.dx+o)*e,c.y+=(c.dy+r)*e,c.translateX+=(this._mouse.x/(i/c.magnetism)-c.translateX)*a,c.translateY+=(this._mouse.y/(i/c.magnetism)-c.translateY)*a;let h=c.x+c.translateX,l=c.y+c.translateY,u=Math.min(h-c.size,this._width-h-c.size,l-c.size,this._height-l-c.size)/20;return c.alpha=u>1?Math.min(c.alpha+.02*e,c.targetAlpha):c.targetAlpha*u,c.x<-c.size||c.x>this._width+c.size||c.y<-c.size||c.y>this._height+c.size?this._particle():c}),this._paint(),this._frame=requestAnimationFrame(c=>this._draw(c))}_paint(){let t=this._ctx,e=devicePixelRatio;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this.el.width,this.el.height),t.setTransform(e,0,0,e,0,0),t.fillStyle=this.options.color||this._style.color;for(let i of this._particles)i.alpha<=0||(t.globalAlpha=i.alpha,t.beginPath(),t.arc(i.x+i.translateX,i.y+i.translateY,i.size,0,2*Math.PI),t.fill());t.globalAlpha=1}};var ii={shortcut:"k",closeOnRun:!0},si=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform),oe=d=>d.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase(),at=class d extends b{constructor(t,e){super(t,e,d);this._active=null;this._generatedIds=[];this._observer=null;this.open=()=>{this.el.open||this.el.showModal(),this.input?.focus()};this.close=()=>{this.el.open&&this.el.close()};this._handleInput=()=>this._filter();this._handleKeydown=t=>{t.key===p.keys.ARROW_DOWN||t.key===p.keys.ARROW_UP?(t.preventDefault(),this._move(t.key===p.keys.ARROW_DOWN?1:-1)):t.key===p.keys.ENTER&&!t.isComposing&&t.keyCode!==229&&this._active&&(t.preventDefault(),this._run(this._active))};this._handleListClick=t=>{let e=t.target.closest('[role="option"]');if(!e||!this.list.contains(e)||e.getAttribute("aria-disabled")==="true")return;let i=this._action(e);if(i&&!i.contains(t.target)){i.click();return}this.options.closeOnRun&&this.close()};this._handlePointerMove=t=>{let e=t.target.closest('[role="option"]');e&&this.list.contains(e)&&e.getAttribute("aria-disabled")!=="true"&&this._setActive(e)};this._handleClose=()=>{this.el.open||(this.input.value="",this._filter())};this._handleShortcut=t=>{let{shortcut:e}=this.options;if(!e||t.defaultPrevented||t.altKey||t.shiftKey||!(si?t.metaKey&&!t.ctrlKey:t.ctrlKey&&!t.metaKey))return;let i=e.toLowerCase(),s=/^[a-z]$/i.test(t.key);(t.key.toLowerCase()===i||!s&&/^[a-z]$/.test(i)&&t.code===`Key${i.toUpperCase()}`)&&(t.preventDefault(),this.el.open?this.close():this.open())};this.el.Expressive_CommandPalette=this;let i=t.dataset.shortcut;if(this.options={...d.defaults,...i!==void 0?{shortcut:i||null}:{},...e},this.input=t.querySelector(":scope > input"),this.list=t.querySelector(":scope > :is(ul, ol)"),!this.input||!this.list){console.error("CommandPalette needs an <input> and a <ul> as children of the dialog.");return}this._setupAccessibility(),this._filter(),this._observer=new MutationObserver(()=>this._filter(!0)),this._observer.observe(this.list,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden","disabled"]}),this.input.addEventListener("input",this._handleInput),this.input.addEventListener("keydown",this._handleKeydown),this.list.addEventListener("click",this._handleListClick),this.list.addEventListener("pointermove",this._handlePointerMove),this.el.addEventListener("close",this._handleClose),document.addEventListener("keydown",this._handleShortcut)}static get defaults(){return ii}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_CommandPalette}get isOpen(){return this.el.open}destroy(){if(this._observer?.disconnect(),document.removeEventListener("keydown",this._handleShortcut),this.el.removeEventListener("close",this._handleClose),this.input&&this.list){this.input.removeEventListener("input",this._handleInput),this.input.removeEventListener("keydown",this._handleKeydown),this.list.removeEventListener("click",this._handleListClick),this.list.removeEventListener("pointermove",this._handlePointerMove);for(let e of["role","aria-controls","aria-expanded","aria-autocomplete","aria-activedescendant"])this.input.removeAttribute(e);this.list.removeAttribute("role");for(let e of this._items()){for(let i of["role","aria-selected","aria-disabled","data-filtered"])e.removeAttribute(i);e.classList.remove("active"),this._action(e)?.removeAttribute("tabindex")}for(let e of this._labels())e.removeAttribute("role"),e.removeAttribute("data-filtered");for(let e of this._generatedIds)e.removeAttribute("id");let t=this._empty();t&&(t.hidden=!1)}this.el.Expressive_CommandPalette=void 0}_items(){return Array.from(this.list.children).filter(t=>t instanceof HTMLElement&&!t.classList.contains("label"))}_labels(){return Array.from(this.list.querySelectorAll(":scope > .label"))}_empty(){return this.el.querySelector(":scope > .command-palette-empty")}_action(t){return t.querySelector(":scope > :is(a[href], button)")}_ensureId(t,e){return t.id||(t.id=`${e}-${p.guid()}`,this._generatedIds.push(t)),t.id}_setupAccessibility(){this.list.setAttribute("role","listbox"),this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-controls",this._ensureId(this.list,"command-palette-list")),this.input.setAttribute("aria-expanded","true"),this.input.setAttribute("aria-autocomplete","list")}_wireItems(){for(let t of this._items())t.getAttribute("role")!=="option"&&(t.setAttribute("role","option"),this._ensureId(t,"command-palette-option"),this._action(t)?.setAttribute("tabindex","-1"));for(let t of this._labels())t.setAttribute("role","none")}_shown(){return this._items().filter(t=>!t.hidden&&!t.hasAttribute("data-filtered"))}_visible(){return this._shown().filter(t=>t.getAttribute("aria-disabled")!=="true")}_isDisabled(t){let e=this._action(t);return!!e&&(e.matches(":disabled")||e.getAttribute("aria-disabled")==="true")}_setActive(t){this._active!==t&&(this._active?.classList.remove("active"),this._active?.removeAttribute("aria-selected"),this._active=t,t?(t.classList.add("active"),t.setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"})):this.input.removeAttribute("aria-activedescendant"))}_filter(t=!1){this._wireItems();let e=oe(this.input.value).split(/\s+/).filter(Boolean);for(let o of this._items()){let r=o.dataset.keywords??this._action(o)?.dataset.keywords??"",a=oe(`${o.textContent} ${r}`);o.toggleAttribute("data-filtered",!e.every(c=>a.includes(c))),this._isDisabled(o)?o.setAttribute("aria-disabled","true"):o.removeAttribute("aria-disabled")}for(let o of this._labels()){let r=o.nextElementSibling,a=!1;for(;r&&!r.classList.contains("label");)!r.hidden&&!r.hasAttribute("data-filtered")&&(a=!0),r=r.nextElementSibling;o.toggleAttribute("data-filtered",!a)}let i=this._visible(),s=this._empty();s&&(s.hidden=this._shown().length>0),this._setActive(t&&i.includes(this._active)?this._active:i[0]??null)}_move(t){let e=this._visible();if(!e.length)return;let i=e.indexOf(this._active);this._setActive(e[(i+t+e.length)%e.length])}_run(t){(this._action(t)??t).click()}};var ni={progressLabel:"Question {current} of {total}",requiredMessage:"Choose an answer to continue."},re=["previous","skip","next"],lt=class d extends b{constructor(t,e){super(t,e,d);this._active=null;this._generated=[];this._generatedIds=[];this._reporting=!1;this.goTo=t=>{let e=this.items[t];if(!e)return;this._active=e,this._render();let i=this._controls(e).filter(s=>!s.disabled);(i.find(s=>s.checked)??i[0])?.focus()};this.next=()=>{this._validate(this._active)&&this.goTo(this.index+1)};this.previous=()=>this.goTo(this.index-1);this.skip=()=>{if(this._active){for(let t of this._controls(this._active)){let e=t instanceof HTMLInputElement&&(t.type==="radio"||t.type==="checkbox");(e?!t.checked:!t.value)||(e?t.checked=!1:t.value="",t.dispatchEvent(new Event("change",{bubbles:!0})))}this.goTo(this.index+1)}};this._handleClick=t=>{let e=t.target.closest?.("button");if(!(!e||!this._buttons().includes(e))){if(re.includes(e.value)){t.preventDefault(),this[e.value]();return}this._syncRequired()}};this._handleKeydown=t=>{t.key!=="Enter"||t.defaultPrevented||t.isComposing||!(t.target instanceof HTMLInputElement)||this.index>=this.items.length-1||(t.preventDefault(),this.next())};this._handleInvalid=t=>{let e=this.items.find(i=>i.contains(t.target));e&&(t.preventDefault(),!this._reporting&&(this._reporting=!0,setTimeout(()=>this._reporting=!1),this._active=e,this._render(),this._validate(e)))};this._handleInput=t=>{this._syncRequired();let e=t.target.closest?.("fieldset");e instanceof HTMLFieldSetElement&&e.classList.contains("invalid")&&this._setInvalid(e,!1)};this.el.Expressive_Questionnaire=this;let i=t.dataset.progressLabel;this.options={...d.defaults,...i?{progressLabel:i}:{},...e},this._progress=document.createElement("div"),this._progress.className="questionnaire-progress",this._progressText=document.createElement("span"),this._progressText.id=`questionnaire-progress-${p.guid()}`,this._progressBar=document.createElement("progress"),this._progressBar.className="progress",this._progressBar.setAttribute("aria-labelledby",this._progressText.id),this._progress.append(this._progressText,this._progressBar),this.el.prepend(this._progress);for(let s of this._fieldsets()){let o=Array.from(s.querySelectorAll(":scope > p:not(.questionnaire-error)")).map(r=>this._ensureId(r,"questionnaire-description"));o.length&&!s.hasAttribute("aria-describedby")&&(s.setAttribute("aria-describedby",o.join(" ")),this._generatedIds.push(s))}this._active=this.items[0]??null,this._syncRequired(),this._render(),this._observer=new MutationObserver(()=>{this._syncRequired(),this._render()}),this._observer.observe(this.el,{attributes:!0,subtree:!0,attributeFilter:["disabled"]}),this.el.addEventListener("click",this._handleClick),this.el.addEventListener("keydown",this._handleKeydown),this.el.addEventListener("input",this._handleInput),this.el.addEventListener("invalid",this._handleInvalid,!0)}static get defaults(){return ni}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Questionnaire}get items(){return this._fieldsets().filter(t=>!t.disabled)}get index(){return this.items.indexOf(this._active)}destroy(){this._observer.disconnect(),this.el.removeEventListener("click",this._handleClick),this.el.removeEventListener("keydown",this._handleKeydown),this.el.removeEventListener("input",this._handleInput),this.el.removeEventListener("invalid",this._handleInvalid,!0);for(let t of this._fieldsets()){if(t.hasAttribute("data-required"))for(let e of this._controls(t))e.setCustomValidity("");t.hidden=!1,this._setInvalid(t,!1)}for(let t of this._buttons())t.hidden=!1;this._progress.remove();for(let t of this._generated)t.remove();for(let t of this._generatedIds)t.removeAttribute(t instanceof HTMLFieldSetElement?"aria-describedby":"id");this.el.Expressive_Questionnaire=void 0}_fieldsets(){return Array.from(this.el.querySelectorAll(":scope > fieldset"))}_buttons(){return Array.from(this.el.querySelectorAll(":scope > footer > button")).filter(t=>re.includes(t.value)||t.type==="submit")}_controls(t){return Array.from(t.elements).filter(e=>e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&e.type!=="button"&&e.type!=="submit")}_required(t){return t.hasAttribute("data-required")||this._controls(t).some(e=>e.required)}_ensureId(t,e){return t.id||(t.id=`${e}-${p.guid()}`,this._generatedIds.push(t)),t.id}_render(){let t=this.items;if(!t.includes(this._active)){let s=this._fieldsets(),o=s.slice(s.indexOf(this._active)+1).find(r=>!r.disabled);this._active=o??t[t.length-1]??null}let e=t.indexOf(this._active),i=e===t.length-1;for(let s of this._fieldsets())s.hidden=s!==this._active;for(let s of this._buttons())s.value==="previous"?s.hidden=e<=0:s.value==="skip"?s.hidden=i||!this._active||this._required(this._active):s.value==="next"?s.hidden=i:s.hidden=!i;this._progressText.textContent=this.options.progressLabel.replace("{current}",String(e+1)).replace("{total}",String(t.length)),this._progressBar.max=Math.max(t.length,1),this._progressBar.value=e+1}_syncRequired(){for(let t of this._fieldsets()){if(!t.hasAttribute("data-required"))continue;let e=this._controls(t).filter(s=>s instanceof HTMLInputElement&&s.type==="checkbox"),i=e.filter(s=>!s.disabled);for(let s of e)s.setCustomValidity("");if(i.length&&!i.some(s=>s.checked)){let s=t.querySelector(":scope > .questionnaire-error:not([data-generated])");i[0].setCustomValidity(s?.textContent.trim()||this.options.requiredMessage)}}}_invalidControl(t){return this._controls(t).find(e=>e.willValidate&&!e.validity.valid)}_validate(t){this._syncRequired();let e=t&&this._invalidControl(t);if(!e)return!0;let i=t.querySelector(":scope > .questionnaire-error");return i||(i=document.createElement("p"),i.className="questionnaire-error",i.dataset.generated="",i.textContent=e.validationMessage||this.options.requiredMessage,t.append(i),this._generated.push(i)),this._setInvalid(t,!0),e.focus(),!1}_setInvalid(t,e){t.classList.toggle("invalid",e);let i=t.querySelector(":scope > .questionnaire-error"),s=(t.getAttribute("aria-describedby")??"").split(" ").filter(o=>o&&o!==i?.id);e&&i&&s.push(this._ensureId(i,"questionnaire-error")),s.length?t.setAttribute("aria-describedby",s.join(" ")):t.removeAttribute("aria-describedby");for(let o of this._controls(t))e?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid");!e&&this._generated.includes(i)&&(i.remove(),this._generated.splice(this._generated.indexOf(i),1))}};var oi={min:null,max:null},j="http://www.w3.org/2000/svg",V=4;function A(d,n={}){let t=document.createElementNS(j,d);for(let e in n)t.setAttribute(e,n[e]);return t}var ri=0;function ai(d){if(!d)return null;let t=(d.dataset.value??d.textContent).replace(/\u2212/g,"-").replace(/[\s%\p{Sc}]/gu,"");return!/^[+-]?(\d{1,3}(,\d{3})+|\d+)?(\.\d+)?(e[+-]?\d+)?$/i.test(t)||!/\d/.test(t)?null:parseFloat(t.replace(/,/g,""))}function ae(d){let n=d.length;if(n===0)return"";if(n===1)return`M${d[0][0]},${d[0][1]}h0`;let t=[];for(let s=0;s<n-1;s++)t.push((d[s+1][1]-d[s][1])/(d[s+1][0]-d[s][0]));let e=d.map((s,o)=>{if(o===0)return t[0];if(o===n-1)return t[n-2];let[r,a]=[t[o-1],t[o]];return r*a<=0?0:2/(1/r+1/a)}),i=`M${d[0][0]},${d[0][1]}`;for(let s=0;s<n-1;s++){let[[o,r],[a,c]]=[d[s],d[s+1]],h=(a-o)/3;i+=`C${o+h},${r+e[s]*h} ${a-h},${c-e[s+1]*h} ${a},${c}`}return i}var S=class extends b{constructor(t,e){super(t,e,new.target);this.labels=[];this.series=[];this.activeIndex=-1;this._generated=[];this._header=[];this._rows=[];this._reversed=!1;this._onPointerMove=t=>{this.show(this._indexAt(t))};this._onFocus=()=>{this.activeIndex<0&&this._plot.matches(":focus-visible")&&this.show(0)};this._onLeave=t=>{t.pointerType==="touch"||this._plot.matches(":focus-visible")||this.show(-1)};this._onCancel=()=>{this.show(-1)};this._onKeyDown=t=>{let e=this._keyTarget(t.key);e!==void 0&&(t.preventDefault(),this.show(e))};this.el[this._key]=this,this.options={...new.target.defaults,...e},this._read(),!(!this.labels.length||!this.series.length)&&(this._reversed=!this._horizontal&&getComputedStyle(this.el).direction==="rtl",this._render(),this.el.classList.contains("sparkline")||(this._plot.tabIndex=0,this._plot.addEventListener("pointerdown",this._onPointerMove),this._plot.addEventListener("pointermove",this._onPointerMove),this._plot.addEventListener("pointerleave",this._onLeave),this._plot.addEventListener("pointercancel",this._onCancel),this._plot.addEventListener("keydown",this._onKeyDown),this._plot.addEventListener("focus",this._onFocus),this._plot.addEventListener("blur",this._onLeave)))}get _type(){return"line-chart"}get _fromZero(){return!1}get _horizontal(){return!1}get _circular(){return!1}get _points(){return!0}get _key(){return"Expressive_LineChart"}static get defaults(){return oi}static init(t,e={}){return super.init(t,e,this)}static getInstance(t){return t.Expressive_LineChart}destroy(){this._generated.forEach(t=>t.remove()),this._generated=[],this.el[this._key]=void 0}show(t){if(!this._tooltip||t===this.activeIndex)return;this.activeIndex=t;let e=t<0||t>=this.labels.length;if(this._cursor.hidden=this._tooltip.hidden=e,e)return;this._cursor.replaceChildren();let i=document.createElement("strong");i.textContent=this.labels[t],this._tooltip.replaceChildren(i),this.series.forEach((s,o)=>{if(s.values[t]===null)return;let a=String(o%V+1),c=s.tops[t];if(c!==null&&this._points){let u=document.createElement("span");u.className=s.className,u.dataset.series=a,u.style.top=`${s.y(c)}%`,this._cursor.append(u)}let h=document.createElement("span");h.dataset.series=a,h.textContent=s.name;let l=document.createElement("span");l.textContent=s.text[t],this._tooltip.append(h,l)}),this._place(t)}_place(t){let e=this._x(t),i=this._horizontal?"top":"left";this._cursor.style[i]=this._tooltip.style[i]=`${e}%`,this._tooltip.classList.toggle("end",e>50)}_read(){let t=this.el.querySelector(":scope > table");if(!t)return;let e=t.tHead?.rows[0]??t.rows[0],i=Array.from(e?.cells??[]),s=Array.from(t.tBodies).flatMap(a=>Array.from(a.rows)).filter(a=>a!==e);if([this._header,this._rows]=[i,s],this.labels=s.map(a=>a.cells[0]?.textContent.trim()??""),this.series=i.slice(1).map((a,c)=>{let h=s.map(l=>ai(l.cells[c+1]));return{name:a.textContent.trim(),className:a.className,text:s.map(l=>l.cells[c+1]?.textContent.trim()??""),values:h,tops:h,y:void 0}}),this.el.classList.contains("stacked")){let a=this.labels.map(()=>0);for(let c of this.series)c.base=[...a],c.tops=c.values.map((h,l)=>a[l]=h===null||a[l]===null?null:a[l]+h)}this.series.every(a=>a.tops.every(c=>c===null))&&(this.series=[]);let r=a=>this._number(a)??this.options[a];this._y=this._scale(this.series,r("min"),r("max"))}_number(t){let e=parseFloat(this.el.dataset[t]??"");return Number.isFinite(e)?e:null}_scale(t,e,i,s=this._fromZero){let o=this.el.classList.contains("stacked"),[r,a]=[1/0,-1/0];for(let{tops:h}of t)for(let l of h)l!==null&&(r=Math.min(r,l),a=Math.max(a,l));if(r>a&&(r=a=0),s){let[h,l]=[Math.min(0,r),Math.max(0,a)],u=(l-(e??h))*.1||1;e??(e=h<0?h-u:0),i??(i=l+u)}else{let h=(a-r)*.1||1;e??(e=o?Math.min(0,r):r-h),i??(i=a+(o?(a-e)*.1||1:h))}let c=h=>100-(h-e)/(i-e||1)*100;for(let h of t)h.y=c;return c}_x(t){let e=(t+.5)/this.labels.length*100;return this._reversed?100-e:e}_render(){let t=this._type;this._plot=document.createElement("div"),this._plot.className=`${t}-plot`;let e=this.el.querySelector(":scope > figcaption")?.textContent.trim();this._plot.setAttribute("role","group"),this._plot.setAttribute("aria-roledescription",t.replace(/-/g," ")),e&&this._plot.setAttribute("aria-label",e),this._cursor=document.createElement("div"),this._cursor.className=`${t}-cursor`,this._cursor.hidden=!0,this._tooltip=document.createElement("div"),this._tooltip.className=`${t}-tooltip`,this._tooltip.hidden=!0,this._tooltip.setAttribute("aria-live","polite"),this._plot.append(this._draw(),this._cursor,this._tooltip),this._generated=[this._plot,...this._guides()],this.el.append(...this._generated)}_total(t){let e=this.el.querySelector(":scope > table")?.tFoot?.rows[0];if(!e)return null;let i=document.createElement("div");i.className=t;let[s,o]=[document.createElement("span"),document.createElement("strong")];return s.textContent=e.cells[0]?.textContent.trim()??"",o.textContent=e.cells[1]?.textContent.trim()??"",i.append(o,s),i}_guides(){let t=document.createElement("ol");t.className=`${this._type}-labels`,t.setAttribute("aria-hidden","true");for(let e of this.labels){let i=document.createElement("li");i.textContent=e,t.append(i)}return[t,...this._legend()]}_legend(){if(this.series.length<2)return[];let t=document.createElement("ul");return t.className=`${this._type}-legend`,t.setAttribute("aria-hidden","true"),t.append(...this.series.map((e,i)=>{let s=document.createElement("li");return s.dataset.series=String(i%V+1),s.textContent=e.name,s})),[t]}_draw(t=this.series){let e=document.createElementNS(j,"svg");e.setAttribute("viewBox","0 0 100 100"),e.setAttribute("preserveAspectRatio","none"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false");for(let i of t){let s=document.createElementNS(j,"g");s.setAttribute("class",`${this._type}-series ${i.className}`.trim()),s.dataset.series=String(this.series.indexOf(i)%V+1);let o=[[]];i.tops.forEach((m,v)=>{m===null?o.push([]):o[o.length-1].push(v)});let r=o.filter(m=>m.length),a=(m,v)=>m.map(g=>[this._x(g),i.y(v[g])]),c=r.map(m=>ae(a(m,i.tops))),h=`line-chart-gradient-${++ri}`,l=document.createElementNS(j,"linearGradient");l.id=h,l.setAttribute("x2","0"),l.setAttribute("y2","1"),l.append(document.createElementNS(j,"stop"),document.createElementNS(j,"stop")),l.lastElementChild.setAttribute("offset","1");let u=document.createElementNS(j,"path");u.setAttribute("class",`${this._type}-area`),u.setAttribute("fill",`url(#${h})`),u.setAttribute("d",r.map((m,v)=>{if(!i.base)return`${c[v]}V100H${this._x(m[0])}Z`;let g=a(m,i.base).map(([E,L])=>[E,Math.min(100,L)]);return`${c[v]}L${ae(g.reverse()).slice(1)}Z`}).join(""));let f=document.createElementNS(j,"path");f.setAttribute("class",`${this._type}-line`),f.setAttribute("d",c.join("")),s.append(l,u,f),e.append(s)}return e}_indexAt(t){let e=this._plot.getBoundingClientRect(),i=this._horizontal?(t.clientY-e.top)/e.height:(t.clientX-e.left)/e.width,s=Math.floor((this._reversed?1-i:i)*this.labels.length);return Math.min(this.labels.length-1,Math.max(0,s))}_polarAt(t){let e=this._plot.getBoundingClientRect(),[i,s]=[t.clientX-e.left-e.width/2,t.clientY-e.top-e.height/2];return[(Math.atan2(i,-s)/(2*Math.PI)+1)%1,Math.hypot(i,s)/e.width]}get _arrows(){return this._circular?[["ArrowRight","ArrowDown"],["ArrowLeft","ArrowUp"]]:this._horizontal?[["ArrowDown"],["ArrowUp"]]:this._reversed?[["ArrowLeft"],["ArrowRight"]]:[["ArrowRight"],["ArrowLeft"]]}_keyTarget(t){let e=this.labels.length-1,[i,s]=this._arrows,o=r=>this._circular?this.activeIndex<0?r>0?0:e:(this.activeIndex+r+e+1)%(e+1):Math.min(e,Math.max(0,this.activeIndex+r));return t==="Escape"?this.activeIndex<0?void 0:-1:i.includes(t)?o(1):s.includes(t)?o(-1):{Home:0,End:e}[t]}};var W=class extends S{get _type(){return"column-chart"}get _key(){return"Expressive_ColumnChart"}get _fromZero(){return!0}get _points(){return!1}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_ColumnChart}_draw(n=this.series){let t=document.createElement("div");t.className="column-chart-columns",t.setAttribute("aria-hidden","true");let e=(i,s=n[0]?.y??this._y)=>Math.min(100,Math.max(0,s(i)));return t.style.setProperty("--zero",`${e(0)}%`),this._plot.style.setProperty("--rows",String(this.labels.length)),this.labels.forEach((i,s)=>{let o=document.createElement("div");n.forEach(r=>{let a=r.tops[s],c=r.base?.[s]??0;if(r.base&&(a===null||c===null))return;let h=document.createElement("span");a!==null&&(h.className=r.className,h.dataset.series=String(this.series.indexOf(r)%V+1),h.classList.toggle("negative",!r.base&&a<c),h.style.setProperty("--top",`${e(Math.max(c,a),r.y)}%`),h.style.setProperty("--bottom",`${100-e(Math.min(c,a),r.y)}%`),this._horizontal&&(h.dataset.text=r.text[s])),o.append(h)}),t.append(o)}),t}};var ct=class extends W{get _type(){return"bar-chart"}get _key(){return"Expressive_BarChart"}get _horizontal(){return!0}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_BarChart}_draw(){let n=super._draw();if(n.className="bar-chart-bars",n.classList.toggle("rtl",getComputedStyle(this.el).direction==="rtl"),!this.el.classList.contains("values"))return n;let t=n.cloneNode(!0);t.classList.replace("bar-chart-bars","bar-chart-values"),t.querySelectorAll("span[data-text]").forEach(i=>{i.textContent=i.dataset.text});let e=document.createElement("div");return e.className="bar-chart-layers",e.append(n,t),e}};var le=6,q=46,li=1.06,ci=.05,hi=0,ht=class extends S{get _type(){return"pie-chart"}get _key(){return"Expressive_PieChart"}get _points(){return!1}get _circular(){return!0}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_PieChart}show(n){if(!this._tooltip||n===this.activeIndex||(super.show(n),this._slices.forEach((s,o)=>s?.classList.toggle("active",o===n)),this._tooltip.hidden))return;let t=this._colors[n];this._tooltip.querySelectorAll("[data-series]").forEach(s=>{t?s.dataset.series=t:delete s.dataset.series});let e=this._share(n),i=this._tooltip.querySelector("span:nth-of-type(2)");e&&i&&(i.textContent+=` (${e})`)}_place(n){let t=(this._turns[n][0]+this._turns[n][1])/2;this._tooltip.style.setProperty("--turn",String(t)),this._tooltip.classList.toggle("end",t<.5)}_share(n){var o;let[t,e]=this._turns[n];if(e<=t)return"";let i=e-t,s=i<.1?1:0;return(o=this._percents??(this._percents=[]))[s]??(o[s]=this._percent(s)),this._percents[s].format(i)}_percent(n){let t={style:"percent",maximumFractionDigits:n};try{return new Intl.NumberFormat(this.el.closest("[lang]")?.lang||void 0,t)}catch{return new Intl.NumberFormat(void 0,t)}}_guides(){this._percents=[];let n=document.createElement("ul");n.className="pie-chart-legend",n.setAttribute("aria-hidden","true");let t=this.series[0].text;return n.append(...this.labels.map((e,i)=>{let s=document.createElement("li");this._colors[i]&&(s.dataset.series=this._colors[i]);let[o,r,a]=[e,t[i],this._share(i)].map(c=>{let h=document.createElement("span");return h.textContent=c,h});return s.append(o,r,a),s})),[n]}_indexAt(n){let[t,e]=this._polarAt(n),i=e*100,s=this.el.classList.contains("donut")&&parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-pie-chart-hole"))||0;if(i<q*s)return-1;let o=this._turns.findIndex(([r,a])=>r<=t&&t<a);return i>q*(o===this.activeIndex?li:1)?-1:o}_draw(){let n=this.series[0].values.map(g=>Math.max(0,g??0)),t=n.reduce((g,E)=>g+E,0),e=0;this._turns=n.map(g=>[e,e+=t?g/t:0]);let i=this._turns.filter(([g,E])=>E>g).length,s=0;this._colors=this._turns.map(([g,E])=>{if(E<=g)return;let L=s++;return String(L===i-1&&L>0&&L%le===0?2:L%le+1)});let o=(g,E=q)=>{let L=g*2*Math.PI;return`${(E*Math.sin(L)).toFixed(3)},${(-E*Math.cos(L)).toFixed(3)}`},r=document.createElement("div");r.className="pie-chart-pie",r.setAttribute("aria-hidden","true");let a=A("svg",{viewBox:"-50 -50 100 100",focusable:"false"}),c=`pie-chart-mask-${++hi}`,h={x:"-50",y:"-50",width:"100",height:"100"},l=A("mask",{id:c,maskUnits:"userSpaceOnUse",...h}),u=this._turns.filter(([g,E])=>E>g);l.append(A("rect",{...h,fill:"white"}),A("path",{class:"pie-chart-gaps",stroke:"black",d:u.length>1?u.map(([g])=>`M0,0L${o(g,50)}`).join(""):""}),A("circle",{class:"pie-chart-hole",r:String(q),fill:"black"}));let f=A("g",{mask:`url(#${c})`}),m=`A${q},${q} 0`;if(this._slices=this._turns.map(([g,E],L)=>{if(E<=g)return null;let M=A("path",{class:"pie-chart-slice","data-series":this._colors[L],d:E-g>=1?`M0,${-q}${m} 1 1 0,${q}${m} 1 1 0,${-q}Z`:`M0,0L${o(g)}${m} ${E-g>.5?1:0} 1 ${o(E)}Z`});return f.append(M),M}),a.append(l,f),r.append(a),this.el.classList.contains("values")){let g=document.createElement("div");g.className="pie-chart-values",this._turns.forEach(([E,L],M)=>{if(L-E<ci)return;let T=document.createElement("span");T.dataset.series=this._colors[M],T.style.setProperty("--turn",String((E+L)/2)),T.textContent=this._share(M),g.append(T)}),r.append(g)}let v=this._total("pie-chart-total");return v&&r.append(v),r}};var dt=class extends S{get _type(){return"heatmap-chart"}get _key(){return"Expressive_HeatmapChart"}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_HeatmapChart}show(n){if(!this._tooltip||n===this.activeIndex)return;let t=this._cells[n],[e,i,s,o]=t?[t.offsetLeft,t.offsetTop,t.offsetWidth,this._plot.clientWidth]:[];if(this._cells[this.activeIndex]?.classList.remove("active"),this.activeIndex=n,this._tooltip.hidden=!t,!t)return;t.classList.add("active");let r=this.series.length,[a,c]=[Math.floor(n/r),this.series[n%r]],h=document.createElement("strong");h.textContent=this.labels[a];let[l,u]=[document.createElement("span"),document.createElement("span")];l.textContent=c.name,this._levels[n]===null?l.className="gap":l.style.setProperty("--level",String(this._levels[n])),u.textContent=c.text[a],this._tooltip.replaceChildren(h,l,u);let f=e+s/2>o/2;this._tooltip.classList.toggle("end",f),this._tooltip.style.left=`${e+(f?0:s)}px`,this._tooltip.style.top=`${i}px`}_keyTarget(n){if(n==="Escape")return this.activeIndex<0?void 0:-1;let[t,e]=[this.series.length,this.labels.length-1],i=Math.max(0,this.activeIndex),[s,o]=[Math.floor(i/t),i%t],[r,a]=this._reversed?["ArrowLeft","ArrowRight"]:["ArrowRight","ArrowLeft"],c={[r]:[s,o+1],[a]:[s,o-1],ArrowDown:[s+1,o],ArrowUp:[s-1,o],Home:[s,0],End:[s,t-1]}[n];if(!c)return;if(this.activeIndex<0)return 0;let h=(l,u)=>Math.min(u,Math.max(0,l));return h(c[0],e)*t+h(c[1],t-1)}_indexAt(n){let[t,e]=[this.series.length,this.labels.length],i=this._cells[0].getBoundingClientRect(),s=this._cells[this._cells.length-1].getBoundingClientRect(),[o,r]=[Math.min(i.left,s.left),Math.max(i.right,s.right)],[a,c]=[n.clientX,n.clientY];if(a<o||a>r||c<i.top||c>s.bottom)return-1;let h=(u,f,m)=>Math.min(m-1,Math.floor(u/(f||1)*m)),l=h(a-o,r-o,t);return h(c-i.top,s.bottom-i.top,e)*t+(this._reversed?t-1-l:l)}_guides(){let n=document.createElement("div");n.className="heatmap-chart-legend",n.setAttribute("aria-hidden","true");let[t,e,i]=["span","span","span"].map(s=>document.createElement(s));return[t.textContent,i.textContent]=this._ends,e.className="heatmap-chart-scale",this._reversed&&e.style.setProperty("--heatmap-chart-to","left"),e.style.setProperty("--low",String(this._endLevels[0])),e.style.setProperty("--high",String(this._endLevels[1])),n.append(t,e,i),[n]}_draw(){let n=this.series.length,[t,e]=[1/0,-1/0];this._ends=["",""],this.series.forEach(f=>f.values.forEach((m,v)=>{m!==null&&(m<t&&([t,this._ends[0]]=[m,f.text[v]]),m>e&&([e,this._ends[1]]=[m,f.text[v]]))}));let i=f=>{let m=parseFloat(this.el.dataset[f]??"");return Number.isFinite(m)?m:this.options[f]},[s,o]=[i("min")??t,i("max")??e],r=f=>Math.min(1,Math.max(0,(f-s)/(o-s||1)));this._endLevels=[r(t),r(e)];let a=document.createElement("div");a.className="heatmap-chart-grid",a.setAttribute("aria-hidden","true"),a.style.setProperty("--columns",String(n)),a.style.setProperty("--rows",String(this.labels.length));let c=(f,m="")=>{let v=document.createElement("span");return v.className=f,v.textContent=m,v},h=f=>f?.dataset.label??f?.textContent.trim()??"",l=this.el.classList.contains("values");this._cells=[],this._levels=[],this.labels.forEach((f,m)=>{a.append(c("heatmap-chart-row",h(this._rows[m].cells[0]))),this.series.forEach(v=>{let g=v.values[m],E=g===null?null:r(g),L=c("heatmap-chart-cell",l?v.text[m]:"");E===null?L.classList.add("gap"):L.style.setProperty("--level",String(E)),this._cells.push(L),this._levels.push(E),a.append(L)})});let u=this._header.slice(1,n+1).map(h);return u.forEach((f,m)=>{if(!f)return;let v=m+1;for(;v<n&&!u[v];)v++;let g=c("heatmap-chart-column",f);g.classList.toggle("run",v>m+1),g.style.gridArea=`${this.labels.length+1} / ${m+2} / auto / ${v+2}`,a.append(g)}),a}};var ce=4,ut=class extends S{get _type(){return"radar-chart"}get _key(){return"Expressive_RadarChart"}get _fromZero(){return!0}get _circular(){return!0}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_RadarChart}_place(n){for(let e of this._cursor.children)e.style.top=`${Math.min(100,Math.max(0,parseFloat(e.style.top)))}%`;let t=this._turn(n);this._cursor.style.setProperty("--turn",String(t)),this._tooltip.style.setProperty("--turn",String(t)),this._tooltip.classList.toggle("end",t>0&&t<.5)}_turn(n){return n/this.labels.length}_guides(){return this._legend()}_indexAt(n){let[t]=this._polarAt(n);return Math.round(t*this.labels.length)%this.labels.length}_draw(){let n=(c,h)=>{let l=this._turn(c)*2*Math.PI;return`${(50*h*Math.sin(l)).toFixed(3)},${(-50*h*Math.cos(l)).toFixed(3)}`},t=c=>Math.min(1,Math.max(0,1-this._y(c)/100)),e=this.labels.map((c,h)=>h),i=c=>`M${e.map(h=>n(h,c)).join("L")}Z`,s=A("svg",{viewBox:"-50 -50 100 100","aria-hidden":"true",focusable:"false"});s.append(A("path",{class:"radar-chart-grid",d:Array.from({length:ce},(c,h)=>i((h+1)/ce)).join("")+e.map(c=>`M0,0L${n(c,1)}`).join("")}));let o=this.el.classList.contains("points");this.series.forEach((c,h)=>{let l=A("g",{class:`radar-chart-series ${c.className}`.trim(),"data-series":String(h%V+1)}),f=e.filter(m=>c.values[m]!==null).map(m=>n(m,t(c.values[m])));l.append(A("path",{class:"radar-chart-shape",d:f.length?`M${f.join("L")}Z`:""})),o&&l.append(A("path",{class:"radar-chart-points",d:f.map(m=>`M${m}h0`).join("")})),s.append(l)});let r=document.createElement("ol");r.className="radar-chart-axes",r.setAttribute("aria-hidden","true"),this.labels.forEach((c,h)=>{let l=document.createElement("li");l.textContent=c,l.style.setProperty("--turn",String(this._turn(h))),r.append(l)});let a=document.createElement("div");return a.className="radar-chart-web",a.append(s,r),a}};var he=46,di=.8,pt=class extends S{get _type(){return"radial-chart"}get _key(){return"Expressive_RadialChart"}get _points(){return!1}get _circular(){return!0}get _gauge(){return this.el.classList.contains("gauge")}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_RadialChart}show(n){if(!this._tooltip||n===this.activeIndex||(super.show(n),this._rings.forEach((e,i)=>e.classList.toggle("active",i===n)),this._tooltip.hidden))return;let t=this._color(n);this._tooltip.querySelectorAll("[data-series]").forEach(e=>{e.dataset.series=t})}_place(n){let t=this._turn(this._fractions[n]),e=this._radii[n],[i,s]=[e*Math.sin(t*2*Math.PI),-e*Math.cos(t*2*Math.PI)];this._tooltip.style.left=`${50+i}%`,this._tooltip.style.top=`${(50+s)/(this._gauge?50:100)*100}%`,this._tooltip.classList.toggle("end",i>0)}_color(n){return String(n%V+1)}_turn(n){return this._gauge?n/2-.25:n}_guides(){if(this.labels.length<2)return[];let n=document.createElement("ul");n.className="radial-chart-legend",n.setAttribute("aria-hidden","true");let t=this.series[0].text;return n.append(...this.labels.map((e,i)=>{let s=document.createElement("li");s.dataset.series=this._color(i);let[o,r]=[e,t[i]].map(a=>{let c=document.createElement("span");return c.textContent=a,c});return s.append(o,r),s})),[n]}_indexAt(n){let t=this._plot.getBoundingClientRect(),[e,i]=[n.clientX-t.left-t.width/2,n.clientY-t.top-t.width/2];if(this._gauge&&i>0)return-1;let s=Math.hypot(e,i)/t.width*100,o=this._radii.length>1?this._radii[0]-this._radii[1]:this._width;return this._radii.findIndex(r=>Math.abs(s-r)<=o/2)}_draw(){let n=getComputedStyle(this.el),t=(m,v)=>{let g=parseFloat(n.getPropertyValue(`--md-comp-radial-chart-${m}`));return Number.isFinite(g)?g:v},e=this.labels.length,[i,s]=[Math.max(0,t("thickness",8)),Math.max(0,t("gap",2))],o=Math.min(1,he*di/(e*i+(e-1)*s||1));[i,s]=[i*o,s*o],this._width=i,this._radii=this.labels.map((m,v)=>he-i/2-v*(i+s));let r=[parseFloat(this.el.dataset.max??""),this.options.max??NaN,100].find(m=>m>0);this._fractions=this.series[0].values.map(m=>Math.min(1,Math.max(0,(m??0)/r)));let a=this._gauge,c=A("svg",{viewBox:a?"-50 -50 100 50":"-50 -50 100 100",focusable:"false"}),h=a?"rotate(180)":"rotate(-90)",l=a?.5:1;this._rings=this._radii.map((m,v)=>{let g=2*Math.PI*m,E=(M,T,Z)=>{let Mt=A("circle",{class:M,r:m.toFixed(3),transform:h,"stroke-width":i.toFixed(3)}),It=Math.max(.001,T*l*g-(Z?i:0));return Mt.style.setProperty("--radial-chart-dash",`${It.toFixed(3)} ${g.toFixed(3)}`),Z&&Mt.style.setProperty("--radial-chart-offset",(-i/2).toFixed(3)),Mt},L=E("radial-chart-ring",this._fractions[v],!0);return L.dataset.series=this._color(v),this._fractions[v]||L.classList.add("empty"),c.append(E("radial-chart-track",1,a),L),L});let u=document.createElement("div");u.className="radial-chart-rings",u.setAttribute("aria-hidden","true"),u.style.setProperty("--radial-chart-middle",`${(this._radii[e-1]-this._width/2)*2}%`),u.append(c);let f=this._total("radial-chart-total");return f&&u.append(f),u}};var Ot=(d,n)=>d.className.split(/\s+/).includes(n),mt=class extends W{get _type(){return"mixed-chart"}get _key(){return"Expressive_MixedChart"}get _points(){return!0}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_MixedChart}_scale(n,t,e){let i=n.filter(r=>Ot(r,"end")),s=n.filter(r=>!i.includes(r)),o=r=>r.some(a=>Ot(a,"column"));return super._scale(i,this._number("endMin"),this._number("endMax"),o(i)),super._scale(s,t,e,o(s))}_draw(){let n=document.createElement("div");n.className="mixed-chart-marks";let t=super._draw(this.series.filter(e=>Ot(e,"column")));return t.className="mixed-chart-columns",n.append(t,S.prototype._draw.call(this,this.series.filter(e=>!Ot(e,"column")))),n}};var ui={classes:"",menuOptions:{}},P=class d extends b{constructor(t,e){super(t,e,d);this._originalLabels=new Map;this._validationMessage=null;this._handleSelectChange=()=>{this._setValueToInput(),this._setSelectedStates(),this._syncValidationError()};this._handleInvalid=t=>{t.defaultPrevented||(this._validationMessage||(this._validationMessage=document.createElement("small"),this._validationMessage.id=this.input.id+"-error",this._validationMessage.className="supporting-text",this._validationMessage.style.color="var(--md-sys-color-error)",this.wrapper.append(this._validationMessage),this.input.setAttribute("aria-describedby",[this.input.getAttribute("aria-describedby"),this._validationMessage.id].filter(Boolean).join(" "))),this.input.ariaInvalid="true",this._syncValidationError())};this._handleNativeFocus=()=>queueMicrotask(()=>{d.getInstance(this.el)===this&&this.el.matches(":focus")&&this.input.focus()});this._handleReset=t=>{clearTimeout(this._resetTimer),this._resetTimer=setTimeout(()=>{t.defaultPrevented||(this._handleSelectChange(),this._clearValidationError())},0)};this._handleOptionKeydown=t=>{(t.key===" "||t.key==="Enter")&&this._handleOptionClick(t)};this._handleOptionClick=t=>{t.preventDefault();let e=t.target.closest("li");this._selectOptionElement(e),t.stopPropagation()};this._handleOptionFocus=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest('li[role="option"]');i?.id&&this.input.setAttribute("aria-activedescendant",i.id)};this._handleInputClick=()=>{this.menu&&this.menu.isOpen&&(this._setValueToInput(),this._setSelectedStates())};!this.el.classList.contains("browser-default")&&(this.el.Expressive_FormSelect=this,this.options={...d.defaults,...e},this.isMultiple=this.el.multiple,this.nativeTabIndex=this.el.tabIndex??-1,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._setupMenu(),this._setupEventHandlers())}static get defaults(){return ui}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FormSelect}destroy(){this._removeEventHandlers(),this._clearValidationError(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,this.el.Expressive_FormSelect=void 0}refresh(){if(!this.menuEl)return;this._bindForm();let t=this.menuEl.getRootNode(),e=this._values.find(i=>i.optionEl.contains(t.activeElement))?.el;this.input.disabled=this.el.matches(":disabled"),this.wrapper.classList.toggle("disabled",this.input.disabled),this.input.disabled?this.menu?.close():this.menu||this._initMenu(),this.input.removeAttribute("aria-activedescendant"),this._rebuildOptions(),this._handleSelectChange(),this.menu&&(this.menu.focusedIndex=-1),this.menu?.isOpen&&(this.menu.recalculateDimensions(),e&&(this._values.find(i=>i.el===e)?.optionEl??this.input).focus())}_setupEventHandlers(){this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange),this.el.addEventListener("invalid",this._handleInvalid),this.el.addEventListener("focus",this._handleNativeFocus),this.input.addEventListener("click",this._handleInputClick),this.menuEl.addEventListener("focusin",this._handleOptionFocus),this._bindForm()}_bindForm(){this._form?.removeEventListener("reset",this._handleReset),this._form=this.el.form,this._form?.addEventListener("reset",this._handleReset)}_removeEventHandlers(){this._removeOptionHandlers(),this.el.removeEventListener("change",this._handleSelectChange),this.el.removeEventListener("invalid",this._handleInvalid),this.el.removeEventListener("focus",this._handleNativeFocus),this.input?.removeEventListener("click",this._handleInputClick),this.menuEl?.removeEventListener("focusin",this._handleOptionFocus),this._form?.removeEventListener("reset",this._handleReset),clearTimeout(this._resetTimer)}_setupOptionHandlers(){this.menuEl.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.addEventListener("click",this._handleOptionClick),t.addEventListener("keydown",this._handleOptionKeydown)})}_removeOptionHandlers(){this.menuEl?.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.removeEventListener("click",this._handleOptionClick),t.removeEventListener("keydown",this._handleOptionKeydown)})}_syncValidationError(){this._validationMessage&&(this.el.willValidate&&!this.el.validity.valid?this._validationMessage.textContent=this.el.validationMessage:this._clearValidationError())}_clearValidationError(){if(!this._validationMessage)return;let t=this.input.getAttribute("aria-describedby")?.split(/\s+/).filter(e=>e!==this._validationMessage.id).join(" ");t?this.input.setAttribute("aria-describedby",t):this.input.removeAttribute("aria-describedby"),this.input.ariaInvalid=this.el.ariaInvalid,this._validationMessage.remove(),this._validationMessage=null}_arraysEqual(t,e){if(t===e)return!0;if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}_selectOptionElement(t){if(!this.el.matches(":disabled")){if(!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(r=>r.optionEl===t);if(!e||e.el.matches(":disabled"))return;let i=this.getSelectedValues();this.isMultiple?this._toggleEntryFromArray(e):(this._deselectAll(),this._selectValue(e)),this._handleSelectChange();let s=this.getSelectedValues();!this._arraysEqual(i,s)&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))}this.isMultiple||this.menu?.close()}}_setupMenu(){this.labelEl=this.el.labels?.[0]??null,Array.from(this.el.labels??[]).forEach(t=>{this._originalLabels.set(t,{for:t.getAttribute("for"),id:t.getAttribute("id")})}),this.labelEl&&!this.el.closest("label")&&(this._labelPlaceholder=document.createComment(""),this.labelEl.before(this._labelPlaceholder)),this._setupWrapper(),this._hideNativeSelect(),this.el.matches(":disabled")&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement("menu"),this.menuEl.id=`select-options-${p.guid()}`,this.menuEl.setAttribute("popover","auto"),this.menuEl.setAttribute("role","listbox"),this.menuEl.ariaMultiSelectable=this.isMultiple.toString(),this.isMultiple&&this.menuEl.classList.add("multiple-select-menu"),this._buildOptions(),this.wrapper.append(this.menuEl),this._buildInput(),this._buildCaret(),this._initMenu(),this._setSelectedStates(),this._labelPlaceholder&&this.input.after(this.labelEl)}_setupWrapper(){let t=this.el.parentElement;t&&t.matches(".field")&&!t.querySelector(":scope > .hide-select")&&!t.querySelector(":scope > input, :scope > textarea")?(this.wrapper=t,this._createdWrapper=!1):(this.wrapper=document.createElement("div"),this.wrapper.classList.add("field"),this._createdWrapper=!0,this.el.before(this.wrapper)),this.options.classes.length>0&&this.wrapper.classList.add(...this.options.classes.split(" ").filter(Boolean))}_hideNativeSelect(){let t=document.createElement("div");t.classList.add("hide-select"),t.ariaHidden="true",this.el.before(t),t.appendChild(this.el),this._createdWrapper&&this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+p.guid(),this.input.classList.add("menu-trigger","no-autoinit"),this.input.type="text",this.input.readOnly=!0,this.input.setAttribute("data-target",this.menuEl.id),this.input.ariaReadOnly="true",this.input.ariaRequired=this.el.hasAttribute("required").toString(),this.input.disabled=this.el.matches(":disabled"),this.input.setAttribute("tabindex",this.nativeTabIndex.toString());let t=this.el.attributes;for(let e=0;e<t.length;++e){let i=t[e];i.name.startsWith("aria-")&&this.input.setAttribute(i.name,i.value)}this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","listbox"),this.input.ariaExpanded="false",this.input.setAttribute("aria-controls",this.menuEl.id),this.input.placeholder=" ",this._originalLabels.forEach((e,i)=>{i.htmlFor=this.input.id}),this._labelPlaceholder&&this._originalLabels.size>1&&!this.input.getAttribute("aria-label")&&!this.input.getAttribute("aria-labelledby")&&this.input.setAttribute("aria-labelledby",Array.from(this._originalLabels.keys(),(e,i)=>(e.id||(e.id=`${this.input.id}-label-${i}`),e.id)).join(" ")),this.wrapper.prepend(this.input),this._setValueToInput()}_buildCaret(){let t=document.createElement("span");t.classList.add("caret"),t.setAttribute("aria-hidden","true"),this.wrapper.prepend(t)}_initMenu(){if(this.el.matches(":disabled"))return;let t={...this.options.menuOptions};t.coverTrigger=!1;let e=t.onOpenEnd,i=t.onCloseEnd;t.onOpenEnd=()=>{let s=this.menuEl.querySelector(".selected");if(s){if(this.menu.focusedIndex=[...s.parentNode.children].indexOf(s),this.menu._focusFocusedItem(),this.menu.isScrollable){let o=s.getBoundingClientRect().top-this.menuEl.getBoundingClientRect().top;o-=this.menuEl.clientHeight/2,this.menuEl.scrollTop=o}s.id&&this.input.setAttribute("aria-activedescendant",s.id)}this.input.ariaExpanded="true",e&&typeof e=="function"&&e.call(this.menu,this.el)},t.onCloseEnd=()=>{this.input.ariaExpanded="false",this.input.removeAttribute("aria-activedescendant"),i&&typeof i=="function"&&i.call(this.menu,this.el)},t.closeOnClick=!1,this.menu=F.init(this.input,t)}_nativeOptions(){return Array.from(this.el.children).filter(t=>["OPTION","OPTGROUP"].includes(t.tagName))}_buildOptions(){this.selectOptions=this._nativeOptions(),this._values=[],this.selectOptions.forEach(t=>{if(t.tagName==="OPTION"){let e=this._createAndAppendOptionWithIcon(t,this.isMultiple?"multiple":void 0);this._addOptionToValues(t,e)}else if(t.tagName==="OPTGROUP"){let e="opt-group-"+p.guid(),i=document.createElement("li");i.classList.add("optgroup"),i.tabIndex=-1,i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e);let s=document.createElement("span");s.id=e,s.setAttribute("role","presentation"),s.textContent=t.getAttribute("label")??"",i.replaceChildren(s),this.menuEl.append(i);let o=[];Array.from(t.children).filter(a=>a.tagName==="OPTION").forEach(a=>{let c=this._createAndAppendOptionWithIcon(a,"optgroup-option");o.push(c.id),this._addOptionToValues(a,c)}),i.setAttribute("aria-owns",o.join(" "))}})}_rebuildOptions(){this._removeOptionHandlers(),this.menuEl.replaceChildren(),this._buildOptions(),this._setupOptionHandlers(),this.menu?._makeMenuFocusable()}_addOptionToValues(t,e){this._values.push({el:t,optionEl:e})}_removeMenu(){this.wrapper?.querySelector(":scope > .caret")?.remove(),this.input?.remove(),this.menuEl?.remove();let t=this.el.parentElement;t?.classList.contains("hide-select")&&t.replaceWith(this.el),this._originalLabels.forEach((e,i)=>{for(let s of["for","id"])e[s]===null?i.removeAttribute(s):i.setAttribute(s,e[s])}),this._labelPlaceholder?.replaceWith(this.labelEl),this.wrapper&&(this._createdWrapper?this.wrapper.replaceWith(this.el):(this.wrapper.classList.remove("disabled"),this.options.classes.length>0&&this.wrapper.classList.remove(...this.options.classes.split(" ").filter(Boolean))))}_createAndAppendOptionWithIcon(t,e){let i=document.createElement("li");i.id="select-option-"+p.guid(),i.setAttribute("role","option"),i.tabIndex=0;let s=this.el.matches(":disabled")||t.matches(":disabled");s&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let o=t.textContent,r=document.createElement("span");if(this.isMultiple&&!s){let l=document.createElement("label"),u=document.createElement("input");u.type="checkbox",u.tabIndex=-1;let f=document.createElement("span");f.textContent=o,l.append(u,f),r.appendChild(l)}else r.textContent=o;i.appendChild(r);let a=t.getAttribute("data-icon"),c;if(a)try{let l=new URL(a,this.el.ownerDocument.baseURI);(["http:","https:","blob:"].includes(l.protocol)||/^data:image\/(?:avif|bmp|gif|jpeg|png|svg\+xml|webp|x-icon)(?:;|,)/i.test(l.href))&&(c=l)}catch{}let h=t.getAttribute("class")?.split(" ").filter(Boolean);if(c){let l=document.createElement("img");h?.length&&l.classList.add(...h),l.src=c.href,l.ariaHidden="true",i.prepend(l)}return this.menuEl.append(i),i}_selectValue(t){t.el.selected=!0,t.optionEl.classList.add("selected"),t.optionEl.ariaSelected="true";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!0)}_deselectValue(t){t.el.selected=!1,t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!1)}_deselectAll(){this._values.forEach(t=>this._deselectValue(t))}_isValueSelected(t){return t.el.selected}_toggleEntryFromArray(t){this._isValueSelected(t)?this._deselectValue(t):this._selectValue(t)}_getSelectedOptions(){return Array.prototype.filter.call(this.el.selectedOptions,t=>t)}_setValueToInput(){this.input.value=this._getSelectedOptions().map(t=>t.textContent.trim()).join(", ")}_setSelectedStates(){this._values.forEach(t=>{let e=t.el.selected,i=t.optionEl.querySelector('input[type="checkbox"]');i&&(i.checked=e),e?this._activateOption(this.menuEl,t.optionEl):(t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false")})}_activateOption(t,e){e&&(this.isMultiple||t.querySelectorAll("li.selected").forEach(i=>i.classList.remove("selected")),e.classList.add("selected"),e.ariaSelected="true")}getSelectedValues(){return this._getSelectedOptions().map(t=>t.value)}};var pi={margin:5,transition:10,duration:250,align:"left"},ft=class d{constructor(n,t,e){this._handleDocumentClick=n=>{this.visible&&!n.composedPath().includes(this.el)&&!n.composedPath().includes(this.container)&&this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{if(this.visible)return;this.visible=!0,document.addEventListener("click",this._handleDocumentClick);let n=p._setAbsolutePosition(this.el,this.container,"bottom",this.options.margin,this.options.transition,this.options.align);this.container.style.visibility="visible",this.container.style.transition=`
|
|
6
6
|
transform ${this.options.duration}ms ease-out,
|
|
7
|
-
opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform=`translateX(${
|
|
7
|
+
opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform=`translateX(${n.x}px) translateY(${n.y}px)`,this.container.style.opacity="1"},1)};this.hide=()=>{this.visible&&(this.visible=!1,document.removeEventListener("click",this._handleDocumentClick),this.container.removeAttribute("style"),this.container.style.transition=`
|
|
8
8
|
transform ${this.options.duration}ms ease-out,
|
|
9
|
-
opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform="translateX(0px) translateY(0px)",this.container.style.opacity="0"},1))};this.el=o,this.options={...de,...e},this.container=document.createElement("div"),this.container.classList.add("display-docked"),this.container.append(t),o.parentElement.append(this.container),document.addEventListener("click",this._handleDocumentClick)}static init(o,t,e){return new d(o,t,e)}};var ue={format:"mmm dd, yyyy",parse:null,isDateRange:!1,dateRangeEndEl:null,isMultipleSelection:!1,defaultDate:null,defaultEndDate:null,setDefaultDate:!1,setDefaultEndDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearRangeReverse:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,openByDefault:!1,container:null,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"\u2039",nextMonth:"\u203A",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onDraw:null,onInputInteraction:null,displayPlugin:null,displayPluginOptions:null,onConfirm:null,onCancel:null},f=class f extends _{constructor(t,e){super(t,e,f);this.multiple=!1;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._focusedDate=null;this._handleInputClick=t=>{t.target.type=="date"&&(this.options.openByDefault||this.options.container)&&t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw(),this.gotoDate(t.target===this.el?this.date:this.endDate)}),this.displayPlugin&&this.displayPlugin.show(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===u.keys.ENTER&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this._focusedDate=t.target===this.endDateEl?this.endDate:this.date,this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this._syncCalendarFocus(!0),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))};this._handleCalendarFocus=t=>{let e=t.target;e.matches(".datepicker-day-button")&&(this._focusedDate=this._dayDate(e),this._syncCalendarFocus())};this._handleCalendarKeydown=t=>{let e=t.target;if(!e.matches(".datepicker-day-button")||t.altKey||t.ctrlKey||t.metaKey)return;let i=this._dayDate(e),s=(i.getDay()-this.options.firstDay+7)%7,n={ArrowLeft:this.options.isRTL?1:-1,ArrowRight:this.options.isRTL?-1:1,ArrowUp:-7,ArrowDown:7,Home:-s,End:6-s};if(Object.hasOwn(n,t.key))i.setDate(i.getDate()+n[t.key]);else if(t.key==="PageUp"||t.key==="PageDown"){let m=i.getDate();i.setDate(1),i.setMonth(i.getMonth()+(t.key==="PageUp"?-1:1)*(t.shiftKey?12:1));let v=new Date(i.getTime());v.setMonth(v.getMonth()+1,0),i.setDate(Math.min(m,v.getDate()))}else return;t.preventDefault();let{minDate:a,maxDate:h,minYear:c,maxYear:l,minMonth:r,maxMonth:p}=this.options;a&&i<a&&i.setTime(a.getTime()),h&&i>h&&i.setTime(h.getTime()),!(i.getFullYear()<c||i.getFullYear()>l||i.getFullYear()===c&&i.getMonth()<(r??0)||i.getFullYear()===l&&i.getMonth()>(p??11))&&(this._focusedDate=i,this.gotoDate(i))};this._handleCalendarClick=t=>{let e=t.target;e.classList.contains("is-disabled")||this._batchDraws(()=>{if(e.classList.contains("datepicker-day-button")&&!e.classList.contains("is-empty")&&!e.parentElement.classList.contains("is-disabled")&&!e.parentElement.classList.contains("is-selection-disabled")){let i=new Date(t.target.getAttribute("data-year"),t.target.getAttribute("data-month"),t.target.getAttribute("data-day"));(!this.multiple||this.multiple&&this.options.isMultipleSelection)&&this.setDate(i),this.options.isDateRange&&this._handleDateRangeCalendarClick(i),this.options.autoSubmit&&this._finishSelection()}else e.closest(".month-prev")?this.prevMonth():e.closest(".month-next")&&this.nextMonth()})};this._handleDateRangeCalendarClick=t=>{if(this.endDate==null||!f._compareDates(t,this.endDate)){if(f._isDate(this.date)&&f._comparePastDate(t,this.date))return;this.setDate(t,!1,f._isDate(this.date));return}this._clearDates(),this.draw()};this._handleClearClick=()=>{this._clearDates(),this.setInputValues()};this._clearDates=()=>{this.date=null,this.endDate=null,this.dates?.splice(0),this.draw()};this._handleMonthChange=t=>{this.gotoMonth(t.target.value)};this._handleYearChange=t=>{this.gotoYear(t.target.value)};this._handleInputChange=t=>{t.detail?.firedBy!==this&&this.setDateFromInput(t.target)};this._finishSelection=()=>{this.setInputValues()};this._confirm=()=>{this._finishSelection(),typeof this.options.onConfirm=="function"&&this.options.onConfirm.call(this)};this._cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.el.Expressive_Datepicker=this,this.options={...f.defaults,...e},e&&e.hasOwnProperty("i18n")&&typeof e.i18n=="object"&&(this.options.i18n={...f.defaults.i18n,...e.i18n}),this.options.minDate&&this.options.minDate.setHours(0,0,0,0),this.options.maxDate&&this.options.maxDate.setHours(0,0,0,0),this.id=u.guid(),this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[t]),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers(),this.options.defaultDate||(this.options.defaultDate=this._parseInput(this.el.value));let i=this.options.defaultDate;if(f._isDate(i)?this.options.setDefaultDate?(this.setDate(i,!0),this.setInputValue(this.el,i)):this.gotoDate(i):this.gotoDate(new Date),this.options.isDateRange){this.multiple=!0;let s=this.options.defaultEndDate;f._isDate(s)&&this.options.setDefaultEndDate&&(this.setDate(s,!0,!0),this.setInputValue(this.endDateEl,s))}this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=X.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return ue}static init(t,e={}){return super.init(t,e,f)}static _escape(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}static _parseDate(t){if(t=t.trim(),!/^\d{4}-\d{2}-\d{2}$/.test(t))return new Date(Date.parse(t));let e=new Date(t+"T00:00:00");return e.getDate()===Number(t.slice(-2))?e:new Date(NaN)}_parseInput(t){return!t.trim()||!this.options.parse?f._parseDate(t):this.options.parse(t,typeof this.options.format=="string"?this.options.format:"")}static _isWeekend(t){let e=t.getDay();return e===0||e===6}static _setToStartOfDay(t){f._isDate(t)&&t.setHours(0,0,0,0)}static _getDaysInMonth(t,e){return[31,f._isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}static _isLeapYear(t){return t%4===0&&t%100!==0||t%400===0}static _compareDates(t,e){return t.getTime()===e.getTime()}static _compareWithinRange(t,e,i){return t.getTime()>e.getTime()&&t.getTime()<i.getTime()}static _comparePastDate(t,e){return t.getTime()<e.getTime()}static getInstance(t){return t.Expressive_Datepicker}destroy(){this._removeEventHandlers(),this.dateEls?.slice(1).forEach(t=>this._removeDateInput(t)),!this.options.dateRangeEndEl&&this.endDateEl&&this._removeDateInput(this.endDateEl),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this.el.Expressive_Datepicker=void 0}destroySelects(){let t=this.calendarEl.querySelector(".orig-select-year");t&&k.getInstance(t).destroy();let e=this.calendarEl.querySelector(".orig-select-month");e&&k.getInstance(e).destroy()}_insertHTMLIntoDOM(){if(this.el.type=="date"&&this.el.classList.add("datepicker-date-input"),this._renderDateInputFormat(this.el),this.options.isDateRange&&(this.containerEl.classList.add("daterange"),this.options.dateRangeEndEl?(this.endDateEl=document.querySelector(this.options.dateRangeEndEl),this.endDateEl?this._renderDateInputFormat(this.endDateEl):console.warn("Specified date range end input element in dateRangeEndEl not found")):(this.endDateEl=this.createDateInput(),this.endDateEl.classList.add("datepicker-end-date"))),u.createButton(this.footer,this.options.i18n.clear,["datepicker-clear"],this.options.showClearBtn,this._handleClearClick),this.options.autoSubmit||u.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this._confirm,this._cancel),this.options.container){let t=this.options.container;this.options.container=t instanceof HTMLElement?t:document.querySelector(t),this.options.container.append(this.containerEl)}else{let t=this.endDateEl?this.endDateEl:this.el;this.options.openByDefault||this.containerEl.setAttribute("style","display: none; visibility: hidden;"),t.parentElement.after(this.containerEl)}}_renderDateInputFormat(t){let e=t.parentElement?.querySelector(".datepicker-format");e&&(e.textContent=typeof this.options.format=="function"?"":String(this.options.format))}toString(t=this.date,e=null){return e=e||this.options.format,typeof e=="function"?e(t):f._isDate(t)?this.formatDate(t,e):""}formatDate(t,e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(s=>this.formats[s]?this.formats[s](t):s).join("")}setDateFromInput(t){if(t.type==="date"&&this.setDataDate(t,f._parseDate(t.value)),(this.options.isDateRange||!this.options.isMultipleSelection)&&!t.value.trim()){this.setSingleDate(null,t===this.endDateEl),this.draw();return}let e=this._parseInput(t.value);if(!f._isDate(e))return;let i=new Date(e.getTime());f._setToStartOfDay(i);let s=t===this.endDateEl;if(this.options.isDateRange&&(s?this.date&&i<this.date:this.endDate&&i>this.endDate)){this.setInputValue(t,s?this.endDate:this.date);return}this.setDate(i,!1,s,!0)}setDate(t=null,e=!1,i=!1,s=!1){let n=this.validateDate(t);n&&(f._setToStartOfDay(n),this.options.isMultipleSelection?s||this.setMultiDate(n):this.setSingleDate(n,i),this.gotoDate(n),!e&&typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,n))}validateDate(t){if(!t)return this._renderDateDisplay(t),this.draw();if(typeof t=="string"&&(t=f._parseDate(t)),!f._isDate(t))return;let e=this.options.minDate,i=this.options.maxDate;return f._isDate(e)&&t<e?t=e:f._isDate(i)&&t>i&&(t=i),new Date(t.getTime())}setSingleDate(t,e){e?e&&(this.endDate=t):this.date=t}setMultiDate(t){let e=this.dates?.find(i=>i.getTime()===t.getTime()?i:!1);e?this.dates.splice(this.dates.indexOf(e),1):this.dates.push(t),this.dates.sort((i,s)=>i.getTime()<s.getTime()?-1:0)}setDataDate(t,e){t.setAttribute("data-date",f._isDate(e)?this.toString(e):"")}setInputValues(){if(!this.options?.isMultipleSelection){this.setInputValue(this.el,this.date),this.options?.isDateRange&&this.setInputValue(this.endDateEl,this.endDate);return}this.setMultipleSelectionInputValues()}setMultipleSelectionInputValues(){let t=Math.max(1,this.dates.length);for(let e of this.dateEls.splice(t))this._removeDateInput(e);for(;this.dateEls.length<t;)this.dateEls.push(this.createDateInput());this.dateEls.forEach((e,i)=>this.setInputValue(e,this.dates[i]??null))}setInputValue(t,e){t&&(t.type=="date"&&this.setDataDate(t,e),f._isDate(e)?t.type=="date"?t.value=this.formatDate(e,"yyyy-mm-dd"):t.value=this.toString(e):t.value="",t.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{firedBy:this}})))}_renderDateDisplay(t,e=null){let i=f._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let s=f._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(s,"mmm d")}`}}gotoDate(t){let e=!0;if(f._isDate(t)){if(this.calendars){let i=new Date(this.calendars[0].year,this.calendars[0].month,1),s=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),n=t.getTime();s.setMonth(s.getMonth()+1),s.setDate(s.getDate()-1),e=n<i.getTime()||s.getTime()<n}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}]),this.adjustCalendars()}}adjustCalendars(){this.calendars[0]=this.adjustCalendar(this.calendars[0]),this.draw()}adjustCalendar(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t}nextMonth(){this.calendars[0].month++,this.adjustCalendars()}prevMonth(){this.calendars[0].month--,this.adjustCalendars()}render(t,e,i){let s=new Date,n=f._getDaysInMonth(t,e),a=[],h=new Date(t,e,1).getDay(),c=[];f._setToStartOfDay(s),this.options.firstDay>0&&(h-=this.options.firstDay,h<0&&(h+=7));let l=e===0?11:e-1,r=e===11?0:e+1,p=e===0?t-1:t,m=e===11?t+1:t,v=f._getDaysInMonth(p,l),E=n+h,b=E;for(;b>7;)b-=7;E+=7-b;let y=!1;for(let I=0,A=0;I<E;I++){let M=new Date(t,e,1+(I-h)),Dt=f._compareDates(M,s),kt=this.options.events.indexOf(M.toDateString())!==-1,_t=I<h||I>=n+h,At=this.options.startRange&&f._compareDates(this.options.startRange,M),St=this.options.endRange&&f._compareDates(this.options.endRange,M),Ot=this.options.startRange&&this.options.endRange&&this.options.startRange<M&&M<this.options.endRange,Ht=this.options.minDate&&M<this.options.minDate||this.options.maxDate&&M>this.options.maxDate||this.options.disableWeekends&&f._isWeekend(M)||this.options.disableDayFn&&this.options.disableDayFn(M),Rt=this.options.isDateRange&&this.date&&this.endDate&&f._compareDates(this.date,M),Pt=this.options.isDateRange&&this.endDate&&f._compareDates(this.endDate,M),Bt=this.options.isDateRange&&f._isDate(this.date)&&f._isDate(this.endDate)&&f._compareWithinRange(M,this.date,this.endDate),nt=1+(I-h),ct=e,dt=t,ot=!1;f._isDate(this.date)&&(ot=f._compareDates(M,this.date)),!ot&&f._isDate(this.endDate)&&(ot=f._compareDates(M,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(Wt=>Wt.getTime()===M.getTime())&&(ot=!0),_t&&(I<h?(nt=v+nt,ct=l,dt=p):(nt=nt-n,ct=r,dt=m));let Nt={day:nt,month:ct,year:dt,hasEvent:kt,isSelected:ot,isToday:Dt,isDisabled:Ht,isEmpty:_t,isStartRange:At,isEndRange:St,isInRange:Ot,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:Rt,isDateRangeEnd:Pt,isDateRange:Bt};c.push(this.renderDay(Nt)),++A===7&&(a.push(this.renderRow(c,this.options.isRTL,y)),c=[],A=0,y=!1)}return this.renderTable(this.options,a,i)}renderDay(t){let e={isDisabled:"is-disabled",isToday:"is-today",isSelected:"is-selected",hasEvent:"has-event",isInRange:"is-inrange",isStartRange:"is-startrange",isEndRange:"is-endrange",isDateRangeStart:"is-daterange-start",isDateRangeEnd:"is-daterange-end",isDateRange:"is-daterange"},i=["isSelected","isDateRange"].filter(c=>!!(t.hasOwnProperty(c)&&t[c]===!0)).length!==0,s=["datepicker-day"];if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)s.push("is-outside-current-month"),s.push("is-selection-disabled");else return'<td class="is-empty"></td>';for(let[c,l]of Object.entries(e))t.hasOwnProperty(c)&&t[c]&&s.push(l);let n=f._escape(t.day),a=f._escape(t.month),h=f._escape(t.year);return`<td data-day="${n}" class="${s.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${h}" data-month="${a}" data-day="${n}">${n}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+f._calendarMarkup((e?t.reverse():t).join(""),"tr")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+f._escape(i)+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let s=f._escape(this.renderDayName(t,i)),n=f._escape(this.renderDayName(t,i,!0));e.push(`<th scope="col"><abbr title="${s}">${n}</abbr></th>`)}return"<thead><tr>"+(t.isRTL?e.reverse():e).join("")+"</tr></thead>"}renderBody(t){return"<tbody>"+f._calendarMarkup(t.join(""),"tbody")+"</tbody>"}static _calendarMarkup(t,e){let i=document.createElement("template");i.innerHTML=t;let s={tr:["class"],td:["class","data-day","aria-selected"],button:["class","type","data-year","data-month","data-day","aria-label","disabled","tabindex"]},n=(a,h)=>{if(a.nodeType===Node.TEXT_NODE){if((h==="tbody"||h==="tr")&&a.textContent.trim())throw new TypeError("Unsupported calendar row content");return f._escape(a.textContent)}if(!(a instanceof HTMLElement))throw new TypeError("Unsupported calendar row content");let c=a.localName==="tr"?"tr":a.localName==="td"?"td":a.localName==="button"?"button":null;if(!c||!(h==="tbody"&&c==="tr"||h==="tr"&&c==="td"||h==="td"&&c==="button"))throw new TypeError("Unsupported calendar row element");if([...a.attributes].some(r=>!s[c].includes(r.name)))throw new TypeError("Unsupported calendar row attribute");if(c==="button"&&a.getAttribute("type")!=="button")throw new TypeError('Calendar day buttons require type="button"');let l=s[c].filter(r=>a.hasAttribute(r)).map(r=>` ${r}="${f._escape(a.getAttribute(r))}"`).join("");return`<${c}${l}>${[...a.childNodes].map(r=>n(r,c)).join("")}</${c}>`};return[...i.content.childNodes].map(a=>n(a,e)).join("")}_arrowState(t,e){let i=this.options,s=t===i.minYear,n=t===i.maxYear;return{prev:!(s&&(e===0||i.minMonth>=e)),next:!(n&&(e===11||i.maxMonth<=e))}}_controlsCacheKey(t){let e=this.options;return[t,e.minYear,e.maxYear,e.minMonth,e.maxMonth,Array.isArray(e.yearRange)?e.yearRange.join("-"):e.yearRange,e.yearRangeReverse,e.showMonthAfterYear].join("|")}renderTitle(t,e,i,s,n,a){let h=this.options,c=i===h.minYear,l=i===h.maxYear,r,p,m=[],v='<div id="'+f._escape(a)+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:E,next:b}=this._arrowState(i,s);for(r=0;r<12;r++)m.push('<option value="'+(i===n?r-e:12+r-e)+'"'+(r===s?' selected="selected"':"")+(c&&r<h.minMonth||l&&r>h.maxMonth?'disabled="disabled"':"")+">"+f._escape(h.i18n.months[r])+"</option>");let y='<select class="datepicker-select orig-select-month" tabindex="-1">'+m.join("")+"</select>";for(Array.isArray(h.yearRange)?(r=h.yearRange[0],p=h.yearRange[1]+1):(r=i-h.yearRange,p=1+i+h.yearRange),m=[];r<p&&r<=h.maxYear;r++)r>=h.minYear&&m.push(`<option value="${r}" ${r===i?'selected="selected"':""}>${r}</option>`);h.yearRangeReverse&&m.reverse();let I=`<select class="datepicker-select orig-select-year" tabindex="-1">${m.join("")}</select>`;return v+=`<button class="month-prev${E?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg></button>`,v+='<div class="selects-container">',h.showMonthAfterYear?v+=I+y:v+=y+I,v+="</div>",v+=`<button class="month-next${b?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg></button>`,v+="</div>"}_batchDraws(t){this._drawDepth++;try{t()}finally{this._drawDepth--,this._drawDepth===0&&this._drawDirty&&(this._drawDirty=!1,this.draw())}}draw(){if(this._drawDepth>0){this._drawDirty=!0;return}let t=this.calendarEl.getRootNode().activeElement,e=t?.matches(".datepicker-day-button")&&this.calendarEl.contains(t),i=this.calendarEl.contains(t)&&t?.matches(".month-prev, .month-next")?t.classList.contains("month-prev")?".month-prev":".month-next":null,s=this.options,n=s.minYear,a=s.maxYear,h=s.minMonth,c=s.maxMonth;this._y<=n&&(this._y=n,!isNaN(h)&&this._m<h&&(this._m=h)),this._y>=a&&(this._y=a,!isNaN(c)&&this._m>c&&(this._m=c));let l=this.calendars[0].year,r=this.calendars[0].month;this.options.isDateRange?this._renderDateDisplay(this.date,this.endDate):this._renderDateDisplay(this.date);let p=this._controlsCacheKey(l);p===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(l,r):(this._controlsKey=p,this._randId="datepicker-title-"+u.guid(),this._rebuildControls(l,r)),this._renderCalendarTable(l,r),this._syncCalendarFocus(!!e),i&&this.calendarEl.querySelector(i)?.focus(),typeof this.options.onDraw=="function"&&this.options.onDraw.call(this)}_rebuildControls(t,e){this.destroySelects(),this.calendarEl.innerHTML=this.renderTitle(this,0,t,e,t,this._randId);let i=this.calendarEl.querySelector(".orig-select-year"),s=this.calendarEl.querySelector(".orig-select-month");k.init(i,{classes:"select-year",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),k.init(s,{classes:"select-month",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),i.addEventListener("change",this._handleYearChange),s.addEventListener("change",this._handleMonthChange)}_reuseControls(t,e){let i=this.calendarEl.querySelector(".orig-select-month");i&&i.value!==e.toString()&&(i.value=e.toString(),k.getInstance(i)?.refresh());let{prev:s,next:n}=this._arrowState(t,e);this.calendarEl.querySelector(".month-prev")?.classList.toggle("is-disabled",!s),this.calendarEl.querySelector(".month-next")?.classList.toggle("is-disabled",!n)}_renderCalendarTable(t,e){let i=this.render(t,e,this._randId),s=this.calendarEl.querySelector(".datepicker-table-wrapper");s?s.outerHTML=i:this.calendarEl.insertAdjacentHTML("beforeend",i)}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("change",this._handleInputChange),this.endDateEl?.addEventListener("click",this._handleInputClick),this.endDateEl?.addEventListener("keydown",this._handleInputKeydown),this.endDateEl?.addEventListener("change",this._handleInputChange),this.calendarEl.addEventListener("click",this._handleCalendarClick),this.calendarEl.addEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.addEventListener("focusin",this._handleCalendarFocus)}_setupVariables(){let t=document.createElement("template");t.innerHTML=f._template.trim(),this.containerEl=t.content.firstChild,this.calendarEl=this.containerEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.containerEl.querySelector(".year-text"),this.dateTextEl=this.containerEl.querySelector(".date-text"),this.footer=this.containerEl.querySelector(".datepicker-footer"),this.formats={d:e=>e.getDate(),dd:e=>{let i=e.getDate();return(i<10?"0":"")+i},ddd:e=>this.options.i18n.weekdaysShort[e.getDay()],dddd:e=>this.options.i18n.weekdays[e.getDay()],m:e=>e.getMonth()+1,mm:e=>{let i=e.getMonth()+1;return(i<10?"0":"")+i},mmm:e=>this.options.i18n.monthsShort[e.getMonth()],mmmm:e=>this.options.i18n.months[e.getMonth()],yy:e=>(""+e.getFullYear()).slice(2),yyyy:e=>e.getFullYear()}}_removeEventHandlers(){for(let t of this.dateEls??[this.el])this._removeInputEventHandlers(t);this.calendarEl.removeEventListener("click",this._handleCalendarClick),this.calendarEl.removeEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.removeEventListener("focusin",this._handleCalendarFocus),this.options.isDateRange&&this.endDateEl&&this._removeInputEventHandlers(this.endDateEl)}_removeInputEventHandlers(t){t.removeEventListener("click",this._handleInputClick),t.removeEventListener("keydown",this._handleInputKeydown),t.removeEventListener("change",this._handleInputChange)}_removeDateInput(t){let e=t.getRootNode().activeElement===t;this._removeInputEventHandlers(t),t.remove(),e&&document.activeElement===document.body&&this.el.focus()}_dayDate(t){let e=new Date(0);return e.setFullYear(Number(t.dataset.year),Number(t.dataset.month),Number(t.dataset.day)),f._setToStartOfDay(e),e}_syncCalendarFocus(t=!1){let e=[...this.calendarEl.querySelectorAll(".datepicker-day-button")],i=e.filter(a=>!a.parentElement.classList.contains("is-selection-disabled")),s=this._focusedDate||this.date||new Date,n=i.find(a=>f._compareDates(this._dayDate(a),s))||i.find(a=>a.parentElement.classList.contains("is-selected"))||i.find(a=>!a.parentElement.classList.contains("is-disabled"))||i[0];for(let a of e)a.tabIndex=a===n?0:-1,a.setAttribute("aria-disabled",String(a.parentElement.matches(".is-disabled, .is-selection-disabled")));n&&(this._focusedDate=this._dayDate(n),t&&n.focus())}gotoMonth(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}gotoYear(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}renderDayName(t,e,i=!1){for(e+=t.firstDay;e>=7;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}createDateInput(){let t=this.el.cloneNode(!0);return t.removeAttribute("id"),t.classList.add("no-autoinit"),t.addEventListener("click",this._handleInputClick),t.addEventListener("keydown",this._handleInputKeydown),t.addEventListener("change",this._handleInputChange),this.el.parentElement.appendChild(t),t}};f._template=`
|
|
9
|
+
opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform="translateX(0px) translateY(0px)",this.container.style.opacity="0"},1))};this.el=n,this.options={...pi,...e},this.container=document.createElement("div"),this.container.classList.add("display-docked"),this.container.append(t),n.parentElement.append(this.container)}static init(n,t,e){return new d(n,t,e)}};var mi={format:"mmm dd, yyyy",parse:null,isDateRange:!1,dateRangeEndEl:null,isMultipleSelection:!1,defaultDate:null,defaultEndDate:null,setDefaultDate:!1,setDefaultEndDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearRangeReverse:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,openByDefault:!1,container:null,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"\u2039",nextMonth:"\u203A",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onDraw:null,onInputInteraction:null,displayPlugin:null,displayPluginOptions:null,onConfirm:null,onCancel:null},_=class _ extends b{constructor(t,e){super(t,e,_);this.multiple=!1;this._checkedRows=new Set;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._focusedDate=null;this._handleInputClick=t=>{t.target.type=="date"&&(this.options.openByDefault||this.options.container)&&t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw(),this.gotoDate(t.target===this.el?this.date:this.endDate)}),this.displayPlugin&&this.displayPlugin.show(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===p.keys.ENTER&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this._focusedDate=t.target===this.endDateEl?this.endDate:this.date,this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this._syncCalendarFocus(!0),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))};this._handleCalendarFocus=t=>{let e=t.target;e.matches(".datepicker-day-button")&&(this._focusedDate=this._dayDate(e),this._syncCalendarFocus())};this._handleCalendarKeydown=t=>{let e=t.target;if(!e.matches(".datepicker-day-button")||t.altKey||t.ctrlKey||t.metaKey)return;let i=this._dayDate(e),s=(i.getDay()-this.options.firstDay+7)%7,o={ArrowLeft:this.options.isRTL?1:-1,ArrowRight:this.options.isRTL?-1:1,ArrowUp:-7,ArrowDown:7,Home:-s,End:6-s};if(Object.hasOwn(o,t.key))i.setDate(i.getDate()+o[t.key]);else if(t.key==="PageUp"||t.key==="PageDown"){let v=i.getDate();i.setDate(1),i.setMonth(i.getMonth()+(t.key==="PageUp"?-1:1)*(t.shiftKey?12:1));let g=new Date(i.getTime());g.setMonth(g.getMonth()+1,0),i.setDate(Math.min(v,g.getDate()))}else return;t.preventDefault();let{minDate:r,maxDate:a,minYear:c,maxYear:h,minMonth:l,maxMonth:u}=this.options;if(r&&i<r&&i.setTime(r.getTime()),a&&i>a&&i.setTime(a.getTime()),i.getFullYear()<c||i.getFullYear()>h||i.getFullYear()===c&&i.getMonth()<(l??0)||i.getFullYear()===h&&i.getMonth()>(u??11))return;this._focusedDate=i;let{year:f,month:m}=this.calendars[0];i.getFullYear()===f&&i.getMonth()===m?this._syncCalendarFocus(!0):this.gotoDate(i)};this._handleCalendarClick=t=>{let e=t.target;e.classList.contains("is-disabled")||this._batchDraws(()=>{if(e.classList.contains("datepicker-day-button")&&!e.classList.contains("is-empty")&&!e.parentElement.classList.contains("is-disabled")&&!e.parentElement.classList.contains("is-selection-disabled")){let i=new Date(t.target.getAttribute("data-year"),t.target.getAttribute("data-month"),t.target.getAttribute("data-day"));(!this.multiple||this.multiple&&this.options.isMultipleSelection)&&this.setDate(i),this.options.isDateRange&&this._handleDateRangeCalendarClick(i),this.options.autoSubmit&&this._finishSelection()}else e.closest(".month-prev")?this.prevMonth():e.closest(".month-next")&&this.nextMonth()})};this._handleDateRangeCalendarClick=t=>{if(this.endDate==null||!_._compareDates(t,this.endDate)){if(_._isDate(this.date)&&_._comparePastDate(t,this.date))return;this.setDate(t,!1,_._isDate(this.date));return}this._clearDates(),this.draw()};this._handleClearClick=()=>{this._clearDates(),this.setInputValues()};this._clearDates=()=>{this.date=null,this.endDate=null,this.dates?.splice(0),this.draw()};this._handleMonthChange=t=>{this.gotoMonth(t.target.value)};this._handleYearChange=t=>{this.gotoYear(t.target.value)};this._handleInputChange=t=>{t.detail?.firedBy!==this&&this.setDateFromInput(t.target)};this._finishSelection=()=>{this.setInputValues()};this._confirm=()=>{this._finishSelection(),typeof this.options.onConfirm=="function"&&this.options.onConfirm.call(this)};this._cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.el.Expressive_Datepicker=this,this.options={..._.defaults,...e},e&&e.hasOwnProperty("i18n")&&typeof e.i18n=="object"&&(this.options.i18n={..._.defaults.i18n,...e.i18n}),this.options.minDate&&this.options.minDate.setHours(0,0,0,0),this.options.maxDate&&this.options.maxDate.setHours(0,0,0,0),this.id=p.guid(),this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[t]),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers(),this.options.defaultDate||(this.options.defaultDate=this._parseInput(this.el.value));let i=this.options.defaultDate;if(_._isDate(i)?this.options.setDefaultDate?(this.setDate(i,!0),this.setInputValue(this.el,i)):this.gotoDate(i):this.gotoDate(new Date),this.options.isDateRange){this.multiple=!0;let s=this.options.defaultEndDate;_._isDate(s)&&this.options.setDefaultEndDate&&(this.setDate(s,!0,!0),this.setInputValue(this.endDateEl,s))}this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=ft.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return mi}static init(t,e={}){return super.init(t,e,_)}static _escape(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}static _parseDate(t){if(t=t.trim(),!/^\d{4}-\d{2}-\d{2}$/.test(t))return new Date(Date.parse(t));let e=new Date(t+"T00:00:00");return e.getDate()===Number(t.slice(-2))?e:new Date(NaN)}_parseInput(t){return!t.trim()||!this.options.parse?_._parseDate(t):this.options.parse(t,typeof this.options.format=="string"?this.options.format:"")}static _isWeekend(t){let e=t.getDay();return e===0||e===6}static _setToStartOfDay(t){_._isDate(t)&&t.setHours(0,0,0,0)}static _getDaysInMonth(t,e){return[31,_._isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}static _isLeapYear(t){return t%4===0&&t%100!==0||t%400===0}static _compareDates(t,e){return t.getTime()===e.getTime()}static _compareWithinRange(t,e,i){return t.getTime()>e.getTime()&&t.getTime()<i.getTime()}static _comparePastDate(t,e){return t.getTime()<e.getTime()}static getInstance(t){return t.Expressive_Datepicker}destroy(){this._removeEventHandlers(),this.dateEls?.slice(1).forEach(t=>this._removeDateInput(t)),!this.options.dateRangeEndEl&&this.endDateEl&&this._removeDateInput(this.endDateEl),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this.el.Expressive_Datepicker=void 0}destroySelects(){let t=this.calendarEl.querySelector(".orig-select-year");t&&P.getInstance(t).destroy();let e=this.calendarEl.querySelector(".orig-select-month");e&&P.getInstance(e).destroy()}_insertHTMLIntoDOM(){if(this.el.type=="date"&&this.el.classList.add("datepicker-date-input"),this._renderDateInputFormat(this.el),this.options.isDateRange&&(this.containerEl.classList.add("daterange"),this.options.dateRangeEndEl?(this.endDateEl=document.querySelector(this.options.dateRangeEndEl),this.endDateEl?this._renderDateInputFormat(this.endDateEl):console.warn("Specified date range end input element in dateRangeEndEl not found")):(this.endDateEl=this.createDateInput(),this.endDateEl.classList.add("datepicker-end-date"))),p.createButton(this.footer,this.options.i18n.clear,["datepicker-clear"],this.options.showClearBtn,this._handleClearClick),this.options.autoSubmit||p.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this._confirm,this._cancel),this.options.container){let t=this.options.container;this.options.container=t instanceof HTMLElement?t:document.querySelector(t),this.options.container.append(this.containerEl)}else{let t=this.endDateEl?this.endDateEl:this.el;this.options.openByDefault||this.containerEl.setAttribute("style","display: none; visibility: hidden;"),t.parentElement.after(this.containerEl)}}_renderDateInputFormat(t){let e=t.parentElement?.querySelector(".datepicker-format");e&&(e.textContent=typeof this.options.format=="function"?"":String(this.options.format))}toString(t=this.date,e=null){return e=e||this.options.format,typeof e=="function"?e(t):_._isDate(t)?this.formatDate(t,e):""}formatDate(t,e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(s=>this.formats[s]?this.formats[s](t):s).join("")}setDateFromInput(t){if(t.type==="date"&&this.setDataDate(t,_._parseDate(t.value)),(this.options.isDateRange||!this.options.isMultipleSelection)&&!t.value.trim()){this.setSingleDate(null,t===this.endDateEl),this.draw();return}let e=this._parseInput(t.value);if(!_._isDate(e))return;let i=new Date(e.getTime());_._setToStartOfDay(i);let s=t===this.endDateEl;if(this.options.isDateRange&&(s?this.date&&i<this.date:this.endDate&&i>this.endDate)){this.setInputValue(t,s?this.endDate:this.date);return}this.setDate(i,!1,s,!0)}setDate(t=null,e=!1,i=!1,s=!1){let o=this.validateDate(t);o&&(_._setToStartOfDay(o),this.options.isMultipleSelection?s||this.setMultiDate(o):this.setSingleDate(o,i),this.gotoDate(o),!e&&typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,o))}validateDate(t){if(!t)return this._renderDateDisplay(t),this.draw();if(typeof t=="string"&&(t=_._parseDate(t)),!_._isDate(t))return;let e=this.options.minDate,i=this.options.maxDate;return _._isDate(e)&&t<e?t=e:_._isDate(i)&&t>i&&(t=i),new Date(t.getTime())}setSingleDate(t,e){e?e&&(this.endDate=t):this.date=t}setMultiDate(t){let e=this.dates?.find(i=>i.getTime()===t.getTime()?i:!1);e?this.dates.splice(this.dates.indexOf(e),1):this.dates.push(t),this.dates.sort((i,s)=>i.getTime()<s.getTime()?-1:0)}setDataDate(t,e){t.setAttribute("data-date",_._isDate(e)?this.toString(e):"")}setInputValues(){if(!this.options?.isMultipleSelection){this.setInputValue(this.el,this.date),this.options?.isDateRange&&this.setInputValue(this.endDateEl,this.endDate);return}this.setMultipleSelectionInputValues()}setMultipleSelectionInputValues(){let t=Math.max(1,this.dates.length);for(let e of this.dateEls.splice(t))this._removeDateInput(e);for(;this.dateEls.length<t;)this.dateEls.push(this.createDateInput());this.dateEls.forEach((e,i)=>this.setInputValue(e,this.dates[i]??null))}setInputValue(t,e){t&&(t.type=="date"&&this.setDataDate(t,e),_._isDate(e)?t.type=="date"?t.value=this.formatDate(e,"yyyy-mm-dd"):t.value=this.toString(e):t.value="",t.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{firedBy:this}})))}_renderDateDisplay(t,e=null){let i=_._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let s=_._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(s,"mmm d")}`}}gotoDate(t){let e=!0;if(_._isDate(t)){if(this.calendars){let i=new Date(this.calendars[0].year,this.calendars[0].month,1),s=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=t.getTime();s.setMonth(s.getMonth()+1),s.setDate(s.getDate()-1),e=o<i.getTime()||s.getTime()<o}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}]),this.adjustCalendars()}}adjustCalendars(){this.calendars[0]=this.adjustCalendar(this.calendars[0]),this.draw()}adjustCalendar(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t}nextMonth(){this.calendars[0].month++,this.adjustCalendars()}prevMonth(){this.calendars[0].month--,this.adjustCalendars()}render(t,e,i){let s=new Date,o=_._getDaysInMonth(t,e),r=[],a=new Date(t,e,1).getDay(),c=[];_._setToStartOfDay(s),this.options.firstDay>0&&(a-=this.options.firstDay,a<0&&(a+=7));let h=e===0?11:e-1,l=e===11?0:e+1,u=e===0?t-1:t,f=e===11?t+1:t,m=_._getDaysInMonth(u,h),v=o+a,g=v;for(;g>7;)g-=7;v+=7-g;let E=!1;for(let L=0,M=0;L<v;L++){let T=new Date(t,e,1+(L-a)),Z=_._compareDates(T,s),Mt=this.options.events.indexOf(T.toDateString())!==-1,It=L<a||L>=o+a,ge=this.options.startRange&&_._compareDates(this.options.startRange,T),_e=this.options.endRange&&_._compareDates(this.options.endRange,T),Ee=this.options.startRange&&this.options.endRange&&this.options.startRange<T&&T<this.options.endRange,be=this.options.minDate&&T<this.options.minDate||this.options.maxDate&&T>this.options.maxDate||this.options.disableWeekends&&_._isWeekend(T)||this.options.disableDayFn&&this.options.disableDayFn(T),ye=this.options.isDateRange&&this.date&&this.endDate&&_._compareDates(this.date,T),Le=this.options.isDateRange&&this.endDate&&_._compareDates(this.endDate,T),Te=this.options.isDateRange&&_._isDate(this.date)&&_._isDate(this.endDate)&&_._compareWithinRange(T,this.date,this.endDate),xt=1+(L-a),Bt=e,Nt=t,Ct=!1;_._isDate(this.date)&&(Ct=_._compareDates(T,this.date)),!Ct&&_._isDate(this.endDate)&&(Ct=_._compareDates(T,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(xe=>xe.getTime()===T.getTime())&&(Ct=!0),It&&(L<a?(xt=m+xt,Bt=h,Nt=u):(xt=xt-o,Bt=l,Nt=f));let Me={day:xt,month:Bt,year:Nt,hasEvent:Mt,isSelected:Ct,isToday:Z,isDisabled:be,isEmpty:It,isStartRange:ge,isEndRange:_e,isInRange:Ee,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:ye,isDateRangeEnd:Le,isDateRange:Te};c.push(this.renderDay(Me)),++M===7&&(r.push(this.renderRow(c,this.options.isRTL,E)),c=[],M=0,E=!1)}return this.renderTable(this.options,r,i)}renderDay(t){let e={isDisabled:"is-disabled",isToday:"is-today",isSelected:"is-selected",hasEvent:"has-event",isInRange:"is-inrange",isStartRange:"is-startrange",isEndRange:"is-endrange",isDateRangeStart:"is-daterange-start",isDateRangeEnd:"is-daterange-end",isDateRange:"is-daterange"},i=["isSelected","isDateRange"].filter(c=>!!(t.hasOwnProperty(c)&&t[c]===!0)).length!==0,s=["datepicker-day"];if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)s.push("is-outside-current-month"),s.push("is-selection-disabled");else return'<td class="is-empty"></td>';for(let[c,h]of Object.entries(e))t.hasOwnProperty(c)&&t[c]&&s.push(h);let o=_._escape(t.day),r=_._escape(t.month),a=_._escape(t.year);return`<td data-day="${o}" class="${s.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${a}" data-month="${r}" data-day="${o}">${o}</button></td>`}renderRow(t,e,i){let s='<tr class="datepicker-row'+(i?" is-selected":"")+'">'+_._calendarMarkup((e?t.reverse():t).join(""),"tr")+"</tr>";return this._checkedRows.add(s),s}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+_._escape(i)+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let s=_._escape(this.renderDayName(t,i)),o=_._escape(this.renderDayName(t,i,!0));e.push(`<th scope="col"><abbr title="${s}">${o}</abbr></th>`)}return"<thead><tr>"+(t.isRTL?e.reverse():e).join("")+"</tr></thead>"}renderBody(t){let e=t.join(""),i=t.every(s=>this._checkedRows.has(s));return this._checkedRows.clear(),"<tbody>"+(i?e:_._calendarMarkup(e,"tbody"))+"</tbody>"}static _calendarMarkup(t,e){let i=document.createElement("template");i.innerHTML=t;let s={tr:["class"],td:["class","data-day","aria-selected"],button:["class","type","data-year","data-month","data-day","aria-label","disabled","tabindex"]},o=(r,a)=>{if(r.nodeType===Node.TEXT_NODE){if((a==="tbody"||a==="tr")&&r.textContent.trim())throw new TypeError("Unsupported calendar row content");return _._escape(r.textContent)}if(!(r instanceof HTMLElement))throw new TypeError("Unsupported calendar row content");let c=r.localName==="tr"?"tr":r.localName==="td"?"td":r.localName==="button"?"button":null;if(!c||!(a==="tbody"&&c==="tr"||a==="tr"&&c==="td"||a==="td"&&c==="button"))throw new TypeError("Unsupported calendar row element");if([...r.attributes].some(l=>!s[c].includes(l.name)))throw new TypeError("Unsupported calendar row attribute");if(c==="button"&&r.getAttribute("type")!=="button")throw new TypeError('Calendar day buttons require type="button"');let h=s[c].filter(l=>r.hasAttribute(l)).map(l=>` ${l}="${_._escape(r.getAttribute(l))}"`).join("");return`<${c}${h}>${[...r.childNodes].map(l=>o(l,c)).join("")}</${c}>`};return[...i.content.childNodes].map(r=>o(r,e)).join("")}_arrowState(t,e){let i=this.options,s=t===i.minYear,o=t===i.maxYear;return{prev:!(s&&(e===0||i.minMonth>=e)),next:!(o&&(e===11||i.maxMonth<=e))}}_controlsCacheKey(t){let e=this.options;return[t,e.minYear,e.maxYear,e.minMonth,e.maxMonth,Array.isArray(e.yearRange)?e.yearRange.join("-"):e.yearRange,e.yearRangeReverse,e.showMonthAfterYear].join("|")}renderTitle(t,e,i,s,o,r){let a=this.options,c=i===a.minYear,h=i===a.maxYear,l,u,f=[],m='<div id="'+_._escape(r)+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:v,next:g}=this._arrowState(i,s);for(l=0;l<12;l++)f.push('<option value="'+(i===o?l-e:12+l-e)+'"'+(l===s?' selected="selected"':"")+(c&&l<a.minMonth||h&&l>a.maxMonth?'disabled="disabled"':"")+">"+_._escape(a.i18n.months[l])+"</option>");let E='<select class="datepicker-select orig-select-month" tabindex="-1">'+f.join("")+"</select>";for(Array.isArray(a.yearRange)?(l=a.yearRange[0],u=a.yearRange[1]+1):(l=i-a.yearRange,u=1+i+a.yearRange),f=[];l<u&&l<=a.maxYear;l++)l>=a.minYear&&f.push(`<option value="${l}" ${l===i?'selected="selected"':""}>${l}</option>`);a.yearRangeReverse&&f.reverse();let L=`<select class="datepicker-select orig-select-year" tabindex="-1">${f.join("")}</select>`;return m+=`<button class="month-prev${v?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg></button>`,m+='<div class="selects-container">',a.showMonthAfterYear?m+=L+E:m+=E+L,m+="</div>",m+=`<button class="month-next${g?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg></button>`,m+="</div>"}_batchDraws(t){this._drawDepth++;try{t()}finally{this._drawDepth--,this._drawDepth===0&&this._drawDirty&&(this._drawDirty=!1,this.draw())}}draw(){if(this._drawDepth>0){this._drawDirty=!0;return}let t=this.calendarEl.getRootNode().activeElement,e=t?.matches(".datepicker-day-button")&&this.calendarEl.contains(t),i=this.calendarEl.contains(t)&&t?.matches(".month-prev, .month-next")?t.classList.contains("month-prev")?".month-prev":".month-next":null,s=this.options,o=s.minYear,r=s.maxYear,a=s.minMonth,c=s.maxMonth;this._y<=o&&(this._y=o,!isNaN(a)&&this._m<a&&(this._m=a)),this._y>=r&&(this._y=r,!isNaN(c)&&this._m>c&&(this._m=c));let h=this.calendars[0].year,l=this.calendars[0].month;this.options.isDateRange?this._renderDateDisplay(this.date,this.endDate):this._renderDateDisplay(this.date);let u=this._controlsCacheKey(h);u===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(h,l):(this._controlsKey=u,this._randId="datepicker-title-"+p.guid(),this._rebuildControls(h,l)),this._renderCalendarTable(h,l),this._syncCalendarFocus(!!e),i&&this.calendarEl.querySelector(i)?.focus(),typeof this.options.onDraw=="function"&&this.options.onDraw.call(this)}_rebuildControls(t,e){this.destroySelects(),this.calendarEl.innerHTML=this.renderTitle(this,0,t,e,t,this._randId);let i=this.calendarEl.querySelector(".orig-select-year"),s=this.calendarEl.querySelector(".orig-select-month");P.init(i,{classes:"select-year",menuOptions:{container:p.portalRoot(this.el),constrainWidth:!1}}),P.init(s,{classes:"select-month",menuOptions:{container:p.portalRoot(this.el),constrainWidth:!1}}),i.addEventListener("change",this._handleYearChange),s.addEventListener("change",this._handleMonthChange)}_reuseControls(t,e){let i=this.calendarEl.querySelector(".orig-select-month");i&&i.value!==e.toString()&&(i.value=e.toString(),P.getInstance(i)?.refresh());let{prev:s,next:o}=this._arrowState(t,e);this.calendarEl.querySelector(".month-prev")?.classList.toggle("is-disabled",!s),this.calendarEl.querySelector(".month-next")?.classList.toggle("is-disabled",!o)}_renderCalendarTable(t,e){let i=this.render(t,e,this._randId),s=this.calendarEl.querySelector(".datepicker-table-wrapper");s?s.outerHTML=i:this.calendarEl.insertAdjacentHTML("beforeend",i)}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("change",this._handleInputChange),this.endDateEl?.addEventListener("click",this._handleInputClick),this.endDateEl?.addEventListener("keydown",this._handleInputKeydown),this.endDateEl?.addEventListener("change",this._handleInputChange),this.calendarEl.addEventListener("click",this._handleCalendarClick),this.calendarEl.addEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.addEventListener("focusin",this._handleCalendarFocus)}_setupVariables(){let t=document.createElement("template");t.innerHTML=_._template.trim(),this.containerEl=t.content.firstChild,this.calendarEl=this.containerEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.containerEl.querySelector(".year-text"),this.dateTextEl=this.containerEl.querySelector(".date-text"),this.footer=this.containerEl.querySelector(".datepicker-footer"),this.formats={d:e=>e.getDate(),dd:e=>{let i=e.getDate();return(i<10?"0":"")+i},ddd:e=>this.options.i18n.weekdaysShort[e.getDay()],dddd:e=>this.options.i18n.weekdays[e.getDay()],m:e=>e.getMonth()+1,mm:e=>{let i=e.getMonth()+1;return(i<10?"0":"")+i},mmm:e=>this.options.i18n.monthsShort[e.getMonth()],mmmm:e=>this.options.i18n.months[e.getMonth()],yy:e=>(""+e.getFullYear()).slice(2),yyyy:e=>e.getFullYear()}}_removeEventHandlers(){for(let t of this.dateEls??[this.el])this._removeInputEventHandlers(t);this.calendarEl.removeEventListener("click",this._handleCalendarClick),this.calendarEl.removeEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.removeEventListener("focusin",this._handleCalendarFocus),this.options.isDateRange&&this.endDateEl&&this._removeInputEventHandlers(this.endDateEl)}_removeInputEventHandlers(t){t.removeEventListener("click",this._handleInputClick),t.removeEventListener("keydown",this._handleInputKeydown),t.removeEventListener("change",this._handleInputChange)}_removeDateInput(t){let e=t.getRootNode().activeElement===t;this._removeInputEventHandlers(t),t.remove(),e&&document.activeElement===document.body&&this.el.focus()}_dayDate(t){let e=new Date(0);return e.setFullYear(Number(t.dataset.year),Number(t.dataset.month),Number(t.dataset.day)),_._setToStartOfDay(e),e}_syncCalendarFocus(t=!1){let e=[...this.calendarEl.querySelectorAll(".datepicker-day-button")],i=e.filter(r=>!r.parentElement.classList.contains("is-selection-disabled")),s=this._focusedDate||this.date||new Date,o=i.find(r=>_._compareDates(this._dayDate(r),s))||i.find(r=>r.parentElement.classList.contains("is-selected"))||i.find(r=>!r.parentElement.classList.contains("is-disabled"))||i[0];for(let r of e)r.tabIndex=r===o?0:-1,r.setAttribute("aria-disabled",String(r.parentElement.matches(".is-disabled, .is-selection-disabled")));o&&(this._focusedDate=this._dayDate(o),t&&o.focus())}gotoMonth(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}gotoYear(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}renderDayName(t,e,i=!1){for(e+=t.firstDay;e>=7;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}createDateInput(){let t=this.el.cloneNode(!0);return t.removeAttribute("id"),t.classList.add("no-autoinit"),t.addEventListener("click",this._handleInputClick),t.addEventListener("keydown",this._handleInputKeydown),t.addEventListener("change",this._handleInputChange),this.el.parentElement.appendChild(t),t}};_._template=`
|
|
10
10
|
<div class="datepicker-container">
|
|
11
11
|
<div class="datepicker-date-display">
|
|
12
12
|
<span class="year-text"></span>
|
|
@@ -16,17 +16,17 @@ var Expressive=(()=>{var ut=Object.defineProperty;var Ft=Object.getOwnPropertyDe
|
|
|
16
16
|
<div class="datepicker-calendar"></div>
|
|
17
17
|
<div class="datepicker-footer"></div>
|
|
18
18
|
</div>
|
|
19
|
-
</div>`;var Z=f;var pe={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},O=class O extends _{constructor(t,e){super(t,e,O);this._changedAncestorList=[];this._timers=new Map;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._isOpen=!1;this._destroyed=!1;this._revision=0;this._handleMotionChange=()=>{if(!this._motion.matches)return;let t=[...this._timers.values()],e=this._cancel();for(let i of t){if(e!==this._revision)break;i()}if(this.overlayActive)for(let i of[this.el,this._overlay,this._photoCaption])i&&(i.style.transition="none")};this._handleLightboxClick=()=>{this._handleLightboxToggle()};this._handleLightboxKeypress=t=>{this._trigger===this.el&&(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._handleLightboxToggle())};this._handleLightboxToggle=()=>{this._isOpen?this.close():this.open()};this._handleWindowScroll=()=>{this.overlayActive&&this.close()};this._handleWindowResize=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{t.key===u.keys.ESC&&this.close()};this.open=()=>{if(this._destroyed||this._isOpen)return;let t=this._cancel();this.overlayActive&&this._reset(),this._isOpen=!0,this._updateVars();let e=this.el.getBoundingClientRect(),i=this.placeholder.getBoundingClientRect();if(this.originalWidth=e.width,this.originalHeight=e.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t!==this._revision)return;this.placeholder.style.width=i.width+"px",this.placeholder.style.height=i.height+"px",this.placeholder.style.position="relative",this.placeholder.style.top="0",this.placeholder.style.left="0",this._makeAncestorsOverflowVisible(),this.el.style.position="absolute",this.el.style.zIndex="1000",this.el.style.willChange="left, top, width, height",this.attrWidth=this.el.getAttribute("width"),this.attrHeight=this.el.getAttribute("height"),this.attrWidth&&(this.el.style.width=this.attrWidth+"px",this.el.removeAttribute("width")),this.attrHeight&&(this.el.style.height=this.attrHeight+"px",this.el.removeAttribute("height")),this._addOverlay(),this.caption!==""&&this._addCaption();let s=this.originalWidth/this.windowWidth,n=this.originalHeight/this.windowHeight;if(this.newWidth=0,this.newHeight=0,s>n){let a=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*a}else{let a=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*a,this.newHeight=this.windowHeight*.9}window.addEventListener("scroll",this._handleWindowScroll,{passive:!0}),window.addEventListener("resize",this._handleWindowResize,{passive:!0}),window.addEventListener("keyup",this._handleWindowEscape),this._animateImageIn()};this.close=()=>{if(this._destroyed||!this._isOpen)return;let t=this._cancel();this._isOpen=!1,this.doneAnimating=!1,typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._revision&&(window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay&&this._removeOverlay(),this._photoCaption&&this._removeCaption(),this._animateImageOut())};this.el.Expressive_Lightbox=this,this.options={...O.defaults,...e},this.overlayActive=!1,this.doneAnimating=!0,this.placeholder=document.createElement("div"),this.placeholder.classList.add("material-placeholder"),this.originalWidth=0,this.originalHeight=0,this.originInlineStyles=this.el.getAttribute("style"),this.caption=this.el.getAttribute("data-caption")||"",this._tabindex=this.el.getAttribute("tabindex"),this._trigger=this.el.closest("button")??this.el,this.el.tabIndex=this._trigger===this.el?0:-1,this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return pe}static init(t,e={}){return super.init(t,e,O)}static getInstance(t){return t.Expressive_Lightbox}destroy(){if(this._destroyed)return;this._destroyed=!0;let t=this.el.getRootNode(),e=t.activeElement===this.el;this._removeEventHandlers(),this._cancel(),this._reset(),this.placeholder.replaceWith(this.el);let i=document.activeElement;for(;i?.shadowRoot?.activeElement;)i=i.shadowRoot.activeElement;e&&(i===document.body||i===t.host)&&this._trigger.focus(),this._tabindex===null?this.el.removeAttribute("tabindex"):this.el.setAttribute("tabindex",this._tabindex),this.el.Expressive_Lightbox=void 0}_reset(){window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay?.remove(),this._photoCaption?.remove();for(let t of this._changedAncestorList){let e=O._overflow.get(t);--e.count===0&&(t.style.setProperty("overflow",e.value,e.priority),O._overflow.delete(t))}this._changedAncestorList=[],this.attrWidth!==null&&this.attrWidth!==void 0&&this.el.setAttribute("width",this.attrWidth),this.attrHeight!==null&&this.attrHeight!==void 0&&this.el.setAttribute("height",this.attrHeight),this.el.classList.remove("active"),this.placeholder.removeAttribute("style"),this.originInlineStyles===null?this.el.removeAttribute("style"):this.el.setAttribute("style",this.originInlineStyles),this.overlayActive=!1,this._isOpen=!1,this.doneAnimating=!0}_cancel(){for(let t of this._timers.keys())clearTimeout(t);return this._timers.clear(),++this._revision}_schedule(t,e){if(this._motion.matches){t();return}let i=setTimeout(()=>{this._timers.delete(i),t()},e);this._timers.set(i,t)}_setupEventHandlers(){this._motion.addEventListener("change",this._handleMotionChange),this._trigger.addEventListener("click",this._handleLightboxClick),this.el.addEventListener("keydown",this._handleLightboxKeypress)}_removeEventHandlers(){this._motion.removeEventListener("change",this._handleMotionChange),this._trigger.removeEventListener("click",this._handleLightboxClick),this.el.removeEventListener("keydown",this._handleLightboxKeypress)}_makeAncestorsOverflowVisible(){this._changedAncestorList=[];let t=this.placeholder.parentNode;for(;t!=null&&t!==document;){let e=t;if(e.style&&(e.style.overflow!=="visible"||O._overflow.has(e))){let i=O._overflow.get(e)??{count:0,value:e.style.overflow,priority:e.style.getPropertyPriority("overflow")};i.count++,O._overflow.set(e,i),this._changedAncestorList.push(e),e.style.overflow="visible"}t=t.parentNode??t.host}}_offset(t){let e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+window.scrollY-i.clientTop,left:e.left+window.scrollX-i.clientLeft}}_updateVars(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}_animateImageIn(){this.el.style.maxHeight=this.newHeight.toString()+"px",this.el.style.maxWidth=this.newWidth.toString()+"px";let t=this._motion.matches?0:this.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this._schedule(()=>{let e=this._offset(this.placeholder);this.el.style.transition=`height ${t}ms ease,
|
|
19
|
+
</div>`;var vt=_;var fi={autoScroll:!0,defaultScrollPosition:"end",peek:64},Ht=2,vi=new Set(["ArrowUp","PageUp","Home"]),de=["pointerup","pointercancel","touchend","touchcancel"],gt=class d extends b{constructor(t,e){super(t,e,d);this._opened=!1;this._following=!1;this._holding=!1;this._lastTop=0;this._target=null;this._distance=1/0;this._ref=null;this._refOffset=0;this._anchor=null;this._spacer=0;this._last=null;this._resizeObserver=null;this._mutationObserver=null;this._handleScroll=()=>{if(this._target!==null){let t=Math.abs(this.viewport.scrollTop-this._resolve(this._target));if(t>Ht&&t<this._distance){this._distance=t;return}this._target=null}this._settle()};this._handleUserScroll=t=>{t.type==="wheel"&&t.deltaY>=0||t.type==="keydown"&&!vi.has(t.key)||(this._target=null,t.type==="pointerdown"||t.type==="touchstart"?this._holding=!0:this._following=!1)};this._handleRelease=()=>{this._holding&&(this._holding=!1,this._following&&(this.viewport.scrollTop=this.viewport.scrollHeight),this._sync())};this._handleButtonClick=()=>this.scrollToEnd();this._handleMutations=t=>{for(let i of t)i.addedNodes.forEach(s=>{s instanceof Element&&this._resizeObserver?.observe(s)}),i.removedNodes.forEach(s=>{s instanceof Element&&this._resizeObserver?.unobserve(s)});let e=this._last;if(this._last=this.viewport.lastElementChild,!!this._opened&&(!this._following&&this._target===null&&this._restore(),!!this.options.autoScroll&&!(e&&e.parentElement!==this.viewport))){for(let i=this._last;i&&i!==e;i=i.previousElementSibling)if(i.hasAttribute("data-scroll-anchor")){this._anchor=i,this._updateSpacer(),this._following=!0,this._scrollTo(this._top(i)-this.options.peek);return}}};this._handleResize=()=>{if(!this._opened){this.viewport.clientHeight>0&&this._open();return}this._updateSpacer();let t=this.viewport;this._target==="end"?this._scrollTo("end"):this._target===null&&(this._following&&!this._holding?t.scrollTop=t.scrollHeight:this._restore()),this._sync()};if(this.el.Expressive_MessageScroller=this,this.options={...d.defaults,...e},this.viewport=t.querySelector(":scope > .message-scroller-viewport"),this.button=t.querySelector(":scope > .message-scroller-button"),!this.viewport){console.error("MessageScroller needs a .message-scroller-viewport child.");return}if(this._last=this.viewport.lastElementChild,this.viewport.clientHeight>0&&this._open(),typeof ResizeObserver<"u"){this._resizeObserver=new ResizeObserver(this._handleResize),this._resizeObserver.observe(this.viewport,{box:"border-box"});for(let i of Array.from(this.viewport.children))this._resizeObserver.observe(i)}this._mutationObserver=new MutationObserver(this._handleMutations),this._mutationObserver.observe(this.viewport,{childList:!0}),this.viewport.addEventListener("scroll",this._handleScroll,{passive:!0});for(let i of["wheel","touchstart","pointerdown","keydown"])this.viewport.addEventListener(i,this._handleUserScroll,{passive:!0});for(let i of de)document.addEventListener(i,this._handleRelease);this.button?.addEventListener("click",this._handleButtonClick)}static get defaults(){return fi}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_MessageScroller}destroy(){if(this.el.Expressive_MessageScroller=void 0,!!this.viewport){this._resizeObserver?.disconnect(),this._mutationObserver?.disconnect(),this.viewport.removeEventListener("scroll",this._handleScroll);for(let t of["wheel","touchstart","pointerdown","keydown"])this.viewport.removeEventListener(t,this._handleUserScroll);for(let t of de)document.removeEventListener(t,this._handleRelease);this.viewport.style.removeProperty("--md-comp-message-scroller-spacer"),this.button&&(this.button.removeEventListener("click",this._handleButtonClick),this.button.inert=!1)}}scrollToEnd(){this._following=this.options.autoScroll,this._scrollTo("end")}scrollToStart(){this._following=!1,this._scrollTo(0)}scrollToMessage(t){let e=p.getElementById(this.viewport,t);return!e||!this.viewport.contains(e)?!1:(this._following=!1,this._scrollTo(this._top(e)-this.options.peek),!0)}_open(){this._opened=!0;let t=this.viewport,e=this.options.defaultScrollPosition,i=t.querySelectorAll(":scope > [data-scroll-anchor]"),s=e==="last-anchor"?i[i.length-1]:null;e==="start"?t.scrollTop=0:s&&this._contentEnd()-this._top(s)+this.options.peek>t.clientHeight?t.scrollTop=this._top(s)-this.options.peek:t.scrollTop=t.scrollHeight,this._settle()}_settle(){let t=this.viewport.scrollTop,e=this._following&&t>=this._lastTop-Ht;this._following=this.options.autoScroll&&(e||this._atEnd()),this._lastTop=t,this._capture(),this._sync()}_scrollTo(t){let e=this.viewport;if(Math.abs(e.scrollTop-this._resolve(t))<=Ht){this._target=null,this._settle();return}this._target=t,this._distance=1/0;let i=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;e.scrollTo({top:t==="end"?e.scrollHeight:t,behavior:i?"auto":"smooth"})}_resolve(t){let e=this.viewport.scrollHeight-this.viewport.clientHeight;return t==="end"?e:Math.max(0,Math.min(t,e))}_atEnd(){let t=this.viewport;return t.scrollHeight-t.scrollTop-t.clientHeight<=Ht}_top(t){let e=this.viewport;return t.getBoundingClientRect().top-e.getBoundingClientRect().top-e.clientTop+e.scrollTop}_contentEnd(){let t=this.viewport.lastElementChild;if(!t)return 0;let e=parseFloat(getComputedStyle(this.viewport).paddingBlockEnd)-this._spacer;return this._top(t)+t.getBoundingClientRect().height+e}_capture(){let t=this.viewport.children,e=this.viewport.getBoundingClientRect().top+this.viewport.clientTop,i=0,s=t.length-1;for(;i<s;){let o=i+s>>1;t[o].getBoundingClientRect().bottom>e?s=o:i=o+1}this._ref=t[i]??null,this._refOffset=this._ref?this._ref.getBoundingClientRect().top-e:0}_restore(){if(this._ref?.parentElement!==this.viewport){this._capture();return}let t=this.viewport.getBoundingClientRect().top+this.viewport.clientTop,e=this._ref.getBoundingClientRect().top-t-this._refOffset;Math.abs(e)>=1&&(this.viewport.scrollTop+=e)}_updateSpacer(){let t=0;if(this._anchor?.parentElement===this.viewport){let e=this._top(this._anchor)-this.options.peek+this.viewport.clientHeight;t=Math.max(0,Math.ceil(e-this._contentEnd()))}else this._anchor=null;t!==this._spacer&&(this._spacer=t,t?this.viewport.style.setProperty("--md-comp-message-scroller-spacer",`${t}px`):this.viewport.style.removeProperty("--md-comp-message-scroller-spacer"))}_sync(){if(!this.button)return;let t=this._atEnd(),e=this.button.getRootNode();t&&e.activeElement===this.button&&this.viewport.focus({preventScroll:!0}),this.button.inert=t}};var gi={Editor:null,extensions:[]},_i=["aria-label","aria-labelledby","aria-describedby"],Dt=class d extends b{constructor(t,e){super(t,e,d);this.editor=null;this.content=null;this._actions=new Map;this._label=null;this._handleClick=t=>{let e=t.target.closest("button[data-command]"),i=this._actions.get(e);i&&!e.disabled&&this.editor.chain().focus()[i.command](i.attributes).run()};this._handleLabelClick=()=>{this.editor.chain().focus().run()};this._handleUpdate=()=>{this.textarea.value=this.editor.isEmpty?"":this.editor.getHTML(),this.textarea.dispatchEvent(new Event("input",{bubbles:!0}))};this._handleTransaction=()=>{let t=this.editor.isEditable&&this.editor.can();for(let[e,{command:i,attributes:s,active:o}]of this._actions){if(e.disabled=!t||!(i in this.editor.commands)||!t[i](s),!o)continue;let r=this.editor.isActive(o,s);e.setAttribute("aria-pressed",String(r)),e.classList.toggle("active",r)}};if(this.el.Expressive_RichTextEditor=this,this.options={...d.defaults,...e},this.textarea=t.querySelector(":scope > textarea"),!this.textarea||!this.options.Editor){console.error("RichTextEditor needs a <textarea> child and the Tiptap Editor class in options.Editor.");return}for(let s of t.querySelectorAll("button[data-command]")){let o=s.dataset.command,r=s.dataset.attributes?JSON.parse(s.dataset.attributes):void 0,a=o.startsWith("toggle")?o[6].toLowerCase()+o.slice(7):void 0;this._actions.set(s,{command:o,attributes:r,active:a})}let i={role:"textbox","aria-multiline":"true"};for(let s of _i){let o=this.textarea.getAttribute(s);o&&(i[s]=o)}this._label=this.textarea.labels?.[0]??null,this._label&&!i["aria-labelledby"]&&(this._label.id||(this._label.id=`rich-text-editor-label-${p.guid()}`),i["aria-labelledby"]=this._label.id,this._label.addEventListener("click",this._handleLabelClick)),this.content=document.createElement("div"),this.content.className="rich-text-editor-content",this.textarea.after(this.content),this.textarea.hidden=!0,this.editor=new this.options.Editor({element:this.content,extensions:this.options.extensions,content:this.textarea.value,editable:!(this.textarea.disabled||this.textarea.readOnly),editorProps:{attributes:i}}),this.editor.on("update",this._handleUpdate),this.editor.on("transaction",this._handleTransaction),this._handleTransaction(),t.addEventListener("click",this._handleClick)}static get defaults(){return gi}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_RichTextEditor}destroy(){if(this.el.Expressive_RichTextEditor=void 0,!!this.editor){this.el.removeEventListener("click",this._handleClick),this._label?.removeEventListener("click",this._handleLabelClick),this.editor.off("update",this._handleUpdate),this.editor.off("transaction",this._handleTransaction),this.editor.destroy(),this.editor=null,this.content.remove(),this.textarea.hidden=!1;for(let t of this._actions.keys())t.disabled=!1,t.classList.remove("active"),t.removeAttribute("aria-pressed")}}};var ue="https://tiles.openfreemap.org/styles/",Ei={maplibregl:null,style:{light:`${ue}positron`,dark:`${ue}dark`},center:[0,20],zoom:1,mapOptions:{}},pe=d=>d.dataset.lngLat.split(",").map(Number);function bi([d,n],[t,e],i=32){let s=t>=d?.25:-.25,o=(d+t)/2-(e-n)*s,r=(n+e)/2+(t-d)*s;return Array.from({length:i+1},(a,c)=>{let h=c/i,l=1-h;return[l*l*d+2*l*h*o+h*h*t,l*l*n+2*l*h*r+h*h*e]})}var Pt=class d extends b{constructor(t,e){super(t,e,d);this.map=null;this.markers=[];this._children=[];this._popups=[];this._markerPopups=new Map;this._overlays=new Map;this._styleReady=!1;this._dark=!1;this._location=null;this._media=null;this._observer=null;this._zoomIn=[];this._zoomOut=[];this._handleStyleLoad=()=>{this._styleReady=!0;for(let t of this._overlays.values())t.draw()};this._handleScheme=()=>{let t=this._isDark();t!==this._dark&&(this._dark=t,this._styleReady=!1,this.map.setStyle(this._style(),{diff:!1}))};this._sync=()=>{let t=this.map.getZoom();for(let e of this._zoomIn)e.disabled=t>=this.map.getMaxZoom();for(let e of this._zoomOut)e.disabled=t<=this.map.getMinZoom();this.el.style.setProperty("--md-comp-map-bearing",`${-this.map.getBearing()}deg`)};this._handleFullscreen=()=>{for(let t of this._buttons("fullscreen"))t.setAttribute("aria-pressed",String(document.fullscreenElement===this.el))};this._handleClick=t=>{let e=t.target,i=e.closest(".map-controls [data-action]"),s=i?.dataset.action;if(s==="zoom-in")this.map.zoomIn();else if(s==="zoom-out")this.map.zoomOut();else if(s==="compass")this.map.resetNorthPitch();else if(s==="locate")this._locate(i);else if(s==="fullscreen")document.fullscreenElement===this.el?document.exitFullscreen():this.el.requestFullscreen();else{let o=e.closest(".map-marker");this._markerPopups.has(o)&&this._toggle(o)}};this._handleMapClick=t=>{let e=t.originalEvent.target;for(let[i,s]of this._markerPopups)!i.contains(e)&&!s.getElement()?.contains(e)&&s.remove()};this._handleKeydown=t=>{if(t.key==="Escape")for(let e of this._popups)e.getElement()?.contains(t.target)&&(t.preventDefault(),e.remove())};this.el.Expressive_MapView=this,this.options={...d.defaults,...e};let i=this.options.maplibregl;if(!i){console.error("MapView needs the maplibre-gl module in options.maplibregl.");return}this._children=[...t.children],this._zoomIn=[...this._buttons("zoom-in")],this._zoomOut=[...this._buttons("zoom-out")],this._dark=this._isDark(),this.map=new i.Map({...this.options.mapOptions,container:t,style:this._style(),center:this.options.center,zoom:this.options.zoom}),this.map.on("style.load",this._handleStyleLoad),this.map.on("move",this._sync),this.map.on("click",this._handleMapClick);let s=this._children.filter(r=>r instanceof HTMLElement),o=new Set;for(let r of s.filter(a=>a.matches(".map-marker[data-lng-lat]"))){let a=r.hasAttribute("aria-controls")?p.getElementById(r,r.getAttribute("aria-controls")):null,c=a?.parentElement===t&&a.matches(".map-popup")?a:null;c&&o.add(c),this._addMarker(r,c)}for(let r of s.filter(a=>a.matches(".map-popup[data-lng-lat]")&&!o.has(a)))this._popup(r,0).setLngLat(pe(r)).addTo(this.map);this._themed()&&(this._media=matchMedia("(prefers-color-scheme: dark)"),this._media.addEventListener("change",this._handleScheme),this._observer=new MutationObserver(this._handleScheme),this._observer.observe(document.documentElement,{attributes:!0,attributeFilter:["theme"],subtree:!0}));for(let r of this._buttons("fullscreen"))r.hidden=!document.fullscreenEnabled;document.addEventListener("fullscreenchange",this._handleFullscreen),t.addEventListener("click",this._handleClick),t.addEventListener("keydown",this._handleKeydown),this._sync()}static get defaults(){return Ei}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_MapView}destroy(){if(this.el.Expressive_MapView=void 0,!!this.map){this.el.removeEventListener("click",this._handleClick),this.el.removeEventListener("keydown",this._handleKeydown),document.removeEventListener("fullscreenchange",this._handleFullscreen),this._media?.removeEventListener("change",this._handleScheme),this._observer?.disconnect();for(let t of this._overlays.values())t.off?.();for(let t of this._popups)t.remove();for(let t of this.markers){t.remove();let e=t.getElement();e.classList.remove(...[...e.classList].filter(i=>i.startsWith("maplibregl-"))),e.style.removeProperty("transform"),e.style.removeProperty("opacity"),e.hasAttribute("aria-controls")&&e.removeAttribute("aria-expanded")}this._location?.remove(),this._location=null,this.map.remove(),this.map=null,this.markers=[],this._popups=[],this._markerPopups.clear(),this._overlays.clear(),this.el.style.removeProperty("--md-comp-map-bearing");for(let t of this.el.querySelectorAll(".map-controls [data-action]"))t.disabled=!1,t.hidden=!1,t.removeAttribute("aria-pressed");this.el.append(...this._children)}}addRoute(t,e,i={}){this._line(t,{type:"LineString",coordinates:e},"route",{width:4,...i})}addArcs(t,e,i={}){this._line(t,{type:"MultiLineString",coordinates:e.map(({from:s,to:o})=>bi(s,o))},"arc",{width:2,...i})}addClusters(t,e,i={}){let s=`${t}-clusters`,o=`${t}-points`,r=async h=>{let[l]=h.features,u=await this.map.getSource(t).getClusterExpansionZoom(l.properties.cluster_id);this.map.easeTo({center:l.geometry.coordinates,zoom:u})},a=()=>{this.map.getCanvas().style.cursor="pointer"},c=()=>{this.map.getCanvas().style.cursor=""};this._draw(t,{draw:()=>{let h=i.color??this._color("var(--md-comp-map-cluster-color)"),l=this._color("var(--md-comp-map-marker-ring-color)");this.map.addSource(t,{type:"geojson",data:e,cluster:!0,clusterRadius:i.radius??50,clusterMaxZoom:i.maxZoom??14}),this.map.addLayer({id:s,type:"circle",source:t,filter:["has","point_count"],paint:{"circle-color":h,"circle-radius":["step",["get","point_count"],16,10,20,100,26],"circle-stroke-width":6,"circle-stroke-color":h,"circle-stroke-opacity":.3}});let u=this.map.getStyle(),f=u.glyphs&&u.layers.find(m=>m.layout?.["text-font"])?.layout["text-font"];f&&this.map.addLayer({id:`${t}-count`,type:"symbol",source:t,filter:["has","point_count"],layout:{"text-field":["get","point_count_abbreviated"],"text-font":f,"text-size":12},paint:{"text-color":this._color("var(--md-comp-map-cluster-label-color)")}}),this.map.addLayer({id:o,type:"circle",source:t,filter:["!",["has","point_count"]],paint:{"circle-color":h,"circle-radius":6,"circle-stroke-width":2,"circle-stroke-color":l}})},off:()=>{this.map.off("click",s,r);for(let h of[s,o])this.map.off("mouseenter",h,a),this.map.off("mouseleave",h,c)}}),this.map.on("click",s,r);for(let h of[s,o])this.map.on("mouseenter",h,a),this.map.on("mouseleave",h,c)}removeOverlay(t){let e=this._overlays.get(t);if(e&&(this._overlays.delete(t),e.off?.(),!(!this._styleReady||!this.map.getSource(t)))){for(let i of this.map.getStyle().layers)i.source===t&&this.map.removeLayer(i.id);this.map.removeSource(t)}}_line(t,e,i,s){this._draw(t,{draw:()=>{this.map.addSource(t,{type:"geojson",data:{type:"Feature",properties:{},geometry:e}}),this.map.addLayer({id:t,type:"line",source:t,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":s.color??this._color(`var(--md-comp-map-${i}-color)`),"line-width":s.width,"line-opacity":s.opacity??1,...s.dashArray&&{"line-dasharray":s.dashArray}}})}})}_draw(t,e){this.removeOverlay(t),this._overlays.set(t,e),this._styleReady&&e.draw()}_addMarker(t,e){let i=new this.options.maplibregl.Marker({element:t,draggable:t.hasAttribute("data-draggable")}).setLngLat(pe(t)).addTo(this.map);if(i.on("dragend",()=>{let{lng:o,lat:r}=i.getLngLat();t.dataset.lngLat=`${o},${r}`,t.dispatchEvent(new Event("change",{bubbles:!0}))}),this.markers.push(i),!e)return;t.setAttribute("aria-expanded","false");let s=this._popup(e,16);s.on("open",()=>t.setAttribute("aria-expanded","true")),s.on("close",()=>{t.setAttribute("aria-expanded","false"),(!document.activeElement||document.activeElement===document.body)&&t.focus()}),this._markerPopups.set(t,s)}_popup(t,e){let i=new this.options.maplibregl.Popup({closeOnClick:!1,maxWidth:"none",offset:e}).setDOMContent(t);return this._popups.push(i),i}_toggle(t){let e=this._markerPopups.get(t);e.isOpen()?e.remove():e.setLngLat(this.markers.find(i=>i.getElement()===t).getLngLat()).addTo(this.map)}_buttons(t){return this.el.querySelectorAll(`.map-controls [data-action="${t}"]`)}_locate(t){navigator.geolocation?.getCurrentPosition(({coords:e})=>{if(!this.map)return;let i=[e.longitude,e.latitude];if(!this._location){let s=document.createElement("span");s.className="map-marker location",s.setAttribute("aria-hidden","true"),this._location=new this.options.maplibregl.Marker({element:s})}this._location.setLngLat(i).addTo(this.map),this.map.flyTo({center:i,zoom:Math.max(this.map.getZoom(),14)})},e=>{this.map&&e.code===e.PERMISSION_DENIED&&(t.disabled=!0)})}_color(t){let e=document.createElement("span");e.hidden=!0,e.style.color=t,this.el.append(e);let i=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});i.fillStyle=getComputedStyle(e).color,e.remove(),i.fillRect(0,0,1,1);let[s,o,r,a]=i.getImageData(0,0,1,1).data;return`rgba(${s}, ${o}, ${r}, ${Math.round(a/255*100)/100})`}_isDark(){return this._color("light-dark(black, white)")==="rgba(255, 255, 255, 1)"}_themed(){let t=this.options.style;return typeof t=="object"&&"light"in t&&"dark"in t}_style(){return this._themed()?this.options.style[this._dark?"dark":"light"]:this.options.style}};var yi={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},B=class B extends b{constructor(t,e){super(t,e,B);this._changedAncestorList=[];this._timers=new Map;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._isOpen=!1;this._destroyed=!1;this._revision=0;this._handleMotionChange=()=>{if(!this._motion.matches)return;let t=[...this._timers.values()],e=this._cancel();for(let i of t){if(e!==this._revision)break;i()}if(this.overlayActive)for(let i of[this.el,this._overlay,this._photoCaption])i&&(i.style.transition="none")};this._handleLightboxClick=()=>{this._handleLightboxToggle()};this._handleLightboxKeypress=t=>{this._trigger===this.el&&(t.key===p.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._handleLightboxToggle())};this._handleLightboxToggle=()=>{this._isOpen?this.close():this.open()};this._handleWindowScroll=()=>{this.overlayActive&&this.close()};this._handleWindowResize=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{t.key===p.keys.ESC&&this.close()};this.open=()=>{if(this._destroyed||this._isOpen)return;let t=this._cancel();this.overlayActive&&this._reset(),this._isOpen=!0,this._updateVars();let e=this.el.getBoundingClientRect(),i=this.placeholder.getBoundingClientRect();if(this.originalWidth=e.width,this.originalHeight=e.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t!==this._revision)return;this.placeholder.style.width=i.width+"px",this.placeholder.style.height=i.height+"px",this.placeholder.style.position="relative",this.placeholder.style.top="0",this.placeholder.style.left="0",this._makeAncestorsOverflowVisible(),this.el.style.position="absolute",this.el.style.zIndex="1000",this.el.style.willChange="left, top, width, height",this.attrWidth=this.el.getAttribute("width"),this.attrHeight=this.el.getAttribute("height"),this.attrWidth&&(this.el.style.width=this.attrWidth+"px",this.el.removeAttribute("width")),this.attrHeight&&(this.el.style.height=this.attrHeight+"px",this.el.removeAttribute("height")),this._addOverlay(),this.caption!==""&&this._addCaption();let s=this.originalWidth/this.windowWidth,o=this.originalHeight/this.windowHeight;if(this.newWidth=0,this.newHeight=0,s>o){let r=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*r}else{let r=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*r,this.newHeight=this.windowHeight*.9}window.addEventListener("scroll",this._handleWindowScroll,{passive:!0}),window.addEventListener("resize",this._handleWindowResize,{passive:!0}),window.addEventListener("keyup",this._handleWindowEscape),this._animateImageIn()};this.close=()=>{if(this._destroyed||!this._isOpen)return;let t=this._cancel();this._isOpen=!1,this.doneAnimating=!1,typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._revision&&(window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay&&this._removeOverlay(),this._photoCaption&&this._removeCaption(),this._animateImageOut())};this.el.Expressive_Lightbox=this,this.options={...B.defaults,...e},this.overlayActive=!1,this.doneAnimating=!0,this.placeholder=document.createElement("div"),this.placeholder.classList.add("material-placeholder"),this.originalWidth=0,this.originalHeight=0,this.originInlineStyles=this.el.getAttribute("style"),this.caption=this.el.getAttribute("data-caption")||"",this._tabindex=this.el.getAttribute("tabindex"),this._trigger=this.el.closest("button")??this.el,this.el.tabIndex=this._trigger===this.el?0:-1,this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return yi}static init(t,e={}){return super.init(t,e,B)}static getInstance(t){return t.Expressive_Lightbox}destroy(){if(this._destroyed)return;this._destroyed=!0;let t=this.el.getRootNode(),e=t.activeElement===this.el;this._removeEventHandlers(),this._cancel(),this._reset(),this.placeholder.replaceWith(this.el);let i=document.activeElement;for(;i?.shadowRoot?.activeElement;)i=i.shadowRoot.activeElement;e&&(i===document.body||i===t.host)&&this._trigger.focus(),this._tabindex===null?this.el.removeAttribute("tabindex"):this.el.setAttribute("tabindex",this._tabindex),this.el.Expressive_Lightbox=void 0}_reset(){window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay?.remove(),this._photoCaption?.remove();for(let t of this._changedAncestorList){let e=B._overflow.get(t);--e.count===0&&(t.style.setProperty("overflow",e.value,e.priority),B._overflow.delete(t))}this._changedAncestorList=[],this.attrWidth!==null&&this.attrWidth!==void 0&&this.el.setAttribute("width",this.attrWidth),this.attrHeight!==null&&this.attrHeight!==void 0&&this.el.setAttribute("height",this.attrHeight),this.el.classList.remove("active"),this.placeholder.removeAttribute("style"),this.originInlineStyles===null?this.el.removeAttribute("style"):this.el.setAttribute("style",this.originInlineStyles),this.overlayActive=!1,this._isOpen=!1,this.doneAnimating=!0}_cancel(){for(let t of this._timers.keys())clearTimeout(t);return this._timers.clear(),++this._revision}_schedule(t,e){if(this._motion.matches){t();return}let i=setTimeout(()=>{this._timers.delete(i),t()},e);this._timers.set(i,t)}_setupEventHandlers(){this._motion.addEventListener("change",this._handleMotionChange),this._trigger.addEventListener("click",this._handleLightboxClick),this.el.addEventListener("keydown",this._handleLightboxKeypress)}_removeEventHandlers(){this._motion.removeEventListener("change",this._handleMotionChange),this._trigger.removeEventListener("click",this._handleLightboxClick),this.el.removeEventListener("keydown",this._handleLightboxKeypress)}_makeAncestorsOverflowVisible(){this._changedAncestorList=[];let t=this.placeholder.parentNode;for(;t!=null&&t!==document;){let e=t;if(e.style&&(e.style.overflow!=="visible"||B._overflow.has(e))){let i=B._overflow.get(e)??{count:0,value:e.style.overflow,priority:e.style.getPropertyPriority("overflow")};i.count++,B._overflow.set(e,i),this._changedAncestorList.push(e),e.style.overflow="visible"}t=t.parentNode??t.host}}_offset(t){let e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+window.scrollY-i.clientTop,left:e.left+window.scrollX-i.clientLeft}}_updateVars(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}_animateImageIn(){this.el.style.maxHeight=this.newHeight.toString()+"px",this.el.style.maxWidth=this.newWidth.toString()+"px";let t=this._motion.matches?0:this.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this._schedule(()=>{let e=this._offset(this.placeholder);this.el.style.transition=`height ${t}ms ease,
|
|
20
20
|
width ${t}ms ease,
|
|
21
21
|
left ${t}ms ease,
|
|
22
22
|
top ${t}ms ease
|
|
23
|
-
`,this.el.style.height=this.newHeight+"px",this.el.style.width=this.newWidth+"px",this.el.style.left=
|
|
23
|
+
`,this.el.style.height=this.newHeight+"px",this.el.style.width=this.newWidth+"px",this.el.style.left=p.getDocumentScrollLeft()+this.windowWidth/2-e.left-this.newWidth/2+"px",this.el.style.top=p.getDocumentScrollTop()+this.windowHeight/2-e.top-this.newHeight/2+"px"},1),this._schedule(()=>{this.doneAnimating=!0,typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},t)}_animateImageOut(){let t=this._motion.matches?0:this.options.outDuration;this.el.style.transition=`height ${t}ms ease,
|
|
24
24
|
width ${t}ms ease,
|
|
25
25
|
left ${t}ms ease,
|
|
26
26
|
top ${t}ms ease
|
|
27
|
-
`,this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this.el.style.left="0",this.el.style.top="0",this._schedule(()=>{this._reset(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_addCaption(){this._photoCaption=document.createElement("div"),this._photoCaption.classList.add("lightbox-caption"),this._photoCaption.innerText=this.caption,u.portalRoot(this.el).append(this._photoCaption),this._photoCaption.style.display="inline",this._photoCaption.style.transition="none",this._photoCaption.style.opacity="0";let t=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="1"},1)}_removeCaption(){let t=this._motion.matches?0:this.options.outDuration;this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="0"}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",i=>{i.stopPropagation(),this.close()},{once:!0}),this.el.before(this._overlay);let t=this._overlay.getBoundingClientRect();this._overlay.style.width=this.windowWidth+"px",this._overlay.style.height=this.windowHeight+"px",this._overlay.style.left=-1*t.left+"px",this._overlay.style.top=-1*t.top+"px",this._overlay.style.transition="none",this._overlay.style.opacity="0";let e=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._overlay.style.transition=`opacity ${e}ms ease`,this._overlay.style.opacity="1"},1)}_removeOverlay(){let t=this._motion.matches?0:this.options.outDuration;this._overlay.style.transition=`opacity ${t}ms ease`,this._overlay.style.opacity="0"}};O._overflow=new WeakMap;var Q=O;var xt=d=>`a[href="#${d}"]`,me={scrollOffset:200,activeClass:"active",getActiveElement:xt,keepTopElementActive:!1},L=class L extends _{constructor(t,e){super(t,e,L);this._ratio=0;this._link=null;this.el.Expressive_ScrollSpy=this,this.options={...L.defaults,...e},this._offset=this.el.style.getPropertyValue("--md-comp-scrollspy-offset"),this._offsetPriority=this.el.style.getPropertyPriority("--md-comp-scrollspy-offset"),this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),L._elements.push(this),typeof IntersectionObserver<"u"&&(this._observer=new IntersectionObserver(i=>{if(L.getInstance(this.el)===this){for(let s of i)this._ratio=s.isIntersecting?s.intersectionRatio:0;L._syncActive(this.options.getActiveElement)}},{rootMargin:`-${this.options.scrollOffset}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}),this._observer.observe(this.el))}static get defaults(){return me}static init(t,e={}){return super.init(t,e,L)}static getInstance(t){return t.Expressive_ScrollSpy}destroy(){let t=L._elements.indexOf(this);if(t<0)return;L._elements.splice(t,1),this._observer?.disconnect();let e=this.options.getActiveElement;L._active.get(e)===this&&L._clearActive(e),this.el.style.setProperty("--md-comp-scrollspy-offset",this._offset,this._offsetPriority),this.el.Expressive_ScrollSpy=void 0,L._syncActive(e)}static _syncActive(t){let e=L._elements.filter(h=>h.options.getActiveElement===t),i=null,s=0;for(let h of e){let c=h._ratio;c>s&&(s=c,i=h)}if(!i){let h=e.filter(c=>c.options.keepTopElementActive);i=L._nearestAbove(h)??h[0]}let n=i?L._linkFor(i.el.id,i.options):null,a=L._active.get(t);a===i&&a?._link===n||(L._clearActive(t),n&&(n.classList.add(i.options.activeClass),n.setAttribute("aria-current","true"),i._link=n,L._active.set(t,i)))}static _nearestAbove(t){let e=null,i=-1/0;for(let s of t){let n=s.el.getBoundingClientRect().top;n<=0&&n>=i&&(i=n,e=s)}return e}static _clearActive(t){let e=L._active.get(t);e&&(e._link?.classList.remove(e.options.activeClass),e._link?.removeAttribute("aria-current"),e._link=null,L._active.delete(t))}static _linkFor(t,e){if(!t)return null;if(e.getActiveElement!==xt)try{return document.querySelector(e.getActiveElement(t))}catch{return null}let i=`#${t}`,s=document.querySelectorAll('a[href^="#"]');for(let n=0;n<s.length;n++)if(s[n].getAttribute("href")===i)return s[n];return null}};L._elements=[],L._active=new Map;var J=L;var fe={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},ve="(width < 600px)",tt=class d extends _{constructor(t,e){super(t,e,d);this.expand=()=>{this.isExpanded||(typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.isExpanded=!0,this.el.classList.add("expanded"),this._sync(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el))};this.collapse=()=>{this.isExpanded&&(typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this.isExpanded=!1,this.el.classList.remove("expanded"),this._sync(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el))};this.toggle=()=>{this.isExpanded?this.collapse():this.expand()};this._onClick=t=>{let e=t.target;if(e instanceof Node){if(this._toggle&&(e===this._toggle||this._toggle.contains(e))){this.toggle(),t.preventDefault();return}e===this.el&&this.isExpanded&&this._isModal()&&this.collapse()}};this._onKeyDown=t=>{if(!(t.key!=="Escape"||t.defaultPrevented)&&this.isExpanded&&this._isModal()){let e=this.el.getRootNode(),i=this.el.contains(e.activeElement),s=e.activeElement;for(;s?.shadowRoot?.activeElement;)s=s.shadowRoot.activeElement;this.collapse();let n=e.activeElement;for(;n?.shadowRoot?.activeElement;)n=n.shadowRoot.activeElement;!this.isExpanded&&i&&n===s&&this._toggle?.focus()}};this.el.Expressive_NavigationRail=this,this.options={...d.defaults,...e},this._toggle=this._findToggle(),this._mql=window.matchMedia(ve),this.isExpanded=this.el.classList.contains("expanded"),this._sync(),this.el.addEventListener("click",this._onClick),document.addEventListener("keydown",this._onKeyDown)}static get defaults(){return fe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_NavigationRail}destroy(){this.el.removeEventListener("click",this._onClick),document.removeEventListener("keydown",this._onKeyDown),this.el.Expressive_NavigationRail=void 0}_findToggle(){let t=this.el.querySelector(":scope > button:not(.button)");return t instanceof HTMLButtonElement?t:null}_isCompact(){return this._mql.matches}_isModal(){return this.el.classList.contains("modal")||this._isCompact()}_sync(){this.el.setAttribute("aria-expanded",this.isExpanded?"true":"false"),this._toggle?.setAttribute("aria-expanded",this.isExpanded?"true":"false")}};var ge={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},et=class d extends _{constructor(t,e){var i;super(t,e,d);this._originalPanels=new Map;this._originalLinks=new Map;this._handleWindowResize=()=>{this._setTabsAndTabWidth(),this._tabWidth!==0&&this._tabsWidth!==0&&(this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px")};this._handleTabClick=t=>{let e=t.target;if(!e)return;let i=e.closest("a");if(!i||!Array.from(this._tabLinks).includes(i))return;let s=i.parentElement;if(i.classList.contains("disabled")||i.getAttribute("aria-disabled")==="true"||s?.classList.contains("disabled")){t.preventDefault();return}if(i.hasAttribute("target"))return;if(this.options.swipeable){let c=i.hash&&document.getElementById(i.hash.slice(1)),l=this._tabsCarousel.images.indexOf(c);l>=0&&this._tabsCarousel.set(l),t.preventDefault();return}let a=this._content;this._tabLinks=this._queryTabLinks();let h=this._index;this._setActiveTabLink(i),this._content&&(this._content.style.display="block",this._content.classList.add("active"),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content),a&&a!==this._content&&(a.style.display="none",a.classList.remove("active"))),this._setTabsAndTabWidth(),this._animateIndicator(h),t.preventDefault()};this.el.Expressive_Tabs=this,this.options={...d.defaults,...e},this._tabLinks=this._queryTabLinks(),this._tabLinks.forEach(s=>{if(this._originalLinks.set(s,{active:s.classList.contains("active"),current:s.getAttribute("aria-current")}),s.hasAttribute("target"))return;let n=s.hash&&document.getElementById(s.hash.slice(1));n&&this._originalPanels.set(n,{display:n.style.display,priority:n.style.getPropertyPriority("display"),active:n.classList.contains("active"),carousel:n.classList.contains("carousel-item")})}),(i=this.options).swipeable&&(i.swipeable=window.innerWidth<=this.options.responsiveThreshold),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers()}static get defaults(){return ge}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Tabs}destroy(){this._removeEventHandlers(),this._indicator.remove(),this.options.swipeable&&this._teardownSwipeableTabs(),this._originalPanels.forEach((t,e)=>{e.style.setProperty("display",t.display,t.priority),e.classList.toggle("active",t.active),e.classList.toggle("carousel-item",t.carousel),e.className||e.removeAttribute("class")}),this._originalLinks.forEach((t,e)=>{e.classList.toggle("active",t.active),t.current===null?e.removeAttribute("aria-current"):e.setAttribute("aria-current",t.current)}),this.el.Expressive_Tabs=void 0}get index(){return this._index}_setupEventHandlers(){window.addEventListener("resize",this._handleWindowResize),this.el.addEventListener("click",this._handleTabClick)}_removeEventHandlers(){window.removeEventListener("resize",this._handleWindowResize),this.el.removeEventListener("click",this._handleTabClick)}_queryTabLinks(){return this.el.querySelectorAll(":scope > a, :scope > .tab > a")}_createIndicator(){let t=this.el.tagName==="UL"||this.el.tagName==="OL"?"li":"span",e=document.createElement(t);e.classList.add("indicator"),this.el.appendChild(e),this._indicator=e,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}_setActiveTabLink(t){Array.from(this._tabLinks).forEach(e=>{e.classList.remove("active"),e.removeAttribute("aria-current")}),this._activeTabLink=t,t.classList.add("active"),t.setAttribute("aria-current","page"),this._index=Array.from(this._tabLinks).indexOf(t),this._content=t.hasAttribute("target")?null:document.getElementById(t.hash.slice(1))}_setupActiveTabLink(){if(this._activeTabLink=Array.from(this._tabLinks).find(t=>t.getAttribute("href")===location.hash),!this._activeTabLink){let t=this.el.querySelector("a.active");t||(t=this._tabLinks[0]),this._activeTabLink=t}this._setActiveTabLink(this._activeTabLink),this._originalPanels.forEach((t,e)=>e.classList.toggle("active",e===this._content))}_setupSwipeableTabs(){let t=[];this._tabLinks.forEach(i=>{if(i.hash&&!i.hasAttribute("target")){let s=document.getElementById(i.hash.slice(1));if(!s)return;s.classList.add("carousel-item"),t.push(s)}});let e=document.createElement("div");e.classList.add("tabs-content","carousel","flat"),t[0].parentElement.insertBefore(e,t[0]),t.forEach(i=>{let s=document.createComment("");i.before(s),this._originalPanels.get(i).marker=s,e.appendChild(i),i.style.display=""}),this._tabsCarousel=F.init(e,{fullWidth:!0,noWrap:!0,duration:this.options.duration,onCycleTo:i=>{let s=this._index;this._setActiveTabLink(Array.from(this._tabLinks).find(n=>!n.hasAttribute("target")&&n.hash==="#"+i.id)),this._setTabsAndTabWidth(),this._animateIndicator(s),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}})}_teardownSwipeableTabs(){let t=this._tabsCarousel.el;this._tabsCarousel.destroy(),this._originalPanels.forEach((e,i)=>e.marker?.replaceWith(i)),t.remove()}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(!(t===this._activeTabLink||t.hasAttribute("target"))&&t.hash){let e=document.getElementById(t.hash.slice(1));e&&(e.style.display="none")}})}_setTabsAndTabWidth(){this._tabsWidth=this.el.getBoundingClientRect().width,this._tabWidth=Math.max(this._tabsWidth,this.el.scrollWidth)/this._tabLinks.length}_calcRightPos(t){return Math.ceil(this._tabsWidth-t.offsetLeft-t.getBoundingClientRect().width)}_calcLeftPos(t){return Math.floor(t.offsetLeft)}updateTabIndicator(){this._setTabsAndTabWidth(),this._animateIndicator(this._index)}_animateIndicator(t){let e=0,i=0;this._index-t>=0?e=90:i=90,this._indicator.style.transition=`
|
|
27
|
+
`,this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this.el.style.left="0",this.el.style.top="0",this._schedule(()=>{this._reset(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_addCaption(){this._photoCaption=document.createElement("div"),this._photoCaption.classList.add("lightbox-caption"),this._photoCaption.innerText=this.caption,p.portalRoot(this.el).append(this._photoCaption),this._photoCaption.style.display="inline",this._photoCaption.style.transition="none",this._photoCaption.style.opacity="0";let t=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="1"},1)}_removeCaption(){let t=this._motion.matches?0:this.options.outDuration;this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="0"}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",i=>{i.stopPropagation(),this.close()},{once:!0}),this.el.before(this._overlay);let t=this._overlay.getBoundingClientRect();this._overlay.style.width=this.windowWidth+"px",this._overlay.style.height=this.windowHeight+"px",this._overlay.style.left=-1*t.left+"px",this._overlay.style.top=-1*t.top+"px",this._overlay.style.transition="none",this._overlay.style.opacity="0";let e=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._overlay.style.transition=`opacity ${e}ms ease`,this._overlay.style.opacity="1"},1)}_removeOverlay(){let t=this._motion.matches?0:this.options.outDuration;this._overlay.style.transition=`opacity ${t}ms ease`,this._overlay.style.opacity="0"}};B._overflow=new WeakMap;var _t=B;var me=d=>`a[href="#${d}"]`,Li={scrollOffset:200,activeClass:"active",getActiveElement:me,keepTopElementActive:!1},x=class x extends b{constructor(t,e){super(t,e,x);this._ratio=0;this._link=null;this.el.Expressive_ScrollSpy=this,this.options={...x.defaults,...e},this._offset=this.el.style.getPropertyValue("--md-comp-scrollspy-offset"),this._offsetPriority=this.el.style.getPropertyPriority("--md-comp-scrollspy-offset"),this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),x._elements.push(this),typeof IntersectionObserver<"u"&&(this._observer=new IntersectionObserver(i=>{if(x.getInstance(this.el)===this){for(let s of i)this._ratio=s.isIntersecting?s.intersectionRatio:0;x._syncActive(this.options.getActiveElement)}},{rootMargin:`-${this.options.scrollOffset}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}),this._observer.observe(this.el))}static get defaults(){return Li}static init(t,e={}){return super.init(t,e,x)}static getInstance(t){return t.Expressive_ScrollSpy}destroy(){let t=x._elements.indexOf(this);if(t<0)return;x._elements.splice(t,1),this._observer?.disconnect();let e=this.options.getActiveElement;x._active.get(e)===this&&x._clearActive(e),this.el.style.setProperty("--md-comp-scrollspy-offset",this._offset,this._offsetPriority),this.el.Expressive_ScrollSpy=void 0,x._syncActive(e)}static _syncActive(t){let e=x._elements.filter(a=>a.options.getActiveElement===t),i=null,s=0;for(let a of e){let c=a._ratio;c>s&&(s=c,i=a)}if(!i){let a=e.filter(c=>c.options.keepTopElementActive);i=x._nearestAbove(a)??a[0]}let o=x._active.get(t);if(i&&o===i&&i._link?.isConnected)return;let r=i?x._linkFor(i.el.id,i.options):null;o===i&&o?._link===r||(x._clearActive(t),r&&(r.classList.add(i.options.activeClass),r.setAttribute("aria-current","true"),i._link=r,x._active.set(t,i)))}static _nearestAbove(t){let e=null,i=-1/0;for(let s of t){let o=s.el.getBoundingClientRect().top;o<=0&&o>=i&&(i=o,e=s)}return e}static _clearActive(t){let e=x._active.get(t);e&&(e._link?.classList.remove(e.options.activeClass),e._link?.removeAttribute("aria-current"),e._link=null,x._active.delete(t))}static _linkFor(t,e){if(!t)return null;if(e.getActiveElement!==me)try{return document.querySelector(e.getActiveElement(t))}catch{return null}let i=`#${t}`,s=document.querySelectorAll('a[href^="#"]');for(let o=0;o<s.length;o++)if(s[o].getAttribute("href")===i)return s[o];return null}};x._elements=[],x._active=new Map;var Et=x;var Ti={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},Mi="(width < 600px)",bt=class d extends b{constructor(t,e){super(t,e,d);this.expand=()=>{this.isExpanded||(typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.isExpanded=!0,this.el.classList.add("expanded"),this._sync(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el))};this.collapse=()=>{this.isExpanded&&(typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this.isExpanded=!1,this.el.classList.remove("expanded"),this._sync(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el))};this.toggle=()=>{this.isExpanded?this.collapse():this.expand()};this._onClick=t=>{let e=t.target;if(e instanceof Node){if(this._toggle&&(e===this._toggle||this._toggle.contains(e))){this.toggle(),t.preventDefault();return}e===this.el&&this.isExpanded&&this._isModal()&&this.collapse()}};this._onKeyDown=t=>{if(!(t.key!=="Escape"||t.defaultPrevented)&&this.isExpanded&&this._isModal()){let e=this.el.getRootNode(),i=this.el.contains(e.activeElement),s=e.activeElement;for(;s?.shadowRoot?.activeElement;)s=s.shadowRoot.activeElement;this.collapse();let o=e.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;!this.isExpanded&&i&&o===s&&this._toggle?.focus()}};this.el.Expressive_NavigationRail=this,this.options={...d.defaults,...e},this._toggle=this._findToggle(),this._mql=window.matchMedia(Mi),this.isExpanded=this.el.classList.contains("expanded"),this._sync(),this.el.addEventListener("click",this._onClick),document.addEventListener("keydown",this._onKeyDown)}static get defaults(){return Ti}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_NavigationRail}destroy(){this.el.removeEventListener("click",this._onClick),document.removeEventListener("keydown",this._onKeyDown),this.el.Expressive_NavigationRail=void 0}_findToggle(){let t=this.el.querySelector(":scope > button:not(.button)");return t instanceof HTMLButtonElement?t:null}_isCompact(){return this._mql.matches}_isModal(){return this.el.classList.contains("modal")||this._isCompact()}_sync(){this.el.setAttribute("aria-expanded",this.isExpanded?"true":"false"),this._toggle?.setAttribute("aria-expanded",this.isExpanded?"true":"false")}};var xi={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},yt=class d extends b{constructor(t,e){var i;super(t,e,d);this._originalPanels=new Map;this._originalLinks=new Map;this._handleWindowResize=p.throttle(()=>{if(this._setTabsAndTabWidth(),this._tabWidth!==0&&this._tabsWidth!==0){let t=this._calcLeftPos(this._activeTabLink),e=this._calcRightPos(this._activeTabLink);this._indicator.style.left=t+"px",this._indicator.style.right=e+"px"}},200);this._handleTabClick=t=>{let e=t.target;if(!e)return;let i=e.closest("a");if(!i||!Array.from(this._tabLinks).includes(i))return;let s=i.parentElement;if(i.classList.contains("disabled")||i.getAttribute("aria-disabled")==="true"||s?.classList.contains("disabled")){t.preventDefault();return}if(i.hasAttribute("target"))return;if(this.options.swipeable){let c=i.hash&&document.getElementById(i.hash.slice(1)),h=this._tabsCarousel.images.indexOf(c);h>=0&&this._tabsCarousel.set(h),t.preventDefault();return}let r=this._content;this._tabLinks=this._queryTabLinks();let a=this._index;this._setActiveTabLink(i),this._content&&(this._content.style.display="block",this._content.classList.add("active"),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content),r&&r!==this._content&&(r.style.display="none",r.classList.remove("active"))),this._setTabsAndTabWidth(),this._animateIndicator(a),t.preventDefault()};this.el.Expressive_Tabs=this,this.options={...d.defaults,...e},this._tabLinks=this._queryTabLinks(),this._tabLinks.forEach(s=>{if(this._originalLinks.set(s,{active:s.classList.contains("active"),current:s.getAttribute("aria-current")}),s.hasAttribute("target"))return;let o=s.hash&&document.getElementById(s.hash.slice(1));o&&this._originalPanels.set(o,{display:o.style.display,priority:o.style.getPropertyPriority("display"),active:o.classList.contains("active"),carousel:o.classList.contains("carousel-item")})}),(i=this.options).swipeable&&(i.swipeable=window.innerWidth<=this.options.responsiveThreshold),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers()}static get defaults(){return xi}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Tabs}destroy(){this._removeEventHandlers(),this._indicator.remove(),this.options.swipeable&&this._teardownSwipeableTabs(),this._originalPanels.forEach((t,e)=>{e.style.setProperty("display",t.display,t.priority),e.classList.toggle("active",t.active),e.classList.toggle("carousel-item",t.carousel),e.className||e.removeAttribute("class")}),this._originalLinks.forEach((t,e)=>{e.classList.toggle("active",t.active),t.current===null?e.removeAttribute("aria-current"):e.setAttribute("aria-current",t.current)}),this.el.Expressive_Tabs=void 0}get index(){return this._index}_setupEventHandlers(){window.addEventListener("resize",this._handleWindowResize),this.el.addEventListener("click",this._handleTabClick)}_removeEventHandlers(){window.removeEventListener("resize",this._handleWindowResize),this.el.removeEventListener("click",this._handleTabClick)}_queryTabLinks(){return this.el.querySelectorAll(":scope > a, :scope > .tab > a")}_createIndicator(){let t=this.el.tagName==="UL"||this.el.tagName==="OL"?"li":"span",e=document.createElement(t);e.classList.add("indicator"),this.el.appendChild(e),this._indicator=e,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}_setActiveTabLink(t){Array.from(this._tabLinks).forEach(e=>{e.classList.remove("active"),e.removeAttribute("aria-current")}),this._activeTabLink=t,t.classList.add("active"),t.setAttribute("aria-current","page"),this._index=Array.from(this._tabLinks).indexOf(t),this._content=t.hasAttribute("target")?null:document.getElementById(t.hash.slice(1))}_setupActiveTabLink(){if(this._activeTabLink=Array.from(this._tabLinks).find(t=>t.getAttribute("href")===location.hash),!this._activeTabLink){let t=this.el.querySelector("a.active");t||(t=this._tabLinks[0]),this._activeTabLink=t}this._setActiveTabLink(this._activeTabLink),this._originalPanels.forEach((t,e)=>e.classList.toggle("active",e===this._content))}_setupSwipeableTabs(){let t=[];this._tabLinks.forEach(i=>{if(i.hash&&!i.hasAttribute("target")){let s=document.getElementById(i.hash.slice(1));if(!s)return;s.classList.add("carousel-item"),t.push(s)}});let e=document.createElement("div");e.classList.add("tabs-content","carousel","flat"),t[0].parentElement.insertBefore(e,t[0]),t.forEach(i=>{let s=document.createComment("");i.before(s),this._originalPanels.get(i).marker=s,e.appendChild(i),i.style.display=""}),this._tabsCarousel=Y.init(e,{fullWidth:!0,noWrap:!0,duration:this.options.duration,onCycleTo:i=>{let s=this._index;this._setActiveTabLink(Array.from(this._tabLinks).find(o=>!o.hasAttribute("target")&&o.hash==="#"+i.id)),this._setTabsAndTabWidth(),this._animateIndicator(s),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}})}_teardownSwipeableTabs(){let t=this._tabsCarousel.el;this._tabsCarousel.destroy(),this._originalPanels.forEach((e,i)=>e.marker?.replaceWith(i)),t.remove()}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(!(t===this._activeTabLink||t.hasAttribute("target"))&&t.hash){let e=document.getElementById(t.hash.slice(1));e&&(e.style.display="none")}})}_setTabsAndTabWidth(){this._tabsWidth=this.el.getBoundingClientRect().width,this._tabWidth=Math.max(this._tabsWidth,this.el.scrollWidth)/this._tabLinks.length}_calcRightPos(t){return Math.ceil(this._tabsWidth-t.offsetLeft-t.getBoundingClientRect().width)}_calcLeftPos(t){return Math.floor(t.offsetLeft)}updateTabIndicator(){this._setTabsAndTabWidth(),this._animateIndicator(this._index)}_animateIndicator(t){let e=0,i=0;this._index-t>=0?e=90:i=90,this._indicator.style.transition=`
|
|
28
28
|
left ${this.options.duration}ms ease-out ${e}ms,
|
|
29
|
-
right ${this.options.duration}ms ease-out ${i}ms`,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}select(t){let e=Array.from(this._tabLinks).find(i=>i.getAttribute("href")==="#"+t);e&&e.click()}};var _e={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",hours:"Hours",minutes:"Minutes"},twelveHour:!0,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},T=class T extends _{constructor(t,e){super(t,e,T);this._dragPointerId=null;this._clockBuilt=!1;this._handleInputClick=()=>{this._updateTimeFromInput(),this._ensureClockBuilt(),this.displayPlugin&&this.displayPlugin.show(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===u.keys.ENTER&&(t.preventDefault(),this._handleInputClick())};this._handleClockClickStart=t=>{if(!t.isPrimary||t.pointerType==="mouse"&&t.button!==0)return;t.preventDefault(),this._ensureClockBuilt();let e=this.plate.getBoundingClientRect(),i={x:e.left,y:e.top};this.x0=i.x+this.options.dialRadius,this.y0=i.y+this.options.dialRadius,this.moved=!1,this._dragPointerId=t.pointerId,this.dx=t.clientX-this.x0,this.dy=t.clientY-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("pointermove",this._handleDocumentClickMove),document.addEventListener("pointerup",this._handleDocumentClickEnd),document.addEventListener("pointercancel",this._handleDocumentClickCancel)};this._handleDocumentClickMove=t=>{if(t.pointerId!==this._dragPointerId)return;t.preventDefault();let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved=!0,this.setHand(e,i,!1)};this._handleDocumentClickEnd=t=>{if(t.pointerId!==this._dragPointerId)return;this._dragPointerId=null,t.preventDefault(),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel);let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved&&e===this.dx&&i===this.dy&&this.setHand(e,i),this.currentView==="hours"?(this.inputMinutes.focus(),this.showView("minutes",this.options.duration/2)):(clearTimeout(this._autoSubmitTimer),this._autoSubmitTimer=setTimeout(()=>{this._autoSubmitTimer=null,this.options.autoSubmit&&this.done()},this.options.duration/2)),typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("pointermove",this._handleDocumentClickMove)};this._handleDocumentClickCancel=t=>{t.pointerId===this._dragPointerId&&(this._dragPointerId=null,this.moved=!1,document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel))};this._handleAmPmClick=t=>{this._handleAmPmInteraction(t.target)};this._handleAmPmInteraction=t=>{this.amOrPm=t.classList.contains("am-btn")?"AM":"PM",this._updateAmPmView()};this.showView=(t,e=null)=>{this._ensureClockBuilt();let i=t==="hours",s=i?this.hoursView:this.minutesView,n=i?this.minutesView:this.hoursView;this.currentView=t,n.classList.add("timepicker-dial-out"),s.style.visibility="visible",s.classList.remove("timepicker-dial-out"),this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(()=>{n.style.visibility="hidden"},this.options.duration)};this._inputFromTextField=t=>{let e=t.target,i=e===this.inputHours;if(!i&&e!==this.inputMinutes)return;this._cancelClockReset();let s=Number(e.value),n=i&&this.options.twelveHour?1:0,a=i?this.options.twelveHour?12:23:59;!e.value.trim()||!Number.isInteger(s)||s<n||s>a||(this[i?"hours":"minutes"]=s,this.drawClockFromTimeInput(s,i))};this.done=(t=null)=>{let e=this.el.value,i=t?"":T._addLeadingZero(this.hours)+":"+T._addLeadingZero(this.minutes);this.time=i,!t&&this.options.twelveHour&&(i=`${i} ${this.amOrPm}`),this.el.value=i,i!==e&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))};this.confirm=()=>{this.done(),typeof this.options.onDone=="function"&&this.options.onDone.call(this)};this.cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.clear=()=>{this.done(!0)};this.el.Expressive_Timepicker=this,this.options={...T.defaults,...e,i18n:{...T.defaults.i18n,...e?.i18n}},this.id=u.guid(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=X.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return _e}static init(t,e={}){return super.init(t,e,T)}static _addLeadingZero(t){return(t<10?"0":"")+t}static _createSVGEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}static getInstance(t){return t.Expressive_Timepicker}destroy(){clearTimeout(this._autoSubmitTimer),clearTimeout(this.toggleViewTimer),clearTimeout(this.vibrateTimer),this._cancelClockReset(),this._removeEventHandlers(),this.displayPlugin?.destroy(),this.containerEl.remove(),this.el.Expressive_Timepicker=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.plate.addEventListener("pointerdown",this._handleClockClickStart),this.digitalClock.addEventListener("input",this._inputFromTextField),this.inputHours.addEventListener("focus",()=>this.showView("hours")),this.inputHours.addEventListener("focusout",()=>this.formatHours()),this.inputMinutes.addEventListener("focus",()=>this.showView("minutes")),this.inputMinutes.addEventListener("focusout",()=>this.formatMinutes())}_removeEventHandlers(){this.digitalClock.removeEventListener("input",this._inputFromTextField),this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel)}_insertHTMLIntoDOM(){let t=document.createElement("template");t.innerHTML=T._template.trim(),this.containerEl=t.content.firstChild,this.containerEl.id="container-"+this.id;let e=this.options.container,i=e instanceof HTMLElement?e:document.querySelector(e);this.options.container&&i?i.append(this.containerEl):this.el.parentElement.appendChild(this.containerEl)}_setupVariables(){this.currentView="hours",this.canVibrate=typeof navigator.vibrate=="function",this._canvas=this.containerEl.querySelector(".timepicker-canvas"),this.plate=this.containerEl.querySelector(".timepicker-plate"),this.digitalClock=this.containerEl.querySelector(".timepicker-display-column"),this.hoursView=this.containerEl.querySelector(".timepicker-hours"),this.minutesView=this.containerEl.querySelector(".timepicker-minutes"),this.inputHours=this.containerEl.querySelector(".timepicker-input-hours"),this.inputMinutes=this.containerEl.querySelector(".timepicker-input-minutes"),this.inputHours.setAttribute("aria-label",this.options.i18n.hours),this.inputMinutes.setAttribute("aria-label",this.options.i18n.minutes),this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_pickerSetup(){u.createButton(this.footer,this.options.i18n.clear,["timepicker-clear"],this.options.showClearBtn,this.clear),this.options.autoSubmit||u.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this.confirm,this.cancel),this._updateTimeFromInput(),this.options.displayPlugin||this.showView("hours")}_ensureClockBuilt(){this._clockBuilt||(this._clockBuilt=!0,this._clockSetup(),this._updateAmPmView())}_clockSetup(){this.options.twelveHour&&(this._amBtn=document.createElement("button"),this._amBtn.type="button",this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("button"),this._pmBtn.type="button",this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._pmBtn)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}_buildSVGClock(){let t=this.options.dialRadius,e=this.options.tickRadius,i=t*2,s=T._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let n=T._createSVGEl("g");n.setAttribute("transform","translate("+t+","+t+")");let a=T._createSVGEl("circle");a.setAttribute("class","timepicker-canvas-bearing"),a.setAttribute("cx","0"),a.setAttribute("cy","0"),a.setAttribute("r","4");let h=T._createSVGEl("line");h.setAttribute("x1","0"),h.setAttribute("y1","0");let c=T._createSVGEl("circle");c.setAttribute("class","timepicker-canvas-bg"),c.setAttribute("r",e.toString()),n.appendChild(h),n.appendChild(c),n.appendChild(a),s.appendChild(n),this._canvas.appendChild(s),this.hand=h,this.bg=c,this.bearing=a,this.g=n}_buildHoursView(){if(this.options.twelveHour)for(let t=1;t<13;t+=1){let e=t/6*Math.PI,i=this.options.outerRadius;this._buildHoursTick(t,e,i)}else for(let t=0;t<24;t+=1){let e=t/6*Math.PI,s=t>0&&t<13?this.options.innerRadius:this.options.outerRadius;this._buildHoursTick(t,e,s)}}_buildHoursTick(t,e,i){let s=document.createElement("div");s.classList.add("timepicker-tick"),s.style.left=this.options.dialRadius+Math.sin(e)*i-this.options.tickRadius+"px",s.style.top=this.options.dialRadius-Math.cos(e)*i-this.options.tickRadius+"px",s.textContent=t===0?"00":t.toString(),this.hoursView.appendChild(s)}_buildMinutesView(){let t=document.createElement("div");t.classList.add("timepicker-tick");for(let e=0;e<60;e+=5){let i=t.cloneNode(!0),s=e/30*Math.PI;i.style.left=this.options.dialRadius+Math.sin(s)*this.options.outerRadius-this.options.tickRadius+"px",i.style.top=this.options.dialRadius-Math.cos(s)*this.options.outerRadius-this.options.tickRadius+"px",i.textContent=T._addLeadingZero(e),this.minutesView.appendChild(i)}}_updateAmPmView(){!this._amBtn||!this._pmBtn||(this._amBtn.setAttribute("aria-pressed",String(this.amOrPm==="AM")),this._pmBtn.setAttribute("aria-pressed",String(this.amOrPm==="PM")),this._amBtn.classList.toggle("outlined",this.amOrPm!=="AM"),this._pmBtn.classList.toggle("outlined",this.amOrPm!=="PM"),this.options.twelveHour&&(this.amOrPm==="PM"?(this._amBtn.classList.remove("filled"),this._pmBtn.classList.add("filled")):this.amOrPm==="AM"&&(this._amBtn.classList.add("filled"),this._pmBtn.classList.remove("filled"))))}_updateTimeFromInput(){this._cancelClockReset();let t=((this.el.value||this.options.defaultTime||"")+"").trim().toUpperCase().split(":"),e=t[1]?.match(/AM|PM/)?.[0];if(t[1]=t[1]?.replace(/AM|PM/,""),t[0]==="NOW"){let i=new Date(+new Date+this.options.fromNow);t=[i.getHours().toString(),i.getMinutes().toString()]}this.hours=+t[0]||0,this.minutes=+t[1]||0,this.options.twelveHour&&(this.amOrPm=e==="AM"||e==="PM"?e:this.hours>=12?"PM":"AM",this.hours=this.hours%12||12),this.inputHours.value=T._addLeadingZero(this.hours),this.inputMinutes.value=T._addLeadingZero(this.minutes),this._updateAmPmView()}_cancelClockReset(){clearTimeout(this._clockResetTimer),this._clockResetTimer=null,this._canvas?.classList.remove("timepicker-canvas-out")}resetClock(t){this._cancelClockReset();let e=this.currentView,i=this[e],s=e==="hours",n=Math.PI/(s?6:30),a=i*n,h=s&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,c=Math.sin(a)*h,l=-Math.cos(a)*h;t?(this._canvas?.classList.add("timepicker-canvas-out"),this._clockResetTimer=setTimeout(()=>{this.setHand(c,l)},t)):this.setHand(c,l)}drawClockFromTimeInput(t,e){let i=Math.PI/(e?6:30),s=t*i,n;this.options.twelveHour?n=this.options.outerRadius:n=e&&t>0&&t<13?this.options.innerRadius:this.options.outerRadius,this.setClockAttributes(s,n)}setHand(t,e,i=!1){this._cancelClockReset();let s=this.currentView==="hours",n=Math.PI/(s||i?6:30),a=Math.sqrt(t*t+e*e),h=s&&a<(this.options.outerRadius+this.options.innerRadius)/2,c=Math.atan2(t,-e),l=h?this.options.innerRadius:this.options.outerRadius;this.options.twelveHour&&(l=this.options.outerRadius),c<0&&(c=Math.PI*2+c);let r=Math.round(c/n);c=r*n,this.options.twelveHour?s?r===0&&(r=12):(i&&(r*=5),r===60&&(r=0)):s?(r===12&&(r=0),r=h?r===0?12:r:r===0?0:r+12):(i&&(r*=5),r===60&&(r=0)),this[this.currentView]!==r&&this.canVibrate&&this.options.vibrate&&(this.vibrateTimer||(navigator.vibrate(10),this.vibrateTimer=setTimeout(()=>{this.vibrateTimer=null},100))),this[this.currentView]=r,s?this.inputHours.value=T._addLeadingZero(r):this.inputMinutes.value=T._addLeadingZero(r),this.setClockAttributes(c,l)}setClockAttributes(t,e){if(!this.hand||!this.bg)return;let i=Math.sin(t)*(e-this.options.tickRadius),s=-Math.cos(t)*(e-this.options.tickRadius),n=Math.sin(t)*e,a=-Math.cos(t)*e;this.hand.setAttribute("x2",i.toString()),this.hand.setAttribute("y2",s.toString()),this.bg.setAttribute("cx",n.toString()),this.bg.setAttribute("cy",a.toString())}formatHours(){this.inputHours.value==""&&this.setHoursDefault(),this.inputHours.value=T._addLeadingZero(this.hours)}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=T._addLeadingZero(this.minutes)}setHoursDefault(){this.hours=new Date().getHours(),this.options.twelveHour&&(this.hours=this.hours%12||12),this.inputHours.value=this.hours.toString()}};T._template=`<div class="timepicker-container">
|
|
29
|
+
right ${this.options.duration}ms ease-out ${i}ms`,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}select(t){let e=Array.from(this._tabLinks).find(i=>i.getAttribute("href")==="#"+t);e&&e.click()}};var Ci={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",hours:"Hours",minutes:"Minutes"},twelveHour:!0,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},C=class C extends b{constructor(t,e){super(t,e,C);this._dragPointerId=null;this._clockBuilt=!1;this._handleInputClick=()=>{this._updateTimeFromInput(),this._ensureClockBuilt(),this.displayPlugin&&this.displayPlugin.show(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===p.keys.ENTER&&(t.preventDefault(),this._handleInputClick())};this._handleClockClickStart=t=>{if(!t.isPrimary||t.pointerType==="mouse"&&t.button!==0)return;t.preventDefault(),this._ensureClockBuilt();let e=this.plate.getBoundingClientRect(),i={x:e.left,y:e.top};this.x0=i.x+this.options.dialRadius,this.y0=i.y+this.options.dialRadius,this.moved=!1,this._dragPointerId=t.pointerId,this.dx=t.clientX-this.x0,this.dy=t.clientY-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("pointermove",this._handleDocumentClickMove),document.addEventListener("pointerup",this._handleDocumentClickEnd),document.addEventListener("pointercancel",this._handleDocumentClickCancel)};this._handleDocumentClickMove=t=>{if(t.pointerId!==this._dragPointerId)return;t.preventDefault();let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved=!0,this.setHand(e,i,!1)};this._handleDocumentClickEnd=t=>{if(t.pointerId!==this._dragPointerId)return;this._dragPointerId=null,t.preventDefault(),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel);let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved&&e===this.dx&&i===this.dy&&this.setHand(e,i),this.currentView==="hours"?(this.inputMinutes.focus(),this.showView("minutes",this.options.duration/2)):(clearTimeout(this._autoSubmitTimer),this._autoSubmitTimer=setTimeout(()=>{this._autoSubmitTimer=null,this.options.autoSubmit&&this.done()},this.options.duration/2)),typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("pointermove",this._handleDocumentClickMove)};this._handleDocumentClickCancel=t=>{t.pointerId===this._dragPointerId&&(this._dragPointerId=null,this.moved=!1,document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel))};this._handleAmPmClick=t=>{this._handleAmPmInteraction(t.target)};this._handleAmPmInteraction=t=>{this.amOrPm=t.classList.contains("am-btn")?"AM":"PM",this._updateAmPmView()};this.showView=(t,e=null)=>{this._ensureClockBuilt();let i=t==="hours",s=i?this.hoursView:this.minutesView,o=i?this.minutesView:this.hoursView;this.currentView=t,o.classList.add("timepicker-dial-out"),s.style.visibility="visible",s.classList.remove("timepicker-dial-out"),this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(()=>{o.style.visibility="hidden"},this.options.duration)};this._inputFromTextField=t=>{let e=t.target,i=e===this.inputHours;if(!i&&e!==this.inputMinutes)return;this._cancelClockReset();let s=Number(e.value),o=i&&this.options.twelveHour?1:0,r=i?this.options.twelveHour?12:23:59;!e.value.trim()||!Number.isInteger(s)||s<o||s>r||(this[i?"hours":"minutes"]=s,this.drawClockFromTimeInput(s,i))};this.done=(t=null)=>{let e=this.el.value,i=t?"":C._addLeadingZero(this.hours)+":"+C._addLeadingZero(this.minutes);this.time=i,!t&&this.options.twelveHour&&(i=`${i} ${this.amOrPm}`),this.el.value=i,i!==e&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))};this.confirm=()=>{this.done(),typeof this.options.onDone=="function"&&this.options.onDone.call(this)};this.cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.clear=()=>{this.done(!0)};this.el.Expressive_Timepicker=this,this.options={...C.defaults,...e,i18n:{...C.defaults.i18n,...e?.i18n}},this.id=p.guid(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=ft.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return Ci}static init(t,e={}){return super.init(t,e,C)}static _addLeadingZero(t){return(t<10?"0":"")+t}static _createSVGEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}static getInstance(t){return t.Expressive_Timepicker}destroy(){clearTimeout(this._autoSubmitTimer),clearTimeout(this.toggleViewTimer),clearTimeout(this.vibrateTimer),this._cancelClockReset(),this._removeEventHandlers(),this.displayPlugin?.destroy(),this.containerEl.remove(),this.el.Expressive_Timepicker=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.plate.addEventListener("pointerdown",this._handleClockClickStart),this.digitalClock.addEventListener("input",this._inputFromTextField),this.inputHours.addEventListener("focus",()=>this.showView("hours")),this.inputHours.addEventListener("focusout",()=>this.formatHours()),this.inputMinutes.addEventListener("focus",()=>this.showView("minutes")),this.inputMinutes.addEventListener("focusout",()=>this.formatMinutes())}_removeEventHandlers(){this.digitalClock.removeEventListener("input",this._inputFromTextField),this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel)}_insertHTMLIntoDOM(){let t=document.createElement("template");t.innerHTML=C._template.trim(),this.containerEl=t.content.firstChild,this.containerEl.id="container-"+this.id;let e=this.options.container,i=e instanceof HTMLElement?e:document.querySelector(e);this.options.container&&i?i.append(this.containerEl):this.el.parentElement.appendChild(this.containerEl)}_setupVariables(){this.currentView="hours",this.canVibrate=typeof navigator.vibrate=="function",this._canvas=this.containerEl.querySelector(".timepicker-canvas"),this.plate=this.containerEl.querySelector(".timepicker-plate"),this.digitalClock=this.containerEl.querySelector(".timepicker-display-column"),this.hoursView=this.containerEl.querySelector(".timepicker-hours"),this.minutesView=this.containerEl.querySelector(".timepicker-minutes"),this.inputHours=this.containerEl.querySelector(".timepicker-input-hours"),this.inputMinutes=this.containerEl.querySelector(".timepicker-input-minutes"),this.inputHours.setAttribute("aria-label",this.options.i18n.hours),this.inputMinutes.setAttribute("aria-label",this.options.i18n.minutes),this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_pickerSetup(){p.createButton(this.footer,this.options.i18n.clear,["timepicker-clear"],this.options.showClearBtn,this.clear),this.options.autoSubmit||p.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this.confirm,this.cancel),this._updateTimeFromInput(),this.options.displayPlugin||this.showView("hours")}_ensureClockBuilt(){this._clockBuilt||(this._clockBuilt=!0,this._clockSetup(),this._updateAmPmView())}_clockSetup(){this.options.twelveHour&&(this._amBtn=document.createElement("button"),this._amBtn.type="button",this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("button"),this._pmBtn.type="button",this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._pmBtn)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}_buildSVGClock(){let t=this.options.dialRadius,e=this.options.tickRadius,i=t*2,s=C._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let o=C._createSVGEl("g");o.setAttribute("transform","translate("+t+","+t+")");let r=C._createSVGEl("circle");r.setAttribute("class","timepicker-canvas-bearing"),r.setAttribute("cx","0"),r.setAttribute("cy","0"),r.setAttribute("r","4");let a=C._createSVGEl("line");a.setAttribute("x1","0"),a.setAttribute("y1","0");let c=C._createSVGEl("circle");c.setAttribute("class","timepicker-canvas-bg"),c.setAttribute("r",e.toString()),o.appendChild(a),o.appendChild(c),o.appendChild(r),s.appendChild(o),this._canvas.appendChild(s),this.hand=a,this.bg=c,this.bearing=r,this.g=o}_buildHoursView(){if(this.options.twelveHour)for(let t=1;t<13;t+=1){let e=t/6*Math.PI,i=this.options.outerRadius;this._buildHoursTick(t,e,i)}else for(let t=0;t<24;t+=1){let e=t/6*Math.PI,s=t>0&&t<13?this.options.innerRadius:this.options.outerRadius;this._buildHoursTick(t,e,s)}}_buildHoursTick(t,e,i){let s=document.createElement("div");s.classList.add("timepicker-tick"),s.style.left=this.options.dialRadius+Math.sin(e)*i-this.options.tickRadius+"px",s.style.top=this.options.dialRadius-Math.cos(e)*i-this.options.tickRadius+"px",s.textContent=t===0?"00":t.toString(),this.hoursView.appendChild(s)}_buildMinutesView(){let t=document.createElement("div");t.classList.add("timepicker-tick");for(let e=0;e<60;e+=5){let i=t.cloneNode(!0),s=e/30*Math.PI;i.style.left=this.options.dialRadius+Math.sin(s)*this.options.outerRadius-this.options.tickRadius+"px",i.style.top=this.options.dialRadius-Math.cos(s)*this.options.outerRadius-this.options.tickRadius+"px",i.textContent=C._addLeadingZero(e),this.minutesView.appendChild(i)}}_updateAmPmView(){!this._amBtn||!this._pmBtn||(this._amBtn.setAttribute("aria-pressed",String(this.amOrPm==="AM")),this._pmBtn.setAttribute("aria-pressed",String(this.amOrPm==="PM")),this._amBtn.classList.toggle("outlined",this.amOrPm!=="AM"),this._pmBtn.classList.toggle("outlined",this.amOrPm!=="PM"),this.options.twelveHour&&(this.amOrPm==="PM"?(this._amBtn.classList.remove("filled"),this._pmBtn.classList.add("filled")):this.amOrPm==="AM"&&(this._amBtn.classList.add("filled"),this._pmBtn.classList.remove("filled"))))}_updateTimeFromInput(){this._cancelClockReset();let t=((this.el.value||this.options.defaultTime||"")+"").trim().toUpperCase().split(":"),e=t[1]?.match(/AM|PM/)?.[0];if(t[1]=t[1]?.replace(/AM|PM/,""),t[0]==="NOW"){let i=new Date(+new Date+this.options.fromNow);t=[i.getHours().toString(),i.getMinutes().toString()]}this.hours=+t[0]||0,this.minutes=+t[1]||0,this.options.twelveHour&&(this.amOrPm=e==="AM"||e==="PM"?e:this.hours>=12?"PM":"AM",this.hours=this.hours%12||12),this.inputHours.value=C._addLeadingZero(this.hours),this.inputMinutes.value=C._addLeadingZero(this.minutes),this._updateAmPmView()}_cancelClockReset(){clearTimeout(this._clockResetTimer),this._clockResetTimer=null,this._canvas?.classList.remove("timepicker-canvas-out")}resetClock(t){this._cancelClockReset();let e=this.currentView,i=this[e],s=e==="hours",o=Math.PI/(s?6:30),r=i*o,a=s&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,c=Math.sin(r)*a,h=-Math.cos(r)*a;t?(this._canvas?.classList.add("timepicker-canvas-out"),this._clockResetTimer=setTimeout(()=>{this.setHand(c,h)},t)):this.setHand(c,h)}drawClockFromTimeInput(t,e){let i=Math.PI/(e?6:30),s=t*i,o;this.options.twelveHour?o=this.options.outerRadius:o=e&&t>0&&t<13?this.options.innerRadius:this.options.outerRadius,this.setClockAttributes(s,o)}setHand(t,e,i=!1){this._cancelClockReset();let s=this.currentView==="hours",o=Math.PI/(s||i?6:30),r=Math.sqrt(t*t+e*e),a=s&&r<(this.options.outerRadius+this.options.innerRadius)/2,c=Math.atan2(t,-e),h=a?this.options.innerRadius:this.options.outerRadius;this.options.twelveHour&&(h=this.options.outerRadius),c<0&&(c=Math.PI*2+c);let l=Math.round(c/o);c=l*o,this.options.twelveHour?s?l===0&&(l=12):(i&&(l*=5),l===60&&(l=0)):s?(l===12&&(l=0),l=a?l===0?12:l:l===0?0:l+12):(i&&(l*=5),l===60&&(l=0)),this[this.currentView]!==l&&this.canVibrate&&this.options.vibrate&&(this.vibrateTimer||(navigator.vibrate(10),this.vibrateTimer=setTimeout(()=>{this.vibrateTimer=null},100))),this[this.currentView]=l,s?this.inputHours.value=C._addLeadingZero(l):this.inputMinutes.value=C._addLeadingZero(l),this.setClockAttributes(c,h)}setClockAttributes(t,e){if(!this.hand||!this.bg)return;let i=Math.sin(t)*(e-this.options.tickRadius),s=-Math.cos(t)*(e-this.options.tickRadius),o=Math.sin(t)*e,r=-Math.cos(t)*e;this.hand.setAttribute("x2",i.toString()),this.hand.setAttribute("y2",s.toString()),this.bg.setAttribute("cx",o.toString()),this.bg.setAttribute("cy",r.toString())}formatHours(){this.inputHours.value==""&&this.setHoursDefault(),this.inputHours.value=C._addLeadingZero(this.hours)}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=C._addLeadingZero(this.minutes)}setHoursDefault(){this.hours=new Date().getHours(),this.options.twelveHour&&(this.hours=this.hours%12||12),this.inputHours.value=this.hours.toString()}};C._template=`<div class="timepicker-container">
|
|
30
30
|
<div class="timepicker-digital-display">
|
|
31
31
|
<div class="timepicker-text-container">
|
|
32
32
|
<div class="timepicker-display-column timepicker-display-digital-clock">
|
|
@@ -53,10 +53,10 @@ var Expressive=(()=>{var ut=Object.defineProperty;var Ft=Object.getOwnPropertyDe
|
|
|
53
53
|
</div>
|
|
54
54
|
<div class="timepicker-footer"></div>
|
|
55
55
|
</div>
|
|
56
|
-
</div>`;var
|
|
56
|
+
</div>`;var Lt=C;var wi={text:"",action:"",onAction:null,dismissible:!1,displayLength:4e3,inDuration:300,outDuration:375,classes:"",completeCallback:null,activationPercent:.8,root:null},y=class y{constructor(n={}){this._dismissed=!1;this._returnFocus=null;this._restoreElement=null;for(this.options={...y.defaults,...n},n.displayLength===void 0&&this.options.action&&(this.options.displayLength=1/0),n.dismissible===void 0&&this.options.action&&(this.options.dismissible=!0),this.message=this.options.text,this.panning=!1,this.timeRemaining=this.options.displayLength;y._snackbars.length>0;){let i=y._snackbars.shift();i._dismissed=!0,i._restoreFocus(!0)}let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;this._returnFocus=t instanceof HTMLElement?t:null,this.el=this._createSnackbar();let e=p.portalRoot(this.options.root??document.body);(!y._container||!y._container.isConnected||y._container.parentNode!==e)&&(y._container&&y._removeContainer(),y._createContainer(e)),y._container.appendChild(this.el),this.el.Expressive_Snackbar=this,y._snackbars.push(this),this._animateIn(),this._setTimer()}static get defaults(){return wi}static getInstance(n){return n.Expressive_Snackbar}static _createContainer(n=document.body){let t=document.createElement("div");t.setAttribute("id","snackbar-container"),t.addEventListener("pointerdown",y._onDragStart),document.addEventListener("pointermove",y._onDragMove),document.addEventListener("pointerup",y._onDragEnd),document.addEventListener("pointercancel",y._onDragCancel),n.appendChild(t),y._container=t}static _removeContainer(){document.removeEventListener("pointermove",y._onDragMove),document.removeEventListener("pointerup",y._onDragEnd),document.removeEventListener("pointercancel",y._onDragCancel),y._container.remove(),y._container=null}static _onDragStart(n){if(!n.isPrimary||n.pointerType==="mouse"&&n.button!==0)return;let t=n.target;if(t&&!t.closest("button, a")&&t.closest(".snackbar")){let i=t.closest(".snackbar").Expressive_Snackbar;if(!i)return;i.panning=!0,i._pauseTimer(),y._draggedSnackbar=i,i.el.classList.add("panning"),i.el.style.transition="",y._dragPointerId=n.pointerId,i.startingXPos=n.clientX,i.velocityX=0,i.time=Date.now(),i.xPos=n.clientX,i._activationDistance=i.el.offsetWidth*i.options.activationPercent}}static _onDragMove(n){if(y._dragPointerId===n.pointerId&&y._draggedSnackbar){n.preventDefault();let t=y._draggedSnackbar;t.deltaX=Math.abs(t.xPos-n.clientX),t.xPos=n.clientX,t.velocityX=t.deltaX/(Date.now()-t.time),t.time=Date.now();let e=t.xPos-t.startingXPos,i=t._activationDistance;t.el.style.transform=`translateX(${e}px)`,t.el.style.opacity=(1-Math.abs(e/i)).toString()}}static _onDragEnd(n){if(y._dragPointerId===n.pointerId&&(y._dragPointerId=null,y._draggedSnackbar)){let t=y._draggedSnackbar;t.panning=!1,t.el.classList.remove("panning");let e=t.xPos-t.startingXPos,i=t._activationDistance,s=Date.now()-t.time<100?t.velocityX:0;Math.abs(e)>i||s>1?(t.wasSwiped=!0,t.dismiss()):(t.el.style.transition="transform .2s, opacity .2s",t.el.style.transform="",t.el.style.opacity="",t._resumeTimer()),y._draggedSnackbar=null}}static _onDragCancel(n){if(y._dragPointerId!==n.pointerId)return;y._dragPointerId=null;let t=y._draggedSnackbar;t&&(t.panning=!1,t.el.classList.remove("panning"),t.el.style.transition="transform .2s, opacity .2s",t.el.style.transform="",t.el.style.opacity="",t._resumeTimer(),y._draggedSnackbar=null)}static dismissAll(){for(let n of[...y._snackbars])n.dismiss()}_createSnackbar(){let n=this.options.snackbarId?p.getElementById(this.options.root??document.body,this.options.snackbarId):document.createElement("div");if(n instanceof HTMLTemplateElement)n=n.content.cloneNode(!0).firstElementChild;else if(n&&this.options.snackbarId){let e=document.createComment("");n.before(e);let i=[...n.childNodes],s=["class","style","role","aria-live","aria-atomic","inert"].map(o=>[o,n.getAttribute(o)]);this._restoreElement=()=>{n.replaceChildren(...i);for(let[o,r]of s)r===null?n.removeAttribute(o):n.setAttribute(o,r);e.replaceWith(n)}}if(!n)throw new Error("Snackbar body not found");this._events=new(n.ownerDocument.defaultView??window).AbortController;let t={signal:this._events.signal};if(n.classList.add("snackbar"),n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),n.inert=!1,n.addEventListener("focusin",e=>{e.relatedTarget instanceof HTMLElement&&!n.contains(e.relatedTarget)&&(this._returnFocus=e.relatedTarget),this._pauseTimer()},t),n.addEventListener("keydown",e=>{e.key!=="Escape"||e.defaultPrevented||this._dismissed||(e.preventDefault(),e.stopPropagation(),this.dismiss())},t),n.addEventListener("focusout",()=>{clearTimeout(this._focusTimer),this._focusTimer=setTimeout(()=>this._resumeTimer(),0)},t),n.addEventListener("pointerenter",()=>this._pauseTimer(),t),n.addEventListener("pointerleave",()=>this._resumeTimer(),t),this.options.classes.length>0&&n.classList.add(...this.options.classes.split(" ").filter(Boolean)),this.message){let e=document.createElement("p");e.textContent=this.message,n.replaceChildren(e)}if(this.options.action){let e=document.createElement("button");e.type="button",e.textContent=this.options.action,e.addEventListener("click",i=>{if(i.stopPropagation(),!this._dismissed)try{typeof this.options.onAction=="function"&&this.options.onAction()}finally{this.dismiss()}},t),n.appendChild(e)}if(this.options.dismissible){let e=document.createElement("button");e.type="button",e.className="circle",e.setAttribute("aria-label","Dismiss");let i=document.createElement("i");i.className="material-symbols",i.setAttribute("aria-hidden","true"),i.textContent="close",e.appendChild(i),e.addEventListener("click",s=>{s.stopPropagation(),this.dismiss()},t),n.appendChild(e)}return n}_remove(){if(this._events.signal.aborted)return;this._events.abort(),clearTimeout(this.counterTimeout),clearTimeout(this._transitionTimer),clearTimeout(this._dismissTimer),clearTimeout(this._focusTimer),this.counterTimeout=null,y._draggedSnackbar===this&&(y._draggedSnackbar=null,y._dragPointerId=null),this.el.Expressive_Snackbar=void 0,this._restoreElement?this._restoreElement():this.el.remove();let n=y._snackbars.indexOf(this);n>=0&&y._snackbars.splice(n,1),!y._snackbars.length&&y._container?.childElementCount===0&&y._removeContainer()}_animateIn(){this.el.style.display="",this.el.style.opacity="0",this.el.style.transform="translateY(24px)",this.el.style.transition=`
|
|
57
57
|
transform ${this.options.inDuration}ms ease,
|
|
58
58
|
opacity ${this.options.inDuration}ms ease
|
|
59
|
-
`,this._transitionTimer=setTimeout(()=>{this.el.style.transform="",this.el.style.opacity="1"},1)}_setTimer(){this.timeRemaining!==1/0&&(this._deadline=Date.now()+this.timeRemaining,this.counterTimeout=setTimeout(()=>this.dismiss(),this.timeRemaining))}_pauseTimer(){this.counterTimeout!=null&&(clearTimeout(this.counterTimeout),this.counterTimeout=null,this.timeRemaining=Math.max(0,this._deadline-Date.now()))}_resumeTimer(){this._dismissed||this.panning||this.el.matches(":hover, :focus-within")||this.counterTimeout!=null||this._setTimer()}_restoreFocus(
|
|
59
|
+
`,this._transitionTimer=setTimeout(()=>{this.el.style.transform="",this.el.style.opacity="1"},1)}_setTimer(){this.timeRemaining!==1/0&&(this._deadline=Date.now()+this.timeRemaining,this.counterTimeout=setTimeout(()=>this.dismiss(),this.timeRemaining))}_pauseTimer(){this.counterTimeout!=null&&(clearTimeout(this.counterTimeout),this.counterTimeout=null,this.timeRemaining=Math.max(0,this._deadline-Date.now()))}_resumeTimer(){this._dismissed||this.panning||this.el.matches(":hover, :focus-within")||this.counterTimeout!=null||this._setTimer()}_restoreFocus(n=!1){let t=this.el.getRootNode().activeElement,e=t&&this.el.contains(t)?this._returnFocus:null;this.el.inert=!0,n&&this._remove(),e?.isConnected&&e.focus({preventScroll:!0})}dismiss(){if(this._dismissed||(this._dismissed=!0,clearTimeout(this.counterTimeout),this.counterTimeout=null,this._restoreFocus(),this._events.signal.aborted))return;let n=this.el.offsetWidth*this.options.activationPercent;this.wasSwiped&&(this.el.style.transition="transform .05s, opacity .05s",this.el.style.transform=`translateX(${n}px)`,this.el.style.opacity="0"),this.el.style.transition=`
|
|
60
60
|
margin ${this.options.outDuration}ms ease,
|
|
61
|
-
opacity ${this.options.outDuration}ms ease`,clearTimeout(this._transitionTimer),this._transitionTimer=setTimeout(()=>{this.el.style.opacity="0",this.el.style.marginTop="-40px"},1),this._dismissTimer=setTimeout(()=>{this._remove(),typeof this.options.completeCallback=="function"&&this.options.completeCallback()},this.options.outDuration)}};
|
|
61
|
+
opacity ${this.options.outDuration}ms ease`,clearTimeout(this._transitionTimer),this._transitionTimer=setTimeout(()=>{this.el.style.opacity="0",this.el.style.marginTop="-40px"},1),this._dismissTimer=setTimeout(()=>{this._remove(),typeof this.options.completeCallback=="function"&&this.options.completeCallback()},this.options.outDuration)}};y._dragPointerId=null,y._snackbars=[],y._container=null,y._draggedSnackbar=null;var Rt=y;var Ii={exitDelay:200,enterDelay:0,text:"",margin:4,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10,opacity:1},Tt=class d extends b{constructor(t,e){super(t,e,d);this.open=(t=!0)=>{this.isOpen||(clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),this.isOpen=!0,this.el.ownerDocument.addEventListener("keydown",this._handleKeydown,!0),this.options={...this.options,...this._getAttributeOptions()},this._updateTooltipContent(),this._setEnterDelayTimeout(t))};this.close=()=>{this.isOpen&&(this.isHovered=!1,this.isFocused=!1,this.isOpen=!1,this.el.ownerDocument.removeEventListener("keydown",this._handleKeydown,!0),clearTimeout(this._enterDelayTimeout),this._setExitDelayTimeout())};this._handleMouseEnter=()=>{this.isHovered=!0,this.open(!1)};this._handleMouseLeave=t=>{let e=t.relatedTarget;e&&(this.el.contains(e)||this.tooltipEl.contains(e))||(this.isHovered=!1,this.isFocused||this.close())};this._handleKeydown=t=>{t.key!=="Escape"||!this.isOpen||(t.preventDefault(),t.stopPropagation(),this.close(),clearTimeout(this._exitDelayTimeout),this._animateOut())};this._handleFocus=t=>{t.target.matches(":focus-visible")&&(this.isFocused=!0,this.open(!1))};this._handleBlur=t=>{let e=t.relatedTarget;e&&(this.el.contains(e)||this.tooltipEl.contains(e))||(this.isFocused=!1,this.isHovered||this.close())};this.el.Expressive_Tooltip=this,this.options={...d.defaults,...this._getAttributeOptions(),...e},this.isOpen=!1,this.isHovered=!1,this.isFocused=!1,this._appendTooltipEl(),this._setupEventHandlers()}static get defaults(){return Ii}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Tooltip}destroy(){clearTimeout(this._enterDelayTimeout),clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),this.isOpen=!1,this.isHovered=!1,this.isFocused=!1;let t=this.el.getAttribute("aria-describedby")?.split(/\s+/);if(t?.includes(this.tooltipEl.id)){let e=t.filter(i=>i&&i!==this.tooltipEl.id).join(" ");e?this.el.setAttribute("aria-describedby",e):this.el.removeAttribute("aria-describedby")}if(this._originalContent){let{el:e,marker:i,display:s,priority:o,hidden:r,contentClass:a}=this._originalContent;e.style.setProperty("display",s,o),r===null?e.removeAttribute("hidden"):e.setAttribute("hidden",r),e.classList.toggle("tooltip-content",a),e.className||e.removeAttribute("class"),i.replaceWith(e),this._originalContent=null}this.tooltipEl.remove(),this._removeEventHandlers(),this.el.Expressive_Tooltip=void 0}_appendTooltipEl(){this.tooltipEl=document.createElement("div"),this.tooltipEl.classList.add("tooltip"),this.tooltipEl.id=`tooltip-${p.guid()}`,this.tooltipEl.setAttribute("role","tooltip"),this.el.setAttribute("aria-describedby",[this.el.getAttribute("aria-describedby"),this.tooltipEl.id].filter(Boolean).join(" "));let t=this.options.tooltipId?p.getElementById(this.el,this.options.tooltipId):document.createElement("div");if(this.options.tooltipId){this.tooltipEl.classList.add("rich");let e=document.createComment("");t.before(e),this._originalContent={el:t,marker:e,display:t.style.display,priority:t.style.getPropertyPriority("display"),hidden:t.getAttribute("hidden"),contentClass:t.classList.contains("tooltip-content")},t.removeAttribute("hidden")}t.style.display="",t.classList.add("tooltip-content"),this._setTooltipContent(t),this.tooltipEl.appendChild(t),p.portalRoot(this.el).appendChild(this.tooltipEl)}_setTooltipContent(t){this.options.tooltipId||(t.innerText=this.options.text)}_updateTooltipContent(){this._setTooltipContent(this.tooltipEl.querySelector(".tooltip-content"))}_setupEventHandlers(){for(let t of[this.el,this.tooltipEl])t.addEventListener("mouseenter",this._handleMouseEnter),t.addEventListener("mouseleave",this._handleMouseLeave),t.addEventListener("focus",this._handleFocus,!0),t.addEventListener("blur",this._handleBlur,!0)}_removeEventHandlers(){for(let t of[this.el,this.tooltipEl])t.removeEventListener("mouseenter",this._handleMouseEnter),t.removeEventListener("mouseleave",this._handleMouseLeave),t.removeEventListener("focus",this._handleFocus,!0),t.removeEventListener("blur",this._handleBlur,!0);this.el.ownerDocument.removeEventListener("keydown",this._handleKeydown,!0)}_setExitDelayTimeout(){clearTimeout(this._exitDelayTimeout),this._exitDelayTimeout=setTimeout(()=>{this.isHovered||this.isFocused||this._animateOut()},this.options.exitDelay)}_setEnterDelayTimeout(t){clearTimeout(this._enterDelayTimeout),this._enterDelayTimeout=setTimeout(()=>{!this.isHovered&&!this.isFocused&&!t||this._animateIn()},this.options.enterDelay)}_positionTooltip(){let t=this.tooltipEl,e=this.el,i=e.offsetHeight,s=e.offsetWidth,o=t.offsetHeight,r=t.offsetWidth,a=this.options.margin;this.xMovement=0,this.yMovement=0;let c=e.getBoundingClientRect(),h=c.top+p.getDocumentScrollTop(),l=c.left+p.getDocumentScrollLeft();this.options.position==="top"?(h+=-o-a,l+=s/2-r/2,this.yMovement=-this.options.transitionMovement):this.options.position==="right"?(h+=i/2-o/2,l+=s+a,this.xMovement=this.options.transitionMovement):this.options.position==="left"?(h+=i/2-o/2,l+=-r-a,this.xMovement=-this.options.transitionMovement):(h+=i+a,l+=s/2-r/2,this.yMovement=this.options.transitionMovement);let u=this._repositionWithinScreen(l,h,r,o);t.style.setProperty("--md-comp-tooltip-anchor-gap",`${Math.max(0,a)+Math.abs(this.options.transitionMovement)}px`),t.style.top=u.y+"px",t.style.left=u.x+"px"}_repositionWithinScreen(t,e,i,s){return p._repositionWithinScreen(t,e,i,s,this.options.margin,this.options.transitionMovement,"center")}_animateIn(){this._animate(!0)}_animateOut(){this._animate(!1)}_animate(t){let e=this.tooltipEl.style,i=this.el.ownerDocument.defaultView.matchMedia("(prefers-reduced-motion: reduce)").matches,s=i?0:t?this.options.inDuration:this.options.outDuration;t&&(this._positionTooltip(),e.visibility="visible",e.overflow="visible"),e.transition=`transform ${s}ms ease-out, opacity ${s}ms ease-out`,clearTimeout(this._animationTimeout),this._animationTimeout=setTimeout(()=>{e.transform=t&&!i?`translateX(${this.xMovement}px) translateY(${this.yMovement}px)`:"none",e.opacity=t?(this.options.opacity||1).toString():"0",t||(this._animationTimeout=setTimeout(()=>{e.visibility="hidden",e.overflow=""},s))},1)}_getAttributeOptions(){let t={},e=this.el.getAttribute("data-tooltip"),i=this.el.getAttribute("data-tooltip-id"),s=this.el.getAttribute("data-position");return e&&(t.text=e),s&&(t.position=s),i&&(t.tooltipId=i),t}};var fe={AppBar:{component:it,selector:"header.medium, header.large, header:has(> :is(nav:not(.tabs, .navigation-bar, .navigation-rail), .bar) > :is(.search-bar, .searchbar))"},Autocomplete:{component:$,selector:".autocomplete"},ButtonGroup:{component:nt,selector:".button-group"},Cards:{component:z,selector:$t,filter:Vt},ExpandingCard:{component:K,selector:qt},Carousel:{component:Y,selector:".carousel"},Chips:{component:U,selector:".chips"},Confetti:{component:ot,selector:".confetti"},Particles:{component:rt,selector:"canvas.particles"},ColumnChart:{component:W,selector:".column-chart"},BarChart:{component:ct,selector:".bar-chart"},PieChart:{component:ht,selector:".pie-chart"},HeatmapChart:{component:dt,selector:".heatmap-chart"},RadarChart:{component:ut,selector:".radar-chart"},RadialChart:{component:pt,selector:".radial-chart"},MixedChart:{component:mt,selector:".mixed-chart"},CommandPalette:{component:at,selector:"dialog.command-palette"},Questionnaire:{component:lt,selector:"form.questionnaire"},Datepicker:{component:vt,selector:".datepicker, .date-picker"},LineChart:{component:S,selector:".line-chart"},Menu:{component:F,selector:".menu-trigger"},MessageScroller:{component:gt,selector:".message-scroller"},Lightbox:{component:_t,selector:".lightboxed"},ScrollSpy:{component:Et,selector:".scrollspy"},FormSelect:{component:P,selector:"select"},NavigationRail:{component:bt,selector:".navigation-rail"},Tabs:{component:yt,selector:".tabs"},Timepicker:{component:Lt,selector:".timepicker, .time-picker"},Tooltip:{component:Tt,selector:".tooltipped"},FloatingActionButton:{component:st,selector:".fab-menu"}};function ve(d=document.body,n){for(let t of Object.keys(fe)){let{component:e,selector:i,filter:s}=fe[t],o=d.querySelectorAll(`:is(${i}):not(.no-autoinit)`);s?o.forEach(r=>{s(r)&&e.init(r,n?.[t]??{})}):e.init(o,n?.[t]??{})}}var Si="0.14.1";et.Init();U.Init();X.Init();z.Init();K.Init();Q.Init();J.Init();tt.Init();return Ae(Ai);})();
|
|
62
62
|
//# sourceMappingURL=expressive.min.js.map
|