@ionic/core 8.2.2-nightly.20240611 → 8.2.2

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.
@@ -28,6 +28,7 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
28
28
  this.pointerDown = false;
29
29
  this.needsCompletion = false;
30
30
  this.didRefresh = false;
31
+ this.contentFullscreen = false;
31
32
  this.lastVelocityY = 0;
32
33
  this.animations = [];
33
34
  this.nativeRefresher = false;
@@ -322,6 +323,12 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
322
323
  * Query the background content element from the host ion-content element directly.
323
324
  */
324
325
  this.backgroundContentEl = await contentEl.getBackgroundElement();
326
+ /**
327
+ * Check if the content element is fullscreen to apply the correct styles
328
+ * when the refresher is refreshing. Otherwise, the refresher will be
329
+ * hidden because it is positioned behind the background content element.
330
+ */
331
+ this.contentFullscreen = contentEl.fullscreen;
325
332
  if (await shouldUseNativeRefresher(this.el, getIonMode(this))) {
326
333
  this.setupNativeRefresher(contentEl);
327
334
  }
@@ -415,6 +422,14 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
415
422
  this.progress = 0;
416
423
  this.state = 1 /* RefresherState.Inactive */;
417
424
  this.memoizeOverflowStyle();
425
+ /**
426
+ * If the content is fullscreen, then we need to
427
+ * set the offset-top style on the background content
428
+ * element to ensure that the refresher is shown.
429
+ */
430
+ if (this.contentFullscreen && this.backgroundContentEl) {
431
+ this.backgroundContentEl.style.setProperty('--offset-top', '0px');
432
+ }
418
433
  }
419
434
  onMove(detail) {
420
435
  if (!this.scrollEl) {
@@ -542,6 +557,7 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
542
557
  close(state, delay) {
543
558
  // create fallback timer incase something goes wrong with transitionEnd event
544
559
  setTimeout(() => {
560
+ var _a;
545
561
  this.state = 1 /* RefresherState.Inactive */;
546
562
  this.progress = 0;
547
563
  this.didStart = false;
@@ -550,6 +566,17 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
550
566
  * user can scroll again.
551
567
  */
552
568
  this.setCss(0, '0ms', false, '', true);
569
+ /**
570
+ * Reset the offset-top style on the background content
571
+ * when the refresher is no longer refreshing and the
572
+ * content is fullscreen.
573
+ *
574
+ * This ensures that the behavior of background content
575
+ * does not change when refreshing is complete.
576
+ */
577
+ if (this.contentFullscreen && this.backgroundContentEl) {
578
+ (_a = this.backgroundContentEl) === null || _a === void 0 ? void 0 : _a.style.removeProperty('--offset-top');
579
+ }
553
580
  }, 600);
554
581
  // reset the styles on the scroll element
555
582
  // set that the refresh is actively cancelling/completing
@@ -603,7 +630,7 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
603
630
  }
604
631
  render() {
605
632
  const mode = getIonMode(this);
606
- return (h(Host, { key: '1696f66f62d18c9075294f17cb24263325fcf35d', slot: "fixed", class: {
633
+ return (h(Host, { key: '3270f181a5141e7d886ec554a3e892974446b90e', slot: "fixed", class: {
607
634
  [mode]: true,
608
635
  // Used internally for styling
609
636
  [`refresher-${mode}`]: true,
@@ -225,6 +225,7 @@ const Refresher = class {
225
225
  this.pointerDown = false;
226
226
  this.needsCompletion = false;
227
227
  this.didRefresh = false;
228
+ this.contentFullscreen = false;
228
229
  this.lastVelocityY = 0;
229
230
  this.animations = [];
230
231
  this.nativeRefresher = false;
@@ -519,6 +520,12 @@ const Refresher = class {
519
520
  * Query the background content element from the host ion-content element directly.
520
521
  */
521
522
  this.backgroundContentEl = await contentEl.getBackgroundElement();
523
+ /**
524
+ * Check if the content element is fullscreen to apply the correct styles
525
+ * when the refresher is refreshing. Otherwise, the refresher will be
526
+ * hidden because it is positioned behind the background content element.
527
+ */
528
+ this.contentFullscreen = contentEl.fullscreen;
522
529
  if (await shouldUseNativeRefresher(this.el, ionicGlobal.getIonMode(this))) {
523
530
  this.setupNativeRefresher(contentEl);
524
531
  }
@@ -612,6 +619,14 @@ const Refresher = class {
612
619
  this.progress = 0;
613
620
  this.state = 1 /* RefresherState.Inactive */;
614
621
  this.memoizeOverflowStyle();
622
+ /**
623
+ * If the content is fullscreen, then we need to
624
+ * set the offset-top style on the background content
625
+ * element to ensure that the refresher is shown.
626
+ */
627
+ if (this.contentFullscreen && this.backgroundContentEl) {
628
+ this.backgroundContentEl.style.setProperty('--offset-top', '0px');
629
+ }
615
630
  }
616
631
  onMove(detail) {
617
632
  if (!this.scrollEl) {
@@ -739,6 +754,7 @@ const Refresher = class {
739
754
  close(state, delay) {
740
755
  // create fallback timer incase something goes wrong with transitionEnd event
741
756
  setTimeout(() => {
757
+ var _a;
742
758
  this.state = 1 /* RefresherState.Inactive */;
743
759
  this.progress = 0;
744
760
  this.didStart = false;
@@ -747,6 +763,17 @@ const Refresher = class {
747
763
  * user can scroll again.
748
764
  */
749
765
  this.setCss(0, '0ms', false, '', true);
766
+ /**
767
+ * Reset the offset-top style on the background content
768
+ * when the refresher is no longer refreshing and the
769
+ * content is fullscreen.
770
+ *
771
+ * This ensures that the behavior of background content
772
+ * does not change when refreshing is complete.
773
+ */
774
+ if (this.contentFullscreen && this.backgroundContentEl) {
775
+ (_a = this.backgroundContentEl) === null || _a === void 0 ? void 0 : _a.style.removeProperty('--offset-top');
776
+ }
750
777
  }, 600);
751
778
  // reset the styles on the scroll element
752
779
  // set that the refresh is actively cancelling/completing
@@ -800,7 +827,7 @@ const Refresher = class {
800
827
  }
801
828
  render() {
802
829
  const mode = ionicGlobal.getIonMode(this);
803
- return (index.h(index.Host, { key: '1696f66f62d18c9075294f17cb24263325fcf35d', slot: "fixed", class: {
830
+ return (index.h(index.Host, { key: '3270f181a5141e7d886ec554a3e892974446b90e', slot: "fixed", class: {
804
831
  [mode]: true,
805
832
  // Used internally for styling
806
833
  [`refresher-${mode}`]: true,
@@ -19,6 +19,7 @@ export class Refresher {
19
19
  this.pointerDown = false;
20
20
  this.needsCompletion = false;
21
21
  this.didRefresh = false;
22
+ this.contentFullscreen = false;
22
23
  this.lastVelocityY = 0;
23
24
  this.animations = [];
24
25
  this.nativeRefresher = false;
@@ -313,6 +314,12 @@ export class Refresher {
313
314
  * Query the background content element from the host ion-content element directly.
314
315
  */
315
316
  this.backgroundContentEl = await contentEl.getBackgroundElement();
317
+ /**
318
+ * Check if the content element is fullscreen to apply the correct styles
319
+ * when the refresher is refreshing. Otherwise, the refresher will be
320
+ * hidden because it is positioned behind the background content element.
321
+ */
322
+ this.contentFullscreen = contentEl.fullscreen;
316
323
  if (await shouldUseNativeRefresher(this.el, getIonMode(this))) {
317
324
  this.setupNativeRefresher(contentEl);
318
325
  }
@@ -406,6 +413,14 @@ export class Refresher {
406
413
  this.progress = 0;
407
414
  this.state = 1 /* RefresherState.Inactive */;
408
415
  this.memoizeOverflowStyle();
416
+ /**
417
+ * If the content is fullscreen, then we need to
418
+ * set the offset-top style on the background content
419
+ * element to ensure that the refresher is shown.
420
+ */
421
+ if (this.contentFullscreen && this.backgroundContentEl) {
422
+ this.backgroundContentEl.style.setProperty('--offset-top', '0px');
423
+ }
409
424
  }
410
425
  onMove(detail) {
411
426
  if (!this.scrollEl) {
@@ -533,6 +548,7 @@ export class Refresher {
533
548
  close(state, delay) {
534
549
  // create fallback timer incase something goes wrong with transitionEnd event
535
550
  setTimeout(() => {
551
+ var _a;
536
552
  this.state = 1 /* RefresherState.Inactive */;
537
553
  this.progress = 0;
538
554
  this.didStart = false;
@@ -541,6 +557,17 @@ export class Refresher {
541
557
  * user can scroll again.
542
558
  */
543
559
  this.setCss(0, '0ms', false, '', true);
560
+ /**
561
+ * Reset the offset-top style on the background content
562
+ * when the refresher is no longer refreshing and the
563
+ * content is fullscreen.
564
+ *
565
+ * This ensures that the behavior of background content
566
+ * does not change when refreshing is complete.
567
+ */
568
+ if (this.contentFullscreen && this.backgroundContentEl) {
569
+ (_a = this.backgroundContentEl) === null || _a === void 0 ? void 0 : _a.style.removeProperty('--offset-top');
570
+ }
544
571
  }, 600);
545
572
  // reset the styles on the scroll element
546
573
  // set that the refresh is actively cancelling/completing
@@ -594,7 +621,7 @@ export class Refresher {
594
621
  }
595
622
  render() {
596
623
  const mode = getIonMode(this);
597
- return (h(Host, { key: '1696f66f62d18c9075294f17cb24263325fcf35d', slot: "fixed", class: {
624
+ return (h(Host, { key: '3270f181a5141e7d886ec554a3e892974446b90e', slot: "fixed", class: {
598
625
  [mode]: true,
599
626
  // Used internally for styling
600
627
  [`refresher-${mode}`]: true,
@@ -0,0 +1,77 @@
1
+ /*!
2
+ * (C) Ionic http://ionicframework.com - MIT License
3
+ */
4
+ import { expect } from "@playwright/test";
5
+ import { configs, test } from "../../../../utils/test/playwright/index";
6
+ import { pullToRefresh } from "../test.utils";
7
+ /**
8
+ * This behavior does not vary across directions.
9
+ */
10
+ configs({ directions: ['ltr'] }).forEach(({ title, config, screenshot }) => {
11
+ test.describe(title('refresher: fullscreen content'), () => {
12
+ test.beforeEach(async ({ page }) => {
13
+ /**
14
+ * Do not call `complete()` from `ion-refresher` in this test.
15
+ * This will allow the refresher to "pause" while refreshing.
16
+ * By pausing, the test can verify that the refresher is
17
+ * completely visible when the content is fullscreen.
18
+ */
19
+ await page.setContent(`
20
+ <ion-header>
21
+ <ion-toolbar>
22
+ <ion-title>Pull To Refresh</ion-title>
23
+ </ion-toolbar>
24
+ </ion-header>
25
+
26
+ <ion-content fullscreen>
27
+ <ion-refresher id="refresher" slot="fixed">
28
+ <ion-refresher-content
29
+ pulling-icon="arrow-down-outline"
30
+ pulling-text="Pull to refresh..."
31
+ refreshing-text="Refreshing..."
32
+ refreshing-spinner="circles"
33
+ >
34
+ </ion-refresher-content>
35
+ </ion-refresher>
36
+
37
+ <p>Pull this content down to trigger the refresh.</p>
38
+ </ion-content>
39
+
40
+ <script>
41
+ const refresher = document.getElementById('refresher');
42
+
43
+ refresher.addEventListener('ionRefresh', () => {
44
+ setTimeout(() => {
45
+ // Custom event consumed by e2e tests
46
+ window.dispatchEvent(new CustomEvent('ionRefreshComplete'));
47
+ }, 500);
48
+ });
49
+ </script>
50
+ `, config);
51
+ });
52
+ // Bug only occurs with the legacy refresher.
53
+ test.describe('legacy refresher', () => {
54
+ test('should display when content is fullscreen', async ({ page, browserName }) => {
55
+ test.info().annotations.push({
56
+ type: 'issue',
57
+ description: 'https://github.com/ionic-team/ionic-framework/issues/18714',
58
+ });
59
+ const refresher = page.locator('ion-refresher');
60
+ await pullToRefresh(page);
61
+ if (browserName === 'firefox') {
62
+ /**
63
+ * The drag is highlighting the text in Firefox for
64
+ * some reason.
65
+ *
66
+ * Clicking the mouse will remove the highlight and
67
+ * be more consistent with other browsers. This
68
+ * does not happen in Firefox, just when running
69
+ * in Playwright.
70
+ */
71
+ await page.mouse.click(0, 0);
72
+ }
73
+ await expect(refresher).toHaveScreenshot(screenshot('refresher-legacy-content-fullscreen'));
74
+ });
75
+ });
76
+ });
77
+ });
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-06-11T06:08:08",
2
+ "timestamp": "2024-06-12T21:16:53",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.18.3",
@@ -221,6 +221,7 @@ const Refresher = class {
221
221
  this.pointerDown = false;
222
222
  this.needsCompletion = false;
223
223
  this.didRefresh = false;
224
+ this.contentFullscreen = false;
224
225
  this.lastVelocityY = 0;
225
226
  this.animations = [];
226
227
  this.nativeRefresher = false;
@@ -515,6 +516,12 @@ const Refresher = class {
515
516
  * Query the background content element from the host ion-content element directly.
516
517
  */
517
518
  this.backgroundContentEl = await contentEl.getBackgroundElement();
519
+ /**
520
+ * Check if the content element is fullscreen to apply the correct styles
521
+ * when the refresher is refreshing. Otherwise, the refresher will be
522
+ * hidden because it is positioned behind the background content element.
523
+ */
524
+ this.contentFullscreen = contentEl.fullscreen;
518
525
  if (await shouldUseNativeRefresher(this.el, getIonMode(this))) {
519
526
  this.setupNativeRefresher(contentEl);
520
527
  }
@@ -608,6 +615,14 @@ const Refresher = class {
608
615
  this.progress = 0;
609
616
  this.state = 1 /* RefresherState.Inactive */;
610
617
  this.memoizeOverflowStyle();
618
+ /**
619
+ * If the content is fullscreen, then we need to
620
+ * set the offset-top style on the background content
621
+ * element to ensure that the refresher is shown.
622
+ */
623
+ if (this.contentFullscreen && this.backgroundContentEl) {
624
+ this.backgroundContentEl.style.setProperty('--offset-top', '0px');
625
+ }
611
626
  }
612
627
  onMove(detail) {
613
628
  if (!this.scrollEl) {
@@ -735,6 +750,7 @@ const Refresher = class {
735
750
  close(state, delay) {
736
751
  // create fallback timer incase something goes wrong with transitionEnd event
737
752
  setTimeout(() => {
753
+ var _a;
738
754
  this.state = 1 /* RefresherState.Inactive */;
739
755
  this.progress = 0;
740
756
  this.didStart = false;
@@ -743,6 +759,17 @@ const Refresher = class {
743
759
  * user can scroll again.
744
760
  */
745
761
  this.setCss(0, '0ms', false, '', true);
762
+ /**
763
+ * Reset the offset-top style on the background content
764
+ * when the refresher is no longer refreshing and the
765
+ * content is fullscreen.
766
+ *
767
+ * This ensures that the behavior of background content
768
+ * does not change when refreshing is complete.
769
+ */
770
+ if (this.contentFullscreen && this.backgroundContentEl) {
771
+ (_a = this.backgroundContentEl) === null || _a === void 0 ? void 0 : _a.style.removeProperty('--offset-top');
772
+ }
746
773
  }, 600);
747
774
  // reset the styles on the scroll element
748
775
  // set that the refresh is actively cancelling/completing
@@ -796,7 +823,7 @@ const Refresher = class {
796
823
  }
797
824
  render() {
798
825
  const mode = getIonMode(this);
799
- return (h(Host, { key: '1696f66f62d18c9075294f17cb24263325fcf35d', slot: "fixed", class: {
826
+ return (h(Host, { key: '3270f181a5141e7d886ec554a3e892974446b90e', slot: "fixed", class: {
800
827
  [mode]: true,
801
828
  // Used internally for styling
802
829
  [`refresher-${mode}`]: true,
@@ -1,4 +1,4 @@
1
1
  import{__awaiter,__generator}from"tslib";
2
2
  /*!
3
3
  * (C) Ionic http://ionicframework.com - MIT License
4
- */import{w as writeTask,r as registerInstance,d as createEvent,e as readTask,h,i as getElement,f as Host}from"./index-c71c5417.js";import{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";import{I as ION_CONTENT_CLASS_SELECTOR,b as ION_CONTENT_ELEMENT_SELECTOR,p as printIonContentErrorMsg,g as getScrollElement}from"./index-5cc724f3.js";import{t as transitionEndAsync,c as componentOnReady,j as clamp,g as getElementRoot,r as raf}from"./helpers-da915de8.js";import{d as hapticImpact,I as ImpactStyle}from"./haptic-ac164e4c.js";import{b as getIonMode,c as config}from"./ionic-global-b9c0d1da.js";import{c as createAnimation}from"./animation-eab5a4ca.js";import{E as ENABLE_HTML_CONTENT_DEFAULT,a as sanitizeDOMString}from"./config-49c88215.js";import{h as caretBackSharp,i as arrowDown}from"./index-e2cf2ceb.js";import{S as SPINNERS}from"./spinner-configs-964f7cf3.js";import"./index-9b0d46f4.js";import"./capacitor-59395cbd.js";import"./index-a5d50daf.js";var getRefresherAnimationType=function(e){var r=e.previousElementSibling;var n=r!==null&&r.tagName==="ION-HEADER";return n?"translate":"scale"};var createPullingAnimation=function(e,r,n){return e==="scale"?createScaleAnimation(r,n):createTranslateAnimation(r,n)};var createBaseAnimation=function(e){var r=e.querySelector("ion-spinner");var n=r.shadowRoot.querySelector("circle");var i=e.querySelector(".spinner-arrow-container");var t=e.querySelector(".arrow-container");var s=t?t.querySelector("ion-icon"):null;var o=createAnimation().duration(1e3).easing("ease-out");var a=createAnimation().addElement(i).keyframes([{offset:0,opacity:"0.3"},{offset:.45,opacity:"0.3"},{offset:.55,opacity:"1"},{offset:1,opacity:"1"}]);var f=createAnimation().addElement(n).keyframes([{offset:0,strokeDasharray:"1px, 200px"},{offset:.2,strokeDasharray:"1px, 200px"},{offset:.55,strokeDasharray:"100px, 200px"},{offset:1,strokeDasharray:"100px, 200px"}]);var h=createAnimation().addElement(r).keyframes([{offset:0,transform:"rotate(-90deg)"},{offset:1,transform:"rotate(210deg)"}]);if(t&&s){var c=createAnimation().addElement(t).keyframes([{offset:0,transform:"rotate(0deg)"},{offset:.3,transform:"rotate(0deg)"},{offset:.55,transform:"rotate(280deg)"},{offset:1,transform:"rotate(400deg)"}]);var l=createAnimation().addElement(s).keyframes([{offset:0,transform:"translateX(2px) scale(0)"},{offset:.3,transform:"translateX(2px) scale(0)"},{offset:.55,transform:"translateX(-1.5px) scale(1)"},{offset:1,transform:"translateX(-1.5px) scale(1)"}]);o.addAnimation([c,l])}return o.addAnimation([a,f,h])};var createScaleAnimation=function(e,r){var n=r.clientHeight;var i=createAnimation().addElement(e).keyframes([{offset:0,transform:"scale(0) translateY(-".concat(n,"px)")},{offset:1,transform:"scale(1) translateY(100px)"}]);return createBaseAnimation(e).addAnimation([i])};var createTranslateAnimation=function(e,r){var n=r.clientHeight;var i=createAnimation().addElement(e).keyframes([{offset:0,transform:"translateY(-".concat(n,"px)")},{offset:1,transform:"translateY(100px)"}]);return createBaseAnimation(e).addAnimation([i])};var createSnapBackAnimation=function(e){return createAnimation().duration(125).addElement(e).fromTo("transform","translateY(var(--ion-pulling-refresher-translate, 100px))","translateY(0px)")};var setSpinnerOpacity=function(e,r){e.style.setProperty("opacity",r.toString())};var handleScrollWhilePulling=function(e,r,n){var i=1;writeTask((function(){e.forEach((function(e,t){var s=t*(i/r);var o=i-s;var a=n-s;var f=clamp(0,a/o,1);e.style.setProperty("opacity",f.toString())}))}))};var handleScrollWhileRefreshing=function(e,r){writeTask((function(){e.style.setProperty("--refreshing-rotation-duration",r>=1?"0.5s":"2s");e.style.setProperty("opacity","1")}))};var translateElement=function(e,r,n){if(n===void 0){n=200}if(!e){return Promise.resolve()}var i=transitionEndAsync(e,n);writeTask((function(){e.style.setProperty("transition","".concat(n,"ms all ease-out"));if(r===undefined){e.style.removeProperty("transform")}else{e.style.setProperty("transform","translate3d(0px, ".concat(r,", 0px)"))}}));return i};var supportsRubberBandScrolling=function(){return navigator.maxTouchPoints>0&&CSS.supports("background: -webkit-named-image(apple-pay-logo-black)")};var shouldUseNativeRefresher=function(e,r){return __awaiter(void 0,void 0,void 0,(function(){var n,i,t;return __generator(this,(function(s){switch(s.label){case 0:n=e.querySelector("ion-refresher-content");if(!n){return[2,Promise.resolve(false)]}return[4,new Promise((function(e){return componentOnReady(n,e)}))];case 1:s.sent();i=e.querySelector("ion-refresher-content .refresher-pulling ion-spinner");t=e.querySelector("ion-refresher-content .refresher-refreshing ion-spinner");return[2,i!==null&&t!==null&&(r==="ios"&&supportsRubberBandScrolling()||r==="md")]}}))}))};var refresherIosCss="ion-refresher{top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}ion-refresher{inset-inline-start:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}:host-context([dir=rtl]) .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}[dir=rtl] .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}@supports selector(:dir(rtl)){.refresher-pulling-icon:dir(rtl),.refresher-refreshing-icon:dir(rtl){-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-ios .refresher-pulling-icon,.refresher-ios .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-ios .refresher-pulling-text,.refresher-ios .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-lines-ios line,.refresher-ios .refresher-refreshing .spinner-lines-small-ios line,.refresher-ios .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-bubbles circle,.refresher-ios .refresher-refreshing .spinner-circles circle,.refresher-ios .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}.refresher-native .refresher-refreshing ion-spinner{--refreshing-rotation-duration:2s;display:none;-webkit-animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards;animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards}.refresher-native .refresher-refreshing{display:none;-webkit-animation:250ms linear refresher-pop forwards;animation:250ms linear refresher-pop forwards}.refresher-native ion-spinner{width:32px;height:32px;color:var(--ion-color-step-450, var(--ion-background-color-step-450, #747577))}.refresher-native.refresher-refreshing .refresher-pulling ion-spinner,.refresher-native.refresher-completing .refresher-pulling ion-spinner{display:none}.refresher-native.refresher-refreshing .refresher-refreshing ion-spinner,.refresher-native.refresher-completing .refresher-refreshing ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-pulling ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-refreshing ion-spinner{display:none}.refresher-native.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0) rotate(180deg);transform:scale(0) rotate(180deg);-webkit-transition:300ms;transition:300ms}@-webkit-keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}@keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}";var IonRefresherIosStyle0=refresherIosCss;var refresherMdCss="ion-refresher{top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}ion-refresher{inset-inline-start:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}:host-context([dir=rtl]) .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}[dir=rtl] .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}@supports selector(:dir(rtl)){.refresher-pulling-icon:dir(rtl),.refresher-refreshing-icon:dir(rtl){-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-md .refresher-pulling-icon,.refresher-md .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-md .refresher-pulling-text,.refresher-md .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-lines-md line,.refresher-md .refresher-refreshing .spinner-lines-small-md line,.refresher-md .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-bubbles circle,.refresher-md .refresher-refreshing .spinner-circles circle,.refresher-md .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;width:24px;height:24px;color:var(--ion-color-primary, #0054e9)}ion-refresher.refresher-native .spinner-arrow-container{display:inherit}ion-refresher.refresher-native .arrow-container{display:block;position:absolute;width:24px;height:24px}ion-refresher.refresher-native .arrow-container ion-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;left:0;right:0;bottom:-4px;position:absolute;color:var(--ion-color-primary, #0054e9);font-size:12px}ion-refresher.refresher-native.refresher-pulling ion-refresher-content .refresher-pulling,ion-refresher.refresher-native.refresher-ready ion-refresher-content .refresher-pulling{display:-ms-flexbox;display:flex}ion-refresher.refresher-native.refresher-refreshing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-completing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-cancelling ion-refresher-content .refresher-refreshing{display:-ms-flexbox;display:flex}ion-refresher.refresher-native .refresher-pulling-icon{-webkit-transform:translateY(calc(-100% - 10px));transform:translateY(calc(-100% - 10px))}ion-refresher.refresher-native .refresher-pulling-icon,ion-refresher.refresher-native .refresher-refreshing-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;border-radius:100%;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;display:-ms-flexbox;display:flex;border:1px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #ececec));background:var(--ion-color-step-250, var(--ion-background-color-step-250, #ffffff));-webkit-box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1);box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1)}";var IonRefresherMdStyle0=refresherMdCss;var Refresher=function(){function e(e){registerInstance(this,e);this.ionRefresh=createEvent(this,"ionRefresh",7);this.ionPull=createEvent(this,"ionPull",7);this.ionStart=createEvent(this,"ionStart",7);this.appliedStyles=false;this.didStart=false;this.progress=0;this.pointerDown=false;this.needsCompletion=false;this.didRefresh=false;this.lastVelocityY=0;this.animations=[];this.nativeRefresher=false;this.state=1;this.pullMin=60;this.pullMax=this.pullMin+60;this.closeDuration="280ms";this.snapbackDuration="280ms";this.pullFactor=1;this.disabled=false}e.prototype.disabledChanged=function(){if(this.gesture){this.gesture.enable(!this.disabled)}};e.prototype.checkNativeRefresher=function(){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,shouldUseNativeRefresher(this.el,getIonMode(this))];case 1:e=n.sent();if(e&&!this.nativeRefresher){r=this.el.closest("ion-content");this.setupNativeRefresher(r)}else if(!e){this.destroyNativeRefresher()}return[2]}}))}))};e.prototype.destroyNativeRefresher=function(){if(this.scrollEl&&this.scrollListenerCallback){this.scrollEl.removeEventListener("scroll",this.scrollListenerCallback);this.scrollListenerCallback=undefined}this.nativeRefresher=false};e.prototype.resetNativeRefresher=function(e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:this.state=r;if(!(getIonMode(this)==="ios"))return[3,2];return[4,translateElement(e,undefined,300)];case 1:n.sent();return[3,4];case 2:return[4,transitionEndAsync(this.el.querySelector(".refresher-refreshing-icon"),200)];case 3:n.sent();n.label=4;case 4:this.didRefresh=false;this.needsCompletion=false;this.pointerDown=false;this.animations.forEach((function(e){return e.destroy()}));this.animations=[];this.progress=0;this.state=1;return[2]}}))}))};e.prototype.setupiOSNativeRefresher=function(e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,t,s;var o=this;return __generator(this,(function(a){switch(a.label){case 0:this.elementToTransform=this.scrollEl;n=e.shadowRoot.querySelectorAll("svg");i=this.scrollEl.clientHeight*.16;t=n.length;writeTask((function(){return n.forEach((function(e){return e.style.setProperty("animation","none")}))}));this.scrollListenerCallback=function(){if(!o.pointerDown&&o.state===1){return}readTask((function(){var e=o.scrollEl.scrollTop;var s=o.el.clientHeight;if(e>0){if(o.state===8){var a=clamp(0,e/(s*.5),1);writeTask((function(){return setSpinnerOpacity(r,1-a)}));return}return}if(o.pointerDown){if(!o.didStart){o.didStart=true;o.ionStart.emit()}if(o.pointerDown){o.ionPull.emit()}}var f=o.didStart?30:0;var h=o.progress=clamp(0,(Math.abs(e)-f)/i,1);var c=o.state===8||h===1;if(c){if(o.pointerDown){handleScrollWhileRefreshing(r,o.lastVelocityY)}if(!o.didRefresh){o.beginRefresh();o.didRefresh=true;hapticImpact({style:ImpactStyle.Light});if(!o.pointerDown){translateElement(o.elementToTransform,"".concat(s,"px"))}}}else{o.state=2;handleScrollWhilePulling(n,t,h)}}))};this.scrollEl.addEventListener("scroll",this.scrollListenerCallback);s=this;return[4,import("./index-39782642.js")];case 1:s.gesture=a.sent().createGesture({el:this.scrollEl,gestureName:"refresher",gesturePriority:31,direction:"y",threshold:5,onStart:function(){o.pointerDown=true;if(!o.didRefresh){translateElement(o.elementToTransform,"0px")}if(i===0){i=o.scrollEl.clientHeight*.16}},onMove:function(e){o.lastVelocityY=e.velocityY},onEnd:function(){o.pointerDown=false;o.didStart=false;if(o.needsCompletion){o.resetNativeRefresher(o.elementToTransform,32);o.needsCompletion=false}else if(o.didRefresh){readTask((function(){return translateElement(o.elementToTransform,"".concat(o.el.clientHeight,"px"))}))}}});this.disabledChanged();return[2]}}))}))};e.prototype.setupMDNativeRefresher=function(e,r,n){return __awaiter(this,void 0,void 0,(function(){var i,t,s,o;var a=this;return __generator(this,(function(f){switch(f.label){case 0:i=getElementRoot(r).querySelector("circle");t=this.el.querySelector("ion-refresher-content .refresher-pulling-icon");s=getElementRoot(n).querySelector("circle");if(i!==null&&s!==null){writeTask((function(){i.style.setProperty("animation","none");n.style.setProperty("animation-delay","-655ms");s.style.setProperty("animation-delay","-655ms")}))}o=this;return[4,import("./index-39782642.js")];case 1:o.gesture=f.sent().createGesture({el:this.scrollEl,gestureName:"refresher",gesturePriority:31,direction:"y",threshold:5,canStart:function(){return a.state!==8&&a.state!==32&&a.scrollEl.scrollTop===0},onStart:function(e){a.progress=0;e.data={animation:undefined,didStart:false,cancelled:false}},onMove:function(r){if(r.velocityY<0&&a.progress===0&&!r.data.didStart||r.data.cancelled){r.data.cancelled=true;return}if(!r.data.didStart){r.data.didStart=true;a.state=2;var n=a.scrollEl;var i=n.matches(ION_CONTENT_CLASS_SELECTOR)?"overflow":"--overflow";writeTask((function(){return n.style.setProperty(i,"hidden")}));var s=getRefresherAnimationType(e);var o=createPullingAnimation(s,t,a.el);r.data.animation=o;o.progressStart(false,0);a.ionStart.emit();a.animations.push(o);return}a.progress=clamp(0,r.deltaY/180*.5,1);r.data.animation.progressStep(a.progress);a.ionPull.emit()},onEnd:function(e){if(!e.data.didStart){return}a.gesture.enable(false);var r=a.scrollEl;var n=r.matches(ION_CONTENT_CLASS_SELECTOR)?"overflow":"--overflow";writeTask((function(){return r.style.removeProperty(n)}));if(a.progress<=.4){e.data.animation.progressEnd(0,a.progress,500).onFinish((function(){a.animations.forEach((function(e){return e.destroy()}));a.animations=[];a.gesture.enable(true);a.state=1}));return}var i=getTimeGivenProgression([0,0],[0,0],[1,1],[1,1],a.progress)[0];var s=createSnapBackAnimation(t);a.animations.push(s);writeTask((function(){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:t.style.setProperty("--ion-pulling-refresher-translate","".concat(i*100,"px"));e.data.animation.progressEnd();return[4,s.play()];case 1:r.sent();this.beginRefresh();e.data.animation.destroy();this.gesture.enable(true);return[2]}}))}))}))}});this.disabledChanged();return[2]}}))}))};e.prototype.setupNativeRefresher=function(e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){if(this.scrollListenerCallback||!e||this.nativeRefresher||!this.scrollEl){return[2]}this.setCss(0,"",false,"");this.nativeRefresher=true;r=this.el.querySelector("ion-refresher-content .refresher-pulling ion-spinner");n=this.el.querySelector("ion-refresher-content .refresher-refreshing ion-spinner");if(getIonMode(this)==="ios"){this.setupiOSNativeRefresher(r,n)}else{this.setupMDNativeRefresher(e,r,n)}return[2]}))}))};e.prototype.componentDidUpdate=function(){this.checkNativeRefresher()};e.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var e;var r=this;return __generator(this,(function(n){if(this.el.getAttribute("slot")!=="fixed"){console.error('Make sure you use: <ion-refresher slot="fixed">');return[2]}e=this.el.closest(ION_CONTENT_ELEMENT_SELECTOR);if(!e){printIonContentErrorMsg(this.el);return[2]}componentOnReady(e,(function(){return __awaiter(r,void 0,void 0,(function(){var r,n,i,t;var s=this;return __generator(this,(function(o){switch(o.label){case 0:r=e.querySelector(ION_CONTENT_CLASS_SELECTOR);n=this;return[4,getScrollElement(r!==null&&r!==void 0?r:e)];case 1:n.scrollEl=o.sent();i=this;return[4,e.getBackgroundElement()];case 2:i.backgroundContentEl=o.sent();return[4,shouldUseNativeRefresher(this.el,getIonMode(this))];case 3:if(!o.sent())return[3,4];this.setupNativeRefresher(e);return[3,6];case 4:t=this;return[4,import("./index-39782642.js")];case 5:t.gesture=o.sent().createGesture({el:e,gestureName:"refresher",gesturePriority:31,direction:"y",threshold:20,passive:false,canStart:function(){return s.canStart()},onStart:function(){return s.onStart()},onMove:function(e){return s.onMove(e)},onEnd:function(){return s.onEnd()}});this.disabledChanged();o.label=6;case 6:return[2]}}))}))}));return[2]}))}))};e.prototype.disconnectedCallback=function(){this.destroyNativeRefresher();this.scrollEl=undefined;if(this.gesture){this.gesture.destroy();this.gesture=undefined}};e.prototype.complete=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){if(this.nativeRefresher){this.needsCompletion=true;if(!this.pointerDown){raf((function(){return raf((function(){return e.resetNativeRefresher(e.elementToTransform,32)}))}))}}else{this.close(32,"120ms")}return[2]}))}))};e.prototype.cancel=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){if(this.nativeRefresher){if(!this.pointerDown){raf((function(){return raf((function(){return e.resetNativeRefresher(e.elementToTransform,16)}))}))}}else{this.close(16,"")}return[2]}))}))};e.prototype.getProgress=function(){return Promise.resolve(this.progress)};e.prototype.canStart=function(){if(!this.scrollEl){return false}if(this.state!==1){return false}if(this.scrollEl.scrollTop>0){return false}return true};e.prototype.onStart=function(){this.progress=0;this.state=1;this.memoizeOverflowStyle()};e.prototype.onMove=function(e){if(!this.scrollEl){return}var r=e.event;if(r.touches!==undefined&&r.touches.length>1){return}if((this.state&56)!==0){return}var n=Number.isNaN(this.pullFactor)||this.pullFactor<0?1:this.pullFactor;var i=e.deltaY*n;if(i<=0){this.progress=0;this.state=1;if(this.appliedStyles){this.setCss(0,"",false,"");return}return}if(this.state===1){var t=this.scrollEl.scrollTop;if(t>0){this.progress=0;return}this.state=2}if(r.cancelable){r.preventDefault()}this.setCss(i,"0ms",true,"");if(i===0){this.progress=0;return}var s=this.pullMin;this.progress=i/s;if(!this.didStart){this.didStart=true;this.ionStart.emit()}this.ionPull.emit();if(i<s){this.state=2;return}if(i>this.pullMax){this.beginRefresh();return}this.state=4;return};e.prototype.onEnd=function(){if(this.state===4){this.beginRefresh()}else if(this.state===2){this.cancel()}else if(this.state===1){this.restoreOverflowStyle()}};e.prototype.beginRefresh=function(){this.state=8;this.setCss(this.pullMin,this.snapbackDuration,true,"");this.ionRefresh.emit({complete:this.complete.bind(this)})};e.prototype.close=function(e,r){var n=this;setTimeout((function(){n.state=1;n.progress=0;n.didStart=false;n.setCss(0,"0ms",false,"",true)}),600);this.state=e;this.setCss(0,this.closeDuration,true,r)};e.prototype.setCss=function(e,r,n,i,t){var s=this;if(t===void 0){t=false}if(this.nativeRefresher){return}this.appliedStyles=e>0;writeTask((function(){if(s.scrollEl&&s.backgroundContentEl){var o=s.scrollEl.style;var a=s.backgroundContentEl.style;o.transform=a.transform=e>0?"translateY(".concat(e,"px) translateZ(0px)"):"";o.transitionDuration=a.transitionDuration=r;o.transitionDelay=a.transitionDelay=i;o.overflow=n?"hidden":""}if(t){s.restoreOverflowStyle()}}))};e.prototype.memoizeOverflowStyle=function(){if(this.scrollEl){var e=this.scrollEl.style,r=e.overflow,n=e.overflowX,i=e.overflowY;this.overflowStyles={overflow:r!==null&&r!==void 0?r:"",overflowX:n!==null&&n!==void 0?n:"",overflowY:i!==null&&i!==void 0?i:""}}};e.prototype.restoreOverflowStyle=function(){if(this.overflowStyles!==undefined&&this.scrollEl!==undefined){var e=this.overflowStyles,r=e.overflow,n=e.overflowX,i=e.overflowY;this.scrollEl.style.overflow=r;this.scrollEl.style.overflowX=n;this.scrollEl.style.overflowY=i;this.overflowStyles=undefined}};e.prototype.render=function(){var e;var r=getIonMode(this);return h(Host,{key:"1696f66f62d18c9075294f17cb24263325fcf35d",slot:"fixed",class:(e={},e[r]=true,e["refresher-".concat(r)]=true,e["refresher-native"]=this.nativeRefresher,e["refresher-active"]=this.state!==1,e["refresher-pulling"]=this.state===2,e["refresher-ready"]=this.state===4,e["refresher-refreshing"]=this.state===8,e["refresher-cancelling"]=this.state===16,e["refresher-completing"]=this.state===32,e)})};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["disabledChanged"]}},enumerable:false,configurable:true});return e}();Refresher.style={ios:IonRefresherIosStyle0,md:IonRefresherMdStyle0};var RefresherContent=function(){function e(e){registerInstance(this,e);this.customHTMLEnabled=config.get("innerHTMLTemplatesEnabled",ENABLE_HTML_CONTENT_DEFAULT);this.pullingIcon=undefined;this.pullingText=undefined;this.refreshingSpinner=undefined;this.refreshingText=undefined}e.prototype.componentWillLoad=function(){if(this.pullingIcon===undefined){var e=supportsRubberBandScrolling();var r=getIonMode(this);var n=e?"lines":arrowDown;this.pullingIcon=config.get("refreshingIcon",r==="ios"&&e?config.get("spinner",n):"circular")}if(this.refreshingSpinner===undefined){var r=getIonMode(this);this.refreshingSpinner=config.get("refreshingSpinner",config.get("spinner",r==="ios"?"lines":"circular"))}};e.prototype.renderPullingText=function(){var e=this,r=e.customHTMLEnabled,n=e.pullingText;if(r){return h("div",{class:"refresher-pulling-text",innerHTML:sanitizeDOMString(n)})}return h("div",{class:"refresher-pulling-text"},n)};e.prototype.renderRefreshingText=function(){var e=this,r=e.customHTMLEnabled,n=e.refreshingText;if(r){return h("div",{class:"refresher-refreshing-text",innerHTML:sanitizeDOMString(n)})}return h("div",{class:"refresher-refreshing-text"},n)};e.prototype.render=function(){var e=this.pullingIcon;var r=e!=null&&SPINNERS[e]!==undefined;var n=getIonMode(this);return h(Host,{key:"1bec5b4da221c69d856f3f5ddf40f2e03ebf2a4c",class:n},h("div",{key:"4fcc526c4f1881e9368d9cd16bd7030919bd3841",class:"refresher-pulling"},this.pullingIcon&&r&&h("div",{key:"a4e9e2e12c2d7faefc8303ec8c021f999ddf308e",class:"refresher-pulling-icon"},h("div",{key:"5a2d215feb7fb4b64d540d3a65c0f24b415a2433",class:"spinner-arrow-container"},h("ion-spinner",{key:"abef2621d671ac6ff0abac43a702cbd825b7f127",name:this.pullingIcon,paused:true}),n==="md"&&this.pullingIcon==="circular"&&h("div",{key:"30087d672c3780672a05874cd93cd099b2855462",class:"arrow-container"},h("ion-icon",{key:"5e30333dee469aec0d8efc8c4e6dabb619c6f363",icon:caretBackSharp,"aria-hidden":"true"})))),this.pullingIcon&&!r&&h("div",{key:"48fe72b5ce8ded633c6ee799cebb520b9c8be528",class:"refresher-pulling-icon"},h("ion-icon",{key:"d8dfd5d42056b1c0a436c5006affb255407816c0",icon:this.pullingIcon,lazy:false,"aria-hidden":"true"})),this.pullingText!==undefined&&this.renderPullingText()),h("div",{key:"c2cbfb94f157c82601ffe7bb815ff82ebc7c0a49",class:"refresher-refreshing"},this.refreshingSpinner&&h("div",{key:"17f3ebe6a31768d5e389f45a2c12f68600185db9",class:"refresher-refreshing-icon"},h("ion-spinner",{key:"e8e61f8d7189c9939bba184201c9509d1d5b0fad",name:this.refreshingSpinner})),this.refreshingText!==undefined&&this.renderRefreshingText()))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();export{Refresher as ion_refresher,RefresherContent as ion_refresher_content};
4
+ */import{w as writeTask,r as registerInstance,d as createEvent,e as readTask,h,i as getElement,f as Host}from"./index-c71c5417.js";import{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";import{I as ION_CONTENT_CLASS_SELECTOR,b as ION_CONTENT_ELEMENT_SELECTOR,p as printIonContentErrorMsg,g as getScrollElement}from"./index-5cc724f3.js";import{t as transitionEndAsync,c as componentOnReady,j as clamp,g as getElementRoot,r as raf}from"./helpers-da915de8.js";import{d as hapticImpact,I as ImpactStyle}from"./haptic-ac164e4c.js";import{b as getIonMode,c as config}from"./ionic-global-b9c0d1da.js";import{c as createAnimation}from"./animation-eab5a4ca.js";import{E as ENABLE_HTML_CONTENT_DEFAULT,a as sanitizeDOMString}from"./config-49c88215.js";import{h as caretBackSharp,i as arrowDown}from"./index-e2cf2ceb.js";import{S as SPINNERS}from"./spinner-configs-964f7cf3.js";import"./index-9b0d46f4.js";import"./capacitor-59395cbd.js";import"./index-a5d50daf.js";var getRefresherAnimationType=function(e){var r=e.previousElementSibling;var n=r!==null&&r.tagName==="ION-HEADER";return n?"translate":"scale"};var createPullingAnimation=function(e,r,n){return e==="scale"?createScaleAnimation(r,n):createTranslateAnimation(r,n)};var createBaseAnimation=function(e){var r=e.querySelector("ion-spinner");var n=r.shadowRoot.querySelector("circle");var i=e.querySelector(".spinner-arrow-container");var t=e.querySelector(".arrow-container");var s=t?t.querySelector("ion-icon"):null;var o=createAnimation().duration(1e3).easing("ease-out");var a=createAnimation().addElement(i).keyframes([{offset:0,opacity:"0.3"},{offset:.45,opacity:"0.3"},{offset:.55,opacity:"1"},{offset:1,opacity:"1"}]);var f=createAnimation().addElement(n).keyframes([{offset:0,strokeDasharray:"1px, 200px"},{offset:.2,strokeDasharray:"1px, 200px"},{offset:.55,strokeDasharray:"100px, 200px"},{offset:1,strokeDasharray:"100px, 200px"}]);var h=createAnimation().addElement(r).keyframes([{offset:0,transform:"rotate(-90deg)"},{offset:1,transform:"rotate(210deg)"}]);if(t&&s){var c=createAnimation().addElement(t).keyframes([{offset:0,transform:"rotate(0deg)"},{offset:.3,transform:"rotate(0deg)"},{offset:.55,transform:"rotate(280deg)"},{offset:1,transform:"rotate(400deg)"}]);var l=createAnimation().addElement(s).keyframes([{offset:0,transform:"translateX(2px) scale(0)"},{offset:.3,transform:"translateX(2px) scale(0)"},{offset:.55,transform:"translateX(-1.5px) scale(1)"},{offset:1,transform:"translateX(-1.5px) scale(1)"}]);o.addAnimation([c,l])}return o.addAnimation([a,f,h])};var createScaleAnimation=function(e,r){var n=r.clientHeight;var i=createAnimation().addElement(e).keyframes([{offset:0,transform:"scale(0) translateY(-".concat(n,"px)")},{offset:1,transform:"scale(1) translateY(100px)"}]);return createBaseAnimation(e).addAnimation([i])};var createTranslateAnimation=function(e,r){var n=r.clientHeight;var i=createAnimation().addElement(e).keyframes([{offset:0,transform:"translateY(-".concat(n,"px)")},{offset:1,transform:"translateY(100px)"}]);return createBaseAnimation(e).addAnimation([i])};var createSnapBackAnimation=function(e){return createAnimation().duration(125).addElement(e).fromTo("transform","translateY(var(--ion-pulling-refresher-translate, 100px))","translateY(0px)")};var setSpinnerOpacity=function(e,r){e.style.setProperty("opacity",r.toString())};var handleScrollWhilePulling=function(e,r,n){var i=1;writeTask((function(){e.forEach((function(e,t){var s=t*(i/r);var o=i-s;var a=n-s;var f=clamp(0,a/o,1);e.style.setProperty("opacity",f.toString())}))}))};var handleScrollWhileRefreshing=function(e,r){writeTask((function(){e.style.setProperty("--refreshing-rotation-duration",r>=1?"0.5s":"2s");e.style.setProperty("opacity","1")}))};var translateElement=function(e,r,n){if(n===void 0){n=200}if(!e){return Promise.resolve()}var i=transitionEndAsync(e,n);writeTask((function(){e.style.setProperty("transition","".concat(n,"ms all ease-out"));if(r===undefined){e.style.removeProperty("transform")}else{e.style.setProperty("transform","translate3d(0px, ".concat(r,", 0px)"))}}));return i};var supportsRubberBandScrolling=function(){return navigator.maxTouchPoints>0&&CSS.supports("background: -webkit-named-image(apple-pay-logo-black)")};var shouldUseNativeRefresher=function(e,r){return __awaiter(void 0,void 0,void 0,(function(){var n,i,t;return __generator(this,(function(s){switch(s.label){case 0:n=e.querySelector("ion-refresher-content");if(!n){return[2,Promise.resolve(false)]}return[4,new Promise((function(e){return componentOnReady(n,e)}))];case 1:s.sent();i=e.querySelector("ion-refresher-content .refresher-pulling ion-spinner");t=e.querySelector("ion-refresher-content .refresher-refreshing ion-spinner");return[2,i!==null&&t!==null&&(r==="ios"&&supportsRubberBandScrolling()||r==="md")]}}))}))};var refresherIosCss="ion-refresher{top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}ion-refresher{inset-inline-start:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}:host-context([dir=rtl]) .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}[dir=rtl] .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}@supports selector(:dir(rtl)){.refresher-pulling-icon:dir(rtl),.refresher-refreshing-icon:dir(rtl){-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-ios .refresher-pulling-icon,.refresher-ios .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-ios .refresher-pulling-text,.refresher-ios .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-lines-ios line,.refresher-ios .refresher-refreshing .spinner-lines-small-ios line,.refresher-ios .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-bubbles circle,.refresher-ios .refresher-refreshing .spinner-circles circle,.refresher-ios .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}.refresher-native .refresher-refreshing ion-spinner{--refreshing-rotation-duration:2s;display:none;-webkit-animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards;animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards}.refresher-native .refresher-refreshing{display:none;-webkit-animation:250ms linear refresher-pop forwards;animation:250ms linear refresher-pop forwards}.refresher-native ion-spinner{width:32px;height:32px;color:var(--ion-color-step-450, var(--ion-background-color-step-450, #747577))}.refresher-native.refresher-refreshing .refresher-pulling ion-spinner,.refresher-native.refresher-completing .refresher-pulling ion-spinner{display:none}.refresher-native.refresher-refreshing .refresher-refreshing ion-spinner,.refresher-native.refresher-completing .refresher-refreshing ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-pulling ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-refreshing ion-spinner{display:none}.refresher-native.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0) rotate(180deg);transform:scale(0) rotate(180deg);-webkit-transition:300ms;transition:300ms}@-webkit-keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}@keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}";var IonRefresherIosStyle0=refresherIosCss;var refresherMdCss="ion-refresher{top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}ion-refresher{inset-inline-start:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}:host-context([dir=rtl]) .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}[dir=rtl] .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}@supports selector(:dir(rtl)){.refresher-pulling-icon:dir(rtl),.refresher-refreshing-icon:dir(rtl){-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-md .refresher-pulling-icon,.refresher-md .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-md .refresher-pulling-text,.refresher-md .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-lines-md line,.refresher-md .refresher-refreshing .spinner-lines-small-md line,.refresher-md .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-bubbles circle,.refresher-md .refresher-refreshing .spinner-circles circle,.refresher-md .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;width:24px;height:24px;color:var(--ion-color-primary, #0054e9)}ion-refresher.refresher-native .spinner-arrow-container{display:inherit}ion-refresher.refresher-native .arrow-container{display:block;position:absolute;width:24px;height:24px}ion-refresher.refresher-native .arrow-container ion-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;left:0;right:0;bottom:-4px;position:absolute;color:var(--ion-color-primary, #0054e9);font-size:12px}ion-refresher.refresher-native.refresher-pulling ion-refresher-content .refresher-pulling,ion-refresher.refresher-native.refresher-ready ion-refresher-content .refresher-pulling{display:-ms-flexbox;display:flex}ion-refresher.refresher-native.refresher-refreshing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-completing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-cancelling ion-refresher-content .refresher-refreshing{display:-ms-flexbox;display:flex}ion-refresher.refresher-native .refresher-pulling-icon{-webkit-transform:translateY(calc(-100% - 10px));transform:translateY(calc(-100% - 10px))}ion-refresher.refresher-native .refresher-pulling-icon,ion-refresher.refresher-native .refresher-refreshing-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;border-radius:100%;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;display:-ms-flexbox;display:flex;border:1px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #ececec));background:var(--ion-color-step-250, var(--ion-background-color-step-250, #ffffff));-webkit-box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1);box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1)}";var IonRefresherMdStyle0=refresherMdCss;var Refresher=function(){function e(e){registerInstance(this,e);this.ionRefresh=createEvent(this,"ionRefresh",7);this.ionPull=createEvent(this,"ionPull",7);this.ionStart=createEvent(this,"ionStart",7);this.appliedStyles=false;this.didStart=false;this.progress=0;this.pointerDown=false;this.needsCompletion=false;this.didRefresh=false;this.contentFullscreen=false;this.lastVelocityY=0;this.animations=[];this.nativeRefresher=false;this.state=1;this.pullMin=60;this.pullMax=this.pullMin+60;this.closeDuration="280ms";this.snapbackDuration="280ms";this.pullFactor=1;this.disabled=false}e.prototype.disabledChanged=function(){if(this.gesture){this.gesture.enable(!this.disabled)}};e.prototype.checkNativeRefresher=function(){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,shouldUseNativeRefresher(this.el,getIonMode(this))];case 1:e=n.sent();if(e&&!this.nativeRefresher){r=this.el.closest("ion-content");this.setupNativeRefresher(r)}else if(!e){this.destroyNativeRefresher()}return[2]}}))}))};e.prototype.destroyNativeRefresher=function(){if(this.scrollEl&&this.scrollListenerCallback){this.scrollEl.removeEventListener("scroll",this.scrollListenerCallback);this.scrollListenerCallback=undefined}this.nativeRefresher=false};e.prototype.resetNativeRefresher=function(e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:this.state=r;if(!(getIonMode(this)==="ios"))return[3,2];return[4,translateElement(e,undefined,300)];case 1:n.sent();return[3,4];case 2:return[4,transitionEndAsync(this.el.querySelector(".refresher-refreshing-icon"),200)];case 3:n.sent();n.label=4;case 4:this.didRefresh=false;this.needsCompletion=false;this.pointerDown=false;this.animations.forEach((function(e){return e.destroy()}));this.animations=[];this.progress=0;this.state=1;return[2]}}))}))};e.prototype.setupiOSNativeRefresher=function(e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,t,s;var o=this;return __generator(this,(function(a){switch(a.label){case 0:this.elementToTransform=this.scrollEl;n=e.shadowRoot.querySelectorAll("svg");i=this.scrollEl.clientHeight*.16;t=n.length;writeTask((function(){return n.forEach((function(e){return e.style.setProperty("animation","none")}))}));this.scrollListenerCallback=function(){if(!o.pointerDown&&o.state===1){return}readTask((function(){var e=o.scrollEl.scrollTop;var s=o.el.clientHeight;if(e>0){if(o.state===8){var a=clamp(0,e/(s*.5),1);writeTask((function(){return setSpinnerOpacity(r,1-a)}));return}return}if(o.pointerDown){if(!o.didStart){o.didStart=true;o.ionStart.emit()}if(o.pointerDown){o.ionPull.emit()}}var f=o.didStart?30:0;var h=o.progress=clamp(0,(Math.abs(e)-f)/i,1);var c=o.state===8||h===1;if(c){if(o.pointerDown){handleScrollWhileRefreshing(r,o.lastVelocityY)}if(!o.didRefresh){o.beginRefresh();o.didRefresh=true;hapticImpact({style:ImpactStyle.Light});if(!o.pointerDown){translateElement(o.elementToTransform,"".concat(s,"px"))}}}else{o.state=2;handleScrollWhilePulling(n,t,h)}}))};this.scrollEl.addEventListener("scroll",this.scrollListenerCallback);s=this;return[4,import("./index-39782642.js")];case 1:s.gesture=a.sent().createGesture({el:this.scrollEl,gestureName:"refresher",gesturePriority:31,direction:"y",threshold:5,onStart:function(){o.pointerDown=true;if(!o.didRefresh){translateElement(o.elementToTransform,"0px")}if(i===0){i=o.scrollEl.clientHeight*.16}},onMove:function(e){o.lastVelocityY=e.velocityY},onEnd:function(){o.pointerDown=false;o.didStart=false;if(o.needsCompletion){o.resetNativeRefresher(o.elementToTransform,32);o.needsCompletion=false}else if(o.didRefresh){readTask((function(){return translateElement(o.elementToTransform,"".concat(o.el.clientHeight,"px"))}))}}});this.disabledChanged();return[2]}}))}))};e.prototype.setupMDNativeRefresher=function(e,r,n){return __awaiter(this,void 0,void 0,(function(){var i,t,s,o;var a=this;return __generator(this,(function(f){switch(f.label){case 0:i=getElementRoot(r).querySelector("circle");t=this.el.querySelector("ion-refresher-content .refresher-pulling-icon");s=getElementRoot(n).querySelector("circle");if(i!==null&&s!==null){writeTask((function(){i.style.setProperty("animation","none");n.style.setProperty("animation-delay","-655ms");s.style.setProperty("animation-delay","-655ms")}))}o=this;return[4,import("./index-39782642.js")];case 1:o.gesture=f.sent().createGesture({el:this.scrollEl,gestureName:"refresher",gesturePriority:31,direction:"y",threshold:5,canStart:function(){return a.state!==8&&a.state!==32&&a.scrollEl.scrollTop===0},onStart:function(e){a.progress=0;e.data={animation:undefined,didStart:false,cancelled:false}},onMove:function(r){if(r.velocityY<0&&a.progress===0&&!r.data.didStart||r.data.cancelled){r.data.cancelled=true;return}if(!r.data.didStart){r.data.didStart=true;a.state=2;var n=a.scrollEl;var i=n.matches(ION_CONTENT_CLASS_SELECTOR)?"overflow":"--overflow";writeTask((function(){return n.style.setProperty(i,"hidden")}));var s=getRefresherAnimationType(e);var o=createPullingAnimation(s,t,a.el);r.data.animation=o;o.progressStart(false,0);a.ionStart.emit();a.animations.push(o);return}a.progress=clamp(0,r.deltaY/180*.5,1);r.data.animation.progressStep(a.progress);a.ionPull.emit()},onEnd:function(e){if(!e.data.didStart){return}a.gesture.enable(false);var r=a.scrollEl;var n=r.matches(ION_CONTENT_CLASS_SELECTOR)?"overflow":"--overflow";writeTask((function(){return r.style.removeProperty(n)}));if(a.progress<=.4){e.data.animation.progressEnd(0,a.progress,500).onFinish((function(){a.animations.forEach((function(e){return e.destroy()}));a.animations=[];a.gesture.enable(true);a.state=1}));return}var i=getTimeGivenProgression([0,0],[0,0],[1,1],[1,1],a.progress)[0];var s=createSnapBackAnimation(t);a.animations.push(s);writeTask((function(){return __awaiter(a,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:t.style.setProperty("--ion-pulling-refresher-translate","".concat(i*100,"px"));e.data.animation.progressEnd();return[4,s.play()];case 1:r.sent();this.beginRefresh();e.data.animation.destroy();this.gesture.enable(true);return[2]}}))}))}))}});this.disabledChanged();return[2]}}))}))};e.prototype.setupNativeRefresher=function(e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){if(this.scrollListenerCallback||!e||this.nativeRefresher||!this.scrollEl){return[2]}this.setCss(0,"",false,"");this.nativeRefresher=true;r=this.el.querySelector("ion-refresher-content .refresher-pulling ion-spinner");n=this.el.querySelector("ion-refresher-content .refresher-refreshing ion-spinner");if(getIonMode(this)==="ios"){this.setupiOSNativeRefresher(r,n)}else{this.setupMDNativeRefresher(e,r,n)}return[2]}))}))};e.prototype.componentDidUpdate=function(){this.checkNativeRefresher()};e.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){var e;var r=this;return __generator(this,(function(n){if(this.el.getAttribute("slot")!=="fixed"){console.error('Make sure you use: <ion-refresher slot="fixed">');return[2]}e=this.el.closest(ION_CONTENT_ELEMENT_SELECTOR);if(!e){printIonContentErrorMsg(this.el);return[2]}componentOnReady(e,(function(){return __awaiter(r,void 0,void 0,(function(){var r,n,i,t;var s=this;return __generator(this,(function(o){switch(o.label){case 0:r=e.querySelector(ION_CONTENT_CLASS_SELECTOR);n=this;return[4,getScrollElement(r!==null&&r!==void 0?r:e)];case 1:n.scrollEl=o.sent();i=this;return[4,e.getBackgroundElement()];case 2:i.backgroundContentEl=o.sent();this.contentFullscreen=e.fullscreen;return[4,shouldUseNativeRefresher(this.el,getIonMode(this))];case 3:if(!o.sent())return[3,4];this.setupNativeRefresher(e);return[3,6];case 4:t=this;return[4,import("./index-39782642.js")];case 5:t.gesture=o.sent().createGesture({el:e,gestureName:"refresher",gesturePriority:31,direction:"y",threshold:20,passive:false,canStart:function(){return s.canStart()},onStart:function(){return s.onStart()},onMove:function(e){return s.onMove(e)},onEnd:function(){return s.onEnd()}});this.disabledChanged();o.label=6;case 6:return[2]}}))}))}));return[2]}))}))};e.prototype.disconnectedCallback=function(){this.destroyNativeRefresher();this.scrollEl=undefined;if(this.gesture){this.gesture.destroy();this.gesture=undefined}};e.prototype.complete=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){if(this.nativeRefresher){this.needsCompletion=true;if(!this.pointerDown){raf((function(){return raf((function(){return e.resetNativeRefresher(e.elementToTransform,32)}))}))}}else{this.close(32,"120ms")}return[2]}))}))};e.prototype.cancel=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){if(this.nativeRefresher){if(!this.pointerDown){raf((function(){return raf((function(){return e.resetNativeRefresher(e.elementToTransform,16)}))}))}}else{this.close(16,"")}return[2]}))}))};e.prototype.getProgress=function(){return Promise.resolve(this.progress)};e.prototype.canStart=function(){if(!this.scrollEl){return false}if(this.state!==1){return false}if(this.scrollEl.scrollTop>0){return false}return true};e.prototype.onStart=function(){this.progress=0;this.state=1;this.memoizeOverflowStyle();if(this.contentFullscreen&&this.backgroundContentEl){this.backgroundContentEl.style.setProperty("--offset-top","0px")}};e.prototype.onMove=function(e){if(!this.scrollEl){return}var r=e.event;if(r.touches!==undefined&&r.touches.length>1){return}if((this.state&56)!==0){return}var n=Number.isNaN(this.pullFactor)||this.pullFactor<0?1:this.pullFactor;var i=e.deltaY*n;if(i<=0){this.progress=0;this.state=1;if(this.appliedStyles){this.setCss(0,"",false,"");return}return}if(this.state===1){var t=this.scrollEl.scrollTop;if(t>0){this.progress=0;return}this.state=2}if(r.cancelable){r.preventDefault()}this.setCss(i,"0ms",true,"");if(i===0){this.progress=0;return}var s=this.pullMin;this.progress=i/s;if(!this.didStart){this.didStart=true;this.ionStart.emit()}this.ionPull.emit();if(i<s){this.state=2;return}if(i>this.pullMax){this.beginRefresh();return}this.state=4;return};e.prototype.onEnd=function(){if(this.state===4){this.beginRefresh()}else if(this.state===2){this.cancel()}else if(this.state===1){this.restoreOverflowStyle()}};e.prototype.beginRefresh=function(){this.state=8;this.setCss(this.pullMin,this.snapbackDuration,true,"");this.ionRefresh.emit({complete:this.complete.bind(this)})};e.prototype.close=function(e,r){var n=this;setTimeout((function(){var e;n.state=1;n.progress=0;n.didStart=false;n.setCss(0,"0ms",false,"",true);if(n.contentFullscreen&&n.backgroundContentEl){(e=n.backgroundContentEl)===null||e===void 0?void 0:e.style.removeProperty("--offset-top")}}),600);this.state=e;this.setCss(0,this.closeDuration,true,r)};e.prototype.setCss=function(e,r,n,i,t){var s=this;if(t===void 0){t=false}if(this.nativeRefresher){return}this.appliedStyles=e>0;writeTask((function(){if(s.scrollEl&&s.backgroundContentEl){var o=s.scrollEl.style;var a=s.backgroundContentEl.style;o.transform=a.transform=e>0?"translateY(".concat(e,"px) translateZ(0px)"):"";o.transitionDuration=a.transitionDuration=r;o.transitionDelay=a.transitionDelay=i;o.overflow=n?"hidden":""}if(t){s.restoreOverflowStyle()}}))};e.prototype.memoizeOverflowStyle=function(){if(this.scrollEl){var e=this.scrollEl.style,r=e.overflow,n=e.overflowX,i=e.overflowY;this.overflowStyles={overflow:r!==null&&r!==void 0?r:"",overflowX:n!==null&&n!==void 0?n:"",overflowY:i!==null&&i!==void 0?i:""}}};e.prototype.restoreOverflowStyle=function(){if(this.overflowStyles!==undefined&&this.scrollEl!==undefined){var e=this.overflowStyles,r=e.overflow,n=e.overflowX,i=e.overflowY;this.scrollEl.style.overflow=r;this.scrollEl.style.overflowX=n;this.scrollEl.style.overflowY=i;this.overflowStyles=undefined}};e.prototype.render=function(){var e;var r=getIonMode(this);return h(Host,{key:"3270f181a5141e7d886ec554a3e892974446b90e",slot:"fixed",class:(e={},e[r]=true,e["refresher-".concat(r)]=true,e["refresher-native"]=this.nativeRefresher,e["refresher-active"]=this.state!==1,e["refresher-pulling"]=this.state===2,e["refresher-ready"]=this.state===4,e["refresher-refreshing"]=this.state===8,e["refresher-cancelling"]=this.state===16,e["refresher-completing"]=this.state===32,e)})};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["disabledChanged"]}},enumerable:false,configurable:true});return e}();Refresher.style={ios:IonRefresherIosStyle0,md:IonRefresherMdStyle0};var RefresherContent=function(){function e(e){registerInstance(this,e);this.customHTMLEnabled=config.get("innerHTMLTemplatesEnabled",ENABLE_HTML_CONTENT_DEFAULT);this.pullingIcon=undefined;this.pullingText=undefined;this.refreshingSpinner=undefined;this.refreshingText=undefined}e.prototype.componentWillLoad=function(){if(this.pullingIcon===undefined){var e=supportsRubberBandScrolling();var r=getIonMode(this);var n=e?"lines":arrowDown;this.pullingIcon=config.get("refreshingIcon",r==="ios"&&e?config.get("spinner",n):"circular")}if(this.refreshingSpinner===undefined){var r=getIonMode(this);this.refreshingSpinner=config.get("refreshingSpinner",config.get("spinner",r==="ios"?"lines":"circular"))}};e.prototype.renderPullingText=function(){var e=this,r=e.customHTMLEnabled,n=e.pullingText;if(r){return h("div",{class:"refresher-pulling-text",innerHTML:sanitizeDOMString(n)})}return h("div",{class:"refresher-pulling-text"},n)};e.prototype.renderRefreshingText=function(){var e=this,r=e.customHTMLEnabled,n=e.refreshingText;if(r){return h("div",{class:"refresher-refreshing-text",innerHTML:sanitizeDOMString(n)})}return h("div",{class:"refresher-refreshing-text"},n)};e.prototype.render=function(){var e=this.pullingIcon;var r=e!=null&&SPINNERS[e]!==undefined;var n=getIonMode(this);return h(Host,{key:"1bec5b4da221c69d856f3f5ddf40f2e03ebf2a4c",class:n},h("div",{key:"4fcc526c4f1881e9368d9cd16bd7030919bd3841",class:"refresher-pulling"},this.pullingIcon&&r&&h("div",{key:"a4e9e2e12c2d7faefc8303ec8c021f999ddf308e",class:"refresher-pulling-icon"},h("div",{key:"5a2d215feb7fb4b64d540d3a65c0f24b415a2433",class:"spinner-arrow-container"},h("ion-spinner",{key:"abef2621d671ac6ff0abac43a702cbd825b7f127",name:this.pullingIcon,paused:true}),n==="md"&&this.pullingIcon==="circular"&&h("div",{key:"30087d672c3780672a05874cd93cd099b2855462",class:"arrow-container"},h("ion-icon",{key:"5e30333dee469aec0d8efc8c4e6dabb619c6f363",icon:caretBackSharp,"aria-hidden":"true"})))),this.pullingIcon&&!r&&h("div",{key:"48fe72b5ce8ded633c6ee799cebb520b9c8be528",class:"refresher-pulling-icon"},h("ion-icon",{key:"d8dfd5d42056b1c0a436c5006affb255407816c0",icon:this.pullingIcon,lazy:false,"aria-hidden":"true"})),this.pullingText!==undefined&&this.renderPullingText()),h("div",{key:"c2cbfb94f157c82601ffe7bb815ff82ebc7c0a49",class:"refresher-refreshing"},this.refreshingSpinner&&h("div",{key:"17f3ebe6a31768d5e389f45a2c12f68600185db9",class:"refresher-refreshing-icon"},h("ion-spinner",{key:"e8e61f8d7189c9939bba184201c9509d1d5b0fad",name:this.refreshingSpinner})),this.refreshingText!==undefined&&this.renderRefreshingText()))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();export{Refresher as ion_refresher,RefresherContent as ion_refresher_content};