@pod-os/elements 0.8.0 → 0.9.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.
Files changed (131) hide show
  1. package/dist/cjs/BrokenFile-b01d72da.js +226 -0
  2. package/dist/cjs/ResourceAware-f1aac952.js +7 -0
  3. package/dist/cjs/elements.cjs.js +1 -1
  4. package/dist/{esm/ion-app_48.entry.js → cjs/index-74c56a41.js} +8 -4122
  5. package/dist/cjs/ion-app_25.cjs.entry.js +3043 -0
  6. package/dist/cjs/ion-badge_7.cjs.entry.js +258 -0
  7. package/dist/cjs/ion-item-divider_3.cjs.entry.js +109 -0
  8. package/dist/cjs/ion-item_3.cjs.entry.js +367 -0
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/pos-app-document-viewer.cjs.entry.js +28 -0
  11. package/dist/cjs/pos-app-generic.cjs.entry.js +16 -0
  12. package/dist/cjs/pos-app-image-viewer.cjs.entry.js +29 -0
  13. package/dist/cjs/pos-app-rdf-document.cjs.entry.js +16 -0
  14. package/dist/cjs/pos-description_2.cjs.entry.js +40 -0
  15. package/dist/cjs/pos-document.cjs.entry.js +67 -0
  16. package/dist/cjs/pos-relations_2.cjs.entry.js +45 -0
  17. package/dist/cjs/pos-subjects.cjs.entry.js +28 -0
  18. package/dist/collection/apps/{pos-app-pdf-viewer/pos-app-pdf-viewer.js → pos-app-document-viewer/pos-app-document-viewer.js} +3 -3
  19. package/dist/collection/collection-manifest.json +2 -2
  20. package/dist/collection/components/{pos-pdf/pos-pdf.css → pos-document/pos-document.css} +0 -0
  21. package/dist/collection/components/{pos-pdf/pos-pdf.js → pos-document/pos-document.js} +4 -4
  22. package/dist/collection/components/pos-type-router/pos-type-router.js +3 -12
  23. package/dist/collection/components/pos-type-router/selectAppForTypes.js +24 -0
  24. package/dist/components/index.d.ts +2 -2
  25. package/dist/components/index.js +2 -2
  26. package/dist/components/pos-app-browser.js +46 -184
  27. package/dist/components/pos-app-document-viewer.d.ts +11 -0
  28. package/dist/components/{pos-app-pdf-viewer2.js → pos-app-document-viewer.js} +50 -47
  29. package/dist/components/pos-app-generic.js +192 -1
  30. package/dist/components/pos-app-image-viewer.js +160 -1
  31. package/dist/components/pos-app-rdf-document.js +168 -1
  32. package/dist/components/{pos-pdf.d.ts → pos-document.d.ts} +4 -4
  33. package/dist/components/pos-document.js +6 -0
  34. package/dist/components/{pos-pdf2.js → pos-document2.js} +8 -8
  35. package/dist/components/pos-router2.js +18 -180
  36. package/dist/components/pos-type-router2.js +28 -217
  37. package/dist/elements/elements.esm.js +1 -1
  38. package/dist/elements/{p-145ab600.entry.js → p-0ed0e3ba.entry.js} +1 -1
  39. package/dist/elements/{p-5808c505.js → p-12407693.js} +1 -1
  40. package/dist/elements/p-1688668c.entry.js +1 -0
  41. package/dist/elements/{p-85d6f579.entry.js → p-16afe2d7.entry.js} +1 -1
  42. package/dist/elements/{p-f4b358b2.entry.js → p-1a9cdd0b.entry.js} +1 -1
  43. package/dist/elements/{p-8ed61030.entry.js → p-21a6c0d5.entry.js} +1 -1
  44. package/dist/elements/{p-1e3bbab1.entry.js → p-24fffcb6.entry.js} +1 -1
  45. package/dist/elements/p-2ca5f7f2.entry.js +5 -0
  46. package/dist/elements/{p-7fc32e8d.entry.js → p-2eced374.entry.js} +1 -1
  47. package/dist/elements/p-301096a8.entry.js +1 -0
  48. package/dist/elements/{p-2a9a9bb1.entry.js → p-35faa0fa.entry.js} +1 -1
  49. package/dist/elements/{p-f851b91a.js → p-37c43290.js} +2 -2
  50. package/dist/elements/p-3f0dec28.entry.js +1 -0
  51. package/dist/elements/p-410c567f.entry.js +1 -0
  52. package/dist/elements/p-417ecc9e.js +1 -0
  53. package/dist/elements/p-43717c61.js +1 -0
  54. package/dist/elements/{p-b57b6dfe.entry.js → p-573e7d6e.entry.js} +1 -1
  55. package/dist/elements/{p-ec8c13e0.entry.js → p-59680588.entry.js} +1 -1
  56. package/dist/elements/p-5fe41c08.entry.js +1 -0
  57. package/dist/elements/p-68110709.entry.js +1 -0
  58. package/dist/elements/{p-29c0f03f.js → p-6ed079a5.js} +2 -2
  59. package/dist/elements/p-709fd743.entry.js +1 -0
  60. package/dist/elements/p-73648481.entry.js +1 -0
  61. package/dist/elements/p-784b06b3.entry.js +1 -0
  62. package/dist/elements/p-84cc1417.entry.js +1 -0
  63. package/dist/elements/p-8596ddbc.js +4 -0
  64. package/dist/elements/{p-b0d8c4f0.entry.js → p-8c0124df.entry.js} +1 -1
  65. package/dist/elements/{p-020dee35.entry.js → p-a48e16ba.entry.js} +1 -1
  66. package/dist/elements/p-ab11bb11.js +4 -0
  67. package/dist/elements/{p-8a24508e.entry.js → p-ae87571c.entry.js} +1 -1
  68. package/dist/elements/p-b2acbe46.entry.js +1 -0
  69. package/dist/elements/p-babdb154.entry.js +9 -0
  70. package/dist/elements/{p-9c719139.js → p-bb128f00.js} +1 -1
  71. package/dist/elements/{p-fe753f07.entry.js → p-c442a411.entry.js} +1 -1
  72. package/dist/elements/{p-b36873af.entry.js → p-c4d119d2.entry.js} +1 -1
  73. package/dist/elements/p-eea7ce93.js +116 -0
  74. package/dist/elements/p-f72edc68.entry.js +1 -0
  75. package/dist/elements/{p-6987a85b.entry.js → p-ffb33569.entry.js} +1 -1
  76. package/dist/esm/BrokenFile-e1e68cb6.js +223 -0
  77. package/dist/esm/ResourceAware-845001bb.js +5 -0
  78. package/dist/esm/{data-62c81c24.js → data-2c0eab05.js} +1 -1
  79. package/dist/esm/elements.js +1 -1
  80. package/dist/esm/{index-ebf7f059.js → index-38d8370e.js} +1 -1
  81. package/dist/esm/{index-1f3d8582.js → index-47f5cd9a.js} +1 -1
  82. package/dist/{cjs/ion-app_48.cjs.entry.js → esm/index-5c6f4d9d.js} +6 -4174
  83. package/dist/esm/{index-65ecd543.js → index-753825bf.js} +1 -1
  84. package/dist/esm/{input-shims-8a389148.js → input-shims-167ef062.js} +2 -2
  85. package/dist/esm/ion-accordion.entry.js +1 -1
  86. package/dist/esm/ion-app_25.entry.js +3015 -0
  87. package/dist/esm/ion-back-button.entry.js +1 -1
  88. package/dist/esm/ion-badge_7.entry.js +248 -0
  89. package/dist/esm/ion-breadcrumb.entry.js +1 -1
  90. package/dist/esm/ion-datetime-button.entry.js +2 -2
  91. package/dist/esm/ion-datetime.entry.js +3 -3
  92. package/dist/esm/ion-fab-button.entry.js +1 -1
  93. package/dist/esm/ion-infinite-scroll.entry.js +2 -2
  94. package/dist/esm/ion-input.entry.js +1 -1
  95. package/dist/esm/ion-item-divider_3.entry.js +103 -0
  96. package/dist/esm/ion-item-sliding.entry.js +2 -2
  97. package/dist/esm/ion-item_3.entry.js +361 -0
  98. package/dist/esm/ion-menu-button.entry.js +1 -1
  99. package/dist/esm/ion-modal.entry.js +2 -2
  100. package/dist/esm/ion-range.entry.js +2 -2
  101. package/dist/esm/ion-refresher-content.entry.js +1 -1
  102. package/dist/esm/ion-refresher.entry.js +2 -2
  103. package/dist/esm/ion-reorder-group.entry.js +2 -2
  104. package/dist/esm/ion-reorder.entry.js +1 -1
  105. package/dist/esm/ion-toggle.entry.js +1 -1
  106. package/dist/esm/loader.js +1 -1
  107. package/dist/esm/pos-app-document-viewer.entry.js +24 -0
  108. package/dist/esm/pos-app-generic.entry.js +12 -0
  109. package/dist/esm/pos-app-image-viewer.entry.js +25 -0
  110. package/dist/esm/pos-app-rdf-document.entry.js +12 -0
  111. package/dist/esm/pos-description_2.entry.js +35 -0
  112. package/dist/esm/pos-document.entry.js +63 -0
  113. package/dist/esm/pos-relations_2.entry.js +40 -0
  114. package/dist/esm/pos-subjects.entry.js +24 -0
  115. package/dist/esm/{status-tap-33623c88.js → status-tap-ce25f9e5.js} +2 -2
  116. package/dist/types/apps/{pos-app-pdf-viewer/pos-app-pdf-viewer.d.ts → pos-app-document-viewer/pos-app-document-viewer.d.ts} +1 -1
  117. package/dist/types/components/{pos-pdf/pos-pdf.d.ts → pos-document/pos-document.d.ts} +1 -1
  118. package/dist/types/components/pos-type-router/selectAppForTypes.d.ts +8 -0
  119. package/dist/types/components.d.ts +40 -40
  120. package/package.json +1 -1
  121. package/dist/components/pos-app-generic2.js +0 -194
  122. package/dist/components/pos-app-image-viewer2.js +0 -162
  123. package/dist/components/pos-app-pdf-viewer.d.ts +0 -11
  124. package/dist/components/pos-app-pdf-viewer.js +0 -6
  125. package/dist/components/pos-app-rdf-document2.js +0 -170
  126. package/dist/components/pos-pdf.js +0 -6
  127. package/dist/elements/p-10cae467.js +0 -4
  128. package/dist/elements/p-19e4a688.js +0 -4
  129. package/dist/elements/p-5f811ad7.entry.js +0 -1
  130. package/dist/elements/p-7a79a3cd.entry.js +0 -128
  131. package/dist/elements/p-b9a87655.entry.js +0 -1
@@ -1,2983 +1,3 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index$1 = require('./index-4018a65a.js');
6
- const ionicGlobal = require('./ionic-global-3ede5d2d.js');
7
- const theme = require('./theme-fc63803b.js');
8
- const helpers = require('./helpers-cb08f5ae.js');
9
- const index$2 = require('./index-b2a479e4.js');
10
- const dir$1 = require('./dir-011f46ea.js');
11
- const index$3 = require('./index-9fca5d6f.js');
12
- const keyboardController = require('./keyboard-controller-a934d106.js');
13
- const index$4 = require('./index-731691ca.js');
14
- require('./index-57b9fa9e.js');
15
-
16
- const appCss = "html.plt-mobile ion-app{user-select:none}html.plt-mobile ion-app [contenteditable]{user-select:text}ion-app.force-statusbar-padding{--ion-safe-area-top:20px}";
17
-
18
- const App = class {
19
- constructor(hostRef) {
20
- index$1.registerInstance(this, hostRef);
21
- }
22
- componentDidLoad() {
23
- {
24
- rIC(async () => {
25
- const isHybrid = ionicGlobal.isPlatform(window, 'hybrid');
26
- if (!ionicGlobal.config.getBoolean('_testing')) {
27
- Promise.resolve().then(function () { return require('./index-ed2ce04f.js'); }).then((module) => module.startTapClick(ionicGlobal.config));
28
- }
29
- if (ionicGlobal.config.getBoolean('statusTap', isHybrid)) {
30
- Promise.resolve().then(function () { return require('./status-tap-39f92004.js'); }).then((module) => module.startStatusTap());
31
- }
32
- if (ionicGlobal.config.getBoolean('inputShims', needInputShims())) {
33
- /**
34
- * needInputShims() ensures that only iOS and Android
35
- * platforms proceed into this block.
36
- */
37
- const platform = ionicGlobal.isPlatform(window, 'ios') ? 'ios' : 'android';
38
- Promise.resolve().then(function () { return require('./input-shims-427999f7.js'); }).then((module) => module.startInputShims(ionicGlobal.config, platform));
39
- }
40
- const hardwareBackButtonModule = await Promise.resolve().then(function () { return require('./hardware-back-button-25372ec7.js'); });
41
- if (ionicGlobal.config.getBoolean('hardwareBackButton', isHybrid)) {
42
- hardwareBackButtonModule.startHardwareBackButton();
43
- }
44
- else {
45
- hardwareBackButtonModule.blockHardwareBackButton();
46
- }
47
- if (typeof window !== 'undefined') {
48
- Promise.resolve().then(function () { return require('./keyboard-79afcba2.js'); }).then((module) => module.startKeyboardAssist(window));
49
- }
50
- Promise.resolve().then(function () { return require('./focus-visible-2624ec15.js'); }).then((module) => (this.focusVisible = module.startFocusVisible()));
51
- });
52
- }
53
- }
54
- /**
55
- * @internal
56
- * Used to set focus on an element that uses `ion-focusable`.
57
- * Do not use this if focusing the element as a result of a keyboard
58
- * event as the focus utility should handle this for us. This method
59
- * should be used when we want to programmatically focus an element as
60
- * a result of another user action. (Ex: We focus the first element
61
- * inside of a popover when the user presents it, but the popover is not always
62
- * presented as a result of keyboard action.)
63
- */
64
- async setFocus(elements) {
65
- if (this.focusVisible) {
66
- this.focusVisible.setFocus(elements);
67
- }
68
- }
69
- render() {
70
- const mode = ionicGlobal.getIonMode(this);
71
- return (index$1.h(index$1.Host, { class: {
72
- [mode]: true,
73
- 'ion-page': true,
74
- 'force-statusbar-padding': ionicGlobal.config.getBoolean('_forceStatusbarPadding'),
75
- } }));
76
- }
77
- get el() { return index$1.getElement(this); }
78
- };
79
- const needInputShims = () => {
80
- /**
81
- * iOS always needs input shims
82
- */
83
- const needsShimsIOS = ionicGlobal.isPlatform(window, 'ios') && ionicGlobal.isPlatform(window, 'mobile');
84
- if (needsShimsIOS) {
85
- return true;
86
- }
87
- /**
88
- * Android only needs input shims when running
89
- * in the browser and only if the browser is using the
90
- * new Chrome 108+ resize behavior: https://developer.chrome.com/blog/viewport-resize-behavior/
91
- */
92
- const isAndroidMobileWeb = ionicGlobal.isPlatform(window, 'android') && ionicGlobal.isPlatform(window, 'mobileweb');
93
- if (isAndroidMobileWeb) {
94
- return true;
95
- }
96
- return false;
97
- };
98
- const rIC = (callback) => {
99
- if ('requestIdleCallback' in window) {
100
- window.requestIdleCallback(callback);
101
- }
102
- else {
103
- setTimeout(callback, 32);
104
- }
105
- };
106
- App.style = appCss;
107
-
108
- const badgeIosCss = ":host{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);--padding-top:3px;--padding-end:8px;--padding-bottom:3px;--padding-start:8px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:inline-block;min-width:10px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:13px;font-weight:bold;line-height:1;text-align:center;white-space:nowrap;contain:content;vertical-align:baseline}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(:empty){display:none}:host{border-radius:10px}";
109
-
110
- const badgeMdCss = ":host{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);--padding-top:3px;--padding-end:8px;--padding-bottom:3px;--padding-start:8px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:inline-block;min-width:10px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:13px;font-weight:bold;line-height:1;text-align:center;white-space:nowrap;contain:content;vertical-align:baseline}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(:empty){display:none}:host{--padding-top:3px;--padding-end:4px;--padding-bottom:4px;--padding-start:4px;border-radius:4px}";
111
-
112
- const Badge = class {
113
- constructor(hostRef) {
114
- index$1.registerInstance(this, hostRef);
115
- }
116
- render() {
117
- const mode = ionicGlobal.getIonMode(this);
118
- return (index$1.h(index$1.Host, { class: theme.createColorClasses(this.color, {
119
- [mode]: true,
120
- }) }, index$1.h("slot", null)));
121
- }
122
- };
123
- Badge.style = {
124
- ios: badgeIosCss,
125
- md: badgeMdCss
126
- };
127
-
128
- const buttonIosCss = ":host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:10px;--padding-top:0;--padding-bottom:0;--padding-start:1em;--padding-end:1em;--transition:background-color, opacity 100ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:2.8em;font-size:16px;font-weight:500;letter-spacing:-0.03em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:var(--ion-color-primary-shade, #3171e0);--background-focused:var(--ion-color-primary-shade, #3171e0);--background-hover:var(--ion-color-primary-tint, #4c8dff);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1}:host(.button-outline){--border-radius:10px;--border-width:1px;--border-style:solid;--background-activated:var(--ion-color-primary, #3880ff);--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;--color-activated:var(--ion-color-primary-contrast, #fff)}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;font-size:17px;font-weight:normal;letter-spacing:0}:host(.button-large){--border-radius:12px;--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--border-radius:6px;--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-strong){font-weight:600}:host(.button-clear.ion-activated){opacity:0.4}:host(.button-outline.ion-activated.ion-color) .button-native{color:var(--ion-color-contrast)}:host(.button-outline.ion-activated.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-activated) .button-native::after{background:var(--ion-color-shade)}:host(.button-outline.ion-focused.ion-color) .button-native,:host(.button-clear.ion-focused.ion-color) .button-native{color:var(--ion-color-base)}:host(.button-outline.ion-focused.ion-color) .button-native::after,:host(.button-clear.ion-focused.ion-color) .button-native::after{background:var(--ion-color-base)}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-shade)}@media (any-hover: hover){:host(.button-clear:hover),:host(.button-outline:hover){opacity:0.6}:host(.button-clear.ion-color:hover) .button-native,:host(.button-outline.ion-color:hover) .button-native{color:var(--ion-color-base)}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:transparent}:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-tint)}:host(:hover.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native::after{background:#fff;opacity:0.1}}";
129
-
130
- const buttonMdCss = ":host{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;font-kerning:none}:host(.button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.button-solid){--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}:host(.button-outline){--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-clear){--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}:host(.button-block){display:block}:host(.button-block) .button-native{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}:host(.button-block) .button-native::after{clear:both}:host(.button-full){display:block}:host(.button-full) .button-native{margin-left:0;margin-right:0;display:block;width:100%;contain:content}:host(.button-full:not(.button-round)) .button-native{border-radius:0;border-right-width:0;border-left-width:0}.button-native{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;box-sizing:border-box;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::-moz-focus-inner{border:0}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}::slotted(ion-icon){font-size:1.4em;pointer-events:none}::slotted(ion-icon[slot=start]){margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}::slotted(ion-icon[slot=end]){margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}::slotted(ion-icon[slot=icon-only]){font-size:1.8em}ion-ripple-effect{color:var(--ripple-color)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}:host(.ion-activated){color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-focused){color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover){color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}:host(.button-solid.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.button-outline.ion-color) .button-native{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}:host(.button-clear.ion-color) .button-native{background:transparent;color:var(--ion-color-base)}:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{color:var(--ion-toolbar-color, var(--color))}:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}:host{--border-radius:4px;--padding-top:0;--padding-bottom:0;--padding-start:1.1em;--padding-end:1.1em;--transition:box-shadow 280ms cubic-bezier(.4, 0, .2, 1),\n background-color 15ms linear,\n color 15ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:36px;font-size:14px;font-weight:500;letter-spacing:0.06em;text-transform:uppercase}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}:host(.button-solid){--background-activated:transparent;--background-hover:var(--ion-color-primary-contrast, #fff);--background-focused:var(--ion-color-primary-contrast, #fff);--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}:host(.button-solid.ion-activated){--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12)}:host(.button-outline){--border-width:2px;--border-style:solid;--box-shadow:none;--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-outline.ion-activated.ion-color) .button-native{background:transparent}:host(.button-clear){--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}:host(.button-round){--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}:host(.button-large){--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}:host(.button-small){--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}:host(.button-strong){font-weight:bold}::slotted(ion-icon[slot=icon-only]){padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host(.button-solid.ion-color.ion-focused) .button-native::after{background:var(--ion-color-contrast)}:host(.button-clear.ion-color.ion-focused) .button-native::after,:host(.button-outline.ion-color.ion-focused) .button-native::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.button-solid.ion-color:hover) .button-native::after{background:var(--ion-color-contrast)}:host(.button-clear.ion-color:hover) .button-native::after,:host(.button-outline.ion-color:hover) .button-native::after{background:var(--ion-color-base)}}";
131
-
132
- const Button = class {
133
- constructor(hostRef) {
134
- index$1.registerInstance(this, hostRef);
135
- this.ionFocus = index$1.createEvent(this, "ionFocus", 7);
136
- this.ionBlur = index$1.createEvent(this, "ionBlur", 7);
137
- this.inItem = false;
138
- this.inListHeader = false;
139
- this.inToolbar = false;
140
- this.inheritedAttributes = {};
141
- /**
142
- * The type of button.
143
- */
144
- this.buttonType = 'button';
145
- /**
146
- * If `true`, the user cannot interact with the button.
147
- */
148
- this.disabled = false;
149
- /**
150
- * When using a router, it specifies the transition direction when navigating to
151
- * another page using `href`.
152
- */
153
- this.routerDirection = 'forward';
154
- /**
155
- * If `true`, activates a button with a heavier font weight.
156
- */
157
- this.strong = false;
158
- /**
159
- * The type of the button.
160
- */
161
- this.type = 'button';
162
- this.handleClick = (ev) => {
163
- const { el } = this;
164
- if (this.type === 'button') {
165
- theme.openURL(this.href, ev, this.routerDirection, this.routerAnimation);
166
- }
167
- else if (helpers.hasShadowDom(el)) {
168
- // this button wants to specifically submit a form
169
- // climb up the dom to see if we're in a <form>
170
- // and if so, then use JS to submit it
171
- let formEl = this.findForm();
172
- const { form } = this;
173
- if (!formEl && form !== undefined) {
174
- /**
175
- * The developer specified a form selector for
176
- * the button to submit, but it was not found.
177
- */
178
- if (typeof form === 'string') {
179
- index$2.printIonWarning(`Form with selector: "#${form}" could not be found. Verify that the id is correct and the form is rendered in the DOM.`, el);
180
- }
181
- else {
182
- index$2.printIonWarning(`The provided "form" element is invalid. Verify that the form is a HTMLFormElement and rendered in the DOM.`, el);
183
- }
184
- return;
185
- }
186
- if (!formEl) {
187
- /**
188
- * If the form element is not set, the button may be inside
189
- * of a form element. Query the closest form element to the button.
190
- */
191
- formEl = el.closest('form');
192
- }
193
- if (formEl) {
194
- ev.preventDefault();
195
- const fakeButton = document.createElement('button');
196
- fakeButton.type = this.type;
197
- fakeButton.style.display = 'none';
198
- formEl.appendChild(fakeButton);
199
- fakeButton.click();
200
- fakeButton.remove();
201
- }
202
- }
203
- };
204
- this.onFocus = () => {
205
- this.ionFocus.emit();
206
- };
207
- this.onBlur = () => {
208
- this.ionBlur.emit();
209
- };
210
- }
211
- componentWillLoad() {
212
- this.inToolbar = !!this.el.closest('ion-buttons');
213
- this.inListHeader = !!this.el.closest('ion-list-header');
214
- this.inItem = !!this.el.closest('ion-item') || !!this.el.closest('ion-item-divider');
215
- this.inheritedAttributes = helpers.inheritAriaAttributes(this.el);
216
- }
217
- get hasIconOnly() {
218
- return !!this.el.querySelector('[slot="icon-only"]');
219
- }
220
- get rippleType() {
221
- const hasClearFill = this.fill === undefined || this.fill === 'clear';
222
- // If the button is in a toolbar, has a clear fill (which is the default)
223
- // and only has an icon we use the unbounded "circular" ripple effect
224
- if (hasClearFill && this.hasIconOnly && this.inToolbar) {
225
- return 'unbounded';
226
- }
227
- return 'bounded';
228
- }
229
- /**
230
- * Finds the form element based on the provided `form` selector
231
- * or element reference provided.
232
- */
233
- findForm() {
234
- const { form } = this;
235
- if (form instanceof HTMLFormElement) {
236
- return form;
237
- }
238
- if (typeof form === 'string') {
239
- const el = document.getElementById(form);
240
- if (el instanceof HTMLFormElement) {
241
- return el;
242
- }
243
- }
244
- return null;
245
- }
246
- render() {
247
- const mode = ionicGlobal.getIonMode(this);
248
- const { buttonType, type, disabled, rel, target, size, href, color, expand, hasIconOnly, shape, strong, inheritedAttributes, } = this;
249
- const finalSize = size === undefined && this.inItem ? 'small' : size;
250
- const TagType = href === undefined ? 'button' : 'a';
251
- const attrs = TagType === 'button'
252
- ? { type }
253
- : {
254
- download: this.download,
255
- href,
256
- rel,
257
- target,
258
- };
259
- let fill = this.fill;
260
- /**
261
- * We check both undefined and null to
262
- * work around https://github.com/ionic-team/stencil/issues/3586.
263
- */
264
- if (fill == null) {
265
- fill = this.inToolbar || this.inListHeader ? 'clear' : 'solid';
266
- }
267
- return (index$1.h(index$1.Host, { onClick: this.handleClick, "aria-disabled": disabled ? 'true' : null, class: theme.createColorClasses(color, {
268
- [mode]: true,
269
- [buttonType]: true,
270
- [`${buttonType}-${expand}`]: expand !== undefined,
271
- [`${buttonType}-${finalSize}`]: finalSize !== undefined,
272
- [`${buttonType}-${shape}`]: shape !== undefined,
273
- [`${buttonType}-${fill}`]: true,
274
- [`${buttonType}-strong`]: strong,
275
- 'in-toolbar': theme.hostContext('ion-toolbar', this.el),
276
- 'in-toolbar-color': theme.hostContext('ion-toolbar[color]', this.el),
277
- 'button-has-icon-only': hasIconOnly,
278
- 'button-disabled': disabled,
279
- 'ion-activatable': true,
280
- 'ion-focusable': true,
281
- }) }, index$1.h(TagType, Object.assign({}, attrs, { class: "button-native", part: "native", disabled: disabled, onFocus: this.onFocus, onBlur: this.onBlur }, inheritedAttributes), index$1.h("span", { class: "button-inner" }, index$1.h("slot", { name: "icon-only" }), index$1.h("slot", { name: "start" }), index$1.h("slot", null), index$1.h("slot", { name: "end" })), mode === 'md' && index$1.h("ion-ripple-effect", { type: this.rippleType }))));
282
- }
283
- get el() { return index$1.getElement(this); }
284
- };
285
- Button.style = {
286
- ios: buttonIosCss,
287
- md: buttonMdCss
288
- };
289
-
290
- const cardIosCss = ":host{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.card-disabled){cursor:default;opacity:0.3;pointer-events:none}.card-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}.card-native::-moz-focus-inner{border:0}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}ion-ripple-effect{color:var(--ripple-color)}:host{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-600, #666666)));margin-left:16px;margin-right:16px;margin-top:24px;margin-bottom:24px;border-radius:8px;transition:transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1);font-size:14px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}:host(.ion-activated){transform:scale3d(0.97, 0.97, 1)}";
291
-
292
- const cardMdCss = ":host{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.card-disabled){cursor:default;opacity:0.3;pointer-events:none}.card-native{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}.card-native::-moz-focus-inner{border:0}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}ion-ripple-effect{color:var(--ripple-color)}:host{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-550, #737373)));margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px;border-radius:4px;font-size:14px;box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}";
293
-
294
- const Card = class {
295
- constructor(hostRef) {
296
- index$1.registerInstance(this, hostRef);
297
- this.inheritedAriaAttributes = {};
298
- /**
299
- * If `true`, a button tag will be rendered and the card will be tappable.
300
- */
301
- this.button = false;
302
- /**
303
- * The type of the button. Only used when an `onclick` or `button` property is present.
304
- */
305
- this.type = 'button';
306
- /**
307
- * If `true`, the user cannot interact with the card.
308
- */
309
- this.disabled = false;
310
- /**
311
- * When using a router, it specifies the transition direction when navigating to
312
- * another page using `href`.
313
- */
314
- this.routerDirection = 'forward';
315
- }
316
- componentWillLoad() {
317
- this.inheritedAriaAttributes = helpers.inheritAttributes(this.el, ['aria-label']);
318
- }
319
- isClickable() {
320
- return this.href !== undefined || this.button;
321
- }
322
- renderCard(mode) {
323
- const clickable = this.isClickable();
324
- if (!clickable) {
325
- return [index$1.h("slot", null)];
326
- }
327
- const { href, routerAnimation, routerDirection, inheritedAriaAttributes } = this;
328
- const TagType = clickable ? (href === undefined ? 'button' : 'a') : 'div';
329
- const attrs = TagType === 'button'
330
- ? { type: this.type }
331
- : {
332
- download: this.download,
333
- href: this.href,
334
- rel: this.rel,
335
- target: this.target,
336
- };
337
- return (index$1.h(TagType, Object.assign({}, attrs, inheritedAriaAttributes, { class: "card-native", part: "native", disabled: this.disabled, onClick: (ev) => theme.openURL(href, ev, routerDirection, routerAnimation) }), index$1.h("slot", null), clickable && mode === 'md' && index$1.h("ion-ripple-effect", null)));
338
- }
339
- render() {
340
- const mode = ionicGlobal.getIonMode(this);
341
- return (index$1.h(index$1.Host, { class: theme.createColorClasses(this.color, {
342
- [mode]: true,
343
- 'card-disabled': this.disabled,
344
- 'ion-activatable': this.isClickable(),
345
- }) }, this.renderCard(mode)));
346
- }
347
- get el() { return index$1.getElement(this); }
348
- };
349
- Card.style = {
350
- ios: cardIosCss,
351
- md: cardMdCss
352
- };
353
-
354
- const cardContentIosCss = "ion-card-content{display:block;position:relative}.card-content-ios{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;font-size:16px;line-height:1.4}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.card-content-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}.card-content-ios h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-ios h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-ios h3,.card-content-ios h4,.card-content-ios h5,.card-content-ios h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-ios p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px}ion-card-header+.card-content-ios{padding-top:0}";
355
-
356
- const cardContentMdCss = "ion-card-content{display:block;position:relative}.card-content-md{padding-left:16px;padding-right:16px;padding-top:13px;padding-bottom:13px;font-size:14px;line-height:1.5}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.card-content-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.card-content-md h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-md h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-md h3,.card-content-md h4,.card-content-md h5,.card-content-md h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-md p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:1.5}ion-card-header+.card-content-md{padding-top:0}";
357
-
358
- const CardContent = class {
359
- constructor(hostRef) {
360
- index$1.registerInstance(this, hostRef);
361
- }
362
- render() {
363
- const mode = ionicGlobal.getIonMode(this);
364
- return (index$1.h(index$1.Host, { class: {
365
- [mode]: true,
366
- // Used internally for styling
367
- [`card-content-${mode}`]: true,
368
- } }));
369
- }
370
- };
371
- CardContent.style = {
372
- ios: cardContentIosCss,
373
- md: cardContentMdCss
374
- };
375
-
376
- const cardHeaderIosCss = ":host{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}@supports (backdrop-filter: blur(0)){:host(.card-header-translucent){background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.9);backdrop-filter:saturate(180%) blur(30px)}}";
377
-
378
- const cardHeaderMdCss = ":host{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{padding-left:16px;padding-right:16px;padding-top:16px;padding-bottom:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-card-title:not(:first-child)),::slotted(ion-card-subtitle:not(:first-child)){margin-top:8px}";
379
-
380
- const CardHeader = class {
381
- constructor(hostRef) {
382
- index$1.registerInstance(this, hostRef);
383
- /**
384
- * If `true`, the card header will be translucent.
385
- * Only applies when the mode is `"ios"` and the device supports
386
- * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
387
- */
388
- this.translucent = false;
389
- }
390
- render() {
391
- const mode = ionicGlobal.getIonMode(this);
392
- return (index$1.h(index$1.Host, { class: theme.createColorClasses(this.color, {
393
- 'card-header-translucent': this.translucent,
394
- 'ion-inherit-color': true,
395
- [mode]: true,
396
- }) }, index$1.h("slot", null)));
397
- }
398
- };
399
- CardHeader.style = {
400
- ios: cardHeaderIosCss,
401
- md: cardHeaderMdCss
402
- };
403
-
404
- const cardTitleIosCss = ":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-text-color, #000);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:28px;font-weight:700;line-height:1.2}";
405
-
406
- const cardTitleMdCss = ":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-850, #262626);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;line-height:1.2}";
407
-
408
- const CardTitle = class {
409
- constructor(hostRef) {
410
- index$1.registerInstance(this, hostRef);
411
- }
412
- render() {
413
- const mode = ionicGlobal.getIonMode(this);
414
- return (index$1.h(index$1.Host, { role: "heading", "aria-level": "2", class: theme.createColorClasses(this.color, {
415
- 'ion-inherit-color': true,
416
- [mode]: true,
417
- }) }, index$1.h("slot", null)));
418
- }
419
- };
420
- CardTitle.style = {
421
- ios: cardTitleIosCss,
422
- md: cardTitleMdCss
423
- };
424
-
425
- /*!
426
- * (C) Ionic http://ionicframework.com - MIT License
427
- */
428
- const SIZE_TO_MEDIA = {
429
- xs: '(min-width: 0px)',
430
- sm: '(min-width: 576px)',
431
- md: '(min-width: 768px)',
432
- lg: '(min-width: 992px)',
433
- xl: '(min-width: 1200px)',
434
- };
435
- // Check if the window matches the media query
436
- // at the breakpoint passed
437
- // e.g. matchBreakpoint('sm') => true if screen width exceeds 576px
438
- const matchBreakpoint = (breakpoint) => {
439
- if (breakpoint === undefined || breakpoint === '') {
440
- return true;
441
- }
442
- if (window.matchMedia) {
443
- const mediaQuery = SIZE_TO_MEDIA[breakpoint];
444
- return window.matchMedia(mediaQuery).matches;
445
- }
446
- return false;
447
- };
448
-
449
- const colCss = ":host{padding-left:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;box-sizing:border-box;position:relative;flex-basis:0;flex-grow:1;width:100%;max-width:100%;min-height:1px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px))}}@media (min-width: 576px){:host{padding-left:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 768px){:host{padding-left:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 992px){:host{padding-left:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 1200px){:host{padding-left:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px))}}}";
450
-
451
- const win = typeof window !== 'undefined' ? window : undefined;
452
- // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
453
- const SUPPORTS_VARS = win && !!(win.CSS && win.CSS.supports && win.CSS.supports('--a: 0'));
454
- const BREAKPOINTS = ['', 'xs', 'sm', 'md', 'lg', 'xl'];
455
- const Col = class {
456
- constructor(hostRef) {
457
- index$1.registerInstance(this, hostRef);
458
- }
459
- onResize() {
460
- index$1.forceUpdate(this);
461
- }
462
- // Loop through all of the breakpoints to see if the media query
463
- // matches and grab the column value from the relevant prop if so
464
- getColumns(property) {
465
- let matched;
466
- for (const breakpoint of BREAKPOINTS) {
467
- const matches = matchBreakpoint(breakpoint);
468
- // Grab the value of the property, if it exists and our
469
- // media query matches we return the value
470
- const columns = this[property + breakpoint.charAt(0).toUpperCase() + breakpoint.slice(1)];
471
- if (matches && columns !== undefined) {
472
- matched = columns;
473
- }
474
- }
475
- // Return the last matched columns since the breakpoints
476
- // increase in size and we want to return the largest match
477
- return matched;
478
- }
479
- calculateSize() {
480
- const columns = this.getColumns('size');
481
- // If size wasn't set for any breakpoint
482
- // or if the user set the size without a value
483
- // it means we need to stick with the default and return
484
- // e.g. <ion-col size-md>
485
- if (!columns || columns === '') {
486
- return;
487
- }
488
- // If the size is set to auto then don't calculate a size
489
- const colSize = columns === 'auto'
490
- ? 'auto'
491
- : // If CSS supports variables we should use the grid columns var
492
- SUPPORTS_VARS
493
- ? `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`
494
- : // Convert the columns to a percentage by dividing by the total number
495
- // of columns (12) and then multiplying by 100
496
- (columns / 12) * 100 + '%';
497
- return {
498
- flex: `0 0 ${colSize}`,
499
- width: `${colSize}`,
500
- 'max-width': `${colSize}`,
501
- };
502
- }
503
- // Called by push, pull, and offset since they use the same calculations
504
- calculatePosition(property, modifier) {
505
- const columns = this.getColumns(property);
506
- if (!columns) {
507
- return;
508
- }
509
- // If the number of columns passed are greater than 0 and less than
510
- // 12 we can position the column, else default to auto
511
- const amount = SUPPORTS_VARS
512
- ? // If CSS supports variables we should use the grid columns var
513
- `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`
514
- : // Convert the columns to a percentage by dividing by the total number
515
- // of columns (12) and then multiplying by 100
516
- columns > 0 && columns < 12
517
- ? (columns / 12) * 100 + '%'
518
- : 'auto';
519
- return {
520
- [modifier]: amount,
521
- };
522
- }
523
- calculateOffset(isRTL) {
524
- return this.calculatePosition('offset', isRTL ? 'margin-right' : 'margin-left');
525
- }
526
- calculatePull(isRTL) {
527
- return this.calculatePosition('pull', isRTL ? 'left' : 'right');
528
- }
529
- calculatePush(isRTL) {
530
- return this.calculatePosition('push', isRTL ? 'right' : 'left');
531
- }
532
- render() {
533
- const isRTL = document.dir === 'rtl';
534
- const mode = ionicGlobal.getIonMode(this);
535
- return (index$1.h(index$1.Host, { class: {
536
- [mode]: true,
537
- }, style: Object.assign(Object.assign(Object.assign(Object.assign({}, this.calculateOffset(isRTL)), this.calculatePull(isRTL)), this.calculatePush(isRTL)), this.calculateSize()) }, index$1.h("slot", null)));
538
- }
539
- };
540
- Col.style = colCss;
541
-
542
- const contentCss = ":host{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}:host(.ion-color) .inner-scroll{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.outer-content){--background:var(--ion-color-step-50, #f2f2f2)}#background-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}.inner-scroll{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom));position:absolute;color:var(--color);box-sizing:border-box;overflow:hidden;touch-action:pan-x pan-y pinch-zoom}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.inner-scroll{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.scroll-y,.scroll-x{-webkit-overflow-scrolling:touch;z-index:0;will-change:scroll-position}.scroll-y{overflow-y:var(--overflow);overscroll-behavior-y:contain}.scroll-x{overflow-x:var(--overflow);overscroll-behavior-x:contain}.overscroll::before,.overscroll::after{position:absolute;width:1px;height:1px;content:\"\"}.overscroll::before{bottom:-1px}.overscroll::after{top:-1px}:host(.content-sizing){display:flex;flex-direction:column;min-height:0;contain:none}:host(.content-sizing) .inner-scroll{position:relative;top:0;bottom:0;margin-top:calc(var(--offset-top) * -1);margin-bottom:calc(var(--offset-bottom) * -1)}.transition-effect{display:none;position:absolute;width:100%;height:100vh;opacity:0;pointer-events:none}:host(.content-ltr) .transition-effect{left:-100%;}:host(.content-rtl) .transition-effect{right:-100%;}.transition-cover{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}.transition-shadow{display:block;position:absolute;width:10px;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAYAAAAIXrg4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTE3MDgzRkQ5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTE3MDgzRkU5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMTcwODNGQjlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxMTcwODNGQzlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmePEuQAAABNSURBVHjaYvz//z8DIxAwMDAwATGMhmFmPDQuOSZks0AMmoJBaQHjkPfB0Lfg/2gQjVow+HPy/yHvg9GiYjQfjMbBqAWjFgy/4hogwADYqwdzxy5BuwAAAABJRU5ErkJggg==);background-repeat:repeat-y;background-size:10px 16px}:host(.content-ltr) .transition-shadow{right:0;}:host(.content-rtl) .transition-shadow{left:0;transform:scaleX(-1)}::slotted([slot=fixed]){position:absolute;transform:translateZ(0)}";
543
-
544
- const Content = class {
545
- constructor(hostRef) {
546
- index$1.registerInstance(this, hostRef);
547
- this.ionScrollStart = index$1.createEvent(this, "ionScrollStart", 7);
548
- this.ionScroll = index$1.createEvent(this, "ionScroll", 7);
549
- this.ionScrollEnd = index$1.createEvent(this, "ionScrollEnd", 7);
550
- this.isScrolling = false;
551
- this.lastScroll = 0;
552
- this.queued = false;
553
- this.cTop = -1;
554
- this.cBottom = -1;
555
- this.isMainContent = true;
556
- // Detail is used in a hot loop in the scroll event, by allocating it here
557
- // V8 will be able to inline any read/write to it since it's a monomorphic class.
558
- // https://mrale.ph/blog/2015/01/11/whats-up-with-monomorphism.html
559
- this.detail = {
560
- scrollTop: 0,
561
- scrollLeft: 0,
562
- type: 'scroll',
563
- event: undefined,
564
- startX: 0,
565
- startY: 0,
566
- startTime: 0,
567
- currentX: 0,
568
- currentY: 0,
569
- velocityX: 0,
570
- velocityY: 0,
571
- deltaX: 0,
572
- deltaY: 0,
573
- currentTime: 0,
574
- data: undefined,
575
- isScrolling: true,
576
- };
577
- /**
578
- * If `true`, the content will scroll behind the headers
579
- * and footers. This effect can easily be seen by setting the toolbar
580
- * to transparent.
581
- */
582
- this.fullscreen = false;
583
- /**
584
- * If you want to enable the content scrolling in the X axis, set this property to `true`.
585
- */
586
- this.scrollX = false;
587
- /**
588
- * If you want to disable the content scrolling in the Y axis, set this property to `false`.
589
- */
590
- this.scrollY = true;
591
- /**
592
- * Because of performance reasons, ionScroll events are disabled by default, in order to enable them
593
- * and start listening from (ionScroll), set this property to `true`.
594
- */
595
- this.scrollEvents = false;
596
- }
597
- connectedCallback() {
598
- this.isMainContent = this.el.closest('ion-menu, ion-popover, ion-modal') === null;
599
- }
600
- disconnectedCallback() {
601
- this.onScrollEnd();
602
- }
603
- onAppLoad() {
604
- this.resize();
605
- }
606
- shouldForceOverscroll() {
607
- const { forceOverscroll } = this;
608
- const mode = ionicGlobal.getIonMode(this);
609
- return forceOverscroll === undefined ? mode === 'ios' && ionicGlobal.isPlatform('ios') : forceOverscroll;
610
- }
611
- resize() {
612
- if (this.fullscreen) {
613
- index$1.readTask(() => this.readDimensions());
614
- }
615
- else if (this.cTop !== 0 || this.cBottom !== 0) {
616
- this.cTop = this.cBottom = 0;
617
- index$1.forceUpdate(this);
618
- }
619
- }
620
- readDimensions() {
621
- const page = getPageElement(this.el);
622
- const top = Math.max(this.el.offsetTop, 0);
623
- const bottom = Math.max(page.offsetHeight - top - this.el.offsetHeight, 0);
624
- const dirty = top !== this.cTop || bottom !== this.cBottom;
625
- if (dirty) {
626
- this.cTop = top;
627
- this.cBottom = bottom;
628
- index$1.forceUpdate(this);
629
- }
630
- }
631
- onScroll(ev) {
632
- const timeStamp = Date.now();
633
- const shouldStart = !this.isScrolling;
634
- this.lastScroll = timeStamp;
635
- if (shouldStart) {
636
- this.onScrollStart();
637
- }
638
- if (!this.queued && this.scrollEvents) {
639
- this.queued = true;
640
- index$1.readTask((ts) => {
641
- this.queued = false;
642
- this.detail.event = ev;
643
- updateScrollDetail(this.detail, this.scrollEl, ts, shouldStart);
644
- this.ionScroll.emit(this.detail);
645
- });
646
- }
647
- }
648
- /**
649
- * Get the element where the actual scrolling takes place.
650
- * This element can be used to subscribe to `scroll` events or manually modify
651
- * `scrollTop`. However, it's recommended to use the API provided by `ion-content`:
652
- *
653
- * i.e. Using `ionScroll`, `ionScrollStart`, `ionScrollEnd` for scrolling events
654
- * and `scrollToPoint()` to scroll the content into a certain point.
655
- */
656
- async getScrollElement() {
657
- /**
658
- * If this gets called in certain early lifecycle hooks (ex: Vue onMounted),
659
- * scrollEl won't be defined yet with the custom elements build, so wait for it to load in.
660
- */
661
- if (!this.scrollEl) {
662
- await new Promise((resolve) => helpers.componentOnReady(this.el, resolve));
663
- }
664
- return Promise.resolve(this.scrollEl);
665
- }
666
- /**
667
- * Returns the background content element.
668
- * @internal
669
- */
670
- async getBackgroundElement() {
671
- if (!this.backgroundContentEl) {
672
- await new Promise((resolve) => helpers.componentOnReady(this.el, resolve));
673
- }
674
- return Promise.resolve(this.backgroundContentEl);
675
- }
676
- /**
677
- * Scroll to the top of the component.
678
- *
679
- * @param duration The amount of time to take scrolling to the top. Defaults to `0`.
680
- */
681
- scrollToTop(duration = 0) {
682
- return this.scrollToPoint(undefined, 0, duration);
683
- }
684
- /**
685
- * Scroll to the bottom of the component.
686
- *
687
- * @param duration The amount of time to take scrolling to the bottom. Defaults to `0`.
688
- */
689
- async scrollToBottom(duration = 0) {
690
- const scrollEl = await this.getScrollElement();
691
- const y = scrollEl.scrollHeight - scrollEl.clientHeight;
692
- return this.scrollToPoint(undefined, y, duration);
693
- }
694
- /**
695
- * Scroll by a specified X/Y distance in the component.
696
- *
697
- * @param x The amount to scroll by on the horizontal axis.
698
- * @param y The amount to scroll by on the vertical axis.
699
- * @param duration The amount of time to take scrolling by that amount.
700
- */
701
- async scrollByPoint(x, y, duration) {
702
- const scrollEl = await this.getScrollElement();
703
- return this.scrollToPoint(x + scrollEl.scrollLeft, y + scrollEl.scrollTop, duration);
704
- }
705
- /**
706
- * Scroll to a specified X/Y location in the component.
707
- *
708
- * @param x The point to scroll to on the horizontal axis.
709
- * @param y The point to scroll to on the vertical axis.
710
- * @param duration The amount of time to take scrolling to that point. Defaults to `0`.
711
- */
712
- async scrollToPoint(x, y, duration = 0) {
713
- const el = await this.getScrollElement();
714
- if (duration < 32) {
715
- if (y != null) {
716
- el.scrollTop = y;
717
- }
718
- if (x != null) {
719
- el.scrollLeft = x;
720
- }
721
- return;
722
- }
723
- let resolve;
724
- let startTime = 0;
725
- const promise = new Promise((r) => (resolve = r));
726
- const fromY = el.scrollTop;
727
- const fromX = el.scrollLeft;
728
- const deltaY = y != null ? y - fromY : 0;
729
- const deltaX = x != null ? x - fromX : 0;
730
- // scroll loop
731
- const step = (timeStamp) => {
732
- const linearTime = Math.min(1, (timeStamp - startTime) / duration) - 1;
733
- const easedT = Math.pow(linearTime, 3) + 1;
734
- if (deltaY !== 0) {
735
- el.scrollTop = Math.floor(easedT * deltaY + fromY);
736
- }
737
- if (deltaX !== 0) {
738
- el.scrollLeft = Math.floor(easedT * deltaX + fromX);
739
- }
740
- if (easedT < 1) {
741
- // do not use DomController here
742
- // must use nativeRaf in order to fire in the next frame
743
- requestAnimationFrame(step);
744
- }
745
- else {
746
- resolve();
747
- }
748
- };
749
- // chill out for a frame first
750
- requestAnimationFrame((ts) => {
751
- startTime = ts;
752
- step(ts);
753
- });
754
- return promise;
755
- }
756
- onScrollStart() {
757
- this.isScrolling = true;
758
- this.ionScrollStart.emit({
759
- isScrolling: true,
760
- });
761
- if (this.watchDog) {
762
- clearInterval(this.watchDog);
763
- }
764
- // watchdog
765
- this.watchDog = setInterval(() => {
766
- if (this.lastScroll < Date.now() - 120) {
767
- this.onScrollEnd();
768
- }
769
- }, 100);
770
- }
771
- onScrollEnd() {
772
- clearInterval(this.watchDog);
773
- this.watchDog = null;
774
- if (this.isScrolling) {
775
- this.isScrolling = false;
776
- this.ionScrollEnd.emit({
777
- isScrolling: false,
778
- });
779
- }
780
- }
781
- render() {
782
- const { isMainContent, scrollX, scrollY, el } = this;
783
- const rtl = dir$1.isRTL(el) ? 'rtl' : 'ltr';
784
- const mode = ionicGlobal.getIonMode(this);
785
- const forceOverscroll = this.shouldForceOverscroll();
786
- const transitionShadow = mode === 'ios';
787
- const TagType = isMainContent ? 'main' : 'div';
788
- this.resize();
789
- return (index$1.h(index$1.Host, { class: theme.createColorClasses(this.color, {
790
- [mode]: true,
791
- 'content-sizing': theme.hostContext('ion-popover', this.el),
792
- overscroll: forceOverscroll,
793
- [`content-${rtl}`]: true,
794
- }), style: {
795
- '--offset-top': `${this.cTop}px`,
796
- '--offset-bottom': `${this.cBottom}px`,
797
- } }, index$1.h("div", { ref: (el) => (this.backgroundContentEl = el), id: "background-content", part: "background" }), index$1.h(TagType, { class: {
798
- 'inner-scroll': true,
799
- 'scroll-x': scrollX,
800
- 'scroll-y': scrollY,
801
- overscroll: (scrollX || scrollY) && forceOverscroll,
802
- }, ref: (scrollEl) => (this.scrollEl = scrollEl), onScroll: this.scrollEvents ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, index$1.h("slot", null)), transitionShadow ? (index$1.h("div", { class: "transition-effect" }, index$1.h("div", { class: "transition-cover" }), index$1.h("div", { class: "transition-shadow" }))) : null, index$1.h("slot", { name: "fixed" })));
803
- }
804
- get el() { return index$1.getElement(this); }
805
- };
806
- const getParentElement = (el) => {
807
- var _a;
808
- if (el.parentElement) {
809
- // normal element with a parent element
810
- return el.parentElement;
811
- }
812
- if ((_a = el.parentNode) === null || _a === void 0 ? void 0 : _a.host) {
813
- // shadow dom's document fragment
814
- return el.parentNode.host;
815
- }
816
- return null;
817
- };
818
- const getPageElement = (el) => {
819
- const tabs = el.closest('ion-tabs');
820
- if (tabs) {
821
- return tabs;
822
- }
823
- /**
824
- * If we're in a popover, we need to use its wrapper so we can account for space
825
- * between the popover and the edges of the screen. But if the popover contains
826
- * its own page element, we should use that instead.
827
- */
828
- const page = el.closest('ion-app, ion-page, .ion-page, page-inner, .popover-content');
829
- if (page) {
830
- return page;
831
- }
832
- return getParentElement(el);
833
- };
834
- // ******** DOM READ ****************
835
- const updateScrollDetail = (detail, el, timestamp, shouldStart) => {
836
- const prevX = detail.currentX;
837
- const prevY = detail.currentY;
838
- const prevT = detail.currentTime;
839
- const currentX = el.scrollLeft;
840
- const currentY = el.scrollTop;
841
- const timeDelta = timestamp - prevT;
842
- if (shouldStart) {
843
- // remember the start positions
844
- detail.startTime = timestamp;
845
- detail.startX = currentX;
846
- detail.startY = currentY;
847
- detail.velocityX = detail.velocityY = 0;
848
- }
849
- detail.currentTime = timestamp;
850
- detail.currentX = detail.scrollLeft = currentX;
851
- detail.currentY = detail.scrollTop = currentY;
852
- detail.deltaX = currentX - detail.startX;
853
- detail.deltaY = currentY - detail.startY;
854
- if (timeDelta > 0 && timeDelta < 100) {
855
- const velocityX = (currentX - prevX) / timeDelta;
856
- const velocityY = (currentY - prevY) / timeDelta;
857
- detail.velocityX = velocityX * 0.7 + detail.velocityX * 0.3;
858
- detail.velocityY = velocityY * 0.7 + detail.velocityY * 0.3;
859
- }
860
- };
861
- Content.style = contentCss;
862
-
863
- /*!
864
- * (C) Ionic http://ionicframework.com - MIT License
865
- */
866
- const handleFooterFade = (scrollEl, baseEl) => {
867
- index$1.readTask(() => {
868
- const scrollTop = scrollEl.scrollTop;
869
- const maxScroll = scrollEl.scrollHeight - scrollEl.clientHeight;
870
- /**
871
- * Toolbar background will fade
872
- * out over fadeDuration in pixels.
873
- */
874
- const fadeDuration = 10;
875
- /**
876
- * Begin fading out maxScroll - 30px
877
- * from the bottom of the content.
878
- * Also determine how close we are
879
- * to starting the fade. If we are
880
- * before the starting point, the
881
- * scale value will get clamped to 0.
882
- * If we are after the maxScroll (rubber
883
- * band scrolling), the scale value will
884
- * get clamped to 1.
885
- */
886
- const fadeStart = maxScroll - fadeDuration;
887
- const distanceToStart = scrollTop - fadeStart;
888
- const scale = helpers.clamp(0, 1 - distanceToStart / fadeDuration, 1);
889
- index$1.writeTask(() => {
890
- baseEl.style.setProperty('--opacity-scale', scale.toString());
891
- });
892
- });
893
- };
894
-
895
- const footerIosCss = "ion-footer{display:block;position:relative;order:1;width:100%;z-index:10}ion-footer.footer-toolbar-padding ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-ios ion-toolbar:first-of-type{--border-width:0.55px 0 0}@supports (backdrop-filter: blur(0)){.footer-background{left:0;right:0;top:0;bottom:0;position:absolute;backdrop-filter:saturate(180%) blur(20px)}.footer-translucent-ios ion-toolbar{--opacity:.8}}.footer-ios.ion-no-border ion-toolbar:first-of-type{--border-width:0}.footer-collapse-fade ion-toolbar{--opacity-scale:inherit}";
896
-
897
- const footerMdCss = "ion-footer{display:block;position:relative;order:1;width:100%;z-index:10}ion-footer.footer-toolbar-padding ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-md::before{left:0;top:-2px;bottom:auto;background-position:left 0 top 0;position:absolute;width:100%;height:2px;background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==\");background-repeat:repeat-x;content:\"\"}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{left:unset;right:unset;right:0}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{background-position:right 0 top 0}.footer-md.ion-no-border::before{display:none}";
898
-
899
- const Footer = class {
900
- constructor(hostRef) {
901
- index$1.registerInstance(this, hostRef);
902
- this.keyboardCtrl = null;
903
- this.keyboardVisible = false;
904
- /**
905
- * If `true`, the footer will be translucent.
906
- * Only applies when the mode is `"ios"` and the device supports
907
- * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
908
- *
909
- * Note: In order to scroll content behind the footer, the `fullscreen`
910
- * attribute needs to be set on the content.
911
- */
912
- this.translucent = false;
913
- this.checkCollapsibleFooter = () => {
914
- const mode = ionicGlobal.getIonMode(this);
915
- if (mode !== 'ios') {
916
- return;
917
- }
918
- const { collapse } = this;
919
- const hasFade = collapse === 'fade';
920
- this.destroyCollapsibleFooter();
921
- if (hasFade) {
922
- const pageEl = this.el.closest('ion-app,ion-page,.ion-page,page-inner');
923
- const contentEl = pageEl ? index$3.findIonContent(pageEl) : null;
924
- if (!contentEl) {
925
- index$3.printIonContentErrorMsg(this.el);
926
- return;
927
- }
928
- this.setupFadeFooter(contentEl);
929
- }
930
- };
931
- this.setupFadeFooter = async (contentEl) => {
932
- const scrollEl = (this.scrollEl = await index$3.getScrollElement(contentEl));
933
- /**
934
- * Handle fading of toolbars on scroll
935
- */
936
- this.contentScrollCallback = () => {
937
- handleFooterFade(scrollEl, this.el);
938
- };
939
- scrollEl.addEventListener('scroll', this.contentScrollCallback);
940
- handleFooterFade(scrollEl, this.el);
941
- };
942
- }
943
- componentDidLoad() {
944
- this.checkCollapsibleFooter();
945
- }
946
- componentDidUpdate() {
947
- this.checkCollapsibleFooter();
948
- }
949
- connectedCallback() {
950
- this.keyboardCtrl = keyboardController.createKeyboardController((keyboardOpen) => {
951
- this.keyboardVisible = keyboardOpen; // trigger re-render by updating state
952
- });
953
- }
954
- disconnectedCallback() {
955
- if (this.keyboardCtrl) {
956
- this.keyboardCtrl.destroy();
957
- }
958
- }
959
- destroyCollapsibleFooter() {
960
- if (this.scrollEl && this.contentScrollCallback) {
961
- this.scrollEl.removeEventListener('scroll', this.contentScrollCallback);
962
- this.contentScrollCallback = undefined;
963
- }
964
- }
965
- render() {
966
- const { translucent, collapse } = this;
967
- const mode = ionicGlobal.getIonMode(this);
968
- const tabs = this.el.closest('ion-tabs');
969
- const tabBar = tabs === null || tabs === void 0 ? void 0 : tabs.querySelector(':scope > ion-tab-bar');
970
- return (index$1.h(index$1.Host, { role: "contentinfo", class: {
971
- [mode]: true,
972
- // Used internally for styling
973
- [`footer-${mode}`]: true,
974
- [`footer-translucent`]: translucent,
975
- [`footer-translucent-${mode}`]: translucent,
976
- ['footer-toolbar-padding']: !this.keyboardVisible && (!tabBar || tabBar.slot !== 'bottom'),
977
- [`footer-collapse-${collapse}`]: collapse !== undefined,
978
- } }, mode === 'ios' && translucent && index$1.h("div", { class: "footer-background" }), index$1.h("slot", null)));
979
- }
980
- get el() { return index$1.getElement(this); }
981
- };
982
- Footer.style = {
983
- ios: footerIosCss,
984
- md: footerMdCss
985
- };
986
-
987
- const gridCss = ":host{padding-left:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));margin-left:auto;margin-right:auto;display:block;flex:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px))}}@media (min-width: 576px){:host{padding-left:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px))}}}@media (min-width: 768px){:host{padding-left:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px))}}}@media (min-width: 992px){:host{padding-left:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px))}}}@media (min-width: 1200px){:host{padding-left:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px))}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px))}}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.grid-fixed){width:var(--ion-grid-width-xs, var(--ion-grid-width, 100%));max-width:100%}@media (min-width: 576px){:host(.grid-fixed){width:var(--ion-grid-width-sm, var(--ion-grid-width, 540px))}}@media (min-width: 768px){:host(.grid-fixed){width:var(--ion-grid-width-md, var(--ion-grid-width, 720px))}}@media (min-width: 992px){:host(.grid-fixed){width:var(--ion-grid-width-lg, var(--ion-grid-width, 960px))}}@media (min-width: 1200px){:host(.grid-fixed){width:var(--ion-grid-width-xl, var(--ion-grid-width, 1140px))}}:host(.ion-no-padding){--ion-grid-column-padding:0;--ion-grid-column-padding-xs:0;--ion-grid-column-padding-sm:0;--ion-grid-column-padding-md:0;--ion-grid-column-padding-lg:0;--ion-grid-column-padding-xl:0}";
988
-
989
- const Grid = class {
990
- constructor(hostRef) {
991
- index$1.registerInstance(this, hostRef);
992
- /**
993
- * If `true`, the grid will have a fixed width based on the screen size.
994
- */
995
- this.fixed = false;
996
- }
997
- render() {
998
- const mode = ionicGlobal.getIonMode(this);
999
- return (index$1.h(index$1.Host, { class: {
1000
- [mode]: true,
1001
- 'grid-fixed': this.fixed,
1002
- } }, index$1.h("slot", null)));
1003
- }
1004
- };
1005
- Grid.style = gridCss;
1006
-
1007
- /*!
1008
- * (C) Ionic http://ionicframework.com - MIT License
1009
- */
1010
- const TRANSITION = 'all 0.2s ease-in-out';
1011
- const cloneElement = (tagName) => {
1012
- const getCachedEl = document.querySelector(`${tagName}.ion-cloned-element`);
1013
- if (getCachedEl !== null) {
1014
- return getCachedEl;
1015
- }
1016
- const clonedEl = document.createElement(tagName);
1017
- clonedEl.classList.add('ion-cloned-element');
1018
- clonedEl.style.setProperty('display', 'none');
1019
- document.body.appendChild(clonedEl);
1020
- return clonedEl;
1021
- };
1022
- const createHeaderIndex = (headerEl) => {
1023
- if (!headerEl) {
1024
- return;
1025
- }
1026
- const toolbars = headerEl.querySelectorAll('ion-toolbar');
1027
- return {
1028
- el: headerEl,
1029
- toolbars: Array.from(toolbars).map((toolbar) => {
1030
- const ionTitleEl = toolbar.querySelector('ion-title');
1031
- return {
1032
- el: toolbar,
1033
- background: toolbar.shadowRoot.querySelector('.toolbar-background'),
1034
- ionTitleEl,
1035
- innerTitleEl: ionTitleEl ? ionTitleEl.shadowRoot.querySelector('.toolbar-title') : null,
1036
- ionButtonsEl: Array.from(toolbar.querySelectorAll('ion-buttons')),
1037
- };
1038
- }),
1039
- };
1040
- };
1041
- const handleContentScroll = (scrollEl, scrollHeaderIndex, contentEl) => {
1042
- index$1.readTask(() => {
1043
- const scrollTop = scrollEl.scrollTop;
1044
- const scale = helpers.clamp(1, 1 + -scrollTop / 500, 1.1);
1045
- // Native refresher should not cause titles to scale
1046
- const nativeRefresher = contentEl.querySelector('ion-refresher.refresher-native');
1047
- if (nativeRefresher === null) {
1048
- index$1.writeTask(() => {
1049
- scaleLargeTitles(scrollHeaderIndex.toolbars, scale);
1050
- });
1051
- }
1052
- });
1053
- };
1054
- const setToolbarBackgroundOpacity = (headerEl, opacity) => {
1055
- /**
1056
- * Fading in the backdrop opacity
1057
- * should happen after the large title
1058
- * has collapsed, so it is handled
1059
- * by handleHeaderFade()
1060
- */
1061
- if (headerEl.collapse === 'fade') {
1062
- return;
1063
- }
1064
- if (opacity === undefined) {
1065
- headerEl.style.removeProperty('--opacity-scale');
1066
- }
1067
- else {
1068
- headerEl.style.setProperty('--opacity-scale', opacity.toString());
1069
- }
1070
- };
1071
- const handleToolbarBorderIntersection = (ev, mainHeaderIndex, scrollTop) => {
1072
- if (!ev[0].isIntersecting) {
1073
- return;
1074
- }
1075
- /**
1076
- * There is a bug in Safari where overflow scrolling on a non-body element
1077
- * does not always reset the scrollTop position to 0 when letting go. It will
1078
- * set to 1 once the rubber band effect has ended. This causes the background to
1079
- * appear slightly on certain app setups.
1080
- *
1081
- * Additionally, we check if user is rubber banding (scrolling is negative)
1082
- * as this can mean they are using pull to refresh. Once the refresher starts,
1083
- * the content is transformed which can cause the intersection observer to erroneously
1084
- * fire here as well.
1085
- */
1086
- const scale = ev[0].intersectionRatio > 0.9 || scrollTop <= 0 ? 0 : ((1 - ev[0].intersectionRatio) * 100) / 75;
1087
- setToolbarBackgroundOpacity(mainHeaderIndex.el, scale === 1 ? undefined : scale);
1088
- };
1089
- /**
1090
- * If toolbars are intersecting, hide the scrollable toolbar content
1091
- * and show the primary toolbar content. If the toolbars are not intersecting,
1092
- * hide the primary toolbar content and show the scrollable toolbar content
1093
- */
1094
- const handleToolbarIntersection = (ev, mainHeaderIndex, scrollHeaderIndex, scrollEl) => {
1095
- index$1.writeTask(() => {
1096
- const scrollTop = scrollEl.scrollTop;
1097
- handleToolbarBorderIntersection(ev, mainHeaderIndex, scrollTop);
1098
- const event = ev[0];
1099
- const intersection = event.intersectionRect;
1100
- const intersectionArea = intersection.width * intersection.height;
1101
- const rootArea = event.rootBounds.width * event.rootBounds.height;
1102
- const isPageHidden = intersectionArea === 0 && rootArea === 0;
1103
- const leftDiff = Math.abs(intersection.left - event.boundingClientRect.left);
1104
- const rightDiff = Math.abs(intersection.right - event.boundingClientRect.right);
1105
- const isPageTransitioning = intersectionArea > 0 && (leftDiff >= 5 || rightDiff >= 5);
1106
- if (isPageHidden || isPageTransitioning) {
1107
- return;
1108
- }
1109
- if (event.isIntersecting) {
1110
- setHeaderActive(mainHeaderIndex, false);
1111
- setHeaderActive(scrollHeaderIndex);
1112
- }
1113
- else {
1114
- /**
1115
- * There is a bug with IntersectionObserver on Safari
1116
- * where `event.isIntersecting === false` when cancelling
1117
- * a swipe to go back gesture. Checking the intersection
1118
- * x, y, width, and height provides a workaround. This bug
1119
- * does not happen when using Safari + Web Animations,
1120
- * only Safari + CSS Animations.
1121
- */
1122
- const hasValidIntersection = (intersection.x === 0 && intersection.y === 0) || (intersection.width !== 0 && intersection.height !== 0);
1123
- if (hasValidIntersection && scrollTop > 0) {
1124
- setHeaderActive(mainHeaderIndex);
1125
- setHeaderActive(scrollHeaderIndex, false);
1126
- setToolbarBackgroundOpacity(mainHeaderIndex.el);
1127
- }
1128
- }
1129
- });
1130
- };
1131
- const setHeaderActive = (headerIndex, active = true) => {
1132
- const headerEl = headerIndex.el;
1133
- if (active) {
1134
- headerEl.classList.remove('header-collapse-condense-inactive');
1135
- headerEl.removeAttribute('aria-hidden');
1136
- }
1137
- else {
1138
- headerEl.classList.add('header-collapse-condense-inactive');
1139
- headerEl.setAttribute('aria-hidden', 'true');
1140
- }
1141
- };
1142
- const scaleLargeTitles = (toolbars = [], scale = 1, transition = false) => {
1143
- toolbars.forEach((toolbar) => {
1144
- const ionTitle = toolbar.ionTitleEl;
1145
- const titleDiv = toolbar.innerTitleEl;
1146
- if (!ionTitle || ionTitle.size !== 'large') {
1147
- return;
1148
- }
1149
- titleDiv.style.transition = transition ? TRANSITION : '';
1150
- titleDiv.style.transform = `scale3d(${scale}, ${scale}, 1)`;
1151
- });
1152
- };
1153
- const handleHeaderFade = (scrollEl, baseEl, condenseHeader) => {
1154
- index$1.readTask(() => {
1155
- const scrollTop = scrollEl.scrollTop;
1156
- const baseElHeight = baseEl.clientHeight;
1157
- const fadeStart = condenseHeader ? condenseHeader.clientHeight : 0;
1158
- /**
1159
- * If we are using fade header with a condense
1160
- * header, then the toolbar backgrounds should
1161
- * not begin to fade in until the condense
1162
- * header has fully collapsed.
1163
- *
1164
- * Additionally, the main content should not
1165
- * overflow out of the container until the
1166
- * condense header has fully collapsed. When
1167
- * using just the condense header the content
1168
- * should overflow out of the container.
1169
- */
1170
- if (condenseHeader !== null && scrollTop < fadeStart) {
1171
- baseEl.style.setProperty('--opacity-scale', '0');
1172
- scrollEl.style.setProperty('clip-path', `inset(${baseElHeight}px 0px 0px 0px)`);
1173
- return;
1174
- }
1175
- const distanceToStart = scrollTop - fadeStart;
1176
- const fadeDuration = 10;
1177
- const scale = helpers.clamp(0, distanceToStart / fadeDuration, 1);
1178
- index$1.writeTask(() => {
1179
- scrollEl.style.removeProperty('clip-path');
1180
- baseEl.style.setProperty('--opacity-scale', scale.toString());
1181
- });
1182
- });
1183
- };
1184
-
1185
- const headerIosCss = "ion-header{display:block;position:relative;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-ios ion-toolbar:last-of-type{--border-width:0 0 0.55px}@supports (backdrop-filter: blur(0)){.header-background{left:0;right:0;top:0;bottom:0;position:absolute;backdrop-filter:saturate(180%) blur(20px)}.header-translucent-ios ion-toolbar{--opacity:.8}.header-collapse-condense-inactive .header-background{backdrop-filter:blur(20px)}}.header-ios.ion-no-border ion-toolbar:last-of-type{--border-width:0}.header-collapse-fade ion-toolbar{--opacity-scale:inherit}.header-collapse-condense{z-index:9}.header-collapse-condense ion-toolbar{position:sticky;top:0}.header-collapse-condense ion-toolbar:first-of-type{padding-top:7px;z-index:1}.header-collapse-condense ion-toolbar{--background:var(--ion-background-color, #fff);z-index:0}.header-collapse-condense ion-toolbar:last-of-type{--border-width:0px}.header-collapse-condense ion-toolbar ion-searchbar{height:48px;padding-top:0px;padding-bottom:13px}.header-collapse-main{--opacity-scale:1}.header-collapse-main ion-toolbar{--opacity-scale:inherit}.header-collapse-main ion-toolbar.in-toolbar ion-title,.header-collapse-main ion-toolbar.in-toolbar ion-buttons{transition:all 0.2s ease-in-out}.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-buttons.buttons-collapse{opacity:0;pointer-events:none}.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-buttons.buttons-collapse{visibility:hidden}";
1186
-
1187
- const headerMdCss = "ion-header{display:block;position:relative;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-md::after{left:0;bottom:-5px;background-position:left 0 top -2px;position:absolute;width:100%;height:5px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==);background-repeat:repeat-x;content:\"\"}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{left:unset;right:unset;right:0}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{background-position:right 0 top -2px}.header-collapse-condense{display:none}.header-md.ion-no-border::after{display:none}";
1188
-
1189
- const Header = class {
1190
- constructor(hostRef) {
1191
- index$1.registerInstance(this, hostRef);
1192
- this.inheritedAttributes = {};
1193
- /**
1194
- * If `true`, the header will be translucent.
1195
- * Only applies when the mode is `"ios"` and the device supports
1196
- * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
1197
- *
1198
- * Note: In order to scroll content behind the header, the `fullscreen`
1199
- * attribute needs to be set on the content.
1200
- */
1201
- this.translucent = false;
1202
- this.setupFadeHeader = async (contentEl, condenseHeader) => {
1203
- const scrollEl = (this.scrollEl = await index$3.getScrollElement(contentEl));
1204
- /**
1205
- * Handle fading of toolbars on scroll
1206
- */
1207
- this.contentScrollCallback = () => {
1208
- handleHeaderFade(this.scrollEl, this.el, condenseHeader);
1209
- };
1210
- scrollEl.addEventListener('scroll', this.contentScrollCallback);
1211
- handleHeaderFade(this.scrollEl, this.el, condenseHeader);
1212
- };
1213
- }
1214
- componentWillLoad() {
1215
- this.inheritedAttributes = helpers.inheritAriaAttributes(this.el);
1216
- }
1217
- componentDidLoad() {
1218
- this.checkCollapsibleHeader();
1219
- }
1220
- componentDidUpdate() {
1221
- this.checkCollapsibleHeader();
1222
- }
1223
- disconnectedCallback() {
1224
- this.destroyCollapsibleHeader();
1225
- }
1226
- async checkCollapsibleHeader() {
1227
- const mode = ionicGlobal.getIonMode(this);
1228
- if (mode !== 'ios') {
1229
- return;
1230
- }
1231
- const { collapse } = this;
1232
- const hasCondense = collapse === 'condense';
1233
- const hasFade = collapse === 'fade';
1234
- this.destroyCollapsibleHeader();
1235
- if (hasCondense) {
1236
- const pageEl = this.el.closest('ion-app,ion-page,.ion-page,page-inner');
1237
- const contentEl = pageEl ? index$3.findIonContent(pageEl) : null;
1238
- // Cloned elements are always needed in iOS transition
1239
- index$1.writeTask(() => {
1240
- const title = cloneElement('ion-title');
1241
- title.size = 'large';
1242
- cloneElement('ion-back-button');
1243
- });
1244
- await this.setupCondenseHeader(contentEl, pageEl);
1245
- }
1246
- else if (hasFade) {
1247
- const pageEl = this.el.closest('ion-app,ion-page,.ion-page,page-inner');
1248
- const contentEl = pageEl ? index$3.findIonContent(pageEl) : null;
1249
- if (!contentEl) {
1250
- index$3.printIonContentErrorMsg(this.el);
1251
- return;
1252
- }
1253
- const condenseHeader = contentEl.querySelector('ion-header[collapse="condense"]');
1254
- await this.setupFadeHeader(contentEl, condenseHeader);
1255
- }
1256
- }
1257
- destroyCollapsibleHeader() {
1258
- if (this.intersectionObserver) {
1259
- this.intersectionObserver.disconnect();
1260
- this.intersectionObserver = undefined;
1261
- }
1262
- if (this.scrollEl && this.contentScrollCallback) {
1263
- this.scrollEl.removeEventListener('scroll', this.contentScrollCallback);
1264
- this.contentScrollCallback = undefined;
1265
- }
1266
- if (this.collapsibleMainHeader) {
1267
- this.collapsibleMainHeader.classList.remove('header-collapse-main');
1268
- this.collapsibleMainHeader = undefined;
1269
- }
1270
- }
1271
- async setupCondenseHeader(contentEl, pageEl) {
1272
- if (!contentEl || !pageEl) {
1273
- index$3.printIonContentErrorMsg(this.el);
1274
- return;
1275
- }
1276
- if (typeof IntersectionObserver === 'undefined') {
1277
- return;
1278
- }
1279
- this.scrollEl = await index$3.getScrollElement(contentEl);
1280
- const headers = pageEl.querySelectorAll('ion-header');
1281
- this.collapsibleMainHeader = Array.from(headers).find((header) => header.collapse !== 'condense');
1282
- if (!this.collapsibleMainHeader) {
1283
- return;
1284
- }
1285
- const mainHeaderIndex = createHeaderIndex(this.collapsibleMainHeader);
1286
- const scrollHeaderIndex = createHeaderIndex(this.el);
1287
- if (!mainHeaderIndex || !scrollHeaderIndex) {
1288
- return;
1289
- }
1290
- setHeaderActive(mainHeaderIndex, false);
1291
- setToolbarBackgroundOpacity(mainHeaderIndex.el, 0);
1292
- /**
1293
- * Handle interaction between toolbar collapse and
1294
- * showing/hiding content in the primary ion-header
1295
- * as well as progressively showing/hiding the main header
1296
- * border as the top-most toolbar collapses or expands.
1297
- */
1298
- const toolbarIntersection = (ev) => {
1299
- handleToolbarIntersection(ev, mainHeaderIndex, scrollHeaderIndex, this.scrollEl);
1300
- };
1301
- this.intersectionObserver = new IntersectionObserver(toolbarIntersection, {
1302
- root: contentEl,
1303
- threshold: [0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],
1304
- });
1305
- this.intersectionObserver.observe(scrollHeaderIndex.toolbars[scrollHeaderIndex.toolbars.length - 1].el);
1306
- /**
1307
- * Handle scaling of large iOS titles and
1308
- * showing/hiding border on last toolbar
1309
- * in primary header
1310
- */
1311
- this.contentScrollCallback = () => {
1312
- handleContentScroll(this.scrollEl, scrollHeaderIndex, contentEl);
1313
- };
1314
- this.scrollEl.addEventListener('scroll', this.contentScrollCallback);
1315
- index$1.writeTask(() => {
1316
- if (this.collapsibleMainHeader !== undefined) {
1317
- this.collapsibleMainHeader.classList.add('header-collapse-main');
1318
- }
1319
- });
1320
- }
1321
- render() {
1322
- const { translucent, inheritedAttributes } = this;
1323
- const mode = ionicGlobal.getIonMode(this);
1324
- const collapse = this.collapse || 'none';
1325
- // banner role must be at top level, so remove role if inside a menu
1326
- const roleType = theme.hostContext('ion-menu', this.el) ? 'none' : 'banner';
1327
- return (index$1.h(index$1.Host, Object.assign({ role: roleType, class: {
1328
- [mode]: true,
1329
- // Used internally for styling
1330
- [`header-${mode}`]: true,
1331
- [`header-translucent`]: this.translucent,
1332
- [`header-collapse-${collapse}`]: true,
1333
- [`header-translucent-${mode}`]: this.translucent,
1334
- } }, inheritedAttributes), mode === 'ios' && translucent && index$1.h("div", { class: "header-background" }), index$1.h("slot", null)));
1335
- }
1336
- get el() { return index$1.getElement(this); }
1337
- };
1338
- Header.style = {
1339
- ios: headerIosCss,
1340
- md: headerMdCss
1341
- };
1342
-
1343
- let CACHED_MAP;
1344
- const getIconMap = () => {
1345
- if (typeof window === 'undefined') {
1346
- return new Map();
1347
- }
1348
- else {
1349
- if (!CACHED_MAP) {
1350
- const win = window;
1351
- win.Ionicons = win.Ionicons || {};
1352
- CACHED_MAP = win.Ionicons.map = win.Ionicons.map || new Map();
1353
- }
1354
- return CACHED_MAP;
1355
- }
1356
- };
1357
- const getUrl = (i) => {
1358
- let url = getSrc(i.src);
1359
- if (url) {
1360
- return url;
1361
- }
1362
- url = getName(i.name, i.icon, i.mode, i.ios, i.md);
1363
- if (url) {
1364
- return getNamedUrl(url);
1365
- }
1366
- if (i.icon) {
1367
- url = getSrc(i.icon);
1368
- if (url) {
1369
- return url;
1370
- }
1371
- url = getSrc(i.icon[i.mode]);
1372
- if (url) {
1373
- return url;
1374
- }
1375
- }
1376
- return null;
1377
- };
1378
- const getNamedUrl = (iconName) => {
1379
- const url = getIconMap().get(iconName);
1380
- if (url) {
1381
- return url;
1382
- }
1383
- return index$1.getAssetPath(`svg/${iconName}.svg`);
1384
- };
1385
- const getName = (iconName, icon, mode, ios, md) => {
1386
- // default to "md" if somehow the mode wasn't set
1387
- mode = (mode && toLower(mode)) === 'ios' ? 'ios' : 'md';
1388
- // if an icon was passed in using the ios or md attributes
1389
- // set the iconName to whatever was passed in
1390
- if (ios && mode === 'ios') {
1391
- iconName = toLower(ios);
1392
- }
1393
- else if (md && mode === 'md') {
1394
- iconName = toLower(md);
1395
- }
1396
- else {
1397
- if (!iconName && icon && !isSrc(icon)) {
1398
- iconName = icon;
1399
- }
1400
- if (isStr(iconName)) {
1401
- iconName = toLower(iconName);
1402
- }
1403
- }
1404
- if (!isStr(iconName) || iconName.trim() === '') {
1405
- return null;
1406
- }
1407
- // only allow alpha characters and dash
1408
- const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
1409
- if (invalidChars !== '') {
1410
- return null;
1411
- }
1412
- return iconName;
1413
- };
1414
- const getSrc = (src) => {
1415
- if (isStr(src)) {
1416
- src = src.trim();
1417
- if (isSrc(src)) {
1418
- return src;
1419
- }
1420
- }
1421
- return null;
1422
- };
1423
- const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
1424
- const isStr = (val) => typeof val === 'string';
1425
- const toLower = (val) => val.toLowerCase();
1426
- /**
1427
- * Elements inside of web components sometimes need to inherit global attributes
1428
- * set on the host. For example, the inner input in `ion-input` should inherit
1429
- * the `title` attribute that developers set directly on `ion-input`. This
1430
- * helper function should be called in componentWillLoad and assigned to a variable
1431
- * that is later used in the render function.
1432
- *
1433
- * This does not need to be reactive as changing attributes on the host element
1434
- * does not trigger a re-render.
1435
- */
1436
- const inheritAttributes = (el, attributes = []) => {
1437
- const attributeObject = {};
1438
- attributes.forEach(attr => {
1439
- if (el.hasAttribute(attr)) {
1440
- const value = el.getAttribute(attr);
1441
- if (value !== null) {
1442
- attributeObject[attr] = el.getAttribute(attr);
1443
- }
1444
- el.removeAttribute(attr);
1445
- }
1446
- });
1447
- return attributeObject;
1448
- };
1449
- /**
1450
- * Returns `true` if the document or host element
1451
- * has a `dir` set to `rtl`. The host value will always
1452
- * take priority over the root document value.
1453
- */
1454
- const isRTL = (hostEl) => {
1455
- if (hostEl) {
1456
- if (hostEl.dir !== '') {
1457
- return hostEl.dir.toLowerCase() === 'rtl';
1458
- }
1459
- }
1460
- return (document === null || document === void 0 ? void 0 : document.dir.toLowerCase()) === 'rtl';
1461
- };
1462
-
1463
- const validateContent = (svgContent) => {
1464
- const div = document.createElement('div');
1465
- div.innerHTML = svgContent;
1466
- // setup this way to ensure it works on our buddy IE
1467
- for (let i = div.childNodes.length - 1; i >= 0; i--) {
1468
- if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
1469
- div.removeChild(div.childNodes[i]);
1470
- }
1471
- }
1472
- // must only have 1 root element
1473
- const svgElm = div.firstElementChild;
1474
- if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
1475
- const svgClass = svgElm.getAttribute('class') || '';
1476
- svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
1477
- // root element must be an svg
1478
- // lets double check we've got valid elements
1479
- // do not allow scripts
1480
- if (isValid(svgElm)) {
1481
- return div.innerHTML;
1482
- }
1483
- }
1484
- return '';
1485
- };
1486
- const isValid = (elm) => {
1487
- if (elm.nodeType === 1) {
1488
- if (elm.nodeName.toLowerCase() === 'script') {
1489
- return false;
1490
- }
1491
- for (let i = 0; i < elm.attributes.length; i++) {
1492
- const name = elm.attributes[i].name;
1493
- if (isStr(name) && name.toLowerCase().indexOf('on') === 0) {
1494
- return false;
1495
- }
1496
- }
1497
- for (let i = 0; i < elm.childNodes.length; i++) {
1498
- if (!isValid(elm.childNodes[i])) {
1499
- return false;
1500
- }
1501
- }
1502
- }
1503
- return true;
1504
- };
1505
-
1506
- const ioniconContent = new Map();
1507
- const requests = new Map();
1508
- const getSvgContent = (url, sanitize) => {
1509
- // see if we already have a request for this url
1510
- let req = requests.get(url);
1511
- if (!req) {
1512
- if (typeof fetch !== 'undefined' && typeof document !== 'undefined') {
1513
- // we don't already have a request
1514
- req = fetch(url).then((rsp) => {
1515
- if (rsp.ok) {
1516
- return rsp.text().then((svgContent) => {
1517
- if (svgContent && sanitize !== false) {
1518
- svgContent = validateContent(svgContent);
1519
- }
1520
- ioniconContent.set(url, svgContent || '');
1521
- });
1522
- }
1523
- ioniconContent.set(url, '');
1524
- });
1525
- // cache for the same requests
1526
- requests.set(url, req);
1527
- }
1528
- else {
1529
- // set to empty for ssr scenarios and resolve promise
1530
- ioniconContent.set(url, '');
1531
- return Promise.resolve();
1532
- }
1533
- }
1534
- return req;
1535
- };
1536
-
1537
- const iconCss = ":host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;box-sizing:content-box !important}:host .ionicon{stroke:currentColor}.ionicon-fill-none{fill:none}.ionicon-stroke-width{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}.icon-inner,.ionicon,svg{display:block;height:100%;width:100%}:host(.flip-rtl) .icon-inner{transform:scaleX(-1)}:host(.icon-small){font-size:18px !important}:host(.icon-large){font-size:32px !important}:host(.ion-color){color:var(--ion-color-base) !important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary, #3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary, #0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary, #f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success, #10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning, #ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger, #f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light, #f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium, #989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark, #222428)}";
1538
-
1539
- let parser;
1540
- const Icon = class {
1541
- constructor(hostRef) {
1542
- index$1.registerInstance(this, hostRef);
1543
- this.iconName = null;
1544
- this.inheritedAttributes = {};
1545
- this.isVisible = false;
1546
- /**
1547
- * The mode determines which platform styles to use.
1548
- */
1549
- this.mode = getIonMode();
1550
- /**
1551
- * If enabled, ion-icon will be loaded lazily when it's visible in the viewport.
1552
- * Default, `false`.
1553
- */
1554
- this.lazy = false;
1555
- /**
1556
- * When set to `false`, SVG content that is HTTP fetched will not be checked
1557
- * if the response SVG content has any `<script>` elements, or any attributes
1558
- * that start with `on`, such as `onclick`.
1559
- * @default true
1560
- */
1561
- this.sanitize = true;
1562
- this.hasAriaHidden = () => {
1563
- const { el } = this;
1564
- return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';
1565
- };
1566
- }
1567
- componentWillLoad() {
1568
- this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
1569
- }
1570
- connectedCallback() {
1571
- // purposely do not return the promise here because loading
1572
- // the svg file should not hold up loading the app
1573
- // only load the svg if it's visible
1574
- this.waitUntilVisible(this.el, '50px', () => {
1575
- this.isVisible = true;
1576
- this.loadIcon();
1577
- });
1578
- }
1579
- disconnectedCallback() {
1580
- if (this.io) {
1581
- this.io.disconnect();
1582
- this.io = undefined;
1583
- }
1584
- }
1585
- waitUntilVisible(el, rootMargin, cb) {
1586
- if (this.lazy && typeof window !== 'undefined' && window.IntersectionObserver) {
1587
- const io = (this.io = new window.IntersectionObserver((data) => {
1588
- if (data[0].isIntersecting) {
1589
- io.disconnect();
1590
- this.io = undefined;
1591
- cb();
1592
- }
1593
- }, { rootMargin }));
1594
- io.observe(el);
1595
- }
1596
- else {
1597
- // browser doesn't support IntersectionObserver
1598
- // so just fallback to always show it
1599
- cb();
1600
- }
1601
- }
1602
- loadIcon() {
1603
- if (this.isVisible) {
1604
- if (!parser) {
1605
- /**
1606
- * Create an instance of the DOM parser. This creates a single
1607
- * parser instance for the entire app, which is more efficient.
1608
- */
1609
- parser = new DOMParser();
1610
- }
1611
- const url = getUrl(this);
1612
- if (url) {
1613
- if (ioniconContent.has(url)) {
1614
- // sync if it's already loaded
1615
- this.svgContent = ioniconContent.get(url);
1616
- }
1617
- else if (url.startsWith('data:')) {
1618
- const doc = parser.parseFromString(url, 'text/html');
1619
- const svgEl = doc.body.querySelector('svg');
1620
- if (svgEl !== null) {
1621
- this.svgContent = svgEl.outerHTML;
1622
- }
1623
- else {
1624
- this.svgContent = '';
1625
- }
1626
- }
1627
- else {
1628
- // async if it hasn't been loaded
1629
- getSvgContent(url, this.sanitize).then(() => (this.svgContent = ioniconContent.get(url)));
1630
- }
1631
- }
1632
- }
1633
- const label = this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
1634
- /**
1635
- * Come up with a default label
1636
- * in case user does not provide their own.
1637
- */
1638
- if (label) {
1639
- this.ariaLabel = label.replace(/\-/g, ' ');
1640
- }
1641
- }
1642
- render() {
1643
- const { iconName, ariaLabel, el, inheritedAttributes } = this;
1644
- const mode = this.mode || 'md';
1645
- const flipRtl = this.flipRtl ||
1646
- (iconName &&
1647
- (iconName.indexOf('arrow') > -1 || iconName.indexOf('chevron') > -1) &&
1648
- this.flipRtl !== false);
1649
- /**
1650
- * Only set the aria-label if a) we have generated
1651
- * one for the icon and if aria-hidden is not set to "true".
1652
- * If developer wants to set their own aria-label, then
1653
- * inheritedAttributes down below will override whatever
1654
- * default label we have set.
1655
- */
1656
- return (index$1.h(index$1.Host, Object.assign({ "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, role: "img", class: Object.assign(Object.assign({ [mode]: true }, createColorClasses(this.color)), { [`icon-${this.size}`]: !!this.size, 'flip-rtl': !!flipRtl && isRTL(el) }) }, inheritedAttributes), this.svgContent ? (index$1.h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (index$1.h("div", { class: "icon-inner" }))));
1657
- }
1658
- static get assetsDirs() { return ["svg"]; }
1659
- get el() { return index$1.getElement(this); }
1660
- static get watchers() { return {
1661
- "name": ["loadIcon"],
1662
- "src": ["loadIcon"],
1663
- "icon": ["loadIcon"]
1664
- }; }
1665
- };
1666
- const getIonMode = () => (typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
1667
- const createColorClasses = (color) => {
1668
- return color
1669
- ? {
1670
- 'ion-color': true,
1671
- [`ion-color-${color}`]: true,
1672
- }
1673
- : null;
1674
- };
1675
- Icon.style = iconCss;
1676
-
1677
- const itemIosCss = ":host{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;align-items:center;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;box-sizing:border-box}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native,:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-inner{border-color:var(--ion-color-shade)}:host(.ion-activated) .item-native{color:var(--color-activated)}:host(.ion-activated) .item-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-color.ion-activated) .item-native{color:var(--ion-color-contrast)}:host(.ion-focused) .item-native{color:var(--color-focused)}:host(.ion-focused) .item-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-color.ion-focused) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .item-native::after{background:var(--ion-color-contrast)}@media (any-hover: hover){:host(.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--color-hover)}:host(.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--ion-color-contrast)}}:host(.item-interactive-disabled:not(.item-multiple-inputs)){cursor:default;pointer-events:none}:host(.item-disabled){cursor:default;opacity:0.3;pointer-events:none}.item-native{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:flex;position:relative;align-items:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;box-sizing:border-box;z-index:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-native{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.item-native::-moz-focus-inner{border:0}.item-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;transition:var(--transition);z-index:-1}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}.item-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;position:relative;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);box-shadow:var(--inner-box-shadow);overflow:inherit;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-bottom{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--inner-padding-end);padding-top:0;padding-bottom:0;display:flex;justify-content:space-between}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-bottom{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--inner-padding-end);padding-inline-end:var(--inner-padding-end)}}.item-detail-icon{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}::slotted(ion-icon){font-size:1.6em}::slotted(ion-button){--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}::slotted(ion-label:not([slot=end])){flex:1}:host(.item-input){align-items:center}.input-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:inherit;box-sizing:border-box}:host(.item-label-stacked),:host(.item-label-floating){align-items:start}:host(.item-label-stacked) .input-wrapper,:host(.item-label-floating) .input-wrapper{flex:1;flex-direction:column}.item-highlight,.item-inner-highlight{left:0;right:0;top:0;bottom:0;border-radius:inherit;position:absolute;width:100%;height:100%;transform:scaleX(0);transition:transform 200ms, border-bottom-width 200ms;z-index:2;box-sizing:border-box;pointer-events:none}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus),:host(.item-interactive.ion-touched.ion-invalid){--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}:host(.ion-focused) .item-highlight,:host(.ion-focused) .item-inner-highlight,:host(.item-has-focus) .item-highlight,:host(.item-has-focus) .item-inner-highlight{transform:scaleX(1);border-style:var(--border-style);border-color:var(--highlight-background)}:host(.ion-focused) .item-highlight,:host(.item-has-focus) .item-highlight{border-width:var(--full-highlight-height);opacity:var(--show-full-highlight)}:host(.ion-focused) .item-inner-highlight,:host(.item-has-focus) .item-inner-highlight{border-bottom-width:var(--inset-highlight-height);opacity:var(--show-inset-highlight)}:host(.ion-focused.item-fill-solid) .item-highlight,:host(.item-has-focus.item-fill-solid) .item-highlight{border-width:calc(var(--full-highlight-height) - 1px)}:host(.ion-focused) .item-inner-highlight,:host(.ion-focused:not(.item-fill-outline)) .item-highlight,:host(.item-has-focus) .item-inner-highlight,:host(.item-has-focus:not(.item-fill-outline)) .item-highlight{border-top:none;border-right:none;border-left:none}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus){--highlight-background:var(--highlight-color-focused)}:host(.item-interactive.ion-valid){--highlight-background:var(--highlight-color-valid)}:host(.item-interactive.ion-invalid){--highlight-background:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=helper]){display:none}::slotted([slot=error]){display:none;color:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=error]){display:block}:host(:not(.item-label)) ::slotted(ion-select){--padding-start:0;max-width:none}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0;align-self:stretch;width:100%;max-width:100%}:host(:not(.item-label)) ::slotted(ion-datetime){--padding-start:0}:host(.item-label-stacked) ::slotted(ion-datetime),:host(.item-label-floating) ::slotted(ion-datetime){--padding-start:0;width:100%}:host(.item-multiple-inputs) ::slotted(ion-checkbox),:host(.item-multiple-inputs) ::slotted(ion-datetime),:host(.item-multiple-inputs) ::slotted(ion-radio),:host(.item-multiple-inputs) ::slotted(ion-select){position:relative}:host(.item-textarea){align-items:stretch}::slotted(ion-reorder[slot]){margin-top:0;margin-bottom:0}ion-ripple-effect{color:var(--ripple-color)}:host(.item-fill-solid) ::slotted([slot=start]),:host(.item-fill-solid) ::slotted([slot=end]),:host(.item-fill-outline) ::slotted([slot=start]),:host(.item-fill-outline) ::slotted([slot=end]){align-self:center}::slotted([slot=helper]),::slotted([slot=error]),.item-counter{padding-top:5px;font-size:12px;z-index:1}.item-counter{margin-left:auto;color:var(--ion-color-step-550, #737373);white-space:nowrap;padding-inline-start:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-counter{margin-left:unset;-webkit-margin-start:auto;margin-inline-start:auto}}@media (prefers-reduced-motion: reduce){.item-highlight,.item-inner-highlight{transition:none}}:host{--min-height:44px;--transition:background-color 200ms linear, opacity 200ms linear;--padding-start:20px;--inner-padding-end:10px;--inner-border-width:0px 0px 0.55px 0px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:#000;--background-focused:#000;--background-hover:currentColor;--background-activated-opacity:.12;--background-focused-opacity:.15;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--color:var(--ion-item-color, var(--ion-text-color, #000));--highlight-height:0px;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);--bottom-padding-start:0px;font-size:17px}:host(.ion-activated){--transition:none}:host(.ion-color.ion-focused) .item-native::after{background:#000;opacity:0.15}:host(.ion-color.ion-activated) .item-native::after{background:#000;opacity:0.12}:host(.item-interactive){--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-full){--border-width:0px 0px 0.55px 0px;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-inset){--inner-border-width:0px 0px 0.55px 0px;--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-inset),:host(.item-lines-none){--border-width:0px;--show-full-highlight:0}:host(.item-lines-full),:host(.item-lines-none){--inner-border-width:0px;--show-inset-highlight:0}.item-highlight,.item-inner-highlight{transition:none}:host(.item-has-focus) .item-inner-highlight,:host(.item-has-focus) .item-highlight{border-top:none;border-right:none;border-left:none}::slotted([slot=start]){margin-left:0;margin-right:20px;margin-top:2px;margin-bottom:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:20px;margin-inline-end:20px}}::slotted([slot=end]){margin-left:10px;margin-right:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}::slotted(ion-icon[slot=start]),::slotted(ion-icon[slot=end]){margin-top:7px;margin-bottom:7px}::slotted(ion-toggle[slot=start]),::slotted(ion-toggle[slot=end]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host(.item-label-stacked) ::slotted([slot=end]),:host(.item-label-floating) ::slotted([slot=end]){margin-top:7px;margin-bottom:7px}::slotted(.button-small){--padding-top:0px;--padding-bottom:0px;--padding-start:.5em;--padding-end:.5em;height:24px;font-size:13px}::slotted(ion-avatar){width:36px;height:36px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:0px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-radio) ::slotted(ion-label),:host(.item-toggle) ::slotted(ion-label){margin-left:unset;-webkit-margin-start:0px;margin-inline-start:0px}}::slotted(ion-label){margin-left:0;margin-right:8px;margin-top:10px;margin-bottom:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}:host(.item-label-floating),:host(.item-label-stacked){--min-height:68px}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0px}:host(.item-label-fixed) ::slotted(ion-select),:host(.item-label-fixed) ::slotted(ion-datetime){--padding-start:0}";
1678
-
1679
- const itemMdCss = ":host{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;align-items:center;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;box-sizing:border-box}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-native,:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) .item-inner{border-color:var(--ion-color-shade)}:host(.ion-activated) .item-native{color:var(--color-activated)}:host(.ion-activated) .item-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}:host(.ion-color.ion-activated) .item-native{color:var(--ion-color-contrast)}:host(.ion-focused) .item-native{color:var(--color-focused)}:host(.ion-focused) .item-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-color.ion-focused) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .item-native::after{background:var(--ion-color-contrast)}@media (any-hover: hover){:host(.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--color-hover)}:host(.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activatable:not(.ion-focused):hover) .item-native::after{background:var(--ion-color-contrast)}}:host(.item-interactive-disabled:not(.item-multiple-inputs)){cursor:default;pointer-events:none}:host(.item-disabled){cursor:default;opacity:0.3;pointer-events:none}.item-native{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:flex;position:relative;align-items:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;box-sizing:border-box;z-index:1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-native{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.item-native::-moz-focus-inner{border:0}.item-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;transition:var(--transition);z-index:-1}button,a{cursor:pointer;user-select:none;-webkit-user-drag:none}.item-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;position:relative;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);box-shadow:var(--inner-box-shadow);overflow:inherit;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-bottom{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--inner-padding-end);padding-top:0;padding-bottom:0;display:flex;justify-content:space-between}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-bottom{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--inner-padding-end);padding-inline-end:var(--inner-padding-end)}}.item-detail-icon{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}::slotted(ion-icon){font-size:1.6em}::slotted(ion-button){--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}::slotted(ion-label:not([slot=end])){flex:1}:host(.item-input){align-items:center}.input-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:inherit;box-sizing:border-box}:host(.item-label-stacked),:host(.item-label-floating){align-items:start}:host(.item-label-stacked) .input-wrapper,:host(.item-label-floating) .input-wrapper{flex:1;flex-direction:column}.item-highlight,.item-inner-highlight{left:0;right:0;top:0;bottom:0;border-radius:inherit;position:absolute;width:100%;height:100%;transform:scaleX(0);transition:transform 200ms, border-bottom-width 200ms;z-index:2;box-sizing:border-box;pointer-events:none}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus),:host(.item-interactive.ion-touched.ion-invalid){--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}:host(.ion-focused) .item-highlight,:host(.ion-focused) .item-inner-highlight,:host(.item-has-focus) .item-highlight,:host(.item-has-focus) .item-inner-highlight{transform:scaleX(1);border-style:var(--border-style);border-color:var(--highlight-background)}:host(.ion-focused) .item-highlight,:host(.item-has-focus) .item-highlight{border-width:var(--full-highlight-height);opacity:var(--show-full-highlight)}:host(.ion-focused) .item-inner-highlight,:host(.item-has-focus) .item-inner-highlight{border-bottom-width:var(--inset-highlight-height);opacity:var(--show-inset-highlight)}:host(.ion-focused.item-fill-solid) .item-highlight,:host(.item-has-focus.item-fill-solid) .item-highlight{border-width:calc(var(--full-highlight-height) - 1px)}:host(.ion-focused) .item-inner-highlight,:host(.ion-focused:not(.item-fill-outline)) .item-highlight,:host(.item-has-focus) .item-inner-highlight,:host(.item-has-focus:not(.item-fill-outline)) .item-highlight{border-top:none;border-right:none;border-left:none}:host(.item-interactive.ion-focused),:host(.item-interactive.item-has-focus){--highlight-background:var(--highlight-color-focused)}:host(.item-interactive.ion-valid){--highlight-background:var(--highlight-color-valid)}:host(.item-interactive.ion-invalid){--highlight-background:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=helper]){display:none}::slotted([slot=error]){display:none;color:var(--highlight-color-invalid)}:host(.item-interactive.ion-invalid) ::slotted([slot=error]){display:block}:host(:not(.item-label)) ::slotted(ion-select){--padding-start:0;max-width:none}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0;align-self:stretch;width:100%;max-width:100%}:host(:not(.item-label)) ::slotted(ion-datetime){--padding-start:0}:host(.item-label-stacked) ::slotted(ion-datetime),:host(.item-label-floating) ::slotted(ion-datetime){--padding-start:0;width:100%}:host(.item-multiple-inputs) ::slotted(ion-checkbox),:host(.item-multiple-inputs) ::slotted(ion-datetime),:host(.item-multiple-inputs) ::slotted(ion-radio),:host(.item-multiple-inputs) ::slotted(ion-select){position:relative}:host(.item-textarea){align-items:stretch}::slotted(ion-reorder[slot]){margin-top:0;margin-bottom:0}ion-ripple-effect{color:var(--ripple-color)}:host(.item-fill-solid) ::slotted([slot=start]),:host(.item-fill-solid) ::slotted([slot=end]),:host(.item-fill-outline) ::slotted([slot=start]),:host(.item-fill-outline) ::slotted([slot=end]){align-self:center}::slotted([slot=helper]),::slotted([slot=error]),.item-counter{padding-top:5px;font-size:12px;z-index:1}.item-counter{margin-left:auto;color:var(--ion-color-step-550, #737373);white-space:nowrap;padding-inline-start:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-counter{margin-left:unset;-webkit-margin-start:auto;margin-inline-start:auto}}@media (prefers-reduced-motion: reduce){.item-highlight,.item-inner-highlight{transition:none}}:host{--min-height:48px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--color:var(--ion-item-color, var(--ion-text-color, #000));--transition:opacity 15ms linear, background-color 15ms linear;--padding-start:16px;--inner-padding-end:16px;--inner-border-width:0 0 1px 0;--highlight-height:1px;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);font-size:16px;font-weight:normal;text-transform:none}:host(.item-fill-outline){--highlight-height:2px}:host(.item-fill-none.item-interactive.ion-focus) .item-highlight,:host(.item-fill-none.item-interactive.item-has-focus) .item-highlight,:host(.item-fill-none.item-interactive.ion-touched.ion-invalid) .item-highlight{transform:scaleX(1);border-width:0 0 var(--full-highlight-height) 0;border-style:var(--border-style);border-color:var(--highlight-background)}:host(.item-fill-none.item-interactive.ion-focus) .item-native,:host(.item-fill-none.item-interactive.item-has-focus) .item-native,:host(.item-fill-none.item-interactive.ion-touched.ion-invalid) .item-native{border-bottom-color:var(--highlight-background)}:host(.item-fill-outline.item-interactive.ion-focus) .item-highlight,:host(.item-fill-outline.item-interactive.item-has-focus) .item-highlight{transform:scaleX(1)}:host(.item-fill-outline.item-interactive.ion-focus) .item-highlight,:host(.item-fill-outline.item-interactive.item-has-focus) .item-highlight,:host(.item-fill-outline.item-interactive.ion-touched.ion-invalid) .item-highlight{border-width:var(--full-highlight-height);border-style:var(--border-style);border-color:var(--highlight-background)}:host(.item-fill-outline.item-interactive.ion-touched.ion-invalid) .item-native{border-color:var(--highlight-background)}:host(.item-fill-solid.item-interactive.ion-focus) .item-highlight,:host(.item-fill-solid.item-interactive.item-has-focus) .item-highlight,:host(.item-fill-solid.item-interactive.ion-touched.ion-invalid) .item-highlight{transform:scaleX(1);border-width:0 0 var(--full-highlight-height) 0;border-style:var(--border-style);border-color:var(--highlight-background)}:host(.item-fill-solid.item-interactive.ion-focus) .item-native,:host(.item-fill-solid.item-interactive.item-has-focus) .item-native,:host(.item-fill-solid.item-interactive.ion-touched.ion-invalid) .item-native{border-bottom-color:var(--highlight-background)}:host(.ion-color.ion-activated) .item-native::after{background:transparent}:host(.item-has-focus) .item-native{caret-color:var(--highlight-background)}:host(.item-interactive){--border-width:0 0 1px 0;--inner-border-width:0;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-full){--border-width:0 0 1px 0;--show-full-highlight:1;--show-inset-highlight:0}:host(.item-lines-inset){--inner-border-width:0 0 1px 0;--show-full-highlight:0;--show-inset-highlight:1}:host(.item-lines-inset),:host(.item-lines-none){--border-width:0;--show-full-highlight:0}:host(.item-lines-full),:host(.item-lines-none){--inner-border-width:0;--show-inset-highlight:0}:host(.item-fill-outline) .item-highlight{--position-offset:calc(-1 * var(--border-width));left:var(--position-offset);top:var(--position-offset);width:calc(100% + 2 * var(--border-width));height:calc(100% + 2 * var(--border-width));transition:none}:host-context([dir=rtl]):host(.item-fill-outline) .item-highlight,:host-context([dir=rtl]).item-fill-outline .item-highlight{left:unset;right:unset;right:var(--position-offset)}:host(.item-fill-outline.ion-focused) .item-native,:host(.item-fill-outline.item-has-focus) .item-native{border-color:transparent}:host(.item-multi-line) ::slotted([slot=start]),:host(.item-multi-line) ::slotted([slot=end]){margin-top:16px;margin-bottom:16px;align-self:flex-start}::slotted([slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted([slot=end]){margin-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}:host(.item-fill-solid) ::slotted([slot=start]),:host(.item-fill-solid) ::slotted([slot=end]),:host(.item-fill-outline) ::slotted([slot=start]),:host(.item-fill-outline) ::slotted([slot=end]){align-self:center}::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);font-size:24px}:host(.ion-color:not(.item-fill-solid):not(.item-fill-outline)) ::slotted(ion-icon){color:var(--ion-color-contrast)}::slotted(ion-icon[slot]){margin-top:12px;margin-bottom:12px}::slotted(ion-icon[slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted(ion-icon[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}:host(.item-fill-solid) ::slotted(ion-icon[slot=start]),:host(.item-fill-outline) ::slotted(ion-icon[slot=start]){margin-right:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-fill-solid) ::slotted(ion-icon[slot=start]),:host(.item-fill-outline) ::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:8px;margin-inline-end:8px}}::slotted(ion-toggle[slot=start]),::slotted(ion-toggle[slot=end]){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}::slotted(ion-note){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;align-self:flex-start;font-size:11px}::slotted(ion-note[slot]:not([slot=helper]):not([slot=error])){padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}::slotted(ion-note[slot=start]){padding-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=start]){padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-note[slot=end]){padding-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=end]){padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}::slotted(ion-avatar){width:40px;height:40px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar),::slotted(ion-thumbnail){margin-top:8px;margin-bottom:8px}::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:10px;margin-bottom:10px}:host(.item-label-stacked) ::slotted([slot=end]),:host(.item-label-floating) ::slotted([slot=end]){margin-top:7px;margin-bottom:7px}:host(.item-label-fixed) ::slotted(ion-select),:host(.item-label-fixed) ::slotted(ion-datetime){--padding-start:8px}:host(.item-toggle) ::slotted(ion-label),:host(.item-radio) ::slotted(ion-label){margin-left:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-toggle) ::slotted(ion-label),:host(.item-radio) ::slotted(ion-label){margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}::slotted(.button-small){--padding-top:0;--padding-bottom:0;--padding-start:.6em;--padding-end:.6em;height:25px;font-size:12px}:host(.item-label-floating),:host(.item-label-stacked){--min-height:55px}:host(.item-label-stacked) ::slotted(ion-select),:host(.item-label-floating) ::slotted(ion-select){--padding-top:8px;--padding-bottom:8px;--padding-start:0}:host(.ion-focused:not(.ion-color)) ::slotted(.label-stacked),:host(.ion-focused:not(.ion-color)) ::slotted(.label-floating),:host(.item-has-focus:not(.ion-color)) ::slotted(.label-stacked),:host(.item-has-focus:not(.ion-color)) ::slotted(.label-floating){color:var(--ion-color-primary, #3880ff)}:host(.ion-color){--highlight-color-focused:var(--ion-color-contrast)}:host(.item-label-color){--highlight-color-focused:var(--ion-color-base)}:host(.item-fill-solid.ion-color),:host(.item-fill-outline.ion-color){--highlight-color-focused:var(--ion-color-base)}:host(.item-fill-solid){--background:var(--ion-color-step-50, #f2f2f2);--background-hover:var(--ion-color-step-100, #e6e6e6);--background-focused:var(--ion-color-step-150, #d9d9d9);--border-width:0 0 1px 0;--inner-border-width:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.item-fill-solid),:host-context([dir=rtl]).item-fill-solid{border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}:host(.item-fill-solid) .item-native{--border-color:var(--ion-color-step-500, gray)}:host(.item-fill-solid.ion-focused) .item-native,:host(.item-fill-solid.item-has-focus) .item-native{--background:var(--background-focused)}:host(.item-fill-solid.item-shape-round){border-top-left-radius:16px;border-top-right-radius:16px;border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.item-fill-solid.item-shape-round),:host-context([dir=rtl]).item-fill-solid.item-shape-round{border-top-left-radius:16px;border-top-right-radius:16px;border-bottom-right-radius:0;border-bottom-left-radius:0}@media (any-hover: hover){:host(.item-fill-solid:hover) .item-native{--background:var(--background-hover);--border-color:var(--ion-color-step-750, #404040)}}:host(.item-fill-outline){--ripple-color:transparent;--background-focused:transparent;--background-hover:transparent;--border-color:var(--ion-color-step-500, gray);--border-width:1px;border:none;overflow:visible}:host(.item-fill-outline) .item-native{--native-padding-left:16px;border-radius:4px}:host(.item-fill-outline.item-shape-round) .item-native{--inner-padding-start:16px;border-radius:28px}:host(.item-fill-outline.item-shape-round) .item-bottom{padding-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.item-fill-outline.item-shape-round) .item-bottom{padding-left:unset;-webkit-padding-start:32px;padding-inline-start:32px}}:host(.item-fill-outline.item-label-floating.ion-focused) .item-native ::slotted(ion-input:not(:first-child)),:host(.item-fill-outline.item-label-floating.ion-focused) .item-native ::slotted(ion-textarea:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-focus) .item-native ::slotted(ion-input:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-focus) .item-native ::slotted(ion-textarea:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-value) .item-native ::slotted(ion-input:not(:first-child)),:host(.item-fill-outline.item-label-floating.item-has-value) .item-native ::slotted(ion-textarea:not(:first-child)){transform:translateY(-14px)}@media (any-hover: hover){:host(.item-fill-outline:hover) .item-native{--border-color:var(--ion-color-step-750, #404040)}}.item-counter{letter-spacing:0.0333333333em}";
1680
-
1681
- const Item = class {
1682
- constructor(hostRef) {
1683
- index$1.registerInstance(this, hostRef);
1684
- this.labelColorStyles = {};
1685
- this.itemStyles = new Map();
1686
- this.inheritedAriaAttributes = {};
1687
- this.multipleInputs = false;
1688
- this.focusable = true;
1689
- /**
1690
- * If `true`, a button tag will be rendered and the item will be tappable.
1691
- */
1692
- this.button = false;
1693
- /**
1694
- * The icon to use when `detail` is set to `true`.
1695
- */
1696
- this.detailIcon = index$4.chevronForward;
1697
- /**
1698
- * If `true`, the user cannot interact with the item.
1699
- */
1700
- this.disabled = false;
1701
- /**
1702
- * If `true`, a character counter will display the ratio of characters used and the total character limit. Only applies when the `maxlength` property is set on the inner `ion-input` or `ion-textarea`.
1703
- */
1704
- this.counter = false;
1705
- /**
1706
- * When using a router, it specifies the transition direction when navigating to
1707
- * another page using `href`.
1708
- */
1709
- this.routerDirection = 'forward';
1710
- /**
1711
- * The type of the button. Only used when an `onclick` or `button` property is present.
1712
- */
1713
- this.type = 'button';
1714
- }
1715
- counterFormatterChanged() {
1716
- this.updateCounterOutput(this.getFirstInput());
1717
- }
1718
- handleIonChange(ev) {
1719
- if (this.counter && ev.target === this.getFirstInput()) {
1720
- this.updateCounterOutput(ev.target);
1721
- }
1722
- }
1723
- labelColorChanged(ev) {
1724
- const { color } = this;
1725
- // There will be a conflict with item color if
1726
- // we apply the label color to item, so we ignore
1727
- // the label color if the user sets a color on item
1728
- if (color === undefined) {
1729
- this.labelColorStyles = ev.detail;
1730
- }
1731
- }
1732
- itemStyle(ev) {
1733
- ev.stopPropagation();
1734
- const tagName = ev.target.tagName;
1735
- const updatedStyles = ev.detail;
1736
- const newStyles = {};
1737
- const childStyles = this.itemStyles.get(tagName) || {};
1738
- let hasStyleChange = false;
1739
- Object.keys(updatedStyles).forEach((key) => {
1740
- if (updatedStyles[key]) {
1741
- const itemKey = `item-${key}`;
1742
- if (!childStyles[itemKey]) {
1743
- hasStyleChange = true;
1744
- }
1745
- newStyles[itemKey] = true;
1746
- }
1747
- });
1748
- if (!hasStyleChange && Object.keys(newStyles).length !== Object.keys(childStyles).length) {
1749
- hasStyleChange = true;
1750
- }
1751
- if (hasStyleChange) {
1752
- this.itemStyles.set(tagName, newStyles);
1753
- index$1.forceUpdate(this);
1754
- }
1755
- }
1756
- connectedCallback() {
1757
- if (this.counter) {
1758
- this.updateCounterOutput(this.getFirstInput());
1759
- }
1760
- this.hasStartEl();
1761
- }
1762
- componentDidUpdate() {
1763
- // Do not use @Listen here to avoid making all items
1764
- // appear as clickable to screen readers
1765
- // https://github.com/ionic-team/ionic-framework/issues/22011
1766
- const input = this.getFirstInput();
1767
- if (input !== undefined && !this.clickListener) {
1768
- this.clickListener = (ev) => this.delegateFocus(ev, input);
1769
- this.el.addEventListener('click', this.clickListener);
1770
- }
1771
- }
1772
- disconnectedCallback() {
1773
- const input = this.getFirstInput();
1774
- if (input !== undefined && this.clickListener) {
1775
- this.el.removeEventListener('click', this.clickListener);
1776
- this.clickListener = undefined;
1777
- }
1778
- }
1779
- componentDidLoad() {
1780
- helpers.raf(() => {
1781
- this.inheritedAriaAttributes = helpers.inheritAttributes(this.el, ['aria-label']);
1782
- this.setMultipleInputs();
1783
- this.focusable = this.isFocusable();
1784
- });
1785
- }
1786
- // If the item contains multiple clickable elements and/or inputs, then the item
1787
- // should not have a clickable input cover over the entire item to prevent
1788
- // interfering with their individual click events
1789
- setMultipleInputs() {
1790
- // The following elements have a clickable cover that is relative to the entire item
1791
- const covers = this.el.querySelectorAll('ion-checkbox, ion-datetime, ion-select, ion-radio');
1792
- // The following elements can accept focus alongside the previous elements
1793
- // therefore if these elements are also a child of item, we don't want the
1794
- // input cover on top of those interfering with their clicks
1795
- const inputs = this.el.querySelectorAll('ion-input, ion-range, ion-searchbar, ion-segment, ion-textarea, ion-toggle');
1796
- // The following elements should also stay clickable when an input with cover is present
1797
- const clickables = this.el.querySelectorAll('ion-anchor, ion-button, a, button');
1798
- // Check for multiple inputs to change the position of the input cover to relative
1799
- // for all of the covered inputs above
1800
- this.multipleInputs =
1801
- covers.length + inputs.length > 1 ||
1802
- covers.length + clickables.length > 1 ||
1803
- (covers.length > 0 && this.isClickable());
1804
- }
1805
- // If the item contains an input including a checkbox, datetime, select, or radio
1806
- // then the item will have a clickable input cover that covers the item
1807
- // that should get the hover, focused and activated states UNLESS it has multiple
1808
- // inputs, then those need to individually get each click
1809
- hasCover() {
1810
- const inputs = this.el.querySelectorAll('ion-checkbox, ion-datetime, ion-select, ion-radio');
1811
- return inputs.length === 1 && !this.multipleInputs;
1812
- }
1813
- // If the item has an href or button property it will render a native
1814
- // anchor or button that is clickable
1815
- isClickable() {
1816
- return this.href !== undefined || this.button;
1817
- }
1818
- canActivate() {
1819
- return this.isClickable() || this.hasCover();
1820
- }
1821
- isFocusable() {
1822
- const focusableChild = this.el.querySelector('.ion-focusable');
1823
- return this.canActivate() || focusableChild !== null;
1824
- }
1825
- getFirstInput() {
1826
- const inputs = this.el.querySelectorAll('ion-input, ion-textarea');
1827
- return inputs[0];
1828
- }
1829
- // This is needed for WebKit due to a delegatesFocus bug where
1830
- // clicking on the left padding of an item is not focusing the input
1831
- // but is opening the keyboard. It will no longer be needed with
1832
- // iOS 14.
1833
- delegateFocus(ev, input) {
1834
- const clickedItem = ev.target.tagName === 'ION-ITEM';
1835
- let firstActive = false;
1836
- // If the first input is the same as the active element we need
1837
- // to focus the first input again, but if the active element
1838
- // is another input inside of the item we shouldn't switch focus
1839
- if (document.activeElement) {
1840
- firstActive = input.querySelector('input, textarea') === document.activeElement;
1841
- }
1842
- // Only focus the first input if we clicked on an ion-item
1843
- // and the first input exists
1844
- if (clickedItem && (firstActive || !this.multipleInputs)) {
1845
- input.fireFocusEvents = false;
1846
- input.setBlur();
1847
- input.setFocus();
1848
- helpers.raf(() => {
1849
- input.fireFocusEvents = true;
1850
- });
1851
- }
1852
- }
1853
- updateCounterOutput(inputEl) {
1854
- var _a, _b;
1855
- const { counter, counterFormatter, defaultCounterFormatter } = this;
1856
- if (counter && !this.multipleInputs && (inputEl === null || inputEl === void 0 ? void 0 : inputEl.maxlength) !== undefined) {
1857
- const length = (_b = (_a = inputEl === null || inputEl === void 0 ? void 0 : inputEl.value) === null || _a === void 0 ? void 0 : _a.toString().length) !== null && _b !== void 0 ? _b : 0;
1858
- if (counterFormatter === undefined) {
1859
- this.counterString = defaultCounterFormatter(length, inputEl.maxlength);
1860
- }
1861
- else {
1862
- try {
1863
- this.counterString = counterFormatter(length, inputEl.maxlength);
1864
- }
1865
- catch (e) {
1866
- index$2.printIonError('Exception in provided `counterFormatter`.', e);
1867
- // Fallback to the default counter formatter when an exception happens
1868
- this.counterString = defaultCounterFormatter(length, inputEl.maxlength);
1869
- }
1870
- }
1871
- }
1872
- }
1873
- defaultCounterFormatter(length, maxlength) {
1874
- return `${length} / ${maxlength}`;
1875
- }
1876
- hasStartEl() {
1877
- const startEl = this.el.querySelector('[slot="start"]');
1878
- if (startEl !== null) {
1879
- this.el.classList.add('item-has-start-slot');
1880
- }
1881
- }
1882
- render() {
1883
- const { counterString, detail, detailIcon, download, fill, labelColorStyles, lines, disabled, href, rel, shape, target, routerAnimation, routerDirection, inheritedAriaAttributes, } = this;
1884
- const childStyles = {};
1885
- const mode = ionicGlobal.getIonMode(this);
1886
- const clickable = this.isClickable();
1887
- const canActivate = this.canActivate();
1888
- const TagType = clickable ? (href === undefined ? 'button' : 'a') : 'div';
1889
- const attrs = TagType === 'button'
1890
- ? { type: this.type }
1891
- : {
1892
- download,
1893
- href,
1894
- rel,
1895
- target,
1896
- };
1897
- // Only set onClick if the item is clickable to prevent screen
1898
- // readers from reading all items as clickable
1899
- const clickFn = clickable
1900
- ? {
1901
- onClick: (ev) => {
1902
- theme.openURL(href, ev, routerDirection, routerAnimation);
1903
- },
1904
- }
1905
- : {};
1906
- const showDetail = detail !== undefined ? detail : mode === 'ios' && clickable;
1907
- this.itemStyles.forEach((value) => {
1908
- Object.assign(childStyles, value);
1909
- });
1910
- const ariaDisabled = disabled || childStyles['item-interactive-disabled'] ? 'true' : null;
1911
- const fillValue = fill || 'none';
1912
- const inList = theme.hostContext('ion-list', this.el);
1913
- return (index$1.h(index$1.Host, { "aria-disabled": ariaDisabled, class: Object.assign(Object.assign(Object.assign({}, childStyles), labelColorStyles), theme.createColorClasses(this.color, {
1914
- item: true,
1915
- [mode]: true,
1916
- [`item-lines-${lines}`]: lines !== undefined,
1917
- [`item-fill-${fillValue}`]: true,
1918
- [`item-shape-${shape}`]: shape !== undefined,
1919
- 'item-disabled': disabled,
1920
- 'in-list': inList,
1921
- 'item-multiple-inputs': this.multipleInputs,
1922
- 'ion-activatable': canActivate,
1923
- 'ion-focusable': this.focusable,
1924
- 'item-rtl': document.dir === 'rtl',
1925
- })), role: inList ? 'listitem' : null }, index$1.h(TagType, Object.assign({}, attrs, inheritedAriaAttributes, { class: "item-native", part: "native", disabled: disabled }, clickFn), index$1.h("slot", { name: "start" }), index$1.h("div", { class: "item-inner" }, index$1.h("div", { class: "input-wrapper" }, index$1.h("slot", null)), index$1.h("slot", { name: "end" }), showDetail && (index$1.h("ion-icon", { icon: detailIcon, lazy: false, class: "item-detail-icon", part: "detail-icon", "aria-hidden": "true", "flip-rtl": detailIcon === index$4.chevronForward })), index$1.h("div", { class: "item-inner-highlight" })), canActivate && mode === 'md' && index$1.h("ion-ripple-effect", null), index$1.h("div", { class: "item-highlight" })), index$1.h("div", { class: "item-bottom" }, index$1.h("slot", { name: "error" }), index$1.h("slot", { name: "helper" }), counterString && index$1.h("ion-note", { class: "item-counter" }, counterString))));
1926
- }
1927
- static get delegatesFocus() { return true; }
1928
- get el() { return index$1.getElement(this); }
1929
- static get watchers() { return {
1930
- "counterFormatter": ["counterFormatterChanged"]
1931
- }; }
1932
- };
1933
- Item.style = {
1934
- ios: itemIosCss,
1935
- md: itemMdCss
1936
- };
1937
-
1938
- const itemDividerIosCss = ":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--inner-padding-top:0px;--inner-padding-end:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;align-items:center;justify-content:space-between;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:100;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.item-divider-sticky){position:sticky;top:0}.item-divider-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border:0;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-divider-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-divider-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:hidden}:host{--background:var(--ion-color-step-100, #e6e6e6);--color:var(--ion-color-step-850, #262626);--padding-start:20px;--inner-padding-end:10px;border-radius:0;position:relative;min-height:28px;font-size:17px;font-weight:600}:host([slot=start]){margin-left:0;margin-right:20px;margin-top:2px;margin-bottom:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host([slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:20px;margin-inline-end:20px}}:host([slot=end]){margin-left:10px;margin-right:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host([slot=end]){margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}::slotted(ion-icon[slot=start]),::slotted(ion-icon[slot=end]){margin-top:7px;margin-bottom:7px}::slotted(h1){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}::slotted(h2){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}::slotted(h3),::slotted(h4),::slotted(h5),::slotted(h6){margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}::slotted(p){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4);font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}::slotted(h2:last-child) ::slotted(h3:last-child),::slotted(h4:last-child),::slotted(h5:last-child),::slotted(h6:last-child),::slotted(p:last-child){margin-bottom:0}";
1939
-
1940
- const itemDividerMdCss = ":host{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--inner-padding-top:0px;--inner-padding-end:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;align-items:center;justify-content:space-between;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:100;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.item-divider-sticky){position:sticky;top:0}.item-divider-inner{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;min-height:inherit;border:0;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.item-divider-inner{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}.item-divider-wrapper{display:flex;flex:1;flex-direction:inherit;align-items:inherit;align-self:stretch;text-overflow:ellipsis;overflow:hidden}:host{--background:var(--ion-background-color, #fff);--color:var(--ion-color-step-400, #999999);--padding-start:16px;--inner-padding-end:0;min-height:30px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));font-size:14px}::slotted([slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted([slot=end]){margin-left:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted([slot=end]){margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}::slotted(ion-label){margin-left:0;margin-right:0;margin-top:13px;margin-bottom:10px}::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);font-size:24px}:host(.ion-color) ::slotted(ion-icon){color:var(--ion-color-contrast)}::slotted(ion-icon[slot]){margin-top:12px;margin-bottom:12px}::slotted(ion-icon[slot=start]){margin-right:32px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=start]){margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}::slotted(ion-icon[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-icon[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(ion-note){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;align-self:flex-start;font-size:11px}::slotted(ion-note[slot]){padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}::slotted(ion-note[slot=start]){padding-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=start]){padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}::slotted(ion-note[slot=end]){padding-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-note[slot=end]){padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}::slotted(ion-avatar){width:40px;height:40px}::slotted(ion-thumbnail){width:56px;height:56px}::slotted(ion-avatar),::slotted(ion-thumbnail){margin-top:8px;margin-bottom:8px}::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=start]),::slotted(ion-thumbnail[slot=start]){margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(ion-avatar[slot=end]),::slotted(ion-thumbnail[slot=end]){margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}::slotted(h1){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}::slotted(h2){margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}::slotted(h3,h4,h5,h6){margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}::slotted(p){margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;color:var(--ion-color-step-600, #666666);font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}";
1941
-
1942
- const ItemDivider = class {
1943
- constructor(hostRef) {
1944
- index$1.registerInstance(this, hostRef);
1945
- /**
1946
- * When it's set to `true`, the item-divider will stay visible when it reaches the top
1947
- * of the viewport until the next `ion-item-divider` replaces it.
1948
- *
1949
- * This feature relies in `position:sticky`:
1950
- * https://caniuse.com/#feat=css-sticky
1951
- */
1952
- this.sticky = false;
1953
- }
1954
- render() {
1955
- const mode = ionicGlobal.getIonMode(this);
1956
- return (index$1.h(index$1.Host, { class: theme.createColorClasses(this.color, {
1957
- [mode]: true,
1958
- 'item-divider-sticky': this.sticky,
1959
- item: true,
1960
- }) }, index$1.h("slot", { name: "start" }), index$1.h("div", { class: "item-divider-inner" }, index$1.h("div", { class: "item-divider-wrapper" }, index$1.h("slot", null)), index$1.h("slot", { name: "end" }))));
1961
- }
1962
- get el() { return index$1.getElement(this); }
1963
- };
1964
- ItemDivider.style = {
1965
- ios: itemDividerIosCss,
1966
- md: itemDividerMdCss
1967
- };
1968
-
1969
- const itemGroupIosCss = "ion-item-group{display:block}";
1970
-
1971
- const itemGroupMdCss = "ion-item-group{display:block}";
1972
-
1973
- const ItemGroup = class {
1974
- constructor(hostRef) {
1975
- index$1.registerInstance(this, hostRef);
1976
- }
1977
- render() {
1978
- const mode = ionicGlobal.getIonMode(this);
1979
- return (index$1.h(index$1.Host, { role: "group", class: {
1980
- [mode]: true,
1981
- // Used internally for styling
1982
- [`item-group-${mode}`]: true,
1983
- item: true,
1984
- } }));
1985
- }
1986
- };
1987
- ItemGroup.style = {
1988
- ios: itemGroupIosCss,
1989
- md: itemGroupMdCss
1990
- };
1991
-
1992
- const labelIosCss = ".item.sc-ion-label-ios-h,.item .sc-ion-label-ios-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-ios-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{white-space:normal}.item-interactive-disabled.sc-ion-label-ios-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-ios-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-ios-h,.item-input .sc-ion-label-ios-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-ios-h,.item-textarea .sc-ion-label-ios-h{align-self:baseline}.label-fixed.sc-ion-label-ios-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-ios-h,.label-floating.sc-ion-label-ios-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-ios-h{transition:none}.sc-ion-label-ios-s h1,.sc-ion-label-ios-s h2,.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{font-size:14px;line-height:1.5}.label-stacked.sc-ion-label-ios-h{margin-bottom:4px;font-size:14px}.label-floating.sc-ion-label-ios-h{margin-bottom:0;transform:translate(0, 29px);transform-origin:left top;transition:transform 150ms ease-in-out}[dir=rtl].sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl] .sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl].label-floating.sc-ion-label-ios-h,[dir=rtl] .label-floating.sc-ion-label-ios-h{transform-origin:right top}.item-textarea.label-floating.sc-ion-label-ios-h,.item-textarea .label-floating.sc-ion-label-ios-h{transform:translate(0, 28px)}.item-has-focus.label-floating.sc-ion-label-ios-h,.item-has-focus .label-floating.sc-ion-label-ios-h,.item-has-placeholder.sc-ion-label-ios-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-ios-h,.item-has-value.label-floating.sc-ion-label-ios-h,.item-has-value .label-floating.sc-ion-label-ios-h{transform:scale(0.82)}.sc-ion-label-ios-s h1{margin-left:0;margin-right:0;margin-top:3px;margin-bottom:2px;font-size:22px;font-weight:normal}.sc-ion-label-ios-s h2{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-ios-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}.sc-ion-label-ios-s>p{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4)}.sc-ion-label-ios-h.in-item-color.sc-ion-label-ios-s>p{color:inherit}.sc-ion-label-ios-s h2:last-child,.sc-ion-label-ios-s h3:last-child,.sc-ion-label-ios-s h4:last-child,.sc-ion-label-ios-s h5:last-child,.sc-ion-label-ios-s h6:last-child,.sc-ion-label-ios-s p:last-child{margin-bottom:0}";
1993
-
1994
- const labelMdCss = ".item.sc-ion-label-md-h,.item .sc-ion-label-md-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:border-box}.ion-color.sc-ion-label-md-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{white-space:normal}.item-interactive-disabled.sc-ion-label-md-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-md-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-md-h,.item-input .sc-ion-label-md-h{flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-md-h,.item-textarea .sc-ion-label-md-h{align-self:baseline}.label-fixed.sc-ion-label-md-h{flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-bottom:0;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-md-h{transition:none}.sc-ion-label-md-s h1,.sc-ion-label-md-s h2,.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{line-height:1.5}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;transform-origin:top left}.label-stacked.label-rtl.sc-ion-label-md-h,.label-floating.label-rtl.sc-ion-label-md-h{transform-origin:top right}.label-stacked.sc-ion-label-md-h{transform:translateY(50%) scale(0.75);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.label-floating.sc-ion-label-md-h{transform:translateY(96%);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.ion-focused.label-floating.sc-ion-label-md-h,.ion-focused .label-floating.sc-ion-label-md-h,.item-has-focus.label-floating.sc-ion-label-md-h,.item-has-focus .label-floating.sc-ion-label-md-h,.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h,.item-has-value.label-floating.sc-ion-label-md-h,.item-has-value .label-floating.sc-ion-label-md-h{transform:translateY(50%) scale(0.75)}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h{transform:translateY(-6px) scale(0.75);position:relative;max-width:min-content;background-color:var(--ion-item-background, var(--ion-background-color, #fff));overflow:visible;z-index:3}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::before,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::before,.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::after,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::before,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::after,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::after{position:absolute;width:4px;height:100%;background-color:var(--ion-item-background, var(--ion-background-color, #fff));content:\"\"}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::before,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::before,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::before,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::before{left:calc(-1 * 4px)}.item-fill-outline.ion-focused.label-floating.sc-ion-label-md-h::after,.item-fill-outline.ion-focused .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-focus .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating::after,.item-fill-outline.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value.label-floating.sc-ion-label-md-h::after,.item-fill-outline.item-has-value .label-floating.sc-ion-label-md-h::after{right:calc(-1 * 4px)}.item-fill-outline.ion-focused.item-has-start-slot.label-floating.sc-ion-label-md-h,.item-fill-outline.ion-focused.item-has-start-slot .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).item-has-start-slot.label-floating,.item-fill-outline.item-has-placeholder:not(.item-input).item-has-start-slot .label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot.label-floating.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot .label-floating.sc-ion-label-md-h{transform:translateX(-32px) translateY(-6px) scale(0.75)}.item-fill-outline.ion-focused.item-has-start-slot.label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.ion-focused.item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot.label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-focus.item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-placeholder.sc-ion-label-md-h:not(.item-input).item-has-start-slot.label-floating.label-rtl,.item-fill-outline.item-has-placeholder:not(.item-input).item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot.label-floating.label-rtl.sc-ion-label-md-h,.item-fill-outline.item-has-value.item-has-start-slot .label-floating.label-rtl.sc-ion-label-md-h{transform:translateX(calc(-1 * -32px)) translateY(-6px) scale(0.75)}.ion-focused.label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused .label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused.label-floating.sc-ion-label-md-h:not(.ion-color),.ion-focused .label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-primary, #3880ff)}.ion-focused.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-focused.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.ion-focused.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-contrast)}.item-fill-solid.ion-focused.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.ion-focused.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.ion-focused.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.ion-focused.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.ion-focused.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-solid.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-fill-outline.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-base)}.ion-invalid.ion-touched.label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-invalid.ion-touched .label-stacked.sc-ion-label-md-h:not(.ion-color),.ion-invalid.ion-touched.label-floating.sc-ion-label-md-h:not(.ion-color),.ion-invalid.ion-touched .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--highlight-color-invalid)}.sc-ion-label-md-s h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.sc-ion-label-md-s h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-md-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:20px;text-overflow:inherit;overflow:inherit}.sc-ion-label-md-s>p{color:var(--ion-color-step-600, #666666)}.sc-ion-label-md-h.in-item-color.sc-ion-label-md-s>p{color:inherit}";
1995
-
1996
- const Label = class {
1997
- constructor(hostRef) {
1998
- index$1.registerInstance(this, hostRef);
1999
- this.ionColor = index$1.createEvent(this, "ionColor", 7);
2000
- this.ionStyle = index$1.createEvent(this, "ionStyle", 7);
2001
- this.inRange = false;
2002
- this.noAnimate = false;
2003
- }
2004
- componentWillLoad() {
2005
- this.inRange = !!this.el.closest('ion-range');
2006
- this.noAnimate = this.position === 'floating';
2007
- this.emitStyle();
2008
- this.emitColor();
2009
- }
2010
- componentDidLoad() {
2011
- if (this.noAnimate) {
2012
- setTimeout(() => {
2013
- this.noAnimate = false;
2014
- }, 1000);
2015
- }
2016
- }
2017
- colorChanged() {
2018
- this.emitColor();
2019
- }
2020
- positionChanged() {
2021
- this.emitStyle();
2022
- }
2023
- emitColor() {
2024
- const { color } = this;
2025
- this.ionColor.emit({
2026
- 'item-label-color': color !== undefined,
2027
- [`ion-color-${color}`]: color !== undefined,
2028
- });
2029
- }
2030
- emitStyle() {
2031
- const { inRange, position } = this;
2032
- // If the label is inside of a range we don't want
2033
- // to override the classes added by the label that
2034
- // is a direct child of the item
2035
- if (!inRange) {
2036
- this.ionStyle.emit({
2037
- label: true,
2038
- [`label-${position}`]: position !== undefined,
2039
- });
2040
- }
2041
- }
2042
- render() {
2043
- const position = this.position;
2044
- const mode = ionicGlobal.getIonMode(this);
2045
- return (index$1.h(index$1.Host, { class: theme.createColorClasses(this.color, {
2046
- [mode]: true,
2047
- 'in-item-color': theme.hostContext('ion-item.ion-color', this.el),
2048
- [`label-${position}`]: position !== undefined,
2049
- [`label-no-animate`]: this.noAnimate,
2050
- 'label-rtl': document.dir === 'rtl',
2051
- }) }));
2052
- }
2053
- get el() { return index$1.getElement(this); }
2054
- static get watchers() { return {
2055
- "color": ["colorChanged"],
2056
- "position": ["positionChanged"]
2057
- }; }
2058
- };
2059
- Label.style = {
2060
- ios: labelIosCss,
2061
- md: labelMdCss
2062
- };
2063
-
2064
- const listIosCss = "ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{transform:translateZ(0);overflow:hidden}.list-ios{background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-ios.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:10px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.list-ios.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-ios.list-inset ion-item{--border-width:0 0 1px 0;--inner-border-width:0}.list-ios.list-inset ion-item:last-child{--border-width:0;--inner-border-width:0}.list-ios.list-inset+ion-list.list-inset{margin-top:0}.list-ios-lines-none .item{--border-width:0;--inner-border-width:0}.list-ios-lines-full .item,.list-ios .item-lines-full{--border-width:0 0 0.55px 0}.list-ios-lines-full .item{--inner-border-width:0}.list-ios-lines-inset .item,.list-ios .item-lines-inset{--inner-border-width:0 0 0.55px 0}.list-ios .item-lines-inset{--border-width:0}.list-ios .item-lines-full{--inner-border-width:0}.list-ios .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";
2065
-
2066
- const listMdCss = "ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{transform:translateZ(0);overflow:hidden}.list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-md>.input:last-child::after{left:0}[dir=rtl] .list-md>.input:last-child::after,:host-context([dir=rtl]) .list-md>.input:last-child::after{left:unset;right:unset;right:0}.list-md.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.list-md.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-md.list-inset ion-item:first-child{--border-radius:2px 2px 0 0}.list-md.list-inset ion-item:last-child{--border-radius:0 0 2px, 2px;--border-width:0;--inner-border-width:0}.list-md.list-inset .item-interactive{--padding-start:0;--padding-end:0}.list-md.list-inset+ion-list.list-inset{margin-top:0}.list-md-lines-none .item{--border-width:0;--inner-border-width:0}.list-md-lines-full .item,.list-md .item-lines-full{--border-width:0 0 1px 0}.list-md-lines-full .item{--inner-border-width:0}.list-md-lines-inset .item,.list-md .item-lines-inset{--inner-border-width:0 0 1px 0}.list-md .item-lines-inset{--border-width:0}.list-md .item-lines-full{--inner-border-width:0}.list-md .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";
2067
-
2068
- const List = class {
2069
- constructor(hostRef) {
2070
- index$1.registerInstance(this, hostRef);
2071
- /**
2072
- * If `true`, the list will have margin around it and rounded corners.
2073
- */
2074
- this.inset = false;
2075
- }
2076
- /**
2077
- * If `ion-item-sliding` are used inside the list, this method closes
2078
- * any open sliding item.
2079
- *
2080
- * Returns `true` if an actual `ion-item-sliding` is closed.
2081
- */
2082
- async closeSlidingItems() {
2083
- const item = this.el.querySelector('ion-item-sliding');
2084
- if (item === null || item === void 0 ? void 0 : item.closeOpened) {
2085
- return item.closeOpened();
2086
- }
2087
- return false;
2088
- }
2089
- render() {
2090
- const mode = ionicGlobal.getIonMode(this);
2091
- const { lines, inset } = this;
2092
- return (index$1.h(index$1.Host, { role: "list", class: {
2093
- [mode]: true,
2094
- // Used internally for styling
2095
- [`list-${mode}`]: true,
2096
- 'list-inset': inset,
2097
- [`list-lines-${lines}`]: lines !== undefined,
2098
- [`list-${mode}-lines-${lines}`]: lines !== undefined,
2099
- } }));
2100
- }
2101
- get el() { return index$1.getElement(this); }
2102
- };
2103
- List.style = {
2104
- ios: listIosCss,
2105
- md: listMdCss
2106
- };
2107
-
2108
- const noteIosCss = ":host{color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-350, #a6a6a6)}";
2109
-
2110
- const noteMdCss = ":host{color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-600, #666666);font-size:14px}";
2111
-
2112
- const Note = class {
2113
- constructor(hostRef) {
2114
- index$1.registerInstance(this, hostRef);
2115
- }
2116
- render() {
2117
- const mode = ionicGlobal.getIonMode(this);
2118
- return (index$1.h(index$1.Host, { class: theme.createColorClasses(this.color, {
2119
- [mode]: true,
2120
- }) }, index$1.h("slot", null)));
2121
- }
2122
- };
2123
- Note.style = {
2124
- ios: noteIosCss,
2125
- md: noteMdCss
2126
- };
2127
-
2128
- const progressBarIosCss = ":host{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}.progress,.progress-indeterminate,.indeterminate-bar-primary,.indeterminate-bar-secondary,.progress-buffer-bar{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}.buffer-circles-container,.buffer-circles{left:0;right:0;top:0;bottom:0;position:absolute}.buffer-circles{right:-10px;left:-10px;}.progress,.progress-buffer-bar,.buffer-circles-container{transform-origin:left top;transition:transform 150ms linear}.progress,.progress-indeterminate{background:var(--progress-background);z-index:2}.progress-buffer-bar{background:var(--buffer-background);z-index:1}.buffer-circles-container{overflow:hidden}.indeterminate-bar-primary{top:0;right:0;bottom:0;left:-145.166611%;animation:primary-indeterminate-translate 2s infinite linear}.indeterminate-bar-primary .progress-indeterminate{animation:primary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.indeterminate-bar-secondary{top:0;right:0;bottom:0;left:-54.888891%;animation:secondary-indeterminate-translate 2s infinite linear}.indeterminate-bar-secondary .progress-indeterminate{animation:secondary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.buffer-circles{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;animation:buffering 450ms infinite linear}:host(.progress-bar-reversed){transform:scaleX(-1)}:host(.progress-paused) .indeterminate-bar-secondary,:host(.progress-paused) .indeterminate-bar-primary,:host(.progress-paused) .buffer-circles{animation-play-state:paused}:host(.ion-color) .progress-buffer-bar{background:rgba(var(--ion-color-base-rgb), 0.3)}:host(.ion-color) .buffer-circles{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}:host(.ion-color) .progress,:host(.ion-color) .progress-indeterminate{background:var(--ion-color-base)}@keyframes primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{to{transform:translateX(-10px)}}:host{height:3px}";
2129
-
2130
- const progressBarMdCss = ":host{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}.progress,.progress-indeterminate,.indeterminate-bar-primary,.indeterminate-bar-secondary,.progress-buffer-bar{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}.buffer-circles-container,.buffer-circles{left:0;right:0;top:0;bottom:0;position:absolute}.buffer-circles{right:-10px;left:-10px;}.progress,.progress-buffer-bar,.buffer-circles-container{transform-origin:left top;transition:transform 150ms linear}.progress,.progress-indeterminate{background:var(--progress-background);z-index:2}.progress-buffer-bar{background:var(--buffer-background);z-index:1}.buffer-circles-container{overflow:hidden}.indeterminate-bar-primary{top:0;right:0;bottom:0;left:-145.166611%;animation:primary-indeterminate-translate 2s infinite linear}.indeterminate-bar-primary .progress-indeterminate{animation:primary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.indeterminate-bar-secondary{top:0;right:0;bottom:0;left:-54.888891%;animation:secondary-indeterminate-translate 2s infinite linear}.indeterminate-bar-secondary .progress-indeterminate{animation:secondary-indeterminate-scale 2s infinite linear;animation-play-state:inherit}.buffer-circles{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;animation:buffering 450ms infinite linear}:host(.progress-bar-reversed){transform:scaleX(-1)}:host(.progress-paused) .indeterminate-bar-secondary,:host(.progress-paused) .indeterminate-bar-primary,:host(.progress-paused) .buffer-circles{animation-play-state:paused}:host(.ion-color) .progress-buffer-bar{background:rgba(var(--ion-color-base-rgb), 0.3)}:host(.ion-color) .buffer-circles{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}:host(.ion-color) .progress,:host(.ion-color) .progress-indeterminate{background:var(--ion-color-base)}@keyframes primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{to{transform:translateX(-10px)}}:host{height:4px}";
2131
-
2132
- const ProgressBar = class {
2133
- constructor(hostRef) {
2134
- index$1.registerInstance(this, hostRef);
2135
- /**
2136
- * The state of the progress bar, based on if the time the process takes is known or not.
2137
- * Default options are: `"determinate"` (no animation), `"indeterminate"` (animate from left to right).
2138
- */
2139
- this.type = 'determinate';
2140
- /**
2141
- * If true, reverse the progress bar direction.
2142
- */
2143
- this.reversed = false;
2144
- /**
2145
- * The value determines how much of the active bar should display when the
2146
- * `type` is `"determinate"`.
2147
- * The value should be between [0, 1].
2148
- */
2149
- this.value = 0;
2150
- /**
2151
- * If the buffer and value are smaller than 1, the buffer circles will show.
2152
- * The buffer should be between [0, 1].
2153
- */
2154
- this.buffer = 1;
2155
- }
2156
- render() {
2157
- const { color, type, reversed, value, buffer } = this;
2158
- const paused = ionicGlobal.config.getBoolean('_testing');
2159
- const mode = ionicGlobal.getIonMode(this);
2160
- return (index$1.h(index$1.Host, { role: "progressbar", "aria-valuenow": type === 'determinate' ? value : null, "aria-valuemin": "0", "aria-valuemax": "1", class: theme.createColorClasses(color, {
2161
- [mode]: true,
2162
- [`progress-bar-${type}`]: true,
2163
- 'progress-paused': paused,
2164
- 'progress-bar-reversed': document.dir === 'rtl' ? !reversed : reversed,
2165
- }) }, type === 'indeterminate' ? renderIndeterminate() : renderProgress(value, buffer)));
2166
- }
2167
- };
2168
- const renderIndeterminate = () => {
2169
- return (index$1.h("div", { part: "track", class: "progress-buffer-bar" }, index$1.h("div", { class: "indeterminate-bar-primary" }, index$1.h("span", { part: "progress", class: "progress-indeterminate" })), index$1.h("div", { class: "indeterminate-bar-secondary" }, index$1.h("span", { part: "progress", class: "progress-indeterminate" }))));
2170
- };
2171
- const renderProgress = (value, buffer) => {
2172
- const finalValue = helpers.clamp(0, value, 1);
2173
- const finalBuffer = helpers.clamp(0, buffer, 1);
2174
- return [
2175
- index$1.h("div", { part: "progress", class: "progress", style: { transform: `scaleX(${finalValue})` } }),
2176
- /**
2177
- * Buffer circles with two container to move
2178
- * the circles behind the buffer progress
2179
- * with respecting the animation.
2180
- * When finalBuffer === 1, we use display: none
2181
- * instead of removing the element to avoid flickering.
2182
- */
2183
- index$1.h("div", { class: { 'buffer-circles-container': true, 'ion-hide': finalBuffer === 1 }, style: { transform: `translateX(${finalBuffer * 100}%)` } }, index$1.h("div", { class: "buffer-circles-container", style: { transform: `translateX(-${finalBuffer * 100}%)` } }, index$1.h("div", { part: "stream", class: "buffer-circles" }))),
2184
- index$1.h("div", { part: "track", class: "progress-buffer-bar", style: { transform: `scaleX(${finalBuffer})` } }),
2185
- ];
2186
- };
2187
- ProgressBar.style = {
2188
- ios: progressBarIosCss,
2189
- md: progressBarMdCss
2190
- };
2191
-
2192
- const rippleEffectCss = ":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;will-change:transform, opacity;pointer-events:none}.fade-out{transform:translate(var(--translate-end)) scale(var(--final-scale, 1));animation:150ms fadeOutAnimation forwards}@keyframes rippleAnimation{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(1)}to{transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@keyframes fadeInAnimation{from{animation-timing-function:linear;opacity:0}to{opacity:0.16}}@keyframes fadeOutAnimation{from{animation-timing-function:linear;opacity:0.16}to{opacity:0}}";
2193
-
2194
- const RippleEffect = class {
2195
- constructor(hostRef) {
2196
- index$1.registerInstance(this, hostRef);
2197
- /**
2198
- * Sets the type of ripple-effect:
2199
- *
2200
- * - `bounded`: the ripple effect expands from the user's click position
2201
- * - `unbounded`: the ripple effect expands from the center of the button and overflows the container.
2202
- *
2203
- * NOTE: Surfaces for bounded ripples should have the overflow property set to hidden,
2204
- * while surfaces for unbounded ripples should have it set to visible.
2205
- */
2206
- this.type = 'bounded';
2207
- }
2208
- /**
2209
- * Adds the ripple effect to the parent element.
2210
- *
2211
- * @param x The horizontal coordinate of where the ripple should start.
2212
- * @param y The vertical coordinate of where the ripple should start.
2213
- */
2214
- async addRipple(x, y) {
2215
- return new Promise((resolve) => {
2216
- index$1.readTask(() => {
2217
- const rect = this.el.getBoundingClientRect();
2218
- const width = rect.width;
2219
- const height = rect.height;
2220
- const hypotenuse = Math.sqrt(width * width + height * height);
2221
- const maxDim = Math.max(height, width);
2222
- const maxRadius = this.unbounded ? maxDim : hypotenuse + PADDING;
2223
- const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);
2224
- const finalScale = maxRadius / initialSize;
2225
- let posX = x - rect.left;
2226
- let posY = y - rect.top;
2227
- if (this.unbounded) {
2228
- posX = width * 0.5;
2229
- posY = height * 0.5;
2230
- }
2231
- const styleX = posX - initialSize * 0.5;
2232
- const styleY = posY - initialSize * 0.5;
2233
- const moveX = width * 0.5 - posX;
2234
- const moveY = height * 0.5 - posY;
2235
- index$1.writeTask(() => {
2236
- const div = document.createElement('div');
2237
- div.classList.add('ripple-effect');
2238
- const style = div.style;
2239
- style.top = styleY + 'px';
2240
- style.left = styleX + 'px';
2241
- style.width = style.height = initialSize + 'px';
2242
- style.setProperty('--final-scale', `${finalScale}`);
2243
- style.setProperty('--translate-end', `${moveX}px, ${moveY}px`);
2244
- const container = this.el.shadowRoot || this.el;
2245
- container.appendChild(div);
2246
- setTimeout(() => {
2247
- resolve(() => {
2248
- removeRipple(div);
2249
- });
2250
- }, 225 + 100);
2251
- });
2252
- });
2253
- });
2254
- }
2255
- get unbounded() {
2256
- return this.type === 'unbounded';
2257
- }
2258
- render() {
2259
- const mode = ionicGlobal.getIonMode(this);
2260
- return (index$1.h(index$1.Host, { role: "presentation", class: {
2261
- [mode]: true,
2262
- unbounded: this.unbounded,
2263
- } }));
2264
- }
2265
- get el() { return index$1.getElement(this); }
2266
- };
2267
- const removeRipple = (ripple) => {
2268
- ripple.classList.add('fade-out');
2269
- setTimeout(() => {
2270
- ripple.remove();
2271
- }, 200);
2272
- };
2273
- const PADDING = 10;
2274
- const INITIAL_ORIGIN_SCALE = 0.5;
2275
- RippleEffect.style = rippleEffectCss;
2276
-
2277
- const rowCss = ":host{display:flex;flex-wrap:wrap}";
2278
-
2279
- const Row = class {
2280
- constructor(hostRef) {
2281
- index$1.registerInstance(this, hostRef);
2282
- }
2283
- render() {
2284
- return (index$1.h(index$1.Host, { class: ionicGlobal.getIonMode(this) }, index$1.h("slot", null)));
2285
- }
2286
- };
2287
- Row.style = rowCss;
2288
-
2289
- const searchbarIosCss = ".sc-ion-searchbar-ios-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}.ion-color.sc-ion-searchbar-ios-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:inherit}.searchbar-search-icon.sc-ion-searchbar-ios{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-ios{display:block;position:relative;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;box-shadow:var(--box-shadow);box-sizing:border-box;appearance:none}.searchbar-input.sc-ion-searchbar-ios::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-ios::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-ios>div.sc-ion-searchbar-ios{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);appearance:none}.searchbar-clear-button.sc-ion-searchbar-ios:focus{opacity:0.5}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{display:block}.searchbar-disabled.sc-ion-searchbar-ios-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.07);--border-radius:10px;--box-shadow:none;--cancel-button-color:var(--ion-color-primary, #3880ff);--clear-button-color:var(--ion-color-step-600, #666666);--color:var(--ion-text-color, #000);--icon-color:var(--ion-color-step-600, #666666);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;height:60px;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.sc-ion-searchbar-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}.searchbar-input-container.sc-ion-searchbar-ios{height:36px}.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:calc(50% - 60px);left:5px;top:0;position:absolute;width:22px;height:100%;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:calc(50% - 60px);margin-inline-start:calc(50% - 60px)}}[dir=rtl].sc-ion-searchbar-ios .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{left:unset;right:unset;right:5px}.searchbar-input.sc-ion-searchbar-ios{padding-left:28px;padding-right:28px;padding-top:0;padding-bottom:0;height:100%;font-size:17px;font-weight:400;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:28px;padding-inline-start:28px;-webkit-padding-end:28px;padding-inline-end:28px}}.searchbar-clear-button.sc-ion-searchbar-ios{right:0;top:0;background-position:center;position:absolute;width:30px;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-ios .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{left:unset;right:unset;left:0}.searchbar-clear-icon.sc-ion-searchbar-ios{width:18px;height:100%}.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:8px;padding-right:0;padding-top:0;padding-bottom:0;flex-shrink:0;background-color:transparent;font-size:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:0;padding-inline-end:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:30px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:unset;-webkit-padding-start:30px;padding-inline-start:30px}}.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{display:block}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{transition:all 300ms ease}.searchbar-animated.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{opacity:1;pointer-events:auto}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:-100%;transform:translate3d(0, 0, 0);transition:all 300ms ease;opacity:0;pointer-events:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:unset;-webkit-margin-end:-100%;margin-inline-end:-100%}}.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{transition-duration:0ms}.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{color:var(--ion-color-base)}@media (any-hover: hover){.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios:hover{color:var(--ion-color-tint)}}ion-toolbar.sc-ion-searchbar-ios-h,ion-toolbar .sc-ion-searchbar-ios-h{padding-top:1px;padding-bottom:15px;height:52px}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color),ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color){color:inherit}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios{color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios{background:rgba(var(--ion-color-contrast-rgb), 0.07);color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}";
2290
-
2291
- const searchbarMdCss = ".sc-ion-searchbar-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);box-sizing:border-box}.ion-color.sc-ion-searchbar-md-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{color:inherit}.searchbar-search-icon.sc-ion-searchbar-md{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-md{display:block;position:relative;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;box-shadow:var(--box-shadow);box-sizing:border-box;appearance:none}.searchbar-input.sc-ion-searchbar-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-md::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-md>div.sc-ion-searchbar-md{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);appearance:none}.searchbar-clear-button.sc-ion-searchbar-md:focus{opacity:0.5}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{display:block}.searchbar-disabled.sc-ion-searchbar-md-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-md-h{--background:var(--ion-background-color, #fff);--border-radius:2px;--box-shadow:0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);--cancel-button-color:var(--ion-color-step-900, #1a1a1a);--clear-button-color:initial;--color:var(--ion-color-step-850, #262626);--icon-color:var(--ion-color-step-600, #666666);padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;background:inherit}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.searchbar-search-icon.sc-ion-searchbar-md{left:16px;top:11px;width:21px;height:21px}[dir=rtl].sc-ion-searchbar-md .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{left:unset;right:unset;right:16px}.searchbar-cancel-button.sc-ion-searchbar-md{left:5px;top:0;background-color:transparent;font-size:1.6em}[dir=rtl].sc-ion-searchbar-md .searchbar-cancel-button.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{left:unset;right:unset;right:5px}.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-cancel-button.sc-ion-searchbar-md{position:absolute}.searchbar-search-icon.ion-activated.sc-ion-searchbar-md,.searchbar-cancel-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-input.sc-ion-searchbar-md{padding-left:55px;padding-right:55px;padding-top:6px;padding-bottom:6px;background-position:left 8px center;height:auto;font-size:16px;font-weight:400;line-height:30px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-md{padding-left:unset;padding-right:unset;-webkit-padding-start:55px;padding-inline-start:55px;-webkit-padding-end:55px;padding-inline-end:55px}}[dir=rtl].sc-ion-searchbar-md .searchbar-input.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background-position:right 8px center}.searchbar-clear-button.sc-ion-searchbar-md{right:13px;top:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;position:absolute;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-md .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{left:unset;right:unset;left:13px}.searchbar-clear-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-clear-icon.sc-ion-searchbar-md{width:22px;height:100%}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md{display:none}ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{padding-left:7px;padding-right:7px;padding-top:3px;padding-bottom:3px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:7px;padding-inline-start:7px;-webkit-padding-end:7px;padding-inline-end:7px}}";
2292
-
2293
- const Searchbar = class {
2294
- constructor(hostRef) {
2295
- index$1.registerInstance(this, hostRef);
2296
- this.ionInput = index$1.createEvent(this, "ionInput", 7);
2297
- this.ionChange = index$1.createEvent(this, "ionChange", 7);
2298
- this.ionCancel = index$1.createEvent(this, "ionCancel", 7);
2299
- this.ionClear = index$1.createEvent(this, "ionClear", 7);
2300
- this.ionBlur = index$1.createEvent(this, "ionBlur", 7);
2301
- this.ionFocus = index$1.createEvent(this, "ionFocus", 7);
2302
- this.ionStyle = index$1.createEvent(this, "ionStyle", 7);
2303
- this.isCancelVisible = false;
2304
- this.shouldAlignLeft = true;
2305
- this.focused = false;
2306
- this.noAnimate = true;
2307
- /**
2308
- * If `true`, enable searchbar animation.
2309
- */
2310
- this.animated = false;
2311
- /**
2312
- * Set the input's autocomplete property.
2313
- */
2314
- this.autocomplete = 'off';
2315
- /**
2316
- * Set the input's autocorrect property.
2317
- */
2318
- this.autocorrect = 'off';
2319
- /**
2320
- * Set the cancel button icon. Only applies to `md` mode.
2321
- * Defaults to `arrow-back-sharp`.
2322
- */
2323
- this.cancelButtonIcon = ionicGlobal.config.get('backButtonIcon', index$4.arrowBackSharp);
2324
- /**
2325
- * Set the the cancel button text. Only applies to `ios` mode.
2326
- */
2327
- this.cancelButtonText = 'Cancel';
2328
- /**
2329
- * Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`.
2330
- */
2331
- this.debounce = 250;
2332
- /**
2333
- * If `true`, the user cannot interact with the input.
2334
- */
2335
- this.disabled = false;
2336
- /**
2337
- * Set the input's placeholder.
2338
- * `placeholder` can accept either plaintext or HTML as a string.
2339
- * To display characters normally reserved for HTML, they
2340
- * must be escaped. For example `<Ionic>` would become
2341
- * `&lt;Ionic&gt;`
2342
- *
2343
- * For more information: [Security Documentation](https://ionicframework.com/docs/faq/security)
2344
- */
2345
- this.placeholder = 'Search';
2346
- /**
2347
- * Sets the behavior for the cancel button. Defaults to `"never"`.
2348
- * Setting to `"focus"` shows the cancel button on focus.
2349
- * Setting to `"never"` hides the cancel button.
2350
- * Setting to `"always"` shows the cancel button regardless
2351
- * of focus state.
2352
- */
2353
- this.showCancelButton = 'never';
2354
- /**
2355
- * Sets the behavior for the clear button. Defaults to `"focus"`.
2356
- * Setting to `"focus"` shows the clear button on focus if the
2357
- * input is not empty.
2358
- * Setting to `"never"` hides the clear button.
2359
- * Setting to `"always"` shows the clear button regardless
2360
- * of focus state, but only if the input is not empty.
2361
- */
2362
- this.showClearButton = 'always';
2363
- /**
2364
- * If `true`, enable spellcheck on the input.
2365
- */
2366
- this.spellcheck = false;
2367
- /**
2368
- * Set the type of the input.
2369
- */
2370
- this.type = 'search';
2371
- /**
2372
- * the value of the searchbar.
2373
- */
2374
- this.value = '';
2375
- /**
2376
- * Clears the input field and triggers the control change.
2377
- */
2378
- this.onClearInput = (shouldFocus) => {
2379
- this.ionClear.emit();
2380
- // setTimeout() fixes https://github.com/ionic-team/ionic/issues/7527
2381
- // wait for 4 frames
2382
- setTimeout(() => {
2383
- const value = this.getValue();
2384
- if (value !== '') {
2385
- this.value = '';
2386
- this.ionInput.emit();
2387
- /**
2388
- * When tapping clear button
2389
- * ensure input is focused after
2390
- * clearing input so users
2391
- * can quickly start typing.
2392
- */
2393
- if (shouldFocus && !this.focused) {
2394
- this.setFocus();
2395
- }
2396
- }
2397
- }, 16 * 4);
2398
- };
2399
- /**
2400
- * Clears the input field and tells the input to blur since
2401
- * the clearInput function doesn't want the input to blur
2402
- * then calls the custom cancel function if the user passed one in.
2403
- */
2404
- this.onCancelSearchbar = (ev) => {
2405
- if (ev) {
2406
- ev.preventDefault();
2407
- ev.stopPropagation();
2408
- }
2409
- this.ionCancel.emit();
2410
- this.onClearInput();
2411
- if (this.nativeInput) {
2412
- this.nativeInput.blur();
2413
- }
2414
- };
2415
- /**
2416
- * Update the Searchbar input value when the input changes
2417
- */
2418
- this.onInput = (ev) => {
2419
- const input = ev.target;
2420
- if (input) {
2421
- this.value = input.value;
2422
- }
2423
- this.ionInput.emit(ev);
2424
- };
2425
- /**
2426
- * Sets the Searchbar to not focused and checks if it should align left
2427
- * based on whether there is a value in the searchbar or not.
2428
- */
2429
- this.onBlur = () => {
2430
- this.focused = false;
2431
- this.ionBlur.emit();
2432
- this.positionElements();
2433
- };
2434
- /**
2435
- * Sets the Searchbar to focused and active on input focus.
2436
- */
2437
- this.onFocus = () => {
2438
- this.focused = true;
2439
- this.ionFocus.emit();
2440
- this.positionElements();
2441
- };
2442
- }
2443
- debounceChanged() {
2444
- this.ionChange = helpers.debounceEvent(this.ionChange, this.debounce);
2445
- }
2446
- valueChanged() {
2447
- const inputEl = this.nativeInput;
2448
- const value = this.getValue();
2449
- if (inputEl && inputEl.value !== value) {
2450
- inputEl.value = value;
2451
- }
2452
- this.ionChange.emit({ value });
2453
- }
2454
- showCancelButtonChanged() {
2455
- requestAnimationFrame(() => {
2456
- this.positionElements();
2457
- index$1.forceUpdate(this);
2458
- });
2459
- }
2460
- connectedCallback() {
2461
- this.emitStyle();
2462
- }
2463
- componentDidLoad() {
2464
- this.positionElements();
2465
- this.debounceChanged();
2466
- setTimeout(() => {
2467
- this.noAnimate = false;
2468
- }, 300);
2469
- }
2470
- emitStyle() {
2471
- this.ionStyle.emit({
2472
- searchbar: true,
2473
- });
2474
- }
2475
- /**
2476
- * Sets focus on the specified `ion-searchbar`. Use this method instead of the global
2477
- * `input.focus()`.
2478
- */
2479
- async setFocus() {
2480
- if (this.nativeInput) {
2481
- this.nativeInput.focus();
2482
- }
2483
- }
2484
- /**
2485
- * Returns the native `<input>` element used under the hood.
2486
- */
2487
- getInputElement() {
2488
- return Promise.resolve(this.nativeInput);
2489
- }
2490
- /**
2491
- * Positions the input search icon, placeholder, and the cancel button
2492
- * based on the input value and if it is focused. (ios only)
2493
- */
2494
- positionElements() {
2495
- const value = this.getValue();
2496
- const prevAlignLeft = this.shouldAlignLeft;
2497
- const mode = ionicGlobal.getIonMode(this);
2498
- const shouldAlignLeft = !this.animated || value.trim() !== '' || !!this.focused;
2499
- this.shouldAlignLeft = shouldAlignLeft;
2500
- if (mode !== 'ios') {
2501
- return;
2502
- }
2503
- if (prevAlignLeft !== shouldAlignLeft) {
2504
- this.positionPlaceholder();
2505
- }
2506
- if (this.animated) {
2507
- this.positionCancelButton();
2508
- }
2509
- }
2510
- /**
2511
- * Positions the input placeholder
2512
- */
2513
- positionPlaceholder() {
2514
- const inputEl = this.nativeInput;
2515
- if (!inputEl) {
2516
- return;
2517
- }
2518
- const rtl = dir$1.isRTL(this.el);
2519
- const iconEl = (this.el.shadowRoot || this.el).querySelector('.searchbar-search-icon');
2520
- if (this.shouldAlignLeft) {
2521
- inputEl.removeAttribute('style');
2522
- iconEl.removeAttribute('style');
2523
- }
2524
- else {
2525
- // Create a dummy span to get the placeholder width
2526
- const doc = document;
2527
- const tempSpan = doc.createElement('span');
2528
- tempSpan.innerText = this.placeholder || '';
2529
- doc.body.appendChild(tempSpan);
2530
- // Get the width of the span then remove it
2531
- helpers.raf(() => {
2532
- const textWidth = tempSpan.offsetWidth;
2533
- tempSpan.remove();
2534
- // Calculate the input padding
2535
- const inputLeft = 'calc(50% - ' + textWidth / 2 + 'px)';
2536
- // Calculate the icon margin
2537
- const iconLeft = 'calc(50% - ' + (textWidth / 2 + 30) + 'px)';
2538
- // Set the input padding start and icon margin start
2539
- if (rtl) {
2540
- inputEl.style.paddingRight = inputLeft;
2541
- iconEl.style.marginRight = iconLeft;
2542
- }
2543
- else {
2544
- inputEl.style.paddingLeft = inputLeft;
2545
- iconEl.style.marginLeft = iconLeft;
2546
- }
2547
- });
2548
- }
2549
- }
2550
- /**
2551
- * Show the iOS Cancel button on focus, hide it offscreen otherwise
2552
- */
2553
- positionCancelButton() {
2554
- const rtl = dir$1.isRTL(this.el);
2555
- const cancelButton = (this.el.shadowRoot || this.el).querySelector('.searchbar-cancel-button');
2556
- const shouldShowCancel = this.shouldShowCancelButton();
2557
- if (cancelButton !== null && shouldShowCancel !== this.isCancelVisible) {
2558
- const cancelStyle = cancelButton.style;
2559
- this.isCancelVisible = shouldShowCancel;
2560
- if (shouldShowCancel) {
2561
- if (rtl) {
2562
- cancelStyle.marginLeft = '0';
2563
- }
2564
- else {
2565
- cancelStyle.marginRight = '0';
2566
- }
2567
- }
2568
- else {
2569
- const offset = cancelButton.offsetWidth;
2570
- if (offset > 0) {
2571
- if (rtl) {
2572
- cancelStyle.marginLeft = -offset + 'px';
2573
- }
2574
- else {
2575
- cancelStyle.marginRight = -offset + 'px';
2576
- }
2577
- }
2578
- }
2579
- }
2580
- }
2581
- getValue() {
2582
- return this.value || '';
2583
- }
2584
- hasValue() {
2585
- return this.getValue() !== '';
2586
- }
2587
- /**
2588
- * Determines whether or not the cancel button should be visible onscreen.
2589
- * Cancel button should be shown if one of two conditions applies:
2590
- * 1. `showCancelButton` is set to `always`.
2591
- * 2. `showCancelButton` is set to `focus`, and the searchbar has been focused.
2592
- */
2593
- shouldShowCancelButton() {
2594
- if (this.showCancelButton === 'never' || (this.showCancelButton === 'focus' && !this.focused)) {
2595
- return false;
2596
- }
2597
- return true;
2598
- }
2599
- /**
2600
- * Determines whether or not the clear button should be visible onscreen.
2601
- * Clear button should be shown if one of two conditions applies:
2602
- * 1. `showClearButton` is set to `always`.
2603
- * 2. `showClearButton` is set to `focus`, and the searchbar has been focused.
2604
- */
2605
- shouldShowClearButton() {
2606
- if (this.showClearButton === 'never' || (this.showClearButton === 'focus' && !this.focused)) {
2607
- return false;
2608
- }
2609
- return true;
2610
- }
2611
- render() {
2612
- const { cancelButtonText } = this;
2613
- const animated = this.animated && ionicGlobal.config.getBoolean('animated', true);
2614
- const mode = ionicGlobal.getIonMode(this);
2615
- const clearIcon = this.clearIcon || (mode === 'ios' ? index$4.closeCircle : index$4.closeSharp);
2616
- const searchIcon = this.searchIcon || (mode === 'ios' ? index$4.searchOutline : index$4.searchSharp);
2617
- const shouldShowCancelButton = this.shouldShowCancelButton();
2618
- const cancelButton = this.showCancelButton !== 'never' && (index$1.h("button", { "aria-label": cancelButtonText, "aria-hidden": shouldShowCancelButton ? undefined : 'true', type: "button", tabIndex: mode === 'ios' && !shouldShowCancelButton ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: "searchbar-cancel-button" }, index$1.h("div", { "aria-hidden": "true" }, mode === 'md' ? (index$1.h("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })) : (cancelButtonText))));
2619
- return (index$1.h(index$1.Host, { role: "search", "aria-disabled": this.disabled ? 'true' : null, class: theme.createColorClasses(this.color, {
2620
- [mode]: true,
2621
- 'searchbar-animated': animated,
2622
- 'searchbar-disabled': this.disabled,
2623
- 'searchbar-no-animate': animated && this.noAnimate,
2624
- 'searchbar-has-value': this.hasValue(),
2625
- 'searchbar-left-aligned': this.shouldAlignLeft,
2626
- 'searchbar-has-focus': this.focused,
2627
- 'searchbar-should-show-clear': this.shouldShowClearButton(),
2628
- 'searchbar-should-show-cancel': this.shouldShowCancelButton(),
2629
- }) }, index$1.h("div", { class: "searchbar-input-container" }, index$1.h("input", { "aria-label": "search text", disabled: this.disabled, ref: (el) => (this.nativeInput = el), class: "searchbar-input", inputMode: this.inputmode, enterKeyHint: this.enterkeyhint, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellcheck: this.spellcheck }), mode === 'md' && cancelButton, index$1.h("ion-icon", { "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), index$1.h("button", { "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onPointerDown: (ev) => {
2630
- /**
2631
- * This prevents mobile browsers from
2632
- * blurring the input when the clear
2633
- * button is activated.
2634
- */
2635
- ev.preventDefault();
2636
- }, onClick: () => this.onClearInput(true) }, index$1.h("ion-icon", { "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
2637
- }
2638
- get el() { return index$1.getElement(this); }
2639
- static get watchers() { return {
2640
- "debounce": ["debounceChanged"],
2641
- "value": ["valueChanged"],
2642
- "showCancelButton": ["showCancelButtonChanged"]
2643
- }; }
2644
- };
2645
- Searchbar.style = {
2646
- ios: searchbarIosCss,
2647
- md: searchbarMdCss
2648
- };
2649
-
2650
- const skeletonTextCss = ":host{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;user-select:none;pointer-events:none}span{display:inline-block}:host(.in-media){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}:host(.skeleton-text-animated){position:relative;background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}";
2651
-
2652
- const SkeletonText = class {
2653
- constructor(hostRef) {
2654
- index$1.registerInstance(this, hostRef);
2655
- /**
2656
- * If `true`, the skeleton text will animate.
2657
- */
2658
- this.animated = false;
2659
- }
2660
- render() {
2661
- const animated = this.animated && ionicGlobal.config.getBoolean('animated', true);
2662
- const inMedia = theme.hostContext('ion-avatar', this.el) || theme.hostContext('ion-thumbnail', this.el);
2663
- const mode = ionicGlobal.getIonMode(this);
2664
- return (index$1.h(index$1.Host, { class: {
2665
- [mode]: true,
2666
- 'skeleton-text-animated': animated,
2667
- 'in-media': inMedia,
2668
- } }, index$1.h("span", null, "\u00A0")));
2669
- }
2670
- get el() { return index$1.getElement(this); }
2671
- };
2672
- SkeletonText.style = skeletonTextCss;
2673
-
2674
- const titleIosCss = ":host{--color:initial;display:flex;flex:1;align-items:center;transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{left:0;top:0;padding-left:90px;padding-right:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;transform:translateZ(0);font-size:17px;font-weight:600;text-align:center;box-sizing:border-box;pointer-events:none}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px}}:host(.title-small){padding-left:9px;padding-right:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:13px;font-weight:normal}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.title-small){padding-left:unset;padding-right:unset;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px}}:host(.title-large){padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;transform-origin:left center;bottom:0;align-items:flex-end;min-width:100%;padding-bottom:6px;font-size:34px;font-weight:700;text-align:start}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.title-large){padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host(.title-large.title-rtl){transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000)}:host(.title-large) .toolbar-title{transform-origin:inherit}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{transform-origin:calc(100% - inherit)}";
2675
-
2676
- const titleMdCss = ":host{--color:initial;display:flex;flex:1;align-items:center;transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{padding-left:20px;padding-right:20px;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;letter-spacing:0.0125em}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}:host(.title-small){width:100%;height:100%;font-size:15px;font-weight:normal}";
2677
-
2678
- const ToolbarTitle = class {
2679
- constructor(hostRef) {
2680
- index$1.registerInstance(this, hostRef);
2681
- this.ionStyle = index$1.createEvent(this, "ionStyle", 7);
2682
- }
2683
- sizeChanged() {
2684
- this.emitStyle();
2685
- }
2686
- connectedCallback() {
2687
- this.emitStyle();
2688
- }
2689
- emitStyle() {
2690
- const size = this.getSize();
2691
- this.ionStyle.emit({
2692
- [`title-${size}`]: true,
2693
- });
2694
- }
2695
- getSize() {
2696
- return this.size !== undefined ? this.size : 'default';
2697
- }
2698
- render() {
2699
- const mode = ionicGlobal.getIonMode(this);
2700
- const size = this.getSize();
2701
- return (index$1.h(index$1.Host, { class: theme.createColorClasses(this.color, {
2702
- [mode]: true,
2703
- [`title-${size}`]: true,
2704
- 'title-rtl': document.dir === 'rtl',
2705
- }) }, index$1.h("div", { class: "toolbar-title" }, index$1.h("slot", null))));
2706
- }
2707
- get el() { return index$1.getElement(this); }
2708
- static get watchers() { return {
2709
- "size": ["sizeChanged"]
2710
- }; }
2711
- };
2712
- ToolbarTitle.style = {
2713
- ios: titleIosCss,
2714
- md: titleMdCss
2715
- };
2716
-
2717
- const toolbarIosCss = ":host{--border-width:0;--border-style:solid;--opacity:1;--opacity-scale:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:block;position:relative;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);contain:content;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}:host(.ion-color){color:var(--ion-color-contrast)}:host(.ion-color) .toolbar-background{background:var(--ion-color-base)}.toolbar-container{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;position:relative;flex-direction:row;align-items:center;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.toolbar-container{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.toolbar-background{left:0;right:0;top:0;bottom:0;position:absolute;transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:calc(var(--opacity) * var(--opacity-scale));z-index:-1;pointer-events:none}::slotted(ion-progress-bar){left:0;right:0;bottom:0;position:absolute}:host{--background:var(--ion-toolbar-background, var(--ion-color-step-50, #f7f7f7));--color:var(--ion-toolbar-color, var(--ion-text-color, #000));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.2))));--padding-top:3px;--padding-bottom:3px;--padding-start:4px;--padding-end:4px;--min-height:44px}.toolbar-content{flex:1;order:4;min-width:0}:host(.toolbar-segment) .toolbar-content{display:inline-flex}:host(.toolbar-searchbar) .toolbar-container{padding-top:0;padding-bottom:0}:host(.toolbar-searchbar) ::slotted(*){align-self:start}:host(.toolbar-searchbar) ::slotted(ion-chip){margin-top:3px}:host(.toolbar-searchbar) ::slotted(ion-back-button){height:38px}::slotted(ion-buttons){min-height:38px}::slotted([slot=start]){order:2}::slotted([slot=secondary]){order:3}::slotted([slot=primary]){order:5;text-align:end}::slotted([slot=end]){order:6;text-align:end}:host(.toolbar-title-large) .toolbar-container{flex-wrap:wrap;align-items:flex-start}:host(.toolbar-title-large) .toolbar-content ion-title{flex:1;order:8;min-width:100%}";
2718
-
2719
- const toolbarMdCss = ":host{--border-width:0;--border-style:solid;--opacity:1;--opacity-scale:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:block;position:relative;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);contain:content;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}:host(.ion-color){color:var(--ion-color-contrast)}:host(.ion-color) .toolbar-background{background:var(--ion-color-base)}.toolbar-container{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;position:relative;flex-direction:row;align-items:center;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;z-index:10;box-sizing:border-box}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.toolbar-container{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.toolbar-background{left:0;right:0;top:0;bottom:0;position:absolute;transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:calc(var(--opacity) * var(--opacity-scale));z-index:-1;pointer-events:none}::slotted(ion-progress-bar){left:0;right:0;bottom:0;position:absolute}:host{--background:var(--ion-toolbar-background, var(--ion-background-color, #fff));--color:var(--ion-toolbar-color, var(--ion-text-color, #424242));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, #c1c4cd)));--padding-top:0;--padding-bottom:0;--padding-start:0;--padding-end:0;--min-height:56px}.toolbar-content{flex:1;order:3;min-width:0;max-width:100%}::slotted(.buttons-first-slot){margin-left:4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(.buttons-first-slot){margin-left:unset;-webkit-margin-start:4px;margin-inline-start:4px}}::slotted(.buttons-last-slot){margin-right:4px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){::slotted(.buttons-last-slot){margin-right:unset;-webkit-margin-end:4px;margin-inline-end:4px}}::slotted([slot=start]){order:2}::slotted([slot=secondary]){order:4}::slotted([slot=primary]){order:5;text-align:end}::slotted([slot=end]){order:6;text-align:end}";
2720
-
2721
- const Toolbar = class {
2722
- constructor(hostRef) {
2723
- index$1.registerInstance(this, hostRef);
2724
- this.childrenStyles = new Map();
2725
- }
2726
- componentWillLoad() {
2727
- const buttons = Array.from(this.el.querySelectorAll('ion-buttons'));
2728
- const firstButtons = buttons.find((button) => {
2729
- return button.slot === 'start';
2730
- });
2731
- if (firstButtons) {
2732
- firstButtons.classList.add('buttons-first-slot');
2733
- }
2734
- const buttonsReversed = buttons.reverse();
2735
- const lastButtons = buttonsReversed.find((button) => button.slot === 'end') ||
2736
- buttonsReversed.find((button) => button.slot === 'primary') ||
2737
- buttonsReversed.find((button) => button.slot === 'secondary');
2738
- if (lastButtons) {
2739
- lastButtons.classList.add('buttons-last-slot');
2740
- }
2741
- }
2742
- childrenStyle(ev) {
2743
- ev.stopPropagation();
2744
- const tagName = ev.target.tagName;
2745
- const updatedStyles = ev.detail;
2746
- const newStyles = {};
2747
- const childStyles = this.childrenStyles.get(tagName) || {};
2748
- let hasStyleChange = false;
2749
- Object.keys(updatedStyles).forEach((key) => {
2750
- const childKey = `toolbar-${key}`;
2751
- const newValue = updatedStyles[key];
2752
- if (newValue !== childStyles[childKey]) {
2753
- hasStyleChange = true;
2754
- }
2755
- if (newValue) {
2756
- newStyles[childKey] = true;
2757
- }
2758
- });
2759
- if (hasStyleChange) {
2760
- this.childrenStyles.set(tagName, newStyles);
2761
- index$1.forceUpdate(this);
2762
- }
2763
- }
2764
- render() {
2765
- const mode = ionicGlobal.getIonMode(this);
2766
- const childStyles = {};
2767
- this.childrenStyles.forEach((value) => {
2768
- Object.assign(childStyles, value);
2769
- });
2770
- return (index$1.h(index$1.Host, { class: Object.assign(Object.assign({}, childStyles), theme.createColorClasses(this.color, {
2771
- [mode]: true,
2772
- 'in-toolbar': theme.hostContext('ion-toolbar', this.el),
2773
- })) }, index$1.h("div", { class: "toolbar-background" }), index$1.h("div", { class: "toolbar-container" }, index$1.h("slot", { name: "start" }), index$1.h("slot", { name: "secondary" }), index$1.h("div", { class: "toolbar-content" }, index$1.h("slot", null)), index$1.h("slot", { name: "primary" }), index$1.h("slot", { name: "end" }))));
2774
- }
2775
- get el() { return index$1.getElement(this); }
2776
- };
2777
- Toolbar.style = {
2778
- ios: toolbarIosCss,
2779
- md: toolbarMdCss
2780
- };
2781
-
2782
- const appendToMap$1 = (map, propName, value) => {
2783
- const items = map.get(propName);
2784
- if (!items) {
2785
- map.set(propName, [value]);
2786
- }
2787
- else if (!items.includes(value)) {
2788
- items.push(value);
2789
- }
2790
- };
2791
- const debounce$1 = (fn, ms) => {
2792
- let timeoutId;
2793
- return (...args) => {
2794
- if (timeoutId) {
2795
- clearTimeout(timeoutId);
2796
- }
2797
- timeoutId = setTimeout(() => {
2798
- timeoutId = 0;
2799
- fn(...args);
2800
- }, ms);
2801
- };
2802
- };
2803
-
2804
- /**
2805
- * Check if a possible element isConnected.
2806
- * The property might not be there, so we check for it.
2807
- *
2808
- * We want it to return true if isConnected is not a property,
2809
- * otherwise we would remove these elements and would not update.
2810
- *
2811
- * Better leak in Edge than to be useless.
2812
- */
2813
- const isConnected$1 = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
2814
- const cleanupElements$1 = debounce$1((map) => {
2815
- for (let key of map.keys()) {
2816
- map.set(key, map.get(key).filter(isConnected$1));
2817
- }
2818
- }, 2000);
2819
- const stencilSubscription$1 = () => {
2820
- if (typeof index$1.getRenderingRef !== 'function') {
2821
- // If we are not in a stencil project, we do nothing.
2822
- // This function is not really exported by @stencil/core.
2823
- return {};
2824
- }
2825
- const elmsToUpdate = new Map();
2826
- return {
2827
- dispose: () => elmsToUpdate.clear(),
2828
- get: (propName) => {
2829
- const elm = index$1.getRenderingRef();
2830
- if (elm) {
2831
- appendToMap$1(elmsToUpdate, propName, elm);
2832
- }
2833
- },
2834
- set: (propName) => {
2835
- const elements = elmsToUpdate.get(propName);
2836
- if (elements) {
2837
- elmsToUpdate.set(propName, elements.filter(index$1.forceUpdate));
2838
- }
2839
- cleanupElements$1(elmsToUpdate);
2840
- },
2841
- reset: () => {
2842
- elmsToUpdate.forEach((elms) => elms.forEach(index$1.forceUpdate));
2843
- cleanupElements$1(elmsToUpdate);
2844
- },
2845
- };
2846
- };
2847
-
2848
- const unwrap$1 = (val) => (typeof val === 'function' ? val() : val);
2849
- const createObservableMap$1 = (defaultState, shouldUpdate = (a, b) => a !== b) => {
2850
- const unwrappedState = unwrap$1(defaultState);
2851
- let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
2852
- const handlers = {
2853
- dispose: [],
2854
- get: [],
2855
- set: [],
2856
- reset: [],
2857
- };
2858
- const reset = () => {
2859
- var _a;
2860
- // When resetting the state, the default state may be a function - unwrap it to invoke it.
2861
- // otherwise, the state won't be properly reset
2862
- states = new Map(Object.entries((_a = unwrap$1(defaultState)) !== null && _a !== void 0 ? _a : {}));
2863
- handlers.reset.forEach((cb) => cb());
2864
- };
2865
- const dispose = () => {
2866
- // Call first dispose as resetting the state would
2867
- // cause less updates ;)
2868
- handlers.dispose.forEach((cb) => cb());
2869
- reset();
2870
- };
2871
- const get = (propName) => {
2872
- handlers.get.forEach((cb) => cb(propName));
2873
- return states.get(propName);
2874
- };
2875
- const set = (propName, value) => {
2876
- const oldValue = states.get(propName);
2877
- if (shouldUpdate(value, oldValue, propName)) {
2878
- states.set(propName, value);
2879
- handlers.set.forEach((cb) => cb(propName, value, oldValue));
2880
- }
2881
- };
2882
- const state = (typeof Proxy === 'undefined'
2883
- ? {}
2884
- : new Proxy(unwrappedState, {
2885
- get(_, propName) {
2886
- return get(propName);
2887
- },
2888
- ownKeys(_) {
2889
- return Array.from(states.keys());
2890
- },
2891
- getOwnPropertyDescriptor() {
2892
- return {
2893
- enumerable: true,
2894
- configurable: true,
2895
- };
2896
- },
2897
- has(_, propName) {
2898
- return states.has(propName);
2899
- },
2900
- set(_, propName, value) {
2901
- set(propName, value);
2902
- return true;
2903
- },
2904
- }));
2905
- const on = (eventName, callback) => {
2906
- handlers[eventName].push(callback);
2907
- return () => {
2908
- removeFromArray$1(handlers[eventName], callback);
2909
- };
2910
- };
2911
- const onChange = (propName, cb) => {
2912
- const unSet = on('set', (key, newValue) => {
2913
- if (key === propName) {
2914
- cb(newValue);
2915
- }
2916
- });
2917
- // We need to unwrap the defaultState because it might be a function.
2918
- // Otherwise we might not be sending the right reset value.
2919
- const unReset = on('reset', () => cb(unwrap$1(defaultState)[propName]));
2920
- return () => {
2921
- unSet();
2922
- unReset();
2923
- };
2924
- };
2925
- const use = (...subscriptions) => {
2926
- const unsubs = subscriptions.reduce((unsubs, subscription) => {
2927
- if (subscription.set) {
2928
- unsubs.push(on('set', subscription.set));
2929
- }
2930
- if (subscription.get) {
2931
- unsubs.push(on('get', subscription.get));
2932
- }
2933
- if (subscription.reset) {
2934
- unsubs.push(on('reset', subscription.reset));
2935
- }
2936
- if (subscription.dispose) {
2937
- unsubs.push(on('dispose', subscription.dispose));
2938
- }
2939
- return unsubs;
2940
- }, []);
2941
- return () => unsubs.forEach((unsub) => unsub());
2942
- };
2943
- const forceUpdate = (key) => {
2944
- const oldValue = states.get(key);
2945
- handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
2946
- };
2947
- return {
2948
- state,
2949
- get,
2950
- set,
2951
- on,
2952
- onChange,
2953
- use,
2954
- dispose,
2955
- reset,
2956
- forceUpdate,
2957
- };
2958
- };
2959
- const removeFromArray$1 = (array, item) => {
2960
- const index = array.indexOf(item);
2961
- if (index >= 0) {
2962
- array[index] = array[array.length - 1];
2963
- array.length--;
2964
- }
2965
- };
2966
-
2967
- const createStore$1 = (defaultState, shouldUpdate) => {
2968
- const map = createObservableMap$1(defaultState, shouldUpdate);
2969
- map.use(stencilSubscription$1());
2970
- return map;
2971
- };
2972
-
2973
- const getIdpUrl = () => prompt('Please enter your Identity Provider URL', 'http://localhost:3000');
2974
-
2975
- const store = createStore$1({
2976
- getIdpUrl,
2977
- isLoggedIn: false,
2978
- webId: '',
2979
- });
2980
-
2981
1
  var __create = Object.create;
2982
2
  var __defProp = Object.defineProperty;
2983
3
  var __defProps = Object.defineProperties;
@@ -5194,14 +2214,14 @@ function subtleMapping(jwk) {
5194
2214
  }
5195
2215
  return { algorithm, keyUsages };
5196
2216
  }
5197
- var parse$1, jwk_to_key_default;
2217
+ var parse, jwk_to_key_default;
5198
2218
  var init_jwk_to_key = __esm({
5199
2219
  "../node_modules/jose/dist/browser/runtime/jwk_to_key.js"() {
5200
2220
  init_env();
5201
2221
  init_webcrypto();
5202
2222
  init_errors();
5203
2223
  init_base64url();
5204
- parse$1 = async (jwk) => {
2224
+ parse = async (jwk) => {
5205
2225
  var _a, _b;
5206
2226
  const { algorithm, keyUsages } = subtleMapping(jwk);
5207
2227
  const rest = [
@@ -5217,7 +2237,7 @@ var init_jwk_to_key = __esm({
5217
2237
  delete keyData.use;
5218
2238
  return webcrypto_default.subtle.importKey("jwk", keyData, ...rest);
5219
2239
  };
5220
- jwk_to_key_default = parse$1;
2240
+ jwk_to_key_default = parse;
5221
2241
  }
5222
2242
  });
5223
2243
 
@@ -28458,7 +25478,7 @@ var BinaryFile = class {
28458
25478
  };
28459
25479
 
28460
25480
  // src/files/BrokenFile.ts
28461
- var BrokenFile$1 = class {
25481
+ var BrokenFile = class {
28462
25482
  constructor(url, status) {
28463
25483
  this.url = url;
28464
25484
  this.status = status;
@@ -28494,7 +25514,7 @@ var FileFetcher = class {
28494
25514
  const blob = yield response.blob();
28495
25515
  return new BinaryFile(url, blob);
28496
25516
  } else {
28497
- return new BrokenFile$1(
25517
+ return new BrokenFile(
28498
25518
  url,
28499
25519
  new HttpStatus(response.status, response.statusText)
28500
25520
  );
@@ -42260,1192 +39280,4 @@ queue-microtask/index.js:
42260
39280
  (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
42261
39281
  */
42262
39282
 
42263
- const createPodOS = () => {
42264
- return new PodOS();
42265
- };
42266
-
42267
- const PosApp = class {
42268
- constructor(hostRef) {
42269
- index$1.registerInstance(this, hostRef);
42270
- this.os = undefined;
42271
- }
42272
- componentWillLoad() {
42273
- this.os = createPodOS();
42274
- this.os.handleIncomingRedirect();
42275
- this.os.trackSession(sessionInfo => {
42276
- store.state.isLoggedIn = sessionInfo.isLoggedIn;
42277
- store.state.webId = sessionInfo.webId;
42278
- });
42279
- }
42280
- async initializeOs(event) {
42281
- event.stopPropagation();
42282
- event.detail(this.os);
42283
- }
42284
- render() {
42285
- return (index$1.h("ion-app", null, index$1.h("slot", null)));
42286
- }
42287
- };
42288
-
42289
- const PosAppBrowser = class {
42290
- constructor(hostRef) {
42291
- index$1.registerInstance(this, hostRef);
42292
- }
42293
- render() {
42294
- return (index$1.h("pos-app", null, index$1.h("ion-header", null, index$1.h("ion-toolbar", null, index$1.h("ion-title", { slot: "start" }, "PodOS"), index$1.h("pos-login", null))), index$1.h("ion-content", null, index$1.h("pos-router", null)), index$1.h("ion-footer", null, index$1.h("ion-toolbar", null, index$1.h("ion-title", null, "PodOS Browser")))));
42295
- }
42296
- };
42297
-
42298
- const PosAppGeneric = class {
42299
- constructor(hostRef) {
42300
- index$1.registerInstance(this, hostRef);
42301
- }
42302
- render() {
42303
- return (index$1.h("ion-grid", null, index$1.h("ion-row", null, index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("ion-card", null, index$1.h("ion-card-header", null, index$1.h("pos-type-badges", null), index$1.h("pos-picture", null), index$1.h("ion-card-title", null, index$1.h("pos-label", null))), index$1.h("ion-card-content", null, index$1.h("pos-description", null)))), index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("pos-literals", null)), index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("pos-relations", null), index$1.h("pos-reverse-relations", null)))));
42304
- }
42305
- };
42306
-
42307
- function subscribeResource(component) {
42308
- component.subscribeResource.emit(component.receiveResource);
42309
- }
42310
-
42311
- const PosAppImageViewer = class {
42312
- constructor(hostRef) {
42313
- index$1.registerInstance(this, hostRef);
42314
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
42315
- this.receiveResource = (resource) => {
42316
- this.resource = resource;
42317
- };
42318
- this.resource = undefined;
42319
- }
42320
- componentWillLoad() {
42321
- subscribeResource(this);
42322
- }
42323
- render() {
42324
- if (!this.resource) {
42325
- return null;
42326
- }
42327
- return (index$1.h("ion-grid", null, index$1.h("ion-row", null, index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("pos-image", { src: this.resource.uri })), index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("ion-card", null, index$1.h("ion-card-header", null, index$1.h("ion-card-title", null, index$1.h("pos-label", null), index$1.h("pos-type-badges", null)), index$1.h("pos-literals", null)))))));
42328
- }
42329
- };
42330
- PosAppImageViewer.style = "pos-image {\n --max-width: 100%;\n }";
42331
-
42332
- const PosAppPdfViewer = class {
42333
- constructor(hostRef) {
42334
- index$1.registerInstance(this, hostRef);
42335
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
42336
- this.receiveResource = (resource) => {
42337
- this.resource = resource;
42338
- };
42339
- this.resource = undefined;
42340
- }
42341
- componentWillLoad() {
42342
- subscribeResource(this);
42343
- }
42344
- render() {
42345
- if (!this.resource) {
42346
- return null;
42347
- }
42348
- return (index$1.h("ion-grid", null, index$1.h("ion-row", null, index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("pos-pdf", { src: this.resource.uri })), index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("ion-card", null, index$1.h("ion-card-header", null, index$1.h("ion-card-title", null, index$1.h("pos-label", null), index$1.h("pos-type-badges", null)), index$1.h("pos-literals", null)))))));
42349
- }
42350
- };
42351
-
42352
- const PosAppRdfDocument = class {
42353
- constructor(hostRef) {
42354
- index$1.registerInstance(this, hostRef);
42355
- }
42356
- render() {
42357
- return (index$1.h("ion-grid", null, index$1.h("ion-row", null, index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("pos-subjects", null)), index$1.h("ion-col", { size: "12", "size-sm": true }, index$1.h("ion-card", null, index$1.h("ion-card-header", null, index$1.h("ion-card-title", null, index$1.h("pos-label", null), index$1.h("pos-type-badges", null)), index$1.h("pos-literals", null)))))));
42358
- }
42359
- };
42360
-
42361
- const PosDescription = class {
42362
- constructor(hostRef) {
42363
- index$1.registerInstance(this, hostRef);
42364
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
42365
- this.receiveResource = (resource) => {
42366
- this.resource = resource;
42367
- };
42368
- this.resource = undefined;
42369
- }
42370
- componentWillLoad() {
42371
- subscribeResource(this);
42372
- }
42373
- render() {
42374
- return this.resource ? this.resource.description() : null;
42375
- }
42376
- };
42377
-
42378
- const BrokenFile = ({ file }) => {
42379
- const iconName = iconForStatus(file.status);
42380
- return (index$1.h("div", null,
42381
- index$1.h("a", { class: "error", href: file.url },
42382
- index$1.h("div", null,
42383
- index$1.h("ion-icon", { name: iconName })),
42384
- index$1.h("div", { class: "code" }, file.status.code),
42385
- index$1.h("div", { class: "text" }, file.status.text))));
42386
- };
42387
- function iconForStatus(status) {
42388
- switch (status.code) {
42389
- case 401:
42390
- case 403:
42391
- return 'lock-closed-outline';
42392
- case 404:
42393
- return 'help-circle-outline';
42394
- default:
42395
- return 'alert-circle-outline';
42396
- }
42397
- }
42398
-
42399
- const posImageCss = ":host{}img,ion-skeleton-text,div.error{border-radius:var(--border-radius);width:var(--width);height:var(--height);max-width:var(--max-width);max-height:var(--max-height)}.error{display:flex;opacity:0.8;background:repeating-linear-gradient( -45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px );flex-direction:column;border:1px solid red;color:black;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}.error ion-icon{color:#282828;--ionicon-stroke-width:calc(var(--width) / 5);font-size:calc(var(--width) / 2)}a{text-decoration:none;width:var(--width);height:var(--height)}.code{font-weight:bold;font-size:calc(var(--width) / 8)}.text{font-size:calc(var(--width) / 20)}";
42400
-
42401
- const PosImage = class {
42402
- constructor(hostRef) {
42403
- index$1.registerInstance(this, hostRef);
42404
- this.initializeOsEmitter = index$1.createEvent(this, "pod-os:init", 7);
42405
- this.setOs = async (os) => {
42406
- this.os = os;
42407
- };
42408
- this.src = undefined;
42409
- this.alt = undefined;
42410
- this.os = undefined;
42411
- this.dataUri = undefined;
42412
- this.brokenFile = undefined;
42413
- this.error = undefined;
42414
- this.loading = true;
42415
- }
42416
- componentWillLoad() {
42417
- store.onChange('isLoggedIn', () => this.fetchBlob());
42418
- this.initializeOsEmitter.emit(this.setOs);
42419
- }
42420
- async fetchBlob() {
42421
- try {
42422
- this.loading = true;
42423
- const file = await this.os.fetchFile(this.src);
42424
- if (file.blob()) {
42425
- this.dataUri = URL.createObjectURL(file.blob());
42426
- this.error = null;
42427
- }
42428
- else {
42429
- this.brokenFile = file;
42430
- }
42431
- }
42432
- catch (err) {
42433
- this.error = err;
42434
- }
42435
- finally {
42436
- this.loading = false;
42437
- }
42438
- }
42439
- render() {
42440
- if (this.loading) {
42441
- return index$1.h("ion-skeleton-text", { animated: true });
42442
- }
42443
- if (this.error) {
42444
- return index$1.h("div", { class: "error" }, this.error.message);
42445
- }
42446
- if (this.brokenFile) {
42447
- return index$1.h(BrokenFile, { file: this.brokenFile });
42448
- }
42449
- return index$1.h("img", { src: this.dataUri, alt: this.alt });
42450
- }
42451
- static get watchers() { return {
42452
- "os": ["fetchBlob"],
42453
- "src": ["fetchBlob"]
42454
- }; }
42455
- };
42456
- PosImage.style = posImageCss;
42457
-
42458
- const PosLabel = class {
42459
- constructor(hostRef) {
42460
- index$1.registerInstance(this, hostRef);
42461
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
42462
- this.receiveResource = (resource) => {
42463
- this.resource = resource;
42464
- };
42465
- this.resource = undefined;
42466
- }
42467
- componentWillLoad() {
42468
- subscribeResource(this);
42469
- }
42470
- render() {
42471
- return this.resource ? this.resource.label() : null;
42472
- }
42473
- };
42474
-
42475
- const PosLiterals = class {
42476
- constructor(hostRef) {
42477
- index$1.registerInstance(this, hostRef);
42478
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
42479
- this.receiveResource = (resource) => {
42480
- this.data = resource.literals();
42481
- };
42482
- this.data = [];
42483
- }
42484
- componentWillLoad() {
42485
- subscribeResource(this);
42486
- }
42487
- render() {
42488
- const items = this.data.map(it => (index$1.h("ion-item-group", null, index$1.h("ion-item-divider", null, index$1.h("ion-label", null, it.predicate)), it.values.map(value => (index$1.h("ion-item", null, index$1.h("ion-label", { class: "ion-text-wrap" }, value), ' '))))));
42489
- return this.data.length > 0 ? index$1.h("ion-list", null, items) : null;
42490
- }
42491
- };
42492
-
42493
- const posLoginCss = ":host{display:flex;gap:10px}.user-data{align-items:center;display:inline-flex;gap:10px}.user-data pos-picture{--width:40px;--height:40px;--border-radius:50%}";
42494
-
42495
- const PosLogin = class {
42496
- constructor(hostRef) {
42497
- index$1.registerInstance(this, hostRef);
42498
- this.initializeOsEmitter = index$1.createEvent(this, "pod-os:init", 7);
42499
- this.setOs = async (os) => {
42500
- this.os = os;
42501
- };
42502
- this.os = undefined;
42503
- }
42504
- componentWillLoad() {
42505
- this.initializeOsEmitter.emit(this.setOs);
42506
- }
42507
- login() {
42508
- const idp = store.state.getIdpUrl();
42509
- this.os.login(idp);
42510
- }
42511
- logout() {
42512
- this.os.logout();
42513
- }
42514
- render() {
42515
- return (index$1.h(index$1.Host, null, store.state.isLoggedIn ? (index$1.h("pos-resource", { uri: store.state.webId }, index$1.h("span", { class: "user-data" }, index$1.h("pos-picture", null), index$1.h("pos-label", null)))) : (''), !store.state.isLoggedIn && index$1.h("ion-button", { onClick: () => this.login() }, "Login"), store.state.isLoggedIn && index$1.h("ion-button", { onClick: () => this.logout() }, "Logout")));
42516
- }
42517
- };
42518
- PosLogin.style = posLoginCss;
42519
-
42520
- const PosNavigationBar = class {
42521
- constructor(hostRef) {
42522
- index$1.registerInstance(this, hostRef);
42523
- this.linkEmitter = index$1.createEvent(this, "pod-os:link", 7);
42524
- this.uri = '';
42525
- this.value = this.uri;
42526
- }
42527
- onChange(event) {
42528
- this.value = event.detail.value;
42529
- }
42530
- onSubmit(event) {
42531
- event.preventDefault();
42532
- this.linkEmitter.emit(this.value);
42533
- }
42534
- render() {
42535
- return (index$1.h("form", { onSubmit: e => this.onSubmit(e) }, index$1.h("ion-searchbar", { enterkeyhint: "search", placeholder: "Enter URI", value: this.uri, debounce: 0, onIonChange: e => this.onChange(e) })));
42536
- }
42537
- };
42538
-
42539
- const posPdfCss = "iframe{width:100%;height:100vh}.error{display:flex;opacity:0.8;background:repeating-linear-gradient( -45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px );flex-direction:column;border:1px solid red;color:black;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}.error ion-icon{color:#282828;--ionicon-stroke-width:calc(var(--width) / 5);font-size:calc(var(--width) / 2)}a{text-decoration:none;width:var(--width);height:var(--height)}.code{font-weight:bold;font-size:calc(var(--width) / 8)}.text{font-size:calc(var(--width) / 20)}";
42540
-
42541
- const PosPdf = class {
42542
- constructor(hostRef) {
42543
- index$1.registerInstance(this, hostRef);
42544
- this.initializeOsEmitter = index$1.createEvent(this, "pod-os:init", 7);
42545
- this.setOs = async (os) => {
42546
- this.os = os;
42547
- };
42548
- this.src = undefined;
42549
- this.alt = undefined;
42550
- this.os = undefined;
42551
- this.dataUri = undefined;
42552
- this.brokenFile = undefined;
42553
- this.error = undefined;
42554
- this.loading = true;
42555
- }
42556
- componentWillLoad() {
42557
- store.onChange('isLoggedIn', () => this.fetchBlob());
42558
- this.initializeOsEmitter.emit(this.setOs);
42559
- }
42560
- async fetchBlob() {
42561
- try {
42562
- this.loading = true;
42563
- const file = await this.os.fetchFile(this.src);
42564
- if (file.blob()) {
42565
- this.dataUri = URL.createObjectURL(file.blob());
42566
- this.error = null;
42567
- }
42568
- else {
42569
- this.brokenFile = file;
42570
- }
42571
- }
42572
- catch (err) {
42573
- this.error = err;
42574
- }
42575
- finally {
42576
- this.loading = false;
42577
- }
42578
- }
42579
- render() {
42580
- if (this.loading) {
42581
- return index$1.h("ion-skeleton-text", { animated: true });
42582
- }
42583
- if (this.error) {
42584
- return index$1.h("div", { class: "error" }, this.error.message);
42585
- }
42586
- if (this.brokenFile) {
42587
- return index$1.h(BrokenFile, { file: this.brokenFile });
42588
- }
42589
- return index$1.h("iframe", { src: this.dataUri });
42590
- }
42591
- static get watchers() { return {
42592
- "os": ["fetchBlob"],
42593
- "src": ["fetchBlob"]
42594
- }; }
42595
- };
42596
- PosPdf.style = posPdfCss;
42597
-
42598
- const posPictureCss = ":host{--width:300px;--height:300px;--border-radius:var(--border-radius, 0)}";
42599
-
42600
- const PosPicture = class {
42601
- constructor(hostRef) {
42602
- index$1.registerInstance(this, hostRef);
42603
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
42604
- this.receiveResource = (resource) => {
42605
- this.resource = resource;
42606
- };
42607
- this.resource = undefined;
42608
- }
42609
- componentWillLoad() {
42610
- subscribeResource(this);
42611
- }
42612
- render() {
42613
- const pic = this.resource ? this.resource.picture() : null;
42614
- if (!pic)
42615
- return null;
42616
- return index$1.h("pos-image", { src: pic.url, alt: this.resource.label() });
42617
- }
42618
- };
42619
- PosPicture.style = posPictureCss;
42620
-
42621
- const PosRelations = class {
42622
- constructor(hostRef) {
42623
- index$1.registerInstance(this, hostRef);
42624
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
42625
- this.receiveResource = (resource) => {
42626
- this.data = resource.relations();
42627
- };
42628
- this.data = [];
42629
- }
42630
- componentWillLoad() {
42631
- subscribeResource(this);
42632
- }
42633
- render() {
42634
- const items = this.data.map(it => (index$1.h("ion-item-group", null, index$1.h("ion-item-divider", null, index$1.h("ion-label", null, it.predicate)), it.uris.map(uri => (index$1.h("pos-rich-link", { uri: uri }))))));
42635
- return this.data.length > 0 ? index$1.h("ion-list", null, items) : null;
42636
- }
42637
- };
42638
-
42639
- const PosResource = class {
42640
- constructor(hostRef) {
42641
- index$1.registerInstance(this, hostRef);
42642
- this.initializeOsEmitter = index$1.createEvent(this, "pod-os:init", 7);
42643
- this.setOs = async (os) => {
42644
- this.os = os;
42645
- };
42646
- this.os = undefined;
42647
- this.resource = undefined;
42648
- this.consumers = [];
42649
- this.uri = undefined;
42650
- this.lazy = false;
42651
- this.error = undefined;
42652
- this.loading = true;
42653
- }
42654
- componentWillLoad() {
42655
- store.onChange('isLoggedIn', () => this.loadResource());
42656
- this.initializeOsEmitter.emit(this.setOs);
42657
- }
42658
- async provideResource(event) {
42659
- event.stopPropagation();
42660
- if (this.resource) {
42661
- event.detail(this.resource);
42662
- }
42663
- this.consumers.push(event);
42664
- }
42665
- async loadResource() {
42666
- await this.getResource(!this.lazy);
42667
- }
42668
- async fetch() {
42669
- await this.getResource(true);
42670
- }
42671
- async getResource(fetch = false) {
42672
- try {
42673
- if (fetch) {
42674
- this.loading = true;
42675
- await this.os.fetch(this.uri);
42676
- }
42677
- this.resource = this.os.store.get(this.uri);
42678
- this.error = null;
42679
- this.consumers.forEach(consumer => {
42680
- consumer.detail(this.resource);
42681
- });
42682
- }
42683
- catch (err) {
42684
- this.error = err;
42685
- }
42686
- finally {
42687
- this.loading = false;
42688
- }
42689
- }
42690
- render() {
42691
- if (this.loading) {
42692
- return index$1.h("ion-progress-bar", { type: "indeterminate" });
42693
- }
42694
- if (this.error) {
42695
- return (index$1.h("ion-card", null, index$1.h("ion-card-header", null, index$1.h("p", null, "Sorry, something went wrong"), index$1.h("p", null, "Status:",
42696
- // @ts-ignore
42697
- this.error.status), index$1.h("details", null, this.error.message)), index$1.h("ion-card-content", null, index$1.h("p", null, "You can try to open the link outside PodOS:"), index$1.h("a", { href: this.uri }, this.uri))));
42698
- }
42699
- return index$1.h("slot", null);
42700
- }
42701
- static get watchers() { return {
42702
- "os": ["loadResource"],
42703
- "uri": ["loadResource"]
42704
- }; }
42705
- };
42706
-
42707
- const PosReverseRelations = class {
42708
- constructor(hostRef) {
42709
- index$1.registerInstance(this, hostRef);
42710
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
42711
- this.receiveResource = (resource) => {
42712
- this.data = resource.reverseRelations();
42713
- };
42714
- this.data = [];
42715
- }
42716
- componentWillLoad() {
42717
- subscribeResource(this);
42718
- }
42719
- render() {
42720
- const items = this.data.map(it => (index$1.h("ion-item-group", null, index$1.h("ion-item-divider", null, index$1.h("ion-label", null, "is ", it.predicate, " of")), it.uris.map(uri => (index$1.h("pos-rich-link", { uri: uri }))))));
42721
- return this.data.length > 0 ? index$1.h("ion-list", null, items) : null;
42722
- }
42723
- };
42724
-
42725
- const PosRichLink = class {
42726
- constructor(hostRef) {
42727
- index$1.registerInstance(this, hostRef);
42728
- this.linkEmitter = index$1.createEvent(this, "pod-os:link", 7);
42729
- this.uri = undefined;
42730
- }
42731
- render() {
42732
- return (index$1.h("pos-resource", { lazy: true, uri: this.uri }, index$1.h("ion-item", { href: this.uri, onClick: e => {
42733
- e.preventDefault();
42734
- this.linkEmitter.emit(this.uri);
42735
- } }, index$1.h("ion-label", null, index$1.h("pos-label", null), index$1.h("p", null, index$1.h("ion-label", { style: { maxWidth: '50rem' } }, index$1.h("pos-description", null))), index$1.h("p", null, index$1.h("a", { href: this.uri }, this.uri))))));
42736
- }
42737
- };
42738
-
42739
- const appendToMap = (map, propName, value) => {
42740
- const items = map.get(propName);
42741
- if (!items) {
42742
- map.set(propName, [value]);
42743
- }
42744
- else if (!items.includes(value)) {
42745
- items.push(value);
42746
- }
42747
- };
42748
- const debounce = (fn, ms) => {
42749
- let timeoutId;
42750
- return (...args) => {
42751
- if (timeoutId) {
42752
- clearTimeout(timeoutId);
42753
- }
42754
- timeoutId = setTimeout(() => {
42755
- timeoutId = 0;
42756
- fn(...args);
42757
- }, ms);
42758
- };
42759
- };
42760
-
42761
- /**
42762
- * Check if a possible element isConnected.
42763
- * The property might not be there, so we check for it.
42764
- *
42765
- * We want it to return true if isConnected is not a property,
42766
- * otherwise we would remove these elements and would not update.
42767
- *
42768
- * Better leak in Edge than to be useless.
42769
- */
42770
- const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
42771
- const cleanupElements = debounce((map) => {
42772
- for (let key of map.keys()) {
42773
- map.set(key, map.get(key).filter(isConnected));
42774
- }
42775
- }, 2000);
42776
- const stencilSubscription = () => {
42777
- if (typeof index$1.getRenderingRef !== 'function') {
42778
- // If we are not in a stencil project, we do nothing.
42779
- // This function is not really exported by @stencil/core.
42780
- return {};
42781
- }
42782
- const elmsToUpdate = new Map();
42783
- return {
42784
- dispose: () => elmsToUpdate.clear(),
42785
- get: (propName) => {
42786
- const elm = index$1.getRenderingRef();
42787
- if (elm) {
42788
- appendToMap(elmsToUpdate, propName, elm);
42789
- }
42790
- },
42791
- set: (propName) => {
42792
- const elements = elmsToUpdate.get(propName);
42793
- if (elements) {
42794
- elmsToUpdate.set(propName, elements.filter(index$1.forceUpdate));
42795
- }
42796
- cleanupElements(elmsToUpdate);
42797
- },
42798
- reset: () => {
42799
- elmsToUpdate.forEach((elms) => elms.forEach(index$1.forceUpdate));
42800
- cleanupElements(elmsToUpdate);
42801
- },
42802
- };
42803
- };
42804
-
42805
- const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
42806
- let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
42807
- const handlers = {
42808
- dispose: [],
42809
- get: [],
42810
- set: [],
42811
- reset: [],
42812
- };
42813
- const reset = () => {
42814
- states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
42815
- handlers.reset.forEach((cb) => cb());
42816
- };
42817
- const dispose = () => {
42818
- // Call first dispose as resetting the state would
42819
- // cause less updates ;)
42820
- handlers.dispose.forEach((cb) => cb());
42821
- reset();
42822
- };
42823
- const get = (propName) => {
42824
- handlers.get.forEach((cb) => cb(propName));
42825
- return states.get(propName);
42826
- };
42827
- const set = (propName, value) => {
42828
- const oldValue = states.get(propName);
42829
- if (shouldUpdate(value, oldValue, propName)) {
42830
- states.set(propName, value);
42831
- handlers.set.forEach((cb) => cb(propName, value, oldValue));
42832
- }
42833
- };
42834
- const state = (typeof Proxy === 'undefined'
42835
- ? {}
42836
- : new Proxy(defaultState, {
42837
- get(_, propName) {
42838
- return get(propName);
42839
- },
42840
- ownKeys(_) {
42841
- return Array.from(states.keys());
42842
- },
42843
- getOwnPropertyDescriptor() {
42844
- return {
42845
- enumerable: true,
42846
- configurable: true,
42847
- };
42848
- },
42849
- has(_, propName) {
42850
- return states.has(propName);
42851
- },
42852
- set(_, propName, value) {
42853
- set(propName, value);
42854
- return true;
42855
- },
42856
- }));
42857
- const on = (eventName, callback) => {
42858
- handlers[eventName].push(callback);
42859
- return () => {
42860
- removeFromArray(handlers[eventName], callback);
42861
- };
42862
- };
42863
- const onChange = (propName, cb) => {
42864
- const unSet = on('set', (key, newValue) => {
42865
- if (key === propName) {
42866
- cb(newValue);
42867
- }
42868
- });
42869
- const unReset = on('reset', () => cb(defaultState[propName]));
42870
- return () => {
42871
- unSet();
42872
- unReset();
42873
- };
42874
- };
42875
- const use = (...subscriptions) => {
42876
- const unsubs = subscriptions.reduce((unsubs, subscription) => {
42877
- if (subscription.set) {
42878
- unsubs.push(on('set', subscription.set));
42879
- }
42880
- if (subscription.get) {
42881
- unsubs.push(on('get', subscription.get));
42882
- }
42883
- if (subscription.reset) {
42884
- unsubs.push(on('reset', subscription.reset));
42885
- }
42886
- if (subscription.dispose) {
42887
- unsubs.push(on('dispose', subscription.dispose));
42888
- }
42889
- return unsubs;
42890
- }, []);
42891
- return () => unsubs.forEach((unsub) => unsub());
42892
- };
42893
- const forceUpdate = (key) => {
42894
- const oldValue = states.get(key);
42895
- handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
42896
- };
42897
- return {
42898
- state,
42899
- get,
42900
- set,
42901
- on,
42902
- onChange,
42903
- use,
42904
- dispose,
42905
- reset,
42906
- forceUpdate,
42907
- };
42908
- };
42909
- const removeFromArray = (array, item) => {
42910
- const index = array.indexOf(item);
42911
- if (index >= 0) {
42912
- array[index] = array[array.length - 1];
42913
- array.length--;
42914
- }
42915
- };
42916
-
42917
- const createStore = (defaultState, shouldUpdate) => {
42918
- const map = createObservableMap(defaultState, shouldUpdate);
42919
- map.use(stencilSubscription());
42920
- return map;
42921
- };
42922
-
42923
- const createRouter = (opts) => {
42924
- var _a;
42925
- const win = window;
42926
- const url = new URL(win.location.href);
42927
- const parseURL = (_a = opts === null || opts === void 0 ? void 0 : opts.parseURL) !== null && _a !== void 0 ? _a : DEFAULT_PARSE_URL;
42928
- const { state, onChange, dispose } = createStore({
42929
- url,
42930
- activePath: parseURL(url)
42931
- }, (newV, oldV, prop) => {
42932
- if (prop === 'url') {
42933
- return newV.href !== oldV.href;
42934
- }
42935
- return newV !== oldV;
42936
- });
42937
- const push = (href) => {
42938
- history.pushState(null, null, href);
42939
- const url = new URL(href, document.baseURI);
42940
- state.url = url;
42941
- state.activePath = parseURL(url);
42942
- };
42943
- const match = (routes) => {
42944
- const { activePath } = state;
42945
- for (let route of routes) {
42946
- const params = matchPath(activePath, route.path);
42947
- if (params) {
42948
- if (route.to != null) {
42949
- const to = (typeof route.to === 'string')
42950
- ? route.to
42951
- : route.to(activePath);
42952
- push(to);
42953
- return match(routes);
42954
- }
42955
- else {
42956
- return { params, route };
42957
- }
42958
- }
42959
- }
42960
- return undefined;
42961
- };
42962
- const navigationChanged = () => {
42963
- const url = new URL(win.location.href);
42964
- state.url = url;
42965
- state.activePath = parseURL(url);
42966
- };
42967
- const Switch = (_, childrenRoutes) => {
42968
- const result = match(childrenRoutes);
42969
- if (result) {
42970
- if (typeof result.route.jsx === 'function') {
42971
- return result.route.jsx(result.params);
42972
- }
42973
- else {
42974
- return result.route.jsx;
42975
- }
42976
- }
42977
- };
42978
- const disposeRouter = () => {
42979
- win.removeEventListener('popstate', navigationChanged);
42980
- dispose();
42981
- };
42982
- const router = {
42983
- Switch,
42984
- get url() {
42985
- return state.url;
42986
- },
42987
- get activePath() {
42988
- return state.activePath;
42989
- },
42990
- push,
42991
- onChange: onChange,
42992
- dispose: disposeRouter,
42993
- };
42994
- // Initial update
42995
- navigationChanged();
42996
- // Listen URL changes
42997
- win.addEventListener('popstate', navigationChanged);
42998
- return router;
42999
- };
43000
- const Route = (props, children) => {
43001
- var _a;
43002
- if ('to' in props) {
43003
- return {
43004
- path: props.path,
43005
- to: props.to,
43006
- };
43007
- }
43008
- return {
43009
- path: props.path,
43010
- id: props.id,
43011
- jsx: (_a = props.render) !== null && _a !== void 0 ? _a : children,
43012
- };
43013
- };
43014
- const matchPath = (pathname, path) => {
43015
- if (typeof path === 'string') {
43016
- if (path === pathname) {
43017
- return {};
43018
- }
43019
- }
43020
- else if (typeof path === 'function') {
43021
- const params = path(pathname);
43022
- if (params) {
43023
- return params === true
43024
- ? {}
43025
- : { ...params };
43026
- }
43027
- }
43028
- else {
43029
- const results = path.exec(pathname);
43030
- if (results) {
43031
- path.lastIndex = 0;
43032
- return { ...results };
43033
- }
43034
- }
43035
- return undefined;
43036
- };
43037
- const DEFAULT_PARSE_URL = (url) => {
43038
- return url.pathname.toLowerCase();
43039
- };
43040
-
43041
- /**
43042
- * TS adaption of https://github.com/pillarjs/path-to-regexp/blob/master/index.js
43043
- */
43044
- /**
43045
- * Default configs.
43046
- */
43047
- const DEFAULT_DELIMITER = '/';
43048
- const DEFAULT_DELIMITERS = './';
43049
- /**
43050
- * The main path matching regexp utility.
43051
- */
43052
- const PATH_REGEXP = new RegExp([
43053
- // Match escaped characters that would otherwise appear in future matches.
43054
- // This allows the user to escape special characters that won't transform.
43055
- '(\\\\.)',
43056
- // Match Express-style parameters and un-named parameters with a prefix
43057
- // and optional suffixes. Matches appear as:
43058
- //
43059
- // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?"]
43060
- // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined]
43061
- '(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?'
43062
- ].join('|'), 'g');
43063
- /**
43064
- * Parse a string for the raw tokens.
43065
- */
43066
- const parse = (str, options) => {
43067
- var tokens = [];
43068
- var key = 0;
43069
- var index = 0;
43070
- var path = '';
43071
- var defaultDelimiter = (options && options.delimiter) || DEFAULT_DELIMITER;
43072
- var delimiters = (options && options.delimiters) || DEFAULT_DELIMITERS;
43073
- var pathEscaped = false;
43074
- var res;
43075
- while ((res = PATH_REGEXP.exec(str)) !== null) {
43076
- var m = res[0];
43077
- var escaped = res[1];
43078
- var offset = res.index;
43079
- path += str.slice(index, offset);
43080
- index = offset + m.length;
43081
- // Ignore already escaped sequences.
43082
- if (escaped) {
43083
- path += escaped[1];
43084
- pathEscaped = true;
43085
- continue;
43086
- }
43087
- var prev = '';
43088
- var next = str[index];
43089
- var name = res[2];
43090
- var capture = res[3];
43091
- var group = res[4];
43092
- var modifier = res[5];
43093
- if (!pathEscaped && path.length) {
43094
- var k = path.length - 1;
43095
- if (delimiters.indexOf(path[k]) > -1) {
43096
- prev = path[k];
43097
- path = path.slice(0, k);
43098
- }
43099
- }
43100
- // Push the current path onto the tokens.
43101
- if (path) {
43102
- tokens.push(path);
43103
- path = '';
43104
- pathEscaped = false;
43105
- }
43106
- var partial = prev !== '' && next !== undefined && next !== prev;
43107
- var repeat = modifier === '+' || modifier === '*';
43108
- var optional = modifier === '?' || modifier === '*';
43109
- var delimiter = prev || defaultDelimiter;
43110
- var pattern = capture || group;
43111
- tokens.push({
43112
- name: name || key++,
43113
- prefix: prev,
43114
- delimiter: delimiter,
43115
- optional: optional,
43116
- repeat: repeat,
43117
- partial: partial,
43118
- pattern: pattern ? escapeGroup(pattern) : '[^' + escapeString(delimiter) + ']+?'
43119
- });
43120
- }
43121
- // Push any remaining characters.
43122
- if (path || index < str.length) {
43123
- tokens.push(path + str.substr(index));
43124
- }
43125
- return tokens;
43126
- };
43127
- /**
43128
- * Escape a regular expression string.
43129
- */
43130
- const escapeString = (str) => {
43131
- return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, '\\$1');
43132
- };
43133
- /**
43134
- * Escape the capturing group by escaping special characters and meaning.
43135
- */
43136
- const escapeGroup = (group) => {
43137
- return group.replace(/([=!:$/()])/g, '\\$1');
43138
- };
43139
- /**
43140
- * Get the flags for a regexp from the options.
43141
- */
43142
- const flags = (options) => {
43143
- return options && options.sensitive ? '' : 'i';
43144
- };
43145
- /**
43146
- * Pull out keys from a regexp.
43147
- */
43148
- const regexpToRegexp = (path, keys) => {
43149
- if (!keys)
43150
- return path;
43151
- // Use a negative lookahead to match only capturing groups.
43152
- var groups = path.source.match(/\((?!\?)/g);
43153
- if (groups) {
43154
- for (var i = 0; i < groups.length; i++) {
43155
- keys.push({
43156
- name: i,
43157
- prefix: null,
43158
- delimiter: null,
43159
- optional: false,
43160
- repeat: false,
43161
- partial: false,
43162
- pattern: null
43163
- });
43164
- }
43165
- }
43166
- return path;
43167
- };
43168
- /**
43169
- * Transform an array into a regexp.
43170
- */
43171
- const arrayToRegexp = (path, keys, options) => {
43172
- var parts = [];
43173
- for (var i = 0; i < path.length; i++) {
43174
- parts.push(pathToRegexp(path[i], keys, options).source);
43175
- }
43176
- return new RegExp('(?:' + parts.join('|') + ')', flags(options));
43177
- };
43178
- /**
43179
- * Create a path regexp from string input.
43180
- */
43181
- const stringToRegexp = (path, keys, options) => {
43182
- return tokensToRegExp(parse(path, options), keys, options);
43183
- };
43184
- /**
43185
- * Expose a function for taking tokens and returning a RegExp.
43186
- */
43187
- const tokensToRegExp = (tokens, keys, options) => {
43188
- options = options || {};
43189
- var strict = options.strict;
43190
- var end = options.end !== false;
43191
- var delimiter = escapeString(options.delimiter || DEFAULT_DELIMITER);
43192
- var delimiters = options.delimiters || DEFAULT_DELIMITERS;
43193
- var endsWith = [].concat(options.endsWith || []).map(escapeString).concat('$').join('|');
43194
- var route = '';
43195
- var isEndDelimited = false;
43196
- // Iterate over the tokens and create our regexp string.
43197
- for (var i = 0; i < tokens.length; i++) {
43198
- var token = tokens[i];
43199
- if (typeof token === 'string') {
43200
- route += escapeString(token);
43201
- isEndDelimited = i === tokens.length - 1 && delimiters.indexOf(token[token.length - 1]) > -1;
43202
- }
43203
- else {
43204
- var prefix = escapeString(token.prefix || '');
43205
- var capture = token.repeat
43206
- ? '(?:' + token.pattern + ')(?:' + prefix + '(?:' + token.pattern + '))*'
43207
- : token.pattern;
43208
- if (keys)
43209
- keys.push(token);
43210
- if (token.optional) {
43211
- if (token.partial) {
43212
- route += prefix + '(' + capture + ')?';
43213
- }
43214
- else {
43215
- route += '(?:' + prefix + '(' + capture + '))?';
43216
- }
43217
- }
43218
- else {
43219
- route += prefix + '(' + capture + ')';
43220
- }
43221
- }
43222
- }
43223
- if (end) {
43224
- if (!strict)
43225
- route += '(?:' + delimiter + ')?';
43226
- route += endsWith === '$' ? '$' : '(?=' + endsWith + ')';
43227
- }
43228
- else {
43229
- if (!strict)
43230
- route += '(?:' + delimiter + '(?=' + endsWith + '))?';
43231
- if (!isEndDelimited)
43232
- route += '(?=' + delimiter + '|' + endsWith + ')';
43233
- }
43234
- return new RegExp('^' + route, flags(options));
43235
- };
43236
- /**
43237
- * Normalize the given path string, returning a regular expression.
43238
- *
43239
- * An empty array can be passed in for the keys, which will hold the
43240
- * placeholder key descriptions. For example, using `/user/:id`, `keys` will
43241
- * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
43242
- */
43243
- const pathToRegexp = (path, keys, options) => {
43244
- if (path instanceof RegExp) {
43245
- return regexpToRegexp(path, keys);
43246
- }
43247
- if (Array.isArray(path)) {
43248
- return arrayToRegexp(path, keys, options);
43249
- }
43250
- return stringToRegexp(path, keys, options);
43251
- };
43252
-
43253
- let cacheCount = 0;
43254
- const patternCache = {};
43255
- const cacheLimit = 10000;
43256
- // Memoized function for creating the path match regex
43257
- const compilePath = (pattern, options) => {
43258
- const cacheKey = `${options.end}${options.strict}`;
43259
- const cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
43260
- const cachePattern = JSON.stringify(pattern);
43261
- if (cache[cachePattern]) {
43262
- return cache[cachePattern];
43263
- }
43264
- const keys = [];
43265
- const re = pathToRegexp(pattern, keys, options);
43266
- const compiledPattern = { re, keys };
43267
- if (cacheCount < cacheLimit) {
43268
- cache[cachePattern] = compiledPattern;
43269
- cacheCount += 1;
43270
- }
43271
- return compiledPattern;
43272
- };
43273
- const match = (pathname, options = {}) => {
43274
- const { exact = false, strict = false } = options;
43275
- const { re, keys } = compilePath(pathname, { end: exact, strict });
43276
- return (path) => {
43277
- const match = re.exec(path);
43278
- if (!match) {
43279
- return undefined;
43280
- }
43281
- const [url, ...values] = match;
43282
- const isExact = path === url;
43283
- if (exact && !isExact) {
43284
- return undefined;
43285
- }
43286
- return keys.reduce((memo, key, index) => {
43287
- memo[key.name] = values[index];
43288
- return memo;
43289
- }, {});
43290
- };
43291
- };
43292
-
43293
- const Router = createRouter();
43294
- const PosRouter = class {
43295
- constructor(hostRef) {
43296
- index$1.registerInstance(this, hostRef);
43297
- this.uri = undefined;
43298
- }
43299
- linkClicked(e) {
43300
- this.navigate(e.detail);
43301
- }
43302
- componentWillLoad() {
43303
- this.updateUri();
43304
- Router.onChange('url', () => {
43305
- this.updateUri();
43306
- });
43307
- }
43308
- navigate(uri) {
43309
- Router.push('?uri=' + encodeURIComponent(uri));
43310
- }
43311
- updateUri() {
43312
- this.uri = new URLSearchParams(window.location.search).get('uri') || window.location.href;
43313
- }
43314
- render() {
43315
- console.log('render router', this.uri);
43316
- return (index$1.h(Router.Switch, null, index$1.h(Route, { path: match('', { exact: false }) }, index$1.h("pos-navigation-bar", { uri: this.uri }), index$1.h("pos-resource", { key: this.uri, uri: this.uri }, index$1.h("pos-type-router", null)))));
43317
- }
43318
- };
43319
-
43320
- const PosSubjects = class {
43321
- constructor(hostRef) {
43322
- index$1.registerInstance(this, hostRef);
43323
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
43324
- this.receiveResource = (resource) => {
43325
- const doc = resource.assume(RdfDocument);
43326
- this.data = doc.subjects();
43327
- };
43328
- this.data = [];
43329
- }
43330
- componentWillLoad() {
43331
- subscribeResource(this);
43332
- }
43333
- render() {
43334
- const items = this.data.map(it => index$1.h("pos-rich-link", { uri: it.uri }));
43335
- return this.data.length > 0 ? index$1.h("ion-list", null, items) : null;
43336
- }
43337
- };
43338
-
43339
- const posTypeBadgesCss = ".types{display:flex;gap:0.25rem;margin:0.5rem 0}.expanded{flex-direction:column;justify-content:flex-start;align-items:flex-start}ion-badge{color:#333;background:#eee}ion-badge.toggle{cursor:pointer}ion-badge.toggle:hover{background:#ddd}";
43340
-
43341
- const PosTypeBadges = class {
43342
- constructor(hostRef) {
43343
- index$1.registerInstance(this, hostRef);
43344
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
43345
- this.receiveResource = (resource) => {
43346
- this.data = resource.types();
43347
- this.typeLabels = [...new Set(resource.types().map(it => it.label))];
43348
- };
43349
- this.data = [];
43350
- this.typeLabels = [];
43351
- this.isExpanded = false;
43352
- }
43353
- componentWillLoad() {
43354
- subscribeResource(this);
43355
- }
43356
- toggleDetails() {
43357
- this.isExpanded = !this.isExpanded;
43358
- }
43359
- render() {
43360
- if (this.data.length == 0) {
43361
- return null;
43362
- }
43363
- if (this.isExpanded) {
43364
- return (index$1.h("div", { class: "types expanded" }, index$1.h("ion-badge", { class: "toggle", onClick: () => this.toggleDetails() }, index$1.h("ion-icon", { name: "contract-outline" })), this.data.map(it => (index$1.h("ion-badge", null, it.uri)))));
43365
- }
43366
- else {
43367
- return (index$1.h(index$1.Host, null, index$1.h("div", { class: "types" }, this.typeLabels.map(it => (index$1.h("ion-badge", null, it))), index$1.h("ion-badge", { class: "toggle", onClick: () => this.toggleDetails() }, index$1.h("ion-icon", { name: "expand-outline" })))));
43368
- }
43369
- }
43370
- };
43371
- PosTypeBadges.style = posTypeBadgesCss;
43372
-
43373
- const PosTypeRouter = class {
43374
- constructor(hostRef) {
43375
- index$1.registerInstance(this, hostRef);
43376
- this.subscribeResource = index$1.createEvent(this, "pod-os:resource", 7);
43377
- this.receiveResource = (resource) => {
43378
- this.types = resource.types();
43379
- };
43380
- this.types = undefined;
43381
- }
43382
- componentWillLoad() {
43383
- subscribeResource(this);
43384
- }
43385
- render() {
43386
- return this.types ? this.renderApp() : null;
43387
- }
43388
- renderApp() {
43389
- if (this.types.some(type => type.uri === 'http://www.w3.org/2007/ont/link#RDFDocument')) {
43390
- return index$1.h("pos-app-rdf-document", null);
43391
- }
43392
- else if (this.types.some(type => type.uri === 'http://www.w3.org/ns/iana/media-types/application/pdf#Resource')) {
43393
- return index$1.h("pos-app-pdf-viewer", null);
43394
- }
43395
- else if (this.types.some(type => type.uri === 'http://purl.org/dc/terms/Image')) {
43396
- return index$1.h("pos-app-image-viewer", null);
43397
- }
43398
- else {
43399
- return index$1.h("pos-app-generic", null);
43400
- }
43401
- }
43402
- };
43403
-
43404
- exports.ion_app = App;
43405
- exports.ion_badge = Badge;
43406
- exports.ion_button = Button;
43407
- exports.ion_card = Card;
43408
- exports.ion_card_content = CardContent;
43409
- exports.ion_card_header = CardHeader;
43410
- exports.ion_card_title = CardTitle;
43411
- exports.ion_col = Col;
43412
- exports.ion_content = Content;
43413
- exports.ion_footer = Footer;
43414
- exports.ion_grid = Grid;
43415
- exports.ion_header = Header;
43416
- exports.ion_icon = Icon;
43417
- exports.ion_item = Item;
43418
- exports.ion_item_divider = ItemDivider;
43419
- exports.ion_item_group = ItemGroup;
43420
- exports.ion_label = Label;
43421
- exports.ion_list = List;
43422
- exports.ion_note = Note;
43423
- exports.ion_progress_bar = ProgressBar;
43424
- exports.ion_ripple_effect = RippleEffect;
43425
- exports.ion_row = Row;
43426
- exports.ion_searchbar = Searchbar;
43427
- exports.ion_skeleton_text = SkeletonText;
43428
- exports.ion_title = ToolbarTitle;
43429
- exports.ion_toolbar = Toolbar;
43430
- exports.pos_app = PosApp;
43431
- exports.pos_app_browser = PosAppBrowser;
43432
- exports.pos_app_generic = PosAppGeneric;
43433
- exports.pos_app_image_viewer = PosAppImageViewer;
43434
- exports.pos_app_pdf_viewer = PosAppPdfViewer;
43435
- exports.pos_app_rdf_document = PosAppRdfDocument;
43436
- exports.pos_description = PosDescription;
43437
- exports.pos_image = PosImage;
43438
- exports.pos_label = PosLabel;
43439
- exports.pos_literals = PosLiterals;
43440
- exports.pos_login = PosLogin;
43441
- exports.pos_navigation_bar = PosNavigationBar;
43442
- exports.pos_pdf = PosPdf;
43443
- exports.pos_picture = PosPicture;
43444
- exports.pos_relations = PosRelations;
43445
- exports.pos_resource = PosResource;
43446
- exports.pos_reverse_relations = PosReverseRelations;
43447
- exports.pos_rich_link = PosRichLink;
43448
- exports.pos_router = PosRouter;
43449
- exports.pos_subjects = PosSubjects;
43450
- exports.pos_type_badges = PosTypeBadges;
43451
- exports.pos_type_router = PosTypeRouter;
39283
+ export { PodOS as P, RdfDocument as R };