/*! For license information please see 30323.0ba8a49e1a97fc39.js.LICENSE.txt */
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[30323],{30323:(e,t,l)=>{l.r(t),l.d(t,{ion_segment_view:()=>n});var o=l(10467),s=l(96317);const n=class{constructor(e){(0,s.r)(this,e),this.ionSegmentViewScroll=(0,s.c)(this,"ionSegmentViewScroll",7),this.scrollEndTimeout=null,this.isTouching=!1,this.disabled=!1,this.isManualScroll=void 0}handleScroll(e){var t;const{scrollLeft:l,scrollWidth:o,clientWidth:s}=e.target;this.ionSegmentViewScroll.emit({scrollRatio:l/(o-s),isManualScroll:null===(t=this.isManualScroll)||void 0===t||t}),this.resetScrollEndTimeout()}handleScrollStart(){this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.isTouching=!0}handleTouchEnd(){this.isTouching=!1}resetScrollEndTimeout(){this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.scrollEndTimeout=setTimeout((()=>{this.checkForScrollEnd()}),100)}checkForScrollEnd(){this.isTouching||(this.isManualScroll=void 0)}setContent(e,t=!0){var l=this;return(0,o.A)((function*(){const o=l.getSegmentContents().findIndex((t=>t.id===e));if(-1===o)return;l.isManualScroll=!1,l.resetScrollEndTimeout();l.el.scrollTo({top:0,left:o*l.el.offsetWidth,behavior:t?"smooth":"instant"})}))()}getSegmentContents(){return Array.from(this.el.querySelectorAll("ion-segment-content"))}render(){const{disabled:e,isManualScroll:t}=this;return(0,s.h)(s.e,{key:"fa528d2d9ae0f00fc3067defe2a047dce77c814a",class:{"segment-view-disabled":e,"segment-view-scroll-disabled":!1===t}},(0,s.h)("slot",{key:"74dc8b4d073caeff1bab272d11b9ea3e1a215954"}))}get el(){return(0,s.f)(this)}};n.style={ios:":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}",md:":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}"}}}]);