=200&&i.status<300||0===i.status?(r.xhrCache&&""!==i.responseText&&(a.removeFromXhrCache(n),a.cache.xhr.push({url:n,time:Utils.now(),content:i.responseText})),a.emit("routerAjaxSuccess",i,t),e(i.responseText)):(a.emit("routerAjaxError",i,t),s(i))},error:function(e){a.emit("routerAjaxError",e,t),s(e)}})}))},t.prototype.setNavbarPosition=function(e,t,a){e.removeClass("navbar-previous navbar-current navbar-next"),t&&e.addClass("navbar-"+t),!1===a?e.removeAttr("aria-hidden"):!0===a&&e.attr("aria-hidden","true"),e.trigger("navbar:position",{position:t}),this.emit("navbarPosition",e[0],t)},t.prototype.setPagePosition=function(e,t,a){e.removeClass("page-previous page-current page-next"),e.addClass("page-"+t),!1===a?e.removeAttr("aria-hidden"):!0===a&&e.attr("aria-hidden","true"),e.trigger("page:position",{position:t}),this.emit("pagePosition",e[0],t)},t.prototype.removeThemeElements=function(e){var t,a=this.app.theme;"ios"===a?t=".md-only, .aurora-only, .if-md, .if-aurora, .if-not-ios, .not-ios":"md"===a?t=".ios-only, .aurora-only, .if-ios, .if-aurora, .if-not-md, .not-md":"aurora"===a&&(t=".ios-only, .md-only, .if-ios, .if-md, .if-not-aurora, .not-aurora"),$(e).find(t).remove()},t.prototype.getPageData=function(e,t,a,r,i,n){void 0===i&&(i={});var s,o,l=$(e).eq(0),p=$(t).eq(0),c=l[0].f7Page||{};if(("next"===a&&"current"===r||"current"===a&&"previous"===r)&&(s="forward"),("current"===a&&"next"===r||"previous"===a&&"current"===r)&&(s="backward"),c&&!c.fromPage){var d=$(n);d.length&&(o=d[0].f7Page)}(o=c.pageFrom||o)&&o.pageFrom&&(o.pageFrom=null);var u={app:this.app,view:this.view,router:this,$el:l,el:l[0],$pageEl:l,pageEl:l[0],$navbarEl:p,navbarEl:p[0],name:l.attr("data-name"),position:a,from:a,to:r,direction:s,route:c.route?c.route:i,pageFrom:o};return l[0].f7Page=u,u},t.prototype.pageCallback=function(e,t,a,r,i,n,s){if(void 0===n&&(n={}),t){var o=this,l=$(t);if(l.length){var p=$(a),c=n.route,d=o.params.restoreScrollTopOnBack&&!(o.params.masterDetailBreakpoint>0&&l.hasClass("page-master")&&o.app.width>=o.params.masterDetailBreakpoint),u=l[0].f7Page&&l[0].f7Page.route&&l[0].f7Page.route.route&&l[0].f7Page.route.route.keepAlive;"beforeRemove"===e&&u&&(e="beforeUnmount");var h="page"+(e[0].toUpperCase()+e.slice(1,e.length)),f="page:"+e.toLowerCase(),v={};(v="beforeRemove"===e&&l[0].f7Page?Utils.extend(l[0].f7Page,{from:r,to:i,position:r}):o.getPageData(l[0],p[0],r,i,c,s)).swipeBack=!!n.swipeBack;var m=n.route?n.route.route:{},g=m.on;void 0===g&&(g={});var b=m.once;if(void 0===b&&(b={}),n.on&&Utils.extend(g,n.on),n.once&&Utils.extend(b,n.once),"mounted"===e&&C(),"init"===e){if(d&&("previous"===r||!r)&&"current"===i&&o.scrollHistory[v.route.url]&&!l.hasClass("no-restore-scroll")){var y=l.find(".page-content");y.length>0&&(y=y.filter((function(e,t){return 0===$(t).parents(".tab:not(.tab-active)").length&&!$(t).is(".tab:not(.tab-active)")}))),y.scrollTop(o.scrollHistory[v.route.url])}if(C(),l[0].f7PageInitialized)return l.trigger("page:reinit",v),void o.emit("pageReinit",v);l[0].f7PageInitialized=!0}if(d&&"beforeOut"===e&&"current"===r&&"previous"===i){var w=l.find(".page-content");w.length>0&&(w=w.filter((function(e,t){return 0===$(t).parents(".tab:not(.tab-active)").length&&!$(t).is(".tab:not(.tab-active)")}))),o.scrollHistory[v.route.url]=w.scrollTop()}d&&"beforeOut"===e&&"current"===r&&"next"===i&&delete o.scrollHistory[v.route.url],l.trigger(f,v),o.emit(h,v),"beforeRemove"!==e&&"beforeUnmount"!==e||(l[0].f7RouteEventsAttached&&(l[0].f7RouteEventsOn&&Object.keys(l[0].f7RouteEventsOn).forEach((function(e){l.off(Utils.eventNameToColonCase(e),l[0].f7RouteEventsOn[e])})),l[0].f7RouteEventsOnce&&Object.keys(l[0].f7RouteEventsOnce).forEach((function(e){l.off(Utils.eventNameToColonCase(e),l[0].f7RouteEventsOnce[e])})),l[0].f7RouteEventsAttached=null,l[0].f7RouteEventsOn=null,l[0].f7RouteEventsOnce=null,delete l[0].f7RouteEventsAttached,delete l[0].f7RouteEventsOn,delete l[0].f7RouteEventsOnce),u||(l[0].f7Page&&l[0].f7Page.navbarEl&&delete l[0].f7Page.navbarEl.f7Page,l[0].f7Page=null))}}function C(){l[0].f7RouteEventsAttached||(l[0].f7RouteEventsAttached=!0,g&&Object.keys(g).length>0&&(l[0].f7RouteEventsOn=g,Object.keys(g).forEach((function(e){g[e]=g[e].bind(o),l.on(Utils.eventNameToColonCase(e),g[e])}))),b&&Object.keys(b).length>0&&(l[0].f7RouteEventsOnce=b,Object.keys(b).forEach((function(e){b[e]=b[e].bind(o),l.once(Utils.eventNameToColonCase(e),b[e])}))))}},t.prototype.saveHistory=function(){this.view.history=this.history,this.params.pushState&&(win.localStorage["f7router-"+this.view.id+"-history"]=JSON.stringify(this.history))},t.prototype.restoreHistory=function(){this.params.pushState&&win.localStorage["f7router-"+this.view.id+"-history"]&&(this.history=JSON.parse(win.localStorage["f7router-"+this.view.id+"-history"]),this.view.history=this.history)},t.prototype.clearHistory=function(){this.history=[],this.view&&(this.view.history=[]),this.saveHistory()},t.prototype.updateCurrentUrl=function(e){appRouterCheck(this,"updateCurrentUrl"),this.history.length?this.history[this.history.length-1]=e:this.history.push(e);var t=this.parseRouteUrl(e),a=t.query,r=t.hash,i=t.params,n=t.url,s=t.path;if(this.currentRoute&&Utils.extend(this.currentRoute,{query:a,hash:r,params:i,url:n,path:s}),this.params.pushState){var o=this.params.pushStateRoot||"";History.replace(this.view.id,{url:e},o+this.params.pushStateSeparator+e)}this.saveHistory(),this.emit("routeUrlUpdate",this.currentRoute,this)},t.prototype.init=function(){var e=this,t=e.app,a=e.view;(a&&e.params.iosSwipeBack&&"ios"===t.theme||a&&e.params.mdSwipeBack&&"md"===t.theme||a&&e.params.auroraSwipeBack&&"aurora"===t.theme)&&SwipeBack(e);var r,i,n=e.params.url,s=doc.location.href.split(doc.location.origin)[1],o=e.params,l=o.pushState,p=o.pushStateOnLoad,c=o.pushStateSeparator,d=o.pushStateAnimateOnLoad,u=e.params.pushStateRoot;if(win.cordova&&l&&!c&&!u&&doc.location.pathname.indexOf("index.html")&&(console.warn("Framework7: wrong or not complete pushState configuration, trying to guess pushStateRoot"),u=doc.location.pathname.split("index.html")[0]),l&&p?(u&&s.indexOf(u)>=0&&""===(s=s.split(u)[1])&&(s="/"),n=c.length>0&&s.indexOf(c)>=0?s.split(c)[1]:s,e.restoreHistory(),e.history.indexOf(n)>=0?e.history=e.history.slice(0,e.history.indexOf(n)+1):e.params.url===n?e.history=[n]:History.state&&History.state[a.id]&&History.state[a.id].url===e.history[e.history.length-1]?n=e.history[e.history.length-1]:e.history=[s.split(c)[0]||"/",n],e.history.length>1?r=!0:e.history=[],e.saveHistory()):(n||(n=s),doc.location.search&&n.indexOf("?")<0&&(n+=doc.location.search),doc.location.hash&&n.indexOf("#")<0&&(n+=doc.location.hash)),e.history.length>1?(i=e.findMatchingRoute(e.history[0]))||(i=Utils.extend(e.parseRouteUrl(e.history[0]),{route:{url:e.history[0],path:e.history[0].split("?")[0]}})):(i=e.findMatchingRoute(n))||(i=Utils.extend(e.parseRouteUrl(n),{route:{url:n,path:n.split("?")[0]}})),e.params.stackPages&&e.$el.children(".page").each((function(t,a){var r=$(a);e.initialPages.push(r[0]),e.dynamicNavbar&&r.children(".navbar").length>0&&e.initialNavbars.push(r.children(".navbar")[0])})),0===e.$el.children(".page:not(.stacked)").length&&n&&e.params.loadInitialPage)e.navigate(n,{initial:!0,reloadCurrent:!0,pushState:!1});else if(e.$el.children(".page:not(.stacked)").length){var h;e.currentRoute=i,e.$el.children(".page:not(.stacked)").each((function(t,r){var i,n=$(r);e.setPagePosition(n,"current"),e.dynamicNavbar&&((i=n.children(".navbar")).length>0?(e.$navbarsEl.parents(doc).length||e.$el.prepend(e.$navbarsEl),e.setNavbarPosition(i,"current"),e.$navbarsEl.append(i),i.children(".title-large").length&&i.addClass("navbar-large"),n.children(".navbar").remove()):(e.$navbarsEl.addClass("navbar-hidden"),i.children(".title-large").length&&e.$navbarsEl.addClass("navbar-hidden navbar-large-hidden"))),e.currentRoute&&e.currentRoute.route&&e.currentRoute.route.master&&e.params.masterDetailBreakpoint>0&&(n.addClass("page-master"),n.trigger("page:role",{role:"master"}),i&&i.length&&i.addClass("navbar-master"),a.checkMasterDetailBreakpoint());var s={route:e.currentRoute};e.currentRoute&&e.currentRoute.route&&e.currentRoute.route.options&&Utils.extend(s,e.currentRoute.route.options),e.currentPageEl=n[0],e.dynamicNavbar&&i.length&&(e.currentNavbarEl=i[0]),e.removeThemeElements(n),e.dynamicNavbar&&i.length&&e.removeThemeElements(i),s.route.route.tab&&(h=!0,e.tabLoad(s.route.route.tab,Utils.extend({},s))),e.pageCallback("init",n,i,"current",void 0,s)})),r&&e.navigate(n,{initial:!0,pushState:!1,history:!1,animate:d,once:{pageAfterIn:function(){(e.params.preloadPreviousPage||e.params[t.theme+"SwipeBack"])&&e.history.length>2&&e.back({preload:!0})}}}),r||h||(e.history.push(n),e.saveHistory())}!(n&&l&&p)||History.state&&History.state[a.id]||History.initViewState(a.id,{url:n}),e.emit("local::init routerInit",e)},t.prototype.destroy=function(){var e=this;e.emit("local::destroy routerDestroy",e),Object.keys(e).forEach((function(t){e[t]=null,delete e[t]})),e=null},t}(Framework7Class);Router.prototype.forward=forward,Router.prototype.load=load,Router.prototype.navigate=navigate,Router.prototype.refreshPage=refreshPage,Router.prototype.tabLoad=tabLoad,Router.prototype.tabRemove=tabRemove,Router.prototype.modalLoad=modalLoad,Router.prototype.modalRemove=modalRemove,Router.prototype.backward=backward,Router.prototype.loadBack=loadBack,Router.prototype.back=back,Router.prototype.clearPreviousHistory=clearPreviousHistory;var RouterModule={name:"router",static:{Router:Router},instance:{cache:{xhr:[],templates:[],components:[]}},create:function(){this.app?this.params.router&&(this.router=new Router(this.app,this)):this.router=new Router(this)}};function resizableView(e){var t=e.app;if(!e.resizableInitialized){Utils.extend(e,{resizable:!0,resizableWidth:null,resizableInitialized:!0});var a=$("html"),r=e.$el;if(r){var i,n,s,o,l,p,c,d={};(i=e.$el.children(".view-resize-handler")).length||(e.$el.append(''),i=e.$el.children(".view-resize-handler")),e.$resizeHandlerEl=i,r.addClass("view-resizable");var u=!!Support.passiveListener&&{passive:!0};e.$el.on(t.touchEvents.start,".view-resize-handler",f,u),t.on("touchmove:active",v),t.on("touchend:passive",m),t.on("resize",g),e.on("beforeOpen",g),e.once("viewDestroy",(function(){r.removeClass("view-resizable"),e.$resizeHandlerEl.remove(),e.$el.off(t.touchEvents.start,".view-resize-handler",f,u),t.off("touchmove:active",v),t.off("touchend:passive",m),t.off("resize",g),e.off("beforeOpen",g)}))}}function h(e){if(!e)return null;if(e.indexOf("%")>=0||e.indexOf("vw")>=0)return parseInt(e,10)/100*t.width;var a=parseInt(e,10);return Number.isNaN(a)?null:a}function f(t){if(e.resizable&&r.hasClass("view-resizable")&&r.hasClass("view-master-detail")){d.x="touchstart"===t.type?t.targetTouches[0].pageX:t.pageX,d.y="touchstart"===t.type?t.targetTouches[0].pageY:t.pageY,s=!1,n=!0;var a=r.children(".page-master");p=h(a.css("min-width")),c=h(a.css("max-width"))}}function v(u){if(n){u.f7PreventSwipePanel=!0;var h="touchmove"===u.type?u.targetTouches[0].pageX:u.pageX;s||(l=i[0].offsetLeft+i[0].offsetWidth,r.addClass("view-resizing"),a.css("cursor","col-resize")),s=!0,u.preventDefault(),o=h-d.x;var f=l+o;p&&!Number.isNaN(p)&&(f=Math.max(f,p)),c&&!Number.isNaN(c)&&(f=Math.min(f,c)),f=Math.min(Math.max(f,0),t.width),e.resizableWidth=f,a[0].style.setProperty("--f7-page-master-width",f+"px"),r.trigger("view:resize",f),e.emit("local::resize viewResize",e,f)}}function m(){if($("html").css("cursor",""),!n||!s)return n=!1,void(s=!1);n=!1,s=!1,a[0].style.setProperty("--f7-page-master-width",e.resizableWidth+"px"),r.removeClass("view-resizing")}function g(){e.resizableWidth&&(p=h(i.css("min-width")),c=h(i.css("max-width")),p&&!Number.isNaN(p)&&e.resizableWidthc&&(e.resizableWidth=Math.min(e.resizableWidth,c)),e.resizableWidth=Math.min(Math.max(e.resizableWidth,0),t.width),a[0].style.setProperty("--f7-page-master-width",e.resizableWidth+"px"))}}var View=function(e){function t(t,a,r){void 0===r&&(r={}),e.call(this,r,[t]);var i,n,s,o=t,l=$(a),p=this;if(0===l.length){var c="Framework7: can't create a View instance because ";throw new Error(c+="string"==typeof a?'the selector "'+a+"\" didn't match any element":"el must be an HTMLElement or Dom7 object")}return p.params=Utils.extend({routes:[],routesAdd:[]},o.params.view,r),p.params.routes.length>0?p.routes=p.params.routes:p.routes=[].concat(o.routes,p.params.routesAdd),i="string"==typeof a?a:(l.attr("id")?"#"+l.attr("id"):"")+(l.attr("class")?"."+l.attr("class").replace(/ /g,".").replace(".active",""):""),"ios"===o.theme&&p.params.iosDynamicNavbar&&0===(n=l.children(".navbars").eq(0)).length&&(n=$('
')),Utils.extend(!1,p,{app:o,$el:l,el:l[0],name:p.params.name,main:p.params.main||l.hasClass("view-main"),$navbarsEl:n,navbarsEl:n?n[0]:void 0,selector:i,history:[],scrollHistory:{}}),l[0].f7View=p,p.useModules(),o.views.push(p),p.main&&(o.views.main=p),p.name&&(o.views[p.name]=p),p.index=o.views.indexOf(p),s=p.name?"view_"+p.name:p.main?"view_main":"view_"+p.index,p.id=s,o.initialized?p.init():o.on("init",(function(){p.init()})),p}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.destroy=function(){var e=this,t=e.app;e.$el.trigger("view:beforedestroy"),e.emit("local::beforeDestroy viewBeforeDestroy",e),t.off("resize",e.checkMasterDetailBreakpoint),e.main?(t.views.main=null,delete t.views.main):e.name&&(t.views[e.name]=null,delete t.views[e.name]),e.$el[0].f7View=null,delete e.$el[0].f7View,t.views.splice(t.views.indexOf(e),1),e.params.router&&e.router&&e.router.destroy(),e.emit("local::destroy viewDestroy",e),Object.keys(e).forEach((function(t){e[t]=null,delete e[t]})),e=null},t.prototype.checkMasterDetailBreakpoint=function(e){var t=this.app,a=this.$el.hasClass("view-master-detail"),r=t.width>=this.params.masterDetailBreakpoint&&this.$el.children(".page-master").length;void 0===e&&r||!0===e?(this.$el.addClass("view-master-detail"),a||(this.emit("local::masterDetailBreakpoint viewMasterDetailBreakpoint",this),this.$el.trigger("view:masterDetailBreakpoint"))):(this.$el.removeClass("view-master-detail"),a&&(this.emit("local::masterDetailBreakpoint viewMasterDetailBreakpoint",this),this.$el.trigger("view:masterDetailBreakpoint")))},t.prototype.initMasterDetail=function(){var e=this.app;this.checkMasterDetailBreakpoint=this.checkMasterDetailBreakpoint.bind(this),this.checkMasterDetailBreakpoint(),this.params.masterDetailResizable&&resizableView(this),e.on("resize",this.checkMasterDetailBreakpoint)},t.prototype.init=function(){this.params.router&&(this.params.masterDetailBreakpoint>0&&this.initMasterDetail(),this.router.init(),this.$el.trigger("view:init"),this.emit("local::init viewInit",this))},t}(Framework7Class);function initClicks(e){e.on("click",(function(t){var a=$(t.target),r=a.closest("a"),i=r.length>0,n=i&&r.attr("href");if(i&&(r.is(e.params.clicks.externalLinks)||n&&n.indexOf("javascript:")>=0)){var s=r.attr("target");n&&win.cordova&&win.cordova.InAppBrowser&&("_system"===s||"_blank"===s)&&(t.preventDefault(),win.cordova.InAppBrowser.open(n,s))}else{Object.keys(e.modules).forEach((function(r){var i=e.modules[r].clicks;i&&(t.preventF7Router||Object.keys(i).forEach((function(r){var n=a.closest(r).eq(0);n.length>0&&i[r].call(e,n,n.dataset(),t)})))}));var o={};if(i&&(t.preventDefault(),o=r.dataset()),!t.preventF7Router)if(!r.hasClass("prevent-router")&&!r.hasClass("router-prevent"))if(n&&n.length>0&&"#"!==n[0]||r.hasClass("back")){var l;if(o.view&&"current"===o.view?l=e.views.current:o.view?l=$(o.view)[0].f7View:(l=a.parents(".view")[0]&&a.parents(".view")[0].f7View,!r.hasClass("back")&&l&&l.params.linksView&&("string"==typeof l.params.linksView?l=$(l.params.linksView)[0].f7View:l.params.linksView instanceof View&&(l=l.params.linksView))),l||e.views.main&&(l=e.views.main),!l||!l.router)return;if(o.context&&"string"==typeof o.context)try{o.context=JSON.parse(o.context)}catch(e){}r[0].f7RouteProps&&(o.props=r[0].f7RouteProps),r.hasClass("back")?l.router.back(n,o):l.router.navigate(n,o)}}}))}View.use(RouterModule);var ClicksModule={name:"clicks",params:{clicks:{externalLinks:".external"}},on:{init:function(){initClicks(this)}}},RouterTemplateLoaderModule={name:"routerTemplateLoader",proto:{templateLoader:function(e,t,a,r,i){var n=this;function s(e){var t,s;try{if("function"==typeof(s=a.context||{}))s=s.call(n);else if("string"==typeof s)try{s=JSON.parse(s)}catch(e){throw i(),e}t="function"==typeof e?e(s):Template7.compile(e)(Utils.extend({},s||{},{$app:n.app,$root:Utils.extend({},n.app.data,n.app.methods),$route:a.route,$f7route:a.route,$router:n,$f7router:n,$theme:{ios:"ios"===n.app.theme,md:"md"===n.app.theme,aurora:"aurora"===n.app.theme}}))}catch(e){throw i(),e}r(t,{context:s})}t?(n.xhr&&(n.xhr.abort(),n.xhr=!1),n.xhrRequest(t,a).then((function(e){s(e)})).catch((function(){i()}))):s(e)},modalTemplateLoader:function(e,t,a,r,i){return this.templateLoader(e,t,a,(function(e){r(e)}),i)},tabTemplateLoader:function(e,t,a,r,i){return this.templateLoader(e,t,a,(function(e){r(e)}),i)},pageTemplateLoader:function(e,t,a,r,i){var n=this;return n.templateLoader(e,t,a,(function(e,t){void 0===t&&(t={}),r(n.getPageEl(e),t)}),i)}}},RouterComponentLoaderModule={name:"routerComponentLoader",proto:{componentLoader:function(e,t,a,r,i){void 0===a&&(a={});var n,s=this,o=s.app,l="string"==typeof e?e:t,p=s.replaceRequestUrlParams(l,a);function c(e){var t=a.context||{};if("function"==typeof t)t=t.call(s);else if("string"==typeof t)try{t=JSON.parse(t)}catch(e){throw i(e),e}var n=Utils.merge({},t,{$route:a.route,$f7route:a.route,$router:s,$f7router:s,$theme:{ios:"ios"===o.theme,md:"md"===o.theme,aurora:"aurora"===o.theme}});a.componentOptions&&a.componentOptions.el&&(e.el=a.componentOptions.el),a.componentOptions&&a.componentOptions.root&&(e.root=a.componentOptions.root),o.component.create(e,n).then((function(e){r(e.el)})).catch((function(e){throw i(e),new Error(e)}))}p&&s.params.componentCache&&s.cache.components.forEach((function(e){e.url===p&&(n=e.component)})),p&&n?c(n):p&&!n?(s.xhr&&(s.xhr.abort(),s.xhr=!1),s.xhrRequest(l,a).then((function(e){var t=o.component.parse(e);s.params.componentCache&&s.cache.components.push({url:p,component:t}),c(t)})).catch((function(e){throw i(),e}))):c(e)},modalComponentLoader:function(e,t,a,r,i,n){this.componentLoader(t,a,r,(function(e){i(e)}),n)},tabComponentLoader:function(e,t,a,r,i,n){this.componentLoader(t,a,r,(function(e){i(e)}),n)},pageComponentLoader:function(e,t,a,r,i,n){this.componentLoader(t,a,r,(function(e,t){void 0===t&&(t={}),i(e,t)}),n)}}};function vnode(e,t,a,r,i){return{sel:e,data:t,children:a,text:r,elm:i,key:void 0===t?void 0:t.key}}var array=Array.isArray;function primitive(e){return"string"==typeof e||"number"==typeof e}function addNS(e,t,a){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==a&&void 0!==t)for(var r=0;r0&&customComponents[i];if(d&&(s.push((function(a){(a.sel===i||c)&&createCustomComponent({app:t,vnode:a,tagName:i,data:e})})),o.push((function(e){destroyCustomComponent(e)})),l.push((function(e,t){updateCustomComponent(t)}))),!d){if(!e||!e.attrs||!e.attrs.class)return n;e.attrs.class.split(" ").forEach((function(e){a||s.push.apply(s,t.getVnodeHooks("insert",e)),o.push.apply(o,t.getVnodeHooks("destroy",e)),l.push.apply(l,t.getVnodeHooks("update",e)),p.push.apply(p,t.getVnodeHooks("postpatch",e))}))}return r&&!a&&p.push((function(e,t){var a=t||e;a&&a.data&&a.data.context&&a.data.context.$options.updated&&a.data.context.$hook("updated")})),0===s.length&&0===o.length&&0===l.length&&0===p.length||(s.length&&(n.insert=function(e){s.forEach((function(t){return t(e)}))}),o.length&&(n.destroy=function(e){o.forEach((function(t){return t(e)}))}),l.length&&(n.update=function(e,t){l.forEach((function(a){return a(e,t)}))}),p.length&&(n.postpatch=function(e,t){p.forEach((function(a){return a(e,t)}))})),n}function getEventHandler(e,t,a){void 0===a&&(a={});var r,i,n=a.stop,s=a.prevent,o=a.once,l=!1,p=!0;if((r=e.indexOf("(")<0?e:e.split("(")[0]).indexOf(".")>=0)r.split(".").forEach((function(e,a){if(0!==a||"this"!==e){if(0===a&&"window"===e)return i=win,void(p=!1);if(i||(i=t),!i[e])throw new Error("Framework7: Component doesn't have method \""+r.split(".").slice(0,a+1).join(".")+'"');i=i[e]}}));else{if(!t[r])throw new Error("Framework7: Component doesn't have method \""+r+'"');i=t[r]}return p&&(i=i.bind(t)),function(){for(var a=[],r=arguments.length;r--;)a[r]=arguments[r];var p=a[0],c=[];if(!o||!l){if(n&&p.stopPropagation(),s&&p.preventDefault(),l=!0,e.indexOf("(")<0)c=a;else{var d=e.split("(")[1].split(")")[0].replace(/'[^']*'|"[^"]*"/g,(function(e){return e.replace(/,/g,"<_comma_>")})).split(",").map((function(e){return e.replace(/<_comma_>/g,",")}));d.forEach((function(e){var a=e.trim();if(isNaN(a))if("true"===a)a=!0;else if("false"===a)a=!1;else if("null"===a)a=null;else if("undefined"===a)a=void 0;else if('"'===a[0])a=a.replace(/"/g,"");else if("'"===a[0])a=a.replace(/'/g,"");else if(a.indexOf(".")>0){var r;a.split(".").forEach((function(e){r||(r=t),r=r[e]})),a=r}else a=t[a];else a=parseFloat(a);c.push(a)}))}i.apply(void 0,c)}}}function getData(e,t,a,r,i,n){var s={context:t},o=e.attributes;Array.prototype.forEach.call(o,(function(e){var a=e.name,r=e.value;if(propsAttrs.indexOf(a)>=0)s.props||(s.props={}),"readonly"===a&&(a="readOnly"),"option"===n&&"value"===a&&(s.attrs||(s.attrs={}),s.attrs.value=r),booleanProps.indexOf(a)>=0?s.props[a]=!1!==r:s.props[a]=r;else if("key"===a)s.key=r;else if(0===a.indexOf("@")){s.on||(s.on={});var o=a.substr(1),l=!1,p=!1,c=!1;o.indexOf(".")>=0&&o.split(".").forEach((function(e,t){0===t?o=e:("stop"===e&&(l=!0),"prevent"===e&&(p=!0),"once"===e&&(c=!0))})),s.on[o]=getEventHandler(r,t,{stop:l,prevent:p,once:c})}else if("style"===a)if(r.indexOf("{")>=0&&r.indexOf("}")>=0)try{s.style=JSON.parse(r)}catch(e){s.attrs||(s.attrs={}),s.attrs.style=r}else s.attrs||(s.attrs={}),s.attrs.style=r;else s.attrs||(s.attrs={}),s.attrs[a]=r,"id"!==a||s.key||i||(s.key=r)})),i&&t&&t.$id&&t.$style&&t.$styleScoped&&(s.attrs||(s.attrs={}),s.attrs["data-f7-"+t.$id]="");var l=getHooks(s,a,r,i,n);return l.prepatch=function(e,t){e&&t&&e&&e.data&&e.data.props&&Object.keys(e.data.props).forEach((function(a){booleanProps.indexOf(a)<0||(t.data||(t.data={}),t.data.props||(t.data.props={}),!0!==e.data.props[a]||a in t.data.props||(t.data.props[a]=!1))}))},l&&(s.hook=l),s}function getChildren(e,t,a,r){for(var i=[],n=e.childNodes,s=0;s=0?[]:getChildren(e,t,a,r))}function vdom(e,t,a){void 0===e&&(e="");var r,i=e.trim(),n=tempDomDIV;0===i.indexOf("0?l:o.length,u=c>0?c:o.length,h=-1!==l||-1!==c?o.slice(0,Math.min(d,u)):o,f=e.elm=isDef(r)&&isDef(a=r.ns)?n.createElementNS(a,h):n.createElement(h);for(d0&&f.setAttribute("class",o.slice(u+1).replace(/\./g," ")),a=0;af?c(e,null==a[g+1]?null:a[g+1].elm,a,d,g,r):u(e,t,l,f))}(o,l,d,a):isDef(d)?(isDef(e.text)&&n.setTextContent(o,""),c(o,null,d,0,d.length-1,a)):isDef(l)?u(o,l,0,l.length-1):isDef(e.text)&&n.setTextContent(o,""):e.text!==t.text&&n.setTextContent(o,t.text),isDef(s)&&isDef(r=s.postpatch)&&r(e,t)}}return function(e,t){var a,r,s,l=[];for(a=0;a0;)a[r]=arguments[r+1];handleEvent(t,a,e.vnode)}}function updateEvents(e,t){var a=e.data.on,r=e.listener,i=e.elm,n=t&&t.data.on,s=t&&t.elm;if(a!==n&&(a&&r&&(n?Object.keys(a).forEach((function(e){n[e]||$(i).off(e,r)})):Object.keys(a).forEach((function(e){$(i).off(e,r)}))),n)){var o=e.listener||createListener();t.listener=o,o.vnode=t,a?Object.keys(n).forEach((function(e){a[e]||$(s).on(e,o)})):Object.keys(n).forEach((function(e){$(s).on(e,o)}))}}var eventListenersModule={create:updateEvents,update:updateEvents,destroy:updateEvents},patch=init([attributesModule,propsModule,styleModule,eventListenersModule]),componentMixins={},Component=function(e,t,a,r){void 0===t&&(t={}),void 0===a&&(a={});var i=Utils.id(),n=this;Utils.merge(n,{$props:{}},a,{$:$,$$:$,$dom7:$,$app:e,$f7:e,$options:Utils.extend({id:i},t),$id:t.isClassComponent?n.constructor.id:t.id||i,$mixins:t.isClassComponent?n.constructor.mixins:t.mixins,$children:r||[],$isRootComponent:!!t.root});var s=n.$options;if(n.$mixins&&n.$mixins.length)for(var o=n.$mixins.length-1;o>=0;o-=1){var l=n.$mixins[o];"string"==typeof l&&(componentMixins[l]?n.$mixins[o]=componentMixins[l]:n.$mixins.splice(o,1))}Object.defineProperty(n,"$slots",{enumerable:!0,configurable:!0,get:function(){var e={};return n.$children.forEach((function(t){var a="default";t.data&&(a=t.data.attrs&&t.data.attrs.slot||"default"),e[a]||(e[a]=[]),e[a].push(t)})),e}}),Object.defineProperty(n,"$root",{enumerable:!0,configurable:!0,get:function(){if(n.$isRootComponent)return n;if(e.rootComponent)return n.$onRootUpdated||(n.$onRootUpdated=function(){return n.$update()},e.on("rootComponentUpdated",n.$onRootUpdated)),e.rootComponent;var t=Utils.merge({},e.data,e.methods);return win&&win.Proxy&&(t=new win.Proxy(t,{set:function(t,a,r){e.data[a]=r},deleteProperty:function(t,a){delete e.data[a],delete e.methods[a]},has:function(t,a){return a in e.data||a in e.methods}})),t},set:function(){}}),s.render&&(s.render=s.render.bind(n));var p={};return n.$mixins&&n.$mixins.length&&n.$mixins.forEach((function(e){e.methods&&Object.assign(p,e.methods)})),s.methods&&Object.assign(p,s.methods),Object.keys(p).forEach((function(e){n[e]=p[e].bind(n)})),s.on&&Object.keys(s.on).forEach((function(e){s.on[e]=s.on[e].bind(n)})),s.once&&Object.keys(s.once).forEach((function(e){s.once[e]=s.once[e].bind(n)})),n.$style=s.isClassComponent?n.constructor.style:s.style,n.$styleScoped=s.isClassComponent?n.constructor.styleScoped:s.styleScoped,n.__updateQueue=[],new Promise((function(e,t){n.$hook("data",!0).then((function(t){var a={};t.forEach((function(e){Object.assign(a,e||{})})),Utils.extend(n,a),n.$hook("beforeCreate");var r=n.$render();if(n.$options.el)return r=r.trim(),n.$vnode=vdom(r,n,!0),n.$style&&(n.$styleEl=doc.createElement("style"),n.$styleEl.innerHTML=n.$style),n.el=n.$options.el,patch(n.el,n.$vnode),n.el=n.$vnode.elm,n.$el=$(n.el),n.$attachEvents(),n.el.f7Component=n,n.$hook("created"),n.$mount(),void e(n);r&&"string"==typeof r?(r=r.trim(),n.$vnode=vdom(r,n,!0),n.el=doc.createElement(n.$vnode.sel||"div"),patch(n.el,n.$vnode),n.$el=$(n.el)):r&&(n.el=r,n.$el=$(n.el)),n.$style&&(n.$styleEl=doc.createElement("style"),n.$styleEl.innerHTML=n.$style),n.$attachEvents(),n.el&&(n.el.f7Component=n),n.$hook("created"),e(n)})).catch((function(e){t(e)}))}))};function parseComponent(e){var t,a=Utils.id(),r="f7_component_create_callback_"+a,i="f7_component_render_callback_"+a,n=e.match(//),s=n[2]||"t7";n&&(t=e.split(//).filter((function(e,t){return t>0})).join("").split("").filter((function(e,t,a){return t").replace(/{{#raw}}([ \n]*)([ \n]*){{\/raw}}/g,"/template>{{/raw}}").replace(/([ \n])([ \n])/g,"/template>{{/raw}}$1"));var o,l,p=null,c=!1;if(e.indexOf("")[0]:e.indexOf("")[0]).replace(/{{this}}/g,"[data-f7-"+a+"]").replace(/[\n]?([^{^}]*){/gi,(function(e,t){return t.indexOf('"')>=0||t.indexOf("'")>=0?e:"\n"+(t=t.split(",").map((function(e){return e.indexOf("@")>=0||e.indexOf("[data-f7-"+a+"]")>=0?e:"[data-f7-"+a+"] "+e.trim()})).join(", "))+" {"}))),e.indexOf("')[0].trim();\n } else {\n scriptContent = 'return () => {return $render}';\n }\n if (!scriptContent || !scriptContent.trim()) scriptContent = 'return () => {return $render}';\n\n // Parse Template\n if (template) {\n scriptContent = scriptContent.replace('$render', `function ($$ctx) {\n var $ = $$ctx.$$;\n var $h = $$ctx.$h;\n var $root = $$ctx.$root;\n var $f7 = $$ctx.$f7;\n var $f7route = $$ctx.$f7route;\n var $f7router = $$ctx.$f7router;\n var $theme = $$ctx.$theme;\n var $update = $$ctx.$update;\n var $store = $$ctx.$store;\n var $ref = $$ctx.$ref;\n var $useState = $$ctx.$useState;\n\n return $h\\`${template}\\`\n }\n `).replace(/export default/g, 'return');\n }\n\n // Execute Script\n scriptContent = `window.${callbackCreateName} = function () {${scriptContent}}`;\n\n // Insert Script El\n const scriptEl = document.createElement('script');\n scriptEl.innerHTML = scriptContent;\n $('head').append(scriptEl);\n const component = window[callbackCreateName]();\n\n // Remove Script El\n $(scriptEl).remove();\n window[callbackCreateName] = null;\n delete window[callbackCreateName];\n\n // Assign Style\n if (style) {\n component.style = style;\n }\n\n // Component ID\n component.id = componentId;\n return component;\n}\nexport default parseComponent;", "import Component from './component-class.js';\nimport parseComponent from './parse-component.js';\nimport customComponents from './custom-components.js';\nimport $jsx from './$jsx.js';\nfunction registerComponent(tagName, component) {\n customComponents[tagName] = component;\n}\nfunction unregisterComponent(tagName) {\n delete customComponents[tagName];\n}\nexport { Component, $jsx };\nexport default {\n name: 'component',\n static: {\n Component,\n parseComponent,\n registerComponent,\n unregisterComponent\n },\n create() {\n const app = this;\n app.component = {\n registerComponent,\n unregisterComponent,\n parse(componentString) {\n return parseComponent(componentString);\n },\n create(component, props, _ref) {\n let {\n root,\n el,\n context,\n children\n } = _ref;\n return new Component(app, component, props, {\n root,\n el,\n context,\n children\n });\n }\n };\n }\n};", "import History from '../../shared/history.js';\nexport default {\n name: 'history',\n static: {\n history: History\n },\n on: {\n init() {\n History.init(this);\n }\n }\n};", "import { getWindow } from 'ssr-window';\nimport { extend } from '../../shared/utils.js';\nconst SW = {\n registrations: [],\n register(path, scope) {\n const app = this;\n const window = getWindow();\n if (!('serviceWorker' in window.navigator) || !app.serviceWorker.container) {\n return new Promise((resolve, reject) => {\n reject(new Error('Service worker is not supported'));\n });\n }\n return new Promise((resolve, reject) => {\n app.serviceWorker.container.register(path, scope ? {\n scope\n } : {}).then(reg => {\n SW.registrations.push(reg);\n app.emit('serviceWorkerRegisterSuccess', reg);\n resolve(reg);\n }).catch(error => {\n app.emit('serviceWorkerRegisterError', error);\n reject(error);\n });\n });\n },\n unregister(registration) {\n const app = this;\n const window = getWindow();\n if (!('serviceWorker' in window.navigator) || !app.serviceWorker.container) {\n return new Promise((resolve, reject) => {\n reject(new Error('Service worker is not supported'));\n });\n }\n let registrations;\n if (!registration) registrations = SW.registrations;else if (Array.isArray(registration)) registrations = registration;else registrations = [registration];\n return Promise.all(registrations.map(reg => new Promise((resolve, reject) => {\n reg.unregister().then(() => {\n if (SW.registrations.indexOf(reg) >= 0) {\n SW.registrations.splice(SW.registrations.indexOf(reg), 1);\n }\n app.emit('serviceWorkerUnregisterSuccess', reg);\n resolve();\n }).catch(error => {\n app.emit('serviceWorkerUnregisterError', reg, error);\n reject(error);\n });\n })));\n }\n};\nexport default {\n name: 'sw',\n params: {\n serviceWorker: {\n path: undefined,\n scope: undefined\n }\n },\n create() {\n const app = this;\n const window = getWindow();\n extend(app, {\n serviceWorker: {\n container: 'serviceWorker' in window.navigator ? window.navigator.serviceWorker : undefined,\n registrations: SW.registrations,\n register: SW.register.bind(app),\n unregister: SW.unregister.bind(app)\n }\n });\n },\n on: {\n init() {\n const window = getWindow();\n if (!('serviceWorker' in window.navigator)) return;\n const app = this;\n if (app.device.cordova || window.Capacitor && window.Capacitor.isNative) return;\n if (!app.serviceWorker.container) return;\n const paths = app.params.serviceWorker.path;\n const scope = app.params.serviceWorker.scope;\n if (!paths || Array.isArray(paths) && !paths.length) return;\n const toRegister = Array.isArray(paths) ? paths : [paths];\n toRegister.forEach(path => {\n app.serviceWorker.register(path, scope);\n });\n }\n }\n};", "/* eslint-disable no-underscore-dangle */\nimport { extend } from '../../shared/utils.js';\nfunction createStore(storeParams) {\n if (storeParams === void 0) {\n storeParams = {};\n }\n const store = {\n __store: true\n };\n const originalState = {\n ...(storeParams.state || {})\n };\n const actions = {\n ...(storeParams.actions || {})\n };\n const getters = {\n ...(storeParams.getters || {})\n };\n const state = extend({}, originalState);\n let propsQueue = [];\n const gettersDependencies = {};\n const gettersCallbacks = {};\n Object.keys(getters).forEach(getterKey => {\n gettersDependencies[getterKey] = [];\n gettersCallbacks[getterKey] = [];\n });\n const getGetterValue = getterKey => {\n return getters[getterKey]({\n state: store.state\n });\n };\n const addGetterDependencies = (getterKey, deps) => {\n if (!gettersDependencies[getterKey]) gettersDependencies[getterKey] = [];\n deps.forEach(dep => {\n if (gettersDependencies[getterKey].indexOf(dep) < 0) {\n gettersDependencies[getterKey].push(dep);\n }\n });\n };\n const addGetterCallback = (getterKey, callback) => {\n if (!gettersCallbacks[getterKey]) gettersCallbacks[getterKey] = [];\n gettersCallbacks[getterKey].push(callback);\n };\n const runGetterCallbacks = stateKey => {\n const keys = Object.keys(gettersDependencies).filter(getterKey => {\n return gettersDependencies[getterKey].indexOf(stateKey) >= 0;\n });\n keys.forEach(getterKey => {\n if (!gettersCallbacks[getterKey] || !gettersCallbacks[getterKey].length) return;\n gettersCallbacks[getterKey].forEach(callback => {\n callback(getGetterValue(getterKey));\n });\n });\n };\n const removeGetterCallback = callback => {\n Object.keys(gettersCallbacks).forEach(stateKey => {\n const callbacks = gettersCallbacks[stateKey];\n if (callbacks.indexOf(callback) >= 0) {\n callbacks.splice(callbacks.indexOf(callback), 1);\n }\n });\n };\n\n // eslint-disable-next-line\n store.__removeCallback = callback => {\n removeGetterCallback(callback);\n };\n const getterValue = function (getterKey, addCallback) {\n if (addCallback === void 0) {\n addCallback = true;\n }\n if (getterKey === 'constructor') return undefined;\n propsQueue = [];\n const value = getGetterValue(getterKey);\n addGetterDependencies(getterKey, propsQueue);\n const onUpdated = callback => {\n addGetterCallback(getterKey, callback);\n };\n const obj = {\n value,\n onUpdated\n };\n if (!addCallback) {\n return obj;\n }\n const callback = v => {\n obj.value = v;\n };\n obj.__callback = callback;\n addGetterCallback(getterKey, callback);\n // eslint-disable-next-line\n return obj;\n };\n store.state = new Proxy(state, {\n set: (target, prop, value) => {\n target[prop] = value;\n runGetterCallbacks(prop);\n return true;\n },\n get: (target, prop) => {\n propsQueue.push(prop);\n return target[prop];\n }\n });\n store.getters = new Proxy(getters, {\n set: () => false,\n get: (target, prop) => {\n if (!target[prop]) {\n return undefined;\n }\n return getterValue(prop, true);\n }\n });\n store._gettersPlain = new Proxy(getters, {\n set: () => false,\n get: (target, prop) => {\n if (!target[prop]) {\n return undefined;\n }\n return getterValue(prop, false);\n }\n });\n store.dispatch = (actionName, data) => {\n return new Promise((resolve, reject) => {\n if (!actions[actionName]) {\n reject();\n throw new Error(`Framework7: Store action \"${actionName}\" is not found`);\n }\n const result = actions[actionName]({\n state: store.state,\n dispatch: store.dispatch\n }, data);\n resolve(result);\n });\n };\n return store;\n}\nexport default createStore;", "import createStore from './create-store.js';\nexport { createStore };\nexport default {\n name: 'store',\n static: {\n createStore\n },\n proto: {\n createStore\n }\n};", "import { getWindow } from 'ssr-window';\nimport $ from '../../shared/dom7.js';\nimport { bindMethods } from '../../shared/utils.js';\nimport { getDevice } from '../../shared/get-device.js';\nconst isCapacitor = () => {\n const window = getWindow();\n return window.Capacitor && window.Capacitor.isNative && window.Capacitor.Plugins && window.Capacitor.Plugins.StatusBar;\n};\nconst Statusbar = {\n hide() {\n const window = getWindow();\n const device = getDevice();\n if (device.cordova && window.StatusBar) {\n window.StatusBar.hide();\n }\n if (isCapacitor()) {\n window.Capacitor.Plugins.StatusBar.hide();\n }\n },\n show() {\n const window = getWindow();\n const device = getDevice();\n if (device.cordova && window.StatusBar) {\n window.StatusBar.show();\n }\n if (isCapacitor()) {\n window.Capacitor.Plugins.StatusBar.show();\n }\n },\n onClick() {\n const app = this;\n let pageContent;\n if ($('.popup.modal-in').length > 0) {\n // Check for opened popup\n pageContent = $('.popup.modal-in').find('.page:not(.page-previous):not(.page-next):not(.cached)').find('.page-content');\n } else if ($('.panel.panel-in').length > 0) {\n // Check for opened panel\n pageContent = $('.panel.panel-in').find('.page:not(.page-previous):not(.page-next):not(.cached)').find('.page-content');\n } else if ($('.views > .view.tab-active').length > 0) {\n // View in tab bar app layout\n pageContent = $('.views > .view.tab-active').find('.page:not(.page-previous):not(.page-next):not(.cached)').find('.page-content');\n } else if ($('.views').length > 0) {\n pageContent = $('.views').find('.page:not(.page-previous):not(.page-next):not(.cached)').find('.page-content');\n } else {\n pageContent = app.$el.children('.view').find('.page:not(.page-previous):not(.page-next):not(.cached)').find('.page-content');\n }\n if (pageContent && pageContent.length > 0) {\n // Check for tab\n if (pageContent.hasClass('tab')) {\n pageContent = pageContent.parent('.tabs').children('.page-content.tab-active');\n }\n if (pageContent.length > 0) pageContent.scrollTop(0, 300);\n }\n },\n setTextColor(color) {\n const window = getWindow();\n const device = getDevice();\n if (device.cordova && window.StatusBar) {\n if (color === 'white') {\n window.StatusBar.styleLightContent();\n } else {\n window.StatusBar.styleDefault();\n }\n }\n if (isCapacitor()) {\n if (color === 'white') {\n window.Capacitor.Plugins.StatusBar.setStyle({\n style: 'DARK'\n });\n } else {\n window.Capacitor.Plugins.StatusBar.setStyle({\n style: 'LIGHT'\n });\n }\n }\n },\n setBackgroundColor(color) {\n const window = getWindow();\n const device = getDevice();\n if (device.cordova && window.StatusBar) {\n window.StatusBar.backgroundColorByHexString(color);\n }\n if (isCapacitor()) {\n window.Capacitor.Plugins.StatusBar.setBackgroundColor({\n color\n });\n }\n },\n isVisible() {\n const window = getWindow();\n const device = getDevice();\n return new Promise(resolve => {\n if (device.cordova && window.StatusBar) {\n resolve(window.StatusBar.isVisible);\n }\n if (isCapacitor()) {\n window.Capacitor.Plugins.StatusBar.getInfo().then(info => {\n resolve(info.visible);\n });\n }\n resolve(false);\n });\n },\n overlaysWebView(overlays) {\n if (overlays === void 0) {\n overlays = true;\n }\n const window = getWindow();\n const device = getDevice();\n if (device.cordova && window.StatusBar) {\n window.StatusBar.overlaysWebView(overlays);\n }\n if (isCapacitor()) {\n window.Capacitor.Plugins.StatusBar.setOverlaysWebView({\n overlay: overlays\n });\n }\n },\n init() {\n const app = this;\n const window = getWindow();\n const device = getDevice();\n const params = app.params.statusbar;\n if (!params.enabled) return;\n const isCordova = device.cordova && window.StatusBar;\n const isCap = isCapacitor();\n if (isCordova || isCap) {\n if (params.scrollTopOnClick) {\n $(window).on('statusTap', Statusbar.onClick.bind(app));\n }\n if (device.ios) {\n if (params.iosOverlaysWebView) {\n Statusbar.overlaysWebView(true);\n } else {\n Statusbar.overlaysWebView(false);\n }\n if (params.iosTextColor === 'white') {\n Statusbar.setTextColor('white');\n } else {\n Statusbar.setTextColor('black');\n }\n }\n if (device.android) {\n if (params.androidOverlaysWebView) {\n Statusbar.overlaysWebView(true);\n } else {\n Statusbar.overlaysWebView(false);\n }\n if (params.androidTextColor === 'white') {\n Statusbar.setTextColor('white');\n } else {\n Statusbar.setTextColor('black');\n }\n }\n }\n if (params.iosBackgroundColor && device.ios) {\n Statusbar.setBackgroundColor(params.iosBackgroundColor);\n }\n if (params.androidBackgroundColor && device.android) {\n Statusbar.setBackgroundColor(params.androidBackgroundColor);\n }\n }\n};\nexport default {\n name: 'statusbar',\n params: {\n statusbar: {\n enabled: true,\n scrollTopOnClick: true,\n iosOverlaysWebView: true,\n iosTextColor: 'black',\n iosBackgroundColor: null,\n androidOverlaysWebView: false,\n androidTextColor: 'black',\n androidBackgroundColor: null\n }\n },\n create() {\n const app = this;\n bindMethods(app, {\n statusbar: Statusbar\n });\n },\n on: {\n init() {\n const app = this;\n Statusbar.init.call(app);\n }\n }\n};", "import $ from '../../shared/dom7.js';\nimport { extend } from '../../shared/utils.js';\nimport View from './view-class.js';\nfunction getCurrentView(app) {\n const $popoverView = $('.popover.modal-in .view');\n const $popupView = $('.popup.modal-in .view');\n const $panelView = $('.panel.panel-in .view');\n let $viewsEl = $('.views');\n if ($viewsEl.length === 0) $viewsEl = app.$el;\n // Find active view as tab\n let $viewEl = $viewsEl.children('.view');\n if ($viewEl.length === 0) {\n $viewEl = $viewsEl.children('.tabs').children('.view');\n }\n // Propably in tabs or split view\n if ($viewEl.length > 1) {\n if ($viewEl.hasClass('tab')) {\n // Tabs\n $viewEl = $viewsEl.children('.view.tab-active');\n if ($viewEl.length === 0) {\n $viewEl = $viewsEl.children('.tabs').children('.view.tab-active');\n }\n } else {\n // Split View, leave appView intact\n }\n }\n if ($popoverView.length > 0 && $popoverView[0].f7View) return $popoverView[0].f7View;\n if ($popupView.length > 0 && $popupView[0].f7View) return $popupView[0].f7View;\n if ($panelView.length > 0 && $panelView[0].f7View) return $panelView[0].f7View;\n if ($viewEl.length > 0) {\n if ($viewEl.length === 1 && $viewEl[0].f7View) return $viewEl[0].f7View;\n if ($viewEl.length > 1) {\n return app.views.main;\n }\n }\n return undefined;\n}\nexport default {\n name: 'view',\n params: {\n view: {\n init: true,\n initRouterOnTabShow: false,\n name: undefined,\n main: false,\n router: true,\n linksView: null,\n xhrCache: true,\n xhrCacheIgnore: [],\n xhrCacheIgnoreGetParameters: false,\n xhrCacheDuration: 1000 * 60 * 10,\n // Ten minutes\n componentCache: true,\n preloadPreviousPage: true,\n allowDuplicateUrls: false,\n reloadPages: false,\n reloadDetail: false,\n masterDetailBreakpoint: 0,\n masterDetailResizable: false,\n removeElements: true,\n removeElementsWithTimeout: false,\n removeElementsTimeout: 0,\n restoreScrollTopOnBack: true,\n unloadTabContent: true,\n passRouteQueryToRequest: true,\n passRouteParamsToRequest: false,\n loadInitialPage: true,\n // Swipe Back\n iosSwipeBack: true,\n iosSwipeBackAnimateShadow: true,\n iosSwipeBackAnimateOpacity: true,\n iosSwipeBackActiveArea: 30,\n iosSwipeBackThreshold: 0,\n mdSwipeBack: false,\n mdSwipeBackAnimateShadow: true,\n mdSwipeBackAnimateOpacity: false,\n mdSwipeBackActiveArea: 30,\n mdSwipeBackThreshold: 0,\n // Push State\n browserHistory: false,\n browserHistoryRoot: undefined,\n browserHistoryAnimate: true,\n browserHistoryAnimateOnLoad: false,\n browserHistorySeparator: '#!',\n browserHistoryOnLoad: true,\n browserHistoryInitialMatch: false,\n browserHistoryStoreHistory: true,\n browserHistoryTabs: 'replace',\n // Animate Pages\n animate: true,\n // iOS Dynamic Navbar\n iosDynamicNavbar: true,\n // Animate iOS Navbar Back Icon\n iosAnimateNavbarBackIcon: true,\n // Delays\n iosPageLoadDelay: 0,\n mdPageLoadDelay: 0,\n // Routes hooks\n routesBeforeEnter: null,\n routesBeforeLeave: null\n }\n },\n static: {\n View\n },\n create() {\n const app = this;\n extend(app, {\n views: extend([], {\n create(el, params) {\n return new View(app, el, params);\n },\n get(viewEl) {\n const $viewEl = $(viewEl);\n if ($viewEl.length && $viewEl[0].f7View) return $viewEl[0].f7View;\n return undefined;\n }\n })\n });\n Object.defineProperty(app.views, 'current', {\n enumerable: true,\n configurable: true,\n get() {\n return getCurrentView(app);\n }\n });\n // Alias\n app.view = app.views;\n },\n on: {\n init() {\n const app = this;\n $('.view-init').each(viewEl => {\n if (viewEl.f7View) return;\n const viewParams = $(viewEl).dataset();\n app.views.create(viewEl, viewParams);\n });\n },\n 'modalOpen panelOpen': function onOpen(instance) {\n const app = this;\n instance.$el.find('.view-init').each(viewEl => {\n if (viewEl.f7View) return;\n const viewParams = $(viewEl).dataset();\n app.views.create(viewEl, viewParams);\n });\n },\n 'modalBeforeDestroy panelBeforeDestroy': function onClose(instance) {\n if (!instance || !instance.$el) return;\n instance.$el.find('.view-init').each(viewEl => {\n const view = viewEl.f7View;\n if (!view) return;\n view.destroy();\n });\n }\n },\n vnode: {\n 'view-init': {\n insert(vnode) {\n const app = this;\n const viewEl = vnode.elm;\n if (viewEl.f7View) return;\n const viewParams = $(viewEl).dataset();\n app.views.create(viewEl, viewParams);\n },\n destroy(vnode) {\n const viewEl = vnode.elm;\n const view = viewEl.f7View;\n if (!view) return;\n view.destroy();\n }\n }\n }\n};", "import $ from '../../shared/dom7.js';\nimport { bindMethods } from '../../shared/utils.js';\nimport { getSupport } from '../../shared/get-support.js';\nconst Navbar = {\n size(el) {\n const app = this;\n let $el = $(el);\n if ($el.hasClass('navbars')) {\n $el = $el.children('.navbar').each(navbarEl => {\n app.navbar.size(navbarEl);\n });\n return;\n }\n const $innerEl = $el.children('.navbar-inner');\n if (!$innerEl.length) return;\n const needCenterTitle = $innerEl.hasClass('navbar-inner-centered-title') || app.params.navbar[`${app.theme}CenterTitle`];\n const needLeftTitle = app.theme === 'ios' && !app.params.navbar[`${app.theme}CenterTitle`];\n if (!needCenterTitle && !needLeftTitle) return;\n if ($el.parents('.tab:not(.tab-active)').length > 0 || $el.parents('.popup:not(.modal-in)').length > 0) {\n return;\n }\n if (app.theme !== 'ios' && app.params.navbar[`${app.theme}CenterTitle`]) {\n $innerEl.addClass('navbar-inner-centered-title');\n }\n if (app.theme === 'ios' && !app.params.navbar.iosCenterTitle) {\n $innerEl.addClass('navbar-inner-left-title');\n }\n const $viewEl = $el.parents('.view').eq(0);\n const left = app.rtl ? $innerEl.children('.right') : $innerEl.children('.left');\n const right = app.rtl ? $innerEl.children('.left') : $innerEl.children('.right');\n const title = $innerEl.children('.title');\n const subnavbar = $innerEl.children('.subnavbar');\n const noLeft = left.length === 0;\n const noRight = right.length === 0;\n const leftWidth = noLeft ? 0 : left.outerWidth(true);\n const rightWidth = noRight ? 0 : right.outerWidth(true);\n const titleWidth = title.outerWidth(true);\n const navbarStyles = $innerEl.styles();\n const navbarWidth = $innerEl[0].offsetWidth;\n const navbarInnerWidth = navbarWidth - parseInt(navbarStyles.paddingLeft, 10) - parseInt(navbarStyles.paddingRight, 10);\n const isPrevious = $el.hasClass('navbar-previous');\n const sliding = $innerEl.hasClass('sliding');\n let router;\n let dynamicNavbar;\n if ($viewEl.length > 0 && $viewEl[0].f7View) {\n router = $viewEl[0].f7View.router;\n dynamicNavbar = router && router.dynamicNavbar;\n }\n let currLeft;\n let diff;\n if (noRight) {\n currLeft = navbarInnerWidth - titleWidth;\n }\n if (noLeft) {\n currLeft = 0;\n }\n if (!noLeft && !noRight) {\n currLeft = (navbarInnerWidth - rightWidth - titleWidth + leftWidth) / 2;\n }\n let requiredLeft = (navbarInnerWidth - titleWidth) / 2;\n if (navbarInnerWidth - leftWidth - rightWidth > titleWidth) {\n if (requiredLeft < leftWidth) {\n requiredLeft = leftWidth;\n }\n if (requiredLeft + titleWidth > navbarInnerWidth - rightWidth) {\n requiredLeft = navbarInnerWidth - rightWidth - titleWidth;\n }\n diff = requiredLeft - currLeft;\n } else {\n diff = 0;\n }\n\n // RTL inverter\n const inverter = app.rtl ? -1 : 1;\n if (dynamicNavbar && app.theme === 'ios') {\n if (title.hasClass('sliding') || title.length > 0 && sliding) {\n let titleLeftOffset = -(currLeft + diff) * inverter;\n const titleRightOffset = (navbarInnerWidth - currLeft - diff - titleWidth) * inverter;\n if (isPrevious) {\n if (router && router.params.iosAnimateNavbarBackIcon) {\n const activeNavbarBackLink = $el.parent().find('.navbar-current').children('.left.sliding').find('.back .icon ~ span');\n if (activeNavbarBackLink.length > 0) {\n titleLeftOffset += activeNavbarBackLink[0].offsetLeft;\n }\n }\n }\n title[0].f7NavbarLeftOffset = titleLeftOffset;\n title[0].f7NavbarRightOffset = titleRightOffset;\n }\n if (!noLeft && (left.hasClass('sliding') || sliding)) {\n if (app.rtl) {\n left[0].f7NavbarLeftOffset = -(navbarInnerWidth - left[0].offsetWidth) / 2 * inverter;\n left[0].f7NavbarRightOffset = leftWidth * inverter;\n } else {\n left[0].f7NavbarLeftOffset = -leftWidth;\n left[0].f7NavbarRightOffset = (navbarInnerWidth - left[0].offsetWidth) / 2;\n if (router && router.params.iosAnimateNavbarBackIcon && left.find('.back .icon').length > 0) {\n if (left.find('.back .icon ~ span').length) {\n const leftOffset = left[0].f7NavbarLeftOffset;\n const rightOffset = left[0].f7NavbarRightOffset;\n left[0].f7NavbarLeftOffset = 0;\n left[0].f7NavbarRightOffset = 0;\n left.find('.back .icon ~ span')[0].f7NavbarLeftOffset = leftOffset;\n left.find('.back .icon ~ span')[0].f7NavbarRightOffset = rightOffset - left.find('.back .icon')[0].offsetWidth;\n }\n }\n }\n }\n if (!noRight && (right.hasClass('sliding') || sliding)) {\n if (app.rtl) {\n right[0].f7NavbarLeftOffset = -rightWidth * inverter;\n right[0].f7NavbarRightOffset = (navbarInnerWidth - right[0].offsetWidth) / 2 * inverter;\n } else {\n right[0].f7NavbarLeftOffset = -(navbarInnerWidth - right[0].offsetWidth) / 2;\n right[0].f7NavbarRightOffset = rightWidth;\n }\n }\n if (subnavbar.length && (subnavbar.hasClass('sliding') || sliding)) {\n subnavbar[0].f7NavbarLeftOffset = app.rtl ? subnavbar[0].offsetWidth : -subnavbar[0].offsetWidth;\n subnavbar[0].f7NavbarRightOffset = -subnavbar[0].f7NavbarLeftOffset;\n }\n }\n\n // Center title\n if (needCenterTitle) {\n let titleLeft = diff;\n if (app.rtl && noLeft && noRight && title.length > 0) titleLeft = -titleLeft;\n title.css({\n left: `${titleLeft}px`\n });\n }\n },\n hide(el, animate, hideStatusbar, hideOnlyCurrent) {\n if (animate === void 0) {\n animate = true;\n }\n if (hideStatusbar === void 0) {\n hideStatusbar = false;\n }\n if (hideOnlyCurrent === void 0) {\n hideOnlyCurrent = false;\n }\n const app = this;\n let $el = $(el);\n const isDynamic = $el.hasClass('navbar') && $el.parent('.navbars').length && !hideOnlyCurrent;\n if (isDynamic) $el = $el.parents('.navbars');\n if (!$el.length) return;\n if ($el.hasClass('navbar-hidden')) return;\n let className = `navbar-hidden${animate ? ' navbar-transitioning' : ''}`;\n const currentIsLarge = isDynamic ? $el.find('.navbar-current .title-large').length : $el.find('.title-large').length;\n if (currentIsLarge) {\n className += ' navbar-large-hidden';\n }\n if (hideStatusbar) {\n className += ' navbar-hidden-statusbar';\n }\n $el.transitionEnd(() => {\n $el.removeClass('navbar-transitioning');\n });\n $el.addClass(className);\n if (isDynamic) {\n $el.children('.navbar').each(subEl => {\n $(subEl).trigger('navbar:hide');\n app.emit('navbarHide', subEl);\n });\n } else {\n $el.trigger('navbar:hide');\n app.emit('navbarHide', $el[0]);\n }\n },\n show(el, animate, hideOnlyCurrent) {\n if (el === void 0) {\n el = '.navbar-hidden';\n }\n if (animate === void 0) {\n animate = true;\n }\n if (hideOnlyCurrent === void 0) {\n hideOnlyCurrent = false;\n }\n const app = this;\n let $el = $(el);\n const isDynamic = $el.hasClass('navbar') && $el.parent('.navbars').length && !hideOnlyCurrent;\n if (isDynamic) $el = $el.parents('.navbars');\n if (!$el.length) return;\n if (!$el.hasClass('navbar-hidden')) return;\n if (animate) {\n $el.addClass('navbar-transitioning');\n $el.transitionEnd(() => {\n $el.removeClass('navbar-transitioning');\n });\n }\n $el.removeClass('navbar-hidden navbar-large-hidden navbar-hidden-statusbar');\n if (isDynamic) {\n $el.children('.navbar').each(subEl => {\n $(subEl).trigger('navbar:show');\n app.emit('navbarShow', subEl);\n });\n } else {\n $el.trigger('navbar:show');\n app.emit('navbarShow', $el[0]);\n }\n },\n getElByPage(page) {\n let $pageEl;\n let $navbarEl;\n let pageData;\n if (page.$navbarEl || page.$el) {\n pageData = page;\n $pageEl = page.$el;\n } else {\n $pageEl = $(page);\n if ($pageEl.length > 0) pageData = $pageEl[0].f7Page;\n }\n if (pageData && pageData.$navbarEl && pageData.$navbarEl.length > 0) {\n $navbarEl = pageData.$navbarEl;\n } else if ($pageEl) {\n $navbarEl = $pageEl.children('.navbar');\n }\n if (!$navbarEl || $navbarEl && $navbarEl.length === 0) return undefined;\n return $navbarEl[0];\n },\n getPageByEl(navbarEl) {\n const $navbarEl = $(navbarEl);\n if ($navbarEl.parents('.page').length) {\n return $navbarEl.parents('.page')[0];\n }\n let pageEl;\n $navbarEl.parents('.view').find('.page').each(el => {\n if (el && el.f7Page && el.f7Page.navbarEl && $navbarEl[0] === el.f7Page.navbarEl) {\n pageEl = el;\n }\n });\n return pageEl;\n },\n collapseLargeTitle(navbarEl) {\n const app = this;\n let $navbarEl = $(navbarEl);\n if ($navbarEl.hasClass('navbars')) {\n $navbarEl = $navbarEl.find('.navbar');\n if ($navbarEl.length > 1) {\n $navbarEl = $(navbarEl).find('.navbar-large.navbar-current');\n }\n if ($navbarEl.length > 1 || !$navbarEl.length) {\n return;\n }\n }\n const $pageEl = $(app.navbar.getPageByEl($navbarEl));\n $navbarEl.addClass('navbar-large-collapsed');\n $pageEl.eq(0).addClass('page-with-navbar-large-collapsed').trigger('page:navbarlargecollapsed');\n app.emit('pageNavbarLargeCollapsed', $pageEl[0]);\n $navbarEl.trigger('navbar:collapse');\n app.emit('navbarCollapse', $navbarEl[0]);\n },\n expandLargeTitle(navbarEl) {\n const app = this;\n let $navbarEl = $(navbarEl);\n if ($navbarEl.hasClass('navbars')) {\n $navbarEl = $navbarEl.find('.navbar-large');\n if ($navbarEl.length > 1) {\n $navbarEl = $(navbarEl).find('.navbar-large.navbar-current');\n }\n if ($navbarEl.length > 1 || !$navbarEl.length) {\n return;\n }\n }\n const $pageEl = $(app.navbar.getPageByEl($navbarEl));\n $navbarEl.removeClass('navbar-large-collapsed');\n $pageEl.eq(0).removeClass('page-with-navbar-large-collapsed').trigger('page:navbarlargeexpanded');\n app.emit('pageNavbarLargeExpanded', $pageEl[0]);\n $navbarEl.trigger('navbar:expand');\n app.emit('navbarExpand', $navbarEl[0]);\n },\n toggleLargeTitle(navbarEl) {\n const app = this;\n let $navbarEl = $(navbarEl);\n if ($navbarEl.hasClass('navbars')) {\n $navbarEl = $navbarEl.find('.navbar-large');\n if ($navbarEl.length > 1) {\n $navbarEl = $(navbarEl).find('.navbar-large.navbar-current');\n }\n if ($navbarEl.length > 1 || !$navbarEl.length) {\n return;\n }\n }\n if ($navbarEl.hasClass('navbar-large-collapsed')) {\n app.navbar.expandLargeTitle($navbarEl);\n } else {\n app.navbar.collapseLargeTitle($navbarEl);\n }\n },\n initNavbarOnScroll(pageEl, navbarEl, needHide, needCollapse, needTransparent) {\n const app = this;\n const support = getSupport();\n const $pageEl = $(pageEl);\n const $navbarEl = $(navbarEl);\n const $titleLargeEl = $navbarEl.find('.title-large');\n const isLarge = $titleLargeEl.length || $navbarEl.hasClass('.navbar-large');\n let navbarHideHeight = 44;\n const snapPageScrollToLargeTitle = app.params.navbar.snapPageScrollToLargeTitle;\n const snapPageScrollToTransparentNavbar = app.params.navbar.snapPageScrollToTransparentNavbar;\n let previousScrollTop;\n let currentScrollTop;\n let scrollHeight;\n let offsetHeight;\n let reachEnd;\n let action;\n let navbarHidden;\n let navbarCollapsed;\n let navbarTitleLargeHeight;\n let navbarOffsetHeight;\n if (needCollapse || needHide && isLarge) {\n navbarTitleLargeHeight = $navbarEl.css('--f7-navbar-large-title-height');\n if (navbarTitleLargeHeight && navbarTitleLargeHeight.indexOf('px') >= 0) {\n navbarTitleLargeHeight = parseInt(navbarTitleLargeHeight, 10);\n if (Number.isNaN(navbarTitleLargeHeight) && $titleLargeEl.length) {\n navbarTitleLargeHeight = $titleLargeEl[0].offsetHeight;\n } else if (Number.isNaN(navbarTitleLargeHeight)) {\n if (app.theme === 'ios') navbarTitleLargeHeight = 52;else if (app.theme === 'md') navbarTitleLargeHeight = 88;\n }\n } else if ($titleLargeEl.length) {\n navbarTitleLargeHeight = $titleLargeEl[0].offsetHeight;\n } else {\n // eslint-disable-next-line\n if (app.theme === 'ios') navbarTitleLargeHeight = 52;else if (app.theme === 'md') navbarTitleLargeHeight = 88;\n }\n }\n if (needHide && isLarge) {\n navbarHideHeight += navbarTitleLargeHeight;\n }\n let scrollChanged;\n let scrollContent;\n let scrollTimeoutId;\n let touchEndTimeoutId;\n const touchSnapTimeout = 70;\n const desktopSnapTimeout = 300;\n function calcScrollableDistance() {\n $pageEl.find('.page-content').each(pageContentEl => {\n pageContentEl.f7ScrollableDistance = pageContentEl.scrollHeight - pageContentEl.offsetHeight;\n });\n }\n function snapLargeNavbar() {\n const inSearchbarExpanded = $navbarEl.hasClass('with-searchbar-expandable-enabled');\n if (inSearchbarExpanded) return;\n if (!scrollContent || currentScrollTop < 0) return;\n if (currentScrollTop >= navbarTitleLargeHeight / 2 && currentScrollTop < navbarTitleLargeHeight) {\n $(scrollContent).scrollTop(navbarTitleLargeHeight, 100);\n } else if (currentScrollTop < navbarTitleLargeHeight) {\n $(scrollContent).scrollTop(0, 200);\n }\n }\n function snapTransparentNavbar() {\n const inSearchbarExpanded = $navbarEl.hasClass('with-searchbar-expandable-enabled');\n if (inSearchbarExpanded) return;\n if (!scrollContent || currentScrollTop < 0) return;\n if (currentScrollTop >= navbarOffsetHeight / 2 && currentScrollTop < navbarOffsetHeight) {\n $(scrollContent).scrollTop(navbarOffsetHeight, 100);\n } else if (currentScrollTop < navbarOffsetHeight) {\n $(scrollContent).scrollTop(0, 200);\n }\n }\n function handleNavbarTransparent() {\n const isHidden = $navbarEl.hasClass('navbar-hidden') || $navbarEl.parent('.navbars').hasClass('navbar-hidden');\n const inSearchbarExpanded = $navbarEl.hasClass('with-searchbar-expandable-enabled');\n if (inSearchbarExpanded || isHidden) return;\n if (!navbarOffsetHeight) {\n navbarOffsetHeight = navbarEl.offsetHeight;\n }\n let opacity = currentScrollTop / navbarOffsetHeight;\n const notTransparent = $navbarEl.hasClass('navbar-transparent-visible');\n opacity = Math.max(Math.min(opacity, 1), 0);\n if (notTransparent && opacity === 1 || !notTransparent && opacity === 0) {\n $navbarEl.find('.navbar-bg, .title').css('opacity', '');\n return;\n }\n if (notTransparent && opacity === 0) {\n $navbarEl.trigger('navbar:transparenthide');\n app.emit('navbarTransparentHide', $navbarEl[0]);\n $navbarEl.removeClass('navbar-transparent-visible');\n $navbarEl.find('.navbar-bg, .title').css('opacity', '');\n return;\n }\n if (!notTransparent && opacity === 1) {\n $navbarEl.trigger('navbar:transparentshow');\n app.emit('navbarTransparentShow', $navbarEl[0]);\n $navbarEl.addClass('navbar-transparent-visible');\n $navbarEl.find('.navbar-bg, .title').css('opacity', '');\n return;\n }\n $navbarEl.find('.navbar-bg, .title').css('opacity', opacity);\n if (snapPageScrollToTransparentNavbar) {\n if (!support.touch) {\n clearTimeout(scrollTimeoutId);\n scrollTimeoutId = setTimeout(() => {\n snapTransparentNavbar();\n }, desktopSnapTimeout);\n } else if (touchEndTimeoutId) {\n clearTimeout(touchEndTimeoutId);\n touchEndTimeoutId = null;\n touchEndTimeoutId = setTimeout(() => {\n snapTransparentNavbar();\n clearTimeout(touchEndTimeoutId);\n touchEndTimeoutId = null;\n }, touchSnapTimeout);\n }\n }\n }\n let previousCollapseProgress = null;\n let collapseProgress = null;\n function handleLargeNavbarCollapse(pageContentEl) {\n const isHidden = $navbarEl.hasClass('navbar-hidden') || $navbarEl.parent('.navbars').hasClass('navbar-hidden');\n if (isHidden) return;\n const isLargeTransparent = $navbarEl.hasClass('navbar-large-transparent') || $navbarEl.hasClass('navbar-large') && $navbarEl.hasClass('navbar-transparent');\n previousCollapseProgress = collapseProgress;\n const scrollableDistance = Math.min(navbarTitleLargeHeight, pageContentEl.f7ScrollableDistance || navbarTitleLargeHeight);\n collapseProgress = Math.min(Math.max(currentScrollTop / scrollableDistance, 0), 1);\n const previousCollapseWasInMiddle = previousCollapseProgress > 0 && previousCollapseProgress < 1;\n const inSearchbarExpanded = $navbarEl.hasClass('with-searchbar-expandable-enabled');\n if (inSearchbarExpanded) return;\n navbarCollapsed = $navbarEl.hasClass('navbar-large-collapsed');\n const $bgEl = $navbarEl.find('.navbar-bg');\n if (collapseProgress === 0 && navbarCollapsed) {\n app.navbar.expandLargeTitle($navbarEl[0]);\n } else if (collapseProgress === 1 && !navbarCollapsed) {\n app.navbar.collapseLargeTitle($navbarEl[0]);\n }\n if (collapseProgress === 0 && navbarCollapsed || collapseProgress === 0 && previousCollapseWasInMiddle || collapseProgress === 1 && !navbarCollapsed || collapseProgress === 1 && previousCollapseWasInMiddle) {\n if (app.theme === 'md') {\n $navbarEl.find('.navbar-inner').css('overflow', '');\n }\n $navbarEl.find('.title').css('opacity', '');\n $navbarEl.find('.title-large-text, .subnavbar').css('transform', '');\n $navbarEl.find('.title-large-text').css('opacity', '');\n if (isLargeTransparent) {\n $bgEl.css('opacity', '');\n }\n $bgEl.css('transform', '');\n } else if (collapseProgress > 0 && collapseProgress < 1) {\n if (app.theme === 'md') {\n $navbarEl.find('.navbar-inner').css('overflow', 'visible');\n }\n $navbarEl.find('.title').css('opacity', -0.5 + collapseProgress * 1.5);\n $navbarEl.find('.title-large-text, .subnavbar').css('transform', `translate3d(0px, ${-1 * collapseProgress * navbarTitleLargeHeight}px, 0)`);\n $navbarEl.find('.title-large-text').css('opacity', 1 - collapseProgress * 2);\n if (isLargeTransparent) {\n $bgEl.css('opacity', collapseProgress);\n }\n $bgEl.css('transform', `translate3d(0px, ${-1 * collapseProgress * navbarTitleLargeHeight}px, 0)`);\n }\n if (snapPageScrollToLargeTitle) {\n if (!support.touch) {\n clearTimeout(scrollTimeoutId);\n scrollTimeoutId = setTimeout(() => {\n snapLargeNavbar();\n }, desktopSnapTimeout);\n } else if (touchEndTimeoutId) {\n clearTimeout(touchEndTimeoutId);\n touchEndTimeoutId = null;\n touchEndTimeoutId = setTimeout(() => {\n snapLargeNavbar();\n clearTimeout(touchEndTimeoutId);\n touchEndTimeoutId = null;\n }, touchSnapTimeout);\n }\n }\n }\n function handleTitleHideShow() {\n if ($pageEl.hasClass('page-with-card-opened')) return;\n scrollHeight = scrollContent.scrollHeight;\n offsetHeight = scrollContent.offsetHeight;\n reachEnd = currentScrollTop + offsetHeight >= scrollHeight;\n navbarHidden = $navbarEl.hasClass('navbar-hidden') || $navbarEl.parent('.navbars').hasClass('navbar-hidden');\n if (reachEnd) {\n if (app.params.navbar.showOnPageScrollEnd) {\n action = 'show';\n }\n } else if (previousScrollTop > currentScrollTop) {\n if (app.params.navbar.showOnPageScrollTop || currentScrollTop <= navbarHideHeight) {\n action = 'show';\n } else {\n action = 'hide';\n }\n } else if (currentScrollTop > navbarHideHeight) {\n action = 'hide';\n } else {\n action = 'show';\n }\n if (action === 'show' && navbarHidden) {\n app.navbar.show($navbarEl, true, true);\n navbarHidden = false;\n } else if (action === 'hide' && !navbarHidden) {\n app.navbar.hide($navbarEl, true, false, true);\n navbarHidden = true;\n }\n previousScrollTop = currentScrollTop;\n }\n function handleScroll(e) {\n scrollContent = this;\n if (e && e.target && e.target !== scrollContent) {\n return;\n }\n currentScrollTop = scrollContent.scrollTop;\n scrollChanged = currentScrollTop;\n if (needCollapse) {\n handleLargeNavbarCollapse(scrollContent);\n } else if (needTransparent) {\n handleNavbarTransparent();\n }\n if ($pageEl.hasClass('page-previous')) return;\n if (needHide) {\n handleTitleHideShow();\n }\n }\n function handeTouchStart() {\n scrollChanged = false;\n }\n function handleTouchEnd() {\n clearTimeout(touchEndTimeoutId);\n touchEndTimeoutId = null;\n touchEndTimeoutId = setTimeout(() => {\n if (scrollChanged !== false) {\n if (needTransparent && !needCollapse) {\n snapTransparentNavbar();\n } else {\n snapLargeNavbar();\n }\n clearTimeout(touchEndTimeoutId);\n touchEndTimeoutId = null;\n }\n }, touchSnapTimeout);\n }\n $pageEl.on('scroll', '.page-content', handleScroll, true);\n if (support.touch && (needCollapse && snapPageScrollToLargeTitle || needTransparent && snapPageScrollToTransparentNavbar)) {\n app.on('touchstart:passive', handeTouchStart);\n app.on('touchend:passive', handleTouchEnd);\n }\n calcScrollableDistance();\n if (needCollapse || needTransparent) {\n $pageEl.find('.page-content').each(pageContentEl => {\n if (pageContentEl.scrollTop > 0) handleScroll.call(pageContentEl);\n });\n }\n app.on('resize', calcScrollableDistance);\n $pageEl[0].f7DetachNavbarScrollHandlers = function f7DetachNavbarScrollHandlers() {\n app.off('resize', calcScrollableDistance);\n delete $pageEl[0].f7DetachNavbarScrollHandlers;\n $pageEl.off('scroll', '.page-content', handleScroll, true);\n if (support.touch && (needCollapse && snapPageScrollToLargeTitle || needTransparent && snapPageScrollToTransparentNavbar)) {\n app.off('touchstart:passive', handeTouchStart);\n app.off('touchend:passive', handleTouchEnd);\n }\n };\n }\n};\nexport default {\n name: 'navbar',\n create() {\n const app = this;\n bindMethods(app, {\n navbar: Navbar\n });\n },\n params: {\n navbar: {\n scrollTopOnTitleClick: true,\n iosCenterTitle: true,\n mdCenterTitle: false,\n hideOnPageScroll: false,\n showOnPageScrollEnd: true,\n showOnPageScrollTop: true,\n collapseLargeTitleOnScroll: true,\n snapPageScrollToLargeTitle: true,\n snapPageScrollToTransparentNavbar: true\n }\n },\n on: {\n 'panelBreakpoint panelCollapsedBreakpoint panelResize viewResize resize viewMasterDetailBreakpoint': function onPanelResize() {\n const app = this;\n $('.navbar').each(navbarEl => {\n app.navbar.size(navbarEl);\n });\n },\n pageBeforeRemove(page) {\n if (page.$el[0].f7DetachNavbarScrollHandlers) {\n page.$el[0].f7DetachNavbarScrollHandlers();\n }\n },\n pageBeforeIn(page) {\n const app = this;\n if (app.theme !== 'ios') return;\n let $navbarsEl;\n const view = page.$el.parents('.view')[0].f7View;\n const navbarEl = app.navbar.getElByPage(page);\n if (!navbarEl) {\n $navbarsEl = page.$el.parents('.view').children('.navbars');\n } else {\n $navbarsEl = $(navbarEl).parents('.navbars');\n }\n if (page.$el.hasClass('no-navbar') || view.router.dynamicNavbar && !navbarEl) {\n const animate = !!(page.pageFrom && page.router.history.length > 0);\n app.navbar.hide($navbarsEl, animate);\n } else {\n app.navbar.show($navbarsEl);\n }\n },\n pageReinit(page) {\n const app = this;\n const $navbarEl = $(app.navbar.getElByPage(page));\n if (!$navbarEl || $navbarEl.length === 0) return;\n app.navbar.size($navbarEl);\n },\n pageInit(page) {\n const app = this;\n const $navbarEl = $(app.navbar.getElByPage(page));\n if (!$navbarEl || $navbarEl.length === 0) return;\n\n // Size\n app.navbar.size($navbarEl);\n\n // Need Collapse On Scroll\n let needCollapseOnScrollHandler;\n if ($navbarEl.find('.title-large').length > 0) {\n $navbarEl.addClass('navbar-large');\n }\n if ($navbarEl.hasClass('navbar-large')) {\n if (app.params.navbar.collapseLargeTitleOnScroll) needCollapseOnScrollHandler = true;\n page.$el.addClass('page-with-navbar-large');\n }\n\n // Need transparent on scroll\n let needTransparentOnScroll;\n if (!needCollapseOnScrollHandler && $navbarEl.hasClass('navbar-transparent')) {\n needTransparentOnScroll = true;\n }\n\n // Need Hide On Scroll\n let needHideOnScrollHandler;\n if (app.params.navbar.hideOnPageScroll || page.$el.find('.hide-navbar-on-scroll').length || page.$el.hasClass('hide-navbar-on-scroll') || page.$el.find('.hide-bars-on-scroll').length || page.$el.hasClass('hide-bars-on-scroll')) {\n if (page.$el.find('.keep-navbar-on-scroll').length || page.$el.hasClass('keep-navbar-on-scroll') || page.$el.find('.keep-bars-on-scroll').length || page.$el.hasClass('keep-bars-on-scroll')) {\n needHideOnScrollHandler = false;\n } else {\n needHideOnScrollHandler = true;\n }\n }\n if (needCollapseOnScrollHandler || needHideOnScrollHandler || needTransparentOnScroll) {\n app.navbar.initNavbarOnScroll(page.el, $navbarEl[0], needHideOnScrollHandler, needCollapseOnScrollHandler, needTransparentOnScroll);\n }\n },\n 'panelOpen panelSwipeOpen modalOpen': function onPanelModalOpen(instance) {\n const app = this;\n instance.$el.find('.navbar:not(.navbar-previous)').each(navbarEl => {\n app.navbar.size(navbarEl);\n });\n },\n tabShow(tabEl) {\n const app = this;\n $(tabEl).find('.navbar:not(.navbar-previous)').each(navbarEl => {\n app.navbar.size(navbarEl);\n });\n }\n },\n clicks: {\n '.navbar .title': function onTitleClick($clickedEl, clickedData, e) {\n const app = this;\n if (!app.params.navbar.scrollTopOnTitleClick) return;\n if ($(e.target).closest('a, button').length > 0) {\n return;\n }\n let $pageContentEl;\n\n // Find active page\n const $navbarEl = $clickedEl.parents('.navbar');\n const $navbarsEl = $navbarEl.parents('.navbars');\n\n // Static Layout\n $pageContentEl = $navbarEl.parents('.page-content');\n if ($pageContentEl.length === 0) {\n // Fixed Layout\n if ($navbarEl.parents('.page').length > 0) {\n $pageContentEl = $navbarEl.parents('.page').find('.page-content');\n }\n // Through Layout iOS\n if ($pageContentEl.length === 0 && $navbarsEl.length) {\n if ($navbarsEl.nextAll('.page-current').length > 0) {\n $pageContentEl = $navbarsEl.nextAll('.page-current').find('.page-content');\n }\n }\n // Through Layout\n if ($pageContentEl.length === 0) {\n if ($navbarEl.nextAll('.page-current').length > 0) {\n $pageContentEl = $navbarEl.nextAll('.page-current').find('.page-content');\n }\n }\n }\n if ($pageContentEl && $pageContentEl.length > 0) {\n // Check for tab\n if ($pageContentEl.hasClass('tab')) {\n $pageContentEl = $pageContentEl.parent('.tabs').children('.page-content.tab-active');\n }\n if ($pageContentEl.length > 0) $pageContentEl.scrollTop(0, 300);\n }\n }\n },\n vnode: {\n navbar: {\n postpatch(vnode) {\n const app = this;\n app.navbar.size(vnode.elm);\n }\n }\n }\n};", "import $ from '../../shared/dom7.js';\nimport { nextFrame, bindMethods } from '../../shared/utils.js';\nconst Toolbar = {\n setHighlight(tabbarEl) {\n const app = this;\n const $tabbarEl = $(tabbarEl);\n if (app.theme === 'ios' && !$tabbarEl.hasClass('tabbar-highlight')) return;\n if ($tabbarEl.length === 0 || !($tabbarEl.hasClass('tabbar') || $tabbarEl.hasClass('tabbar-icons'))) return;\n let $highlightEl = $tabbarEl.find('.tab-link-highlight');\n const tabLinksCount = $tabbarEl.find('.tab-link').length;\n if (tabLinksCount === 0) {\n $highlightEl.remove();\n return;\n }\n if ($highlightEl.length === 0) {\n $tabbarEl.children('.toolbar-inner').append('');\n $highlightEl = $tabbarEl.find('.tab-link-highlight');\n } else if ($highlightEl.next().length) {\n $tabbarEl.children('.toolbar-inner').append($highlightEl);\n }\n const $activeLink = $tabbarEl.find('.tab-link-active');\n let highlightWidth;\n let highlightTranslate;\n if ($tabbarEl.hasClass('tabbar-scrollable') && $activeLink && $activeLink[0]) {\n highlightWidth = `${$activeLink[0].offsetWidth}px`;\n highlightTranslate = `${$activeLink[0].offsetLeft}px`;\n } else {\n const activeIndex = $activeLink.index();\n highlightWidth = `${100 / tabLinksCount}%`;\n highlightTranslate = `${(app.rtl ? -activeIndex : activeIndex) * 100}%`;\n }\n nextFrame(() => {\n $highlightEl.css('width', highlightWidth).transform(`translate3d(${highlightTranslate},0,0)`);\n });\n },\n init(tabbarEl) {\n const app = this;\n app.toolbar.setHighlight(tabbarEl);\n },\n hide(el, animate) {\n if (animate === void 0) {\n animate = true;\n }\n const app = this;\n const $el = $(el);\n if ($el.hasClass('toolbar-hidden')) return;\n const className = `toolbar-hidden${animate ? ' toolbar-transitioning' : ''}`;\n $el.transitionEnd(() => {\n $el.removeClass('toolbar-transitioning');\n });\n $el.addClass(className);\n $el.trigger('toolbar:hide');\n app.emit('toolbarHide', $el[0]);\n },\n show(el, animate) {\n if (animate === void 0) {\n animate = true;\n }\n const app = this;\n const $el = $(el);\n if (!$el.hasClass('toolbar-hidden')) return;\n if (animate) {\n $el.addClass('toolbar-transitioning');\n $el.transitionEnd(() => {\n $el.removeClass('toolbar-transitioning');\n });\n }\n $el.removeClass('toolbar-hidden');\n $el.trigger('toolbar:show');\n app.emit('toolbarShow', $el[0]);\n },\n initToolbarOnScroll(pageEl) {\n const app = this;\n const $pageEl = $(pageEl);\n let $toolbarEl = $pageEl.parents('.view').children('.toolbar');\n if ($toolbarEl.length === 0) {\n $toolbarEl = $pageEl.find('.toolbar');\n }\n if ($toolbarEl.length === 0) {\n $toolbarEl = $pageEl.parents('.views').children('.tabbar, .tabbar-icons');\n }\n if ($toolbarEl.length === 0) {\n return;\n }\n let previousScrollTop;\n let currentScrollTop;\n let scrollHeight;\n let offsetHeight;\n let reachEnd;\n let action;\n let toolbarHidden;\n function handleScroll(e) {\n if ($pageEl.hasClass('page-with-card-opened')) return;\n if ($pageEl.hasClass('page-previous')) return;\n const scrollContent = this;\n if (e && e.target && e.target !== scrollContent) {\n return;\n }\n currentScrollTop = scrollContent.scrollTop;\n scrollHeight = scrollContent.scrollHeight;\n offsetHeight = scrollContent.offsetHeight;\n reachEnd = currentScrollTop + offsetHeight >= scrollHeight;\n toolbarHidden = $toolbarEl.hasClass('toolbar-hidden');\n if (reachEnd) {\n if (app.params.toolbar.showOnPageScrollEnd) {\n action = 'show';\n }\n } else if (previousScrollTop > currentScrollTop) {\n if (app.params.toolbar.showOnPageScrollTop || currentScrollTop <= 44) {\n action = 'show';\n } else {\n action = 'hide';\n }\n } else if (currentScrollTop > 44) {\n action = 'hide';\n } else {\n action = 'show';\n }\n if (action === 'show' && toolbarHidden) {\n app.toolbar.show($toolbarEl);\n toolbarHidden = false;\n } else if (action === 'hide' && !toolbarHidden) {\n app.toolbar.hide($toolbarEl);\n toolbarHidden = true;\n }\n previousScrollTop = currentScrollTop;\n }\n $pageEl.on('scroll', '.page-content', handleScroll, true);\n $pageEl[0].f7ScrollToolbarHandler = handleScroll;\n }\n};\nexport default {\n name: 'toolbar',\n create() {\n const app = this;\n bindMethods(app, {\n toolbar: Toolbar\n });\n },\n params: {\n toolbar: {\n hideOnPageScroll: false,\n showOnPageScrollEnd: true,\n showOnPageScrollTop: true\n }\n },\n on: {\n pageBeforeRemove(page) {\n if (page.$el[0].f7ScrollToolbarHandler) {\n page.$el.off('scroll', '.page-content', page.$el[0].f7ScrollToolbarHandler, true);\n }\n },\n pageBeforeIn(page) {\n const app = this;\n let $toolbarEl = page.$el.parents('.view').children('.toolbar');\n if ($toolbarEl.length === 0) {\n $toolbarEl = page.$el.parents('.views').children('.tabbar, .tabbar-icons');\n }\n if ($toolbarEl.length === 0) {\n $toolbarEl = page.$el.find('.toolbar');\n }\n if ($toolbarEl.length === 0) {\n return;\n }\n if (page.$el.hasClass('no-toolbar')) {\n app.toolbar.hide($toolbarEl);\n } else {\n app.toolbar.show($toolbarEl);\n }\n },\n pageInit(page) {\n const app = this;\n page.$el.find('.tabbar, .tabbar-icons').each(tabbarEl => {\n app.toolbar.init(tabbarEl);\n });\n if (app.params.toolbar.hideOnPageScroll || page.$el.find('.hide-toolbar-on-scroll').length || page.$el.hasClass('hide-toolbar-on-scroll') || page.$el.find('.hide-bars-on-scroll').length || page.$el.hasClass('hide-bars-on-scroll')) {\n if (page.$el.find('.keep-toolbar-on-scroll').length || page.$el.hasClass('keep-toolbar-on-scroll') || page.$el.find('.keep-bars-on-scroll').length || page.$el.hasClass('keep-bars-on-scroll')) {\n return;\n }\n app.toolbar.initToolbarOnScroll(page.el);\n }\n },\n init() {\n const app = this;\n app.$el.find('.tabbar, .tabbar-icons').each(tabbarEl => {\n app.toolbar.init(tabbarEl);\n });\n }\n },\n vnode: {\n tabbar: {\n insert(vnode) {\n const app = this;\n app.toolbar.init(vnode.elm);\n }\n }\n }\n};", "import $ from '../../shared/dom7.js';\nexport default {\n name: 'subnavbar',\n on: {\n pageInit(page) {\n if (page.$navbarEl && page.$navbarEl.length && page.$navbarEl.find('.subnavbar').length) {\n page.$el.addClass('page-with-subnavbar');\n }\n const $innerSubnavbars = page.$el.find('.subnavbar').filter(subnavbarEl => {\n return $(subnavbarEl).parents('.page')[0] === page.$el[0];\n });\n if ($innerSubnavbars.length) {\n page.$el.addClass('page-with-subnavbar');\n }\n }\n }\n};", "import $ from '../../shared/dom7.js';\nexport default class TouchRipple {\n constructor(app, $el, x, y) {\n const ripple = this;\n if (!$el) return undefined;\n const {\n left,\n top,\n width,\n height\n } = $el[0].getBoundingClientRect();\n const center = {\n x: x - left,\n y: y - top\n };\n let diameter = Math.max((height ** 2 + width ** 2) ** 0.5, 48);\n let isInset = false;\n const insetElements = app.params.touch.touchRippleInsetElements || '';\n if (insetElements && $el.is(insetElements)) {\n isInset = true;\n }\n if (isInset) {\n diameter = Math.max(Math.min(width, height), 48);\n }\n if (!isInset && $el.css('overflow') === 'hidden') {\n const distanceFromCenter = ((center.x - width / 2) ** 2 + (center.y - height / 2) ** 2) ** 0.5;\n const scale = (diameter / 2 + distanceFromCenter) / (diameter / 2);\n ripple.rippleTransform = `translate3d(0px, 0px, 0) scale(${scale * 2})`;\n } else {\n // prettier-ignore\n ripple.rippleTransform = `translate3d(${-center.x + width / 2}px, ${-center.y + height / 2}px, 0) scale(1)`;\n }\n if (isInset) {\n $el.addClass('ripple-inset');\n }\n ripple.$rippleWaveEl = $(``);\n $el.prepend(ripple.$rippleWaveEl);\n ripple.$rippleWaveEl.animationEnd(() => {\n if (!ripple.$rippleWaveEl) return;\n if (ripple.$rippleWaveEl.hasClass('ripple-wave-out')) return;\n ripple.$rippleWaveEl.addClass('ripple-wave-in');\n if (ripple.shouldBeRemoved) {\n ripple.out();\n }\n });\n return ripple;\n }\n destroy() {\n let ripple = this;\n if (ripple.$rippleWaveEl) {\n ripple.$rippleWaveEl.remove();\n }\n Object.keys(ripple).forEach(key => {\n ripple[key] = null;\n delete ripple[key];\n });\n ripple = null;\n }\n out() {\n const ripple = this;\n const {\n $rippleWaveEl\n } = this;\n clearTimeout(ripple.removeTimeout);\n $rippleWaveEl.addClass('ripple-wave-out');\n ripple.removeTimeout = setTimeout(() => {\n ripple.destroy();\n }, 300);\n $rippleWaveEl.animationEnd(() => {\n clearTimeout(ripple.removeTimeout);\n ripple.destroy();\n });\n }\n remove() {\n const ripple = this;\n if (ripple.shouldBeRemoved) return;\n ripple.removeTimeout = setTimeout(() => {\n ripple.destroy();\n }, 400);\n ripple.shouldBeRemoved = true;\n if (ripple.$rippleWaveEl.hasClass('ripple-wave-in')) {\n ripple.out();\n }\n }\n}", "import TouchRipple from './touch-ripple-class.js';\nexport default {\n name: 'touch-ripple',\n static: {\n TouchRipple\n },\n create() {\n const app = this;\n app.touchRipple = {\n create() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return new TouchRipple(...args);\n }\n };\n }\n};", "import { getDocument } from 'ssr-window';\nimport $ from '../../shared/dom7.js';\nimport { extend, deleteProps } from '../../shared/utils.js';\nimport Framework7Class from '../../shared/class.js';\nconst openedModals = [];\nconst dialogsQueue = [];\nfunction clearDialogsQueue() {\n if (dialogsQueue.length === 0) return;\n const dialog = dialogsQueue.shift();\n dialog.open();\n}\nclass Modal extends Framework7Class {\n constructor(app, params) {\n super(params, [app]);\n const modal = this;\n const defaults = {};\n\n // Extend defaults with modules params\n modal.useModulesParams(defaults);\n modal.params = extend(defaults, params);\n modal.opened = false;\n let $containerEl = modal.params.containerEl ? $(modal.params.containerEl).eq(0) : app.$el;\n if (!$containerEl.length) $containerEl = app.$el;\n modal.$containerEl = $containerEl;\n modal.containerEl = $containerEl[0];\n\n // Install Modules\n modal.useModules();\n return this;\n }\n onOpen() {\n const modal = this;\n modal.opened = true;\n openedModals.push(modal);\n $('html').addClass(`with-modal-${modal.type.toLowerCase()}`);\n modal.$el.trigger(`modal:open ${modal.type.toLowerCase()}:open`);\n modal.emit(`local::open modalOpen ${modal.type}Open`, modal);\n }\n onOpened() {\n const modal = this;\n modal.$el.trigger(`modal:opened ${modal.type.toLowerCase()}:opened`);\n modal.emit(`local::opened modalOpened ${modal.type}Opened`, modal);\n }\n onClose() {\n const modal = this;\n modal.opened = false;\n if (!modal.type || !modal.$el) return;\n openedModals.splice(openedModals.indexOf(modal), 1);\n $('html').removeClass(`with-modal-${modal.type.toLowerCase()}`);\n modal.$el.trigger(`modal:close ${modal.type.toLowerCase()}:close`);\n modal.emit(`local::close modalClose ${modal.type}Close`, modal);\n }\n onClosed() {\n const modal = this;\n if (!modal.type || !modal.$el) return;\n modal.$el.removeClass('modal-out');\n modal.$el.hide();\n if (modal.params.backdrop && (modal.params.backdropUnique || modal.forceBackdropUnique) && modal.$backdropEl) {\n modal.$backdropEl.remove();\n }\n modal.$el.trigger(`modal:closed ${modal.type.toLowerCase()}:closed`);\n modal.emit(`local::closed modalClosed ${modal.type}Closed`, modal);\n }\n open(animateModal, force) {\n const modal = this;\n const document = getDocument();\n const app = modal.app;\n const $el = modal.$el;\n const $backdropEl = modal.$backdropEl;\n const type = modal.type;\n let animate = true;\n if (typeof animateModal !== 'undefined') animate = animateModal;else if (typeof modal.params.animate !== 'undefined') {\n animate = modal.params.animate;\n }\n if (!$el || $el.hasClass('modal-in')) {\n if (animateModal === false && $el[0] && type !== 'dialog') {\n $el[0].style.display = 'block';\n }\n if (!force) return modal;\n }\n if (type === 'dialog' && app.params.modal.queueDialogs) {\n let pushToQueue;\n if ($('.dialog.modal-in').length > 0) {\n pushToQueue = true;\n } else if (openedModals.length > 0) {\n openedModals.forEach(openedModal => {\n if (openedModal.type === 'dialog') pushToQueue = true;\n });\n }\n if (pushToQueue) {\n dialogsQueue.push(modal);\n return modal;\n }\n }\n const $modalParentEl = $el.parent();\n const wasInDom = $el.parents(document).length > 0;\n if (!$modalParentEl.is(modal.$containerEl)) {\n modal.$containerEl.append($el);\n modal.once(`${type}Closed`, () => {\n if (wasInDom) {\n $modalParentEl.append($el);\n } else {\n $el.remove();\n }\n });\n }\n // Show Modal\n $el.show();\n if (modal.params.backdrop && (modal.params.backdropUnique || modal.forceBackdropUnique) && modal.$backdropEl) {\n modal.$backdropEl.insertBefore($el);\n }\n\n /* eslint no-underscore-dangle: [\"error\", { \"allow\": [\"_clientLeft\"] }] */\n modal._clientLeft = $el[0].clientLeft;\n\n // Modal\n function transitionEnd() {\n if ($el.hasClass('modal-out')) {\n modal.onClosed();\n } else if ($el.hasClass('modal-in')) {\n modal.onOpened();\n }\n }\n if (animate) {\n if ($backdropEl) {\n $backdropEl.removeClass('not-animated');\n $backdropEl.addClass('backdrop-in');\n }\n $el.animationEnd(() => {\n transitionEnd();\n });\n $el.transitionEnd(() => {\n transitionEnd();\n });\n $el.removeClass('modal-out not-animated').addClass('modal-in');\n modal.onOpen();\n } else {\n if ($backdropEl) {\n $backdropEl.addClass('backdrop-in not-animated');\n }\n $el.removeClass('modal-out').addClass('modal-in not-animated');\n modal.onOpen();\n modal.onOpened();\n }\n return modal;\n }\n close(animateModal) {\n const modal = this;\n const $el = modal.$el;\n const $backdropEl = modal.$backdropEl;\n let animate = true;\n if (typeof animateModal !== 'undefined') animate = animateModal;else if (typeof modal.params.animate !== 'undefined') {\n animate = modal.params.animate;\n }\n if (!$el || !$el.hasClass('modal-in')) {\n if (dialogsQueue.indexOf(modal) >= 0) {\n dialogsQueue.splice(dialogsQueue.indexOf(modal), 1);\n }\n return modal;\n }\n\n // backdrop\n if ($backdropEl) {\n let needToHideBackdrop = true;\n if (modal.type === 'popup') {\n modal.$el.prevAll('.popup.modal-in').add(modal.$el.nextAll('.popup.modal-in')).each(popupEl => {\n const popupInstance = popupEl.f7Modal;\n if (!popupInstance) return;\n if (popupInstance.params.closeByBackdropClick && popupInstance.params.backdrop && popupInstance.backdropEl === modal.backdropEl) {\n needToHideBackdrop = false;\n }\n });\n }\n if (needToHideBackdrop) {\n $backdropEl[animate ? 'removeClass' : 'addClass']('not-animated');\n $backdropEl.removeClass('backdrop-in');\n }\n }\n\n // Modal\n $el[animate ? 'removeClass' : 'addClass']('not-animated');\n function transitionEnd() {\n if ($el.hasClass('modal-out')) {\n modal.onClosed();\n } else if ($el.hasClass('modal-in')) {\n modal.onOpened();\n }\n }\n if (animate) {\n $el.animationEnd(() => {\n transitionEnd();\n });\n $el.transitionEnd(() => {\n transitionEnd();\n });\n $el.removeClass('modal-in').addClass('modal-out');\n // Emit close\n modal.onClose();\n } else {\n $el.addClass('not-animated').removeClass('modal-in').addClass('modal-out');\n // Emit close\n modal.onClose();\n modal.onClosed();\n }\n if (modal.type === 'dialog') {\n clearDialogsQueue();\n }\n return modal;\n }\n destroy() {\n const modal = this;\n if (modal.destroyed) return;\n modal.emit(`local::beforeDestroy modalBeforeDestroy ${modal.type}BeforeDestroy`, modal);\n if (modal.$el) {\n modal.$el.trigger(`modal:beforedestroy ${modal.type.toLowerCase()}:beforedestroy`);\n if (modal.$el.length && modal.$el[0].f7Modal) {\n delete modal.$el[0].f7Modal;\n }\n }\n deleteProps(modal);\n modal.destroyed = true;\n }\n}\nexport default Modal;", "import $ from '../../shared/dom7.js';\nimport { extend } from '../../shared/utils.js';\nimport Modal from './modal-class.js';\nclass CustomModal extends Modal {\n constructor(app, params) {\n const extendedParams = extend({\n backdrop: true,\n closeByBackdropClick: true,\n on: {}\n }, params);\n\n // Extends with open/close Modal methods;\n super(app, extendedParams);\n const customModal = this;\n customModal.params = extendedParams;\n\n // Find Element\n let $el;\n if (!customModal.params.el) {\n $el = $(customModal.params.content);\n } else {\n $el = $(customModal.params.el);\n }\n if ($el && $el.length > 0 && $el[0].f7Modal) {\n return $el[0].f7Modal;\n }\n if ($el.length === 0) {\n return customModal.destroy();\n }\n let $backdropEl;\n if (customModal.params.backdrop) {\n $backdropEl = app.$el.children('.custom-modal-backdrop');\n if ($backdropEl.length === 0) {\n $backdropEl = $('');\n app.$el.append($backdropEl);\n }\n }\n function handleClick(e) {\n if (!customModal || customModal.destroyed) return;\n if ($backdropEl && e.target === $backdropEl[0]) {\n customModal.close();\n }\n }\n customModal.on('customModalOpened', () => {\n if (customModal.params.closeByBackdropClick && customModal.params.backdrop) {\n app.on('click', handleClick);\n }\n });\n customModal.on('customModalClose', () => {\n if (customModal.params.closeByBackdropClick && customModal.params.backdrop) {\n app.off('click', handleClick);\n }\n });\n extend(customModal, {\n app,\n $el,\n el: $el[0],\n $backdropEl,\n backdropEl: $backdropEl && $backdropEl[0],\n type: 'customModal'\n });\n $el[0].f7Modal = customModal;\n return customModal;\n }\n}\nexport default CustomModal;", "import Modal from './modal-class.js';\nimport CustomModal from './custom-modal-class.js';\nexport default {\n name: 'modal',\n static: {\n Modal,\n CustomModal\n },\n create() {\n const app = this;\n app.customModal = {\n create(params) {\n return new CustomModal(app, params);\n }\n };\n },\n params: {\n modal: {\n queueDialogs: true\n }\n }\n};", "/**\n * Framework7 8.3.2\n * Full featured mobile HTML framework for building iOS & Android apps\n * https://framework7.io/\n *\n * Copyright 2014-2024 Vladimir Kharlampidi\n *\n * Released under the MIT License\n *\n * Released on: February 27, 2024\n */\n\nimport $ from './shared/dom7.js';\nimport Framework7 from './components/app/app-class.js';\nimport * as utils from './shared/utils.js';\nimport { getSupport } from './shared/get-support.js';\nimport { getDevice } from './shared/get-device.js';\nimport DeviceModule from './modules/device/device.js';\nimport SupportModule from './modules/support/support.js';\nimport UtilsModule from './modules/utils/utils.js';\nimport ResizeModule from './modules/resize/resize.js';\nimport TouchModule from './modules/touch/touch.js';\nimport ClicksModule from './modules/clicks/clicks.js';\nimport RouterModule from './modules/router/router.js';\nimport RouterComponentLoaderModule from './modules/router/component-loader.js';\nimport ComponentModule, { Component, $jsx } from './modules/component/component.js';\nimport HistoryModule from './modules/history/history.js';\nimport ServiceWorkerModule from './modules/service-worker/service-worker.js';\nimport StoreModule, { createStore } from './modules/store/store.js';\nimport Statusbar from './components/statusbar/statusbar.js';\nimport View from './components/view/view.js';\nimport Navbar from './components/navbar/navbar.js';\nimport Toolbar from './components/toolbar/toolbar.js';\nimport Subnavbar from './components/subnavbar/subnavbar.js';\nimport TouchRipple from './components/touch-ripple/touch-ripple.js';\nimport Modal from './components/modal/modal.js';\nimport Router from './modules/router/router-class.js';\nRouter.use([RouterComponentLoaderModule]);\nFramework7.use([DeviceModule, SupportModule, UtilsModule, ResizeModule, TouchModule, ClicksModule, RouterModule, HistoryModule, ComponentModule, ServiceWorkerModule, StoreModule, Statusbar, View, Navbar, Toolbar, Subnavbar, TouchRipple, Modal]);\nexport { Component, $jsx, $ as Dom7, utils, getDevice, getSupport, createStore };\nexport default Framework7;\n", "import { createStore } from 'framework7';\n \nexport const setConfig = () => {\n // collect all data elements stored in body\n let config = $(document).find(\"script[data-for='app']\");\n config = JSON.parse(config.html());\n \n // always erase existing root value just in case the user changes the root.\n // This may be harmful\n config.root = \"#app\";\n \n // check if the app is intended to be a PWA\n let isPWA = $('body').attr('data-pwa') === \"true\";\n \n if (isPWA) {\n config.serviceWorker = {\n path: window.location.pathname + \"service-worker.js\",\n scope: window.location.pathname\n };\n }\n \n // Widgets cache\n config.store = createStore({\n state: {\n // any other widget type to cache ...\n popovers: [],\n tooltips: [],\n actions: []\n },\n actions: {\n //toggleDarkTheme: function() {\n // let self = this;\n // let $html = self.$(\"html\");\n // $html.toggleClass(\"theme-dark\");\n //}\n }\n });\n \n return config;\n};", " \n// Style for touch plugin\nconst setTouchStyle = (config) => {\n if (config.hasOwnProperty(\"touch\")) {\n if (config.touch.tapHold) {\n $(\"