@nanoporetech-digital/components 8.0.0-alpha.10 → 8.0.0-alpha.11
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/dist/cjs/{algolia-data-CSm7qrG0.js → algolia-data-C57jw89c.js} +1 -1
- package/dist/cjs/{component-store-Bjf_XOwd.js → component-store-D4ZpyJGu.js} +1 -1
- package/dist/cjs/{dom-DM4lO0bS.js → dom-DrCOFZHp.js} +1 -1
- package/dist/cjs/{fade-DGHn7mml.js → fade-C1bcLlQH.js} +3 -3
- package/dist/cjs/{form-control-BGk1kbyE.js → form-control-ed3BuLGX.js} +1 -1
- package/dist/cjs/{fullscreen-Dta_4HIi.js → fullscreen-CEgvGOfe.js} +3 -3
- package/dist/cjs/{index-DMCNW34o.js → index-BtfGVqVr.js} +1 -1
- package/dist/cjs/{index-trCnMfo7.js → index-lEfdugE-.js} +29 -11
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{lazyload-C-7hsy_w.js → lazyload-DHYuvWUl.js} +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{modal-Ca7dG1up.js → modal-CZ38TYy8.js} +1 -1
- package/dist/cjs/nano-accordion.cjs.entry.js +3 -3
- package/dist/cjs/nano-alert.cjs.entry.js +8 -8
- package/dist/cjs/nano-algolia-filter.cjs.entry.js +4 -4
- package/dist/cjs/nano-algolia-pagination.cjs.entry.js +2 -2
- package/dist/cjs/nano-algolia-results.cjs.entry.js +3 -3
- package/dist/cjs/nano-algolia.cjs.entry.js +5 -5
- package/dist/cjs/nano-animation.cjs.entry.js +2 -2
- package/dist/cjs/nano-avatar_5.cjs.entry.js +10 -10
- package/dist/cjs/nano-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/nano-card-carousel.cjs.entry.js +3 -3
- package/dist/cjs/nano-card.cjs.entry.js +1 -1
- package/dist/cjs/nano-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/nano-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/nano-collapsible-comparison.cjs.entry.js +2 -2
- package/dist/cjs/nano-components.cjs.js +2 -2
- package/dist/cjs/nano-content-links.cjs.entry.js +1 -1
- package/dist/cjs/nano-cta.cjs.entry.js +1 -1
- package/dist/cjs/{nano-data-table-zUnFb2XO.js → nano-data-table-BygClX0L.js} +5 -5
- package/dist/cjs/nano-data-table.cjs.entry.js +6 -6
- package/dist/cjs/nano-datalist_3.cjs.entry.js +3 -3
- package/dist/cjs/nano-date-input.cjs.entry.js +2 -2
- package/dist/cjs/nano-date-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/nano-details.cjs.entry.js +4 -4
- package/dist/cjs/nano-dialog.cjs.entry.js +9 -9
- package/dist/cjs/nano-dropdown_2.cjs.entry.js +5 -5
- package/dist/cjs/nano-feature-box.cjs.entry.js +1 -1
- package/dist/cjs/nano-field-validator.cjs.entry.js +3 -3
- package/dist/cjs/nano-file-upload.cjs.entry.js +2 -2
- package/dist/cjs/nano-footer.cjs.entry.js +1 -1
- package/dist/cjs/nano-global-nav.cjs.entry.js +2 -2
- package/dist/cjs/nano-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/nano-grid_2.cjs.entry.js +2 -2
- package/dist/cjs/nano-hero.cjs.entry.js +2 -2
- package/dist/cjs/nano-icon-item.cjs.entry.js +1 -1
- package/dist/cjs/nano-icon_3.cjs.entry.js +2 -2
- package/dist/cjs/nano-in-page-nav.cjs.entry.js +3 -3
- package/dist/cjs/nano-intersection-observe.cjs.entry.js +4 -4
- package/dist/cjs/nano-masked-overflow.cjs.entry.js +4 -4
- package/dist/cjs/nano-menu-drawer.cjs.entry.js +4 -4
- package/dist/cjs/nano-more-less.cjs.entry.js +2 -2
- package/dist/cjs/nano-nav-item.cjs.entry.js +5 -5
- package/dist/cjs/nano-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/nano-range.cjs.entry.js +2 -2
- package/dist/cjs/nano-rating.cjs.entry.js +2 -2
- package/dist/cjs/nano-resize-observe.cjs.entry.js +2 -2
- package/dist/cjs/nano-slide.cjs.entry.js +2 -2
- package/dist/cjs/{nano-slides-B7FiIqgq.js → nano-slides-CXU8XyXL.js} +6 -6
- package/dist/cjs/nano-slides.cjs.entry.js +3 -3
- package/dist/cjs/nano-sortable.cjs.entry.js +2 -2
- package/dist/cjs/nano-spinner.cjs.entry.js +1 -1
- package/dist/cjs/nano-split-pane.cjs.entry.js +2 -2
- package/dist/cjs/nano-sticker.cjs.entry.js +4 -4
- package/dist/cjs/nano-tab-content.cjs.entry.js +2 -2
- package/dist/cjs/nano-tab-group.cjs.entry.js +4 -4
- package/dist/cjs/nano-tab.cjs.entry.js +2 -2
- package/dist/cjs/nano-table.cjs.entry.js +2 -2
- package/dist/cjs/{page-dots-DsiFDlfV.js → page-dots-DnxKCAbO.js} +3 -3
- package/dist/cjs/{renderer-W7BRtd3i.js → renderer-Cp5bbbnx.js} +1 -1
- package/dist/cjs/{scroll-33Y1FRj4.js → scroll-oYroBCcY.js} +1 -1
- package/dist/cjs/{slot-CppKo1Tn.js → slot-DamVLdw5.js} +1 -1
- package/dist/cjs/{tabbable-CQ4-mXv0.js → tabbable-5kSrTVb2.js} +1 -1
- package/dist/cjs/{table.worker-Dto6wn52.js → table.worker-Dj-G_N11.js} +6 -6
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/alert/alert.css +1 -0
- package/dist/collection/components/card-carousel/card-carousel.css +1 -0
- package/dist/collection/components/details/details.css +2 -0
- package/dist/collection/components/dialog/dialog.css +1 -0
- package/dist/collection/components/drawer/drawer.css +1 -0
- package/dist/collection/components/dropdown/dropdown.js +1 -1
- package/dist/collection/components/field-validator/field-validator.js +1 -1
- package/dist/collection/components/sortable/sortable.js +5 -5
- package/dist/components/details.js +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/nano-alert.js +1 -1
- package/dist/components/nano-card-carousel.js +1 -1
- package/dist/components/nano-dialog.js +1 -1
- package/dist/esm/{algolia-data-BWVUf8dc.js → algolia-data-CHDAQ-na.js} +1 -1
- package/dist/esm/{component-store-6lIsMtwd.js → component-store-BA4haUxz.js} +1 -1
- package/dist/esm/{dom-C8mB0MAq.js → dom-DpX4e3pw.js} +1 -1
- package/dist/esm/{fade-C_4Qu5OX.js → fade-Dt3mCRd5.js} +3 -3
- package/dist/esm/{form-control-COOIq-Al.js → form-control-BQDNikCR.js} +1 -1
- package/dist/esm/{fullscreen-jLcYyDdS.js → fullscreen-CiMUnO6C.js} +3 -3
- package/dist/esm/{index-q0XK-YfO.js → index-CDb2_YWF.js} +29 -11
- package/dist/esm/{index-wpeqhSWn.js → index-Cb6_W06a.js} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/{lazyload-D8CHTgro.js → lazyload-DBW-FOzX.js} +3 -3
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{modal-DmA7xt58.js → modal-DnQPxb_Q.js} +1 -1
- package/dist/esm/nano-accordion.entry.js +3 -3
- package/dist/esm/nano-alert.entry.js +8 -8
- package/dist/esm/nano-algolia-filter.entry.js +4 -4
- package/dist/esm/nano-algolia-pagination.entry.js +2 -2
- package/dist/esm/nano-algolia-results.entry.js +3 -3
- package/dist/esm/nano-algolia.entry.js +5 -5
- package/dist/esm/nano-animation.entry.js +2 -2
- package/dist/esm/nano-avatar_5.entry.js +10 -10
- package/dist/esm/nano-breadcrumb.entry.js +1 -1
- package/dist/esm/nano-card-carousel.entry.js +3 -3
- package/dist/esm/nano-card.entry.js +1 -1
- package/dist/esm/nano-checkbox-group.entry.js +2 -2
- package/dist/esm/nano-checkbox.entry.js +2 -2
- package/dist/esm/nano-collapsible-comparison.entry.js +2 -2
- package/dist/esm/nano-components.js +3 -3
- package/dist/esm/nano-content-links.entry.js +1 -1
- package/dist/esm/nano-cta.entry.js +1 -1
- package/dist/esm/{nano-data-table-CC6zn15I.js → nano-data-table-bZhulcwy.js} +5 -5
- package/dist/esm/nano-data-table.entry.js +6 -6
- package/dist/esm/nano-datalist_3.entry.js +3 -3
- package/dist/esm/nano-date-input.entry.js +2 -2
- package/dist/esm/nano-date-picker_2.entry.js +4 -4
- package/dist/esm/nano-details.entry.js +4 -4
- package/dist/esm/nano-dialog.entry.js +9 -9
- package/dist/esm/nano-dropdown_2.entry.js +5 -5
- package/dist/esm/nano-feature-box.entry.js +1 -1
- package/dist/esm/nano-field-validator.entry.js +3 -3
- package/dist/esm/nano-file-upload.entry.js +2 -2
- package/dist/esm/nano-footer.entry.js +1 -1
- package/dist/esm/nano-global-nav.entry.js +2 -2
- package/dist/esm/nano-grid-item.entry.js +1 -1
- package/dist/esm/nano-grid_2.entry.js +2 -2
- package/dist/esm/nano-hero.entry.js +2 -2
- package/dist/esm/nano-icon-item.entry.js +1 -1
- package/dist/esm/nano-icon_3.entry.js +2 -2
- package/dist/esm/nano-in-page-nav.entry.js +3 -3
- package/dist/esm/nano-intersection-observe.entry.js +4 -4
- package/dist/esm/nano-masked-overflow.entry.js +4 -4
- package/dist/esm/nano-menu-drawer.entry.js +4 -4
- package/dist/esm/nano-more-less.entry.js +2 -2
- package/dist/esm/nano-nav-item.entry.js +5 -5
- package/dist/esm/nano-progress-bar.entry.js +1 -1
- package/dist/esm/nano-range.entry.js +2 -2
- package/dist/esm/nano-rating.entry.js +2 -2
- package/dist/esm/nano-resize-observe.entry.js +2 -2
- package/dist/esm/nano-slide.entry.js +2 -2
- package/dist/esm/{nano-slides-DQzB1F7A.js → nano-slides-BH9wpDRh.js} +6 -6
- package/dist/esm/nano-slides.entry.js +3 -3
- package/dist/esm/nano-sortable.entry.js +2 -2
- package/dist/esm/nano-spinner.entry.js +1 -1
- package/dist/esm/nano-split-pane.entry.js +2 -2
- package/dist/esm/nano-sticker.entry.js +4 -4
- package/dist/esm/nano-tab-content.entry.js +2 -2
- package/dist/esm/nano-tab-group.entry.js +4 -4
- package/dist/esm/nano-tab.entry.js +2 -2
- package/dist/esm/nano-table.entry.js +2 -2
- package/dist/esm/{page-dots-o5M__fM6.js → page-dots-B5aFjE5U.js} +3 -3
- package/dist/esm/{renderer-BjGZGWn8.js → renderer-CGoibSOJ.js} +1 -1
- package/dist/esm/{scroll-N_WMYKm7.js → scroll-DMVLi4kX.js} +1 -1
- package/dist/esm/{slot-CUINJXSo.js → slot-xEoA61Tz.js} +1 -1
- package/dist/esm/{tabbable-DqhO0wy7.js → tabbable-DQFS44_5.js} +1 -1
- package/dist/esm/{table.worker-DxcGLZVJ.js → table.worker-Bt49ORjw.js} +6 -6
- package/dist/nano-components/{algolia-data-BWVUf8dc.js → algolia-data-CHDAQ-na.js} +1 -1
- package/dist/nano-components/{component-store-6lIsMtwd.js → component-store-BA4haUxz.js} +1 -1
- package/dist/nano-components/{dom-C8mB0MAq.js → dom-DpX4e3pw.js} +1 -1
- package/dist/nano-components/{fade-C_4Qu5OX.js → fade-Dt3mCRd5.js} +1 -1
- package/dist/nano-components/{form-control-COOIq-Al.js → form-control-BQDNikCR.js} +1 -1
- package/dist/nano-components/{fullscreen-jLcYyDdS.js → fullscreen-CiMUnO6C.js} +1 -1
- package/dist/nano-components/index-CDb2_YWF.js +5 -0
- package/dist/nano-components/{index-wpeqhSWn.js → index-Cb6_W06a.js} +1 -1
- package/dist/nano-components/index.esm.js +1 -1
- package/dist/nano-components/{lazyload-D8CHTgro.js → lazyload-DBW-FOzX.js} +1 -1
- package/dist/nano-components/{modal-DmA7xt58.js → modal-DnQPxb_Q.js} +1 -1
- package/dist/nano-components/nano-accordion.entry.js +1 -1
- package/dist/nano-components/nano-alert.entry.js +1 -1
- package/dist/nano-components/nano-algolia-filter.entry.js +1 -1
- package/dist/nano-components/nano-algolia-pagination.entry.js +1 -1
- package/dist/nano-components/nano-algolia-results.entry.js +1 -1
- package/dist/nano-components/nano-algolia.entry.js +1 -1
- package/dist/nano-components/nano-animation.entry.js +1 -1
- package/dist/nano-components/nano-avatar_5.entry.js +1 -1
- package/dist/nano-components/nano-breadcrumb.entry.js +1 -1
- package/dist/nano-components/nano-card-carousel.entry.js +1 -1
- package/dist/nano-components/nano-card.entry.js +1 -1
- package/dist/nano-components/nano-checkbox-group.entry.js +1 -1
- package/dist/nano-components/nano-checkbox.entry.js +1 -1
- package/dist/nano-components/nano-collapsible-comparison.entry.js +1 -1
- package/dist/nano-components/nano-components.css +7 -0
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-content-links.entry.js +1 -1
- package/dist/nano-components/nano-cta.entry.js +1 -1
- package/dist/nano-components/{nano-data-table-CC6zn15I.js → nano-data-table-bZhulcwy.js} +1 -1
- package/dist/nano-components/nano-data-table.entry.js +1 -1
- package/dist/nano-components/nano-datalist_3.entry.js +1 -1
- package/dist/nano-components/nano-date-input.entry.js +1 -1
- package/dist/nano-components/nano-date-picker_2.entry.js +1 -1
- package/dist/nano-components/nano-details.entry.js +1 -1
- package/dist/nano-components/nano-dialog.entry.js +1 -1
- package/dist/nano-components/nano-dropdown_2.entry.js +1 -1
- package/dist/nano-components/nano-feature-box.entry.js +1 -1
- package/dist/nano-components/nano-field-validator.entry.js +1 -1
- package/dist/nano-components/nano-file-upload.entry.js +1 -1
- package/dist/nano-components/nano-footer.entry.js +1 -1
- package/dist/nano-components/nano-global-nav.entry.js +1 -1
- package/dist/nano-components/nano-grid-item.entry.js +1 -1
- package/dist/nano-components/nano-grid_2.entry.js +1 -1
- package/dist/nano-components/nano-hero.entry.js +1 -1
- package/dist/nano-components/nano-icon-item.entry.js +1 -1
- package/dist/nano-components/nano-icon_3.entry.js +1 -1
- package/dist/nano-components/nano-in-page-nav.entry.js +1 -1
- package/dist/nano-components/nano-intersection-observe.entry.js +1 -1
- package/dist/nano-components/nano-masked-overflow.entry.js +1 -1
- package/dist/nano-components/nano-menu-drawer.entry.js +1 -1
- package/dist/nano-components/nano-more-less.entry.js +1 -1
- package/dist/nano-components/nano-nav-item.entry.js +1 -1
- package/dist/nano-components/nano-progress-bar.entry.js +1 -1
- package/dist/nano-components/nano-range.entry.js +1 -1
- package/dist/nano-components/nano-rating.entry.js +1 -1
- package/dist/nano-components/nano-resize-observe.entry.js +1 -1
- package/dist/nano-components/nano-slide.entry.js +1 -1
- package/dist/nano-components/{nano-slides-DQzB1F7A.js → nano-slides-BH9wpDRh.js} +4 -4
- package/dist/nano-components/nano-slides.entry.js +1 -1
- package/dist/nano-components/nano-sortable.entry.js +1 -1
- package/dist/nano-components/nano-spinner.entry.js +1 -1
- package/dist/nano-components/nano-split-pane.entry.js +1 -1
- package/dist/nano-components/nano-sticker.entry.js +1 -1
- package/dist/nano-components/nano-tab-content.entry.js +1 -1
- package/dist/nano-components/nano-tab-group.entry.js +1 -1
- package/dist/nano-components/nano-tab.entry.js +1 -1
- package/dist/nano-components/nano-table.entry.js +1 -1
- package/dist/nano-components/{page-dots-o5M__fM6.js → page-dots-B5aFjE5U.js} +1 -1
- package/dist/nano-components/{renderer-BjGZGWn8.js → renderer-CGoibSOJ.js} +1 -1
- package/dist/nano-components/{scroll-N_WMYKm7.js → scroll-DMVLi4kX.js} +1 -1
- package/dist/nano-components/{slot-CUINJXSo.js → slot-xEoA61Tz.js} +1 -1
- package/dist/nano-components/{tabbable-DqhO0wy7.js → tabbable-DQFS44_5.js} +1 -1
- package/dist/nano-components/table.worker-Bt49ORjw.js +4 -0
- package/dist/style/components.css +1 -1
- package/dist/style/components.css.map +1 -1
- package/dist/style/core.css +1 -1
- package/dist/style/core.css.map +1 -1
- package/dist/style/nano.css +1 -1
- package/dist/style/nano.css.map +1 -1
- package/docs-json.json +14 -14
- package/hydrate/index.js +29 -15
- package/hydrate/index.mjs +29 -15
- package/package.json +3 -3
- package/dist/nano-components/index-q0XK-YfO.js +0 -5
- package/dist/nano-components/table.worker-DxcGLZVJ.js +0 -4
- package/dist/types/utils/testing/index.d.ts +0 -50
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import{r as n,c as i,g as a,a as t}from"./index-
|
4
|
+
import{r as n,c as i,g as a,a as t}from"./index-CDb2_YWF.js";import{h as s}from"./renderer-CGoibSOJ.js";import{a as o}from"./math-BEqsTfVK.js";const r=class{constructor(a){n(this,a),this.nanoChange=i(this,"nanoChange",7),this.nanoBlur=i(this,"nanoBlur",7),this.nanoFocus=i(this,"nanoFocus",7)}rating;isRtl;indicator;get host(){return a(this)}hoverValue=0;isHovering=!1;value=0;max=5;precision=1;readonly=!1;disabled=!1;name="";required=!1;hideLabel=!0;_label="";get label(){return this.required&&!this._label.endsWith("*")?this._label+" *":this._label}set label(n){this._label=n}symbolName="solid/star-sharp";symbol=()=>'<nano-icon name="'+this.symbolName+'"></nano-icon>';handleValueChange(){this.nanoChange.emit()}handleSymbolChange(){this.symbol||(this.symbol=()=>'<nano-icon name="'+this.symbolName+'"></nano-icon>')}nanoChange;nanoBlur;nanoFocus;async setFocus(){this.rating.focus()}async removeFocus(){this.rating.blur()}getValueFromMousePosition(n){const i=this.rating.getBoundingClientRect().left,a=this.rating.getBoundingClientRect().width;let t;return t=this.roundToPrecision((n.clientX-i)/a*this.max,this.precision),this.isRtl&&(t=this.max+this.precision-t),o(t,0,this.max)}roundToPrecision(n,i=.5){const a=1/i;return Math.ceil(n*a)/a}handleClick=n=>{if(this.disabled||this.readonly)return;const i=this.getValueFromMousePosition(n);this.value=i===this.value?0:i,this.isHovering=!1};handleKeyDown=n=>{this.disabled||this.readonly||("ArrowLeft"===n.key&&(this.value=this.roundToPrecision(Math.max(0,this.value-(n.shiftKey?1:this.precision))),n.preventDefault()),"ArrowRight"===n.key&&(this.value=this.roundToPrecision(Math.min(this.max,this.value+(n.shiftKey?1:this.precision))),n.preventDefault()),"Home"===n.key&&(this.value=0,n.preventDefault()),"End"===n.key&&(this.value=this.max,n.preventDefault()))};handleMouseEnter=()=>{this.isHovering=!0};handleMouseLeave=()=>{this.isHovering=!1};handleFocus=()=>{this.nanoFocus.emit()};handleBlur=()=>{this.nanoBlur.emit()};handleMouseMove=n=>{this.hoverValue=this.getValueFromMousePosition(n)};clip(n){if(!this.rating)return;const i=this.rating.getBoundingClientRect().width;return this.isRtl?`rect(0, ${i}px, 2em, ${i-i/100*(n/this.max*100)}px)`:`rect(0, ${i/100*(n/this.max*100)}px, 2em, 0)`}componentDidLoad(){setTimeout((()=>this.indicator.style.clip=this.clip(this.value)),20)}connectedCallback(){this.isRtl="rtl"===this.host.dir||"rtl"===this.host.ownerDocument.dir}render(){this.isRtl="rtl"===this.host.dir||"rtl"===this.host.ownerDocument.dir;const n=Array.from(Array(this.max).keys());let i=0;return i=this.disabled||this.readonly?this.value:this.isHovering?this.hoverValue:this.value,s(t,{key:"b97fc830f206f0eb0263197dc2b99d6b8235ad50",class:"nano-rating"},s("label",{key:"20b2c67efd69927a1433248bdaf74f0726356705",class:"rating-label"+(this.hideLabel?" visually-hidden":""),part:"label",htmlFor:this.name},s("slot",{key:"d498daf06fd036f76310c59e74725058978e0cf3",name:"label"},this.label)),s("input",{key:"f06defdfc2d6bccfd9aef0fb9d668ce08bfe9c51",class:"range-input visually-hidden",name:this.name,id:this.name,disabled:this.disabled||this.readonly,required:this.required,value:this.value,onFocus:()=>{this.setFocus()}}),s("div",{key:"e6e135c5fba41911f07838789eefc2158147839b",class:"rating-wrap"},s("div",{key:"0d1198d9a1a7793a948b652d9c89807f288142ac",dir:this.isRtl?"rtl":null,ref:n=>this.rating=n,part:"base",class:{rating:!0,"rating--readonly":this.readonly,"rating--disabled":this.disabled},"aria-disabled":this.disabled?"true":"false","aria-readonly":this.readonly?"true":"false","aria-valuenow":this.value,"aria-valuemin":0,"aria-valuemax":this.max,tabIndex:this.disabled?-1:0,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onMouseMove:this.handleMouseMove,onFocus:this.handleFocus,onBlur:this.handleBlur},s("span",{key:"55c7b360b3406483d9b8e3670d36ad8fdcb4c3ed",class:"rating__symbols rating__symbols--inactive"},n.map((n=>s("span",{class:{rating__symbol:!0,"rating__symbol--hover":this.isHovering&&Math.ceil(i)===n+1},onMouseEnter:this.handleMouseEnter,innerHTML:this.symbol(n+1)})))),s("span",{key:"139506c429111e93040522616545fd96946cd141",ref:n=>this.indicator=n,class:"rating__symbols rating__symbols--indicator",style:{clip:this.clip(i)}},n.map((n=>s("span",{class:{rating__symbol:!0,"rating__symbol--hover":this.isHovering&&Math.ceil(i)===n+1},innerHTML:this.symbol(n+1)})))))))}static get watchers(){return{value:["handleValueChange"],symbolName:["handleSymbolChange"]}}};r.style=".sc-nano-rating-h,*.sc-nano-rating,*.sc-nano-rating::before,*.sc-nano-rating::after{box-sizing:border-box}[hidden].sc-nano-rating{display:none !important}@media (prefers-reduced-motion: reduce){.sc-nano-rating-h,*.sc-nano-rating,*.sc-nano-rating::before,*.sc-nano-rating::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}.sc-nano-rating-h,*.sc-nano-rating,*.sc-nano-rating::before,*.sc-nano-rating::after{box-sizing:border-box}[hidden].sc-nano-rating{display:none !important}@media (prefers-reduced-motion: reduce){.sc-nano-rating-h,*.sc-nano-rating,*.sc-nano-rating::before,*.sc-nano-rating::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}.sc-nano-rating-h{--symbol-color:var(--nano-color-neutral-400);--symbol-color-active:var(--nano-color-primary-1200);--symbol-spacing:0.25rem;--symbol-size:1.3125rem;display:inline-block}.rating-wrap.sc-nano-rating{position:relative;margin-block:0;margin-inline:calc(var(--symbol-spacing) * -1)}.rating-label.sc-nano-rating{display:block;inline-size:100%;overflow:clip;white-space:nowrap;text-overflow:ellipsis;color:var(--nano-color-base-1000);font-size:var(--nano-font-size-xs);padding-block-end:var(--nano-spacing-sm);line-height:1;display:flex;align-items:center}.visually-hidden.sc-nano-rating{clip-path:inset(50%);block-size:1px;overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}.rating.sc-nano-rating{position:relative;vertical-align:middle;inline-size:100%}.rating.sc-nano-rating:focus{outline:none}.rating.sc-nano-rating:focus-visible:focus{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}.rating__symbols.sc-nano-rating{display:flex;align-items:center;position:relative;font-size:var(--symbol-size);color:var(--symbol-color);white-space:nowrap;cursor:pointer;line-height:0;justify-content:space-between}.rating__symbols--inactive.sc-nano-rating .rating__symbol.sc-nano-rating>.sc-nano-rating:not(.nano-icon){background-color:currentcolor !important}.rating__symbols.sc-nano-rating>*.sc-nano-rating{margin:var(--symbol-spacing)}.rating__symbols--indicator.sc-nano-rating{position:absolute;inset-block-start:0;inset-inline-start:0;color:var(--symbol-color-active);pointer-events:none;inline-size:100%}.rating__symbol.sc-nano-rating{transition:0.2s transform;text-align:center}.rating__symbol--hover.sc-nano-rating{transform:scale(1.2)}.rating--disabled.sc-nano-rating .rating__symbols.sc-nano-rating,.rating--readonly.sc-nano-rating .rating__symbols.sc-nano-rating{cursor:default}.rating--disabled.sc-nano-rating .rating__symbol.sc-nano-rating,.rating--readonly.sc-nano-rating .rating__symbol.sc-nano-rating{transform:none !important}.rating--disabled.sc-nano-rating{opacity:0.5}.rating--disabled.sc-nano-rating .rating__symbols.sc-nano-rating{cursor:not-allowed}";export{r as nano_rating}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import{r as t,c as s,g as i,e,a as n}from"./index-
|
4
|
+
import{r as t,c as s,g as i,e,a as n}from"./index-CDb2_YWF.js";import{h}from"./renderer-CGoibSOJ.js";const a=class{constructor(i){t(this,i),this.nanoResizeStateChange=s(this,"nanoResizeStateChange",7),this.nanoResizeObserverReady=s(this,"nanoResizeObserverReady",7),this.nanoResizeContentFitChange=s(this,"nanoResizeContentFitChange",7),this.nanoResize=s(this,"nanoResize",7)}ro;appliedStates;isReady=!1;get host(){return i(this)}currentWidth;currentHeight;classNames=[];contentFitX=null;contentFitY=null;classNameChange(){this.host.className=this.classNames.join(" "),!this.isReady&&this.classNames.includes("is-ready")&&(this.isReady=!0,this.nanoResizeObserverReady.emit())}notifyContentFit;states;newStatesProp(){this.statesChanged()}nanoResizeStateChange;nanoResizeObserverReady;nanoResizeContentFitChange;nanoResize;dimensionChanged(){this.assessChanges()}statesChanged(){if(!this.states)return;const t=t=>{const s=t.split(/(\d+)/).filter((t=>t.length));return{bp:parseInt(s[0]),dir:s[1]}};this.appliedStates={h:new Map,w:new Map},this.states.split(",").map((s=>{if((s=s.trim()).includes(" ")){const[i,...e]=s.split(" "),{bp:n,dir:h}=t(i);this.appliedStates[h].set(n,{states:e,applied:!1})}else{const{bp:i,dir:e}=t(s);this.appliedStates[e].set(i,{applied:!1})}}))}assesContentFit(){if(!this.notifyContentFit)return;const t=(t=>{if("contents"!==window.getComputedStyle(t).display)return t;const s=t=>Array.from(t.children).find((t=>{if("contents"!==window.getComputedStyle(t).display)return t;s(t)}));return s(t)})(this.host.firstElementChild);if(!t)return;let s=!1;const{width:i,height:e}=this.host.getBoundingClientRect();this.notifyContentFit&&this.notifyContentFit.includes("x")&&(i<t.scrollWidth&&!1!==this.contentFitX?(s=!0,this.contentFitX=!1):i>=t.scrollWidth&&!0!==this.contentFitX&&(s=!0,this.contentFitX=!0)),this.notifyContentFit&&this.notifyContentFit.includes("y")&&(e<t.scrollHeight&&!1!==this.contentFitY?(s=!0,this.contentFitY=!1):e>=t.scrollHeight&&!0!==this.contentFitY&&(s=!0,this.contentFitY=!0)),s&&this.nanoResizeContentFitChange.emit({x:this.contentFitX,y:this.contentFitY})}assessChanges=()=>{if(!this.currentWidth&&!this.currentHeight)return;if(e((()=>this.assesContentFit())),!this.states||!this.appliedStates)return;const t={h:new Map,w:new Map};let s=!1;Object.keys(this.appliedStates).forEach((i=>{let e;e="h"===i?this.currentHeight:this.currentWidth,this.appliedStates[i].forEach(((n,h)=>{e>=h&&!1===n.applied?(n.applied=!0,t[i].set(h,n),s=!0):e<h&&!0===n.applied&&(n.applied=!1,t[i].set(h,n),s=!0)}))})),s?this.applyChanges(t):this.classNames.includes("is-ready")||(this.classNames=[...this.classNames,"is-ready"])};applyChanges(t){if(!this.states)return;let s=[...this.classNames];Object.keys(t).forEach((i=>{t[i].forEach((t=>{t.states&&t.states.map((i=>{t.applied?(s.push(i),s=s.filter((t=>t!=="not-"+i))):(s.push("not-"+i),s=s.filter((t=>t!==i)))}))}))})),this.classNames=[...new Set(["is-ready",...s])],this.nanoResizeStateChange.emit(this.toSimpleObj(t))}toSimpleObj(t){const s={};return Object.keys(t).forEach((i=>{t[i].forEach(((t,e)=>{s[e+i]=t.applied}))})),s}attachRO(){window.ResizeObserver&&(this.ro=new ResizeObserver((t=>{const{width:s,height:i}=this.host.getBoundingClientRect();this.currentWidth=Math.ceil(s),this.currentHeight=Math.ceil(i),this.nanoResize.emit(t)})),this.ro.observe(this.host))}componentWillLoad(){this.classNames=Array.from(this.host.classList),this.statesChanged(),this.applyChanges(this.appliedStates),this.currentWidth||this.currentHeight?this.assessChanges():e((()=>{const{width:t,height:s}=this.host.getBoundingClientRect();this.currentWidth=Math.ceil(t),this.currentHeight=Math.ceil(s)}))}connectedCallback(){this.ro||this.attachRO()}disconnectedCallback(){this.ro&&(this.ro.disconnect(),this.ro=void 0)}render(){return h(n,{key:"1842de6720755b876b6c398c89162c8c2275f547",class:{"nano-resize-observe":!0,"content-fit-x":this.contentFitX,"content-fit-y":this.contentFitY,"content-nofit-x":!1===this.contentFitX,"content-nofit-y":!1===this.contentFitY}},h("slot",{key:"40b58af8e25fe11c6d2448db44d516e42a7af8af"}),!!this.notifyContentFit&&(null!==this.contentFitX||null!==this.contentFitY)&&[h("slot",this.contentFitX?{name:"content-fit-x"}:{name:"content-nofit-x"}),h("slot",this.contentFitY?{name:"content-fit-y"}:{name:"content-nofit-y"})])}static get watchers(){return{classNames:["classNameChange"],states:["newStatesProp","statesChanged"],currentHeight:["dimensionChanged"],currentWidth:["dimensionChanged"]}}};a.style=":host { display: block }";export{a as nano_resize_observe}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import{r as t,c as e,a as o}from"./index-
|
4
|
+
import{r as t,c as e,a as o}from"./index-CDb2_YWF.js";import{h as i}from"./renderer-CGoibSOJ.js";const n=class{constructor(o){t(this,o),this.nanoSlideReady=e(this,"nanoSlideReady",7)}nanoSlideReady;ready=null;readyChange(t,e){void 0!==e&&!1===e&&!0===t&&this.nanoSlideReady.emit()}componentDidLoad(){"boolean"!=typeof this.ready&&setTimeout((()=>{this.nanoSlideReady.emit(),this.ready=!0}))}render(){return i(o,{key:"06310115126788d079ea5c5913d4ce6e7046c51d",class:"nano-slide"},i("slot",{key:"91259ac35d21f740a3ecb6e212c64fbe2d196577"}))}static get watchers(){return{ready:["readyChange"]}}};n.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:flex;align-items:center;justify-content:center;inline-size:100%;min-block-size:100%;font-size:18px;text-align:center;box-sizing:border-box;overflow:hidden;transition:opacity 0.2s;opacity:0;flex-direction:column}:host([ready]){opacity:1}:host(:not([ready])){flex:1 0 auto}";export{n as nano_slide}
|
@@ -1,22 +1,22 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import{r as t,c as i,g as s,e as n,d as e,a as o}from"./index-
|
4
|
+
import{r as t,c as i,g as s,e as n,d as e,a as o}from"./index-CDb2_YWF.js";import{t as h,h as c}from"./renderer-CGoibSOJ.js";function r(){}const a=r.prototype;
|
5
5
|
/*!
|
6
6
|
* getSize v2.0.3
|
7
7
|
* measure size of elements
|
8
8
|
* MIT license
|
9
9
|
*/
|
10
|
-
function l(t){const i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}a.on=function(t,i){if(!t||!i)return;const s=this._events=this._events||{},n=s[t]=s[t]||[];return-1==n.indexOf(i)&&n.push(i),this},a.once=function(t,i){if(!t||!i)return;this.on(t,i);const s=this._onceEvents=this._onceEvents||{};return(s[t]=s[t]||{})[i]=!0,this},a.off=function(t,i){const s=this._events&&this._events[t];if(!s||!s.length)return;const n=s.indexOf(i);return-1!=n&&s.splice(n,1),this},a.emitEvent=function(t,i){let s=this._events&&this._events[t];if(!s||!s.length)return;s=s.slice(0),i=i||[];const n=this._onceEvents&&this._onceEvents[t];for(let e=0;e<s.length;e++){const o=s[e];n&&n[o]&&(this.off(t,o),delete n[o]),o.apply(this,i)}return this},a.allOff=function(){delete this._events,delete this._onceEvents};const u="undefined"==typeof console?function(){}:function(t){console.error(t)},f=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],d=f.length;function p(t){const i=getComputedStyle(t);return i||u("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),i}let b,y=!1;function g(t){if(function(){if(y)return;y=!0;const t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";const i=document.body||document.documentElement;i.appendChild(t);const s=p(t);b=200==Math.round(l(s.width)),g.isBoxSizeOuter=b,i.removeChild(t)}(),"string"==typeof t&&(t=document.querySelector(t)),!t||"object"!=typeof t||!t.nodeType)return;const i=p(t);if("none"==i.display)return function(){const t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(let i=0;i<d;i++)t[f[i]]=0;return t}();const s={};s.width=t.offsetWidth,s.height=t.offsetHeight;const n=s.isBorderBox="border-box"==i.boxSizing;for(let t=0;t<d;t++){const n=f[t],e=parseFloat(i[n]);s[n]=isNaN(e)?0:e}const e=s.paddingLeft+s.paddingRight,o=s.paddingTop+s.paddingBottom,h=s.marginLeft+s.marginRight,c=s.marginTop+s.marginBottom,r=s.borderLeftWidth+s.borderRightWidth,a=s.borderTopWidth+s.borderBottomWidth,u=n&&b,m=l(i.width);!1!==m&&(s.width=m+(u?0:e+r));const v=l(i.height);return!1!==v&&(s.height=v+(u?0:o+a)),s.innerWidth=s.width-(e+r),s.innerHeight=s.height-(o+a),s.outerWidth=s.width+h,s.outerHeight=s.height+c,s}const m={extend:function(t,i){for(const s in i)t[s]=i[s];return t},docReady:function(t){const i=document.readyState;"complete"==i||"interactive"==i?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},toDashed:function(t){return t.replace(/(.)([A-Z])/g,(function(t,i,s){return i+"-"+s})).toLowerCase()},modulo:function(t,i){return(t%i+i)%i}},v=Array.prototype.slice;m.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?v.call(t):[t]},m.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if((t=t.parentElement).matches(i))return t},m.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},m.handleEvent=function(t){const i="on"+t.type;this[i]&&this[i](t)},m.filterFindElements=function(t,i){t=m.makeArray(t);const s=[];return t.forEach((function(t){if(!(t instanceof HTMLElement))return;if(!i)return void s.push(t);t.matches(i)&&s.push(t);const n=t.querySelectorAll(i);for(let t=0;t<n.length;t++)s.push(n[t])})),s},m.debounceMethod=function(t,i,s){s=s||100;const n=t.prototype[i],e=i+"Timeout";t.prototype[i]=function(...t){clearTimeout(this[e]);const i=this;this[e]=setTimeout((function(){n.apply(i,t),delete i[e]}),s)}};const k=window.console;function w(t,i){this.element=t,this.parent=i,this.create()}m.htmlInit=function(t,i){m.docReady((function(){const s=m.toDashed(i),n="data-"+s,e=document.querySelectorAll("["+n+"]"),o=document.querySelectorAll(".js-"+s),h=m.makeArray(e).concat(m.makeArray(o)),c=n+"-options";h.forEach((function(i){const s=i.getAttribute(n)||i.getAttribute(c);let e;try{e=s&&JSON.parse(s)}catch(t){return void(k&&k.error("Error parsing "+n+" on "+i.className+": "+t))}new t(i,e)}))}))};const x=w.prototype;function S(t){this.parent=t,this.isOriginLeft="left"==t.originSide,this.cells=[],this.outerWidth=0,this.height=0}x.create=function(){this.element.style.position="absolute",this.element.setAttribute("aria-hidden","true"),this.x=0,this.shift=0,Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.setAttribute("tabindex","-1")}))},x.destroy=function(){this.unselect(),this.element.style.position="",this.element.style[this.parent.originSide]=""},x.getSize=function(){this.size=g(this.element)},x.setPosition=function(t){this.x=t,this.updateTarget(),this.renderPosition(t)},x.updateTarget=x.setDefaultTarget=function(){this.target=this.x+this.size["left"==this.parent.originSide?"marginLeft":"marginRight"]+this.size.width*this.parent.cellAlign},x.renderPosition=function(t){this.element.style[this.parent.originSide]=this.parent.getPositionValue(t)},x.select=function(){this.element.classList.add("is-selected"),this.element.removeAttribute("aria-hidden"),Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.removeAttribute("tabindex")}))},x.unselect=function(){this.element.classList.remove("is-selected"),this.element.setAttribute("aria-hidden","true"),Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.setAttribute("tabindex","-1")}))},x.wrapShift=function(t){this.shift=t,this.renderPosition(this.x+this.parent.slideableWidth*t)},x.remove=function(){this.element.parentNode.removeChild(this.element)};const z=S.prototype;z.addCell=function(t){this.cells.push(t),this.outerWidth+=t.size.outerWidth,this.height=Math.max(t.size.outerHeight,this.height),1==this.cells.length&&(this.x=t.x,this.firstMargin=t.size[this.isOriginLeft?"marginLeft":"marginRight"])},z.updateTarget=function(){const t=this.isOriginLeft?"marginRight":"marginLeft",i=this.getLastCell();this.target=this.x+this.firstMargin+(this.outerWidth-(this.firstMargin+(i?i.size[t]:0)))*this.parent.cellAlign},z.getLastCell=function(){return this.cells[this.cells.length-1]},z.select=function(){this.cells.forEach((function(t){t.select()}))},z.unselect=function(){this.cells.forEach((function(t){t.unselect()}))},z.getCellElements=function(){return this.cells.map((function(t){return t.element}))};const C={startAnimation:function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},animate:function(){this.applyDragForce(),this.applySelectedAttraction();const t=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(t),this.isAnimating){const t=this;requestAnimationFrame((function(){t.animate()}))}},positionSlider:function(){let t=this.x;this.options.wrapAround&&this.cells.length>1&&(t=m.modulo(t,this.slideableWidth),t-=this.slideableWidth,this.shiftWrapCells(t)),this.setTranslateX(t,this.isAnimating),this.dispatchScrollEvent()},setTranslateX:function(t){t+=this.cursorPosition;const i=this.getPositionValue(t=this.options.rightToLeft?-t:t);this.slider.style.transform="translate3d("+i+",0,0)"},dispatchScrollEvent:function(){const t=this.slides[0];if(!t)return;const i=-this.x-t.target;this.dispatchEvent("scroll",null,[i/this.slidesWidth,i])},positionSliderAtSelected:function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},getPositionValue:function(t){return this.options.percentPosition?.01*Math.round(t/this.size.innerWidth*1e4)+"%":Math.round(t)+"px"},settle:function(t){this.isPointerDown||Math.round(100*this.x)!=Math.round(100*t)||this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},shiftWrapCells:function(t){this._shiftCells(this.beforeShiftCells,this.cursorPosition+t,-1),this._shiftCells(this.afterShiftCells,this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition),1)},_shiftCells:function(t,i,s){for(let n=0;n<t.length;n++){const e=t[n];e.wrapShift(i>0?s:0),i-=e.size.outerWidth}},_unshiftCells:function(t){if(t&&t.length)for(let i=0;i<t.length;i++)t[i].wrapShift(0)},integratePhysics:function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},applyForce:function(t){this.velocity+=t},getFrictionFactor:function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},getRestingPosition:function(){return this.x+this.velocity/(1-this.getFrictionFactor())},applyDragForce:function(){this.isDraggable&&this.isPointerDown&&this.applyForce(this.dragX-this.x-this.velocity)},applySelectedAttraction:function(){this.isDraggable&&this.isPointerDown||this.isFreeScrolling||!this.slides.length||this.applyForce((-1*this.selectedSlide.target-this.x)*this.options.selectedAttraction)}},M=window.getComputedStyle,T=window.console;function A(t,i){for(t=m.makeArray(t);t.length;)i.appendChild(t.shift())}let E=0;const P={};function D(t,i){const s=m.getQueryElement(t);if(s){if(this.element=s,this.element.flickityGUID){const t=P[this.element.flickityGUID];if(!P[this.element.flickityGUID])return;return t.option(i),t}this.options=m.extend({},this.constructor.defaults),this.option(i),this._create()}else T&&T.error("Bad element for Flickity: "+(s||t))}D.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},D.createMethods=[];const F=D.prototype;m.extend(F,r.prototype),F._create=function(){const t=this.guid=++E;this.element.flickityGUID=t,P[t]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this.viewport.part.add("slide-viewport"),this._createSlider(),(this.options.resize||this.options.watchCSS)&&window.addEventListener("resize",this);for(const t in this.options.on)this.on(t,this.options.on[t]);D.createMethods.forEach((function(t){this[t]()}),this),this.options.watchCSS?this.watchCSS():this.activate()},F.option=function(t){m.extend(this.options,t)},F.activate=function(){this.isActive||(this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize(),A(this.element.children,this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate"),this.selectInitialIndex(),this.isInitActivated=!0,this.dispatchEvent("ready"))},F._createSlider=function(){const t=document.createElement("div");t.className="flickity-slider",t.style[this.originSide]=0,this.slider=t},F._filterFindCellElements=function(t){return m.filterFindElements(t,this.options.cellSelector)},F.reloadCells=function(){let t=this.slider.children;if(this.slider.getRootNode().host){t=[];for(const i of this.slider.getRootNode().host.children)"assignedElements"in i?t=[...t,...i.assignedElements()]:t.push(i)}this.cells=this._makeCells(t),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},F._makeCells=function(t){return this._filterFindCellElements(t).map((function(t){return new w(t,this)}),this)},F.getLastCell=function(){return this.cells[this.cells.length-1]},F.getLastSlide=function(){return this.slides[this.slides.length-1]},F.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},F._positionCells=function(t){this.maxCellHeight=(t=t||0)&&this.maxCellHeight||0;let i=0;if(t>0){const s=this.cells[t-1];i=s.x+s.size.outerWidth}const s=this.cells.length;for(let n=t;n<s;n++){const t=this.cells[n];t.setPosition(i),i+=t.size.outerWidth,this.maxCellHeight=Math.max(t.size.outerHeight,this.maxCellHeight)}this.slideableWidth=i,this.updateSlides(),this._containSlides(),this.slidesWidth=s?this.getLastSlide().target-this.slides[0].target:0},F._sizeCells=function(t){t.forEach((function(t){t.getSize()}))},F.updateSlides=function(){if(this.slides=[],!this.cells.length)return;let t=new S(this);this.slides.push(t);const i="left"==this.originSide?"marginRight":"marginLeft",s=this._getCanCellFit();this.cells.forEach((function(n,e){t.cells.length?(s.call(this,e,t.outerWidth-t.firstMargin+(n.size.outerWidth-n.size[i]))||(t.updateTarget(),t=new S(this),this.slides.push(t)),t.addCell(n)):t.addCell(n)}),this),t.updateTarget(),this.updateSelectedSlide()},F._getCanCellFit=function(){const t=this.options.groupCells;if(!t)return function(){return!1};if("number"==typeof t){const i=parseInt(t,10);return function(t){return t%i!=0}}const i="string"==typeof t&&t.match(/^(\d+)%$/),s=i?parseInt(i[1],10)/100:1;return function(t,i){return i<=(this.size.innerWidth+1)*s}},F._init=F.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},F.getSize=function(){this.size=g(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};const L={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};function R(){}F.setCellAlign=function(){const t=L[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign},F.setGallerySize=function(){this.options.setGallerySize&&(this.viewport.style.height=(this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight)+"px")},F._getWrapShiftCells=function(){if(!this.options.wrapAround)return;this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);let t=this.cursorPosition;this.beforeShiftCells=this._getGapCells(t,this.cells.length-1,-1),t=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(t,0,1)},F._getGapCells=function(t,i,s){const n=[];for(;t>0;){const e=this.cells[i];if(!e)break;n.push(e),i+=s,t-=e.size.outerWidth}return n},F._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length)return;const t=this.options.rightToLeft,i=t?"marginRight":"marginLeft",s=t?"marginLeft":"marginRight",n=this.slideableWidth-this.getLastCell().size[s],e=n<this.size.innerWidth,o=this.cursorPosition+this.cells[0].size[i],h=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach((function(t){e?t.target=n*this.cellAlign:(t.target=Math.max(t.target,o),t.target=Math.min(t.target,h))}),this)},F.dispatchEvent=function(t,i,s){const n=i?[i].concat(s):s;this.emitEvent(t,n)},F.select=function(t,i,s){if(!this.isActive)return;if(t=parseInt(t,10),this._wrapSelect(t),(this.options.wrapAround||i)&&(t=m.modulo(t,this.slides.length)),!this.slides[t])return;const n=this.selectedIndex;this.selectedIndex=t,this.updateSelectedSlide(),s?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select",null,[t]),t!=n&&this.dispatchEvent("change",null,[t]),this.dispatchEvent("cellSelect")},F._wrapSelect=function(t){const i=this.slides.length;if(!(this.options.wrapAround&&i>1))return t;const s=m.modulo(t,i),n=Math.abs(s-this.selectedIndex),e=Math.abs(s+i-this.selectedIndex),o=Math.abs(s-i-this.selectedIndex);!this.isDragSelect&&e<n?t+=i:!this.isDragSelect&&o<n&&(t-=i),t<0?this.x-=this.slideableWidth:t>=i&&(this.x+=this.slideableWidth)},F.previous=function(t,i){this.select(this.selectedIndex-1,t,i)},F.next=function(t,i){this.select(this.selectedIndex+1,t,i)},F.updateSelectedSlide=function(){const t=this.slides[this.selectedIndex];t&&(this.unselectSelectedSlide(),this.selectedSlide=t,t.select(),this.selectedCells=t.cells,this.selectedElements=t.getCellElements(),this.selectedCell=t.cells[0],this.selectedElement=this.selectedElements[0])},F.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},F.selectInitialIndex=function(){const t=this.options.initialIndex;if(this.isInitActivated)return void this.select(this.selectedIndex,!1,!0);if(t&&"string"==typeof t&&this.queryCell(t))return void this.selectCell(t,!1,!0);let i=0;t&&this.slides[t]&&(i=t),this.select(i,!1,!0)},F.selectCell=function(t,i,s){const n=this.queryCell(t);if(!n)return;const e=this.getCellSlideIndex(n);this.select(e,i,s)},F.getCellSlideIndex=function(t){for(let i=0;i<this.slides.length;i++)if(-1!=this.slides[i].cells.indexOf(t))return i},F.getCell=function(t){for(let i=0;i<this.cells.length;i++){const s=this.cells[i];if(s.element==t)return s}},F.getCells=function(t){t=m.makeArray(t);const i=[];return t.forEach((function(t){const s=this.getCell(t);s&&i.push(s)}),this),i},F.getCellElements=function(){return this.cells.map((function(t){return t.element}))},F.getParentCell=function(t){return this.getCell(t)||(t=m.getParent(t,".flickity-slider > *"),this.getCell(t))},F.getAdjacentCellElements=function(t,i){if(!t)return this.selectedSlide.getCellElements();i=void 0===i?this.selectedIndex:i;const s=this.slides.length;if(1+2*t>=s)return this.getCellElements();let n=[];for(let e=i-t;e<=i+t;e++){const t=this.options.wrapAround?m.modulo(e,s):e,i=this.slides[t];i&&(n=n.concat(i.getCellElements()))}return n},F.queryCell=function(t){if("number"==typeof t)return this.cells[t];if("string"==typeof t){if(t.match(/^[#\.]?[\d\/]/))return;t=this.element.querySelector(t)}return this.getCell(t)},F.uiChange=function(){this.emitEvent("uiChange")},F.childUIPointerDown=function(t){"touchstart"!=t.type&&t.preventDefault(),this.focus()},F.onresize=function(){this.watchCSS(),this.resize()},m.debounceMethod(D,"onresize",150),F.resize=function(){this.isActive&&(this.getSize(),this.options.wrapAround&&(this.x=m.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize"),this.selectCell(this.selectedElements&&this.selectedElements[0],!1,!0))},F.watchCSS=function(){this.options.watchCSS&&(-1!=M(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},F.onkeydown=function(t){const i=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||i)return;const s=D.keyboardHandlers[t.keyCode];s&&s.call(this)},D.keyboardHandlers={37:function(){const t=this.options.rightToLeft?"next":"previous";this.uiChange(),this[t]()},39:function(){const t=this.options.rightToLeft?"previous":"next";this.uiChange(),this[t]()}},F.focus=function(){const t=window.pageYOffset;this.element.focus({preventScroll:!0}),window.pageYOffset!=t&&window.scrollTo(window.pageXOffset,t)},F.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach((function(t){t.destroy()})),this.element.removeChild(this.viewport),A(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},F.destroy=function(){this.deactivate(),window.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),delete this.element.flickityGUID,delete P[this.guid]},m.extend(F,C),D.data=function(t){const i=(t=m.getQueryElement(t))&&t.flickityGUID;return i&&P[i]},m.htmlInit(D,"flickity"),D.Cell=w,D.Slide=S;const j=R.prototype=Object.create(r.prototype);j.bindStartEvent=function(t){this._bindStartEvent(t,!0)},j.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},j._bindStartEvent=function(t,i){i=void 0===i||i;let s="mousedown";"ontouchstart"in window?s="touchstart":window.PointerEvent&&(s="pointerdown"),t[i?"addEventListener":"removeEventListener"](s,this)},j.handleEvent=function(t){const i="on"+t.type;this[i]&&this[i](t)},j.getTouch=function(t){for(let i=0;i<t.length;i++){const s=t[i];if(s.identifier==this.pointerIdentifier)return s}},j.onmousedown=function(t){const i=t.button;i&&0!==i&&1!==i||this._pointerDown(t,t)},j.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])},j.onpointerdown=function(t){this._pointerDown(t,t)},j._pointerDown=function(t,i){t.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==i.pointerId?i.pointerId:i.identifier,this.pointerDown(t,i))},j.pointerDown=function(t,i){this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,i])};const O={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};
|
10
|
+
function l(t){const i=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(i)&&i}a.on=function(t,i){if(!t||!i)return;const s=this._events=this._events||{},n=s[t]=s[t]||[];return-1==n.indexOf(i)&&n.push(i),this},a.once=function(t,i){if(!t||!i)return;this.on(t,i);const s=this._onceEvents=this._onceEvents||{};return(s[t]=s[t]||{})[i]=!0,this},a.off=function(t,i){const s=this._events&&this._events[t];if(!s||!s.length)return;const n=s.indexOf(i);return-1!=n&&s.splice(n,1),this},a.emitEvent=function(t,i){let s=this._events&&this._events[t];if(!s||!s.length)return;s=s.slice(0),i=i||[];const n=this._onceEvents&&this._onceEvents[t];for(let e=0;e<s.length;e++){const o=s[e];n&&n[o]&&(this.off(t,o),delete n[o]),o.apply(this,i)}return this},a.allOff=function(){delete this._events,delete this._onceEvents};const u="undefined"==typeof console?function(){}:function(t){console.error(t)},f=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],d=f.length;function p(t){const i=getComputedStyle(t);return i||u("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),i}let b,y=!1;function g(t){if(function(){if(y)return;y=!0;const t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";const i=document.body||document.documentElement;i.appendChild(t);const s=p(t);b=200==Math.round(l(s.width)),g.isBoxSizeOuter=b,i.removeChild(t)}(),"string"==typeof t&&(t=document.querySelector(t)),!t||"object"!=typeof t||!t.nodeType)return;const i=p(t);if("none"==i.display)return function(){const t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(let i=0;i<d;i++)t[f[i]]=0;return t}();const s={};s.width=t.offsetWidth,s.height=t.offsetHeight;const n=s.isBorderBox="border-box"==i.boxSizing;for(let t=0;t<d;t++){const n=f[t],e=parseFloat(i[n]);s[n]=isNaN(e)?0:e}const e=s.paddingLeft+s.paddingRight,o=s.paddingTop+s.paddingBottom,h=s.marginLeft+s.marginRight,c=s.marginTop+s.marginBottom,r=s.borderLeftWidth+s.borderRightWidth,a=s.borderTopWidth+s.borderBottomWidth,u=n&&b,m=l(i.width);!1!==m&&(s.width=m+(u?0:e+r));const v=l(i.height);return!1!==v&&(s.height=v+(u?0:o+a)),s.innerWidth=s.width-(e+r),s.innerHeight=s.height-(o+a),s.outerWidth=s.width+h,s.outerHeight=s.height+c,s}const m={extend:function(t,i){for(const s in i)t[s]=i[s];return t},docReady:function(t){const i=document.readyState;"complete"==i||"interactive"==i?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},toDashed:function(t){return t.replace(/(.)([A-Z])/g,(function(t,i,s){return i+"-"+s})).toLowerCase()},modulo:function(t,i){return(t%i+i)%i}},v=Array.prototype.slice;m.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?v.call(t):[t]},m.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if((t=t.parentElement).matches(i))return t},m.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},m.handleEvent=function(t){const i="on"+t.type;this[i]&&this[i](t)},m.filterFindElements=function(t,i){t=m.makeArray(t);const s=[];return t.forEach((function(t){if(!(t instanceof HTMLElement))return;if(!i)return void s.push(t);t.matches(i)&&s.push(t);const n=t.querySelectorAll(i);for(let t=0;t<n.length;t++)s.push(n[t])})),s},m.debounceMethod=function(t,i,s){s=s||100;const n=t.prototype[i],e=i+"Timeout";t.prototype[i]=function(...t){clearTimeout(this[e]);const i=this;this[e]=setTimeout((function(){n.apply(i,t),delete i[e]}),s)}};const k=window.console;function w(t,i){this.element=t,this.parent=i,this.create()}m.htmlInit=function(t,i){m.docReady((function(){const s=m.toDashed(i),n="data-"+s,e=document.querySelectorAll("["+n+"]"),o=document.querySelectorAll(".js-"+s),h=m.makeArray(e).concat(m.makeArray(o)),c=n+"-options";h.forEach((function(i){const s=i.getAttribute(n)||i.getAttribute(c);let e;try{e=s&&JSON.parse(s)}catch(t){return void(k&&k.error("Error parsing "+n+" on "+i.className+": "+t))}new t(i,e)}))}))};const x=w.prototype;function S(t){this.parent=t,this.isOriginLeft="left"==t.originSide,this.cells=[],this.outerWidth=0,this.height=0}x.create=function(){this.element.style.position="absolute",this.element.setAttribute("aria-hidden","true"),this.x=0,this.shift=0,Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.setAttribute("tabindex","-1")}))},x.destroy=function(){this.unselect(),this.element.style.position="",this.element.style[this.parent.originSide]=""},x.getSize=function(){this.size=g(this.element)},x.setPosition=function(t){this.x=t,this.updateTarget(),this.renderPosition(t)},x.updateTarget=x.setDefaultTarget=function(){this.target=this.x+this.size["left"==this.parent.originSide?"marginLeft":"marginRight"]+this.size.width*this.parent.cellAlign},x.renderPosition=function(t){this.element.style[this.parent.originSide]=this.parent.getPositionValue(t)},x.select=function(){this.element.classList.add("is-selected"),this.element.removeAttribute("aria-hidden"),Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.removeAttribute("tabindex")}))},x.unselect=function(){this.element.classList.remove("is-selected"),this.element.setAttribute("aria-hidden","true"),Array.from(this.element.querySelectorAll("*")).forEach((t=>{t.setAttribute("tabindex","-1")}))},x.wrapShift=function(t){this.shift=t,this.renderPosition(this.x+this.parent.slideableWidth*t)},x.remove=function(){this.element.parentNode.removeChild(this.element)};const z=S.prototype;z.addCell=function(t){this.cells.push(t),this.outerWidth+=t.size.outerWidth,this.height=Math.max(t.size.outerHeight,this.height),1==this.cells.length&&(this.x=t.x,this.firstMargin=t.size[this.isOriginLeft?"marginLeft":"marginRight"])},z.updateTarget=function(){const t=this.isOriginLeft?"marginRight":"marginLeft",i=this.getLastCell();this.target=this.x+this.firstMargin+(this.outerWidth-(this.firstMargin+(i?i.size[t]:0)))*this.parent.cellAlign},z.getLastCell=function(){return this.cells[this.cells.length-1]},z.select=function(){this.cells.forEach((function(t){t.select()}))},z.unselect=function(){this.cells.forEach((function(t){t.unselect()}))},z.getCellElements=function(){return this.cells.map((function(t){return t.element}))};const C={startAnimation:function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},animate:function(){this.applyDragForce(),this.applySelectedAttraction();const t=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(t),this.isAnimating){const t=this;requestAnimationFrame((function(){t.animate()}))}},positionSlider:function(){let t=this.x;this.options.wrapAround&&this.cells.length>1&&(t=m.modulo(t,this.slideableWidth),t-=this.slideableWidth,this.shiftWrapCells(t)),this.setTranslateX(t,this.isAnimating),this.dispatchScrollEvent()},setTranslateX:function(t){t+=this.cursorPosition;const i=this.getPositionValue(t=this.options.rightToLeft?-t:t);this.slider.style.transform="translate3d("+i+",0,0)"},dispatchScrollEvent:function(){const t=this.slides[0];if(!t)return;const i=-this.x-t.target;this.dispatchEvent("scroll",null,[i/this.slidesWidth,i])},positionSliderAtSelected:function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},getPositionValue:function(t){return this.options.percentPosition?.01*Math.round(t/this.size.innerWidth*1e4)+"%":Math.round(t)+"px"},settle:function(t){this.isPointerDown||Math.round(100*this.x)!=Math.round(100*t)||this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},shiftWrapCells:function(t){this._shiftCells(this.beforeShiftCells,this.cursorPosition+t,-1),this._shiftCells(this.afterShiftCells,this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition),1)},_shiftCells:function(t,i,s){for(let n=0;n<t.length;n++){const e=t[n];e.wrapShift(i>0?s:0),i-=e.size.outerWidth}},_unshiftCells:function(t){if(t&&t.length)for(let i=0;i<t.length;i++)t[i].wrapShift(0)},integratePhysics:function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},applyForce:function(t){this.velocity+=t},getFrictionFactor:function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},getRestingPosition:function(){return this.x+this.velocity/(1-this.getFrictionFactor())},applyDragForce:function(){this.isDraggable&&this.isPointerDown&&this.applyForce(this.dragX-this.x-this.velocity)},applySelectedAttraction:function(){this.isDraggable&&this.isPointerDown||this.isFreeScrolling||!this.slides.length||this.applyForce((-1*this.selectedSlide.target-this.x)*this.options.selectedAttraction)}},M=window.getComputedStyle,T=window.console;function A(t,i){for(t=m.makeArray(t);t.length;)i.appendChild(t.shift())}let E=0;const D={};function F(t,i){const s=m.getQueryElement(t);if(s){if(this.element=s,this.element.flickityGUID){const t=D[this.element.flickityGUID];if(!D[this.element.flickityGUID])return;return t.option(i),t}this.options=m.extend({},this.constructor.defaults),this.option(i),this._create()}else T&&T.error("Bad element for Flickity: "+(s||t))}F.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},F.createMethods=[];const P=F.prototype;m.extend(P,r.prototype),P._create=function(){const t=this.guid=++E;this.element.flickityGUID=t,D[t]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this.viewport.part.add("slide-viewport"),this._createSlider(),(this.options.resize||this.options.watchCSS)&&window.addEventListener("resize",this);for(const t in this.options.on)this.on(t,this.options.on[t]);F.createMethods.forEach((function(t){this[t]()}),this),this.options.watchCSS?this.watchCSS():this.activate()},P.option=function(t){m.extend(this.options,t)},P.activate=function(){this.isActive||(this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize(),A(this.element.children,this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate"),this.selectInitialIndex(),this.isInitActivated=!0,this.dispatchEvent("ready"))},P._createSlider=function(){const t=document.createElement("div");t.className="flickity-slider",t.style[this.originSide]=0,this.slider=t},P._filterFindCellElements=function(t){return m.filterFindElements(t,this.options.cellSelector)},P.reloadCells=function(){let t=this.slider.children;if(this.slider.getRootNode().host){t=[];for(const i of this.slider.getRootNode().host.children)"assignedElements"in i?t=[...t,...i.assignedElements()]:t.push(i)}this.cells=this._makeCells(t),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},P._makeCells=function(t){return this._filterFindCellElements(t).map((function(t){return new w(t,this)}),this)},P.getLastCell=function(){return this.cells[this.cells.length-1]},P.getLastSlide=function(){return this.slides[this.slides.length-1]},P.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},P._positionCells=function(t){this.maxCellHeight=(t=t||0)&&this.maxCellHeight||0;let i=0;if(t>0){const s=this.cells[t-1];i=s.x+s.size.outerWidth}const s=this.cells.length;for(let n=t;n<s;n++){const t=this.cells[n];t.setPosition(i),i+=t.size.outerWidth,this.maxCellHeight=Math.max(t.size.outerHeight,this.maxCellHeight)}this.slideableWidth=i,this.updateSlides(),this._containSlides(),this.slidesWidth=s?this.getLastSlide().target-this.slides[0].target:0},P._sizeCells=function(t){t.forEach((function(t){t.getSize()}))},P.updateSlides=function(){if(this.slides=[],!this.cells.length)return;let t=new S(this);this.slides.push(t);const i="left"==this.originSide?"marginRight":"marginLeft",s=this._getCanCellFit();this.cells.forEach((function(n,e){t.cells.length?(s.call(this,e,t.outerWidth-t.firstMargin+(n.size.outerWidth-n.size[i]))||(t.updateTarget(),t=new S(this),this.slides.push(t)),t.addCell(n)):t.addCell(n)}),this),t.updateTarget(),this.updateSelectedSlide()},P._getCanCellFit=function(){const t=this.options.groupCells;if(!t)return function(){return!1};if("number"==typeof t){const i=parseInt(t,10);return function(t){return t%i!=0}}const i="string"==typeof t&&t.match(/^(\d+)%$/),s=i?parseInt(i[1],10)/100:1;return function(t,i){return i<=(this.size.innerWidth+1)*s}},P._init=P.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},P.getSize=function(){this.size=g(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};const L={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};function R(){}P.setCellAlign=function(){const t=L[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign},P.setGallerySize=function(){this.options.setGallerySize&&(this.viewport.style.height=(this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight)+"px")},P._getWrapShiftCells=function(){if(!this.options.wrapAround)return;this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);let t=this.cursorPosition;this.beforeShiftCells=this._getGapCells(t,this.cells.length-1,-1),t=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(t,0,1)},P._getGapCells=function(t,i,s){const n=[];for(;t>0;){const e=this.cells[i];if(!e)break;n.push(e),i+=s,t-=e.size.outerWidth}return n},P._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length)return;const t=this.options.rightToLeft,i=t?"marginRight":"marginLeft",s=t?"marginLeft":"marginRight",n=this.slideableWidth-this.getLastCell().size[s],e=n<this.size.innerWidth,o=this.cursorPosition+this.cells[0].size[i],h=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach((function(t){e?t.target=n*this.cellAlign:(t.target=Math.max(t.target,o),t.target=Math.min(t.target,h))}),this)},P.dispatchEvent=function(t,i,s){const n=i?[i].concat(s):s;this.emitEvent(t,n)},P.select=function(t,i,s){if(!this.isActive)return;if(t=parseInt(t,10),this._wrapSelect(t),(this.options.wrapAround||i)&&(t=m.modulo(t,this.slides.length)),!this.slides[t])return;const n=this.selectedIndex;this.selectedIndex=t,this.updateSelectedSlide(),s?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select",null,[t]),t!=n&&this.dispatchEvent("change",null,[t]),this.dispatchEvent("cellSelect")},P._wrapSelect=function(t){const i=this.slides.length;if(!(this.options.wrapAround&&i>1))return t;const s=m.modulo(t,i),n=Math.abs(s-this.selectedIndex),e=Math.abs(s+i-this.selectedIndex),o=Math.abs(s-i-this.selectedIndex);!this.isDragSelect&&e<n?t+=i:!this.isDragSelect&&o<n&&(t-=i),t<0?this.x-=this.slideableWidth:t>=i&&(this.x+=this.slideableWidth)},P.previous=function(t,i){this.select(this.selectedIndex-1,t,i)},P.next=function(t,i){this.select(this.selectedIndex+1,t,i)},P.updateSelectedSlide=function(){const t=this.slides[this.selectedIndex];t&&(this.unselectSelectedSlide(),this.selectedSlide=t,t.select(),this.selectedCells=t.cells,this.selectedElements=t.getCellElements(),this.selectedCell=t.cells[0],this.selectedElement=this.selectedElements[0])},P.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},P.selectInitialIndex=function(){const t=this.options.initialIndex;if(this.isInitActivated)return void this.select(this.selectedIndex,!1,!0);if(t&&"string"==typeof t&&this.queryCell(t))return void this.selectCell(t,!1,!0);let i=0;t&&this.slides[t]&&(i=t),this.select(i,!1,!0)},P.selectCell=function(t,i,s){const n=this.queryCell(t);if(!n)return;const e=this.getCellSlideIndex(n);this.select(e,i,s)},P.getCellSlideIndex=function(t){for(let i=0;i<this.slides.length;i++)if(-1!=this.slides[i].cells.indexOf(t))return i},P.getCell=function(t){for(let i=0;i<this.cells.length;i++){const s=this.cells[i];if(s.element==t)return s}},P.getCells=function(t){t=m.makeArray(t);const i=[];return t.forEach((function(t){const s=this.getCell(t);s&&i.push(s)}),this),i},P.getCellElements=function(){return this.cells.map((function(t){return t.element}))},P.getParentCell=function(t){return this.getCell(t)||(t=m.getParent(t,".flickity-slider > *"),this.getCell(t))},P.getAdjacentCellElements=function(t,i){if(!t)return this.selectedSlide.getCellElements();i=void 0===i?this.selectedIndex:i;const s=this.slides.length;if(1+2*t>=s)return this.getCellElements();let n=[];for(let e=i-t;e<=i+t;e++){const t=this.options.wrapAround?m.modulo(e,s):e,i=this.slides[t];i&&(n=n.concat(i.getCellElements()))}return n},P.queryCell=function(t){if("number"==typeof t)return this.cells[t];if("string"==typeof t){if(t.match(/^[#\.]?[\d\/]/))return;t=this.element.querySelector(t)}return this.getCell(t)},P.uiChange=function(){this.emitEvent("uiChange")},P.childUIPointerDown=function(t){"touchstart"!=t.type&&t.preventDefault(),this.focus()},P.onresize=function(){this.watchCSS(),this.resize()},m.debounceMethod(F,"onresize",150),P.resize=function(){this.isActive&&(this.getSize(),this.options.wrapAround&&(this.x=m.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize"),this.selectCell(this.selectedElements&&this.selectedElements[0],!1,!0))},P.watchCSS=function(){this.options.watchCSS&&(-1!=M(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},P.onkeydown=function(t){const i=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||i)return;const s=F.keyboardHandlers[t.keyCode];s&&s.call(this)},F.keyboardHandlers={37:function(){const t=this.options.rightToLeft?"next":"previous";this.uiChange(),this[t]()},39:function(){const t=this.options.rightToLeft?"previous":"next";this.uiChange(),this[t]()}},P.focus=function(){const t=window.pageYOffset;this.element.focus({preventScroll:!0}),window.pageYOffset!=t&&window.scrollTo(window.pageXOffset,t)},P.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach((function(t){t.destroy()})),this.element.removeChild(this.viewport),A(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},P.destroy=function(){this.deactivate(),window.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),delete this.element.flickityGUID,delete D[this.guid]},m.extend(P,C),F.data=function(t){const i=(t=m.getQueryElement(t))&&t.flickityGUID;return i&&D[i]},m.htmlInit(F,"flickity"),F.Cell=w,F.Slide=S;const O=R.prototype=Object.create(r.prototype);O.bindStartEvent=function(t){this._bindStartEvent(t,!0)},O.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},O._bindStartEvent=function(t,i){i=void 0===i||i;let s="mousedown";"ontouchstart"in window?s="touchstart":window.PointerEvent&&(s="pointerdown"),t[i?"addEventListener":"removeEventListener"](s,this)},O.handleEvent=function(t){const i="on"+t.type;this[i]&&this[i](t)},O.getTouch=function(t){for(let i=0;i<t.length;i++){const s=t[i];if(s.identifier==this.pointerIdentifier)return s}},O.onmousedown=function(t){const i=t.button;i&&0!==i&&1!==i||this._pointerDown(t,t)},O.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])},O.onpointerdown=function(t){this._pointerDown(t,t)},O._pointerDown=function(t,i){t.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==i.pointerId?i.pointerId:i.identifier,this.pointerDown(t,i))},O.pointerDown=function(t,i){this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,i])};const j={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};
|
11
11
|
/*!
|
12
12
|
* Unidragger v2.4.0
|
13
13
|
* Draggable base class
|
14
14
|
* MIT license
|
15
15
|
*/
|
16
|
-
function N(){}
|
16
|
+
function N(){}O._bindPostStartEvents=function(t){if(!t)return;const i=j[t.type];i.forEach((function(t){window.addEventListener(t,this)}),this),this._boundPointerEvents=i},O._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach((function(t){window.removeEventListener(t,this)}),this),delete this._boundPointerEvents)},O.onmousemove=function(t){this._pointerMove(t,t)},O.onpointermove=function(t){t.pointerId==this.pointerIdentifier&&this._pointerMove(t,t)},O.ontouchmove=function(t){const i=this.getTouch(t.changedTouches);i&&this._pointerMove(t,i)},O._pointerMove=function(t,i){this.pointerMove(t,i)},O.pointerMove=function(t,i){this.emitEvent("pointerMove",[t,i])},O.onmouseup=function(t){this._pointerUp(t,t)},O.onpointerup=function(t){t.pointerId==this.pointerIdentifier&&this._pointerUp(t,t)},O.ontouchend=function(t){const i=this.getTouch(t.changedTouches);i&&this._pointerUp(t,i)},O._pointerUp=function(t,i){this._pointerDone(),this.pointerUp(t,i)},O.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i])},O._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},O._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},O.pointerDone=
|
17
17
|
/*!
|
18
18
|
* Unipointer v2.4.0
|
19
19
|
* base class for doing one thing with pointer event
|
20
20
|
* MIT license
|
21
21
|
*/
|
22
|
-
function(){},j.onpointercancel=function(t){t.pointerId==this.pointerIdentifier&&this._pointerCancel(t,t)},j.ontouchcancel=function(t){const i=this.getTouch(t.changedTouches);i&&this._pointerCancel(t,i)},j._pointerCancel=function(t,i){this._pointerDone(),this.pointerCancel(t,i)},j.pointerCancel=function(t,i){this.emitEvent("pointerCancel",[t,i])},R.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};const B=N.prototype=Object.create(R.prototype);B.bindHandles=function(){this._bindHandles(!0)},B.unbindHandles=function(){this._bindHandles(!1)},B._bindHandles=function(t){const i=(t=void 0===t||t)?"addEventListener":"removeEventListener",s=t?this._touchActionValue:"";for(let n=0;n<this.handles.length;n++){const e=this.handles[n];this._bindStartEvent(e,t),e[i]("click",this),window.PointerEvent&&(e.style.touchAction=s)}},B._touchActionValue="none",B.pointerDown=function(t,i){this.okayPointerDown(t)&&(this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY},t.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,i]))};const I={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},W={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};B.okayPointerDown=function(t){const i=!I[t.target.nodeName]||W[t.target.type];return i||this._pointerReset(),i},B.pointerDownBlur=function(){const t=document.activeElement;t&&t.blur&&t!=document.body&&t.blur()},B.pointerMove=function(t,i){const s=this._dragPointerMove(t,i);this.emitEvent("pointerMove",[t,i,s]),this._dragMove(t,i,s)},B._dragPointerMove=function(t,i){const s={x:i.pageX-this.pointerDownPointer.pageX,y:i.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(s)&&this._dragStart(t,i),s},B.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3},B.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i]),this._dragPointerUp(t,i)},B._dragPointerUp=function(t,i){this.isDragging?this._dragEnd(t,i):this._staticClick(t,i)},B._dragStart=function(t,i){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(t,i)},B.dragStart=function(t,i){this.emitEvent("dragStart",[t,i])},B._dragMove=function(t,i,s){this.isDragging&&this.dragMove(t,i,s)},B.dragMove=function(t,i,s){t.preventDefault(),this.emitEvent("dragMove",[t,i,s])},B._dragEnd=function(t,i){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,i)},B.dragEnd=function(t,i){this.emitEvent("dragEnd",[t,i])},B.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},B._staticClick=function(t,i){this.isIgnoringMouseUp&&"mouseup"==t.type||(this.staticClick(t,i),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},B.staticClick=function(t,i){this.emitEvent("staticClick",[t,i])},N.getPointerPoint=R.getPointerPoint;const _=D;(()=>{m.extend(D.defaults,{draggable:">1",dragThreshold:3}),D.createMethods.push("_createDrag");const t=D.prototype;m.extend(t,N.prototype),t._touchActionValue="pan-y";const i="createTouch"in document;let s=!1;t._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable),i&&!s&&(window.addEventListener("touchmove",(function(){})),s=!0)},t.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},t.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},t.updateDraggable=function(){this.isDraggable=">1"==this.options.draggable?this.slides.length>1:this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},t.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},t.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},t._uiChangeDrag=function(){delete this.isFreeScrolling},t.pointerDown=function(t,i){this.isDraggable?this.okayPointerDown(t)&&(this._pointerDownPreventDefault(t),this.pointerDownFocus(t),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=e(),window.addEventListener("scroll",this),this._pointerDownDefault(t,i)):this._pointerDownDefault(t,i)},t._pointerDownDefault=function(t,i){this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY},this._bindPostStartEvents(t),this.dispatchEvent("pointerDown",t,[i])};const n={INPUT:!0,TEXTAREA:!0,SELECT:!0};function e(){return{x:window.scrollX,y:window.scrollY}}t.pointerDownFocus=function(t){n[t.target.nodeName]||this.focus()},t._pointerDownPreventDefault=function(t){"touchstart"==t.type||"touch"==t.pointerType||n[t.target.nodeName]||t.preventDefault()},t.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold},t.pointerUp=function(t,i){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",t,[i]),this._dragPointerUp(t,i)},t.pointerDone=function(){window.removeEventListener("scroll",this),delete this.pointerDownScroll},t.dragStart=function(t,i){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),window.removeEventListener("scroll",this),this.dispatchEvent("dragStart",t,[i]))},t.pointerMove=function(t,i){const s=this._dragPointerMove(t,i);this.dispatchEvent("pointerMove",t,[i,s]),this._dragMove(t,i,s)},t.dragMove=function(t,i,s){if(!this.isDraggable)return;t.preventDefault(),this.previousDragX=this.dragX;const n=this.options.rightToLeft?-1:1;this.options.wrapAround&&(s.x=s.x%this.slideableWidth);let e=this.dragStartPosition+s.x*n;if(!this.options.wrapAround&&this.slides.length){const t=Math.max(-this.slides[0].target,this.dragStartPosition);e=e>t?.5*(e+t):e;const i=Math.min(-this.getLastSlide().target,this.dragStartPosition);e=e<i?.5*(e+i):e}this.dragX=e,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",t,[i,s])},t.dragEnd=function(t,i){if(!this.isDraggable)return;this.options.freeScroll&&(this.isFreeScrolling=!0);let s=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){const t=this.getRestingPosition();this.isFreeScrolling=-t>this.slides[0].target&&-t<this.getLastSlide().target}else this.options.freeScroll||s!=this.selectedIndex||(s+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(s),delete this.isDragSelect,this.dispatchEvent("dragEnd",t,[i])},t.dragEndRestingSelect=function(){const t=this.getRestingPosition(),i=Math.abs(this.getSlideDistance(-t,this.selectedIndex)),s=this._getClosestResting(t,i,1),n=this._getClosestResting(t,i,-1);return s.distance<n.distance?s.index:n.index},t._getClosestResting=function(t,i,s){let n=this.selectedIndex,e=1/0;const o=this.options.contain&&!this.options.wrapAround?function(t,i){return t<=i}:function(t,i){return t<i};for(;o(i,e)&&(n+=s,e=i,null!==(i=this.getSlideDistance(-t,n)));)i=Math.abs(i);return{distance:e,index:n-s}},t.getSlideDistance=function(t,i){const s=this.slides.length,n=this.options.wrapAround&&s>1,e=n?m.modulo(i,s):i,o=this.slides[e];if(!o)return null;const h=n?this.slideableWidth*Math.floor(i/s):0;return t-(o.target+h)},t.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;const t=this.getSlideDistance(-this.dragX,this.selectedIndex),i=this.previousDragX-this.dragX;return t>0&&i>0?1:t<0&&i<0?-1:0},t.staticClick=function(t,i){const s=this.getParentCell(t.target),n=s&&s.element,e=s&&this.cells.indexOf(s);this.dispatchEvent("staticClick",t,[i,n,e])},t.onscroll=function(){const t=e(),i=this.pointerDownScroll.y-t.y;(Math.abs(this.pointerDownScroll.x-t.x)>3||Math.abs(i)>3)&&this._pointerDone()}})(),(()=>{function t(t,i){this.direction=t,this.parent=i,this.parentElement=this.parent.element.shadowRoot||this.parent.element,this._create()}(t.prototype=Object.create(R.prototype))._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction,this.isLeft=this.direction==(this.parent.options.rightToLeft?1:-1);const t=this.element=document.createElement("button");t.className="flickity-button flickity-prev-next-button",t.part.add("navigation-button"),this.isPrevious?(t.classList.add("previous"),t.part.add("navigation-button--previous")):(t.classList.add("next"),t.part.add("navigation-button--next")),t.setAttribute("type","button"),this.disable(),t.setAttribute("aria-label",this.isPrevious?"Previous":"Next");const i=document.createElement("slot");i.name=this.isPrevious?"previous-icon":"next-icon",t.appendChild(i),i.addEventListener("slotchange",(()=>{i.assignedElements({flatten:!0}).forEach((t=>{t.removeAttribute("hidden")}))}));const s=document.createElement("span");s.className="button-icon "+(this.isPrevious?"button-icon--previous":"button-icon--next"),s.part.add("navigation-icon"),i.appendChild(s),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},t.prototype.activate=function(){this.bindStartEvent(this.element),this.element.addEventListener("click",this),this.parentElement.appendChild(this.element)},t.prototype.deactivate=function(){this.parentElement.removeChild(this.element),this.unbindStartEvent(this.element),this.element.removeEventListener("click",this)},t.prototype.handleEvent=m.handleEvent,t.prototype.onclick=function(){this.isEnabled&&(this.parent.uiChange(),this.parent[this.isPrevious?"previous":"next"]())},t.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},t.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},t.prototype.update=function(){const t=this.parent.slides;this.parent.options.wrapAround&&t.length>1?this.enable():this[this.parent.selectedIndex==(this.isPrevious?0:t.length?t.length-1:0)?"disable":"enable"]()},t.prototype.destroy=function(){this.deactivate(),this.allOff()},m.extend(D.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),D.createMethods.push("_createPrevNextButtons");const i=D.prototype;i._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new t(-1,this),this.nextButton=new t(1,this),this.on("activate",this.activatePrevNextButtons))},i.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},i.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},D.PrevNextButton=t})(),(()=>{function t(t){this.parent=t,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}(t.prototype=Object.create(r.prototype)).play=function(){"playing"!=this.state&&(document.hidden?document.addEventListener("visibilitychange",this.onVisibilityPlay):(this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()))},t.prototype.tick=function(){if("playing"!=this.state)return;let t=this.parent.options.autoPlay;t="number"==typeof t?t:3e3;const i=this;this.clear(),this.timeout=setTimeout((function(){i.parent.next(!0),i.tick()}),t)},t.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},t.prototype.clear=function(){clearTimeout(this.timeout)},t.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},t.prototype.unpause=function(){"paused"==this.state&&this.play()},t.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},t.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},m.extend(D.defaults,{pauseAutoPlayOnHover:!0}),D.createMethods.push("_createPlayer");const i=D.prototype;i._createPlayer=function(){this.player=new t(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},i.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},i.playPlayer=function(){this.player.play()},i.stopPlayer=function(){this.player.stop()},i.pausePlayer=function(){this.player.pause()},i.unpausePlayer=function(){this.player.unpause()},i.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},i.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},i.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},D.Player=t})();const X=class{constructor(s){t(this,s),this.nanoSlidesDidLoad=i(this,"nanoSlidesDidLoad",7),this.nanoSlidesReady=i(this,"nanoSlidesReady",7),this.nanoSlidesSelect=i(this,"nanoSlidesSelect",7),this.nanoSlidesChange=i(this,"nanoSlidesChange",7),this.nanoSlidesScroll=i(this,"nanoSlidesScroll",7),this.nanoSlidesTransitionEnd=i(this,"nanoSlidesTransitionEnd",7),this.nanoSlidesDragStart=i(this,"nanoSlidesDragStart",7),this.nanoSlidesDragMove=i(this,"nanoSlidesDragMove",7),this.nanoSlidesDragEnd=i(this,"nanoSlidesDragEnd",7),this.nanoSlidesTap=i(this,"nanoSlidesTap",7),this.nanoSlidesFullscreenChange=i(this,"nanoSlidesFullscreenChange",7)}flickityEl;flickityReady=!1;mutationO;resizeO;readyflickity;flickity=new Promise((t=>{this.readyflickity=t}));syncflickity;childrenEles;hasFullScreenModule=!1;hasLazyLoadModule=!1;hasDotsModule=!1;hasFadeModule=!1;iCurrentSlide;slidesReady;didInit=!1;get host(){return s(this)}options={};async optionsChanged(){if(this.flickityReady){const t=await this.getflickity(),i=Object.assign(t.options,this.options);await this.loadFlickityModules(i),await this.update()}}navbtns=!1;async navbtnsChanged(){Array.from(this._getRoot().querySelectorAll(".flickity-prev-next-button")).forEach((t=>{t.hidden=!this.navbtns}))}pager=!1;async pagerChanged(){const t=this._getRoot().querySelector(".flickity-page-dots");t&&(t.hidden=!this.pager)}fullscreenbtn=!1;async fullscreenBtnChanged(){const t=this._getRoot().querySelector(".flickity-fullscreen-button");t&&(t.hidden=!this.fullscreenbtn)}fullscreen=!1;async fullscreenChanged(t,i){const s=await this.getflickity();this.fullscreen?s.viewFullscreen():void 0!==i&&s.exitFullscreen()}animation="scroll";async animationChange(t,i){const[s,n]=await Promise.all([this.getflickity(),q(this.host)]);if(n.forEach((t=>{t.style.left=void 0})),"parallax"===i&&(s.off("scroll",this.parallax),n.forEach(((t,i)=>{this.childrenEles&&this.childrenEles[i]&&(this.childrenEles[i].style.transform=void 0)})),this.update()),"function"==typeof i&&s.off("scroll",i),"function"==typeof this.animation)return this.options={fade:!1,percentPosition:!0},void s.on("scroll",this.animation);switch(this.animation){case"fade":this.options={fade:!0,percentPosition:!0};break;case"parallax":this.options={fade:!1,percentPosition:!0},s.on("scroll",this.parallax);break;default:this.options={fade:!1,percentPosition:!0}}}currentSlide=0;currentSlideChange(){this.currentSlide!==this.iCurrentSlide&&this.slideTo(this.currentSlide)}internalSlideChange(){this.currentSlide=this.iCurrentSlide}autoplay=!1;async autoPlayChange(){await this.stopAutoplay(),this.autoplay&&("string"==typeof this.autoplay&&(this.autoplay=parseInt(this.autoplay)),this.autoplay>0&&this.startAutoplay(this.autoplay))}ready=!1;nanoSlidesDidLoad;nanoSlidesReady;nanoSlidesSelect;nanoSlidesChange;nanoSlidesScroll;nanoSlidesTransitionEnd;nanoSlidesDragStart;nanoSlidesDragMove;nanoSlidesDragEnd;nanoSlidesTap;nanoSlidesFullscreenChange;async update(){const[t]=await Promise.all([this.getflickity(),q(this.host)]);this.childrenEles=this.host.querySelectorAll(`${h("nano-slide")} > *`),t.reloadCells(),t.resize(),t.reposition()}async slideTo(t,i){(await this.getflickity()).select(t,i)}async slideNext(t,i){(await this.getflickity()).next(i,t)}async slidePrev(t,i){(await this.getflickity()).previous(t,i)}async getActiveIndex(){return(await this.getflickity()).selectedIndex}async length(){return(await this.getflickity()).slides.length}async isEnd(){const t=await this.getflickity();return t.selectedIndex===t.slides.length-1}async isBeginning(){return 0===(await this.getflickity()).selectedIndex}async startAutoplay(t){const i=await this.getflickity();t&&(this.options={autoPlay:t}),setTimeout((()=>i.playPlayer()))}async stopAutoplay(){(await this.getflickity()).stopPlayer()}async lockSwipes(t){const i=await this.getflickity();i.options.draggable=!t,i.updateDraggable()}async getflickity(){return this.flickity}async reload(){this.destroyflickity(),setTimeout((()=>this.initflickity()),20)}_getRoot(){return this.host.shadowRoot?this.host.shadowRoot:this.host}parallax=async()=>{const t=await this.flickity;t.cells.forEach((i=>{let s=t.x;var n;t.options.wrapAround&&t.cells.length>1&&(s=(s%(n=t.slideableWidth)+n)%n,s-=t.slideableWidth);let e=-1*(i.target+s)/3;i.shift<0?e=-1*(i.target-t.slideableWidth+s)/3:i.shift>0&&(e=-1*(i.target+(s+t.slideableWidth))/3),i.element.children[0].style.transform="translate3d("+e+"px, 0, 0)",i.element.style.setProperty("--animation-amount",(3*e/i.size.width*100).toString())}))};handleFullscreen=t=>{this.fullscreen=t,this.nanoSlidesFullscreenChange.emit(t)};handleSlideSelect=t=>{this.iCurrentSlide=t,this.nanoSlidesSelect.emit(t)};destroyflickity(){const t=this.syncflickity;void 0!==t&&(t.destroy(),this.flickity=new Promise((t=>{this.readyflickity=t})),this.flickityReady=!1,this.syncflickity=void 0,this.ready=!1),this.didInit=!1}async loadFlickityModules(t){!this.hasFullScreenModule&&t.fullscreen&&(await import("./fullscreen-jLcYyDdS.js"),this.hasFullScreenModule=!0),!this.hasLazyLoadModule&&t.lazyLoad&&(await import("./lazyload-D8CHTgro.js"),this.hasLazyLoadModule=!0),!this.hasDotsModule&&t.pageDots&&(await import("./page-dots-o5M__fM6.js"),this.hasDotsModule=!0),!this.hasFadeModule&&t.fade&&(await import("./fade-C_4Qu5OX.js"),this.hasFadeModule=!0)}async initflickity(){const t=this.normalizeOptions();await this.loadFlickityModules(t),await q(this.host),this.flickityEl=this.flickityEl||this._getRoot().querySelector(".flickity-container"),this.flickityEl&&(this.slidesReady=!0,this.flickityEl.classList.contains("flickity-enabled")&&this.destroyflickity(),this.flickityEl.style.height=this.flickityEl.getBoundingClientRect().height+"px",setTimeout((()=>{this.flickityEl.style.height="";const i=new _(this.flickityEl,t);this.flickityReady=!0,this.syncflickity=i,this.animationChange(),this.navbtnsChanged(),this.pagerChanged(),this.fullscreenChanged(),this.fullscreenBtnChanged(),this.readyflickity(i),this.ready=!0,window.ResizeObserver&&(this.resizeO&&(this.resizeO.disconnect(),this.resizeO=void 0),(this.resizeO=new ResizeObserver((()=>{n((()=>{const t=this.host.shadowRoot.querySelector(".flickity-viewport");e((()=>{t&&(t.style.height=""),i.resize()}))}))}))).observe(this.host))}),100))}normalizeOptions(){const t={cellSelector:h("nano-slide"),contain:!0,prevNextButtons:!0,fullscreen:this.fullscreen,accessibility:!0,imagesLoaded:!0,pageDots:this.pager};"fade"===this.animation&&(t.fade=!0),this.currentSlide>0&&(t.initialIndex=this.currentSlide),this.autoplay&&("string"==typeof this.autoplay&&(this.autoplay=parseInt(this.autoplay)),this.autoplay>0&&(t.autoPlay=this.autoplay));const i={on:{...this.options&&this.options.on?this.options.on:{},ready:()=>{setTimeout((()=>{this.nanoSlidesReady.emit()}),20)},select:this.handleSlideSelect,change:this.nanoSlidesChange.emit,scroll:this.nanoSlidesScroll.emit,settle:()=>requestAnimationFrame((()=>this.nanoSlidesTransitionEnd.emit())),dragStart:()=>requestAnimationFrame((()=>this.nanoSlidesDragStart.emit())),dragMove:()=>requestAnimationFrame((()=>this.nanoSlidesDragMove.emit())),dragEnd:()=>requestAnimationFrame((()=>this.nanoSlidesDragEnd.emit())),staticClick:this.nanoSlidesTap.emit,fullscreenChange:this.handleFullscreen}};return{...t,...i,...this.options}}componentDidLoad(){"undefined"!=typeof window&&window.MutationObserver&&(this.mutationO=new MutationObserver((t=>{t[0].addedNodes[0]&&t[0].addedNodes[0].nodeName.toLowerCase()===h("nano-slide")&&this.flickityReady&&this.update()}))).observe(this.host,{childList:!0,subtree:!0})}componentWillLoad(){this.nanoSlidesDidLoad.emit(),this.didInit||(this.didInit=!0,this.initflickity())}disconnectedCallback(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0),this.resizeO&&(this.resizeO.disconnect(),this.resizeO=void 0),this.destroyflickity()}render(){return c(o,{key:"4f3e88fcb168e5504c1cbb7649eb7233f235dff7",class:"nano-slides"},c("div",{key:"0c80e9c3b733ee41f6b06a473eeef9ab06eae1cd",class:{slideshow:!0,ready:this.ready,"not-ready":!this.ready},part:"base"},c("div",{key:"beae0495f2effa9d6bb5d6a093fd76b50bd3027e",ref:t=>this.flickityEl=t,class:{"flickity-container":!0,"slides-ready":this.slidesReady,"slides-not-ready":!this.slidesReady},part:"slide-container"},c("slot",{key:"89282a60c520a65e2155836ab66f698520b47721"})),c("div",{key:"fd3e6b6fb4d75ceb6002b389e63930d69965d304",class:"ui-extras"},c("slot",{key:"8dfacb9cc08a4fc13f998b9a97e5079640fe5ede",name:"ui"}))))}static get watchers(){return{options:["optionsChanged"],navbtns:["navbtnsChanged"],pager:["pagerChanged"],fullscreenbtn:["fullscreenBtnChanged"],fullscreen:["fullscreenChanged"],animation:["animationChange"],currentSlide:["currentSlideChange"],iCurrentSlide:["internalSlideChange"],autoplay:["autoPlayChange"]}}},q=t=>{const i=Array.from(t.querySelectorAll(h("nano-slide")));let s=i.filter((t=>!t.ready));return s.length?new Promise((n=>{const e=o=>{s=s.filter((t=>t!==o.target)),s.length||(n(i),t.removeEventListener("nanoSlideReady",e),t.removeEventListener("nano-slide-ready",e))};t.addEventListener("nanoSlideReady",e),t.addEventListener("nano-slide-ready",e)})):Promise.resolve(i)};X.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--dot-color:var(--nano-color-neutral-400);--dot-color-active:var(--nano-color-primary-1000);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:transparent;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:transparent;--navbtns-width:1.875rem;--navbtns-height:2.75rem;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:transparent;--flip-icon-ltr:0;--flip-icon-rtl:1;display:block;-webkit-user-select:none;user-select:none;overflow:hidden;transition:opacity 0.2s;opacity:0;max-inline-size:100vw}:host:dir(rtl){--flip-icon-ltr:1;--flip-icon-rtl:0}:host([ready]){opacity:1}.slideshow{max-block-size:100%;min-block-size:inherit;block-size:inherit;position:relative}.slideshow.not-ready{inline-size:100%;max-block-size:300px;overflow:hidden}.flickity-container{opacity:0;transition:opacity 0.2s;display:flex;inline-size:fit-content;block-size:fit-content}.not-ready .flickity-container{inline-size:fit-content;block-size:fit-content}.flickity-container.slides-ready{min-block-size:inherit;max-block-size:inherit;block-size:inherit;inline-size:auto}[hidden]{display:none !important}.ui-extras{pointer-events:none;position:absolute;block-size:100%;inline-size:100%;inset-block-start:0;inset-inline-start:0}.ui-extras *{pointer-events:all}/*! Flickity v2.2.1\nhttps://flickity.metafizzy.co\n---------------------------------------------- */.flickity-enabled{position:relative;opacity:1}.flickity-enabled:focus{outline:none}.flickity-viewport{overflow:hidden;position:relative;min-block-size:100%;flex:1}.flickity-slider{position:absolute;inline-size:100%;block-size:100%}.flickity-enabled.is-draggable{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.flickity-enabled.is-draggable .flickity-viewport{cursor:move;cursor:grab;cursor:grab}.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down{cursor:grabbing}.flickity-button{position:absolute;background:var(--navbtns-bg-color);border:none;color:#333;opacity:0.75}.flickity-button:hover{opacity:1;cursor:pointer}.flickity-button:focus{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}.flickity-button:active{opacity:0.6}.flickity-button:disabled{opacity:0.3;cursor:auto;pointer-events:none;background:var(--navbtns-bg-color-disabled)}.button-icon{display:block}.button-icon::after{content:"";display:block;background-size:cover;inline-size:var(--navbtns-width);block-size:var(--navbtns-height);background-color:var(--navbtns-icon-color);-webkit-mask-image:var(--nano-component-icon-chevron);mask-image:var(--nano-component-icon-chevron);transition:color var(--nano-transition-fast) ease;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;transform-origin:center;margin-inline-start:auto;rotate:calc(180deg * var(--flip-icon-ltr));-webkit-mask-size:cover;mask-size:cover}.button-icon--previous::after{rotate:calc(180deg * var(--flip-icon-rtl))}.flickity-button:disabled .button-icon::after{background-color:var(--navbtns-icon-color-disabled)}.flickity-prev-next-button{inset-block-start:50%;transform:translateY(-50%)}.flickity-prev-next-button.previous{inset-inline-start:10px}.flickity-prev-next-button.next{inset-inline-end:10px}.flickity-rtl .flickity-prev-next-button.previous{inset-inline:auto 10px}.flickity-rtl .flickity-prev-next-button.next{inset-inline:10px auto}.flickity-prev-next-button .flickity-button-icon{position:absolute;inset-inline-start:20%;inset-block-start:20%;inline-size:60%;block-size:60%}.flickity-page-dots{position:absolute;inline-size:100%;padding:0;margin:0;text-align:center;line-height:1;z-index:4;display:inline-flex;justify-content:center;inset-block-end:0}.flickity-rtl .flickity-page-dots{direction:rtl}.flickity-page-dots .dot{all:unset;text-indent:200%;white-space:nowrap;overflow:hidden;display:inline-block;display:inline-block;position:relative;inline-size:1.25rem;block-size:0.375rem;margin-block:0;cursor:pointer;padding:calc(var(--nano-spacing-md) / 2)}.flickity-page-dots .dot::after{content:"";position:absolute;inset:0;background:currentcolor;background:var(--dot-color);margin:calc(var(--nano-spacing-md) / 2)}.flickity-page-dots .dot:focus-visible{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset);z-index:1}.flickity-page-dots .dot.is-selected::after{background:var(--dot-color-active)}.flickity-enabled.is-fullscreen{position:fixed;inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;background:hsla(0, 0%, 0%, 0.9);padding-block-end:35px;z-index:100}.flickity-enabled.is-fullscreen .flickity-page-dots{inset-block-end:45px}html.is-flickity-fullscreen{overflow:hidden}.flickity-fullscreen-button{display:block;inset-inline-end:10px;inset-block-start:10px;inline-size:24px;block-size:24px;border-radius:4px;background:var(--fsbtn-bg-color);fill:var(--fsbtn-icon-color)}.flickity-rtl .flickity-fullscreen-button{inset-inline:10px auto}.flickity-fullscreen-button-exit{display:none}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-exit{display:block}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-view{display:none}.flickity-fullscreen-button .flickity-button-icon{position:absolute;inline-size:16px;block-size:16px;inset-inline-start:4px;inset-block-start:4px}.flickity-enabled.is-fade .flickity-slider>*{pointer-events:none;z-index:0}.flickity-enabled.is-fade .flickity-slider ::slotted(.is-selected){pointer-events:auto;z-index:1}';export{D as F,X as S,R as U,m as u}
|
22
|
+
function(){},O.onpointercancel=function(t){t.pointerId==this.pointerIdentifier&&this._pointerCancel(t,t)},O.ontouchcancel=function(t){const i=this.getTouch(t.changedTouches);i&&this._pointerCancel(t,i)},O._pointerCancel=function(t,i){this._pointerDone(),this.pointerCancel(t,i)},O.pointerCancel=function(t,i){this.emitEvent("pointerCancel",[t,i])},R.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};const B=N.prototype=Object.create(R.prototype);B.bindHandles=function(){this._bindHandles(!0)},B.unbindHandles=function(){this._bindHandles(!1)},B._bindHandles=function(t){const i=(t=void 0===t||t)?"addEventListener":"removeEventListener",s=t?this._touchActionValue:"";for(let n=0;n<this.handles.length;n++){const e=this.handles[n];this._bindStartEvent(e,t),e[i]("click",this),window.PointerEvent&&(e.style.touchAction=s)}},B._touchActionValue="none",B.pointerDown=function(t,i){this.okayPointerDown(t)&&(this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY},t.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,i]))};const I={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},W={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};B.okayPointerDown=function(t){const i=!I[t.target.nodeName]||W[t.target.type];return i||this._pointerReset(),i},B.pointerDownBlur=function(){const t=document.activeElement;t&&t.blur&&t!=document.body&&t.blur()},B.pointerMove=function(t,i){const s=this._dragPointerMove(t,i);this.emitEvent("pointerMove",[t,i,s]),this._dragMove(t,i,s)},B._dragPointerMove=function(t,i){const s={x:i.pageX-this.pointerDownPointer.pageX,y:i.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(s)&&this._dragStart(t,i),s},B.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3},B.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i]),this._dragPointerUp(t,i)},B._dragPointerUp=function(t,i){this.isDragging?this._dragEnd(t,i):this._staticClick(t,i)},B._dragStart=function(t,i){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(t,i)},B.dragStart=function(t,i){this.emitEvent("dragStart",[t,i])},B._dragMove=function(t,i,s){this.isDragging&&this.dragMove(t,i,s)},B.dragMove=function(t,i,s){t.preventDefault(),this.emitEvent("dragMove",[t,i,s])},B._dragEnd=function(t,i){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,i)},B.dragEnd=function(t,i){this.emitEvent("dragEnd",[t,i])},B.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},B._staticClick=function(t,i){this.isIgnoringMouseUp&&"mouseup"==t.type||(this.staticClick(t,i),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},B.staticClick=function(t,i){this.emitEvent("staticClick",[t,i])},N.getPointerPoint=R.getPointerPoint;const U=F;(()=>{m.extend(F.defaults,{draggable:">1",dragThreshold:3}),F.createMethods.push("_createDrag");const t=F.prototype;m.extend(t,N.prototype),t._touchActionValue="pan-y";const i="createTouch"in document;let s=!1;t._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable),i&&!s&&(window.addEventListener("touchmove",(function(){})),s=!0)},t.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},t.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},t.updateDraggable=function(){this.isDraggable=">1"==this.options.draggable?this.slides.length>1:this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},t.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},t.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},t._uiChangeDrag=function(){delete this.isFreeScrolling},t.pointerDown=function(t,i){this.isDraggable?this.okayPointerDown(t)&&(this._pointerDownPreventDefault(t),this.pointerDownFocus(t),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=e(),window.addEventListener("scroll",this),this._pointerDownDefault(t,i)):this._pointerDownDefault(t,i)},t._pointerDownDefault=function(t,i){this.pointerDownPointer={pageX:i.pageX,pageY:i.pageY},this._bindPostStartEvents(t),this.dispatchEvent("pointerDown",t,[i])};const n={INPUT:!0,TEXTAREA:!0,SELECT:!0};function e(){return{x:window.scrollX,y:window.scrollY}}t.pointerDownFocus=function(t){n[t.target.nodeName]||this.focus()},t._pointerDownPreventDefault=function(t){"touchstart"==t.type||"touch"==t.pointerType||n[t.target.nodeName]||t.preventDefault()},t.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold},t.pointerUp=function(t,i){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",t,[i]),this._dragPointerUp(t,i)},t.pointerDone=function(){window.removeEventListener("scroll",this),delete this.pointerDownScroll},t.dragStart=function(t,i){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),window.removeEventListener("scroll",this),this.dispatchEvent("dragStart",t,[i]))},t.pointerMove=function(t,i){const s=this._dragPointerMove(t,i);this.dispatchEvent("pointerMove",t,[i,s]),this._dragMove(t,i,s)},t.dragMove=function(t,i,s){if(!this.isDraggable)return;t.preventDefault(),this.previousDragX=this.dragX;const n=this.options.rightToLeft?-1:1;this.options.wrapAround&&(s.x=s.x%this.slideableWidth);let e=this.dragStartPosition+s.x*n;if(!this.options.wrapAround&&this.slides.length){const t=Math.max(-this.slides[0].target,this.dragStartPosition);e=e>t?.5*(e+t):e;const i=Math.min(-this.getLastSlide().target,this.dragStartPosition);e=e<i?.5*(e+i):e}this.dragX=e,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",t,[i,s])},t.dragEnd=function(t,i){if(!this.isDraggable)return;this.options.freeScroll&&(this.isFreeScrolling=!0);let s=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){const t=this.getRestingPosition();this.isFreeScrolling=-t>this.slides[0].target&&-t<this.getLastSlide().target}else this.options.freeScroll||s!=this.selectedIndex||(s+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(s),delete this.isDragSelect,this.dispatchEvent("dragEnd",t,[i])},t.dragEndRestingSelect=function(){const t=this.getRestingPosition(),i=Math.abs(this.getSlideDistance(-t,this.selectedIndex)),s=this._getClosestResting(t,i,1),n=this._getClosestResting(t,i,-1);return s.distance<n.distance?s.index:n.index},t._getClosestResting=function(t,i,s){let n=this.selectedIndex,e=1/0;const o=this.options.contain&&!this.options.wrapAround?function(t,i){return t<=i}:function(t,i){return t<i};for(;o(i,e)&&(n+=s,e=i,null!==(i=this.getSlideDistance(-t,n)));)i=Math.abs(i);return{distance:e,index:n-s}},t.getSlideDistance=function(t,i){const s=this.slides.length,n=this.options.wrapAround&&s>1,e=n?m.modulo(i,s):i,o=this.slides[e];if(!o)return null;const h=n?this.slideableWidth*Math.floor(i/s):0;return t-(o.target+h)},t.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;const t=this.getSlideDistance(-this.dragX,this.selectedIndex),i=this.previousDragX-this.dragX;return t>0&&i>0?1:t<0&&i<0?-1:0},t.staticClick=function(t,i){const s=this.getParentCell(t.target),n=s&&s.element,e=s&&this.cells.indexOf(s);this.dispatchEvent("staticClick",t,[i,n,e])},t.onscroll=function(){const t=e(),i=this.pointerDownScroll.y-t.y;(Math.abs(this.pointerDownScroll.x-t.x)>3||Math.abs(i)>3)&&this._pointerDone()}})(),(()=>{function t(t,i){this.direction=t,this.parent=i,this.parentElement=this.parent.element.shadowRoot||this.parent.element,this._create()}(t.prototype=Object.create(R.prototype))._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction,this.isLeft=this.direction==(this.parent.options.rightToLeft?1:-1);const t=this.element=document.createElement("button");t.className="flickity-button flickity-prev-next-button",t.part.add("navigation-button"),this.isPrevious?(t.classList.add("previous"),t.part.add("navigation-button--previous")):(t.classList.add("next"),t.part.add("navigation-button--next")),t.setAttribute("type","button"),this.disable(),t.setAttribute("aria-label",this.isPrevious?"Previous":"Next");const i=document.createElement("slot");i.name=this.isPrevious?"previous-icon":"next-icon",t.appendChild(i),i.addEventListener("slotchange",(()=>{i.assignedElements({flatten:!0}).forEach((t=>{t.removeAttribute("hidden")}))}));const s=document.createElement("span");s.className="button-icon "+(this.isPrevious?"button-icon--previous":"button-icon--next"),s.part.add("navigation-icon"),i.appendChild(s),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},t.prototype.activate=function(){this.bindStartEvent(this.element),this.element.addEventListener("click",this),this.parentElement.appendChild(this.element)},t.prototype.deactivate=function(){this.parentElement.removeChild(this.element),this.unbindStartEvent(this.element),this.element.removeEventListener("click",this)},t.prototype.handleEvent=m.handleEvent,t.prototype.onclick=function(){this.isEnabled&&(this.parent.uiChange(),this.parent[this.isPrevious?"previous":"next"]())},t.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},t.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},t.prototype.update=function(){const t=this.parent.slides;this.parent.options.wrapAround&&t.length>1?this.enable():this[this.parent.selectedIndex==(this.isPrevious?0:t.length?t.length-1:0)?"disable":"enable"]()},t.prototype.destroy=function(){this.deactivate(),this.allOff()},m.extend(F.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),F.createMethods.push("_createPrevNextButtons");const i=F.prototype;i._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new t(-1,this),this.nextButton=new t(1,this),this.on("activate",this.activatePrevNextButtons))},i.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},i.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},F.PrevNextButton=t})(),(()=>{function t(t){this.parent=t,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}(t.prototype=Object.create(r.prototype)).play=function(){"playing"!=this.state&&(document.hidden?document.addEventListener("visibilitychange",this.onVisibilityPlay):(this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()))},t.prototype.tick=function(){if("playing"!=this.state)return;let t=this.parent.options.autoPlay;t="number"==typeof t?t:3e3;const i=this;this.clear(),this.timeout=setTimeout((function(){i.parent.next(!0),i.tick()}),t)},t.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},t.prototype.clear=function(){clearTimeout(this.timeout)},t.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},t.prototype.unpause=function(){"paused"==this.state&&this.play()},t.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},t.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},m.extend(F.defaults,{pauseAutoPlayOnHover:!0}),F.createMethods.push("_createPlayer");const i=F.prototype;i._createPlayer=function(){this.player=new t(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},i.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},i.playPlayer=function(){this.player.play()},i.stopPlayer=function(){this.player.stop()},i.pausePlayer=function(){this.player.pause()},i.unpausePlayer=function(){this.player.unpause()},i.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},i.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},i.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},F.Player=t})();const _=class{constructor(s){t(this,s),this.nanoSlidesDidLoad=i(this,"nanoSlidesDidLoad",7),this.nanoSlidesReady=i(this,"nanoSlidesReady",7),this.nanoSlidesSelect=i(this,"nanoSlidesSelect",7),this.nanoSlidesChange=i(this,"nanoSlidesChange",7),this.nanoSlidesScroll=i(this,"nanoSlidesScroll",7),this.nanoSlidesTransitionEnd=i(this,"nanoSlidesTransitionEnd",7),this.nanoSlidesDragStart=i(this,"nanoSlidesDragStart",7),this.nanoSlidesDragMove=i(this,"nanoSlidesDragMove",7),this.nanoSlidesDragEnd=i(this,"nanoSlidesDragEnd",7),this.nanoSlidesTap=i(this,"nanoSlidesTap",7),this.nanoSlidesFullscreenChange=i(this,"nanoSlidesFullscreenChange",7)}flickityEl;flickityReady=!1;mutationO;resizeO;readyflickity;flickity=new Promise((t=>{this.readyflickity=t}));syncflickity;childrenEles;hasFullScreenModule=!1;hasLazyLoadModule=!1;hasDotsModule=!1;hasFadeModule=!1;iCurrentSlide;slidesReady;didInit=!1;get host(){return s(this)}options={};async optionsChanged(){if(this.flickityReady){const t=await this.getflickity(),i=Object.assign(t.options,this.options);await this.loadFlickityModules(i),await this.update()}}navbtns=!1;async navbtnsChanged(){Array.from(this._getRoot().querySelectorAll(".flickity-prev-next-button")).forEach((t=>{t.hidden=!this.navbtns}))}pager=!1;async pagerChanged(){const t=this._getRoot().querySelector(".flickity-page-dots");t&&(t.hidden=!this.pager)}fullscreenbtn=!1;async fullscreenBtnChanged(){const t=this._getRoot().querySelector(".flickity-fullscreen-button");t&&(t.hidden=!this.fullscreenbtn)}fullscreen=!1;async fullscreenChanged(t,i){const s=await this.getflickity();this.fullscreen?s.viewFullscreen():void 0!==i&&s.exitFullscreen()}animation="scroll";async animationChange(t,i){const[s,n]=await Promise.all([this.getflickity(),X(this.host)]);if(n.forEach((t=>{t.style.left=void 0})),"parallax"===i&&(s.off("scroll",this.parallax),n.forEach(((t,i)=>{this.childrenEles&&this.childrenEles[i]&&(this.childrenEles[i].style.transform=void 0)})),this.update()),"function"==typeof i&&s.off("scroll",i),"function"==typeof this.animation)return this.options={fade:!1,percentPosition:!0},void s.on("scroll",this.animation);switch(this.animation){case"fade":this.options={fade:!0,percentPosition:!0};break;case"parallax":this.options={fade:!1,percentPosition:!0},s.on("scroll",this.parallax);break;default:this.options={fade:!1,percentPosition:!0}}}currentSlide=0;currentSlideChange(){this.currentSlide!==this.iCurrentSlide&&this.slideTo(this.currentSlide)}internalSlideChange(){this.currentSlide=this.iCurrentSlide}autoplay=!1;async autoPlayChange(){await this.stopAutoplay(),this.autoplay&&("string"==typeof this.autoplay&&(this.autoplay=parseInt(this.autoplay)),this.autoplay>0&&this.startAutoplay(this.autoplay))}ready=!1;nanoSlidesDidLoad;nanoSlidesReady;nanoSlidesSelect;nanoSlidesChange;nanoSlidesScroll;nanoSlidesTransitionEnd;nanoSlidesDragStart;nanoSlidesDragMove;nanoSlidesDragEnd;nanoSlidesTap;nanoSlidesFullscreenChange;async update(){const[t]=await Promise.all([this.getflickity(),X(this.host)]);this.childrenEles=this.host.querySelectorAll(`${h("nano-slide")} > *`),t.reloadCells(),t.resize(),t.reposition()}async slideTo(t,i){(await this.getflickity()).select(t,i)}async slideNext(t,i){(await this.getflickity()).next(i,t)}async slidePrev(t,i){(await this.getflickity()).previous(t,i)}async getActiveIndex(){return(await this.getflickity()).selectedIndex}async length(){return(await this.getflickity()).slides.length}async isEnd(){const t=await this.getflickity();return t.selectedIndex===t.slides.length-1}async isBeginning(){return 0===(await this.getflickity()).selectedIndex}async startAutoplay(t){const i=await this.getflickity();t&&(this.options={autoPlay:t}),setTimeout((()=>i.playPlayer()))}async stopAutoplay(){(await this.getflickity()).stopPlayer()}async lockSwipes(t){const i=await this.getflickity();i.options.draggable=!t,i.updateDraggable()}async getflickity(){return this.flickity}async reload(){this.destroyflickity(),setTimeout((()=>this.initflickity()),20)}_getRoot(){return this.host.shadowRoot?this.host.shadowRoot:this.host}parallax=async()=>{const t=await this.flickity;t.cells.forEach((i=>{let s=t.x;var n;t.options.wrapAround&&t.cells.length>1&&(s=(s%(n=t.slideableWidth)+n)%n,s-=t.slideableWidth);let e=-1*(i.target+s)/3;i.shift<0?e=-1*(i.target-t.slideableWidth+s)/3:i.shift>0&&(e=-1*(i.target+(s+t.slideableWidth))/3),i.element.children[0].style.transform="translate3d("+e+"px, 0, 0)",i.element.style.setProperty("--animation-amount",(3*e/i.size.width*100).toString())}))};handleFullscreen=t=>{this.fullscreen=t,this.nanoSlidesFullscreenChange.emit(t)};handleSlideSelect=t=>{this.iCurrentSlide=t,this.nanoSlidesSelect.emit(t)};destroyflickity(){const t=this.syncflickity;void 0!==t&&(t.destroy(),this.flickity=new Promise((t=>{this.readyflickity=t})),this.flickityReady=!1,this.syncflickity=void 0,this.ready=!1),this.didInit=!1}async loadFlickityModules(t){!this.hasFullScreenModule&&t.fullscreen&&(await import("./fullscreen-CiMUnO6C.js"),this.hasFullScreenModule=!0),!this.hasLazyLoadModule&&t.lazyLoad&&(await import("./lazyload-DBW-FOzX.js"),this.hasLazyLoadModule=!0),!this.hasDotsModule&&t.pageDots&&(await import("./page-dots-B5aFjE5U.js"),this.hasDotsModule=!0),!this.hasFadeModule&&t.fade&&(await import("./fade-Dt3mCRd5.js"),this.hasFadeModule=!0)}async initflickity(){const t=this.normalizeOptions();await this.loadFlickityModules(t),await X(this.host),this.flickityEl=this.flickityEl||this._getRoot().querySelector(".flickity-container"),this.flickityEl&&(this.slidesReady=!0,this.flickityEl.classList.contains("flickity-enabled")&&this.destroyflickity(),this.flickityEl.style.height=this.flickityEl.getBoundingClientRect().height+"px",setTimeout((()=>{this.flickityEl.style.height="";const i=new U(this.flickityEl,t);this.flickityReady=!0,this.syncflickity=i,this.animationChange(),this.navbtnsChanged(),this.pagerChanged(),this.fullscreenChanged(),this.fullscreenBtnChanged(),this.readyflickity(i),this.ready=!0,window.ResizeObserver&&(this.resizeO&&(this.resizeO.disconnect(),this.resizeO=void 0),(this.resizeO=new ResizeObserver((()=>{n((()=>{const t=this.host.shadowRoot.querySelector(".flickity-viewport");e((()=>{t&&(t.style.height=""),i.resize()}))}))}))).observe(this.host))}),100))}normalizeOptions(){const t={cellSelector:h("nano-slide"),contain:!0,prevNextButtons:!0,fullscreen:this.fullscreen,accessibility:!0,imagesLoaded:!0,pageDots:this.pager};"fade"===this.animation&&(t.fade=!0),this.currentSlide>0&&(t.initialIndex=this.currentSlide),this.autoplay&&("string"==typeof this.autoplay&&(this.autoplay=parseInt(this.autoplay)),this.autoplay>0&&(t.autoPlay=this.autoplay));const i={on:{...this.options&&this.options.on?this.options.on:{},ready:()=>{setTimeout((()=>{this.nanoSlidesReady.emit()}),20)},select:this.handleSlideSelect,change:this.nanoSlidesChange.emit,scroll:this.nanoSlidesScroll.emit,settle:()=>requestAnimationFrame((()=>this.nanoSlidesTransitionEnd.emit())),dragStart:()=>requestAnimationFrame((()=>this.nanoSlidesDragStart.emit())),dragMove:()=>requestAnimationFrame((()=>this.nanoSlidesDragMove.emit())),dragEnd:()=>requestAnimationFrame((()=>this.nanoSlidesDragEnd.emit())),staticClick:this.nanoSlidesTap.emit,fullscreenChange:this.handleFullscreen}};return{...t,...i,...this.options}}componentDidLoad(){"undefined"!=typeof window&&window.MutationObserver&&(this.mutationO=new MutationObserver((t=>{t[0].addedNodes[0]&&t[0].addedNodes[0].nodeName.toLowerCase()===h("nano-slide")&&this.flickityReady&&this.update()}))).observe(this.host,{childList:!0,subtree:!0})}componentWillLoad(){this.nanoSlidesDidLoad.emit(),this.didInit||(this.didInit=!0,this.initflickity())}disconnectedCallback(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0),this.resizeO&&(this.resizeO.disconnect(),this.resizeO=void 0),this.destroyflickity()}render(){return c(o,{key:"4f3e88fcb168e5504c1cbb7649eb7233f235dff7",class:"nano-slides"},c("div",{key:"0c80e9c3b733ee41f6b06a473eeef9ab06eae1cd",class:{slideshow:!0,ready:this.ready,"not-ready":!this.ready},part:"base"},c("div",{key:"beae0495f2effa9d6bb5d6a093fd76b50bd3027e",ref:t=>this.flickityEl=t,class:{"flickity-container":!0,"slides-ready":this.slidesReady,"slides-not-ready":!this.slidesReady},part:"slide-container"},c("slot",{key:"89282a60c520a65e2155836ab66f698520b47721"})),c("div",{key:"fd3e6b6fb4d75ceb6002b389e63930d69965d304",class:"ui-extras"},c("slot",{key:"8dfacb9cc08a4fc13f998b9a97e5079640fe5ede",name:"ui"}))))}static get watchers(){return{options:["optionsChanged"],navbtns:["navbtnsChanged"],pager:["pagerChanged"],fullscreenbtn:["fullscreenBtnChanged"],fullscreen:["fullscreenChanged"],animation:["animationChange"],currentSlide:["currentSlideChange"],iCurrentSlide:["internalSlideChange"],autoplay:["autoPlayChange"]}}},X=t=>{const i=Array.from(t.querySelectorAll(h("nano-slide")));let s=i.filter((t=>!t.ready));return s.length?new Promise((n=>{const e=o=>{s=s.filter((t=>t!==o.target)),s.length||(n(i),t.removeEventListener("nanoSlideReady",e),t.removeEventListener("nano-slide-ready",e))};t.addEventListener("nanoSlideReady",e),t.addEventListener("nano-slide-ready",e)})):Promise.resolve(i)};_.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--dot-color:var(--nano-color-neutral-400);--dot-color-active:var(--nano-color-primary-1000);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:transparent;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:transparent;--navbtns-width:1.875rem;--navbtns-height:2.75rem;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:transparent;--flip-icon-ltr:0;--flip-icon-rtl:1;display:block;-webkit-user-select:none;user-select:none;overflow:hidden;transition:opacity 0.2s;opacity:0;max-inline-size:100vw}:host:dir(rtl){--flip-icon-ltr:1;--flip-icon-rtl:0}:host([ready]){opacity:1}.slideshow{max-block-size:100%;min-block-size:inherit;block-size:inherit;position:relative}.slideshow.not-ready{inline-size:100%;max-block-size:300px;overflow:hidden}.flickity-container{opacity:0;transition:opacity 0.2s;display:flex;inline-size:fit-content;block-size:fit-content}.not-ready .flickity-container{inline-size:fit-content;block-size:fit-content}.flickity-container.slides-ready{min-block-size:inherit;max-block-size:inherit;block-size:inherit;inline-size:auto}[hidden]{display:none !important}.ui-extras{pointer-events:none;position:absolute;block-size:100%;inline-size:100%;inset-block-start:0;inset-inline-start:0}.ui-extras *{pointer-events:all}/*! Flickity v2.2.1\nhttps://flickity.metafizzy.co\n---------------------------------------------- */.flickity-enabled{position:relative;opacity:1}.flickity-enabled:focus{outline:none}.flickity-viewport{overflow:hidden;position:relative;min-block-size:100%;flex:1}.flickity-slider{position:absolute;inline-size:100%;block-size:100%}.flickity-enabled.is-draggable{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.flickity-enabled.is-draggable .flickity-viewport{cursor:move;cursor:grab;cursor:grab}.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down{cursor:grabbing}.flickity-button{position:absolute;background:var(--navbtns-bg-color);border:none;color:#333;opacity:0.75}.flickity-button:hover{opacity:1;cursor:pointer}.flickity-button:focus{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}.flickity-button:active{opacity:0.6}.flickity-button:disabled{opacity:0.3;cursor:auto;pointer-events:none;background:var(--navbtns-bg-color-disabled)}.button-icon{display:block}.button-icon::after{content:"";display:block;background-size:cover;inline-size:var(--navbtns-width);block-size:var(--navbtns-height);background-color:var(--navbtns-icon-color);-webkit-mask-image:var(--nano-component-icon-chevron);mask-image:var(--nano-component-icon-chevron);transition:color var(--nano-transition-fast) ease;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;transform-origin:center;margin-inline-start:auto;rotate:calc(180deg * var(--flip-icon-ltr));-webkit-mask-size:cover;mask-size:cover}.button-icon--previous::after{rotate:calc(180deg * var(--flip-icon-rtl))}.flickity-button:disabled .button-icon::after{background-color:var(--navbtns-icon-color-disabled)}.flickity-prev-next-button{inset-block-start:50%;transform:translateY(-50%)}.flickity-prev-next-button.previous{inset-inline-start:10px}.flickity-prev-next-button.next{inset-inline-end:10px}.flickity-rtl .flickity-prev-next-button.previous{inset-inline:auto 10px}.flickity-rtl .flickity-prev-next-button.next{inset-inline:10px auto}.flickity-prev-next-button .flickity-button-icon{position:absolute;inset-inline-start:20%;inset-block-start:20%;inline-size:60%;block-size:60%}.flickity-page-dots{position:absolute;inline-size:100%;padding:0;margin:0;text-align:center;line-height:1;z-index:4;display:inline-flex;justify-content:center;inset-block-end:0}.flickity-rtl .flickity-page-dots{direction:rtl}.flickity-page-dots .dot{all:unset;text-indent:200%;white-space:nowrap;overflow:hidden;display:inline-block;display:inline-block;position:relative;inline-size:1.25rem;block-size:0.375rem;margin-block:0;cursor:pointer;padding:calc(var(--nano-spacing-md) / 2)}.flickity-page-dots .dot::after{content:"";position:absolute;inset:0;background:currentcolor;background:var(--dot-color);margin:calc(var(--nano-spacing-md) / 2)}.flickity-page-dots .dot:focus-visible{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset);z-index:1}.flickity-page-dots .dot.is-selected::after{background:var(--dot-color-active)}.flickity-enabled.is-fullscreen{position:fixed;inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;background:hsla(0, 0%, 0%, 0.9);padding-block-end:35px;z-index:100}.flickity-enabled.is-fullscreen .flickity-page-dots{inset-block-end:45px}html.is-flickity-fullscreen{overflow:hidden}.flickity-fullscreen-button{display:block;inset-inline-end:10px;inset-block-start:10px;inline-size:24px;block-size:24px;border-radius:4px;background:var(--fsbtn-bg-color);fill:var(--fsbtn-icon-color)}.flickity-rtl .flickity-fullscreen-button{inset-inline:10px auto}.flickity-fullscreen-button-exit{display:none}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-exit{display:block}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-view{display:none}.flickity-fullscreen-button .flickity-button-icon{position:absolute;inline-size:16px;block-size:16px;inset-inline-start:4px;inset-block-start:4px}.flickity-enabled.is-fade .flickity-slider>*{pointer-events:none;z-index:0}.flickity-enabled.is-fade .flickity-slider ::slotted(.is-selected){pointer-events:auto;z-index:1}';export{F,_ as S,R as U,m as u}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
export{S as nano_slides}from"./nano-slides-
|
4
|
+
export{S as nano_slides}from"./nano-slides-BH9wpDRh.js";import"./index-CDb2_YWF.js";import"./renderer-CGoibSOJ.js";
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import{g as t,d as e,e as i,r as s,c as h,a as r}from"./index-q0XK-YfO.js";import{h as o}from"./renderer-BjGZGWn8.js";import{d as n}from"./drag-BLOEuv-q.js";import{d as a}from"./throttle-C93FMm2Z.js";import{a as d}from"./events-ClRFmcmJ.js";const l={horizontal:{x:1,y:0},vertical:{x:0,y:1}};let c=0;const m=class{itemSelector="li";handleItemSelectorChange(){this.refreshKeyboardHandles()}handleSelector;handleHandleSelectorChange(){this.refreshKeyboardHandles(),this.attachMutationObserver()}dropzoneSelector;helperText='Press "Space" or "Enter" to enable element reordering and use the arrow keys to reorder items.Press "Escape" to cancel reordering. Alternatively, use your mouse to drag / reorder.';itemDescriptor=t=>`"${t?.textContent.trim()}"`;grabbedHelperText=t=>`${this.itemDescriptor(t)} grabbed`;droppedHelperText=t=>`${this.itemDescriptor(t)} dropped`;reorderHelperText=(t,e,i)=>`The list has been reordered, ${this.itemDescriptor(t)} is now item ${i} of ${e.length}`;createKeyboardHandle=(t,e)=>{const i=document.createElement("div");i.innerHTML='\n <nano-icon-button\n slot="end"\n icon-name="light/arrows-up-down-left-right"\n class="nano-sortable__keyboard-handle visually-hidden"\n label="Re-order this item"\n ></nano-icon-button>';const s=i.children[0];return e.append(s),s};handleCreateKeyboardHandleChange(){this.refreshKeyboardHandles()}sortableHostElement;handleSortableHostElement(t,e){e&&this.removeEventHandlers(e),this.addEventHandlers(),this.refreshKeyboardHandles(),this.attachMutationObserver(),this.sortableHostElement&&(this.sortableHostElement.style.position="relative")}animationEnabled=!0;draggedClass="nano-sortable__dragged";handleDraggedClass="nano-sortable__handle-dragged";placeholderClass="nano-sortable__placeholder";dropzoneActiveClass="";animationTiming={duration:200,easing:"ease-out"};orientation;dragResize=!1;nanoOrderChange;nanoGrabbed;nanoDropped;async refreshKeyboardHandles(){if(this.handleSelector)return this.keyboardHandleMap?.size&&this.keyboardHandleMap.clear(),void this.sortableHost.querySelectorAll(this.handleSelector).forEach((t=>{t.getAttribute("aria-describedby")||t.setAttribute("aria-describedby",this.sortableId);const e=t.closest(this.itemSelector);e&&this.keyboardHandleMap.set(t,e)}));this.keyboardHandleMap?.size&&(this.keyboardHandleMap?.forEach(((t,e)=>e.remove())),this.keyboardHandleMap.clear()),this.sortableHost.querySelectorAll(this.itemSelector).forEach(((t,e)=>{const i=this.createKeyboardHandle(e,t);i?(this.keyboardHandleMap.set(i,t),i.setAttribute("aria-describedby",this.sortableId)):console.error("`createKeyboardHandle` *must* return the handle element it creates")}))}get host(){return t(this)}dragRequestPending=!1;draggedElement;draggedElementClone;draggedElementOrigin;sortableNodes=[];dropzoneNodes=[];animatedElements=[];animationPromise;keyboardHandleMap=new Map;sortableId="nano-sortable-"+c++;mouseDownTimer;mutationObserver;keyboardSortActive=!1;ariaTextList=[];get sortableHost(){return this.sortableHostElement?this.sortableHostElement:this.host}addAriaMsg(t){this.ariaTextList=[...this.ariaTextList,t],setTimeout((()=>{const e=this.ariaTextList.indexOf(t);this.ariaTextList.splice(e,1),this.ariaTextList=[...this.ariaTextList]}),1e4)}updateUserSelectStyle(t){this.host.style.userSelect=t}hitTest(t,e){const{left:i,top:s,width:h,height:r}=t.getBoundingClientRect(),o=i+h/2,n=s+r/2;return e.filter((t=>{const{left:e,right:i,top:s,bottom:h}=t.getBoundingClientRect();return!(o<e||o>i||n<s||n>h)}))}isAnimating(t){return-1!==this.animatedElements.indexOf(t)}animateNode(t,i=0,s=0){t.animate&&(this.animatedElements.push(t),t.style.willChange="transform",e((()=>{this.animationPromise=new Promise((e=>{t.animate([{transform:`translate3d(${i}px, ${s}px, 0)`},{transform:"none"}],this.animationTiming).addEventListener("finish",(()=>{const i=this.animatedElements.indexOf(t);t.style.willChange="",-1!==i&&this.animatedElements.splice(i,1),e(),delete this.animationPromise}),{once:!0})}))})))}insertAtTarget(t,e){if(!t||!e)return;let i=[];if(this.animationEnabled&&(i=this.sortableNodes.map((t=>({x:t.offsetLeft,y:t.offsetTop})))),t.isConnected&&e.isConnected){if(this.dropzoneNodes.indexOf(e)>-1)e.append(t);else{const i=t.compareDocumentPosition(e);let s;i&this.host.DOCUMENT_POSITION_FOLLOWING&&(s=e.parentNode===t.parentNode?"afterend":"beforebegin"),i&this.host.DOCUMENT_POSITION_PRECEDING&&(s=e.parentNode===t.parentNode?"beforebegin":"afterend"),s&&e.insertAdjacentElement(s,t)}this.animationEnabled&&this.sortableNodes.forEach(((t,e)=>{const{x:s,y:h}=i[e],r=s-t.offsetLeft,o=h-t.offsetTop;0===r&&0===o||this.animateNode(t,r,o)}))}}reset(){void 0!==this.draggedElementClone&&null!==this.draggedElementClone.parentNode&&this.draggedElementClone.parentNode.removeChild(this.draggedElementClone),this.draggedElement&&this.draggedElement.parentNode&&this.draggedElementOrigin&&this.draggedElement.classList.remove(this.placeholderClass),this.dropzoneActiveClass&&this.dropzoneNodes.length&&this.dropzoneNodes.forEach((t=>t.classList.remove(this.dropzoneActiveClass))),delete this.draggedElementClone,delete this.draggedElement,this.dropzoneNodes=[],this.sortableNodes=[],this.animatedElements=[],this.dragRequestPending=!1,this.updateUserSelectStyle("")}createClone(t){const e=t.cloneNode(!0);t.id&&(e.id="clone__"+e.id),Array.from(e.children).forEach(((e,i)=>{const s=e,h=t.children.item(i);h&&(s.style.width=`${h.offsetWidth}px`)}));const{offsetLeft:i,offsetTop:s,offsetWidth:h,offsetHeight:r}=t;return Object.assign(e.style,{position:"absolute",left:`calc(${i}px - var(--grab-offset-x, 0px))`,top:`calc(${s}px - var(--grab-offset-y, 0px))`,height:this.dragResize?`${r}px`:void 0,width:this.dragResize?`${h}px`:void 0,willChange:"transform,opacity"}),e.classList.add(this.draggedClass),t.parentNode.appendChild(e)}removeEventHandlers(t){(t=t||this.sortableHost).removeEventListener("mousedown",this.handleTrack),t.removeEventListener("touchstart",this.handleTrack),t.removeEventListener("keydown",this.handleKeydown)}addEventHandlers(t){d(t=t||this.sortableHost,"mousedown touchstart",this.handleTrack,{passive:!0}),t.addEventListener("keydown",this.handleKeydown)}attachMutationObserver(){this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0),this.mutationObserver=new MutationObserver((()=>{const t=Array.from(this.keyboardHandleMap.values()),e=Array.from(this.sortableHost.querySelectorAll(this.itemSelector));(t.length!==e.length||e.find((e=>!t.includes(e))))&&this.refreshKeyboardHandles()})),this.mutationObserver.observe(this.sortableHost,{subtree:!0,childList:!0})}handleKeydown(t){const e=t.target;let i,s;if(console.log("yooo",t.key),this.handleSelector?(i=e.closest(this.handleSelector),s=e.closest(this.itemSelector)):(s=this.keyboardHandleMap.get(e),i=e),!i||!s)return;const h=t=>{this.keyboardSortActive=t,this.draggedElement=t?s:void 0,s.classList.toggle(this.draggedClass,t),i.classList.toggle(this.handleDraggedClass,t),t?(this.addAriaMsg(this.grabbedHelperText(s)),document.addEventListener("mousedown",(()=>h(!1)),{once:!0})):this.addAriaMsg(this.droppedHelperText(s))};if([" ","Space","Enter"].includes(t.key)){if(t.preventDefault(),this.keyboardSortActive)h(!1),this.nanoDropped.emit({element:s});else if(h(!0),this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],this.nanoGrabbed.emit({element:s,index:this.sortableNodes.indexOf(s)}).defaultPrevented)return void h(!1);return}if(!this.keyboardSortActive)return;["Escape","Tab"].includes(t.key)&&h(!1);let r=["Home","End"];if(this.orientation&&"horizontal"!==this.orientation||(r=[...r,"ArrowRight","ArrowLeft"]),this.orientation&&"vertical"!==this.orientation||(r=[...r,"ArrowUp","ArrowDown"]),!r.includes(t.key))return;t.preventDefault(),this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[];const o=this.sortableNodes.indexOf(this.draggedElement);let n=-1;if(this.dropzoneNodes.length){const t=this.draggedElement.closest(this.dropzoneSelector);n=this.dropzoneNodes.indexOf(t),n=n>-1?n:-1}const a=o-1<0&&n>-1?this.dropzoneNodes[n-1]:this.sortableNodes[o-1],d=o+1===this.sortableNodes.length&&n>-1?this.dropzoneNodes[n+1]:this.sortableNodes[o+1];"Home"===t.key&&this.insertAtTarget(this.draggedElement,this.sortableNodes[0]),"End"===t.key&&this.insertAtTarget(this.draggedElement,this.sortableNodes[this.sortableNodes.length-1]),["ArrowRight","ArrowDown"].includes(t.key)&&this.insertAtTarget(this.draggedElement,d),["ArrowLeft","ArrowUp"].includes(t.key)&&this.insertAtTarget(this.draggedElement,a),this.finishOrder(),this.draggedElement=s;const l=()=>{requestAnimationFrame((()=>{"function"==typeof i.setFocus?i.setFocus():i.focus()}))};this.animationPromise?this.animationPromise.then((()=>l())):l()}handleTrack(t){if(this.dragRequestPending||t.button&&1!==t.button)return;const e=t=>{t.cancelable&&t.preventDefault(),clearTimeout(this.mouseDownTimer)},i=()=>{clearTimeout(this.mouseDownTimer),document.removeEventListener("touchmove",e),document.removeEventListener("contextmenu",this.finishOrder)};i(),this.mouseDownTimer=window?.setTimeout((()=>{this.trackStart(t)&&(document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("contextmenu",this.finishOrder),this.addAriaMsg(this.grabbedHelperText(this.draggedElement)),n(this.sortableHost,{initialEvent:t,relative:!0,onMove:(t,e)=>{this.trackMove(t,e)},onStop:()=>{this.nanoDropped.emit({element:this.draggedElement}),i();const t=()=>{this.addAriaMsg(this.droppedHelperText(this.draggedElement)),requestAnimationFrame((()=>this.finishOrder()))};this.animationPromise?this.animationPromise.then((()=>t())):t()}}))}),150),d(document,"mouseup touchend touchmove",(()=>clearTimeout(this.mouseDownTimer)),{once:!0})}trackStart(t){const e=t.target;let i;if(this.handleSelector){if(i=e.closest(this.handleSelector),!i)return;i.classList.add(this.handleDraggedClass)}const s=e.closest(this.itemSelector);return!!s&&(this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],!this.nanoGrabbed.emit({element:s,index:this.sortableNodes.indexOf(s)}).defaultPrevented&&(t.preventDefault(),this.updateUserSelectStyle("none"),this.dragRequestPending=!0,this.draggedElement=s,this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[],this.draggedElementClone=this.createClone(s),this.draggedElementOrigin=s.nextSibling,this.animatedElements=[],this.draggedElement.classList.add(this.placeholderClass),!0))}finishOrder=()=>{if(!this.draggedElement)return;const t=Array.from(this.sortableHost.querySelectorAll(this.itemSelector)).filter((t=>t!==this.draggedElementClone)),e=this.sortableNodes.indexOf(this.draggedElement),i=t.indexOf(this.draggedElement);if(this.handleSelector&&this.draggedElement.querySelector(this.handleSelector).classList.remove(this.handleDraggedClass),e!==i){if(this.nanoOrderChange.emit({element:this.draggedElement,originalIndex:e,targetIndex:i}).defaultPrevented)return void(this.animationPromise=new Promise((i=>{setTimeout((()=>{this.insertAtTarget(this.draggedElement,t[e]),this.reset(),this.dragRequestPending=!1,i()}),200)})));this.addAriaMsg(this.reorderHelperText(this.draggedElement,t,i+1))}this.reset(),this.dragRequestPending=!1};trackMove=(t,s)=>{if(!this.draggedElementClone)return;this.orientation&&(t*=l[this.orientation].x,s*=l[this.orientation].y),e((()=>{Object.assign(this.draggedElementClone.style,{transform:`translate3d(${t}px, ${s}px, 0)`})}));let h,r=this.hitTest(this.draggedElementClone,this.sortableNodes)[0];this.dropzoneSelector&&this.dropzoneActiveClass&&i((()=>{h=this.draggedElement.closest(this.dropzoneSelector),e((()=>{this.dropzoneNodes.filter((t=>t!==h)).forEach((t=>t.classList.remove(this.dropzoneActiveClass))),h.classList.add(this.dropzoneActiveClass)}))})),!r&&this.dropzoneNodes.length&&(r=this.hitTest(this.draggedElementClone,this.dropzoneNodes)[0],this.draggedElement.closest(this.dropzoneSelector)===r)||r&&r!==this.draggedElement&&!this.isAnimating(r)&&this.insertAtTarget(this.draggedElement,r)};constructor(t){s(this,t),this.nanoOrderChange=h(this,"nanoOrderChange",7),this.nanoGrabbed=h(this,"nanoGrabbed",7),this.nanoDropped=h(this,"nanoDropped",7),this.handleTrack=this.handleTrack.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.refreshKeyboardHandles=this.refreshKeyboardHandles.bind(this),this.refreshKeyboardHandles=a(this.refreshKeyboardHandles,500)}connectedCallback(){this.addEventHandlers(),this.refreshKeyboardHandles(),this.attachMutationObserver(),this.host.querySelector(`#${this.sortableId}`)||this.host.insertAdjacentHTML("beforeend",`<div class="visually-hidden" id="${this.sortableId}">${this.helperText}</div>`)}disconnectedCallback(){this.removeEventHandlers(),this.host.querySelector(`#${this.sortableId}`)?.remove(),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0)}render(){return o(r,{key:"2d575a0cd296fe9c691962f7075f2b808f7abe01",class:"nano-sortable"},o("div",{key:"c2178832b34f1c069b09eff039940ab52bc22b61",class:"sortable__live-region","aria-live":"polite","aria-relevant":"additions","aria-atomic":"true",role:"log",part:"announcements"},this.ariaTextList.map((t=>o("div",null,t)))),o("slot",{key:"703feb95010c77a8945dfc34bd57a5acb16b40d1"}))}static get watchers(){return{itemSelector:["handleItemSelectorChange"],handleSelector:["handleHandleSelectorChange"],createKeyboardHandle:["handleCreateKeyboardHandleChange"],sortableHostElement:["handleSortableHostElement"]}}};m.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{position:relative;display:block}.sortable__live-region{clip-path:inset(50%);block-size:1px;overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}";export{m as nano_sortable}
|
4
|
+
import{g as t,d as e,e as i,r as s,c as h,a as r}from"./index-CDb2_YWF.js";import{h as o}from"./renderer-CGoibSOJ.js";import{d as n}from"./drag-BLOEuv-q.js";import{d as a}from"./throttle-C93FMm2Z.js";import{a as d}from"./events-ClRFmcmJ.js";const l={horizontal:{x:1,y:0},vertical:{x:0,y:1}};let c=0;const m=class{itemSelector="li";handleItemSelectorChange(){this.refreshKeyboardHandles()}handleSelector;handleHandleSelectorChange(){this.refreshKeyboardHandles(),this.attachMutationObserver()}dropzoneSelector;helperText='Press "Space" or "Enter" to enable element reordering and use the arrow keys to reorder items.Press "Escape" to cancel reordering. Alternatively, use your mouse to drag / reorder.';itemDescriptor=t=>`"${t?.textContent.trim()}"`;grabbedHelperText=t=>`${this.itemDescriptor(t)} grabbed`;droppedHelperText=t=>`${this.itemDescriptor(t)} dropped`;reorderHelperText=(t,e,i)=>`The list has been reordered, ${this.itemDescriptor(t)} is now item ${i} of ${e.length}`;createKeyboardHandle=(t,e)=>{const i=document.createElement("div");i.innerHTML='\n <nano-icon-button\n slot="end"\n icon-name="light/arrows-up-down-left-right"\n class="nano-sortable__keyboard-handle visually-hidden"\n label="Re-order this item"\n ></nano-icon-button>';const s=i.children[0];return e.append(s),s};handleCreateKeyboardHandleChange(){this.refreshKeyboardHandles()}sortableHostElement;handleSortableHostElement(t,e){e&&this.removeEventHandlers(e),this.addEventHandlers(),this.refreshKeyboardHandles(),this.attachMutationObserver(),this.sortableHostElement&&(this.sortableHostElement.style.position="relative")}animationEnabled=!0;draggedClass="nano-sortable__dragged";handleDraggedClass="nano-sortable__handle-dragged";placeholderClass="nano-sortable__placeholder";dropzoneActiveClass="";animationTiming={duration:200,easing:"ease-out"};orientation;dragResize=!1;nanoOrderChange;nanoGrabbed;nanoDropped;async refreshKeyboardHandles(){if(this.handleSelector)return this.keyboardHandleMap?.size&&this.keyboardHandleMap.clear(),void this.sortableHost.querySelectorAll(this.handleSelector).forEach((t=>{t.getAttribute("aria-describedby")||t.setAttribute("aria-describedby",this.sortableId);const e=t.closest(this.itemSelector);e&&this.keyboardHandleMap.set(t,e)}));this.keyboardHandleMap?.size&&(this.keyboardHandleMap?.forEach(((t,e)=>e.remove())),this.keyboardHandleMap.clear()),this.sortableHost.querySelectorAll(this.itemSelector).forEach(((t,e)=>{const i=this.createKeyboardHandle(e,t);i?(this.keyboardHandleMap.set(i,t),i.setAttribute("aria-describedby",this.sortableId)):console.error("`createKeyboardHandle` *must* return the handle element it creates")}))}get host(){return t(this)}dragRequestPending=!1;draggedElement;draggedElementClone;draggedElementOrigin;sortableNodes=[];dropzoneNodes=[];animatedElements=[];animationPromise;keyboardHandleMap=new Map;sortableId="nano-sortable-"+c++;mouseDownTimer;mutationObserver;keyboardSortActive=!1;ariaTextList=[];get sortableHost(){return this.sortableHostElement?this.sortableHostElement:this.host}addAriaMsg(t){this.ariaTextList=[...this.ariaTextList,t],setTimeout((()=>{const e=this.ariaTextList.indexOf(t);this.ariaTextList.splice(e,1),this.ariaTextList=[...this.ariaTextList]}),1e4)}updateUserSelectStyle(t){this.host.style.userSelect=t}hitTest(t,e){const{left:i,top:s,width:h,height:r}=t.getBoundingClientRect(),o=i+h/2,n=s+r/2;return e.filter((t=>{const{left:e,right:i,top:s,bottom:h}=t.getBoundingClientRect();return!(o<e||o>i||n<s||n>h)}))}isAnimating(t){return-1!==this.animatedElements.indexOf(t)}animateNode(t,i=0,s=0){t.animate&&(this.animatedElements.push(t),t.style.willChange="transform",e((()=>{this.animationPromise=new Promise((e=>{t.animate([{transform:`translate3d(${i}px, ${s}px, 0)`},{transform:"none"}],this.animationTiming).addEventListener("finish",(()=>{const i=this.animatedElements.indexOf(t);t.style.willChange="",-1!==i&&this.animatedElements.splice(i,1),e(),delete this.animationPromise}),{once:!0})}))})))}insertAtTarget(t,e){if(!t||!e)return;let i=[];if(this.animationEnabled&&(i=this.sortableNodes.map((t=>({x:t.offsetLeft,y:t.offsetTop})))),t.isConnected&&e.isConnected){if(this.dropzoneNodes.indexOf(e)>-1)e.append(t);else{const i=t.compareDocumentPosition(e);let s;i&this.host.DOCUMENT_POSITION_FOLLOWING&&(s=e.parentNode===t.parentNode?"afterend":"beforebegin"),i&this.host.DOCUMENT_POSITION_PRECEDING&&(s=e.parentNode===t.parentNode?"beforebegin":"afterend"),s&&e.insertAdjacentElement(s,t)}this.animationEnabled&&this.sortableNodes.forEach(((t,e)=>{const{x:s,y:h}=i[e],r=s-t.offsetLeft,o=h-t.offsetTop;0===r&&0===o||this.animateNode(t,r,o)}))}}reset(){void 0!==this.draggedElementClone&&null!==this.draggedElementClone.parentNode&&this.draggedElementClone.parentNode.removeChild(this.draggedElementClone),this.draggedElement&&this.draggedElement.parentNode&&this.draggedElementOrigin&&this.draggedElement.classList.remove(this.placeholderClass),this.dropzoneActiveClass&&this.dropzoneNodes.length&&this.dropzoneNodes.forEach((t=>t.classList.remove(this.dropzoneActiveClass))),delete this.draggedElementClone,delete this.draggedElement,this.dropzoneNodes=[],this.sortableNodes=[],this.animatedElements=[],this.dragRequestPending=!1,this.updateUserSelectStyle("")}createClone(t){const e=t.cloneNode(!0);t.id&&(e.id="clone__"+e.id),Array.from(e.children).forEach(((e,i)=>{const s=e,h=t.children.item(i);h&&(s.style.width=`${h.offsetWidth}px`)}));const{offsetLeft:i,offsetTop:s,offsetWidth:h,offsetHeight:r}=t;return Object.assign(e.style,{position:"absolute",left:`calc(${i}px - var(--grab-offset-x, 0px))`,top:`calc(${s}px - var(--grab-offset-y, 0px))`,height:this.dragResize?`${r}px`:void 0,width:this.dragResize?`${h}px`:void 0,willChange:"transform,opacity"}),e.classList.add(this.draggedClass),t.parentNode.appendChild(e)}removeEventHandlers(t){(t=t||this.sortableHost).removeEventListener("mousedown",this.handleTrack),t.removeEventListener("touchstart",this.handleTrack),t.removeEventListener("keydown",this.handleKeydown)}addEventHandlers(t){d(t=t||this.sortableHost,"mousedown touchstart",this.handleTrack,{passive:!0}),t.addEventListener("keydown",this.handleKeydown)}attachMutationObserver(){this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0),this.mutationObserver=new MutationObserver((()=>{const t=Array.from(this.keyboardHandleMap.values()),e=Array.from(this.sortableHost.querySelectorAll(this.itemSelector));(t.length!==e.length||e.find((e=>!t.includes(e))))&&this.refreshKeyboardHandles()})),this.mutationObserver.observe(this.sortableHost,{subtree:!0,childList:!0})}handleKeydown(t){const e=t.target;let i,s;if(console.log("yooo",t.key),this.handleSelector?(i=e.closest(this.handleSelector),s=e.closest(this.itemSelector)):(s=this.keyboardHandleMap.get(e),i=e),!i||!s)return;const h=t=>{this.keyboardSortActive=t,this.draggedElement=t?s:void 0,s.classList.toggle(this.draggedClass,t),i.classList.toggle(this.handleDraggedClass,t),t?(this.addAriaMsg(this.grabbedHelperText(s)),document.addEventListener("mousedown",(()=>h(!1)),{once:!0})):this.addAriaMsg(this.droppedHelperText(s))};if([" ","Space","Enter"].includes(t.key)){if(t.preventDefault(),this.keyboardSortActive)h(!1),this.nanoDropped.emit({element:s});else if(h(!0),this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],this.nanoGrabbed.emit({element:s,index:this.sortableNodes.indexOf(s)}).defaultPrevented)return void h(!1);return}if(!this.keyboardSortActive)return;["Escape","Tab"].includes(t.key)&&h(!1);let r=["Home","End"];if(this.orientation&&"horizontal"!==this.orientation||(r=[...r,"ArrowRight","ArrowLeft"]),this.orientation&&"vertical"!==this.orientation||(r=[...r,"ArrowUp","ArrowDown"]),!r.includes(t.key))return;t.preventDefault(),this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[];const o=this.sortableNodes.indexOf(this.draggedElement);let n=-1;if(this.dropzoneNodes.length){const t=this.draggedElement.closest(this.dropzoneSelector);n=this.dropzoneNodes.indexOf(t),n=n>-1?n:-1}const a=o-1<0&&n>-1?this.dropzoneNodes[n-1]:this.sortableNodes[o-1],d=o+1===this.sortableNodes.length&&n>-1?this.dropzoneNodes[n+1]:this.sortableNodes[o+1];"Home"===t.key&&this.insertAtTarget(this.draggedElement,this.sortableNodes[0]),"End"===t.key&&this.insertAtTarget(this.draggedElement,this.sortableNodes[this.sortableNodes.length-1]),["ArrowRight","ArrowDown"].includes(t.key)&&this.insertAtTarget(this.draggedElement,d),["ArrowLeft","ArrowUp"].includes(t.key)&&this.insertAtTarget(this.draggedElement,a),this.finishOrder(),this.draggedElement=s;const l=()=>{requestAnimationFrame((()=>{"function"==typeof i.setFocus?i.setFocus():i.focus()}))};this.animationPromise?this.animationPromise.then((()=>l())):l()}handleTrack(t){if(this.dragRequestPending||t.button&&1!==t.button)return;const e=t=>{t.cancelable&&t.preventDefault(),clearTimeout(this.mouseDownTimer)},i=()=>{clearTimeout(this.mouseDownTimer),document.removeEventListener("touchmove",e),document.removeEventListener("contextmenu",this.finishOrder)};i(),this.mouseDownTimer=window?.setTimeout((()=>{this.trackStart(t)&&(document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("contextmenu",this.finishOrder),this.addAriaMsg(this.grabbedHelperText(this.draggedElement)),n(this.sortableHost,{initialEvent:t,relative:!0,onMove:(t,e)=>{this.trackMove(t,e)},onStop:()=>{this.nanoDropped.emit({element:this.draggedElement}),i();const t=()=>{this.addAriaMsg(this.droppedHelperText(this.draggedElement)),requestAnimationFrame((()=>this.finishOrder()))};this.animationPromise?this.animationPromise.then((()=>t())):t()}}))}),150),d(document,"mouseup touchend touchmove",(()=>clearTimeout(this.mouseDownTimer)),{once:!0})}trackStart(t){const e=t.target;let i;if(this.handleSelector){if(i=e.closest(this.handleSelector),!i)return;i.classList.add(this.handleDraggedClass)}const s=e.closest(this.itemSelector);return!!s&&(this.sortableNodes=Array.from(this.sortableHost.querySelectorAll(this.itemSelector))||[],!this.nanoGrabbed.emit({element:s,index:this.sortableNodes.indexOf(s)}).defaultPrevented&&(t.preventDefault(),this.updateUserSelectStyle("none"),this.dragRequestPending=!0,this.draggedElement=s,this.dropzoneNodes=Array.from(this.sortableHost.querySelectorAll(this.dropzoneSelector))||[],this.draggedElementClone=this.createClone(s),this.draggedElementOrigin=s.nextSibling,this.animatedElements=[],this.draggedElement.classList.add(this.placeholderClass),!0))}finishOrder=()=>{if(!this.draggedElement)return;const t=Array.from(this.sortableHost.querySelectorAll(this.itemSelector)).filter((t=>t!==this.draggedElementClone)),e=this.sortableNodes.indexOf(this.draggedElement),i=t.indexOf(this.draggedElement);if(this.handleSelector&&this.draggedElement.querySelector(this.handleSelector).classList.remove(this.handleDraggedClass),e!==i){if(this.nanoOrderChange.emit({element:this.draggedElement,originalIndex:e,targetIndex:i}).defaultPrevented)return void(this.animationPromise=new Promise((i=>{setTimeout((()=>{this.insertAtTarget(this.draggedElement,t[e]),this.reset(),this.dragRequestPending=!1,i()}),200)})));this.addAriaMsg(this.reorderHelperText(this.draggedElement,t,i+1))}this.reset(),this.dragRequestPending=!1};trackMove=(t,s)=>{if(!this.draggedElementClone)return;this.orientation&&(t*=l[this.orientation].x,s*=l[this.orientation].y),e((()=>{Object.assign(this.draggedElementClone.style,{transform:`translate3d(${t}px, ${s}px, 0)`})}));let h,r=this.hitTest(this.draggedElementClone,this.sortableNodes)[0];this.dropzoneSelector&&this.dropzoneActiveClass&&i((()=>{h=this.draggedElement.closest(this.dropzoneSelector),e((()=>{this.dropzoneNodes.filter((t=>t!==h)).forEach((t=>t.classList.remove(this.dropzoneActiveClass))),h.classList.add(this.dropzoneActiveClass)}))})),!r&&this.dropzoneNodes.length&&(r=this.hitTest(this.draggedElementClone,this.dropzoneNodes)[0],this.draggedElement.closest(this.dropzoneSelector)===r)||r&&r!==this.draggedElement&&!this.isAnimating(r)&&this.insertAtTarget(this.draggedElement,r)};constructor(t){s(this,t),this.nanoOrderChange=h(this,"nanoOrderChange",7),this.nanoGrabbed=h(this,"nanoGrabbed",7),this.nanoDropped=h(this,"nanoDropped",7),this.handleTrack=this.handleTrack.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.refreshKeyboardHandles=this.refreshKeyboardHandles.bind(this),this.refreshKeyboardHandles=a(this.refreshKeyboardHandles,500)}connectedCallback(){this.addEventHandlers(),this.refreshKeyboardHandles(),this.attachMutationObserver(),this.host.querySelector(`#${this.sortableId}`)||this.host.insertAdjacentHTML("beforeend",`<div class="visually-hidden" id="${this.sortableId}">${this.helperText}</div>`)}disconnectedCallback(){this.removeEventHandlers(),this.host.querySelector(`#${this.sortableId}`)?.remove(),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0)}render(){return o(r,{key:"2d575a0cd296fe9c691962f7075f2b808f7abe01",class:"nano-sortable"},o("div",{key:"c2178832b34f1c069b09eff039940ab52bc22b61",class:"sortable__live-region","aria-live":"polite","aria-relevant":"additions","aria-atomic":"true",role:"log",part:"announcements"},this.ariaTextList.map((t=>o("div",null,t)))),o("slot",{key:"703feb95010c77a8945dfc34bd57a5acb16b40d1"}))}static get watchers(){return{itemSelector:["handleItemSelectorChange"],handleSelector:["handleHandleSelectorChange"],createKeyboardHandle:["handleCreateKeyboardHandleChange"],sortableHostElement:["handleSortableHostElement"]}}};m.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{position:relative;display:block}.sortable__live-region{clip-path:inset(50%);block-size:1px;overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}";export{m as nano_sortable}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import{r as n}from"./index-
|
4
|
+
import{r as n}from"./index-CDb2_YWF.js";const o=class{constructor(o){n(this,o)}overlay=!1};o.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:where(nano-spinner,.nano-spinner){display:inline-block;--track-size:.1em;--indicator-color:var(--nano-color-primary-1000);--track-color:var(--nano-color-neutral-300);--overlay-color:rgb(var(--nano-color-base-rgb-0) / 88%);display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--nano-spacing-xs)}:where(nano-spinner,.nano-spinner)::after{content:"";order:-1;font-size:1em;display:block;inline-size:1em;block-size:1em;border-radius:50%;border:solid var(--track-size) var(--track-color);border-block-start-color:var(--indicator-color);border-inline-end-color:var(--indicator-color);border-inline-start-color:var(--indicator-color);animation:1s linear infinite loading-spin}:where(nano-spinner,.nano-spinner)>:not([slot=label]){display:none}:where(nano-spinner,.nano-spinner) [slot=label]{font-size:var(--nano-font-size-sm);color:var(--nano-color-neutral-1200);display:block;text-align:center;position:relative;z-index:1}:where(nano-spinner,.nano-spinner)[overlay]:not([overlay=false]){position:absolute;inset:0;display:grid;grid-template-rows:auto auto;z-index:var(--nano-z-index-mask);justify-items:center}:where(nano-spinner,.nano-spinner)[overlay]:not([overlay=false])::before{content:"";order:-2;position:absolute;inset:0;background:var(--overlay-color);z-index:-1}:where(nano-spinner,.nano-spinner)[overlay]:not([overlay=false]) [slot=label]{align-self:start;grid-row:2}:where(nano-spinner,.nano-spinner)[overlay]:not([overlay=false])::after{align-self:end;grid-row:1;position:relative}@keyframes loading-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}';export{o as nano_spinner}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import{g as i,r as t,c as e,a as s}from"./index-
|
4
|
+
import{g as i,r as t,c as e,a as s}from"./index-CDb2_YWF.js";import{h as o}from"./renderer-CGoibSOJ.js";import{d as n}from"./drag-BLOEuv-q.js";import{a as r}from"./math-BEqsTfVK.js";import{d as a}from"./throttle-C93FMm2Z.js";const h=class{get host(){return i(this)}cachedPositionInPixels;ro;isAnimating=!1;didLoad=!1;get size(){const{width:i,height:t}=this.host.getBoundingClientRect();return this.vertical?t:i}get shouldAnimate(){return this.didLoad&&this._shouldAnimate}set shouldAnimate(i){this._shouldAnimate=i}_shouldAnimate=!0;constructor(i){t(this,i),this.nanoReposition=e(this,"nanoReposition",7),this.nanoDragging=e(this,"nanoDragging",7),this.handlePositionChange=a(this.handlePositionChange.bind(this),100)}get position(){return this._position}set position(i){i=Math.min(Math.max(i,0),100),isNaN(i)||i===this._position||(this.shouldAnimate&&this.animationDuration>0&&!isNaN(this.position)?this.animatePosition(i):this._position=i)}_position;handlePositionChange(){this.cachedPositionInPixels=this.percentageToPixels(this.position),this.positionInPixels=this.percentageToPixels(this.position),this.nanoReposition.emit()}positionInPixels;handlePositionInPixelsChange(){this.position=this.pixelsToPercentage(this.positionInPixels)}vertical=!1;disabled=!1;primary;snap;snapThreshold=12;animationDuration=.6;nanoReposition;nanoDragging;async getPercentageToPixels(i){return this.percentageToPixels(i)}async getPixelsToPercentage(i){return this.pixelsToPercentage(i)}animatePosition(i){if(this.isAnimating)return;const t=this.animationDuration,e=this.position,s=i-e;let o=e,n=0;const r=()=>{var a,h,d;if(n+=1/60,a=n,h=e,d=s,o=(a/=t/2)<1?d/2*a*a+h:-d/2*(--a*(a-2)-1)+h,i>e&&o>=i||i<e&&o<=i)return this.position=i,this.shouldAnimate=!0,void(this.isAnimating=!1);this.position=o,requestAnimationFrame(r)};this.shouldAnimate=!1,this.isAnimating=!0,requestAnimationFrame(r)}percentageToPixels(i){return this.size*(i/100)}pixelsToPercentage(i){return i/this.size*100}attachRO(){window.ResizeObserver&&(this.detachRO(),this.ro=new ResizeObserver((()=>this.handleResize())),this.ro.observe(this.host))}detachRO(){this.ro&&(this.ro.unobserve(this.host),this.ro=void 0)}handleDrag=i=>{this.disabled||(i.preventDefault(),n(this.host,{onMove:(i,t)=>{let e=this.vertical?t:i;this.nanoDragging.emit(e),"end"===this.primary&&(e=this.size-e),this.snap&&this.snap.split(" ").forEach((i=>{let t;t=i.endsWith("%")?this.size*(parseFloat(i)/100):parseFloat(i),e>=t-this.snapThreshold&&e<=t+this.snapThreshold&&(e=t)})),this.shouldAnimate=!1,this.position=r(this.pixelsToPercentage(e),0,100),requestAnimationFrame((()=>this.shouldAnimate=!0))}}))};handleKeyDown=i=>{if(!this.disabled&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(i.key)){let t=this.position;const e=(i.shiftKey?10:1)*("end"===this.primary?-1:1);i.preventDefault(),("ArrowLeft"===i.key&&!this.vertical||"ArrowUp"===i.key&&this.vertical)&&(t-=e),("ArrowRight"===i.key&&!this.vertical||"ArrowDown"===i.key&&this.vertical)&&(t+=e),"Home"===i.key&&(t="end"===this.primary?100:0),"End"===i.key&&(t="end"===this.primary?0:100),this.shouldAnimate=!1,this.position=r(t,0,100),requestAnimationFrame((()=>this.shouldAnimate=!0))}};handleResize=()=>{this.didLoad&&!this.isAnimating&&this.primary&&(this.shouldAnimate=!1,this.position=this.pixelsToPercentage(this.cachedPositionInPixels),requestAnimationFrame((()=>this.shouldAnimate=!0)))};componentDidLoad(){this.positionInPixels&&this.handlePositionInPixelsChange(),setTimeout((()=>this.didLoad=!0))}connectedCallback(){this.cachedPositionInPixels=this.percentageToPixels(this.position),this.attachRO()}disconnectedCallback(){this.detachRO()}componentDidRender(){requestAnimationFrame((()=>{void 0===this.position&&(this.position=50)}))}render(){if(void 0===this.position)return;const i={},t=`\n clamp(\n 0%,\n clamp(\n var(--min),\n ${this.position}% - var(--divider-width) / 2,\n var(--max)\n ),\n calc(100% - var(--divider-width))\n )\n `,e="auto";return i[this.vertical?"gridTemplateRows":"gridTemplateColumns"]="end"===this.primary?`${e} var(--divider-width) ${t}`:`${t} var(--divider-width) ${e}`,o(s,{style:i,class:"nano-split-pane"},o("div",{part:"panel start",class:"start"},o("slot",{name:"start"})),o("div",{part:"divider",class:"divider",tabindex:this.disabled?void 0:"0",role:"separator","aria-label":"Resize",onKeyDown:this.handleKeyDown,onMouseDown:this.handleDrag,onTouchStart:this.handleDrag},o("slot",{name:"handle"},o("nano-icon",!this.disabled&&this.vertical?{slot:"handle",name:"solid/grip-dots"}:{slot:"handle",name:"solid/grip-dots-vertical"}))),o("div",{part:"panel end",class:"end"},o("slot",{name:"end"})))}static get watchers(){return{position:["handlePositionChange"],positionInPixels:["handlePositionInPixelsChange"]}}};h.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--divider-width:4px;--divider-hit-area:14px;--min:0%;--max:100%;--background-color:var(--nano-color-neutral-300);--content-color:var(--nano-color-neutral-1000);display:grid}.start,.end{overflow:hidden}.divider{flex:0 0 var(--divider-width);display:flex;position:relative;align-items:center;justify-content:center;background-color:var(--background-color);color:var(--content-color);z-index:1;font-size:0.8rem}.divider:focus{outline:none}:host(:not([disabled])) .divider:focus-visible{background-color:var(--nano-focus-ring-color)}:host([disabled]) .divider{cursor:not-allowed}:host(:not([vertical],[disabled])) .divider{cursor:col-resize}:host(:not([vertical])) .divider::after{display:flex;content:"";position:absolute;block-size:100%;inset-inline-start:calc(var(--divider-hit-area) / -2 + var(--divider-width) / 2);inline-size:var(--divider-hit-area)}:host([vertical]){flex-direction:column}:host([vertical]:not([disabled])) .divider{cursor:row-resize}:host([vertical]) .divider::after{content:"";position:absolute;inline-size:100%;inset-block-start:calc(var(--divider-hit-area) / -2 + var(--divider-width) / 2);block-size:var(--divider-hit-area)}';export{h as nano_split_pane}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import{r as t,c as i,g as s,a as e}from"./index-q0XK-YfO.js";import{a as h}from"./dom-C8mB0MAq.js";import{d as n}from"./throttle-C93FMm2Z.js";import{f as o}from"./scroll-N_WMYKm7.js";import{t as r,h as a}from"./renderer-BjGZGWn8.js";function c(t,i){const s=i instanceof Document?document.documentElement:i;return h(t,s)}const d=class{constructor(s){t(this,s),this.nanoStuck=i(this,"nanoStuck",7),this.nanoUnstuck=i(this,"nanoUnstuck",7),this.nanoHide=i(this,"nanoHide",7),this.nanoShow=i(this,"nanoShow",7)}isRtl=!1;io;contentSizeObserver;parentSizeObserver;sticker;content;scrollPosCache=0;scrollPosThresholdCache=0;cacheOffset=0;slottedContent;pauseResizeWatcher=!1;listenForScrollParent=!1;stickToEleInitSize;positions=[];pauseHide=!1;hasBootstrapped=!1;get host(){return s(this)}isStuck=!1;isRootSticker=!0;hide=!1;scrollHide=!1;multiStickerHide=!1;scrollingTo=!1;quietModeIsOn=!1;stuckCounter=0;stickerIndex=0;stickToEle;triggerPos;trigger;_offset=0;autoResize=!0;isSticky=!0;offset=0;position="top";quietMode={h:600,w:600};hideOnNewStickers=!0;breakPointMax=null;breakPointMin=null;scrollParent;stickTo;nanoStuck;nanoUnstuck;nanoHide;nanoShow;async isHiding(){return this.hide}async isSticking(){return this.shouldStick(),this.isStuck}async setTriggerPos(t){return this._offset=t}async getTriggerPos(){return this.triggerPos}async pauseHiding(t){this.pauseHide=t}updateTriggerOffset(){this.trigger&&this.scrollParent&&this.listenForScrollParent&&(this.triggerPos=c(this.trigger,this.scrollParent))}stickerResizeListener(){this.content&&window.ResizeObserver&&(this.contentSizeObserver&&(this.contentSizeObserver.disconnect(),this.contentSizeObserver=void 0),this.contentSizeObserver=new ResizeObserver((t=>{for(const i of t){if(this.pauseResizeWatcher)return;i.contentRect.height&&("top"===this.position&&(this.host.style.height=i.contentRect.height+"px"),"bottom"===this.position&&(this.host.style.minHeight=i.contentRect.height+"px"))}})),this.contentSizeObserver.observe(this.content))}quietModeChange(){"on"===this.quietMode?requestAnimationFrame((()=>this.quietModeIsOn=!0)):"off"===this.quietMode&&requestAnimationFrame((()=>this.quietModeIsOn=!1))}setOffset(){let t,i,s,e;this.trigger&&this.trigger.setAttribute("style","");const h=this.isRootSticker||this.stickToEle?this.sticker:this.host;if(!h)return;"object"==typeof this.offset?({v:t,h:i}=this.offset):t=i=this.offset,"object"==typeof this._offset?({v:t=s,h:i=e}=this._offset):s=e=this._offset;const n=s=>{const e=s.match(/(top|bottom)/)?t:i;o(s),h.style[s]=e+"px",this.host.style.setProperty("--hide-transform-amount",e?`(110% + ${e}px)`:null)},o=h=>{const n=h.match(/(top|bottom)/)?t+s:i+e;this.trigger.style[h]=-1*n+"px",this.trigger.style.position="relative",this.trigger.style.minHeight="1px",this.trigger.style.maxHeight="1px",this.trigger.style.overflow="hidden"};(this.positions.includes("start")&&this.isRtl||this.positions.includes("end")&&!this.isRtl)&&n("right"),(this.positions.includes("end")&&this.isRtl||this.positions.includes("start")&&!this.isRtl)&&n("left"),this.positions.includes("top")&&n("top"),this.positions.includes("bottom")&&n("bottom")}positionChange(){this.positions=this.position.split("-"),this.setOffset()}async stuckChange(){this.isStuck?this.stickToEle?(this.slottedContent=Array.from(this.host.children),this.slottedContent.forEach((t=>{this.stickToEle.appendChild(t),t.style.order=this.stickerIndex+""})),this.nanoStuck.emit({sticker:this.stickToEle})):this.nanoStuck.emit({sticker:this.host}):(this.scrollHide=!1,this.stickToEle?(this.slottedContent.forEach((t=>{this.host.appendChild(t),t.style.order=""})),this.nanoUnstuck.emit({sticker:this.stickToEle})):this.nanoUnstuck.emit({sticker:this.host}))}attachScrollListeners(){this.quietModeIsOn?this.scrollParent.addEventListener("scroll",this.onScroll,{passive:!0,capture:!1}):this.scrollParent&&(this.scrollParent.removeEventListener("scroll",this.onScroll),this.moveTrigger(!0))}handleParentEvents(t,i=null){this.listenForScrollParent&&(i&&this.manageListenersOnParent(!1,i),this.scrollParent&&this.manageListenersOnParent(!this.stickToEle))}stickToEleChange(t,i){this.stickToEle&&(this.stickToEle.addEventListener("nanoHide",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoShow",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoStuck",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoUnstuck",this.onStickToDisplayEvent)),i&&(i.removeEventListener("nanoHide",this.onStickToDisplayEvent),i.removeEventListener("nanoShow",this.onStickToDisplayEvent),i.removeEventListener("nanoStuck",this.onStickToDisplayEvent),i.removeEventListener("nanoUnstuck",this.onStickToDisplayEvent))}stickToChange(){this.stickToEle="string"==typeof this.stickTo?this.scrollParent.querySelector(this.stickTo):this.stickTo?this.stickTo:void 0}visibilityDecisionHandler(){this.hide=!(!this.multiStickerHide&&!this.scrollHide)}handleHideChange(){this.hide?this.nanoHide.emit({sticker:this.host}):this.nanoShow.emit({sticker:this.host})}setupIO(){if(this.io&&(this.io.disconnect(),this.io=void 0),!this.scrollParent||!this.hasBootstrapped||!this.trigger)return;this.isRootSticker=this.scrollParent instanceof Document;let t=this.scrollParent;this.scrollParent instanceof Document&&(t=null),this.io=new window.IntersectionObserver((t=>{!this.pauseResizeWatcher&&this.isSticky&&this.shouldStick(t.slice(-1)[0])}),{root:t}),this.io.observe(this.trigger)}setupParentResizeListener=()=>{if(!window.ResizeObserver)return;this.parentSizeObserver&&(this.parentSizeObserver.disconnect(),this.parentSizeObserver=void 0),this.parentSizeObserver=new ResizeObserver((t=>{for(const i of t){let t,s;i.contentRect.height&&(t=i.contentRect.height),i.contentRect.width&&(s=i.contentRect.width),"object"==typeof this.quietMode&&(this.quietModeIsOn=s<this.quietMode.w||t<this.quietMode.h),this.breakPointMin&&(this.isSticky=s>this.breakPointMin),this.breakPointMax&&(this.isSticky=s<this.breakPointMax),this.isRootSticker&&this.sticker&&this.autoResize&&(this.sticker.style.width=this.host.scrollWidth+"px")}}));const t=this.scrollParent instanceof Document?this.scrollParent.documentElement:this.scrollParent;t&&this.parentSizeObserver.observe(t)};onStickToDisplayEvent=t=>{if(t.detail.sticker===this.stickToEle)switch(t.type){case"nanoHide":this._offset=0,this.cacheOffset=this.offset,this.offset=0,this.isStuck||this.moveTrigger(!1),!this.isRootSticker&&this.quietModeIsOn&&requestAnimationFrame((()=>{this.stickToEle.style.minHeight=this.stickToEleInitSize.height+(this.host.scrollHeight+("object"==typeof this.cacheOffset?this.cacheOffset.v:this.cacheOffset))+"px",this.stickToEle.setTriggerPos(-1*this.stickToEleInitSize.height)}));break;case"nanoShow":this._offset=this.stickToEleInitSize.height,this.offset=this.cacheOffset,this.moveTrigger(!0),!this.isRootSticker&&this.quietModeIsOn&&requestAnimationFrame((()=>{this.stickToEle.style.minHeight="",this.stickToEle.setTriggerPos(0)}));break;case"nanoStuck":this.stickToEleInitSize=this.stickToEle.getBoundingClientRect(),this._offset=this.stickToEleInitSize.height}};manageListenersOnParent(t,i){const s=i||this.scrollParent;if(s){if(t)s.addEventListener("nanoStuck",this.onStickEvent),s.addEventListener("nanoUnstuck",this.onStickEvent),this.quietModeIsOn&&this.attachScrollListeners();else try{this.quietModeIsOn&&s.removeEventListener("scroll",this.onScroll),s.removeEventListener("nanoStuck",this.onStickEvent),s.removeEventListener("nanoUnstuck",this.onStickEvent)}catch(t){console.error("Events haven`t been added")}this.setupParentResizeListener()}}onStickEvent=async t=>{const i=t.detail?t.detail.sticker:null;if(!i||i.position!==this.position)return;const s=await i.getTriggerPos();if("nanoStuck"===t.type&&i!==this.host&&i.scrollParent===this.host.scrollParent){if(this.stickerIndex++,!this.hideOnNewStickers)return;(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top)&&(this.multiStickerHide=!0,this.stuckCounter++)}if("nanoUnstuck"===t.type&&i!==this.host&&i.scrollParent===this.host.scrollParent){if(this.stickerIndex--,!this.hideOnNewStickers)return;(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top)&&(this.stuckCounter--,this.stuckCounter<1&&(this.multiStickerHide=!1))}};onScroll=()=>{const t=(i=this.scrollParent)instanceof Document?window.pageYOffset:i.scrollTop;var i;t<this.scrollPosCache&&(this.positions.includes("bottom")?this.handleScrollAway(t):this.handleScrollTo()),t>this.scrollPosCache&&(this.positions.includes("bottom")?this.handleScrollTo():this.handleScrollAway(t)),this.scrollPosCache=t};handleScrollTo(){this.scrollPosThresholdCache=null,this.scrollHide&&(!0!==this.scrollingTo&&(this._offset=this.cacheOffset||this._offset),this.scrollingTo=!0,this.scrollHide=!1)}handleScrollAway(t){this.scrollHide||this.isStuck&&(!1!==this.scrollingTo&&(this.cacheOffset=this._offset,this._offset=0),this.scrollingTo=!1,this.scrollPosThresholdCache?!this.pauseHide&&Math.abs(t-this.scrollPosThresholdCache)>100&&(this.scrollHide=!0):this.scrollPosThresholdCache=t)}moveTrigger(t){this.positions.includes("bottom")&&!t||!this.positions.includes("bottom")&&t?this.host.parentNode.insertBefore(this.trigger,this.host):this.host.parentNode.insertBefore(this.trigger,this.host.nextSibling)}shouldStick(t){let i;if(this.positions.includes("top"))i=this.isRootSticker?this.trigger.getBoundingClientRect().top:c(this.trigger,this.scrollParent).top,this.isStuck=i<-1;else if(this.positions.includes("bottom")){i=this.trigger.getBoundingClientRect().top;const s=t&&t.rootBounds?t.rootBounds:(this.scrollParent instanceof Document?document.documentElement:this.scrollParent).getBoundingClientRect();this.isStuck=!t.isIntersecting||i>s.height+s.top}}bootstrapGurantor(){this.hasBootstrapped=!0;const t=this.scrollParent||o(this.host);this.scrollParent=t===document.documentElement?document:t,this.isRootSticker=this.scrollParent instanceof Document,this.trigger=this.trigger||document.createElement("div"),this.trigger.innerHTML=" ",this.trigger.classList.add("sticker-trigger"),this.positionChange(),this.moveTrigger(!0),this.quietModeChange(),this.listenForScrollParent=!0,this.handleParentEvents(!0),this.stickerIndex=Array.from(this.scrollParent.querySelectorAll(r("nano-sticker"))).filter((t=>t.position===this.position)).findIndex((t=>t===this.host)),this.setOffset(),this.stickerResizeListener(),this.setupParentResizeListener(),this.slottedContent=Array.from(this.host.children),this.slottedContent.forEach((t=>{t.style.order=this.stickerIndex+""})),this.updateTriggerOffset(),this.stickToChange(),this.setupIO(),this.onStickToDisplayEvent=n(this.onStickToDisplayEvent,50)}connectedCallback(){this.isRtl="rtl"===this.host.dir||"rtl"===this.host.ownerDocument.dir,setTimeout((()=>{this.hasBootstrapped||this.bootstrapGurantor()}),1e3)}disconnectedCallback(){this.io&&(this.io.disconnect(),this.io=void 0),this.parentSizeObserver&&(this.parentSizeObserver.disconnect(),this.parentSizeObserver=void 0),this.scrollParent=null,this.hasBootstrapped=!1}render(){return a(e,{key:"c8aac0477fcb4d6a456715ec51fb773236bbaa7f",sticky:!this.isRootSticker&&!this.stickToEle&&this.isSticky,hide:this.hide&&this.isStuck,siblings:this.stuckCounter,index:this.stickerIndex,stuck:this.isStuck&&this.isSticky,"placed-bottom":this.positions.includes("bottom"),"placed-top":this.positions.includes("top"),"placed-end":this.positions.includes("end"),"placed-start":this.positions.includes("start"),class:"nano-sticker"},a("div",{key:"15a548042c3ff9b93c38d21e383c1023174ae22e",class:{sticker:!0,sticky:this.isRootSticker&&this.isSticky,stuck:this.isStuck&&this.isRootSticker&&this.isSticky,hide:this.isRootSticker&&this.hide&&this.isStuck},ref:t=>this.sticker=t},a("div",{key:"6d8bf085310c30c1705beb85c0ca3de88f93ee08",class:"sticker-content",ref:t=>this.content=t},a("slot",{key:"02fb0c73c8c16f10fbaf2183aa1c26152d984ac6"}))))}static get watchers(){return{trigger:["updateTriggerOffset"],scrollParent:["updateTriggerOffset","handleParentEvents","setupIO"],position:["stickerResizeListener","positionChange"],quietMode:["quietModeChange"],offset:["setOffset"],_offset:["setOffset"],isStuck:["stuckChange"],quietModeIsOn:["attachScrollListeners"],stickToEle:["handleParentEvents","stickToEleChange"],stickTo:["stickToChange"],multiStickerHide:["visibilityDecisionHandler"],scrollHide:["visibilityDecisionHandler"],hide:["handleHideChange"]}}};d.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--stuck-left:initial;--stuck-right:initial;--stuck-z-index:var(--nano-z-index-menubar);--top-hide:translateY(-110%);--bottom-hide:translateY(110%);display:block;max-inline-size:100%}:host([sticky]){position:sticky;transition:0.3s ease transform;will-change:min-block-size}:host([sticky][stuck]){inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index) !important}:host([sticky][hide][placed-top]){transform:var(--top-hide)}:host([sticky][hide][placed-bottom]){transform:var(--bottom-hide)}:host([sticky][index="1"]){z-index:calc(var(--stuck-z-index) + 1)}:host([sticky][index="2"]){z-index:calc(var(--stuck-z-index) + 2)}:host([sticky][index="3"]){z-index:calc(var(--stuck-z-index) + 3)}:host([sticky][index="4"]){z-index:calc(var(--stuck-z-index) + 4)}:host([sticky][index="5"]){z-index:calc(var(--stuck-z-index) + 5)}.sticker{display:inherit;max-inline-size:inherit;inline-size:100%}.sticker:not(.stuck){inline-size:auto !important}.sticker.sticky{transition:0.3s ease all;position:relative}:host([index="1"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 1)}:host([index="2"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 2)}:host([index="3"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 3)}:host([index="4"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 4)}:host([index="5"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 5)}.sticker.stuck{position:fixed;inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index);transform:translateY(0)}:host([placed-top]) .sticker.stuck{inset-block-start:0}:host([placed-bottom]) .sticker.stuck{inset-block-end:0}:host([placed-top]) .sticker.stuck.hide{transform:var(--top-hide)}:host([placed-bottom]) .sticker.stuck.hide{transform:var(--bottom-hide)}.sticker-content{display:flex;flex-wrap:wrap}';export{d as nano_sticker}
|
4
|
+
import{r as t,c as i,g as s,a as e}from"./index-CDb2_YWF.js";import{a as h}from"./dom-DpX4e3pw.js";import{d as n}from"./throttle-C93FMm2Z.js";import{f as o}from"./scroll-DMVLi4kX.js";import{t as r,h as a}from"./renderer-CGoibSOJ.js";function c(t,i){const s=i instanceof Document?document.documentElement:i;return h(t,s)}const d=class{constructor(s){t(this,s),this.nanoStuck=i(this,"nanoStuck",7),this.nanoUnstuck=i(this,"nanoUnstuck",7),this.nanoHide=i(this,"nanoHide",7),this.nanoShow=i(this,"nanoShow",7)}isRtl=!1;io;contentSizeObserver;parentSizeObserver;sticker;content;scrollPosCache=0;scrollPosThresholdCache=0;cacheOffset=0;slottedContent;pauseResizeWatcher=!1;listenForScrollParent=!1;stickToEleInitSize;positions=[];pauseHide=!1;hasBootstrapped=!1;get host(){return s(this)}isStuck=!1;isRootSticker=!0;hide=!1;scrollHide=!1;multiStickerHide=!1;scrollingTo=!1;quietModeIsOn=!1;stuckCounter=0;stickerIndex=0;stickToEle;triggerPos;trigger;_offset=0;autoResize=!0;isSticky=!0;offset=0;position="top";quietMode={h:600,w:600};hideOnNewStickers=!0;breakPointMax=null;breakPointMin=null;scrollParent;stickTo;nanoStuck;nanoUnstuck;nanoHide;nanoShow;async isHiding(){return this.hide}async isSticking(){return this.shouldStick(),this.isStuck}async setTriggerPos(t){return this._offset=t}async getTriggerPos(){return this.triggerPos}async pauseHiding(t){this.pauseHide=t}updateTriggerOffset(){this.trigger&&this.scrollParent&&this.listenForScrollParent&&(this.triggerPos=c(this.trigger,this.scrollParent))}stickerResizeListener(){this.content&&window.ResizeObserver&&(this.contentSizeObserver&&(this.contentSizeObserver.disconnect(),this.contentSizeObserver=void 0),this.contentSizeObserver=new ResizeObserver((t=>{for(const i of t){if(this.pauseResizeWatcher)return;i.contentRect.height&&("top"===this.position&&(this.host.style.height=i.contentRect.height+"px"),"bottom"===this.position&&(this.host.style.minHeight=i.contentRect.height+"px"))}})),this.contentSizeObserver.observe(this.content))}quietModeChange(){"on"===this.quietMode?requestAnimationFrame((()=>this.quietModeIsOn=!0)):"off"===this.quietMode&&requestAnimationFrame((()=>this.quietModeIsOn=!1))}setOffset(){let t,i,s,e;this.trigger&&this.trigger.setAttribute("style","");const h=this.isRootSticker||this.stickToEle?this.sticker:this.host;if(!h)return;"object"==typeof this.offset?({v:t,h:i}=this.offset):t=i=this.offset,"object"==typeof this._offset?({v:t=s,h:i=e}=this._offset):s=e=this._offset;const n=s=>{const e=s.match(/(top|bottom)/)?t:i;o(s),h.style[s]=e+"px",this.host.style.setProperty("--hide-transform-amount",e?`(110% + ${e}px)`:null)},o=h=>{const n=h.match(/(top|bottom)/)?t+s:i+e;this.trigger.style[h]=-1*n+"px",this.trigger.style.position="relative",this.trigger.style.minHeight="1px",this.trigger.style.maxHeight="1px",this.trigger.style.overflow="hidden"};(this.positions.includes("start")&&this.isRtl||this.positions.includes("end")&&!this.isRtl)&&n("right"),(this.positions.includes("end")&&this.isRtl||this.positions.includes("start")&&!this.isRtl)&&n("left"),this.positions.includes("top")&&n("top"),this.positions.includes("bottom")&&n("bottom")}positionChange(){this.positions=this.position.split("-"),this.setOffset()}async stuckChange(){this.isStuck?this.stickToEle?(this.slottedContent=Array.from(this.host.children),this.slottedContent.forEach((t=>{this.stickToEle.appendChild(t),t.style.order=this.stickerIndex+""})),this.nanoStuck.emit({sticker:this.stickToEle})):this.nanoStuck.emit({sticker:this.host}):(this.scrollHide=!1,this.stickToEle?(this.slottedContent.forEach((t=>{this.host.appendChild(t),t.style.order=""})),this.nanoUnstuck.emit({sticker:this.stickToEle})):this.nanoUnstuck.emit({sticker:this.host}))}attachScrollListeners(){this.quietModeIsOn?this.scrollParent.addEventListener("scroll",this.onScroll,{passive:!0,capture:!1}):this.scrollParent&&(this.scrollParent.removeEventListener("scroll",this.onScroll),this.moveTrigger(!0))}handleParentEvents(t,i=null){this.listenForScrollParent&&(i&&this.manageListenersOnParent(!1,i),this.scrollParent&&this.manageListenersOnParent(!this.stickToEle))}stickToEleChange(t,i){this.stickToEle&&(this.stickToEle.addEventListener("nanoHide",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoShow",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoStuck",this.onStickToDisplayEvent),this.stickToEle.addEventListener("nanoUnstuck",this.onStickToDisplayEvent)),i&&(i.removeEventListener("nanoHide",this.onStickToDisplayEvent),i.removeEventListener("nanoShow",this.onStickToDisplayEvent),i.removeEventListener("nanoStuck",this.onStickToDisplayEvent),i.removeEventListener("nanoUnstuck",this.onStickToDisplayEvent))}stickToChange(){this.stickToEle="string"==typeof this.stickTo?this.scrollParent.querySelector(this.stickTo):this.stickTo?this.stickTo:void 0}visibilityDecisionHandler(){this.hide=!(!this.multiStickerHide&&!this.scrollHide)}handleHideChange(){this.hide?this.nanoHide.emit({sticker:this.host}):this.nanoShow.emit({sticker:this.host})}setupIO(){if(this.io&&(this.io.disconnect(),this.io=void 0),!this.scrollParent||!this.hasBootstrapped||!this.trigger)return;this.isRootSticker=this.scrollParent instanceof Document;let t=this.scrollParent;this.scrollParent instanceof Document&&(t=null),this.io=new window.IntersectionObserver((t=>{!this.pauseResizeWatcher&&this.isSticky&&this.shouldStick(t.slice(-1)[0])}),{root:t}),this.io.observe(this.trigger)}setupParentResizeListener=()=>{if(!window.ResizeObserver)return;this.parentSizeObserver&&(this.parentSizeObserver.disconnect(),this.parentSizeObserver=void 0),this.parentSizeObserver=new ResizeObserver((t=>{for(const i of t){let t,s;i.contentRect.height&&(t=i.contentRect.height),i.contentRect.width&&(s=i.contentRect.width),"object"==typeof this.quietMode&&(this.quietModeIsOn=s<this.quietMode.w||t<this.quietMode.h),this.breakPointMin&&(this.isSticky=s>this.breakPointMin),this.breakPointMax&&(this.isSticky=s<this.breakPointMax),this.isRootSticker&&this.sticker&&this.autoResize&&(this.sticker.style.width=this.host.scrollWidth+"px")}}));const t=this.scrollParent instanceof Document?this.scrollParent.documentElement:this.scrollParent;t&&this.parentSizeObserver.observe(t)};onStickToDisplayEvent=t=>{if(t.detail.sticker===this.stickToEle)switch(t.type){case"nanoHide":this._offset=0,this.cacheOffset=this.offset,this.offset=0,this.isStuck||this.moveTrigger(!1),!this.isRootSticker&&this.quietModeIsOn&&requestAnimationFrame((()=>{this.stickToEle.style.minHeight=this.stickToEleInitSize.height+(this.host.scrollHeight+("object"==typeof this.cacheOffset?this.cacheOffset.v:this.cacheOffset))+"px",this.stickToEle.setTriggerPos(-1*this.stickToEleInitSize.height)}));break;case"nanoShow":this._offset=this.stickToEleInitSize.height,this.offset=this.cacheOffset,this.moveTrigger(!0),!this.isRootSticker&&this.quietModeIsOn&&requestAnimationFrame((()=>{this.stickToEle.style.minHeight="",this.stickToEle.setTriggerPos(0)}));break;case"nanoStuck":this.stickToEleInitSize=this.stickToEle.getBoundingClientRect(),this._offset=this.stickToEleInitSize.height}};manageListenersOnParent(t,i){const s=i||this.scrollParent;if(s){if(t)s.addEventListener("nanoStuck",this.onStickEvent),s.addEventListener("nanoUnstuck",this.onStickEvent),this.quietModeIsOn&&this.attachScrollListeners();else try{this.quietModeIsOn&&s.removeEventListener("scroll",this.onScroll),s.removeEventListener("nanoStuck",this.onStickEvent),s.removeEventListener("nanoUnstuck",this.onStickEvent)}catch(t){console.error("Events haven`t been added")}this.setupParentResizeListener()}}onStickEvent=async t=>{const i=t.detail?t.detail.sticker:null;if(!i||i.position!==this.position)return;const s=await i.getTriggerPos();if("nanoStuck"===t.type&&i!==this.host&&i.scrollParent===this.host.scrollParent){if(this.stickerIndex++,!this.hideOnNewStickers)return;(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top)&&(this.multiStickerHide=!0,this.stuckCounter++)}if("nanoUnstuck"===t.type&&i!==this.host&&i.scrollParent===this.host.scrollParent){if(this.stickerIndex--,!this.hideOnNewStickers)return;(this.positions.includes("top")&&this.triggerPos.top<s.top||this.positions.includes("bottom")&&this.triggerPos.top>s.top)&&(this.stuckCounter--,this.stuckCounter<1&&(this.multiStickerHide=!1))}};onScroll=()=>{const t=(i=this.scrollParent)instanceof Document?window.pageYOffset:i.scrollTop;var i;t<this.scrollPosCache&&(this.positions.includes("bottom")?this.handleScrollAway(t):this.handleScrollTo()),t>this.scrollPosCache&&(this.positions.includes("bottom")?this.handleScrollTo():this.handleScrollAway(t)),this.scrollPosCache=t};handleScrollTo(){this.scrollPosThresholdCache=null,this.scrollHide&&(!0!==this.scrollingTo&&(this._offset=this.cacheOffset||this._offset),this.scrollingTo=!0,this.scrollHide=!1)}handleScrollAway(t){this.scrollHide||this.isStuck&&(!1!==this.scrollingTo&&(this.cacheOffset=this._offset,this._offset=0),this.scrollingTo=!1,this.scrollPosThresholdCache?!this.pauseHide&&Math.abs(t-this.scrollPosThresholdCache)>100&&(this.scrollHide=!0):this.scrollPosThresholdCache=t)}moveTrigger(t){this.positions.includes("bottom")&&!t||!this.positions.includes("bottom")&&t?this.host.parentNode.insertBefore(this.trigger,this.host):this.host.parentNode.insertBefore(this.trigger,this.host.nextSibling)}shouldStick(t){let i;if(this.positions.includes("top"))i=this.isRootSticker?this.trigger.getBoundingClientRect().top:c(this.trigger,this.scrollParent).top,this.isStuck=i<-1;else if(this.positions.includes("bottom")){i=this.trigger.getBoundingClientRect().top;const s=t&&t.rootBounds?t.rootBounds:(this.scrollParent instanceof Document?document.documentElement:this.scrollParent).getBoundingClientRect();this.isStuck=!t.isIntersecting||i>s.height+s.top}}bootstrapGurantor(){this.hasBootstrapped=!0;const t=this.scrollParent||o(this.host);this.scrollParent=t===document.documentElement?document:t,this.isRootSticker=this.scrollParent instanceof Document,this.trigger=this.trigger||document.createElement("div"),this.trigger.innerHTML=" ",this.trigger.classList.add("sticker-trigger"),this.positionChange(),this.moveTrigger(!0),this.quietModeChange(),this.listenForScrollParent=!0,this.handleParentEvents(!0),this.stickerIndex=Array.from(this.scrollParent.querySelectorAll(r("nano-sticker"))).filter((t=>t.position===this.position)).findIndex((t=>t===this.host)),this.setOffset(),this.stickerResizeListener(),this.setupParentResizeListener(),this.slottedContent=Array.from(this.host.children),this.slottedContent.forEach((t=>{t.style.order=this.stickerIndex+""})),this.updateTriggerOffset(),this.stickToChange(),this.setupIO(),this.onStickToDisplayEvent=n(this.onStickToDisplayEvent,50)}connectedCallback(){this.isRtl="rtl"===this.host.dir||"rtl"===this.host.ownerDocument.dir,setTimeout((()=>{this.hasBootstrapped||this.bootstrapGurantor()}),1e3)}disconnectedCallback(){this.io&&(this.io.disconnect(),this.io=void 0),this.parentSizeObserver&&(this.parentSizeObserver.disconnect(),this.parentSizeObserver=void 0),this.scrollParent=null,this.hasBootstrapped=!1}render(){return a(e,{key:"c8aac0477fcb4d6a456715ec51fb773236bbaa7f",sticky:!this.isRootSticker&&!this.stickToEle&&this.isSticky,hide:this.hide&&this.isStuck,siblings:this.stuckCounter,index:this.stickerIndex,stuck:this.isStuck&&this.isSticky,"placed-bottom":this.positions.includes("bottom"),"placed-top":this.positions.includes("top"),"placed-end":this.positions.includes("end"),"placed-start":this.positions.includes("start"),class:"nano-sticker"},a("div",{key:"15a548042c3ff9b93c38d21e383c1023174ae22e",class:{sticker:!0,sticky:this.isRootSticker&&this.isSticky,stuck:this.isStuck&&this.isRootSticker&&this.isSticky,hide:this.isRootSticker&&this.hide&&this.isStuck},ref:t=>this.sticker=t},a("div",{key:"6d8bf085310c30c1705beb85c0ca3de88f93ee08",class:"sticker-content",ref:t=>this.content=t},a("slot",{key:"02fb0c73c8c16f10fbaf2183aa1c26152d984ac6"}))))}static get watchers(){return{trigger:["updateTriggerOffset"],scrollParent:["updateTriggerOffset","handleParentEvents","setupIO"],position:["stickerResizeListener","positionChange"],quietMode:["quietModeChange"],offset:["setOffset"],_offset:["setOffset"],isStuck:["stuckChange"],quietModeIsOn:["attachScrollListeners"],stickToEle:["handleParentEvents","stickToEleChange"],stickTo:["stickToChange"],multiStickerHide:["visibilityDecisionHandler"],scrollHide:["visibilityDecisionHandler"],hide:["handleHideChange"]}}};d.style=':host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--stuck-left:initial;--stuck-right:initial;--stuck-z-index:var(--nano-z-index-menubar);--top-hide:translateY(-110%);--bottom-hide:translateY(110%);display:block;max-inline-size:100%}:host([sticky]){position:sticky;transition:0.3s ease transform;will-change:min-block-size}:host([sticky][stuck]){inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index) !important}:host([sticky][hide][placed-top]){transform:var(--top-hide)}:host([sticky][hide][placed-bottom]){transform:var(--bottom-hide)}:host([sticky][index="1"]){z-index:calc(var(--stuck-z-index) + 1)}:host([sticky][index="2"]){z-index:calc(var(--stuck-z-index) + 2)}:host([sticky][index="3"]){z-index:calc(var(--stuck-z-index) + 3)}:host([sticky][index="4"]){z-index:calc(var(--stuck-z-index) + 4)}:host([sticky][index="5"]){z-index:calc(var(--stuck-z-index) + 5)}.sticker{display:inherit;max-inline-size:inherit;inline-size:100%}.sticker:not(.stuck){inline-size:auto !important}.sticker.sticky{transition:0.3s ease all;position:relative}:host([index="1"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 1)}:host([index="2"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 2)}:host([index="3"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 3)}:host([index="4"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 4)}:host([index="5"]) .sticker.sticky{z-index:calc(var(--stuck-z-index) + 5)}.sticker.stuck{position:fixed;inset-inline:var(--stuck-left) var(--stuck-right);z-index:var(--stuck-z-index);transform:translateY(0)}:host([placed-top]) .sticker.stuck{inset-block-start:0}:host([placed-bottom]) .sticker.stuck{inset-block-end:0}:host([placed-top]) .sticker.stuck.hide{transform:var(--top-hide)}:host([placed-bottom]) .sticker.stuck.hide{transform:var(--bottom-hide)}.sticker-content{display:flex;flex-wrap:wrap}';export{d as nano_sticker}
|