(function framework7ComponentLoader(t,o){void 0===o&&(o=!0);document;var d=window,p=t.$,m=(t.Template7,t.utils),e=(t.device,t.support,t.Class,t.Modal),n=(t.ConstructorMethods,t.ModalMethods),s=function(u){function t(n,t){var o=m.extend({on:{}},n.params.toast,t);u.call(this,n,o);var s=this;s.app=n,s.params=o;var e,a,r=s.params,l=r.closeButton,c=r.closeTimeout;if(s.params.el)e=p(s.params.el);else{var i=s.render();e=p(i)}return e&&0<e.length&&e[0].f7Modal?e[0].f7Modal:0===e.length?s.destroy():(m.extend(s,{$el:e,el:e[0],type:"toast"}),e[0].f7Modal=s,l&&(e.find(".toast-button").on("click",function(){s.emit("local::closeButtonClick toastCloseButtonClick",s),s.close()}),s.on("beforeDestroy",function(){e.find(".toast-button").off("click")})),s.on("open",function(){p(".toast.modal-in").each(function(t,o){var e=n.toast.get(o);o!==s.el&&e&&e.close()}),c&&(a=m.nextTick(function(){s.close()},c))}),s.on("close",function(){d.clearTimeout(a)}),s.params.destroyOnClose&&s.once("closed",function(){setTimeout(function(){s.destroy()},0)}),s)}return u&&(t.__proto__=u),((t.prototype=Object.create(u&&u.prototype)).constructor=t).prototype.render=function(){var t=this;if(t.params.render)return t.params.render.call(t,t);var o=t.params,e=o.position,n=o.cssClass,s=o.icon,a=o.text,r=o.closeButton,l=o.closeButtonColor,c=o.closeButtonText;return('\n      <div class="toast toast-'+e+" "+(n||"")+" "+(s?"toast-with-icon":"")+'">\n        <div class="toast-content">\n          '+(s?'<div class="toast-icon">'+s+"</div>":"")+'\n          <div class="toast-text">'+a+"</div>\n          "+(r&&!s?('\n          <a class="toast-button button '+(l?"color-"+l:"")+'">'+c+"</a>\n          ").trim():"")+"\n        </div>\n      </div>\n    ").trim()},t}(e),a={name:"toast",static:{Toast:s},create:function(){var o=this;o.toast=m.extend({},n({app:o,constructor:s,defaultSelector:".toast.modal-in"}),{show:function(t){return m.extend(t,{destroyOnClose:!0}),new s(o,t).open()}})},params:{toast:{icon:null,text:null,position:"bottom",closeButton:!1,closeButtonColor:null,closeButtonText:"Ok",closeTimeout:null,cssClass:null,render:null}}};if(o){if(t.prototype.modules&&t.prototype.modules[a.name])return;t.use(a),t.instance&&(t.instance.useModuleParams(a,t.instance.params),t.instance.useModule(a))}return a}(Framework7, typeof Framework7AutoInstallComponent === 'undefined' ? undefined : Framework7AutoInstallComponent))
