{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm-es5/ion-refresher_2-md.entry.js","webpack:///./node_modules/@ionic/core/dist/esm-es5/index-3476b023.js"],"names":["Refresher","class_1","hostRef","this","appliedStyles","didStart","progress","state","pullMin","pullMax","closeDuration","snapbackDuration","pullFactor","disabled","ionRefresh","ionPull","ionStart","prototype","disabledChanged","gesture","setDisabled","connectedCallback","contentEl","_a","_b","_this","_c","label","el","getAttribute","console","error","closest","getScrollElement","scrollEl","sent","createGesture","gestureName","gesturePriority","direction","threshold","passive","canStart","onStart","onMove","ev","onEnd","disconnectedCallback","undefined","destroy","complete","close","cancel","getProgress","Promise","resolve","scrollTop","detail","event","touches","length","Number","isNaN","deltaY","setCss","scrollHostScrollTop","cancelable","preventDefault","emit","beginRefresh","bind","delay","setTimeout","y","duration","overflowVisible","style","transform","transitionDuration","transitionDelay","overflow","render","mode","slot","class","Object","defineProperty","get","enumerable","configurable","RefresherContent","componentWillLoad","pullingIcon","refreshingSpinner","icon","lazy","pullingText","innerHTML","name","refreshingText","sanitizeDOMString","untrustedString","documentFragment_1","document","createDocumentFragment","workingDiv","createElement","appendChild","blockedTags","forEach","blockedTag","getElementsToRemove","querySelectorAll","elementIndex","element","parentNode","removeChild","childElements","getElementChildren","childIndex","sanitizeElement","dfChildren","fragmentDiv","getInnerDiv","querySelector","err","nodeType","i","attributes","attribute","item","attributeName","allowedAttributes","includes","toLowerCase","attributeValue","value","removeAttribute","children","childNodes"],"mappings":"gHAAA,+JAIIA,EAA2B,WAC3B,SAASC,EAAQC,GACb,eAAiBC,KAAMD,GACvBC,KAAKC,eAAgB,EACrBD,KAAKE,UAAW,EAChBF,KAAKG,SAAW,EAWhBH,KAAKI,MAAQ,EAKbJ,KAAKK,QAAU,GAMfL,KAAKM,QAAUN,KAAKK,QAAU,GAI9BL,KAAKO,cAAgB,QAIrBP,KAAKQ,iBAAmB,QAYxBR,KAAKS,WAAa,EAIlBT,KAAKU,UAAW,EAChBV,KAAKW,W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,EAAYf,EAAQc,WAAWE,KAAKH,GACpCI,EAAgBF,EAAU/B,KAE9B,GAAKkC,EAAkBC,SAASF,EAAcG,eAA9C,CAMA,IAAIC,EAAiBN,EAAUO,MAET,MAAlBD,GAA0BA,EAAeD,cAAcD,SAAS,gBAChEnB,EAAQuB,gBAAgBN,QARxBjB,EAAQuB,gBAAgBN,GAchC,IAAId,EAAgBC,EAAmBJ,GAEvC,IAASa,EAAI,EAAGA,EAAIV,EAAczD,OAAQmE,IACtCP,EAAgBH,EAAcU,MAOlCT,EAAqB,SAAU1F,GAC/B,OAAuB,MAAfA,EAAG8G,SAAoB9G,EAAG8G,SAAW9G,EAAG+G,YAEhDP,EAAoB,CAAC,QAAS,KAAM,OAAQ,MAAO,OAAQ,QAC3DxB,EAAc,CAAC,SAAU,QAAS,SAAU,OAAQ,OAAQ,SAAU","file":"js/chunk-af516e02.6364cb5a.js","sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nimport { r as registerInstance, d as createEvent, w as writeTask, c as getIonMode, h, e as getElement, H as Host } from './core-feeeff0d.js';\nimport { b as config } from './config-3c7f3790.js';\nimport { s as sanitizeDOMString } from './index-3476b023.js';\nvar Refresher = /** @class */ (function () {\n function class_1(hostRef) {\n registerInstance(this, hostRef);\n this.appliedStyles = false;\n this.didStart = false;\n this.progress = 0;\n /**\n * The current state which the refresher is in. The refresher's states include:\n *\n * - `inactive` - The refresher is not being pulled down or refreshing and is currently hidden.\n * - `pulling` - The user is actively pulling down the refresher, but has not reached the point yet that if the user lets go, it'll refresh.\n * - `cancelling` - The user pulled down the refresher and let go, but did not pull down far enough to kick off the `refreshing` state. After letting go, the refresher is in the `cancelling` state while it is closing, and will go back to the `inactive` state once closed.\n * - `ready` - The user has pulled down the refresher far enough that if they let go, it'll begin the `refreshing` state.\n * - `refreshing` - The refresher is actively waiting on the async operation to end. Once the refresh handler calls `complete()` it will begin the `completing` state.\n * - `completing` - The `refreshing` state has finished and the refresher is in the way of closing itself. Once closed, the refresher will go back to the `inactive` state.\n */\n this.state = 1 /* Inactive */;\n /**\n * The minimum distance the user must pull down until the\n * refresher will go into the `refreshing` state.\n */\n this.pullMin = 60;\n /**\n * The maximum distance of the pull until the refresher\n * will automatically go into the `refreshing` state.\n * Defaults to the result of `pullMin + 60`.\n */\n this.pullMax = this.pullMin + 60;\n /**\n * Time it takes to close the refresher.\n */\n this.closeDuration = '280ms';\n /**\n * Time it takes the refresher to to snap back to the `refreshing` state.\n */\n this.snapbackDuration = '280ms';\n /**\n * How much to multiply the pull speed by. To slow the pull animation down,\n * pass a number less than `1`. To speed up the pull, pass a number greater\n * than `1`. The default value is `1` which is equal to the speed of the cursor.\n * If a negative value is passed in, the factor will be `1` instead.\n *\n * For example: If the value passed is `1.2` and the content is dragged by\n * `10` pixels, instead of `10` pixels the content will be pulled by `12` pixels\n * (an increase of 20 percent). If the value passed is `0.8`, the dragged amount\n * will be `8` pixels, less than the amount the cursor has moved.\n */\n this.pullFactor = 1;\n /**\n * If `true`, the refresher will be hidden.\n */\n this.disabled = false;\n this.ionRefresh = createEvent(this, \"ionRefresh\", 7);\n this.ionPull = createEvent(this, \"ionPull\", 7);\n this.ionStart = createEvent(this, \"ionStart\", 7);\n }\n class_1.prototype.disabledChanged = function () {\n if (this.gesture) {\n this.gesture.setDisabled(this.disabled);\n }\n };\n class_1.prototype.connectedCallback = function () {\n return __awaiter(this, void 0, void 0, function () {\n var contentEl, _a, _b;\n var _this = this;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (this.el.getAttribute('slot') !== 'fixed') {\n console.error('Make sure you use: ');\n return [2 /*return*/];\n }\n contentEl = this.el.closest('ion-content');\n if (!contentEl) {\n console.error(' must be used inside an ');\n return [2 /*return*/];\n }\n _a = this;\n return [4 /*yield*/, contentEl.getScrollElement()];\n case 1:\n _a.scrollEl = _c.sent();\n _b = this;\n return [4 /*yield*/, import('./index-624eea58.js')];\n case 2:\n _b.gesture = (_c.sent()).createGesture({\n el: contentEl,\n gestureName: 'refresher',\n gesturePriority: 10,\n direction: 'y',\n threshold: 20,\n passive: false,\n canStart: function () { return _this.canStart(); },\n onStart: function () { return _this.onStart(); },\n onMove: function (ev) { return _this.onMove(ev); },\n onEnd: function () { return _this.onEnd(); },\n });\n this.disabledChanged();\n return [2 /*return*/];\n }\n });\n });\n };\n class_1.prototype.disconnectedCallback = function () {\n this.scrollEl = undefined;\n if (this.gesture) {\n this.gesture.destroy();\n this.gesture = undefined;\n }\n };\n /**\n * Call `complete()` when your async operation has completed.\n * For example, the `refreshing` state is while the app is performing\n * an asynchronous operation, such as receiving more data from an\n * AJAX request. Once the data has been received, you then call this\n * method to signify that the refreshing has completed and to close\n * the refresher. This method also changes the refresher's state from\n * `refreshing` to `completing`.\n */\n class_1.prototype.complete = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n this.close(32 /* Completing */, '120ms');\n return [2 /*return*/];\n });\n });\n };\n /**\n * Changes the refresher's state from `refreshing` to `cancelling`.\n */\n class_1.prototype.cancel = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n this.close(16 /* Cancelling */, '');\n return [2 /*return*/];\n });\n });\n };\n /**\n * A number representing how far down the user has pulled.\n * The number `0` represents the user hasn't pulled down at all. The\n * number `1`, and anything greater than `1`, represents that the user\n * has pulled far enough down that when they let go then the refresh will\n * happen. If they let go and the number is less than `1`, then the\n * refresh will not happen, and the content will return to it's original\n * position.\n */\n class_1.prototype.getProgress = function () {\n return Promise.resolve(this.progress);\n };\n class_1.prototype.canStart = function () {\n if (!this.scrollEl) {\n return false;\n }\n if (this.state !== 1 /* Inactive */) {\n return false;\n }\n // if the scrollTop is greater than zero then it's\n // not possible to pull the content down yet\n if (this.scrollEl.scrollTop > 0) {\n return false;\n }\n return true;\n };\n class_1.prototype.onStart = function () {\n this.progress = 0;\n this.state = 1 /* Inactive */;\n };\n class_1.prototype.onMove = function (detail) {\n if (!this.scrollEl) {\n return;\n }\n // this method can get called like a bazillion times per second,\n // so it's built to be as efficient as possible, and does its\n // best to do any DOM read/writes only when absolutely necessary\n // if multi-touch then get out immediately\n var ev = detail.event;\n if (ev.touches && ev.touches.length > 1) {\n return;\n }\n // do nothing if it's actively refreshing\n // or it's in the way of closing\n // or this was never a startY\n if ((this.state & 56 /* _BUSY_ */) !== 0) {\n return;\n }\n var pullFactor = (Number.isNaN(this.pullFactor) || this.pullFactor < 0) ? 1 : this.pullFactor;\n var deltaY = detail.deltaY * pullFactor;\n // don't bother if they're scrolling up\n // and have not already started dragging\n if (deltaY <= 0) {\n // the current Y is higher than the starting Y\n // so they scrolled up enough to be ignored\n this.progress = 0;\n this.state = 1 /* Inactive */;\n if (this.appliedStyles) {\n // reset the styles only if they were applied\n this.setCss(0, '', false, '');\n return;\n }\n return;\n }\n if (this.state === 1 /* Inactive */) {\n // this refresh is not already actively pulling down\n // get the content's scrollTop\n var scrollHostScrollTop = this.scrollEl.scrollTop;\n // if the scrollTop is greater than zero then it's\n // not possible to pull the content down yet\n if (scrollHostScrollTop > 0) {\n this.progress = 0;\n return;\n }\n // content scrolled all the way to the top, and dragging down\n this.state = 2 /* Pulling */;\n }\n // prevent native scroll events\n if (ev.cancelable) {\n ev.preventDefault();\n }\n // the refresher is actively pulling at this point\n // move the scroll element within the content element\n this.setCss(deltaY, '0ms', true, '');\n if (deltaY === 0) {\n // don't continue if there's no delta yet\n this.progress = 0;\n return;\n }\n var pullMin = this.pullMin;\n // set pull progress\n this.progress = deltaY / pullMin;\n // emit \"start\" if it hasn't started yet\n if (!this.didStart) {\n this.didStart = true;\n this.ionStart.emit();\n }\n // emit \"pulling\" on every move\n this.ionPull.emit();\n // do nothing if the delta is less than the pull threshold\n if (deltaY < pullMin) {\n // ensure it stays in the pulling state, cuz its not ready yet\n this.state = 2 /* Pulling */;\n return;\n }\n if (deltaY > this.pullMax) {\n // they pulled farther than the max, so kick off the refresh\n this.beginRefresh();\n return;\n }\n // pulled farther than the pull min!!\n // it is now in the `ready` state!!\n // if they let go then it'll refresh, kerpow!!\n this.state = 4 /* Ready */;\n return;\n };\n class_1.prototype.onEnd = function () {\n // only run in a zone when absolutely necessary\n if (this.state === 4 /* Ready */) {\n // they pulled down far enough, so it's ready to refresh\n this.beginRefresh();\n }\n else if (this.state === 2 /* Pulling */) {\n // they were pulling down, but didn't pull down far enough\n // set the content back to it's original location\n // and close the refresher\n // set that the refresh is actively cancelling\n this.cancel();\n }\n };\n class_1.prototype.beginRefresh = function () {\n // assumes we're already back in a zone\n // they pulled down far enough, so it's ready to refresh\n this.state = 8 /* Refreshing */;\n // place the content in a hangout position while it thinks\n this.setCss(this.pullMin, this.snapbackDuration, true, '');\n // emit \"refresh\" because it was pulled down far enough\n // and they let go to begin refreshing\n this.ionRefresh.emit({\n complete: this.complete.bind(this)\n });\n };\n class_1.prototype.close = function (state, delay) {\n var _this = this;\n // create fallback timer incase something goes wrong with transitionEnd event\n setTimeout(function () {\n _this.state = 1 /* Inactive */;\n _this.progress = 0;\n _this.didStart = false;\n _this.setCss(0, '0ms', false, '');\n }, 600);\n // reset set the styles on the scroll element\n // set that the refresh is actively cancelling/completing\n this.state = state;\n this.setCss(0, this.closeDuration, true, delay);\n // TODO: stop gesture\n };\n class_1.prototype.setCss = function (y, duration, overflowVisible, delay) {\n var _this = this;\n this.appliedStyles = (y > 0);\n writeTask(function () {\n if (_this.scrollEl) {\n var style = _this.scrollEl.style;\n style.transform = ((y > 0) ? \"translateY(\" + y + \"px) translateZ(0px)\" : 'translateZ(0px)');\n style.transitionDuration = duration;\n style.transitionDelay = delay;\n style.overflow = (overflowVisible ? 'hidden' : '');\n }\n });\n };\n class_1.prototype.render = function () {\n var _a;\n var mode = getIonMode(this);\n return (h(Host, { slot: \"fixed\", class: (_a = {},\n _a[mode] = true,\n // Used internally for styling\n _a[\"refresher-\" + mode] = true,\n _a['refresher-active'] = this.state !== 1 /* Inactive */,\n _a['refresher-pulling'] = this.state === 2 /* Pulling */,\n _a['refresher-ready'] = this.state === 4 /* Ready */,\n _a['refresher-refreshing'] = this.state === 8 /* Refreshing */,\n _a['refresher-cancelling'] = this.state === 16 /* Cancelling */,\n _a['refresher-completing'] = this.state === 32 /* Completing */,\n _a) }));\n };\n Object.defineProperty(class_1.prototype, \"el\", {\n get: function () { return getElement(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"watchers\", {\n get: function () {\n return {\n \"disabled\": [\"disabledChanged\"]\n };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"style\", {\n get: function () { return \"ion-refresher{left:0;top:0;display:none;position:absolute;width:100%;height:60px;z-index:-1}:host-context([dir=rtl]) ion-refresher,[dir=rtl] ion-refresher{left:unset;right:unset;right:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:.2s;transition:.2s;font-size:30px;text-align:center}:host-context([dir=rtl]) .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-refreshing-icon,[dir=rtl] .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}.refresher-pulling ion-refresher-content .refresher-pulling,.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-cancelling ion-refresher-content .refresher-pulling,.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-md .refresher-pulling-icon,.refresher-md .refresher-pulling-text,.refresher-md .refresher-refreshing-icon,.refresher-md .refresher-refreshing-text{color:var(--ion-text-color,#000)}.refresher-md .refresher-refreshing .spinner-crescent circle,.refresher-md .refresher-refreshing .spinner-lines-md line,.refresher-md .refresher-refreshing .spinner-lines-small-md line{stroke:var(--ion-text-color,#000)}.refresher-md .refresher-refreshing .spinner-bubbles circle,.refresher-md .refresher-refreshing .spinner-circles circle,.refresher-md .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color,#000)}\"; },\n enumerable: true,\n configurable: true\n });\n return class_1;\n}());\nvar RefresherContent = /** @class */ (function () {\n function RefresherContent(hostRef) {\n registerInstance(this, hostRef);\n }\n RefresherContent.prototype.componentWillLoad = function () {\n if (this.pullingIcon === undefined) {\n this.pullingIcon = config.get('refreshingIcon', 'arrow-down');\n }\n if (this.refreshingSpinner === undefined) {\n var mode = getIonMode(this);\n this.refreshingSpinner = config.get('refreshingSpinner', config.get('spinner', mode === 'ios' ? 'lines' : 'crescent'));\n }\n };\n RefresherContent.prototype.render = function () {\n return (h(Host, { class: getIonMode(this) }, h(\"div\", { class: \"refresher-pulling\" }, this.pullingIcon &&\n h(\"div\", { class: \"refresher-pulling-icon\" }, h(\"ion-icon\", { icon: this.pullingIcon, lazy: false })), this.pullingText &&\n h(\"div\", { class: \"refresher-pulling-text\", innerHTML: sanitizeDOMString(this.pullingText) })), h(\"div\", { class: \"refresher-refreshing\" }, this.refreshingSpinner &&\n h(\"div\", { class: \"refresher-refreshing-icon\" }, h(\"ion-spinner\", { name: this.refreshingSpinner })), this.refreshingText &&\n h(\"div\", { class: \"refresher-refreshing-text\", innerHTML: sanitizeDOMString(this.refreshingText) }))));\n };\n return RefresherContent;\n}());\nexport { Refresher as ion_refresher, RefresherContent as ion_refresher_content };\n","/**\n * Does a simple sanitization of all elements\n * in an untrusted string\n */\nvar sanitizeDOMString = function (untrustedString) {\n try {\n if (typeof untrustedString !== 'string' || untrustedString === '') {\n return untrustedString;\n }\n /**\n * Create a document fragment\n * separate from the main DOM,\n * create a div to do our work in\n */\n var documentFragment_1 = document.createDocumentFragment();\n var workingDiv = document.createElement('div');\n documentFragment_1.appendChild(workingDiv);\n workingDiv.innerHTML = untrustedString;\n /**\n * Remove any elements\n * that are blocked\n */\n blockedTags.forEach(function (blockedTag) {\n var getElementsToRemove = documentFragment_1.querySelectorAll(blockedTag);\n for (var elementIndex = getElementsToRemove.length - 1; elementIndex >= 0; elementIndex--) {\n var element = getElementsToRemove[elementIndex];\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n else {\n documentFragment_1.removeChild(element);\n }\n /**\n * We still need to sanitize\n * the children of this element\n * as they are left behind\n */\n var childElements = getElementChildren(element);\n /* tslint:disable-next-line */\n for (var childIndex = 0; childIndex < childElements.length; childIndex++) {\n sanitizeElement(childElements[childIndex]);\n }\n }\n });\n /**\n * Go through remaining elements and remove\n * non-allowed attribs\n */\n // IE does not support .children on document fragments, only .childNodes\n var dfChildren = getElementChildren(documentFragment_1);\n /* tslint:disable-next-line */\n for (var childIndex = 0; childIndex < dfChildren.length; childIndex++) {\n sanitizeElement(dfChildren[childIndex]);\n }\n // Append document fragment to div\n var fragmentDiv = document.createElement('div');\n fragmentDiv.appendChild(documentFragment_1);\n // First child is always the div we did our work in\n var getInnerDiv = fragmentDiv.querySelector('div');\n return (getInnerDiv !== null) ? getInnerDiv.innerHTML : fragmentDiv.innerHTML;\n }\n catch (err) {\n console.error(err);\n return '';\n }\n};\n/**\n * Clean up current element based on allowed attributes\n * and then recursively dig down into any child elements to\n * clean those up as well\n */\nvar sanitizeElement = function (element) {\n // IE uses childNodes, so ignore nodes that are not elements\n if (element.nodeType && element.nodeType !== 1) {\n return;\n }\n for (var i = element.attributes.length - 1; i >= 0; i--) {\n var attribute = element.attributes.item(i);\n var attributeName = attribute.name;\n // remove non-allowed attribs\n if (!allowedAttributes.includes(attributeName.toLowerCase())) {\n element.removeAttribute(attributeName);\n continue;\n }\n // clean up any allowed attribs\n // that attempt to do any JS funny-business\n var attributeValue = attribute.value;\n /* tslint:disable-next-line */\n if (attributeValue != null && attributeValue.toLowerCase().includes('javascript:')) {\n element.removeAttribute(attributeName);\n }\n }\n /**\n * Sanitize any nested children\n */\n var childElements = getElementChildren(element);\n /* tslint:disable-next-line */\n for (var i = 0; i < childElements.length; i++) {\n sanitizeElement(childElements[i]);\n }\n};\n/**\n * IE doesn't always support .children\n * so we revert to .childNodes instead\n */\nvar getElementChildren = function (el) {\n return (el.children != null) ? el.children : el.childNodes;\n};\nvar allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];\nvar blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed'];\nexport { sanitizeDOMString as s };\n"],"sourceRoot":""}