1 line
46 KiB
JSON
1 line
46 KiB
JSON
{"ast":null,"code":"import _asyncToGenerator from \"D:/MobileDev/WRB/WrenchBoard2023a/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\n\n/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { g as getScrollElement, c as scrollByPoint, f as findClosestIonContent } from './index-3413f7be.js';\nimport { a as addEventListener, b as removeEventListener, r as raf, p as pointerCoord, c as componentOnReady } from './helpers-4d272360.js';\nimport './index-c4b11676.js';\nconst cloneMap = new WeakMap();\n\nconst relocateInput = (componentEl, inputEl, shouldRelocate, inputRelativeY = 0) => {\n if (cloneMap.has(componentEl) === shouldRelocate) {\n return;\n }\n\n if (shouldRelocate) {\n addClone(componentEl, inputEl, inputRelativeY);\n } else {\n removeClone(componentEl, inputEl);\n }\n};\n\nconst isFocused = input => {\n return input === input.getRootNode().activeElement;\n};\n\nconst addClone = (componentEl, inputEl, inputRelativeY) => {\n // this allows for the actual input to receive the focus from\n // the user's touch event, but before it receives focus, it\n // moves the actual input to a location that will not screw\n // up the app's layout, and does not allow the native browser\n // to attempt to scroll the input into place (messing up headers/footers)\n // the cloned input fills the area of where native input should be\n // while the native input fakes out the browser by relocating itself\n // before it receives the actual focus event\n // We hide the focused input (with the visible caret) invisible by making it scale(0),\n const parentEl = inputEl.parentNode; // DOM WRITES\n\n const clonedEl = inputEl.cloneNode(false);\n clonedEl.classList.add('cloned-input');\n clonedEl.tabIndex = -1;\n parentEl.appendChild(clonedEl);\n cloneMap.set(componentEl, clonedEl);\n const doc = componentEl.ownerDocument;\n const tx = doc.dir === 'rtl' ? 9999 : -9999;\n componentEl.style.pointerEvents = 'none';\n inputEl.style.transform = `translate3d(${tx}px,${inputRelativeY}px,0) scale(0)`;\n};\n\nconst removeClone = (componentEl, inputEl) => {\n const clone = cloneMap.get(componentEl);\n\n if (clone) {\n cloneMap.delete(componentEl);\n clone.remove();\n }\n\n componentEl.style.pointerEvents = '';\n inputEl.style.transform = '';\n};\n\nconst enableHideCaretOnScroll = (componentEl, inputEl, scrollEl) => {\n if (!scrollEl || !inputEl) {\n return () => {\n return;\n };\n }\n\n const scrollHideCaret = shouldHideCaret => {\n if (isFocused(inputEl)) {\n relocateInput(componentEl, inputEl, shouldHideCaret);\n }\n };\n\n const onBlur = () => relocateInput(componentEl, inputEl, false);\n\n const hideCaret = () => scrollHideCaret(true);\n\n const showCaret = () => scrollHideCaret(false);\n\n addEventListener(scrollEl, 'ionScrollStart', hideCaret);\n addEventListener(scrollEl, 'ionScrollEnd', showCaret);\n inputEl.addEventListener('blur', onBlur);\n return () => {\n removeEventListener(scrollEl, 'ionScrollStart', hideCaret);\n removeEventListener(scrollEl, 'ionScrollEnd', showCaret);\n inputEl.addEventListener('ionBlur', onBlur);\n };\n};\n\nconst SKIP_SELECTOR = 'input, textarea, [no-blur], [contenteditable]';\n\nconst enableInputBlurring = () => {\n let focused = true;\n let didScroll = false;\n const doc = document;\n\n const onScroll = () => {\n didScroll = true;\n };\n\n const onFocusin = () => {\n focused = true;\n };\n\n const onTouchend = ev => {\n // if app did scroll return early\n if (didScroll) {\n didScroll = false;\n return;\n }\n\n const active = doc.activeElement;\n\n if (!active) {\n return;\n } // only blur if the active element is a text-input or a textarea\n\n\n if (active.matches(SKIP_SELECTOR)) {\n return;\n } // if the selected target is the active element, do not blur\n\n\n const tapped = ev.target;\n\n if (tapped === active) {\n return;\n }\n\n if (tapped.matches(SKIP_SELECTOR) || tapped.closest(SKIP_SELECTOR)) {\n return;\n }\n\n focused = false; // TODO: find a better way, why 50ms?\n\n setTimeout(() => {\n if (!focused) {\n active.blur();\n }\n }, 50);\n };\n\n addEventListener(doc, 'ionScrollStart', onScroll);\n doc.addEventListener('focusin', onFocusin, true);\n doc.addEventListener('touchend', onTouchend, false);\n return () => {\n removeEventListener(doc, 'ionScrollStart', onScroll, true);\n doc.removeEventListener('focusin', onFocusin, true);\n doc.removeEventListener('touchend', onTouchend, false);\n };\n};\n\nconst SCROLL_ASSIST_SPEED = 0.3;\n\nconst getScrollData = (componentEl, contentEl, keyboardHeight) => {\n const itemEl = componentEl.closest('ion-item,[ion-item]') || componentEl;\n return calcScrollData(itemEl.getBoundingClientRect(), contentEl.getBoundingClientRect(), keyboardHeight, componentEl.ownerDocument.defaultView.innerHeight);\n};\n\nconst calcScrollData = (inputRect, contentRect, keyboardHeight, platformHeight) => {\n // compute input's Y values relative to the body\n const inputTop = inputRect.top;\n const inputBottom = inputRect.bottom; // compute visible area\n\n const visibleAreaTop = contentRect.top;\n const visibleAreaBottom = Math.min(contentRect.bottom, platformHeight - keyboardHeight); // compute safe area\n\n const safeAreaTop = visibleAreaTop + 15;\n const safeAreaBottom = visibleAreaBottom * 0.75; // figure out if each edge of the input is within the safe area\n\n const distanceToBottom = safeAreaBottom - inputBottom;\n const distanceToTop = safeAreaTop - inputTop; // desiredScrollAmount is the negated distance to the safe area according to our calculations.\n\n const desiredScrollAmount = Math.round(distanceToBottom < 0 ? -distanceToBottom : distanceToTop > 0 ? -distanceToTop : 0); // our calculations make some assumptions that aren't always true, like the keyboard being closed when an input\n // gets focus, so make sure we don't scroll the input above the visible area\n\n const scrollAmount = Math.min(desiredScrollAmount, inputTop - visibleAreaTop);\n const distance = Math.abs(scrollAmount);\n const duration = distance / SCROLL_ASSIST_SPEED;\n const scrollDuration = Math.min(400, Math.max(150, duration));\n return {\n scrollAmount,\n scrollDuration,\n scrollPadding: keyboardHeight,\n inputSafeY: -(inputTop - safeAreaTop) + 4\n };\n};\n\nconst enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardHeight) => {\n let coord;\n\n const touchStart = ev => {\n coord = pointerCoord(ev);\n };\n\n const touchEnd = ev => {\n // input cover touchend/mouseup\n if (!coord) {\n return;\n } // get where the touchend/mouseup ended\n\n\n const endCoord = pointerCoord(ev); // focus this input if the pointer hasn't moved XX pixels\n // and the input doesn't already have focus\n\n if (!hasPointerMoved(6, coord, endCoord) && !isFocused(inputEl)) {\n // begin the input focus process\n jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight);\n }\n };\n\n componentEl.addEventListener('touchstart', touchStart, {\n capture: true,\n passive: true\n });\n componentEl.addEventListener('touchend', touchEnd, true);\n return () => {\n componentEl.removeEventListener('touchstart', touchStart, true);\n componentEl.removeEventListener('touchend', touchEnd, true);\n };\n};\n\nconst jsSetFocus = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (componentEl, inputEl, contentEl, footerEl, keyboardHeight) {\n if (!contentEl && !footerEl) {\n return;\n }\n\n const scrollData = getScrollData(componentEl, contentEl || footerEl, keyboardHeight);\n\n if (contentEl && Math.abs(scrollData.scrollAmount) < 4) {\n // the text input is in a safe position that doesn't\n // require it to be scrolled into view, just set focus now\n inputEl.focus();\n return;\n } // temporarily move the focus to the focus holder so the browser\n // doesn't freak out while it's trying to get the input in place\n // at this point the native text input still does not have focus\n\n\n relocateInput(componentEl, inputEl, true, scrollData.inputSafeY);\n inputEl.focus();\n /**\n * Relocating/Focusing input causes the\n * click event to be cancelled, so\n * manually fire one here.\n */\n\n raf(() => componentEl.click());\n\n if (typeof window !== 'undefined') {\n let scrollContentTimeout;\n\n const scrollContent = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator(function* () {\n // clean up listeners and timeouts\n if (scrollContentTimeout !== undefined) {\n clearTimeout(scrollContentTimeout);\n }\n\n window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n window.removeEventListener('ionKeyboardDidShow', scrollContent); // scroll the input into place\n\n if (contentEl) {\n yield scrollByPoint(contentEl, 0, scrollData.scrollAmount, scrollData.scrollDuration);\n } // the scroll view is in the correct position now\n // give the native text input focus\n\n\n relocateInput(componentEl, inputEl, false, scrollData.inputSafeY); // ensure this is the focused input\n\n inputEl.focus();\n });\n\n return function scrollContent() {\n return _ref2.apply(this, arguments);\n };\n }();\n\n const doubleKeyboardEventListener = () => {\n window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n window.addEventListener('ionKeyboardDidShow', scrollContent);\n };\n\n if (contentEl) {\n const scrollEl = yield getScrollElement(contentEl);\n /**\n * scrollData will only consider the amount we need\n * to scroll in order to properly bring the input\n * into view. It will not consider the amount\n * we can scroll in the content element.\n * As a result, scrollData may request a greater\n * scroll position than is currently available\n * in the DOM. If this is the case, we need to\n * wait for the webview to resize/the keyboard\n * to show in order for additional scroll\n * bandwidth to become available.\n */\n\n const totalScrollAmount = scrollEl.scrollHeight - scrollEl.clientHeight;\n\n if (scrollData.scrollAmount > totalScrollAmount - scrollEl.scrollTop) {\n /**\n * On iOS devices, the system will show a \"Passwords\" bar above the keyboard\n * after the initial keyboard is shown. This prevents the webview from resizing\n * until the \"Passwords\" bar is shown, so we need to wait for that to happen first.\n */\n if (inputEl.type === 'password') {\n // Add 50px to account for the \"Passwords\" bar\n scrollData.scrollAmount += 50;\n window.addEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n } else {\n window.addEventListener('ionKeyboardDidShow', scrollContent);\n }\n /**\n * This should only fire in 2 instances:\n * 1. The app is very slow.\n * 2. The app is running in a browser on an old OS\n * that does not support Ionic Keyboard Events\n */\n\n\n scrollContentTimeout = setTimeout(scrollContent, 1000);\n return;\n }\n }\n\n scrollContent();\n }\n });\n\n return function jsSetFocus(_x, _x2, _x3, _x4, _x5) {\n return _ref.apply(this, arguments);\n };\n}();\n\nconst hasPointerMoved = (threshold, startCoord, endCoord) => {\n if (startCoord && endCoord) {\n const deltaX = startCoord.x - endCoord.x;\n const deltaY = startCoord.y - endCoord.y;\n const distance = deltaX * deltaX + deltaY * deltaY;\n return distance > threshold * threshold;\n }\n\n return false;\n};\n\nconst PADDING_TIMER_KEY = '$ionPaddingTimer';\n\nconst enableScrollPadding = keyboardHeight => {\n const doc = document;\n\n const onFocusin = ev => {\n setScrollPadding(ev.target, keyboardHeight);\n };\n\n const onFocusout = ev => {\n setScrollPadding(ev.target, 0);\n };\n\n doc.addEventListener('focusin', onFocusin);\n doc.addEventListener('focusout', onFocusout);\n return () => {\n doc.removeEventListener('focusin', onFocusin);\n doc.removeEventListener('focusout', onFocusout);\n };\n};\n\nconst setScrollPadding = (input, keyboardHeight) => {\n var _a, _b;\n\n if (input.tagName !== 'INPUT') {\n return;\n }\n\n if (input.parentElement && input.parentElement.tagName === 'ION-INPUT') {\n return;\n }\n\n if (((_b = (_a = input.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'ION-SEARCHBAR') {\n return;\n }\n\n const el = findClosestIonContent(input);\n\n if (el === null) {\n return;\n }\n\n const timer = el[PADDING_TIMER_KEY];\n\n if (timer) {\n clearTimeout(timer);\n }\n\n if (keyboardHeight > 0) {\n el.style.setProperty('--keyboard-offset', `${keyboardHeight}px`);\n } else {\n el[PADDING_TIMER_KEY] = setTimeout(() => {\n el.style.setProperty('--keyboard-offset', '0px');\n }, 120);\n }\n};\n\nconst INPUT_BLURRING = true;\nconst SCROLL_PADDING = true;\n\nconst startInputShims = config => {\n const doc = document;\n const keyboardHeight = config.getNumber('keyboardHeight', 290);\n const scrollAssist = config.getBoolean('scrollAssist', true);\n const hideCaret = config.getBoolean('hideCaretOnScroll', true);\n const inputBlurring = config.getBoolean('inputBlurring', true);\n const scrollPadding = config.getBoolean('scrollPadding', true);\n const inputs = Array.from(doc.querySelectorAll('ion-input, ion-textarea'));\n const hideCaretMap = new WeakMap();\n const scrollAssistMap = new WeakMap();\n\n const registerInput = /*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator(function* (componentEl) {\n yield new Promise(resolve => componentOnReady(componentEl, resolve));\n const inputRoot = componentEl.shadowRoot || componentEl;\n const inputEl = inputRoot.querySelector('input') || inputRoot.querySelector('textarea');\n const scrollEl = findClosestIonContent(componentEl);\n const footerEl = !scrollEl ? componentEl.closest('ion-footer') : null;\n\n if (!inputEl) {\n return;\n }\n\n if (!!scrollEl && hideCaret && !hideCaretMap.has(componentEl)) {\n const rmFn = enableHideCaretOnScroll(componentEl, inputEl, scrollEl);\n hideCaretMap.set(componentEl, rmFn);\n }\n /**\n * date/datetime-locale inputs on mobile devices show date picker\n * overlays instead of keyboards. As a result, scroll assist is\n * not needed. This also works around a bug in iOS <16 where\n * scroll assist causes the browser to lock up. See FW-1997.\n */\n\n\n const isDateInput = inputEl.type === 'date' || inputEl.type === 'datetime-local';\n\n if (!isDateInput && (!!scrollEl || !!footerEl) && scrollAssist && !scrollAssistMap.has(componentEl)) {\n const rmFn = enableScrollAssist(componentEl, inputEl, scrollEl, footerEl, keyboardHeight);\n scrollAssistMap.set(componentEl, rmFn);\n }\n });\n\n return function registerInput(_x6) {\n return _ref3.apply(this, arguments);\n };\n }();\n\n const unregisterInput = componentEl => {\n if (hideCaret) {\n const fn = hideCaretMap.get(componentEl);\n\n if (fn) {\n fn();\n }\n\n hideCaretMap.delete(componentEl);\n }\n\n if (scrollAssist) {\n const fn = scrollAssistMap.get(componentEl);\n\n if (fn) {\n fn();\n }\n\n scrollAssistMap.delete(componentEl);\n }\n };\n\n if (inputBlurring && INPUT_BLURRING) {\n enableInputBlurring();\n }\n\n if (scrollPadding && SCROLL_PADDING) {\n enableScrollPadding(keyboardHeight);\n } // Input might be already loaded in the DOM before ion-device-hacks did.\n // At this point we need to look for all of the inputs not registered yet\n // and register them.\n\n\n for (const input of inputs) {\n registerInput(input);\n }\n\n doc.addEventListener('ionInputDidLoad', ev => {\n registerInput(ev.detail);\n });\n doc.addEventListener('ionInputDidUnload', ev => {\n unregisterInput(ev.detail);\n });\n};\n\nexport { startInputShims };","map":{"version":3,"names":["g","getScrollElement","c","scrollByPoint","f","findClosestIonContent","a","addEventListener","b","removeEventListener","r","raf","p","pointerCoord","componentOnReady","cloneMap","WeakMap","relocateInput","componentEl","inputEl","shouldRelocate","inputRelativeY","has","addClone","removeClone","isFocused","input","getRootNode","activeElement","parentEl","parentNode","clonedEl","cloneNode","classList","add","tabIndex","appendChild","set","doc","ownerDocument","tx","dir","style","pointerEvents","transform","clone","get","delete","remove","enableHideCaretOnScroll","scrollEl","scrollHideCaret","shouldHideCaret","onBlur","hideCaret","showCaret","SKIP_SELECTOR","enableInputBlurring","focused","didScroll","document","onScroll","onFocusin","onTouchend","ev","active","matches","tapped","target","closest","setTimeout","blur","SCROLL_ASSIST_SPEED","getScrollData","contentEl","keyboardHeight","itemEl","calcScrollData","getBoundingClientRect","defaultView","innerHeight","inputRect","contentRect","platformHeight","inputTop","top","inputBottom","bottom","visibleAreaTop","visibleAreaBottom","Math","min","safeAreaTop","safeAreaBottom","distanceToBottom","distanceToTop","desiredScrollAmount","round","scrollAmount","distance","abs","duration","scrollDuration","max","scrollPadding","inputSafeY","enableScrollAssist","footerEl","coord","touchStart","touchEnd","endCoord","hasPointerMoved","jsSetFocus","capture","passive","scrollData","focus","click","window","scrollContentTimeout","scrollContent","undefined","clearTimeout","doubleKeyboardEventListener","totalScrollAmount","scrollHeight","clientHeight","scrollTop","type","threshold","startCoord","deltaX","x","deltaY","y","PADDING_TIMER_KEY","enableScrollPadding","setScrollPadding","onFocusout","_a","_b","tagName","parentElement","el","timer","setProperty","INPUT_BLURRING","SCROLL_PADDING","startInputShims","config","getNumber","scrollAssist","getBoolean","inputBlurring","inputs","Array","from","querySelectorAll","hideCaretMap","scrollAssistMap","registerInput","Promise","resolve","inputRoot","shadowRoot","querySelector","rmFn","isDateInput","unregisterInput","fn","detail"],"sources":["D:/MobileDev/WRB/WrenchBoard2023a/node_modules/@ionic/core/dist/esm/input-shims-a9a56f5a.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { g as getScrollElement, c as scrollByPoint, f as findClosestIonContent } from './index-3413f7be.js';\nimport { a as addEventListener, b as removeEventListener, r as raf, p as pointerCoord, c as componentOnReady } from './helpers-4d272360.js';\nimport './index-c4b11676.js';\n\nconst cloneMap = new WeakMap();\nconst relocateInput = (componentEl, inputEl, shouldRelocate, inputRelativeY = 0) => {\n if (cloneMap.has(componentEl) === shouldRelocate) {\n return;\n }\n if (shouldRelocate) {\n addClone(componentEl, inputEl, inputRelativeY);\n }\n else {\n removeClone(componentEl, inputEl);\n }\n};\nconst isFocused = (input) => {\n return input === input.getRootNode().activeElement;\n};\nconst addClone = (componentEl, inputEl, inputRelativeY) => {\n // this allows for the actual input to receive the focus from\n // the user's touch event, but before it receives focus, it\n // moves the actual input to a location that will not screw\n // up the app's layout, and does not allow the native browser\n // to attempt to scroll the input into place (messing up headers/footers)\n // the cloned input fills the area of where native input should be\n // while the native input fakes out the browser by relocating itself\n // before it receives the actual focus event\n // We hide the focused input (with the visible caret) invisible by making it scale(0),\n const parentEl = inputEl.parentNode;\n // DOM WRITES\n const clonedEl = inputEl.cloneNode(false);\n clonedEl.classList.add('cloned-input');\n clonedEl.tabIndex = -1;\n parentEl.appendChild(clonedEl);\n cloneMap.set(componentEl, clonedEl);\n const doc = componentEl.ownerDocument;\n const tx = doc.dir === 'rtl' ? 9999 : -9999;\n componentEl.style.pointerEvents = 'none';\n inputEl.style.transform = `translate3d(${tx}px,${inputRelativeY}px,0) scale(0)`;\n};\nconst removeClone = (componentEl, inputEl) => {\n const clone = cloneMap.get(componentEl);\n if (clone) {\n cloneMap.delete(componentEl);\n clone.remove();\n }\n componentEl.style.pointerEvents = '';\n inputEl.style.transform = '';\n};\n\nconst enableHideCaretOnScroll = (componentEl, inputEl, scrollEl) => {\n if (!scrollEl || !inputEl) {\n return () => {\n return;\n };\n }\n const scrollHideCaret = (shouldHideCaret) => {\n if (isFocused(inputEl)) {\n relocateInput(componentEl, inputEl, shouldHideCaret);\n }\n };\n const onBlur = () => relocateInput(componentEl, inputEl, false);\n const hideCaret = () => scrollHideCaret(true);\n const showCaret = () => scrollHideCaret(false);\n addEventListener(scrollEl, 'ionScrollStart', hideCaret);\n addEventListener(scrollEl, 'ionScrollEnd', showCaret);\n inputEl.addEventListener('blur', onBlur);\n return () => {\n removeEventListener(scrollEl, 'ionScrollStart', hideCaret);\n removeEventListener(scrollEl, 'ionScrollEnd', showCaret);\n inputEl.addEventListener('ionBlur', onBlur);\n };\n};\n\nconst SKIP_SELECTOR = 'input, textarea, [no-blur], [contenteditable]';\nconst enableInputBlurring = () => {\n let focused = true;\n let didScroll = false;\n const doc = document;\n const onScroll = () => {\n didScroll = true;\n };\n const onFocusin = () => {\n focused = true;\n };\n const onTouchend = (ev) => {\n // if app did scroll return early\n if (didScroll) {\n didScroll = false;\n return;\n }\n const active = doc.activeElement;\n if (!active) {\n return;\n }\n // only blur if the active element is a text-input or a textarea\n if (active.matches(SKIP_SELECTOR)) {\n return;\n }\n // if the selected target is the active element, do not blur\n const tapped = ev.target;\n if (tapped === active) {\n return;\n }\n if (tapped.matches(SKIP_SELECTOR) || tapped.closest(SKIP_SELECTOR)) {\n return;\n }\n focused = false;\n // TODO: find a better way, why 50ms?\n setTimeout(() => {\n if (!focused) {\n active.blur();\n }\n }, 50);\n };\n addEventListener(doc, 'ionScrollStart', onScroll);\n doc.addEventListener('focusin', onFocusin, true);\n doc.addEventListener('touchend', onTouchend, false);\n return () => {\n removeEventListener(doc, 'ionScrollStart', onScroll, true);\n doc.removeEventListener('focusin', onFocusin, true);\n doc.removeEventListener('touchend', onTouchend, false);\n };\n};\n\nconst SCROLL_ASSIST_SPEED = 0.3;\nconst getScrollData = (componentEl, contentEl, keyboardHeight) => {\n const itemEl = componentEl.closest('ion-item,[ion-item]') || componentEl;\n return calcScrollData(itemEl.getBoundingClientRect(), contentEl.getBoundingClientRect(), keyboardHeight, componentEl.ownerDocument.defaultView.innerHeight);\n};\nconst calcScrollData = (inputRect, contentRect, keyboardHeight, platformHeight) => {\n // compute input's Y values relative to the body\n const inputTop = inputRect.top;\n const inputBottom = inputRect.bottom;\n // compute visible area\n const visibleAreaTop = contentRect.top;\n const visibleAreaBottom = Math.min(contentRect.bottom, platformHeight - keyboardHeight);\n // compute safe area\n const safeAreaTop = visibleAreaTop + 15;\n const safeAreaBottom = visibleAreaBottom * 0.75;\n // figure out if each edge of the input is within the safe area\n const distanceToBottom = safeAreaBottom - inputBottom;\n const distanceToTop = safeAreaTop - inputTop;\n // desiredScrollAmount is the negated distance to the safe area according to our calculations.\n const desiredScrollAmount = Math.round(distanceToBottom < 0 ? -distanceToBottom : distanceToTop > 0 ? -distanceToTop : 0);\n // our calculations make some assumptions that aren't always true, like the keyboard being closed when an input\n // gets focus, so make sure we don't scroll the input above the visible area\n const scrollAmount = Math.min(desiredScrollAmount, inputTop - visibleAreaTop);\n const distance = Math.abs(scrollAmount);\n const duration = distance / SCROLL_ASSIST_SPEED;\n const scrollDuration = Math.min(400, Math.max(150, duration));\n return {\n scrollAmount,\n scrollDuration,\n scrollPadding: keyboardHeight,\n inputSafeY: -(inputTop - safeAreaTop) + 4,\n };\n};\n\nconst enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardHeight) => {\n let coord;\n const touchStart = (ev) => {\n coord = pointerCoord(ev);\n };\n const touchEnd = (ev) => {\n // input cover touchend/mouseup\n if (!coord) {\n return;\n }\n // get where the touchend/mouseup ended\n const endCoord = pointerCoord(ev);\n // focus this input if the pointer hasn't moved XX pixels\n // and the input doesn't already have focus\n if (!hasPointerMoved(6, coord, endCoord) && !isFocused(inputEl)) {\n // begin the input focus process\n jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight);\n }\n };\n componentEl.addEventListener('touchstart', touchStart, { capture: true, passive: true });\n componentEl.addEventListener('touchend', touchEnd, true);\n return () => {\n componentEl.removeEventListener('touchstart', touchStart, true);\n componentEl.removeEventListener('touchend', touchEnd, true);\n };\n};\nconst jsSetFocus = async (componentEl, inputEl, contentEl, footerEl, keyboardHeight) => {\n if (!contentEl && !footerEl) {\n return;\n }\n const scrollData = getScrollData(componentEl, (contentEl || footerEl), keyboardHeight);\n if (contentEl && Math.abs(scrollData.scrollAmount) < 4) {\n // the text input is in a safe position that doesn't\n // require it to be scrolled into view, just set focus now\n inputEl.focus();\n return;\n }\n // temporarily move the focus to the focus holder so the browser\n // doesn't freak out while it's trying to get the input in place\n // at this point the native text input still does not have focus\n relocateInput(componentEl, inputEl, true, scrollData.inputSafeY);\n inputEl.focus();\n /**\n * Relocating/Focusing input causes the\n * click event to be cancelled, so\n * manually fire one here.\n */\n raf(() => componentEl.click());\n if (typeof window !== 'undefined') {\n let scrollContentTimeout;\n const scrollContent = async () => {\n // clean up listeners and timeouts\n if (scrollContentTimeout !== undefined) {\n clearTimeout(scrollContentTimeout);\n }\n window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n window.removeEventListener('ionKeyboardDidShow', scrollContent);\n // scroll the input into place\n if (contentEl) {\n await scrollByPoint(contentEl, 0, scrollData.scrollAmount, scrollData.scrollDuration);\n }\n // the scroll view is in the correct position now\n // give the native text input focus\n relocateInput(componentEl, inputEl, false, scrollData.inputSafeY);\n // ensure this is the focused input\n inputEl.focus();\n };\n const doubleKeyboardEventListener = () => {\n window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n window.addEventListener('ionKeyboardDidShow', scrollContent);\n };\n if (contentEl) {\n const scrollEl = await getScrollElement(contentEl);\n /**\n * scrollData will only consider the amount we need\n * to scroll in order to properly bring the input\n * into view. It will not consider the amount\n * we can scroll in the content element.\n * As a result, scrollData may request a greater\n * scroll position than is currently available\n * in the DOM. If this is the case, we need to\n * wait for the webview to resize/the keyboard\n * to show in order for additional scroll\n * bandwidth to become available.\n */\n const totalScrollAmount = scrollEl.scrollHeight - scrollEl.clientHeight;\n if (scrollData.scrollAmount > totalScrollAmount - scrollEl.scrollTop) {\n /**\n * On iOS devices, the system will show a \"Passwords\" bar above the keyboard\n * after the initial keyboard is shown. This prevents the webview from resizing\n * until the \"Passwords\" bar is shown, so we need to wait for that to happen first.\n */\n if (inputEl.type === 'password') {\n // Add 50px to account for the \"Passwords\" bar\n scrollData.scrollAmount += 50;\n window.addEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n }\n else {\n window.addEventListener('ionKeyboardDidShow', scrollContent);\n }\n /**\n * This should only fire in 2 instances:\n * 1. The app is very slow.\n * 2. The app is running in a browser on an old OS\n * that does not support Ionic Keyboard Events\n */\n scrollContentTimeout = setTimeout(scrollContent, 1000);\n return;\n }\n }\n scrollContent();\n }\n};\nconst hasPointerMoved = (threshold, startCoord, endCoord) => {\n if (startCoord && endCoord) {\n const deltaX = startCoord.x - endCoord.x;\n const deltaY = startCoord.y - endCoord.y;\n const distance = deltaX * deltaX + deltaY * deltaY;\n return distance > threshold * threshold;\n }\n return false;\n};\n\nconst PADDING_TIMER_KEY = '$ionPaddingTimer';\nconst enableScrollPadding = (keyboardHeight) => {\n const doc = document;\n const onFocusin = (ev) => {\n setScrollPadding(ev.target, keyboardHeight);\n };\n const onFocusout = (ev) => {\n setScrollPadding(ev.target, 0);\n };\n doc.addEventListener('focusin', onFocusin);\n doc.addEventListener('focusout', onFocusout);\n return () => {\n doc.removeEventListener('focusin', onFocusin);\n doc.removeEventListener('focusout', onFocusout);\n };\n};\nconst setScrollPadding = (input, keyboardHeight) => {\n var _a, _b;\n if (input.tagName !== 'INPUT') {\n return;\n }\n if (input.parentElement && input.parentElement.tagName === 'ION-INPUT') {\n return;\n }\n if (((_b = (_a = input.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'ION-SEARCHBAR') {\n return;\n }\n const el = findClosestIonContent(input);\n if (el === null) {\n return;\n }\n const timer = el[PADDING_TIMER_KEY];\n if (timer) {\n clearTimeout(timer);\n }\n if (keyboardHeight > 0) {\n el.style.setProperty('--keyboard-offset', `${keyboardHeight}px`);\n }\n else {\n el[PADDING_TIMER_KEY] = setTimeout(() => {\n el.style.setProperty('--keyboard-offset', '0px');\n }, 120);\n }\n};\n\nconst INPUT_BLURRING = true;\nconst SCROLL_PADDING = true;\nconst startInputShims = (config) => {\n const doc = document;\n const keyboardHeight = config.getNumber('keyboardHeight', 290);\n const scrollAssist = config.getBoolean('scrollAssist', true);\n const hideCaret = config.getBoolean('hideCaretOnScroll', true);\n const inputBlurring = config.getBoolean('inputBlurring', true);\n const scrollPadding = config.getBoolean('scrollPadding', true);\n const inputs = Array.from(doc.querySelectorAll('ion-input, ion-textarea'));\n const hideCaretMap = new WeakMap();\n const scrollAssistMap = new WeakMap();\n const registerInput = async (componentEl) => {\n await new Promise((resolve) => componentOnReady(componentEl, resolve));\n const inputRoot = componentEl.shadowRoot || componentEl;\n const inputEl = inputRoot.querySelector('input') || inputRoot.querySelector('textarea');\n const scrollEl = findClosestIonContent(componentEl);\n const footerEl = !scrollEl ? componentEl.closest('ion-footer') : null;\n if (!inputEl) {\n return;\n }\n if (!!scrollEl && hideCaret && !hideCaretMap.has(componentEl)) {\n const rmFn = enableHideCaretOnScroll(componentEl, inputEl, scrollEl);\n hideCaretMap.set(componentEl, rmFn);\n }\n /**\n * date/datetime-locale inputs on mobile devices show date picker\n * overlays instead of keyboards. As a result, scroll assist is\n * not needed. This also works around a bug in iOS <16 where\n * scroll assist causes the browser to lock up. See FW-1997.\n */\n const isDateInput = inputEl.type === 'date' || inputEl.type === 'datetime-local';\n if (!isDateInput &&\n (!!scrollEl || !!footerEl) &&\n scrollAssist &&\n !scrollAssistMap.has(componentEl)) {\n const rmFn = enableScrollAssist(componentEl, inputEl, scrollEl, footerEl, keyboardHeight);\n scrollAssistMap.set(componentEl, rmFn);\n }\n };\n const unregisterInput = (componentEl) => {\n if (hideCaret) {\n const fn = hideCaretMap.get(componentEl);\n if (fn) {\n fn();\n }\n hideCaretMap.delete(componentEl);\n }\n if (scrollAssist) {\n const fn = scrollAssistMap.get(componentEl);\n if (fn) {\n fn();\n }\n scrollAssistMap.delete(componentEl);\n }\n };\n if (inputBlurring && INPUT_BLURRING) {\n enableInputBlurring();\n }\n if (scrollPadding && SCROLL_PADDING) {\n enableScrollPadding(keyboardHeight);\n }\n // Input might be already loaded in the DOM before ion-device-hacks did.\n // At this point we need to look for all of the inputs not registered yet\n // and register them.\n for (const input of inputs) {\n registerInput(input);\n }\n doc.addEventListener('ionInputDidLoad', ((ev) => {\n registerInput(ev.detail);\n }));\n doc.addEventListener('ionInputDidUnload', ((ev) => {\n unregisterInput(ev.detail);\n }));\n};\n\nexport { startInputShims };\n"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,CAAC,IAAIC,gBAAd,EAAgCC,CAAC,IAAIC,aAArC,EAAoDC,CAAC,IAAIC,qBAAzD,QAAsF,qBAAtF;AACA,SAASC,CAAC,IAAIC,gBAAd,EAAgCC,CAAC,IAAIC,mBAArC,EAA0DC,CAAC,IAAIC,GAA/D,EAAoEC,CAAC,IAAIC,YAAzE,EAAuFX,CAAC,IAAIY,gBAA5F,QAAoH,uBAApH;AACA,OAAO,qBAAP;AAEA,MAAMC,QAAQ,GAAG,IAAIC,OAAJ,EAAjB;;AACA,MAAMC,aAAa,GAAG,CAACC,WAAD,EAAcC,OAAd,EAAuBC,cAAvB,EAAuCC,cAAc,GAAG,CAAxD,KAA8D;EAClF,IAAIN,QAAQ,CAACO,GAAT,CAAaJ,WAAb,MAA8BE,cAAlC,EAAkD;IAChD;EACD;;EACD,IAAIA,cAAJ,EAAoB;IAClBG,QAAQ,CAACL,WAAD,EAAcC,OAAd,EAAuBE,cAAvB,CAAR;EACD,CAFD,MAGK;IACHG,WAAW,CAACN,WAAD,EAAcC,OAAd,CAAX;EACD;AACF,CAVD;;AAWA,MAAMM,SAAS,GAAIC,KAAD,IAAW;EAC3B,OAAOA,KAAK,KAAKA,KAAK,CAACC,WAAN,GAAoBC,aAArC;AACD,CAFD;;AAGA,MAAML,QAAQ,GAAG,CAACL,WAAD,EAAcC,OAAd,EAAuBE,cAAvB,KAA0C;EACzD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMQ,QAAQ,GAAGV,OAAO,CAACW,UAAzB,CAVyD,CAWzD;;EACA,MAAMC,QAAQ,GAAGZ,OAAO,CAACa,SAAR,CAAkB,KAAlB,CAAjB;EACAD,QAAQ,CAACE,SAAT,CAAmBC,GAAnB,CAAuB,cAAvB;EACAH,QAAQ,CAACI,QAAT,GAAoB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