├── .editorconfig ├── .gitignore ├── README.md ├── assets ├── js │ ├── admin.js │ ├── frontend.js │ ├── runtime.js │ ├── style.js │ ├── vendors.js │ ├── vendors.js.LICENSE │ └── vendors.js.LICENSE.txt └── less │ └── style.less ├── composer.json ├── config.json ├── includes ├── Admin.php ├── Api.php ├── Api │ └── Example.php ├── Assets.php └── Frontend.php ├── languages └── .gitkeep ├── package-lock.json ├── package.json ├── plugin.php ├── src ├── admin │ ├── App.vue │ ├── main.js │ ├── pages │ │ ├── Home.vue │ │ └── Settings.vue │ ├── router │ │ └── index.js │ └── utils │ │ └── admin-menu-fix.js └── frontend │ ├── App.vue │ ├── main.js │ ├── pages │ ├── Home.vue │ └── Profile.vue │ └── router │ └── index.js └── webpack.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | # Matches multiple files with brace expansion notation 11 | # Set default charset 12 | [*.{js,py}] 13 | charset = utf-8 14 | 15 | # 4 space indentation 16 | [*.php] 17 | indent_style = space 18 | indent_size = 4 19 | 20 | # Tab indentation (no size specified) 21 | [Makefile] 22 | indent_style = tab 23 | 24 | # Indentation override for all JS under lib directory 25 | [lib/**.js] 26 | indent_style = space 27 | indent_size = 2 28 | 29 | # Matches the exact files either package.json or .travis.yml 30 | [{package.json,.travis.yml}] 31 | indent_style = space 32 | indent_size = 2 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | plugin-deploy.sh 2 | export.sh 3 | nbproject 4 | node_modules 5 | build 6 | secret.json 7 | log.txt 8 | 9 | # Compiled output # 10 | ################### 11 | /dist 12 | /tmp 13 | /build 14 | 15 | # Dependencies # 16 | ################### 17 | /node_modules 18 | /bower_components 19 | /vendor 20 | 21 | # Misc # 22 | ################### 23 | .idea 24 | config.codekit 25 | /.sass-cache 26 | /connect.lock 27 | /coverage/* 28 | /libpeerconnection.log 29 | npm-debug.log 30 | testem.log 31 | 32 | # Compiled source # 33 | ################### 34 | *.com 35 | *.class 36 | *.dll 37 | *.exe 38 | *.o 39 | *.so 40 | 41 | # Packages # 42 | ############ 43 | # it's better to unpack these files and commit the raw source 44 | # git has its own built in compression methods 45 | *.7z 46 | *.dmg 47 | *.gz 48 | *.iso 49 | *.jar 50 | *.rar 51 | *.tar 52 | *.zip 53 | 54 | # OS generated files # 55 | ###################### 56 | .DS_Store 57 | .DS_Store? 58 | ._* 59 | .Spotlight-V100 60 | .Trashes 61 | ehthumbs.db 62 | Thumbs.db 63 | 64 | # Logs and databases # 65 | ###################### 66 | *.log 67 | *.sql 68 | *.sqlite -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vue.js WordPress Starter 2 | 3 | A WordPress [Vue.js](https://vuejs.org/) starter plugin with required toolbelts 😎 4 | 5 | ## 📦 What it ships with? 6 | 7 | - Pre-configured webpack config 8 | - Babel loader, Vue loader, CSS and LESS loader 9 | - Separate `vendor.js` with all vendor scripts 10 | - Uglify JS for production 11 | - Separate `frontend.js` and `admin.js` 12 | - Extracted CSS/LESS to separate `frontend.css` and `admin.css` files. 13 | - Auto reloading with Browser with **Browsersync** *([config](config.json))* 14 | - [Vue](https://vuejs.org/) and [Vue Router](https://router.vuejs.org/en/) 15 | - Frontend (shortcode) and Backend starter app 16 | - Modern PHP codebase with [namespace](http://php.net/manual/en/language.namespaces.php) support 17 | 18 | 19 | ## 🚚 Running 20 | 21 | 1. Clone this repository in your plugins folder 22 | 1. Activate the plugin 23 | 24 | ## 👨‍💻 Post Installation 25 | 26 | 1. The name of the plugin class is `Base_Plugin`, change the class name with your desired class name. 27 | 1. Replace the PHP namespace `App` with your desired name. 28 | 1. Replace `baseplugin` or `BASEPLUGIN` reference in files. 29 | 1. Run `npm install` 30 | 1. To start developing, run `npm run dev` 🤘 31 | 1. For production build, run `npm run build` 👍 32 | 33 | ## 🎁 Preview 34 | 35 | ![screenshot](http://tareq.in/owiyZI+) 36 | 37 | ## ⛑ Extra Goodies 38 | 39 | 1. [Vue List Table Component](https://github.com/tareq1988/vue-wp-list-table-component) - Helps you to build WordPress list tables easily. 40 | 41 | ## About 42 | 43 | Made by [Tareq Hasan](https://github.com/tareq1988) from [weDevs](https://wedevs.com). 44 | 45 | *Found anything that can be improved? You are welcome to contribute.* -------------------------------------------------------------------------------- /assets/js/admin.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{10:function(e,t,n){"use strict";n.r(t);var a=n(1),s={name:"App"},i=n(0),r=Object(i.a)(s,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{attrs:{id:"vue-backend-app"}},[t("h1",[this._v("Backend App")]),this._v(" "),t("router-view")],1)}),[],!1,null,null,null).exports,u=n(2),l={name:"Home",data:()=>({msg:"Welcome to Your Vue.js Admin App"})},p=Object(i.a)(l,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"home"},[t("span",[this._v(this._s(this.msg))])])}),[],!1,null,"1be020c0",null).exports,c={name:"Settings",data:()=>({})},o=Object(i.a)(c,(function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"app-settings"},[this._v("\n The Settings Page\n")])}),[],!1,null,"9b386344",null).exports;a.a.use(u.a);var h=new u.a({routes:[{path:"/",name:"Home",component:p},{path:"/settings",name:"Settings",component:o}]});var m=function(e){var t=jQuery;let n=t("#toplevel_page_"+e),a=window.location.href,s=a.substr(a.indexOf("admin.php"));n.on("click","a",(function(){var e=t(this);t("ul.wp-submenu li",n).removeClass("current"),e.hasClass("wp-has-submenu")?t("li.wp-first-item",n).addClass("current"):e.parents("li").addClass("current")})),t("ul.wp-submenu a",n).each((function(e,n){t(n).attr("href")!==s||t(n).parent().addClass("current")}))};a.a.config.productionTip=!1,new a.a({el:"#vue-admin-app",router:h,render:e=>e(r)}),m("vue-app")}},[[10,0,1]]]); -------------------------------------------------------------------------------- /assets/js/frontend.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{11:function(e,t,n){"use strict";n.r(t);var r=n(1),o={name:"App"},s=n(0),i=Object(s.a)(o,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{attrs:{id:"vue-frontend-app"}},[t("h2",[this._v("Frontend App")]),this._v(" "),t("router-link",{attrs:{to:"/"}},[this._v("Home")]),this._v(" "),t("router-link",{attrs:{to:"/profile"}},[this._v("Profile")]),this._v(" "),t("router-view")],1)}),[],!1,null,null,null).exports,a=n(2),l={name:"Home",data:()=>({msg:"Welcome to Your Vue.js Frontend App"})},p=Object(s.a)(l,(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"hello"},[t("span",[this._v(this._s(this.msg))])])}),[],!1,null,"50a8de1d",null).exports,u={name:"Profile",data:()=>({})},c=Object(s.a)(u,(function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"profile"},[this._v("\n The Profile Page\n")])}),[],!1,null,"4beb872e",null).exports;r.a.use(a.a);var h=new a.a({routes:[{path:"/",name:"Home",component:p},{path:"/profile",name:"Profile",component:c}]});r.a.config.productionTip=!1,new r.a({el:"#vue-frontend-app",router:h,render:e=>e(i)})}},[[11,0,1]]]); -------------------------------------------------------------------------------- /assets/js/runtime.js: -------------------------------------------------------------------------------- 1 | !function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function v(t){return null==t?"":Array.isArray(t)||l(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function h(t){var e=parseFloat(t);return isNaN(e)?t:e}function m(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function w(t,e){return b.call(t,e)}function $(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var x=/-(\w)/g,C=$((function(t){return t.replace(x,(function(t,e){return e?e.toUpperCase():""}))})),k=$((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),A=/\B([A-Z])/g,O=$((function(t){return t.replace(A,"-$1").toLowerCase()}));var S=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function T(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function E(t,e){for(var n in e)t[n]=e[n];return t}function j(t){for(var e={},n=0;n0,Q=X&&X.indexOf("edge/")>0,tt=(X&&X.indexOf("android"),X&&/iphone|ipad|ipod|ios/.test(X)||"ios"===G),et=(X&&/chrome\/\d+/.test(X),X&&/phantomjs/.test(X),X&&X.match(/firefox\/(\d+)/)),nt={}.watch,rt=!1;if(K)try{var it={};Object.defineProperty(it,"passive",{get:function(){rt=!0}}),window.addEventListener("test-passive",null,it)}catch(t){}var ot=function(){return void 0===z&&(z=!K&&!W&&void 0!==t&&(t.process&&"server"===t.process.env.VUE_ENV)),z},at=K&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function st(t){return"function"==typeof t&&/native code/.test(t.toString())}var ct,ut="undefined"!=typeof Symbol&&st(Symbol)&&"undefined"!=typeof Reflect&&st(Reflect.ownKeys);ct="undefined"!=typeof Set&&st(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var lt=L,ft=0,pt=function(){this.id=ft++,this.subs=[]};pt.prototype.addSub=function(t){this.subs.push(t)},pt.prototype.removeSub=function(t){_(this.subs,t)},pt.prototype.depend=function(){pt.target&&pt.target.addDep(this)},pt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(o&&!w(i,"default"))a=!1;else if(""===a||a===O(t)){var c=Vt(String,i.type);(c<0||s0&&(pe((c=t(c,(n||"")+"_"+r))[0])&&pe(l)&&(f[u]=_t(l.text+c[0].text),c.shift()),f.push.apply(f,c)):s(c)?pe(l)?f[u]=_t(l.text+c):""!==c&&f.push(_t(c)):pe(c)&&pe(l)?f[u]=_t(l.text+c.text):(a(e._isVList)&&o(c.tag)&&i(c.key)&&o(n)&&(c.key="__vlist"+n+"_"+r+"__"),f.push(c)));return f}(t):void 0}function pe(t){return o(t)&&o(t.text)&&!1===t.isComment}function de(t,e){if(t){for(var n=Object.create(null),r=ut?Reflect.ownKeys(t):Object.keys(t),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&n&&n!==r&&s===n.$key&&!o&&!n.$hasNormal)return n;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=ye(e,c,t[c]))}else i={};for(var u in e)u in i||(i[u]=ge(e,u));return t&&Object.isExtensible(t)&&(t._normalized=i),V(i,"$stable",a),V(i,"$key",s),V(i,"$hasNormal",o),i}function ye(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});return(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:fe(t))&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function ge(t,e){return function(){return t[e]}}function _e(t,e){var n,r,i,a,s;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,i=t.length;rdocument.createEvent("Event").timeStamp&&(ln=function(){return fn.now()})}function pn(){var t,e;for(un=ln(),sn=!0,nn.sort((function(t,e){return t.id-e.id})),cn=0;cncn&&nn[n].id>t.id;)n--;nn.splice(n+1,0,t)}else nn.push(t);an||(an=!0,re(pn))}}(this)},vn.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||c(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){qt(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},vn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},vn.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},vn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var hn={enumerable:!0,configurable:!0,get:L,set:L};function mn(t,e,n){hn.get=function(){return this[e][n]},hn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,hn)}function yn(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[];t.$parent&&kt(!1);var o=function(o){i.push(o);var a=Ut(o,e,n,t);St(r,o,a),o in t||mn(t,"_props",o)};for(var a in e)o(a);kt(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var n in e)t[n]="function"!=typeof e[n]?L:S(e[n],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;l(e=t._data="function"==typeof e?function(t,e){vt();try{return t.call(e,e)}catch(t){return qt(t,e,"data()"),{}}finally{ht()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);for(;i--;){var o=n[i];0,r&&w(r,o)||H(o)||mn(t,"_data",o)}Ot(e,!0)}(t):Ot(t._data={},!0),e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=ot();for(var i in e){var o=e[i],a="function"==typeof o?o:o.get;0,r||(n[i]=new vn(t,a||L,L,gn)),i in t||_n(t,i,o)}}(t,e.computed),e.watch&&e.watch!==nt&&function(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function Tn(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=On(a.componentOptions);s&&!e(s)&&En(n,o,r,i)}}}function En(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,_(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=xn++,e._isVue=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Dt(Cn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Xe(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,i=n&&n.context;t.$slots=ve(e._renderChildren,i),t.$scopedSlots=r,t._c=function(e,n,r,i){return Be(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Be(t,e,n,r,i,!0)};var o=n&&n.data;St(t,"$attrs",o&&o.attrs||r,null,!0),St(t,"$listeners",e._parentListeners||r,null,!0)}(e),en(e,"beforeCreate"),function(t){var e=de(t.$options.inject,t);e&&(kt(!1),Object.keys(e).forEach((function(n){St(t,n,e[n])})),kt(!0))}(e),yn(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),en(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(kn),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Tt,t.prototype.$delete=Et,t.prototype.$watch=function(t,e,n){if(l(e))return $n(this,t,e,n);(n=n||{}).user=!0;var r=new vn(this,t,e,n);if(n.immediate)try{e.call(this,r.value)}catch(t){qt(t,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(kn),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var i=0,o=t.length;i1?T(n):n;for(var r=T(arguments,1),i='event handler for "'+t+'"',o=0,a=n.length;oparseInt(this.max)&&En(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return U}};Object.defineProperty(t,"config",e),t.util={warn:lt,extend:E,mergeOptions:Dt,defineReactive:St},t.set=Tt,t.delete=Et,t.nextTick=re,t.observable=function(t){return Ot(t),t},t.options=Object.create(null),D.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,E(t.options.components,Ln),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=T(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Dt(this.options,t),this}}(t),An(t),function(t){D.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&l(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(kn),Object.defineProperty(kn.prototype,"$isServer",{get:ot}),Object.defineProperty(kn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(kn,"FunctionalRenderContext",{value:Ie}),kn.version="2.6.11";var Rn=m("style,class"),In=m("input,textarea,option,select,progress"),Nn=function(t,e,n){return"value"===n&&In(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Mn=m("contenteditable,draggable,spellcheck"),Pn=m("events,caret,typing,plaintext-only"),Dn=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Fn="http://www.w3.org/1999/xlink",Un=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Bn=function(t){return Un(t)?t.slice(6,t.length):""},Hn=function(t){return null==t||!1===t};function Vn(t){for(var e=t.data,n=t,r=t;o(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=qn(r.data,e));for(;o(n=n.parent);)n&&n.data&&(e=qn(e,n.data));return function(t,e){if(o(t)||o(e))return zn(t,Jn(e));return""}(e.staticClass,e.class)}function qn(t,e){return{staticClass:zn(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function zn(t,e){return t?e?t+" "+e:t:e||""}function Jn(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,i=t.length;r-1?yr(t,e,n):Dn(e)?Hn(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Mn(e)?t.setAttribute(e,function(t,e){return Hn(e)||"false"===e?"false":"contenteditable"===t&&Pn(e)?e:"true"}(e,n)):Un(e)?Hn(n)?t.removeAttributeNS(Fn,Bn(e)):t.setAttributeNS(Fn,e,n):yr(t,e,n)}function yr(t,e,n){if(Hn(n))t.removeAttribute(e);else{if(Z&&!Y&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var gr={create:hr,update:hr};function _r(t,e){var n=e.elm,r=e.data,a=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var s=Vn(e),c=n._transitionClasses;o(c)&&(s=zn(s,Jn(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var br,wr,$r,xr,Cr,kr,Ar={create:_r,update:_r},Or=/[\w).+\-_$\]]/;function Sr(t){var e,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=t.charAt(v));v--);h&&Or.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=t.slice(0,r).trim()):m();function m(){(o||(o=[])).push(t.slice(d,r).trim()),d=r+1}if(void 0===i?i=t.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:t.slice(0,xr),key:'"'+t.slice(xr+1)+'"'}:{exp:t,key:null};wr=t,xr=Cr=kr=0;for(;!zr();)Jr($r=qr())?Wr($r):91===$r&&Kr($r);return{exp:t.slice(0,Cr),key:t.slice(Cr+1,kr)}}(t);return null===n.key?t+"="+e:"$set("+n.exp+", "+n.key+", "+e+")"}function qr(){return wr.charCodeAt(++xr)}function zr(){return xr>=br}function Jr(t){return 34===t||39===t}function Kr(t){var e=1;for(Cr=xr;!zr();)if(Jr(t=qr()))Wr(t);else if(91===t&&e++,93===t&&e--,0===e){kr=xr;break}}function Wr(t){for(var e=t;!zr()&&(t=qr())!==e;);}var Gr;function Xr(t,e,n){var r=Gr;return function i(){var o=e.apply(null,arguments);null!==o&&Qr(t,i,n,r)}}var Zr=Gt&&!(et&&Number(et[1])<=53);function Yr(t,e,n,r){if(Zr){var i=un,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}Gr.addEventListener(t,e,rt?{capture:n,passive:r}:n)}function Qr(t,e,n,r){(r||Gr).removeEventListener(t,e._wrapper||e,n)}function ti(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Gr=e.elm,function(t){if(o(t.__r)){var e=Z?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}o(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),ce(n,r,Yr,Qr,Xr,e.context),Gr=void 0}}var ei,ni={create:ti,update:ti};function ri(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};for(n in o(c.__ob__)&&(c=e.data.domProps=E({},c)),s)n in c||(a[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var u=i(r)?"":String(r);ii(a,u)&&(a.value=u)}else if("innerHTML"===n&&Gn(a.tagName)&&i(a.innerHTML)){(ei=ei||document.createElement("div")).innerHTML=""+r+"";for(var l=ei.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(r!==s[n])try{a[n]=r}catch(t){}}}}function ii(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(o(r)){if(r.number)return h(n)!==h(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var oi={create:ri,update:ri},ai=$((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function si(t){var e=ci(t.style);return t.staticStyle?E(t.staticStyle,e):e}function ci(t){return Array.isArray(t)?j(t):"string"==typeof t?ai(t):t}var ui,li=/^--/,fi=/\s*!important$/,pi=function(t,e,n){if(li.test(e))t.style.setProperty(e,n);else if(fi.test(n))t.style.setProperty(O(e),n.replace(fi,""),"important");else{var r=vi(e);if(Array.isArray(n))for(var i=0,o=n.length;i-1?e.split(yi).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function _i(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(yi).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function bi(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&E(e,wi(t.name||"v")),E(e,t),e}return"string"==typeof t?wi(t):void 0}}var wi=$((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),$i=K&&!Y,xi="transition",Ci="transitionend",ki="animation",Ai="animationend";$i&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(xi="WebkitTransition",Ci="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ki="WebkitAnimation",Ai="webkitAnimationEnd"));var Oi=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Si(t){Oi((function(){Oi(t)}))}function Ti(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),gi(t,e))}function Ei(t,e){t._transitionClasses&&_(t._transitionClasses,e),_i(t,e)}function ji(t,e,n){var r=Ri(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s="transition"===i?Ci:Ai,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout((function(){c0&&(n="transition",l=a,f=o.length):"animation"===e?u>0&&(n="animation",l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?"transition":"animation":null)?"transition"===n?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:"transition"===n&&Li.test(r[xi+"Property"])}}function Ii(t,e){for(;t.length1}function Ui(t,e){!0!==e.data.show&&Mi(e)}var Bi=function(t){var e,n,r={},c=t.modules,u=t.nodeOps;for(e=0;ev?_(t,i(n[y+1])?null:n[y+1].elm,n,d,y,r):d>y&&w(e,p,v)}(p,m,y,n,l):o(y)?(o(t.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,n)):o(m)?w(m,0,m.length-1):o(t.text)&&u.setTextContent(p,""):t.text!==e.text&&u.setTextContent(p,e.text),o(v)&&o(d=v.hook)&&o(d=d.postpatch)&&d(t,e)}}}function k(t,e,n){if(a(n)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==o&&(a.selected=o);else if(N(Ji(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function zi(t,e){return e.every((function(e){return!N(e,t)}))}function Ji(t){return"_value"in t?t._value:t.value}function Ki(t){t.target.composing=!0}function Wi(t){t.target.composing&&(t.target.composing=!1,Gi(t.target,"input"))}function Gi(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Xi(t){return!t.componentInstance||t.data&&t.data.transition?t:Xi(t.componentInstance._vnode)}var Zi={model:Hi,show:{bind:function(t,e,n){var r=e.value,i=(n=Xi(n)).data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,Mi(n,(function(){t.style.display=o}))):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=Xi(n)).data&&n.data.transition?(n.data.show=!0,r?Mi(n,(function(){t.style.display=t.__vOriginalDisplay})):Pi(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}}},Yi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Qi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Qi(Je(e.children)):t}function to(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[C(o)]=i[o];return e}function eo(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var no=function(t){return t.tag||ze(t)},ro=function(t){return"show"===t.name},io={name:"transition",props:Yi,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(no)).length){0;var r=this.mode;0;var i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var o=Qi(i);if(!o)return i;if(this._leaving)return eo(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var c=(o.data||(o.data={})).transition=to(this),u=this._vnode,l=Qi(u);if(o.data.directives&&o.data.directives.some(ro)&&(o.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(o,l)&&!ze(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=E({},c);if("out-in"===r)return this._leaving=!0,ue(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),eo(t,i);if("in-out"===r){if(ze(o))return u;var p,d=function(){p()};ue(c,"afterEnter",d),ue(c,"enterCancelled",d),ue(f,"delayLeave",(function(t){p=t}))}}return i}}},oo=E({tag:String,moveClass:String},Yi);function ao(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function so(t){t.data.newPos=t.elm.getBoundingClientRect()}function co(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete oo.mode;var uo={Transition:io,TransitionGroup:{props:oo,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=Ye(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=to(this),s=0;s-1?Yn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Yn[t]=/HTMLUnknownElement/.test(e.toString())},E(kn.options.directives,Zi),E(kn.options.components,uo),kn.prototype.__patch__=K?Bi:L,kn.prototype.$mount=function(t,e){return function(t,e,n){var r;return t.$el=e,t.$options.render||(t.$options.render=gt),en(t,"beforeMount"),r=function(){t._update(t._render(),n)},new vn(t,r,L,{before:function(){t._isMounted&&!t._isDestroyed&&en(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,en(t,"mounted")),t}(this,t=t&&K?tr(t):void 0,e)},K&&setTimeout((function(){U.devtools&&at&&at.emit("init",kn)}),0);var lo=/\{\{((?:.|\r?\n)+?)\}\}/g,fo=/[-.*+?^${}()|[\]\/\\]/g,po=$((function(t){var e=t[0].replace(fo,"\\$&"),n=t[1].replace(fo,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")}));var vo={staticKeys:["staticClass"],transformNode:function(t,e){e.warn;var n=Fr(t,"class");n&&(t.staticClass=JSON.stringify(n));var r=Dr(t,"class",!1);r&&(t.classBinding=r)},genData:function(t){var e="";return t.staticClass&&(e+="staticClass:"+t.staticClass+","),t.classBinding&&(e+="class:"+t.classBinding+","),e}};var ho,mo={staticKeys:["staticStyle"],transformNode:function(t,e){e.warn;var n=Fr(t,"style");n&&(t.staticStyle=JSON.stringify(ai(n)));var r=Dr(t,"style",!1);r&&(t.styleBinding=r)},genData:function(t){var e="";return t.staticStyle&&(e+="staticStyle:"+t.staticStyle+","),t.styleBinding&&(e+="style:("+t.styleBinding+"),"),e}},yo=function(t){return(ho=ho||document.createElement("div")).innerHTML=t,ho.textContent},go=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),_o=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),bo=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),wo=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,$o=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,xo="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+B.source+"]*",Co="((?:"+xo+"\\:)?"+xo+")",ko=new RegExp("^<"+Co),Ao=/^\s*(\/?)>/,Oo=new RegExp("^<\\/"+Co+"[^>]*>"),So=/^]+>/i,To=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Io=/&(?:lt|gt|quot|amp|#39);/g,No=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Mo=m("pre,textarea",!0),Po=function(t,e){return t&&Mo(t)&&"\n"===e[0]};function Do(t,e){var n=e?No:Io;return t.replace(n,(function(t){return Ro[t]}))}var Fo,Uo,Bo,Ho,Vo,qo,zo,Jo,Ko=/^@|^v-on:/,Wo=/^v-|^@|^:|^#/,Go=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Xo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Zo=/^\(|\)$/g,Yo=/^\[.*\]$/,Qo=/:(.*)$/,ta=/^:|^\.|^v-bind:/,ea=/\.[^.\]]+(?=[^\]]*$)/g,na=/^v-slot(:|$)|^#/,ra=/[\r\n]/,ia=/\s+/g,oa=$(yo);function aa(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:da(e),rawAttrsMap:{},parent:n,children:[]}}function sa(t,e){Fo=e.warn||Er,qo=e.isPreTag||R,zo=e.mustUseProp||R,Jo=e.getTagNamespace||R;var n=e.isReservedTag||R;(function(t){return!!t.component||!n(t.tag)}),Bo=jr(e.modules,"transformNode"),Ho=jr(e.modules,"preTransformNode"),Vo=jr(e.modules,"postTransformNode"),Uo=e.delimiters;var r,i,o=[],a=!1!==e.preserveWhitespace,s=e.whitespace,c=!1,u=!1;function l(t){if(f(t),c||t.processed||(t=ca(t,e)),o.length||t===r||r.if&&(t.elseif||t.else)&&la(r,{exp:t.elseif,block:t}),i&&!t.forbidden)if(t.elseif||t.else)a=t,(s=function(t){for(var e=t.length;e--;){if(1===t[e].type)return t[e];t.pop()}}(i.children))&&s.if&&la(s,{exp:a.elseif,block:a});else{if(t.slotScope){var n=t.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[n]=t}i.children.push(t),t.parent=i}var a,s;t.children=t.children.filter((function(t){return!t.slotScope})),f(t),t.pre&&(c=!1),qo(t.tag)&&(u=!1);for(var l=0;l]*>)","i")),p=t.replace(f,(function(t,n,r){return u=r.length,jo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),Po(l,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""}));c+=t.length-p.length,t=p,A(l,c-u,c)}else{var d=t.indexOf("<");if(0===d){if(To.test(t)){var v=t.indexOf("--\x3e");if(v>=0){e.shouldKeepComment&&e.comment(t.substring(4,v),c,c+v+3),x(v+3);continue}}if(Eo.test(t)){var h=t.indexOf("]>");if(h>=0){x(h+2);continue}}var m=t.match(So);if(m){x(m[0].length);continue}var y=t.match(Oo);if(y){var g=c;x(y[0].length),A(y[1],g,c);continue}var _=C();if(_){k(_),Po(_.tagName,t)&&x(1);continue}}var b=void 0,w=void 0,$=void 0;if(d>=0){for(w=t.slice(d);!(Oo.test(w)||ko.test(w)||To.test(w)||Eo.test(w)||($=w.indexOf("<",1))<0);)d+=$,w=t.slice(d);b=t.substring(0,d)}d<0&&(b=t),b&&x(b.length),e.chars&&b&&e.chars(b,c-b.length,c)}if(t===n){e.chars&&e.chars(t);break}}function x(e){c+=e,t=t.substring(e)}function C(){var e=t.match(ko);if(e){var n,r,i={tagName:e[1],attrs:[],start:c};for(x(e[0].length);!(n=t.match(Ao))&&(r=t.match($o)||t.match(wo));)r.start=c,x(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],x(n[0].length),i.end=c,i}}function k(t){var n=t.tagName,c=t.unarySlash;o&&("p"===r&&bo(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=t.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)e.end&&e.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,o):"p"===s&&(e.start&&e.start(t,[],!1,n,o),e.end&&e.end(t,n,o))}A()}(t,{warn:Fo,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,outputSourceRange:e.outputSourceRange,start:function(t,n,a,s,f){var p=i&&i.ns||Jo(t);Z&&"svg"===p&&(n=function(t){for(var e=[],n=0;nc&&(s.push(o=t.slice(c,i)),a.push(JSON.stringify(o)));var u=Sr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),Pr(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Vr(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Vr(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Vr(e,"$$c")+"}",null,!0)}(t,r,i);else if("input"===o&&"radio"===a)!function(t,e,n){var r=n&&n.number,i=Dr(t,"value")||"null";Lr(t,"checked","_q("+e+","+(i=r?"_n("+i+")":i)+")"),Pr(t,"change",Vr(e,i),null,!0)}(t,r,i);else if("input"===o||"textarea"===o)!function(t,e,n){var r=t.attrsMap.type;0;var i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?"__r":"input",l="$event.target.value";s&&(l="$event.target.value.trim()");a&&(l="_n("+l+")");var f=Vr(e,l);c&&(f="if($event.target.composing)return;"+f);Lr(t,"value","("+e+")"),Pr(t,u,f,null,!0),(s||a)&&Pr(t,"blur","$forceUpdate()")}(t,r,i);else{if(!U.isReservedTag(o))return Hr(t,r,i),!1}return!0},text:function(t,e){e.value&&Lr(t,"textContent","_s("+e.value+")",e)},html:function(t,e){e.value&&Lr(t,"innerHTML","_s("+e.value+")",e)}},isPreTag:function(t){return"pre"===t},isUnaryTag:go,mustUseProp:Nn,canBeLeftOpenTag:_o,isReservedTag:Xn,getTagNamespace:Zn,staticKeys:function(t){return t.reduce((function(t,e){return t.concat(e.staticKeys||[])}),[]).join(",")}(ya)},wa=$((function(t){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))}));function $a(t,e){t&&(ga=wa(e.staticKeys||""),_a=e.isReservedTag||R,function t(e){if(e.static=function(t){if(2===t.type)return!1;if(3===t.type)return!0;return!(!t.pre&&(t.hasBindings||t.if||t.for||y(t.tag)||!_a(t.tag)||function(t){for(;t.parent;){if("template"!==(t=t.parent).tag)return!1;if(t.for)return!0}return!1}(t)||!Object.keys(t).every(ga)))}(e),1===e.type){if(!_a(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var n=0,r=e.children.length;n|^function(?:\s+[\w$]+)?\s*\(/,Ca=/\([^)]*?\);*$/,ka=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Aa={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Oa={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Sa=function(t){return"if("+t+")return null;"},Ta={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Sa("$event.target !== $event.currentTarget"),ctrl:Sa("!$event.ctrlKey"),shift:Sa("!$event.shiftKey"),alt:Sa("!$event.altKey"),meta:Sa("!$event.metaKey"),left:Sa("'button' in $event && $event.button !== 0"),middle:Sa("'button' in $event && $event.button !== 1"),right:Sa("'button' in $event && $event.button !== 2")};function Ea(t,e){var n=e?"nativeOn:":"on:",r="",i="";for(var o in t){var a=ja(t[o]);t[o]&&t[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function ja(t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map((function(t){return ja(t)})).join(",")+"]";var e=ka.test(t.value),n=xa.test(t.value),r=ka.test(t.value.replace(Ca,""));if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(Ta[s])o+=Ta[s],Aa[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=Sa(["ctrl","shift","alt","meta"].filter((function(t){return!c[t]})).map((function(t){return"$event."+t+"Key"})).join("||"))}else a.push(s);return a.length&&(i+=function(t){return"if(!$event.type.indexOf('key')&&"+t.map(La).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(e?"return "+t.value+"($event)":n?"return ("+t.value+")($event)":r?"return "+t.value:t.value)+"}"}return e||n?t.value:"function($event){"+(r?"return "+t.value:t.value)+"}"}function La(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=Aa[t],r=Oa[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ra={on:function(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}},bind:function(t,e){t.wrapData=function(n){return"_b("+n+",'"+t.tag+"',"+e.value+","+(e.modifiers&&e.modifiers.prop?"true":"false")+(e.modifiers&&e.modifiers.sync?",true":"")+")"}},cloak:L},Ia=function(t){this.options=t,this.warn=t.warn||Er,this.transforms=jr(t.modules,"transformCode"),this.dataGenFns=jr(t.modules,"genData"),this.directives=E(E({},Ra),t.directives);var e=t.isReservedTag||R;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Na(t,e){var n=new Ia(e);return{render:"with(this){return "+(t?Ma(t,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ma(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return Pa(t,e);if(t.once&&!t.onceProcessed)return Da(t,e);if(t.for&&!t.forProcessed)return Ua(t,e);if(t.if&&!t.ifProcessed)return Fa(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=qa(t,e),i="_t("+n+(r?","+r:""),o=t.attrs||t.dynamicAttrs?Ka((t.attrs||[]).concat(t.dynamicAttrs||[]).map((function(t){return{name:C(t.name),value:t.value,dynamic:t.dynamic}}))):null,a=t.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(t,e);var n;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:qa(e,n,!0);return"_c("+t+","+Ba(e,n)+(r?","+r:"")+")"}(t.component,t,e);else{var r;(!t.plain||t.pre&&e.maybeComponent(t))&&(r=Ba(t,e));var i=t.inlineTemplate?null:qa(t,e,!0);n="_c('"+t.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}(a):"")+")"}(t,t.scopedSlots,e)+","),t.model&&(n+="model:{value:"+t.model.value+",callback:"+t.model.callback+",expression:"+t.model.expression+"},"),t.inlineTemplate){var o=function(t,e){var n=t.children[0];0;if(n&&1===n.type){var r=Na(n,e.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(t){return"function(){"+t+"}"})).join(",")+"]}"}}(t,e);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",t.dynamicAttrs&&(n="_b("+n+',"'+t.tag+'",'+Ka(t.dynamicAttrs)+")"),t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function Ha(t){return 1===t.type&&("slot"===t.tag||t.children.some(Ha))}function Va(t,e){var n=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!n)return Fa(t,e,Va,"null");if(t.for&&!t.forProcessed)return Ua(t,e,Va);var r="_empty_"===t.slotScope?"":String(t.slotScope),i="function("+r+"){return "+("template"===t.tag?t.if&&n?"("+t.if+")?"+(qa(t,e)||"undefined")+":undefined":qa(t,e)||"undefined":Ma(t,e))+"}",o=r?"":",proxy:true";return"{key:"+(t.slotTarget||'"default"')+",fn:"+i+o+"}"}function qa(t,e,n,r,i){var o=t.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?e.maybeComponent(a)?",1":",0":"";return""+(r||Ma)(a,e)+s}var c=n?function(t,e){for(var n=0,r=0;r':'
',Ya.innerHTML.indexOf(" ")>0}var ns=!!K&&es(!1),rs=!!K&&es(!0),is=$((function(t){var e=tr(t);return e&&e.innerHTML})),os=kn.prototype.$mount;kn.prototype.$mount=function(t,e){if((t=t&&tr(t))===document.body||t===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=is(r));else{if(!r.nodeType)return this;r=r.innerHTML}else t&&(r=function(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t));if(r){0;var i=ts(r,{outputSourceRange:!1,shouldDecodeNewlines:ns,shouldDecodeNewlinesForHref:rs,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return os.call(this,t,e)},kn.compile=ts,e.a=kn}).call(this,n(3),n(4).setImmediate)},function(t,e,n){"use strict";function r(t,e){for(var n in e)t[n]=e[n];return t}var i={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,i=e.children,a=e.parent,s=e.data;s.routerView=!0;for(var c=a.$createElement,u=n.name,l=a.$route,f=a._routerViewCache||(a._routerViewCache={}),p=0,d=!1;a&&a._routerRoot!==a;){var v=a.$vnode?a.$vnode.data:{};v.routerView&&p++,v.keepAlive&&a._directInactive&&a._inactive&&(d=!0),a=a.$parent}if(s.routerViewDepth=p,d){var h=f[u],m=h&&h.component;return m?(h.configProps&&o(m,s,h.route,h.configProps),c(m,s,i)):c()}var y=l.matched[p],g=y&&y.components[u];if(!y||!g)return f[u]=null,c();f[u]={component:g},s.registerRouteInstance=function(t,e){var n=y.instances[u];(e&&n!==t||!e&&n===t)&&(y.instances[u]=e)},(s.hook||(s.hook={})).prepatch=function(t,e){y.instances[u]=e.componentInstance},s.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==y.instances[u]&&(y.instances[u]=t.componentInstance)};var _=y.props&&y.props[u];return _&&(r(f[u],{route:l,configProps:_}),o(g,s,l,_)),c(g,s,i)}};function o(t,e,n,i){var o=e.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}(n,i);if(o){o=e.props=r({},o);var a=e.attrs=e.attrs||{};for(var s in o)t.props&&s in t.props||(a[s]=o[s],delete o[s])}}var a=/[!'()*]/g,s=function(t){return"%"+t.charCodeAt(0).toString(16)},c=/%2C/g,u=function(t){return encodeURIComponent(t).replace(a,s).replace(c,",")},l=decodeURIComponent;var f=function(t){return null==t||"object"==typeof t?t:String(t)};function p(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var n=t.replace(/\+/g," ").split("="),r=l(n.shift()),i=n.length>0?l(n.join("=")):null;void 0===e[r]?e[r]=i:Array.isArray(e[r])?e[r].push(i):e[r]=[e[r],i]})),e):e}function d(t){var e=t?Object.keys(t).map((function(e){var n=t[e];if(void 0===n)return"";if(null===n)return u(e);if(Array.isArray(n)){var r=[];return n.forEach((function(t){void 0!==t&&(null===t?r.push(u(e)):r.push(u(e)+"="+u(t)))})),r.join("&")}return u(e)+"="+u(n)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var v=/\/?$/;function h(t,e,n,r){var i=r&&r.options.stringifyQuery,o=e.query||{};try{o=m(o)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:o,params:e.params||{},fullPath:_(e,i),matched:t?g(t):[]};return n&&(a.redirectedFrom=_(n,i)),Object.freeze(a)}function m(t){if(Array.isArray(t))return t.map(m);if(t&&"object"==typeof t){var e={};for(var n in t)e[n]=m(t[n]);return e}return t}var y=h(null,{path:"/"});function g(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function _(t,e){var n=t.path,r=t.query;void 0===r&&(r={});var i=t.hash;return void 0===i&&(i=""),(n||"/")+(e||d)(r)+i}function b(t,e){return e===y?t===e:!!e&&(t.path&&e.path?t.path.replace(v,"")===e.path.replace(v,"")&&t.hash===e.hash&&w(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&w(t.query,e.query)&&w(t.params,e.params)))}function w(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every((function(n){var r=t[n],i=e[n];return null==r||null==i?r===i:"object"==typeof r&&"object"==typeof i?w(r,i):String(r)===String(i)}))}function $(t,e,n){var r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;var i=e.split("/");n&&i[i.length-1]||i.pop();for(var o=t.replace(/^\//,"").split("/"),a=0;a=0&&(e=t.slice(r),t=t.slice(0,r));var i=t.indexOf("?");return i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),{path:t,query:n,hash:e}}(o.path||""),l=e&&e.path||"/",d=u.path?$(u.path,l,n||o.append):l,v=function(t,e,n){void 0===e&&(e={});var r,i=n||p;try{r=i(t||"")}catch(t){r={}}for(var o in e){var a=e[o];r[o]=Array.isArray(a)?a.map(f):f(a)}return r}(u.query,o.query,i&&i.options.parseQuery),h=o.hash||u.hash;return h&&"#"!==h.charAt(0)&&(h="#"+h),{_normalized:!0,path:d,query:v,hash:h}}var V,q=function(){},z={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(t){var e=this,n=this.$router,i=this.$route,o=n.resolve(this.to,i,this.append),a=o.location,s=o.route,c=o.href,u={},l=n.options.linkActiveClass,f=n.options.linkExactActiveClass,p=null==l?"router-link-active":l,d=null==f?"router-link-exact-active":f,m=null==this.activeClass?p:this.activeClass,y=null==this.exactActiveClass?d:this.exactActiveClass,g=s.redirectedFrom?h(null,H(s.redirectedFrom),null,n):s;u[y]=b(i,g),u[m]=this.exact?u[y]:function(t,e){return 0===t.path.replace(v,"/").indexOf(e.path.replace(v,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(i,g);var _=u[y]?this.ariaCurrentValue:null,w=function(t){J(t)&&(e.replace?n.replace(a,q):n.push(a,q))},$={click:J};Array.isArray(this.event)?this.event.forEach((function(t){$[t]=w})):$[this.event]=w;var x={class:u},C=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:c,route:s,navigate:w,isActive:u[m],isExactActive:u[y]});if(C){if(1===C.length)return C[0];if(C.length>1||!C.length)return 0===C.length?t():t("span",{},C)}if("a"===this.tag)x.on=$,x.attrs={href:c,"aria-current":_};else{var k=function t(e){var n;if(e)for(var r=0;r-1&&(s.params[p]=n.params[p]);return s.path=B(l.path,s.params),c(l,s,a)}if(s.path){s.params={};for(var d=0;d=t.length?n():t[i]?e(t[i],(function(){r(i+1)})):r(i+1)};r(0)}var gt={redirected:2,aborted:4,cancelled:8,duplicated:16};function _t(t,e){return wt(t,e,gt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+function(t){if("string"==typeof t)return t;if("path"in t)return t.path;var e={};return $t.forEach((function(n){n in t&&(e[n]=t[n])})),JSON.stringify(e,null,2)}(e)+'" via a navigation guard.')}function bt(t,e){return wt(t,e,gt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function wt(t,e,n,r){var i=new Error(r);return i._isRouter=!0,i.from=t,i.to=e,i.type=n,i}var $t=["params","query","hash"];function xt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function Ct(t,e){return xt(t)&&t._isRouter&&(null==e||t.type===e)}function kt(t){return function(e,n,r){var i=!1,o=0,a=null;At(t,(function(t,e,n,s){if("function"==typeof t&&void 0===t.cid){i=!0,o++;var c,u=Tt((function(e){var i;((i=e).__esModule||St&&"Module"===i[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:V.extend(e),n.components[s]=e,--o<=0&&r()})),l=Tt((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=xt(t)?t:new Error(e),r(a))}));try{c=t(u,l)}catch(t){l(t)}if(c)if("function"==typeof c.then)c.then(u,l);else{var f=c.component;f&&"function"==typeof f.then&&f.then(u,l)}}})),i||r()}}function At(t,e){return Ot(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function Ot(t){return Array.prototype.concat.apply([],t)}var St="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Tt(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var Et=function(t,e){this.router=t,this.base=function(t){if(!t)if(K){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=y,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function jt(t,e,n,r){var i=At(t,(function(t,r,i,o){var a=function(t,e){"function"!=typeof t&&(t=V.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,r,i,o)})):n(a,r,i,o)}));return Ot(r?i.reverse():i)}function Lt(t,e){if(e)return function(){return t.apply(e,arguments)}}Et.prototype.listen=function(t){this.cb=t},Et.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Et.prototype.onError=function(t){this.errorCbs.push(t)},Et.prototype.transitionTo=function(t,e,n){var r,i=this;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}this.confirmTransition(r,(function(){var t=i.current;i.updateRoute(r),e&&e(r),i.ensureURL(),i.router.afterHooks.forEach((function(e){e&&e(r,t)})),i.ready||(i.ready=!0,i.readyCbs.forEach((function(t){t(r)})))}),(function(t){n&&n(t),t&&!i.ready&&(i.ready=!0,Ct(t,gt.redirected)?i.readyCbs.forEach((function(t){t(r)})):i.readyErrorCbs.forEach((function(e){e(t)})))}))},Et.prototype.confirmTransition=function(t,e,n){var r,i,o=this,a=this.current,s=function(t){!Ct(t)&&xt(t)&&(o.errorCbs.length?o.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},c=t.matched.length-1,u=a.matched.length-1;if(b(t,a)&&c===u&&t.matched[c]===a.matched[u])return this.ensureURL(),s(((i=wt(r=a,t,gt.duplicated,'Avoided redundant navigation to current location: "'+r.fullPath+'".')).name="NavigationDuplicated",i));var l=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n0)){var e=this.router,n=e.options.scrollBehavior,r=vt&&n;r&&this.listeners.push(it());var i=function(){var n=t.current,i=It(t.base);t.current===y&&i===t._startLocation||t.transitionTo(i,(function(t){r&&ot(e,t,n,!0)}))};window.addEventListener("popstate",i),this.listeners.push((function(){window.removeEventListener("popstate",i)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this,i=this.current;this.transitionTo(t,(function(t){ht(x(r.base+t.fullPath)),ot(r.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,i=this.current;this.transitionTo(t,(function(t){mt(x(r.base+t.fullPath)),ot(r.router,t,i,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(It(this.base)!==this.current.fullPath){var e=x(this.base+this.current.fullPath);t?ht(e):mt(e)}},e.prototype.getCurrentLocation=function(){return It(this.base)},e}(Et);function It(t){var e=decodeURI(window.location.pathname);return t&&0===e.toLowerCase().indexOf(t.toLowerCase())&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Nt=function(t){function e(e,n,r){t.call(this,e,n),r&&function(t){var e=It(t);if(!/^\/#/.test(e))return window.location.replace(x(t+"/#"+e)),!0}(this.base)||Mt()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=vt&&e;n&&this.listeners.push(it());var r=function(){var e=t.current;Mt()&&t.transitionTo(Pt(),(function(r){n&&ot(t.router,r,e,!0),vt||Ut(r.fullPath)}))},i=vt?"popstate":"hashchange";window.addEventListener(i,r),this.listeners.push((function(){window.removeEventListener(i,r)}))}},e.prototype.push=function(t,e,n){var r=this,i=this.current;this.transitionTo(t,(function(t){Ft(t.fullPath),ot(r.router,t,i,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,i=this.current;this.transitionTo(t,(function(t){Ut(t.fullPath),ot(r.router,t,i,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Pt()!==e&&(t?Ft(e):Ut(e))},e.prototype.getCurrentLocation=function(){return Pt()},e}(Et);function Mt(){var t=Pt();return"/"===t.charAt(0)||(Ut("/"+t),!1)}function Pt(){var t=window.location.href,e=t.indexOf("#");if(e<0)return"";var n=(t=t.slice(e+1)).indexOf("?");if(n<0){var r=t.indexOf("#");t=r>-1?decodeURI(t.slice(0,r))+t.slice(r):decodeURI(t)}else t=decodeURI(t.slice(0,n))+t.slice(n);return t}function Dt(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function Ft(t){vt?ht(Dt(t)):window.location.hash=t}function Ut(t){vt?mt(Dt(t)):window.location.replace(Dt(t))}var Bt=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){e.index=n,e.updateRoute(r)}),(function(t){Ct(t,gt.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Et),Ht=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=X(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!vt&&!1!==t.fallback,this.fallback&&(e="hash"),K||(e="abstract"),this.mode=e,e){case"history":this.history=new Rt(this,t.base);break;case"hash":this.history=new Nt(this,t.base,this.fallback);break;case"abstract":this.history=new Bt(this,t.base);break;default:0}},Vt={currentRoute:{configurable:!0}};function qt(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Ht.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},Vt.currentRoute.get=function(){return this.history&&this.history.current},Ht.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardownListeners()})),!this.app){this.app=t;var n=this.history;if(n instanceof Rt||n instanceof Nt){var r=function(t){n.setupListeners(),function(t){var r=n.current,i=e.options.scrollBehavior;vt&&i&&"fullPath"in t&&ot(e,t,r,!1)}(t)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Ht.prototype.beforeEach=function(t){return qt(this.beforeHooks,t)},Ht.prototype.beforeResolve=function(t){return qt(this.resolveHooks,t)},Ht.prototype.afterEach=function(t){return qt(this.afterHooks,t)},Ht.prototype.onReady=function(t,e){this.history.onReady(t,e)},Ht.prototype.onError=function(t){this.history.onError(t)},Ht.prototype.push=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.push(t,e,n)}));this.history.push(t,e,n)},Ht.prototype.replace=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.replace(t,e,n)}));this.history.replace(t,e,n)},Ht.prototype.go=function(t){this.history.go(t)},Ht.prototype.back=function(){this.go(-1)},Ht.prototype.forward=function(){this.go(1)},Ht.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Ht.prototype.resolve=function(t,e,n){var r=H(t,e=e||this.history.current,n,this),i=this.match(r,e),o=i.redirectedFrom||i.fullPath;return{location:r,route:i,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?x(t+"/"+r):r}(this.history.base,o,this.mode),normalizedTo:r,resolved:i}},Ht.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==y&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Ht.prototype,Vt),Ht.install=function t(e){if(!t.installed||V!==e){t.installed=!0,V=e;var n=function(t){return void 0!==t},r=function(t,e){var r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed:function(){r(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",i),e.component("RouterLink",z);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Ht.version="3.4.3",Ht.isNavigationFailure=Ct,Ht.NavigationFailureType=gt,K&&window.Vue&&window.Vue.use(Ht),e.a=Ht},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(5),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(3))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,c=1,u={},l=!1,f=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){v(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){v(t.data)},r=function(t){o.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(t){var e=f.createElement("script");e.onreadystatechange=function(){v(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(v,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&v(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;nn.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i
'; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /includes/Api.php: -------------------------------------------------------------------------------- 1 | includes(); 16 | 17 | add_action( 'rest_api_init', [ $this, 'register_routes' ] ); 18 | } 19 | 20 | /** 21 | * Include the controller classes 22 | * 23 | * @return void 24 | */ 25 | private function includes() { 26 | if ( !class_exists( __NAMESPACE__ . '\Api\Example' ) ) { 27 | require_once __DIR__ . '/Api/Example.php'; 28 | } 29 | } 30 | 31 | /** 32 | * Register the API routes 33 | * 34 | * @return void 35 | */ 36 | public function register_routes() { 37 | (new Api\Example())->register_routes(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /includes/Api/Example.php: -------------------------------------------------------------------------------- 1 | namespace = 'myapp/v1'; 16 | $this->rest_base = 'test'; 17 | } 18 | 19 | /** 20 | * Register the routes 21 | * 22 | * @return void 23 | */ 24 | public function register_routes() { 25 | register_rest_route( 26 | $this->namespace, 27 | '/' . $this->rest_base, 28 | array( 29 | array( 30 | 'methods' => \WP_REST_Server::READABLE, 31 | 'callback' => array( $this, 'get_items' ), 32 | 'permission_callback' => array( $this, 'get_items_permissions_check' ), 33 | 'args' => $this->get_collection_params(), 34 | ) 35 | ) 36 | ); 37 | } 38 | 39 | /** 40 | * Retrieves a collection of items. 41 | * 42 | * @param WP_REST_Request $request Full details about the request. 43 | * 44 | * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. 45 | */ 46 | public function get_items( $request ) { 47 | $items = [ 48 | 'foo' => 'bar' 49 | ]; 50 | 51 | $response = rest_ensure_response( $items ); 52 | 53 | return $response; 54 | } 55 | 56 | /** 57 | * Checks if a given request has access to read the items. 58 | * 59 | * @param WP_REST_Request $request Full details about the request. 60 | * 61 | * @return true|WP_Error True if the request has read access, WP_Error object otherwise. 62 | */ 63 | public function get_items_permissions_check( $request ) { 64 | return true; 65 | } 66 | 67 | /** 68 | * Retrieves the query params for the items collection. 69 | * 70 | * @return array Collection parameters. 71 | */ 72 | public function get_collection_params() { 73 | return []; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /includes/Assets.php: -------------------------------------------------------------------------------- 1 | register_scripts( $this->get_scripts() ); 25 | $this->register_styles( $this->get_styles() ); 26 | } 27 | 28 | /** 29 | * Register scripts 30 | * 31 | * @param array $scripts 32 | * 33 | * @return void 34 | */ 35 | private function register_scripts( $scripts ) { 36 | foreach ( $scripts as $handle => $script ) { 37 | $deps = isset( $script['deps'] ) ? $script['deps'] : false; 38 | $in_footer = isset( $script['in_footer'] ) ? $script['in_footer'] : false; 39 | $version = isset( $script['version'] ) ? $script['version'] : BASEPLUGIN_VERSION; 40 | 41 | wp_register_script( $handle, $script['src'], $deps, $version, $in_footer ); 42 | } 43 | } 44 | 45 | /** 46 | * Register styles 47 | * 48 | * @param array $styles 49 | * 50 | * @return void 51 | */ 52 | public function register_styles( $styles ) { 53 | foreach ( $styles as $handle => $style ) { 54 | $deps = isset( $style['deps'] ) ? $style['deps'] : false; 55 | 56 | wp_register_style( $handle, $style['src'], $deps, BASEPLUGIN_VERSION ); 57 | } 58 | } 59 | 60 | /** 61 | * Get all registered scripts 62 | * 63 | * @return array 64 | */ 65 | public function get_scripts() { 66 | $prefix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.min' : ''; 67 | 68 | $scripts = [ 69 | 'baseplugin-runtime' => [ 70 | 'src' => BASEPLUGIN_ASSETS . '/js/runtime.js', 71 | 'version' => filemtime( BASEPLUGIN_PATH . '/assets/js/runtime.js' ), 72 | 'in_footer' => true 73 | ], 74 | 'baseplugin-vendor' => [ 75 | 'src' => BASEPLUGIN_ASSETS . '/js/vendors.js', 76 | 'version' => filemtime( BASEPLUGIN_PATH . '/assets/js/vendors.js' ), 77 | 'in_footer' => true 78 | ], 79 | 'baseplugin-frontend' => [ 80 | 'src' => BASEPLUGIN_ASSETS . '/js/frontend.js', 81 | 'deps' => [ 'jquery', 'baseplugin-vendor', 'baseplugin-runtime' ], 82 | 'version' => filemtime( BASEPLUGIN_PATH . '/assets/js/frontend.js' ), 83 | 'in_footer' => true 84 | ], 85 | 'baseplugin-admin' => [ 86 | 'src' => BASEPLUGIN_ASSETS . '/js/admin.js', 87 | 'deps' => [ 'jquery', 'baseplugin-vendor', 'baseplugin-runtime' ], 88 | 'version' => filemtime( BASEPLUGIN_PATH . '/assets/js/admin.js' ), 89 | 'in_footer' => true 90 | ] 91 | ]; 92 | 93 | return $scripts; 94 | } 95 | 96 | /** 97 | * Get registered styles 98 | * 99 | * @return array 100 | */ 101 | public function get_styles() { 102 | 103 | $styles = [ 104 | 'baseplugin-style' => [ 105 | 'src' => BASEPLUGIN_ASSETS . '/css/style.css' 106 | ], 107 | 'baseplugin-frontend' => [ 108 | 'src' => BASEPLUGIN_ASSETS . '/css/frontend.css' 109 | ], 110 | 'baseplugin-admin' => [ 111 | 'src' => BASEPLUGIN_ASSETS . '/css/admin.css' 112 | ], 113 | ]; 114 | 115 | return $styles; 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /includes/Frontend.php: -------------------------------------------------------------------------------- 1 | '; 26 | 27 | return $content; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /languages/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tareq1988/vue-wp-starter/241f2fc39f7555d5ddbc34b40652bbf8860aa3bc/languages/.gitkeep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-wp-starter", 3 | "version": "1.0.0", 4 | "description": "A WordPress Vue.js starter plugin", 5 | "author": "Tareq Hasan ", 6 | "license": "GPLv2", 7 | "private": true, 8 | "scripts": { 9 | "dev": "webpack --watch --progress --hide-modules", 10 | "dev-build": "webpack -d --mode development", 11 | "build": "webpack -p --mode production" 12 | }, 13 | "dependencies": { 14 | "vue": "^2.6.11", 15 | "vue-router": "^3.4.3" 16 | }, 17 | "devDependencies": { 18 | "@babel/core": "^7.11.1", 19 | "@babel/preset-env": "latest", 20 | "babel-loader": "^8.1.0", 21 | "browser-sync": "^2.26.12", 22 | "browser-sync-webpack-plugin": "^2.2.2", 23 | "css-loader": "^3.6.0", 24 | "file-loader": "^4.3.0", 25 | "html-webpack-plugin": "^3.2.0", 26 | "html-webpack-template": "^6.2.0", 27 | "less": "^3.12.2", 28 | "less-loader": "^5.0.0", 29 | "mini-css-extract-plugin": "^0.8.2", 30 | "optimize-css-assets-webpack-plugin": "^5.0.3", 31 | "terser-webpack-plugin": "^4.1.0", 32 | "url-loader": "^2.3.0", 33 | "vue-loader": "^15.9.3", 34 | "vue-template-compiler": "^2.6.11", 35 | "webpack": "^4.44.1", 36 | "webpack-cli": "^3.3.12" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /plugin.php: -------------------------------------------------------------------------------- 1 | define_constants(); 74 | 75 | register_activation_hook( __FILE__, array( $this, 'activate' ) ); 76 | register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) ); 77 | 78 | add_action( 'plugins_loaded', array( $this, 'init_plugin' ) ); 79 | } 80 | 81 | /** 82 | * Initializes the Base_Plugin() class 83 | * 84 | * Checks for an existing Base_Plugin() instance 85 | * and if it doesn't find one, creates it. 86 | */ 87 | public static function init() { 88 | static $instance = false; 89 | 90 | if ( ! $instance ) { 91 | $instance = new Base_Plugin(); 92 | } 93 | 94 | return $instance; 95 | } 96 | 97 | /** 98 | * Magic getter to bypass referencing plugin. 99 | * 100 | * @param $prop 101 | * 102 | * @return mixed 103 | */ 104 | public function __get( $prop ) { 105 | if ( array_key_exists( $prop, $this->container ) ) { 106 | return $this->container[ $prop ]; 107 | } 108 | 109 | return $this->{$prop}; 110 | } 111 | 112 | /** 113 | * Magic isset to bypass referencing plugin. 114 | * 115 | * @param $prop 116 | * 117 | * @return mixed 118 | */ 119 | public function __isset( $prop ) { 120 | return isset( $this->{$prop} ) || isset( $this->container[ $prop ] ); 121 | } 122 | 123 | /** 124 | * Define the constants 125 | * 126 | * @return void 127 | */ 128 | public function define_constants() { 129 | define( 'BASEPLUGIN_VERSION', $this->version ); 130 | define( 'BASEPLUGIN_FILE', __FILE__ ); 131 | define( 'BASEPLUGIN_PATH', dirname( BASEPLUGIN_FILE ) ); 132 | define( 'BASEPLUGIN_INCLUDES', BASEPLUGIN_PATH . '/includes' ); 133 | define( 'BASEPLUGIN_URL', plugins_url( '', BASEPLUGIN_FILE ) ); 134 | define( 'BASEPLUGIN_ASSETS', BASEPLUGIN_URL . '/assets' ); 135 | } 136 | 137 | /** 138 | * Load the plugin after all plugis are loaded 139 | * 140 | * @return void 141 | */ 142 | public function init_plugin() { 143 | $this->includes(); 144 | $this->init_hooks(); 145 | } 146 | 147 | /** 148 | * Placeholder for activation function 149 | * 150 | * Nothing being called here yet. 151 | */ 152 | public function activate() { 153 | 154 | $installed = get_option( 'baseplugin_installed' ); 155 | 156 | if ( ! $installed ) { 157 | update_option( 'baseplugin_installed', time() ); 158 | } 159 | 160 | update_option( 'baseplugin_version', BASEPLUGIN_VERSION ); 161 | } 162 | 163 | /** 164 | * Placeholder for deactivation function 165 | * 166 | * Nothing being called here yet. 167 | */ 168 | public function deactivate() { 169 | 170 | } 171 | 172 | /** 173 | * Include the required files 174 | * 175 | * @return void 176 | */ 177 | public function includes() { 178 | 179 | require_once BASEPLUGIN_INCLUDES . '/Assets.php'; 180 | 181 | if ( $this->is_request( 'admin' ) ) { 182 | require_once BASEPLUGIN_INCLUDES . '/Admin.php'; 183 | } 184 | 185 | if ( $this->is_request( 'frontend' ) ) { 186 | require_once BASEPLUGIN_INCLUDES . '/Frontend.php'; 187 | } 188 | 189 | if ( $this->is_request( 'ajax' ) ) { 190 | // require_once BASEPLUGIN_INCLUDES . '/class-ajax.php'; 191 | } 192 | 193 | require_once BASEPLUGIN_INCLUDES . '/Api.php'; 194 | } 195 | 196 | /** 197 | * Initialize the hooks 198 | * 199 | * @return void 200 | */ 201 | public function init_hooks() { 202 | 203 | add_action( 'init', array( $this, 'init_classes' ) ); 204 | 205 | // Localize our plugin 206 | add_action( 'init', array( $this, 'localization_setup' ) ); 207 | } 208 | 209 | /** 210 | * Instantiate the required classes 211 | * 212 | * @return void 213 | */ 214 | public function init_classes() { 215 | 216 | if ( $this->is_request( 'admin' ) ) { 217 | $this->container['admin'] = new App\Admin(); 218 | } 219 | 220 | if ( $this->is_request( 'frontend' ) ) { 221 | $this->container['frontend'] = new App\Frontend(); 222 | } 223 | 224 | if ( $this->is_request( 'ajax' ) ) { 225 | // $this->container['ajax'] = new App\Ajax(); 226 | } 227 | 228 | $this->container['api'] = new App\Api(); 229 | $this->container['assets'] = new App\Assets(); 230 | } 231 | 232 | /** 233 | * Initialize plugin for localization 234 | * 235 | * @uses load_plugin_textdomain() 236 | */ 237 | public function localization_setup() { 238 | load_plugin_textdomain( 'baseplugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 239 | } 240 | 241 | /** 242 | * What type of request is this? 243 | * 244 | * @param string $type admin, ajax, cron or frontend. 245 | * 246 | * @return bool 247 | */ 248 | private function is_request( $type ) { 249 | switch ( $type ) { 250 | case 'admin' : 251 | return is_admin(); 252 | 253 | case 'ajax' : 254 | return defined( 'DOING_AJAX' ); 255 | 256 | case 'rest' : 257 | return defined( 'REST_REQUEST' ); 258 | 259 | case 'cron' : 260 | return defined( 'DOING_CRON' ); 261 | 262 | case 'frontend' : 263 | return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' ); 264 | } 265 | } 266 | 267 | } // Base_Plugin 268 | 269 | $baseplugin = Base_Plugin::init(); 270 | -------------------------------------------------------------------------------- /src/admin/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /src/admin/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import menuFix from './utils/admin-menu-fix' 5 | 6 | Vue.config.productionTip = false 7 | 8 | /* eslint-disable no-new */ 9 | new Vue({ 10 | el: '#vue-admin-app', 11 | router, 12 | render: h => h(App) 13 | }); 14 | 15 | 16 | // fix the admin menu for the slug "vue-app" 17 | menuFix('vue-app'); 18 | -------------------------------------------------------------------------------- /src/admin/pages/Home.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 21 | 24 | -------------------------------------------------------------------------------- /src/admin/pages/Settings.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 22 | -------------------------------------------------------------------------------- /src/admin/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Home from 'admin/pages/Home.vue' 4 | import Settings from 'admin/pages/Settings.vue' 5 | 6 | Vue.use(Router) 7 | 8 | export default new Router({ 9 | routes: [ 10 | { 11 | path: '/', 12 | name: 'Home', 13 | component: Home 14 | }, 15 | { 16 | path: '/settings', 17 | name: 'Settings', 18 | component: Settings 19 | }, 20 | ] 21 | }) 22 | -------------------------------------------------------------------------------- /src/admin/utils/admin-menu-fix.js: -------------------------------------------------------------------------------- 1 | /** 2 | * As we are using hash based navigation, hack fix 3 | * to highlight the current selected menu 4 | * 5 | * Requires jQuery 6 | */ 7 | function menuFix(slug) { 8 | var $ = jQuery; 9 | 10 | let menuRoot = $('#toplevel_page_' + slug); 11 | let currentUrl = window.location.href; 12 | let currentPath = currentUrl.substr( currentUrl.indexOf('admin.php') ); 13 | 14 | menuRoot.on('click', 'a', function() { 15 | var self = $(this); 16 | 17 | $('ul.wp-submenu li', menuRoot).removeClass('current'); 18 | 19 | if ( self.hasClass('wp-has-submenu') ) { 20 | $('li.wp-first-item', menuRoot).addClass('current'); 21 | } else { 22 | self.parents('li').addClass('current'); 23 | } 24 | }); 25 | 26 | $('ul.wp-submenu a', menuRoot).each(function(index, el) { 27 | if ( $(el).attr( 'href' ) === currentPath ) { 28 | $(el).parent().addClass('current'); 29 | return; 30 | } 31 | }); 32 | } 33 | 34 | export default menuFix; -------------------------------------------------------------------------------- /src/frontend/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /src/frontend/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | 5 | Vue.config.productionTip = false 6 | 7 | /* eslint-disable no-new */ 8 | new Vue({ 9 | el: '#vue-frontend-app', 10 | router, 11 | render: h => h(App) 12 | }) 13 | -------------------------------------------------------------------------------- /src/frontend/pages/Home.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 21 | 24 | -------------------------------------------------------------------------------- /src/frontend/pages/Profile.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 22 | -------------------------------------------------------------------------------- /src/frontend/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Home from 'frontend/pages/Home.vue' 4 | import Profile from 'frontend/pages/Profile.vue' 5 | 6 | Vue.use(Router) 7 | 8 | export default new Router({ 9 | routes: [ 10 | { 11 | path: '/', 12 | name: 'Home', 13 | component: Home 14 | }, 15 | { 16 | path: '/profile', 17 | name: 'Profile', 18 | component: Profile 19 | }, 20 | ] 21 | }) 22 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | const path = require('path'); 3 | const package = require('./package.json'); 4 | const VueLoaderPlugin = require('vue-loader/lib/plugin'); 5 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 6 | const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); 7 | const TerserJSPlugin = require('terser-webpack-plugin'); 8 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 9 | const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); 10 | const config = require( './config.json' ); 11 | 12 | const devMode = process.env.NODE_ENV !== 'production'; 13 | 14 | // Naming and path settings 15 | var appName = 'app'; 16 | var entryPoint = { 17 | frontend: './src/frontend/main.js', 18 | admin: './src/admin/main.js', 19 | style: './assets/less/style.less', 20 | }; 21 | 22 | var exportPath = path.resolve(__dirname, './assets/js'); 23 | 24 | // Enviroment flag 25 | var plugins = []; 26 | 27 | // extract css into its own file 28 | plugins.push(new MiniCssExtractPlugin({ 29 | filename: '../css/[name].css', 30 | ignoreOrder: false, // Enable to remove warnings about conflicting order 31 | })); 32 | 33 | // enable live reload with browser-sync 34 | // set your WordPress site URL in config.json 35 | // file and uncomment the snippet below. 36 | // -------------------------------------- 37 | // plugins.push(new BrowserSyncPlugin( { 38 | // proxy: { 39 | // target: config.proxyURL 40 | // }, 41 | // files: [ 42 | // '**/*.php' 43 | // ], 44 | // cors: true, 45 | // reloadDelay: 0 46 | // } )); 47 | 48 | plugins.push(new VueLoaderPlugin()); 49 | 50 | // Differ settings based on production flag 51 | if ( devMode ) { 52 | appName = '[name].js'; 53 | } else { 54 | appName = '[name].min.js'; 55 | } 56 | 57 | module.exports = { 58 | entry: entryPoint, 59 | mode: devMode ? 'development' : 'production', 60 | output: { 61 | path: exportPath, 62 | filename: appName, 63 | }, 64 | 65 | resolve: { 66 | alias: { 67 | 'vue$': 'vue/dist/vue.esm.js', 68 | '@': path.resolve('./src/'), 69 | 'frontend': path.resolve('./src/frontend/'), 70 | 'admin': path.resolve('./src/admin/'), 71 | }, 72 | modules: [ 73 | path.resolve('./node_modules'), 74 | path.resolve(path.join(__dirname, 'src/')), 75 | ] 76 | }, 77 | 78 | optimization: { 79 | runtimeChunk: 'single', 80 | splitChunks: { 81 | cacheGroups: { 82 | vendor: { 83 | test: /[\\\/]node_modules[\\\/]/, 84 | name: 'vendors', 85 | chunks: 'all' 86 | } 87 | } 88 | }, 89 | minimizer: [new TerserJSPlugin({}), new OptimizeCSSAssetsPlugin({})], 90 | }, 91 | 92 | plugins, 93 | 94 | module: { 95 | rules: [ 96 | { 97 | test: /\.vue$/, 98 | loader: 'vue-loader' 99 | }, 100 | { 101 | test: /\.js$/, 102 | use: 'babel-loader', 103 | exclude: /node_modules/ 104 | }, 105 | { 106 | test: /\.less$/, 107 | use: [ 108 | 'vue-style-loader', 109 | 'css-loader', 110 | 'less-loader' 111 | ] 112 | }, 113 | { 114 | test: /\.png$/, 115 | use: [ 116 | { 117 | loader: 'url-loader', 118 | options: { 119 | mimetype: 'image/png' 120 | } 121 | } 122 | ] 123 | }, 124 | { 125 | test: /\.svg$/, 126 | use: 'file-loader' 127 | }, 128 | { 129 | test: /\.css$/, 130 | use: [ 131 | { 132 | loader: MiniCssExtractPlugin.loader, 133 | options: { 134 | publicPath: (resourcePath, context) => { 135 | return path.relative(path.dirname(resourcePath), context) + '/'; 136 | }, 137 | hmr: process.env.NODE_ENV === 'development', 138 | }, 139 | }, 140 | 'css-loader', 141 | ], 142 | }, 143 | ] 144 | }, 145 | } 146 | --------------------------------------------------------------------------------