├── styles.css ├── .gitignore ├── amd ├── src │ └── app-lazy.js └── build │ ├── 1.app-lazy.min.js │ └── app-lazy.min.js ├── vue ├── .babelrc ├── components │ ├── not-found.vue │ ├── example-lazy-loading.vue │ └── rooms-edit.vue ├── package.json ├── main.js ├── store.js ├── webpack.config.js └── mform.js ├── db ├── services.php ├── upgrade.php ├── access.php └── install.xml ├── index.php ├── version.php ├── classes ├── external │ ├── exporter │ │ └── room.php │ └── rooms.php ├── form │ ├── room_edit.php │ ├── room_edit_controller.php │ └── form_controller.php └── vuejsdemo.php ├── lang └── en │ └── vuejsdemo.php ├── README.md ├── view.php ├── mod_form.php ├── lib.php └── pix └── icon.svg /styles.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vue/node_modules/ 2 | -------------------------------------------------------------------------------- /amd/src/app-lazy.js: -------------------------------------------------------------------------------- 1 | ../build/app-lazy.min.js -------------------------------------------------------------------------------- /vue/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@babel/plugin-syntax-dynamic-import"] 3 | } 4 | -------------------------------------------------------------------------------- /db/services.php: -------------------------------------------------------------------------------- 1 | array( 5 | 'classname' => 'mod_vuejsdemo\external\rooms', 6 | 'methodname' => 'get_rooms', 7 | 'description' => 'Get all rooms.', 8 | 'type' => 'read', 9 | 'ajax' => true, 10 | ), 11 | ); 12 | -------------------------------------------------------------------------------- /vue/components/not-found.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /vue/components/example-lazy-loading.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 15 | 16 | 19 | -------------------------------------------------------------------------------- /amd/build/1.app-lazy.min.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{21:function(e,n,t){"use strict";t.r(n);var a={name:"example-lazy-loading",created:function(){}},i=t(3),o=Object(i.a)(a,function(){var e=this.$createElement;return(this._self._c||e)("div",{staticClass:"example-lazy-loading"},[this._v("\n This component is used together with a lazy loading route. Lazy loading is useful if this component is big or has a lot of\n dependencies that are only used by this component.\n")])},[],!1,null,"1a2397de",null);n.default=o.exports}}]); -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * This file is meant to list all the instances in a particular course. 19 | * 20 | * @package mod_vuejsdemo 21 | * @copyright 2019 Martin Gauk, innoCampus, TU Berlin 22 | */ 23 | 24 | require_once('../../config.php'); 25 | 26 | $id = required_param('id', PARAM_INT); // Course ID. 27 | -------------------------------------------------------------------------------- /version.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * @package mod_vuejsdemo 19 | * @copyright 2019 Martin Gauk, innoCampus, TU Berlin 20 | */ 21 | 22 | defined('MOODLE_INTERNAL') || die(); 23 | 24 | $plugin->version = 2019041600; 25 | $plugin->requires = 2017111302; 26 | $plugin->component = 'mod_vuejsdemo'; 27 | $plugin->maturity = MATURITY_ALPHA; 28 | $plugin->release = '0.1'; 29 | -------------------------------------------------------------------------------- /vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "moodle-mod_vuejsdemo", 3 | "description": "Vue.js project", 4 | "version": "1.0.0", 5 | "author": "info@example.com", 6 | "license": "GPL", 7 | "private": true, 8 | "scripts": { 9 | "dev": "cross-env webpack --mode development --progress --hide-modules", 10 | "watch": "cross-env webpack --mode development --watch --hide-modules", 11 | "watch-hot": "cross-env webpack-dev-server --mode development --hot --inline --progress", 12 | "build": "cross-env webpack --mode production --progress --hide-modules" 13 | }, 14 | "dependencies": { 15 | "vue": "^2.6.10", 16 | "vue-router": "^3.0.5", 17 | "vuex": "^3.1.0" 18 | }, 19 | "browserslist": [ 20 | "> 1%", 21 | "last 2 versions", 22 | "not ie <= 8" 23 | ], 24 | "devDependencies": { 25 | "@babel/core": "^7.4.3", 26 | "@babel/plugin-syntax-dynamic-import": "^7.2.0", 27 | "@babel/preset-env": "^7.4.3", 28 | "babel-loader": "^8.0.5", 29 | "cross-env": "^5.2.0", 30 | "css-loader": "^2.1.1", 31 | "file-loader": "^3.0.1", 32 | "vue-loader": "^15.7.0", 33 | "vue-template-compiler": "^2.6.10", 34 | "webpack": "^4.30.0", 35 | "webpack-cli": "^3.3.0", 36 | "webpack-dev-server": "^3.3.1" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /db/upgrade.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * This file keeps track of upgrades to mod_vuejsdemo. 19 | * 20 | * @package mod_vuejsdemo 21 | * @copyright 2019 Martin Gauk, innoCampus, TU Berlin 22 | */ 23 | 24 | defined('MOODLE_INTERNAL') || die(); 25 | 26 | 27 | /** 28 | * Upgrade code for mod_vuejsdemo. 29 | * 30 | * @param int $oldversion the version we are upgrading from. 31 | */ 32 | function xmldb_vuejsdemo_upgrade($oldversion = 0) { 33 | global $CFG, $DB; 34 | 35 | $dbman = $DB->get_manager(); 36 | 37 | return true; 38 | } 39 | -------------------------------------------------------------------------------- /classes/external/exporter/room.php: -------------------------------------------------------------------------------- 1 | room = $room; 12 | 13 | parent::__construct([], ['context' => $context]); 14 | } 15 | 16 | protected static function define_other_properties() { 17 | return [ 18 | 'id' => [ 19 | 'type' => PARAM_INT, 20 | 'description' => 'room id', 21 | ], 22 | 'name' => [ 23 | 'type' => PARAM_TEXT, 24 | 'description' => 'room name', 25 | ], 26 | 'description' => [ 27 | 'type' => PARAM_TEXT, 28 | 'description' => 'room description', 29 | ], 30 | ]; 31 | } 32 | 33 | protected static function define_related() { 34 | return [ 35 | 'context' => 'context', 36 | ]; 37 | } 38 | 39 | protected function get_other_values(\renderer_base $output) { 40 | return [ 41 | 'id' => $this->room->id, 42 | 'name' => $this->room->name, 43 | 'description' => $this->room->description, 44 | ]; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /classes/form/room_edit.php: -------------------------------------------------------------------------------- 1 | libdir . "/formslib.php"); 8 | 9 | class room_edit extends \moodleform { 10 | public function definition() { 11 | $mform = $this->_form; 12 | 13 | /** @var \mod_vuejsdemo\vuejsdemo $vuejsdemo */ 14 | $vuejsdemo = $this->_customdata['vuejsdemo']; 15 | 16 | /** @var int $roomid */ 17 | $roomid = $this->_customdata['roomid']; 18 | 19 | // General section header. 20 | $mform->addElement('header', 'general', get_string('room', 'mod_vuejsdemo')); 21 | 22 | // Room id. 23 | $mform->addElement('hidden', 'roomid'); 24 | $mform->setType('roomid', PARAM_INT); 25 | if ($roomid) { 26 | $mform->setConstant('roomid', $roomid); 27 | } 28 | 29 | // Name. 30 | $mform->addElement('text', 'name', get_string('room_name', 'mod_vuejsdemo')); 31 | $mform->addRule('name', get_string('required'), 'required'); 32 | $mform->setType('name', PARAM_TEXT); 33 | 34 | // Description. 35 | $mform->addElement('text', 'description', get_string('room_description', 'mod_vuejsdemo')); 36 | $mform->addRule('description', get_string('required'), 'required'); 37 | $mform->setType('description', PARAM_TEXT); 38 | 39 | $this->add_action_buttons(true, get_string('savechanges')); 40 | } 41 | 42 | public function validation($data, $files) { 43 | return []; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /db/access.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Plugin capabilities 19 | * 20 | * @package mod_vuejsdemo 21 | * @copyright 2019 Martin Gauk, innoCampus, TU Berlin 22 | */ 23 | 24 | defined('MOODLE_INTERNAL') || die(); 25 | 26 | $capabilities = array( 27 | 28 | 'mod/vuejsdemo:addinstance' => array( 29 | 'riskbitmask' => RISK_XSS, 30 | 'captype' => 'write', 31 | 'contextlevel' => CONTEXT_COURSE, 32 | 'archetypes' => array( 33 | 'manager' => CAP_ALLOW 34 | ), 35 | ), 36 | 37 | 'mod/vuejsdemo:view' => array( 38 | 'captype' => 'read', 39 | 'contextlevel' => CONTEXT_MODULE, 40 | 'archetypes' => array( 41 | 'guest' => CAP_ALLOW, 42 | 'frontpage' => CAP_ALLOW, 43 | 'student' => CAP_ALLOW, 44 | 'teacher' => CAP_ALLOW, 45 | 'editingteacher' => CAP_ALLOW, 46 | 'manager' => CAP_ALLOW 47 | ) 48 | ), 49 | 50 | ); 51 | -------------------------------------------------------------------------------- /classes/external/rooms.php: -------------------------------------------------------------------------------- 1 | new external_value(PARAM_INT, 'course module id'), 16 | ]); 17 | } 18 | 19 | public static function get_rooms_returns() { 20 | return new external_multiple_structure( 21 | exporter\room::get_read_structure() 22 | ); 23 | } 24 | 25 | /** 26 | * Get all rooms. 27 | * 28 | * @param $coursemoduleid 29 | * @return bool 30 | * @throws \invalid_parameter_exception 31 | */ 32 | public static function get_rooms($coursemoduleid) { 33 | $params = ['coursemoduleid' => $coursemoduleid]; 34 | $params = self::validate_parameters(self::get_rooms_parameters(), $params); 35 | 36 | list($course, $coursemodule) = get_course_and_cm_from_cmid($params['coursemoduleid'], 'vuejsdemo'); 37 | self::validate_context($coursemodule->context); 38 | 39 | global $PAGE, $DB; 40 | $renderer = $PAGE->get_renderer('core'); 41 | $ctx = $coursemodule->context; 42 | 43 | $list = []; 44 | $rooms = $DB->get_records('vuejsdemo_rooms', ['vuejsdemoid' => $coursemodule->instance]); 45 | foreach ($rooms as $room) { 46 | $exporter = new exporter\room($room, $ctx); 47 | $list[] = $exporter->export($renderer); 48 | } 49 | 50 | return $list; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /classes/form/room_edit_controller.php: -------------------------------------------------------------------------------- 1 | roomid = (isset($this->moreargs->roomid)) ? intval($this->moreargs->roomid) : null; 19 | $this->customdata = [ 20 | 'vuejsdemo' => $this->vuejsdemo, 21 | 'roomid' => $this->roomid, 22 | ]; 23 | 24 | if ($this->roomid) { 25 | $this->room = $DB->get_record('vuejsdemo_rooms', ['id' => $this->roomid]); 26 | } 27 | } 28 | 29 | protected function handle_submit(\stdClass $data) : bool { 30 | if ($this->roomid && $data->roomid != $this->roomid) { 31 | return false; 32 | } 33 | 34 | global $DB; 35 | $room = new \stdClass(); 36 | $room->id = $this->roomid; 37 | $room->vuejsdemoid = $this->vuejsdemo->get_id(); 38 | $room->name = $data->name; 39 | $room->description = $data->description; 40 | 41 | if ($room->id) { 42 | $DB->update_record('vuejsdemo_rooms', $room); 43 | } else { 44 | $DB->insert_record('vuejsdemo_rooms', $room); 45 | } 46 | 47 | return true; 48 | } 49 | 50 | protected function handle_display() { 51 | global $DB; 52 | 53 | if ($this->room) { 54 | // Set default (existing) data. 55 | $data = [ 56 | 'name' => $this->room->name, 57 | 'description' => $this->room->description, 58 | ]; 59 | $this->mform->set_data($data); 60 | } 61 | } 62 | 63 | protected function check_capability() { 64 | $this->vuejsdemo->require_user_has_capability('mod/vuejsdemo:view'); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lang/en/vuejsdemo.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Strings for mod_vuejsdemo, language en 19 | * 20 | * @package mod_vuejsdemo 21 | * @copyright 2019 Martin Gauk, innoCampus, TU Berlin 22 | */ 23 | 24 | // Required strings. 25 | $string['modulename'] = 'Vue.js Demonstration'; 26 | $string['modulenameplural'] = 'Vue.js Demonstrations'; 27 | $string['modulename_help'] = 'Vue.js Demonstration'; 28 | $string['pluginadministration'] = 'Vue.js Demonstration Administration'; 29 | $string['pluginname'] = 'Vue.js Demonstration'; 30 | 31 | // Capabilities. 32 | $string['vuejsdemo:addinstance'] = 'Add a new Vue.js demonstration instance'; 33 | $string['vuejsdemo:view'] = 'View Vue.js Demonstration'; 34 | 35 | // Vue component route not found. 36 | $string['route_not_found'] = 'Error: Page (route) not found!'; 37 | 38 | // Vue component rooms edit. 39 | $string['rooms_edit_site_name'] = 'Rooms configuration'; 40 | $string['rooms_edit_site_description'] = 'You may add a new room or edit existing rooms.'; 41 | $string['rooms_edit_no_rooms'] = 'There are no rooms to show.'; 42 | 43 | // Room form. 44 | $string['room'] = 'Room'; 45 | $string['room_name'] = 'Room name'; 46 | $string['room_description'] = 'Room description'; 47 | $string['room_form_title_add'] = 'Add a new room'; 48 | $string['room_form_title_edit'] = 'Edit a room'; -------------------------------------------------------------------------------- /classes/vuejsdemo.php: -------------------------------------------------------------------------------- 1 | modname !== 'vuejsdemo') { 22 | throw new \moodle_exception('wrong_cm_info_given', 'vuejsdemo'); 23 | } 24 | $this->instance = $coursemodule->instance; 25 | $this->coursemodule = $coursemodule; 26 | $this->context = $coursemodule->context; 27 | } 28 | 29 | /** 30 | * Get vuejsdemo instance id. 31 | * 32 | * @return int 33 | */ 34 | public function get_id() : int { 35 | return $this->instance; 36 | } 37 | 38 | public function get_context() : \context_module { 39 | return $this->context; 40 | } 41 | 42 | public function get_coursemodule() { 43 | return $this->coursemodule; 44 | } 45 | 46 | public function get_settings() { 47 | if ($this->settings === null) { 48 | global $DB; 49 | $settings = $DB->get_record('vuejsdemo', ['id' => $this->instance], '*', MUST_EXIST); 50 | 51 | $this->settings = new \stdClass(); 52 | $this->settings->name = $settings->name; 53 | } 54 | 55 | return $this->settings; 56 | } 57 | 58 | public function make_url(string $subpath, array $params = null) : \moodle_url { 59 | $path = '/mod/vuejsdemo/view.php/' . $this->coursemodule->id . '/' . $subpath; 60 | return new \moodle_url($path, $params); 61 | } 62 | 63 | public function user_has_capability(string $capability) : bool { 64 | return \has_capability($capability, $this->context); 65 | } 66 | 67 | public function require_user_has_capability(string $capability) { 68 | \require_capability($capability, $this->context); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Moodle Vue.js Demonstration 2 | 3 | This is a small demonstration of using [Vue.js](https://vuejs.org/) and 4 | [Vue Router](https://router.vuejs.org/) in a Moodle plugin. 5 | 6 | ## Frontend with Vue.js 7 | 8 | The javascript files and Vue components will be bundled to a single file as AMD module 9 | `amd/build/app-lazy.min.js` using **Webpack**. 10 | You may call functions in that module with `$PAGE->requires->js_call_amd`. 11 | 12 | [The suffix -lazy is used to tell Moodle that the file should not be bundled with Moodle's 13 | other AMD modules](https://docs.moodle.org/dev/Javascript_Modules#But_I_have_a_mega_JS_file_I_don.27t_want_loaded_on_every_page.3F) 14 | That makes sense because the javascript file generated by Webpack is quite big 15 | and is only needed for this plugin. 16 | 17 | 18 | If you want to change the Vue components or the javascript code, you have to install 19 | all dependencies: 20 | ``` 21 | cd vue 22 | npm install 23 | ``` 24 | 25 | With `npm run dev` or `npm run watch` you build the file `amd/build/app-lazy.min.js` 26 | (in development mode) that will be loaded by the browser. Watch does not exit, it will 27 | re-build the file whenever one of the source files was touched. 28 | 29 | **Important: Before a commit** you should build the file with `npm run build` (production mode). 30 | This generates a much smaller file. However, the file is not suitable for debugging using the 31 | browser web developer tools. 32 | 33 | Hint: you should disable Moodle's javascript cache. You may add the line `$CFG->cachejs = false;` 34 | to `config.php`. If you disable caching, Moodle takes the file from the `amd/src` folder. 35 | Hence, there is a symbolic link to `../build/app-lazy.min.js`. 36 | 37 | If you want to use javascript libraries from Moodle, you have to declare them as external 38 | dependencies in `vue/webpack.config.js` under `exports.externals`. 39 | 40 | ## Forms 41 | 42 | You may create forms just like any other form in Moodle by extending the class `moodleform` 43 | (have a look at the `classes/form/` directory). 44 | 45 | The forms are displayed using a modal. There is the javascript class `MFormModal`. 46 | 47 | -------------------------------------------------------------------------------- /db/install.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /view.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * This page is the entry page into the mod. 19 | * 20 | * @package mod_vuejsdemo 21 | * @copyright 2019 Martin Gauk, innoCampus, TU Berlin 22 | */ 23 | 24 | require('../../config.php'); 25 | require_once('lib.php'); 26 | 27 | // if url has form view.php?id=xy then redirect to to view.php/xy 28 | $coursemoduleid = optional_param('id', 0, PARAM_INT); 29 | if ($coursemoduleid > 0) { 30 | $path = '/mod/vuejsdemo/view.php/' . $coursemoduleid . '/'; 31 | redirect(new \moodle_url($path)); 32 | } 33 | // Support for Vue.js Router and its URL structure. 34 | // /mod/vuejsdemo/view.php/[course module id]/.../... 35 | $paths = explode('/', $_SERVER['REQUEST_URI']); 36 | $baseindex = array_search('view.php', $paths); 37 | if (count($paths) > $baseindex + 1) { 38 | $coursemoduleid = intval($paths[$baseindex + 1]); 39 | } 40 | 41 | list($course, $coursemodule) = get_course_and_cm_from_cmid($coursemoduleid, 'vuejsdemo'); 42 | 43 | require_login($course, true, $coursemodule); 44 | 45 | $title = get_string('modulename', 'mod_vuejsdemo'); 46 | $url = new moodle_url('/mod/vuejsdemo/view.php', ['id' => $coursemoduleid]); 47 | 48 | $PAGE->set_context($coursemodule->context); 49 | $PAGE->set_title($title); 50 | $PAGE->set_heading($title); 51 | $PAGE->set_url($url); 52 | $PAGE->set_pagelayout('standard'); 53 | 54 | $PAGE->requires->js_call_amd('mod_vuejsdemo/app-lazy', 'init', [ 55 | 'coursemoduleid' => $coursemodule->id, 56 | 'contextid' => $coursemodule->context->id, 57 | ]); 58 | 59 | echo $OUTPUT->header(); 60 | 61 | echo <<<'EOT' 62 |
63 | 64 |
65 | EOT; 66 | 67 | echo $OUTPUT->footer($course); 68 | -------------------------------------------------------------------------------- /vue/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import VueRouter from 'vue-router'; 3 | import { store } from './store'; 4 | import notFound from './components/not-found'; 5 | import roomsEdit from './components/rooms-edit' 6 | const exampleLazyLoading = () => import('./components/example-lazy-loading'); 7 | 8 | function init(coursemoduleid, contextid) { 9 | // We need to overwrite the variable for lazy loading. 10 | __webpack_public_path__ = M.cfg.wwwroot + '/mod/vuejsdemo/amd/build/'; 11 | 12 | Vue.use(VueRouter); 13 | 14 | store.commit('setCourseModuleID', coursemoduleid); 15 | store.commit('setContextID', contextid); 16 | store.dispatch('loadComponentStrings'); 17 | 18 | // You have to use child routes if you use the same component. Otherwise the component's beforeRouteUpdate 19 | // will not be called. 20 | const routes = [ 21 | { path: '/', redirect: { name: 'rooms-edit-overview' }}, 22 | { path: '/rooms/edit', component: roomsEdit, name: 'rooms-edit-overview', meta: { title: 'rooms_edit_site_name' }, 23 | children: [ 24 | { path: '/rooms/edit/:roomId(\\d+)', component: roomsEdit, name: 'room-edit', meta: { title: 'room_form_title_edit' }}, 25 | { path: '/rooms/edit/new', component: roomsEdit, name: 'room-new', meta: { title: 'room_form_title_add' }}, 26 | ], 27 | }, 28 | { path: '/lazy-loading', component: exampleLazyLoading}, 29 | { path: '*', component: notFound, meta: { title: 'route_not_found' } }, 30 | ]; 31 | 32 | // base URL is /mod/vuejsdemo/view.php/[course module id]/ 33 | const currenturl = window.location.pathname; 34 | const base = currenturl.substr(0, currenturl.indexOf('.php')) + '.php/' + coursemoduleid + '/'; 35 | 36 | const router = new VueRouter({ 37 | mode: 'history', 38 | routes, 39 | base 40 | }); 41 | 42 | router.beforeEach((to, from, next) => { 43 | // Find a translation for the title. 44 | if (to.hasOwnProperty('meta') && to.meta.hasOwnProperty('title')) { 45 | if (store.state.strings.hasOwnProperty(to.meta.title)) { 46 | document.title = store.state.strings[to.meta.title]; 47 | } 48 | } 49 | next() 50 | }); 51 | 52 | new Vue({ 53 | el: '#mod-vuejsdemo-app', 54 | store, 55 | router, 56 | }); 57 | } 58 | 59 | export { init }; 60 | -------------------------------------------------------------------------------- /mod_form.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * The main vuejsdemo configuration form 19 | * 20 | * @package mod_vuejsdemo 21 | * @copyright 2019 Martin Gauk, innoCampus, TU Berlin 22 | */ 23 | defined('MOODLE_INTERNAL') || die(); 24 | 25 | require_once($CFG->dirroot . '/course/moodleform_mod.php'); 26 | 27 | /** 28 | * Module instance settings form 29 | */ 30 | class mod_vuejsdemo_mod_form extends moodleform_mod { 31 | /** 32 | * Defines forms elements. 33 | */ 34 | public function definition() { 35 | global $CFG, $PAGE; 36 | $mform = $this->_form; 37 | 38 | // Adding the "general" fieldset, where all the common settings are showed. 39 | $mform->addElement('header', 'general', get_string('general', 'form')); 40 | 41 | // Adding the standard "name" field. 42 | $mform->addElement('text', 'name', 'Title', array( 43 | 'size' => '64' 44 | )); 45 | if (!empty($CFG->formatstringstriptags)) { 46 | $mform->setType('name', PARAM_TEXT); 47 | } else { 48 | $mform->setType('name', PARAM_CLEANHTML); 49 | } 50 | $mform->addRule('name', null, 'required', null, 'client'); 51 | $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); 52 | 53 | // Adding the standard "intro" and "introformat" fields. 54 | $this->standard_intro_elements(); 55 | 56 | // Add standard elements, common to all modules. 57 | $this->standard_coursemodule_elements(); 58 | 59 | // Add standard action buttons, common to all modules. 60 | $this->add_action_buttons(); 61 | } 62 | 63 | /** 64 | * Checks that accesstimestart is before accesstimestop 65 | */ 66 | public function validation($data, $files) { 67 | $errors = parent::validation($data, $files); 68 | 69 | return $errors; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vue/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Vuex from 'vuex'; 3 | import moodleAjax from 'core/ajax'; 4 | import moodleStorage from 'core/localstorage'; 5 | import Notification from 'core/notification'; 6 | import $ from 'jquery'; 7 | 8 | Vue.use(Vuex); 9 | 10 | export const store = new Vuex.Store({ 11 | state: { 12 | courseModuleID: 0, 13 | contextID: 0, 14 | strings: {}, 15 | rooms: null, 16 | }, 17 | //strict: process.env.NODE_ENV !== 'production', 18 | mutations: { 19 | setCourseModuleID(state, id) { 20 | state.courseModuleID = id; 21 | }, 22 | setContextID(state, id) { 23 | state.contextID = id; 24 | }, 25 | setRooms(state, ajaxdata) { 26 | state.rooms = ajaxdata; 27 | }, 28 | setStrings(state, strings) { 29 | state.strings = strings; 30 | }, 31 | }, 32 | actions: { 33 | async loadComponentStrings(context) { 34 | const lang = $('html').attr('lang').replace(/-/g, '_'); 35 | const cacheKey = 'mod_vuejsdemo/strings/' + lang; 36 | const cachedStrings = moodleStorage.get(cacheKey); 37 | if (cachedStrings) { 38 | context.commit('setStrings', JSON.parse(cachedStrings)); 39 | } else { 40 | const request = { 41 | methodname: 'core_get_component_strings', 42 | args: { 43 | 'component': 'mod_vuejsdemo', 44 | lang, 45 | }, 46 | }; 47 | const loadedStrings = await moodleAjax.call([request])[0]; 48 | let strings = {}; 49 | loadedStrings.forEach((s) => { 50 | strings[s.stringid] = s.string; 51 | }); 52 | context.commit('setStrings', strings); 53 | moodleStorage.set(cacheKey, JSON.stringify(strings)); 54 | } 55 | }, 56 | async fetchRooms(context) { 57 | const rooms = await ajax('mod_vuejsdemo_get_rooms'); 58 | context.commit('setRooms', rooms); 59 | }, 60 | } 61 | }); 62 | 63 | /** 64 | * Single ajax call to Moodle. 65 | */ 66 | export async function ajax(method, args) { 67 | const request = { 68 | methodname: method, 69 | args: Object.assign({ 70 | coursemoduleid: store.state.courseModuleID 71 | }, args), 72 | }; 73 | 74 | try { 75 | return await moodleAjax.call([request])[0]; 76 | } catch (e) { 77 | Notification.exception(e); 78 | throw e; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vue/components/rooms-edit.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 83 | 84 | 93 | -------------------------------------------------------------------------------- /classes/form/form_controller.php: -------------------------------------------------------------------------------- 1 | vuejsdemo = $vuejsdemo; 33 | $this->formdata = $formdata; 34 | $this->moreargs = $moreargs; 35 | 36 | $this->build_customdata(); 37 | $this->check_capability(); 38 | $this->construct_mform(); 39 | 40 | if ($data = $this->mform->get_data()) { 41 | // We have validated data. 42 | $this->formsubmittedsuccess = $this->handle_submit($data); 43 | } else { 44 | $this->handle_display(); 45 | } 46 | } 47 | 48 | protected function construct_mform() { 49 | $formclass = '\\mod_vuejsdemo\\form\\' . static::$formname; 50 | $this->mform = new $formclass(null, $this->customdata, 'post', '', null, true, $this->formdata); 51 | } 52 | 53 | /** 54 | * Render form (HTML). 55 | * 56 | * @return string 57 | */ 58 | public function render() { 59 | if (!empty($this->message)) { 60 | return $this->message; 61 | } 62 | 63 | return $this->mform->render(); 64 | } 65 | 66 | /** 67 | * Get a message that should be sent to the client. 68 | * 69 | * @return string 70 | */ 71 | public function get_message() { 72 | return $this->message; 73 | } 74 | 75 | /** 76 | * Form was submitted, validated and data was processed successfully. 77 | * 78 | * @return bool 79 | */ 80 | public function success() : bool { 81 | return $this->formsubmittedsuccess; 82 | } 83 | 84 | /** 85 | * Customdata sent to form. 86 | */ 87 | abstract protected function build_customdata(); 88 | 89 | /** 90 | * Handle a successful form submission. 91 | * 92 | * Called when the submitted form data was validated. 93 | * 94 | * @param \stdClass $data validated data from form 95 | * @return bool 96 | */ 97 | abstract protected function handle_submit(\stdClass $data) : bool; 98 | 99 | /** 100 | * First display of the form. 101 | * 102 | * Or the form is submitted but the data doesn't validate and the form is redisplayed. 103 | * 104 | * This is the place where to set the default (existing) data with 105 | * $this->mform->set_data. 106 | */ 107 | abstract protected function handle_display(); 108 | 109 | /** 110 | * Check that user is allowed to access this form. 111 | */ 112 | abstract protected function check_capability(); 113 | 114 | /** 115 | * Get the specific controller for a form. 116 | */ 117 | static public function get_controller(string $formname, vuejsdemo $vuejsdemo, array $formdata, \stdClass $moreargs) 118 | : form_controller { 119 | 120 | switch ($formname) { 121 | case 'room_edit': 122 | return new room_edit_controller($vuejsdemo, $formdata, $moreargs); 123 | 124 | default: 125 | throw new \moodle_exception('unknown_form', 'vuejsdemo'); 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /vue/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var webpack = require('webpack'); 3 | const VueLoaderPlugin = require('vue-loader/lib/plugin'); 4 | const TerserPlugin = require('terser-webpack-plugin'); 5 | 6 | const isDevServer = process.argv.find(v => v.includes('webpack-dev-server')); 7 | 8 | module.exports = (env, options) => { 9 | 10 | exports = { 11 | entry: './main.js', 12 | output: { 13 | path: path.resolve(__dirname, '../amd/build'), 14 | publicPath: '/dist/', 15 | filename: 'app-lazy.min.js', 16 | chunkFilename: "[id].app-lazy.min.js?v=[hash]", 17 | libraryTarget: 'amd', 18 | }, 19 | module: { 20 | rules: [ 21 | { 22 | test: /\.css$/, 23 | use: [ 24 | 'vue-style-loader', 25 | 'css-loader' 26 | ], 27 | }, 28 | { 29 | test: /\.vue$/, 30 | loader: 'vue-loader', 31 | options: { 32 | loaders: {} 33 | // Other vue-loader options go here 34 | } 35 | }, 36 | { 37 | test: /\.js$/, 38 | loader: 'babel-loader', 39 | exclude: /node_modules/ 40 | } 41 | ] 42 | }, 43 | resolve: { 44 | alias: { 45 | 'vue$': 'vue/dist/vue.esm.js' 46 | }, 47 | extensions: ['*', '.js', '.vue', '.json'] 48 | }, 49 | devServer: { 50 | historyApiFallback: true, 51 | noInfo: true, 52 | overlay: true, 53 | headers: { 54 | 'Access-Control-Allow-Origin': '\*' 55 | }, 56 | disableHostCheck: true, 57 | https: true, 58 | public: 'https://127.0.0.1:8080', 59 | hot: true, 60 | }, 61 | performance: { 62 | hints: false 63 | }, 64 | devtool: '#eval-source-map', 65 | plugins: [ 66 | new VueLoaderPlugin() 67 | ], 68 | watchOptions: { 69 | ignored: /node_modules/ 70 | }, 71 | externals: { 72 | 'core/ajax': { 73 | amd: 'core/ajax' 74 | }, 75 | 'core/str': { 76 | amd: 'core/str' 77 | }, 78 | 'core/modal_factory': { 79 | amd: 'core/modal_factory' 80 | }, 81 | 'core/modal_events': { 82 | amd: 'core/modal_events' 83 | }, 84 | 'core/fragment': { 85 | amd: 'core/fragment' 86 | }, 87 | 'core/yui': { 88 | amd: 'core/yui' 89 | }, 90 | 'core/localstorage': { 91 | amd: 'core/localstorage' 92 | }, 93 | 'core/notification': { 94 | amd: 'core/notification' 95 | }, 96 | 'jquery': { 97 | amd: 'jquery' 98 | } 99 | } 100 | }; 101 | 102 | if (options.mode === 'production') { 103 | exports.devtool = false; 104 | // http://vue-loader.vuejs.org/en/workflow/production.html 105 | exports.plugins = (exports.plugins || []).concat([ 106 | new webpack.DefinePlugin({ 107 | 'process.env': { 108 | NODE_ENV: '"production"' 109 | } 110 | }), 111 | new webpack.LoaderOptionsPlugin({ 112 | minimize: true 113 | }) 114 | ]); 115 | exports.optimization = { 116 | minimizer: [ 117 | new TerserPlugin({ 118 | cache: true, 119 | parallel: true, 120 | sourceMap: true, 121 | terserOptions: { 122 | // https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions 123 | } 124 | }), 125 | ] 126 | } 127 | } 128 | 129 | return exports; 130 | }; 131 | 132 | -------------------------------------------------------------------------------- /lib.php: -------------------------------------------------------------------------------- 1 | . 16 | 17 | /** 18 | * Library of functions for mod_vuejsdemo. 19 | * 20 | * @package mod_vuejsdemo 21 | * @copyright 2019 Martin Gauk, innoCampus, TU Berlin 22 | */ 23 | 24 | defined('MOODLE_INTERNAL') || die(); 25 | 26 | /** 27 | * Saves a new vuejsdemo instance into the database. 28 | * 29 | * Given an object containing all the necessary data, 30 | * (defined by the form in mod_form.php) this function 31 | * will create a new instance and return the id number 32 | * of the new instance. 33 | * 34 | * @param object $vuejsdemo an object from the form in mod_form.php 35 | * @return int the id of the newly inserted record 36 | */ 37 | function vuejsdemo_add_instance($vuejsdemo) { 38 | global $DB; 39 | 40 | $vuejsdemo->timecreated = time(); 41 | $vuejsdemo->timemodified = time(); 42 | 43 | $id = $DB->insert_record('vuejsdemo', $vuejsdemo); 44 | return $id; 45 | } 46 | 47 | /** 48 | * Updates a vuejsdemo instance. 49 | * 50 | * Given an object containing all the necessary data, 51 | * (defined by the form in mod_form.php) this function 52 | * will update an existing instance with new data. 53 | * 54 | * @param object $vuejsdemo an object from the form in mod_form.php 55 | * @return boolean Success/Fail 56 | */ 57 | function vuejsdemo_update_instance($vuejsdemo) { 58 | global $DB; 59 | 60 | $vuejsdemo->timemodified = time(); 61 | $vuejsdemo->id = $vuejsdemo->instance; 62 | 63 | $ret = $DB->update_record('vuejsdemo', $vuejsdemo); 64 | return $ret; 65 | } 66 | 67 | /** 68 | * Removes a vuejsdemo instance from the database. 69 | * 70 | * Given an ID of an instance of this module, 71 | * this function will permanently delete the instance 72 | * and any data that depends on it. 73 | * 74 | * @param int $id ID of the module instance. 75 | * @return boolean Success/Failure 76 | */ 77 | function vuejsdemo_delete_instance($id) { 78 | global $DB; 79 | 80 | // Check if an instance with this id exists. 81 | if (!$vuejsdemoinstance = $DB->get_record('vuejsdemo', array('id' => $id))) { 82 | return false; 83 | } 84 | 85 | $DB->delete_records('vuejsdemo', ['id' => $id]); 86 | $DB->delete_records('vuejsdemo_rooms', ['vuejsdemoid' => $id]); 87 | return true; 88 | } 89 | 90 | /** 91 | * @param string $feature FEATURE_xx constant for requested feature 92 | * @return bool True if feature is supported 93 | */ 94 | function vuejsdemo_supports($feature) { 95 | switch ($feature) { 96 | case FEATURE_GROUPS: 97 | return false; 98 | case FEATURE_GROUPINGS: 99 | return false; 100 | case FEATURE_MOD_INTRO: 101 | return true; 102 | case FEATURE_BACKUP_MOODLE2: 103 | return true; 104 | case FEATURE_SHOW_DESCRIPTION: 105 | return true; 106 | 107 | default: 108 | return null; 109 | } 110 | } 111 | 112 | /** 113 | * View or submit an mform. 114 | * 115 | * Returns the HTML to view an mform. 116 | * If form data is delivered and the data is valid, this returns 'ok'. 117 | * 118 | * @param $args 119 | * @return string 120 | * @throws moodle_exception 121 | */ 122 | function mod_vuejsdemo_output_fragment_mform($args) { 123 | $context = $args['context']; 124 | if ($context->contextlevel != CONTEXT_MODULE) { 125 | throw new \moodle_exception('fragment_mform_wrong_context', 'vuejsdemo'); 126 | } 127 | 128 | list($course, $coursemodule) = get_course_and_cm_from_cmid($context->instanceid, 'vuejsdemo'); 129 | $vuejsdemo = new \mod_vuejsdemo\vuejsdemo($coursemodule); 130 | 131 | $formdata = []; 132 | if (!empty($args['jsonformdata'])) { 133 | $serialiseddata = json_decode($args['jsonformdata']); 134 | if (is_string($serialiseddata)) { 135 | parse_str($serialiseddata, $formdata); 136 | } 137 | } 138 | 139 | $moreargs = (isset($args['moreargs'])) ? json_decode($args['moreargs']) : new stdClass; 140 | $formname = $args['form'] ?? ''; 141 | 142 | $form = \mod_vuejsdemo\form\form_controller::get_controller($formname, $vuejsdemo, $formdata, $moreargs); 143 | 144 | if ($form->success()) { 145 | $ret = 'ok'; 146 | if ($msg = $form->get_message()) { 147 | $ret .= ' ' . $msg; 148 | } 149 | return $ret; 150 | } else { 151 | return $form->render(); 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /vue/mform.js: -------------------------------------------------------------------------------- 1 | import Str from 'core/str'; 2 | import ModalFactory from 'core/modal_factory'; 3 | import ModalEvents from 'core/modal_events'; 4 | import Fragment from 'core/fragment'; 5 | import Notification from 'core/notification'; 6 | import Y from 'core/yui'; 7 | 8 | // Some of the code was taken from 9 | // https://docs.moodle.org/dev/MForm_Modal 10 | 11 | export class MFormModal { 12 | 13 | constructor(form, modalTitle, contextid, moreargs) { 14 | this.form = form; 15 | this.modalTitle = modalTitle; 16 | this.contextid = contextid; 17 | this.moreargs = moreargs; 18 | 19 | this.modal = null; 20 | this.formSubmittedSuccess = false; 21 | 22 | this.messageAfterSubmit = null; 23 | this.messageAfterSubmitDisplayed = false; 24 | 25 | this.isSubmitting = false; 26 | 27 | this.finished = new Promise((resolve, reject) => { 28 | // Promise should return True if form was submitted successfully and false if 29 | // form/modal was closed without submit. 30 | this._finishedResolve = resolve; 31 | this._finishedReject = reject; 32 | }); 33 | } 34 | 35 | async show() { 36 | this.modal = await ModalFactory.create({ 37 | type: ModalFactory.types.SAVE_CANCEL, 38 | title: this.modalTitle, 39 | body: this.getBody() 40 | }); 41 | 42 | // Forms are big, we want a big modal. 43 | this.modal.setLarge(); 44 | 45 | // We want to reset the form every time it is opened. 46 | this.modal.getRoot().on(ModalEvents.hidden, this.destroy.bind(this)); 47 | 48 | // We want to hide the submit buttons every time it is opened. 49 | this.modal.getRoot().on(ModalEvents.shown, function() { 50 | this.modal.getRoot().append(''); 51 | // Set save button text (call here because event bodyRendered is not fired when the modal is displayed for the first time). 52 | this.saveButtonText(); 53 | }.bind(this)); 54 | 55 | // We catch the modal save event, and use it to submit the form inside the modal. 56 | // Triggering a form submission will give JS validation scripts a chance to check for errors. 57 | this.modal.getRoot().on(ModalEvents.save, this.submitForm.bind(this)); 58 | // We also catch the form submit event and use it to submit the form with ajax. 59 | this.modal.getRoot().on('submit', 'form', this.submitFormAjax.bind(this)); 60 | 61 | // Set save button text. 62 | this.modal.getRoot().on(ModalEvents.bodyRendered, this.saveButtonText.bind(this)); 63 | 64 | this.modal.show(); 65 | } 66 | 67 | getBody(formdata) { 68 | if (typeof formdata === "undefined") { 69 | formdata = {}; 70 | } 71 | // Get the content of the modal. 72 | const params = { 73 | jsonformdata: JSON.stringify(formdata), 74 | form: this.form, 75 | moreargs: JSON.stringify(this.moreargs), 76 | }; 77 | 78 | return Fragment.loadFragment('mod_vuejsdemo', 'mform', this.contextid, params); 79 | } 80 | 81 | saveButtonText() { 82 | // Find the submit button in the form and adjust the modal's save button text. 83 | 84 | let tries = 3; 85 | 86 | let findTextAndSet = () => { 87 | if (tries <= 0) { 88 | // We did not found the button. Give up. 89 | return; 90 | } 91 | let button = this.modal.getRoot().find('input[name=submitbutton]'); 92 | if (button.length === 1 && button.attr('value')) { 93 | this.modal.setSaveButtonText(button.attr('value')); 94 | } else { 95 | // Button not found. Try again later. 96 | tries -= 1; 97 | setTimeout(findTextAndSet, 100); 98 | } 99 | }; 100 | 101 | // We have to wait here a moment because the browser has to render the html first. 102 | setTimeout(findTextAndSet, 2); 103 | } 104 | 105 | submitFormAjax(e) { 106 | // We don't want to do a real form submission. 107 | e.preventDefault(); 108 | 109 | if (this.isSubmitting) { 110 | // We are already submitting and waiting for the result. Do not allow to send again before 111 | // finishing the other request. 112 | return; 113 | } 114 | 115 | this.isSubmitting = true; 116 | 117 | // Convert all the form elements values to a serialised string. 118 | const formData = this.modal.getRoot().find('form').serialize(); 119 | 120 | let promiseBody = this.getBody(formData); 121 | promiseBody.then((html, js) => { 122 | this.isSubmitting = false; 123 | if (html.startsWith('ok')) { 124 | this.formSubmittedSuccess = true; 125 | if (html.length > 3) { 126 | this.messageAfterSubmit = html.substr(3); 127 | } 128 | this.destroy(); 129 | 130 | } else { 131 | this.modal.setBody(promiseBody); 132 | } 133 | }); 134 | promiseBody.fail((e) => { 135 | Notification.exception(e); 136 | this.isSubmitting = false; 137 | }); 138 | } 139 | 140 | /** 141 | * This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed. 142 | * 143 | * @method submitForm 144 | * @param {Event} e Form submission event. 145 | * @private 146 | */ 147 | submitForm(e) { 148 | e.preventDefault(); 149 | this.modal.getRoot().find('form').submit(); 150 | } 151 | 152 | destroy(graceful = true) { 153 | // Trigger event through promise. 154 | if (graceful) { 155 | this._finishedResolve(this.formSubmittedSuccess); 156 | } else { 157 | this._finishedReject(); 158 | } 159 | 160 | this.modal.hide(); 161 | Y.use('moodle-core-formchangechecker', function() { 162 | M.core_formchangechecker.reset_form_dirty_state(); 163 | }); 164 | this.modal.destroy(); 165 | 166 | if (graceful) { 167 | this.displayMessageAfterSubmit(); 168 | } 169 | } 170 | 171 | displayMessageAfterSubmit() { 172 | if (this.messageAfterSubmit && !this.messageAfterSubmitDisplayed) { 173 | this.messageAfterSubmitDisplayed = true; 174 | let modalPromise = ModalFactory.create({ 175 | type: ModalFactory.types.DEFAULT, 176 | title: this.modalTitle, 177 | body: this.messageAfterSubmit, 178 | }); 179 | modalPromise.then((modal) => { 180 | modal.show(); 181 | }); 182 | } 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /pix/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml 48 | 50 | 546 | 553 | 557 | 561 | 565 | 568 | 571 | 574 | 575 | 580 | 587 | 591 | 595 | 598 | 601 | 604 | 605 | 610 | 617 | 621 | 625 | 628 | 631 | 634 | 635 | 640 | 648 | 652 | 656 | 660 | 663 | 666 | 669 | 670 | 675 | 683 | 687 | 691 | 695 | 699 | 703 | 707 | 710 | 713 | 716 | 719 | 722 | 723 | 728 | 729 | 730 | 731 | -------------------------------------------------------------------------------- /amd/build/app-lazy.min.js: -------------------------------------------------------------------------------- 1 | define(["core/modal_factory","core/modal_events","core/notification","core/ajax","core/localstorage","jquery","core/fragment","core/yui","core/str"],function(t,e,n,r,o,i,a,s,c){return function(t){function e(e){for(var n,o,i=e[0],a=e[1],s=0,u=[];s=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return i(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function h(t){return null==t?"":Array.isArray(t)||l(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function m(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-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"===W),et=(X&&/chrome\/\d+/.test(X),X&&/phantomjs/.test(X),X&&X.match(/firefox\/(\d+)/)),nt={}.watch,rt=!1;if(K)try{var ot={};Object.defineProperty(ot,"passive",{get:function(){rt=!0}}),window.addEventListener("test-passive",null,ot)}catch(t){}var it=function(){return void 0===z&&(z=!K&&!G&&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=M,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(i&&!w(o,"default"))a=!1;else if(""===a||a===O(t)){var c=Ht(String,o.type);(c<0||s0&&(fe((u=t(u,(n||"")+"_"+c))[0])&&fe(f)&&(r[l]=_t(f.text+u[0].text),u.shift()),r.push.apply(r,u)):s(u)?fe(f)?r[l]=_t(f.text+u):""!==u&&r.push(_t(u)):fe(u)&&fe(f)?r[l]=_t(f.text+u.text):(a(e._isVList)&&i(u.tag)&&o(u.key)&&i(n)&&(u.key="__vlist"+n+"_"+c+"__"),r.push(u)));return r}(t):void 0}function fe(t){return i(t)&&i(t.text)&&!1===t.isComment}function pe(t,e){if(t){for(var n=Object.create(null),r=ut?Reflect.ownKeys(t):Object.keys(t),o=0;o0,a=t?!!t.$stable:!i,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&n&&n!==r&&s===n.$key&&!i&&!n.$hasNormal)return n;for(var c in o={},t)t[c]&&"$"!==c[0]&&(o[c]=me(e,c,t[c]))}else o={};for(var u in e)u in o||(o[u]=ye(e,u));return t&&Object.isExtensible(t)&&(t._normalized=o),V(o,"$stable",a),V(o,"$key",s),V(o,"$hasNormal",i),o}function me(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]:le(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 ye(t,e){return function(){return t[e]}}function ge(t,e){var n,r,o,a,s;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,o=t.length;rdocument.createEvent("Event").timeStamp&&(fn=function(){return pn.now()})}function dn(){var t,e;for(ln=fn(),cn=!0,rn.sort(function(t,e){return t.id-e.id}),un=0;unun&&rn[n].id>t.id;)n--;rn.splice(n+1,0,t)}else rn.push(t);sn||(sn=!0,ne(dn))}}(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){Vt(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 mn={enumerable:!0,configurable:!0,get:M,set:M};function yn(t,e,n){mn.get=function(){return this[e][n]},mn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,mn)}function gn(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props={},o=t.$options._propKeys=[];t.$parent&&kt(!1);var i=function(i){o.push(i);var a=Ft(i,e,n,t);St(r,i,a),i in t||yn(t,"_props",i)};for(var a in e)i(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]?M: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){ht();try{return t.call(e,e)}catch(t){return Vt(t,e,"data()"),{}}finally{vt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props,o=(t.$options.methods,n.length);for(;o--;){var i=n[o];0,r&&w(r,i)||(a=void 0,36!==(a=(i+"").charCodeAt(0))&&95!==a&&yn(t,"_data",i))}var a;Ot(e,!0)}(t):Ot(t._data={},!0),e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=it();for(var o in e){var i=e[o],a="function"==typeof i?i:i.get;0,r||(n[o]=new vn(t,a||M,M,_n)),o in t||bn(t,o,i)}}(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 o=0;o-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function En(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var a=n[i];if(a){var s=Sn(a.componentOptions);s&&!e(s)&&jn(n,i,r,o)}}}function jn(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,_(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=Cn++,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 o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Dt(kn(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&&Ze(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=de(e._renderChildren,o),t.$scopedSlots=r,t._c=function(e,n,r,o){return He(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return He(t,e,n,r,o,!0)};var i=n&&n.data;St(t,"$attrs",i&&i.attrs||r,null,!0),St(t,"$listeners",e._parentListeners||r,null,!0)}(e),nn(e,"beforeCreate"),function(t){var e=pe(t.$options.inject,t);e&&(kt(!1),Object.keys(e).forEach(function(n){St(t,n,e[n])}),kt(!0))}(e),gn(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),nn(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(An),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 xn(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){Vt(t,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(An),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var o=0,i=t.length;o1?T(e):e;for(var n=T(arguments,1),r='event handler for "'+t+'"',o=0,i=e.length;oparseInt(this.max)&&jn(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return B}};Object.defineProperty(t,"config",e),t.util={warn:lt,extend:E,mergeOptions:Dt,defineReactive:St},t.set=Tt,t.delete=Et,t.nextTick=ne,t.observable=function(t){return Ot(t),t},t.options=Object.create(null),F.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,E(t.options.components,Rn),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),On(t),function(t){F.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)}(An),Object.defineProperty(An.prototype,"$isServer",{get:it}),Object.defineProperty(An.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(An,"FunctionalRenderContext",{value:Re}),An.version="2.6.10";var In=m("style,class"),Ln=m("input,textarea,option,select,progress"),Nn=function(t,e,n){return"value"===n&&Ln(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Dn=m("contenteditable,draggable,spellcheck"),Pn=m("events,caret,typing,plaintext-only"),Fn=function(t,e){return qn(e)||"false"===e?"false":"contenteditable"===t&&Pn(e)?e:"true"},Un=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"),Bn="http://www.w3.org/1999/xlink",Hn=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Vn=function(t){return Hn(t)?t.slice(6,t.length):""},qn=function(t){return null==t||!1===t};function zn(t){for(var e=t.data,n=t,r=t;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Jn(r.data,e));for(;i(n=n.parent);)n&&n.data&&(e=Jn(e,n.data));return function(t,e){if(i(t)||i(e))return Kn(t,Gn(e));return""}(e.staticClass,e.class)}function Jn(t,e){return{staticClass:Kn(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Kn(t,e){return t?e?t+" "+e:t:e||""}function Gn(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r-1?_r(t,e,n):Un(e)?qn(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Dn(e)?t.setAttribute(e,Fn(e,n)):Hn(e)?qn(n)?t.removeAttributeNS(Bn,Vn(e)):t.setAttributeNS(Bn,e,n):_r(t,e,n)}function _r(t,e,n){if(qn(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 br={create:yr,update:yr};function wr(t,e){var n=e.elm,r=e.data,a=t.data;if(!(o(r.staticClass)&&o(r.class)&&(o(a)||o(a.staticClass)&&o(a.class)))){var s=zn(e),c=n._transitionClasses;i(c)&&(s=Kn(s,Gn(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var $r,xr,Cr,kr,Ar,Or,Sr={create:wr,update:wr},Tr=/[\w).+\-_$\]]/;function Er(t){var e,n,r,o,i,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(v=t.charAt(h));h--);v&&Tr.test(v)||(u=!0)}}else void 0===o?(d=r+1,o=t.slice(0,r).trim()):m();function m(){(i||(i=[])).push(t.slice(d,r).trim()),d=r+1}if(void 0===o?o=t.slice(0,r).trim():0!==d&&m(),i)for(r=0;r-1?{exp:t.slice(0,kr),key:'"'+t.slice(kr+1)+'"'}:{exp:t,key:null};xr=t,kr=Ar=Or=0;for(;!Kr();)Gr(Cr=Jr())?Xr(Cr):91===Cr&&Wr(Cr);return{exp:t.slice(0,Ar),key:t.slice(Ar+1,Or)}}(t);return null===n.key?t+"="+e:"$set("+n.exp+", "+n.key+", "+e+")"}function Jr(){return xr.charCodeAt(++kr)}function Kr(){return kr>=$r}function Gr(t){return 34===t||39===t}function Wr(t){var e=1;for(Ar=kr;!Kr();)if(Gr(t=Jr()))Xr(t);else if(91===t&&e++,93===t&&e--,0===e){Or=kr;break}}function Xr(t){for(var e=t;!Kr()&&(t=Jr())!==e;);}var Zr,Yr="__r",Qr="__c";function to(t,e,n){var r=Zr;return function o(){null!==e.apply(null,arguments)&&ro(t,o,n,r)}}var eo=Gt&&!(et&&Number(et[1])<=53);function no(t,e,n,r){if(eo){var o=ln,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}Zr.addEventListener(t,e,rt?{capture:n,passive:r}:n)}function ro(t,e,n,r){(r||Zr).removeEventListener(t,e._wrapper||e,n)}function oo(t,e){if(!o(t.data.on)||!o(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Zr=e.elm,function(t){if(i(t[Yr])){var e=Z?"change":"input";t[e]=[].concat(t[Yr],t[e]||[]),delete t[Yr]}i(t[Qr])&&(t.change=[].concat(t[Qr],t.change||[]),delete t[Qr])}(n),se(n,r,no,ro,to,e.context),Zr=void 0}}var io,ao={create:oo,update:oo};function so(t,e){if(!o(t.data.domProps)||!o(e.data.domProps)){var n,r,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};for(n in i(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=o(r)?"":String(r);co(a,u)&&(a.value=u)}else if("innerHTML"===n&&Zn(a.tagName)&&o(a.innerHTML)){(io=io||document.createElement("div")).innerHTML=""+r+"";for(var l=io.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 co(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(i(r)){if(r.number)return v(n)!==v(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var uo={create:so,update:so},lo=$(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 fo(t){var e=po(t.style);return t.staticStyle?E(t.staticStyle,e):e}function po(t){return Array.isArray(t)?j(t):"string"==typeof t?lo(t):t}var ho,vo=/^--/,mo=/\s*!important$/,yo=function(t,e,n){if(vo.test(e))t.style.setProperty(e,n);else if(mo.test(n))t.style.setProperty(O(e),n.replace(mo,""),"important");else{var r=_o(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split($o).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 Co(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split($o).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 ko(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&E(e,Ao(t.name||"v")),E(e,t),e}return"string"==typeof t?Ao(t):void 0}}var Ao=$(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"}}),Oo=K&&!Y,So="transition",To="animation",Eo="transition",jo="transitionend",Mo="animation",Ro="animationend";Oo&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Eo="WebkitTransition",jo="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Mo="WebkitAnimation",Ro="webkitAnimationEnd"));var Io=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Lo(t){Io(function(){Io(t)})}function No(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),xo(t,e))}function Do(t,e){t._transitionClasses&&_(t._transitionClasses,e),Co(t,e)}function Po(t,e,n){var r=Uo(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s=o===So?jo:Ro,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c0&&(n=So,l=a,f=i.length):e===To?u>0&&(n=To,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?So:To:null)?n===So?i.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===So&&Fo.test(r[Eo+"Property"])}}function Bo(t,e){for(;t.length1}function Ko(t,e){!0!==e.data.show&&Vo(e)}var Go=function(t){var e,n,r={},c=t.modules,u=t.nodeOps;for(e=0;eh?_(t,o(n[y+1])?null:n[y+1].elm,n,d,y,r):d>y&&w(0,e,p,h)}(p,m,y,n,l):i(y)?(i(t.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,n)):i(m)?w(0,m,0,m.length-1):i(t.text)&&u.setTextContent(p,""):t.text!==e.text&&u.setTextContent(p,e.text),i(h)&&i(d=h.hook)&&i(d=d.postpatch)&&d(t,e)}}}function k(t,e,n){if(a(n)&&i(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==i&&(a.selected=i);else if(L(Qo(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function Yo(t,e){return e.every(function(e){return!L(e,t)})}function Qo(t){return"_value"in t?t._value:t.value}function ti(t){t.target.composing=!0}function ei(t){t.target.composing&&(t.target.composing=!1,ni(t.target,"input"))}function ni(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function ri(t){return!t.componentInstance||t.data&&t.data.transition?t:ri(t.componentInstance._vnode)}var oi={model:Wo,show:{bind:function(t,e,n){var r=e.value,o=(n=ri(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,Vo(n,function(){t.style.display=i})):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=ri(n)).data&&n.data.transition?(n.data.show=!0,r?Vo(n,function(){t.style.display=t.__vOriginalDisplay}):qo(n,function(){t.style.display="none"})):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},ii={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 ai(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ai(Ke(e.children)):t}function si(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var i in o)e[C(i)]=o[i];return e}function ci(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var ui=function(t){return t.tag||Je(t)},li=function(t){return"show"===t.name},fi={name:"transition",props:ii,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(ui)).length){0;var r=this.mode;0;var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=ai(o);if(!i)return o;if(this._leaving)return ci(t,o);var a="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?a+"comment":a+i.tag:s(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var c=(i.data||(i.data={})).transition=si(this),u=this._vnode,l=ai(u);if(i.data.directives&&i.data.directives.some(li)&&(i.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,l)&&!Je(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=E({},c);if("out-in"===r)return this._leaving=!0,ce(f,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),ci(t,o);if("in-out"===r){if(Je(i))return u;var p,d=function(){p()};ce(c,"afterEnter",d),ce(c,"enterCancelled",d),ce(f,"delayLeave",function(t){p=t})}}return o}}},pi=E({tag:String,moveClass:String},ii);function di(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function hi(t){t.data.newPos=t.elm.getBoundingClientRect()}function vi(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+o+"px)",i.transitionDuration="0s"}}delete pi.mode;var mi={Transition:fi,TransitionGroup:{props:pi,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Qe(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),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,o=this.$slots.default||[],i=this.children=[],a=si(this),s=0;s-1?tr[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:tr[t]=/HTMLUnknownElement/.test(e.toString())},E(An.options.directives,oi),E(An.options.components,mi),An.prototype.__patch__=K?Go:M,An.prototype.$mount=function(t,e){return function(t,e,n){var r;return t.$el=e,t.$options.render||(t.$options.render=gt),nn(t,"beforeMount"),r=function(){t._update(t._render(),n)},new vn(t,r,M,{before:function(){t._isMounted&&!t._isDestroyed&&nn(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,nn(t,"mounted")),t}(this,t=t&&K?nr(t):void 0,e)},K&&setTimeout(function(){B.devtools&&at&&at.emit("init",An)},0);var yi=/\{\{((?:.|\r?\n)+?)\}\}/g,gi=/[-.*+?^${}()|[\]\/\\]/g,_i=$(function(t){var e=t[0].replace(gi,"\\$&"),n=t[1].replace(gi,"\\$&");return new RegExp(e+"((?:.|\\n)+?)"+n,"g")});var bi={staticKeys:["staticClass"],transformNode:function(t,e){e.warn;var n=Br(t,"class");n&&(t.staticClass=JSON.stringify(n));var r=Ur(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 wi,$i={staticKeys:["staticStyle"],transformNode:function(t,e){e.warn;var n=Br(t,"style");n&&(t.staticStyle=JSON.stringify(lo(n)));var r=Ur(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}},xi=function(t){return(wi=wi||document.createElement("div")).innerHTML=t,wi.textContent},Ci=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),ki=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Ai=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"),Oi=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Si=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ti="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+H.source+"]*",Ei="((?:"+Ti+"\\:)?"+Ti+")",ji=new RegExp("^<"+Ei),Mi=/^\s*(\/?)>/,Ri=new RegExp("^<\\/"+Ei+"[^>]*>"),Ii=/^]+>/i,Li=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Ui=/&(?:lt|gt|quot|amp|#39);/g,Bi=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Hi=m("pre,textarea",!0),Vi=function(t,e){return t&&Hi(t)&&"\n"===e[0]};function qi(t,e){var n=e?Bi:Ui;return t.replace(n,function(t){return Fi[t]})}var zi,Ji,Ki,Gi,Wi,Xi,Zi,Yi,Qi=/^@|^v-on:/,ta=/^v-|^@|^:/,ea=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,na=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ra=/^\(|\)$/g,oa=/^\[.*\]$/,ia=/:(.*)$/,aa=/^:|^\.|^v-bind:/,sa=/\.[^.\]]+(?=[^\]]*$)/g,ca=/^v-slot(:|$)|^#/,ua=/[\r\n]/,la=/\s+/g,fa=$(xi),pa="_empty_";function da(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:ba(e),rawAttrsMap:{},parent:n,children:[]}}function ha(t,e){zi=e.warn||Mr,Xi=e.isPreTag||R,Zi=e.mustUseProp||R,Yi=e.getTagNamespace||R;var n=e.isReservedTag||R;(function(t){return!!t.component||!n(t.tag)}),Ki=Rr(e.modules,"transformNode"),Gi=Rr(e.modules,"preTransformNode"),Wi=Rr(e.modules,"postTransformNode"),Ji=e.delimiters;var r,o,i=[],a=!1!==e.preserveWhitespace,s=e.whitespace,c=!1,u=!1;function l(t){if(f(t),c||t.processed||(t=va(t,e)),i.length||t===r||r.if&&(t.elseif||t.else)&&ya(r,{exp:t.elseif,block:t}),o&&!t.forbidden)if(t.elseif||t.else)a=t,(s=function(t){var e=t.length;for(;e--;){if(1===t[e].type)return t[e];t.pop()}}(o.children))&&s.if&&ya(s,{exp:a.elseif,block:a});else{if(t.slotScope){var n=t.slotTarget||'"default"';(o.scopedSlots||(o.scopedSlots={}))[n]=t}o.children.push(t),t.parent=o}var a,s;t.children=t.children.filter(function(t){return!t.slotScope}),f(t),t.pre&&(c=!1),Xi(t.tag)&&(u=!1);for(var l=0;l]*>)","i")),p=t.replace(f,function(t,n,r){return u=r.length,Di(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),Vi(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(Li.test(t)){var h=t.indexOf("--\x3e");if(h>=0){e.shouldKeepComment&&e.comment(t.substring(4,h),c,c+h+3),x(h+3);continue}}if(Ni.test(t)){var v=t.indexOf("]>");if(v>=0){x(v+2);continue}}var m=t.match(Ii);if(m){x(m[0].length);continue}var y=t.match(Ri);if(y){var g=c;x(y[0].length),A(y[1],g,c);continue}var _=C();if(_){k(_),Vi(_.tagName,t)&&x(1);continue}}var b=void 0,w=void 0,$=void 0;if(d>=0){for(w=t.slice(d);!(Ri.test(w)||ji.test(w)||Li.test(w)||Ni.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(ji);if(e){var n,r,o={tagName:e[1],attrs:[],start:c};for(x(e[0].length);!(n=t.match(Mi))&&(r=t.match(Si)||t.match(Oi));)r.start=c,x(r[0].length),r.end=c,o.attrs.push(r);if(n)return o.unarySlash=n[1],x(n[0].length),o.end=c,o}}function k(t){var n=t.tagName,c=t.unarySlash;i&&("p"===r&&Ai(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&&o[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=o.length-1;u>=a;u--)e.end&&e.end(o[u].tag,n,i);o.length=a,r=a&&o[a-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,i):"p"===s&&(e.start&&e.start(t,[],!1,n,i),e.end&&e.end(t,n,i))}A()}(t,{warn:zi,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=o&&o.ns||Yi(t);Z&&"svg"===p&&(n=function(t){for(var e=[],n=0;nc&&(s.push(i=t.slice(c,o)),a.push(JSON.stringify(i)));var u=Er(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=o+r[0].length}return c-1"+("true"===i?":("+e+")":":_q("+e+","+i+")")),Fr(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+i+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+o+")":o)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+zr(e,"$$a.concat([$$v])")+")}else{$$i>-1&&("+zr(e,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+zr(e,"$$c")+"}",null,!0)}(t,r,o);else if("input"===i&&"radio"===a)!function(t,e,n){var r=n&&n.number,o=Ur(t,"value")||"null";Ir(t,"checked","_q("+e+","+(o=r?"_n("+o+")":o)+")"),Fr(t,"change",zr(e,o),null,!0)}(t,r,o);else if("input"===i||"textarea"===i)!function(t,e,n){var r=t.attrsMap.type,o=n||{},i=o.lazy,a=o.number,s=o.trim,c=!i&&"range"!==r,u=i?"change":"range"===r?Yr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=zr(e,l);c&&(f="if($event.target.composing)return;"+f),Ir(t,"value","("+e+")"),Fr(t,u,f,null,!0),(s||a)&&Fr(t,"blur","$forceUpdate()")}(t,r,o);else if(!B.isReservedTag(i))return qr(t,r,o),!1;return!0},text:function(t,e){e.value&&Ir(t,"textContent","_s("+e.value+")",e)},html:function(t,e){e.value&&Ir(t,"innerHTML","_s("+e.value+")",e)}},isPreTag:function(t){return"pre"===t},isUnaryTag:Ci,mustUseProp:Nn,canBeLeftOpenTag:ki,isReservedTag:Yn,getTagNamespace:Qn,staticKeys:function(t){return t.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")}(Ca)},Sa=$(function(t){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))});function Ta(t,e){t&&(ka=Sa(e.staticKeys||""),Aa=e.isReservedTag||R,function t(e){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)||!Aa(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(ka)))}(e);if(1===e.type){if(!Aa(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var n=0,r=e.children.length;n|^function\s*(?:[\w$]+)?\s*\(/,ja=/\([^)]*?\);*$/,Ma=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ra={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ia={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"]},La=function(t){return"if("+t+")return null;"},Na={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:La("$event.target !== $event.currentTarget"),ctrl:La("!$event.ctrlKey"),shift:La("!$event.shiftKey"),alt:La("!$event.altKey"),meta:La("!$event.metaKey"),left:La("'button' in $event && $event.button !== 0"),middle:La("'button' in $event && $event.button !== 1"),right:La("'button' in $event && $event.button !== 2")};function Da(t,e){var n=e?"nativeOn:":"on:",r="",o="";for(var i in t){var a=Pa(t[i]);t[i]&&t[i].dynamic?o+=i+","+a+",":r+='"'+i+'":'+a+","}return r="{"+r.slice(0,-1)+"}",o?n+"_d("+r+",["+o.slice(0,-1)+"])":n+r}function Pa(t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return Pa(t)}).join(",")+"]";var e=Ma.test(t.value),n=Ea.test(t.value),r=Ma.test(t.value.replace(ja,""));if(t.modifiers){var o="",i="",a=[];for(var s in t.modifiers)if(Na[s])i+=Na[s],Ra[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;i+=La(["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&&(o+=function(t){return"if(!$event.type.indexOf('key')&&"+t.map(Fa).join("&&")+")return null;"}(a)),i&&(o+=i),"function($event){"+o+(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 Fa(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=Ra[t],r=Ia[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ua={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:M},Ba=function(t){this.options=t,this.warn=t.warn||Mr,this.transforms=Rr(t.modules,"transformCode"),this.dataGenFns=Rr(t.modules,"genData"),this.directives=E(E({},Ua),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 Ha(t,e){var n=new Ba(e);return{render:"with(this){return "+(t?Va(t,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Va(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return qa(t,e);if(t.once&&!t.onceProcessed)return za(t,e);if(t.for&&!t.forProcessed)return Ka(t,e);if(t.if&&!t.ifProcessed)return Ja(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return function(t,e){var n=t.slotName||'"default"',r=Za(t,e),o="_t("+n+(r?","+r:""),i=t.attrs||t.dynamicAttrs?ts((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"];!i&&!a||r||(o+=",null");i&&(o+=","+i);a&&(o+=(i?"":",null")+","+a);return o+")"}(t,e);var n;if(t.component)n=function(t,e,n){var r=e.inlineTemplate?null:Za(e,n,!0);return"_c("+t+","+Ga(e,n)+(r?","+r:"")+")"}(t.component,t,e);else{var r;(!t.plain||t.pre&&e.maybeComponent(t))&&(r=Ga(t,e));var o=t.inlineTemplate?null:Za(t,e,!0);n="_c('"+t.tag+"'"+(r?","+r:"")+(o?","+o:"")+")"}for(var i=0;i>>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 i=function(t,e){var n=t.children[0];0;if(n&&1===n.type){var r=Ha(n,e.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(t){return"function(){"+t+"}"}).join(",")+"]}"}}(t,e);i&&(n+=i+",")}return n=n.replace(/,$/,"")+"}",t.dynamicAttrs&&(n="_b("+n+',"'+t.tag+'",'+ts(t.dynamicAttrs)+")"),t.wrapData&&(n=t.wrapData(n)),t.wrapListeners&&(n=t.wrapListeners(n)),n}function Wa(t){return 1===t.type&&("slot"===t.tag||t.children.some(Wa))}function Xa(t,e){var n=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!n)return Ja(t,e,Xa,"null");if(t.for&&!t.forProcessed)return Ka(t,e,Xa);var r=t.slotScope===pa?"":String(t.slotScope),o="function("+r+"){return "+("template"===t.tag?t.if&&n?"("+t.if+")?"+(Za(t,e)||"undefined")+":undefined":Za(t,e)||"undefined":Va(t,e))+"}",i=r?"":",proxy:true";return"{key:"+(t.slotTarget||'"default"')+",fn:"+o+i+"}"}function Za(t,e,n,r,o){var i=t.children;if(i.length){var a=i[0];if(1===i.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?e.maybeComponent(a)?",1":",0":"";return""+(r||Va)(a,e)+s}var c=n?function(t,e){for(var n=0,r=0;r':'
',is.innerHTML.indexOf(" ")>0}var us=!!K&&cs(!1),ls=!!K&&cs(!0),fs=$(function(t){var e=nr(t);return e&&e.innerHTML}),ps=An.prototype.$mount;An.prototype.$mount=function(t,e){if((t=t&&nr(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=fs(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 o=ss(r,{outputSourceRange:!1,shouldDecodeNewlines:us,shouldDecodeNewlinesForHref:ls,delimiters:n.delimiters,comments:n.comments},this),i=o.render,a=o.staticRenderFns;n.render=i,n.staticRenderFns=a}}return ps.call(this,t,e)},An.compile=ss,e.a=An}).call(this,n(6),n(12).setImmediate)},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";function r(t,e,n,r,o,i,a,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):o&&(c=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},function(t,e,n){var r=n(17);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);(0,n(20).default)("18b677a4",r,!0,{})},function(t,e){t.exports=n},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){t.exports=r},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e){t.exports=a},function(t,e){t.exports=s},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.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(13),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(6))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,o,i,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(){h(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?((i=new MessageChannel).port1.onmessage=function(t){h(t.data)},r=function(t){i.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(t){var e=f.createElement("script");e.onreadystatechange=function(){h(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):r=function(t){setTimeout(h,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&h(+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;n-1}function i(t,e){for(var n in e)t[n]=e[n];return t}var a={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,r=e.children,o=e.parent,a=e.data;a.routerView=!0;for(var s=o.$createElement,c=n.name,u=o.$route,l=o._routerViewCache||(o._routerViewCache={}),f=0,p=!1;o&&o._routerRoot!==o;){var d=o.$vnode&&o.$vnode.data;d&&(d.routerView&&f++,d.keepAlive&&o._inactive&&(p=!0)),o=o.$parent}if(a.routerViewDepth=f,p)return s(l[c],a,r);var h=u.matched[f];if(!h)return l[c]=null,s();var v=l[c]=h.components[c];a.registerRouteInstance=function(t,e){var n=h.instances[c];(e&&n!==t||!e&&n===t)&&(h.instances[c]=e)},(a.hook||(a.hook={})).prepatch=function(t,e){h.instances[c]=e.componentInstance},a.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==h.instances[c]&&(h.instances[c]=t.componentInstance)};var m=a.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}}(u,h.props&&h.props[c]);if(m){m=a.props=i({},m);var y=a.attrs=a.attrs||{};for(var g in m)v.props&&g in v.props||(y[g]=m[g],delete m[g])}return s(v,a,r)}};var s=/[!'()*]/g,c=function(t){return"%"+t.charCodeAt(0).toString(16)},u=/%2C/g,l=function(t){return encodeURIComponent(t).replace(s,c).replace(u,",")},f=decodeURIComponent;function p(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var n=t.replace(/\+/g," ").split("="),r=f(n.shift()),o=n.length>0?f(n.join("=")):null;void 0===e[r]?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}),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 l(e);if(Array.isArray(n)){var r=[];return n.forEach(function(t){void 0!==t&&(null===t?r.push(l(e)):r.push(l(e)+"="+l(t)))}),r.join("&")}return l(e)+"="+l(n)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var h=/\/?$/;function v(t,e,n,r){var o=r&&r.options.stringifyQuery,i=e.query||{};try{i=m(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:_(e,o),matched:t?g(t):[]};return n&&(a.redirectedFrom=_(n,o)),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=v(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 o=t.hash;return void 0===o&&(o=""),(n||"/")+(e||d)(r)+o}function b(t,e){return e===y?t===e:!!e&&(t.path&&e.path?t.path.replace(h,"")===e.path.replace(h,"")&&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],o=e[n];return"object"==typeof r&&"object"==typeof o?w(r,o):String(r)===String(o)})}var $,x=[String,Object],C=[String,Array],k={name:"RouterLink",props:{to:{type:x,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:C,default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,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=a.path?v(null,a,null,n):s;u[y]=b(r,g),u[m]=this.exact?u[y]:function(t,e){return 0===t.path.replace(h,"/").indexOf(e.path.replace(h,"/"))&&(!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)}(r,g);var _=function(t){A(t)&&(e.replace?n.replace(a):n.push(a))},w={click:A};Array.isArray(this.event)?this.event.forEach(function(t){w[t]=_}):w[this.event]=_;var $={class:u};if("a"===this.tag)$.on=w,$.attrs={href:c};else{var x=function t(e){if(e)for(var n,r=0;r=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(o.path||""),u=e&&e.path||"/",l=c.path?S(c.path,u,n||o.append):u,f=function(t,e,n){void 0===e&&(e={});var r,o=n||p;try{r=o(t||"")}catch(t){r={}}for(var i in e)r[i]=e[i];return r}(c.query,o.query,r&&r.options.parseQuery),d=o.hash||c.hash;return d&&"#"!==d.charAt(0)&&(d="#"+d),{_normalized:!0,path:l,query:f,hash:d}}function Y(t,e){var n=W(t),r=n.pathList,o=n.pathMap,i=n.nameMap;function a(t,n,a){var s=Z(t,n,!1,e),u=s.name;if(u){var l=i[u];if(!l)return c(null,s);var f=l.regex.keys.filter(function(t){return!t.optional}).map(function(t){return t.name});if("object"!=typeof s.params&&(s.params={}),n&&"object"==typeof n.params)for(var p in n.params)!(p in s.params)&&f.indexOf(p)>-1&&(s.params[p]=n.params[p]);if(l)return s.path=G(l.path,s.params),c(l,s,a)}else if(s.path){s.params={};for(var d=0;d=t.length?n():t[o]?e(t[o],function(){r(o+1)}):r(o+1)};r(0)}function yt(t){return function(e,n,r){var i=!1,a=0,s=null;gt(t,function(t,n,c,u){if("function"==typeof t&&void 0===t.cid){i=!0,a++;var l,f=wt(function(n){var o;((o=n).__esModule||bt&&"Module"===o[Symbol.toStringTag])&&(n=n.default),t.resolved="function"==typeof n?n:$.extend(n),c.components[u]=n,--a<=0&&r(e)}),p=wt(function(t){var e="Failed to resolve async component "+u+": "+t;s||(s=o(t)?t:new Error(e),r(s))});try{l=t(f,p)}catch(t){p(t)}if(l)if("function"==typeof l.then)l.then(f,p);else{var d=l.component;d&&"function"==typeof d.then&&d.then(f,p)}}}),i||r()}}function gt(t,e){return _t(t.map(function(t){return Object.keys(t.components).map(function(n){return e(t.components[n],t.instances[n],t,n)})}))}function _t(t){return Array.prototype.concat.apply([],t)}var bt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function wt(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 $t=function(t,e){this.router=t,this.base=function(t){if(!t)if(O){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=[]};function xt(t,e,n,r){var o=gt(t,function(t,r,o,i){var a=function(t,e){"function"!=typeof t&&(t=$.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map(function(t){return n(t,r,o,i)}):n(a,r,o,i)});return _t(r?o.reverse():o)}function Ct(t,e){if(e)return function(){return t.apply(e,arguments)}}$t.prototype.listen=function(t){this.cb=t},$t.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},$t.prototype.onError=function(t){this.errorCbs.push(t)},$t.prototype.transitionTo=function(t,e,n){var r=this,o=this.router.match(t,this.current);this.confirmTransition(o,function(){r.updateRoute(o),e&&e(o),r.ensureURL(),r.ready||(r.ready=!0,r.readyCbs.forEach(function(t){t(o)}))},function(t){n&&n(t),t&&!r.ready&&(r.ready=!0,r.readyErrorCbs.forEach(function(e){e(t)}))})},$t.prototype.confirmTransition=function(t,e,n){var r=this,i=this.current,a=function(t){o(t)&&(r.errorCbs.length?r.errorCbs.forEach(function(e){e(t)}):console.error(t)),n&&n(t)};if(b(t,i)&&t.matched.length===i.matched.length)return this.ensureURL(),a();var s=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n-1?decodeURI(t.slice(0,r))+t.slice(r):decodeURI(t)}else n>-1&&(t=decodeURI(t.slice(0,n))+t.slice(n));return t}function Et(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function jt(t){ut?ht(Et(t)):window.location.hash=t}function Mt(t){ut?vt(Et(t)):window.location.replace(Et(t))}var Rt=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)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}($t),It=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Y(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ut&&!1!==t.fallback,this.fallback&&(e="hash"),O||(e="abstract"),this.mode=e,e){case"history":this.history=new kt(this,t.base);break;case"hash":this.history=new Ot(this,t.base,this.fallback);break;case"abstract":this.history=new Rt(this,t.base);break;default:0}},Lt={currentRoute:{configurable:!0}};function Nt(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}It.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},Lt.currentRoute.get=function(){return this.history&&this.history.current},It.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)}),!this.app){this.app=t;var n=this.history;if(n instanceof kt)n.transitionTo(n.getCurrentLocation());else if(n instanceof Ot){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},It.prototype.beforeEach=function(t){return Nt(this.beforeHooks,t)},It.prototype.beforeResolve=function(t){return Nt(this.resolveHooks,t)},It.prototype.afterEach=function(t){return Nt(this.afterHooks,t)},It.prototype.onReady=function(t,e){this.history.onReady(t,e)},It.prototype.onError=function(t){this.history.onError(t)},It.prototype.push=function(t,e,n){this.history.push(t,e,n)},It.prototype.replace=function(t,e,n){this.history.replace(t,e,n)},It.prototype.go=function(t){this.history.go(t)},It.prototype.back=function(){this.go(-1)},It.prototype.forward=function(){this.go(1)},It.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]})})):[]},It.prototype.resolve=function(t,e,n){var r=Z(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?T(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}},It.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==y&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(It.prototype,Lt),It.install=function t(e){if(!t.installed||$!==e){t.installed=!0,$=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",a),e.component("RouterLink",k);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},It.version="3.0.5",O&&window.Vue&&window.Vue.use(It);var Dt=It; 13 | /** 14 | * vuex v3.1.0 15 | * (c) 2019 Evan You 16 | * @license MIT 17 | */var Pt="undefined"!=typeof window&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function Ft(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}var Ut=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"==typeof n?n():n)||{}},Bt={namespaced:{configurable:!0}};Bt.namespaced.get=function(){return!!this._rawModule.namespaced},Ut.prototype.addChild=function(t,e){this._children[t]=e},Ut.prototype.removeChild=function(t){delete this._children[t]},Ut.prototype.getChild=function(t){return this._children[t]},Ut.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},Ut.prototype.forEachChild=function(t){Ft(this._children,t)},Ut.prototype.forEachGetter=function(t){this._rawModule.getters&&Ft(this._rawModule.getters,t)},Ut.prototype.forEachAction=function(t){this._rawModule.actions&&Ft(this._rawModule.actions,t)},Ut.prototype.forEachMutation=function(t){this._rawModule.mutations&&Ft(this._rawModule.mutations,t)},Object.defineProperties(Ut.prototype,Bt);var Ht=function(t){this.register([],t,!1)};Ht.prototype.get=function(t){return t.reduce(function(t,e){return t.getChild(e)},this.root)},Ht.prototype.getNamespace=function(t){var e=this.root;return t.reduce(function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")},"")},Ht.prototype.update=function(t){!function t(e,n,r){0;n.update(r);if(r.modules)for(var o in r.modules){if(!n.getChild(o))return void 0;t(e.concat(o),n.getChild(o),r.modules[o])}}([],this.root,t)},Ht.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var o=new Ut(e,n);0===t.length?this.root=o:this.get(t.slice(0,-1)).addChild(t[t.length-1],o);e.modules&&Ft(e.modules,function(e,o){r.register(t.concat(o),e,n)})},Ht.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];e.getChild(n).runtime&&e.removeChild(n)};var Vt;var qt=function(t){var e=this;void 0===t&&(t={}),!Vt&&"undefined"!=typeof window&&window.Vue&&Yt(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var r=t.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Ht(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new Vt;var o=this,i=this.dispatch,a=this.commit;this.dispatch=function(t,e){return i.call(o,t,e)},this.commit=function(t,e,n){return a.call(o,t,e,n)},this.strict=r;var s=this._modules.root.state;Wt(this,s,[],this._modules.root),Gt(this,s),n.forEach(function(t){return t(e)}),(void 0!==t.devtools?t.devtools:Vt.config.devtools)&&function(t){Pt&&(t._devtoolHook=Pt,Pt.emit("vuex:init",t),Pt.on("vuex:travel-to-state",function(e){t.replaceState(e)}),t.subscribe(function(t,e){Pt.emit("vuex:mutation",t,e)}))}(this)},zt={state:{configurable:!0}};function Jt(t,e){return e.indexOf(t)<0&&e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function Kt(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;Wt(t,n,[],t._modules.root,!0),Gt(t,n,e)}function Gt(t,e,n){var r=t._vm;t.getters={};var o=t._wrappedGetters,i={};Ft(o,function(e,n){i[n]=function(){return e(t)},Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})});var a=Vt.config.silent;Vt.config.silent=!0,t._vm=new Vt({data:{$$state:e},computed:i}),Vt.config.silent=a,t.strict&&function(t){t._vm.$watch(function(){return this._data.$$state},function(){0},{deep:!0,sync:!0})}(t),r&&(n&&t._withCommit(function(){r._data.$$state=null}),Vt.nextTick(function(){return r.$destroy()}))}function Wt(t,e,n,r,o){var i=!n.length,a=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[a]=r),!i&&!o){var s=Xt(e,n.slice(0,-1)),c=n[n.length-1];t._withCommit(function(){Vt.set(s,c,r.state)})}var u=r.context=function(t,e,n){var r=""===e,o={dispatch:r?t.dispatch:function(n,r,o){var i=Zt(n,r,o),a=i.payload,s=i.options,c=i.type;return s&&s.root||(c=e+c),t.dispatch(c,a)},commit:r?t.commit:function(n,r,o){var i=Zt(n,r,o),a=i.payload,s=i.options,c=i.type;s&&s.root||(c=e+c),t.commit(c,a,s)}};return Object.defineProperties(o,{getters:{get:r?function(){return t.getters}:function(){return function(t,e){var n={},r=e.length;return Object.keys(t.getters).forEach(function(o){if(o.slice(0,r)===e){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return t.getters[o]},enumerable:!0})}}),n}(t,e)}},state:{get:function(){return Xt(t.state,n)}}}),o}(t,a,n);r.forEachMutation(function(e,n){!function(t,e,n,r){(t._mutations[e]||(t._mutations[e]=[])).push(function(e){n.call(t,r.state,e)})}(t,a+n,e,u)}),r.forEachAction(function(e,n){var r=e.root?n:a+n,o=e.handler||e;!function(t,e,n,r){(t._actions[e]||(t._actions[e]=[])).push(function(e,o){var i,a=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e,o);return(i=a)&&"function"==typeof i.then||(a=Promise.resolve(a)),t._devtoolHook?a.catch(function(e){throw t._devtoolHook.emit("vuex:error",e),e}):a})}(t,r,o,u)}),r.forEachGetter(function(e,n){!function(t,e,n,r){if(t._wrappedGetters[e])return void 0;t._wrappedGetters[e]=function(t){return n(r.state,r.getters,t.state,t.getters)}}(t,a+n,e,u)}),r.forEachChild(function(r,i){Wt(t,e,n.concat(i),r,o)})}function Xt(t,e){return e.length?e.reduce(function(t,e){return t[e]},t):t}function Zt(t,e,n){var r;return null!==(r=t)&&"object"==typeof r&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function Yt(t){Vt&&t===Vt||function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(Vt=t)}zt.state.get=function(){return this._vm._data.$$state},zt.state.set=function(t){0},qt.prototype.commit=function(t,e,n){var r=this,o=Zt(t,e,n),i=o.type,a=o.payload,s=(o.options,{type:i,payload:a}),c=this._mutations[i];c&&(this._withCommit(function(){c.forEach(function(t){t(a)})}),this._subscribers.forEach(function(t){return t(s,r.state)}))},qt.prototype.dispatch=function(t,e){var n=this,r=Zt(t,e),o=r.type,i=r.payload,a={type:o,payload:i},s=this._actions[o];if(s){try{this._actionSubscribers.filter(function(t){return t.before}).forEach(function(t){return t.before(a,n.state)})}catch(t){0}return(s.length>1?Promise.all(s.map(function(t){return t(i)})):s[0](i)).then(function(t){try{n._actionSubscribers.filter(function(t){return t.after}).forEach(function(t){return t.after(a,n.state)})}catch(t){0}return t})}},qt.prototype.subscribe=function(t){return Jt(t,this._subscribers)},qt.prototype.subscribeAction=function(t){return Jt("function"==typeof t?{before:t}:t,this._actionSubscribers)},qt.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch(function(){return t(r.state,r.getters)},e,n)},qt.prototype.replaceState=function(t){var e=this;this._withCommit(function(){e._vm._data.$$state=t})},qt.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),Wt(this,this.state,t,this._modules.get(t),n.preserveState),Gt(this,this.state)},qt.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var n=Xt(e.state,t.slice(0,-1));Vt.delete(n,t[t.length-1])}),Kt(this)},qt.prototype.hotUpdate=function(t){this._modules.update(t),Kt(this,!0)},qt.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(qt.prototype,zt);var Qt=oe(function(t,e){var n={};return re(e).forEach(function(e){var r=e.key,o=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=ie(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"==typeof o?o.call(this,e,n):e[o]},n[r].vuex=!0}),n}),te=oe(function(t,e){var n={};return re(e).forEach(function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.commit;if(t){var i=ie(this.$store,"mapMutations",t);if(!i)return;r=i.context.commit}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}}),n}),ee=oe(function(t,e){var n={};return re(e).forEach(function(e){var r=e.key,o=e.val;o=t+o,n[r]=function(){if(!t||ie(this.$store,"mapGetters",t))return this.$store.getters[o]},n[r].vuex=!0}),n}),ne=oe(function(t,e){var n={};return re(e).forEach(function(e){var r=e.key,o=e.val;n[r]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var i=ie(this.$store,"mapActions",t);if(!i)return;r=i.context.dispatch}return"function"==typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}}),n});function re(t){return Array.isArray(t)?t.map(function(t){return{key:t,val:t}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}})}function oe(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function ie(t,e,n){return t._modulesNamespaceMap[n]}var ae={Store:qt,install:Yt,version:"3.1.0",mapState:Qt,mapMutations:te,mapGetters:ee,mapActions:ne,createNamespacedHelpers:function(t){return{mapState:Qt.bind(null,t),mapGetters:ee.bind(null,t),mapMutations:te.bind(null,t),mapActions:ne.bind(null,t)}}},se=n(7),ce=n.n(se),ue=n(8),le=n.n(ue),fe=n(5),pe=n.n(fe),de=n(9),he=n.n(de);r.a.use(ae);const ve=new ae.Store({state:{courseModuleID:0,contextID:0,strings:{},rooms:null},mutations:{setCourseModuleID(t,e){t.courseModuleID=e},setContextID(t,e){t.contextID=e},setRooms(t,e){t.rooms=e},setStrings(t,e){t.strings=e}},actions:{async loadComponentStrings(t){const e=he()("html").attr("lang").replace(/-/g,"_"),n="mod_vuejsdemo/strings/"+e,r=le.a.get(n);if(r)t.commit("setStrings",JSON.parse(r));else{const r={methodname:"core_get_component_strings",args:{component:"mod_vuejsdemo",lang:e}},o=await ce.a.call([r])[0];let i={};o.forEach(t=>{i[t.stringid]=t.string}),t.commit("setStrings",i),le.a.set(n,JSON.stringify(i))}},async fetchRooms(t){const e=await async function(t,e){const n={methodname:t,args:Object.assign({coursemoduleid:ve.state.courseModuleID},e)};try{return await ce.a.call([n])[0]}catch(t){throw pe.a.exception(t),t}}("mod_vuejsdemo_get_rooms");t.commit("setRooms",e)}}});var me={name:"not-found",computed:Qt(["strings"]),created:function(){}},ye=n(3),ge=Object(ye.a)(me,function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"not-found"},[e("h3",[this._v(this._s(this.strings.route_not_found))])])},[],!1,null,"1f3ed8fe",null).exports,_e=(n(15),n(1)),be=n.n(_e),we=n(2),$e=n.n(we),xe=n(10),Ce=n.n(xe),ke=n(11),Ae=n.n(ke);class Oe{constructor(t,e,n,r){this.form=t,this.modalTitle=e,this.contextid=n,this.moreargs=r,this.modal=null,this.formSubmittedSuccess=!1,this.messageAfterSubmit=null,this.messageAfterSubmitDisplayed=!1,this.isSubmitting=!1,this.finished=new Promise((t,e)=>{this._finishedResolve=t,this._finishedReject=e})}async show(){this.modal=await be.a.create({type:be.a.types.SAVE_CANCEL,title:this.modalTitle,body:this.getBody()}),this.modal.setLarge(),this.modal.getRoot().on($e.a.hidden,this.destroy.bind(this)),this.modal.getRoot().on($e.a.shown,function(){this.modal.getRoot().append(""),this.saveButtonText()}.bind(this)),this.modal.getRoot().on($e.a.save,this.submitForm.bind(this)),this.modal.getRoot().on("submit","form",this.submitFormAjax.bind(this)),this.modal.getRoot().on($e.a.bodyRendered,this.saveButtonText.bind(this)),this.modal.show()}getBody(t){void 0===t&&(t={});const e={jsonformdata:JSON.stringify(t),form:this.form,moreargs:JSON.stringify(this.moreargs)};return Ce.a.loadFragment("mod_vuejsdemo","mform",this.contextid,e)}saveButtonText(){let t=3,e=()=>{if(t<=0)return;let n=this.modal.getRoot().find("input[name=submitbutton]");1===n.length&&n.attr("value")?this.modal.setSaveButtonText(n.attr("value")):(t-=1,setTimeout(e,100))};setTimeout(e,2)}submitFormAjax(t){if(t.preventDefault(),this.isSubmitting)return;this.isSubmitting=!0;const e=this.modal.getRoot().find("form").serialize();let n=this.getBody(e);n.then((t,e)=>{this.isSubmitting=!1,t.startsWith("ok")?(this.formSubmittedSuccess=!0,t.length>3&&(this.messageAfterSubmit=t.substr(3)),this.destroy()):this.modal.setBody(n)}),n.fail(t=>{pe.a.exception(t),this.isSubmitting=!1})}submitForm(t){t.preventDefault(),this.modal.getRoot().find("form").submit()}destroy(t=!0){t?this._finishedResolve(this.formSubmittedSuccess):this._finishedReject(),this.modal.hide(),Ae.a.use("moodle-core-formchangechecker",function(){M.core_formchangechecker.reset_form_dirty_state()}),this.modal.destroy(),t&&this.displayMessageAfterSubmit()}displayMessageAfterSubmit(){if(this.messageAfterSubmit&&!this.messageAfterSubmitDisplayed){this.messageAfterSubmitDisplayed=!0,be.a.create({type:be.a.types.DEFAULT,title:this.modalTitle,body:this.messageAfterSubmit}).then(t=>{t.show()})}}}var Se={name:"rooms-edit",data:function(){return{modal:null}},computed:Qt(["strings","rooms"]),methods:{async showForm(t=null){let e="",n={};t?(e=this.strings.room_form_title_edit,n.roomid=t):e=this.strings.room_form_title_add,this.modal=new Oe("room_edit",e,this.$store.state.contextID,n);try{await this.modal.show(),await this.modal.finished&&this.$store.dispatch("fetchRooms"),this.$router.push({name:"rooms-edit-overview"})}catch(t){}finally{this.modal=null}},checkRoute(t){this.modal&&this.modal.destroy(!1),"room-edit"===t.name?this.$nextTick(this.showForm.bind(this,t.params.roomId)):"room-new"===t.name&&this.$nextTick(this.showForm.bind(this,null))}},created:function(){this.$store.dispatch("fetchRooms"),this.checkRoute(this.$route)},beforeRouteUpdate(t,e,n){this.checkRoute(t),n()}},Te=(n(16),Object(ye.a)(Se,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"rooms-edit"},[n("h3",[t._v(t._s(t.strings.rooms_edit_site_name))]),t._v(" "),n("div",{staticClass:"description"},[t._v(t._s(t.strings.rooms_edit_site_description))]),t._v(" "),n("ul",{staticClass:"rooms-edit-list"},t._l(t.rooms,function(e){return n("li",[n("div",{staticClass:"room-top-level"},[t._v("\n "+t._s(e.name)+"\n "),n("router-link",{attrs:{to:{name:"room-edit",params:{roomId:e.id}}}},[n("i",{staticClass:"icon fa fa-cog fa-fw iconsmall",attrs:{title:t.strings.edit}})])],1)])}),0),t._v(" "),null!==t.rooms&&0==t.rooms.length?n("div",[t._v("\n "+t._s(t.strings.rooms_edit_no_rooms)+"\n ")]):t._e(),t._v(" "),n("div",{staticClass:"rooms-edit-add"},[n("router-link",{staticClass:"btn btn-primary",attrs:{to:{name:"room-new"},tag:"button"}},[t._v(t._s(t.strings.room_form_title_add))])],1)])},[],!1,null,"2ade5f8a",null).exports);n.d(e,"init",function(){return je});const Ee=()=>n.e(1).then(n.bind(null,21));function je(t,e){n.p=M.cfg.wwwroot+"/mod/vuejsdemo/amd/build/",r.a.use(Dt),ve.commit("setCourseModuleID",t),ve.commit("setContextID",e),ve.dispatch("loadComponentStrings");const o=[{path:"/",redirect:{name:"rooms-edit-overview"}},{path:"/rooms/edit",component:Te,name:"rooms-edit-overview",meta:{title:"rooms_edit_site_name"},children:[{path:"/rooms/edit/:roomId(\\d+)",component:Te,name:"room-edit",meta:{title:"room_form_title_edit"}},{path:"/rooms/edit/new",component:Te,name:"room-new",meta:{title:"room_form_title_add"}}]},{path:"/lazy-loading",component:Ee},{path:"*",component:ge,meta:{title:"route_not_found"}}],i=window.location.pathname,a=i.substr(0,i.indexOf(".php"))+".php/"+t+"/",s=new Dt({mode:"history",routes:o,base:a});s.beforeEach((t,e,n)=>{t.hasOwnProperty("meta")&&t.meta.hasOwnProperty("title")&&ve.state.strings.hasOwnProperty(t.meta.title)&&(document.title=ve.state.strings[t.meta.title]),n()}),new r.a({el:"#mod-vuejsdemo-app",store:ve,router:s})}},function(t,e,n){"use strict";function r(t,e){for(var n=[],r={},o=0;on.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(o=0;o