vue-router-tab
Version:
Vue.js tab components, based on Vue Router
2 lines • 60.6 kB
JavaScript
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue-router-tab"]=e():t["vue-router-tab"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s="fb15")}({"0d3e":function(t,e,r){"use strict";r.r(e),e["default"]={tab:{untitled:"无标题"},contextmenu:{refresh:"刷新",refreshAll:"刷新全部",close:"关闭",closeLefts:"关闭左侧",closeRights:"关闭右侧",closeOthers:"关闭其他"},msg:{keepLastTab:"至少应保留1个页签",i18nProp:"请提供“i18n”方法以处理国际化内容"}}},"3dec":function(t,e,r){"use strict";r.r(e),e["default"]={tab:{untitled:"Untitled"},contextmenu:{refresh:"Refresh",refreshAll:"Refresh All",close:"Close",closeLefts:"Close to the Left",closeRights:"Close to the Right",closeOthers:"Close Others"},msg:{keepLastTab:"Keep at least 1 tab",i18nProp:'Method "i18n" is not defined on the instance'}}},"751c":function(t,e,r){},8875:function(t,e,r){var n,o,i;(function(r,a){o=[],n=a,i="function"===typeof n?n.apply(e,o):n,void 0===i||(t.exports=i)})("undefined"!==typeof self&&self,(function(){function t(){var e=Object.getOwnPropertyDescriptor(document,"currentScript");if(!e&&"currentScript"in document&&document.currentScript)return document.currentScript;if(e&&e.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(d){var r,n,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,a=/@([^@]*):(\d+):(\d+)\s*$/gi,u=i.exec(d.stack)||a.exec(d.stack),s=u&&u[1]||!1,c=u&&u[2]||!1,l=document.location.href.replace(document.location.hash,""),f=document.getElementsByTagName("script");s===l&&(r=document.documentElement.outerHTML,n=new RegExp("(?:[^\\n]+?\\n){0,"+(c-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=r.replace(n,"$1").trim());for(var h=0;h<f.length;h++){if("interactive"===f[h].readyState)return f[h];if(f[h].src===s)return f[h];if(s===l&&f[h].innerHTML&&f[h].innerHTML.trim()===o)return f[h]}return null}}return t}))},"96cf":function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(A){s=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof m?e:m,i=Object.create(o.prototype),a=new _(n||[]);return i._invoke=j(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(A){return{type:"throw",arg:A}}}t.wrap=c;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",v={};function m(){}function b(){}function y(){}var g={};s(g,i,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(I([])));x&&x!==r&&n.call(x,i)&&(g=x);var O=y.prototype=m.prototype=Object.create(g);function $(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,u){var s=l(t[o],t,i);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"===typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var o;function i(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}this._invoke=i}function j(t,e,r){var n=f;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return D()}r.method=o,r.arg=i;while(1){var a=r.delegate;if(a){var u=P(a,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var s=l(t,e,r);if("normal"===s.type){if(n=r.done?p:h,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator["return"]&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function I(t){if(t){var r=t[i];if(r)return r.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){while(++o<t.length)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:D}}function D(){return{value:e,done:!0}}return b.prototype=y,s(O,"constructor",y),s(y,"constructor",b),b.displayName=s(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,u,"GeneratorFunction")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},$(S.prototype),s(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},$(O),s(O,u,"Generator"),s(O,i,(function(){return this})),s(O,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){while(e.length){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=I,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=n}catch(o){"object"===typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},a34a:function(t,e,r){t.exports=r("96cf")},a85e:function(t,e,r){},b13e:function(t,e,r){var n={"./en.js":"3dec","./zh.js":"0d3e"};function o(t){var e=i(t);return r(e)}function i(t){if(!r.o(n,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return n[t]}o.keys=function(){return Object.keys(n)},o.resolve=i,t.exports=o,o.id="b13e"},fb15:function(t,e,r){"use strict";if(r.r(e),r.d(e,"RouterAlive",(function(){return Xt})),r.d(e,"RouterTabRoutes",(function(){return or})),r.d(e,"Iframe",(function(){return nr})),"undefined"!==typeof window){var n=window.document.currentScript,o=r("8875");n=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(r.p=i[1])}var a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"router-tab"},[r("header",{ref:"header",staticClass:"router-tab__header"},[r("div",{staticClass:"router-tab__slot-start"},[t._t("start")],2),r("tab-scroll",{ref:"scroll"},[r("transition-group",t._b({staticClass:"router-tab__nav",attrs:{tag:"ul"},on:{"after-enter":t.onTabTrans,"after-leave":t.onTabTrans}},"transition-group",t.tabTrans,!1),t._l(t.items,(function(e,n){return r("tab-item",{key:e.id||e.to,ref:"tab",refInFor:!0,attrs:{data:e,index:n},nativeOn:{contextmenu:function(r){return r.preventDefault(),function(r){return t.showContextmenu(e.id,n,r)}.apply(null,arguments)}}})})),1)],1),r("div",{staticClass:"router-tab__slot-end"},[t._t("end")],2)],1),r("div",{staticClass:"router-tab__container"},[r("router-alive",{attrs:{"page-class":"router-tab-page","keep-alive":t.keepAlive,reuse:t.reuse,max:t.maxAlive,transition:t.pageTrans,"page-scroller":t.pageScroller},on:{ready:t.onAliveReady,change:t.onAliveChange}}),r("transition-group",t._b({staticClass:"router-tab__iframes",attrs:{tag:"div"}},"transition-group",t.pageTrans,!1),t._l(t.iframes,(function(e){return r("iframe",{directives:[{name:"show",rawName:"v-show",value:e===t.currentIframe,expression:"url === currentIframe"}],key:e,staticClass:"router-tab__iframe",attrs:{src:e,name:t.iframeNamePrefix+e,frameborder:"0"},on:{load:function(r){return t.iframeLoaded(e)}}})})),0)],1),r("transition",{attrs:{name:"router-tab-zoom"}},[!1!==t.contextmenu&&t.contextData.index>-1?r("tab-contextmenu",{attrs:{data:t.contextData,menu:t.contextMenu}}):t._e()],1)],1)},u=[],s=r("a34a"),c=r.n(s);function l(t,e){return v(t)||p(t,e)||h(t,e)||f()}function f(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(t,e){if(t){if("string"===typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function p(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done);a=!0)if(i.push(n.value),e&&i.length===e)break}catch(s){u=!0,o=s}finally{try{a||null==r["return"]||r["return"]()}finally{if(u)throw o}}return i}}function v(t){if(Array.isArray(t))return t}function m(t){return m="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}var b=Object.create(null);function y(t,e){if(t.length){var r=t.indexOf(e);if(r>-1)return t.splice(r,1)}}function g(t){var e=t.wrap,r=t.left,n=void 0===r?0:r,o=t.top,i=void 0===o?0:o,a=t.smooth,u=void 0===a||a;e&&(e.scrollTo?e.scrollTo({left:n,top:i,behavior:u?"smooth":"auto"}):(e.scrollLeft=n,e.scrollTop=i))}function w(t){var e=t.el,r=t.wrap,n=t.block,o=void 0===n?"start":n,i=t.inline,a=void 0===i?"nearest":i;if(e&&r)if(e.scrollIntoView)e.scrollIntoView({behavior:"smooth",block:o,inline:a});else{var u,s,c=e.offsetLeft,l=e.offsetTop;s="center"===o?l+(e.clientHeight-r.clientHeight)/2:l,u="center"===a?c+(e.clientWidth-r.clientWidth)/2:c,g({wrap:r,left:u,top:s})}}var x=function(){var t=null;return function(){if(null!==t)return t;var e=document.createElement("div");return e.style.cssText="width: 100px; height: 100px;overflow-y: scroll",document.body.appendChild(e),t=e.offsetWidth-e.clientWidth,e.parentElement.removeChild(e),t}}();function O(t,e,r){var n={},o=function(e,o){null!==o&&"object"===m(o)||(o={default:o});var i=o,a=i.default,u=i.alias;n[u||e]=function(){var n=this[t][e];return r&&"function"===typeof n?n(this[r]):void 0!==a&&void 0===n?"function"===typeof a?a.bind(this)():a:n}};return Array.isArray(e)?e.forEach((function(t){return o(t)})):Object.entries(e).forEach((function(t){var e=l(t,2),r=e[0],n=e[1];return o(r,n)})),n}var $=function(t){return t.split("#")[0]};function S(t){return"string"===typeof t?{name:t}:t}function j(t){return t.$vnode.componentOptions.Ctor.cid}function P(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function T(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){P(i,n,o,a,u,"next",t)}function u(t){P(i,n,o,a,u,"throw",t)}a(void 0)}))}}var k={data:function(){return{contextData:{id:null,index:-1,left:0,top:0}}},computed:{contextMenu:function(){return Array.isArray(this.contextmenu)?this.contextmenu:void 0}},watch:{$route:function(){this.hideContextmenu()},onDragSort:function(){this.hideContextmenu()}},mounted:function(){document.addEventListener("click",this.contextmenuClickOutSide)},destroyed:function(){document.removeEventListener("click",this.contextmenuClickOutSide)},methods:{showContextmenu:function(t,e,r){var n=this;return T(c.a.mark((function o(){var i,a,u;return c.a.wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(null===t||null===n.contextData.id){o.next=4;break}return n.hideContextmenu(),o.next=4,n.$nextTick();case 4:i=r||b,a=i.clientY,u=i.clientX,Object.assign(n.contextData,{id:t,index:e,top:a,left:u});case 6:case"end":return o.stop()}}),o)})))()},hideContextmenu:function(){this.showContextmenu(null,-1)},contextmenuClickOutSide:function(t){t.target!==this.$el.querySelector(".router-tab-contextmenu")&&this.hideContextmenu()}}};function _(t,e){return L(t)||E(t,e)||D(t,e)||I()}function I(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(t,e){if(t){if("string"===typeof t)return A(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?A(t,e):void 0}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function E(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done);a=!0)if(i.push(n.value),e&&i.length===e)break}catch(s){u=!0,o=s}finally{try{a||null==r["return"]||r["return"]()}finally{if(u)throw o}}return i}}function L(t){if(Array.isArray(t))return t}var C=r("b13e"),R=C.keys().reduce((function(t,e){var r=/\.\/(.*).js/g.exec(e),n=_(r,2),o=n[1];return t[o]=C(e).default,t}),{}),M="[Vue Router Tab]";function W(t,e){t||"undefined"!==typeof console&&console.warn("".concat(M," ").concat(e))}function N(t){return K(t)||B(t)||V(t)||U()}function U(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function V(t,e){if(t){if("string"===typeof t)return H(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(t,e):void 0}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function B(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function K(t){if(Array.isArray(t))return t}var F={computed:{langs:function(){var t=this.lang;return"auto"===t&&(t=(navigator.language||navigator.userLanguage).substr(0,2)),"string"===typeof t&&(t=R[t]),t||(t=R["en"]),t}},methods:{i18nText:function(t){var e=this.i18nParse(t),r=e.key,n=e.params;if(r){var o="function"===typeof this.i18n;if(this._hasI18nPropWarn||(W(o,this.langs.msg.i18nProp),this._hasI18nPropWarn=!0),o)return this.i18n(r,n)}return t},i18nParse:function(t){var e,r;if("string"===typeof t){var n=/^i18n:([^\s]+)$/.exec(t);n&&(e=n[1],r=[])}else if(Array.isArray(t)){var o=N(t);e=o[0],r=o.slice(1)}return{key:e,params:r}}}},z={data:function(){return{iframes:[],currentIframe:null,iframeNamePrefix:"RouterTabIframe-"}},methods:{getIframePath:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n="".concat(this.basePath,"/iframe/").replace(/\/+/g,"/")+encodeURIComponent(t);return e&&(n+="/"+e,r&&(n+="/"+r)),n},openIframe:function(t,e,r){var n=this.getIframePath(t,e,r);this.$router.push(n)},closeIframe:function(t){var e=this.getIframePath(t);this.close({path:e,match:!1})},refreshIframe:function(t){var e=this.getIframePath(t);this.refresh(e,!1)},getIframeEl:function(t){var e=this.iframeNamePrefix+t;return document.getElementsByName(e)[0]},iframeMounted:function(t){var e=this.getIframeEl(t);this.$emit("iframe-mounted",t,e)},iframeLoaded:function(t){var e=this.getIframeEl(t);this.$emit("iframe-loaded",t,e)}}};function G(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function X(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){G(i,n,o,a,u,"next",t)}function u(t){G(i,n,o,a,u,"throw",t)}a(void 0)}))}}function q(t,e){return tt(t)||Z(t,e)||J(t,e)||Y()}function Y(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function J(t,e){if(t){if("string"===typeof t)return Q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(t,e):void 0}}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Z(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done);a=!0)if(i.push(n.value),e&&i.length===e)break}catch(s){u=!0,o=s}finally{try{a||null==r["return"]||r["return"]()}finally{if(u)throw o}}return i}}function tt(t){if(Array.isArray(t))return t}function et(t){return et="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t){t=Array.from(t);var e=t.length,r=t[0];if(e){if(!r||"object"!==et(r)||r.name||r.fullPath||r.params||r.query||r.hash){var n=t,o=q(n,2),i=o[0],a=o[1];return{path:i,to:a}}return r}return{}}function nt(t,e){var r=/\/$/;return t.replace(r,"")===e.replace(r,"")}var ot={methods:{open:function(t){var e=arguments,r=this;return X(c.a.mark((function n(){var o,i,a,u,s;return c.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return o=e.length>1&&void 0!==e[1]&&e[1],i=!(e.length>2&&void 0!==e[2])||e[2],a=r.activeTabId,u=r.getRouteKey(t),s=nt(a,u),"sameTab"===i&&(i=s),i&&r.refresh(t,!1),n.prev=7,n.next=10,r.$router[o?"replace":"push"](t);case 10:n.next=14;break;case 12:n.prev=12,n.t0=n["catch"](7);case 14:return n.prev=14,s&&r.reload(),n.finish(14);case 17:case"end":return n.stop()}}),n,null,[[7,12,14,17]])})))()},removeTab:function(t){var e=arguments,r=this;return X(c.a.mark((function n(){var o,i,a;return c.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=e.length>1&&void 0!==e[1]&&e[1],i=r.items,a=i.findIndex((function(e){return e.id===t})),o||!r.keepLastTab||1!==i.length){n.next=5;break}throw new Error(r.langs.msg.keepLastTab);case 5:if(o){n.next=8;break}return n.next=8,r.leavePage(t,"close");case 8:r.$alive.remove(t),a>-1&&i.splice(a,1);case 10:case"end":return n.stop()}}),n)})))()},close:function(){var t=arguments,e=this;return X(c.a.mark((function r(){var n,o,i,a,u,s,l,f,h,d,p,v,m,b;return c.a.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(n=rt(t),o=n.id,i=n.path,a=n.match,u=void 0===a||a,s=n.force,l=void 0===s||s,f=n.to,h=n.refresh,d=void 0!==h&&h,p=e.activeTabId,v=e.items,o||!i){r.next=6;break}if(o=e.getIdByPath(i,u),o){r.next=6;break}return r.abrupt("return");case 6:return o||(o=p),r.prev=7,m=v.findIndex((function(t){return t.id===o})),r.next=11,e.removeTab(o,l);case 11:if(null!==f){r.next=13;break}return r.abrupt("return");case 13:f||p!==o||(b=v[m]||v[m-1],f=b?b.to:e.defaultPath),f&&e.open(f,!0,!1!==d||"sameTab"),r.next=20;break;case 17:r.prev=17,r.t0=r["catch"](7),W(!1,r.t0);case 20:case"end":return r.stop()}}),r,null,[[7,17]])})))()},closeTab:function(){var t=arguments,e=this;return X(c.a.mark((function r(){var n,o,i;return c.a.wrap((function(r){while(1)switch(r.prev=r.next){case 0:n=t.length>0&&void 0!==t[0]?t[0]:e.activeTabId,o=t.length>1?t[1]:void 0,i=t.length>2&&void 0!==t[2]&&t[2],e.close({id:n,to:o,force:i});case 4:case"end":return r.stop()}}),r)})))()},refresh:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t&&this.getIdByPath(t,e)||void 0;this.refreshTab(n,r)},refreshTab:function(){var t=arguments,e=this;return X(c.a.mark((function r(){var n,o;return c.a.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(n=t.length>0&&void 0!==t[0]?t[0]:e.activeTabId,o=t.length>1&&void 0!==t[1]&&t[1],r.prev=2,o){r.next=6;break}return r.next=6,e.leavePage(n,"refresh");case 6:e.$alive.refresh(n),r.next=12;break;case 9:r.prev=9,r.t0=r["catch"](2),W(!1,r.t0);case 12:case"end":return r.stop()}}),r,null,[[2,9]])})))()},refreshAll:function(){var t=arguments,e=this;return X(c.a.mark((function r(){var n,o,i;return c.a.wrap((function(r){while(1)switch(r.prev=r.next){case 0:n=t.length>0&&void 0!==t[0]&&t[0],o=e.$alive.cache,r.t0=c.a.keys(o);case 3:if((r.t1=r.t0()).done){r.next=16;break}if(i=r.t1.value,r.prev=5,n){r.next=9;break}return r.next=9,e.leavePage(i,"refresh");case 9:e.$alive.refresh(i),r.next=14;break;case 12:r.prev=12,r.t2=r["catch"](5);case 14:r.next=3;break;case 16:case"end":return r.stop()}}),r,null,[[5,12]])})))()},reset:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultPath;this.items.forEach((function(e){var r=e.id;return t.$alive.remove(r)})),this.clearTabsStore(),this.initTabs(),this.open(e,!0,!0)}}};function it(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function at(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){it(i,n,o,a,u,"next",t)}function u(t){it(i,n,o,a,u,"throw",t)}a(void 0)}))}}var ut,st,ct=function(t){return function(e,r,n){var o=t.app.$tabs;if(o){var i,a,u=o.getRouteKey(r),s=o.getRouteKey(e),c=o.$alive,l=c&&c.cache[u],f=c&&c.cache[s]||b,h=f.alivePath,d=o.matchRoute(e);h&&h!==d.alivePath?(a="replace",i=s):c.basePath!==d.basePath?(a="leave",i=o.activeTabId):l||u===s||(a="leave",i=o.activeTabId),a?o.leavePage(i,a).then(n).catch((function(){return n(!1)})):n()}else n()}},lt={created:function(){var t=this.$router;t._RouterTabInit||(t.beforeEach(ct(t)),t._RouterTabInit=!0)},methods:{leavePage:function(t,e){var r=this;return at(c.a.mark((function n(){var o,i,a,u;return c.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=r.items.find((function(e){return e.id===t})),i=r.$alive.cache[t]||b,a=i.vm,!a&&r.activeTabId===t)try{a=r.$route.matched[r.$alive.routeMatch.routeIndex].instances.default}catch(s){a=null}if(a&&o){n.next=5;break}return n.abrupt("return");case 5:if(u=a.$vnode.componentOptions.Ctor.options.beforePageLeave,"function"!==typeof u){n.next=8;break}return n.abrupt("return",u.bind(a)(o,e));case 8:case"end":return n.stop()}}),n)})))()}}},ft=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;return function(e,r,n){var o=n.value,i=null;n.value=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var a=this;clearTimeout(i),i=setTimeout((function(){o.call.apply(o,[a].concat(r))}),t)}}};function ht(t,e,r,n,o){var i={};return Object.keys(n).forEach((function(t){i[t]=n[t]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=r.slice().reverse().reduce((function(r,n){return n(t,e,r)||r}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer&&(Object.defineProperty(t,e,i),i=null),i}function dt(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function pt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){dt(i,n,o,a,u,"next",t)}function u(t){dt(i,n,o,a,u,"throw",t)}a(void 0)}))}}var vt={watch:{activeTabId:{handler:function(){var t=this;return pt(c.a.mark((function e(){return c.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.$el){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.$nextTick();case 4:t.adjust();case 5:case"end":return e.stop()}}),e)})))()},immediate:!0}},mounted:function(){window.addEventListener("resize",this.adjust)},destroyed:function(){window.removeEventListener("resize",this.adjust)},methods:(ut=ft(),st={adjust:function(){if(this.$el){var t=this.$refs.scroll,e=this.$el.querySelector(".router-tab__item.is-active");t&&e&&!t.isInView(e)&&t.scrollIntoView(e),this.hideContextmenu()}},onTabTrans:function(){this.adjust()}},ht(st,"adjust",[ut],Object.getOwnPropertyDescriptor(st,"adjust"),st),st)},mt={computed:{restoreKey:function(){var t=this.restore,e=this.basePath;if(!t||"undefined"===typeof sessionStorage)return"";var r="RouterTab:restore:".concat(e);return"string"===typeof t&&(r+=":".concat(t)),r}},mounted:function(){window.addEventListener("beforeunload",this.saveTabs)},destroyed:function(){window.removeEventListener("beforeunload",this.saveTabs)},watch:{restoreKey:function(){if(this.restoreWatch){var t=this.activeTab;this.initTabs(),this.activeTab||this.items.push(t)}}},methods:{saveTabs:function(){this.restoreKey&&sessionStorage.setItem(this.restoreKey,JSON.stringify(this.items))},clearTabsStore:function(){this.restoreKey&&sessionStorage.removeItem(this.restoreKey)},restoreTabs:function(){if(!this.restoreKey)return!1;var t=sessionStorage.getItem(this.restoreKey),e=!1;try{t=JSON.parse(t),Array.isArray(t)&&t.length&&(e=!0,this.presetTabs(t))}catch(r){}return e}}},bt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"router-alive"},[r("transition",t._b({attrs:{appear:""},on:{"after-enter":t.onTrans,"after-leave":t.onTrans}},"transition",t.pageTrans,!1),[r("keep-alive",{attrs:{max:t.max}},[t.alive&&!t.onRefresh?r("router-view",t._g({key:t.key,ref:"page",class:t.pageClass,on:{"page-loaded":t.onPageLoaded}},t.hooks)):t._e()],1)],1),r("transition",t._b({attrs:{appear:""},on:{"after-enter":t.onTrans,"after-leave":t.onTrans}},"transition",t.pageTrans,!1),[t.alive||t.onRefresh?t._e():r("router-view",{key:t.key,ref:"page",class:t.pageClass})],1)],1)},yt=[],gt={path:function(t){return t.path},fullpath:function(t){return $(t.fullPath)}};function wt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ot(t,e,r){return e&&xt(t.prototype,e),r&&xt(t,r),t}function $t(t,e){return kt(t)||Tt(t,e)||jt(t,e)||St()}function St(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jt(t,e){if(t){if("string"===typeof t)return Pt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pt(t,e):void 0}}function Pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Tt(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done);a=!0)if(i.push(n.value),e&&i.length===e)break}catch(s){u=!0,o=s}finally{try{a||null==r["return"]||r["return"]()}finally{if(u)throw o}}return i}}function kt(t){if(Array.isArray(t))return t}function _t(t,e,r){var n=e.path;if(!r)return n;if("string"===typeof r){var o=gt[r.toLowerCase()];return o?o(t):r}return"function"===typeof r?_t(t,e,r(t)):n}function It(t,e){return Object.entries(e).reduce((function(t,e){var r=$t(e,2),n=r[0],o=r[1];return t.replace(":"+n,o)}),t)}var Dt=function(){function t(e,r){wt(this,t),this.vm=e,this.$route=r}return Ot(t,[{key:"$route",get:function(){return this._$route||this.vm.$route},set:function(t){if(t&&!t.matched){var e=this.vm.$router;t=e.match(t,e.currentRoute)}this._$route=t}},{key:"routeIndex",get:function(){return this.vm.routeIndex}},{key:"route",get:function(){return this.$route.matched[this.routeIndex]}},{key:"basePath",get:function(){if(this.routeIndex<1)return"/";var t=this.$route.matched[this.routeIndex-1]||{},e=t.path;return e&&It(e,this.$route.params)||"/"}},{key:"alivePath",get:function(){var t=this.$route;return this.nest?It(this.route.path,t.params):$(t.fullPath)}},{key:"meta",get:function(){var t=this.route,e=this.vm.$nuxt;if(e)try{var r=e.context.route.meta,n=void 0===r?[]:r,o=n[this.routeIndex];if(o&&Object.keys(o).length)return o}catch(i){console.error(i)}return t&&t.meta||{}}},{key:"nest",get:function(){return this.$route.matched.length>this.routeIndex+1}},{key:"key",get:function(){return this.route?_t(this.$route,this.route,this.meta.key):""}},{key:"alive",get:function(){var t=this.meta.keepAlive;return"boolean"===typeof t?t:this.vm.keepAlive}},{key:"reusable",get:function(){var t=this.meta.reuse;return"boolean"===typeof t?t:this.vm.reuse}}]),t}();function At(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function Et(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){At(i,n,o,a,u,"next",t)}function u(t){At(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Lt(t,e){return Nt(t)||Wt(t,e)||Rt(t,e)||Ct()}function Ct(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Rt(t,e){if(t){if("string"===typeof t)return Mt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mt(t,e):void 0}}function Mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Wt(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done);a=!0)if(i.push(n.value),e&&i.length===e)break}catch(s){u=!0,o=s}finally{try{a||null==r["return"]||r["return"]()}finally{if(u)throw o}}return i}}function Nt(t){if(Array.isArray(t))return t}function Ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Vt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ut(Object(r),!0).forEach((function(e){Ht(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ut(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ht(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Bt=["created","mounted","activated","deactivated","destroyed"],Kt={name:"RouterAlive",provide:function(){return{RouterAlive:this}},props:{keepAlive:{type:Boolean,default:!1},reuse:{type:Boolean,default:!1},max:{type:Number,default:0},pageClass:{type:[Array,Object,String],default:"router-alive-page"},pageScroller:{type:String,default:""},transition:{type:[String,Object]}},data:function(){return this.cache={},{routeMatch:new Dt(this),routeIndex:this.getRouteIndex(),onRefresh:!1}},computed:Vt(Vt({},O("routeMatch",["key","meta","nest","alive","reusable","basePath","alivePath"])),{},{hooks:function(){var t=this;return Bt.reduce((function(e,r){return e["hook:"+r]=function(){return t.pageHook(r)},e}),{})},pageTrans:function(){return S(this.transition)}}),watch:{$route:{handler:function(t,e){if(e||this.$emit("ready",this),t.matched.length){var r=this.key,n=this.alive,o=this.reusable,i=this.alivePath,a=this.nest,u=this.cache[r]||{},s=u.alivePath,c=u.fullPath,l=u.vm;if(s&&!o&&s!==i&&(s="",this.refresh(r)),a&&l&&t.fullPath!==c){var f=this.matchRoute(e).key;f!==r&&(this.nestForceUpdate=!0)}var h=s?"update":"create";this.$emit("change",h,this.routeMatch),n&&(u.fullPath=t.fullPath)}},immediate:!0}},mounted:function(){this.$refs.alive=this._vnode.children[0].child._vnode.componentInstance},destroyed:function(){this.cache=null,this.routeMatch=null,this._match=null,this.$refs.alive=null},methods:{getRouteIndex:function(){var t=this,e=-1;while(t&&e<0){var r=t.$vnode||{},n=r.data;n&&n.routerView?e=n.routerViewDepth:t=t.$parent}return e+1},remove:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.key,e=this.$refs.alive;if(e){var r=this.cache[t],n=e.cache,o=e.keys;r&&(r.vm.$destroy(),r.vm=null,this.cache[t]=null),Object.entries(n).find((function(e){var r,i,a=Lt(e,2),u=a[0],s=a[1],c=null===s||void 0===s?void 0:s.componentInstance;if((null===c||void 0===c||null===(r=c.$vnode)||void 0===r||null===(i=r.data)||void 0===i?void 0:i.key)===t)return c.$destroy(),n[u]=null,y(o,u),!0}))}},refresh:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.key;this.remove(t),t===this.key&&this.reload()},reload:function(){this.onRefresh||(this.onRefresh=!0)},pageHook:function(t){var e=this["pageHook:".concat(t)];"function"===typeof e&&e()},"pageHook:created":function(){this.cache[this.key]={alivePath:this.alivePath,fullPath:this.$route.fullPath}},"pageHook:mounted":function(){this.cache[this.key].vm=this.$refs.page,this.resetScrollPosition()},"pageHook:activated":function(){var t=this.$refs.page;this.checkHotReloading()||(this.nestForceUpdate&&(delete this.nestForceUpdate,t.$forceUpdate()),this.restoreScrollPosition())},"pageHook:deactivated":function(){this.checkHotReloading()||this.saveScrollPosition()},"pageHook:destroyed":function(){var t=this;return Et(c.a.mark((function e(){return c.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$nextTick();case 2:if(t.cache){e.next=4;break}return e.abrupt("return");case 4:Object.entries(t.cache).forEach((function(e){var r=Lt(e,2),n=r[0],o=r[1],i=o||{},a=i.vm;a&&a._isDestroyed&&t.remove(n)}));case 5:case"end":return e.stop()}}),e)})))()},onTrans:function(){this.onRefresh&&(this.onRefresh=!1,this.$emit("change","create",this.routeMatch))},matchRoute:function(t){var e=this._match;return t===this.$route||t.fullPath===this.$route.fullPath||t===this.$route.fullPath?this.routeMatch:e?(e.$route=t,e):this._match=new Dt(this,t)},checkHotReloading:function(){var t=this.$refs.page,e=t._lastCtorId,r=t._lastCtorId=j(t);return!(!e||e===r)&&(this.refresh(),!0)},getScroller:function(t){return t.startsWith("$")?document.querySelector(t.replace(/^\$/,"")):this.$el.querySelector(t)},saveScrollPosition:function(){var t=this,e=this.$refs.page;if(e){var r=e.$vnode.componentOptions.Ctor.options.pageScroller;"string"===typeof r&&r.length&&(r=r.split(/\s?,\s?/)),Array.isArray(r)||(r=[]),r.push("."+this.pageClass),this.pageScroller&&r.push("$"+this.pageScroller);var n=r.reduce((function(e,r){var n=t.getScroller(r);return n&&(e[r]={left:n.scrollLeft,top:n.scrollTop}),e}),{});e._pageScrollPosition=n}},restoreScrollPosition:function(){var t=this,e=this.$refs.page,r=null===e||void 0===e?void 0:e._pageScrollPosition;r&&Object.entries(r).forEach((function(e){var r=Lt(e,2),n=r[0],o=r[1],i=t.getScroller(n);i&&(i.scrollLeft=o.left,i.scrollTop=o.top)}))},resetScrollPosition:function(){if(this.pageScroller){var t=this.getScroller("$"+this.pageScroller);t&&(t.scrollLeft=0,t.scrollTop=0)}},onPageLoaded:function(){var t=this;return Et(c.a.mark((function e(){return c.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$nextTick();case 2:t.restoreScrollPosition();case 3:case"end":return e.stop()}}),e)})))()}}},Ft=Kt;function zt(t,e,r,n,o,i,a,u){var s,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=r,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),a?(s=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=s):o&&(s=u?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),s)if(c.functional){c._injectStyles=s;var l=c.render;c.render=function(t,e){return s.call(e),l(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,s):[s]}return{exports:t,options:c}}var Gt=zt(Ft,bt,yt,!1,null,null,null),Xt=Gt.exports;function qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Yt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qt(Object(r),!0).forEach((function(e){Jt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Jt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Qt="RouterTabDragSortIndex:",Zt=null,te={name:"TabItem",inject:["$tabs"],props:{data:{type:Object,required:!0},index:Number},data:function(){return{onDragSort:!1,isDragOver:!1}},computed:Yt(Yt({},O("data",["id","to","icon","tabClass","target","href"])),{},{classList:function(){return["router-tab__item",this.tabClass,{"is-active":this.$tabs.activeTabId===this.id,"is-closable":this.closable,"is-contextmenu":this.$tabs.contextData.id===this.id,"is-drag-over":this.isDragOver&&!this.onDragSort}]},i18nText:function(){return this.$tabs.i18nText},untitled:function(){return this.$tabs.langs.tab.untitled},title:function(){return this.i18nText(this.data.title)||this.untitled},tips:function(){return this.i18nText(this.data.tips||this.data.title)||this.untitled},closable:function(){var t=this.$tabs,e=t.keepLastTab,r=t.items;return!1!==this.data.closable&&!(e&&r.length<2)}}),methods:{slotDefault:function(){var t=this,e=this.$createElement;return[this.icon&&e("i",{class:["router-tab__item-icon",this.icon]}),e("span",{class:"router-tab__item-title",attrs:{title:this.tips}},[this.title]),this.closable&&e("i",{class:"router-tab__item-close",on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.close(e)}}})]},close:function(){this.$tabs.closeTab(this.id)},onDragStart:function(t){this.onDragSort=this.$tabs.onDragSort=!0,Zt=Qt+this.index,t.dataTransfer.setData("text",Zt),t.dataTransfer.effectAllowed="move"},onDragOver:function(t){this.isDragOver=!0,t.dataTransfer.dropEffect="move"},onDragEnd:function(){this.onDragSort=this.$tabs.onDragSort=!1,Zt=null},onDrop:function(t){var e=this.$tabs.items,r=t.dataTransfer.getData("text")||Zt;if(this.isDragOver=!1,"string"===typeof r&&r.startsWith(Qt)){var n=r.replace(Qt,""),o=e[n];e.splice(n,1),e.splice(this.index,0,o)}}},render:function(){var t=this,e=arguments[0],r=this.$tabs.$scopedSlots.default,n=void 0===r?this.slotDefault:r;return e("RouterLink",{attrs:{custom:!0,to:this.to},scopedSlots:{default:function(r){var o=r.navigate;return e("li",{class:t.classList,attrs:{draggable:t.$tabs.dragsort},on:{click:o,dragstart:t.onDragStart,dragend:t.onDragEnd,dragover:function(e){return e.preventDefault(),t.onDragOver(e)},dragleave:function(e){return e.preventDefault(),function(){return t.isDragOver=!1}()},drop:function(e){return e.stopPropagation(),e.preventDefault(),t.onDrop(e)},mouseup:function(e){return"button"in e&&1!==e.button?null:function(){return t.closable&&t.close()}()}}},[n(t)])}}})}},ee=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"router-tab__scroll",on:{wheel:function(e){return e.preventDefault(),t.onWheel.apply(null,arguments)},mouseenter:t.update}},[r("div",{ref:"container",staticClass:"router-tab__scroll-container",class:{"is-mobile":t.isMobile},on:{scroll:t.update}},[t._t("default")],2),r("div",{directives:[{name:"show",rawName:"v-show",value:t.hasScroller,expression:"hasScroller"}],ref:"bar",staticClass:"router-tab__scrollbar",class:{"is-dragging":t.dragData}},[r("div",{ref:"thumb",staticClass:"router-tab__scrollbar-thumb",style:{width:t.thumbWidth+"px",transform:"translateX("+t.thumbLeft+"px"},on:{mousedown:function(e){return e.preventDefault(),t.onDragStart.apply(null,arguments)}}})])])},re=[],ne={name:"TabScroll",props:{space:{type:Number,default:300}},data:function(){return{isMobile:!1,scrollData:{clientWidth:0,scrollWidth:0,scrollLeft:0},dragData:null}},computed:{hasScroller:function(){return!this.isMobile&&!this.$tabs.onDragSort&&this.scrollData.scrollWidth>this.scrollData.clientWidth},thumbWidth:function(){if(this.hasScroller){var t=this.scrollData,e=t.clientWidth,r=t.scrollWidth;return e/r*e}},thumbLeft:function(){if(this.hasScroller){if(this.dragData)return this.dragData.thumbLeft;var t=this.scrollData,e=t.clientWidth,r=t.scrollWidth,n=t.scrollLeft;return(e-this.thumbWidth)*(n/(r-e))}}},mounted:function(){this.update()},methods:{update:function(){var t=this.$refs.container;if(t){var e=t.clientWidth,r=t.scrollWidth,n=t.scrollLeft;this.isMobile=/mobile/i.test(navigator.userAgent)||!x(),Object.assign(this.scrollData,{clientWidth:e,scrollWidth:r,scrollLeft:n})}},scrollTo:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];g({wrap:this.$refs.container,left:t,smooth:e})},scrollIntoView:function(t){w({el:t,wrap:this.$refs.container,inline:"center"})},isInView:function(t){var e=this.$refs.container,r=t.offsetLeft,n=e.scrollLeft;return!(r<n||r+t.clientWidth>n+e.clientWidth)},onWheel:function(t){var e=+new Date,r=e-(this.lastWheel||0)>100;if(r){this.lastWheel=e;var n=this.space,o=t.deltaY<0;this.scrollTo(this.$refs.container.scrollLeft+(o?-n:n))}},onDragStart:function(t){var e=this.thumbLeft;this.dragData={startPageX:t.pageX,startScrollLeft:this.$refs.container.scrollLeft,startThumbLeft:e,thumbLeft:e},document.addEventListener("mousemove",this.onDragMove),document.addEventListener("mouseup",this.onDragEnd)},onDragMove:function(t){var e=this.dragData,r=this.thumbWidth,n=this.scrollData,o=n.clientWidth,i=n.scrollWidth,a=e.startThumbLeft+t.pageX-e.startPageX,u=o-r;a<0?a=0:a>u&&(a=u),e.thumbLeft=a,this.scrollTo(a*(i-o)/(o-r),!1),t.preventDefault()},onDragEnd:function(t){this.dragData=null,document.removeEventListener("mousemove",this.onDragMove),document.removeEventListener("mouseup",this.onDragEnd),t.preventDefault()}}},oe=ne,ie=zt(oe,ee,re,!1,null,null,null),ae=ie.exports,ue=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"router-tab__contextmenu",class:{"has-icon":t.hasIcon},style:{left:t.data.left+"px",top:t.data.top+"px"}},t._l(t.menuList,(function(t){return r("tab-contextmenu-item",{key:t.id,attrs:{data:t}})})),1)},se=[],ce=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visible?r("a",{staticClass:"router-tab__contextmenu-item",class:t.menuClass,attrs:{"data-action":t.id,disabled:!t.enable,title:t.tips},on:{click:function(e){t.enable&&t.data.handler(t.context)}}},[t.icon?r("i",{staticClass:"router-tab__contextmenu-icon",class:t.icon}):t._e(),t._v(" "+t._s(t.title)+" ")]):t._e()},le=[];function fe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function he(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fe(Object(r),!0).forEach((function(e){de(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fe(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function de(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var pe={name:"ContextmenuItem",inject:["$tabs"],props:{data:{type:Object,required:!0}},computed:he({context:function(){var t=this.$tabs,e=this.$parent,r=e.target,n=e.data;return{$tabs:t,$menu:e,target:r,data:n}}},O("data",{id:"",title:function(){return this.$tabs.langs.contextmenu[this.id]},icon:"",tips:"",class:{default:"",alias:"menuClass"},visible:!0,enable:!0},"context"))},ve=pe,me=zt(ve,ce,le,!1,null,null,null),be=me.exports;function ye(t,e){return $e(t)||Oe(t,e)||we(t,e)||ge()}function ge(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(t,e){if(t){if("string"===typeof t)return xe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xe(t,e):void 0}}function xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Oe(t,e){var r=null==t?null:"undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done);a=!0)if(i.push(n.value),e&&i.length===e)break}catch(s){u=!0,o=s}finally{try{a||null==r["return"]||r["return"]()}finally{if(u)throw o}}return i}}function $e(t){if(Array.isArray(t))return t}var Se={refresh:{handler:function(t){var e=t.data,r=t.$tabs;r.refreshTab(e.id)}},refreshAll:{handler:function(t){var e=t.$tabs;e.refreshAll()}},close:{enable:function(t){var e=t.target;return e.closable},handler:function(t){var e=t.data,r=t.$tabs;r.closeTab(e.id)}},closeLefts:{enable:function(t){var e=t.$menu;return e.lefts.length},handler:function(t){var e=t.$menu;e.closeMulti(e.lefts)}},closeRights:{enable:function(t){var e=t.$menu;return e.rights.length},handler:function(t){var e=t.$menu;e.closeMulti(e.rights)}},closeOthers:{enable:function(t){var e=t.$menu;return e.others.length},handler:function(t){var e=t.$menu;e.closeMulti(e.others)}}};Object.entries(Se).forEach((function(t){var e=ye(t,2),r=e[0],n=e[1];return n.id=r}));var je=Se,Pe=["refresh","refreshAll","close","closeLefts","closeRights","closeOthers"];function Te(t,e){var r="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ke(t))||e&&t&&"number"===typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ke(t,e){if(t){if("string"===typeof t)return _e(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_e(t,e):void 0}}function _e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ie(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function De(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ie(i,n,o,a,u,"next",t)}function u(t){Ie(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Ae(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ee(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ae(Object(r),!0).forEach((function(e){Le(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ae(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Le(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ce={name:"TabContextmenu",components:{TabContextmenuItem:be},inject:["$tabs"],props:{data:{type:[Boolean,Object]},menu:{type:Array,default:function(){return Pe}}},computed:{target:function(){return this.tabMap[this.data.id]},menuList:function(){return this.menu.map((function(t){if("string"===typeof t)return je[t];if(t&&t.id){var e=je[t.id];return e?Ee(Ee({},e),t):t}})).filter((function(t){return t}))},hasIcon:function(){return this.menuList.some((function(t){return t.icon}))},tabMap:function(){return this.$tabs.$refs.tab.reduce((function(t,e){return t[e.id]=e,t}),{})},tabs:function(){var t=this;return this.$tabs.items.map((function(e){return t.tabMap[e.id]}))},lefts:function(){return this.tabs.slice(0,this.data.index).filter((function(t){return t.closable}))},rights:function(){return this.tabs.slice(this.data.index+1).filter((function(t){return t.closable}))},others:function(){var t=this;return this.tabs.filter((function(e){return e.closable&&t.data.id!==e.id}))}},mounted:function(){this.adjust()},methods:{closeMulti:function(t){var e=this;return De(c.a.mark((function r(){var n,o,i;return c.a.wrap((function(r){while(1)switch(r.prev=r.next){case 0:n=Te(t),r.prev=1,n.s();case 3:if((o=n.n()).done){r.next=14;break}return i=o.value.id,r.prev=5,r.next=8,e.$tabs.removeTab(i);case 8:r.next=12;break;case 10:r.prev=10,r.t0=r["catch"](5);case 12:r.next=3;break;case 14:r.next=19;break;case 16:r.prev=16,r.t1=r["catch"](1),n.e(r.t1);case 19:return r.prev=19,n.f(),r.finish(19);case 22:e.$tabs.activeTab||e.$router.replace(e.target.to);case 23:case"end":return r.stop()}}),r,null,[[1,16,19,22],[5,10]])})))()},adjust:function(){var t=this.$el.clientWidth,e=window.innerWidth;this.data.left+t>e&&(this.data.left=e-t-5)}}},Re=Ce,Me=zt(Re,ue,se,!1,null,null,null),We=Me.exports;function Ne(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function Ue(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ne(i,n,o,a,u,"next",t)}function u(t){Ne(i,n,o,a,u,"throw",t)}a(void 0)}))}}function Ve(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function He(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ve(Object(r),!0).forEach((function(e){Be(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Be(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ke={name:"RouterTab",components:{RouterAlive:Xt,TabItem:te,TabScroll:ae,TabContextmenu:We},mixins:[k,F,z,ot,lt,vt,mt],provide:function(){return{$tabs:this}},props:{tabs:{type:Array,default:function(){return[]}},restore:{type:[Boolean,String],default:!1},restoreWatch:{type:Boolean,default:!1},pageScroller:{type:String,default:".router-tab__container"},defaultPage:[String,Object],tabTransition:{type:[String,Object],default:"router-tab-zoom"},pageTransition:{type:[String,Object],default:function(){return{name:"router-tab-swap",mode:"out-in"}}},contextmenu:{type:[Boolean,Array],default:!0},dragsort:{type:Boolean,default:!0},append:{type:String,default:"last"},keepLastTab:{type:Boolean,default:!0},keepAlive:{type:Boolean,default:!0},maxAlive:{type:Number,default:0},reuse:{type:Boolean,default:!1},i18n:Function,lang:{type:[String,Object],default:"auto"}},data:function(){return{items:[],onDragSort:!1,aliveReady:!1}},computed:{$alive:function(){return this.aliveReady?this.$refs.routerAlive:null},activeTabId:function(){return this.$alive?this.$alive.key:null},activeTabIndex:function(){var t=this;return this.items.findIndex((function(e){return e.id===t.activeTabId}))},activeTab:function(){return this.items[this.activeTabIndex]},basePath:function(){return this.$alive?this.$alive.basePath:"/"},defaultPath:function(){return this.defaultPage||this.basePath||"/"},tabTrans:function(){return S(this.tabTransition)},pageTrans:function(){return S(this.pageTransition)}},created:function(){Ke.Vue.prototype.$tabs=this},destroyed:function(){var t=Ke.Vue.prototype;t.$tabs===this&&(t.$tabs=null)},methods:{onAliveReady:function(t){this.$refs.routerAlive=t,this.aliveReady=!0,this.initTabs()},initTabs:function(){this.restoreTabs()||this.presetTabs()},presetTabs:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.tabs,r={};this.items=e.map((function(e){e="string"===typeof e?{to:e}:e||b;var n=e.to&&t.matchRoute(e.to);if(n){var o=t.getRouteTab(n),i=o.id;if(!r[i])return delete e.id,r[i]=Object.assign(o,e)}})).filter((function(t){return!!t}))},onAliveChange:function(t,e){var r=this.items,n=this.lastMatchedKey,o=e.key,i=r.findIndex((function(t){var e=t.id;return e===o})),a=this.getRouteTab(e);if(i>-1)("create"===t||"update"===t&&r[i].to!==e.$route.fullPath)&&this.$set(r,i,a);else if("next"===this.append&&void 0!==n){var u=this.items.findIndex((function(t){return t.id===n}));r.splice(u+1,0,a)}else r.push(a);this.lastMatchedKey=o},getRouteTab:function(t){var e=t.key,r=t.$route,n=t.meta,o=He({},n),i=["title","tips","icon","closable"];for(var a in o)if(i.includes(a)){var u=o[a];"function"===typeof u&&(o[a]=u(r))}return Object.assign(o,{id:e,to:r.fullPath})},reload:function(){var t=this;return Ue(c.a.mark((function e(){return c.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.$alive.reload();case 1:case"end":return e.stop()}}),e)})))()},matchRoute:function(t){return this.$alive.matchRoute(t)},getRouteKey:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.$route;return this.matchRoute(t).key},getIdByPath:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t){var r=this.matchRoute(t),n=r.key;if(e){var o=this.items.find((function(t){var e=t.to;return $(e)===$(r.$route.fullPath)}));if(o)return n}return n}}}},Fe=Ke,ze=Fe,Ge=zt(ze,a,u,!1,null,null,null),Xe=Ge.exports,qe=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"router-tab-iframe-fake"})},Ye=[];function Je(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(c){return void r(c)}u.done?e(s):Promise.resolve(s).then(n,o)}function Qe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Je(i,n,o,a,u,"next",t)}function u(t){Je(i,n,o,a,u,"throw",t)}a(void 0)}))}}var Ze={key:function(t){return"iframe-".concat(t.params.src)},title:function(t){return t.params.title},icon:function(t){return t.params.icon}},tr={name:"Iframe",inject:["$tabs"],meta:Ze,props:{src:String,title:String,icon:String},computed:{url:function(){var t=decodeURIComponent(this.src);return/^(javascript|data):/i.test(t)?"about:blank":t}},mounted:function(){var t=this;return Qe(c.a.mark((function e(){var r,n,o;return c.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t.url,n=t.$tabs,o=n.iframes,o.includes(r)||o.push(r),n.currentIframe=r,e.next=6,t.$nextTick();case 6:t.$tabs.iframeMounted(r);case 7:case"end":return e.stop()}}),e)})))()},activated:function(){this.$tabs.currentIframe=this.url},deactivated:function(){this.$tabs.currentIframe=null},destroyed:function(){var t=this.url,e=this.$tabs.iframes,r=e.indexOf(t);r>-1&&e.splice(r,1)}},er=tr,rr=zt(er,qe,Ye,!1,null,null,null),nr=rr.exports,or=[{path:"iframe/:src/:title?/:icon?",component:nr,props:!0,meta:Ze}],ir=function(t,e,r){return function(n){if(t||!t._isDestroyed){var o=t.items.find((function(t){return t.id===e})),i=r(o,"unload");return i&&"string"===typeof i?(n.preventDefault(),n.returnValue=i,t.activeTabId!==e&&t.open(o.to,!1,!1),i):void 0}}};function ar(t){var e="string"===typeof t?{title:t}:t,r=this.$tabs||b,n=r.activeTab;if(e&&n)for(var o in e)["id","to"].includes(o)||this.$set(n,o,e[o])}var ur={watch:{routeTab:{handler:function(t){t&&!this._inactive&&ar.call(this,t)},deep:!0,immediate:!0}},mounted:function(){var t=this.$tabs,e=this.$vnode&&this.$vnode.componentOptions.Ctor.options||b,r=e.beforePageLeave;t&&r&&window.addEventListener("beforeunload",this._beforeunload=ir(t,t.activeTabId,r.bind(this)))},activated:function(){this.routeTab&&ar.call(this,this.routeTab)},destroyed:function(){this._beforeunload&&window.removeEventListener("beforeunload",this._beforeunload)}};r("751c"),r("a85e");Xe.install=function t(e){t.installed||(Xe.Vue=e,t.installed=!0,e.component(Xe.name,Xe),e.mixin(ur))},"undefined"!==typeof window&&window.Vue&&window.Vue.use(Xe);var sr=Xe;e["default"]=sr}})}));
//# sourceMappingURL=vue-router-tab.umd.min.js.map