@nanoporetech-digital/components 8.3.2 → 8.4.0
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/constructible-style-BsHBb9au.js +133 -0
- package/dist/cjs/{fade-BzBFJiQK.js → fade-DBuNbJEw.js} +1 -1
- package/dist/cjs/{fullscreen-Cz3eYnOp.js → fullscreen-Bk4jXSN0.js} +1 -1
- package/dist/cjs/index-DGttnXif.js +28 -16
- package/dist/cjs/{lazyload-DIFYejbf.js → lazyload-gQqOMvpr.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-accordion.cjs.entry.js +28 -9
- package/dist/cjs/nano-avatar_5.cjs.entry.js +11 -11
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/{nano-data-table-DFEflpc4.js → nano-data-table-BHQIpW0N.js} +31 -1
- package/dist/cjs/nano-data-table.cjs.entry.js +1 -1
- package/dist/cjs/nano-details.cjs.entry.js +6 -4
- package/dist/cjs/nano-field-validator.cjs.entry.js +4 -2
- package/dist/cjs/nano-footer.cjs.entry.js +2 -2
- package/dist/cjs/nano-global-nav.cjs.entry.js +21 -20
- package/dist/cjs/nano-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/nano-grid_2.cjs.entry.js +6 -130
- package/dist/cjs/nano-hero.cjs.entry.js +4 -4
- package/dist/cjs/{nano-icon_3.cjs.entry.js → nano-icon-button_2.cjs.entry.js} +2 -320
- package/dist/cjs/nano-icon.cjs.entry.js +326 -0
- package/dist/cjs/nano-in-page-nav.cjs.entry.js +1 -1
- package/dist/cjs/nano-increment.cjs.entry.js +1 -1
- package/dist/cjs/nano-intersection-observe.cjs.entry.js +1 -1
- package/dist/cjs/nano-masked-overflow.cjs.entry.js +3 -3
- package/dist/cjs/nano-menu-drawer.cjs.entry.js +2 -2
- package/dist/cjs/nano-more-less.cjs.entry.js +2 -2
- package/dist/cjs/nano-rating.cjs.entry.js +4 -4
- package/dist/cjs/nano-resize-observe.cjs.entry.js +2 -2
- package/dist/cjs/nano-slide.cjs.entry.js +1 -1
- package/dist/cjs/{nano-slides-C576PTmo.js → nano-slides-C73bSG0h.js} +7 -7
- package/dist/cjs/nano-slides.cjs.entry.js +1 -1
- package/dist/cjs/nano-sortable.cjs.entry.js +1 -1
- package/dist/cjs/nano-step-accordion.cjs.entry.js +101 -0
- package/dist/cjs/nano-step-breadcrumb.cjs.entry.js +133 -0
- package/dist/cjs/nano-sticker.cjs.entry.js +2 -2
- package/dist/cjs/nano-tab-content.cjs.entry.js +2 -2
- 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-Clb2QknR.js → page-dots-BLPta5z5.js} +1 -1
- package/dist/cjs/{table.worker-DxRLPmU9.js → table.worker-BeE8kdSf.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/accordion/accordion.js +51 -13
- package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/collection/components/data-table/table.js +1 -13
- package/dist/collection/components/details/details.js +9 -6
- package/dist/collection/components/field-validator/field-validator.js +4 -2
- package/dist/collection/components/footer/footer.css +7 -7
- package/dist/collection/components/footer/footer.js +2 -1
- package/dist/collection/components/global-nav/global-nav.js +22 -21
- package/dist/collection/components/global-search-results/global-search-results.js +4 -4
- package/dist/collection/components/grid/grid-item.js +1 -1
- package/dist/collection/components/grid/grid.js +1 -1
- package/dist/collection/components/hero/hero.js +4 -4
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/validate.js +1 -1
- package/dist/collection/components/img/img.js +3 -3
- package/dist/collection/components/in-page-nav/in-page-nav.js +1 -1
- package/dist/collection/components/increment/increment.js +1 -1
- package/dist/collection/components/intersection-observe/intersection-observe.js +1 -1
- package/dist/collection/components/masked-overflow/masked-overflow.js +3 -3
- package/dist/collection/components/menu-drawer/menu-drawer.js +2 -2
- package/dist/collection/components/more-less/more-less.js +2 -2
- package/dist/collection/components/rating/rating.js +4 -4
- package/dist/collection/components/resize-observe/resize-observe.js +2 -2
- package/dist/collection/components/select/select.js +7 -7
- package/dist/collection/components/slides/slide.js +1 -1
- package/dist/collection/components/slides/slides.js +3 -3
- package/dist/collection/components/sortable/sortable.js +1 -1
- package/dist/collection/components/step-accordion/step-accordion.css +138 -0
- package/dist/collection/components/step-accordion/step-accordion.js +190 -0
- package/dist/collection/components/step-breadcrumb/step-breadcrumb.css +231 -0
- package/dist/collection/components/step-breadcrumb/step-breadcrumb.js +222 -0
- package/dist/collection/components/sticker/sticker.js +2 -2
- package/dist/collection/components/table/table.js +2 -2
- package/dist/collection/components/tabs/tab-content.js +2 -2
- package/dist/collection/components/tabs/tab.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/utils/constructible-style.js +2 -2
- package/dist/collection/utils/performance.js +17 -0
- package/dist/components/accordion.js +80 -0
- package/dist/components/constructible-style.js +131 -0
- package/dist/components/details.js +6 -4
- package/dist/components/global-search-results.js +4 -4
- package/dist/components/grid.js +5 -129
- package/dist/components/icon.js +2 -2
- package/dist/components/img.js +3 -3
- package/dist/components/masked-overflow.js +3 -3
- package/dist/components/nano-accordion.js +1 -56
- package/dist/components/nano-data-table.js +30 -0
- package/dist/components/nano-field-validator.js +4 -2
- package/dist/components/nano-footer.js +2 -2
- package/dist/components/nano-global-nav.js +21 -20
- package/dist/components/nano-grid-item.js +1 -1
- package/dist/components/nano-hero.js +4 -4
- package/dist/components/nano-in-page-nav.js +1 -1
- package/dist/components/nano-increment.js +1 -1
- package/dist/components/nano-intersection-observe.js +1 -1
- package/dist/components/nano-menu-drawer.js +2 -2
- package/dist/components/nano-more-less.js +2 -2
- package/dist/components/nano-rating.js +4 -4
- package/dist/components/nano-slide.js +1 -1
- package/dist/components/nano-sortable.js +1 -1
- package/dist/components/nano-step-accordion.d.ts +11 -0
- package/dist/components/nano-step-accordion.js +141 -0
- package/dist/components/nano-step-breadcrumb.d.ts +11 -0
- package/dist/components/nano-step-breadcrumb.js +181 -0
- package/dist/components/nano-tab-content.js +2 -2
- package/dist/components/nano-tab.js +2 -2
- package/dist/components/nano-table.js +2 -2
- package/dist/components/resize-observe.js +2 -2
- package/dist/components/select.js +7 -7
- package/dist/components/slides.js +3 -3
- package/dist/components/sticker.js +2 -2
- package/dist/components/tooltip.js +2 -2
- package/dist/esm/constructible-style-B2_GfhhS.js +131 -0
- package/dist/esm/{fade-D4P3XGVa.js → fade-C0NluV0K.js} +1 -1
- package/dist/esm/{fullscreen-Cfl6LvH2.js → fullscreen-Ck_w6MCZ.js} +1 -1
- package/dist/esm/index-BM3Om9WE.js +28 -16
- package/dist/esm/{lazyload-CQYknGN2.js → lazyload-DddTyM-A.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-accordion.entry.js +28 -9
- package/dist/esm/nano-avatar_5.entry.js +11 -11
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/{nano-data-table-Bqk8ZUaL.js → nano-data-table-CWliPF7Y.js} +31 -1
- package/dist/esm/nano-data-table.entry.js +1 -1
- package/dist/esm/nano-details.entry.js +6 -4
- package/dist/esm/nano-field-validator.entry.js +4 -2
- package/dist/esm/nano-footer.entry.js +2 -2
- package/dist/esm/nano-global-nav.entry.js +21 -20
- package/dist/esm/nano-grid-item.entry.js +1 -1
- package/dist/esm/nano-grid_2.entry.js +7 -131
- package/dist/esm/nano-hero.entry.js +4 -4
- package/dist/esm/{nano-icon_3.entry.js → nano-icon-button_2.entry.js} +4 -321
- package/dist/esm/nano-icon.entry.js +324 -0
- package/dist/esm/nano-in-page-nav.entry.js +1 -1
- package/dist/esm/nano-increment.entry.js +1 -1
- package/dist/esm/nano-intersection-observe.entry.js +1 -1
- package/dist/esm/nano-masked-overflow.entry.js +3 -3
- package/dist/esm/nano-menu-drawer.entry.js +2 -2
- package/dist/esm/nano-more-less.entry.js +2 -2
- package/dist/esm/nano-rating.entry.js +4 -4
- package/dist/esm/nano-resize-observe.entry.js +2 -2
- package/dist/esm/nano-slide.entry.js +1 -1
- package/dist/esm/{nano-slides-DcJWApi6.js → nano-slides-BiPGpe5F.js} +7 -7
- package/dist/esm/nano-slides.entry.js +1 -1
- package/dist/esm/nano-sortable.entry.js +1 -1
- package/dist/esm/nano-step-accordion.entry.js +99 -0
- package/dist/esm/nano-step-breadcrumb.entry.js +131 -0
- package/dist/esm/nano-sticker.entry.js +2 -2
- package/dist/esm/nano-tab-content.entry.js +2 -2
- package/dist/esm/nano-tab.entry.js +2 -2
- package/dist/esm/nano-table.entry.js +2 -2
- package/dist/esm/{page-dots-kX7jiD3G.js → page-dots-WKehEjjM.js} +1 -1
- package/dist/esm/{table.worker-a52UkSRM.js → table.worker-DJks4i_l.js} +1 -1
- package/dist/nano-components/constructible-style-B2_GfhhS.js +4 -0
- package/dist/nano-components/{fade-D4P3XGVa.js → fade-C0NluV0K.js} +1 -1
- package/dist/nano-components/{fullscreen-Cfl6LvH2.js → fullscreen-Ck_w6MCZ.js} +1 -1
- package/dist/nano-components/{lazyload-CQYknGN2.js → lazyload-DddTyM-A.js} +1 -1
- package/dist/nano-components/nano-accordion.entry.js +1 -1
- package/dist/nano-components/nano-avatar_5.entry.js +1 -1
- package/dist/nano-components/nano-components.css +32 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-data-table-CWliPF7Y.js +4 -0
- package/dist/nano-components/nano-data-table.entry.js +1 -1
- package/dist/nano-components/nano-details.entry.js +1 -1
- package/dist/nano-components/nano-field-validator.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-button_2.entry.js +4 -0
- package/dist/nano-components/nano-icon.entry.js +4 -0
- package/dist/nano-components/nano-in-page-nav.entry.js +1 -1
- package/dist/nano-components/nano-increment.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-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-DcJWApi6.js → nano-slides-BiPGpe5F.js} +3 -3
- 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-step-accordion.entry.js +4 -0
- package/dist/nano-components/nano-step-breadcrumb.entry.js +4 -0
- 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.entry.js +1 -1
- package/dist/nano-components/nano-table.entry.js +1 -1
- package/dist/nano-components/{page-dots-kX7jiD3G.js → page-dots-WKehEjjM.js} +1 -1
- package/dist/nano-components/{table.worker-a52UkSRM.js → table.worker-DJks4i_l.js} +1 -1
- package/dist/stencil.config.js +1 -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/dist/types/components/accordion/accordion.d.ts +10 -4
- package/dist/types/components/details/details.d.ts +3 -2
- package/dist/types/components/footer/footer.d.ts +1 -0
- package/dist/types/components/global-nav/global-nav.d.ts +1 -1
- package/dist/types/components/step-accordion/step-accordion.d.ts +38 -0
- package/dist/types/components/step-breadcrumb/step-breadcrumb.d.ts +37 -0
- package/dist/types/components.d.ts +174 -4
- package/dist/types/utils/performance.d.ts +1 -0
- package/docs-json.json +352 -18
- package/docs-vscode.json +41 -2
- package/hydrate/index.js +403 -98
- package/hydrate/index.mjs +403 -98
- package/package.json +2 -2
- package/dist/nano-components/nano-data-table-Bqk8ZUaL.js +0 -4
- package/dist/nano-components/nano-icon_3.entry.js +0 -4
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/generate-vue-component.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/index.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/output-vue.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/plugin.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/types.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/utils.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/stencil.config.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/stencil.config.prod.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/testing/mocks/intersection-observer.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/wdio.conf.d.ts +0 -0
@@ -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-BM3Om9WE.js";import{h as s}from"./renderer-BaP2L8CT.js";import{a as o}from"./math-BEqsTfVK.js";const
|
4
|
+
import{r as n,c as i,g as a,a as t}from"./index-BM3Om9WE.js";import{h as s}from"./renderer-BaP2L8CT.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:"bacb1319a8119e09eb7223396c0fd308d8f1bcf0",class:"nano-rating"},s("label",{key:"e96dd3dc5d27aad666c9273fb48a0dde49b05bcd",class:"rating-label"+(this.hideLabel?" visually-hidden":""),part:"label",htmlFor:this.name},s("slot",{key:"a50e1bb855e58080b964cde932b6e850be44cff5",name:"label"},this.label)),s("input",{key:"c95ba7bf46db99df309030b4e7c9a006909e47a7",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:"a04e24da1bf879b551f31b3692e990e912739643",class:"rating-wrap"},s("div",{key:"2686f949da578a7bcdbd3043f131edccc24f0f30",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:"890e0a8296994061f88cdfa42811ff61d1fbb2b2",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:"fad1f1de103c1451d848a215c9c7b18084f172ce",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{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-BM3Om9WE.js";import{h}from"./renderer-BaP2L8CT.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:"
|
4
|
+
import{r as t,c as s,g as i,e,a as n}from"./index-BM3Om9WE.js";import{h}from"./renderer-BaP2L8CT.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:"3d1301e7d8a6c0f96188ea4dadddcc3f71a349cc",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:"363d69b62debe81c7d3d1790d4dead42538f7118"}),!!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
|
4
|
+
import{r as t,c as e,a as o}from"./index-BM3Om9WE.js";import{h as i}from"./renderer-BaP2L8CT.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:"3d5f03684b14b0944b06802a26955b035ae20a9f",class:"nano-slide"},i("slot",{key:"5115d41ae13fb0980ae656c106b9105b5f14703b"}))}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}
|
@@ -7,16 +7,16 @@ import{r as t,c as i,g as s,e as n,d as e,a as o}from"./index-BM3Om9WE.js";impor
|
|
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 P=0;const E={};function D(t,i){const s=m.getQueryElement(t);if(s){if(this.element=s,this.element.flickityGUID){const t=E[this.element.flickityGUID];if(!E[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 L=D.prototype;m.extend(L,r.prototype),L._create=function(){const t=this.guid=++P;this.element.flickityGUID=t,E[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()},L.option=function(t){m.extend(this.options,t)},L.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"))},L._createSlider=function(){const t=document.createElement("div");t.className="flickity-slider",t.style[this.originSide]=0,this.slider=t},L._filterFindCellElements=function(t){return m.filterFindElements(t,this.options.cellSelector)},L.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()},L._makeCells=function(t){return this._filterFindCellElements(t).map((function(t){return new w(t,this)}),this)},L.getLastCell=function(){return this.cells[this.cells.length-1]},L.getLastSlide=function(){return this.slides[this.slides.length-1]},L.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},L._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},L._sizeCells=function(t){t.forEach((function(t){t.getSize()}))},L.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()},L._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}},L._init=L.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},L.getSize=function(){this.size=g(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};const F={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};function R(){}L.setCellAlign=function(){const t=F[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign},L.setGallerySize=function(){this.options.setGallerySize&&(this.viewport.style.height=(this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight)+"px")},L._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)},L._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},L._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)},L.dispatchEvent=function(t,i,s){const n=i?[i].concat(s):s;this.emitEvent(t,n)},L.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")},L._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)},L.previous=function(t,i){this.select(this.selectedIndex-1,t,i)},L.next=function(t,i){this.select(this.selectedIndex+1,t,i)},L.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])},L.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},L.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)},L.selectCell=function(t,i,s){const n=this.queryCell(t);if(!n)return;const e=this.getCellSlideIndex(n);this.select(e,i,s)},L.getCellSlideIndex=function(t){for(let i=0;i<this.slides.length;i++)if(-1!=this.slides[i].cells.indexOf(t))return i},L.getCell=function(t){for(let i=0;i<this.cells.length;i++){const s=this.cells[i];if(s.element==t)return s}},L.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},L.getCellElements=function(){return this.cells.map((function(t){return t.element}))},L.getParentCell=function(t){return this.getCell(t)||(t=m.getParent(t,".flickity-slider > *"),this.getCell(t))},L.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},L.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)},L.uiChange=function(){this.emitEvent("uiChange")},L.childUIPointerDown=function(t){"touchstart"!=t.type&&t.preventDefault(),this.focus()},L.onresize=function(){this.watchCSS(),this.resize()},m.debounceMethod(D,"onresize",150),L.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))},L.watchCSS=function(){this.options.watchCSS&&(-1!=M(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},L.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]()}},L.focus=function(){const t=window.pageYOffset;this.element.focus({preventScroll:!0}),window.pageYOffset!=t&&window.scrollTo(window.pageXOffset,t)},L.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"))},L.destroy=function(){this.deactivate(),window.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),delete this.element.flickityGUID,delete E[this.guid]},m.extend(L,C),D.data=function(t){const i=(t=m.getQueryElement(t))&&t.flickityGUID;return i&&E[i]},m.htmlInit(D,"flickity"),D.Cell=w,D.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"]};
|
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"]};
|
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(){}j._bindPostStartEvents=function(t){if(!t)return;const i=O[t.type];i.forEach((function(t){window.addEventListener(t,this)}),this),this._boundPointerEvents=i},j._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach((function(t){window.removeEventListener(t,this)}),this),delete this._boundPointerEvents)},j.onmousemove=function(t){this._pointerMove(t,t)},j.onpointermove=function(t){t.pointerId==this.pointerIdentifier&&this._pointerMove(t,t)},j.ontouchmove=function(t){const i=this.getTouch(t.changedTouches);i&&this._pointerMove(t,i)},j._pointerMove=function(t,i){this.pointerMove(t,i)},j.pointerMove=function(t,i){this.emitEvent("pointerMove",[t,i])},j.onmouseup=function(t){this._pointerUp(t,t)},j.onpointerup=function(t){t.pointerId==this.pointerIdentifier&&this._pointerUp(t,t)},j.ontouchend=function(t){const i=this.getTouch(t.changedTouches);i&&this._pointerUp(t,i)},j._pointerUp=function(t,i){this._pointerDone(),this.pointerUp(t,i)},j.pointerUp=function(t,i){this.emitEvent("pointerUp",[t,i])},j._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},j._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},j.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(){},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 X=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 U=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(),_(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.updateOptions({fade:!1,percentPosition:!0}),void s.on("scroll",this.animation);switch(this.animation){case"fade":this.updateOptions({fade:!0,percentPosition:!0});break;case"parallax":this.updateOptions({fade:!1,percentPosition:!0}),s.on("scroll",this.parallax);break;default:this.updateOptions({fade:!1,percentPosition:!0})}}updateOptions(t){this.options={...this.options,...t}}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(),_(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-Cfl6LvH2.js"),this.hasFullScreenModule=!0),!this.hasLazyLoadModule&&t.lazyLoad&&(await import("./lazyload-CQYknGN2.js"),this.hasLazyLoadModule=!0),!this.hasDotsModule&&t.pageDots&&(await import("./page-dots-kX7jiD3G.js"),this.hasDotsModule=!0),!this.hasFadeModule&&t.fade&&(await import("./fade-D4P3XGVa.js"),this.hasFadeModule=!0)}async initflickity(){const t=this.normalizeOptions();await this.loadFlickityModules(t),await _(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 X(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:"25fe656149129885383046b7f2cb81ecc965db13",class:"nano-slides"},c("div",{key:"84d9f878b91454a12311ffc5203d49a243fb9c66",class:{slideshow:!0,ready:this.ready,"not-ready":!this.ready},part:"base"},c("div",{key:"b975dcadc6d7b7b5b7e915980527eba3bf740165",ref:t=>this.flickityEl=t,class:{"flickity-container":!0,"slides-ready":this.slidesReady,"slides-not-ready":!this.slidesReady},part:"slide-container"},c("slot",{key:"a9b13e8e0c8808617c694953e3fef74a57d719a8"})),c("div",{key:"9caacd27973cc67740145365ab7a10c75ab44219",class:"ui-extras"},c("slot",{key:"ad80afb5ddbcc54b10310a4e115403fee8dda215",name:"ui"}))))}static get watchers(){return{options:["optionsChanged"],navbtns:["navbtnsChanged"],pager:["pagerChanged"],fullscreenbtn:["fullscreenBtnChanged"],fullscreen:["fullscreenChanged"],animation:["animationChange"],currentSlide:["currentSlideChange"],iCurrentSlide:["internalSlideChange"],autoplay:["autoPlayChange"]}}},_=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)};U.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,U as S,R as U,m as u}
|
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 U=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.updateOptions({fade:!1,percentPosition:!0}),void s.on("scroll",this.animation);switch(this.animation){case"fade":this.updateOptions({fade:!0,percentPosition:!0});break;case"parallax":this.updateOptions({fade:!1,percentPosition:!0}),s.on("scroll",this.parallax);break;default:this.updateOptions({fade:!1,percentPosition:!0})}}updateOptions(t){this.options={...this.options,...t}}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-Ck_w6MCZ.js"),this.hasFullScreenModule=!0),!this.hasLazyLoadModule&&t.lazyLoad&&(await import("./lazyload-DddTyM-A.js"),this.hasLazyLoadModule=!0),!this.hasDotsModule&&t.pageDots&&(await import("./page-dots-WKehEjjM.js"),this.hasDotsModule=!0),!this.hasFadeModule&&t.fade&&(await import("./fade-C0NluV0K.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:"905eab94c6853e11f8103ade8a2711515a957a88",class:"nano-slides"},c("div",{key:"a6ca3bf953dc8ad8643b5f196bbbb4cad5696739",class:{slideshow:!0,ready:this.ready,"not-ready":!this.ready},part:"base"},c("div",{key:"ebf38a42c8c0ee4a192e2c10c7e882f4953cf707",ref:t=>this.flickityEl=t,class:{"flickity-container":!0,"slides-ready":this.slidesReady,"slides-not-ready":!this.slidesReady},part:"slide-container"},c("slot",{key:"ac8e76e6ee701ef38a73a1f753cbf7ad30ef9c59"})),c("div",{key:"e74cad0bd4ec8e2e15308b26550a697ff3dd4dcb",class:"ui-extras"},c("slot",{key:"8b7b6cfb6ba0e531a8c7707f5f65cba334e8eba6",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)};U.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,U 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-BiPGpe5F.js";import"./index-BM3Om9WE.js";import"./renderer-BaP2L8CT.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-BM3Om9WE.js";import{h as o}from"./renderer-BaP2L8CT.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(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:"d6d4f0ad6adf2a3f5e1d36b757e116b58e5b55b4",class:"nano-sortable"},o("div",{key:"d2cfcad28acfb052acbc6093dddfc247f5369bcf",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:"079bc29ba8c2f26163b7e3a23f0107f78db7b3fb"}))}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-BM3Om9WE.js";import{h as o}from"./renderer-BaP2L8CT.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(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:"f9329f87a60f9b77ad917b9bbf0aa526f4779e82",class:"nano-sortable"},o("div",{key:"c30a6d47b7a932906b17f0cd0cec80e0c7ea38ef",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:"a377bb437eb590b3f77d10f105b2fa09e0d21cbd"}))}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}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/*!
|
2
|
+
* Custom elements for Nanopore-Digital Web applications
|
3
|
+
*/
|
4
|
+
import{r as e,c as n,g as t,j as o,F as a}from"./index-BM3Om9WE.js";import{h as r}from"./renderer-BaP2L8CT.js";const i=class{constructor(t){e(this,t),this.nanoStepActive=n(this,"nanoStepActive",7)}get host(){return t(this)}nanoDetails;gridWorking=!0;activeStep=0;handleActiveStepChange(e,n){this.steps[e]?.enabled?this.nanoStepActive.emit({index:e,step:this.steps[e]}).defaultPrevented&&(this.activeStep=n):this.activeStep=n}_steps=[];stepProxyHandler={set:(e,n,t)=>(e[n]=t,o(this.host),!0)};get steps(){return this._steps}set steps(e){this._steps=[],e.forEach((e=>{const n=new Proxy(e,this.stepProxyHandler);this._steps.push(n)}))}nanoStepActive;handleToggle(e){e.detail.index!==this.activeStep&&(this.activeStep=e.detail.index)}isDetailsGridWorking(e){const n=document.createElement("div");n.style.gridColumn="2",n.style.height="1px",n.style.width="1px",n.style.visibility="hidden",e.appendChild(n);const t=e.getBoundingClientRect().x,o=n.getBoundingClientRect().x;return e.removeChild(n),Math.abs(o-t)>1}componentDidLoad(){if(!this.nanoDetails)return;const e=this.nanoDetails.shadowRoot.querySelector("details");e&&(this.gridWorking=this.isDetailsGridWorking(e))}render(){return r("nano-accordion",{key:"d92d8997c0486e26c132793db92b12e04d46a384",alwaysOpen:!0,onNanoToggle:e=>this.handleToggle(e)},this.steps.map(((e,n)=>r("nano-details",{open:n===this.activeStep,disabled:!e.enabled,class:{step:!0,"step--active":n===this.activeStep,"step--complete":e.complete,"step--grid-working":this.gridWorking,"step--grid-not-working":!this.gridWorking,"step--disabled":!e.enabled},ref:e=>this.nanoDetails=e},r("span",{class:"step-icon",slot:"icon-start"},n+1),r("div",{class:"step-header",slot:"label"},r("span",{class:"step-title "+(e.complete?"complete":"")},e.title),e.complete&&r(a,null,r("span",null," - "),r("span",{class:"step-change"},"Change"))),r("span",{slot:"icon-end"}),r("div",{class:"step-content"},r("slot",{name:`step-${n}`}))))))}static get watchers(){return{activeStep:["handleActiveStepChange"]}}};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{display:block}.nano-details{--padding:0;--btn-bg-color--hover:transparent;--btn-bg-color--active:transparent;border:none;margin-block-end:var(--nano-spacing-sm)}.nano-details::part(base){display:grid;grid-template-rows:auto auto;grid-template-columns:auto 1fr;gap:var(--nano-spacing-sm) 1.625rem}.nano-details.step--grid-working::part(base)::before{content:"";display:block;grid-column:1;grid-row:2;inline-size:1rem;min-block-size:1rem;border-inline-end:2px solid var(--nano-color-neutral-300)}.nano-details.step--grid-working::part(base)::after{content:"";grid-column:1;grid-row:2;inline-size:0.4rem;block-size:0.4rem;place-self:end end;translate:-50% 0;inset-inline-start:calc(50% - 2.5px);position:relative;border-inline-end:2px solid var(--nano-color-neutral-300);border-block-end:2px solid var(--nano-color-neutral-300);rotate:45deg}.nano-details:last-of-type::part(base)::before{min-block-size:0}.nano-details:last-of-type::part(base)::after{display:none}.nano-details::part(header){grid-column:1/-1;grid-row:1;display:inline-flex;gap:var(--nano-spacing-sm)}.nano-details::part(body){grid-column:2;grid-row:2}.nano-details::part(content-wrapper){padding:1px}.nano-details.step--grid-not-working::part(header){padding-block-end:var(--nano-spacing-sm)}.nano-details.step--grid-not-working::part(body){padding:0 0 0 2.5625rem}.step .step-header{display:inline-flex;gap:var(--nano-spacing-sm);align-items:center}.step .step-icon{display:inline-flex;align-items:center;justify-content:center;inline-size:2rem;block-size:2rem;border-radius:var(--nano-border-radius-circle);background-color:transparent;color:var(--nano-color-neutral-1400);border:1px solid var(--nano-color-neutral-300)}.step.step--complete .step-icon{background-color:var(--nano-color-success-1000);color:var(--nano-color-base-0);border:none}.step[open] .step-icon{background-color:var(--nano-color-primary-1000);color:var(--nano-color-base-0);border:none}.step .step-change{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);text-decoration:underline;color:var(--nano-color-primary-1200)}';export{i as nano_step_accordion}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/*!
|
2
|
+
* Custom elements for Nanopore-Digital Web applications
|
3
|
+
*/
|
4
|
+
import{r as e,c as t,g as i,j as n,a}from"./index-BM3Om9WE.js";import{h as s}from"./renderer-BaP2L8CT.js";import{C as o}from"./constructible-style-B2_GfhhS.js";import{a as r}from"./style-Ds52s5za.js";const l=class{constructor(i){e(this,i),this.nanoStepActive=t(this,"nanoStepActive",7)}get host(){return i(this)}calculatedWidth;cacheKey;activeStep=0;handleActiveStepChange(e,t){this.steps[e]?.enabled?this.nanoStepActive.emit({index:e,step:this.steps[e]}).defaultPrevented&&(this.activeStep=t):this.activeStep=t}nanoStepActive;_steps=[];stepProxyHandler={set:(e,t,i)=>(e[t]=i,n(this.host),!0)};get steps(){return this._steps}set steps(e){this._steps=[],e.forEach((e=>{const t=new Proxy(e,this.stepProxyHandler);this._steps.push(t)}))}handleStepsChange(){const e=this._steps.length,t=this._steps.reduce(((e,t)=>e+t.title.length),0);this.cacheKey="step-breadcrumb-"+e+t,this.calculatedWidth=`calc(${t}ch + ${1.5*e}rem + ${1.875*(e-1)}rem + ${10*e}px)`}styles=()=>`@container (width > ${this.calculatedWidth}) {\n .step-list.mobile.${this.cacheKey} { display: none; }\n .step-list.desktop.${this.cacheKey} { display: flex; }\n }\n @container (width <= ${this.calculatedWidth}) {\n .step-list.mobile.${this.cacheKey} { display: block; }\n .step-list.desktop.${this.cacheKey} { display: none; }\n }`;componentWillLoad(){this.handleStepsChange(),r(this.host.shadowRoot)}ControlTag=({step:e,index:t})=>s(e.enabled?e.href?"A":"BUTTON":"SPAN",{href:e.href||void 0,class:{"step-item":!0,"step-item--active":t===this.activeStep,"step-item--complete":e.complete,"step-item--disabled":!e.enabled},onClick:()=>{e.enabled&&(this.activeStep=t)}},s("span",{class:"step-item-icon",slot:"icon-start"},t+1),s("span",{class:"step-item-title"},e.title));render(){const e=this.steps.filter((e=>e.href)).length>0?"nav":"div";return s(a,{key:"c4d0e767abe4ee65f8e70534844e7ff254455af0"},s(e,{key:"6df94c5a9df7ae957b5ff243ecbe78e7c57233b3",class:"step-wrapper"},s("ul",{key:"ba1838191a0b888b630bfaba5125ae868f8aab38",class:`step-list desktop ${this.cacheKey}`},this.steps.map(((e,t)=>s("li",{class:"step-item-wrapper",key:t},s(this.ControlTag,{step:e,index:t}))))),s("div",{key:"64ae2c870494d376f4bb6484e97a5217dc4be311",class:`step-list mobile ${this.cacheKey}`},s("nano-dropdown",{key:"08d3dc468d594177b922ae91fb1ff02ed79d282c",dialogTitle:"Steps",class:"step-dropdown"},s("button",{key:"88ef0602628d800a3517da3c06e2eea1dad5a7dd",slot:"trigger",class:"step-trigger"},s("div",{key:"9d60be986e00fdd6814a910641cf94ef97fb2eed",class:"step-progress-circle",role:"progressbar","aria-valuenow":"2","aria-valuemin":"0","aria-valuemax":"5",style:{"--value":""+(this.activeStep+1),"--max":""+this.steps.length}},s("span",{key:"9e6eb88c9fc12f4228f55fe04cb2e1ce9a92e1f2",class:"step-progress-text"},s("strong",{key:"5e999ae958a2c43f5d8998e9083e91b11ea9041d"},this.activeStep+1)," of"," ",this.steps.length)),s("div",{key:"ccb66003ef35b256ae8d0d34c8cad7535680d05b",class:"step-trigger-text"},s("div",{key:"87f8a73802c33c289860b0eb530edae379fa5ebf",class:"step-trigger-now"},this.steps[0|this.activeStep]?.title||"Select a step"),s("div",{key:"9b00c5ae99376028ec077e782f430b0346580119",class:"step-trigger-next"},this.steps[this.activeStep+1]?.title||"Next step")),s("nano-icon",{key:"5073cf36a3a15599df7fa3816a62e72af257ab99",class:"step-trigger-icon",name:"light/chevron-down"})),s("nano-menu",{key:"18f15bb2439661286c019a6f20272db72a6ad1b1"},this.steps.map(((e,t)=>s("nano-nav-item",{class:{"step-item-mobile":!0,"step-item-mobile step-item--active":t===this.activeStep,"step-item-mobile step-item--complete":e.complete},disabled:!e.enabled,key:t,onClick:()=>{e.enabled&&(this.activeStep=t)}},s("span",{class:"step-item-icon",slot:"icon-start"},t+1),s("span",{class:"step-item-title"},e.title)))))))))}static get watchers(){return{activeStep:["handleActiveStepChange"],steps:["handleStepsChange"]}}};(function(e,t,i,n){var a,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(a=e[r])&&(o=(s<3?a(o):s>3?a(t,i,o):a(t,i))||o);s>3&&o&&Object.defineProperty(t,i,o)})([o({cacheKeyProperty:"calculatedWidth"}),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:type",Object)],l.prototype,"styles",void 0),l.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:block;--background:var(--nano-color-base-0)}.step-wrapper{container-type:inline-size}.step-list.desktop{display:flex;flex-direction:row;align-items:center;justify-content:space-between;list-style:none;padding:0;margin:0;position:relative;z-index:1}.step-list.desktop::before{content:"";display:block;flex-grow:1;block-size:1px;background-color:var(--nano-color-neutral-300);position:absolute;inset-block-start:50%;z-index:-1;inset-inline-start:0;inline-size:100%}.step-item-wrapper{flex:0 1 auto;display:inline-flex;align-items:center;cursor:pointer}.step-item-wrapper:last-of-type{flex:0 1 auto}.step-item-wrapper:last-of-type .step-item{padding-inline-end:0}.step-item-wrapper:first-of-type::before{display:none}.step-item-wrapper:first-of-type .step-item{padding-inline-start:0}.step-item-wrapper::before{content:"";grid-column:2;grid-row:1;inline-size:0.4rem;block-size:0.4rem;place-self:center end;inset-block-start:0.5px;position:relative;border-inline-end:1px solid var(--nano-color-neutral-300);border-block-end:1px solid var(--nano-color-neutral-300);rotate:-45deg}:dir(rtl) .step-item-wrapper::after{rotate:45deg}.step-item{all:unset;display:inline-flex;align-items:center;gap:var(--nano-spacing-sm);background-color:var(--background);padding:0 var(--nano-spacing-sm);position:relative}.step-item:focus-visible{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset);z-index:1}.step-item.step-item--disabled{cursor:not-allowed}.step-item.step-item--disabled>*{opacity:0.5}.step-item-icon{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);display:inline-flex;align-items:center;justify-content:center;inline-size:1.5rem;block-size:1.5rem;border-radius:var(--nano-border-radius-circle);background-color:transparent;color:var(--nano-color-neutral-1400);border:1px solid var(--nano-color-neutral-300)}.step-item--complete .step-item-icon{background-color:var(--nano-color-success-1000);color:var(--nano-color-base-0);border:none}.step-item--active .step-item-icon{background-color:var(--nano-color-primary-1000);color:var(--nano-color-base-0);border:none}.step-dropdown{inline-size:100%;min-inline-size:300px}.step-trigger{all:unset;display:inline-flex;gap:var(--nano-spacing-md);align-items:center;inline-size:100%;cursor:pointer}.step-trigger-text{display:flex;flex-direction:column}.step-trigger-now{font-weight:var(--nano-font-weight-normal);font-size:var(--nano-font-size-xl);line-height:var(--nano-line-height-denser);text-wrap:balance;color:var(--nano-color-neutral-1400)}.step-trigger-next{font-size:var(--nano-font-size-2xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);color:var(--nano-color-neutral-1000)}.step-trigger-icon{margin-inline-start:auto;color:var(--nano-color-primary-1000);transition:var(--nano-transition-x-fast) rotate}[open] .step-trigger-icon{rotate:180deg}.step-progress-circle{--size:64px;--thickness:4px;inline-size:var(--size);min-inline-size:var(--size);aspect-ratio:1/1;border-radius:50%;display:grid;place-items:center;position:relative}.step-progress-circle::before{content:"";position:absolute;inset:0;border-radius:50%;background:conic-gradient(var(--nano-color-success-1000) calc(var(--value) / var(--max) * 360deg), var(--nano-color-neutral-100) 0);-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%);mask:radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%)}.step-progress-title{font-size:var(--nano-font-size-sm);line-height:var(--nano-line-height-normal);font-weight:var(--nano-font-weight-bold);white-space:nowrap;color:var(--nano-color-neutral-1000)}.step-progress-title strong{color:var(--nano-color-neutral-1400)}';export{l as nano_step_breadcrumb}
|
@@ -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-BM3Om9WE.js";import{a as h}from"./dom-dlicJTEJ.js";import{d as n}from"./throttle-C93FMm2Z.js";import{f as o}from"./scroll-1nFw8CNk.js";import{t as r,h as a}from"./renderer-BaP2L8CT.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:"f087d54cf3135fa7ba3d089f112157797efedaf2",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:"db32b41390349cec6975dfad25b6b99ddadf5758",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:"b1e54c375552b7460fb6991f1c476bf9f73c997f",class:"sticker-content",ref:t=>this.content=t},a("slot",{key:"a2ee69ba9e39d796d832340777f61deb21c2f5d1"}))))}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-BM3Om9WE.js";import{a as h}from"./dom-dlicJTEJ.js";import{d as n}from"./throttle-C93FMm2Z.js";import{f as o}from"./scroll-1nFw8CNk.js";import{t as r,h as a}from"./renderer-BaP2L8CT.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:"d0e4e1b0cc7c63db0389ee67b999c30347f7e16b",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:"6f9852e2cfeb2e203e5dde6f71e7a042a996dd86",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:"1e54d0ebe57b52c95a64acbb6d46f8c9d9778dd3",class:"sticker-content",ref:t=>this.content=t},a("slot",{key:"e8359edd6c73c5006ff1c90a91ecafad07e5c915"}))))}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}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import{r as t,g as a,a as
|
4
|
+
import{r as t,g as a,a as e}from"./index-BM3Om9WE.js";import{h as n}from"./renderer-BaP2L8CT.js";let o=0;const i=class{constructor(a){t(this,a)}tabContentId="nano-tab-content-"+ ++o;ready=!1;get host(){return a(this)}name="";active=!1;componentDidLoad(){requestAnimationFrame((()=>this.ready=!0))}render(){return n(e,{key:"7afee777be86f5847c5ac4c8de6babae3199b01d",id:this.host.id||this.tabContentId,style:{display:this.active?"block":"none"},role:"tabpanel","aria-hidden":this.active?"false":"true",class:{ready:this.ready,"nano-tab-content":!0}},n("div",{key:"c316e2c15458eeb9fb6162d81060b81a1132e795",part:"base",class:"nano-tab-content"},n("slot",{key:"532eedd714e732749cfe9b303b1f4c633e89491c"})))}};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{display:block;opacity:1;animation:opacity 0.3s ease-in-out forwards;animation-duration:0s !important}:host(.ready){animation-duration:0.3s !important}@media only screen and (width <= 768px){:host([animation-dir=left]){animation:slide-right 0.3s ease-in-out;opacity:1}:host([animation-dir=right]){animation:slide-left 0.3s ease-in-out;opacity:1}}.nano-tab-content{position:relative}@keyframes opacity{0%{opacity:0}100%{opacity:1}}@keyframes slide-left{0%{transform:translate3d(-100%, 0, 0)}50%{transform:translate3d(0%) translate3d(-0.9em)}100%{transform:translate3d(0, 0, 0)}}@keyframes slide-right{0%{transform:translate3d(100%, 0, 0)}50%{transform:translateX(0%) translate3d(0.9em)}100%{transform:translate3d(0, 0, 0)}}@media (prefers-reduced-motion: reduce){*{animation:none !important}}";export{i as nano_tab_content}
|