-
Notifications
You must be signed in to change notification settings - Fork 0
/
7259.c5a44bda89e51a5d.js
1 lines (1 loc) · 4.8 KB
/
7259.c5a44bda89e51a5d.js
1
"use strict";(self.webpackChunkbusu_city_ui=self.webpackChunkbusu_city_ui||[]).push([[7259],{7259:(q,O,g)=>{g.r(O),g.d(O,{startInputShims:()=>X});var b=g(3241),C=g(7162),S=g(3944),m=g(9365),I=(()=>{return(e=I||(I={})).Body="body",e.Ionic="ionic",e.Native="native",e.None="none",I;var e})();const j={getEngine(){var e;return(null===(e=null==m.w?void 0:m.w.Capacitor)||void 0===e?void 0:e.isPluginAvailable("Keyboard"))&&(null==m.w?void 0:m.w.Capacitor.Plugins.Keyboard)},getResizeMode(){const e=this.getEngine();return e&&e.getResizeMode?e.getResizeMode():Promise.resolve(void 0)}},M=new WeakMap,P=(e,n,t,o=0,s=!1)=>{M.has(e)!==t&&(t?H(e,n,o,s):k(e,n))},H=(e,n,t,o=!1)=>{const s=n.parentNode,i=n.cloneNode(!1);i.classList.add("cloned-input"),i.tabIndex=-1,o&&(i.disabled=!0),s.appendChild(i),M.set(e,i);const d="rtl"===e.ownerDocument.dir?9999:-9999;e.style.pointerEvents="none",n.style.transform=`translate3d(${d}px,${t}px,0) scale(0)`},k=(e,n)=>{const t=M.get(e);t&&(M.delete(e),t.remove()),e.style.pointerEvents="",n.style.transform=""},p="input, textarea, [no-blur], [contenteditable]",R="$ionPaddingTimer",T=(e,n,t)=>{const o=e[R];o&&clearTimeout(o),n>0?e.style.setProperty("--keyboard-offset",`${n}px`):e[R]=setTimeout(()=>{e.style.setProperty("--keyboard-offset","0px"),t&&t()},120)},N=(e,n,t)=>{e.addEventListener("focusout",()=>{n&&T(n,0,t)},{once:!0})};let y=0;const V=(e,n,t,o,s,i,a,d=!1)=>{const r=i&&(void 0===a||a.mode===I.None),_=function(){var c=(0,b.Z)(function*(){J(e,n,t,o,s,r,d)});return function(){return c.apply(this,arguments)}}();return e.addEventListener("focusin",_,!0),()=>{e.removeEventListener("focusin",_,!0)}},J=function(){var e=(0,b.Z)(function*(n,t,o,s,i,a,d=!1){if(!o&&!s)return;const r=((e,n,t)=>{var o;return((e,n,t,o)=>{const s=e.top,i=e.bottom,a=n.top,r=a+15,c=Math.min(n.bottom,o-t)-50-i,h=r-s,l=Math.round(c<0?-c:h>0?-h:0),v=Math.min(l,s-a),A=Math.abs(v)/.3;return{scrollAmount:v,scrollDuration:Math.min(400,Math.max(150,A)),scrollPadding:t,inputSafeY:4-(s-r)}})((null!==(o=e.closest("ion-item,[ion-item]"))&&void 0!==o?o:e).getBoundingClientRect(),n.getBoundingClientRect(),t,e.ownerDocument.defaultView.innerHeight)})(n,o||s,i);if(o&&Math.abs(r.scrollAmount)<4)return t.focus(),void(a&&null!==o&&(y+=r.scrollPadding,T(o,y),N(t,o,()=>y=0)));if(P(n,t,!0,r.inputSafeY,d),t.focus(),(0,S.r)(()=>n.click()),a&&o&&(y+=r.scrollPadding,T(o,y)),typeof window<"u"){let _;const c=function(){var l=(0,b.Z)(function*(){void 0!==_&&clearTimeout(_),window.removeEventListener("ionKeyboardDidShow",h),window.removeEventListener("ionKeyboardDidShow",c),o&&(yield(0,C.c)(o,0,r.scrollAmount,r.scrollDuration)),P(n,t,!1,r.inputSafeY),t.focus(),a&&N(t,o,()=>y=0)});return function(){return l.apply(this,arguments)}}(),h=()=>{window.removeEventListener("ionKeyboardDidShow",h),window.addEventListener("ionKeyboardDidShow",c)};if(o){const l=yield(0,C.g)(o);if(r.scrollAmount>l.scrollHeight-l.clientHeight-l.scrollTop)return"password"===t.type?(r.scrollAmount+=50,window.addEventListener("ionKeyboardDidShow",h)):window.addEventListener("ionKeyboardDidShow",c),void(_=setTimeout(c,1e3))}c()}});return function(t,o,s,i,a,d){return e.apply(this,arguments)}}(),X=function(){var e=(0,b.Z)(function*(n,t){const o=document,s="ios"===t,i="android"===t,a=n.getNumber("keyboardHeight",290),d=n.getBoolean("scrollAssist",!0),r=n.getBoolean("hideCaretOnScroll",s),_=n.getBoolean("inputBlurring",s),c=n.getBoolean("scrollPadding",!0),h=Array.from(o.querySelectorAll("ion-input, ion-textarea")),l=new WeakMap,v=new WeakMap,U=yield j.getResizeMode(),A=function(){var f=(0,b.Z)(function*(u){yield new Promise(D=>(0,S.c)(u,D));const x=u.shadowRoot||u,w=x.querySelector("input")||x.querySelector("textarea"),L=(0,C.f)(u),W=L?null:u.closest("ion-footer");if(w){if(L&&r&&!l.has(u)){const D=((e,n,t)=>{if(!t||!n)return()=>{};const o=d=>{(e=>e===e.getRootNode().activeElement)(n)&&P(e,n,d)},s=()=>P(e,n,!1),i=()=>o(!0),a=()=>o(!1);return(0,S.a)(t,"ionScrollStart",i),(0,S.a)(t,"ionScrollEnd",a),n.addEventListener("blur",s),()=>{(0,S.b)(t,"ionScrollStart",i),(0,S.b)(t,"ionScrollEnd",a),n.removeEventListener("blur",s)}})(u,w,L);l.set(u,D)}if("date"!==w.type&&"datetime-local"!==w.type&&(L||W)&&d&&!v.has(u)){const D=V(u,w,L,W,a,c,U,i);v.set(u,D)}}});return function(x){return f.apply(this,arguments)}}();_&&(()=>{let e=!0,n=!1;const t=document;(0,S.a)(t,"ionScrollStart",()=>{n=!0}),t.addEventListener("focusin",()=>{e=!0},!0),t.addEventListener("touchend",a=>{if(n)return void(n=!1);const d=t.activeElement;if(!d||d.matches(p))return;const r=a.target;r!==d&&(r.matches(p)||r.closest(p)||(e=!1,setTimeout(()=>{e||d.blur()},50)))},!1)})();for(const f of h)A(f);o.addEventListener("ionInputDidLoad",f=>{A(f.detail)}),o.addEventListener("ionInputDidUnload",f=>{(f=>{if(r){const u=l.get(f);u&&u(),l.delete(f)}if(d){const u=v.get(f);u&&u(),v.delete(f)}})(f.detail)})});return function(t,o){return e.apply(this,arguments)}}()}}]);